
:root {
  color-scheme: light;
  --page: #fafbfc;
  --canvas: #f2f4f7;
  --surface: #ffffff;
  --inset: #f7f8fa;
  --hover: #f3f5f7;
  --hover-2: #eceff3;
  --ink: #20242a;
  --ink-2: #66707d;
  --ink-3: #9aa3af;
  --line: #e8ebef;
  --line-strong: #d9dee5;
  --field: #f7f8fa;
  --accent: #3979e8;
  --accent-ink: #245fbf;
  --accent-tint: #edf4ff;
  --green: #23845a;
  --green-tint: #edf8f2;
  --orange: #b56c15;
  --orange-tint: #fff6e8;
  --red: #c74949;
  --red-tint: #fff0f0;
  --shadow-hairline: 0 0 0 1px var(--line);
  --shadow-btn: 0 0 0 1px var(--line-strong), 0 1px 2px rgba(16,24,40,.05);
  --shadow-card: 0 0 0 1px var(--line), 0 1px 2px rgba(16,24,40,.05), 0 6px 20px rgba(16,24,40,.025);
  --shadow-raised: 0 0 0 1px var(--line), 0 3px 12px rgba(16,24,40,.08);
  --shadow-overlay: 0 0 0 1px var(--line-strong), 0 10px 34px rgba(16,24,40,.14);
  --shadow-inset: inset 0 1px 2px rgba(16,24,40,.08);
  --radius-chip: 6px;
  --radius-control: 8px;
  --radius-card: 10px;
  --radius-window: 14px;
  --ease-out-strong: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out-strong: cubic-bezier(0.77, 0, 0.175, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #1d2026;
  --canvas: #20242a;
  --surface: #272b32;
  --inset: #23272d;
  --hover: #2c3138;
  --hover-2: #333941;
  --ink: #f1f3f5;
  --ink-2: #b1bac5;
  --ink-3: #7e8895;
  --line: #353a42;
  --line-strong: #424852;
  --field: #2a2f36;
  --accent: #5b96f2;
  --accent-ink: #9dc3ff;
  --accent-tint: rgba(91,150,242,.15);
  --green: #72c69a;
  --green-tint: rgba(114,198,154,.13);
  --orange: #e3ad64;
  --orange-tint: rgba(227,173,100,.13);
  --red: #ef8888;
  --red-tint: rgba(239,136,136,.13);
  --shadow-hairline: 0 0 0 1px var(--line);
  --shadow-btn: 0 0 0 1px rgba(255,255,255,.09), 0 1px 2px rgba(0,0,0,.3);
  --shadow-card: 0 0 0 1px rgba(255,255,255,.09), 0 1px 2px rgba(0,0,0,.18), 0 5px 18px rgba(0,0,0,.12);
  --shadow-raised: 0 0 0 1px rgba(255,255,255,.11), 0 4px 16px rgba(0,0,0,.22);
  --shadow-overlay: 0 0 0 1px rgba(255,255,255,.13), 0 10px 36px rgba(0,0,0,.34);
  --shadow-inset: inset 0 1px 2px rgba(0,0,0,.4);
}


* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: -0.01em;
  line-height: 1.5;
}
button, input, select { font: inherit; }
button, a, label:has(input) { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; }
::selection { background: var(--accent-tint); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible, select:focus-visible { outline: none; }

.icon { width: 17px; height: 17px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 14px; height: 14px; }
.icon.lg { width: 20px; height: 20px; }

.ui-btn {
  appearance: none; border: 0; height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 0 10px; border-radius: var(--radius-control); background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow-btn);
  font-size: 12.5px; font-weight: 550; white-space: nowrap; transition: background-color 140ms var(--ease-out-strong), color 140ms var(--ease-out-strong), transform 140ms var(--ease-out-strong), box-shadow 140ms var(--ease-out-strong);
}
.ui-btn:hover { background: var(--hover); color: var(--ink); }
.ui-btn:active { transform: scale(.97); }
.ui-btn.primary { background: var(--accent); color: white; box-shadow: none; }
.ui-btn.primary:hover { filter: saturate(.92) brightness(1.03); }
.ui-btn.danger { color: var(--red); background: var(--red-tint); box-shadow: 0 0 0 1px color-mix(in srgb, var(--red) 25%, transparent); }
.ui-btn.danger:hover { background: color-mix(in srgb, var(--red) 14%, var(--surface)); }
.ui-btn.ghost { box-shadow: none; background: transparent; }
.ui-btn.icon-only { width: 32px; padding: 0; }
.ui-btn.pill { border-radius: 999px; }

.ui-field {
  width: 100%; height: 38px; border: 1px solid var(--line-strong); border-radius: var(--radius-control); padding: 0 11px;
  background: var(--field); color: var(--ink); box-shadow: var(--shadow-inset); transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.ui-field:hover { border-color: color-mix(in srgb, var(--line-strong) 65%, var(--ink-3)); }
.ui-field:focus { border-color: color-mix(in srgb, var(--accent) 62%, var(--line)); box-shadow: 0 0 0 3px var(--accent-tint), var(--shadow-inset); }
.ui-field::placeholder { color: var(--ink-3); }

.ui-card { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.ui-label { color: var(--ink-2); font-size: 12px; font-weight: 550; }
.ui-muted { color: var(--ink-3); }
.ui-kbd { display: inline-flex; min-width: 20px; height: 20px; padding: 0 5px; align-items: center; justify-content: center; border-radius: 5px; background: var(--inset); color: var(--ink-3); box-shadow: var(--shadow-hairline); font-size: 10px; }

.status-chip { display: inline-flex; height: 24px; align-items: center; gap: 6px; border-radius: 999px; padding: 0 8px; font-size: 11.5px; font-weight: 550; }
.status-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-chip.ready { color: var(--green); background: var(--green-tint); }
.status-chip.processing { color: var(--orange); background: var(--orange-tint); }
.status-chip.error { color: var(--red); background: var(--red-tint); }

.theme-toggle { width: 32px; height: 32px; border: 0; border-radius: var(--radius-control); background: transparent; color: var(--ink-2); display: inline-grid; place-items: center; }
.theme-toggle:hover { background: var(--hover); color: var(--ink); }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }

.ui-toast-wrap { position: fixed; z-index: 9999; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; pointer-events: none; }
.ui-toast { min-width: 220px; max-width: min(520px, calc(100vw - 32px)); display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 10px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-overlay); animation: toast-in 220ms var(--ease-out-strong) both; }
.ui-toast.success .toast-dot { background: var(--green); }
.ui-toast.error .toast-dot { background: var(--red); }
.toast-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity:.45; } 50% { opacity:1; } }

/* Admin shell */
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1fr) 224px; direction: ltr; background: var(--canvas); }
.app-sidebar { grid-column: 2; grid-row: 1; position: sticky; top: 0; height: 100vh; overflow: hidden; background: var(--surface); border-left: 1px solid var(--line); direction: rtl; transition: width 220ms var(--ease-out-strong); }
.sidebar-inner { width: 224px; height: 100%; display: flex; flex-direction: column; padding: 10px 8px; }
.sidebar-brand { height: 42px; display: flex; align-items: center; gap: 9px; padding: 0 8px; margin-bottom: 8px; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--ink); color: var(--surface); flex: 0 0 auto; }
.brand-copy { min-width: 0; }
.brand-title { font-size: 13.5px; font-weight: 650; line-height: 1.15; }
.brand-sub { font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.sidebar-nav { display: grid; gap: 2px; }
.sidebar-row { width: 100%; height: 36px; display: flex; align-items: center; gap: 9px; padding: 0 9px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); text-decoration: none; font-size: 13px; font-weight: 550; transition: background 140ms ease, color 140ms ease, transform 120ms ease; }
.sidebar-row:hover { background: var(--hover); color: var(--ink); }
.sidebar-row.active { background: var(--hover-2); color: var(--ink); }
.sidebar-row:active { transform: scale(.985); }
.sidebar-row .icon-wrap { width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 auto; }
.sidebar-section-label { padding: 15px 10px 7px; color: var(--ink-3); font-size: 10px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 2px; padding-top: 10px; border-top: 1px solid var(--line); }
.admin-main { grid-column: 1; grid-row: 1; min-width: 0; direction: rtl; }
.admin-content { max-width: 1320px; margin: 0 auto; padding: 28px 30px 44px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-title { margin: 0; font-size: 24px; line-height: 1.25; letter-spacing: -.025em; font-weight: 700; }
.page-subtitle { margin-top: 5px; color: var(--ink-2); font-size: 12.5px; }
.head-actions { display: flex; gap: 7px; align-items: center; }

.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-bottom: 12px; }
.stat-card { padding: 14px 14px 13px; min-height: 92px; display: flex; flex-direction: column; justify-content: space-between; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-2); font-size: 11.5px; }
.stat-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: var(--inset); color: var(--ink-2); box-shadow: var(--shadow-hairline); }
.stat-value { margin-top: 14px; font-size: 22px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-detail { color: var(--ink-3); font-size: 10.5px; margin-top: 1px; }

.upload-card { margin-bottom: 12px; overflow: hidden; }
.card-head { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.card-title { font-size: 13px; font-weight: 650; }
.card-desc { color: var(--ink-3); font-size: 11.5px; margin-top: 2px; }
.dropzone { margin: 12px; min-height: 144px; display: grid; place-items: center; border: 1px dashed var(--line-strong); border-radius: var(--radius-card); background: var(--inset); transition: background 140ms ease, border-color 140ms ease, transform 140ms ease; position: relative; overflow: hidden; }
.dropzone.dragging { background: var(--accent-tint); border-color: var(--accent); transform: scale(.998); }
.dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone-content { pointer-events: none; text-align: center; padding: 22px; }
.upload-glyph { width: 38px; height: 38px; margin: 0 auto 9px; display: grid; place-items: center; border-radius: 11px; background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow-btn); }
.drop-title { font-size: 13px; font-weight: 650; }
.drop-copy { margin-top: 4px; color: var(--ink-3); font-size: 11.5px; }
.upload-queue { display: none; align-items: center; gap: 10px; margin: 0 12px 12px; padding: 10px 11px; border-radius: 9px; background: var(--inset); box-shadow: var(--shadow-hairline); }
.upload-queue.visible { display: flex; }
.file-badge { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 8px; background: var(--surface); color: var(--accent-ink); box-shadow: var(--shadow-hairline); font-size: 9px; font-weight: 750; }
.queue-copy { min-width: 0; flex: 1; }
.queue-name { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-state { color: var(--ink-3); font-size: 10.5px; margin-top: 2px; }
.progress-track { height: 3px; background: var(--line); overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width 220ms var(--ease-out-strong); }
.progress-bar.indeterminate { width: 36%; animation: indeterminate 1.1s var(--ease-in-out-strong) infinite; }
@keyframes indeterminate { 0% { transform: translateX(-150%); } 100% { transform: translateX(340%); } }

.records-shell { overflow: hidden; background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.records-toolbar { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line-strong); }
.records-toolbar-left, .records-toolbar-right { display: flex; align-items: center; gap: 6px; }
.search-box { width: min(290px, 31vw); height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 9px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); color: var(--ink-3); }
.search-box:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 3px var(--accent-tint); }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12.5px; }
.search-box input::placeholder { color: var(--ink-3); }
.compact-select { height: 32px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); color: var(--ink-2); padding: 0 28px 0 9px; font-size: 12px; }
.records-scroll { overflow: auto; max-height: min(55vh, 560px); scrollbar-color: var(--line-strong) transparent; }
.records-table { width: 100%; min-width: 880px; border-collapse: separate; border-spacing: 0; }
.records-table th { position: sticky; top: 0; z-index: 2; height: 36px; padding: 0 10px; background: var(--inset); color: var(--ink-3); border-bottom: 1px solid var(--line-strong); font-size: 10.5px; font-weight: 650; text-align: right; white-space: nowrap; }
.records-table td { height: 54px; padding: 7px 10px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 12px; vertical-align: middle; }
.records-table tbody tr { transition: background 100ms ease; }
.records-table tbody tr:hover td { background: var(--hover); }
.records-table tbody tr:last-child td { border-bottom: 0; }
.records-table tbody tr.selected td { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.model-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.model-mark { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; background: var(--inset); color: var(--ink-2); box-shadow: var(--shadow-hairline); }
.model-copy { min-width: 0; }
.model-name { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 600; }
.model-id { color: var(--ink-3); font: 10.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; margin-top: 2px; }
.row-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-start; }
.row-actions .ui-btn { height: 29px; padding: 0 8px; font-size: 11.5px; }
.empty-state { padding: 46px 20px !important; text-align: center; color: var(--ink-3) !important; }
.table-check { width: 15px; height: 15px; accent-color: var(--accent); }

.bulk-bar { position: fixed; z-index: 60; left: 50%; bottom: 22px; transform: translate(-50%, 18px) scale(.98); opacity: 0; pointer-events: none; height: 42px; display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-overlay); transition: opacity 180ms ease, transform 220ms var(--ease-out-strong); }
.bulk-bar.visible { opacity: 1; pointer-events: auto; transform: translate(-50%,0) scale(1); }
.bulk-count { height: 34px; display: inline-flex; align-items: center; padding: 0 10px; color: var(--ink-2); font-size: 11.5px; border-left: 1px solid var(--line); }
.bulk-bar .ui-btn { height: 34px; border-radius: 999px; box-shadow: none; }

/* Login */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1fr) minmax(360px,480px); background: var(--canvas); }
.auth-visual { position: relative; overflow: hidden; background: var(--page); border-left: 1px solid var(--line); }
.auth-grid { position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg,var(--line) 1px,transparent 1px); background-size: 34px 34px; mask-image: radial-gradient(circle at 55% 45%, black, transparent 72%); opacity: .75; }
.auth-orbit { position: absolute; width: 340px; height: 340px; border: 1px solid var(--line-strong); border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%,-50%); }
.auth-orbit::before, .auth-orbit::after { content:""; position:absolute; inset: 52px; border:1px solid var(--line); border-radius:50%; }
.auth-orbit::after { inset: 118px; background: var(--surface); box-shadow: var(--shadow-raised); }
.auth-cube { position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; color: var(--accent-ink); }
.auth-caption { position: absolute; left: 50%; top: calc(50% + 205px); transform: translateX(-50%); width: min(420px,80%); text-align: center; }
.auth-caption strong { font-size: 16px; }
.auth-caption p { margin: 5px 0 0; color: var(--ink-3); font-size: 12px; }
.auth-panel { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: var(--surface); position: relative; }
.auth-theme { position: absolute; top: 18px; left: 18px; }
.auth-form { width: min(360px,100%); }
.auth-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 28px; }
.auth-title { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.auth-sub { margin: 6px 0 22px; color: var(--ink-2); font-size: 12.5px; }
.form-field { margin-bottom: 13px; }
.form-field label { display: block; margin-bottom: 6px; color: var(--ink-2); font-size: 11.5px; font-weight: 550; }
.auth-error { margin-bottom: 13px; padding: 9px 10px; border-radius: 8px; background: var(--red-tint); color: var(--red); box-shadow: 0 0 0 1px color-mix(in srgb,var(--red) 22%,transparent); font-size: 11.5px; }
.auth-submit { width: 100%; height: 38px; margin-top: 5px; }
.auth-foot { margin-top: 18px; text-align: center; color: var(--ink-3); font-size: 10.5px; }

/* Viewer shared chrome */
.viewer-shell { position: fixed; inset: 0; display: grid; grid-template-rows: 54px minmax(0,1fr); background: var(--canvas); }
.viewer-top { z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 10px 0 12px; background: color-mix(in srgb,var(--surface) 96%,transparent); border-bottom: 1px solid var(--line-strong); backdrop-filter: blur(14px); }
.viewer-identity { min-width: 0; display: flex; align-items: center; gap: 9px; }
.viewer-mark { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--ink); color: var(--surface); flex: 0 0 auto; }
.viewer-name { min-width: 0; max-width: min(38vw,440px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 650; }
.viewer-toolbar { display: flex; align-items: center; gap: 5px; min-width: 0; }
.viewer-toolbar .ui-btn { height: 30px; }
.segmented { display: flex; align-items: center; gap: 1px; padding: 2px; border-radius: 9px; background: var(--inset); box-shadow: var(--shadow-hairline); }
.segmented .ui-btn { height: 26px; min-width: 38px; padding: 0 8px; border-radius: 7px; background: transparent; box-shadow: none; color: var(--ink-3); }
.segmented .ui-btn:hover { color: var(--ink); background: var(--hover); }
.segmented .ui-btn.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-btn); }
.viewer-stage { position: relative; min-height: 0; overflow: hidden; background: var(--page); }
.viewer-stage canvas.main { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.viewer-loading { position: absolute; z-index: 7; inset: 0; display: grid; place-items: center; background: color-mix(in srgb,var(--page) 88%,transparent); backdrop-filter: blur(3px); }
.loader-card { min-width: 220px; display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px; background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow-raised); font-size: 11.5px; }
.loader-spinner { width: 15px; height: 15px; border: 1.5px solid var(--line-strong); border-top-color: var(--ink-2); border-radius: 50%; animation: spin 700ms linear infinite; }
.viewer-hud { position: absolute; z-index: 5; left: 12px; bottom: 12px; display: flex; gap: 5px; pointer-events: none; }
.viewer-chip { height: 27px; display: inline-flex; align-items: center; padding: 0 8px; border-radius: 7px; background: color-mix(in srgb,var(--surface) 90%,transparent); color: var(--ink-3); box-shadow: var(--shadow-btn); backdrop-filter: blur(10px); font-size: 10.5px; }
.viewer-info { position: absolute; z-index: 5; right: 12px; bottom: 12px; max-width: min(340px,calc(100vw - 24px)); padding: 9px 10px; border-radius: 9px; background: color-mix(in srgb,var(--surface) 92%,transparent); box-shadow: var(--shadow-card); backdrop-filter: blur(10px); }
.viewer-info-title { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: 11.5px; font-weight: 600; }
.viewer-info-meta { margin-top: 2px; color: var(--ink-3); font-size: 10.5px; font-variant-numeric: tabular-nums; }

@media (max-width: 980px) {
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .admin-shell { grid-template-columns: minmax(0,1fr) 64px; }
  .app-sidebar { width: 64px; }
  .sidebar-inner { width: 64px; }
  .brand-copy, .sidebar-row span:not(.icon-wrap), .sidebar-section-label { display: none; }
  .sidebar-row { justify-content: center; padding: 0; }
  .sidebar-brand { justify-content: center; padding: 0; }
}
@media (max-width: 760px) {
  .admin-shell { display: block; }
  .app-sidebar { position: static; width: 100%; height: 54px; border-left: 0; border-bottom: 1px solid var(--line); }
  .sidebar-inner { width: 100%; height: 54px; flex-direction: row; align-items: center; padding: 6px 8px; }
  .sidebar-brand { margin: 0 auto 0 0; height: 40px; }
  .sidebar-nav { display: flex; gap: 2px; }
  .sidebar-row { width: 36px; }
  .sidebar-section-label, .sidebar-bottom .sidebar-row:first-child { display: none; }
  .sidebar-bottom { margin: 0; padding: 0; border: 0; display: flex; }
  .admin-content { padding: 18px 12px 34px; }
  .page-head { align-items: center; }
  .page-subtitle { display: none; }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .records-toolbar { align-items: stretch; flex-direction: column; }
  .records-toolbar-left, .records-toolbar-right { width: 100%; }
  .search-box { width: 100%; }
  .records-toolbar-right { justify-content: space-between; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .viewer-toolbar .optional { display: none; }
  .viewer-name { max-width: 28vw; }
  .viewer-hud .viewer-chip:nth-child(n+2) { display: none; }
}
@media (max-width: 520px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { min-height: 82px; padding: 12px; }
  .stat-value { font-size: 19px; margin-top: 10px; }
  .page-title { font-size: 20px; }
  .head-actions .ui-btn span { display: none; }
  .viewer-toolbar .segmented button:not(#iso):not(#fit) { display:none; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior:auto!important; transition-duration:0.01ms!important; animation-duration:0.01ms!important; animation-iteration-count:1!important; }
}

/* V6.2 admin routed views */
.admin-view[hidden] { display: none !important; }
.upload-page-card { max-width: 920px; margin: 0 auto 14px; }
.upload-page-dropzone { min-height: 280px; display: grid; place-items: center; }
.upload-help-card { max-width: 920px; margin: 0 auto; padding: 16px; }
.upload-help-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-top: 12px; }
.upload-help-grid > div { min-height: 84px; display: flex; align-items: flex-start; gap: 10px; padding: 13px; border-radius: 9px; background: var(--inset); box-shadow: var(--shadow-hairline); color: var(--ink-2); font-size: 12px; line-height: 1.8; }
.upload-help-grid strong { width: 24px; height: 24px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 7px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-btn); }
@media (max-width: 760px) { .upload-help-grid { grid-template-columns: 1fr; } .upload-page-dropzone { min-height: 220px; } }
