/* Platform admin — the shell, sign-in/setup, the shops list, add-a-shop and the
   change log. Look and tokens copied from the approved mockup (app/mockups/platform-admin.html).
   One shop's page and billing live in shop.css, which uses the same tokens. */
:root {
  --f-display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --f-body: "IBM Plex Sans Thai", "Helvetica Neue", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
/* HERO POS's three looks (the owner's pick, app/mockups/pos-hq-look-options.html, version A). One
   token set per theme on <html data-hq-theme>; every screen is drawn through these tokens, so no
   screen has its own colours. app.js sets the attribute: the saved choice, or the device's
   (dark gives Night, light gives Day). Status colours keep their meaning in every theme:
   paid green, due amber, overdue red. */

/* Day: lavender page, white header, light cards, dark navy hero cards. Also the look before
   app.js has run. */
:root, :root[data-hq-theme="day"] {
  --page: linear-gradient(180deg, #ecebf8, #e4e3f4);
  --frame: rgba(255, 255, 255, .38); --frame-pad: 18px; --frame-r: 18px;
  --head: #ffffff; --head-ink: #17243f; --head-muted: #5b6785; --head-line: #dfe3ef;
  --tab-on: #c7ecf3; --tab-on-ink: #0d3a4a;
  --bg: #eef0f8; --panel: #f8f9fe; --card: #f8f9fe;
  --ink: #17243f; --muted: #5b6785; --line: #dfe3ef;
  --edge: #e3e7f2; --shadow: 0 8px 22px rgba(70, 70, 140, .12);
  --hero: linear-gradient(150deg, #19386b, #10264d); --hero-ink: #ffffff; --hero-muted: rgba(225, 235, 255, .74); --hero-edge: transparent;
  --brand: #2456c8; --brand-soft: #e2e9fb; --on-brand: #ffffff;
  --accent: #22c1d6; --accent2: #4f7ae8; --accent3: #1a8fc4; --c4: #8a6cf0; --c5: #12a07a; --on-accent: #04202a;
  --bar: #3a4766; --ghost: rgba(58, 71, 102, .10); --track: #e1e6f1;
  --shop: #b8431a; --shop-soft: #fbece4;
  --data: #6a3fa0; --data-soft: #efe8fa;
  --good: #0d7a57; --good-bg: #dcf3ea;
  --mid: #8f5d00;  --mid-bg: #fbefd2;
  --bad: #b3303b;  --bad-bg: #f9e0e2;
  --backdrop: rgba(23, 36, 63, .45);
  color-scheme: light;
}
/* Dusk: blue-grey page, a dark navy header strip, light cards, dark navy hero cards. */
:root[data-hq-theme="dusk"] {
  --page: #8f9dbb;
  --frame: #c3cde0; --frame-pad: 18px; --frame-r: 18px;
  --head: #13284d; --head-ink: #eaf1ff; --head-muted: #a9b9d8; --head-line: rgba(255, 255, 255, .22);
  --tab-on: rgba(31, 194, 214, .24); --tab-on-ink: #ffffff;
  --bg: #e1e7f2; --panel: #eef2f9; --card: #eef2f9;
  --ink: #17243f; --muted: #4c5a77; --line: #cfd7e6;
  --edge: #dde3ef; --shadow: 0 10px 24px rgba(20, 34, 70, .18);
  --hero: linear-gradient(150deg, #19386b, #10264d); --hero-ink: #ffffff; --hero-muted: rgba(225, 235, 255, .74); --hero-edge: transparent;
  --brand: #2456c8; --brand-soft: #dbe4f8; --on-brand: #ffffff;
  --accent: #1fc2d6; --accent2: #3e6fe0; --accent3: #1a8fc4; --c4: #8a6cf0; --c5: #13a77f; --on-accent: #04202a;
  --bar: #33415e; --ghost: rgba(51, 65, 94, .12); --track: #d6deeb;
  --shop: #a83d16; --shop-soft: #f8e6dc;
  --data: #62389a; --data-soft: #ebe3f8;
  --good: #0b7553; --good-bg: #d6efe5;
  --mid: #885800;  --mid-bg: #f8ebcb;
  --bad: #ad2c37;  --bad-bg: #f6dcdf;
  --backdrop: rgba(10, 20, 45, .5);
  color-scheme: light;
}
/* Night: dark navy with glowing edges and a cyan accent. */
:root[data-hq-theme="night"] {
  --page: radial-gradient(120% 90% at 30% 0%, #0f3566 0%, #081d3b 45%, #050f22 100%);
  --frame: transparent; --frame-pad: 0px; --frame-r: 0px;
  --head: rgba(6, 20, 44, .82); --head-ink: #e6f1ff; --head-muted: #8fa9cc; --head-line: rgba(120, 180, 240, .35);
  --tab-on: rgba(47, 220, 236, .18); --tab-on-ink: #e6f1ff;
  --bg: #0a1d3a; --panel: #0f2a4f; --card: linear-gradient(160deg, #0f2a4f, #0a1f3d);
  --ink: #e6f1ff; --muted: #93abcd; --line: rgba(84, 160, 230, .24);
  --edge: rgba(84, 170, 240, .3); --shadow: 0 0 0 1px rgba(40, 120, 200, .15), 0 12px 30px rgba(0, 8, 30, .55), inset 0 1px 0 rgba(130, 200, 255, .08);
  --hero: linear-gradient(150deg, #13427d, #0b2a55 60%, #0a2149); --hero-ink: #ffffff; --hero-muted: rgba(220, 235, 255, .74); --hero-edge: rgba(84, 170, 240, .35);
  --brand: #2fdcec; --brand-soft: rgba(47, 220, 236, .14); --on-brand: #04202a;
  --accent: #2fdcec; --accent2: #4d7dff; --accent3: #1f9fd6; --c4: #a17cff; --c5: #35e0b0; --on-accent: #04202a;
  --bar: #3a5578; --ghost: rgba(120, 160, 210, .16); --track: rgba(130, 170, 220, .18);
  --shop: #f5a173; --shop-soft: rgba(245, 161, 115, .14);
  --data: #c9adf5; --data-soft: rgba(201, 173, 245, .13);
  --good: #35e0b0; --good-bg: rgba(53, 224, 176, .14);
  --mid: #f2c14e;  --mid-bg: rgba(242, 193, 78, .14);
  --bad: #ff8a93;  --bad-bg: rgba(255, 122, 133, .15);
  --backdrop: rgba(2, 8, 20, .7);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) { :root:not([data-hq-theme]) {
  --page: radial-gradient(120% 90% at 30% 0%, #0f3566 0%, #081d3b 45%, #050f22 100%);
  --frame: transparent; --frame-pad: 0px; --frame-r: 0px;
  --head: rgba(6, 20, 44, .82); --head-ink: #e6f1ff; --head-muted: #8fa9cc; --head-line: rgba(120, 180, 240, .35);
  --tab-on: rgba(47, 220, 236, .18); --tab-on-ink: #e6f1ff;
  --bg: #0a1d3a; --panel: #0f2a4f; --card: linear-gradient(160deg, #0f2a4f, #0a1f3d);
  --ink: #e6f1ff; --muted: #93abcd; --line: rgba(84, 160, 230, .24);
  --edge: rgba(84, 170, 240, .3); --shadow: 0 0 0 1px rgba(40, 120, 200, .15), 0 12px 30px rgba(0, 8, 30, .55), inset 0 1px 0 rgba(130, 200, 255, .08);
  --hero: linear-gradient(150deg, #13427d, #0b2a55 60%, #0a2149); --hero-ink: #ffffff; --hero-muted: rgba(220, 235, 255, .74); --hero-edge: rgba(84, 170, 240, .35);
  --brand: #2fdcec; --brand-soft: rgba(47, 220, 236, .14); --on-brand: #04202a;
  --accent: #2fdcec; --accent2: #4d7dff; --accent3: #1f9fd6; --c4: #a17cff; --c5: #35e0b0; --on-accent: #04202a;
  --bar: #3a5578; --ghost: rgba(120, 160, 210, .16); --track: rgba(130, 170, 220, .18);
  --shop: #f5a173; --shop-soft: rgba(245, 161, 115, .14);
  --data: #c9adf5; --data-soft: rgba(201, 173, 245, .13);
  --good: #35e0b0; --good-bg: rgba(53, 224, 176, .14);
  --mid: #f2c14e;  --mid-bg: rgba(242, 193, 78, .14);
  --bad: #ff8a93;  --bad-bg: rgba(255, 122, 133, .15);
  --backdrop: rgba(2, 8, 20, .7);
  color-scheme: dark;
} }

* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
html { background: var(--page); min-height: 100% }
body { margin: 0; background: transparent; color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.55; min-height: 100vh; overflow-x: hidden }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; line-height: 1.15 }
h2 { font-size: 20px }
h3 { font-size: 16px }
p { margin: 0; max-width: 70ch }
code, .mono { font-family: var(--f-mono); font-size: .88em }
.hint, .small { font-size: 12.5px; color: var(--muted) }
.eyebrow { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600 }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); padding: 16px; text-align: center }

/* buttons, inputs */
.btn { all: unset; box-sizing: border-box; cursor: pointer; font-size: 13px; font-weight: 600; padding: 7px 13px; border-radius: 8px; border: 1px solid var(--line); color: var(--ink); background: var(--panel); text-align: center; white-space: nowrap }
.btn:hover { border-color: var(--muted) }
.btn:focus-visible, .linkbtn:focus-visible, .row:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px }
.btn.pri { background: var(--brand); border-color: var(--brand); color: var(--on-brand) }
.btn.danger { border-color: var(--bad); color: var(--bad); background: transparent }
.btn[disabled] { opacity: .45; cursor: not-allowed }
.linkbtn { all: unset; cursor: pointer; color: var(--brand); font-size: 12.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px }
label.f { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; min-width: 0 }
input, select, textarea { font: inherit; font-size: 15px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0 }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand) }
input.code6 { font-family: var(--f-mono); font-size: 22px; letter-spacing: .35em; text-align: center; padding: 8px 4px }
.addr-in { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); min-width: 0 }
.addr-in:focus-within { outline: 2px solid var(--brand); border-color: var(--brand) }
.addr-in input { border: 0; border-radius: 8px 0 0 8px; flex: 1 1 auto; outline: none }
.addr-in input:focus-visible { outline: none }
.addr-tail { display: flex; align-items: center; padding: 0 10px; font-size: 15px; font-weight: 500; color: var(--muted); white-space: nowrap }
.err { color: var(--bad); font-size: 12.5px; font-weight: 600 }
.err:empty { display: none }
.okmsg { color: var(--good); background: var(--good-bg); border-radius: 8px; padding: 8px 12px; font-size: 13px }
.okmsg:empty { display: none }

/* the shell */
/* The app sits in a framed window in Dusk and Day (header strip on top, a soft panel under it),
   and fills the page in Night. On a phone it always fills the page. */
.hq { padding: var(--frame-pad) var(--frame-pad) var(--frame-pad); max-width: 1680px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column }
.ahead { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px 22px; padding: 12px 24px; min-height: 64px; background: var(--head); color: var(--head-ink);
  border-radius: var(--frame-r) var(--frame-r) 0 0; flex-wrap: wrap; box-shadow: var(--shadow); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px) }
:root[data-hq-theme="night"] .ahead { box-shadow: 0 1px 0 var(--line) }
.brandmark { display: flex; gap: 10px; align-items: center; font-family: var(--f-display); font-weight: 700; font-size: 18px; color: inherit; text-decoration: none; white-space: nowrap }
a.brandmark:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px }
.logo { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: var(--on-brand); font-size: 12px; font-weight: 700; font-family: var(--f-display); flex: none }
.logo.mark { width: 30px; height: 30px; border-radius: 9px; font-size: 15px; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff }
.heromark { display: inline-flex; flex: none; height: 40px }
.heromark img { height: 100%; width: auto }
.heromark .hm-dark { display: none }
:root[data-hq-theme="dusk"] .heromark .hm-light, :root[data-hq-theme="night"] .heromark .hm-light { display: none }
:root[data-hq-theme="dusk"] .heromark .hm-dark, :root[data-hq-theme="night"] .heromark .hm-dark { display: block }
@media (prefers-color-scheme: dark) { :root:not([data-hq-theme]) .heromark .hm-light { display: none } :root:not([data-hq-theme]) .heromark .hm-dark { display: block } }
.auth .heromark { height: 72px }
/* the sign-in card's top is always the dark hero colour: cream letters there on every theme */
.authhero .heromark .hm-light { display: none !important } .authhero .heromark .hm-dark { display: block !important }
.tabs { display: flex; gap: 8px; min-width: 0 }
.tabs a { padding: 6px 16px; border-radius: 999px; border: 1px solid var(--head-line); font-size: 13px; color: inherit; text-decoration: none; white-space: nowrap }
.tabs a:hover { border-color: var(--accent) }
.tabs a[aria-current="page"] { background: var(--tab-on); color: var(--tab-on-ink); border-color: var(--accent); font-weight: 600 }
.tabs a:focus-visible, .years a:focus-visible, .modes .mode:focus-visible, .ahead .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.years { margin-left: auto; display: flex; gap: 4px; font-size: 13px; font-variant-numeric: tabular-nums }
.years a { color: var(--head-muted); text-decoration: none; padding: 4px 8px; border-radius: 8px }
.years a:hover { color: var(--head-ink) }
.years a[aria-current="true"] { color: var(--accent); font-weight: 700 }
:root[data-hq-theme="day"] .years a[aria-current="true"] { color: var(--head-ink) }
.modes { display: flex; gap: 2px }
.modes .mode { all: unset; cursor: pointer; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: inherit; opacity: .7 }
.modes .mode:hover { opacity: 1 }
.modes .mode[aria-pressed="true"] { color: var(--accent); opacity: 1 }
:root[data-hq-theme="day"] .modes .mode[aria-pressed="true"] { color: var(--brand) }
.modes svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round }
.ahead .btn.so { background: transparent; color: inherit; border-color: var(--head-line) }
.ahead .btn.so:hover { border-color: var(--accent) }
.abody { display: grid; grid-template-columns: minmax(0, 1fr); flex: 1; background: var(--frame); border-radius: 0 0 var(--frame-r) var(--frame-r); min-width: 0 }
@media (max-width: 1100px) { .years { margin-left: 0 } .tabs { order: 5; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; padding: 2px } .ahead .brandmark { margin-right: auto } }
@media (max-width: 760px) {
  :root { --frame-pad: 0px !important; --frame-r: 0px !important }
  .abody { min-height: 0 }
  .ahead { padding: 10px 16px; gap: 8px 10px; min-height: 0 }
  .ahead .brandmark { font-size: 16px }
  .tabs a { padding: 5px 13px }
  .years a { padding: 4px 5px }
  .modes .mode { width: 30px; height: 30px }
}
@media (max-width: 420px) { .years a:not([aria-current]) { display: none } .ahead .btn.so { padding: 7px 9px } }

/* status dots and the yellow flag (the Shops screen's cards and legend) */
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted) }
.dot.paid { background: var(--good) } .dot.due { background: var(--mid) } .dot.over { background: var(--bad) }
.dot.ns, .dot.none, .dot.ended { background: transparent; border: 2px solid var(--muted) }
.flag { width: 7px; height: 7px; border-radius: 50%; background: var(--mid); flex: none; box-shadow: 0 0 0 2px var(--mid-bg) }
.legend { display: grid; gap: 3px; font-size: 11.5px; color: var(--muted); padding: 6px 8px 0 }
.legend span { display: flex; gap: 6px; align-items: center }
.legend .dot { width: 8px; height: 8px }
.legend .dot.ns { border-width: 1.5px }

.detail { padding: 22px 24px; display: grid; gap: 18px; align-content: start; min-width: 0 }
@media (max-width: 520px) { .detail { padding: 14px 16px } }
.loading { color: var(--muted); font-size: 14px }

/* status pills (statusPill() in format.js) — full rules on the tone classes, so a plainer
   .pill elsewhere (shop.css price tags) can't shrink them */
.pill.good, .pill.warn, .pill.bad, .pill.quiet { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: normal; line-height: 1.3; border: 1px solid transparent }
.pill.good { background: var(--good-bg); color: var(--good) }
.pill.warn { background: var(--mid-bg); color: var(--mid) }
.pill.bad { background: var(--bad-bg); color: var(--bad) }
.pill.quiet { background: var(--bg); color: var(--muted); border-color: var(--line) }
.paused { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 9px; border-radius: 6px; background: var(--ink); color: var(--panel); white-space: nowrap }
.paused::before { content: ""; width: 7px; height: 9px; border-left: 2.5px solid currentColor; border-right: 2.5px solid currentColor; box-sizing: border-box }
.paused.sm { font-size: 10px; padding: 2px 6px }
.paused.sm::before { width: 6px; height: 7px; border-width: 2px }
.statepill { font-size: 12px; font-weight: 600; color: var(--good) }

/* shops list */
.lhead { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap }
.lhead > div { display: grid; gap: 4px; min-width: 0 }
.row { all: unset; box-sizing: border-box; cursor: pointer; display: grid }
.row:hover { background: var(--bg) }
.list { display: grid; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel) }
.nodata { font-size: 13px; color: var(--muted); background: var(--panel); border: 1px dashed var(--line); border-radius: 10px; padding: 14px }
.toast { font-size: 12.5px; color: var(--shop); background: var(--shop-soft); border-radius: 8px; padding: 8px 12px }

/* change log */
.log { display: grid; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel) }
.lg { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 4px 14px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13.5px }
.lg:first-child { border-top: 0 }
.lg time { font-family: var(--f-mono); font-size: 12px; color: var(--muted) }
.lg .w { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere }
.lg .w small { color: var(--muted); font-size: 12px }
.lg .ba { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere }
.lg .ba s { color: var(--bad); text-decoration-thickness: 1px } .lg .ba ins { color: var(--good); text-decoration: none; font-weight: 600 }
.lg .empty { grid-column: 1 / -1 }
@media (max-width: 520px) { .lg { grid-template-columns: minmax(0, 1fr) } }
.logf { min-width: 180px }
@media (max-width: 520px) { .logf { min-width: 0; width: 100% } }

/* sign in / setup */
.auth { display: grid; place-items: center; padding: 32px 16px; min-height: 100vh; position: relative }
.auth .themecorner { position: absolute; top: 12px; right: 16px }
.authcard { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px; display: grid; gap: 14px }
@media (max-width: 420px) { .authcard { padding: 18px 14px } }
.authcard.wide { max-width: 560px }
.authcard h2 { font-size: 22px }
.stepn { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start }
.stepn > i { font-style: normal; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-family: var(--f-display); font-size: 14px }
.stepn > i.ok { background: var(--good-bg); color: var(--good) }
.stepn > div { display: grid; gap: 8px; min-width: 0 }
.qrrow { display: flex; gap: 14px; align-items: center; flex-wrap: wrap }
.qr { width: 240px; height: 240px; max-width: 100%; flex: none; border-radius: 10px; background: #fff; border: 1px solid var(--line); padding: 4px; display: grid; place-items: center }
.qr img { width: 100%; height: 100%; display: block; image-rendering: pixelated }
.secret { font-family: var(--f-mono); font-size: 13px; background: var(--bg); border-radius: 6px; padding: 4px 8px; overflow-wrap: anywhere; user-select: all }
.meter { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden }
.meter span { display: block; height: 100%; background: var(--mid); width: 0; transition: width .2s }
.meter span.ok { background: var(--good) }
@media (prefers-reduced-motion: reduce) { .meter span { transition: none } }

/* dialog */
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--panel); color: var(--ink); width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px) }
dialog::backdrop { background: var(--backdrop) }
.dlg { padding: 20px; display: grid; gap: 14px }
.dlg h2 { font-size: 20px }
.dacts { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap }

/* ---- round 2: backup banner, money summary, ending-soon pill, checklist ring ---- */
.bkbanner { display: flex; gap: 8px; align-items: baseline; padding: 8px 16px; font-size: 13px; background: var(--mid-bg); color: var(--mid); border-bottom: 1px solid var(--line) }
.bkbanner a { color: inherit; font-weight: 700; text-underline-offset: 2px }
.bkbanner a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px }


.msum { display: grid; gap: 8px }
.mcards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px }
.mcards.five { grid-template-columns: repeat(5, minmax(0, 1fr)) }   /* with Deposits held */
@media (max-width: 860px) { .mcards, .mcards.five { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
.mcard { display: grid; gap: 2px; align-content: start; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0 }
.mcard .ml { font-size: 12px; color: var(--muted); font-weight: 600 }
.mcard b { font-family: var(--f-display); font-size: 22px; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere }
.mcard b.g { color: var(--good) } .mcard b.w { color: var(--mid) } .mcard b.r { color: var(--bad) }
.mcard .mx { font-size: 11.5px; color: var(--muted) }
a.mlink { color: inherit; text-decoration: none; cursor: pointer }
a.mlink .mx { color: var(--brand); text-decoration: underline; text-underline-offset: 2px }
a.mlink:hover { border-color: var(--muted) }
a.mlink.on, a.mchip.on { border-color: var(--brand); background: var(--brand-soft) }
a.mlink:focus-visible, a.mchip:focus-visible, .fnote a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px }
.mmini { display: flex; gap: 8px; flex-wrap: wrap; max-width: none }
a.mchip { font-size: 12.5px; color: var(--ink); text-decoration: none; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 3px 11px }
a.mchip:hover { border-color: var(--muted) }
.fnote { font-size: 13px; color: var(--muted) }
.fnote a { color: var(--brand); font-weight: 600 }
.pill.warn.ending { font-size: 11.5px }
.ring { flex: none; display: block }
.ring circle { fill: none; stroke-width: 2.5 }
.ring .rt { stroke: var(--line) }
.ring .rf { stroke: var(--brand); stroke-linecap: round }

/* ---- round 2: the Settings page ---- */
.card.setc, .card.rec-sec { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 12px; min-width: 0 }
@media (max-width: 420px) { .card.setc, .card.rec-sec { padding: 14px 12px } }
.setgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px }
.setgrid.two { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) }
@media (max-width: 520px) { .setgrid, .setgrid.two { grid-template-columns: minmax(0, 1fr) } }
.setc .f, .rec .f { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; min-width: 0 }
.flabel { font-size: 12.5px; color: var(--muted); font-weight: 600 }
.setc textarea { resize: vertical; line-height: 1.5 }
.setc .linkbtn { justify-self: start }
.setacts { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap }
.setacts.left { justify-content: flex-start }
.setacts .okmsg { margin-right: auto }
.setacts a.btn { text-decoration: none }
.setrow { display: flex; gap: 8px; align-items: center }
.phs { font-size: 13px }
.phs summary { cursor: pointer; color: var(--brand); font-weight: 600 }
.phs ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 2px; color: var(--muted) }
.bkstate { margin: 0; display: grid; gap: 6px }
.bkstate > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; font-size: 13.5px; align-items: baseline }
.bkstate dt { color: var(--muted); font-size: 12.5px; font-weight: 600 }
.bkstate dd { margin: 0; overflow-wrap: anywhere }
p.okmsg { max-width: none }

/* ---- round 2: the shop's records (records.js) ---- */
.rec { display: grid; gap: 18px; min-width: 0 }
.rec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap }
.rec-list, .rec-cklist, .rec-notes { list-style: none; margin: 0; padding: 0; display: grid }
.rec-doc { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line) }
.rec-doc:first-child { border-top: 0 }
.rec-dico { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; background: var(--brand-soft); color: var(--brand) }
.rec-dmain { display: grid; gap: 1px; min-width: 0 }
.rec-dmain a { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; text-underline-offset: 2px }
.rec-dmain a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px }
.rec-dmain small { color: var(--muted); font-size: 12px }
.rec-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap }
.rec-form .f { flex: 1 1 180px }
.rec-form .err { flex-basis: 100% }
.rec-form .rec-text { flex: 3 1 260px }
.rec [hidden], .setc [hidden] { display: none !important }
.rec-form input[type="file"] { padding: 6px; font-size: 13px }
.rec-count { font-size: 13px; font-weight: 700; color: var(--mid) }
.rec-count.all { color: var(--good) }
.rec-bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden }
.rec-bar span { display: block; height: 100%; background: var(--brand) }
.rec-ck { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); flex-wrap: wrap }
.rec-ck:first-child { border-top: 0 }
.rec-ck input, .sp .rec-ck input { width: 20px; height: 20px; flex: none; accent-color: var(--brand); margin: 0 }
.rec-ck label { font-size: 14px; flex: 1 1 140px; min-width: 0; cursor: pointer }
.rec-ck.done label { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--muted) }
.rec-ck small { font-size: 12px; color: var(--good) }
.rec-note { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--line) }
.rec-note:first-child { border-top: 0 }
.rec-nico { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: var(--muted); font-size: 15px; border: 1px solid var(--line) }
.rec-note.k-call .rec-nico { color: var(--brand); background: var(--brand-soft); border-color: transparent }
.rec-note.k-visit .rec-nico { color: var(--shop); background: var(--shop-soft); border-color: transparent }
.rec-note.k-promise .rec-nico { color: var(--mid); background: var(--mid-bg); border-color: transparent; font-weight: 700 }
.rec-note.rec-open { background: var(--bad-bg); border-radius: 10px; padding: 10px; border-top-color: transparent }
.rec-note.rec-open + .rec-note { border-top-color: transparent }
.rec-note.rec-open .rec-nico { color: var(--bad); background: var(--panel) }
.rec-nbody { display: grid; gap: 3px; min-width: 0 }
.rec-nmeta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px }
.rec-nmeta time { color: var(--muted); font-size: 12px; font-family: var(--f-mono) }
.rec-nbody p { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere }

/* ---- HERO POS look: every boxed surface takes the theme's card (glow edge in Night, soft
   shadow in Dusk and Day). Listed here once so the screens keep their own markup. ---- */
.list, .log, .mcard, .authcard, .card.setc, .card.rec-sec, dialog { background: var(--card); border: 1px solid var(--edge); box-shadow: var(--shadow); border-radius: 16px }
.mcard { border-radius: 14px }
.nodata { background: var(--card); border-radius: 14px }
.auth .themecorner { color: var(--ink) }
.auth .brandmark { font-size: 18px }
.authh { font-size: 22px }
.lhead h2, .ov-top h2 { font-size: 22px }
a.mlink.on, a.mchip.on { border-color: var(--accent) }
.auth .modes .mode[aria-pressed="true"] { color: var(--brand) }
