:root {
  color-scheme: dark;
  --bg: #0a0e14;
  --surface: #10161f;
  --surface-2: #151d28;
  --surface-3: #1a2431;
  --border: #2a3747;
  --text: #eef3fa;
  --muted: #91a0b5;
  --primary: #8aa9ff;
  --primary-strong: #a7bcff;
  --primary-ink: #111a31;
  --green: #68d9a2;
  --danger: #ff7b7b;
  --danger-bg: #341c22;
  --shadow: 0 18px 50px rgba(0, 0, 0, .22);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8faff;
  --surface-3: #edf1f8;
  --border: #d6deea;
  --text: #182131;
  --muted: #66758a;
  --primary: #718fe8;
  --primary-strong: #5f7ed9;
  --primary-ink: #101831;
  --green: #20865a;
  --danger: #c43d4f;
  --danger-bg: #fff0f2;
  --shadow: 0 18px 45px rgba(29, 42, 65, .08);
}

@media (prefers-color-scheme: light) {
  html[data-theme="system"] {
    color-scheme: light;
    --bg: #f4f6fa;
    --surface: #ffffff;
    --surface-2: #f8faff;
    --surface-3: #edf1f8;
    --border: #d6deea;
    --text: #182131;
    --muted: #66758a;
    --primary: #718fe8;
    --primary-strong: #5f7ed9;
    --primary-ink: #101831;
    --green: #20865a;
    --danger: #c43d4f;
    --danger-bg: #fff0f2;
    --shadow: 0 18px 45px rgba(29, 42, 65, .08);
  }
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  height: 72px;
  display: grid;
  grid-template-columns: 260px minmax(280px, 620px) 260px;
  align-items: center;
  gap: 24px;
  padding: 0 26px;
  background: rgba(16, 22, 31, .9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(145deg, #9bb5ff, #708ff0); color: #111a31; font-weight: 900; box-shadow: inset 0 1px rgba(255,255,255,.35), 0 7px 20px rgba(112,143,240,.22); }
.top-search { height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid var(--border); border-radius: 9px; background: #0e141d; color: var(--muted); }
.top-search input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; }
.top-search kbd { padding: 3px 7px; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); background: var(--surface-2); font-size: 12px; }
.topbar > .button { justify-self: end; }

.app-shell { min-height: 100vh; padding-top: 72px; }
.sidebar { position: fixed; inset: 72px auto 0 0; width: 260px; display: flex; flex-direction: column; justify-content: space-between; padding: 28px 18px 20px; border-right: 1px solid var(--border); background: var(--surface); }
.nav-label { margin: 0 10px 12px; color: #77869b; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.nav-section { margin-top: 28px; }
.nav-link { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; min-height: 43px; padding: 0 11px; border-radius: 8px; color: #c2cbd8; font-weight: 600; }
.nav-link:hover { background: rgba(255,255,255,.035); color: var(--text); }
.nav-link.active { background: #192231; color: var(--text); box-shadow: inset 3px 0 var(--primary); }
.count { min-width: 25px; padding: 2px 7px; border-radius: 99px; background: #252f3d; color: var(--muted); font-size: 12px; text-align: center; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(104,217,162,.1); }
.theme-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); }
.theme-switch button { padding: 7px 4px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.theme-switch button.selected { background: #25345a; color: var(--primary-strong); box-shadow: inset 0 0 0 1px #526fae; }
.user-chip { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted); }
.user-chip strong, .user-chip small { display: block; }
.user-chip strong { color: var(--text); font-size: 13px; }
.user-chip small { margin-top: 2px; font-size: 11px; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #263552; color: var(--primary-strong); font-size: 12px; font-weight: 800; }

.main-content { margin-left: 260px; padding: 48px 50px 70px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; max-width: 1300px; }
.eyebrow { margin: 0 0 9px !important; color: var(--primary) !important; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.page-heading h1 { max-width: 760px; margin: 0; font-size: clamp(34px, 4vw, 54px); line-height: 1.03; letter-spacing: -.048em; }
.page-heading p { margin: 14px 0 0; color: var(--muted); font-size: 17px; line-height: 1.6; }
.heading-actions { display: flex; gap: 10px; flex-shrink: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); font-weight: 750; cursor: pointer; box-shadow: 0 1px rgba(255,255,255,.025); }
.button:hover { border-color: #45566b; background: var(--surface-3); }
.button-primary { border-color: #809ef4; background: var(--primary); color: var(--primary-ink); }
.button-primary:hover { border-color: var(--primary-strong); background: var(--primary-strong); }

.metric-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 14px; max-width: 1300px; margin-top: 38px; }
.metric-card { min-height: 160px; padding: 21px; border: 1px solid var(--border); border-radius: 12px; background: linear-gradient(145deg, var(--surface-2), #101720); box-shadow: var(--shadow); }
.metric-card.accent-card { background: radial-gradient(circle at 90% 0, rgba(132,164,255,.18), transparent 50%), linear-gradient(145deg, #172030, #101720); }
.metric-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; font-weight: 700; }
.metric-card strong { display: block; margin-top: 26px; font-size: 28px; letter-spacing: -.04em; }
.metric-card small { display: block; margin-top: 9px; color: var(--muted); }
.meter { height: 5px; margin-top: 14px; overflow: hidden; border-radius: 9px; background: #263140; }
.meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6f91f2, #a6bbff); }

.panel { max-width: 1300px; margin-top: 18px; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.panel-heading h2 { margin: 0; font-size: 18px; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.panel-heading a { color: var(--primary); font-size: 13px; font-weight: 700; }
.file-row { display: grid; grid-template-columns: minmax(260px, 2fr) 150px 100px 100px 36px; align-items: center; gap: 18px; min-height: 71px; padding: 10px 22px; border-bottom: 1px solid rgba(42,55,71,.7); color: #c4cedb; font-size: 13px; }
.file-row:last-child { border-bottom: 0; }
.file-row.table-heading { min-height: 40px; color: #77869b; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.file-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.file-name strong, .file-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-name strong { color: var(--text); font-size: 13px; }
.file-name small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.file-icon { display: grid; place-items: center; flex: 0 0 38px; height: 42px; border: 1px solid #48628e; border-radius: 8px; background: #1e2c45; color: #a8c0ff; font-size: 9px; font-weight: 900; }
.file-icon.violet { border-color: #654f88; background: #2a2140; color: #cbb2ff; }
.file-icon.green { border-color: #356b59; background: #172f2a; color: #93e5c4; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid #364252; border-radius: 99px; color: #b7c2d0; background: #171f2a; font-size: 11px; font-weight: 700; }
.badge-public { border-color: #315d4f; color: #86dbb9; background: #14271f; }
.more { border: 0; background: transparent; color: var(--muted); cursor: pointer; }

/* Complete application surfaces */
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); cursor: pointer; }
.mobile-menu-button { display: none; }
.top-actions { justify-self: end; }
.sidebar-scrim { display: none; }
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu-popover { position: absolute; inset: auto 0 calc(100% + 8px) 0; z-index: 30; overflow: hidden; padding: 6px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); box-shadow: var(--shadow); }
.user-menu-popover a, .user-menu-popover button { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.user-menu-popover a:hover, .user-menu-popover button:hover { background: var(--surface-3); }
.messages { display: grid; gap: 8px; max-width: 1300px; margin: 0 0 18px; }
.message { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid #375e50; border-radius: 9px; background: #14271f; color: #a9e5cb; }
.message-error { border-color: #693b46; background: var(--danger-bg); color: var(--danger); }
.message button { border: 0; background: transparent; color: inherit; font-size: 20px; cursor: pointer; }
.page-heading.compact { align-items: center; }
.page-heading.compact h1 { font-size: clamp(32px, 3.4vw, 46px); }
.narrow-page { width: min(100%, 780px); }
.centered-page { margin: 9vh auto 0; text-align: center; }
.form-card { margin-top: 28px; padding: 28px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.form-stack { display: grid; gap: 20px; }
.form-field { display: grid; gap: 8px; }
.form-field label, .sharing-fieldset legend { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.form-field input:not([type="checkbox"]), .form-field select, .copy-field input, .top-search input { min-width: 0; }
.form-field input:not([type="checkbox"]), .form-field select, .form-field textarea, .copy-field input { width: 100%; min-height: 43px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; outline: 0; background: var(--bg); color: var(--text); }
.form-field input:focus, .form-field select:focus, .copy-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(130, 160, 245, .14); }
.form-field input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--primary); }
.checkbox-field { grid-template-columns: 20px 1fr; align-items: center; }
.checkbox-field .field-help, .checkbox-field .field-error { grid-column: 2; }
.field-help, .field-error { margin: 0; font-size: 12px; line-height: 1.5; }
.field-help { color: var(--muted); }
.field-error { color: var(--danger); }
.field-help ul, .form-alert ul { margin: 5px 0; padding-left: 20px; }
.form-alert { padding: 11px 13px; border: 1px solid #693b46; border-radius: 8px; background: var(--danger-bg); color: var(--danger); font-size: 13px; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding-top: 4px; }
.form-side-link { margin-left: auto; }
.button-full { width: 100%; }
.button-small { min-height: 32px; padding: 0 10px; font-size: 12px; }
.button-danger { border-color: #c95364; background: #d95a6c; color: #fff; }
.button-danger:hover { border-color: #ed8190; background: #e7697a; }
.text-button { border: 0; background: transparent; color: var(--primary); font-weight: 700; cursor: pointer; }
.danger-text, .danger-link { color: var(--danger); }
.danger-link { display: inline-block; margin: 14px 6px 0; font-size: 13px; font-weight: 700; }
.muted { color: var(--muted); }
.sharing-fieldset { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0; padding: 20px; border: 1px solid var(--border); border-radius: 10px; }
.sharing-fieldset legend { padding: 0 7px; }
.security-note { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid #334c71; border-radius: 9px; background: rgba(78, 113, 169, .09); color: var(--muted); }
.security-note span { color: var(--primary); }
.security-note p { margin: 0; font-size: 13px; line-height: 1.55; }
.security-note strong { color: var(--text); }

.upload-drop { position: relative; display: grid; place-items: center; min-height: 245px; padding: 30px; border: 1px dashed #52627a; border-radius: 12px; background: radial-gradient(circle at 50% 20%, rgba(129,160,247,.12), transparent 55%), var(--bg); text-align: center; transition: border-color .2s, background .2s; }
.upload-drop.dragging { border-color: var(--primary); background: rgba(129,160,247,.09); }
.upload-drop input[type="file"] { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-drop strong { margin-top: 12px; }
.upload-drop small { color: var(--muted); }
.upload-mark { display: grid; place-items: center; width: 54px; height: 54px; border: 1px solid #4d6190; border-radius: 14px; background: #1d2a46; color: var(--primary-strong); font-size: 25px; }

.library-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; max-width: 1300px; margin-top: 34px; }
.filter-panel { align-self: start; padding: 18px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.filter-panel .form-field { margin-top: 17px; }
.filter-heading { display: flex; align-items: center; justify-content: space-between; padding-bottom: 15px; border-bottom: 1px solid var(--border); }
.filter-heading h2 { margin: 0; font-size: 16px; }
.filter-heading a { color: var(--primary); font-size: 12px; font-weight: 700; }
.result-count { margin: 0 0 9px; color: var(--muted); font-size: 13px; }
.flush-panel { margin-top: 0; }
.linked-row { transition: background .15s; }
.linked-row:hover { background: var(--surface-2); }
.row-arrow { color: var(--muted); font-size: 23px; }
.pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; margin-top: 16px; color: var(--muted); font-size: 12px; }
.pagination > :last-child { justify-self: end; }
.empty-state { display: grid; place-items: center; min-height: 290px; padding: 45px 22px; text-align: center; }
.empty-state h3 { margin: 17px 0 0; }
.empty-state p { max-width: 430px; margin: 8px 0 20px; color: var(--muted); line-height: 1.55; }
.empty-mark { display: grid; place-items: center; width: 54px; height: 54px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); color: var(--primary); font-size: 22px; font-weight: 900; }

progress { overflow: hidden; border: 0; border-radius: 99px; background: #263140; }
progress::-webkit-progress-bar { background: #263140; }
progress::-webkit-progress-value { border-radius: inherit; background: linear-gradient(90deg, #6f91f2, #a6bbff); }
progress::-moz-progress-bar { border-radius: inherit; background: linear-gradient(90deg, #6f91f2, #a6bbff); }
.meter { display: block; width: 100%; height: 5px; margin-top: 14px; }

.detail-heading { max-width: 1300px; }
.detail-title { display: flex; align-items: center; gap: 17px; min-width: 0; }
.detail-title h1 { overflow-wrap: anywhere; }
.file-icon.large { flex-basis: 58px; width: 58px; height: 64px; font-size: 11px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .65fr); gap: 18px; max-width: 1300px; margin-top: 28px; }
.detail-panel, .settings-panel, .metadata-panel { margin-top: 0; }
.link-card { margin: 20px; padding: 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.link-card-heading { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; }
.link-card-heading strong, .link-card-heading small { display: block; }
.link-card-heading small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.share-icon { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-3); color: var(--primary); }
.share-icon.public { border-color: #315d4f; background: #14271f; color: #86dbb9; }
.copy-field { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 15px; }
.copy-field input { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.link-meta { display: block; margin-top: 9px; color: var(--muted); }
.detail-side { display: grid; align-content: start; gap: 14px; }
.compact-form { padding: 18px; }
.inline-danger-form { padding: 0 18px 18px; }
.metadata-list { margin: 0; padding: 8px 18px 17px; }
.metadata-list div { display: flex; justify-content: space-between; gap: 18px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.metadata-list div:last-child { border-bottom: 0; }
.metadata-list dt { color: var(--muted); }
.metadata-list dd { margin: 0; text-align: right; }
.hash { max-width: 150px; overflow: hidden; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; }
.danger-card { max-width: 600px; margin-inline: auto; }
.danger-card h1 { margin: 12px 0; font-size: 34px; }
.danger-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.6; }
.danger-card .form-actions { justify-content: center; }
.danger-mark { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 19px; border: 1px solid #864453; border-radius: 50%; background: var(--danger-bg); color: var(--danger); font-size: 27px; font-weight: 900; }

.status-tabs { display: flex; gap: 5px; max-width: 1300px; margin: 28px 0 14px; overflow-x: auto; }
.status-tabs a { padding: 8px 12px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
.status-tabs a.active { border-color: var(--border); background: var(--surface-2); color: var(--text); }
.fetch-stack { display: grid; gap: 12px; max-width: 1300px; }
.fetch-card { padding: 18px 20px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow); }
.fetch-main { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 13px; }
.fetch-status-icon { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid #40577f; border-radius: 10px; background: #192945; color: var(--primary); font-weight: 900; }
.fetch-status-icon.status-complete { border-color: #315d4f; background: #14271f; color: #86dbb9; }
.fetch-status-icon.status-failed, .fetch-status-icon.status-cancelled { border-color: #693b46; background: var(--danger-bg); color: var(--danger); }
.fetch-copy { min-width: 0; }
.fetch-copy h2, .fetch-copy p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fetch-copy h2 { margin: 0; font-size: 15px; }
.fetch-copy p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.status-downloading, .status-resolving, .status-queued { color: var(--primary); }
.status-failed, .status-cancelled { color: var(--danger); }
.fetch-progress { margin: 16px 0 0 55px; }
.fetch-progress progress { width: 100%; height: 6px; }
.fetch-progress div { display: flex; justify-content: space-between; margin-top: 7px; color: var(--muted); font-size: 11px; }
.fetch-error { margin: 14px 0 0 55px; padding: 10px 12px; border-radius: 7px; background: var(--danger-bg); color: var(--danger); font-size: 12px; }
.fetch-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 15px 0 0 55px; color: var(--muted); font-size: 11px; }
.fetch-actions > div { display: flex; align-items: center; gap: 8px; }
.fetch-actions form { display: inline-flex; }

.user-table { margin-top: 28px; }
.user-row { display: grid; grid-template-columns: minmax(240px, 1.3fr) minmax(190px, 1fr) 190px 100px 150px; align-items: center; gap: 16px; min-height: 72px; padding: 11px 20px; border-bottom: 1px solid var(--border); font-size: 12px; }
.user-row:last-child { border-bottom: 0; }
.user-row.table-heading { min-height: 40px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.user-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.user-identity strong, .user-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-identity small { margin-top: 3px; color: var(--muted); }
.permission-list, .row-buttons { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.row-buttons { justify-content: flex-end; }

.auth-page { position: relative; min-height: 100vh; display: grid; place-items: center; overflow: hidden; padding: 90px 20px 40px; background: radial-gradient(circle at 50% 0, #16223a, var(--bg) 58%); }
.auth-brand { position: absolute; top: 28px; left: 32px; z-index: 2; }
.auth-card { position: relative; z-index: 2; width: min(100%, 430px); padding: 35px; border: 1px solid var(--border); border-radius: 15px; background: rgba(16, 22, 31, .91); box-shadow: 0 30px 80px rgba(0,0,0,.36); backdrop-filter: blur(20px); }
html[data-theme="light"] .auth-card { background: rgba(255,255,255,.91); }
.auth-card h1 { margin: 0; font-size: 40px; letter-spacing: -.045em; }
.auth-intro { margin: 10px 0 25px; color: var(--muted); line-height: 1.55; }
.auth-footnote { margin: 20px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.auth-glow { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .35; }
.auth-glow-one { width: 460px; height: 460px; top: -230px; left: -130px; background: radial-gradient(circle, #587bdc, transparent 68%); }
.auth-glow-two { width: 420px; height: 420px; right: -170px; bottom: -220px; background: radial-gradient(circle, #4d77b2, transparent 68%); }
.public-message { text-align: center; }
.public-message .empty-mark { margin: 0 auto 20px; }

html[data-theme="light"] .topbar, html[data-theme="light"] .auth-card,
html[data-theme="light"] .message { backdrop-filter: none; }
html[data-theme="light"] .top-search, html[data-theme="light"] .form-field input:not([type="checkbox"]), html[data-theme="light"] .form-field select, html[data-theme="light"] .form-field textarea, html[data-theme="light"] .copy-field input { background: #fff; }
html[data-theme="light"] .nav-link.active { background: #edf1fa; }
html[data-theme="light"] .metric-card { background: linear-gradient(145deg, #fff, #f7f9fd); }
html[data-theme="light"] .accent-card { background: radial-gradient(circle at 90% 0, rgba(92,127,220,.14), transparent 50%), linear-gradient(145deg, #fff, #f7f9fd); }

@media (max-width: 1120px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-side { grid-template-columns: 1fr 1fr; }
  .detail-side .danger-link { grid-column: 1 / -1; }
  .user-row { grid-template-columns: minmax(220px, 1fr) minmax(170px, .8fr) 100px 130px; }
  .user-row > :nth-child(3) { display: none; }
}

@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr auto; }
  .top-search { display: none; }
  .sidebar { width: 220px; }
  .main-content { margin-left: 220px; padding: 38px 28px 60px; }
  .metric-grid { grid-template-columns: 1fr; }
  .file-row { grid-template-columns: minmax(220px, 1fr) 130px 80px 36px; }
  .file-row > :nth-child(4) { display: none; }
  .library-layout { grid-template-columns: 1fr; }
  .filter-panel { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
  .filter-panel .filter-heading, .filter-panel .button { grid-column: 1 / -1; }
  .filter-panel .form-field { margin-top: 0; }
}

@media (max-width: 720px) {
  .topbar { height: 64px; grid-template-columns: auto 1fr auto; gap: 10px; padding: 0 13px; }
  .mobile-menu-button { display: grid; }
  .topbar .brand > span:last-child { display: none; }
  .topbar .button { min-height: 38px; padding-inline: 11px; font-size: 12px; }
  .app-shell { padding-top: 64px; }
  .sidebar { display: flex; inset: 64px auto 0 0; z-index: 28; width: min(290px, 86vw); transform: translateX(-102%); transition: transform .2s ease; box-shadow: 22px 0 50px rgba(0,0,0,.3); }
  body.menu-open { overflow: hidden; }
  body.menu-open .sidebar { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 64px 0 0; z-index: 27; width: 100%; height: auto; border: 0; background: rgba(0,0,0,.48); }
  body.menu-open .sidebar-scrim { display: block; }
  .main-content { margin-left: 0; padding: 30px 18px 50px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading h1 { font-size: 38px; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .file-row { grid-template-columns: minmax(0, 1fr) 36px; }
  .file-row > :nth-child(2), .file-row > :nth-child(3), .file-row > :nth-child(4) { display: none; }
  .file-row.table-heading { display: none; }
  .filter-panel { grid-template-columns: 1fr; }
  .filter-panel .filter-heading, .filter-panel .button { grid-column: auto; }
  .detail-title { align-items: flex-start; }
  .detail-title .file-icon { display: none; }
  .detail-side { grid-template-columns: 1fr; }
  .link-card { margin: 14px; }
  .link-card-heading { grid-template-columns: 38px 1fr; }
  .link-card-heading > .badge { grid-column: 2; justify-self: start; }
  .copy-field { grid-template-columns: 1fr; }
  .sharing-fieldset { grid-template-columns: 1fr; }
  .fetch-main { grid-template-columns: 40px minmax(0, 1fr); }
  .fetch-main > .badge { grid-column: 2; justify-self: start; }
  .fetch-progress, .fetch-error, .fetch-actions { margin-left: 0; }
  .fetch-actions { align-items: flex-start; flex-direction: column; }
  .fetch-actions > div { width: 100%; flex-wrap: wrap; }
  .user-row { grid-template-columns: minmax(0, 1fr) auto; padding: 15px; }
  .user-row.table-heading, .user-row > :nth-child(2), .user-row > :nth-child(3), .user-row > :nth-child(4) { display: none; }
  .auth-card { padding: 28px 22px; }
  .auth-brand { top: 22px; left: 20px; }
  .form-actions .button { flex: 1; }
}
