@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

/* Frame it Grafit, with the Koxit sky accent. */
:root {
  color-scheme: dark;
  --bg: #0d0e10;
  --side: #111214;
  --panel: #16181b;
  --panel-2: #1c1f23;
  --hover: #22262b;
  --line: #24272c;
  --line-2: #30343a;
  --text: #ecedee;
  --text-2: #a0a5ac;
  --muted: #9298a1;
  --blue: #3aa4ea;
  --green: #3ecf8e;
  --amber: #f5b544;
  --red: #f0524f;
  --violet: #8b7cf6;
  --radius: 14px;
  --gutter: clamp(16px, 3.5vw, 44px);
  --sans: "Schibsted Grotesk", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--text); font: 14.5px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button[disabled] { cursor: default; opacity: .5; }
a { color: inherit; }
svg { flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
::selection { background: var(--blue); color: #0b1014; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
:focus-visible:not(:is(button, a, input, textarea, select, summary)) { outline-offset: -2px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 32px; line-height: 1.12; letter-spacing: -.035em; }
h2 { font-size: 17px; line-height: 1.25; font-weight: 680; letter-spacing: -.017em; }
h3 { font-size: 15px; line-height: 1.35; font-weight: 650; }
strong { font-weight: 660; }
.subtle { color: var(--text-2); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.numeric, time { font-variant-numeric: tabular-nums; }
.eyebrow { margin-bottom: 5px; color: var(--muted); font: 500 11px/1.45 var(--mono); letter-spacing: .075em; text-transform: uppercase; }
.positive { color: var(--green); }
.negative { color: #ff7876; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 8px 12px; background: var(--text); color: var(--bg); transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 290px minmax(0, 1fr); }
.shell.folded { grid-template-columns: 62px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 20px; padding: 20px 14px 14px; background: var(--side); border-right: 1px solid var(--line); }
.sidebar-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 6px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 16px; font-weight: 720; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; flex: none; background: color-mix(in srgb, var(--blue) 17%, var(--panel)); border: 1px solid color-mix(in srgb, var(--blue) 28%, var(--line)); border-radius: 8px; color: #7bc9ff; font: 650 20px/1 var(--sans); }
.navigation { display: grid; gap: 3px; }
.navigation a, .nav-more { display: flex; align-items: center; gap: 11px; min-height: 36px; width: 100%; padding: 0 10px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--text-2); text-decoration: none; font-weight: 510; transition: background .15s, color .15s; }
.navigation a:hover, .nav-more:hover { background: var(--hover); color: var(--text); }
.navigation a[aria-current="page"], .nav-more[aria-expanded="true"] { background: var(--panel-2); color: var(--text); border-color: var(--line); }
.navigation a[aria-current="page"] svg, .nav-more.is-current svg { color: var(--blue); }
.nav-more { display: none; }
.mobile-links { display: contents; }
.sidebar-footer { margin-top: auto; display: grid; gap: 12px; }
.sidebar-footer #voice-launch { justify-content: flex-start; }
.sidebar-footer #voice-launch svg { color: var(--blue); }
.account { display: flex; align-items: center; gap: 9px; border-top: 1px solid var(--line); padding: 12px 3px 0; min-width: 0; }
.account-text { display: grid; min-width: 0; flex: 1; }
.account strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account small { color: var(--muted); font-size: 11px; }
.account-dot { width: 7px; height: 7px; flex: none; margin-left: 3px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 13%, transparent); }
.folded .sidebar { padding-inline: 10px; }
.folded .sidebar-top { flex-direction: column; padding: 0; }
.folded .navigation a, .folded #voice-launch, .folded .account { justify-content: center; padding-inline: 0; }
.folded .brand > span:last-child, .folded .navigation a span, .folded #voice-launch span, .folded .account-text, .folded .account-dot { display: none; }

.content { max-width: 1280px; margin-inline: auto; padding: 0 var(--gutter) 52px; min-width: 0; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 33px 0 22px; }
.page-header .subtle { margin-top: 7px; }
.page-header > div:first-child { min-width: 0; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px; padding: 0 12px; border: 1px solid transparent; border-radius: 8px; line-height: 1.2; font-size: 13px; font-weight: 640; text-decoration: none; text-align: center; transition: background .15s, border-color .15s, color .15s, transform .1s; }
.button:active:not(:disabled) { transform: scale(.98); }
.button-primary { background: var(--text); color: #111214; }
.button-primary:hover:not(:disabled) { background: #bde4ff; }
.button-secondary { border-color: var(--line-2); background: transparent; color: var(--text); }
.button-secondary:hover:not(:disabled) { background: var(--hover); border-color: #515761; }
.button-quiet { background: transparent; color: var(--text-2); }
.button-quiet:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.button-danger { border-color: color-mix(in srgb, var(--red) 42%, var(--line)); background: color-mix(in srgb, var(--red) 8%, var(--panel)); color: #ff9b98; }
.button-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--red) 18%, var(--panel)); }
.button-small { min-height: 30px; padding-inline: 9px; }
.icon-button { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); flex: none; }
.icon-button:hover { background: var(--hover); color: var(--text); }

.panel, .metric { min-width: 0; overflow-wrap: anywhere; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel + .panel { margin-top: 12px; }
.panel-heading { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; justify-content: space-between; margin-bottom: 15px; }
.panel-heading .subtle { margin-top: 5px; font-size: 13px; }
.grid { display: grid; gap: 12px; }
.grid > .panel { margin: 0; }
.metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 12px; }
.metric { --accent: var(--blue); position: relative; min-height: 142px; display: flex; flex-direction: column; gap: 8px; isolation: isolate; }
.metric::after { content: ""; z-index: -1; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(ellipse at 100% 100%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 66%); pointer-events: none; }
.metric[data-tone="violet"] { --accent: var(--violet); }
.metric[data-tone="amber"] { --accent: var(--amber); }
.metric-label { display: flex; align-items: center; gap: 8px; }
.metric-label i { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.metric .eyebrow { margin: 0; }
.metric-value { font-size: clamp(26px, 3vw, 37px); font-weight: 740; line-height: 1.1; letter-spacing: -.04em; }
.metric .subtle { margin-top: auto; font-size: 13px; }
.overview-grid { grid-template-columns: minmax(0, 1.57fr) minmax(230px, 1fr); }
.settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 12px; }
.quick-links { display: grid; gap: 7px; }
.quick-links a { display: flex; align-items: center; gap: 9px; padding: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; text-decoration: none; }
.quick-links a:hover { background: var(--hover); }
.quick-links a > :first-child { color: var(--blue); }
.quick-links a > :last-child { margin-left: auto; color: var(--muted); }
.stack { display: grid; gap: 12px; }
.empty { display: grid; justify-items: center; gap: 8px; padding: 28px 12px; text-align: center; }
.empty h3 { font-size: 16px; }
.empty p { color: var(--text-2); max-width: 46ch; font-size: 13.5px; }
.empty .actions { margin-top: 4px; justify-content: center; }
.empty-icon { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--blue); }
.badge { display: inline-flex; align-items: center; width: fit-content; gap: 6px; border: 1px solid var(--line-2); border-radius: 99px; padding: 2px 8px; color: var(--text-2); background: var(--panel-2); font: 500 10.5px/1.45 var(--mono); }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-warn { color: var(--amber); background: color-mix(in srgb, var(--amber) 9%, var(--panel)); }
.badge-live { color: var(--green); background: color-mix(in srgb, var(--green) 9%, var(--panel)); }
.badge-blue { color: #87cdff; background: color-mix(in srgb, var(--blue) 9%, var(--panel)); }
.filters { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 13px; }
.filter { display: inline-flex; align-items: center; gap: 5px; padding: 0 12px; min-height: 30px; border-radius: 99px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font: inherit; font-size: 13px; }
.filter:hover { color: var(--text); background: var(--hover); }
.filter[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #111; font-weight: 600; }
.callout { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text-2); font-size: 13px; }
.callout svg { color: var(--blue); margin-top: 1px; }
.callout-warning { border-color: color-mix(in srgb, var(--amber) 32%, var(--line)); }
.callout-warning svg { color: var(--amber); }
.callout + .panel, .panel + .callout { margin-top: 12px; }

.table-wrap { position: relative; overflow-x: auto; margin-top: 8px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; text-align: left; }
.data-table th { border-bottom: 1px solid var(--line-2); padding: 8px 10px; white-space: nowrap; color: var(--muted); font: 500 10.5px var(--mono); text-transform: uppercase; }
.data-table td { border-bottom: 1px solid var(--line); padding: 8px 10px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--panel-2); }
.data-table .numeric { text-align: right; white-space: nowrap; }
.data-table .row-action { text-align: right; }
.data-table .row-head { min-width: 148px; }
.data-table .row-head small { display: block; color: var(--text-2); font: 11px/1.5 var(--mono); }
.data-table .depot-name { min-width: 82px; }
.table-name { display: inline; padding: 0; border: 0; background: transparent; color: var(--text); font-weight: 650; text-align: left; }
.table-name:hover { color: #9bd8ff; text-decoration: underline; text-underline-offset: 3px; }
.clean-list { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; align-items: center; gap: 10px 14px; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); }
.list-row:last-child { padding-bottom: 0; }
.list-row:first-child { border-top: 0; padding-top: 0; }
.list-row .subtle { font-size: 13px; margin-top: 3px; }
.list-row > :first-child { min-width: 0; }
.list-row .actions { justify-content: flex-end; flex: 0 1 auto; min-width: 0; }
.group + .group { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.group h3 { margin-bottom: 10px; }
.notice { display: grid; gap: 8px; padding: 13px 0; border-top: 1px solid var(--line); }
.notice:first-child { padding-top: 0; border-top: 0; }
.notice:last-child { padding-bottom: 0; }
.notice-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.notice time { color: var(--muted); font: 11px var(--mono); }
.notice-text { white-space: pre-wrap; }
.notice-feedback[aria-pressed="true"] { border-color: var(--blue); color: #9bd8ff; }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 12px; }
.field-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { min-width: 0; display: grid; gap: 5px; align-content: start; color: var(--text-2); font-size: 13px; }
.field > span { font-weight: 590; }
.field-required { color: #83c8f9; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; min-height: 36px; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line-2); background: #121416; color: var(--text); }
.field input[type="file"] { padding: 6px; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); }
.field input::placeholder, .field textarea::placeholder { color: #8d939c; }
.field-foot { align-self: end; margin-bottom: 1px; }
.form-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.form-error { padding: 9px 11px; border: 1px solid color-mix(in srgb, var(--red) 42%, var(--line)); border-radius: 8px; background: color-mix(in srgb, var(--red) 9%, var(--panel)); color: #ffaaa7; font-size: 13px; }
details > summary { cursor: pointer; color: var(--text-2); }
details > summary:hover { color: var(--text); }
details[open] > summary { margin-bottom: 10px; }
.check { display: flex; align-items: start; gap: 8px; }
.check input { accent-color: var(--blue); margin: 4px 0 0; width: 16px; height: 16px; }
.section-note { color: var(--text-2); font-size: 13px; }
.detail-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin: 0; }
.detail-values div { padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); overflow-wrap: anywhere; }
.detail-values dt { color: var(--text-2); font-size: 12px; }
.detail-values dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.dialog { width: min(560px, calc(100% - 24px)); max-width: none; max-height: calc(100% - 26px); max-height: calc(100dvh - 26px); padding: 0; border: 1px solid var(--line-2); border-radius: 18px; background: var(--panel); color: var(--text); box-shadow: 0 35px 100px #000a; overscroll-behavior: contain; }
.dialog.dialog-wide { width: min(840px, calc(100% - 24px)); }
.dialog::backdrop { background: #050607b0; backdrop-filter: blur(4px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 18px 20px 12px; }
.dialog-heading h2 { font-size: 21px; overflow-wrap: anywhere; }
.dialog-heading .subtle { margin-top: 6px; }
.dialog-heading .icon-button { margin: -3px -5px 0 0; }
.dialog-content { display: grid; gap: 12px; padding: 2px 20px 18px; }
.dialog-actions { position: sticky; z-index: 1; bottom: 0; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; padding: 11px 20px 14px; border-top: 1px solid var(--line); background: var(--panel); }
.dialog-actions .button { min-height: 38px; }
.dialog-actions > [data-action="delete-position"], .dialog-actions > [data-action="delete-watch"] { margin-right: auto; }
.import-entry { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.import-preview { display: grid; gap: 9px; }
.import-entry, .import-preview { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--side); }
.import-row { min-width: 0; margin: 0; padding: 10px; border: 1px solid var(--line-2); border-radius: 9px; }
.import-row legend { padding-inline: 5px; color: var(--text-2); font: 500 11px var(--mono); }
.import-row .field-grid + details { margin-top: 9px; }
.import-summary { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.import-warning { color: var(--amber); font-size: 13px; }
.import-warning ul { margin: 6px 0 0; padding-left: 18px; }

.chat { display: grid; gap: 12px; }
.chat-log { display: grid; gap: 10px; max-height: 480px; overflow-y: auto; }
.chat-line { padding: 11px 13px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--panel-2); min-width: 0; overflow-wrap: anywhere; }
.chat-line.user { justify-self: end; background: color-mix(in srgb, var(--blue) 10%, var(--panel)); max-width: 92%; }
.chat-line p { white-space: pre-wrap; }
.chat-line .eyebrow { color: var(--text-2); }
.chat-compose { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.chat-compose textarea { min-height: 64px; }
.settings-model { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 7px; }
.settings-fields { display: grid; gap: 10px; }
.settings-fields .field-grid { grid-column: 1 / -1; }
.content > form[data-form="settings"] { margin-bottom: 12px; }
.settings-note { margin-top: 10px; }
.account-logout-mobile { display: none; }
.voice-dialog .subtle { padding: 0 20px 12px; }
.voice-status { display: flex; align-items: center; gap: 9px; padding: 13px; margin: 0 20px 13px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel-2); }
.voice-indicator { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--muted); }
.voice-indicator[data-state="connecting"] { background: var(--blue); animation: pulse 1.5s ease infinite; }
.voice-indicator[data-state="live"] { background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 14%, transparent); }
.voice-indicator[data-state="error"] { background: var(--red); }
@keyframes pulse { 50% { opacity: .42; } }
.voice-transcript { display: grid; gap: 8px; max-height: 260px; overflow: auto; margin: 0 20px 15px; }
.voice-transcript .chat-line { font-size: 13px; }

.gate { display: grid; min-height: 100vh; min-height: 100dvh; place-items: center; padding: 16px; }
.gate-card { display: grid; gap: 12px; justify-items: center; width: min(100%, 415px); padding: 28px; text-align: center; border: 1px solid var(--line-2); border-radius: 18px; background: var(--panel); }
.gate-card .brand-mark { width: 39px; height: 39px; font-size: 24px; }
.gate-card p { color: var(--text-2); }
.gate-card .button { min-height: 40px; }
.toasts { position: fixed; z-index: 30; right: 17px; bottom: 17px; max-width: min(415px, calc(100vw - 34px)); }
.toast { padding: 10px 13px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel-2); box-shadow: 0 15px 32px #0007; color: var(--text); font-size: 13px; overflow-wrap: anywhere; }
.toast.error { border-color: color-mix(in srgb, var(--red) 48%, var(--line)); }

@media (max-width: 1100px) {
  .metric { min-height: 130px; }
  .overview-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (min-width: 761px) and (max-width: 910px) {
  .shell { grid-template-columns: 208px minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .shell, .shell.folded { display: block; }
  .sidebar { z-index: 20; position: fixed; inset: auto 0 0; height: auto; padding: 5px 6px max(8px, env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line-2); }
  .sidebar-top, .sidebar-footer { display: none; }
  .navigation { position: relative; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; }
  .navigation > a, .nav-more { display: flex; flex-direction: column; min-height: 48px; justify-content: center; gap: 2px; padding: 3px 2px; font-size: 10px; line-height: 1.15; }
  .folded .navigation a span { display: inline; }
  .navigation > a svg, .nav-more svg { width: 17px; height: 17px; }
  .mobile-links { display: none; position: absolute; right: 2px; bottom: calc(100% + 12px); width: min(245px, calc(100vw - 16px)); padding: 6px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--panel); box-shadow: 0 18px 32px #000b; }
  .mobile-links[data-open] { display: grid; gap: 2px; }
  .mobile-links a { min-height: 44px; }
  .content { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .page-header { padding: 24px 0 18px; gap: 12px; }
  .page-header .actions { width: 100%; }
  h1 { font-size: 28px; }
  .metrics { grid-template-columns: 1fr; }
  .metric { min-height: 105px; }
  .button, .icon-button, .dialog-actions .button, .filter { min-height: 44px; }
  .icon-button { width: 44px; }
  .panel, .metric { padding: 14px; }
  .account-logout-mobile { display: inline-flex; }
  .toasts { bottom: calc(69px + env(safe-area-inset-bottom)); }
  .import-entry { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .field-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .list-row { align-items: flex-start; flex-wrap: wrap; }
  .list-row .actions { justify-content: flex-start; flex-basis: 100%; }
  .chat-compose { grid-template-columns: minmax(0, 1fr); }
  .chat-compose .button { justify-self: end; }
  .dialog-heading { padding-inline: 14px; }
  .dialog-content, .dialog-actions { padding-inline: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
