/* Order Hub · Petal & Co
   Palette: cream, blush, sage, deep berry. Soft rounded cards, pill chips,
   round icon buttons, colour-blocked tiles. */

@font-face { font-family: 'Fraunces'; font-weight: 500; font-display: swap; src: url('fonts/fraunces-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-weight: 400; font-style: italic; font-display: swap; src: url('fonts/fraunces-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('fonts/inter-latin-600-normal.woff2') format('woff2'); }

:root {
  --canvas: #f4eee6;
  --surface: #ffffff;
  --soft: #f8ede8;
  --ink: #2f1e26;
  --muted: #7d6770;
  --line: #efe2dd;
  --accent: #7a2e4a;
  --on-accent: #fff7f3;
  --sage: #d6e2c6;
  --blush: #f6d3d6;
  --cream: #fbf1e6;
  --warn: #b5522f;
  --warn-soft: #fbe3d6;
  --ok: #4d6b3c;
  --grad: linear-gradient(100deg, #d3e0c1 0%, #ead9cf 50%, #f5cfd4 100%);
  --mesh: radial-gradient(60% 70% at 85% 15%, #f4c6cf 0%, transparent 60%),
    radial-gradient(70% 80% at 10% 90%, #cfdcbf 0%, transparent 60%),
    linear-gradient(160deg, #fdf8f1, #f6ebe4);
  --shadow: 0 1px 2px rgb(47 30 38 / 0.04), 0 8px 24px -12px rgb(47 30 38 / 0.14);
  --shadow-lift: 0 2px 4px rgb(47 30 38 / 0.05), 0 24px 48px -20px rgb(47 30 38 / 0.32);
  --display: 'Fraunces', Georgia, serif;
  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --r-card: 26px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }
h1, h2, h3, p { margin: 0; }
.display { font-family: var(--display); font-weight: 500; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.wrap-any { overflow-wrap: anywhere; }
.tb-left .only-mobile { display: none; }
svg.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; margin: 16px 0 16px 16px; height: calc(100dvh - 32px);
  background: var(--surface); border-radius: 28px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; padding: 22px 16px;
}
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--grad); color: var(--accent); font: 500 20px var(--display); flex: none; }
.mark-sm { width: 34px; height: 34px; font-size: 17px; }
.sb-name { font: 500 19px/1.1 var(--display); letter-spacing: -0.02em; }
.sb-sub { font-size: 11.5px; color: var(--muted); }
.sb-new { margin: 20px 4px 6px; }
.sb-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 6px 12px 6px 6px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-size: 14px;
}
.nav-link .nav-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; }
.nav-link:hover { color: var(--ink); }
.nav-link[aria-current='page'] { background: var(--canvas); color: var(--ink); font-weight: 600; }
.nav-link[aria-current='page'] .nav-ic { background: var(--grad); color: var(--accent); }
.nav-count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 11.5px; font-weight: 600; text-align: center; }
.sb-foot { margin-top: auto; padding: 16px; border-radius: 22px; background: var(--mesh); font-size: 12px; color: var(--muted); line-height: 1.5; }
.sb-foot-t { font: 500 16px var(--display); color: var(--ink); margin-bottom: 4px; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 40px 14px; background: color-mix(in srgb, var(--canvas) 85%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.tb-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tb-title { font: 500 15px var(--sans); }
.tb-date { font-size: 12px; color: var(--muted); }
.tb-right { display: flex; align-items: center; gap: 10px; }
.demo-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-size: 11.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.demo-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.lang { display: flex; padding: 3px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); }
.lang button { border: 0; background: none; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.lang button[aria-checked='true'] { background: var(--grad); color: var(--ink); }

.view { width: 100%; max-width: 1140px; margin: 0 auto; padding: 8px 40px 40px; outline: none; }
.foot { text-align: center; font-size: 12px; color: var(--muted); padding: 24px 16px 40px; }

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.h1 { font: 500 42px/1.05 var(--display); letter-spacing: -0.02em; margin-top: 6px; }
.lede { margin-top: 6px; color: var(--muted); max-width: 620px; }

/* ---------- Cards, tiles ---------- */
.card { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-title { font-size: 16px; font-weight: 600; }
.mesh { background: var(--mesh); border-radius: 28px; padding: 24px; position: relative; overflow: hidden; }
.glass { background: rgb(255 255 255 / 0.55); border: 1px solid rgb(255 255 255 / 0.7); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile { position: relative; border-radius: 24px; padding: 16px; min-height: 124px; border: 0; text-align: left; text-decoration: none; color: inherit; display: block; transition: transform 0.2s ease; }
.tile:hover { transform: translateY(-2px); }
.tile-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgb(255 255 255 / 0.7); color: var(--accent); }
.tile-go { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.tile-go svg.ic { width: 14px; height: 14px; }
.tile-label { margin-top: 18px; font-size: 12px; color: rgb(47 30 38 / 0.7); }
.tile-num { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.t-sage { background: var(--sage); }
.t-blush { background: var(--blush); }
.t-cream { background: var(--cream); }
.t-white { background: var(--surface); box-shadow: var(--shadow); }

/* ---------- Buttons, chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--soft); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: #6a2640; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--accent); padding-left: 8px; padding-right: 8px; }
.btn-danger { color: var(--warn); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-grad { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 6px 6px 20px; border: 0; border-radius: 999px; background: var(--grad); color: var(--ink); font-weight: 600; font-size: 14.5px; box-shadow: var(--shadow); }
.btn-grad-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); flex: none; }
.icon-btn:hover { background: var(--soft); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap;
}
.chip:hover { color: var(--ink); }
.chip[aria-pressed='true'] { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 8%, transparent); }
.chip .n { padding: 0 6px; border-radius: 999px; background: var(--canvas); font-size: 11px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.p-new { background: var(--blush); color: var(--accent); }
.p-confirmed { background: var(--cream); color: var(--ink); }
.p-prep { background: #efe6f4; color: #5b3c6e; }
.p-ready { background: var(--sage); color: var(--ok); }
.p-out { background: #e4ecf2; color: #34556b; }
.p-done { background: var(--canvas); color: var(--muted); }
.p-warn { background: var(--warn-soft); color: var(--warn); }
.p-ok { background: var(--sage); color: var(--ok); }
.p-muted { background: var(--canvas); color: var(--muted); }

/* ---------- Lists ---------- */
.rows { display: flex; flex-direction: column; gap: 10px; }
.row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px 12px 12px;
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); border: 0; text-align: left; width: 100%;
}
.row:hover { box-shadow: var(--shadow-lift); }
.row:has(.row-thumb) { grid-template-columns: auto auto minmax(0, 1fr) auto; }
.row-thumb, .dh-photo { display: grid; place-items: center; color: var(--muted); flex: none; }
.row-thumb { width: 50px; height: 50px; border-radius: 14px; }
/* Product photos have transparent backgrounds: the bouquet stands on its own, no tile behind it. */
.row-thumb img, .dh-photo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.dh-main { display: flex; gap: 14px; align-items: center; min-width: 0; }
.dh-text { min-width: 0; }
.dh-photo { width: 84px; height: 84px; border-radius: 20px; }
.row-date { display: grid; place-items: center; width: 54px; padding: 7px 0; border-radius: 16px; background: var(--canvas); line-height: 1.1; text-align: center; }
.row-date .d { font-size: 20px; font-weight: 600; }
.row-date .w { font-size: 10px; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.row-date.today { background: var(--accent); color: var(--on-accent); }
.row-date.today .w { color: inherit; opacity: 0.8; }
.row-main { min-width: 0; }
.row-title { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.row-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.price { font-weight: 600; font-variant-numeric: tabular-nums; }
.issues { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain > li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.list-plain > li:first-child { border-top: 0; }

/* attention list */
.att { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.att:first-child { border-top: 0; }
.att-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--warn-soft); color: var(--warn); }
.att-dot.ok { background: var(--sage); color: var(--ok); }
.att-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* tally */
.tally { width: 100%; border-collapse: collapse; font-size: 14px; }
.tally th { text-align: left; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 0 0 8px; }
.tally td { padding: 9px 0; border-top: 1px solid var(--line); }
.tally td.qty { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.tally th.qty { text-align: right; }
.bar { height: 8px; border-radius: 999px; background: var(--canvas); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.6s ease; }

/* prep cards */
.prep { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.prep-card { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.prep-card h3 { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.recipe { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.recipe li { padding: 3px 10px; border-radius: 999px; background: var(--canvas); font-size: 12.5px; }
.card-msg { margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: var(--cream); font: italic 400 14.5px/1.45 var(--display); overflow-wrap: anywhere; white-space: pre-wrap; }
.card-msg.missing { background: var(--warn-soft); color: var(--warn); font: 600 13px var(--sans); }

/* runs */
.run { margin-bottom: 22px; }
.run-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.run-name { font: 600 21px/1.2 var(--sans); letter-spacing: -0.02em; }

/* peak */
.camp { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.big-num { font: 500 54px/1 var(--display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.field-inline { display: flex; align-items: center; gap: 8px; }
.field-inline input { width: 90px; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 14px; }
.form-section { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.f-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.f-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; }
.field .opt { font-weight: 400; color: var(--muted); }
.input, .field input:not([type='checkbox']), .field select, .field textarea {
  width: 100%; padding: 10px 13px; border-radius: 14px; border: 1px solid var(--line); background: var(--canvas); font-size: 15px; color: var(--ink);
}
.field textarea { resize: vertical; min-height: 70px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--surface); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--warn); background: #fff8f4; }
.field .err { font-size: 12px; color: var(--warn); font-weight: 500; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.form-alert { padding: 10px 14px; border-radius: 14px; background: var(--warn-soft); color: var(--warn); font-size: 13.5px; font-weight: 500; }
.form-note { padding: 10px 14px; border-radius: 14px; background: var(--cream); font-size: 13px; color: var(--muted); }

/* ---------- Overlays ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgb(47 30 38 / 0.32); backdrop-filter: blur(3px); animation: fade 0.2s ease both; }
.modal {
  position: fixed; z-index: 61; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(680px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  overflow-y: auto; background: var(--canvas); border-radius: 28px; box-shadow: var(--shadow-lift); padding: 24px; animation: pop 0.25s ease both;
}
.modal-head, .drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.modal-title { font: 500 28px/1.1 var(--display); letter-spacing: -0.02em; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.drawer {
  position: fixed; z-index: 61; top: 12px; right: 12px; bottom: 12px; width: min(460px, calc(100vw - 24px)); overflow-y: auto; overflow-x: hidden;
  background: var(--canvas); border-radius: 28px; box-shadow: var(--shadow-lift); padding: 22px; animation: slide 0.28s cubic-bezier(.2,.7,.2,1) both;
}
.dbody { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.kv { margin: 0; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.stepper { display: flex; flex-wrap: wrap; gap: 6px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 12px 18px; font-size: 13.5px; overflow-wrap: anywhere; }
.timeline li::before { content: ''; position: absolute; left: 3px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); opacity: 0.5; }
.timeline .when { display: block; font-size: 11.5px; color: var(--muted); }
.sms { padding: 12px 14px; border-radius: 18px 18px 18px 6px; background: #e8f0e0; font-size: 14px; overflow-wrap: anywhere; }
.toast-wrap { position: fixed; left: 0; right: 0; bottom: 28px; z-index: 80; display: flex; justify-content: center; pointer-events: none; padding: 0 16px; }
.toast { display: flex; align-items: center; gap: 8px; max-width: 520px; padding: 11px 16px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lift); animation: pop 0.25s ease both; }
.toast.warn { background: var(--warn); }

.empty { text-align: center; padding: 34px 18px; }
.empty .ic-wrap { margin: 0 auto 10px; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--canvas); color: var(--muted); }
.empty h3 { font-size: 16px; font-weight: 600; }
.empty p { margin-top: 4px; color: var(--muted); font-size: 14px; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -48%) scale(0.98); } }
.toast { animation-name: rise; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes slide { from { opacity: 0; transform: translateX(24px); } }
.view > * { animation: rise 0.4s cubic-bezier(.2,.7,.2,1) both; }

/* ---------- Mobile ---------- */
.tabbar, .fab { display: none; }

@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .tb-left .only-mobile { display: grid; }
  .topbar { padding: 12px 16px 10px; }
  .view { padding: 4px 16px 120px; }
  .foot { padding-bottom: 120px; }
  .h1 { font-size: 34px; }
  .grid-main, .grid-2, .camp { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prep { grid-template-columns: minmax(0, 1fr); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40;
    margin-bottom: env(safe-area-inset-bottom); background: rgb(255 255 255 / 0.95); backdrop-filter: blur(12px); border-radius: 26px; box-shadow: var(--shadow-lift); padding: 4px;
  }
  .tab { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 0; font-size: 10.5px; font-weight: 500; color: var(--muted); text-decoration: none; position: relative; }
  .tab .nav-ic { display: grid; place-items: center; width: 40px; height: 34px; border-radius: 999px; }
  .tab[aria-current='page'] { color: var(--ink); }
  .tab[aria-current='page'] .nav-ic { background: var(--grad); color: var(--accent); }
  .tab .nav-count { position: absolute; top: 2px; right: 12%; margin: 0; padding: 0 5px; min-width: 16px; font-size: 10px; }
  .fab {
    display: grid; place-items: center; position: fixed; right: 20px; bottom: 96px; z-index: 41; width: 56px; height: 56px; border-radius: 50%; border: 0;
    background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-lift); margin-bottom: env(safe-area-inset-bottom);
  }
  .fab svg.ic { width: 24px; height: 24px; }
  .modal { left: 0; right: 0; top: auto; bottom: 0; transform: none; width: 100%; max-height: 92dvh; border-radius: 28px 28px 0 0; padding: 20px 16px 28px; animation: up 0.3s cubic-bezier(.2,.7,.2,1) both; }
  .drawer { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 92dvh; border-radius: 28px 28px 0 0; animation: up 0.3s cubic-bezier(.2,.7,.2,1) both; }
  .toast-wrap { bottom: 100px; }
}
@media (max-width: 560px) {
  .demo-badge { display: none; }
  .f-row, .f-row-3 { grid-template-columns: minmax(0, 1fr); }
  .row, .row:has(.row-thumb) { grid-template-columns: auto minmax(0, 1fr); }
  .row-thumb { display: none; }
  .dh-photo { width: 64px; height: 64px; border-radius: 16px; }
  .row-side { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; flex-wrap: wrap; }
  .att { grid-template-columns: auto minmax(0, 1fr); }
  .att-actions { grid-column: 2; justify-content: flex-start; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kv dt { margin-top: 8px; font-size: 12px; }
}
@keyframes up { from { transform: translateY(30px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}


/* ---------- View helpers ---------- */
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.section-gap { margin-top: 18px; }
.sub-h { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 6px 0 10px; }
.sub-h:not(:first-child) { margin-top: 22px; }
.link-btn { border: 0; background: none; padding: 0; text-align: left; color: inherit; cursor: pointer; }
.link-btn:hover { color: var(--accent); }
.btn svg.ic { width: 16px; height: 16px; }
.btn-danger-fill { background: var(--warn); border-color: var(--warn); }
.btn-danger-fill:hover { background: #9c4325; }
.empty-act { margin-top: 14px; display: flex; justify-content: center; }
.list-sum { margin: 4px 2px 10px; }
.filters { display: grid; gap: 10px; margin-bottom: 16px; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; background: none; padding: 11px 0; outline: none; color: var(--ink); }
.flow li { display: grid; grid-template-columns: 128px minmax(0, 1fr) 24px; gap: 10px; }
.flow .pill { justify-self: start; }
.flow-bar { height: 8px; border-radius: 999px; background: var(--canvas); overflow: hidden; }
.flow-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--grad); }
.flow .price { text-align: right; }
.side-promo { display: block; color: inherit; text-decoration: none; padding: 20px; }
.side-promo .tile-go { top: 18px; right: 18px; }
.promo-title { font: 500 22px/1.15 var(--display); margin: 6px 40px 10px 0; }
.promo-num { margin-bottom: 10px; }
.promo-num .big-num { font-size: 40px; }
.promo-foot { margin-top: 8px; }
.side-link { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.more-link { text-decoration: none; color: inherit; }
.split > li { justify-content: space-between; }
.prep-card .card-head { margin-bottom: 4px; align-items: flex-start; }
.prep-card.is-done, .rem.is-done { opacity: 0.6; }
.prep-note { margin-top: 10px; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; }
.prep-note svg.ic { width: 15px; height: 15px; margin-top: 2px; }
.prep-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-top: 12px; }
.sticky-side { position: sticky; top: 84px; }
.tally-note { margin-bottom: 10px; }
.row-meta a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.row-meta svg.ic, .pill svg.ic, .form-note svg.ic, .card-msg svg.ic { width: 14px; height: 14px; vertical-align: -2px; }
.peak-hero { display: grid; gap: 16px; }
.peak-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.peak-title { font: 500 34px/1.05 var(--display); letter-spacing: -0.02em; margin: 4px 0; }
.peak-nums { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.peak-left { text-align: right; }
.bar-lg { height: 12px; background: rgb(255 255 255 / 0.6); }
.peak-controls { display: grid; grid-template-columns: 160px minmax(0, 220px) 1fr; gap: 12px; align-items: end; padding: 14px; border-radius: 20px; }
.peak-controls .field input { background: var(--surface); }
.peak-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.peak-how { display: flex; gap: 6px; align-items: flex-start; }
.peak-how svg.ic { width: 15px; height: 15px; margin-top: 2px; }
.rem-msg { margin-top: 12px; }
.backup-card .tile-ic { background: var(--canvas); margin-bottom: 12px; }
.backup-card .card-title { margin-bottom: 4px; }
.backup-card .prep-actions { justify-content: flex-start; margin-top: 14px; }
.where { margin-top: 6px; max-width: 720px; }
.seg-opt { cursor: pointer; position: relative; }
.seg-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-opt[aria-pressed='true'] { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 8%, transparent); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.field textarea:disabled { opacity: 0.5; }
.note-form { display: flex; gap: 8px; margin-top: 8px; }
.note-form .input { flex: 1; min-width: 0; padding: 8px 12px; }
.drawer-next { margin-top: 12px; width: 100%; }
.drawer-foot { justify-content: space-between; }
.drawer .card { padding: 16px; border-radius: 22px; }
.drawer .row-meta { margin-top: 8px; }
@media (max-width: 960px) {
  .sticky-side { position: static; }
  .peak-controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .peak-btns { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 560px) {
  .h1 { font-size: 30px; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .flow li { grid-template-columns: 110px minmax(0, 1fr) 20px; }
  .peak-title { font-size: 28px; }
  .peak-left { text-align: left; }
  .peak-controls { grid-template-columns: minmax(0, 1fr); }
  .tile-num { font-size: 22px; }
}

/* ---------- Print ---------- */
/* ---------- Money ---------- */
.t-loss { background: #f6d9d2; }
.tile-sub { margin-top: 4px; font-size: 12px; color: rgb(47 30 38 / 0.62); }
.is-loss, .tile.t-loss .tile-num { color: var(--warn); }
.money-range { justify-content: flex-end; }
.pl .pl-line { justify-content: space-between; padding: 8px 0; font-size: 14px; }
.pl .pl-line .price { font-variant-numeric: tabular-nums; }
.pl .pl-sub { font-weight: 600; border-top: 1px solid color-mix(in srgb, var(--ink) 22%, transparent); }
.pl .pl-total { font-weight: 700; font-size: 17px; border-top: 2px solid var(--ink); padding-top: 12px; }
.pl .pl-total.is-loss { border-top-color: var(--warn); }
.tbl-wrap { overflow-x: auto; margin: 0 -4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 6px 4px; }
.tbl td { padding: 8px 4px; border-top: 1px solid var(--line); white-space: nowrap; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-prod { display: flex; align-items: center; gap: 10px; white-space: normal; }
.tbl-thumb { display: grid; place-items: center; width: 34px; height: 34px; flex: none; }
.tbl-thumb img { width: 100%; height: 100%; object-fit: contain; }
.exp-form { display: grid; gap: 10px; margin: 12px 0 6px; }
.exp-form .btn { justify-self: start; }
.exp-list { max-height: 340px; overflow-y: auto; margin-top: 10px; }
.exp-list li { gap: 10px; }
.exp-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.exp-main .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn-sm { width: 32px; height: 32px; }
.icon-btn-sm svg.ic { width: 15px; height: 15px; }
.exp-none { margin-top: 10px; }
.section-gap-sm { margin-top: 10px; }
.costs-modal { width: min(720px, calc(100vw - 24px)); }
.costs-flat { margin: 6px 0 14px; }
.costs-stems { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 8px; }
.money-today-num { font-size: 20px; }
@media (max-width: 960px) { .money-range { justify-content: flex-start; } }
/* Phones: the numbers plus one card per section; each opens in a window. */
.money-cards { display: none; }
.money-entry { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center; width: 100%; border: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.money-entry-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.money-entry .price { font-weight: 600; }
.money-modal { width: min(640px, calc(100vw - 24px)); }
.money-modal .modal-head p { margin-top: 4px; }
/* On phones every modal is a full-width sheet; keep these two from narrowing it. */
@media (max-width: 560px) { .money-modal, .costs-modal { width: 100%; } }
@media (max-width: 760px) {
  .money-full { display: none; }
  .money-cards { display: grid; gap: 10px; }
  .tile-sub { display: none; }
}
.tbl th { white-space: nowrap; }
@media (max-width: 560px) { .tbl .c-cost { display: none; } .tbl-thumb { width: 30px; height: 30px; } }

@media print {
  @page { margin: 12mm; }
  body.printing .shell, body.printing .tabbar, body.printing .fab, body.printing #overlay-root, body.printing #toast-root { display: none !important; }
  body.printing { background: #fff; }
  body.printing #print-root { display: block; }
}
#print-root { display: none; font-size: 12pt; color: #000; }
#print-root h1 { font: 500 20pt var(--display); margin-bottom: 4pt; }
#print-root .p-sub { color: #555; margin-bottom: 12pt; }
#print-root table { width: 100%; border-collapse: collapse; margin-bottom: 14pt; }
#print-root th, #print-root td { text-align: left; border-bottom: 1px solid #ccc; padding: 5pt 4pt; vertical-align: top; }
#print-root .p-block { break-inside: avoid; border: 1px solid #ccc; border-radius: 8pt; padding: 10pt; margin-bottom: 10pt; }
#print-root .p-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8mm; }
#print-root .p-card { break-inside: avoid; height: 70mm; border: 1px dashed #999; border-radius: 4mm; padding: 10mm; display: flex; flex-direction: column; justify-content: center; text-align: center; }
#print-root .p-card .msg { font: italic 400 14pt/1.5 var(--display); white-space: pre-wrap; overflow-wrap: anywhere; }
#print-root .p-card .ref { margin-top: 6mm; font-size: 8pt; color: #888; }

/* ---------- Gate: brand intro + lock screen (js/gate.js) ----------
   Shown unless <html> has .open. The dashboard renders behind it, so
   unlocking only fades the gate away: nothing moves underneath. */
.gate { display: none; }
html:not(.open) .gate, .gate.is-leaving { display: flex; }
.gate {
  position: fixed; inset: 0; z-index: 100; flex-direction: column; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  padding: 20px 28px; background: var(--mesh); background-color: var(--canvas); outline: none;
}
html:not(.open) .shell, html:not(.open) .tabbar, html:not(.open) .fab { opacity: 0; transform: translateY(14px) scale(0.985); }
.shell, .tabbar, .fab { transition: opacity 0.8s ease, transform 1s cubic-bezier(.2,.7,.2,1); }
html.revealing .view > * { animation-duration: 0.7s; }
html.revealing .view > :nth-child(2) { animation-delay: 0.08s; }
html.revealing .view > :nth-child(3) { animation-delay: 0.16s; }
html.revealing .view > :nth-child(4) { animation-delay: 0.24s; }
html.revealing .view > :nth-child(n+5) { animation-delay: 0.32s; }
.gate.is-leaving { pointer-events: none; animation: g-leave 0.95s cubic-bezier(.4,0,.2,1) forwards; }
.gate.is-entering { animation: fade 0.5s ease both; }

.g-top { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.g-top .lang { margin-left: auto; }
.g-mid { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 28px 0; }
.g-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; transition: transform 1s cubic-bezier(.65,0,.25,1); }
.g-flower { width: 76px; height: 76px; overflow: visible; }
.g-petal { fill: var(--blush); stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.g-heart { fill: var(--accent); transform-box: fill-box; transform-origin: center; }
.g-seed { fill: var(--blush); }
.g-word { font: 500 clamp(40px, 4.4vw, 58px)/1 var(--display); letter-spacing: -0.02em; color: var(--ink); white-space: nowrap; }
.g-word span { display: inline-block; }
.g-word .amp { font-style: italic; font-weight: 400; color: var(--accent); padding: 0 0.04em; }
.g-tag { display: flex; align-items: center; gap: 12px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.g-rule { width: 28px; height: 1px; background: currentColor; opacity: 0.5; }

.g-card {
  width: min(420px, 100%); display: grid; padding: 28px; border-radius: 30px; text-align: left;
  background: rgb(255 255 255 / 0.74); border: 1px solid rgb(255 255 255 / 0.85); box-shadow: var(--shadow-lift);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.g-date { font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.g-title { font: 500 34px/1.05 var(--display); letter-spacing: -0.02em; margin-top: 6px; }
.g-lede { margin-top: 6px; color: var(--muted); font-size: 14.5px; }
.g-field { display: grid; gap: 6px; margin-top: 20px; }
.g-label { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.g-input {
  width: 100%; padding: 12px 18px; border-radius: 18px; border: 1px solid var(--line); background: var(--canvas);
  font: 500 28px/1.2 var(--sans); letter-spacing: 0.6em; text-indent: 0.6em; text-align: center; color: var(--ink); -webkit-text-security: disc;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.g-input:focus { outline: none; background: var(--surface); border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 9%, transparent); }
.g-field.invalid .g-input { border-color: var(--warn); background: #fff8f4; }
.g-err { min-height: 1.5em; margin: 6px 2px 4px; font-size: 13px; font-weight: 500; color: var(--warn); }
.g-submit { width: 100%; padding: 7px 7px 7px 22px; font-size: 15.5px; }
.g-submit:disabled { opacity: 1; cursor: default; }
.g-submit .btn-grad-ic { transition: transform 0.4s cubic-bezier(.2,.7,.2,1), background-color 0.3s ease; }
.g-submit:hover .btn-grad-ic { transform: rotate(45deg); }
.g-card.is-ok .g-submit .btn-grad-ic { transform: rotate(45deg) scale(1.08); background: var(--ok); }
.g-hint { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding: 6px 6px 6px 14px; border-radius: 16px; background: var(--cream); font-size: 13px; color: var(--muted); }
.g-code-shown { color: var(--ink); letter-spacing: 0.14em; font-variant-numeric: tabular-nums; }
.g-note { margin-top: 14px; font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.g-replay { justify-self: start; display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 2px 0; border: 0; background: none; font-size: 12px; font-weight: 500; color: var(--muted); }
.g-replay:hover { color: var(--accent); }
.g-replay svg.ic { width: 14px; height: 14px; }
.g-foot { position: relative; z-index: 1; text-align: center; font-size: 12px; color: var(--muted); }
.g-skip { position: absolute; z-index: 3; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 6px 14px; border: 0; border-radius: 999px; background: var(--surface); font-size: 12.5px; clip-path: inset(50%); }
.g-skip:focus-visible { clip-path: none; }
.g-sprig { position: absolute; z-index: 0; width: clamp(160px, 17vw, 300px); fill: none; stroke: var(--accent); stroke-width: 1.3; stroke-linecap: round; opacity: 0.28; pointer-events: none; }
.g-sprig path, .g-sprig circle { stroke-dasharray: 1; stroke-dashoffset: 0; }
.g-sprig-a { left: -12px; bottom: 0; }
.g-sprig-b { right: -12px; top: 64px; transform: scale(-1, -1); }

/* Intro: the brand sits at the centre, larger, and draws itself. */
.gate[data-stage='intro'] { cursor: pointer; }
.gate[data-stage='intro'] .g-brand { transform: translateY(var(--shift, 0px)) scale(1.5); transition: none; }
.gate[data-stage='intro'] .g-card, .gate[data-stage='intro'] .g-top, .gate[data-stage='intro'] .g-foot { opacity: 0; visibility: hidden; }
.gate[data-stage='intro'] .g-flower { animation: g-bloom 1.6s cubic-bezier(.2,.7,.2,1) both; }
.gate[data-stage='intro'] .g-petal { animation: g-draw 0.9s ease-out both, g-fill 0.6s ease both; animation-delay: calc(var(--i) * 0.09s), calc(0.55s + var(--i) * 0.09s); }
.gate[data-stage='intro'] .g-heart { animation: g-pop 0.5s 0.95s cubic-bezier(.3,1.6,.5,1) both; }
.gate[data-stage='intro'] .g-seed { animation: fade 0.3s 1.2s both; }
.gate[data-stage='intro'] .g-word span { animation: g-letter 0.7s calc(0.9s + var(--i) * 0.045s) cubic-bezier(.2,.7,.2,1) both; }
.gate[data-stage='intro'] .g-tag { animation: g-up 0.7s 1.5s cubic-bezier(.2,.7,.2,1) both; }
.gate[data-stage='intro'] .g-rule { animation: g-line 0.8s 1.6s cubic-bezier(.2,.7,.2,1) both; }
.gate[data-stage='intro'] .g-sprig path, .gate[data-stage='intro'] .g-sprig circle { animation: g-draw 2.2s 0.2s ease-out both; }

/* Lock: the brand glides up (transition above), the card rises in. */
.gate[data-stage='lock'] .g-card { animation: g-card 0.8s 0.35s cubic-bezier(.2,.7,.2,1) both; }
.gate[data-stage='lock'] .g-top, .gate[data-stage='lock'] .g-foot { animation: fade 0.6s 0.55s ease both; }
.g-card.shake { animation: g-shake 0.45s cubic-bezier(.36,.07,.19,.97) both !important; }

@keyframes g-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes g-fill { from { fill-opacity: 0; } }
@keyframes g-bloom { from { transform: rotate(-36deg) scale(0.72); } }
@keyframes g-pop { from { transform: scale(0); } }
@keyframes g-letter { from { opacity: 0; transform: translateY(0.45em); filter: blur(4px); } }
@keyframes g-up { from { opacity: 0; transform: translateY(8px); } }
@keyframes g-line { from { transform: scaleX(0); } }
@keyframes g-card { from { opacity: 0; transform: translateY(26px) scale(0.98); } }
@keyframes g-leave { to { opacity: 0; transform: scale(1.04); } }
@keyframes g-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-10px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(3px); } }

.tb-lock svg.ic { width: 15px; height: 15px; }
@media (max-height: 820px) and (min-width: 561px) {
  .gate { padding-top: 14px; padding-bottom: 14px; }
  .g-mid { gap: 16px; padding: 8px 0; }
  .g-field { margin-top: 16px; }
  .g-hint, .g-note { margin-top: 10px; }
  .g-flower { width: 60px; height: 60px; }
  .g-card { padding: 24px; }
  .g-title { font-size: 30px; }
}
@media (max-width: 760px) { .g-sprig { display: none; } }
@media (max-width: 560px) {
  .gate { padding: 14px 16px; }
  .g-mid { gap: 22px; padding: 20px 0; }
  .g-flower { width: 60px; height: 60px; }
  .g-word { font-size: 40px; }
  .g-card { padding: 22px 20px; border-radius: 26px; }
  .g-title { font-size: 28px; }
  .tb-lock { padding: 0; width: 36px; height: 36px; }
  .tb-lock-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (min-width: 1600px) and (min-height: 960px) {
  .g-flower { width: 92px; height: 92px; }
  .g-word { font-size: 64px; }
  .g-tag { font-size: 12.5px; }
  .g-card { width: 460px; padding: 32px; }
  .g-title { font-size: 38px; }
}
@media (max-width: 560px) {
  .gate[data-stage='intro'] .g-brand { transform: translateY(var(--shift, 0px)) scale(1.15); }
}

/* ---------- New order / edit order (js/order-form.js) ----------
   Form on the left in numbered sections; photo panel on the right with the
   order summary. Chinese headings fall through Fraunces to a Song serif. */
/* The form's palette, shared by every pop-up (see "Pop-ups" below). */
.of-modal, .modal, .drawer {
  --of-paper: #faf5ef; --of-field: #fffdfa; --of-edge: #e4d8cf; --of-rose: #c98c99; --of-star: #c4506a;
  --of-green: #3e5a2c; --of-green-dark: #33491f; --of-green-ink: #34461f;
  --of-script: 'Snell Roundhand', 'Savoye LET', 'Apple Chancery', 'Fraunces', Georgia, cursive;
  --of-serif: 'Fraunces', 'Songti SC', 'STSong', 'Noto Serif SC', 'Source Han Serif SC', Georgia, serif;
}
.of-modal {
  width: min(1280px, calc(100vw - 48px)); height: min(900px, calc(100dvh - 48px)); max-height: none;
  padding: 0; overflow: hidden; background: var(--of-paper); border-radius: 28px;
}
.of { display: grid; grid-template-columns: minmax(0, 1fr) clamp(340px, 38%, 540px); height: 100%; }
.of-main { min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding: 38px 44px 34px; display: grid; gap: 14px; align-content: start; }
.of-x { position: absolute; top: 18px; right: 18px; z-index: 3; }
.of-x .icon-btn { width: 42px; height: 42px; border: 0; background: rgb(255 255 255 / 0.92); box-shadow: var(--shadow); }

.of-head { position: relative; padding-left: 4px; margin-bottom: 4px; }
.of-eyebrow { display: flex; align-items: center; gap: 22px; white-space: nowrap; font: 500 12px var(--of-serif); letter-spacing: 0.3em; text-transform: uppercase; color: #4a3a33; padding-left: 46px; }
.of-eyebrow-line { flex: 0 1 220px; height: 1px; background: #cdbcb2; }
.of-title { display: flex; align-items: center; gap: 4px; margin-top: 8px; font: 600 54px/1.05 var(--of-serif); letter-spacing: 0.02em; color: var(--of-green-ink); }
.of-title-petal { width: 44px; height: 52px; flex: none; margin-left: -6px; transform: rotate(-14deg); }
.of-lede { margin-top: 6px; padding-left: 46px; font: 400 16px/1.5 var(--of-serif); color: #5d4c45; }

.of-sec { display: flex; align-items: baseline; gap: 14px; margin-top: 14px; font: 600 22px var(--of-serif); letter-spacing: 0.04em; color: var(--of-green-ink); }
.of-num { font: italic 400 28px/1 'Fraunces', Georgia, serif; color: var(--of-rose); min-width: 36px; }
.of-line { flex: 1; height: 1px; background: #d9c9c0; align-self: center; }

.of .f-row { gap: 12px 26px; }
.of .field { gap: 6px; }
.of .field > span:first-child { font-size: 13.5px; font-weight: 600; letter-spacing: 0.02em; color: #3d2a30; }
.of .req { color: var(--of-star); font-weight: 600; }
.of .field input:not([type='checkbox']), .of .field select, .of .field textarea {
  padding: 10px 14px; border-radius: 10px; border: 1px solid var(--of-edge); background: var(--of-field); font-size: 15px; min-height: 44px;
}
.of .field textarea { min-height: 84px; }
.of .field input:focus, .of .field select:focus, .of .field textarea:focus { background: #fff; border-color: color-mix(in srgb, var(--of-green) 55%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--of-green) 12%, transparent); }
.of :focus-visible { outline-color: var(--of-green); }
.of .field.invalid input, .of .field.invalid select, .of .field.invalid textarea { border-color: var(--warn); background: #fff8f4; }
.of .form-note { border-radius: 10px; }
.of .check input { accent-color: var(--of-green); width: 18px; height: 18px; }

.of-ful { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 26px; }
.of-ful-opt {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; border-radius: 10px;
  border: 1px solid #d8c8be; background: var(--of-field); font: 500 17px var(--of-serif); letter-spacing: 0.06em; color: #3d2a30; cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.of-ful-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.of-ful-opt svg.ic { width: 26px; height: 26px; stroke-width: 1.5; }
.of-ful-opt:hover { background: #fff; }
.of-ful-opt.is-on { background: var(--of-green); border-color: var(--of-green-dark); color: #fbf6ec; box-shadow: inset 0 0 0 2px rgb(255 255 255 / 0.12), 0 6px 16px -8px rgb(40 60 25 / 0.6); }
.of-ful-opt:has(input:focus-visible) { outline: 2px solid var(--of-green); outline-offset: 3px; }

.of-product { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 16px; align-items: end; }
.of-thumb { display: grid; place-items: center; width: 78px; height: 78px; border-radius: 14px; overflow: hidden; background: var(--grad); color: var(--accent); box-shadow: var(--shadow); }
.of-thumb svg.ic { width: 30px; height: 30px; stroke-width: 1.5; }
.of-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.of-thumb.has-photo { background: radial-gradient(circle at 50% 42%, #fffaf6 0%, #f5e6de 100%); }
.of-product .f-row-3 { grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.7fr) minmax(0, 0.9fr); }
.of-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: -4px; }

/* Photo panel and summary */
.of-side {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; padding: 0 22px 22px; overflow-x: hidden; overflow-y: auto;
  /* A cream wash softens the photo; stronger behind the shop name so it reads. */
  background: radial-gradient(75% 48% at 72% 24%, rgb(253 248 243 / 0.7), rgb(253 248 243 / 0) 72%), linear-gradient(rgb(253 247 242 / 0.34), rgb(253 247 242 / 0.34)), #f3ddd6 url('assets/order-ui/floral-panel.jpg') center top / cover no-repeat;
}
.of-brand { padding: clamp(80px, 13vh, 150px) 0 0 38%; text-align: center; color: #4b4321; }
.of-word { font: 400 clamp(52px, 5vw, 74px)/0.98 var(--of-script); letter-spacing: 0; }
.of-word-l { display: block; white-space: nowrap; transform: translateX(calc((var(--i) - 0.4) * 0.7em)); }
.of-sub { margin: 22px auto 0; max-width: 11em; font-size: 12px; font-weight: 500; line-height: 1.7; letter-spacing: 0.3em; text-transform: uppercase; color: #4a3a33; }
.of-rule { display: block; width: 72px; height: 1px; margin: 16px auto 0; background: #8c7266; opacity: 0.6; }

.of-sum {
  display: grid; gap: 12px; padding: 24px 24px 18px; border-radius: 24px; color: var(--ink);
  background: rgb(255 249 246 / 0.76); border: 1px solid rgb(255 255 255 / 0.75); box-shadow: 0 18px 40px -24px rgb(90 40 50 / 0.45);
  backdrop-filter: blur(16px) saturate(1.1); -webkit-backdrop-filter: blur(16px) saturate(1.1);
}
.of-sum-title { display: flex; align-items: center; gap: 8px; font: 600 24px var(--of-serif); letter-spacing: 0.04em; color: var(--of-green-ink); }
.of-sum-petal { width: 28px; height: 32px; transform: rotate(-14deg); }
.of-lines { display: grid; gap: 6px; padding: 4px 4px 14px; border-bottom: 1px solid #d9c6bd; }
.of-line-row, .of-fee-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14.5px; color: #4a3a33; }
.of-line-row [data-sub] { font-variant-numeric: tabular-nums; }
.of .of-fee-row { flex-direction: row; flex-wrap: wrap; }
.of .of-fee-row > span:first-child { font-size: 14.5px; font-weight: 400; letter-spacing: 0; color: #4a3a33; }
.of-fee { display: inline-flex; align-items: center; gap: 2px; padding: 0 0 0 10px; border-radius: 10px; border: 1px solid var(--of-edge); background: var(--of-field); color: var(--muted); font-size: 14px; }
.of .of-fee-row .of-fee input { width: 74px; min-height: 34px; padding: 4px 10px 4px 2px; border: 0; background: none; text-align: right; font-variant-numeric: tabular-nums; box-shadow: none; }
.of .of-fee-row .of-fee input:disabled { color: var(--muted); }
.of-fee:focus-within { border-color: color-mix(in srgb, var(--of-green) 55%, transparent); background: #fff; }
.of-fee-row .err { flex-basis: 100%; text-align: right; }
.of-fee-hint { font-size: 11.5px; color: var(--muted); text-align: right; min-height: 1.4em; }
.of-total { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 2px 4px; }
.of-total span { font: 600 22px var(--of-serif); letter-spacing: 0.04em; color: var(--of-green-ink); }
.of-total strong { font: 600 38px/1 var(--of-serif); letter-spacing: -0.01em; color: #2f1e26; font-variant-numeric: lining-nums tabular-nums; }
.of-paid { display: flex; align-items: center; gap: 10px; padding: 0 4px; font-size: 14px; font-weight: 600; cursor: pointer; }
.of-paid input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.of-switch { position: relative; width: 40px; height: 24px; border-radius: 999px; background: #dccbc3; transition: background-color 0.2s ease; flex: none; }
.of-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.2); transition: transform 0.2s ease; }
.of-paid input:checked + .of-switch { background: var(--of-green); }
.of-paid input:checked + .of-switch::after { transform: translateX(16px); }
.of-paid input:focus-visible + .of-switch { outline: 2px solid var(--of-green); outline-offset: 2px; }
.of-submit {
  display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 58px; margin-top: 4px; border: 0; border-radius: 999px;
  background: var(--of-green); color: #fbf6ec; font: 600 19px var(--of-serif); letter-spacing: 0.1em; box-shadow: 0 10px 24px -12px rgb(40 60 25 / 0.75);
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.of-submit:hover { background: var(--of-green-dark); transform: translateY(-1px); }
.of-submit svg.ic { width: 22px; height: 22px; stroke-width: 2.2; }
.of-cancel { justify-self: center; border: 0; background: none; padding: 4px 12px; font: 500 15px var(--of-serif); letter-spacing: 0.1em; color: #4a3a33; }
.of-cancel:hover { color: var(--of-green); }

@media (max-height: 820px) and (min-width: 961px) {
  .of-main { padding: 28px 38px 26px; gap: 12px; }
  .of-title { font-size: 44px; }
  .of-sec { margin-top: 8px; }
  .of-brand { padding-top: 64px; }
  .of-sum { padding: 18px 20px 14px; gap: 9px; }
  .of-total strong { font-size: 32px; }
  .of-submit { min-height: 52px; }
}
/* Phones and small tablets: photo becomes a banner, summary follows the form. */
@media (max-width: 960px) {
  .of-modal { width: 100%; height: 94dvh; max-height: 94dvh; overflow-y: auto; padding: 0; }
  .of { display: flex; flex-direction: column; height: auto; }
  .of-side { display: contents; }
  .of-brand {
    order: -1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-height: 196px; padding: 64px 18px 24px 38%;
    background: radial-gradient(70% 90% at 72% 50%, rgb(253 248 243 / 0.72), rgb(253 248 243 / 0) 75%), linear-gradient(rgb(253 247 242 / 0.34), rgb(253 247 242 / 0.34)), #f3ddd6 url('assets/order-ui/floral-panel.jpg') center 22% / cover no-repeat; text-align: center;
  }
  /* One line, centred under the close button: "Petal & Co", then the tagline. */
  .of-word { font-size: clamp(36px, 10.5vw, 50px); line-height: 1; white-space: nowrap; }
  .of-word-l { display: inline; transform: none; }
  .of-word-l + .of-word-l { margin-left: 0.24em; }
  .of-rule { order: 2; width: 44px; margin: 12px auto 0; }
  .of-sub { order: 3; max-width: none; margin-top: 10px; font-size: 10px; letter-spacing: 0.26em; white-space: nowrap; }
  .of-eyebrow.is-brand { display: none; }
  .of-main { overflow: visible; padding: 22px 16px 8px; }
  .of-sum { margin: 10px 12px calc(16px + env(safe-area-inset-bottom)); background: #fff8f4; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .of-title { font-size: 40px; }
  .of-eyebrow, .of-lede { padding-left: 40px; }
  .of-x { top: 14px; right: 14px; }
}
@media (max-width: 560px) {
  .of-ful { gap: 10px; }
  .of-product { grid-template-columns: minmax(0, 1fr); }
  .of-thumb { width: 64px; height: 64px; }
  .of-product .f-row-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .of-product .f-row-3 > :first-child { grid-column: 1 / -1; }
  .of-title { font-size: 34px; }
  .of-eyebrow { gap: 12px; letter-spacing: 0.22em; }
}

/* ---------- Pop-ups: the order form's look, without its photo panel ----------
   Confirm boxes, cost prices, the Money windows and the order drawer use the
   same paper, serif headings, green buttons and field style as New order. */
.modal:not(.of-modal), .drawer { background: var(--of-paper); }
.modal .modal-title, .drawer .modal-title { font: 600 32px/1.1 var(--of-serif); letter-spacing: 0.02em; color: var(--of-green-ink); }
.modal .eyebrow, .drawer .eyebrow { font: 500 11.5px var(--of-serif); letter-spacing: 0.28em; color: #4a3a33; }
.modal .form-section, .drawer .form-section { font: 600 13px var(--of-serif); letter-spacing: 0.18em; color: var(--of-green-ink); }
.modal-head .muted, .modal > .muted, .money-modal .exp-form + p, .modal .lede { font-family: var(--of-serif); color: #5d4c45; }
.modal .icon-btn, .drawer .icon-btn { border: 0; background: rgb(255 255 255 / 0.92); box-shadow: var(--shadow); }
.modal .field > span:first-child, .drawer .field > span:first-child { font-size: 13.5px; font-weight: 600; letter-spacing: 0.02em; color: #3d2a30; }
.modal .field input:not([type='checkbox']), .modal .field select, .modal .field textarea,
.drawer .field input:not([type='checkbox']), .drawer .field select, .drawer .field textarea, .drawer .input {
  padding: 10px 14px; border-radius: 10px; border: 1px solid var(--of-edge); background: var(--of-field); font-size: 15px; min-height: 44px;
}
.modal .field input:focus, .modal .field select:focus, .modal .field textarea:focus, .drawer .input:focus {
  outline: none; background: #fff; border-color: color-mix(in srgb, var(--of-green) 55%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--of-green) 12%, transparent);
}
.modal .field [aria-invalid='true'] { border-color: var(--warn); background: #fff8f4; }
.modal :focus-visible, .drawer :focus-visible { outline-color: var(--of-green); }
.modal .btn-primary:not(.btn-danger-fill), .drawer .btn-primary:not(.btn-danger-fill) {
  background: var(--of-green); border-color: var(--of-green-dark); color: #fbf6ec; font-family: var(--of-serif); letter-spacing: 0.06em;
  box-shadow: 0 8px 20px -12px rgb(40 60 25 / 0.75);
}
.modal .btn-primary:not(.btn-danger-fill):hover, .drawer .btn-primary:not(.btn-danger-fill):hover { background: var(--of-green-dark); }
.modal .btn:not(.btn-primary), .drawer .btn:not(.btn-primary) { font-family: var(--of-serif); letter-spacing: 0.04em; border-color: var(--of-edge); background: var(--of-field); }
.modal .btn:not(.btn-primary):hover, .drawer .btn:not(.btn-primary):hover { color: var(--of-green); border-color: color-mix(in srgb, var(--of-green) 40%, transparent); }
.modal .btn-danger, .drawer .btn-danger { color: var(--warn); }
.modal .card, .drawer .card { background: var(--of-field); border: 1px solid var(--of-edge); box-shadow: none; }
.drawer .pl-total, .modal .pl-total { font-family: var(--of-serif); }

/* ---------- Demo role switcher (js/role.js) ---------- */
.tb-role { gap: 6px; }
.tb-role svg.ic { width: 15px; height: 15px; }
.role-list { display: grid; gap: 10px; }
.role-opt {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; width: 100%; padding: 14px 16px;
  border: 1px solid var(--of-edge); border-radius: 16px; background: var(--of-field); text-align: left; color: inherit; font: inherit; cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.role-opt:hover { border-color: color-mix(in srgb, var(--of-green) 40%, transparent); }
.role-opt.is-on { border-color: var(--of-green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--of-green) 12%, transparent); }
.role-ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: #eef0e6; color: var(--of-green); }
.role-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.role-main strong { font: 600 18px var(--of-serif); color: var(--of-green-ink); letter-spacing: 0.02em; }
.role-check { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--of-green); color: #fbf6ec; }
.role-check svg.ic { width: 15px; height: 15px; }
.role-note { margin-top: 14px; }
.role-modal { width: min(520px, calc(100vw - 24px)); }
@media (max-width: 560px) { .role-modal { width: 100%; } }
/* A driver only has the runs page: no new-order button, no tab bar. */
[data-role='driver'] .sb-new, [data-role='driver'] .fab, [data-role='driver'] .tabbar { display: none; }
/* Phones: keep the top bar on one line with the role pill added. */
.lang button, .tb-title, .tb-date, .tb-role { white-space: nowrap; }
.tb-left > div { min-width: 0; }
.tb-date { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) {
  .tb-right { gap: 6px; flex: none; }
  .tb-role { padding: 0 10px; height: 36px; }
  .lang button { padding: 5px 9px; }
}
@media (max-width: 400px) {
  .tb-role { padding: 0; width: 36px; justify-content: center; }
  .tb-role-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

/* ---------- Phones: app-like screens ----------
   Busy pages become a few big cards; each opens its detail in a sheet.
   .desk-only / .mob-only pick which version shows. */
.mob-only { display: none !important; }
.m-modules { gap: 10px; }
.m-entry { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center; width: 100%; border: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.m-entry-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.m-entry .price { font-weight: 600; }
.sheet-modal { width: min(640px, calc(100vw - 24px)); }
.sheet-side { margin-top: 4px; }
.peak-controls-sheet { display: grid; gap: 12px; margin-bottom: 10px; }
.att-all { width: 100%; justify-content: center; margin-top: 10px; }
@media (max-width: 560px) {
  .desk-only { display: none !important; }
  .mob-only { display: revert !important; }
  .m-modules.mob-only { display: grid !important; }
  .att-all.mob-only { display: flex !important; }
  .att-more { display: none; }
  .sheet-modal { width: 100%; }
  /* Large title only: the top bar already names the page. */
  .page-head { margin-bottom: 16px; gap: 10px; }
  .page-head .eyebrow { display: none; }
  .page-head .lede { font-size: 14px; }
  .head-actions:not(:has(> :not(.desk-only))) { display: none; }
}


/* ---------- Delivery tracking (js/track.js) ----------
   Progress by stop, no GPS. White cards with a dotted stop line and a truck
   on the stop that is on the way; the tracking sheet is dark. */
:root { --trk: #ef6a43; --trk-soft: #fde3d9; --trk-dark: #1f1b1c; --trk-dark-2: #2d2729; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 2px 10px; }
.trk-wrap { display: grid; gap: 10px; }
.trk-hero {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 12px; width: 100%; padding: 20px 20px 18px;
  border: 0; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow); text-align: left; font: inherit; color: inherit; cursor: pointer; overflow: hidden;
}
.trk-hero:hover { box-shadow: var(--shadow-lift); }
.trk-head { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.trk-title { font: 600 26px/1.1 var(--sans); letter-spacing: -0.025em; overflow-wrap: anywhere; }
.trk-sub { font-size: 13px; color: var(--muted); }
.trk-head .trk-pill { margin-top: 8px; }
.trk-photo { width: 104px; height: 104px; margin: -10px -8px -10px 0; }
.trk-photo img, .trk-box img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 12px 14px rgb(47 30 38 / 0.18)); }
.trk-pill { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px; background: #f2eeec; color: var(--ink); font-size: 12px; font-weight: 500; white-space: nowrap; }
.trk-pill.is-out { background: var(--trk-soft); color: #b8441f; }
.trk-pill.is-done { background: var(--sage); color: var(--ok); }
.trk-pill.is-late { background: var(--warn-soft); color: var(--warn); }

/* The progress line: a dotted rail, four fixed dots, the truck where the driver is. */
.trk-line { grid-column: 1 / -1; position: relative; height: 30px; margin: 22px 11px 0; }
.trk-rail, .trk-fill { position: absolute; left: 0; top: 50%; border-top: 2px dotted #d3ccc8; }
.trk-rail { right: 0; }
.trk-fill { border-top-color: var(--trk); transition: width 0.6s ease; }
.trk-dot, .trk-truck { position: absolute; top: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; border-radius: 50%; }
.trk-dot { width: 22px; height: 22px; background: #dcd7d4; color: #fff; }
.trk-dot svg.ic { width: 12px; height: 12px; stroke-width: 3; }
.trk-dot.is-done { background: var(--trk); box-shadow: 0 0 0 3px var(--trk-soft); }
.trk-truck { z-index: 1; width: 32px; height: 32px; background: var(--trk-soft); color: var(--trk); box-shadow: 0 0 0 3px var(--surface); }
.trk-truck svg.ic { width: 18px; height: 18px; }
.trk-tag { position: absolute; bottom: calc(100% + 5px); left: 50%; transform: translateX(-50%); font: 600 11px/1 var(--sans); font-style: normal; white-space: nowrap; color: var(--ink); }
.trk-tag.at-start { left: 0; transform: none; }
.trk-tag.at-end { left: auto; right: 0; transform: none; }
.trk-ends { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; }
.trk-ends .r, .trk-top .r { text-align: right; }
.trk-k { font-size: 11.5px; color: var(--muted); }
.trk-v { margin-top: 2px; font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }

/* Big thumb-sized buttons for the driver. */
.trk-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.trk-acts-1 { grid-template-columns: 1fr; }
.trk-btn { position: relative; min-height: 54px; border-radius: 18px; font-size: 15px; cursor: pointer; }
.trk-btn svg.ic { width: 19px; height: 19px; }
.trk-go { background: var(--trk-dark); border-color: var(--trk-dark); color: #fff; }
.trk-go:hover { background: #000; }
.trk-done { background: var(--trk); border-color: var(--trk); color: #fff; }
.trk-done:hover { background: #dc5a34; }
.proof-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.trk-btn:has(.proof-input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Runs: one card per stop. */
.run-trk { padding: 4px 16px 16px; margin-bottom: 10px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.run-stops { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); align-items: start; }
.tstop { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 16px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.tstop-ph { width: 48px; height: 48px; border-radius: 50%; background: var(--canvas); display: grid; place-items: center; overflow: hidden; color: var(--accent); }
.tstop-ph img { width: 100%; height: 100%; object-fit: contain; }
.tstop-name { font: 600 17px/1.2 var(--sans); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.tstop-sub { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.tstop-info, .tstop-st, .tstop .trk-acts { grid-column: 1 / -1; }
.tstop-note { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.tstop-st { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; border: 0; border-radius: 14px; background: var(--canvas); color: var(--ink); font: 500 13px/1.35 var(--sans); text-align: left; }
button.tstop-st { cursor: pointer; }
.tstop-st > span { flex: 1; min-width: 0; }
.tstop-st svg.ic { width: 16px; height: 16px; flex: none; }
.tstop.is-out .tstop-st { background: var(--trk-soft); color: #9c3a1a; }
.tstop.is-done .tstop-st { background: #eef3e7; color: var(--ok); }
.tstop.is-done .tstop-ph, .tstop.is-done .tstop-main, .tstop.is-done .tstop-info { opacity: 0.6; }
.tstop.is-done .tstop-info { display: none; }
.trk-acts-quiet .trk-btn { min-height: 44px; border-color: transparent; background: var(--canvas); font-size: 14px; }
.tstop-proof { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; flex: none; }

/* The dark tracking sheet. */
.modal.track-modal { background: var(--trk-dark); color: #f7f2ef; }
.track-modal .modal-title { color: #fff; font: 600 20px/1.2 var(--sans); letter-spacing: -0.01em; }
.track-modal .modal-head { align-items: center; }
.track-modal .icon-btn { background: rgb(255 255 255 / 0.08); border-color: transparent; color: #fff; }
.trk-sheet { position: relative; display: grid; gap: 16px; }
.trk-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.trk-top .trk-pill { margin-top: 6px; }
.trk-id { margin-top: 2px; font: 500 30px/1.1 var(--sans); letter-spacing: -0.02em; color: #fff; }
.track-modal .trk-k { color: rgb(255 255 255 / 0.5); }
.track-modal .trk-v { color: #fff; }
.track-modal .trk-pill { background: rgb(255 255 255 / 0.1); color: #fff; }
.track-modal .trk-pill.is-out { background: var(--trk); }
.track-modal .trk-pill.is-done { background: #fff; color: var(--trk-dark); }
.track-modal .trk-pill.is-late { background: #6b2c1a; color: #ffd9cc; }
.track-modal .trk-dot { background: #4a4345; color: var(--trk-dark); }
.track-modal .trk-dot.is-done { background: #fff; box-shadow: none; color: var(--trk-dark); }
.track-modal .trk-truck { background: var(--trk); color: #fff; box-shadow: 0 0 0 3px var(--trk-dark); }
.track-modal .trk-rail { border-top-color: rgb(255 255 255 / 0.25); }
.track-modal .trk-fill { border-top-color: rgb(255 255 255 / 0.85); }
.track-modal .trk-tag { color: #fff; }
.trk-hr { border: 0; border-top: 1px solid rgb(255 255 255 / 0.1); margin: 0; }
.trk-grid { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; padding-right: 110px; min-height: 120px; }
.trk-box { position: absolute; right: -8px; bottom: -6px; width: 128px; height: 128px; }
/* Shopee-style updates: newest on top, the next one (an estimate) hollow. */
.trk-tl { list-style: none; margin: -6px 0 0; padding: 0; }
.trk-tl li { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 0 0 14px 24px; font-size: 13.5px; color: rgb(255 255 255 / 0.62); }
.trk-tl li::before { content: ''; position: absolute; left: 3px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #5a5254; }
.trk-tl li::after { content: ''; position: absolute; left: 7.5px; top: 18px; bottom: 2px; border-left: 1px dashed rgb(255 255 255 / 0.2); }
.trk-tl li:last-child { padding-bottom: 0; }
.trk-tl li:last-child::after { display: none; }
.trk-tl li:first-child, .trk-tl li.is-soon + li { color: #fff; font-weight: 500; }
.trk-tl li:first-child::before, .trk-tl li.is-soon + li::before { background: var(--trk); box-shadow: 0 0 0 4px rgb(239 106 67 / 0.25); }
.trk-tl li.is-soon { color: rgb(255 255 255 / 0.62); font-weight: 400; }
.trk-tl li.is-soon::before { background: transparent; border: 2px dashed rgb(255 255 255 / 0.5); box-shadow: none; width: 6px; height: 6px; }
.trk-tl .when { flex: none; font-size: 12px; color: rgb(255 255 255 / 0.45); font-weight: 400; }
.trk-proof { display: grid; gap: 6px; margin: 0; }
.trk-proof img { width: 100%; max-height: 340px; object-fit: cover; border-radius: 20px; }
.trk-note { font-size: 12px; color: rgb(255 255 255 / 0.5); }
.trk-contact { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 999px; background: var(--trk-dark-2); }
.trk-ava { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--blush); color: var(--accent); font-weight: 700; }
.trk-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.trk-who strong { color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trk-who span { font-size: 12px; color: rgb(255 255 255 / 0.5); }
.trk-call, .trk-msg { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 50%; text-decoration: none; }
.trk-call { background: var(--trk); color: #fff; }
.trk-msg { background: #fff; color: var(--trk-dark); }
.trk-call svg.ic, .trk-msg svg.ic { width: 20px; height: 20px; }
@media (min-width: 900px) {
  .trk-wrap:has(.trk-acts) { grid-template-columns: minmax(0, 1fr) 300px; align-items: stretch; }
  .trk-wrap .trk-acts { grid-template-columns: 1fr; align-content: center; }
  .trk-hero { padding: 24px 28px 22px; }
  .trk-title { font-size: 30px; }
  .trk-photo { width: 120px; height: 120px; }
}
@media (max-width: 560px) {
  .trk-hero { padding: 18px 16px 16px; }
  .trk-title { font-size: 23px; }
  .trk-photo { width: 88px; height: 88px; margin: -8px -6px -8px 0; }
  /* A handle on the dark sheet, like a native bottom sheet. */
  .modal.track-modal { padding-top: 26px; }
  .modal.track-modal::before { content: ''; position: absolute; top: 9px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: rgb(255 255 255 / 0.25); }
  .trk-id { font-size: 26px; }
  .trk-grid { padding-right: 84px; }
  .trk-box { width: 100px; height: 100px; right: -4px; }
}

/* ---------- In-app chat (js/chat.js) ----------
   One thread per order plus a team thread, in a bottom sheet. Bubbles from
   others are white cards; your own are dark, the send button is the
   tracker's orange. */
.chat-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--trk); color: #fff; font: 600 11px/1 var(--sans); flex: none; }
.chat-badge.on-tb, .chat-badge.on-trk { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10.5px; box-shadow: 0 0 0 2px var(--canvas); }
.chat-badge.on-trk { box-shadow: 0 0 0 2px var(--trk-dark-2); }
.tb-chat { position: relative; padding: 0; width: 36px; height: 36px; justify-content: center; }
.tb-chat svg.ic { width: 16px; height: 16px; }
.trk-chat { position: relative; border: 0; cursor: pointer; }
.trk-ava-shop svg.ic { width: 20px; height: 20px; }

.chat-entry { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center; width: 100%; padding: 14px 16px; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.chat-entry-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--trk-soft); color: var(--trk); }
.chat-entry-ic svg.ic { width: 18px; height: 18px; }
.chat-entry-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chat-entry-main .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer .chat-entry { margin-bottom: 14px; }

.modal.chat-modal { display: flex; flex-direction: column; height: min(760px, calc(100dvh - 48px)); overflow: hidden; padding-bottom: 14px; }
.chat-modal .modal-head { margin-bottom: 10px; align-items: center; }
.chat-head-t { flex: 1; min-width: 0; }
.chat-modal .modal-title, .chat-inbox .modal-title { font-size: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-sub { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.chat-ph { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 16px; }
.chat-ph img { width: 100%; height: 100%; object-fit: contain; }
.chat-ph svg.ic { width: 22px; height: 22px; }
.chat-ph-team { border-radius: 50%; background: var(--trk-dark); color: #fff; }

.chat-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 4px; padding: 6px 2px 12px; margin: 0 -4px; }
.chat-list > :first-child { margin-top: auto; } /* few messages sit by the send box, like a chat app */
.chat-day { align-self: center; margin: 10px 0 6px; padding: 3px 10px; border-radius: 999px; background: rgb(47 30 38 / 0.06); font-size: 11.5px; color: var(--muted); }
.chat-empty { margin: auto; display: grid; justify-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.chat-empty svg.ic { width: 28px; height: 28px; opacity: 0.6; }
.chat-msg { display: flex; align-items: flex-end; gap: 8px; max-width: 86%; }
.chat-msg.is-first { margin-top: 8px; }
.chat-msg.is-mine { align-self: flex-end; }
.chat-ava { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; font: 700 11px/1 var(--sans); }
.chat-msg:not(.is-first) .chat-ava { visibility: hidden; }
.chat-ava.r-driver { background: var(--trk-soft); color: #b8441f; }
.chat-ava.r-owner { background: var(--blush); color: var(--accent); }
.chat-ava.r-florist { background: var(--sage); color: var(--ok); }
.chat-bub { min-width: 0; padding: 9px 13px 7px; border-radius: 20px 20px 20px 6px; background: #fff; box-shadow: var(--shadow); }
.is-mine .chat-bub { border-radius: 20px 20px 6px 20px; background: var(--trk-dark); color: #fff; box-shadow: none; }
.chat-from { font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.chat-text { font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.chat-time { margin-top: 3px; font-size: 10.5px; color: var(--muted); text-align: right; }
.is-mine .chat-time { color: rgb(255 255 255 / 0.55); }

.chat-quick { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 0 10px; margin: 0 -2px; }
.chat-quick::-webkit-scrollbar { display: none; }
.chat-q { flex: none; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--of-edge, var(--line)); background: #fff; color: var(--ink); font: 500 13px var(--sans); white-space: nowrap; cursor: pointer; }
.chat-q:hover { border-color: var(--trk); color: #b8441f; }
.chat-form { display: flex; gap: 2px; align-items: center; padding: 6px 6px 6px 16px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); }
.chat-input { flex: 1; min-width: 0; border: 0; background: none; font: 400 15px var(--sans); color: var(--ink); padding: 8px 0; outline: none; }
.chat-form:focus-within { box-shadow: 0 0 0 2px color-mix(in srgb, var(--trk) 45%, transparent), var(--shadow); }
.chat-send { display: grid; place-items: center; flex: none; margin-left: 4px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--trk); color: #fff; cursor: pointer; }
.chat-send:hover { background: #dc5a34; }
.chat-send svg.ic { width: 18px; height: 18px; stroke-width: 2.4; }
.chat-note { margin-top: 10px; font-size: 11.5px; color: var(--muted); text-align: center; }

.chat-rows { display: grid; gap: 8px; }
.chat-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 12px 14px; border: 0; border-radius: 22px; background: #fff; box-shadow: var(--shadow); text-align: left; color: inherit; font: inherit; cursor: pointer; }
.chat-row:hover { box-shadow: var(--shadow-lift); }
.chat-row-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.chat-row-top { display: flex; justify-content: space-between; gap: 8px; }
.chat-row-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.chat-row-when { flex: none; font-size: 11.5px; color: var(--muted); }
.chat-row-sub { font-size: 12px; color: var(--muted); }
.chat-row-prev { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row.is-unread .chat-row-prev { color: var(--ink); font-weight: 500; }

/* Photos, WhatsApp style: attach and camera inside the bar, a preview to
   caption before sending, the photo fills its bubble, tap for full screen. */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.chat-att { position: relative; display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; color: var(--muted); cursor: pointer; }
.chat-att:hover { color: var(--trk); background: var(--trk-soft); }
.chat-att svg.ic { width: 20px; height: 20px; }
.chat-att input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.chat-att:has(input:focus-visible) { outline: 2px solid var(--trk); outline-offset: 1px; }
.chat-pending { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; padding: 8px; border-radius: 20px; background: #fff; box-shadow: var(--shadow); }
.chat-pending[hidden] { display: none; }
.chat-pending img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; flex: none; }
.chat-pending-t { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); }
.chat-pending-x { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--canvas); color: var(--ink); cursor: pointer; flex: none; }
.chat-pending-x svg.ic { width: 16px; height: 16px; }
.chat-bub.has-photo { padding: 4px 4px 6px; }
.chat-bub.has-photo .chat-from, .chat-bub.has-photo .chat-text, .chat-bub.has-photo .chat-time { padding: 0 9px; }
.chat-bub.has-photo .chat-from { padding-top: 5px; }
.chat-img { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 16px; overflow: hidden; }
.chat-img img { display: block; width: 100%; max-width: 240px; max-height: 300px; object-fit: cover; }
.chat-img + .chat-text { margin-top: 5px; }
.chat-lightbox { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 56px 12px 24px; background: rgb(20 16 17 / 0.94); border-radius: inherit; cursor: zoom-out; animation: fade 0.2s ease both; }
.chat-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 12px; }
.chat-lightbox .icon-btn { position: absolute; top: 14px; right: 14px; background: rgb(255 255 255 / 0.14); color: #fff; box-shadow: none; }

@media (max-width: 560px) {
  .modal.chat-modal { height: 92dvh; padding: 26px 14px 12px; }
  .chat-modal::before, .chat-inbox::before { content: ''; position: absolute; top: 9px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: rgb(47 30 38 / 0.18); }
  .modal.chat-inbox { padding-top: 26px; }
  .chat-modal .modal-title, .chat-inbox .modal-title { font-size: 22px; }
  .chat-ph { width: 42px; height: 42px; }
  .chat-att.mob-only { display: grid !important; }
  .chat-input { font-size: 16px; } /* 16px stops iPhone zooming in on focus */
  .chat-msg { max-width: 90%; }
}

/* ---------- Phone top bar: only Messages and a menu button ----------
   Role, language and lock live in a side menu (like Facebook) on phones.
   Desktop keeps them in the bar and never shows the menu button. */
.tb-menu { display: none; padding: 0; width: 36px; height: 36px; justify-content: center; }
.tb-menu svg.ic { width: 18px; height: 18px; }
@media (max-width: 560px) {
  .tb-role, .tb-lock, .topbar .lang { display: none; }
  .tb-menu { display: inline-flex; }
  .tb-chat, .tb-menu { width: 40px; height: 40px; }
  .tb-chat svg.ic { width: 18px; height: 18px; }
  .tb-right { gap: 8px; }
}
.modal.side-menu {
  left: auto; right: 0; top: 0; bottom: 0; transform: none; width: min(340px, 86vw); max-height: none; height: 100dvh;
  border-radius: 28px 0 0 28px; padding: max(20px, env(safe-area-inset-top)) 18px 24px; display: flex; flex-direction: column;
  animation: menu-in 0.28s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes menu-in { from { transform: translateX(40px); opacity: 0; } }
.menu-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.menu-head > div { flex: 1; min-width: 0; }
.menu-name { font: 600 18px/1.2 var(--of-serif); color: var(--of-green-ink); }
.menu-k { margin: 0 4px 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.menu-group { display: grid; gap: 2px; padding: 4px; margin-bottom: 20px; border-radius: 20px; background: #fff; box-shadow: var(--shadow); }
.menu-gap { margin-top: 4px; }
.menu-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 6px 12px 6px 8px; border: 0; border-radius: 16px; background: none; color: var(--ink); font: 500 15px var(--sans); text-align: left; cursor: pointer; }
.menu-row:hover { background: var(--canvas); }
.menu-row.is-on { background: var(--soft); }
.menu-row-t { flex: 1; }
.menu-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--canvas); color: var(--ink); flex: none; }
.menu-row.is-on .menu-ic { background: var(--accent); color: var(--on-accent); }
.menu-ic svg.ic { width: 17px; height: 17px; }
.menu-check { color: var(--accent); }
.menu-check svg.ic { width: 18px; height: 18px; stroke-width: 2.6; }
.menu-lang { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 20px; padding: 4px; }
.menu-lang button { padding: 10px; font-size: 14px; }
.menu-foot { margin-top: auto; padding: 0 4px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.menu-foot .dot { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--accent); vertical-align: middle; }

/* ---------- Chat alerts: banner, and the switches in the Messages list ---------- */
#chat-banner-root { position: fixed; left: 0; right: 0; top: max(10px, env(safe-area-inset-top)); z-index: 90; display: flex; justify-content: center; padding: 0 10px; pointer-events: none; }
.chat-banner { pointer-events: auto; display: flex; align-items: center; gap: 4px; width: min(440px, 100%); padding: 6px 6px 6px 8px; border-radius: 22px; background: var(--trk-dark); color: #fff; box-shadow: 0 18px 40px -16px rgb(0 0 0 / 0.55); animation: drop 0.32s cubic-bezier(.2,.7,.2,1) both; }
@keyframes drop { from { transform: translateY(-24px); opacity: 0; } }
.chat-banner-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 4px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.chat-banner-main .chat-ava { width: 36px; height: 36px; }
.chat-banner-t { min-width: 0; display: flex; flex-direction: column; }
.chat-banner-t strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-banner-t span { font-size: 14px; color: rgb(255 255 255 / 0.75); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-banner-x { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgb(255 255 255 / 0.1); color: #fff; cursor: pointer; }
.chat-banner-x svg.ic { width: 15px; height: 15px; }
.chat-set-k { margin-top: 20px; }
.chat-sets { display: grid; gap: 2px; padding: 4px; border-radius: 20px; background: #fff; box-shadow: var(--shadow); }
.chat-set { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 16px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.chat-set:hover:not(:disabled) { background: var(--canvas); }
.chat-set:disabled { cursor: default; }
.chat-set-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-set-t strong { font-size: 14.5px; font-weight: 500; }
.chat-set-t span { font-size: 12px; color: var(--muted); }
.chat-switch { position: relative; flex: none; width: 46px; height: 28px; border-radius: 999px; background: #ddd5d1; transition: background 0.2s ease; }
.chat-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.2); transition: transform 0.2s ease; }
.chat-set[aria-checked='true'] .chat-switch { background: var(--trk); }
.chat-set[aria-checked='true'] .chat-switch::after { transform: translateX(18px); }
.chat-set:disabled .chat-switch { opacity: 0.45; }

/* ---------- Home Screen app (js/install.js) ---------- */
.chat-install-ic { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 12px; background: var(--accent); color: var(--on-accent); }
.chat-install-ic svg.ic { width: 18px; height: 18px; }
div.chat-install { cursor: default; }
div.chat-install:hover { background: none; }
.chat-install-go { flex: none; padding: 7px 14px; border-radius: 999px; background: var(--trk); color: #fff; font-size: 13px; font-weight: 600; }
.chat-install-ok { flex: none; color: var(--ok); }
.chat-install-ok svg.ic { width: 18px; height: 18px; stroke-width: 2.6; }
.menu-install { margin-bottom: 12px; }
/* Opened from the Home Screen: keep clear of the notch and the home bar. */
@media (display-mode: standalone) {
  .topbar { padding-top: max(12px, env(safe-area-inset-top)); }
}

/* ---------- Customer tracking page (track.html, js/customer.js) ----------
   What the person who ordered sees from the shop's link. One column, phone
   first: a white status card with the order's own four-dot line, then the
   dark updates card (it borrows the dark sheet's .track-modal styles). */
body.cust { min-height: 100vh; min-height: 100dvh; }
.cust-page { display: grid; gap: 14px; max-width: 520px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); outline: none; }
.cust-bar { display: flex; align-items: center; gap: 12px; padding: 4px 2px 6px; }
.cust-brand { flex: 1; min-width: 0; }
.cust-name { font: 500 19px/1.1 var(--display); letter-spacing: -0.02em; }
.cust-card { display: grid; gap: 14px; padding: 20px 20px 18px; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.cust-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.cust-card .trk-line { margin-top: 26px; }
.cust-steps { position: relative; height: 2.8em; margin: -8px 11px 0; padding: 0; list-style: none; font-size: 11.5px; line-height: 1.25; color: var(--muted); }
.cust-steps li { position: absolute; top: 0; max-width: 31%; transform: translateX(-50%); text-align: center; }
.cust-steps li:nth-child(1) { left: 0; transform: translateX(-11px); text-align: left; }
.cust-steps li:nth-child(2) { left: 33.333%; }
.cust-steps li:nth-child(3) { left: 66.667%; }
.cust-steps li:nth-child(4) { right: 0; transform: translateX(11px); text-align: right; }
.cust-steps li.is-on { color: var(--ink); }
.cust-steps li[aria-current] { font-weight: 600; color: var(--trk); }
.cust-note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: var(--canvas); font-size: 12.5px; color: var(--muted); }
.cust-note svg.ic { flex: none; width: 15px; height: 15px; margin-top: 1px; }
.cust-dark { display: grid; gap: 14px; padding: 20px; border-radius: var(--r-card); background: var(--trk-dark); color: #f7f2ef; }
.cust-dark .trk-tl { margin-top: -4px; }
.cust-dark .trk-proof img { max-height: 300px; }
.cust-miss { padding: 8px; }
.cust-foot { display: grid; gap: 6px; padding: 6px 8px 0; text-align: center; font-size: 12px; color: var(--muted); }
.cust-foot .dot { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
@media (min-width: 768px) {
  .cust-page { padding-top: 40px; gap: 16px; }
  .cust-card, .cust-dark { padding: 26px; }
}

/* Staff side: the share action (order drawer, dark tracking sheet) and its text. */
.track-modal .btn.trk-share { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; border-radius: 18px; border-color: transparent; background: rgb(255 255 255 / 0.08); color: #fff; font: 600 14.5px var(--sans); letter-spacing: 0; cursor: pointer; }
.track-modal .btn.trk-share:hover { background: rgb(255 255 255 / 0.14); color: #fff; border-color: transparent; }
.trk-share svg.ic { width: 18px; height: 18px; }
.share-lede { margin-top: 6px; font-size: 14px; }
.share-sms { margin-top: 14px; }
.share-note { margin-top: 10px; }
.share-foot .btn { flex: 1 1 auto; justify-content: center; }

/* Customer chat (tracking page): the customer's avatar and entry cards. */
.chat-ava.r-customer, .trk-ava.trk-ava-cust { background: #e4ecf6; color: #2f5d8a; }
.chat-entry-ic.is-cust { background: #e4ecf6; color: #2f5d8a; }
.cust-chat { border: 0; }
