@font-face { font-family: 'Schibsted Grotesk'; font-weight: 400; font-display: swap; src: url('/fonts/schibsted-400.woff2') format('woff2'); }
@font-face { font-family: 'Schibsted Grotesk'; font-weight: 500; font-display: swap; src: url('/fonts/schibsted-500.woff2') format('woff2'); }
@font-face { font-family: 'Schibsted Grotesk'; font-weight: 600; font-display: swap; src: url('/fonts/schibsted-600.woff2') format('woff2'); }
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 700; font-display: swap; src: url('/fonts/bricolage-700.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Serif'; font-weight: 400; font-display: swap; src: url('/fonts/instrument-serif-400.woff2') format('woff2'); }

/* Lumiave brand: deep sea #0B3A48, teal #0E9E93, coral #FF6B57 (the mark's three fills).
   The brand teal is only 3.3:1 on white, so text and buttons use the walked-down
   --a2-deep #097169 (5.5:1); the raw teal is kept for chart bars and the logo. */
:root {
  --bg: #F6F7F7;
  --surface: #FFFFFF;
  --surface-2: #FBFCFC;
  --sunken: #EDEFEF;
  --line: #E2E6E6;
  --line-strong: #C9D2D2;
  --ink: #0C1214;
  --ink-2: #3E4A4C;
  --ink-3: #57666A;
  --accent: #097169;
  --accent-ink: #FFFFFF;
  --accent-soft: #EAF5F1;
  --good: #137a3f;
  --good-soft: #e3f3e9;
  --warn: #9a5b00;
  --warn-soft: #fbf0dc;
  --bad: #b42318;
  --bad-soft: #fdeceb;
  --bar: #0E9E93;
  --shadow: 0 1px 2px rgba(4, 37, 46, .05), 0 0 0 1px var(--line);
  --shadow-lg: 0 20px 50px rgba(4, 37, 46, .2), 0 0 0 1px var(--line);
  --radius: 12px;
  --sans: 'Schibsted Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --wordmark: 'Bricolage Grotesque', var(--sans);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* Sidebar: always on the deep-sea ground, like the site's .on-ink bands. */
  --side-bg: #04252E;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #071A20; --surface: #0B242C; --surface-2: #0E2A32; --sunken: #051419; --line: #153640; --line-strong: #24505B;
    --ink: #EEF5F4; --ink-2: #A9C0C0; --ink-3: #8BA5A6; --accent: #4FC9BF; --accent-ink: #04252E; --accent-soft: #0C2E2A;
    --good: #5cc98a; --good-soft: #10291d; --warn: #e6b04e; --warn-soft: #2c2210; --bad: #FF9B8B; --bad-soft: #351816; --bar: #4FC9BF;
    --shadow: 0 0 0 1px var(--line); --shadow-lg: 0 20px 50px rgba(0, 0, 0, .5), 0 0 0 1px var(--line);
    --side-bg: #04161B; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #071A20; --surface: #0B242C; --surface-2: #0E2A32; --sunken: #051419; --line: #153640; --line-strong: #24505B;
  --ink: #EEF5F4; --ink-2: #A9C0C0; --ink-3: #8BA5A6; --accent: #4FC9BF; --accent-ink: #04252E; --accent-soft: #0C2E2A;
  --good: #5cc98a; --good-soft: #10291d; --warn: #e6b04e; --warn-soft: #2c2210; --bad: #FF9B8B; --bad-soft: #351816; --bar: #4FC9BF;
  --shadow: 0 0 0 1px var(--line); --shadow-lg: 0 20px 50px rgba(0, 0, 0, .5), 0 0 0 1px var(--line);
  --side-bg: #04161B; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14.5px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
[hidden] { display: none !important; }

/* ───── shell ───── */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--side-bg) 236px, transparent 236px); }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--side-bg);
  display: flex; flex-direction: column; gap: 18px; padding: 18px 14px;
  /* Token override, as on the site's dark bands: everything inside inverts on its own. */
  --ink: #EEF5F4; --ink-2: #C3D6D5; --ink-3: #8FB0B0; --line: rgba(238, 245, 244, .1); --line-strong: rgba(238, 245, 244, .2);
  --sunken: rgba(238, 245, 244, .07); --surface: rgba(238, 245, 244, .11); --accent: #4FC9BF; --accent-ink: #04252E;
  --shadow: none; color: var(--ink); color-scheme: dark;
}
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--wordmark); font-weight: 700; font-size: 17px; letter-spacing: -.02em; padding: 0 6px; }
.brand small { font-family: var(--sans); font-weight: 500; font-size: 13px; letter-spacing: 0; color: var(--ink-3); margin-left: -3px; }
.brand-mark { width: 26px; height: 26px; display: block; flex: none; }
.site-pick label { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin: 0 6px 6px; }
.site-pick select { width: 100%; }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--ink-2); text-decoration: none; font-weight: 520;
}
.nav a:hover { background: var(--sunken); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.nav svg { flex: none; color: var(--ink-3); }
.nav a[aria-current="page"] svg { color: var(--accent); }
.nav .count { margin-left: auto; font-size: 12px; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 7px; font-weight: 650; }
.nav-label { font-size: 11.5px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin: 10px 10px 4px; }
.side-foot { margin-top: auto; display: grid; gap: 4px; font-size: 13px; }
.side-foot button { background: none; border: 0; text-align: left; padding: 6px 10px; border-radius: 8px; color: var(--ink-3); cursor: pointer; }
.side-foot button:hover { background: var(--sunken); color: var(--ink); }

.main { padding: 28px 36px 64px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1, .project-title h1 { font-family: var(--serif); font-size: 32px; font-weight: 400; letter-spacing: -.005em; line-height: 1.1; }
.page-head p { margin: 4px 0 0; color: var(--ink-3); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ───── primitives ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  padding: 7px 13px; border-radius: 8px; font-weight: 560; cursor: pointer; text-decoration: none; white-space: nowrap;
  min-height: 36px;
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--sunken); }
.btn.sm { padding: 4px 9px; min-height: 30px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: default; }

input[type=text], input[type=email], input[type=url], input[type=number], input[type=password], input:not([type]), select, textarea {
  width: 100%; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px;
  padding: 8px 10px; min-height: 38px;
}
textarea { min-height: 90px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=color] { width: 44px; height: 38px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); cursor: pointer; }

.field { display: grid; gap: 6px; align-content: start; }
.field > span { font-weight: 600; font-size: 13.5px; }
.field small, .help { color: var(--ink-3); font-size: 12.5px; line-height: 1.45; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stack { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.inline { display: flex; align-items: center; gap: 10px; }

.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.check b { font-weight: 600; display: block; }
.check small { color: var(--ink-3); font-size: 12.5px; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--line-strong); position: relative; cursor: pointer; margin: 0; transition: background .15s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--good); }
.switch input:checked::after { transform: translateX(16px); }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 15px; font-weight: 650; }
.card-head p { margin: 2px 0 0; color: var(--ink-3); font-size: 13px; }
.section-title { font-size: 13px; font-weight: 650; color: var(--ink-2); margin: 28px 0 10px; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--sunken); color: var(--ink-2); white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

.note { border-radius: 10px; padding: 12px 14px; background: var(--sunken); color: var(--ink-2); font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note svg { flex: none; margin-top: 1px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--ink-3); text-decoration: none; font-weight: 560; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--ink); }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.truncate { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.muted { color: var(--ink-3); }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-3); }
.empty h3 { color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* ───── overview ───── */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { padding: 18px 20px; display: grid; gap: 4px; text-decoration: none; color: inherit; }
.stat:hover { box-shadow: 0 0 0 1px var(--line-strong), 0 2px 6px rgba(0,0,0,.05); }
.stat .label { font-size: 13px; color: var(--ink-3); font-weight: 560; display: flex; gap: 8px; align-items: center; }
.stat .value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat .sub { font-size: 13px; color: var(--ink-2); }
.tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tool { padding: 18px 20px; display: grid; gap: 10px; align-content: start; }
.tool-top { display: flex; align-items: center; gap: 10px; }
.tool-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.tool h3 { font-size: 15px; font-weight: 650; }
.tool p { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.chart { padding: 18px 20px 14px; position: relative; }
.chart h3 { font-size: 14px; font-weight: 650; }
.chart .total { font-size: 13px; color: var(--ink-3); margin-bottom: 10px; }
.chart svg { display: block; width: 100%; height: 120px; overflow: visible; }
.chart .axis { fill: var(--ink-3); font-size: 11px; }
.chart .base { stroke: var(--line-strong); }
.chart .hit { fill: transparent; cursor: default; }
.chart .bar { fill: var(--bar); }
.chart .bar.zero { fill: var(--line); }
.chart g:hover .bar { opacity: .75; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 12.5px; padding: 5px 9px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -100%); margin-top: -8px; }

/* ───── inbox ───── */
.inbox { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); min-height: 560px; overflow: hidden; }
.inbox-list { border-right: 1px solid var(--line); overflow-y: auto; max-height: 72vh; }
.inbox-tools { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.inbox-tools input { flex: 1; min-width: 120px; }
.inbox-tools select { width: auto; }
.msg-row { display: grid; gap: 2px; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; background: none; border-left: 3px solid transparent; width: 100%; text-align: left; border-top: 0; border-right: 0; }
.msg-row:hover { background: var(--surface-2); }
.msg-row[aria-current="true"] { background: var(--accent-soft); border-left-color: var(--accent); }
.msg-row .top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.msg-row .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-row.unread .who::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 2px; }
.msg-row .when { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.msg-row .preview { color: var(--ink-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail { padding: 24px 28px; overflow-y: auto; max-height: 72vh; }
.detail h2 { font-size: 19px; margin-bottom: 4px; }
.meta { display: flex; gap: 6px 14px; flex-wrap: wrap; color: var(--ink-3); font-size: 13px; margin-bottom: 18px; }
.fields { display: grid; grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); gap: 0; border-top: 1px solid var(--line); margin-bottom: 20px; }
.fields dt, .fields dd { padding: 10px 0; border-bottom: 1px solid var(--line); margin: 0; }
.fields dt { color: var(--ink-3); font-size: 13px; padding-right: 20px; font-weight: 560; }
.fields dd { white-space: pre-wrap; word-break: break-word; }

/* ───── settings + preview ───── */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 20px; align-items: start; }
.preview { position: sticky; top: 20px; overflow: hidden; }
.preview iframe { width: 100%; height: 620px; border: 0; display: block; background: #fff; border-radius: 0 0 var(--radius) var(--radius); }
.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.save-bar { position: sticky; bottom: 0; display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding: 14px 20px; background: var(--surface); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.save-bar .help { margin-right: auto; }
.radios { display: flex; gap: 8px; flex-wrap: wrap; }
.radios label { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 11px; cursor: pointer; }
.radios input { accent-color: var(--accent); margin: 0; }
.radios label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

.issue { border-top: 1px solid var(--line); padding: 14px 20px; display: grid; gap: 6px; }
.issue-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.issue-head b { font-weight: 650; }
.issue ul { margin: 2px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; }
.issue ul code { word-break: break-all; }
details.page > summary { list-style: none; cursor: pointer; padding: 14px 20px; display: flex; gap: 12px; align-items: center; }
details.page > summary::-webkit-details-marker { display: none; }
details.page > summary:hover { background: var(--surface-2); }
details.page + details.page { border-top: 1px solid var(--line); }
.chev { transition: transform .15s; color: var(--ink-3); flex: none; }
details[open] .chev { transform: rotate(90deg); }

.hbar { display: grid; grid-template-columns: minmax(120px, 180px) minmax(0, 1fr) 48px; gap: 12px; align-items: center; padding: 6px 0; }
.hbar .track { height: 10px; background: var(--sunken); border-radius: 4px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--bar); border-radius: 0 4px 4px 0; }

/* ───── code ───── */
.code { position: relative; background: var(--sunken); border: 1px solid var(--line); border-radius: 10px; }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 12.5px/1.6 var(--mono); white-space: pre; }
.code .copy { position: absolute; top: 8px; right: 8px; }
.code.prompt pre { white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow-y: auto; font-size: 12.5px; }
.platforms { display: flex; flex-wrap: wrap; gap: 6px; }
.platforms button { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 6px 13px; font-weight: 560; cursor: pointer; color: var(--ink-2); }
.platforms button:hover { border-color: var(--ink-3); color: var(--ink); }
.platforms button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
h3.sub { font-size: 14px; font-weight: 650; margin: 4px 0 -4px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); }

/* ───── chat ───── */
.transcript { display: grid; gap: 10px; }
.bubble { max-width: 80%; padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; }
.bubble.user { justify-self: end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.bubble.bot { justify-self: start; background: var(--sunken); border-bottom-left-radius: 4px; }
.bubble-meta { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.tester { display: grid; grid-template-rows: minmax(0, 1fr) auto; height: 560px; }
.tester .transcript { overflow-y: auto; padding: 20px; align-content: start; }
.tester form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.progress { height: 8px; background: var(--sunken); border-radius: 4px; overflow: hidden; }
.progress div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }

/* ───── login / onboarding ───── */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login { width: 100%; max-width: 380px; padding: 32px; display: grid; gap: 18px; }
.login h1 { font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.1; }
.login p { margin: 0; color: var(--ink-3); }
.onboard { max-width: 560px; width: 100%; padding: 32px; display: grid; gap: 18px; }

/* ───── dialog + toasts ───── */
dialog {
  border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgba(4, 37, 46, .5); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 16px; }
.modal-body { padding: 20px; display: grid; gap: 16px; overflow-y: auto; max-height: calc(100vh - 200px); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
dialog.wide { width: min(820px, calc(100vw - 32px)); }

#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; justify-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 520; animation: up .2s ease-out; }
.toast.error { background: var(--bad); color: #fff; }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* ───── projects ───── */
a.brand { color: inherit; text-decoration: none; }
.avatar { width: 22px; height: 22px; border-radius: 6px; background: var(--sunken); color: var(--ink-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; box-shadow: inset 0 0 0 1px var(--line); }
.nav a[aria-current="page"] .avatar { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.avatar.lg { width: 40px; height: 40px; border-radius: 10px; font-size: 17px; }
.nav-add { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; border: 0; background: none; color: var(--ink-3); cursor: pointer; font-weight: 520; text-align: left; }
.nav-add:hover { background: var(--sunken); color: var(--ink); }

.project-head { margin-bottom: 22px; }
.crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--ink-3); margin-bottom: 4px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.project-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }

.project-tabs { margin-bottom: 0; }
.project-tabs a { display: inline-flex; align-items: center; gap: 7px; }
.project-tabs a svg { color: var(--ink-3); }
.project-tabs a[aria-current="page"] svg { color: var(--accent); }
.project-tabs .count { font-size: 11.5px; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 7px; font-weight: 650; }
.page-head h2 { font-size: 18px; font-weight: 650; }

.subtabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--sunken); border-radius: 10px; margin-bottom: 20px; max-width: 100%; overflow-x: auto; }
.subtabs a { padding: 6px 12px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 560; font-size: 13.5px; white-space: nowrap; }
.subtabs a:hover { color: var(--ink); }
.subtabs a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.projects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.project { display: grid; gap: 16px; padding: 18px 20px; text-decoration: none; color: inherit; align-content: start; }
.project:hover { box-shadow: 0 0 0 1px var(--line-strong), 0 4px 14px rgba(0,0,0,.06); }
.project-top { display: flex; gap: 12px; align-items: center; }
.project-top h2 { font-size: 16px; font-weight: 650; }
.project-top .muted { font-size: 13px; display: block; }
.project-tools { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.project-tools > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.project-tools > div:last-child { border-bottom: 0; padding-bottom: 0; }
.project-tools dt { display: flex; align-items: center; gap: 8px; font-weight: 560; color: var(--ink-2); font-size: 13.5px; }
.project-tools dt svg { color: var(--ink-3); }
.project-tools dd { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.metric { font-size: 12.5px; color: var(--ink-3); }
.project.add { border: 1.5px dashed var(--line-strong); box-shadow: none; background: transparent; place-items: center; align-content: center; min-height: 200px; color: var(--ink-3); cursor: pointer; font-weight: 600; gap: 8px; }
.project.add:hover { color: var(--ink); border-color: var(--ink-3); }

/* ───── responsive: keep ALL media queries at the end so they win over the base rules ───── */
@media (max-width: 1100px) {
  .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .preview { position: static; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tools { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .site-pick { flex: 1; min-width: 160px; }
  .site-pick label { display: none; }
  .nav { order: 3; width: 100%; display: flex; overflow-x: auto; gap: 4px; padding-bottom: 2px; }
  .nav a { white-space: nowrap; padding: 7px 10px; }
  .nav-label, .nav a:has(.avatar), .nav-add { display: none; }
  .side-foot { margin: 0; display: flex; }
  .main { padding: 20px 16px 48px; }
  .charts { grid-template-columns: minmax(0, 1fr); }
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .inbox-list { border-right: 0; max-height: 46vh; border-bottom: 1px solid var(--line); }
  .detail { padding: 20px 16px; max-height: none; }
}
@media (max-width: 560px) {
  .projects { grid-template-columns: minmax(0, 1fr); }
  .project-title h1 { font-size: 26px; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .row, .row-3, .feature-grid { grid-template-columns: minmax(0, 1fr); }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .fields dt { border-bottom: 0; padding-bottom: 0; }
  .hbar { grid-template-columns: minmax(0, 1fr) 40px; }
  .hbar .track { grid-column: 1 / -1; grid-row: 2; }
  .table th, .table td { padding: 10px 12px; }
  .hide-sm { display: none; }
  .page-head h1 { font-size: 26px; }
}

/* ───── desktop app (Electron adds "SitekitApp" to the user agent) ───── */
.desktop .side { padding-top: 46px; }
.desktop .side::before { content: ""; position: absolute; inset: 0 0 auto; height: 40px; -webkit-app-region: drag; }
.desktop .side a, .desktop .side button { -webkit-app-region: no-drag; }
.desktop .center { -webkit-app-region: drag; }
.desktop .center .card { -webkit-app-region: no-drag; }
