/* The Momo Factory brand styles, shared by every page. */
:root {
  --saffron: #E8832A; --crimson: #C0392B; --fog: #9E9080;
  --page: #F7F2EA; --surface: #FFFDF9; --well: #EFE8DC; --line: #DDD4C6;
  --text: #1A1208; --muted: #6B6053;
  --accent: #E8832A; --on-accent: #1A1208; --alert: #C0392B; --ok: #2E7D4F;
  --strong: #1A1208; --on-strong: #F7F2EA; --focus: #1A1208;
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #1A1208; --surface: #261C11; --well: #31261A; --line: #43362A;
    --text: #F7F2EA; --muted: #BBAF9F; --alert: #E86455; --ok: #6CC290;
    --strong: #F7F2EA; --on-strong: #1A1208; --focus: #E8832A;
  }
}
:root[data-theme="dark"] {
  --page: #1A1208; --surface: #261C11; --well: #31261A; --line: #43362A;
  --text: #F7F2EA; --muted: #BBAF9F; --alert: #E86455; --ok: #6CC290;
  --strong: #F7F2EA; --on-strong: #1A1208; --focus: #E8832A;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; background: var(--page); color: var(--text);
  font: 400 17px/1.5 var(--font); -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { touch-action: manipulation; cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; font-weight: 400; }
ul, ol { list-style: none; }
b, strong { font-weight: 500; }
a { color: inherit; text-underline-offset: 3px; text-decoration-color: var(--saffron); }
img { max-width: 100%; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.themebtn { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); }
.themebtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.themebtn .sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .themebtn .sun { display: block; }
  :root:not([data-theme="light"]) .themebtn .moon { display: none; }
}
:root[data-theme="dark"] .themebtn .sun { display: block; }
:root[data-theme="dark"] .themebtn .moon { display: none; }
.themebar { display: flex; justify-content: flex-end; padding-top: 10px; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* logo */
.logo { display: block; }
.logo img, img.logo { display: block; width: 100%; height: auto; }
.mark { display: block; width: 56px; height: auto; }

/* layout */
.wrap { max-width: 560px; margin: 0 auto; padding: 4px 16px 40px; }
.wide { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
body.has-bar .wrap, body.has-bar main { padding-bottom: 120px; }

/* brand header */
.hero { position: relative; text-align: center; padding: 14px 0 64px; margin-bottom: 18px; overflow: hidden; }
.hero .logo { width: min(100%, 420px); margin: 0 auto 12px; }
.rule { display: block; width: 44px; height: 2px; margin: 14px auto 12px; background: var(--saffron); border-radius: 2px; }
.tagline { font-weight: 300; font-style: italic; letter-spacing: .1em; font-size: 17px; }
.where { margin-top: 6px; font-size: 15px; color: var(--muted); }
.ridge { position: absolute; bottom: 0; width: min(46%, 230px); height: auto; }
.ridge.l { left: -14px; } .ridge.r { right: -14px; transform: scaleX(-1); }
.eyebrow { font-size: 13px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--saffron); }

/* cards and controls */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px 16px 18px; margin-bottom: 18px; }
.card h2 { font-weight: 500; font-size: 24px; line-height: 1.2; letter-spacing: -.01em; }
.card .lede, .lede { color: var(--muted); font-size: 15px; margin: 4px 0 16px; }
.grp { margin-bottom: 16px; }
.grp > h3 { font-weight: 500; font-size: 15px; line-height: 1.2; margin: 0 0 8px; color: var(--muted); }
.opts { display: grid; gap: 8px; }
.opts.c2 { grid-template-columns: repeat(2, 1fr); }
.opts.c3 { grid-template-columns: repeat(3, 1fr); }
.chip { min-height: 54px; text-align: left; padding: 10px 13px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); font-weight: 500; line-height: 1.25; }
.chip small { display: block; font-weight: 400; font-size: 14px; margin-top: 2px; opacity: .8; }
.chip[aria-pressed="true"] { background: var(--strong); color: var(--on-strong); border-color: var(--strong); }
.chip:disabled { opacity: .55; cursor: not-allowed; background: var(--well); }
.chip.mid { text-align: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border: 1.5px solid var(--text); border-radius: 999px; background: transparent; color: var(--text); font-weight: 500; text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.dark { background: var(--strong); color: var(--on-strong); border-color: var(--strong); }
.btn.primary:active, .btn.dark:active { filter: brightness(.94); }
.btn.big { width: 100%; min-height: 58px; font-size: 18px; }
.btn.small { min-height: 38px; padding: 6px 14px; font-size: 15px; }
.btn.quiet { border-color: transparent; text-decoration: underline; text-underline-offset: 3px; font-weight: 400; min-height: 44px; padding: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.xrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.xrow:first-child { border-top: 0; }
.xrow b { display: block; font-weight: 500; }
.xrow small { color: var(--muted); font-size: 15px; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; flex: none; background: var(--surface); }
.stepper button { width: 46px; height: 44px; border: 0; background: transparent; font-size: 22px; line-height: 1; }
.stepper button:disabled { opacity: .35; }
.stepper output { min-width: 28px; text-align: center; font-weight: 500; }
.soldtag { font-weight: 500; color: var(--muted); }
.notice { background: var(--surface); border: 1.5px solid var(--alert); border-radius: 12px; padding: 10px 12px; font-size: 15px; margin-bottom: 12px; }
.ok-notice { border-color: var(--ok); }
.field { display: block; margin-top: 12px; }
.field > span { display: block; font-weight: 500; margin-bottom: 6px; font-size: 15px; }
.field input, .field select, .field textarea { width: 100%; min-height: 50px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 17px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--text); outline: none; }
.field textarea { min-height: 90px; resize: vertical; }
.fields2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.err { color: var(--alert); font-weight: 500; font-size: 15px; margin-top: 8px; }
.hint { color: var(--muted); font-size: 15px; margin: 10px 0 14px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; background: var(--well); color: var(--text); vertical-align: middle; }
.badge.paid { background: var(--ok); color: #fff; }
.badge.warn { background: var(--alert); color: #fff; }

/* bottom bar and sheet */
#bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px)); pointer-events: none; }
#bar button { pointer-events: auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; max-width: 528px; margin: 0 auto; min-height: 60px; padding: 10px 22px; border: 0; border-radius: 999px; background: var(--strong); color: var(--on-strong); font-weight: 500; font-size: 17px; box-shadow: 0 8px 24px rgba(26, 18, 8, .22); }
#bar .count { display: inline-flex; align-items: center; gap: 10px; }
#bar .count i { font-style: normal; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; background: var(--saffron); color: #1A1208; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
#bar button.bump { animation: bump .28s ease-out; }
@keyframes bump { 40% { transform: scale(1.03); } }
#sheet { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; justify-content: flex-end; }
.backdrop { position: absolute; inset: 0; background: rgba(26, 18, 8, .55); }
.panel { position: relative; background: var(--surface); color: var(--text); border-radius: 24px 24px 0 0; max-height: 92%; overflow-y: auto; width: 100%; max-width: 560px; margin: 0 auto; padding: 18px 18px calc(22px + env(safe-area-inset-bottom, 0px)); overscroll-behavior: contain; }
.panel header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.panel h2 { font-weight: 500; font-size: 24px; outline: none; }
.line { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.line .what { flex: 1; min-width: 0; }
.line .what b { display: block; font-weight: 500; line-height: 1.25; }
.line .what small { color: var(--muted); font-size: 14px; }
.sum { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); }
.sum.total { border-top: 1px solid var(--text); font-weight: 500; padding: 14px 0; }
.sum.total b { font-weight: 500; font-size: 30px; line-height: 1; }
.seg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }

/* order docket */
.docket { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 24px 20px 78px; margin: 8px 0 20px; text-align: center; }
.docket .logo { width: min(78%, 280px); margin: 0 auto 8px; }
.docket .who { color: var(--muted); font-size: 15px; margin-top: 10px; }
.docket .num { font-weight: 500; font-size: clamp(116px, 40vw, 190px); line-height: .92; letter-spacing: -.04em; margin: 6px 0 10px; font-variant-numeric: tabular-nums; }
.docket .msg { font-weight: 500; font-size: 20px; line-height: 1.3; max-width: 24ch; margin: 0 auto; }
.docket .sub { color: var(--muted); margin-top: 6px; }
.steps { display: flex; gap: 6px; margin: 22px 0 4px; }
.steps li { flex: 1; padding: 10px 4px 0; font-size: 14px; font-weight: 500; color: var(--muted); border-top: 3px solid var(--line); }
.steps li.past { border-color: var(--saffron); color: var(--text); }
.steps li.on { border-color: var(--crimson); color: var(--text); }
.docket .items { text-align: left; margin-top: 20px; border-top: 1px dashed var(--fog); padding-top: 12px; font-size: 16px; }
.docket .items li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.docket .items small { display: block; color: var(--muted); font-size: 14px; }
.docket .tot { display: flex; justify-content: space-between; font-weight: 500; margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--fog); }
.docket .ridge { width: min(52%, 240px); }
.docket.ready { background: #1A1208; color: #F7F2EA; border-color: #1A1208; animation: arrive .6s ease-out 1; }
.docket.ready .num { color: #E8832A; }
.docket.ready .who, .docket.ready .sub, .docket.ready .items small { color: #CFC4B4; }
.docket.ready .steps li { color: #CFC4B4; border-color: #4A3D2E; }
.docket.ready .steps li.past, .docket.ready .steps li.on { border-color: #E8832A; color: #F7F2EA; }
.docket.gone .num { opacity: .3; }
.paybox { background: var(--well); border-radius: 16px; padding: 14px; margin: 0 0 14px; text-align: center; }
.paybox p { margin-bottom: 10px; font-size: 15px; }
@keyframes arrive { 0% { transform: scale(.97); } 60% { transform: scale(1.015); } 100% { transform: none; } }
.row-actions { display: flex; gap: 10px; justify-content: center; margin: 12px 0; flex-wrap: wrap; }
.row-actions .btn { flex: 1; min-width: 130px; }

#toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 40; background: #1A1208; color: #F7F2EA; border: 1px solid #E8832A; padding: 10px 18px; border-radius: 999px; font-weight: 500; font-size: 15px; width: max-content; max-width: min(92vw, 460px); text-align: center; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
