/* V Station · iPad seller app. Tokens are the ones in the S3 mockup: app bar #1B2464, brand #28338C,
   gold #FAB001, OCR blue #EEF2FF, "needs a look" yellow #FFF6E1, success #2E844A, error #BA0517. */
:root {
  --navy: #1B2464;
  --brand: #28338C;
  --gold: #FAB001;
  --ocr: #EEF2FF;
  --check: #FFF6E1;
  --ok: #2E844A;
  --error: #BA0517;
  --ink: #1B2033;
  --muted: #5E6478;
  --line: #E3E6F0;
  --page: #F4F6FB;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(27, 36, 100, .12), 0 8px 24px rgba(27, 36, 100, .06);
  font-family: "IBM Plex Sans Thai", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { background: var(--page); color: var(--ink); font-size: 16px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

#boot-error {
  position: fixed; inset: auto 12px 12px 12px; z-index: 9999; background: #2a1215; color: #ffb4a9;
  border: 1px solid #5c2b2e; border-radius: 10px; padding: 10px 14px; font-size: 13px; white-space: pre-wrap;
}
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }

.app { min-height: 100%; display: flex; flex-direction: column; }

/* ---------------------------------------------------------------- app bar */
.bar {
  flex: none; display: flex; align-items: center; gap: 14px; background: var(--navy); color: #fff;
  padding: 0 20px; height: 66px; border-bottom: 3px solid var(--gold);
  padding-top: env(safe-area-inset-top, 0px); height: calc(66px + env(safe-area-inset-top, 0px));
}
.bar__logo { width: 38px; height: 38px; border-radius: 9px; background: var(--gold); color: var(--navy);
  display: grid; place-items: center; font-weight: 700; flex: none; }
.bar__title { font-size: 16px; font-weight: 700; white-space: nowrap; }
.bar__subtitle { font-size: 13px; color: #A9B4E4; }
.bar__context { font-size: 12px; color: #B9C2E8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar__right { margin-left: auto; display: flex; align-items: center; gap: 12px; flex: none; }
.bar__avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: var(--navy);
  display: grid; place-items: center; font-weight: 700; }
.pill { display: inline-flex; align-items: center; gap: 7px; border-radius: 20px; padding: 0 13px; height: 31px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill--online { background: rgba(69, 198, 90, .16); color: #9AEBAE; border: 1px solid rgba(69, 198, 90, .45); }
.pill--offline { background: rgba(255, 176, 1, .16); color: #FFD98A; border: 1px solid rgba(250, 176, 1, .5); }
.pill__dot { width: 7px; height: 7px; border-radius: 50%; background: #45C65A; }
.pill--offline .pill__dot { background: var(--gold); }
.bar__action {
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .35); color: #fff;
  border-radius: 8px; padding: 7px 14px; font-size: 13px; font-weight: 600; transition: background .15s;
}
.bar__action:hover { background: rgba(255, 255, 255, .2); }

/* ---------------------------------------------------------------- path bar */
.path { flex: none; background: #fff; border-bottom: 1px solid var(--line); padding: 14px 20px 12px; display: flex; }
.path__step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.path__line { display: flex; align-items: center; width: 100%; }
.path__rule { flex: 1; height: 3px; background: var(--line); }
.path__rule--blank { background: transparent; }
.path__dot { flex: none; width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 2px solid #CDD3E2;
  color: var(--muted); display: grid; place-items: center; font-weight: 600; font-size: 14px; margin: 0 8px; }
.path__step--done .path__dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.path__step--done .path__rule { background: var(--brand); }
.path__step--now .path__dot { border: 3px solid var(--brand); color: var(--brand); }
.path__label { font-size: 13.5px; font-weight: 500; color: var(--muted); text-align: center; }
.path__step--now .path__label { color: var(--navy); font-weight: 700; }
.path__tick { width: 26px; height: 3px; border-radius: 2px; background: transparent; }
.path__step--now .path__tick { background: var(--gold); }

/* ---------------------------------------------------------------- layout */
.main { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.main--center { align-items: center; justify-content: center; }
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card__head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card__title { font-size: 16px; font-weight: 700; color: var(--navy); }
.card__hint { font-size: 12.5px; color: var(--muted); margin-left: auto; text-align: right; }
.card__body { padding: 16px 18px; }

.kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; }
.kpi__label { font-size: 13px; color: var(--muted); }
.kpi__value { font-size: 30px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.kpi__note { font-size: 12.5px; color: var(--muted); }

.band { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px;
  display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center; box-shadow: var(--shadow); }
.band__name { font-size: 18px; font-weight: 700; color: var(--navy); }
.band__item { display: flex; flex-direction: column; }
.band__item span:first-child { font-size: 11.5px; color: var(--muted); }
.band__item span:last-child { font-size: 13.5px; font-weight: 600; }
.tag { border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag--live { background: rgba(46, 132, 74, .12); color: var(--ok); }
.tag--wait { background: rgba(250, 176, 1, .18); color: #8A6100; }
.tag--won { background: rgba(40, 51, 140, .1); color: var(--brand); }

/* ---------------------------------------------------------------- buttons */
.btn { border: 0; border-radius: 10px; padding: 0 22px; height: 48px; font-size: 16px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: filter .15s, background .15s; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: #fff; }
.btn--gold { background: var(--gold); color: var(--navy); }
.btn--ghost { background: #fff; border: 1px solid #CDD3E2; color: var(--brand); }
.btn--ghost:hover { background: #F3F5FD; }
.btn--danger-ghost { background: #fff; border: 1px solid #F0C3C3; color: var(--error); }
.btn--wide { width: 100%; }
.btn--big { height: 64px; font-size: 19px; border-radius: 14px; }
.btn[aria-busy="true"] { opacity: .85; }
.btn__spinner { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff;
  border-radius: 50%; animation: spin .8s linear infinite; }
.btn--ghost .btn__spinner, .btn--gold .btn__spinner { border-color: rgba(27, 36, 100, .3); border-top-color: var(--navy); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field__label { font-size: 13px; color: var(--muted); font-weight: 500; }
.field__source { font-size: 11px; font-weight: 600; border-radius: 5px; padding: 1px 7px; margin-left: 6px; }
.field__source--ocr { background: var(--ocr); color: var(--brand); }
.field__source--check { background: var(--check); color: #8A6100; }
.field__source--typed { background: #F1F3F8; color: var(--muted); }
.field input, .field select, .field textarea {
  border: 1px solid #CDD3E2; border-radius: 9px; padding: 11px 13px; font-size: 15.5px; background: #fff; width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.field--ocr input { background: var(--ocr); }
.field--check input { background: var(--check); }
.field__error { font-size: 13px; color: var(--error); font-weight: 600; }
.field--invalid input, .field--invalid select, .field--invalid textarea { border-color: var(--error); }
.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choice { border: 1px solid #CDD3E2; background: #fff; border-radius: 999px; padding: 9px 18px; font-size: 14.5px;
  transition: background .15s, border-color .15s; }
.choice:hover { background: #F3F5FD; }
.choice[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; font-size: 15px; }
.check input { width: 22px; height: 22px; margin-top: 2px; }

/* ---------------------------------------------------------------- lists */
.rows { width: 100%; border-collapse: collapse; }
.rows th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 8px 12px;
  border-bottom: 1px solid var(--line); }
.rows td { padding: 12px; border-bottom: 1px solid #F0F2F8; font-size: 14.5px; vertical-align: middle; }
.rows td:last-child { text-align: right; white-space: nowrap; }
.rows tr:last-child td { border-bottom: 0; }
.rows tr[data-clickable] { cursor: pointer; transition: background .12s; }
.rows tr[data-clickable]:hover { background: #F3F5FD; }
.rows__name { font-weight: 600; color: var(--navy); }
.rows__meta { font-size: 12.5px; color: var(--muted); }
.steps-mini { display: inline-flex; gap: 3px; }
.steps-mini i { width: 14px; height: 6px; border-radius: 2px; background: var(--line); display: inline-block; }
.steps-mini i.on { background: var(--brand); }
.empty { padding: 26px; text-align: center; color: var(--muted); font-size: 14.5px; }
.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, #EEF0F6, #F7F8FC, #EEF0F6);
  background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- notices */
.notice { border-radius: 10px; padding: 12px 15px; font-size: 14.5px; display: flex; gap: 10px; align-items: flex-start; }
.notice--error { background: #FDF0F0; border: 1px solid #F3C4C4; color: #8B1111; }
.notice--warn { background: var(--check); border: 1px solid #F0DCA8; color: #7A5600; }
.notice--ok { background: #EBF7EF; border: 1px solid #BFE4CB; color: #1C6134; }
.notice--info { background: var(--ocr); border: 1px solid #CBD6FA; color: var(--brand); }
.notice strong { font-weight: 700; }

/* ---------------------------------------------------------------- camera */
.camera { position: relative; background: #0B0D12; border-radius: 18px; overflow: hidden; flex: 1;
  display: flex; align-items: center; justify-content: center; min-height: 380px;
  /* the shutter has to stay on screen on an iPad: never taller than the space left under the path bar */
  max-height: calc(100vh - 230px); }
.camera video { width: 100%; height: 100%; object-fit: cover; }
.camera__frame { position: absolute; width: 62%; aspect-ratio: 1.586; border: 3px dashed rgba(255, 255, 255, .55);
  border-radius: 14px; display: grid; place-items: center; gap: 10px; text-align: center; color: #fff; }
.camera__frame b { display: block; font-size: 20px; font-weight: 500; }
.camera__frame span { font-size: 15px; color: rgba(255, 255, 255, .6); }
.camera__corner { position: absolute; width: 30px; height: 30px; border: 4px solid var(--gold); }
.camera__controls { position: absolute; bottom: 26px; left: 0; right: 0; display: flex; align-items: center;
  justify-content: center; gap: 56px; }
.shutter { width: 84px; height: 84px; border-radius: 50%; background: #fff; border: 6px solid rgba(255, 255, 255, .35);
  box-shadow: 0 0 0 2px #0B0D12 inset; transition: transform .12s; }
.shutter:hover { transform: scale(1.04); }
.shutter:active { transform: scale(.96); }
.camera__button { height: 52px; padding: 0 24px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .4);
  background: rgba(255, 255, 255, .06); color: #fff; font-weight: 600; }
.camera__button:hover { background: rgba(255, 255, 255, .18); }
.camera__status { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); color: #fff;
  background: rgba(0, 0, 0, .55); border-radius: 999px; padding: 6px 16px; font-size: 13.5px; }

/* ---------------------------------------------------------------- plans */
.plan { display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 2px solid var(--line);
  border-radius: 14px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.plan:hover { border-color: #B9C2E8; box-shadow: var(--shadow); }
.plan[aria-selected="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(40, 51, 140, .12); }
.plan--out { opacity: .6; background: #FAFBFD; }
.plan__name { font-size: 16.5px; font-weight: 700; color: var(--navy); }
.plan__price { font-size: 34px; font-weight: 700; color: var(--brand); line-height: 1.1; }
.plan__price small { font-size: 14px; color: var(--muted); font-weight: 500; }
.plan__list { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: #3C4257; }
.plan__list li::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.plan--out .plan__list li::before { content: "• "; color: var(--muted); }

/* ---------------------------------------------------------------- payment */
.qr { display: grid; place-items: center; gap: 14px; }
.qr__code { width: 260px; height: 260px; padding: 14px; background: #fff; border: 3px solid var(--navy);
  border-radius: 14px; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.qr__code:hover { transform: scale(1.02); box-shadow: 0 10px 30px rgba(27, 36, 100, .18); }
.qr__hint { font-size: 13.5px; color: var(--muted); }
.amount { font-size: 44px; font-weight: 700; color: var(--navy); line-height: 1; }
.amount small { font-size: 16px; color: var(--muted); font-weight: 500; }
.summary { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 14.5px; }
.summary dt { color: var(--muted); }
.summary dd { font-weight: 600; text-align: right; }

/* ---------------------------------------------------------------- done */
.done { display: grid; place-items: center; gap: 16px; text-align: center; padding: 30px 0; }
.done__mark { width: 84px; height: 84px; border-radius: 50%; background: #EBF7EF; color: var(--ok);
  display: grid; place-items: center; font-size: 42px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip { background: #F1F3F8; border-radius: 999px; padding: 7px 15px; font-size: 13.5px; white-space: nowrap; }
.chip--link { color: var(--brand); text-decoration: none; border: 1px solid #CBD6FA; background: var(--ocr); }
.chip--link:hover { background: #E0E7FF; }
.chip--go { color: var(--brand); font-weight: 600; }
.links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.links a { font-size: 13.5px; color: var(--brand); text-decoration: none; border: 1px solid #CBD6FA;
  background: var(--ocr); border-radius: 8px; padding: 7px 13px; }
.links a:hover { background: #E0E7FF; }

/* ---------------------------------------------------------------- campaign picker */
.picker { display: grid; grid-template-columns: minmax(280px, 380px) minmax(320px, 520px); min-height: 100vh; }
.picker__brand { background: linear-gradient(160deg, var(--navy), var(--brand)); color: #fff; padding: 48px 40px;
  display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.picker__brand h1 { font-size: 30px; font-weight: 700; }
.picker__brand p { color: #B9C2E8; font-size: 15px; }
.picker__panel { background: #fff; padding: 40px; display: flex; flex-direction: column; gap: 18px; }
.seller { display: flex; align-items: center; gap: 12px; }
.seller__avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--gold); color: var(--navy);
  display: grid; place-items: center; font-weight: 700; font-size: 18px; }
.option { display: flex; gap: 12px; align-items: flex-start; border: 2px solid var(--line); border-radius: 12px;
  padding: 14px 16px; background: #fff; width: 100%; text-align: left; transition: border-color .15s, background .15s; }
.option:hover { border-color: #B9C2E8; background: #F7F9FF; }
.option[aria-pressed="true"] { border-color: var(--brand); background: #F3F5FD; }
.option__radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #CDD3E2; flex: none; margin-top: 3px; }
.option[aria-pressed="true"] .option__radio { border: 6px solid var(--brand); }
.option__name { font-weight: 600; color: var(--navy); }
.option__meta { font-size: 13px; color: var(--muted); }

@media (max-width: 900px) {
  .picker { grid-template-columns: 1fr; }
  .picker__brand { padding: 28px 24px; }
  .path__label { font-size: 12px; }
  .main { padding: 14px; }
}

/* ---------------------------------------------------------------- dashboard (1.1) */
.band--facts { border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: none; border-left: 0; border-right: 0; border-bottom: 0; gap: 10px 34px; }
.band__icon { width: 42px; height: 42px; border-radius: 10px; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 20px; flex: none; }
.count { background: #EEF2FF; color: var(--brand); border-radius: 999px; padding: 2px 10px;
  font-size: 12.5px; font-weight: 700; }

.columns { display: grid; grid-template-columns: minmax(420px, 1.7fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.columns__main, .columns__side { display: flex; flex-direction: column; gap: 16px; }

.cta { display: flex; align-items: center; gap: 18px; text-align: left; width: 100%;
  background: var(--brand); color: #fff; border: 0; border-radius: 14px; padding: 18px 22px;
  box-shadow: 0 10px 28px rgba(40, 51, 140, .22); transition: filter .15s, transform .12s; }
.cta:hover { filter: brightness(1.07); }
.cta:active { transform: translateY(1px); }
.cta__plus { width: 52px; height: 52px; border-radius: 14px; background: rgba(255, 255, 255, .16);
  display: grid; place-items: center; font-size: 30px; font-weight: 600; flex: none; }
.cta__text { display: flex; flex-direction: column; gap: 2px; }
.cta__title { font-size: 22px; font-weight: 700; }
.cta__sub { font-size: 15px; color: #DDE3FF; }
.cta__note { font-size: 12.5px; color: #B9C2E8; }

.list { display: flex; flex-direction: column; }
.list__row { display: flex; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid #F0F2F8; }
.list__row:last-child { border-bottom: 0; }
.list__icon { width: 26px; height: 26px; border-radius: 8px; background: #EEF2FF; color: var(--brand);
  display: grid; place-items: center; font-size: 13px; flex: none; }
.list__body { display: flex; flex-direction: column; flex: 1; }
.list__title { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.list__note { font-size: 12.5px; color: var(--muted); }
.list__value { font-size: 18px; font-weight: 700; color: var(--navy); }

@media (max-width: 1100px) { .columns { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- two-column screens (2.3, 5.1) */
.split { display: grid; grid-template-columns: minmax(420px, 2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.shot { width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; aspect-ratio: 1.586;
  object-fit: cover; background: #0B0D12; }
.shot--empty { display: grid; place-items: center; color: #9AA5B6; font-size: 13.5px; }
.legend { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend__swatch { width: 16px; height: 16px; border-radius: 4px; border: 1px solid #CDD3E2; display: inline-block; }
.legend__swatch--ocr { background: var(--ocr); }
.legend__swatch--check { background: var(--check); }
.legend__swatch--typed { background: #fff; }

@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .kpis { grid-template-columns: 1fr; } }
