/* AuthTool proportions, personalized for the VG MOD VIP owner workspace. */
:root {
  --background: #17181d;
  --surface: #202127;
  --surface-raised: #282a32;
  --nav: #202127;
  --text: #e7e6ef;
  --muted: #a4a5b5;
  --line: #363740;
  --brand: #ff874d;
  --brand-bright: #ffab6e;
  --brand-soft: #ff874d18;
  --gold: #e9bc75;
  --radius: 10px;
  --shadow: 0 3px 12px #0000001f;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
body { color: var(--text); background: var(--background); }
body[data-theme="dark"] { color-scheme: dark; }
body[data-theme="light"] {
  color-scheme: light;
  --background: #f4f5fa;
  --surface: #fff;
  --surface-raised: #f3f3f7;
  --nav: #fff;
  --text: #444356;
  --muted: #77768a;
  --line: #e7e7ee;
  --brand: #db6834;
  --brand-bright: #f08b53;
  --brand-soft: #ff874d14;
  --shadow: 0 3px 12px #34334c0b;
}
svg { display: inline-block; width: 20px; height: 20px; flex: none; vertical-align: middle; }
button, a, input, select, textarea, summary { touch-action: manipulation; }
button, input, select, textarea { color: inherit; }
.app-shell { min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: 260px; background: var(--nav); border-right: 0;
  box-shadow: 3px 0 12px #0000000a;
  scrollbar-color: var(--line) transparent;
}
.sidebar .brand { gap: 10px; height: 76px; padding: 20px 22px; color: var(--text); }
.sidebar .brand img { width: 36px; height: 36px; border-radius: 8px; box-shadow: none; }
.sidebar .brand > span { font-size: 21px; font-weight: 750; letter-spacing: -.6px; }
.sidebar .brand em { color: var(--gold); font-size: 11px; }
.sidebar nav { padding: 0 14px 16px 0; }
.nav-heading, .nav-heading.secondary {
  display: flex; align-items: center; gap: 12px; margin: 20px 0 12px;
  padding: 0 22px; color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: .4px;
}
.nav-heading:first-child { margin-top: 8px; }
.nav-heading.secondary::before { content: ""; width: 14px; height: 1px; background: var(--line); margin-left: -22px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; height: 42px; margin: 4px 0;
  padding: 0 18px 0 22px; border: 0; border-radius: 0 50px 50px 0;
  color: var(--text); font-size: 15px; font-weight: 400;
}
.nav-link svg { width: 22px; height: 22px; color: var(--muted); }
.nav-link:hover { color: var(--text); background: var(--surface-raised); }
.nav-link[aria-current="page"] {
  color: #fff; background: linear-gradient(98deg, #c85c36, #ff9857);
  box-shadow: 0 3px 8px #f2803826; font-weight: 500;
}
.nav-link[aria-current="page"]::before { display: none; }
.nav-link[aria-current="page"] svg { color: #fff; }
.nav-counter { font-size: 10px; color: inherit; border: 0; background: #ffffff1f; }
.sidebar-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding: 12px 16px 12px 22px; }
.owner-label { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.owner-label .status-dot { background: var(--gold); }
.app-content { margin-left: 260px; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center;
  height: 64px; min-height: 64px; gap: 12px; padding: 0 13px;
  border: 0; background: var(--background); backdrop-filter: none;
}
.topbar-left, .topbar-right { gap: 0; }
.topbar-left { gap: 12px; }
.topbar-right { margin-left: auto; }
.icon-button, .topbar .icon-button { width: 40px; height: 40px; min-width: 40px; min-height: 40px; border: 0; border-radius: 50%; color: var(--muted); }
.icon-button svg, .topbar .icon-button svg { width: 22px; height: 22px; }
.icon-button:hover { color: var(--brand); background: var(--brand-soft); border-color: transparent; }
.mobile-menu { display: none; }
.vg-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 24px; padding: 0 8px; border-radius: 5px; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 700; letter-spacing: .5px; }
.topbar .user-avatar { width: 36px; height: 36px; min-width: 36px; border: 0; border-radius: 50%; background: url('/assets/vgmod-icon-192.png') center / cover; font-size: 0; box-shadow: 0 0 0 2px var(--surface); }
.account-button { position: relative; margin-left: 6px; }
.account-button::after { content: ""; position: absolute; right: 2px; bottom: 3px; width: 9px; height: 9px; border: 2px solid var(--background); border-radius: 50%; background: #6ac69b; }
.theme-moon, body[data-theme="light"] .theme-sun { display: none; }
body[data-theme="light"] .theme-moon { display: inline-block; }
main { width: 100%; max-width: none; margin: 0; padding: 24px; }
.page-heading { display: none; }
.app-footer { padding: 18px 24px; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.nav-scrim { background: #0b0b1499; backdrop-filter: none; }
.panel, .stat-card { background: var(--surface); border: 0; border-radius: 10px; box-shadow: var(--shadow); }
.panel-head { padding: 20px; }
.panel-head h2, .reference-card-head h2 { color: var(--text); font-size: 20px; font-weight: 500; letter-spacing: 0; line-height: 1.4; }
.panel-head p, .reference-card-head p { margin-top: 5px; color: var(--muted); font-size: 14px; }
.reference-card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 20px; }
.reference-card-head { min-height: 72px; }
.reference-actions .button { height: 38px; border-radius: 8px; font-size: 14px; padding: 8px 18px; background: var(--brand); border-color: var(--brand); color: #25150e; }
.reference-actions [data-action="create-key"] { width: 145px; }
.reference-actions [data-action="create-static"] { width: 172px; }
.reference-actions [data-action="manage-aliases"] { width: 180px; }
.reference-actions [data-action="delete-expired"] { width: 214px; }
.reference-actions [data-action="bulk-keys"] { width: 233px; }
.reference-actions [data-action="change-package"] { width: 167px; }
.reference-actions [data-action="delete-filtered"] { width: 203px; }
.reference-actions [data-action="delete-expired"], .reference-actions [data-action="delete-filtered"] { background: #ee5258; border-color: #ee5258; color: white; }
.reference-card-head > div { min-width: 0; }
.reference-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 20px 20px 12px; }
.reference-card-head + .reference-actions { padding-top: 0; }
.reference-filters { display: block; margin: 0 20px 20px; padding: 8px 0 4px; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.reference-filters > summary { list-style: none; position: relative; min-height: 32px; display: flex; align-items: center; }
.reference-filters > summary::-webkit-details-marker { display: none; }
.reference-filters > summary::after { content: '⌄'; display: grid; place-items: center; margin-left: auto; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #25150e; font-size: 20px; }
.reference-filters[open] > summary::after { transform: rotate(180deg); }
.table-tools:has(#selection-count:only-child) { padding: 0 20px; border: 0; }
.table-tools #selection-count { font-size: 12px; color: var(--muted); }
.grid-toolbar .search-field input { border-width: 0 0 1px; border-radius: 0; }
.reference-filters > summary { cursor: pointer; margin-bottom: 16px; color: var(--text); font-size: 14px; }
.reference-filters:not([open]) > summary { margin-bottom: 0; }
.reference-filters .form-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px 16px; width: 100%; }
@media (max-width: 650px) { .reference-filters .form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 420px) { .reference-filters .form-grid { grid-template-columns: minmax(0,1fr); } }
.reference-filters .field { flex: 1 1 180px; min-width: 0; margin: 0; }
.reference-filters > label { display: flex; flex: 1 1 180px; flex-direction: column; gap: 8px; min-width: 0; color: var(--muted); font-size: 13px; }
.button { min-height: 38px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-raised); color: var(--text); font-size: 13px; font-weight: 500; letter-spacing: .2px; box-shadow: none; }
.button svg { width: 18px; height: 18px; }
.button:hover { background: var(--surface-raised); border-color: var(--muted); }
.button.primary { background: var(--brand); border-color: var(--brand); color: #25150e; box-shadow: 0 2px 6px #ff874d26; }
.button.primary:hover { background: var(--brand-bright); border-color: var(--brand-bright); }
.button.soft { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.button.small { min-height: 32px; font-size: 12px; }
.link-button { color: var(--brand); font-size: 13px; }
input, select, textarea { min-height: 48px; padding: 11px 14px; border: 1px solid #51515e; border-radius: 6px; background: transparent; color: var(--text); font-size: 14px; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input[readonly] { color: var(--muted); background: var(--surface-raised); }
select option { background: var(--surface); color: var(--text); }
.field > label, .modal .field > label, .settings-body .field > label, .api-body .field > label { color: var(--text); font-size: 13px; font-weight: 400; }
.field > small { color: var(--muted); font-size: 12px; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 18px; margin: 0; padding: 0; accent-color: var(--brand); flex: none; vertical-align: middle; cursor: pointer; }
.grid-toolbar, .table-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 20px 20px; }
.grid-toolbar .search-field { flex: 0 1 240px; min-width: 180px; max-width: 280px; margin-left: auto; }
.grid-toolbar > input[type="search"] { width: 240px; margin-left: auto; min-height: 40px; }
.grid-toolbar .button { padding-inline: 10px; background: transparent; border-color: transparent; color: var(--muted); }
.grid-toolbar .button:hover { color: var(--brand); background: var(--brand-soft); }
.grid-toolbar { align-items: flex-start; gap: 0; padding: 0 8px 14px; }
.grid-toolbar .button { min-height: 30px; height: 30px; padding: 4px 9px; font-size: 14px; }
.grid-toolbar .search-field { flex-basis: 260px; }
.grid-toolbar .search-field input { min-height: 30px; height: 30px; padding: 4px 8px 4px 32px; }
.grid-toolbar .search-field svg { top: 5px; left: 8px; }
.table-tools { border-bottom: 1px solid var(--line); }
.table-tools select { width: auto; max-width: 220px; min-height: 38px; font-size: 13px; padding-block: 6px; }
.selection-count { margin-right: auto; color: var(--muted); font-size: 13px; }
.table-toolbar { padding: 16px 20px; }
.toolbar-left, .toolbar-right { flex-wrap: wrap; }
.search-field { min-width: 180px; }
.search-field svg { width: 20px; height: 20px; top: 11px; left: 12px; color: var(--muted); }
.search-field input { height: 42px; min-height: 42px; padding: 9px 12px 9px 40px; background: transparent; border-color: var(--line); font-size: 14px; }
.toolbar-select { background: transparent; border-color: var(--line); color: var(--text); font-size: 13px; }
.table-info-label { color: var(--muted); font-size: 13px; }
.table-panel { overflow: visible; }
.table-wrap { overflow: auto; scrollbar-color: var(--line) transparent; }
.reference-table, .data-table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
.reference-table th, .data-table th { height: 56px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface-raised); color: var(--text); font-size: 13px; font-weight: 500; letter-spacing: .4px; }
.reference-table td, .data-table td { height: 52px; padding: 10px 20px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.reference-table th:first-child, .reference-table td:first-child, .data-table th:first-child, .data-table td:first-child { padding-left: 20px; }
.reference-table strong, .data-table strong { color: var(--text); font-size: 14px; font-weight: 500; }
.reference-table tbody tr:hover, .data-table tbody tr:hover { background: var(--brand-soft); }
.reference-table tr:last-child td { border-bottom: 0; }
.reference-table .selection-cell, .data-table .selection-cell { width: 50px; }
.table-customer { max-width: 250px; }
.table-customer strong { font-size: 14px; }
.table-customer small, .application-version, .expiry-cell small { color: var(--muted); font-size: 12px; }
.application-label, .device-count, .expiry-cell { color: var(--text); font-size: 14px; }
.key-cell code, .package-slug { color: var(--gold); font-size: 13px; }
.table-pagination { justify-content: flex-end; flex-wrap: wrap; gap: 20px; min-height: 64px; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.table-pagination select { width: auto; min-height: 32px; border: 0; padding-block: 4px; font-size: 13px; }
.pagination-controls { gap: 4px; }
.pagination-controls .icon-button { width: 32px; height: 32px; min-width: 32px; min-height: 32px; border: 0; }
.pagination-controls span { color: var(--brand); border: 0; background: var(--brand-soft); }
.badge { padding: 4px 8px; border: 0; border-radius: 5px; font-size: 12px; font-weight: 500; }
.badge.active { color: #70cfab; background: #67cda41c; }
.badge.waiting { color: #9ebcff; background: #7899e91c; }
.badge.expired { color: #f48d9a; background: #f48d9a1c; }
.badge.blocked { color: #c5a2ec; background: #c5a2ec1c; }
.badge.amber { color: var(--gold); background: #e9bc751c; }
.badge.neutral { color: var(--muted); background: var(--surface-raised); }
.filter-tabs { padding: 0 20px; background: transparent; }
.filter-tab { padding: 14px 12px; color: var(--muted); font-size: 14px; }
.filter-tab.selected { color: var(--brand); border-bottom-color: var(--brand); }
.filter-tab:hover { color: var(--brand); }
.row-actions { gap: 0; }
.row-actions .icon-button { width: 32px; height: 32px; min-width: 32px; min-height: 32px; }
.row-actions .icon-button svg { width: 20px; height: 20px; }
.row-menu, .column-menu { position: relative; }
.row-menu summary, .column-menu summary { list-style: none; cursor: pointer; }
.row-menu summary::-webkit-details-marker, .column-menu summary::-webkit-details-marker { display: none; }
.row-menu > div, .row-menu > ul, .column-menu > div { position: absolute; top: calc(100% + 5px); right: 0; z-index: 30; min-width: 190px; margin: 0; padding: 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: 0 6px 24px #0003; list-style: none; }
.row-menu button, .row-menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 4px; background: transparent; color: var(--text); text-align: left; font-size: 13px; white-space: nowrap; }
.row-menu button:hover, .row-menu a:hover { background: var(--brand-soft); color: var(--brand); }
.row-menu button.danger { color: var(--danger); }
.license-actions-header { display: flex; align-items: center; gap: 8px; }
.license-actions-header summary[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.selected-menu-count { padding: 8px 12px; margin: 0; color: var(--muted); font-size: 12px; letter-spacing: 0; }
.license-table th:last-child, .license-table td:last-child:not([colspan]) { position: sticky; right: 0; background: var(--surface); box-shadow: -5px 0 10px #0001; }
.license-table th:last-child { z-index: 3; background: var(--surface-raised); }
.license-table td:last-child:not([colspan]) { z-index: 2; }
.row-menu > div:popover-open { position: fixed; position-anchor: none; position-area: none; inset: auto; margin: 0; max-height: calc(100dvh - 16px); overflow-y: auto; color: var(--text); }
.column-menu label { display: flex; align-items: center; gap: 10px; padding: 8px; color: var(--text); font-size: 13px; white-space: nowrap; }
@supports (position-area: bottom) {
  .row-menu > div, .row-menu > ul { position: fixed; position-anchor: --row-menu; position-area: bottom span-left; inset: auto; }
  .row-menu[open] > summary { anchor-name: --row-menu; }
}
.reference-dashboard { display: grid; gap: 24px; }
.stats-grid, .reference-dashboard .stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-bottom: 24px; }
.reference-dashboard .stats-grid { margin-bottom: 0; }
.stat-card { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding: 20px; }
.stat-top { display: contents; }
.stat-top > span { order: 2; color: var(--muted); font-size: 14px; }
.stat-icon { order: 0; width: 42px; height: 42px; margin-bottom: 12px; border: 0; border-radius: 7px; color: var(--brand); background: var(--brand-soft); }
.stat-icon svg { width: 24px; height: 24px; }
.stat-card > svg { width: 24px; height: 24px; margin-bottom: 12px; color: var(--brand); }
.stat-value { order: 1; margin: 0 0 4px; color: var(--text); font-size: 28px; line-height: 1.3; font-weight: 500; letter-spacing: 0; }
.stat-card h3 { order: 2; color: var(--muted); font-size: 14px; font-weight: 400; }
.stat-detail { order: 3; margin-top: 8px; color: var(--muted); font-size: 12px; }
.dashboard-grid, .dashboard-grid.dashboard-lower { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.dashboard-lower { margin-top: 24px; }
.reference-dashboard .dashboard-lower { margin-top: 0; }
.activity-list { display: block; padding: 0 20px 12px; }
.activity-item { padding: 14px 0; border-color: var(--line); }
.activity-main strong, .summary-row strong, .expiring-row strong { color: var(--text); font-size: 14px; }
.activity-main p, .activity-time, .expiring-row small { color: var(--muted); font-size: 12px; }
.summary-row { color: var(--muted); font-size: 14px; }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .chart-grid { stroke: var(--line); }
.chart-bottom { color: var(--muted); font-size: 12px; }
.chart-bottom strong { color: var(--gold); font-size: 13px; }
.empty-state { padding: 48px 24px; }
.empty-state h3, .empty-state.compact h3 { color: var(--text); font-size: 16px; }
.empty-state p, .empty-state.compact p { color: var(--muted); font-size: 14px; }
.table-footnote, .customer-note { margin: 16px 0; color: var(--muted); font-size: 13px; }
.modal { width: 600px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 48px); margin: auto; padding: 0; border: 0; border-radius: 10px; background: var(--surface); color: var(--text); box-shadow: 0 20px 70px #0006; }
.modal::backdrop { background: #0b0b1473; backdrop-filter: none; }
.modal-head { padding: 24px 24px 20px; border: 0; background: transparent; }
.modal-head h2 { color: var(--text); font-size: 24px; font-weight: 500; line-height: 1.4; letter-spacing: 0; }
.modal-head p { margin-top: 8px; color: var(--muted); font-size: 14px; }
.modal-head .icon-button { margin: -8px -8px 0 0; }
.modal-body { padding: 0 24px 8px; }
.modal .field { margin-bottom: 20px; }
.modal-footer { padding: 16px 24px 24px; gap: 12px; border: 0; background: transparent; }
.modal-error { padding: 0 24px; }
.manual-copy-panel { padding: 16px 24px; border-top: 1px solid var(--line); }
.manual-copy-panel textarea { font-family: "Cascadia Code", Consolas, monospace; overflow-wrap: anywhere; }
.modal input, .modal select, .modal textarea { min-height: 48px; font-size: 14px; }
.modal input[type="checkbox"], .modal input[type="radio"] { min-height: 18px; }
.confirm-message { color: var(--text); font-size: 14px; }
.settings-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.settings-tabs button, .settings-tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 18px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 14px; }
.settings-tabs .active, .settings-tabs .selected, .settings-tabs [aria-selected="true"] { color: #25150e; background: var(--brand); box-shadow: 0 2px 6px #ff874d26; }
.settings-grid, .api-grid { gap: 24px; }
.settings-body, .api-body { padding: 0 20px 20px; }
.settings-body input, .api-body input { font-size: 14px; }
.settings-body .button { font-size: 13px; }
.settings-note, .api-step p, .api-step strong, .api-side-note { color: var(--muted); font-size: 14px; }
.api-step strong, .api-endpoint { color: var(--text); }
.code-block { border-color: var(--line); background: var(--background); color: var(--gold); font-size: 12px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-size: 14px; cursor: pointer; }
.switch input { width: 38px; height: 22px; min-height: 22px; margin: 0; padding: 0; border: 0; border-radius: 20px; appearance: none; background: var(--line); transition: background .15s; }
.switch input::before { content: ""; display: block; width: 16px; height: 16px; margin: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0003; transition: transform .15s; }
.switch input:checked { background: var(--brand); }
.switch input:checked::before { transform: translateX(16px); }
.switch input:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.switch input + .switch-track { display: none; }
.notice-banner, .local-note, .field-help { border-color: var(--line); background: var(--surface-raised); color: var(--muted); font-size: 13px; }
.notice-banner strong, .local-note strong, .local-note a { color: var(--text); }
.toast { border-color: var(--line); background: var(--surface); color: var(--text); font-size: 14px; }
.page-loading, .table-skeleton { color: var(--muted); font-size: 14px; }
body[data-theme="light"] input, body[data-theme="light"] select, body[data-theme="light"] textarea { border-color: #d4d3de; }
body[data-theme="light"] .badge.active { color: #238a62; }
body[data-theme="light"] .badge.waiting { color: #476cbe; }
body[data-theme="light"] .badge.expired { color: #cc4d61; }
body[data-theme="light"] .badge.blocked { color: #8256b5; }
body[data-theme="light"] .badge.amber { color: #9d6a20; }
/* Keep the existing artwork and sign-in composition from fire-theme.css. */
.auth-shell { color-scheme: dark; color: #e7e6ef; }
.auth-shell input { color: #e7e6ef; border-color: #51515e; }
.auth-shell .field > label { color: #ded8e1; }
.auth-shell .icon-button { color: #b3afbf; }
.auth-shell .button { font-size: 14px; }
@media (max-width: 1199px) {
  .sidebar { width: 260px; transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility .2s; }
  .app-shell.nav-open .sidebar { transform: translateX(0); visibility: visible; }
  .app-content { margin-left: 0; }
  .mobile-menu { display: inline-flex; }
}
@media (min-width: 1200px) {
  .sidebar { width: 260px; transform: none; visibility: visible; }
  .app-content { margin-left: 260px; }
  .nav-scrim { display: none; }
}
@media (max-width: 900px) {
  .stats-grid, .reference-dashboard .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid, .api-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .dashboard-grid, .dashboard-grid.dashboard-lower { grid-template-columns: minmax(0, 1fr); }
  .grid-toolbar { gap: 4px; }
  .grid-toolbar .search-field, .grid-toolbar > input[type="search"] { flex-basis: 100%; width: 100%; max-width: none; margin-top: 8px; }
  .reference-actions, .reference-card-head { gap: 8px; }
  .reference-filters { gap: 12px; }
  .table-pagination { gap: 12px; }
  .modal { max-height: calc(100dvh - 24px); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-two { grid-column: auto; }
  .settings-tabs { gap: 4px; }
  .settings-tabs button, .settings-tabs a { padding-inline: 12px; }
}
@media (max-width: 420px) {
  .topbar-left { gap: 6px; }
  .global-search { display: none; }
  .stats-grid, .reference-dashboard .stats-grid { gap: 12px; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 26px; }
  .stat-top > span { font-size: 13px; }
  .reference-actions .button { flex-grow: 1; }
  .table-pagination { padding-inline: 12px; font-size: 12px; }
  .modal-head, .modal-footer { padding-inline: 20px; }
  .modal-body, .modal-error { padding-inline: 20px; }
}
