/* Självhostade typsnitt (SIL OFL). Bricolage Grotesque = display. Instrument Sans = text och data (tnum). */
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 500 800; font-display: swap; src: url('fonts/bricolage-grotesque-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 500 800; font-display: swap; src: url('fonts/bricolage-grotesque-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('fonts/instrument-sans-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('fonts/instrument-sans-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Alla utseendeval ligger här som tokens. Komponenter (app.css) läser bara tokens.
   Nytt utseende = nytt html[data-tema="..."]-block, aldrig ändrade komponentregler. */
:root {
  /* typsnitt */
  --font-display: 'Bricolage Grotesque', 'Segoe UI', sans-serif;
  --font-text: 'Instrument Sans', 'Segoe UI', sans-serif;
  --font-data: var(--font-text);
  --w-display: 700;
  --w-strong: 650;

  /* ytor: sida < panel < upphöjt */
  --paper: #eee9dd;
  --surface: #f8f5ec;
  --lift: #fffdf7;
  --zebra: #f1ede1;
  --hover: #e9e3d2;
  --line: #d6cfbb;
  --line-strong: #1b2420;

  /* text */
  --ink: #1b2420;
  --ink-2: #4a5650;
  --ink-3: #66726b;
  --on-solid: #ffffff;
  --on-warm: #1b2420;

  /* accent = primär handling och fokus */
  --accent: #6a1f4e;
  --accent-tint: #e8d6df;
  --on-accent: #ffffff;
  --focus: #6a1f4e;

  /* semantik: varje betydelse har en färg */
  --ok: #2b7549;
  --ny: #2a5fb0;
  --pagar: #1b7373;
  --vantar: #e3a62c;
  --fel: #b23a2e;
  --stangt: #6f7771;
  --ok-tint: #dbe8dc;
  --ny-tint: #d9e3f2;
  --pagar-tint: #d4e6e4;
  --vantar-tint: #f3e4bf;
  --fel-tint: #f1d8d3;
  --stangt-tint: #e3e2da;

  /* sidhuvud */
  --head-bg: #1b2420;
  --head-ink: #f3efe3;
  --head-dim: #a9b3ab;
  --head-line: #34413a;

  /* form och djup */
  --r-s: 4px;
  --r-m: 10px;
  --lift-shadow: 0 1px 0 rgba(27, 36, 32, .06), 0 10px 28px -12px rgba(27, 36, 32, .35);
  --row-h: 44px;
  --gap: 16px;
}

html[data-tema='natt'] {
  --paper: #131815;
  --surface: #1b221e;
  --lift: #232c27;
  --zebra: #1f2723;
  --hover: #2a352f;
  --line: #34413a;
  --line-strong: #ece7d9;
  --ink: #ece7d9;
  --ink-2: #b4bdb5;
  --ink-3: #8e9992;
  --on-solid: #0f1512;
  --on-warm: #0f1512;
  --accent: #e6a3cb;
  --accent-tint: #3a2733;
  --on-accent: #0f1512;
  --focus: #e6a3cb;
  --ok: #4fb27a;
  --ny: #6c9be6;
  --pagar: #4db5b0;
  --vantar: #e9b44c;
  --fel: #e5766a;
  --stangt: #8c958f;
  --ok-tint: #1f3328;
  --ny-tint: #1f2c42;
  --pagar-tint: #1d3534;
  --vantar-tint: #3a3220;
  --fel-tint: #3c2420;
  --stangt-tint: #2a2f2c;
  --head-bg: #0b0f0d;
  --head-ink: #ece7d9;
  --head-dim: #8e9992;
  --head-line: #2a352f;
  --lift-shadow: 0 1px 0 rgba(0, 0, 0, .4), 0 14px 32px -12px rgba(0, 0, 0, .8);
}

/* Komponenter läser bara tokens (tokens.css). Inga hex-värden, typsnittsnamn eller radier här. */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; -webkit-text-size-adjust: 100%; }
html[data-tema='natt'] { color-scheme: dark; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 14.5px/1.5 var(--font-text); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-display); font-weight: var(--w-display); letter-spacing: -.02em; margin: 0; font-optical-sizing: auto; }
a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
code { font: 500 12.5px/1.4 var(--font-data); background: var(--zebra); padding: 1px 5px; border-radius: var(--r-s); word-break: break-all; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.dim { color: var(--ink-3); }
.small { font-size: 12.5px; }
.micro { font: 700 11px/1 var(--font-text); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.bad-text { color: var(--fel); font-weight: 600; }
.lead { color: var(--ink-2); font-size: 15.5px; max-width: 70ch; margin: 6px 0 14px; }
.lead.small { font-size: 13.5px; }

/* ---------------------------------------------------------------- sidhuvud */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 22px; padding: 0 24px; height: 58px; background: var(--head-bg); color: var(--head-ink); }
.brand { white-space: nowrap; flex: none; display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--head-ink); }
.brand span { display: flex; flex-direction: column; line-height: 1.05; }
.brand b { font: 700 17px/1 var(--font-display); letter-spacing: -.02em; }
.brand small { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--head-dim); margin-top: 3px; }
.tabs { display: flex; gap: 2px; align-self: stretch; }
.tabs a { white-space: nowrap; display: flex; align-items: center; padding: 0 14px; text-decoration: none; color: var(--head-dim); font-weight: 600; box-shadow: inset 0 -3px 0 transparent; }
.tabs a:hover { color: var(--head-ink); }
.tabs a.on { color: var(--head-ink); box-shadow: inset 0 -3px 0 var(--accent); }
.tabs.sub { background: none; margin: 4px 0 18px; border-bottom: 1px solid var(--line); height: auto; align-self: auto; }
.tabs.sub a { color: var(--ink-3); padding: 10px 16px 9px 0; margin-right: 12px; }
.tabs.sub a.on { color: var(--ink); box-shadow: inset 0 -3px 0 var(--accent); }
.searchbox { position: relative; flex: 1 1 240px; min-width: 200px; max-width: 460px; margin-left: auto; }
.searchbox input { width: 100%; height: 36px; padding: 0 34px 0 12px; border: 1px solid var(--head-line); border-radius: var(--r-s); background: transparent; color: var(--head-ink); font: inherit; }
.searchbox input::placeholder { color: var(--head-dim); }
.searchbox input:focus { outline: 2px solid var(--accent); border-color: transparent; background: var(--head-line); }
.searchbox kbd { position: absolute; right: 9px; top: 9px; font: 600 11px/1 var(--font-text); color: var(--head-dim); border: 1px solid var(--head-line); border-radius: var(--r-s); padding: 3px 6px; }
.right { display: flex; align-items: center; gap: 10px; }
.age { color: var(--head-dim); font-size: 12px; white-space: nowrap; }
@media (max-width: 1240px) { .age { display: none; } }
.icon, .right select, .user { background: transparent; color: var(--head-ink); border: 1px solid var(--head-line); border-radius: var(--r-s); height: 34px; }
.icon { width: 34px; display: grid; place-items: center; }
.right select { padding: 0 8px; font: inherit; }
.right select option { color: var(--ink); background: var(--surface); }
.user { padding: 0 11px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.icon:hover, .user:hover, .right select:hover { background: var(--head-line); }
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 40; background: transparent; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }

main { max-width: 1280px; margin: 0 auto; padding: 28px 24px 80px; outline: none; }
.pagehead { font-size: 34px; margin: 0 0 18px; }
section { margin-top: 30px; }
.sechead { display: flex; align-items: baseline; gap: 14px; justify-content: space-between; margin-bottom: 10px; }
.sechead h2 { font-size: 21px; }
.count { font: 600 12px/1 var(--font-text); background: var(--ink); color: var(--paper); padding: 3px 7px; border-radius: var(--r-s); margin-left: 8px; vertical-align: 3px; }

/* --------------------------------------------------------- nyckeltalsremsa */
.strip { display: flex; gap: 2px; margin: 0 0 18px; }
.strip > div { flex: 1; background: var(--surface); padding: 12px 16px 13px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.strip > div.s-main { flex: 2.2; background: var(--ink); color: var(--paper); }
.strip > div.s-main .micro { color: var(--head-dim); }
.strip > div.s-main.bad { background: var(--fel); color: var(--on-solid); }
.strip > div.s-main.bad .micro { color: var(--on-solid); }
.strip b { font: 700 34px/1 var(--font-display); letter-spacing: -.03em; }
.strip b.small { font-size: 19px; line-height: 1.2; }
.strip em { font-style: normal; font-size: 12px; opacity: .75; }
.strip .bad { background: var(--fel-tint); }
.strip .bad b { color: var(--fel); }
.strip .warn { background: var(--vantar-tint); }
.strip.big b { font-size: 44px; }

/* --------------------------------------------------------------- chips m.m. */
.chip { display: inline-block; font: 700 10.5px/1 var(--font-text); letter-spacing: .07em; text-transform: uppercase; padding: 5px 7px; border-radius: var(--r-s); color: var(--on-solid); white-space: nowrap; }
.chip.t-ok { background: var(--ok); } .chip.t-ny { background: var(--ny); } .chip.t-pagar { background: var(--pagar); }
.chip.t-vantar { background: var(--vantar); color: var(--on-warm); } .chip.t-fel { background: var(--fel); }
.chip.t-stangt, .chip.outline { background: transparent; color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--stangt); }
.scope { display: inline-block; font: 600 11.5px/1 var(--font-text); padding: 4px 7px; border-radius: var(--r-s); background: var(--zebra); box-shadow: inset 0 0 0 1px var(--line); }
.scope.global { background: var(--ink); color: var(--paper); box-shadow: none; letter-spacing: .04em; }
.t-ok { --c: var(--ok); --ct: var(--ok-tint); } .t-ny { --c: var(--ny); --ct: var(--ny-tint); } .t-pagar { --c: var(--pagar); --ct: var(--pagar-tint); }
.t-vantar { --c: var(--vantar); --ct: var(--vantar-tint); } .t-fel { --c: var(--fel); --ct: var(--fel-tint); } .t-stangt { --c: var(--stangt); --ct: var(--stangt-tint); }

.field { width: 100%; padding: 9px 11px; background: var(--lift); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-s); font: inherit; }
.field:focus { outline: 2px solid var(--focus); border-color: transparent; }
textarea.field { resize: vertical; font: 500 12.5px/1.45 var(--font-data); }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 16px; border-radius: var(--r-s); border: 1px solid var(--line-strong); background: transparent; font-weight: 650; text-decoration: none; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.12); }
.btn.big { height: 48px; padding: 0 24px; font-size: 16px; }
.btn[disabled] { opacity: .55; cursor: progress; }
.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; }
.searchrow { margin: 0 0 12px; }

.facet { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.facet .micro { width: 52px; }
.fchip { height: 30px; padding: 0 10px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px; }
.fchip b { font-weight: 600; color: var(--ink-3); font-size: 12px; }
.fchip:hover { background: var(--hover); }
.fchip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.fchip.on b { color: var(--head-dim); }

/* ---------------------------------------------------------------- tabeller */
.tablewrap { background: var(--surface); border-radius: var(--r-m); }
table.grid { width: 100%; border-collapse: collapse; }
.grid th { position: sticky; top: 58px; z-index: 2; text-align: left; background: var(--head-bg); color: var(--head-ink); font: 700 11px/1 var(--font-text); letter-spacing: .08em; text-transform: uppercase; padding: 13px 12px; white-space: nowrap; }
.grid th:first-child { border-top-left-radius: var(--r-m); } .grid th:last-child { border-top-right-radius: var(--r-m); }
.grid th.num { text-align: right; }
.grid td { padding: 0 12px; height: var(--row-h); vertical-align: middle; }
.grid tbody tr:nth-child(even) { background: var(--zebra); }
.grid tbody tr.row:hover { background: var(--hover); }
.grid tbody tr.row[data-key], .grid tbody tr.row[data-app] { cursor: pointer; }
.grid tbody tr.row.active { background: var(--accent-tint); }
.grid tr.row td:first-child { box-shadow: inset 5px 0 0 var(--c, var(--stangt)); padding-left: 16px; }
.grid tr.m-ok { --c: var(--ok); } .grid tr.m-fel { --c: var(--fel); } .grid tr.m-pagar { --c: var(--pagar); } .grid tr.m-vantar { --c: var(--vantar); } .grid tr.m-stangt { --c: var(--stangt); } .grid tr.m-ny { --c: var(--ny); }
.c-id { font-weight: 650; white-space: nowrap; }
.c-id small { display: block; font-weight: 400; font-size: 11px; color: var(--ink-3); line-height: 1.1; }
.c-name { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-type, .c-scope, .c-status { white-space: nowrap; }
.c-app { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.applink { text-decoration: none; } .applink:hover { text-decoration: underline; }
.note { color: var(--ink-2); font-size: 13px; max-width: 420px; }
.file { color: var(--ink-3); font: 500 12px/1.3 var(--font-data); max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fillcol { width: 120px; }
.bar { display: block; height: 8px; background: var(--c-bg, var(--zebra)); box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--r-s); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--c, var(--ok)); }
.bar.big { height: 14px; }
.more { display: block; margin: 12px auto 0; height: 38px; padding: 0 18px; border: 1px solid var(--line-strong); background: transparent; border-radius: var(--r-s); font-weight: 650; }
.more:hover { background: var(--hover); }

/* ----------------------------------------------------------------- tomt m.m. */
.empty { background: var(--surface); border-radius: var(--r-m); padding: 34px 28px; margin: 14px 0; }
.empty h3 { font-size: 22px; margin-bottom: 8px; }
.empty.bad { background: var(--fel-tint); }
.empty p { max-width: 62ch; margin: 6px 0; }
.alert { background: var(--fel-tint); padding: 14px 16px; border-radius: var(--r-s); margin: 14px 0; }
.alert h3 { font-size: 16px; margin-bottom: 4px; color: var(--fel); }
.skeleton .skrow { height: var(--row-h); margin: 2px 0; background: linear-gradient(90deg, var(--surface), var(--zebra), var(--surface)); background-size: 200% 100%; animation: sk 1.4s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* -------------------------------------------------------------------- start */
.start .cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 36px; margin-top: 8px; }
.start h2 { font-size: 30px; margin-bottom: 6px; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 26px; }
.example { padding: 8px 13px; border-radius: var(--r-s); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; font-weight: 650; }
.example:hover { background: var(--accent-tint); }
.how { background: var(--surface); padding: 18px 20px; border-radius: var(--r-m); }
.how h3 { font-size: 16px; margin-bottom: 8px; } .how ul { margin: 0; padding-left: 18px; color: var(--ink-2); } .how li { margin: 5px 0; }
.col-side h3 { font-size: 15px; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .06em; font-family: var(--font-text); font-size: 11px; color: var(--ink-3); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.feed a { text-decoration: none; font-weight: 600; } .feed span { font-size: 12.5px; color: var(--ink-3); }

/* ------------------------------------------------------------ intervallkarta */
.legend { display: flex; gap: 6px; flex-wrap: wrap; }
.rulerwrap { margin: 8px 0 24px; overflow-x: auto; background: var(--surface); border-radius: var(--r-m); }
.ruler { position: relative; min-width: 2600px; margin: 0; padding-top: 28px; overflow: hidden; }
.axis { position: absolute; left: 0; right: 0; top: 0; height: 28px; }
.tick { position: absolute; top: 18px; bottom: -4000px; width: 1px; background: var(--line); opacity: .55; }
.tick.major { background: var(--ink-3); opacity: .5; top: 8px; }
.tick span { position: absolute; top: -17px; left: 4px; font: 600 11px/1 var(--font-text); color: var(--ink-2); }
.lane { position: relative; margin: 0 0 0; }
.blk { position: absolute; height: 34px; padding: 3px 7px 8px; background: var(--ct, var(--zebra)); box-shadow: inset 0 0 0 1px var(--c, var(--stangt)); overflow: hidden; text-decoration: none; display: flex; flex-direction: column; justify-content: center; min-width: 4px; z-index: 1; }
.blk::after { content: ''; position: absolute; left: 0; bottom: 0; height: 6px; width: var(--fill, 0%); background: var(--c, var(--stangt)); }
.blk b { font: 650 12px/1.1 var(--font-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk small { font-size: 10.5px; color: var(--ink-2); line-height: 1.1; white-space: nowrap; }
.blk:hover { z-index: 3; box-shadow: inset 0 0 0 2px var(--ink); }
.straybar { position: relative; height: 34px; margin-top: 6px; border-top: 1px solid var(--line); }
.straybar .micro { position: absolute; left: 10px; bottom: 7px; }
.stray { position: absolute; top: 0; width: 3px; height: 16px; background: var(--fel); z-index: 2; }

.picker { position: relative; max-width: 440px; margin-bottom: 18px; } .picker label { display: block; margin-bottom: 6px; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 10; background: var(--lift); box-shadow: var(--lift-shadow); border-radius: var(--r-s); overflow: hidden; margin-top: 2px; }
.suggest[hidden] { display: none; }
.suggest button { display: flex; width: 100%; justify-content: space-between; align-items: baseline; padding: 10px 12px; border: 0; background: none; text-align: left; }
.suggest button:hover { background: var(--accent-tint); } .suggest small { color: var(--ink-3); }
.dym { display: block; padding: 8px 12px 0; font-size: 12px; color: var(--ink-3); font-style: italic; }
.pools { display: grid; gap: 4px; }
.poolrow { display: grid; grid-template-columns: 170px 1fr 90px; align-items: center; gap: 12px; padding: 6px 0; }
.pname { display: flex; flex-direction: column; line-height: 1.2; } .pname small { color: var(--ink-3); }
.pbar { position: relative; height: 22px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.seg { position: absolute; top: 0; bottom: 0; background: var(--accent); opacity: .85; min-width: 4px; }
.pcount { text-align: right; }

/* ------------------------------------------------------------- appdetaljer */
.back { display: inline-block; margin-bottom: 12px; color: var(--ink-3); text-decoration: none; font-weight: 600; } .back:hover { color: var(--ink); }
.apphead { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 16px; }
.apphead h1 { font-size: 36px; margin: 6px 0 8px; }
.fillbig { display: flex; align-items: center; gap: 16px; } .fillbig .bar { flex: 1; }
.typebars { display: grid; gap: 4px; max-width: 640px; }
.typebars > div { display: grid; grid-template-columns: 190px 1fr 56px; align-items: center; gap: 12px; }

/* ------------------------------------------------------------------ krockar */
details.cg { background: var(--surface); margin: 2px 0; border-radius: var(--r-s); }
details.cg summary, details.cust summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; min-height: var(--row-h); padding: 6px 14px; }
details.cg summary::-webkit-details-marker, details.cust summary::-webkit-details-marker { display: none; }
details.cg:nth-child(even) { background: var(--zebra); }
details.cg:hover { background: var(--hover); }
details.cg[open] { background: var(--lift); box-shadow: var(--lift-shadow); }
.mk { width: 10px; height: 10px; background: var(--c); flex: none; }
.cgbody { padding: 4px 16px 16px 36px; } .cgbody ul { margin: 8px 0 0; padding-left: 18px; } .cgbody li { margin: 6px 0; }
details.cust { margin: 8px 0; } details.cust > summary { background: var(--ink); color: var(--paper); border-radius: var(--r-s); }
details.cust > summary .count { background: var(--paper); color: var(--ink); margin-left: auto; }

/* ------------------------------------------------------------- ny app */
.newapp { max-width: 820px; }
.newapp fieldset { border: 0; padding: 0; margin: 22px 0; position: relative; } .newapp legend { padding: 0; margin-bottom: 10px; }
.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.typebtn, .poolbtn { text-align: left; padding: 11px 13px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); display: flex; flex-direction: column; gap: 3px; }
.typebtn small { color: var(--ink-3); font-size: 12px; line-height: 1.3; } .poolbtn small { color: var(--ink-3); }
.typebtn:hover, .poolbtn:hover { background: var(--hover); }
.typebtn.on, .poolbtn.on { background: var(--ink); color: var(--paper); border-color: var(--ink); } .typebtn.on small, .poolbtn.on small { color: var(--head-dim); }
.pools-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .lbl { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 5px; color: var(--ink-2); }
.inline { display: flex; gap: 8px; } .ok-line { margin: 8px 0 0; }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.done { background: var(--ok-tint); padding: 28px; border-radius: var(--r-m); max-width: 820px; } .done h2 { font-size: 28px; margin: 8px 0; }
pre.code { background: var(--ink); color: var(--paper); padding: 14px 16px; border-radius: var(--r-s); overflow-x: auto; font: 500 13px/1.5 var(--font-data); margin: 10px 0; }

/* ------------------------------------------------------------------- sidopanel */
#drawer { position: fixed; top: 58px; right: 0; bottom: 0; width: min(460px, 100%); background: var(--lift); box-shadow: var(--lift-shadow); z-index: 30; overflow-y: auto; padding: 22px 24px 40px; }
#drawer[hidden] { display: none; }
#drawer header { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
#drawer h2 { font-size: 26px; margin-top: 6px; word-break: break-word; }
#drawer .x { width: 36px; height: 36px; border: 1px solid var(--line); background: none; border-radius: var(--r-s); font-size: 22px; line-height: 1; }
.dchips { display: flex; gap: 6px; margin-bottom: 14px; }
#drawer dl { margin: 0; } #drawer dl > div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); } #drawer dt { color: var(--ink-3); font-size: 12.5px; } #drawer dd { margin: 0; word-break: break-word; }
#drawer section { margin-top: 22px; } #drawer h3 { font-size: 16px; margin-bottom: 8px; }
#drawer .alert ul, .lines { margin: 8px 0 0; padding-left: 18px; } .lines { list-style: none; padding: 0; } .lines li { padding: 6px 0; border-bottom: 1px solid var(--line); }

/* ---------------------------------------------------------------- välkomst */
.welcome { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--paper); }
.wl { padding: 12vh 7vw; max-width: 760px; align-self: center; } .wl h1 { font-size: clamp(40px, 5.2vw, 68px); margin: 12px 0 14px; line-height: .98; }
.logo-big { color: var(--ink); margin-bottom: 26px; } .logo-big svg { width: 54px; height: 54px; }
.wr { background: var(--head-bg); display: flex; align-items: flex-end; padding: 0 5vw; }
.ruler-art { display: flex; align-items: flex-end; gap: 7px; width: 100%; height: 62%; border-bottom: 3px solid var(--head-ink); }
.ruler-art i { flex: 1; background: var(--head-ink); opacity: .85; } .ruler-art i:nth-child(4n) { background: var(--accent); opacity: 1; }

body.drawer-open { overflow-x: hidden; }

@media (max-width: 1180px) { .opt { display: none; } }
@media (max-width: 960px) {
  .top { flex-wrap: wrap; height: auto; padding: 8px 14px; gap: 8px 14px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; } .tabs a { padding: 10px 12px; }
  .searchbox { order: 2; flex-basis: 100%; max-width: none; margin-left: 0; } .age, .user { display: none; }
  .tablewrap { overflow-x: auto; }
  .grid th { top: 0; position: static; }
  main { padding: 20px 14px 60px; } .pagehead { font-size: 28px; }
  .strip { flex-wrap: wrap; } .strip > div { flex: 1 1 40%; } .strip > div.s-main { flex-basis: 100%; }
  .start .cols { grid-template-columns: 1fr; gap: 20px; }
  .poolrow { grid-template-columns: 1fr; gap: 4px; } .typebars > div { grid-template-columns: 110px 1fr 44px; }
  .grid2 { grid-template-columns: 1fr; } #drawer { top: 0; width: 100%; } .welcome { grid-template-columns: 1fr; } .wr { display: none; }
  .c-app { max-width: 150px; } .c-name { max-width: 170px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
