/* ==========================================================================
   File Share – design system
   No logo anywhere: the brand is plain text only.
   ========================================================================== */

:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f0f2f8;
  --border: #e3e6ef;
  --border-strong: #cfd4e2;
  --text: #161a2c;
  --muted: #6a7088;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #ecebfd;
  --accent-text: #4338ca;
  --ok: #138a4b;
  --ok-soft: #e0f5ea;
  --warn: #b45d09;
  --warn-soft: #fdf0d9;
  --danger: #d12d2d;
  --danger-soft: #fde8e8;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 26, 50, .05), 0 6px 20px rgba(20, 26, 50, .06);
  --shadow-lg: 0 10px 40px rgba(20, 26, 50, .22);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --sidebar-w: 248px;
}

:root[data-theme="dark"] {
  --bg: #0d1017;
  --surface: #151925;
  --surface-2: #1c2130;
  --border: #272d3f;
  --border-strong: #38405a;
  --text: #e9ebf5;
  --muted: #98a0b9;
  --accent: #7f7bf7;
  --accent-hover: #9591ff;
  --accent-soft: #24264a;
  --accent-text: #aeabff;
  --ok: #4cc58a;
  --ok-soft: #12301f;
  --warn: #f0b252;
  --warn-soft: #36280f;
  --danger: #f27272;
  --danger-soft: #3a1717;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .6);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 14.5px/1.5 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0 0 .75em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: .12em .4em; border-radius: 5px; }
.i { flex: none; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.push-right { margin-left: auto; }
.only-mobile { display: none; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
[hidden] { display: none !important; }

.link { color: var(--accent-text); font-weight: 500; }
.link:hover { text-decoration: underline; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-text); font-weight: 500; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font: 600 14px/1.2 var(--font);
  cursor: pointer; transition: background .15s, border-color .15s, transform .05s, opacity .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.92); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border-radius: 8px; border: 0; background: transparent; color: var(--muted);
  cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn.copied { color: var(--ok); background: var(--ok-soft); }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field > span, .field > legend { font-weight: 600; font-size: 13px; }
.field small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=search], input[type=datetime-local], select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s; min-width: 0;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
::placeholder { color: var(--muted); opacity: .75; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.check small { color: var(--muted); font-weight: 400; }
.fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px 14px; }
.fieldset legend { padding: 0 6px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 16px; }
.form-actions { display: flex; gap: 10px; align-items: center; }
.inline-form { display: inline; margin: 0; }

/* ---------- Layout shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 20px 14px; z-index: 40;
}
.brand { display: flex; align-items: baseline; gap: 8px; padding: 4px 10px 22px; }
.brand-text { font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand-tag {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent-text); background: var(--accent-soft); padding: 2px 7px; border-radius: 99px;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px;
  font-weight: 500; color: var(--muted); transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.is-active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--border); padding-top: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 10px 8px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 13px;
}
.user-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.scrim { display: none; }

.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 14px 32px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.page-title { font-size: 20px; font-weight: 700; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.content { padding: 28px 32px 56px; display: flex; flex-direction: column; gap: 24px; max-width: 1280px; width: 100%; }
.page-intro { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.page-intro p { margin: 0; max-width: 640px; }

.theme-moon { display: none; }
:root[data-theme="dark"] .theme-sun { display: none; }
:root[data-theme="dark"] .theme-moon { display: inline-flex; }

/* ---------- Cards, grids ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2 { font-size: 16px; font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.grid-upload { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 24px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center;
}
.stat-ic { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent-text); grid-row: span 2; }
.stat-num { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-sub { grid-column: 2; color: var(--muted); font-size: 12px; }

/* ---------- Lists / tables ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-top: 1px solid var(--border); }
.list-row:first-child { border-top: 0; padding-top: 0; }
.list.compact .list-row { padding: 9px 0; }
.row-title { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.row-title:hover { color: var(--accent-text); }
.row-sub { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline-ic { display: inline-flex; align-items: center; gap: 3px; }

.thumb {
  width: 44px; height: 44px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted); overflow: hidden; border: 1px solid var(--border);
}
.thumb.has-img { background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 13px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.file-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.file-meta { min-width: 0; max-width: 300px; }

.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.filters select { width: auto; min-width: 140px; }
.search { position: relative; flex: 1 1 220px; max-width: 340px; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 36px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; padding-top: 18px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-muted { background: var(--surface-2); color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); }
.chip-accent { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.ext-pill { font-size: 11px; font-weight: 700; letter-spacing: .06em; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 6px; padding: 1px 7px; color: var(--muted); }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.empty p { margin-bottom: 8px; }

.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.bar-label { font-weight: 600; }
.bar-label .muted { font-weight: 400; margin-left: 6px; font-size: 12.5px; }
.bar-val { color: var(--muted); font-size: 12.5px; }
.bar { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 99px; background: var(--accent); }

/* ---------- Alerts / toasts ---------- */
.alert { padding: 11px 14px; border-radius: var(--radius-sm); font-weight: 500; margin-bottom: 14px; }
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  pointer-events: auto; min-width: 240px; max-width: 380px; padding: 12px 16px; border-radius: 10px;
  background: var(--text); color: var(--bg); font-weight: 500; box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--ok); animation: toast-in .25s ease; transition: opacity .3s, transform .3s;
}
.toast-danger { border-left-color: var(--danger); }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Modal ---------- */
.modal {
  border: 0; padding: 24px; border-radius: 16px; background: var(--surface); color: var(--text);
  width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); max-height: calc(100vh - 40px);
}
.modal-lg { width: min(660px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(10, 13, 25, .55); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* ---------- Upload ---------- */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 34px 20px; text-align: center;
  color: var(--muted); background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); outline: none; }
.dropzone .i { margin-bottom: 8px; }
.dropzone p { margin: 0; }
.dz-title { font-weight: 700; font-size: 16px; color: var(--text); }
.queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.q-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.q-item .thumb { width: 40px; height: 40px; }
.q-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-sub { font-size: 12.5px; color: var(--muted); }
.q-progress { height: 5px; border-radius: 99px; background: var(--surface-2); margin-top: 6px; overflow: hidden; }
.q-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.q-item.done .q-progress span { background: var(--ok); }
.q-item.error { border-color: var(--danger); }
.q-item.error .q-sub { color: var(--danger); }
.results .list-row { align-items: flex-start; }
.link-line { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.link-line input { font-family: var(--mono); font-size: 12.5px; padding: 7px 10px; }

/* ---------- Events ---------- */
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.event-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.event-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); height: 96px; background: var(--surface-2); }
.event-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.event-empty { grid-column: 1 / -1; display: grid; place-items: center; color: var(--muted); }
.event-body { padding: 18px 20px 6px; flex: 1; }
.event-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.event-title-row h3 { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-stats { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin: 10px 0 6px; }
.event-stats strong { color: var(--text); }
.event-slug { font-size: 12.5px; }
.event-actions { display: flex; align-items: center; gap: 8px; padding: 14px 20px 18px; flex-wrap: wrap; }

/* ---------- API keys ---------- */
.key-reveal { border-color: var(--accent); background: var(--accent-soft); }
.key-reveal-head { display: flex; gap: 14px; align-items: flex-start; color: var(--accent-text); margin-bottom: 14px; }
.key-reveal-head h2 { font-size: 16px; color: var(--text); }
.key-reveal-head p { margin: 2px 0 0; }
.copy-box { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 10px 10px 14px; flex-wrap: wrap; }
.copy-box code { flex: 1; min-width: 200px; word-break: break-all; background: none; font-size: 14px; padding: 0; }
.code-block { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; margin: 12px 0; overflow: hidden; }
.code-title { display: flex; justify-content: space-between; padding: 8px 14px; font-size: 12.5px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--border); }
.code-block pre { margin: 0; padding: 12px 14px; overflow-x: auto; font: 12.5px/1.6 var(--mono); }

.kv { margin: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--border); }
.kv > div:first-child { border-top: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; word-break: break-all; }

/* ---------- Public pages ---------- */
body.public { min-height: 100vh; display: flex; flex-direction: column; }
.pub-top { border-bottom: 1px solid var(--border); background: var(--surface); }
.pub-top-inner { max-width: 880px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; }
.pub-top-inner.wide { max-width: 1180px; }
.pub-main { flex: 1; width: 100%; max-width: 880px; margin: 0 auto; padding: 36px 20px 48px; display: flex; flex-direction: column; gap: 20px; }
.pub-main.wide { max-width: 1180px; }
.pub-foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 18px; }

.auth-card, .state-card { max-width: 440px; width: 100%; margin: 6vh auto 0; text-align: center; padding: 34px 30px; }
.auth-card h1, .state-card h1 { font-size: 22px; margin-bottom: 6px; }
.auth-card .form { text-align: left; margin-top: 18px; }
.state-ic { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); margin: 0 auto 14px; }

.file-card { padding: 0; overflow: hidden; }
.preview { background: var(--surface-2); display: grid; place-items: center; min-height: 220px; border-bottom: 1px solid var(--border); }
.preview img { max-height: 520px; width: auto; max-width: 100%; object-fit: contain; }
.preview video { width: 100%; max-height: 520px; background: #000; }
.preview iframe { width: 100%; height: 560px; border: 0; background: #fff; }
.audio-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 40px 20px; color: var(--muted); width: 100%; }
.audio-wrap audio { width: min(460px, 100%); }
.generic-preview { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 50px 0; color: var(--muted); }
.generic-preview .i { width: 54px; height: 54px; }
.file-info { padding: 24px 28px 28px; }
.file-info h1 { font-size: 22px; word-break: break-word; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 16px 0 22px; }
.meta-row dt { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.meta-row dd { margin: 2px 0 0; font-weight: 600; }
.file-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.event-hero { padding: 6px 0 4px; }
.event-hero h1 { font-size: 32px; letter-spacing: -.025em; margin: 4px 0 8px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.g-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform .15s, box-shadow .15s; }
.g-item:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.g-thumb { aspect-ratio: 4 / 3; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; color: var(--muted); overflow: hidden; }
.g-thumb img { width: 100%; height: 100%; object-fit: cover; }
.g-meta { padding: 12px 14px; }
.g-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-upload { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .only-mobile { display: inline-grid; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(10, 13, 25, .5); z-index: 35; }
  .scrim.show { display: block; }
  .main { margin-left: 0; }
  .topbar { padding: 12px 16px; }
  .content { padding: 20px 16px 48px; }
  .page-intro { flex-direction: column; align-items: stretch; }
  .topbar-actions .btn span { display: none; }
}
@media (max-width: 600px) {
  .stat-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .card { padding: 18px; }
  .table-wrap { margin: 0 -18px; padding: 0 18px; }
  .file-info { padding: 20px; }
  .preview iframe { height: 420px; }
  .toasts { left: 16px; right: 16px; }
  .toast { max-width: none; }
}
