[hidden] { display: none !important; }
body { margin: 0; }
img { max-width: 100%; }
/* Layout: app shell. Phone = top bar + bottom tab bar with a centre "+" action; laptop = left sidebar + content column. */
:root {
  /* Mango Market (default, light) */
  --bg: #FFF8EE; --surface: #FFFFFF; --surface-2: #FDF0DC; --ink: #17302F; --muted: #5E706C; --line: #EEDFC8;
  --brand: #0E4D52; --on-brand: #FFF3DF; --brand-soft: #DCEDEA; --hero: #0E4D52; --on-hero: #FFF3DF;
  --accent: #FFB627; --on-accent: #2A1A00;
  --good: #1F8A5B; --warn: #C77700; --bad: #E2502F; --info: #1F6FB2;
  --chart-a: #0E4D52; --chart-b: #FFB627;
  --font-ui: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(23 48 47 / .06), 0 6px 20px rgb(23 48 47 / .06);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0C1F21; --surface: #12292B; --surface-2: #183538; --ink: #F5EBDD; --muted: #A2B3AF; --line: #24464A;
  --brand: #0A3639; --on-brand: #FFE7B8; --brand-soft: #1B3E41; --hero: #1F6166; --on-hero: #FFF3DF;
  --accent: #FFC24D; --on-accent: #2A1A00;
  --good: #4CC38A; --warn: #F2A93B; --bad: #FF7A5C; --info: #6AB4F0;
  --chart-a: #7FD1C7; --chart-b: #FFC24D; --shadow: 0 1px 2px rgb(0 0 0 / .3); color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0C1F21; --surface: #12292B; --surface-2: #183538; --ink: #F5EBDD; --muted: #A2B3AF; --line: #24464A;
  --brand: #0A3639; --on-brand: #FFE7B8; --brand-soft: #1B3E41; --hero: #1F6166; --on-hero: #FFF3DF;
  --accent: #FFC24D; --on-accent: #2A1A00;
  --good: #4CC38A; --warn: #F2A93B; --bad: #FF7A5C; --info: #6AB4F0;
  --chart-a: #7FD1C7; --chart-b: #FFC24D; --shadow: 0 1px 2px rgb(0 0 0 / .3); color-scheme: dark }

/* Island Blue */
:root[data-palette="island"] {
  --bg: #F8F3EA; --surface: #FFFFFF; --surface-2: #F1E6D3; --ink: #0B2233; --muted: #56697A; --line: #E4D8C4;
  --brand: #0B3C5D; --on-brand: #F6EBD9; --brand-soft: #DDEBF3; --hero: #0B3C5D; --on-hero: #F6EBD9;
  --accent: #00B4D8; --on-accent: #032430;
  --good: #1E8C62; --warn: #C46A00; --bad: #E8603A; --info: #0B78A8;
  --chart-a: #0B3C5D; --chart-b: #FF8C61; --font-ui: "Outfit", "Segoe UI", system-ui, sans-serif; }
@media (prefers-color-scheme: dark) { :root[data-palette="island"]:not([data-theme="light"]) {
  --bg: #07192A; --surface: #0D2438; --surface-2: #12304A; --ink: #EAF2F7; --muted: #9BB1C2; --line: #1D3D57;
  --brand: #05192A; --on-brand: #F6EBD9; --brand-soft: #143552; --hero: #17507A; --on-hero: #F6EBD9;
  --accent: #2CC9E8; --on-accent: #032430;
  --good: #4CC38A; --warn: #F2A93B; --bad: #FF8C61; --info: #6AB4F0; --chart-a: #5CC8E6; --chart-b: #FF9D76; } }
:root[data-palette="island"][data-theme="dark"] {
  --bg: #07192A; --surface: #0D2438; --surface-2: #12304A; --ink: #EAF2F7; --muted: #9BB1C2; --line: #1D3D57;
  --brand: #05192A; --on-brand: #F6EBD9; --brand-soft: #143552; --hero: #17507A; --on-hero: #F6EBD9;
  --accent: #2CC9E8; --on-accent: #032430;
  --good: #4CC38A; --warn: #F2A93B; --bad: #FF8C61; --info: #6AB4F0; --chart-a: #5CC8E6; --chart-b: #FF9D76; }

/* Calm Pro */
:root[data-palette="calm"] {
  --bg: #F2F5F4; --surface: #FFFFFF; --surface-2: #E8EEEC; --ink: #1B2A2F; --muted: #5B6B70; --line: #DCE4E2;
  --brand: #1B2A2F; --on-brand: #F2F5F4; --brand-soft: #DDF5EA; --hero: #1B2A2F; --on-hero: #F2F5F4;
  --accent: #3DDC97; --on-accent: #0B2A1D;
  --good: #16865A; --warn: #B86E00; --bad: #D64545; --info: #2F6FB0;
  --chart-a: #1B2A2F; --chart-b: #3DDC97; --font-ui: "Inter", "Segoe UI", system-ui, sans-serif; --radius: 12px; --radius-sm: 8px; }
@media (prefers-color-scheme: dark) { :root[data-palette="calm"]:not([data-theme="light"]) {
  --bg: #111A1D; --surface: #172327; --surface-2: #1E2D32; --ink: #E8EFED; --muted: #94A6A3; --line: #2A3B40;
  --brand: #0C1416; --on-brand: #E8EFED; --brand-soft: #1A3A2E; --hero: #1F4A3B; --on-hero: #E8EFED;
  --accent: #3DDC97; --on-accent: #0B2A1D;
  --good: #4CC38A; --warn: #F2A93B; --bad: #F07070; --info: #6AB4F0; --chart-a: #9FB6B1; --chart-b: #3DDC97; } }
:root[data-palette="calm"][data-theme="dark"] {
  --bg: #111A1D; --surface: #172327; --surface-2: #1E2D32; --ink: #E8EFED; --muted: #94A6A3; --line: #2A3B40;
  --brand: #0C1416; --on-brand: #E8EFED; --brand-soft: #1A3A2E; --hero: #1F4A3B; --on-hero: #E8EFED;
  --accent: #3DDC97; --on-accent: #0B2A1D;
  --good: #4CC38A; --warn: #F2A93B; --bad: #F07070; --info: #6AB4F0; --chart-a: #9FB6B1; --chart-b: #3DDC97; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-ui); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--brand); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.num, .money { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: .86em; letter-spacing: -.01em; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); }

/* Shell */
.shell { min-height: 100%; display: grid; grid-template-columns: 1fr; }
.sidebar { display: none; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--brand); color: var(--on-brand);
  display: flex; align-items: center; gap: 12px; padding-block: 12px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wordmark { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; }
.wordmark .seal { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.topbar .spacer { flex: 1; }
.sample-chip { font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; background: color-mix(in srgb, var(--on-brand) 16%, transparent); }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: color-mix(in srgb, var(--on-brand) 12%, transparent); color: var(--on-brand); display: grid; place-items: center; }
.main { padding-block: 20px 110px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); min-width: 0; }
.view { max-width: 1120px; margin: 0 auto; display: grid; gap: 18px; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px)); padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px)); }
.tab { border: 0; background: none; display: grid; justify-items: center; gap: 2px; font-size: .7rem; font-weight: 600; color: var(--muted); padding: 6px 0; text-decoration: none; }
.tab[aria-current="page"] { color: var(--brand); }
:root[data-theme="dark"] .tab[aria-current="page"] { color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tab[aria-current="page"] { color: var(--accent); } }
.tab .pill { padding: 3px 14px; border-radius: 999px; }
.tab[aria-current="page"] .pill { background: var(--brand-soft); }
.fab { justify-self: center; width: 56px; height: 56px; margin-top: -26px; border-radius: 18px; border: 0; background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 45%, transparent); display: grid; place-items: center; }

@media (min-width: 900px) {
  .shell { grid-template-columns: 248px 1fr; }
  .sidebar { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; background: var(--brand); color: var(--on-brand); padding: 20px 14px; padding-left: max(14px, env(safe-area-inset-left, 0px)); }
  .sidebar .wordmark { padding: 4px 8px 18px; }
  .side-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: color-mix(in srgb, var(--on-brand) 80%, transparent); text-decoration: none; font-weight: 600; border: 0; background: none; text-align: left; }
  .side-link:hover { background: color-mix(in srgb, var(--on-brand) 8%, transparent); }
  .side-link[aria-current="page"] { background: color-mix(in srgb, var(--on-brand) 14%, transparent); color: var(--on-brand); }
  .side-link.primary { background: var(--accent); color: var(--on-accent); margin-bottom: 12px; justify-content: center; }
  .side-sep { height: 1px; background: color-mix(in srgb, var(--on-brand) 14%, transparent); margin: 10px 8px; }
  .side-note { font-size: .72rem; opacity: .6; padding: 0 12px; }
  .sidebar .grow { flex: 1; }
  .topbar .wordmark, .topbar .mobile-only { display: none; }
  .topbar { position: static; background: transparent; color: var(--ink); padding-top: 22px; padding-bottom: 0; }
  .topbar .sample-chip { background: var(--surface-2); color: var(--muted); }
  .topbar .icon-btn { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
  .tabbar { display: none; }
  .main { padding-bottom: 40px; padding-left: 28px; padding-right: max(28px, env(safe-area-inset-right, 0px)); }
}

/* Generic pieces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.btn { text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 16px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.btn.dark { background: var(--hero); border-color: transparent; color: var(--on-hero); }
.btn.small { padding: 6px 12px; font-size: .85rem; border-radius: 10px; }
.btn.block { width: 100%; justify-content: center; padding: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; border-radius: 999px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--hero); color: var(--on-hero); border-color: transparent; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.b-good { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.b-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 15%, transparent); }
.b-bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.b-info { color: var(--info); background: color-mix(in srgb, var(--info) 14%, transparent); }
.b-mute { color: var(--muted); background: var(--surface-2); }
.thumb { width: 52px; height: 52px; border-radius: 12px; flex: none; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; color: var(--brand); font-size: .9rem; }
:root[data-theme="dark"] .thumb { color: var(--accent); }

/* Overview */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 4px; min-width: 0; }
.kpi.hero { background: var(--hero); color: var(--on-hero); border-color: transparent; }
.kpi .label { font-size: .8rem; font-weight: 600; color: var(--muted); }
.kpi.hero .label { color: color-mix(in srgb, var(--on-hero) 75%, transparent); }
.kpi .value { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: .78rem; color: var(--muted); }
.kpi.hero .sub { color: color-mix(in srgb, var(--on-hero) 75%, transparent); }
.delta { font-weight: 700; color: var(--good); }
.kpi.hero .delta { color: var(--accent); }
.grid-2 { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }
.legend { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 14px; font-family: var(--font-ui); }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.hbar + .hbar { margin-top: 12px; }
.hbar .track { grid-column: 1 / -1; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--chart-b); border-radius: 99px; }
.hbar .name { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pipeline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.stage { background: var(--surface-2); border-radius: 12px; padding: 10px 8px; text-align: center; position: relative; }
.stage b { display: block; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.stage span { font-size: .7rem; font-weight: 600; color: var(--muted); }
.stage.hot { background: var(--accent); color: var(--on-accent); }
.stage.hot span { color: var(--on-accent); opacity: .8; }
.alerts { display: grid; gap: 8px; }
.alert { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border-left: 4px solid var(--warn); }
.alert.bad { border-left-color: var(--bad); }
.alert.info { border-left-color: var(--info); }
.alert p { flex: 1; min-width: 0; font-size: .9rem; }
.alert .go { color: var(--muted); }

/* Lists of cards */
.list { display: grid; gap: 10px; }
@media (min-width: 900px) { .list.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.row-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; min-width: 0; }
.row-top { display: flex; gap: 12px; align-items: flex-start; }
.row-top .info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.row-top .title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { font-size: .82rem; color: var(--muted); }
.row-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.price { font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.margin { font-size: .82rem; font-weight: 700; color: var(--good); }
.more-btn { border: 0; background: var(--surface-2); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }

/* Parcel timeline */
.timeline { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); position: relative; }
.timeline::before { content: ""; position: absolute; left: 8.33%; right: 8.33%; top: 7px; height: 3px; background: var(--line); border-radius: 3px; }
.timeline .progress { position: absolute; left: 8.33%; top: 7px; height: 3px; background: var(--accent); border-radius: 3px; }
.tl-step { display: grid; justify-items: center; gap: 4px; text-align: center; position: relative; }
.tl-dot { width: 17px; height: 17px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line); }
.tl-step.done .tl-dot { background: var(--accent); border-color: var(--accent); }
.tl-step.now .tl-dot { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); }
.tl-step span { font-size: .68rem; font-weight: 600; color: var(--muted); line-height: 1.2; }
.tl-step small { font-size: .64rem; color: var(--muted); opacity: .8; font-variant-numeric: tabular-nums; }
.tl-step.now span { color: var(--ink); }

/* Stock */
.stock-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.stat { background: var(--surface-2); border-radius: 10px; padding: 8px; text-align: center; }
.stat b { display: block; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: .7rem; color: var(--muted); font-weight: 600; }

/* Import */
.steps { display: flex; gap: 8px; align-items: center; font-size: .82rem; font-weight: 700; color: var(--muted); flex-wrap: wrap; }
.steps .s { display: flex; align-items: center; gap: 6px; }
.steps .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: .75rem; }
.steps .s.on { color: var(--ink); }
.steps .s.on .n { background: var(--accent); color: var(--on-accent); }
.steps .line { width: 24px; height: 2px; background: var(--line); }
.drop { border: 2px dashed color-mix(in srgb, var(--brand) 35%, var(--line)); border-radius: var(--radius); padding: 28px 16px; text-align: center; display: grid; gap: 10px; justify-items: center; background: var(--surface); }
.drop.over { background: var(--brand-soft); }
.drop .big { width: 56px; height: 56px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.previews { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.previews img { width: 64px; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.scan { display: grid; gap: 10px; justify-items: center; padding: 30px 0; }
.scan .bar { width: min(320px, 100%); height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.scan .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 1.4s ease; }
.review { display: grid; gap: 14px; }
.found { font-size: .72rem; font-weight: 700; color: var(--good); display: inline-flex; gap: 4px; align-items: center; }
.fields { display: grid; gap: 10px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .fields { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.fields .wide { grid-column: 1 / -1; }
.field { display: grid; gap: 4px; min-width: 0; }
.field label, .field .lbl { font-size: .75rem; font-weight: 700; color: var(--muted); }
.field input, .field select { width: 100%; min-width: 0; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: .95rem; }
.field .ro { padding: 10px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.calc { background: var(--surface-2); border-radius: 12px; padding: 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; font-size: .9rem; }
.calc b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.calc .eq { color: var(--muted); }
.seg { display: inline-grid; grid-auto-flow: column; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: none; padding: 8px 14px; border-radius: 9px; font-weight: 700; font-size: .85rem; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.tip { font-size: .85rem; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }

/* Sheet + popovers */
.backdrop { position: fixed; inset: 0; z-index: 20; background: rgb(5 15 16 / .45); display: grid; align-items: end; justify-items: center; }
.sheet { background: var(--surface); width: 100%; max-height: 92%; border-radius: 22px 22px 0 0; display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; }
@media (min-width: 700px) { .backdrop { align-items: center; } .sheet { width: min(560px, 92vw); border-radius: 22px; max-height: 86%; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.sheet-body { overflow: auto; padding: 16px 18px; display: grid; gap: 14px; align-content: start; }
.sheet-foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); display: grid; gap: 10px; }
.close-x { border: 0; background: var(--surface-2); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.actions { display: grid; gap: 8px; }
.action { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); text-align: left; }
.action .ic { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.action b { display: block; }
.action small { color: var(--muted); }
.palettes { display: grid; gap: 10px; }
.pal { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); text-align: left; }
.pal[aria-pressed="true"] { border-color: var(--accent); }
.sw { display: flex; }
.sw i { width: 22px; height: 34px; }
.sw i:first-child { border-radius: 8px 0 0 8px; }
.sw i:last-child { border-radius: 0 8px 8px 0; }
.pal .check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.pal[aria-pressed="true"] .check { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 30; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: .9rem; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
@media (min-width: 900px) { .toast { bottom: 28px; } }
.menu { position: fixed; z-index: 25; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 30px rgb(0 0 0 / .18); padding: 6px; display: grid; min-width: 190px; }
.menu button { border: 0; background: none; text-align: left; padding: 10px 12px; border-radius: 10px; font-weight: 600; }
.menu button:hover { background: var(--surface-2); }
.empty { text-align: center; color: var(--muted); padding: 24px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- App additions ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding-block: 32px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.login form { width: min(400px, 100%); display: grid; gap: 14px; }
.login .wordmark { color: var(--ink); justify-content: center; font-size: 1.3rem; }
.error { color: var(--bad); font-weight: 600; font-size: .9rem; }
.note { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; font-size: .9rem; display: grid; gap: 6px; }
.note.warn { border-left: 4px solid var(--warn); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.field textarea { width: 100%; min-height: 110px; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 10px 12px; font: inherit; color: inherit; }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 6px; }
.pill-count { font-size: .75rem; font-weight: 700; color: var(--muted); background: var(--surface-2); padding: 2px 8px; border-radius: 999px; }
.bm { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 800; text-decoration: none; cursor: grab; border: 2px dashed color-mix(in srgb, var(--on-accent) 35%, transparent); }
.steps-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.thumb { overflow: hidden; }
.mini { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; flex: none; background: var(--surface-2); }
.items-mini { display: flex; gap: 4px; flex-wrap: wrap; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }
.danger { color: var(--bad); }
.linklike { border: 0; background: none; color: var(--info); font-weight: 700; padding: 0; text-decoration: underline; cursor: pointer; }
.more-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.more-grid .action { width: 100%; }
details.card summary { cursor: pointer; font-weight: 700; }
@media (max-width: 899px) { .desktop-only { display: none !important; } }
a.action { color: inherit; text-decoration: none; }
a.icon-btn { text-decoration: none; }
@media (min-width: 900px) { .desktop-hide { display: none !important; } }
