/* Chiba Surfboard Repairs — shared styles for the staff app and customer pages.
   Look: PU-foam white, ocean-slate ink, resin teal, masking-tape yellow job labels, ding-marker red. */

@font-face { font-family: 'Barlow Condensed'; src: url('/fonts/BarlowCondensed-SemiBold.woff') format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/fonts/BarlowCondensed-ExtraBold.woff') format('woff'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/fonts/Barlow-Regular.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/fonts/Barlow-SemiBold.woff') format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/fonts/Barlow-Bold.woff') format('woff'); font-weight: 700; font-display: swap; }

:root {
  --foam: #f4f7f8;
  --paper: #ffffff;
  --ink: #1b2a3a;
  --muted: #566676;
  --line: #d6dee4;
  --line-strong: #b6c3cd;
  --resin: #0d6a6f;
  --resin-dark: #09504f;
  --resin-wash: #e3f1f0;
  --tape: #f2c230;
  --tape-edge: #d9a915;
  --ding: #d7263d;
  --ding-wash: #fbe7ea;
  --wa: #157a43;
  --ln: #f29a1f;
  --ok: #1d7a3e;
  --ok-wash: #e4f3e8;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); font-size: 1.0625rem; line-height: 1.5; color: var(--ink); background: var(--foam); }
img { max-width: 100%; display: block; }
a { color: var(--resin); text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.05; letter-spacing: 0.005em; margin: 0 0 0.4em; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 0.8em; }
:focus-visible { outline: 3px solid var(--ln); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-line; }
.opt { color: var(--muted); font-weight: 400; font-size: 0.85em; }
.hp { position: absolute; left: -9999px; }
[hidden] { display: none !important; }

/* ---------- the tape label: the one loud element ---------- */
.tape {
  display: inline-block;
  font-family: var(--display); font-weight: 800; font-size: 1.15rem; letter-spacing: 0.04em;
  color: var(--ink); background: var(--tape);
  padding: 0.12em 0.7em 0.08em;
  transform: rotate(-1.6deg);
  clip-path: polygon(2% 8%, 0 50%, 3% 92%, 50% 100%, 97% 94%, 100% 52%, 98% 6%, 50% 0);
  box-shadow: inset 0 -2px 0 var(--tape-edge);
  white-space: nowrap;
}
.tape-sm { font-size: 0.95rem; padding: 0.06em 0.55em 0.02em; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45em;
  min-height: 44px; padding: 0.55em 1.05em;
  font: 700 1rem/1.2 var(--body); text-decoration: none; text-align: center;
  border: 2px solid transparent; border-radius: var(--r); cursor: pointer;
  background: var(--paper); color: var(--ink);
  touch-action: manipulation;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 1.2em; height: 1.2em; flex: none; }
.btn-primary { background: var(--resin); color: #fff; }
.btn-primary:hover { background: var(--resin-dark); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-ln { background: var(--ln); color: var(--ink); }
.btn-danger { background: transparent; border-color: var(--ding); color: var(--ding); }
.btn-lg { min-height: 52px; font-size: 1.08rem; padding: 0.7em 1.25em; }
.btn-sm { min-height: 36px; padding: 0.3em 0.75em; font-size: 0.92rem; }
.btn-block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* ---------- forms ---------- */
.form label, label.field { display: block; font-weight: 700; margin-bottom: 0.9rem; }
:where(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea) {
  display: block; width: 100%; margin-top: 0.3rem; padding: 0.65em 0.75em;
  font: 400 1rem/1.35 var(--body); color: var(--ink);
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--r-sm);
}
:where(input, select, textarea):focus { border-color: var(--resin); outline: none; box-shadow: 0 0 0 3px var(--resin-wash); }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
legend { font-family: var(--display); font-weight: 800; font-size: 1.3rem; margin-bottom: 0.5rem; padding: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.75rem; }
.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
.check input { width: 1.2rem; height: 1.2rem; accent-color: var(--resin); }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.1rem; margin-bottom: 1rem; }
.alert { padding: 0.8rem 1rem; border-radius: var(--r); margin: 0 0 1rem; font-weight: 700; }
.alert-error { background: var(--ding-wash); color: #8f1424; }
.alert-ok { background: var(--ok-wash); color: #14532b; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 0.4rem 0 0; }

/* ---------- progress rail (a real sequence, so it is numbered by position) ---------- */
.rail { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 0; margin: 0 0 1rem; }
.rail li { position: relative; padding-top: 14px; font-size: 0.72rem; line-height: 1.15; color: var(--muted); text-align: center; }
.rail li::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 8px; border-radius: 4px; background: var(--line); }
.rail li.done::before { background: var(--resin); }
.rail li.now::before { background: var(--tape); box-shadow: inset 0 -2px 0 var(--tape-edge); }
.rail li.now { color: var(--ink); font-weight: 700; }
.rail-off { opacity: 0.45; }
.status-now { font-size: 1.6rem; margin-bottom: 0.25em; }

/* ---------- quote table ---------- */
.quote { width: 100%; border-collapse: collapse; margin-bottom: 0.6rem; font-variant-numeric: tabular-nums; }
.quote th { text-align: left; font-size: 0.85rem; color: var(--muted); font-weight: 700; padding: 0.3rem 0; border-bottom: 2px solid var(--ink); }
.quote td { padding: 0.55rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.quote .num { text-align: right; white-space: nowrap; padding-left: 0.75rem; }
.quote tfoot td { border-bottom: 0; padding: 0.3rem 0; }
.quote tfoot .total td { font-weight: 700; font-size: 1.12rem; border-top: 2px solid var(--ink); padding-top: 0.5rem; }
.pin-no {
  display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; margin-right: 0.45rem;
  border-radius: 50%; background: var(--ding); color: #fff; font: 800 0.85rem/1 var(--display);
  vertical-align: 1px;
}

/* ---------- public pages ---------- */
.public { min-height: 100vh; display: flex; flex-direction: column; }
.pub-header { padding: 0.8rem 1rem; background: var(--ink); }
.wordmark { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; color: inherit; }
.wordmark strong { display: block; font: 800 1.6rem/0.9 var(--display); letter-spacing: 0.02em; }
.wordmark small { display: block; font: 600 0.85rem/1.1 var(--display); letter-spacing: 0.03em; opacity: 0.8; }
.pub-header .wordmark { color: #fff; }
.pub-main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 1.25rem 1rem 2rem; }
.pub-footer { padding: 1.25rem 1rem calc(1.5rem + var(--safe-b)); text-align: center; color: var(--muted); font-size: 0.88rem; border-top: 1px solid var(--line); }
.pub-footer p { margin: 0.15rem 0; }
.slogan { font-family: var(--display); font-weight: 800; font-size: 1.05rem; color: var(--ink); letter-spacing: 0.04em; }
.page-title { font-size: 2.3rem; }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 36em; }

.hero { padding: 1.5rem 0 1rem; }
.hero h1 { font-size: clamp(2.6rem, 11vw, 4.2rem); line-height: 0.95; margin-bottom: 0.35em; }
.hero .actions { margin-top: 1.2rem; }
.how { margin-top: 2rem; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 2.4rem 1fr; column-gap: 0.75rem; align-items: baseline; }
.steps li::before { content: counter(s); grid-row: span 2; font: 800 2rem/1 var(--display); color: var(--resin); }
.steps strong { font-size: 1.05rem; }
.steps span { color: var(--muted); }
.staff-link { margin-top: 3rem; text-align: center; font-size: 0.9rem; }

.job-head { margin-bottom: 1rem; }
.job-head .tape { margin-bottom: 0.6rem; }
.job-head h1 { font-size: 2rem; margin-bottom: 0.15em; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.5rem; margin-bottom: 1rem; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r); border: 1px solid var(--line); background: var(--line); }
.gallery figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.2rem; }
.doc-link { font-size: 0.95rem; }
.approve { border: 2px solid var(--resin); }
.decline { margin-top: 1rem; }
.decline summary { cursor: pointer; color: var(--muted); font-weight: 700; }
.decline form { margin-top: 0.75rem; }
.pay-options { display: grid; gap: 0.9rem; margin: 0.75rem 0; }
.paid-full { border: 2px solid var(--ok); background: var(--ok-wash); }
.timeline { list-style: none; padding: 0; margin: 0 0 1.5rem; border-left: 3px solid var(--line); }
.timeline li { padding: 0 0 0.8rem 1rem; position: relative; }
.timeline li::before { content: ''; position: absolute; left: -7.5px; top: 0.45rem; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 3px solid var(--resin); }
.timeline time { font-size: 0.82rem; color: var(--muted); }
.timeline p { margin: 0; }

.photo-pick .btn { display: inline-flex; margin: 0; }
.thumbs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--r-sm); }

.ln-card { text-align: center; }
.ln-amount { display: flex; flex-direction: column; gap: 0.1rem; }
.ln-amount strong { font: 800 2.2rem/1 var(--display); }
.ln-amount span { color: var(--muted); }
.qr { display: block; width: min(300px, 80vw); margin: 0.75rem auto; padding: 8px; background: #fff; border: 2px solid var(--ink); border-radius: var(--r); }
.qr svg { display: block; width: 100%; height: auto; }
.ln-state { font-weight: 700; }
.ln-state.paid { color: var(--ok); }
.ln-card .actions { justify-content: center; margin-bottom: 0.5rem; }

/* ---------- printable quote / invoice ---------- */
.doc { background: #e8edf0; }
.doc-tools { max-width: 800px; margin: 1rem auto; padding: 0 1rem; display: flex; gap: 0.5rem; }
.doc-page { max-width: 800px; margin: 0 auto 2rem; background: #fff; padding: 2rem; border-radius: var(--r); }
.doc-head { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; border-bottom: 3px solid var(--ink); padding-bottom: 1rem; margin-bottom: 1rem; }
.doc-head p { font-size: 0.9rem; color: var(--muted); margin: 0.6rem 0 0; }
.doc-meta { text-align: right; }
.doc-meta h1 { font-size: 2.4rem; margin: 0; }
.doc-meta dl { display: grid; grid-template-columns: auto auto; gap: 0.1rem 0.75rem; margin: 0.4rem 0 0; font-size: 0.92rem; }
.doc-meta dt { color: var(--muted); }
.doc-meta dd { margin: 0; font-weight: 700; }
.doc-to { display: grid; grid-template-columns: auto 1fr; gap: 0 1rem; margin-bottom: 1rem; }
.doc-to h2 { font-size: 1rem; color: var(--muted); margin: 0; }
.doc-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.5rem; margin: 1rem 0; }
.doc-photos img { border-radius: var(--r-sm); border: 1px solid var(--line); }
.terms { font-size: 0.85rem; color: var(--muted); }
@media print {
  .doc { background: #fff; }
  .doc-tools { display: none; }
  .doc-page { padding: 0; margin: 0; max-width: none; }
  .tape { box-shadow: none; }
}

/* ======================= staff app ======================= */
.app { min-height: 100vh; padding-bottom: calc(72px + var(--safe-b)); }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 0.6rem;
  min-height: 56px; padding: 0.4rem 0.75rem; background: var(--ink); color: #fff;
}
.topbar h1 { font-size: 1.4rem; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .icon-btn { color: #fff; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; background: transparent; border-radius: var(--r); cursor: pointer; color: var(--ink); }
.icon-btn svg { width: 24px; height: 24px; }
.view { max-width: 760px; margin: 0 auto; padding: 1rem 0.85rem 1.5rem; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding-bottom: var(--safe-b); background: var(--paper); border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; font-size: 0.75rem; font-weight: 700; color: var(--muted); text-decoration: none; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a[aria-current=page] { color: var(--resin); }
.tabbar .tab-book span { color: var(--ink); }
.tabbar .tab-book .plus { display: grid; place-items: center; width: 40px; height: 30px; border-radius: 9px; background: var(--tape); color: var(--ink); box-shadow: inset 0 -2px 0 var(--tape-edge); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.4rem; margin-bottom: 1rem; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 0.5rem 0.55rem; min-width: 0; }
.stat b { display: block; font: 800 1.45rem/1.05 var(--display); }
.stat span { display: block; font-size: 0.76rem; line-height: 1.2; color: var(--muted); }
.stat.warn b { color: var(--ding); }

.chips { display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 0.4rem; margin-bottom: 0.6rem; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; min-height: 36px; padding: 0.3em 0.85em; border-radius: 999px; border: 2px solid var(--line); background: var(--paper); font: 700 0.9rem var(--body); color: var(--ink); cursor: pointer; }
.chip[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .n { font-weight: 400; opacity: 0.75; margin-left: 0.25em; }
.search { position: relative; margin-bottom: 0.75rem; }
.search input { margin: 0; padding-left: 2.5rem; }
.search svg { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); }

.job-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.job-row {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 0.75rem; align-items: center;
  padding: 0.6rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  text-decoration: none; color: inherit;
}
.job-row:hover { border-color: var(--line-strong); }
.job-row .thumb { width: 64px; height: 64px; border-radius: var(--r-sm); object-fit: cover; background: var(--resin-wash); display: grid; place-items: center; color: var(--resin); }
.job-row .thumb svg { width: 30px; height: 30px; }
.job-row .who { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-row .what { color: var(--muted); font-size: 0.9rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-row .meta { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 0.3rem; }
.job-row .amt { font-weight: 700; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.job-row .tape { margin-bottom: 0.15rem; }
.badge { display: inline-block; padding: 0.15em 0.55em; border-radius: 999px; font-size: 0.75rem; font-weight: 700; background: var(--resin-wash); color: var(--resin-dark); white-space: nowrap; }
.badge[data-s=requested] { background: #fff3cf; color: #7a5800; }
.badge[data-s=quoted] { background: #e8eefc; color: #2b4a9a; }
.badge[data-s=ready] { background: var(--ok-wash); color: #14532b; }
.badge[data-s=declined], .badge[data-s=cancelled] { background: #eceff2; color: var(--muted); }
.badge.due { background: var(--ding-wash); color: #8f1424; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty h2 { color: var(--ink); }

.section { margin-bottom: 1.25rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }
.section-head h2 { margin: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.9rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.next-step { border: 2px solid var(--resin); background: var(--resin-wash); }
.next-step h2 { font-size: 1.25rem; }
.wa-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.photo-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 0.5rem; }
.photo-tile { position: relative; border: 0; padding: 0; background: var(--line); border-radius: var(--r); overflow: hidden; cursor: pointer; aspect-ratio: 1; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile .tag { position: absolute; left: 4px; bottom: 4px; font-size: 0.7rem; font-weight: 700; background: rgba(27, 42, 58, 0.85); color: #fff; padding: 1px 6px; border-radius: 4px; }
.photo-tile .tag.marked { background: var(--ding); }
.photo-add { display: grid; place-items: center; gap: 0.2rem; aspect-ratio: 1; border: 2px dashed var(--line-strong); border-radius: var(--r); color: var(--muted); font-weight: 700; font-size: 0.85rem; cursor: pointer; text-align: center; padding: 0.3rem; }
.photo-add svg { width: 28px; height: 28px; }

.items { list-style: none; margin: 0; padding: 0; }
.items li { display: grid; grid-template-columns: 1fr auto auto; gap: 0.5rem; align-items: center; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.items .desc { min-width: 0; }
.items .price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 0.2rem 1rem; margin-top: 0.6rem; font-variant-numeric: tabular-nums; }
.totals .big { font: 800 1.35rem var(--display); }
.totals dd, .totals dt { margin: 0; }
.totals dd { text-align: right; }
.balance-due { color: var(--ding); }

.pay-list { list-style: none; padding: 0; margin: 0; }
.pay-list li { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); align-items: center; }
.pay-list .st { font-size: 0.8rem; font-weight: 700; }
.pay-list .st[data-s=paid] { color: var(--ok); }
.pay-list .st[data-s=pending] { color: #8a6400; }
.pay-list .st[data-s=failed], .pay-list .st[data-s=expired], .pay-list .st[data-s=void] { color: var(--muted); text-decoration: line-through; }

.log { list-style: none; padding: 0; margin: 0; font-size: 0.92rem; }
.log li { padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.log time { display: block; font-size: 0.78rem; color: var(--muted); }
.log .private { font-size: 0.72rem; font-weight: 700; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 4px; margin-left: 0.3rem; }

/* bottom sheet dialogs */
dialog.sheet {
  width: 100%; max-width: 640px; max-height: 92vh; margin: auto auto 0; padding: 0;
  border: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--paper); color: var(--ink);
}
dialog.sheet::backdrop { background: rgba(27, 42, 58, 0.55); }
@media (min-width: 700px) { dialog.sheet { margin: auto; border-radius: var(--r-lg); } }
.sheet-head { position: sticky; top: 0; display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1rem; background: var(--paper); border-bottom: 1px solid var(--line); z-index: 2; }
.sheet-head h2 { flex: 1; margin: 0; font-size: 1.35rem; }
.sheet-body { padding: 1rem; padding-bottom: calc(1rem + var(--safe-b)); }
.preset-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.35rem; }
.preset-list button { width: 100%; display: flex; justify-content: space-between; gap: 0.75rem; text-align: left; padding: 0.65rem 0.75rem; border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--paper); font: 400 0.98rem var(--body); color: var(--ink); cursor: pointer; }
.preset-list button:hover { border-color: var(--resin); }
.preset-list b { white-space: nowrap; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translateX(-50%); z-index: 100; max-width: calc(100% - 2rem); padding: 0.7rem 1rem; border-radius: var(--r); background: var(--ink); color: #fff; font-weight: 700; box-shadow: 0 6px 24px rgba(27, 42, 58, 0.3); }
.toast.error { background: #8f1424; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: var(--ink); }
.login .card { width: 100%; max-width: 380px; }
.login .wordmark { margin-bottom: 1rem; }

/* ---------- ding markup editor (full screen) ---------- */
.markup { position: fixed; inset: 0; z-index: 200; display: grid; grid-template-rows: auto 1fr auto; background: #0f1a24; color: #fff; }
.markup-top, .markup-tools { display: flex; align-items: center; gap: 0.4rem; padding: 0.5rem 0.6rem; background: var(--ink); }
.markup-top h2 { flex: 1; margin: 0; font-size: 1.25rem; }
.markup-top .icon-btn { color: #fff; }
.markup-stage { position: relative; overflow: hidden; display: grid; place-items: center; touch-action: none; }
.markup-stage canvas { max-width: 100%; max-height: 100%; touch-action: none; }
.markup-tools { justify-content: space-between; padding-bottom: calc(0.5rem + var(--safe-b)); flex-wrap: wrap; }
.tool-group { display: flex; gap: 0.3rem; align-items: center; }
.tool { display: grid; place-items: center; min-width: 52px; height: 52px; padding: 0 0.4rem; border: 2px solid transparent; border-radius: var(--r); background: rgba(255,255,255,0.08); color: #fff; font: 700 0.72rem var(--body); cursor: pointer; }
.tool svg { width: 24px; height: 24px; }
.tool[aria-pressed=true] { border-color: var(--tape); background: rgba(242, 194, 48, 0.15); }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.25); cursor: pointer; padding: 0; }
.swatch[aria-pressed=true] { border-color: #fff; }
.markup-hint { position: absolute; top: 0.6rem; left: 50%; transform: translateX(-50%); background: rgba(27,42,58,0.85); padding: 0.35rem 0.75rem; border-radius: 999px; font-size: 0.85rem; pointer-events: none; white-space: nowrap; }

@media (min-width: 700px) {
  .view { padding-top: 1.5rem; }
}
@media (prefers-reduced-motion: no-preference) {
  dialog.sheet[open] { animation: rise 0.18s ease-out; }
  @keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
}
