/* ADManager — design tokens ------------------------------------------------ */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f0f3f9;
  --border: #e2e7f0;
  --text: #182033;
  --text-2: #5b6579;
  --text-3: #8a93a6;
  --primary: #3159d8;
  --primary-hover: #2847b5;
  --primary-soft: #e8eefc;
  --on-primary: #ffffff;
  --success: #12804a;
  --success-soft: #e3f5ec;
  --warning: #9a5b00;
  --warning-soft: #fdf1dc;
  --danger: #c4312b;
  --danger-soft: #fce8e7;
  --info: #2a6bb8;
  --info-soft: #e6f0fb;
  --sidebar: #0f1729;
  --sidebar-text: #a9b4cc;
  --sidebar-active: #ffffff;
  --sidebar-hover: #1b2540;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .07);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, .12);
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  --mono: "Cascadia Code", ui-monospace, Consolas, "SFMono-Regular", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120; --surface: #121a2c; --surface-2: #18223a; --border: #243049;
    --text: #e6eaf3; --text-2: #a4aec3; --text-3: #6f7a92;
    --primary: #6b8cff; --primary-hover: #8aa4ff; --primary-soft: #1c2a52; --on-primary: #0b1120;
    --success: #4cc68a; --success-soft: #11301f; --warning: #f0b14a; --warning-soft: #352710;
    --danger: #ff7b72; --danger-soft: #3a1717; --info: #6aaef5; --info-soft: #132a45;
    --sidebar: #080d18; --sidebar-hover: #141d33;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1120; --surface: #121a2c; --surface-2: #18223a; --border: #243049;
  --text: #e6eaf3; --text-2: #a4aec3; --text-3: #6f7a92;
  --primary: #6b8cff; --primary-hover: #8aa4ff; --primary-soft: #1c2a52; --on-primary: #0b1120;
  --success: #4cc68a; --success-soft: #11301f; --warning: #f0b14a; --warning-soft: #352710;
  --danger: #ff7b72; --danger-soft: #3a1717; --info: #6aaef5; --info-soft: #132a45;
  --sidebar: #080d18; --sidebar-hover: #141d33;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* Base ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14.5px/1.55 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; }
p { margin: 0 0 12px; }
code, .mono { font-family: var(--mono); font-size: .86em; word-break: break-all; }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
     stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
.i.lg { width: 22px; height: 22px; }
.i.xl { width: 40px; height: 40px; }
.muted { color: var(--text-2); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }

.demo-banner { background: var(--warning-soft); color: var(--warning); border-bottom: 1px solid var(--border);
               padding: 8px 16px; font-size: .85rem; text-align: center; }

/* App shell -------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-text); padding: 18px 12px; position: sticky; top: 0;
           height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 1.05rem;
         padding: 4px 10px 18px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
               background: linear-gradient(135deg, #4f7bff, #7c4dff); color: #fff; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #5f6b85;
             padding: 14px 12px 6px; font-weight: 600; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px;
            color: var(--sidebar-text); font-weight: 500; }
.nav-link:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--sidebar-hover); color: var(--sidebar-active);
                   box-shadow: inset 3px 0 0 #6b8cff; }
.sidebar-foot { margin-top: auto; padding: 12px 10px 0; font-size: .75rem; color: #56617a; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 10px 28px;
          background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px);
          border-bottom: 1px solid var(--border); min-height: 60px; }
.topbar .spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 999px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
          background: var(--primary-soft); color: var(--primary); font-size: .85rem; }
.user-chip .who { line-height: 1.2; }
.user-chip .who small { display: block; color: var(--text-2); font-size: .75rem; }
.content { padding: 28px; max-width: 1240px; width: 100%; }
.nav-toggle, .nav-toggle-btn { display: none; }

/* Page header ------------------------------------------------------------ */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--text-2); }
.breadcrumb { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: .85rem; margin-bottom: 6px; }

/* Cards ------------------------------------------------------------------ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
        box-shadow: var(--shadow); margin-bottom: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px;
             border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }
.card-body > :last-child { margin-bottom: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; margin-bottom: 8px; }
.row.between { justify-content: space-between; }
.mt { margin-top: 16px; }
.mb0 { margin-bottom: 0; }

/* Profile header --------------------------------------------------------- */
.profile { display: flex; gap: 18px; align-items: center; }
.profile .avatar { width: 56px; height: 56px; font-size: 1.2rem; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 10px 16px; margin: 0; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Forms ------------------------------------------------------------------ */
label { display: block; font-weight: 550; font-size: .88rem; margin-bottom: 14px; }
label .hint { display: block; font-weight: 400; color: var(--text-2); font-size: .8rem; margin-top: 4px; }
input[type=text], input[type=password], input[type=search], input[type=date], input[type=number],
input:not([type]), select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 9px 12px; font: inherit; font-weight: 400;
  color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 84px; resize: vertical; font-family: var(--mono); font-size: .85rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
input:disabled { opacity: .55; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 450; cursor: pointer; }
.check input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--primary); }
.check .hint { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.input-group { position: relative; }
.input-group input { padding-right: 44px; }
.input-group .reveal { position: absolute; right: 6px; bottom: 5px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px 2px; margin: 0 0 16px; }
legend { padding: 0 6px; font-weight: 600; font-size: .85rem; color: var(--text-2); }
.confirm-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
               padding: 16px 16px 2px; margin-bottom: 16px; }
.confirm-box .title { display: flex; gap: 8px; align-items: center; font-weight: 600; margin-bottom: 10px; font-size: .9rem; }
.option-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 16px; }
.option-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0;
               cursor: pointer; display: flex; gap: 10px; align-items: flex-start; }
.option-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.option-card input { margin-top: 4px; accent-color: var(--primary); }
.option-card small { display: block; color: var(--text-2); font-weight: 400; }

/* Buttons ---------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px;
       border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text);
       font: inherit; font-weight: 550; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s;
       white-space: nowrap; line-height: 1.2; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { filter: brightness(.93); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 6px 11px; font-size: .85rem; }
.btn.block { width: 100%; }
.btn.icon { padding: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }
.inline-sm { display: inline-block; width: 220px; margin: 0; }

/* Badges ----------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px;
         font-size: .76rem; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.primary { background: var(--primary-soft); color: var(--primary); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }

/* Alerts ----------------------------------------------------------------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius-sm);
         margin-bottom: 16px; border: 1px solid transparent; }
.alert .i { margin-top: 2px; }
.alert .body { flex: 1; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.alert.success { background: var(--success-soft); color: var(--success); }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.warn, .alert.warning { background: var(--warning-soft); color: var(--warning); }
.alert.info { background: var(--info-soft); color: var(--info); }
.alert .close { background: none; border: 0; color: inherit; cursor: pointer; padding: 0; opacity: .7; }

/* Tables ----------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 600;
     background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
tr[data-href] { cursor: pointer; }
td .sub { display: block; color: var(--text-2); font-size: .82rem; }
.cell-user { display: flex; align-items: center; gap: 12px; }
.cell-user .avatar { width: 32px; height: 32px; font-size: .78rem; }
table.compact td { padding: 8px 14px; font-size: .86rem; }
.empty { text-align: center; padding: 40px 20px; color: var(--text-2); }
.empty .i { width: 36px; height: 36px; color: var(--text-3); margin-bottom: 8px; }

/* Toolbar / filters ------------------------------------------------------ */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.toolbar label { margin: 0; flex: 1 1 160px; }
.toolbar .grow { flex: 3 1 260px; }
.search-box { position: relative; flex: 1 1 320px; }
.search-box .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.search-box input { padding-left: 38px; margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--text-2); font-weight: 550;
       border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px;
         border-top: 1px solid var(--border); flex-wrap: wrap; }

/* Stats ------------------------------------------------------------------ */
.stat { padding: 16px 20px; }
.stat .label { color: var(--text-2); font-size: .8rem; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 1.15rem; font-weight: 650; margin-top: 4px; }

/* Secret / code ---------------------------------------------------------- */
.secret { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-family: var(--mono);
          font-size: 1.25rem; padding: 14px 16px; background: var(--surface-2); border: 1px dashed var(--border);
          border-radius: var(--radius-sm); margin-bottom: 16px; word-break: break-all; }
pre.json { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
           padding: 14px 16px; font-family: var(--mono); font-size: .82rem; overflow-x: auto; margin: 0; white-space: pre-wrap; }

/* Auth layout ------------------------------------------------------------ */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-aside { background: radial-gradient(1200px 600px at 10% 10%, #2a3f8f 0%, transparent 60%),
              linear-gradient(160deg, #0f1729 0%, #1a2550 100%); color: #dfe6f7; padding: 48px;
              display: flex; flex-direction: column; justify-content: space-between; }
.auth-aside h1 { font-size: 2rem; color: #fff; margin: 18px 0 10px; }
.auth-aside p { color: #b7c3e0; max-width: 460px; }
.auth-aside ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.auth-aside li { display: flex; gap: 12px; align-items: flex-start; color: #c9d3ec; }
.auth-aside li .i { color: #8fa8ff; margin-top: 2px; }
.auth-main { display: flex; flex-direction: column; justify-content: center; padding: 48px; }
.auth-card { width: 100%; max-width: 420px; margin: 0 auto; }
.auth-card.wide { max-width: 760px; }
.auth-card h2 { font-size: 1.4rem; margin-bottom: 6px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: .8rem; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.auth-links { display: flex; justify-content: space-between; margin-top: 18px; font-size: .88rem; }
.simple-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px;
              border-bottom: 1px solid var(--border); background: var(--surface); }
.simple-top .brand { color: var(--text); padding: 0; }
.simple-main { max-width: 760px; margin: 32px auto; padding: 0 16px; }

/* Timeline (audit) ------------------------------------------------------- */
.result-success { color: var(--success); }
.result-fail { color: var(--danger); }
.result-neutral { color: var(--text-2); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { color: var(--text-3); white-space: nowrap; font-size: .8rem; min-width: 128px; }

/* Dashboard charts (server-rendered, no JS or inline styles — CSP-safe) --- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-grid .stat .value { font-size: 1.5rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.panel-head h2 { font-size: .95rem; }

/* Horizontal bars: native <progress value max>, restyled (no inline width). */
.bar-list { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 124px 1fr 38px; align-items: center; gap: 10px; font-size: .85rem; }
.bar-row .label { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .value { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.bar-row progress { -webkit-appearance: none; -moz-appearance: none; appearance: none;
                     width: 100%; height: 10px; border: none; border-radius: 999px; background: var(--surface-2); }
.bar-row progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
.bar-row progress::-webkit-progress-value { background: var(--primary); border-radius: 999px; }
.bar-row progress::-moz-progress-bar { background: var(--primary); border-radius: 999px; }
.bar-row progress.success::-webkit-progress-value { background: var(--success); }
.bar-row progress.success::-moz-progress-bar { background: var(--success); }
.bar-row progress.danger::-webkit-progress-value { background: var(--danger); }
.bar-row progress.danger::-moz-progress-bar { background: var(--danger); }
.bar-row progress.muted::-webkit-progress-value { background: var(--text-3); }
.bar-row progress.muted::-moz-progress-bar { background: var(--text-3); }

/* Vertical trend bars: discrete 5%-step height classes (no inline height). */
.trend-chart { display: flex; align-items: flex-end; gap: 5px; height: 110px; padding-top: 8px;
               border-bottom: 1px solid var(--border); }
.trend-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; min-width: 0; }
.trend-col .fill { width: 100%; max-width: 26px; margin: 0 auto; background: var(--primary);
                    border-radius: 4px 4px 0 0; min-height: 2px; }
.trend-labels { display: flex; gap: 5px; margin-top: 6px; }
.trend-labels span { flex: 1; text-align: center; font-size: .65rem; color: var(--text-3); min-width: 0; }


/* Dialog (custom confirm/alert, replaces window.confirm/alert) ------------ */
dialog.adm-dialog { padding: 0; border: 1px solid var(--border); border-radius: var(--radius);
                    background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
                    max-width: 420px; width: calc(100% - 32px); }
dialog.adm-dialog::backdrop { background: rgba(10, 14, 26, .55); backdrop-filter: blur(2px); }
.adm-dialog-form { display: flex; flex-direction: column; gap: 14px; padding: 22px; }
.adm-dialog-icon .i { color: var(--info); }
dialog.adm-dialog.danger .adm-dialog-icon .i { color: var(--danger); }
.adm-dialog-title { margin: 0; font-size: 1.05rem; }
.adm-dialog-message { margin: 6px 0 0; color: var(--text-2); white-space: pre-line; }
.adm-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* OU tree ------------------------------------------------------------------ */
.ou-tree { list-style: none; margin: 0; padding: 0; }
.ou-tree .ou-children { list-style: none; margin: 6px 0 2px 21px; padding: 0 0 0 16px;
                        border-left: 1px dashed var(--border); }
.ou-node > summary { cursor: pointer; list-style: none; }
.ou-node > summary::-webkit-details-marker { display: none; }
.ou-node > summary::marker { content: ""; }
.ou-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); }
.ou-row:hover { background: var(--surface-2); }
.ou-row .chevron { color: var(--text-3); transition: transform .15s; flex: none; }
details.ou-node[open] > summary .ou-row .chevron { transform: rotate(90deg); }
.ou-row .ou-name { display: flex; align-items: center; gap: 8px; font-weight: 550; }
.ou-body { padding: 2px 10px 10px 38px; }
.ou-desc { margin: 0 0 8px; }
.ou-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.ou-empty { color: var(--text-2); font-size: .85rem; margin: 2px 0 8px; }

/* Responsive ------------------------------------------------------------- */
@media (max-width: 1080px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 20; transform: translateX(-100%);
             transition: transform .2s; }
  .nav-toggle:checked ~ .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .nav-toggle-btn { display: inline-flex; }
  .content { padding: 20px 16px; }
  .topbar { padding: 10px 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-main { padding: 32px 16px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 10px; }
  .user-chip .who { display: none; }
}

/* Discrete height steps for .trend-col .fill (no inline style, CSP-safe). */
.h-0 { height: 0%; } .h-5 { height: 5%; } .h-10 { height: 10%; } .h-15 { height: 15%; }
.h-20 { height: 20%; } .h-25 { height: 25%; } .h-30 { height: 30%; } .h-35 { height: 35%; }
.h-40 { height: 40%; } .h-45 { height: 45%; } .h-50 { height: 50%; } .h-55 { height: 55%; }
.h-60 { height: 60%; } .h-65 { height: 65%; } .h-70 { height: 70%; } .h-75 { height: 75%; }
.h-80 { height: 80%; } .h-85 { height: 85%; } .h-90 { height: 90%; } .h-95 { height: 95%; }
.h-100 { height: 100%; }
