/* Alma Finance — styles. Every value comes from theme.css tokens (design/Alma Finance v5.dc.html).
   Desktop ≥ 900px: sidebar + sticky header. Phone < 900px: cream header + floating tab bar. */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: var(--font); background: var(--paper); color: var(--text);
  -webkit-font-smoothing: antialiased; font-size: var(--fs-body); line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font-family: inherit; }
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.small { font-size: var(--fs-small); }
.cream { color: var(--on-ink); }
.center-text { text-align: center; }
.error { color: var(--bad); font-size: var(--fs-body); margin-top: 10px; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ok-text { color: var(--ok); font-weight: 600; }
.amber-text, .warn-text { color: var(--warn); font-weight: 600; }
.red-text { color: var(--bad); font-weight: 600; }
.desktop-only { display: none; }
@media (min-width: 900px) { .desktop-only { display: inline-flex; } .mobile-only { display: none !important; } }

/* ---------- full-screen states (loading, login) ---------- */
.fullscreen { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.fullscreen.green { background: var(--ink); }
.login-card { width: 100%; max-width: 360px; }
.login-card label { color: var(--on-ink-muted); }
.login-card input { background: var(--on-ink-hover); border-color: var(--on-ink-line); color: var(--on-ink); }
.login-card input:focus { border-color: var(--on-ink); box-shadow: none; }
.login-card .btn { margin-top: 6px; }
.login-card p { margin: 18px 0; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0 auto 32px; }
.login-wordmark { width: 170px; height: auto; }
.login-brand .brand-sub { font-size: var(--fs-small); letter-spacing: .22em; text-transform: uppercase; color: var(--on-ink-muted); font-weight: 600; }
.slogan { margin-top: 14px; font-size: 15px; font-style: italic; color: var(--on-ink-muted); }
.link-btn { display: block; width: 100%; margin-top: 16px; background: none; border: none; color: var(--on-ink-muted); font-size: var(--fs-body); text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--on-ink); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--on-ink-line); border-top-color: var(--on-ink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- forms ---------- */
label { display: block; font-size: var(--fs-label); font-weight: 500; color: var(--text-muted); margin-bottom: 14px; }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 11px 13px; min-height: var(--tap);
  background: var(--card); border: 1px solid var(--stone); border-radius: var(--r-input-m);
  color: var(--text); font-size: 16px;
}
input[type="checkbox"] { min-height: 0; width: auto; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--olive); box-shadow: 0 0 0 3px var(--range-band); }
textarea { min-height: 80px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }
.form-actions .btn { flex: 1; }

/* ---------- Button ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: var(--r-pill); border: 1px solid transparent;
  font-size: var(--fs-label); font-weight: 500; line-height: 1; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s ease, transform .08s ease;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--ink); color: var(--on-ink); }
.btn-primary:hover { background: var(--ink-hover); }
.btn-olive { background: var(--olive-deep); color: var(--on-ink); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--stone); }
.btn-secondary:hover { background: var(--card); }
.btn-danger { background: transparent; color: var(--bad); border-color: var(--stone); }
.btn-sm { height: 34px; padding: 0 14px; font-size: var(--fs-small); }
.btn-cream { background: var(--on-ink); color: var(--ink); width: 100%; height: 48px; }
.btn-outline-cream { background: transparent; color: var(--on-ink); border-color: var(--on-ink-line); width: 100%; height: 48px; }
.icon-btn { width: 36px; height: 36px; border-radius: var(--r-nav); border: none; background: transparent; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--stone); color: var(--text); }
.link-action { border: 0; background: none; padding: 0; color: var(--olive); font-size: var(--fs-body); font-weight: 500; cursor: pointer; text-align: left; white-space: nowrap; }
.link-action:hover { color: var(--olive-deep); text-decoration: underline; }

/* ---------- Chip ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 34px; min-width: 44px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--stone);
  background: var(--card); color: var(--text); font-size: var(--fs-label); font-weight: 500; line-height: 1;
  cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--text-faint); }
.chip.active { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.chip.code { font-weight: 600; letter-spacing: .04em; }

/* ---------- code chip, pills ---------- */
.code-chip { width: 40px; height: 26px; flex: none; border-radius: var(--r-code); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; letter-spacing: .08em; background: var(--stone); color: var(--olive-deep); }
.code-chip.warn { background: var(--warn-tint); color: var(--warn); }
.pct-pill { display: inline-block; font-size: var(--fs-tiny); font-weight: 600; padding: 1px 7px; border-radius: var(--r-pill); background: var(--neutral-tint); color: var(--text-muted); white-space: nowrap; }
.pct-pill.t-ok { background: var(--ok-tint); color: var(--ok); }
.pct-pill.t-warn { background: var(--warn-tint); color: var(--warn); }
.pct-pill.t-bad { background: var(--bad-tint); color: var(--bad); }
.pill { display: inline-block; padding: 3px 9px; border-radius: var(--r-pill); font-size: var(--fs-tiny); font-weight: 600; letter-spacing: .02em; background: var(--neutral-tint); color: var(--text-muted); white-space: nowrap; }
.pill.open, .pill.needs { background: var(--warn-tint); color: var(--warn); }
.pill.overdue { background: var(--bad-tint); color: var(--bad); }
.pill.paid { background: var(--ok-tint); color: var(--ok); }
.pill.cat, .pill.mail, .pill.statement, .pill.credit_note, .pill.wait, .pill.disputed { background: var(--neutral-tint); color: var(--text-muted); }
.pill.mail { padding: 2px 6px; }

/* ---------- StatusBar ---------- */
.sbar { position: relative; width: 100%; height: 6px; background: var(--stone); border-radius: 3px; }
.sbar > span { display: block; height: 100%; border-radius: 3px; background: var(--text-faint); }
.sbar > span.t-ok { background: var(--ok-bar); }
.sbar > span.t-warn { background: var(--warn-bar); }
.sbar > span.t-bad { background: var(--bad-bar); }
.sbar.share > span { background: var(--olive); }
.sbar > i { position: absolute; top: -3px; width: 2px; height: 12px; margin-left: -1px; background: var(--ink); opacity: .55; border-radius: 1px; }

/* ---------- page layout ---------- */
.page { display: flex; flex-direction: column; gap: 28px; max-width: 1360px; animation: fadein .18s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } }
.section { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.section-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; min-height: 34px; }
.section-label { font-size: var(--fs-section); letter-spacing: var(--ls-section); text-transform: uppercase; color: var(--text-muted); font-weight: 500; }
.section-legend { margin-left: auto; font-size: var(--fs-small); color: var(--text-faint); }
.section-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.section-legend + .section-actions { margin-left: 0; }
.page-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-sub { font-size: var(--fs-label); color: var(--text-muted); }
.page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.note { font-size: var(--fs-small); color: var(--text-faint); }
.card { background: var(--card); border: 1px solid var(--stone); border-radius: var(--r-card-lg); }
.card-pad { padding: 20px 24px; }
.empty-state { padding: 36px 18px; text-align: center; color: var(--text-muted); background: var(--card); border: 1px solid var(--stone); border-radius: var(--r-card-lg); }
.empty-state strong { display: block; color: var(--text); margin-bottom: 4px; font-weight: 500; }
.empty { padding: 36px 18px; text-align: center; color: var(--text-muted); }
.empty strong { display: block; color: var(--text); margin-bottom: 4px; }

/* ---------- KpiCard ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi-card { background: var(--card); border: 1px solid var(--stone); border-radius: var(--r-card); padding: 22px 24px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.kpi-l { font-size: var(--fs-body); color: var(--text-muted); }
.kpi-v { font-size: var(--fs-kpi); font-weight: 400; letter-spacing: -.03em; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.kpi-n { font-size: var(--fs-label); color: var(--text-muted); }
.kpi-card.t-ok .kpi-v { color: var(--ok); }
.kpi-card.t-warn .kpi-v { color: var(--warn); }
.kpi-card.t-bad .kpi-v { color: var(--bad); }
@media (min-width: 900px) and (max-width: 1240px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- DataTable ---------- */
.dt { background: var(--card); border: 1px solid var(--stone); border-radius: var(--r-card-lg); overflow: hidden; }
.dt-h, .dt-r { display: grid; grid-template-columns: var(--dt-grid); gap: 28px; align-items: center; padding: 14px 28px; }
.dt-h { font-size: var(--fs-label); color: var(--text-muted); font-weight: 500; }
.dt-h .al-r { text-align: right; }
.dt-r { padding: 16px 28px; border-top: 1px solid var(--stone); }
.dt-r.clickable { cursor: pointer; }
.dt-r.clickable:hover { background: var(--paper); }
.dt-r.warn, .dt-r.warn:hover { background: var(--warn-wash); }
.dt-c { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.dt-c.al-r { align-items: flex-end; text-align: right; }
.dt-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dt-t { font-size: 16px; font-weight: 500; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.dt-t.strong { font-weight: 600; }
.dt-per { font-size: var(--fs-small); font-weight: 400; color: var(--text-faint); white-space: nowrap; letter-spacing: 0; }   /* "(£14.00/kg)" after a pack price */
.tx-ok { color: var(--ok) !important; } .tx-warn { color: var(--warn) !important; } .tx-bad { color: var(--bad) !important; }
.tx-faint { color: var(--text-faint) !important; } .tx-muted { color: var(--text-muted) !important; } .tx-olive { color: var(--olive) !important; }
.dt-s { font-size: var(--fs-small); color: var(--text-faint); }
.dt-s.tx-warn, .dt-s.tx-bad, .dt-s.tx-olive { font-weight: 500; }
.dt-empty { padding: 28px; color: var(--text-muted); text-align: center; }
.dt-cards { display: none; }

/* older <table> grids (Food cost supplier grid, Check reconciliation) */
.table-wrap { overflow-x: auto; }
table.sched { width: 100%; border-collapse: collapse; font-size: var(--fs-body); }
.sched th { text-align: left; font-size: var(--fs-label); font-weight: 500; color: var(--text-muted); padding: 14px 16px; white-space: nowrap; vertical-align: bottom; line-height: 1.3; }
.sched td { padding: 12px 16px; border-top: 1px solid var(--stone); white-space: nowrap; }
.sched td.r, .sched th.r { text-align: right; }
.sched tr:hover td { background: var(--paper); }
.sched tr.total td { font-weight: 600; background: var(--paper); }
.sched .code { font-size: var(--fs-tiny); font-weight: 600; letter-spacing: .08em; color: var(--olive); }
table.grid td:first-child { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.recon { font-size: var(--fs-small); margin-left: 8px; font-weight: 500; }
.recon.ok { color: var(--ok); } .recon.diff { color: var(--bad); }

/* ================= AppShell ================= */
.shell { min-height: 100dvh; }
.sidebar { display: none; }
.main-col { min-width: 0; }
.logo { display: inline-block; flex: none; background: currentColor; -webkit-mask: url(/wordmark.png) no-repeat left center / contain; mask: url(/wordmark.png) no-repeat left center / contain; }
.brand-sub { font-size: 10px; letter-spacing: .28em; text-transform: uppercase; font-weight: 500; }
.brand-slogan { font-style: italic; }

/* header: title, date pill, sync pill (desktop one row; phone stacked) */
.appbar { display: grid; align-items: center; background: var(--paper); }
.side-brand, .appbar-brand { cursor: pointer; }   /* the logo goes to Home */
.appbar-brand { grid-area: brand; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.appbar-brand .brand-row { display: flex; align-items: baseline; gap: 8px; }
.appbar-brand .logo { width: 70px; height: 16px; color: var(--ink); }
.appbar-brand .brand-sub { font-size: 9px; color: var(--olive); }
.appbar-brand .brand-slogan { font-size: var(--fs-small); color: var(--text-muted); }
.appbar-title { grid-area: title; font-size: var(--fs-title); font-weight: 500; letter-spacing: -.015em; line-height: 1.1; color: var(--text); white-space: nowrap; }

.date-pill { grid-area: date; display: flex; align-items: center; background: var(--card); border: 1px solid var(--stone); border-radius: var(--r-pill); padding: 4px; justify-self: start; }
.dp-step { width: 32px; height: 32px; border: 0; background: transparent; border-radius: 16px; cursor: pointer; font-size: 16px; color: var(--text-muted); flex: none; }
.dp-step:hover { background: var(--stone); }
.dp-open { min-width: 150px; height: 32px; padding: 0 12px; border: 0; border-radius: 16px; background: transparent; font-size: var(--fs-body); font-weight: 500; color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.dp-open.open, .dp-open:hover { background: var(--stone); }
.dp-open svg { width: 14px; height: 14px; flex: none; }

.sync-pill { grid-area: sync; justify-self: end; display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 8px 0 16px; border-radius: var(--r-pill); border: 1px solid var(--stone); background: var(--card); cursor: pointer; color: var(--text); }
.sync-pill.open { background: var(--stone); }
.sync-dot { width: 8px; height: 8px; border-radius: 4px; background: var(--ok-bar); flex: none; }
.sync-pill.busy .sync-dot { background: var(--warn-bar); }
.sync-pill.error .sync-dot { background: var(--bad-bar); }
.sync-txt { font-size: var(--fs-label); font-weight: 500; white-space: nowrap; }
.sync-track { width: 72px; height: 5px; border-radius: 3px; background: var(--stone); overflow: hidden; flex: none; }
.sync-track > span { display: block; height: 100%; background: var(--olive); border-radius: 3px; }
.sync-bell { position: relative; width: 30px; height: 30px; border-radius: 15px; background: var(--ink); color: var(--on-ink); display: flex; align-items: center; justify-content: center; flex: none; }
.sync-bell svg { width: 14px; height: 14px; }
.sync-badge { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--gold); color: var(--ink); font-size: 10px; font-weight: 700; line-height: 17px; text-align: center; }

/* bottom tab bar (phone) */
.tabbar { position: fixed; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 14px); z-index: 18; height: 68px; padding: 0 8px; border-radius: 26px; background: var(--sidebar); display: flex; align-items: center; justify-content: space-around; }
.tabbar button { flex: 1; max-width: 78px; min-width: 56px; min-height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 0; border-radius: 18px; background: transparent; color: var(--on-ink); font-size: var(--fs-tiny); font-weight: 500; cursor: pointer; }
.tabbar .tdot { width: 5px; height: 5px; border-radius: 3px; background: transparent; }
.tabbar button.active { background: var(--olive); color: var(--on-ink); }
.tabbar button.active .tdot { background: var(--gold); }
.more-backdrop { position: fixed; inset: 0; z-index: 17; background: var(--backdrop-strong); }
.more-menu { position: fixed; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 96px); z-index: 19; background: var(--card); border-radius: var(--r-popover); padding: 8px; display: flex; flex-direction: column; box-shadow: var(--shadow-pop); }
.more-menu button { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; border: 0; border-radius: 14px; background: transparent; font-size: 15px; font-weight: 500; color: var(--text); cursor: pointer; text-align: left; }
.more-menu button.active { background: var(--paper); }
.more-menu button::after { content: "›"; margin-left: auto; color: var(--text-faint); font-size: 18px; }

/* popovers (desktop) — become bottom sheets on phones */
.pop-backdrop { position: fixed; inset: 0; z-index: 30; background: var(--backdrop); }
.pop { position: fixed; z-index: 31; top: 82px; background: var(--card); border: 1px solid var(--stone); border-radius: var(--r-popover); box-shadow: var(--shadow-pop); }
.pop-handle { display: none; }
.pop > * { flex-shrink: 0; }
.pop-sync { right: 44px; width: 560px; max-height: calc(100dvh - 110px); overflow-y: auto; padding: 26px 28px; display: flex; flex-direction: column; gap: 18px; }
.pop-date { left: calc(var(--sidebar-w) + 44px); width: 820px; max-width: calc(100vw - var(--sidebar-w) - 88px); overflow: hidden; display: flex; flex-direction: column; }

/* SyncStatus popover */
.sync-head { display: flex; align-items: baseline; gap: 12px; }
.sync-title { font-size: 17px; font-weight: 500; }
.sync-updated { margin-left: auto; font-size: var(--fs-small); color: var(--text-faint); }
.sync-progress { height: 8px; border-radius: 4px; background: var(--stone); overflow: hidden; }
.sync-progress > span { display: block; height: 100%; background: var(--olive); border-radius: 4px; }
.sync-counts { display: flex; gap: 20px; flex-wrap: wrap; font-size: var(--fs-body); align-items: baseline; }
.sync-counts b { font-weight: 600; }
.sync-counts .w { color: var(--warn); } .sync-counts .f { color: var(--bad); }
.sync-counts .link-action.f { font-size: inherit; font-weight: inherit; min-height: 0; } .sync-counts .link-action.f:hover { color: var(--bad); }
.sync-counts .next { margin-left: auto; color: var(--text-faint); font-size: var(--fs-label); }
.sync-sources { display: flex; flex-direction: column; border-top: 1px solid var(--stone); }
.sync-src { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--stone); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; color: inherit; }
button.sync-src { cursor: pointer; }
button.sync-src:hover { background: var(--paper); }
.sync-src .d { width: 8px; height: 8px; border-radius: 4px; margin-top: 6px; background: var(--text-disabled); }
.sync-src .d.ok { background: var(--ok-bar); } .sync-src .d.warn { background: var(--warn-bar); } .sync-src .d.bad { background: var(--bad-bar); }
.sync-src .n { font-size: var(--fs-body); font-weight: 500; display: block; }
.sync-src .t { font-size: var(--fs-small); color: var(--text-muted); display: block; overflow-wrap: anywhere; }
.sync-src .w { font-size: var(--fs-small); color: var(--text-faint); white-space: nowrap; }
.sync-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.sync-actions .btn-danger { color: var(--bad); }

/* DateRangePicker */
.drp { display: flex; }
.drp-presets { width: 190px; flex: none; border-right: 1px solid var(--stone); padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.drp-preset { text-align: left; height: 40px; padding: 0 14px; border: 0; border-radius: var(--r-nav); background: transparent; color: var(--text); font-size: var(--fs-body); cursor: pointer; white-space: nowrap; }
.drp-preset:hover { background: var(--paper); }
.drp-preset.active { background: var(--ink); color: var(--on-ink); }
.drp-cal { flex: 1; min-width: 0; padding: 18px 24px 20px; display: flex; flex-direction: column; gap: 12px; }
.drp-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.drp-step { width: 34px; height: 34px; border: 0; border-radius: 17px; background: transparent; font-size: 16px; color: var(--text-muted); cursor: pointer; flex: none; }
.drp-step:hover { background: var(--stone); }
.drp-hint { font-size: var(--fs-small); color: var(--text-faint); }
.drp-mtitle-m { display: none; }
.drp-months { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.drp-month { display: flex; flex-direction: column; gap: 10px; }
.drp-mtitle { font-size: 15px; font-weight: 500; text-align: center; }
.drp-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 4px; }
.drp-wd { text-align: center; font-size: var(--fs-tiny); color: var(--text-faint); font-weight: 500; padding-bottom: 6px; }
.drp-cell { display: flex; justify-content: center; }
.drp-cell.band { background: var(--range-band); }
.drp-cell.band-start { background: linear-gradient(90deg, transparent 50%, var(--range-band) 50%); }
.drp-cell.band-end { background: linear-gradient(90deg, var(--range-band) 50%, transparent 50%); }
.drp-day { width: 38px; height: 38px; border: 0; border-radius: var(--r-nav); background: transparent; color: var(--text); font-size: var(--fs-label); cursor: pointer; font-variant-numeric: tabular-nums; }
.drp-day:hover { background: var(--stone); }
.drp-day.future { color: var(--text-disabled); }
.drp-day.today { font-weight: 600; text-decoration: underline; }
.drp-day.end, .drp-day.end:hover { background: var(--ink); color: var(--on-ink); font-weight: 600; text-decoration: none; }
.drp-foot { display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-top: 1px solid var(--stone); flex-wrap: wrap; }
.drp-field { display: flex; flex-direction: column; gap: 2px; padding: 8px 14px; border: 1px solid var(--stone); border-radius: var(--r-input-m); background: var(--paper); min-width: 130px; }
.drp-field span { font-size: var(--fs-tiny); color: var(--text-faint); }
.drp-field b { font-size: var(--fs-body); font-weight: 500; }
.drp-arrow { color: var(--text-faint); }
.drp-days { font-size: var(--fs-label); color: var(--text-muted); }
.drp-foot .btn:first-of-type { margin-left: auto; }

/* BottomSheet (phone) / dialog (desktop) */
.sheet { position: fixed; inset: 0; z-index: 40; }
.sheet-backdrop { position: absolute; inset: 0; background: var(--backdrop-strong); animation: fade .15s ease; }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92dvh; overflow: auto; background: var(--card); border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding: 0 22px calc(env(safe-area-inset-bottom) + 24px); animation: up .2s ease; }
.sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--stone); margin: 12px auto 0; }
.sheet-head { position: sticky; top: 0; background: var(--card); display: flex; align-items: center; justify-content: space-between; padding: 12px 0 10px; z-index: 1; }
.sheet-head h3 { font-size: 17px; font-weight: 500; }
.sheet-body { padding-top: 4px; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@keyframes pop { from { transform: translate(-50%, -48%); opacity: 0; } }
.detail dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; font-size: var(--fs-body); margin: 10px 0 16px; }
.detail dt { color: var(--text-muted); }
.detail dd { font-weight: 500; overflow-wrap: anywhere; }
.attach { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px dashed var(--stone); border-radius: var(--r-input-m); background: var(--paper); font-size: var(--fs-body); }
.attach input { display: none; }
.attach .btn { margin: 0 0 0 auto; }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 100px); transform: translateX(-50%); z-index: 50; background: var(--ink); color: var(--on-ink); padding: 12px 18px; border-radius: var(--r-pill); font-size: var(--fs-body); box-shadow: var(--shadow-pop); animation: up .2s ease; max-width: calc(100vw - 32px); }
.fab { position: fixed; right: 18px; bottom: calc(env(safe-area-inset-bottom) + 96px); z-index: 16; width: 54px; height: 54px; border-radius: 50%; border: none; background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow-pop); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.fab svg { width: 24px; height: 24px; }

/* ---------- desktop (≥ 900px) ---------- */
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; background: var(--sidebar); color: var(--on-ink); padding: 30px 16px 20px; }
  .side-brand { padding: 0 12px; display: flex; flex-direction: column; gap: 6px; }
  .side-brand .brand-row { display: flex; align-items: baseline; gap: 10px; }
  .side-brand .logo { width: 92px; height: 21px; color: var(--on-ink); }
  .side-brand .brand-sub { color: var(--olive-light); }
  .side-brand .brand-slogan { font-size: var(--fs-body); color: var(--on-ink-muted); letter-spacing: .01em; }
  .side-nav { margin-top: 36px; display: flex; flex-direction: column; gap: 2px; }
  .side-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: none; margin-bottom: 12px; } .side-nav::-webkit-scrollbar { display: none; }
  .side-nav .ngroup, .side-nav .nsub { display: flex; flex-direction: column; gap: 2px; }
  .side-nav .ngroup.shut, .side-nav .nsub.shut { display: none; }
  .side-nav button { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 0; border-radius: var(--r-nav); background: transparent; color: var(--on-ink-muted); font-size: var(--fs-body); text-align: left; cursor: pointer; white-space: nowrap; }
  .side-nav button:hover, .side-nav button:focus-visible { background: var(--on-ink-active); color: var(--on-ink); }   /* the page under the pointer lights up like the page you are on (Baha, 12 Nov) */
  .side-nav button:hover .ndot { background: var(--on-ink-faint); }
  .side-nav button.active:hover .ndot { background: var(--olive-light); }
  .side-nav button.active { background: var(--on-ink-active); color: var(--on-ink); font-weight: 500; }
  .side-nav .ndot { width: 6px; height: 6px; border-radius: 3px; background: transparent; flex: none; }
  .side-nav button.active .ndot { background: var(--olive-light); }
  .side-nav .nsec:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
  .side-nav .nsec { margin: 18px 0 6px; padding: 16px 12px 0; border-top: 1px solid var(--on-ink-line); font-size: 10px; letter-spacing: .28em; text-transform: uppercase; font-weight: 500; color: var(--olive-light); white-space: nowrap; }   /* a block of its own: Alma Packaging */
  /* headings that fold their block, and the "More" line at the foot of a block (Baha, 12 Nov) */
  .side-nav button.nsec { width: 100%; border-radius: 0; background: transparent; justify-content: space-between; }
  .side-nav button.nsec:hover, .side-nav button.nsec:focus-visible { background: transparent; color: var(--on-ink); }
  .side-nav .nchev { margin-left: auto; font-size: 14px; letter-spacing: 0; line-height: 1; color: var(--on-ink-faint); transform: rotate(90deg); transition: transform .15s ease; }
  .side-nav .shut > .nchev { transform: rotate(0deg); }
  .side-nav button.nmore { color: var(--on-ink-faint); }
  .side-nav button.nmore .ndot, .side-nav button.nmore:hover .ndot { background: transparent; }
  .side-nav .nbadge { margin-left: auto; font-size: var(--fs-tiny); color: var(--gold); font-weight: 600; }
  .side-user { margin-top: auto; display: flex; align-items: center; gap: 12px; padding: 14px 12px 0; border-top: 1px solid var(--on-ink-line); }
  .avatar { width: 32px; height: 32px; border-radius: 16px; background: var(--olive); color: var(--on-ink); display: flex; align-items: center; justify-content: center; font-size: var(--fs-small); font-weight: 600; flex: none; text-transform: uppercase; }
  .side-user .who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .side-user .name { font-size: var(--fs-label); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-user .role { font-size: var(--fs-tiny); color: var(--on-ink-faint); text-transform: capitalize; }
  .side-user .icon-btn { margin-left: auto; color: var(--on-ink-faint); }
  .side-user .icon-btn:hover { background: var(--on-ink-hover); color: var(--on-ink); }

  .appbar { position: sticky; top: 0; z-index: 15; grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "title date . sync"; column-gap: 20px; padding: 28px 44px 20px; }
  .appbar-brand { display: none; }
  .appbar.no-range .date-pill { visibility: hidden; }
  #main { padding: 4px 44px 48px; }
  .tabbar, .more-menu, .more-backdrop, .fab { display: none !important; }
  .toast { bottom: 28px; }
  .sheet-panel { left: 50%; top: 50%; bottom: auto; right: auto; transform: translate(-50%, -50%); width: 560px; border-radius: var(--r-popover); max-height: 88vh; padding: 0 28px 28px; box-shadow: var(--shadow-pop); animation: pop .15s ease; }
  .sheet-handle { display: none; }
  .sheet-head { padding-top: 22px; }
}

/* ---------- phone (< 900px) ---------- */
@media (max-width: 899px) {
  .appbar { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand sync" "title title" "date date"; column-gap: 10px; padding: calc(env(safe-area-inset-top) + 16px) 20px 0; }
  .appbar-title { margin-top: 18px; font-size: var(--fs-title-m); letter-spacing: -.01em; }
  .date-pill { margin-top: 12px; justify-self: stretch; background: none; border: 0; padding: 0; gap: 6px; }
  .dp-step { width: var(--tap); height: var(--tap); border-radius: 22px; border: 1px solid var(--stone); background: var(--card); color: var(--text); font-size: 18px; }
  .dp-open { flex: 1; min-width: 0; height: var(--tap); border-radius: 22px; border: 1px solid var(--stone); background: var(--card); }
  .dp-open span { overflow: hidden; text-overflow: ellipsis; }
  .sync-pill { height: var(--tap); padding: 0 6px 0 14px; gap: 8px; }
  .sync-pill .sync-w, .sync-pill .sync-track { display: none; }
  .sync-bell { width: 32px; height: 32px; border-radius: 16px; background: var(--gold); color: var(--ink); }
  .sync-badge { background: var(--ink); color: var(--on-ink); }
  #main { padding: 16px 20px calc(env(safe-area-inset-bottom) + 112px); }
  .page { gap: 20px; }

  .pop-backdrop { background: var(--backdrop-strong); }
  .pop { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-width: none; max-height: 88dvh; overflow-y: auto; border: 0; border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding: 12px 20px calc(env(safe-area-inset-bottom) + 30px); gap: 16px; }
  .pop-handle { display: block; align-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--stone); flex: none; margin: 0 auto; }
  .pop-sync { padding-left: 22px; padding-right: 22px; }
  .sync-counts { gap: 14px; font-size: var(--fs-label); }
  .sync-counts .next { margin-left: 0; width: 100%; }
  .sync-src { gap: 12px; padding: 12px 0; }
  .sync-actions .btn { flex: 1; height: 48px; font-size: var(--fs-body); }

  .pop-date { display: flex; flex-direction: column; overflow-y: auto; }
  .drp { flex-direction: column; gap: 16px; }
  .drp-presets { width: auto; border: 0; padding: 0; flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .drp-preset { height: 40px; border-radius: var(--r-pill); background: var(--paper); font-size: var(--fs-label); font-weight: 500; }
  .drp-cal { padding: 0; }
  .drp-step { width: var(--tap); height: var(--tap); border-radius: 22px; background: var(--paper); color: var(--text); font-size: 18px; }
  .drp-hint { display: none; }
  .drp-mtitle-m { display: block; font-size: 15px; font-weight: 500; }
  .drp-months { grid-template-columns: 1fr; }
  .drp-month + .drp-month { display: none; }
  .drp-mtitle { display: none; }
  .drp-day { width: var(--tap); height: var(--tap); border-radius: var(--r-input-m); font-size: var(--fs-body); }
  .drp-foot { padding: 0; border: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .drp-arrow { display: none; }
  .drp-days { display: none; }
  .drp-foot .btn { grid-column: 1 / -1; height: 50px; font-size: 15px; margin-left: 0 !important; }
  .drp-foot .btn-secondary { display: none; }
  .drp-foot .btn-primary { background: var(--olive-deep); }
  .drp-sheet-title { display: flex; align-items: baseline; }

  .btn { height: var(--tap); }
  .desktop-only { display: none !important; }
  .btn-sm { height: var(--tap); padding: 0 16px; font-size: var(--fs-label); }
  .chip { height: var(--tap); padding: 0 16px; }
  .icon-btn { width: var(--tap); height: var(--tap); }
  .link-action { min-height: var(--tap); display: inline-flex; align-items: center; }

  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-card { padding: 14px; gap: 6px; }
  .kpi-l { font-size: var(--fs-small); }
  .kpi-v { font-size: var(--fs-kpi-m); letter-spacing: -.02em; }
  .kpi-n { font-size: var(--fs-tiny); line-height: 1.35; }
  .kpi-card.t-ok { background: var(--ok-tint); border-color: var(--ok-border); }
  .kpi-card.t-ok .kpi-v { color: var(--ok-deep); } .kpi-card.t-ok .kpi-l, .kpi-card.t-ok .kpi-n { color: var(--ok-label); }
  .kpi-card.t-warn { background: var(--warn-tint); border-color: var(--warn-border); }
  .kpi-card.t-warn .kpi-v { color: var(--warn-deep); } .kpi-card.t-warn .kpi-l, .kpi-card.t-warn .kpi-n { color: var(--warn-label); }
  .kpi-card.t-bad { background: var(--bad-tint); border-color: var(--bad-border); }
  .kpi-card.t-bad .kpi-v { color: var(--bad-deep); } .kpi-card.t-bad .kpi-l, .kpi-card.t-bad .kpi-n { color: var(--bad-label); }
  .kpi-card.is-lead { background: var(--ink); border-color: var(--ink); }
  .kpi-card.is-lead .kpi-v { color: var(--on-ink); } .kpi-card.is-lead .kpi-l, .kpi-card.is-lead .kpi-n { color: var(--on-ink-soft); }

  .section-label { font-size: var(--fs-tiny); }
  .section-legend { margin-left: 0; width: 100%; }

  .dt { display: none; }
  .dt-cards { display: flex; flex-direction: column; gap: 10px; }
  .dt-card { background: var(--card); border: 1px solid var(--stone); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
  .dt-card.clickable { cursor: pointer; }
  .dt-card.warn { background: var(--warn-wash); }
  .dt-card-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .dt-card .code-chip { width: 38px; height: 24px; background: var(--olive-deep); color: var(--on-ink); }
  .dt-card .code-chip.warn { background: var(--warn-tint); color: var(--warn); }
  .dt-card-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .dt-ct { font-size: 15px; font-weight: 500; }
  .dt-item { display: flex; flex-direction: column; gap: 5px; }
  .dt-irow { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: var(--fs-label); min-height: 24px; }
  .dt-il { color: var(--text-muted); }
  .dt-il:empty { display: none; }
  .dt-irow:has(.dt-il:empty) { justify-content: flex-end; }
  .dt-iv { font-weight: 600; text-align: right; }
  .dt-iv.pill { padding: 2px 9px; border-radius: var(--r-pill); font-size: var(--fs-label); letter-spacing: 0; background: transparent; color: var(--text); }
  .dt-iv.pill.t-ok { background: var(--ok-tint); color: var(--ok); }
  .dt-iv.pill.t-warn { background: var(--warn-tint); color: var(--warn); }
  .dt-iv.pill.t-bad { background: var(--bad-tint); color: var(--bad); }
  .dt-iv.pill.t-faint { color: var(--text-faint); font-weight: 500; }
  .dt-iv.pill.t-muted { color: var(--text-muted); font-weight: 500; }
  .dt-iv.pill.t-olive { color: var(--olive); }
  .dt-item .sbar { height: 4px; }
  .dt-item .sbar > i { display: none; }

  .table-wrap.card { background: transparent; border: 0; overflow: visible; }
  table.cardify, .cardify tbody { display: block; }
  .cardify thead { display: none; }
  .cardify tbody { display: flex; flex-direction: column; gap: 10px; }
  .cardify tr { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--stone); border-radius: 16px; padding: 10px 16px; }
  .cardify tr.total { background: var(--paper); }
  .cardify td { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border: 0; white-space: normal; text-align: right !important; max-width: none !important; font-size: var(--fs-label); }
  .cardify td::before { content: attr(data-label); color: var(--text-muted); text-align: left; font-weight: 400; }
  .cardify td:first-child { font-size: 15px; font-weight: 500; text-align: left !important; padding-bottom: 6px; }
  .cardify td:first-child::before, .cardify td[data-label=""]::before { content: none; }
  .cardify td:empty { display: none; }
  .cardify tr:hover td { background: transparent; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ================= pages ================= */

/* ---------- Costs ---------- */
.cbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cbar input[type="search"] { flex: 1; min-width: 200px; margin: 0; height: 40px; min-height: 40px; padding: 0 16px; border-radius: var(--r-pill); font-size: var(--fs-body); }
.seg { display: inline-flex; background: var(--stone); border-radius: var(--r-pill); padding: 3px; gap: 3px; flex: none; }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; } .seg::-webkit-scrollbar { display: none; } .seg button { flex: none; }   /* five views on Procurement: the control scrolls sideways on a phone */
.seg button { border: 0; background: transparent; height: 34px; padding: 0 14px; border-radius: var(--r-pill); font-size: var(--fs-label); font-weight: 500; color: var(--text); cursor: pointer; white-space: nowrap; }
.seg button.active { background: var(--card); }
.line-select { display: none; }
.bbar { display: grid; grid-template-columns: repeat(var(--n, 8), minmax(0, 1fr)); gap: 1px; background: var(--stone); border: 1px solid var(--stone); border-radius: var(--r-card-lg); overflow: hidden; }
.bseg { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 14px 14px 12px; background: var(--card); border: 0; cursor: pointer; text-align: left; color: var(--text); }
.bseg:hover { background: var(--paper); }
.bseg .top { display: flex; align-items: baseline; gap: 6px; width: 100%; min-width: 0; }
.bseg .code { font-size: var(--fs-tiny); font-weight: 600; letter-spacing: .08em; color: var(--olive); flex: none; }
.bseg .name { font-size: var(--fs-small); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bseg .amt { font-size: 18px; font-weight: 500; letter-spacing: -.02em; margin-top: 4px; white-space: nowrap; }
.bseg .cnt { font-size: var(--fs-tiny); color: var(--text-faint); white-space: nowrap; }
.bseg .share { display: block; width: 100%; height: 4px; border-radius: 2px; background: var(--stone); margin-top: 8px; overflow: hidden; }
.bseg .share > span { display: block; height: 100%; background: var(--olive); }
.bseg.unassigned .code { color: var(--warn); }
.bseg.active { background: var(--ink); }
.bseg.active .code, .bseg.active .name, .bseg.active .cnt { color: var(--on-ink-muted); }
.bseg.active .amt { color: var(--on-ink); }
.bseg.active .share { background: var(--on-ink-line); }
.bseg.active .share > span { background: var(--on-ink); }
.cwrap { display: grid; grid-template-columns: 1fr; gap: 16px; }
.sup-list { padding: 8px 0; overflow: hidden; }
.sup-row { display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 10px 16px; border: 0; border-left: 3px solid transparent; background: none; color: inherit; text-align: left; cursor: pointer; font-size: var(--fs-body); }
.sup-row .n { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sup-row .p { margin-left: auto; color: var(--text-faint); font-size: var(--fs-small); white-space: nowrap; min-width: 44px; text-align: right; }
.sup-row .t { color: var(--text-muted); white-space: nowrap; min-width: 62px; text-align: right; }
.sup-row:hover { background: var(--paper); }
.sup-row.active { background: var(--paper); border-left-color: var(--ink); font-weight: 600; }
.sup-row.active .t, .sup-row.active .p { color: var(--text); }
.sup-inline { padding: 4px 10px 12px; }
.list { display: flex; flex-direction: column; gap: 12px; }
.igroup { overflow: hidden; }
.ghead { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; background: var(--paper); border-bottom: 1px solid var(--stone); font-size: var(--fs-label); }
.gname { font-weight: 600; min-width: 0; flex: 1; }
.gtot { font-weight: 600; white-space: nowrap; }
.irow { display: grid; grid-template-columns: 44px minmax(0, 1fr) 96px 200px 110px; grid-template-areas: "b m d p a"; align-items: center; gap: 12px; padding: 11px 20px; border-top: 1px solid var(--stone); cursor: pointer; font-size: var(--fs-body); position: relative; }
.ghead + .irow, .igroup > .irow:first-child { border-top: none; }
.irow:hover { background: var(--paper); }
.irow.needs::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--warn-bar); }
.ib { grid-area: b; height: 24px; border-radius: var(--r-code); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; letter-spacing: .08em; background: var(--stone); color: var(--olive-deep); }
.ib.none { background: var(--warn-tint); color: var(--warn); }
.im { grid-area: m; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.it { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.is { color: var(--text-faint); font-size: var(--fs-label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1 1 0; }
.id { grid-area: d; color: var(--text-muted); font-size: var(--fs-label); white-space: nowrap; }
.ip { grid-area: p; display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.ia { grid-area: a; text-align: right; font-weight: 600; white-space: nowrap; }
.inv { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; padding: 13px 16px; background: var(--card); border: 1px solid var(--stone); border-radius: 14px; }
.inv .t { font-weight: 500; } .inv .s { font-size: var(--fs-label); color: var(--text-muted); } .inv .amt { font-size: 16px; font-weight: 600; text-align: right; } .inv .right { text-align: right; }
@media (min-width: 900px) {
  .cwrap { grid-template-columns: 280px minmax(0, 1fr); align-items: start; }
  .sup-list { position: sticky; top: 104px; max-height: calc(100vh - 124px); overflow-y: auto; }
  .sup-inline { display: none; }
}
@media (max-width: 899px) {
  .cbar input[type="search"] { flex: 1 1 100%; height: var(--tap); min-height: var(--tap); order: -1; }
  .seg button { height: var(--tap); }
  .costs .chips.lines { display: none; }
  .line-select { display: block; margin: 0; height: var(--tap); border-radius: var(--r-pill); padding: 0 16px; }
  .bbar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bseg { padding: 10px; min-height: 64px; }
  .bseg .name { display: none; }
  .bseg .amt { font-size: 15px; }
  .bseg .cnt { font-size: 10px; }
  .cwrap #inv-list:not(.show-all) { display: none; }
  .sup-row { min-height: var(--tap); align-items: center; }
  .irow { grid-template-columns: 40px 86px minmax(0, 1fr) auto; grid-template-areas: "b m m a" "b d p p"; gap: 2px 10px; padding: 12px 14px; min-height: 56px; }
  .im { flex-direction: column; align-items: stretch; gap: 0; }
  .it { display: block; }
  .is { flex: none; width: 100%; }
  .ib { align-self: start; margin-top: 2px; }
  .id { font-size: var(--fs-small); }
  .ip { flex-wrap: nowrap; }
  .ip .pill { font-size: 10.5px; padding: 2px 7px; }
  .ghead { padding: 10px 14px; align-items: flex-start; }
  .gname .recon { display: block; margin: 2px 0 0; }
}

/* ---------- P&L statement ---------- */
.pl { overflow: clip; }   /* clip (not hidden) so the sticky header row can stick */
.pl-row { display: grid; grid-template-columns: minmax(170px, 1.5fr) repeat(var(--pl-n, 8), minmax(0, 1fr)); gap: 14px; align-items: center; padding: 8px 24px; }
.pl-head { padding: 14px 24px; align-items: end; }
.pl-head .lbl { font-size: var(--fs-small); color: var(--text-faint); }
.pl-hc { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 0; }
.pl-code { font-size: var(--fs-tiny); font-weight: 600; letter-spacing: .08em; color: var(--olive); }
.pl-code.warn { color: var(--warn); } .pl-code.all { color: var(--text); }
.pl-name { font-size: var(--fs-small); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pl-label { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: var(--fs-body); color: var(--text-muted); white-space: nowrap; }
.pl-label .lt { overflow: hidden; text-overflow: ellipsis; }
.pl-cell { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 0; }
.pl-v { font-size: var(--fs-body); white-space: nowrap; color: var(--text); }
.pl-v.zero { color: var(--text-disabled); }
.pl-v.pos { color: var(--ok); } .pl-v.neg { color: var(--bad); }
.tag-enter { font-size: 10px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--ok-deep); background: var(--ok-tint); padding: 2px 7px; border-radius: var(--r-pill); flex: none; }
.pl-input { width: 100%; max-width: 110px; height: 36px; min-height: 36px; margin: 0; padding: 0 10px; border: 1px solid var(--input-border); border-radius: var(--r-input); background: var(--card); font-size: var(--fs-body); font-weight: 600; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.pl-input:focus { border-color: var(--olive); box-shadow: 0 0 0 3px var(--range-band); }
.pl-input:disabled { background: transparent; border-color: transparent; color: var(--text); opacity: 1; }
.k-input { background: var(--input-row); padding: 12px 24px; border-top: 1px solid var(--stone); }
.k-input .pl-label { font-size: 15px; font-weight: 500; color: var(--text); }
.k-input .pl-v { font-size: 15px; font-weight: 600; }
.k-section { padding: 20px 24px 6px; border-top: 1px solid var(--stone); }
.k-section .pl-label { grid-column: 1 / -1; font-size: var(--fs-tiny); font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .18em; }
.k-sub { background: var(--paper); padding: 12px 24px; border-top: 1px solid var(--stone); }
.k-sub .pl-label { font-weight: 600; color: var(--text); }
.k-sub .pl-v { font-size: 15px; font-weight: 600; }
.k-net { background: var(--net-row); padding: 16px 24px; border-top: 2px solid var(--ink); }
.k-net .pl-label { font-size: 15px; font-weight: 600; color: var(--text); }
.k-net .pl-v { font-size: 16px; font-weight: 600; }
.pl-m { display: none; }
@media (min-width: 900px) and (max-width: 1240px) {
  .pl-row { grid-template-columns: minmax(104px, 1fr) repeat(var(--pl-n, 8), minmax(0, 1fr)); gap: 6px; padding-left: 12px; padding-right: 12px; }
  .pl-v { font-size: var(--fs-small); }
  .k-input .pl-v, .k-sub .pl-v, .k-net .pl-v { font-size: var(--fs-label); }
  .pl-input { font-size: var(--fs-small); padding: 0 4px; height: 32px; min-height: 32px; }
  .pl-name { font-size: var(--fs-tiny); }
  .pl-label { font-size: var(--fs-label); }
  .tag-enter { display: none; }
  .appbar { padding-left: 28px; padding-right: 28px; }
  #main { padding-left: 28px; padding-right: 28px; }
  .pop-sync { right: 28px; }
  .pop-date { left: calc(var(--sidebar-w) + 28px); max-width: calc(100vw - var(--sidebar-w) - 56px); }
  .drp-presets { width: 160px; }
  .drp-day { width: 32px; height: 32px; }
  .drp-months { gap: 16px; }
}
@media (max-width: 899px) {
  .pl { display: none; }
  .pl-m { display: block; overflow: hidden; }
  .plm-head { padding: 14px 16px 10px; display: flex; align-items: baseline; gap: 8px; }
  .plm-head b { font-size: 16px; font-weight: 500; }
  .plm-head span { margin-left: auto; font-size: var(--fs-tiny); color: var(--text-faint); }
  .plm-row { display: flex; align-items: center; gap: 10px; padding: 9px 16px; }
  .plm-row .pl-label { flex: 1; white-space: normal; }
  .plm-row.k-input { padding: 10px 16px; }
  .plm-row.k-section { padding: 16px 16px 4px; }
  .plm-row.k-sub { padding: 12px 16px; }
  .plm-row.k-net { padding: 16px; }
  .plm-row .pl-input { width: 118px; max-width: none; height: var(--tap); min-height: var(--tap); padding: 0 12px; border-radius: var(--r-input-m); font-size: 15px; }
  .plm-row .pl-v { font-size: var(--fs-body); }
}

/* ---------- Monthly: typed figures ---------- */
.box-input { width: 100%; max-width: 170px; height: 40px; min-height: 40px; margin: 0; padding: 0 12px; border: 1px solid var(--stone); border-radius: var(--r-input); background: var(--paper); font-size: var(--fs-body); font-weight: 500; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.box-input:focus { border-color: var(--olive); background: var(--card); }
.box-input:disabled { opacity: 1; background: transparent; border-color: transparent; }
@media (max-width: 899px) { .box-input { max-width: 150px; height: var(--tap); border-radius: var(--r-input-m); } }
.plm-val { display: flex; align-items: center; gap: 10px; flex: none; }
@media (min-width: 900px) { .plm-val { display: none; } }

/* ---------- Check ---------- */
@media (min-width: 900px) { .kpi-grid.kpi-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sched tr.clickable { cursor: pointer; }
.sched td.why { white-space: normal; max-width: 360px; }
.sched tr.sub-head td { padding-top: 18px; font-size: var(--fs-tiny); letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); }
.ck-docs { margin-top: 12px; gap: 8px; }
.assign-row { grid-template-columns: 1fr auto; align-items: start; }
.assign-row .s { line-height: 1.45; }
.assign-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.assign-select { grid-column: 1 / -1; margin-top: 2px; }
.assign-select select { margin-top: 0; }
.assign-row.done { opacity: .6; }
.assign-preview { grid-column: 1 / -1; margin-top: 4px; border: 1px solid var(--stone); border-radius: var(--r-input-m); overflow: hidden; background: var(--paper); }
.assign-preview iframe { display: block; width: 100%; height: 70vh; border: 0; }
.assign-preview img { display: block; width: 100%; height: auto; }
@media (min-width: 900px) { .sheet-panel.wide { width: min(980px, 94vw); } }   /* the Assign branches sheet, so the PDF is readable */
.ck-docs .inv[data-doc] { cursor: pointer; }
.ck-docs .inv[data-doc]:hover, .ck-docs .inv[data-doc]:focus-visible { border-color: var(--olive); outline: none; }
.ck-verdict { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.ck-verdict .section-legend { margin-left: 0; width: 100%; }
@media (max-width: 899px) { .ck-verdict .btn { width: 100%; } }

/* ---------- sheets: invoice detail and forms ---------- */
.sheet-stack { gap: 20px; }
.sched td.strong { font-weight: 600; }
.detail-amount { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.form-actions.spaced { margin-top: 16px; }
.form-note { margin-bottom: 10px; }
.gross-line { margin: 10px 0 14px; font-size: var(--fs-label); }
input[type="checkbox"] { margin: 0; min-height: 0; flex: none; }

/* Costs — quick assign in the document sheet */
.quick-assign { margin: 4px 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
.quick-assign .form-note { margin-bottom: 6px; }

/* quick-assign: the multi-month spread is tucked away until needed */
.spread-more summary { cursor: pointer; color: var(--text-muted); font-size: var(--fs-label); padding: 6px 0; }
.spread-more[open] summary { margin-bottom: 8px; }

/* shared (head-office) costs */
.ib.hq { background: var(--olive-deep); color: var(--on-ink); }
.pill.shared { background: var(--stone); color: var(--olive-deep); }

/* P&L: branch header stays put while scrolling; cost figures open the invoices behind them */
@media (min-width: 900px) { .pl-head { position: sticky; top: 104px; z-index: 2; background: var(--card); border-bottom: 1px solid var(--stone); } }
/* column headings stay put under the app bar while a long table scrolls (Baha, 6 Nov). The wrappers must not be scroll
   containers for that, so on desktop they clip instead of scrolling sideways (the tables fit the page there). */
@media (min-width: 900px) {
  .table-wrap, .dt { overflow: clip; }
  .sched thead th { position: sticky; top: 104px; z-index: 3; background: var(--card); box-shadow: 0 1px 0 var(--stone); }
  .dt-h { position: sticky; top: 104px; z-index: 3; background: var(--card); box-shadow: 0 1px 0 var(--stone); }
}
/* a figure that opens the invoices behind it (P&L, Food cost) */
.pl-go, .fig-link { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; font: inherit; color: inherit; text-align: inherit; text-decoration: underline dotted var(--text-faint); text-underline-offset: 3px; }
.pl-go:hover, .fig-link:hover { color: var(--olive); text-decoration-color: var(--olive); }
.fig-link.plain { text-decoration: none; }
.fig-link.plain:hover { text-decoration: underline; }
.kpi-card.clickable { cursor: pointer; }
.kpi-card.clickable:hover { border-color: var(--text-faint); }
.form-actions.presets { justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
.more-actions { justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
.pl-code.ho { color: var(--olive-deep); }

/* Check: sortable headers */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--text); }
th.sortable.sort-asc::after { content: " \2191"; color: var(--olive); }
th.sortable.sort-desc::after { content: " \2193"; color: var(--olive); }
/* P&L: typed boxes line up whether or not a % pill sits under them */
.k-input { align-items: start; }
.k-input .pl-label { padding-top: 8px; }
.k-input .pl-cell:last-child { padding-top: 8px; }
.sup-order { display: flex; gap: 6px; padding: 6px 12px 8px; border-bottom: 1px solid var(--stone); }
.sup-order .chip { height: 30px; padding: 0 12px; font-size: var(--fs-small); }

/* Check: the Why column wraps inside the card instead of running off the right edge */
.sched.check td.why { max-width: none; min-width: 220px; }
.why-src { margin-top: 4px; font-size: var(--fs-tiny); color: var(--text-faint); }
.dt-why { font-size: var(--fs-small); color: var(--text-muted); line-height: 1.35; white-space: normal; display: block; }
.dt-item .dt-why { margin-top: 4px; }
.sched.check td, .sched.check th { padding-left: 14px; padding-right: 14px; }
@media (min-width: 900px) and (max-width: 1240px) {
  .sched.check th, .sched.check td:first-child { white-space: normal; }
  .sched.check td.why { min-width: 150px; }
  .sched.check td, .sched.check th { padding-left: 10px; padding-right: 10px; }
}
/* P&L phone: tappable figures get a 44px target without making the rows taller */
@media (max-width: 899px) { .plm-row .pl-go { min-height: var(--tap); display: inline-flex; align-items: center; margin: -12px 0; } }

/* Food cost grid on phones: each figure link gets a 44px target without making the cards taller */
@media (max-width: 899px) { .cardify .fig-link { min-height: var(--tap); display: inline-flex; align-items: center; margin: -12px 0; } }
/* Check: the row detail opens under the clicked row on desktop */
tr.clickable.open td { background: var(--paper); }
tr.ck-expand > td { padding: 0 0 12px; background: var(--paper); border-top: 0; }
tr.ck-expand .card { margin: 0 16px; box-shadow: none; border: 1px solid var(--stone); }

/* ---------- Home: trend by branch (LineChart in components.js) ---------- */
.trend-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1240px) { .trend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .trend-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; } }
.trend-card { background: var(--card); border: 1px solid var(--stone); border-radius: var(--r-card); padding: 16px 18px 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.trend-head { display: flex; align-items: center; gap: 12px; min-height: 26px; }
.trend-title { display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; }
.trend-title:hover .trend-name { text-decoration: underline; }
.trend-name { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trend-stats { display: flex; align-items: center; gap: 16px; font-size: var(--fs-label); min-height: 22px; flex-wrap: wrap; }
.trend-stat { display: inline-flex; align-items: center; gap: 6px; }
.trend-stat b { font-weight: 600; font-size: 15px; }
.trend-delta { font-size: var(--fs-tiny); color: var(--text-faint); }
.trend-missing { font-size: var(--fs-small); color: var(--text-faint); }
.trend-plot { min-width: 0; }
/* the chart itself: marks carry the series colour, text wears the text tokens */
.lc { position: relative; width: 100%; }
.lc-svg { display: block; width: 100%; height: auto; font-family: var(--font); }
.lc-hit { touch-action: pan-y; cursor: crosshair; }
.lc-grid { stroke: var(--stone); stroke-width: 1; }
.lc-y, .lc-x { font-size: 11px; fill: var(--text-faint); font-variant-numeric: tabular-nums; }
.lc-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lc-dot { stroke: var(--card); stroke-width: 2; }
.lc-target { stroke-width: 1; stroke-dasharray: 3 4; opacity: .55; }
.lc-cross { stroke: var(--text-faint); stroke-width: 1; pointer-events: none; }
.lc-line.food, .lc-target.food { stroke: var(--ink); }   .lc-dot.food { fill: var(--ink); }
.lc-line.pay, .lc-target.pay { stroke: var(--olive); }   .lc-dot.pay { fill: var(--olive); }
.lc-line.price { stroke: var(--ink); }   .lc-dot.price { fill: var(--ink); }
.lc-dot.up { fill: var(--bad-bar); }   .lc-dot.down { fill: var(--ok-bar); }   /* a price: dearer red, cheaper green */
.price-plot { background: var(--card); border: 1px solid var(--stone); border-radius: var(--r-card); padding: 16px 18px 10px; min-width: 0; }
.price-plot .note { margin: 0; }
@media (max-width: 899px) { .price-plot { padding: 14px 10px 8px; } }
.lc-key { display: inline-block; width: 14px; height: 0; border-top: 2px solid; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.lc-key.food { border-color: var(--ink); }
.lc-key.pay { border-color: var(--olive); }
.section-legend .lc-key.pay { margin-left: 12px; }
.lc-tip { position: absolute; top: 0; background: var(--card); border: 1px solid var(--stone); border-radius: var(--r-input); padding: 8px 10px; font-size: var(--fs-small); color: var(--text-muted); box-shadow: var(--shadow-pop); pointer-events: none; white-space: nowrap; z-index: 2; }
.lc-tip-h { font-weight: 500; color: var(--text); margin-bottom: 4px; }
.lc-tip-r { display: flex; align-items: center; gap: 6px; }
.lc-tip-r b { color: var(--text); font-weight: 600; }
@media (max-width: 899px) {
  .trend-card { padding: 14px 14px 8px; }
  .trend-stats { gap: 10px; }
}
/* phone sheets: dragging one down doesn't drag the page behind it */
@media (max-width: 899px) { .pop, .sheet-panel { overscroll-behavior: contain; } }

/* Procurement › Buying guide: the list Baha ticks before downloading the one-page report */
.guide-list { display: flex; flex-direction: column; gap: 10px; }
.guide-row { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: var(--card); border: 1px solid var(--stone); border-radius: var(--r-card); }
.guide-row.off { opacity: .55; }
.guide-tick { margin: 0; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; flex: none; cursor: pointer; }
.guide-tick input { width: 20px; height: 20px; }
.guide-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.guide-main textarea { width: 100%; min-height: 56px; }
.guide-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; width: 100%; justify-content: space-between; }
.guide-title { font-weight: 600; color: var(--text); }
.guide-save { font-size: var(--fs-small); font-weight: 600; }
.guide-meta { font-size: var(--fs-small); color: var(--text-muted); line-height: 1.5; }
.guide-total { color: var(--text); margin: 4px 0 0; }
/* Negotiation sheet: the "their offer" box under an item, with what it is worth a year beside it */
.neg-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; }
.neg-offer input { width: 130px; margin: 0; }
.neg-worth { font-size: var(--fs-small); font-weight: 600; color: var(--text-muted); }

/* ---------- Alma Packaging (pages/packaging.js) ---------- */
.more-menu { max-height: calc(100dvh - 140px); overflow-y: auto; }
.more-sec:first-child { margin-top: 0; padding-top: 10px; border-top: 0; }
.more-sec { margin: 6px 8px 2px; padding: 14px 8px 4px; border-top: 1px solid var(--stone); font-size: 10px; letter-spacing: .28em; text-transform: uppercase; font-weight: 500; color: var(--olive); }
@media (max-width: 899px) { .appbar.no-range .date-pill { display: none; } }
.pk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.pk-deliv { padding: 20px 24px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pk-dtop { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pk-dname { font-size: 16px; font-weight: 500; }
.pk-dbig { font-size: 26px; letter-spacing: -.02em; line-height: 1.1; }
.pk-dbig .note { letter-spacing: 0; }
.pk-lines { display: flex; flex-direction: column; }
.pk-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 8px 0; border: 0; border-top: 1px solid var(--stone); background: none; font-size: var(--fs-label); color: var(--text); text-align: left; cursor: pointer; }
.pk-line:hover { color: var(--olive-deep); }
.pk-line span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-dfoot { padding-top: 4px; }
.pk-comment { font-size: var(--fs-label); color: var(--text-muted); }
.pk .cbar .chips { flex: none; }
.pk-art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.pk-art { overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.pk-thumb { aspect-ratio: 4 / 3; width: 100%; border: 0; border-bottom: 1px solid var(--stone); background: var(--paper); display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; padding: 0; }
.pk-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pk-ext { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; height: 44px; padding: 0 12px; border-radius: var(--r-input); background: var(--stone); color: var(--olive-deep); font-size: var(--fs-label); font-weight: 600; letter-spacing: .08em; }
.pk-ext.sm { min-width: 44px; height: 30px; padding: 0 8px; font-size: 10px; flex: none; }
.pk-art-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pk-art-name { font-size: 15px; font-weight: 500; }
.pk-art-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
label.pk-up { margin: 0; cursor: pointer; }
.pk-up input { display: none; }
.pk-up.busy { opacity: .6; pointer-events: none; }
.pk-item .section-head { margin-top: 6px; }
.pk-file { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--stone); }
.pk-file:first-child { border-top: 0; }
.pk-file.old .pk-fname { color: var(--text-faint); }
.pk-fmain { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 180px; }
.pk-fname { font-size: var(--fs-body); font-weight: 500; overflow-wrap: anywhere; }
.pk-factions { display: flex; gap: 14px; flex-wrap: wrap; }
.pk-item #pk-files { margin: 10px 0; }
@media (max-width: 899px) {
  .pk-grid { grid-template-columns: 1fr; gap: 10px; }
  .pk-art-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pk-art-body { padding: 12px 12px 14px; }
  .pk-line { min-height: var(--tap); }
  label.pk-up { height: var(--tap); }
  .pk .cbar .chips { flex: 1 1 100%; overflow-x: auto; flex-wrap: nowrap; }
}

/* ---------- Alma Kitchen › Dish costs: the cookbook (Jelly's layout in Alma's design) ---------- */
.dc-locbar { margin-bottom: 14px; gap: 12px; }
.dc-locbar:empty { display: none; }
.dc-filters { margin-top: 10px; gap: 12px; }
.dc-sel { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-label); }
.dc-sel select { margin: 0; width: auto; min-width: 150px; height: 40px; min-height: 40px; }
/* a row: photo, what it is, name, type — and the price and GP on the right */
.dc-rows { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--stone); border-radius: var(--r-card); overflow: hidden; }
.dc-row, .dc-ing, .dc-step, .dc-choice { display: flex; align-items: center; gap: 14px; width: 100%; border: 0; border-bottom: 1px solid var(--stone); background: transparent; padding: 12px 14px; min-height: var(--tap); cursor: pointer; font: inherit; text-align: left; color: var(--text); }
.dc-rows > :last-child, .dc-card > :last-child { border-bottom: 0; }
.dc-row:hover, .dc-ing:hover, .dc-step:hover, .dc-choice:hover { background: var(--paper); }
.dc-pickrow { cursor: default; } .dc-pickrow:hover { background: transparent; }
.dc-thumb { flex: none; width: 72px; height: 72px; border-radius: var(--r-input, 10px); overflow: hidden; background: var(--stone); display: flex; align-items: center; justify-content: center; font-size: var(--fs-tiny); color: var(--text-faint); text-align: center; }
.dc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dc-rmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.dc-rkind { font-size: var(--fs-small); color: var(--text-muted); }
.dc-rname { font-size: var(--fs-body); font-weight: 600; color: var(--text); }
.dc-rsub { font-size: var(--fs-small); color: var(--text-muted); font-weight: 400; line-height: 1.45; }
.dc-rtags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dc-rnum { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.dc-rbig { font-size: var(--fs-body); font-weight: 600; }
.dc-chev { flex: none; color: var(--text-faint); font-size: 20px; line-height: 1; }
.dc-batch { color: var(--olive); font-weight: 600; }
.dc-choice { flex-direction: column; align-items: flex-start; gap: 4px; padding: 20px; border: 1px solid var(--stone); border-radius: var(--r-card); background: var(--card); }
/* the recipe sheet */
.dc-view { display: flex; flex-direction: column; gap: 14px; }
.dc-view label { margin-bottom: 0; }
.dc-banner { position: relative; height: 220px; border-radius: var(--r-card); overflow: hidden; background: var(--stone); display: flex; align-items: center; justify-content: center; color: var(--text-faint); font-size: var(--fs-label); }
.dc-banner.none { height: 110px; }
.dc-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dc-photo { position: absolute; right: 12px; bottom: 12px; margin: 0; cursor: pointer; }
.dc-title { display: flex; flex-direction: column; gap: 2px; }
.dc-h { font-size: 22px; font-weight: 600; letter-spacing: -.01em; color: var(--text); }
.dc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dc-tabs { align-self: flex-start; }
.dc-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--stone); border-radius: var(--r-card); overflow: hidden; }
.dc-card > .note { padding: 14px; margin: 0; }
.dc-kv { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 14px; border-bottom: 1px solid var(--stone); font-size: var(--fs-body); color: var(--text); margin: 0; font-weight: 400; }
.dc-kv b { font-weight: 600; text-align: right; }
.dc-band { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px; border-radius: var(--r-card); background: var(--ink); color: var(--on-ink); font-size: var(--fs-body); margin: 0; font-weight: 400; }
.dc-band b { font-size: 18px; font-weight: 600; } .dc-band .dc-rsub { color: var(--on-ink-muted); }
.dc-band input, .dc-kv input { margin: 0; width: 110px; text-align: right; }
.dc-in { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.dc-makes label { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--on-ink); font-size: var(--fs-body); }
.dc-method { padding: 14px; font-size: var(--fs-body); line-height: 1.6; color: var(--text); }
.dc-back { display: flex; justify-content: flex-start; }
.dc-shead { display: flex; justify-content: space-between; padding: 8px 14px; margin-top: 6px; background: var(--stone); border-radius: var(--r-pill); font-size: var(--fs-small); font-weight: 600; color: var(--text-muted); }
.dc-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--fs-small); color: var(--text-muted); }
.dc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dc-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); flex: none; }
.dc-dot.on { background: var(--ink); }
.dc-all .seg button { height: 32px; padding: 0 12px; }
.dc-tick { cursor: pointer; } .dc-tick input { margin-right: 8px; }
/* editing: the ingredient lines */
.dc-eline { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--stone); }
.dc-ehead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.dc-ebody { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dc-ebody input { width: 110px; margin: 0; }
.dc-ecost { margin-left: auto; font-size: var(--fs-body); font-weight: 600; }
.dc-why { color: var(--text); font-weight: 500; }
.dc-x { border: 0; background: transparent; color: var(--text-muted); font-size: 22px; line-height: 1; width: var(--tap); min-height: var(--tap); cursor: pointer; border-radius: var(--r-pill); }
.dc-x:hover { color: var(--text); background: var(--stone); }
.dc-units { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--paper); border: 1px solid var(--stone); border-radius: var(--r-card); }
.dc-ugroup { display: flex; flex-direction: column; gap: 6px; } .dc-ugroup .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dc-plus { flex: none; width: var(--tap); height: var(--tap); border-radius: 50%; border: 0; background: var(--olive); color: var(--on-ink); font-size: 22px; line-height: 1; cursor: pointer; }
.dc-plus.on { background: var(--ink); font-size: 16px; }
.dc-pack { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.dc-pack label { flex: 1; min-width: 96px; } .dc-pack input, .dc-pack select { margin: 2px 0 0; width: 100%; }
.dc-pack .dc-in input { width: 64px; }
.dc-times { padding-bottom: 12px; font-weight: 600; color: var(--text-muted); }
.dc-view mark { background: transparent; color: var(--olive); font-weight: 600; }
@media (max-width: 899px) {
  .dc-thumb { width: 56px; height: 56px; }
  .dc-banner { height: 170px; }
  .dc-sel { flex: 1; } .dc-sel select { flex: 1; min-width: 0; height: var(--tap); }
  .dc-actions .btn { flex: 1; }
}

/* Dish costs, eye-friendly pass (Baha, 12 Nov): the figures sit in columns right beside the name instead of at the far edge
   of the page; one sortable table for menu items, one for batch recipes; a recipe reads on one screen. */
.dc-n { margin-left: 4px; color: var(--text-faint); font-weight: 400; }
.seg button.active .dc-n { color: var(--text-muted); }
.dc-ghead { margin: 18px 0 8px; font-size: var(--fs-section); letter-spacing: var(--ls-section); text-transform: uppercase; font-weight: 600; color: var(--text-muted); }
.dc-ghead:first-child { margin-top: 0; }
.dct { background: var(--card); border: 1px solid var(--stone); border-radius: var(--r-card); overflow: hidden; }
.dct-h, .dct-r { display: grid; grid-template-columns: 40px minmax(170px, 340px) 84px 84px 92px 84px minmax(0, 150px) minmax(0, 1fr) 12px; column-gap: 16px; align-items: center; padding: 0 16px; }
.dct-h { height: 38px; background: var(--paper); border-bottom: 1px solid var(--stone); }
.dct-hb { border: 0; background: transparent; padding: 0; margin: 0; font: inherit; font-size: var(--fs-tiny); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); text-align: right; white-space: nowrap; }
.dct-hb.l { text-align: left; }
button.dct-hb { cursor: pointer; height: 38px; } button.dct-hb:hover { color: var(--text); }
.dct-r { width: 100%; min-height: 58px; border: 0; border-bottom: 1px solid var(--stone); background: transparent; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.dct > .dct-r:last-child { border-bottom: 0; }
.dct-r:hover { background: var(--paper); }
.dct-r .dc-thumb { width: 40px; height: 40px; font-size: 9px; line-height: 1.1; }
.dct-nm { min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 8px 0; }
.dct-name { font-size: var(--fs-body); font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dct-sub { display: none; font-size: var(--fs-small); color: var(--text-muted); }
.dct-c { text-align: right; font-size: var(--fs-body); white-space: nowrap; }
.dct-c .pct-pill { font-size: var(--fs-label); padding: 3px 9px; }
.dct-type { min-width: 0; overflow: hidden; }
.dct-note { min-width: 0; font-size: var(--fs-small); color: var(--text-muted); }
.dc-mrow .dc-mgp { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 110px; }
.dc-mrow .dc-mgp .pct-pill { font-size: var(--fs-label); padding: 3px 9px; }
.dc-mrow .dc-rmain { flex: 0 1 420px; }
.dc-mrow .dc-chev { margin-left: auto; }

.dc-hero { display: flex; gap: 18px; align-items: flex-start; }
.dc-pic { text-align: center; flex: none; width: 136px; height: 136px; border-radius: var(--r-card); overflow: hidden; background: var(--stone); display: flex; align-items: center; justify-content: center; font-size: var(--fs-small); color: var(--text-faint); }
.dc-pic.none { width: 72px; height: 72px; }
.dc-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dc-hero .dc-title { flex: 1; min-width: 0; gap: 6px; }
.dc-hero .dc-actions { margin-top: 8px; }
.dc-printopts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; padding: 12px; background: var(--paper); border: 1px solid var(--stone); border-radius: var(--r-card); }
.dc-printopts .dc-rsub { flex: 1 1 100%; }
.dc-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.dc-stat { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; background: var(--paper); border: 1px solid var(--stone); border-radius: var(--r-card); min-width: 0; }
.dc-stat span { font-size: var(--fs-small); color: var(--text-muted); }
.dc-stat b { font-size: 22px; font-weight: 600; letter-spacing: -.01em; line-height: 1.15; }
.dc-stat i { font-style: normal; font-size: var(--fs-tiny); color: var(--text-muted); line-height: 1.4; }
.dc-warn { margin: 0; padding: 10px 14px; border-radius: var(--r-input-m); background: var(--warn-wash); color: var(--text); font-size: var(--fs-label); line-height: 1.5; }
.dc-cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.dc-sec { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dc-sech { font-size: var(--fs-section); letter-spacing: var(--ls-section); text-transform: uppercase; font-weight: 600; color: var(--text-muted); }
.dc-sech.dc-gap { margin-top: 14px; }
.dc-il { display: grid; grid-template-columns: minmax(0, 1fr) 84px 64px 10px; column-gap: 12px; align-items: center; width: 100%; padding: 9px 14px; min-height: var(--tap); border: 0; border-bottom: 1px solid var(--stone); background: transparent; font: inherit; font-size: var(--fs-body); color: var(--text); text-align: left; }
button.dc-il { cursor: pointer; } button.dc-il:hover { background: var(--paper); }
.dc-il > .num { text-align: right; white-space: nowrap; } .dc-il > b { font-weight: 600; }
.dc-ilh { min-height: 34px; padding-top: 0; padding-bottom: 0; background: var(--paper); font-size: var(--fs-tiny); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.dc-ilh span:nth-child(2), .dc-ilh span:nth-child(3) { text-align: right; }
.dc-ilt { background: var(--paper); font-weight: 600; }
.dc-alls { display: flex; flex-wrap: wrap; gap: 8px; }
.dc-all1 { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--stone); border-radius: var(--r-pill); background: var(--card); font-size: var(--fs-label); font-weight: 500; }
.dc-all1 em { font-style: normal; font-weight: 400; color: var(--text-muted); }
.dc-all1 .dc-dot { width: 11px; height: 11px; }
.dc-eline .link-action { white-space: nowrap; }
@media (max-width: 899px) {
  .dct-h { display: none; }
  .dct-r { grid-template-columns: 44px repeat(3, minmax(0, 1fr)); column-gap: 12px; row-gap: 8px; align-items: start; padding: 12px 14px; }
  .dct-r .dc-thumb { width: 44px; height: 44px; grid-row: 1 / span 2; }
  .dct-nm { grid-column: 2 / -1; padding: 0; }
  .dct-sub { display: block; }
  .dct-c { text-align: left; display: flex; flex-direction: column; gap: 1px; font-weight: 600; }
  .dct-c::before { content: attr(data-l); font-size: var(--fs-tiny); font-weight: 400; color: var(--text-muted); }
  .dct-c.c3, .dct-type, .dct-r > .dc-chev { display: none; }
  .dct-note { grid-column: 2 / -1; } .dct-note:empty { display: none; }
  .dc-pic { width: 84px; height: 84px; } .dc-pic.none { width: 56px; height: 56px; }
  .dc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dc-stat b { font-size: 19px; }
  .dc-cols { grid-template-columns: minmax(0, 1fr); }
  .dc-il { grid-template-columns: minmax(0, 1fr) auto 58px 8px; column-gap: 10px; }
  .dc-mrow .dc-mgp { width: 88px; }
  #dc-kind { flex: 1 1 100%; }
}
/* photos (Baha, 12 Nov): the browser's own "Choose file" box never shows — the label is the button; a recipe with no photo
   offers "+ Photo" in the list and on its screen for anyone who can edit */
.dc-file { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important; border: 0 !important; opacity: 0; overflow: hidden; clip-path: inset(50%); pointer-events: none; }
.dc-view label.dc-photo, label.dc-photo { position: absolute; right: 12px; bottom: 12px; left: auto; display: inline-flex; flex-direction: row; align-items: center; justify-content: center; width: auto; margin: 0; cursor: pointer; }
.dc-banner.none { height: 132px; flex-direction: column; }
.dc-banner.none label.dc-photo { position: static; }
.dc-banner.none .dc-bnote { margin-bottom: 10px; }
label.dc-thumb.add, label.dc-pic.add { position: relative; margin: 0; cursor: pointer; background: transparent; border: 1.5px dashed var(--text-faint); color: var(--olive); font-weight: 600; flex-direction: row; }
label.dc-thumb.add:hover, label.dc-pic.add:hover { background: var(--ok-tint); border-color: var(--olive); }
label.dc-thumb.add.busy, label.dc-pic.add.busy { pointer-events: none; color: var(--text-muted); }
.dct-r .dc-thumb.add { font-size: 9px; line-height: 1.15; }
.dct-r .dc-thumb.add span { white-space: normal; text-align: center; }
div.dct-r:focus-visible { outline: 2px solid var(--olive); outline-offset: -2px; }

/* ============ Dish costs v2 (design/Alma Dish Costs.dc.html, 12 Nov): authors, sign-off, the olive modal ============ */
/* avatars: the four recipe-team colours are tokens; "none" is a recipe with no creator yet */
.dc-av { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; font-size: 11px; font-weight: 700; background: var(--stone); color: var(--text-muted); letter-spacing: 0; }
.dc-av.av-bs { background: var(--av-bs); color: var(--av-bs-fg); } .dc-av.av-mj { background: var(--av-mj); color: var(--av-fg); } .dc-av.av-kp { background: var(--av-kp); color: var(--av-fg); } .dc-av.av-as { background: var(--av-as); color: var(--av-fg); }
.dc-av.xs { width: 22px; height: 22px; font-size: 9px; } .dc-av.md { width: 40px; height: 40px; font-size: 13px; } .dc-av.lg { width: 52px; height: 52px; font-size: 16px; }
.dc-av.ring { width: 30px; height: 30px; background: var(--card); color: var(--ink); box-shadow: 0 0 0 2px var(--olive-deep), 0 0 0 3.5px var(--gold); }
.dcm-who.signed .dc-av.ring { box-shadow: 0 0 0 2px var(--olive-deep), 0 0 0 3.5px var(--olive-light); }
/* sign-off pill */
.dc-sp { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 4px; border-radius: var(--r-pill); font-size: var(--fs-small); font-weight: 600; white-space: nowrap; }
.dc-sp i { font-style: normal; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; font-size: 10px; font-weight: 700; color: var(--card); }
.dc-sp.yes { background: var(--signed-bg); color: var(--signed-fg); } .dc-sp.yes i { background: var(--signed-fg); }
.dc-sp.no { background: var(--unsigned-bg); color: var(--unsigned-fg); } .dc-sp.no i { background: var(--warn-bar); }
.dc-sp.plain { padding: 0 12px; height: 28px; } .dc-sp.sm { height: 22px; padding: 0 8px; font-size: var(--fs-tiny); }
.dc-sp i.dot { width: 6px; height: 6px; }
/* DC4: the person cards, the filters, the table */
.dc-people { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.dc-people:empty { display: none; }
.dc-person { display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-align: left; font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--stone); border-radius: var(--r-card); cursor: pointer; min-height: var(--tap); }
.dc-person.hot { background: var(--paper); border-color: var(--warn-bar); }
.dc-person.on { box-shadow: inset 0 0 0 1.5px var(--ink); }
.dc-fd { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 6px 0 14px; margin: 0; border: 1px solid var(--stone); border-radius: var(--r-pill); background: var(--card); font-size: var(--fs-label); color: var(--text-muted); }
.dc-fd.on { background: var(--signed-bg); border-color: var(--signed-bg); }
.dc-fd select { margin: 0; width: auto; max-width: 190px; height: 34px; min-height: 34px; padding: 0 22px 0 4px; border: 0; background-color: transparent; font-weight: 600; color: var(--text); font-size: var(--fs-label); }
.dct-h, .dct-r { grid-template-columns: 44px minmax(0, 1.5fr) 220px 200px 96px minmax(0, 130px) 12px; column-gap: 18px; }
.dct.nocost .dct-h, .dct.nocost .dct-r { grid-template-columns: 44px minmax(0, 1.5fr) 220px 200px minmax(0, 130px) 12px; }
.dct-r { min-height: 64px; }
.dct-r .dc-thumb { width: 44px; height: 44px; }
.dct-name { font-size: 15px; }
.dct-sub { display: block; font-size: var(--fs-small); color: var(--text-muted); } .dct-sub b { font-weight: 500; color: var(--unsigned-fg); }
.dct-by { display: flex; align-items: center; gap: 10px; min-width: 0; } .dct-who { font-size: var(--fs-body); font-weight: 500; }
.dct-c { font-size: 15px; font-weight: 500; }
/* the modal (DC1, DC3, DC5): the panel carries no padding and no title bar; the olive header is the title */
@media (min-width: 900px) { .sheet-panel.dcm { width: min(1140px, 94vw); height: min(928px, 92vh); max-height: 92vh; } }
.sheet-panel.dcm { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.sheet-panel.dcm .sheet-head, .sheet-panel.dcm .sheet-handle { display: none; }
.sheet-panel.dcm .sheet-body { flex: 1; min-height: 0; padding: 0; display: flex; flex-direction: column; }
.dcm-root { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.dcm-hero { flex: none; display: flex; gap: 24px; align-items: flex-start; padding: 28px 32px 26px; background: var(--olive-deep); color: var(--card); }
.dcm-hero.compact { padding: 20px 32px; } .dcm-hero.col { flex-direction: column; gap: 14px; padding-bottom: 0; align-items: stretch; }
.dcm-photo { flex: none; width: 120px; height: 120px; border-radius: var(--r-card-lg); overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: var(--fs-small); font-weight: 500; color: var(--card); background: var(--on-ink-hover); border: 1.5px dashed var(--on-ink-faint); margin: 0; position: relative; }
.dcm-photo img { width: 100%; height: 100%; object-fit: cover; display: block; } .dcm-photo:has(img) { border: 0; }
label.dcm-photo.add { cursor: pointer; } label.dcm-photo.add:hover { background: var(--on-ink-active); }
.dcm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.dcm-eyebrow { font-size: var(--fs-tiny); letter-spacing: .22em; text-transform: uppercase; color: var(--olive-light); font-weight: 500; }
.dcm-name { font-size: 36px; font-weight: 500; letter-spacing: -.02em; line-height: 1.05; } .dcm-name.sm { font-size: 30px; }
.dcm-sub, .dcm-by { font-size: var(--fs-label); color: var(--on-ink-soft); } .dcm-by { display: flex; align-items: center; gap: 8px; font-size: var(--fs-small); }
.dcm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.dcm-chip { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: var(--r-pill); background: var(--on-ink-line); font-size: var(--fs-small); }
.dcm-who { align-self: flex-start; display: flex; align-items: center; gap: 10px; margin-top: 4px; padding: 4px 6px 4px 4px; border: 0; border-radius: var(--r-pill); background: var(--on-ink-active); color: var(--card); font: inherit; text-align: left; }
button.dcm-who { cursor: pointer; padding-right: 16px; }
.dcm-whot { display: flex; flex-direction: column; line-height: 1.25; padding: 0 4px; } .dcm-whot span { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); } .dcm-whot b { font-size: var(--fs-label); font-weight: 500; }
.dcm-who.signed .dcm-whot span { color: var(--olive-light); }
.dcm-sign { margin-left: 6px; height: 30px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: var(--gold); color: var(--ink); font: inherit; font-size: var(--fs-small); font-weight: 600; cursor: pointer; }
.dcm-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 18px; position: relative; }
.dcm-x { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--on-ink-line); color: var(--card); font-size: 16px; cursor: pointer; flex: none; }
.dcm-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.dcm-btn { height: 40px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--on-ink-faint); background: transparent; color: var(--card); font: inherit; font-size: var(--fs-label); font-weight: 500; cursor: pointer; white-space: nowrap; }
.dcm-btn:hover { background: var(--on-ink-hover); } .dcm-btn.solid { background: var(--card); color: var(--ink); border-color: var(--card); font-weight: 600; padding: 0 20px; } .dcm-btn.round { width: 40px; padding: 0; }
.dcm-menu { position: absolute; right: 0; top: 104px; z-index: 3; min-width: 230px; display: flex; flex-direction: column; padding: 6px; background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow-pop); }
.dcm-menu button { height: var(--tap); padding: 0 14px; border: 0; background: transparent; text-align: left; font: inherit; font-size: var(--fs-body); color: var(--text); border-radius: var(--r-nav); cursor: pointer; } .dcm-menu button:hover { background: var(--paper); } .dcm-menu button.danger { color: var(--bad); }
.dcm-body { flex: 1; min-height: 0; overflow-y: auto; padding: 24px 32px 32px; display: flex; flex-direction: column; gap: 20px; background: var(--card); }
.dcm-card { background: var(--paper); border: 1px solid var(--stone); border-radius: var(--r-card); padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dcm-card.flush { padding: 0; overflow: hidden; gap: 0; } .dc-card.pad { padding: 16px 18px; gap: 12px; } .note.pad { padding: 14px 22px; margin: 0; }
.dcm-kpis { display: grid; grid-template-columns: 280px minmax(0, 1fr) 250px; gap: 16px; }
.dcm-ring { flex-direction: row; align-items: center; gap: 18px; } .dcm-ring .dc-rmain { gap: 8px; }
.rg-track { stroke: var(--stone); } .rg-val { stroke: var(--olive); } .rg-val.t-warn { stroke: var(--warn-bar); } .rg-val.t-bad { stroke: var(--bad-bar); } .rg-mark { stroke: var(--ink); }
.rg-n { font-size: 22px; font-weight: 600; fill: var(--ink); font-family: var(--font); } .rg-l { font-size: 11px; fill: var(--text-muted); font-family: var(--font); }
.dcm-wh { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.dcm-bar { display: flex; height: 34px; border-radius: var(--r-nav); overflow: hidden; gap: 2px; }
.dcm-bar i, .dcm-legend i { font-style: normal; } .b-ing { background: var(--warn-bar); } .b-oh { background: var(--gold); } .b-vat { background: var(--on-ink-soft); } .b-mar { background: var(--olive); }
.dcm-bar .b-mar { flex: 1; min-width: 0; color: var(--card); font-size: var(--fs-small); font-weight: 600; display: flex; align-items: center; padding-left: 12px; white-space: nowrap; overflow: hidden; }
.dcm-legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; } .dcm-legend div { display: flex; flex-direction: column; gap: 3px; } .dcm-legend span { display: flex; align-items: center; gap: 6px; font-size: var(--fs-small); color: var(--text-muted); } .dcm-legend i { width: 8px; height: 8px; border-radius: 2px; flex: none; } .dcm-legend b { font-size: 20px; font-weight: 500; } .dcm-legend b.mar { font-weight: 600; color: var(--signed-fg); }
.dcm-floor { background: var(--ink); border-color: var(--ink); color: var(--card); gap: 8px; } .dcm-floor span { font-size: var(--fs-label); color: var(--on-ink-soft); line-height: 1.45; } .dcm-floor b { font-size: 40px; font-weight: 400; letter-spacing: -.03em; line-height: 1; }
.dcm-warn { display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 18px; border-radius: var(--r-input-m); background: var(--unsigned-bg); color: var(--unsigned-fg); font-size: var(--fs-body); } .dcm-warn b { font-weight: 600; }
.dcm-warn button, .dce-cta { margin-left: auto; flex: none; height: 34px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: var(--unsigned-fg); color: var(--card); font: inherit; font-size: var(--fs-label); font-weight: 500; cursor: pointer; }
.dcm-cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; } .dcm-cols .dc-sec { gap: 16px; }
.dcm-ch { display: flex; align-items: center; gap: 8px; padding: 16px 22px; } .dcm-ch.nop { padding: 0; } .dcm-ch .dcm-mini { margin-left: auto; }
.dcm-mini { height: 30px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--stone); background: var(--card); color: var(--text); font: inherit; font-size: var(--fs-small); font-weight: 500; cursor: pointer; } .dcm-mini.dark { background: var(--ink); border-color: var(--ink); color: var(--card); }
.dcm-il { display: grid; grid-template-columns: minmax(0, 1fr) 72px 64px 112px; column-gap: 16px; align-items: center; padding: 12px 22px; border-top: 1px solid var(--stone); cursor: pointer; }
.dcm-il.nocost { grid-template-columns: minmax(0, 1fr) 80px; }
.dcm-il:hover { background: var(--card); } .dcm-il.head { cursor: default; padding: 8px 22px; background: var(--card); font-size: var(--fs-tiny); letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; } .dcm-il.head span:nth-child(2), .dcm-il.head span:nth-child(3) { text-align: right; }
.dcm-il .amt { text-align: right; color: var(--text-muted); } .dcm-il b { text-align: right; font-weight: 600; } .dcm-il .dc-rname { font-weight: 500; }
.dcm-il.miss { background: var(--warn-wash); box-shadow: inset 3px 0 0 var(--warn-bar); } .dcm-il.miss .dc-rsub, .dcm-il.miss b { color: var(--unsigned-fg); }
.dcm-share, .dce-share { display: flex; align-items: center; gap: 8px; } .dcm-share > i, .dce-share > i { flex: 1; height: 6px; border-radius: 3px; background: var(--stone); overflow: hidden; display: block; } .dcm-share > i > i, .dce-share > i > i { display: block; height: 100%; background: var(--olive); border-radius: 3px; } .dcm-share span, .dce-share span { font-size: var(--fs-small); color: var(--text-muted); width: 30px; text-align: right; }
.dcm-pick { height: 28px; border-radius: var(--r-pill); border: 1px solid var(--warn-bar); background: var(--card); color: var(--unsigned-fg); font: inherit; font-size: var(--fs-small); font-weight: 600; cursor: pointer; }
.dcm-tot { display: flex; flex-direction: column; gap: 6px; padding: 14px 22px; border-top: 1px solid var(--stone); background: var(--card); } .dcm-tot div { display: flex; justify-content: space-between; font-size: var(--fs-label); color: var(--text-muted); } .dcm-tot .big { font-size: 15px; font-weight: 600; color: var(--text); }
.dcm-step { display: flex; gap: 12px; align-items: flex-start; font-size: var(--fs-body); line-height: 1.5; } .dcm-step b { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--olive-deep); color: var(--card); font-size: var(--fs-small); font-weight: 600; display: flex; align-items: center; justify-content: center; } .dcm-step span { padding-top: 2px; }
.dcm-addon { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--r-nav); background: var(--card); font-size: var(--fs-label); } .dcm-addon b { font-size: var(--fs-tiny); letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--olive); }
.dc-alcs { display: flex; flex-wrap: wrap; gap: 6px; }
.dc-alc { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--r-pill); border: 1px dashed var(--text-faint); color: var(--text-muted); font-size: var(--fs-small); }
.dc-alc.contains { border: 1px solid var(--ink); background: var(--ink); color: var(--card); font-weight: 600; } .dc-alc.removable { border: 1px solid var(--ink); color: var(--ink); font-weight: 600; } .dc-alc.free { border: 1px solid var(--stone); color: var(--text-faint); }
/* DC3: the edit modal */
.dcm-top { display: flex; align-items: center; gap: 14px; } .dcm-top .dcm-x { margin-left: auto; }
.dcm-backlink { border: 0; background: transparent; color: var(--olive-light); font: inherit; font-size: var(--fs-label); font-weight: 500; cursor: pointer; padding: 0; min-height: 36px; }
.dcm-row { display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.dcm-live { margin-left: auto; display: flex; padding: 6px; border-radius: var(--r-input-m); background: var(--on-ink-active); } .dcm-live div { display: flex; flex-direction: column; gap: 2px; padding: 6px 14px; } .dcm-live div + div { border-left: 1px solid var(--on-ink-line); } .dcm-live span { font-size: var(--fs-tiny); color: var(--on-ink-soft); } .dcm-live b { font-size: 18px; font-weight: 600; } .dcm-live b.lv-ok { color: var(--olive-light); } .dcm-live b.lv-warn, .dcm-live b.lv-bad { color: var(--gold); }
.dcm-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; } .dcm-tabs::-webkit-scrollbar { display: none; }
.dcm-tabs button { flex: none; height: 44px; padding: 0 18px; border: 0; border-radius: 12px 12px 0 0; background: transparent; color: var(--on-ink-soft); font: inherit; font-size: var(--fs-body); font-weight: 500; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.dcm-tabs button.on { background: var(--card); color: var(--ink); }
.dcm-tabs i { font-style: normal; font-size: var(--fs-tiny); font-weight: 600; padding: 2px 7px; border-radius: var(--r-pill); background: var(--on-ink-line); } .dcm-tabs button.on i { background: var(--signed-bg); color: var(--signed-fg); } .dcm-tabs button.todo i { background: var(--unsigned-bg); color: var(--unsigned-fg); }
.dcm-foot { flex: none; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 32px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--stone); background: var(--paper); } .dcm-foot .sp { flex: 1; } .dcm-foot b { font-size: 15px; font-weight: 600; } .dcm-foot .btn { height: 42px; }
.dcm-err { margin: 0; padding: 8px 32px 12px; background: var(--paper); }
.dce { display: flex; flex-direction: column; gap: 14px; } .dce-form { max-width: 760px; } .dce-form label { margin: 0; } .form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dce-add { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; } .dce-search { flex: 1; min-width: 260px; margin: 0; } .dce-search input { margin: 0; height: 46px; border-radius: var(--r-input-m); }
.dce-results, .dce-picker { background: var(--paper); border: 1px solid var(--stone); border-radius: var(--r-input-m); box-shadow: var(--shadow-pop); overflow: hidden; max-height: 340px; overflow-y: auto; }
.dce-picker { margin: 0 18px 14px 78px; } .dce-ph { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--stone); } .dce-ph input { flex: 1; margin: 0; height: 36px; min-height: 36px; }
.dce-pick { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 150px 110px 150px; column-gap: 12px; align-items: center; padding: 10px 14px; min-height: var(--tap); border: 0; border-top: 1px solid var(--stone); background: transparent; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.dce-pick:first-child { border-top: 0; } .dce-pick:hover { background: var(--signed-bg); } .dce-pick b { text-align: right; font-size: var(--fs-label); font-weight: 600; } .dce-pick .dc-rname { font-size: var(--fs-label); }
.dce-line { display: grid; grid-template-columns: 20px 26px minmax(0, 1fr) 210px 78px 92px 72px; column-gap: 14px; align-items: center; padding: 12px 18px; }
.dce-line.nocost { grid-template-columns: 20px 26px minmax(0, 1fr) 210px 72px; }
.dce-line.head { padding: 10px 18px; background: var(--card); font-size: var(--fs-tiny); letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; } .dce-line .r { text-align: right; }
.dce-row { border-top: 1px solid var(--stone); } .dce-row.miss { background: var(--warn-wash); box-shadow: inset 3px 0 0 var(--warn-bar); } .dce-row.over { box-shadow: inset 0 2px 0 var(--olive); } .dce-row.drag { opacity: .5; }
.dce-grip { color: var(--text-faint); cursor: grab; letter-spacing: -2px; user-select: none; }
.dce-n { width: 24px; height: 24px; border-radius: 50%; background: var(--olive-deep); color: var(--card); font-size: var(--fs-small); font-weight: 600; display: flex; align-items: center; justify-content: center; } .dce-row.miss .dce-n { background: var(--warn-bar); color: var(--ink); }
.dce-pn { display: flex; align-items: center; gap: 8px; min-width: 0; } .dce-pn .dc-rname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .dce-pn .pill { flex: none; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.dce-kn { display: flex; align-items: center; gap: 6px; margin: 0; font-size: var(--fs-small); color: var(--text-muted); font-weight: 400; } .dce-kn span { flex: none; }
.dce-kn input { flex: 1; min-width: 0; margin: 0; height: 26px; min-height: 26px; padding: 0 2px; border: 0; border-bottom: 1px dashed var(--text-faint); border-radius: 0; background: transparent; font-size: var(--fs-small); font-weight: 500; color: var(--text); } .dce-kn input:focus { border-bottom-style: solid; outline: none; }
.dce-amt { display: flex; align-items: center; height: 40px; border: 1px solid var(--stone); border-radius: var(--r-nav); overflow: hidden; background: var(--card); }
.dce-amt input { width: 76px; flex: 1; min-width: 0; margin: 0; border: 0; height: 38px; min-height: 38px; padding: 0 10px; background: transparent; font-size: 15px; font-weight: 500; }
.dce-units { display: flex; gap: 2px; padding: 3px; height: 100%; background: var(--paper); } .dce-units button { padding: 0 8px; border: 0; border-radius: var(--r-code); background: transparent; color: var(--text-muted); font: inherit; font-size: var(--fs-small); font-weight: 600; cursor: pointer; } .dce-units button.on { background: var(--card); color: var(--ink); box-shadow: 0 0 0 1px var(--stone); }
.dce-cost { text-align: right; font-size: 15px; font-weight: 600; } .dce-nop { font-size: var(--fs-tiny); font-weight: 600; color: var(--unsigned-fg); width: auto !important; }
.dce-act { display: flex; gap: 4px; justify-content: flex-end; } .dce-act button { width: 32px; height: 32px; border: 0; border-radius: var(--r-code); background: transparent; color: var(--text-muted); font-size: 16px; cursor: pointer; } .dce-act button:hover { background: var(--stone); } .dce-act .rm { color: var(--bad); font-size: 14px; }
.dce-sub { display: flex; align-items: center; gap: 12px; padding: 0 18px 12px 78px; } .dce-why { font-size: var(--fs-small); color: var(--unsigned-fg); } .dce-cta { height: 30px; }
.dce-makes { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-radius: var(--r-card); background: var(--ink); color: var(--card); } .dce-makes label { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--card); font-size: var(--fs-body); } .dce-makes input { width: 110px; margin: 0; } .dce-makes select { width: auto; margin: 0; } .dce-makes .dc-rsub { color: var(--on-ink-soft); }
.dce-photo { display: flex; align-items: center; gap: 16px; } .dce-pbtn { position: relative; margin: 0; display: inline-flex; align-items: center; cursor: pointer; width: auto; }
/* DC6: signing and the stamp */
.dcs-head { display: flex; align-items: center; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--stone); } .dcs-eyebrow { font-size: var(--fs-tiny); letter-spacing: .22em; text-transform: uppercase; color: var(--olive); font-weight: 600; } .dcs-name { font-size: 24px; font-weight: 500; letter-spacing: -.01em; line-height: 1.1; }
.dcs-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--stone); border-radius: var(--r-input-m); background: var(--paper); } .dcs-row > i { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--olive); color: var(--card); font-style: normal; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; } .dcs-row b { font-size: var(--fs-body); font-weight: 600; } .dcs-row > .dc-rsub { margin-left: auto; text-align: right; }
.dcs-row.no { background: var(--unsigned-bg); border-color: var(--unsigned-bg); color: var(--unsigned-fg); } .dcs-row.no > i { background: var(--warn-bar); } .dcs-row.no .dc-rsub { color: var(--unsigned-fg); }
.dcs-card { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; border: 1px solid var(--stone); border-radius: var(--r-card); background: var(--paper); }
.dcs-confirm { display: flex; gap: 12px; align-items: flex-start; margin: 0; font-size: var(--fs-label); font-weight: 400; line-height: 1.5; color: var(--text); cursor: pointer; } .dcs-confirm input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--olive-deep); flex: none; }
.dc-signame { font-family: var(--font-sign); font-size: 40px; font-weight: 600; line-height: 1; color: var(--ink); padding: 4px 2px 2px; } .dc-signame.big { font-size: 44px; padding: 0; }
.dcs-line { height: 1.5px; background: var(--ink); } .dcs-under { display: flex; justify-content: space-between; padding-top: 6px; font-size: var(--fs-tiny); color: var(--text-muted); }
.dcs-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; } .dcs-foot .dc-rsub { max-width: 200px; } .dcs-foot .form-actions { margin: 0; }
.dcs-stamp { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; padding: 12px 4px; } .dcs-stamp .dc-rmain { gap: 6px; }
.dcs-seal { flex: none; transform: rotate(-8deg); } .dcs-seal .s-ring { stroke: var(--olive-deep); } .dcs-seal .s-core { fill: var(--olive-deep); } .dcs-seal .s-arc { font-size: 11.5px; font-weight: 700; letter-spacing: 3px; fill: var(--olive-deep); font-family: var(--font); } .dcs-seal .s-ini { font-size: 24px; font-weight: 700; fill: var(--card); font-family: var(--font); } .dcs-seal .s-date { font-size: 10px; font-weight: 600; letter-spacing: 1.5px; fill: var(--signed-bg); font-family: var(--font); }
.dcs-ok { display: flex; align-items: center; gap: 8px; font-size: var(--fs-small); letter-spacing: .2em; text-transform: uppercase; color: var(--signed-fg); font-weight: 700; } .dcs-ok i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; background: var(--signed-fg); color: var(--card); font-size: 11px; letter-spacing: 0; display: flex; align-items: center; justify-content: center; }
/* DC5: recipe team */
.dct-team { display: flex; flex-direction: column; } .dct-tr { display: grid; grid-template-columns: 44px minmax(0, 1fr) 120px 120px 110px; column-gap: 16px; align-items: center; padding: 14px 4px; border-top: 1px solid var(--stone); } .dct-tr.head { border-top: 0; padding: 0 4px 10px; font-size: var(--fs-tiny); letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; grid-template-columns: minmax(0, 1fr) 120px 120px 110px; } .dct-tr.head span:nth-child(2), .dct-tr.head span:nth-child(3), .dct-tr .c { text-align: center; display: flex; justify-content: center; } .dct-tr.head span:last-child, .dct-tr .r { text-align: right; color: var(--text-muted); } .dct-tr.off { opacity: .55; }
.dc-sw { flex: none; position: relative; width: 44px; height: 26px; border: 0; border-radius: 13px; background: var(--on-ink-soft); cursor: pointer; padding: 0; } .dc-sw i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--card); transition: left .15s; } .dc-sw.on { background: var(--olive); } .dc-sw.on i { left: 21px; } .dc-sw:disabled { opacity: .5; cursor: default; }
.dc-kv .dc-sw { margin-left: auto; }
@media (max-width: 899px) {
  .dc-people { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .dc-person { padding: 10px 12px; }
  .dc-fd { flex: 1 1 46%; height: var(--tap); } .dc-fd select { flex: 1; max-width: none; height: 40px; }
  .dct-r, .dct.nocost .dct-r { grid-template-columns: 44px minmax(0, 1fr) auto; column-gap: 12px; row-gap: 10px; align-items: center; padding: 12px 14px; }
  .dct-r .dc-thumb { grid-row: auto; } .dct-nm { grid-column: 2 / -1; } .dct-by { grid-column: 1 / 3; } .dct-so { grid-column: 1 / 3; } .dct-c { grid-column: 3; grid-row: 2 / span 2; text-align: right; align-self: center; }
  .sheet-panel.dcm { top: 0; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .dcm-hero, .dcm-hero.compact { padding: 18px 16px; gap: 14px; flex-wrap: wrap; } .dcm-hero.col { padding-bottom: 0; }
  .dcm-photo { width: 72px; height: 72px; border-radius: var(--r-card); font-size: var(--fs-tiny); gap: 2px; } .dcm-name, .dcm-name.sm { font-size: 24px; }
  .dcm-side { position: static; flex: 1 1 100%; align-items: stretch; gap: 10px; } .dcm-side .dcm-x { position: absolute; top: 14px; right: 14px; } .dcm-acts { justify-content: flex-start; } .dcm-menu { top: auto; left: 16px; right: 16px; }
  .dcm-main { padding-right: 40px; } .dcm-body { padding: 16px; gap: 16px; }
  .dcm-kpis, .dcm-cols { grid-template-columns: minmax(0, 1fr); } .dcm-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dcm-il { grid-template-columns: minmax(0, 1fr) auto 60px; padding: 12px 14px; } .dcm-il > .dcm-share, .dcm-il.head span:nth-child(4) { display: none; } .dcm-il .dcm-pick { grid-column: 1 / -1; justify-self: start; padding: 0 12px; }
  .dcm-ch, .dcm-tot { padding-left: 14px; padding-right: 14px; } .dcm-warn { flex-wrap: wrap; }
  .dcm-live { margin-left: 0; width: 100%; } .dcm-live div { flex: 1; padding: 6px 10px; }
  .dcm-foot { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); gap: 8px; } .dcm-foot .sp { display: none; } .dcm-foot .btn { flex: 1; padding: 0 10px; }
  .dce-line, .dce-line.nocost { grid-template-columns: 20px 26px minmax(0, 1fr) 64px; row-gap: 10px; padding: 12px 14px; } .dce-line.head { display: none; }
  .dce-line > .dc-rmain { grid-column: 3 / -1; } .dce-amt { grid-column: 1 / 4; } .dce-cost { grid-column: 4; } .dce-share { display: none; } .dce-act { grid-column: 1 / -1; justify-content: flex-start; } .dce-pn { flex-wrap: wrap; } .dce-pn .dc-rname { white-space: normal; }
  .dce-sub { padding-left: 14px; flex-wrap: wrap; } .dce-picker { margin: 0 14px 14px; } .dce-pick { grid-template-columns: minmax(0, 1fr) auto; } .dce-pick > span:nth-child(2), .dce-pick > span:nth-child(3) { display: none; }
  .form-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dct-tr { grid-template-columns: 40px minmax(0, 1fr) 52px 52px; } .dct-tr .r { display: none; } .dct-tr.head { grid-template-columns: minmax(0, 1fr) 52px 52px; font-size: 9px; letter-spacing: .04em; } .dct-tr.head span:last-child { display: none; }
  .dcs-stamp { justify-content: center; }
}
.dce-form .form-grid { row-gap: 12px; }
.dcm-body > * { flex: none; }
.dce-kn { align-self: stretch; }
.dcm-legend span { font-size: var(--fs-tiny); white-space: nowrap; }

/* ----- Add invoice (pages/add-invoice.js): upload a missing invoice, read at once ----- */
.ai-drop { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0; padding: 30px 18px; border: 1.5px dashed var(--stone); border-radius: var(--r-card); background: var(--paper); text-align: center; cursor: pointer; }
.ai-drop.over { border-color: var(--olive); background: var(--card); }
.ai-drop input { display: none; }
.ai-drop .btn { pointer-events: none; }
.ai-drop-t { font-size: var(--fs-body); font-weight: 600; color: var(--text); }
.ai-steps { padding: 6px 0; }
.ai-step { display: flex; align-items: center; gap: 12px; padding: 12px 16px; font-size: var(--fs-body); color: var(--text-faint); }
.ai-step i { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: var(--fs-tiny); font-weight: 600; background: var(--stone); color: var(--text-muted); }
.ai-step.done { color: var(--text-muted); } .ai-step.done i { background: var(--olive); color: var(--on-ink); }
.ai-step.now { color: var(--text); font-weight: 600; } .ai-step.now i { background: var(--ink); color: var(--on-ink); animation: ai-pulse 1.1s ease-in-out infinite; }
@keyframes ai-pulse { 50% { opacity: .45; } }
.ai-verdict { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--r-card); background: var(--card); border: 1px solid var(--stone); font-size: var(--fs-label); line-height: 1.5; color: var(--text-muted); }
.ai-verdict b { font-size: var(--fs-body); font-weight: 600; color: var(--text); }
.ai-verdict.warn, .ai-verdict.bad { background: var(--warn-wash); border-color: transparent; color: var(--text); }
.ai .dc-kv select { margin: 0; width: auto; max-width: 60%; }
.ai-line { display: grid; grid-template-columns: minmax(0, 1fr) 90px 80px; gap: 12px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--stone); font-size: var(--fs-label); color: var(--text); }
.ai-line > :not(:first-child) { text-align: right; }
.ai-line.head { font-size: var(--fs-tiny); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); }
.ai-lines { max-height: 320px; overflow-y: auto; }
.ai-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 899px) {
  .ai-line { grid-template-columns: minmax(0, 1fr) 70px 64px; }
  .ai-actions .btn { flex: 1; height: var(--tap); }
}
.dct-tr { grid-template-columns: 44px minmax(0, 1fr) 92px 92px 92px 92px 96px; } .dct-tr.head { grid-template-columns: minmax(0, 1fr) 92px 92px 92px 92px 96px; } .dct-tr.head span:nth-child(4), .dct-tr.head span:nth-child(5) { text-align: center; display: flex; justify-content: center; }
@media (max-width: 899px) { .dct-tr { grid-template-columns: 40px minmax(0, 1fr) repeat(4, 46px); column-gap: 6px; } .dct-tr.head { grid-template-columns: minmax(0, 1fr) repeat(4, 46px); column-gap: 6px; } .dct-tr.head span:last-child, .dct-tr .r { display: none; } }

/* ----- Dish details, calmer (Baha, 12 Nov: "simplify, clean, professional, too many colours"): one olive header, plain figures,
   neutral pills and notes; the only status colour left on the screen is GP against its target ----- */
.dcm-hero .dc-sp, .dcm-hero .dc-sp.yes, .dcm-hero .dc-sp.no { background: var(--on-ink-line); color: inherit; font-weight: 500; }
.dcm-hero .dc-sp i.dot { display: none; }
.dcm-eyebrow, .dcm-whot span, .dcm-who.signed .dcm-whot span { color: var(--on-ink-muted); }
.dcm-root .dcm-sign { background: transparent; border: 1px solid var(--on-ink-muted); color: var(--card); font-weight: 500; }
.dcm-body .dc-sp, .dcm-body .dc-sp.yes, .dcm-body .dc-sp.no { background: var(--stone); color: var(--text-muted); font-weight: 500; }
.dcm-body .dc-stat { background: var(--card); }
.dcm-warn { background: var(--card); border: 1px solid var(--stone); color: var(--text); }
.dcm-warn button { background: var(--ink); color: var(--on-ink); }
.dcm-il { grid-template-columns: minmax(0, 1fr) 72px 64px 56px; }
.dcm-il.head span:nth-child(4), .dcm-pc { text-align: right; }
.dcm-pc { font-size: var(--fs-small); color: var(--text-muted); }
.dcm-il.miss { background: transparent; box-shadow: none; } .dcm-il.miss .dc-rsub, .dcm-il.miss b { color: var(--text-muted); }
.dcm-il .dcm-pick { grid-column: 3 / -1; border-color: var(--stone); color: var(--text); font-weight: 500; }
.dcm-step b { background: var(--stone); color: var(--text); }
.dcm-addon b { color: var(--text-muted); }
@media (max-width: 899px) {
  .dcm-il { grid-template-columns: minmax(0, 1fr) auto 60px; } .dcm-il > .dcm-pc { display: none; } .dcm-il .dcm-pick { grid-column: 1 / -1; }
}

/* My profile — your own name and photo (Baha, 12 Nov; SQL 102) */
.avatar img, .dc-av img, .pf-pic img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.dc-av.has-img { background: var(--stone); overflow: hidden; }
.side-me { cursor: pointer; }
.side-me:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
.pf { display: flex; flex-direction: column; gap: 18px; }
.pf-top { display: flex; align-items: center; gap: 18px; }
.pf-pic { flex: none; width: 88px; height: 88px; border-radius: 50%; background: var(--olive); color: var(--on-ink); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 600; overflow: hidden; }
.pf-btns { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.pf-up { position: relative; min-height: 44px; display: inline-flex; align-items: center; cursor: pointer; }
.pf-file { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pf-note { margin: 0; font-size: var(--fs-small); color: var(--text-muted); }
.pf-rm { background: none; border: 0; padding: 6px 0; color: var(--text-muted); font: inherit; font-size: var(--fs-small); text-decoration: underline; cursor: pointer; }

/* Dish header (Baha, 12 Nov 21:33): the actions sit under the name, beside what they act on; the sign-off pill is alone on the right */
.dcm-actwrap { position: relative; margin-top: 6px; }
.dcm-actwrap .dcm-acts { justify-content: flex-start; }
.dcm-actwrap .dcm-menu { top: calc(100% + 8px); left: 0; right: auto; }
.dcm-side .dcm-who { align-self: flex-end; margin-top: 0; }
@media (max-width: 899px) { .dcm-side .dcm-who { align-self: flex-start; } .dcm-actwrap .dcm-menu { left: 0; right: 0; } }

/* Menu: picking its dishes (Baha, 12 Nov 21:47) — tappable rows with a tick, grouped by category, Save always in view */
.dcp { gap: 16px; }
.dcp-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; } .dcp-bar input { flex: 1; min-width: 200px; margin: 0; }
.dcp-list { max-height: min(46vh, 460px); overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); }
.dcp-cat { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--stone); font-size: var(--fs-tiny); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); }
.dcp-cat i { font-style: normal; font-weight: 400; letter-spacing: 0; text-transform: none; margin-left: 6px; }
.dcp-cat .link-action { font-size: var(--fs-small); letter-spacing: 0; text-transform: none; }
.dcp-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 48px; padding: 8px 16px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; font-size: var(--fs-body); text-align: left; cursor: pointer; }
.dcp-row:last-child { border-bottom: 0; } .dcp-row:hover { background: var(--input-row); } .dcp-row.on { background: var(--input-row); }
.dcp-tick { flex: none; width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--text-faint, var(--text-muted)); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--on-ink); background: var(--card); }
.dcp-row.on .dcp-tick { background: var(--olive); border-color: var(--olive); }
.dcp-name { flex: 1; min-width: 0; font-weight: 500; }
.dcp-gp { flex: none; font-size: var(--fs-label); color: var(--text-muted); } .dcp-gp.low { color: var(--bad); font-weight: 600; }
.dcp-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; } .dcp-foot .form-actions { margin: 0; }
.dcp-count { font-size: var(--fs-label); font-weight: 600; }

/* Check: both documents of a possible duplicate, side by side (Baha, 12 Nov 22:09) */
.ck-pair { display: flex; flex-direction: column; gap: 12px; }
.ck-pdoc { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ck-pdoc:hover { background: var(--input-row); }
.ck-pmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; } .ck-pmain b { font-size: var(--fs-body); font-weight: 600; } .ck-pmain span { font-size: var(--fs-small); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; }
.ck-pamt { font-weight: 600; } .ck-pgo { color: var(--olive); font-weight: 500; white-space: nowrap; }
