/* Car Care Queue – black / brand green / yellow, built for phones and all ages */
:root {
  --ink: #111111;
  --muted: #4A5361;
  --line: #E2E6EB;
  --line-strong: #A9B0B9;
  --bg: #F4F4F1;
  --card: #FFFFFF;
  --green: #1E7B34;        /* actions; white text passes 5:1 */
  --green-ink: #14532D;
  --green-soft: #EAF6EC;
  --logo-green: #3DAE2B;   /* decorative only */
  --yellow: #FFC72C;
  --yellow-soft: #FFE68A;
  --red: #B91C1C;
  --radius: 14px;
  --font: 'IBM Plex Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ink); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.app { max-width: 560px; margin: 0 auto; min-height: 100dvh; position: relative; padding-bottom: 96px; }
.app.no-nav { padding-bottom: 24px; }

/* header */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 8px;
  background: var(--ink); color: #fff; border-bottom: 3px solid var(--logo-green); }
.top h1 { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.25; }
.top .sub { font-size: 14px; color: #C8C8C8; }
.top .grow { flex: 1; min-width: 0; padding-left: 4px; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px;
  border: 1px solid transparent; background: transparent; color: inherit; cursor: pointer; text-decoration: none; flex-shrink: 0; }
.top .icon-btn.outline { border-color: #4A4A4A; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 12px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.pill.yellow { background: var(--yellow); color: var(--ink); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 10px 16px 0; }
.steps span { height: 4px; border-radius: 2px; background: #D5DBE1; }
.steps span.on { background: var(--green); }

main { padding: 14px 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card.warn { border: 2px solid #F0B44C; }
.card h2 { margin: 0; font-size: 17px; font-weight: 600; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.big { font-size: 22px; font-weight: 700; }
.center { text-align: center; }
.hidden { display: none !important; }

/* forms */
label.f { font-size: 15px; font-weight: 600; display: block; margin-bottom: 6px; }
.field { display: flex; flex-direction: column; }
.input, select.input, textarea.input { width: 100%; min-height: 50px; border-radius: 12px; border: 1px solid var(--line-strong); background: #fff;
  padding: 0 12px; font-size: 17px; }
textarea.input { padding: 10px 12px; min-height: 84px; resize: vertical; }
.input:focus { border-color: var(--green); outline: 2px solid var(--green-soft); }
.plate { border: 2px solid var(--ink); border-radius: 12px; padding: 8px 12px; display: flex; flex-direction: column; align-items: center; background: #fff; }
.plate input { width: 100%; border: none; outline: none; text-align: center; font-size: 32px; font-weight: 700; letter-spacing: 2px; background: transparent; }
.plate select { border: none; background: transparent; font-size: 16px; text-align: center; text-align-last: center; max-width: 100%; }

/* buttons */
.btn { min-height: 52px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: #fff; font-size: 17px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; cursor: pointer; text-decoration: none; color: var(--ink); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.soft { background: var(--green-soft); border-color: var(--green); color: var(--green-ink); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.line { background: #06C755; border-color: #06C755; color: #04230F; font-weight: 700; }
.btn.danger { color: #991B1B; border-color: var(--red); }
.btn.block { width: 100%; }
.btn.lg { min-height: 58px; font-size: 18px; }
.btn.sm { min-height: 44px; font-size: 15px; padding: 0 14px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.chip { min-height: 44px; padding: 0 12px; border-radius: 22px; border: 1px solid var(--line-strong); background: #fff; display: inline-flex;
  align-items: center; gap: 8px; font-size: 15px; cursor: pointer; }
.chip.on { border: 2px solid var(--green); background: var(--green-soft); }
.swatch { width: 22px; height: 22px; border-radius: 11px; border: 1px solid #9AA3AE; }
.seg { display: grid; gap: 6px; background: #E4E5E1; padding: 4px; border-radius: 12px; }
.seg button { min-height: 44px; border-radius: 9px; border: none; background: transparent; font-size: 16px; font-weight: 600; cursor: pointer; }
.seg button.on { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.wrap { display: flex; flex-wrap: wrap; gap: 8px; }

/* bottom bar for wizard steps */
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line);
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
.bottom .inner { max-width: 528px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }

/* when a screen has both the step bar and the tab bar, stack the step bar above the tabs */
.app.has-tabs .bottom { bottom: calc(72px + env(safe-area-inset-bottom)); padding-bottom: 12px; box-shadow: 0 -4px 12px rgba(0,0,0,.06); }
.app.has-tabs.has-bottom { padding-bottom: 170px; }

/* tab bar */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line);
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); }
.tabs .inner { max-width: 560px; margin: 0 auto; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.tabs a { min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 13px;
  color: var(--muted); text-decoration: none; font-weight: 500; }
.tabs a .ic { width: 48px; height: 28px; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.tabs a.on { color: var(--green-ink); font-weight: 700; }
.tabs a.on .ic { background: var(--green-soft); }

/* service options */
.opt { text-align: left; width: 100%; padding: 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); display: flex; gap: 12px;
  align-items: flex-start; cursor: pointer; }
.opt.on { border: 2px solid var(--green); }
.box { width: 26px; height: 26px; border-radius: 8px; border: 2px solid #9AA3AE; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; }
.opt.on .box { background: var(--green); border-color: var(--green); }
.price { font-size: 17px; font-weight: 700; white-space: nowrap; }

/* inspection diagram */
.car-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.car { position: relative; width: 240px; height: 440px; }
.car svg { position: absolute; inset: 0; }
.zone { position: absolute; border-radius: 10px; border: 1.5px dashed #B4BCC6; background: rgba(30,123,52,0.05); padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; }
.zone .n { width: 26px; height: 26px; border-radius: 13px; color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center;
  justify-content: center; box-shadow: 0 0 0 2px #fff; }
.side-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.vert { writing-mode: vertical-rl; }
.mark-row { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 10px; border-radius: 10px; background: #F6F8FA; }
.dot { width: 24px; height: 24px; border-radius: 12px; color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.check { min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 15px; cursor: pointer; }
.check.on { border: 1.5px solid var(--green); background: var(--green-soft); }
.check input { width: 20px; height: 20px; accent-color: var(--green); margin: 0; }
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.photos .ph { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #DDE3E9; }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos .ph button { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 16px; border: none; background: rgba(0,0,0,.6); color: #fff; }
.photos label.add { aspect-ratio: 1; border-radius: 12px; border: 1.5px dashed var(--green); background: var(--green-soft); color: var(--green-ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 14px; font-weight: 600; cursor: pointer; }
.ok-banner { background: var(--green-soft); border: 1px solid #B7E0C6; border-radius: 14px; padding: 14px 16px; color: var(--green-ink); font-size: 15px; }

/* queue */
.qcard { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.qno { font-size: 26px; font-weight: 700; min-width: 80px; }
.status { padding: 4px 10px; border-radius: 12px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.st-IN_QUEUE { background: #EEF0F3; color: #3A4452; }
.st-IN_PROGRESS { background: var(--yellow-soft); color: #4A3600; }
.st-QC { background: #FFF1DC; color: #7C3A06; }
.st-READY { background: #DCF5E4; color: var(--green-ink); }
.st-DELIVERED, .st-REGISTERED { background: #EEF0EC; color: var(--muted); }
.filter { display: flex; gap: 6px; overflow-x: auto; padding: 0 16px 12px; background: var(--ink); }
.filter button { min-height: 40px; padding: 0 12px; border-radius: 20px; border: 1px solid #5A5A5A; background: transparent; color: #fff;
  font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; flex-shrink: 0; }
.filter button.on { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.fab { position: fixed; right: max(16px, calc(50% - 264px)); bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 25; min-height: 56px; padding: 0 20px; border-radius: 28px;
  background: var(--green); color: #fff; display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; text-decoration: none;
  box-shadow: 0 6px 16px rgba(17,17,17,.25); }

/* ticket */
.ticket-page { background: var(--ink); min-height: 100dvh; }
.ticket { background: #fff; border-radius: 20px; padding: 24px 20px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ticket .no { font-size: 72px; font-weight: 700; line-height: 1.1; letter-spacing: 2px; }
.stats3 { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed #C9D0D8; text-align: center; }

/* tracking */
.hero { border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 6px; color: #fff; background: #3A4452; }
.hero.s-IN_PROGRESS { background: var(--yellow); color: var(--ink); }
.hero.s-QC { background: #9A4A07; }
.hero.s-READY, .hero.s-DELIVERED { background: var(--green); }
.stepper { list-style: none; margin: 0; padding: 0; }
.stepper li { display: flex; gap: 14px; min-height: 64px; }
.stepper .rail { display: flex; flex-direction: column; align-items: center; width: 28px; }
.stepper .b { width: 28px; height: 28px; border-radius: 14px; border: 2px solid #B4BCC6; background: #fff; display: flex; align-items: center;
  justify-content: center; font-size: 13px; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.stepper .l { flex: 1; width: 2px; background: var(--line); margin: 4px 0; }
.stepper li.done .b, .stepper li.now .b { background: var(--green); border-color: var(--green); color: #fff; }
.stepper li.done .l { background: var(--green); }
.stepper li:last-child .l { display: none; }
.stepper li.now .t { font-weight: 700; }

/* report */
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; }
.bars { height: 170px; display: flex; align-items: flex-end; gap: 6px; border-bottom: 1px solid #C9D0D8; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.bars .bar i { display: block; width: 100%; max-width: 32px; border-radius: 6px 6px 0 0; background: #A7D3A0; }
.bars .bar.hi i { background: var(--green); }
.bars .bar b { font-size: 13px; }
.blabels { display: flex; gap: 6px; }
.blabels span { flex: 1; text-align: center; font-size: 13px; color: var(--muted); }
.meter { height: 8px; border-radius: 4px; background: #EEF0EC; }
.meter i { display: block; height: 8px; border-radius: 4px; background: var(--green); }

/* locked (free plan) */
.locked { position: relative; min-height: 60vh; }
.locked .skel { padding: 16px; display: flex; flex-direction: column; gap: 10px; filter: blur(3px); opacity: .75; }
.skel .sk { background: #fff; border: 1px solid var(--line); border-radius: 16px; height: 84px; }
.lockcard { position: absolute; left: 20px; right: 20px; top: 40%; transform: translateY(-50%); background: #fff; border-radius: 20px; padding: 22px 20px;
  box-shadow: 0 10px 30px rgba(17,17,17,.18); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.lockcard .lk { width: 56px; height: 56px; border-radius: 28px; background: var(--ink); color: var(--yellow); display: flex; align-items: center; justify-content: center; }
.quota { padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.quota .meter { height: 10px; border-radius: 5px; }
.quota .meter i { height: 10px; border-radius: 5px; }

/* watermark: faint shop logo over the page; never blocks taps */
.wm { position: fixed; inset: 0; z-index: 15; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.wm img { width: min(92vw, 520px); filter: grayscale(1) invert(1); mix-blend-mode: multiply; }
.wm.dark img { filter: none; mix-blend-mode: screen; }

/* misc */
.toast { position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100; max-width: 92vw;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 15px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.err { background: var(--red); }
.sheet-bg { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; background: #fff; border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px; }
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp input { height: 58px; border-radius: 12px; border: 1px solid var(--line-strong); text-align: center; font-size: 26px; font-weight: 700; min-width: 0; padding: 0; }
.login-hero { background: var(--ink); height: 240px; display: flex; align-items: center; justify-content: center; border-bottom: 3px solid var(--logo-green); }
.login-hero img { width: 112px; height: 112px; border-radius: 26px; }
.code-input { font-family: ui-monospace, Menlo, monospace; text-transform: uppercase; letter-spacing: 2px; text-align: center; font-size: 22px; font-weight: 700; }
.plan-opt { text-align: left; width: 100%; background: #fff; border-radius: 16px; border: 1px solid var(--line); padding: 14px 16px; display: flex;
  align-items: center; gap: 12px; cursor: pointer; }
.plan-opt.on { border: 2px solid var(--green); }
.radio { width: 24px; height: 24px; border-radius: 12px; border: 2px solid var(--line-strong); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.plan-opt.on .radio { border-color: var(--green); }
.plan-opt.on .radio::after { content: ''; width: 12px; height: 12px; border-radius: 6px; background: var(--green); }
.mono { font-family: ui-monospace, Menlo, monospace; }
.spin { padding: 48px 0; text-align: center; color: var(--muted); }
@media (min-width: 600px) { .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
