/* MetaFrame Pro — design system
   Graphite neutrals, one warm "safelight" accent, semantic status colours.
   Typography: Inter (UI) + JetBrains Mono (tag keys and values). */
@font-face { font-family: 'Inter'; src: url('/fonts/inter.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; src: url('/fonts/inter-ext.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/mono.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --r-sm: 5px; --r: 8px; --r-lg: 12px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --nav-w: 216px;
  color-scheme: dark;
  /* dark (default) */
  --bg: #0f1012; --bg-2: #141518; --panel: #18191d; --panel-2: #1e2025; --raise: #24262c; --hover: #2a2d34;
  --line: #2a2c32; --line-2: #34373e;
  --text: #ecebe8; --text-2: #b4b3ae; --text-3: #85847f; --text-4: #5f5e5a;
  --accent: #f0a23b; --accent-2: #ffb85c; --accent-ink: #1b1204; --accent-soft: rgba(240, 162, 59, .12); --accent-line: rgba(240, 162, 59, .35);
  --ok: #4fbf7f; --ok-soft: rgba(79, 191, 127, .12); --warn: #e8b33a; --warn-soft: rgba(232, 179, 58, .13); --bad: #ef6a5b; --bad-soft: rgba(239, 106, 91, .13); --info: #6ea8fe; --info-soft: rgba(110, 168, 254, .12);
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px rgba(0,0,0,.45);
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f4f3f0; --bg-2: #efeeea; --panel: #ffffff; --panel-2: #f8f7f4; --raise: #ffffff; --hover: #efede8;
  --line: #e3e1dc; --line-2: #d4d2cc;
  --text: #1a1a18; --text-2: #4a4945; --text-3: #6f6e69; --text-4: #9a9893;
  --accent: #c97a12; --accent-2: #a9650c; --accent-ink: #ffffff; --accent-soft: rgba(201, 122, 18, .1); --accent-line: rgba(201, 122, 18, .35);
  --ok: #1f8a52; --ok-soft: rgba(31, 138, 82, .1); --warn: #a87808; --warn-soft: rgba(168, 120, 8, .1); --bad: #c8412f; --bad-soft: rgba(200, 65, 47, .09); --info: #2f6fd6; --info-soft: rgba(47, 111, 214, .09);
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 12px 32px rgba(0,0,0,.1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--text-3); }
.dim { color: var(--text-4); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row { display: flex; align-items: center; gap: var(--s2); }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: var(--s2); }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s4) 0; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; height: 100vh; }
.nav { background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: var(--s4) var(--s3); gap: 2px; min-height: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); flex: none; }
.brand-name { font-weight: 650; letter-spacing: -.01em; font-size: 15px; }
.brand-name span { color: var(--text-3); font-weight: 500; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r); color: var(--text-2); border: 0; background: none; cursor: pointer; text-align: left; font-weight: 500; width: 100%; }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item[aria-current='page'] { background: var(--panel-2); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.nav-item .count { margin-left: auto; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.nav-sep { height: 1px; background: var(--line); margin: var(--s3) 6px; }
.nav-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--s2); }
.retention-pill { border: 1px solid var(--line); border-radius: var(--r); padding: 10px; font-size: 12px; color: var(--text-3); background: var(--panel); }
.retention-pill .l { display: flex; gap: 6px; align-items: center; }
.retention-pill strong { display: block; color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.retention-pill.warn strong { color: var(--warn); }
.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.topbar { height: 56px; flex: none; display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s5); border-bottom: 1px solid var(--line); background: var(--bg); }
.topbar h1 { font-size: 16px; margin: 0; font-weight: 620; letter-spacing: -.01em; }
.topbar .sub { color: var(--text-3); font-size: 13px; }
.content { flex: 1; min-height: 0; overflow: auto; }
.page { padding: var(--s5); max-width: 1500px; margin: 0 auto; }
.page.full { max-width: none; height: 100%; padding: 0; }
.mobile-nav { display: none; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font-weight: 550; font-size: 13px; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, transform .06s; }
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12.5px; border-radius: 6px; }
.btn.lg { height: 40px; padding: 0 18px; font-size: 14px; }
.btn.icon { width: 32px; padding: 0; }
.btn.icon.sm { width: 26px; }
.btn-group { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); padding: 2px; background: var(--panel); gap: 2px; }
.btn-group button { border: 0; background: none; padding: 4px 10px; border-radius: 6px; color: var(--text-3); font-size: 12.5px; font-weight: 550; cursor: pointer; }
.btn-group button[aria-pressed='true'] { background: var(--raise); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.btn-group button:hover { color: var(--text); }

/* ---------- Inputs ---------- */
.input, .select, .textarea { width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 7px 10px; min-height: 34px; transition: border-color .12s, background .12s; }
.textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-4); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.mono, .textarea.mono { font-family: var(--mono); font-size: 12.5px; }
.input.mixed::placeholder { color: var(--warn); font-style: italic; }
.input.changed, .textarea.changed, .select.changed { border-color: var(--accent-line); background: var(--accent-soft); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .label { font-size: 12px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.field .hint { font-size: 11.5px; color: var(--text-4); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 6px 0; }
.check input { margin-top: 3px; accent-color: var(--accent); width: 15px; height: 15px; flex: none; }
.check .t { font-weight: 550; }
.check .d { color: var(--text-3); font-size: 12.5px; }
input[type='checkbox'] { accent-color: var(--accent); }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-4); pointer-events: none; }
.search .input { padding-left: 32px; }
.kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--text-3); }

/* ---------- Surfaces ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card-h { display: flex; align-items: center; gap: var(--s2); padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card-h h2, .card-h h3 { margin: 0; font-size: 14px; font-weight: 620; }
.card-b { padding: 16px; }
.section-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 650; margin: 0 0 var(--s3); }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 7px; border-radius: 5px; font-size: 11.5px; font-weight: 600; background: var(--raise); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.callout { border: 1px solid var(--line); border-left: 3px solid var(--info); background: var(--panel-2); border-radius: var(--r); padding: 10px 12px; font-size: 13px; color: var(--text-2); }
.callout.warn { border-left-color: var(--warn); }
.callout.bad { border-left-color: var(--bad); }
.callout.ok { border-left-color: var(--ok); }
.callout strong { color: var(--text); }
.empty { display: grid; place-items: center; text-align: center; padding: var(--s7) var(--s5); color: var(--text-3); }
.empty h3 { color: var(--text); margin: var(--s3) 0 4px; font-size: 15px; font-weight: 620; }
.empty p { margin: 0 0 var(--s4); max-width: 420px; }
.empty .glyph { width: 48px; height: 48px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--text-3); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 600; color: var(--text-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.progress { height: 6px; border-radius: 99px; background: var(--raise); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s var(--ease); }
.progress.ok > div { background: var(--ok); }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--panel-2), var(--raise), var(--panel-2)); background-size: 200% 100%; animation: sk 1.4s infinite; border-radius: var(--r-sm); }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Library ---------- */
.dropzone { border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); padding: var(--s6) var(--s5); text-align: center; background: var(--panel); transition: border-color .15s, background .15s; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone h2 { margin: 12px 0 4px; font-size: 17px; font-weight: 640; letter-spacing: -.01em; }
.drop-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(15,16,18,.72); backdrop-filter: blur(3px); display: grid; place-items: center; pointer-events: none; }
.drop-overlay div { border: 2px dashed var(--accent); border-radius: 18px; padding: 48px 64px; font-size: 18px; font-weight: 620; color: var(--text); background: var(--panel); }
.toolbar { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--s3); }
.tile { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; cursor: pointer; transition: border-color .12s, transform .12s var(--ease); }
.tile:hover { border-color: var(--line-2); }
.tile.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tile.focused { box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft); }
.tile .thumb, .insp-preview { background-color: var(--bg-2); background-image: conic-gradient(var(--panel-2) 25%, transparent 0 50%, var(--panel-2) 0 75%, transparent 0); background-size: 16px 16px; }
.tile .thumb { position: relative; aspect-ratio: 4 / 3; overflow: hidden; display: grid; place-items: center; color: var(--text-4); border-bottom: 1px solid var(--line); }
.tile .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.tile .meta { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 4px; }
.tile .name { font-weight: 560; font-size: 13px; }
.tile .facts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 11.5px; color: var(--text-3); }
.tile .sel { position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; border-radius: 6px; background: rgba(15,16,18,.6); border: 1px solid rgba(255,255,255,.25); display: grid; place-items: center; color: #fff; }
.tile.selected .sel { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tile .badges { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
.list-row { display: grid; grid-template-columns: 28px 44px 1fr 90px 110px 90px 140px 34px; align-items: center; gap: 10px; padding: 6px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list-row:hover { background: var(--panel-2); }
.list-row.selected { background: var(--accent-soft); }
.list-row img { width: 44px; height: 33px; object-fit: cover; border-radius: 4px; background: var(--bg-2); }
.uploads { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s4); }
.upload-row.failed .progress > div { background: var(--bad); }
.upload-row { display: grid; grid-template-columns: 1fr 160px 120px auto; gap: 12px; align-items: center; font-size: 13px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }

/* ---------- Inspector ---------- */
.inspector { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; height: 100%; min-height: 0; }
.insp-side { border-right: 1px solid var(--line); overflow: auto; padding: var(--s4); display: flex; flex-direction: column; gap: var(--s4); background: var(--bg-2); }
.insp-preview { position: relative; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4/3; display: grid; place-items: center; }
.insp-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.insp-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.insp-bar { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; padding: 12px var(--s5); border-bottom: 1px solid var(--line); }
.insp-scroll { flex: 1; overflow: auto; padding: var(--s4) var(--s5) var(--s6); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { height: 26px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font-size: 12.5px; cursor: pointer; font-weight: 550; display: inline-flex; align-items: center; gap: 6px; }
.fchip:hover { color: var(--text); border-color: var(--text-4); }
.fchip[aria-pressed='true'] { background: var(--text); color: var(--bg); border-color: var(--text); }
.fchip .n { opacity: .6; font-variant-numeric: tabular-nums; }
.group { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); margin-bottom: var(--s3); overflow: hidden; }
.group-h { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; background: none; border: 0; cursor: pointer; text-align: left; font-weight: 620; }
.group-h:hover { background: var(--panel-2); }
.group-h .chev { transition: transform .15s; color: var(--text-3); }
.group-h[aria-expanded='true'] .chev { transform: rotate(90deg); }
.tag-row { display: grid; grid-template-columns: minmax(180px, 28%) 1fr auto; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); align-items: start; }
.tag-row:hover { background: var(--panel-2); }
.tag-row.modified { background: var(--accent-soft); }
.tag-row.removed .val { text-decoration: line-through; color: var(--text-4); }
.tag-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tag-name .h { font-weight: 550; font-size: 13px; }
.tag-name .k { font-family: var(--mono); font-size: 11px; color: var(--text-4); overflow-wrap: anywhere; }
.val { font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); min-width: 0; }
.val .was { color: var(--text-4); text-decoration: line-through; display: block; }
.val .now { color: var(--accent); display: block; }
.val.binary { color: var(--text-4); font-style: italic; }
.tag-actions { display: flex; gap: 2px; align-items: center; opacity: .35; transition: opacity .12s; }
.tag-row:hover .tag-actions, .tag-row:focus-within .tag-actions, .tag-row.modified .tag-actions { opacity: 1; }
.edit-state { font-size: 11px; display: inline-flex; gap: 4px; align-items: center; color: var(--text-4); }
.edit-state.editable { color: var(--ok); }
.tech-meta { font-size: 11px; color: var(--text-4); font-family: var(--mono); }
.pv-section { margin-bottom: var(--s5); }
.pv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s3) var(--s4); }
.exposure { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.exposure > div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; }
.exposure .l { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.exposure .v { font-weight: 600; font-size: 13.5px; overflow-wrap: anywhere; }

/* ---------- Editor ---------- */
.editor { display: grid; grid-template-columns: 300px 1fr; gap: var(--s5); align-items: start; }
.editor-side { position: sticky; top: 0; display: flex; flex-direction: column; gap: var(--s3); }
.mode-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); cursor: pointer; text-align: left; width: 100%; }
.mode-card:hover { border-color: var(--line-2); }
.mode-card[aria-pressed='true'] { border-color: var(--accent); background: var(--accent-soft); }
.mode-card .letter { width: 22px; height: 22px; border-radius: 6px; background: var(--raise); display: grid; place-items: center; font-size: 11.5px; font-weight: 700; flex: none; color: var(--text-2); }
.mode-card[aria-pressed='true'] .letter { background: var(--accent); color: var(--accent-ink); }
.mode-card .t { font-weight: 600; font-size: 13px; }
.mode-card .d { font-size: 12px; color: var(--text-3); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: var(--s4); overflow-x: auto; }
.tab { border: 0; background: none; padding: 9px 12px; color: var(--text-3); font-weight: 560; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--text); }
.tab[aria-selected='true'] { color: var(--text); border-bottom-color: var(--accent); }
.tab .n { font-size: 11px; background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 0 6px; font-weight: 700; }
.mixed-note { font-size: 11px; color: var(--warn); display: inline-flex; gap: 4px; align-items: center; font-weight: 600; }
.unsupported-note { font-size: 11px; color: var(--text-4); }
.sticky-foot { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: var(--s4) 0 var(--s2); display: flex; gap: var(--s2); align-items: center; z-index: 2; }

/* ---------- Modal / toasts ---------- */
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(8,8,10,.6); backdrop-filter: blur(2px); display: grid; place-items: center; padding: var(--s4); animation: fade .15s var(--ease); }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); width: min(640px, 100%); max-height: min(86vh, 900px); display: flex; flex-direction: column; animation: pop .18s var(--ease); }
.modal.wide { width: min(980px, 100%); }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: var(--s2); }
.modal-h h2 { margin: 0; font-size: 16px; font-weight: 640; }
.modal-b { padding: 20px; overflow: auto; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: var(--s2); justify-content: flex-end; align-items: center; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.985); } }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--raise); border: 1px solid var(--line-2); border-left: 3px solid var(--info); border-radius: var(--r); padding: 10px 12px; box-shadow: var(--shadow); font-size: 13px; animation: pop .2s var(--ease); display: flex; gap: 10px; align-items: flex-start; }
.toast.bad { border-left-color: var(--bad); }
.toast.ok { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--warn); }

/* ---------- Exports & countdown ---------- */
.ready { display: grid; grid-template-columns: 1fr auto; gap: var(--s5); align-items: center; padding: var(--s5); border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.ready h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.015em; }
.countdown { text-align: right; }
.countdown .clock { font-family: var(--mono); font-size: 40px; font-weight: 600; letter-spacing: .02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.countdown.low .clock { color: var(--warn); }
.countdown.expired .clock { color: var(--text-4); }
.countdown .when { font-size: 12px; color: var(--text-3); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s3); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px; }
.stat .l { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.stat .v { font-size: 22px; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat .v.ok { color: var(--ok); } .stat .v.bad { color: var(--bad); }
.item { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); margin-bottom: 8px; }
.item-h { display: grid; grid-template-columns: 22px 1fr auto auto; gap: 12px; align-items: center; padding: 10px 14px; }
.item-b { border-top: 1px solid var(--line); padding: 12px 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--s4); }
.check-list { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.check-list div { display: grid; grid-template-columns: 16px 1fr auto; gap: 8px; align-items: center; }
.pass { color: var(--ok); } .fail { color: var(--bad); } .na { color: var(--text-4); }
.json { font-family: var(--mono); font-size: 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow: auto; margin: 0; color: var(--text-2); }

/* ---------- Credentials ---------- */
.cr-status { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--panel); }
.cr-status .ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.cr-status.trusted .ic { background: var(--ok-soft); color: var(--ok); }
.cr-status.local .ic, .cr-status.untrusted .ic { background: var(--warn-soft); color: var(--warn); }
.cr-status.invalid .ic, .cr-status.error .ic { background: var(--bad-soft); color: var(--bad); }
.cr-status.none .ic, .cr-status.unsupported .ic { background: var(--raise); color: var(--text-3); }
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding-bottom: 12px; position: relative; }
.tl::before { content: ''; position: absolute; left: 8px; top: 18px; bottom: 0; width: 1px; background: var(--line-2); }
.tl:last-child::before { display: none; }
.tl .b { width: 17px; height: 17px; border-radius: 50%; border: 2px solid var(--accent); background: var(--panel); margin-top: 2px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: var(--s5); background: radial-gradient(1200px 600px at 20% -10%, var(--accent-soft), transparent 60%), var(--bg); }
.login .card { width: min(400px, 100%); padding: var(--s6); }
.login h1 { font-size: 22px; letter-spacing: -.02em; margin: var(--s4) 0 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .editor { grid-template-columns: 1fr; }
  .editor-side { position: static; }
  .inspector { grid-template-columns: 1fr; height: auto; }
  .insp-side { border-right: 0; border-bottom: 1px solid var(--line); }
  .insp-preview { max-height: 260px; }
}
@media (max-width: 760px) {
  :root { --nav-w: 0px; }
  .shell { grid-template-columns: 1fr; height: auto; min-height: 100vh; }
  .nav { display: none; }
  .main { min-height: 100vh; }
  .content { overflow: visible; padding-bottom: 72px; }
  .topbar { padding: 0 var(--s4); position: sticky; top: 0; z-index: 20; }
  .page { padding: var(--s4); }
  .mobile-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--bg-2); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .mobile-nav button { background: none; border: 0; color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; padding: 4px 0; cursor: pointer; }
  .mobile-nav button[aria-current='page'] { color: var(--accent); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s2); }
  .tag-row { grid-template-columns: 1fr auto; }
  .tag-row .val { grid-column: 1 / -1; grid-row: 2; }
  .ready { grid-template-columns: 1fr; }
  .countdown { text-align: left; }
  .countdown .clock { font-size: 34px; }
  .upload-row { grid-template-columns: 1fr auto; }
  .upload-row .progress, .upload-row .size { display: none; }
  .list-row { grid-template-columns: 24px 44px 1fr 34px; }
  .list-row .hide-sm { display: none; }
  .insp-bar, .insp-scroll { padding-left: var(--s4); padding-right: var(--s4); }
  .item-h { grid-template-columns: 22px 1fr auto; }
  .item-h .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
