:root {
  /* Dark only: Tibor liked the dark dashboard (feedback 26-9-2026) */
  --bg: #111315; --panel: #1B1E21; --col: #16181B; --ink: #ECEDEA; --muted: #9AA0A6; --line: #2B2F33;
  --accent: #F2B81C; --accent-ink: #111315; --chip: #24282C; --bar: #0A0B0C; --bar-ink: #ECEDEA; --bar-chip: #24282C;
  --todo: #9CA3AF; --doing: #6EA2F5; --done: #5BBE86; --revise: #F08A55; --approved: #C79BF2; --danger: #F97066;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}
/* Light mode, switched on per person with the toggle in the top bar. The top bar stays dark in both. */
body.light {
  --bg: #F3F4F2; --panel: #FFFFFF; --col: #E6E8E5; --ink: #16181B; --muted: #5E646A; --line: #D8DBD7;
  --accent: #E3A600; --accent-ink: #16181B; --chip: #ECEEEB; --bar: #16181B; --bar-ink: #F3F4F2; --bar-chip: #2A2E33;
  --todo: #6B7280; --doing: #2F6FD6; --done: #2F7D4F; --revise: #C8551F; --approved: #7C4DBF; --danger: #B42318;
  --shadow: 0 1px 2px rgba(22,24,27,.08), 0 2px 8px rgba(22,24,27,.05);
  color-scheme: light;
}
.theme { white-space: nowrap; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: var(--bar); color: var(--bar-ink); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; font-size: 14px; }
.brand img { width: 26px; height: 26px; }
.tabs { display: flex; gap: 4px; }
.tabs button { background: transparent; border: 0; color: #B9BEC3; padding: 7px 12px; border-radius: 6px; cursor: pointer; font-weight: 600; }
.tabs button[aria-current="page"] { background: var(--bar-chip); color: var(--bar-ink); }
.spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 8px; }
.who button { background: var(--bar-chip); border: 0; color: var(--bar-ink); padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }

/* ---------- shared controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); padding: 8px 14px;
  border-radius: 6px; cursor: pointer; font-weight: 600; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, .tabs button:focus-visible, .card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=text], input[type=password], input[type=url], input[type=date], input[type=number], select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.f { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.f > span { text-transform: uppercase; letter-spacing: .05em; font-size: 11px; }

/* ---------- board ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 16px 6px; }
.toolbar select { width: auto; min-width: 150px; background: var(--panel); }
.toolbar .count { color: var(--muted); font-size: 13px; }
.board { display: grid; grid-template-columns: repeat(5, minmax(230px, 1fr)); gap: 12px; padding: 8px 16px 32px; align-items: start; }
.column { background: var(--col); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.column header { display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; font-weight: 700; font-size: 13px;
  text-transform: uppercase; letter-spacing: .06em; }
.column header .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.column header .n { color: var(--muted); font-family: var(--mono); font-weight: 500; }
.column[data-status=todo] { --c: var(--todo); } .column[data-status=doing] { --c: var(--doing); }
.column[data-status=revise] { --c: var(--revise); } .column[data-status=done] { --c: var(--done); }
.column[data-status=approved] { --c: var(--approved); }
.column.over { outline: 2px dashed var(--c); outline-offset: -2px; }
.column .empty { color: var(--muted); font-size: 13px; padding: 10px 4px; }
.column .more { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; padding: 6px; text-decoration: underline; }

.card { background: var(--panel); border-radius: 8px; padding: 10px 12px; box-shadow: var(--shadow); cursor: pointer; display: grid; gap: 7px;
  border-left: 3px solid var(--c, transparent); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.card .client { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.card .title { font-weight: 600; }
.card .meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--chip); font-weight: 600; font-variant-numeric: tabular-nums; }
.pill.late { background: var(--danger); color: #fff; }
.pill.soon { background: var(--accent); color: var(--accent-ink); }
.pill.rev { background: var(--revise); color: #fff; }
.avatar { margin-left: auto; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: var(--ink); color: var(--bg); flex: none; }
.progress { height: 5px; background: var(--chip); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--done); }
.card.ghost { position: fixed; z-index: 100; pointer-events: none; transform: rotate(2deg); box-shadow: 0 10px 30px rgba(0,0,0,.25); opacity: .95; }
.card.dragging { opacity: .3; }
.placeholder { height: 56px; border-radius: 8px; border: 2px dashed var(--line); }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(10,12,14,.45); display: flex; justify-content: center; align-items: flex-start;
  padding: 5vh 16px; overflow-y: auto; }
.modal { background: var(--panel); border-radius: 12px; width: 100%; max-width: 680px; padding: 20px; display: grid; gap: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal h2 { margin: 0; font-size: 20px; }
#card-form { display: grid; gap: 14px; }
.modal .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal .actions { display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
.modal .actions > div { display: flex; gap: 8px; flex-wrap: wrap; }
.statusbar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.statusbar button { border: 1px solid var(--line); background: var(--bg); border-radius: 6px; padding: 8px 4px; cursor: pointer; font-weight: 600; font-size: 13px; }
.statusbar button[aria-pressed=true] { background: var(--c); border-color: var(--c); color: #fff; }
.statusbar [data-s=todo] { --c: var(--todo); } .statusbar [data-s=doing] { --c: var(--doing); }
.statusbar [data-s=revise] { --c: var(--revise); } .statusbar [data-s=done] { --c: var(--done); }
.statusbar [data-s=approved] { --c: var(--approved); }
.statusbar button[aria-pressed=true] { color: #fff; }
body:not(.light) .statusbar button[aria-pressed=true] { color: #111315; }
.section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.checklist { display: grid; gap: 2px; }
.check { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; }
.check:hover { background: var(--bg); }
.check input { width: 18px; height: 18px; accent-color: var(--done); flex: none; }
.check.done span { text-decoration: line-through; color: var(--muted); }
.check.revision { background: color-mix(in srgb, var(--revise) 10%, transparent); }
.check .pill { font-size: 12px; }
.check .x { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; padding: 0 4px; }
.addrow { display: flex; gap: 8px; }
.addrow input { flex: 1; }
.readonly { white-space: pre-wrap; }
.linkline a { word-break: break-all; }
.confirm { background: color-mix(in srgb, var(--danger) 10%, transparent); padding: 10px; border-radius: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- summary strip ---------- */
.muted { color: var(--muted); }
.summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 16px 0; }
.sum { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); border-radius: 8px;
  padding: 7px 12px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); }
.sum b { font-size: 18px; font-variant-numeric: tabular-nums; color: var(--ink); }
.sum.late.hot { border-color: var(--danger); } .sum.late.hot b { color: var(--danger); }
.sum.soon.hot { border-color: var(--accent); }
.sum.rev.hot { border-color: var(--revise); } .sum.rev.hot b { color: var(--revise); }
.sum[aria-pressed=true] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.sum[aria-pressed=true] b { color: var(--bg); }
.load { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; margin-left: 6px; }
.loadchip { border: 0; background: var(--chip); border-radius: 999px; padding: 4px 10px; cursor: pointer; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.loadchip[aria-pressed=true] { background: var(--ink); color: var(--bg); }
.clear { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 13px; }
.card .client { display: flex; gap: 6px; align-items: center; justify-content: space-between; }
.type { font-size: 10px; padding: 1px 6px; border-radius: 4px; background: var(--chip); color: var(--ink); letter-spacing: .04em; }
.type.t-posting { background: color-mix(in srgb, var(--doing) 18%, transparent); }
.type.t-clipping { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.type.t-shoot { background: color-mix(in srgb, var(--done) 20%, transparent); }

/* ---------- comments, tables ---------- */
.nudge { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 12px; border-radius: 8px;
  background: color-mix(in srgb, var(--done) 12%, transparent); font-weight: 600; }
.linklist { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -6px; }
.linklist a { font-size: 13px; background: var(--chip); padding: 3px 8px; border-radius: 6px; text-decoration: none; }
a.btn { text-decoration: none; }
.comments { display: grid; gap: 8px; }
.comment { background: var(--bg); border-radius: 8px; padding: 8px 10px; display: grid; gap: 2px; }
.chead { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.chead .x { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; }
.addrow select.narrow { width: auto; max-width: 40%; }
.modal.wide { max-width: 820px; }
.tablewrap { overflow-x: auto; }
table.plan { width: 100%; border-collapse: collapse; font-size: 14px; }
table.plan th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.plan td { padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.plan td select, table.plan td input[type=number] { padding: 5px 8px; min-width: 90px; }
table.plan td input[type=number] { width: 80px; min-width: 0; }
table.plan td input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
table.plan .num { font-variant-numeric: tabular-nums; font-weight: 600; }
label.inline { display: flex; gap: 8px; align-items: center; font-size: 14px; }
label.inline input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- lists (clients, team) ---------- */
.page { max-width: 900px; margin: 0 auto; padding: 16px; display: grid; gap: 14px; }
.page h1 { margin: 0; font-size: 22px; }
.list { background: var(--panel); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.list .item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list .item:last-child { border-bottom: 0; }
.list .item:hover { background: var(--bg); }
.list .item .sub { color: var(--muted); font-size: 13px; }
.list .item .grow { flex: 1; min-width: 0; }
.list .item.off { opacity: .55; }
.secret { font-family: var(--mono); background: var(--chip); padding: 10px; border-radius: 6px; user-select: all; }

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.login form { background: var(--panel); padding: 28px; border-radius: 12px; box-shadow: var(--shadow); width: 100%; max-width: 360px; display: grid; gap: 14px; }
.login h1 { margin: 0; font-size: 22px; display: flex; gap: 10px; align-items: center; }
.login h1 img { width: 32px; }
.err { color: var(--danger); font-size: 14px; min-height: 1em; }

#toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 8px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 200; }
#toast.show { opacity: 1; }

/* ---------- phone ---------- */
@media (max-width: 820px) {
  .board { grid-template-columns: repeat(5, minmax(260px, 1fr)); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 40px; }
  .column { scroll-snap-align: center; }
  .modal .row { grid-template-columns: 1fr; }
  .top .tabs { order: 3; width: 100%; }
  .who > span { display: none; }
  .sum { padding: 5px 10px; font-size: 13px; } .sum b { font-size: 15px; }
  .load { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }

/* ---------- people, avatars, clip links ---------- */
.people { display: flex; flex-wrap: wrap; gap: 6px; }
.person { border: 1px solid var(--line); background: var(--bg); color: var(--muted); border-radius: 999px; padding: 5px 11px; cursor: pointer; font-size: 13px; font-weight: 600; }
.person[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.person:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
table.plan .people { min-width: 260px; }
.avatars { margin-left: auto; display: flex; }
.avatars .avatar { margin-left: -6px; border: 2px solid var(--panel); }
.avatars .avatar:first-child { margin-left: 0; }
.avatar.more { background: var(--chip); color: var(--ink); }
.check label { flex: 1; cursor: pointer; }
.check.done label { text-decoration: line-through; color: var(--muted); }
.check .vlink { font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; }
.check .x.link { font-size: 12px; margin-left: 0; }
.linkedit { padding: 0 8px 6px 36px; }
.addrow .count-in { width: 72px; flex: 0 0 72px; }
.addrow { align-items: center; }

/* ---------- team per function ---------- */
.teamgroup { display: grid; gap: 8px; }
.peoplegroups { display: grid; gap: 8px; }
.prow { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; }
.plabel { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
table.plan .prow { grid-template-columns: 1fr; gap: 4px; }
@media (max-width: 820px) { .prow { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- settings ---------- */
.settings { background: var(--panel); border-radius: 10px; box-shadow: var(--shadow); padding: 18px; display: grid; gap: 12px; }
.settings h2 { margin: 0; font-size: 18px; }

/* ---------- priority ---------- */
.pill.prio.p1 { background: var(--danger); color: #fff; }
.pill.prio.p3 { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.prio-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.prio-opt { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.prio-opt input { position: absolute; opacity: 0; pointer-events: none; }
.prio-opt:has(input:checked) { color: var(--ink); border-color: var(--ink); }
.prio-opt.p1:has(input:checked) { background: var(--danger); border-color: var(--danger); color: #fff; }
.prio-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.sum.high.hot { border-color: var(--danger); } .sum.high.hot b { color: var(--danger); }

/* ---------- every screen size (responsive test: npm run test:responsive) ---------- */
.boardwrap { max-width: 2400px; margin: 0 auto; }
.board { overflow-x: auto; }
@media (min-width: 821px) { .board { grid-template-columns: repeat(5, minmax(210px, 1fr)); } }
.modal, .modal > *, .f, .f > *, .prow > *, .row > *, .addrow > * { min-width: 0; }
.modal input, .modal select, .modal textarea { max-width: 100%; }
.colswitch { display: none; }
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { white-space: nowrap; flex: none; }

/* Phones: compact top bar, one column at a time, swipeable counters */
@media (max-width: 720px) {
  .top { gap: 6px 8px; padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px; }
  .brand { font-size: 13px; gap: 8px; }
  .brand img { width: 22px; height: 22px; }
  .who { gap: 6px; margin-left: auto; }
  .who button { padding: 7px 9px; font-size: 12px; }
  .top .tabs { order: 3; width: 100%; flex-wrap: nowrap; margin: 0 -4px; }
  .tabs button { padding: 7px 8px; font-size: 12.5px; }
  .who .theme .tlabel { display: none; }
  .summary { flex-wrap: nowrap; overflow-x: auto; padding: 10px 12px 0; scrollbar-width: none; }
  .summary::-webkit-scrollbar { display: none; }
  .summary > * { flex: none; }
  .load { flex-wrap: nowrap; }
  .toolbar { padding: 10px 12px 4px; gap: 8px; }
  .toolbar select { flex: 1 1 140px; min-width: 0; }
  .toolbar .btn.primary { flex: 1 1 100%; justify-content: center; }
  .toolbar .count { display: none; }
  .colswitch { display: flex; gap: 4px; padding: 6px 12px 0; overflow-x: auto; scrollbar-width: none; }
  .colswitch::-webkit-scrollbar { display: none; }
  .colswitch button { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--panel);
    color: var(--muted); border-radius: 8px; padding: 9px 10px; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; cursor: pointer; white-space: nowrap; }
  .colswitch button .n { font-family: var(--mono); font-weight: 500; }
  .colswitch button[aria-selected=true] { color: var(--ink); border-color: var(--c); box-shadow: inset 0 -3px 0 var(--c); }
  .board { display: block; overflow: visible; padding: 8px 12px 32px; }
  .board .column { display: none; }
  .board[data-show=todo] .column[data-status=todo], .board[data-show=doing] .column[data-status=doing], .board[data-show=done] .column[data-status=done],
  .board[data-show=revise] .column[data-status=revise], .board[data-show=approved] .column[data-status=approved] { display: flex; }
  .column header { display: none; }
  .overlay { padding: 12px 8px; }
  .modal { padding: 16px; border-radius: 12px; }
  .statusbar { grid-template-columns: repeat(3, 1fr); }
  .page { padding: 12px; }
  .prow { grid-template-columns: 1fr; gap: 4px; }
}

/* Touch screens: fingers need room */
@media (pointer: coarse) {
  .loadchip, .person, .prio-opt, .clear, .more, .linkish { min-height: 36px; }
  .check { min-height: 44px; }
  .check input { width: 22px; height: 22px; }
  .x, .check .x.link, .chead .x { min-width: 36px; min-height: 36px; }
  .check .vlink { padding: 8px 4px; }
  .who button, .tabs button { min-height: 36px; min-width: 36px; }
}

/* Very wide screens: keep columns at a readable width */
@media (min-width: 2000px) {
  .board { grid-template-columns: repeat(5, minmax(240px, 1fr)); }
}

@media (max-width: 380px) {
  .who button { padding: 7px 8px; }
}

/* ---------- settings switch, created line ---------- */
.page > .settings + .settings { margin-top: 0; }
.switch { display: flex; align-items: center; gap: 12px; font-weight: 600; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .slider { position: relative; width: 44px; height: 26px; border-radius: 13px; background: var(--chip); border: 1px solid var(--line); flex: none; transition: background .15s; }
.switch .slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked + .slider { background: var(--done); border-color: var(--done); }
.switch input:checked + .slider::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent); outline-offset: 2px; }
.created { margin: -8px 0 0; font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .switch .slider, .switch .slider::after { transition: none; } }

/* FRIDAY: small "by SVBS" next to the name on the login screen */
.bsub { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 8px; letter-spacing: .04em; }

/* ---------- app feel ---------- */
/* Tab icons and the account button only show on phones */
.tico { display: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.acct { display: none; }
button, a, .card { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

@media (max-width: 720px) {
  html, body { overflow-x: hidden; overscroll-behavior-y: none; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  /* Top: just the name and your account button */
  .top { flex-wrap: nowrap; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; }
  .top .who { display: none; }
  .acct { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; border: 0;
    background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 13px; cursor: pointer; flex: none; }
  /* Tabs: a fixed bar at the bottom, like an app */
  .top .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0; width: auto; order: 0;
    display: flex; justify-content: space-around; gap: 0; overflow: visible;
    background: var(--bar); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .top .tabs button { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 4px 2px; font-size: 10.5px; font-weight: 600; background: transparent; color: #8A9096; border-radius: 10px; }
  .top .tabs button[aria-current="page"] { background: transparent; color: var(--accent); }
  .top .tabs .tlbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tico { display: block; }
  /* No zoom-in when tapping a field (iPhone zooms on text under 16px) */
  input[type=text], input[type=password], input[type=url], input[type=date], input[type=number], select, textarea { font-size: 16px; }
  /* Windows open as a full sheet from the bottom */
  /* Top-aligned with an auto margin: short windows still sit at the bottom, long ones can scroll to their top */
  /* Windows only move up and down: no sideways panning, long links and titles wrap */
  .overlay { padding: 0; align-items: flex-start; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; overflow-x: hidden; touch-action: pan-y; }
  .modal, .modal * { overflow-wrap: break-word; }
  .modal .readonly, .modal a { overflow-wrap: anywhere; }
  body:has(.overlay) { overflow: hidden; }
  .modal { margin-top: auto; border-radius: 16px 16px 0 0; max-width: none; min-height: 88vh; padding: 18px 16px calc(24px + env(safe-area-inset-bottom, 0px)); box-shadow: none; }
  .modal.sheet { min-height: 0; }
  .sheetbtns { display: grid; gap: 10px; }
  .sheetbtns .btn { justify-content: center; min-height: 48px; font-size: 16px; }
  #toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}
/* Opened from the home screen: status bar sits on top of the dark bar */
@media (display-mode: standalone) and (max-width: 720px) {
  .top { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
}

/* ---------- counters and column switcher: everything in view, no sideways scrolling ---------- */
.lshort { display: none; }
.loadchips { display: contents; }
.colswitch .cl { white-space: nowrap; }
@media (max-width: 720px) {
  /* Four counters as tiles: number on top, short label below */
  .summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; overflow: visible; flex-wrap: wrap; }
  .summary > .sum { flex-direction: column; align-items: flex-start; gap: 0; padding: 7px 9px; min-width: 0; }
  .sum b { font-size: 17px; line-height: 1.2; }
  .sum .lfull { display: none; }
  .sum .lshort { display: block; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  /* Per person: own line, chips wrap to a second line when needed */
  .summary > .load { grid-column: 1 / -1; margin: 2px 0 0; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
  .summary > .load > .muted { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
  .loadchips { display: flex; flex-wrap: wrap; gap: 6px; }
  .summary > .clear { grid-column: 1 / -1; justify-self: start; }
  /* Columns: five equal buttons side by side, count on top */
  .colswitch { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; overflow: visible; }
  .colswitch button { flex-direction: column; gap: 1px; padding: 7px 2px 8px; min-width: 0; text-transform: none; letter-spacing: 0; font-size: 11.5px; }
  .colswitch button .n { font-size: 16px; font-weight: 700; font-family: var(--font); color: var(--ink); }
  .colswitch .cl { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
}

/* ---------- phone windows: close button on top, buttons at the bottom, nothing sticks out ---------- */
.mclose { display: none; }
@media (max-width: 720px) {
  /* iPhone gives date fields their own width; keep them inside the window */
  input[type=date] { -webkit-appearance: none; appearance: none; display: block; width: 100%; min-width: 0; max-width: 100%; text-align: left; }
  input[type=date]::-webkit-date-and-time-value { text-align: left; }
  /* Floats top right over the window, so it is always in reach */
  .mclose { display: flex; align-items: center; justify-content: center; position: fixed; z-index: 60;
    top: calc(10px + env(safe-area-inset-top, 0px)); right: 12px; width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid var(--line); background: var(--chip); color: var(--ink); font-size: 24px; line-height: 1; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
  .modal { padding-top: 60px; }
  .modal.sheet { padding-top: 18px; }
  /* Save / Cancel stay visible at the bottom of the screen */
  .modal > .actions { position: sticky; bottom: 0; z-index: 5; background: var(--panel); margin: 0 -16px calc(-24px - env(safe-area-inset-bottom, 0px));
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
}
/* Safari draws its own small select boxes; draw them ourselves at full height */
@media (max-width: 720px) {
  select, .toolbar select { -webkit-appearance: none; appearance: none; min-height: 44px; padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239AA0A6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
}
/* The account menu is short and has its own Close button */
@media (max-width: 720px) { .overlay:has(.sheet) .mclose { display: none; } }
/* Long titles or names without spaces wrap instead of running over other columns */
.card .title, .card .client { overflow-wrap: anywhere; }

/* ---------- white label: Brand block on top of the formats page ---------- */
.brandblock { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 10px; }
.brandblock .bbhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.brandblock h2 { margin: 0; font-size: 17px; }
.brandblock .bbrow { display: grid; gap: 2px; }
.brandblock p { margin: 0; }

/* ---------- output: two tidy cards ---------- */
.outgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; align-items: start; }
.outcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 8px; }
table.out { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
table.out th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 0; border-bottom: 1px solid var(--line); }
table.out td { padding: 8px 0; border-bottom: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.out .num { text-align: right; width: 110px; font-variant-numeric: tabular-nums; font-weight: 700; }
table.out tfoot td { border-bottom: 0; font-weight: 700; padding-top: 10px; }
