/* Isolated V16 refinement: existing behavior and permission contracts stay upstream. */
html { scroll-padding-top: 88px; }
body { font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
:root { --hydev-radius: 18px; }
:focus-visible { outline: 3px solid var(--hydev-focus) !important; outline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button, .btn, .nav a { min-height: 40px; }
input, select, textarea { max-width: 100%; min-width: 0; }
.card, .hd-surface, .stat-card { border-radius: 18px; }
.card.chroma::before { animation: none; opacity: .28; }
.hero { background: radial-gradient(ellipse at 95% 0%,color-mix(in srgb,var(--hydev-violet) 19%,transparent),transparent 65%),var(--hydev-panel) !important; }
.hero h1, .hd-page-title { letter-spacing: -.045em; line-height: 1.12; }
.eyebrow, .hd-kicker { color: var(--hydev-violet); font-size: 11px; letter-spacing: .13em; }
.sub, .tiny, .stat .k, .pill, .table, .field label { font-size: max(12px, .75rem); }
.nav a.active, .sidebar-item.active { box-shadow: inset 3px 0 var(--hydev-cyan); }
.nav a, .sidebar-item { transition: background .15s; }
.table th, th { text-align: left; font-size: 12px; }
.table td, td { line-height: 1.6; }
.table tbody tr:hover, tbody tr:focus-within { background: var(--hydev-hover); }
.project-card-next, .project-next, .hd-approval-card { border-left: 3px solid var(--hydev-violet); }
.activity article, .hd-task-row { padding-top: 12px; padding-bottom: 12px; }
.empty { line-height: 1.7; padding: 32px 20px; }
.lane-tools { position: relative; z-index: 25; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 18px; border-bottom: 1px solid var(--hydev-line); background: var(--hydev-surface); }
.lane-tools .lane-version { margin-right: auto; font: 600 11px ui-monospace,monospace; letter-spacing: .12em; color: var(--hydev-muted); }
.lane-tools #hydev-theme-toggle { position: static !important; transform: none !important; margin: 0 !important; width: auto !important; height: 40px !important; }
.lane-dialog { width: min(460px,calc(100% - 24px)); max-height: 85dvh; overflow: auto; border: 1px solid var(--hydev-line); border-radius: 20px; padding: 24px; color: var(--hydev-text); background: var(--hydev-panel-strong); box-shadow: var(--hydev-shadow); }
.lane-dialog::backdrop { background: #02040abb; backdrop-filter: blur(6px); }
.lane-dialog p { line-height: 1.6; overflow-wrap: anywhere; }
.lane-dialog .row { margin-top: 18px; }
.lane-selection { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--hydev-line); background: var(--hydev-surface-soft); }
.lane-selection label { display: flex; align-items: center; gap: 8px; }
.lane-select { min-width: 20px; min-height: 20px; }
tr:has(.lane-select:checked) { background: color-mix(in srgb,var(--hydev-violet) 12%,var(--hydev-surface)); }
.lane-skip { position: fixed; top: -100px; left: 12px; z-index: 10000; background: var(--hydev-panel-strong); padding: 14px; }
.lane-skip:focus { top: 12px; }
.tablewrap, .table-wrap, .hd-table-shell { max-width: 100%; overflow-x: auto; }
@media(max-width:980px) {
 .side { display: block; position: static; height: auto; padding: 12px; border-right: 0; }
 .side .brand, .side-foot { display: none; }
 .side .nav { display: flex; overflow-x: auto; padding-bottom: 4px; }
 .side .nav a { flex: 0 0 auto; white-space: nowrap; }
 .shell { grid-template-columns: minmax(0,1fr); }
}
@media(max-width:600px) {
 .top { height: auto; min-height: 64px; padding: 12px; flex-wrap: wrap; position: relative; }
 .top .title { flex-basis: 100%; }
 .content, .portal { padding: 12px; }
 .hero { padding: 22px 16px; }
 .project-grid, .detail-grid, .overview-two-col, .g2, .g3, .g4 { grid-template-columns: minmax(0,1fr) !important; }
 .attention-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .drawer.open { padding: 8px; }
 .drawer-panel { padding: 14px; height: calc(100dvh - 16px); border-radius: 16px; }
 .client-details-grid, .asset-upload, .color-grid { grid-template-columns: minmax(0,1fr); }
 .roadmap { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .lane-tools { padding: 8px 12px; }
 .lane-tools .lane-version { font-size: 10px; }
 .lane-tools .hydev-theme-label { display: inline !important; }
 .lane-tools .btn { padding: 8px; font-size: 12px; }
 .health { grid-template-columns: minmax(0,1fr); }
 .login { padding: 16px; min-height: calc(100dvh - 60px); }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
/* Contain the original admin stylesheet's global flex/overflow rules. */
html { height: auto; min-height: 100%; }
body { display: block; width: 100%; height: auto; min-height: 100dvh; margin: 0; overflow: visible; }
.lane-tools #hydev-theme-toggle { display: inline-flex !important; padding: 8px 12px !important; }
body:has(#admin-main) { display: grid; grid-template-columns: 220px minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); height: 100dvh; overflow: hidden; }
body:has(#admin-main) > .lane-tools { grid-column: 1 / -1; }
#admin-sidebar { grid-row: 2; grid-column: 1; min-height: 0; overflow-y: auto; }
#admin-main { grid-row: 2; grid-column: 2; min-width: 0; min-height: 0; height: auto; }
body:has(#hd-shell) { height: 100dvh; overflow: hidden; }
body:has(#hd-shell) .hd-shell { height: calc(100dvh - 61px) !important; }
body:has(.header) > .lane-tools { margin-top: 60px; }
@media(max-width:900px) {
 body:has(#admin-main) { display: block; height: auto; overflow: visible; }
 #admin-main { height: auto; overflow: visible; }
 #admin-content { overflow: visible; }
 #admin-sidebar:not(.hy-drawer) { display: flex; flex-direction: row; width: 100%; height: auto; overflow-x: auto; padding: 8px; }
 #admin-sidebar:not(.hy-drawer) .sidebar-item { flex: 0 0 auto; white-space: nowrap; }
 #admin-sidebar:not(.hy-drawer) #admin-logo, #admin-sidebar:not(.hy-drawer) .sidebar-section { display: none; }
 #admin-sidebar:not(.hy-drawer) #sidebar-back { flex: 0 0 auto; margin: 0; }
}

/* Keep six operations KPI cards within the center column at tablet landscape widths. */
@media (min-width:901px) and (max-width:1190px) {
 body:has(.ops-wrap) .attention-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
/* Preserve HTML hidden semantics despite legacy broad .btn display rules. */
#lane-logout[hidden] { display: none !important; }
