/* Glasurbog — colourful studio app. Each section has its own glaze colour (--sec). */
:root {
  --bg: #fff7ef;
  --card: #ffffff;
  --card-2: #fbf1e7;
  --line: #f0e2d4;
  --text: #2a1f1a;
  --muted: #86766b;
  --shadow: 0 1px 2px rgba(90, 50, 20, .05), 0 6px 20px rgba(90, 50, 20, .07);
  --radius: 18px;
  --round: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* section colours */
  --coral: #ff6b4a;  --coral-2: #ffb347;
  --cobalt: #4361ee; --cobalt-2: #8b5cf6;
  --teal: #0fb3a3;   --teal-2: #3cc8e8;
  --amber: #f59e0b;  --amber-2: #fcd34d;
  --green: #16a34a;  --green-2: #4ade80;
  --plum: #a14fd8;   --plum-2: #ff5d8f;
  --sec: var(--coral); --sec-2: var(--coral-2); --sec-ink: #fff;
  --sec-soft: color-mix(in srgb, var(--sec) 13%, var(--card));

  /* status */
  --st-raa: #9a8f86; --st-skro: #f08a5d; --st-glaseret: #4361ee; --st-faerdig: #16a34a; --st-fejl: #e5484d;
  --red: #e5484d; --good: #16a34a;

  /* chart series (validated: blue/orange, CVD-safe) */
  --ser-sales: #2f6fdb; --ser-buy: #e8692f;

  --safe-b: env(safe-area-inset-bottom, 0px);
  --vv-gap: 0px; /* set by app.js when iOS leaves the layout viewport at the wrong height */
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17131a; --card: #221d26; --card-2: #2b2530; --line: #3a3240; --text: #f4ecf6; --muted: #a99bb0;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 6px 18px rgba(0,0,0,.25);
    --ser-sales: #5b93f0; --ser-buy: #dd6a2e;
    color-scheme: dark;
  }
}
body.s-home   { --sec: var(--coral);  --sec-2: var(--coral-2); }
body.s-emner  { --sec: var(--cobalt); --sec-2: var(--cobalt-2); }
body.s-glasur { --sec: var(--teal);   --sec-2: var(--teal-2); }
body.s-lager  { --sec: var(--amber);  --sec-2: var(--amber-2); --sec-ink: #2a1f1a; }
body.s-oko    { --sec: var(--green);  --sec-2: var(--green-2); }
body.s-mere   { --sec: var(--plum);   --sec-2: var(--plum-2); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.45; }
body { overscroll-behavior-y: none; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
svg { width: 20px; height: 20px; flex: none; }
.tile .lbl svg { width: 28px; height: 28px; }
.band .studio-pill svg { width: 16px; height: 16px; }
.chip .swatch { width: 10px; height: 10px; }
.chip.on .swatch { box-shadow: 0 0 0 2px #fff; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--round); font-weight: 800; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; line-height: 1.1; }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; }

/* ---------- shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  padding: calc(var(--safe-t) + 8px) 12px 8px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  display: flex; align-items: center; gap: 6px; min-height: 52px;
}
.topbar .title { flex: 1; font-family: var(--round); font-size: 1.12rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.topbar .side { width: 92px; display: flex; gap: 2px; }
.topbar .side.r { justify-content: flex-end; }
.topbar .back { border: 0; background: none; padding: 6px 4px; color: var(--sec); font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 0; cursor: pointer; }
.topbar .back svg { width: 24px; height: 24px; }

/* colourful header band on main tabs */
.band {
  position: relative; overflow: hidden;
  margin: 0 -16px; padding: calc(var(--safe-t) + 18px) 18px 22px;
  background: linear-gradient(135deg, var(--sec), var(--sec-2));
  color: var(--sec-ink);
  border-radius: 0 0 28px 28px;
}
.band::before, .band::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.16); pointer-events: none; }
.band::before { width: 180px; height: 180px; right: -50px; top: -60px; }
.band::after { width: 110px; height: 110px; right: 70px; bottom: -70px; background: rgba(255,255,255,.1); }
.band h1 { font-size: 2rem; }
.band p { margin: 4px 0 0; opacity: .88; }
.band .band-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; position: relative; z-index: 1; }
.band .studio-pill { background: rgba(255,255,255,.22); border: 0; color: inherit; border-radius: 999px; padding: 6px 12px; font-size: .82rem; font-weight: 700; display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.band .avatar { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.25); display: grid; place-items: center; font-weight: 800; border: 0; color: inherit; cursor: pointer; font-family: var(--round); }
.band .content { position: relative; z-index: 1; }
.band .search { margin-top: 14px; }
.band .search input { background: rgba(255,255,255,.95); border-color: transparent; color: #2a1f1a; }
.band .seg { margin-top: 14px; background: rgba(255,255,255,.22); border-color: transparent; }
.band .seg button { color: inherit; }
.band .seg button.on { background: #fff; color: #2a1f1a; }

main { max-width: 760px; margin: 0 auto; padding: 0 16px calc(104px + var(--safe-b)); }
main.plain { padding-top: 6px; }

.tabbar {
  position: fixed; left: 10px; right: 10px; bottom: calc(8px + var(--safe-b) + var(--vv-gap)); z-index: 30;
  max-width: 560px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px;
  background: color-mix(in srgb, var(--card) 90%, transparent);
  backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border: 1px solid var(--line); border-radius: 24px;
  box-shadow: 0 10px 30px rgba(60, 30, 10, .15);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: .66rem; font-weight: 600; color: var(--muted); padding: 6px 0 5px; border-radius: 18px; }
.tabbar a svg { width: 23px; height: 23px; }
.tabbar a.on { color: #fff; }
.tabbar a.on.t-home { background: var(--coral); } .tabbar a.on.t-emner { background: var(--cobalt); }
.tabbar a.on.t-glasur { background: var(--teal); } .tabbar a.on.t-lager { background: var(--amber); color: #2a1f1a; }
.tabbar a.on.t-oko { background: var(--green); }

.fab {
  position: fixed; right: 18px; bottom: calc(86px + var(--safe-b) + var(--vv-gap)); z-index: 25;
  background: linear-gradient(135deg, var(--sec), var(--sec-2)); color: var(--sec-ink); border: 0; border-radius: 999px;
  padding: 14px 20px 14px 16px; font-weight: 800; font-family: var(--round); font-size: 1rem;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--sec) 45%, transparent);
  display: flex; align-items: center; gap: 6px; cursor: pointer;
}
.fab svg { width: 22px; height: 22px; }

/* ---------- building blocks ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.section { margin-top: 24px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.section-head h2 { display: flex; align-items: center; gap: 8px; }
.section-head a, .link { color: var(--sec); font-size: .9rem; font-weight: 700; }
.pad { padding: 14px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.tiny { font-size: .75rem; }
.bold { font-weight: 700; }
.row { display: flex; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pre { white-space: pre-wrap; }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--good); } .neg { color: var(--red); }
.empty { text-align: center; color: var(--muted); padding: 34px 16px; }
.empty .ico { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 20px; display: grid; place-items: center; background: var(--sec-soft); color: var(--sec); }
.empty .ico svg { width: 32px; height: 32px; }
.empty .big { font-family: var(--round); font-weight: 800; font-size: 1.1rem; color: var(--text); margin-bottom: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

.dot-ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; }
.dot-ico svg { width: 17px; height: 17px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--card); border-radius: 14px;
  padding: 10px 14px; font-weight: 700; cursor: pointer; min-height: 46px;
}
.btn svg { width: 19px; height: 19px; flex: none; }
.btn.primary { background: linear-gradient(135deg, var(--sec), color-mix(in srgb, var(--sec) 70%, var(--sec-2))); border-color: transparent; color: var(--sec-ink); box-shadow: 0 4px 14px color-mix(in srgb, var(--sec) 30%, transparent); }
.btn.soft { background: var(--sec-soft); border-color: transparent; color: var(--sec); }
.btn.danger { color: var(--red); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 6px 11px; font-size: .86rem; border-radius: 11px; }
.btn:disabled { opacity: .5; }
.icon-btn { border: 0; background: none; padding: 8px; border-radius: 12px; cursor: pointer; color: var(--text); display: inline-flex; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.on { color: #f5a524; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 6px; margin: 0 -16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 7px 13px; font-size: .88rem; font-weight: 600; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
.chip.on { background: var(--sec); color: var(--sec-ink); border-color: var(--sec); }
.chip .count { opacity: .65; font-size: .8em; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; color: #fff; background: var(--muted); white-space: nowrap; }
.badge.raa { background: var(--st-raa); } .badge.skro { background: var(--st-skro); } .badge.glaseret { background: var(--st-glaseret); }
.badge.faerdig { background: var(--st-faerdig); } .badge.fejl { background: var(--st-fejl); }
.badge.sold { background: #111; } .badge.warn { background: var(--red); } .badge.soft { background: var(--card-2); color: var(--muted); }
.badge.sec { background: var(--sec); color: var(--sec-ink); }

.swatch { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); flex: none; background: var(--card-2); }
.swatch.lg { width: 48px; height: 48px; border-radius: 16px; border-width: 0; }

.search { position: relative; }
.search input { width: 100%; padding: 12px 12px 12px 40px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); font-size: 16px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--muted); }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .76rem; font-weight: 800; color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .05em; }
.field input, .field select, .field textarea, .inp {
  width: 100%; padding: 11px 12px; border-radius: 13px; border: 1px solid var(--line); background: var(--card);
  font-size: 16px; min-height: 46px; appearance: none; -webkit-appearance: none;
}
.field input:focus, .field select:focus, .field textarea:focus, .inp:focus, .search input:focus { outline: 2px solid color-mix(in srgb, var(--sec) 55%, transparent); outline-offset: 0; border-color: transparent; }
.field select, select.inp { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.field textarea, textarea.inp { min-height: 92px; resize: vertical; }
.field input[type=color] { padding: 4px; height: 46px; }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.form-card { padding: 16px 14px 4px; margin-bottom: 14px; }
.form-card > h2 { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.seg { display: flex; background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: none; padding: 8px 6px; border-radius: 11px; font-size: .9rem; font-weight: 600; cursor: pointer; min-height: 38px; }
.seg button.on { background: var(--card); box-shadow: var(--shadow); font-weight: 800; color: var(--sec); }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; font-weight: 600; }
.check input { width: 22px; height: 22px; accent-color: var(--sec); }

.layer { border: 1px solid var(--line); border-radius: 15px; padding: 12px; margin-bottom: 10px; background: var(--card-2); }
.layer-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.layer-num { width: 26px; height: 26px; border-radius: 50%; background: var(--sec); color: var(--sec-ink); font-size: .8rem; font-weight: 800; display: grid; place-items: center; flex: none; }

.save-bar { position: sticky; bottom: calc(86px + var(--safe-b)); display: flex; gap: 10px; padding: 10px 0; z-index: 5; }
.save-bar .btn { flex: 1; }

/* ---------- piece cards ---------- */
.pgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .pgrid { grid-template-columns: repeat(3, 1fr); } }
.pcard { overflow: hidden; display: flex; flex-direction: column; }
.pcard .img { aspect-ratio: 1; background: var(--card-2); position: relative; }
.pcard .img img, .pcard .img video { width: 100%; height: 100%; object-fit: cover; }
.pcard .img .badge { position: absolute; left: 8px; top: 8px; }
.pcard .img .fav { position: absolute; right: 8px; top: 7px; color: #ffc53d; filter: drop-shadow(0 1px 3px rgba(0,0,0,.45)); }
.pcard .img .fav svg { width: 20px; height: 20px; }
.pcard .img .price { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: .74rem; font-weight: 800; padding: 3px 8px; border-radius: 8px; }
.pcard .body { padding: 9px 11px 12px; }
.pcard .t { font-weight: 800; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .g { display: flex; align-items: center; gap: 4px; margin-top: 5px; font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; }
.pcard .g .swatch { width: 12px; height: 12px; border-width: 1px; }
.noimg { width: 100%; height: 100%; display: grid; place-items: center; color: color-mix(in srgb, var(--sec) 40%, var(--card-2)); background: linear-gradient(135deg, var(--card-2), color-mix(in srgb, var(--sec) 10%, var(--card-2))); }
.noimg svg { width: 40%; height: 40%; }

.hscroll { display: flex; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 8px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { flex: 0 0 42%; scroll-snap-align: start; }
@media (min-width: 560px) { .hscroll > * { flex-basis: 28%; } }

/* ---------- stat tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile { border-radius: 20px; padding: 14px; color: #fff; position: relative; overflow: hidden; min-height: 96px; display: flex; flex-direction: column; justify-content: space-between; }
.tile::after { content: ""; position: absolute; width: 90px; height: 90px; border-radius: 50%; right: -26px; top: -26px; background: rgba(255,255,255,.18); }
.tile .lbl { font-size: .78rem; font-weight: 700; opacity: .92; position: relative; z-index: 1; }
.tile .val { font-family: var(--round); font-size: 1.55rem; font-weight: 800; line-height: 1.1; position: relative; z-index: 1; }
.tile .sub { font-size: .74rem; opacity: .9; position: relative; z-index: 1; }
.tile.coral { background: linear-gradient(135deg, var(--coral), var(--coral-2)); }
.tile.cobalt { background: linear-gradient(135deg, var(--cobalt), var(--cobalt-2)); }
.tile.teal { background: linear-gradient(135deg, var(--teal), var(--teal-2)); }
.tile.amber { background: linear-gradient(135deg, var(--amber), var(--amber-2)); color: #2a1f1a; }
.tile.green { background: linear-gradient(135deg, var(--green), var(--green-2)); }
.tile.plum { background: linear-gradient(135deg, var(--plum), var(--plum-2)); }
.tile.ink { background: linear-gradient(135deg, #2a1f1a, #5b4636); }
.tile.wide { grid-column: span 2; }

.status-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 14px; }
.status-row a { border-radius: 14px; padding: 9px 2px 8px; text-align: center; background: var(--card); border: 1px solid var(--line); }
.status-row b { display: block; font-family: var(--round); font-size: 1.3rem; line-height: 1; }
.status-row span { font-size: .64rem; font-weight: 700; color: var(--muted); }
.status-row a.raa b { color: var(--st-raa); } .status-row a.skro b { color: var(--st-skro); } .status-row a.glaseret b { color: var(--st-glaseret); }
.status-row a.faerdig b { color: var(--st-faerdig); } .status-row a.fejl b { color: var(--st-fejl); }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 12px; padding: 11px 14px; align-items: center; border-bottom: 1px solid var(--line); cursor: pointer; }
.list-item:last-child { border-bottom: 0; }
.list-item .name { font-weight: 700; }
.list-item .thumb { width: 54px; height: 54px; border-radius: 14px; overflow: hidden; flex: none; background: var(--card-2); position: relative; }
.list-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.list-item .thumb .sw { position: absolute; right: 3px; bottom: 3px; width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--card); }
.chev { color: var(--muted); width: 18px; height: 18px; flex: none; }
.amount { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stockbar { height: 7px; border-radius: 4px; background: var(--card-2); overflow: hidden; margin-top: 6px; }
.stockbar > div { height: 100%; background: var(--teal); border-radius: 4px; }
.stockbar.low > div { background: var(--red); }

/* ---------- detail ---------- */
.hero { margin: 0 -16px; position: relative; background: var(--card-2); }
.hero img, .hero video { width: 100%; max-height: 60vh; object-fit: cover; cursor: zoom-in; }
.hero .noimg { aspect-ratio: 16/10; }
.hero .hero-count { position: absolute; right: 12px; bottom: 12px; background: rgba(0,0,0,.6); color: #fff; font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.hero-title { margin-top: 16px; }
.meta { color: var(--muted); font-size: .92rem; margin-top: 4px; }

.stepper { display: flex; gap: 5px; margin-top: 16px; }
.stepper button { flex: 1; border: 0; background: var(--card-2); border-radius: 12px; padding: 10px 2px 9px; font-size: .72rem; font-weight: 700; color: var(--muted); cursor: pointer; }
.stepper button.done { color: #fff; }
.stepper button.raa.done { background: var(--st-raa); } .stepper button.skro.done { background: var(--st-skro); }
.stepper button.glaseret.done { background: var(--st-glaseret); } .stepper button.faerdig.done { background: var(--st-faerdig); }
.stepper button.fejl.done { background: var(--st-fejl); }
.stepper button.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px currentColor; }
.stepper button.on.done { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }

.lv { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.lv:last-child { border-bottom: 0; }
.lv .n { font-size: .74rem; font-weight: 800; color: var(--muted); width: 16px; text-align: center; }

.mgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
@media (min-width: 560px) { .mgrid { grid-template-columns: repeat(4, 1fr); } }
.mthumb { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--card-2); position: relative; cursor: pointer; border: 0; padding: 0; display: block; width: 100%; }
.mthumb img, .mthumb video { width: 100%; height: 100%; object-fit: cover; }
.mthumb .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; pointer-events: none; }
.mthumb .play svg { width: 34px; height: 34px; filter: drop-shadow(0 1px 4px rgba(0,0,0,.6)); }
.mthumb .cov { position: absolute; left: 5px; top: 5px; background: var(--sec); color: var(--sec-ink); font-size: .6rem; font-weight: 800; padding: 2px 6px; border-radius: 6px; }
.mthumb .fileico { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); font-size: .72rem; font-weight: 700; }
.stage-title { font-size: .76rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 16px 0 8px; display: flex; justify-content: space-between; align-items: center; }
.stage-title i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; }

.capture { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 12px; }
.capture .btn { flex-direction: column; gap: 4px; padding: 12px 6px; font-size: .8rem; min-height: 74px; border-radius: 16px; }
.capture .btn svg { width: 26px; height: 26px; }
.capture .btn.cam { background: linear-gradient(135deg, var(--sec), var(--sec-2)); color: var(--sec-ink); border: 0; }
.progress { height: 7px; border-radius: 4px; background: var(--card-2); overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--sec), var(--sec-2)); transition: width .2s; }

.upload-pill { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + var(--safe-b) + var(--vv-gap)); z-index: 40; background: var(--text); color: var(--bg); padding: 9px 14px; border-radius: 999px; font-size: .84rem; font-weight: 700; display: flex; align-items: center; gap: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 92vw; }
.upload-pill .bar { width: 70px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.25); overflow: hidden; }
.upload-pill .bar > div { height: 100%; background: var(--coral-2); }

.runpick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.runpick button { border: 1px solid var(--line); background: var(--card); border-radius: 13px; padding: 6px 2px 7px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .62rem; font-weight: 700; color: var(--muted); line-height: 1.1; min-height: 66px; }
.runpick button.on { border-color: var(--sec); background: var(--sec-soft); color: var(--text); }
.runpick svg { width: 30px; height: 30px; }
.stars { display: flex; gap: 2px; }
.stars button { border: 0; background: none; padding: 4px; cursor: pointer; color: var(--line); }
.stars button.on { color: #ffb020; }
.stars svg { width: 30px; height: 30px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; font-size: .93rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.firing { padding: 10px 0; border-bottom: 1px solid var(--line); }
.firing:last-child { border-bottom: 0; }

.stock-big { font-family: var(--round); font-size: 2.3rem; font-weight: 800; line-height: 1; }
.stock-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 14px; }
.ev { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .9rem; align-items: center; }
.ev:last-child { border-bottom: 0; }
.ev .ch { font-weight: 800; min-width: 70px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- charts ---------- */
.legend { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.chart { position: relative; margin-top: 10px; }
.chart .plot { display: grid; gap: 4px; align-items: end; height: 150px; border-bottom: 1px solid var(--line); position: relative; }
.chart .grid-line { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); pointer-events: none; }
.chart .grid-line span { position: absolute; right: 0; top: -15px; font-size: .62rem; color: var(--muted); background: var(--card); padding: 0 2px; }
.chart .col { display: flex; gap: 2px; align-items: flex-end; height: 100%; cursor: pointer; position: relative; padding: 0 1px; }
.chart .col > div { flex: 1; border-radius: 4px 4px 0 0; min-height: 0; }
.chart .col.sel { background: color-mix(in srgb, var(--text) 6%, transparent); border-radius: 6px 6px 0 0; }
.chart .xl { display: grid; gap: 4px; margin-top: 4px; }
.chart .xl span { font-size: .62rem; color: var(--muted); text-align: center; }
.chart .tip { margin-top: 10px; font-size: .86rem; background: var(--card-2); border-radius: 12px; padding: 8px 12px; display: flex; gap: 14px; flex-wrap: wrap; }
.hbar { margin-top: 10px; }
.hbar .r { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; margin-bottom: 9px; font-size: .86rem; }
.hbar .r .track { grid-column: span 2; height: 9px; background: var(--card-2); border-radius: 5px; overflow: hidden; }
.hbar .r .track > div { height: 100%; border-radius: 0 4px 4px 0; }
.bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; align-items: end; height: 96px; margin-top: 8px; }
.bars .b { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.bars .b > div { width: 100%; border-radius: 4px 4px 0 0; min-height: 2px; background: var(--teal); }
.bars .b span { font-size: .68rem; color: var(--muted); font-weight: 700; }

/* combos */
.combo { padding: 13px; }
.combo-layer { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: .95rem; }
.combo-layer .arrow { color: var(--muted); font-weight: 500; font-size: .8rem; width: 18px; text-align: center; }
.combo-stack { display: flex; flex-direction: column; gap: 4px; }
.thumbs-row { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.thumbs-row img { width: 66px; height: 66px; border-radius: 11px; object-fit: cover; flex: none; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: #0c0a0d; color: #f6f0f7; display: flex; flex-direction: column; }
.overlay .ohead { display: flex; align-items: center; gap: 8px; padding: calc(var(--safe-t) + 8px) 10px 8px; }
.overlay .ohead .grow { font-size: .9rem; opacity: .85; text-align: center; }
.overlay .icon-btn { color: #f6f0f7; }
.overlay .stage-area { flex: 1; min-height: 0; position: relative; overflow: auto; display: flex; align-items: center; justify-content: center; }
.overlay .stage-area.zoomed { display: block; }
.overlay .stage-area img.fit { max-width: 100%; max-height: 100%; object-fit: contain; }
.overlay .stage-area img.full { max-width: none; max-height: none; }
.overlay .stage-area video { max-width: 100%; max-height: 100%; }
.overlay .ofoot { padding: 8px 10px calc(var(--safe-b) + 10px); display: flex; flex-direction: column; gap: 8px; }
.overlay .ofoot .row { justify-content: space-between; }
.overlay .btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.14); color: #f6f0f7; }
.overlay .btn.danger { color: #ff9c8a; }
.overlay select.inp { background-color: rgba(255,255,255,.1); border-color: rgba(255,255,255,.14); color: #f6f0f7; min-height: 40px; padding-top: 7px; padding-bottom: 7px; }
.overlay select.inp option { color: #000; }
.overlay .navbtn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.4); border-radius: 50%; z-index: 2; }
.overlay .navbtn.l { left: 6px; } .overlay .navbtn.r { right: 6px; }
.loading-img { position: absolute; inset: 0; display: grid; place-items: center; opacity: .6; font-size: .85rem; pointer-events: none; }

.compare { position: relative; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.compare .handle { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; box-shadow: 0 0 6px rgba(0,0,0,.6); pointer-events: none; }
.compare .handle::after { content: "⟷"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: #fff; color: #000; border-radius: 50%; width: 36px; height: 36px; display: grid; place-items: center; font-size: 15px; }
.compare .lbl { position: absolute; top: 10px; background: rgba(0,0,0,.55); padding: 3px 9px; border-radius: 8px; font-size: .78rem; font-weight: 700; }
.sbs { display: grid; grid-template-rows: 1fr 1fr; gap: 4px; width: 100%; height: 100%; }
@media (orientation: landscape) { .sbs { grid-template-rows: none; grid-template-columns: 1fr 1fr; } }
.sbs > div { position: relative; min-height: 0; }
.sbs img { width: 100%; height: 100%; object-fit: contain; }
.picker { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.picker img { width: 52px; height: 52px; border-radius: 9px; object-fit: cover; opacity: .5; border: 2px solid transparent; flex: none; cursor: pointer; }
.picker img.on { opacity: 1; border-color: var(--coral-2); }

.sheet-bg { position: fixed; inset: 0; z-index: 90; background: rgba(20, 10, 20, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 560px; border-radius: 24px 24px 0 0; padding: 10px 16px calc(var(--safe-b) + 18px); max-height: 90vh; overflow: auto; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet h2 { margin-bottom: 12px; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 4px; border: 0; background: none; border-bottom: 1px solid var(--line); font-size: 1rem; font-weight: 600; cursor: pointer; text-align: left; }
.menu-item:last-child { border-bottom: 0; }
.menu-item.danger { color: var(--red); }

.toast { position: fixed; left: 50%; top: calc(var(--safe-t) + 12px); transform: translateX(-50%); z-index: 200; background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 14px; font-size: .9rem; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 90vw; animation: drop .25s ease-out; }
.toast.err { background: var(--red); color: #fff; }
@keyframes drop { from { transform: translate(-50%, -20px); opacity: 0; } }

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 15%, #ffb34755, transparent 45%), radial-gradient(circle at 85% 25%, #4361ee44, transparent 45%), radial-gradient(circle at 50% 95%, #0fb3a355, transparent 50%), var(--bg); }
.login .card { width: 100%; max-width: 380px; padding: 28px 22px; }
.login h1 { text-align: center; }
.logo { width: 76px; height: 76px; margin: 0 auto 14px; display: block; border-radius: 22px; box-shadow: 0 10px 26px rgba(255, 107, 74, .35); }

.spin { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--sec); border-radius: 50%; animation: spin .8s linear infinite; margin: 50px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.alert { padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--red) 12%, var(--card)); color: var(--red); font-weight: 600; font-size: .9rem; }
.note { padding: 12px 14px; border-radius: 14px; background: var(--sec-soft); font-size: .9rem; }

.run-big { width: 54px; height: 54px; color: var(--cobalt); display: block; }
.run-big svg { width: 100%; height: 100%; }
.overlay .seg { background: rgba(255,255,255,.12); border-color: transparent; }
.overlay .seg button { color: #f6f0f7; }
.overlay .seg button.on { background: #fff; color: #1a1420; }

/* ---------------------------------------------------------------- multi-select & bulk status */
.pcard.selected { outline: 3px solid var(--sec); outline-offset: -1px; }
.pcard .img .pick { position: absolute; right: 8px; bottom: 8px; width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.85); border: 2px solid rgba(0,0,0,.25); display: grid; place-items: center; }
.pcard .img .pick.on { background: var(--sec); border-color: transparent; color: #fff; }
.pcard .img .pick svg { width: 18px; height: 18px; }
.pcard.selected .img .price { display: none; }
.chip.select-chip svg { width: 14px; height: 14px; }
.bulk-bar { position: fixed; left: 12px; right: 12px; bottom: calc(80px + var(--safe-b) + var(--vv-gap)); z-index: 26; max-width: 560px; margin: 0 auto;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 12px 14px; }
.bulk-btns { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.bulk-btns .btn { padding-left: 4px; padding-right: 4px; font-size: .78rem; color: #fff; border-color: transparent; }
.bulk-btns .st-raa { background: var(--st-raa); } .bulk-btns .st-skro { background: var(--st-skro); }
.bulk-btns .st-glaseret { background: var(--st-glaseret); } .bulk-btns .st-faerdig { background: var(--st-faerdig); }
.bulk-btns .st-fejl { background: var(--st-fejl); }
.bulk-btns .btn:disabled { opacity: .45; }
main:has(.bulk-bar) .pgrid { padding-bottom: 150px; }

/* ---------------------------------------------------------------- glaze picker */
.glaze-pick { display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; min-width: 0; }
.glaze-pick > svg { width: 16px; height: 16px; opacity: .55; flex: none; }
.sheet .list-item { width: 100%; background: none; border: 0; font: inherit; color: inherit; cursor: pointer; }
.sheet .list-item > svg { width: 18px; height: 18px; opacity: .6; flex: none; }

/* keyboard open (iOS): keep the bottom bars out of the way */
.kb-open .tabbar, .kb-open .fab, .kb-open .bulk-bar { display: none; }
.kb-open .save-bar { bottom: 0; }

/* sheet header with close button */
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 -16px 12px; padding: 4px 16px; min-height: 36px; position: sticky; top: -10px; z-index: 2; background: var(--bg); }
.sheet-head h2 { margin: 0; }
.sheet-close { padding: 0; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--card-2); color: var(--text); display: grid; place-items: center; border: 0; cursor: pointer; }
.sheet-close svg { width: 20px; height: 20px; }

/* glaze page: colour field when there is no picture yet */
.hero .glaze-noimg { display: grid; place-items: center; aspect-ratio: 16/9; }
.hero .glaze-noimg svg { width: 48px; height: 48px; opacity: .5; }
