/* Stars Shop — стиль «як у рілсів: чисто й просто» (vault docs/design-style.md, макет v6). Лише світла тема. */
:root {
  color-scheme: light;
  --ground: #F3F3F0;
  --surface: #FFFFFF;
  --text: #17181C;
  --text-soft: #3A3C42;
  --muted: #5D6068;
  --line: #E3E3DE;
  --accent: #1F4FD8;
  --accent-bg: #E7EEFF;
  --accent-ink: #133A9E;
  --ok: #15703A;
  --ok-bg: #E3F1E8;
  --warn-chip: #FDE7C7;
  --warn-ink: #8A4B08;
  --secondary: #ECECE8;
  --tile: #F7F7F4;
  --input-line: #D6D7DB;
  --disabled-ink: #9A9CA3;
  --scrim: rgba(23, 24, 28, 0.45);
  --star: #F2A900;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ground); }
body {
  font-family: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button, a, [role="button"], .tap { touch-action: manipulation; cursor: pointer; }
a { color: var(--accent); text-decoration: none; }

#app { position: fixed; inset: 0; display: flex; flex-direction: column; overflow: hidden; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 12px; }
.hidden { display: none !important; }

/* шапка */
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 4px 4px 2px; }
.head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
h1 { margin: 0; font-size: 24px; line-height: 1.15; font-weight: 800; letter-spacing: -0.01em; }
h2 { margin: 0; font-size: 16px; font-weight: 700; }
.sub { margin: 0; font-size: 14px; color: var(--muted); }
.lang-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 12px;
  border: 0; border-radius: 22px; background: var(--surface); font-size: 14px; font-weight: 800; }
.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 4px;
  border: 0; background: none; font-size: 15px; font-weight: 600; color: var(--text-soft); }

/* картки */
.card { background: var(--surface); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.card.tight { gap: 10px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row .label { font-size: 14px; color: var(--muted); }
.strike { font-size: 15px; font-weight: 600; color: var(--muted); text-decoration: line-through; }
.big { font-size: 22px; font-weight: 800; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 10px; font-size: 12.5px; font-weight: 700; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.progress { background: var(--accent-bg); color: var(--accent-ink); }
.chip.idle { background: var(--secondary); color: var(--muted); }
.chip.error { background: var(--warn-chip); color: var(--warn-ink); }
.hint { font-size: 13px; color: var(--muted); }

/* перемикач */
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--secondary); border-radius: 12px; }
.seg button { height: 40px; border: 0; border-radius: 9px; font-size: 15px; font-weight: 700; background: transparent; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); }

.tile-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 0 14px;
  background: var(--tile); border-radius: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-soft); }
.field input { height: 48px; border: 1px solid var(--input-line); border-radius: 14px; padding: 0 14px; font-size: 16px; background: var(--surface); outline: none; }
.field input:focus { border-color: var(--accent); }
.field .err { font-size: 13px; color: var(--warn-ink); }

/* пакети */
.packs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pack { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; min-height: 68px; padding: 8px 10px;
  border-radius: 14px; border: 2px solid var(--tile); background: var(--tile); text-align: left; }
.pack[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-bg); }
.pack .n { display: flex; align-items: center; gap: 5px; font-size: 17px; font-weight: 800; }
.pack .p { font-size: 13px; font-weight: 600; color: var(--muted); }
.custom-btn { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border: 1px dashed var(--input-line);
  border-radius: 14px; background: var(--surface); color: var(--text-soft); font-size: 15px; font-weight: 700; }
.custom-btn[aria-pressed="true"] { border: 2px solid var(--accent); background: var(--accent-bg); color: var(--accent-ink); }

/* дія внизу */
.action { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 10px 16px calc(10px + var(--safe-bottom));
  background: var(--ground); border-top: 1px solid var(--line); }
.action.with-tabs { padding-bottom: 10px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border: 0; border-radius: 14px;
  background: var(--accent); color: #FFFFFF; font-size: 16px; font-weight: 700; width: 100%; }
.btn:disabled { background: var(--secondary); color: var(--disabled-ink); }
.btn.secondary { background: var(--secondary); color: var(--text); }

/* гаманці */
.wallet { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 4px; color: var(--text); border: 0; background: none; text-align: left; width: 100%; }
.wallet + .wallet { border-top: 1px solid var(--line); }
.wallet .ico { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--tile); display: flex; align-items: center; justify-content: center; color: var(--accent); }
.wallet .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.wallet .t1 { font-size: 15px; font-weight: 700; }
.wallet .t2 { font-size: 13px; color: var(--muted); }
.note { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--accent-bg); color: var(--accent-ink); }
.note p { margin: 0; font-size: 14px; line-height: 1.4; font-weight: 500; }
.note.warn { background: var(--warn-chip); color: var(--warn-ink); }

/* статус */
.status-hero { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 14px; }
.steps { display: flex; flex-direction: column; gap: 0; }
.step { display: flex; gap: 12px; }
.step .rail { display: flex; flex-direction: column; align-items: center; }
.step .dot { width: 28px; height: 28px; border-radius: 14px; background: var(--secondary); color: var(--muted); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; }
.step.done .dot { background: var(--ok); color: #FFFFFF; }
.step.active .dot { background: var(--accent); color: #FFFFFF; }
.step .line { width: 2px; flex: 1; min-height: 18px; background: var(--line); }
.step.done .line { background: var(--ok); }
.step .body { padding: 4px 0 14px; display: flex; flex-direction: column; gap: 2px; }
.step .title { font-size: 15px; font-weight: 700; color: var(--muted); }
.step.done .title, .step.active .title { color: var(--text); }
.step .desc { font-size: 13px; color: var(--muted); }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { font-weight: 600; text-align: right; overflow-wrap: anywhere; }

/* профіль */
.order { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; border: 0; background: none; padding: 0; text-align: left; width: 100%; }
.order + .order { border-top: 1px solid var(--line); }
.order .l { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.order .s { font-size: 15px; font-weight: 700; }
.order .m { font-size: 13px; color: var(--muted); }
.empty { font-size: 14px; color: var(--muted); padding: 6px 0; }

/* вкладки */
.tabs { flex: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 6px 8px calc(8px + var(--safe-bottom));
  background: var(--surface); border-top: 1px solid var(--line); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; border: 0; background: none;
  color: var(--muted); font-size: 11.5px; font-weight: 700; }
.tab .pill { display: flex; align-items: center; justify-content: center; width: 52px; height: 30px; border-radius: 15px; }
.tab[aria-current="page"] { color: var(--accent); }
.tab[aria-current="page"] .pill { background: var(--accent-bg); }

/* лист знизу */
.sheet-wrap { position: absolute; inset: 0; z-index: 20; transform: translateZ(0); }
.sheet-scrim { position: absolute; inset: 0; border: 0; padding: 0; background: var(--scrim); }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 20px 20px 0 0;
  padding: 10px 16px calc(24px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 8px; }
.sheet .grab { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin-bottom: 4px; }
.sheet h2 { font-size: 18px; font-weight: 800; margin: 0 0 4px; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; padding: 0 14px; border: 2px solid var(--tile);
  border-radius: 14px; background: var(--tile); font-size: 16px; font-weight: 700; text-align: left; }
.opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-bg); }
.opt .code { width: 30px; font-size: 13px; font-weight: 800; color: var(--muted); display: inline-block; }

/* тост */
.toast { position: absolute; left: 16px; right: 16px; top: 12px; z-index: 30; padding: 12px 14px; border-radius: 14px; background: var(--text); color: #FFFFFF;
  font-size: 14px; font-weight: 600; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18); }
.toast.bad { background: var(--warn-ink); }

.loading { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 15px; }
.closed-banner { padding: 12px 14px; border-radius: 14px; background: var(--warn-chip); color: var(--warn-ink); font-size: 14px; font-weight: 600; }

/* Низькі екрани (iPhone SE / малі Android: Telegram лишає ≈600 px) — усе важливе головної без гортання. */
@media (max-height: 700px) {
  .scroll { padding: 10px 14px 8px; gap: 8px; }
  .head { padding-top: 0; }
  h1 { font-size: 21px; }
  .sub { font-size: 13px; }
  .lang-btn { height: 38px; }
  .card { padding: 12px; gap: 8px; border-radius: 18px; }
  .seg button { height: 34px; }
  .tile-line { min-height: 38px; }
  .packs { gap: 6px; }
  .pack { min-height: 52px; padding: 6px 9px; gap: 2px; }
  .pack .n { font-size: 15px; }
  .pack .p { font-size: 12px; }
  .custom-btn { min-height: 38px; font-size: 14px; }
  .big { font-size: 20px; }
  .action { padding-top: 8px; padding-bottom: 8px; }
  .btn { min-height: 48px; }
  .tab { min-height: 46px; }
  .wallet { min-height: 50px; }
}
