/* Azizz Mini App: a quiet, professional dark interface. One accent, flat surfaces with 1px
   borders, real icons, tabular numerals. Motion is short and transform/opacity only. */

@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0b0f1a;
  --surface: #121829;
  --surface-2: #192238;
  --surface-3: #212c47;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --ink: #f2f4f8;
  --ink-2: rgba(242, 244, 248, .64);
  --ink-3: rgba(242, 244, 248, .42);
  --accent: #5b8cff;
  --accent-2: #7aa2ff;
  --accent-tint: rgba(91, 140, 255, .14);
  --accent-line: rgba(91, 140, 255, .45);
  --ok: #34d399;
  --warn: #f5b14c;
  --danger: #f0616d;
  --r: 16px;
  --r-sm: 12px;
  --shadow: 0 10px 30px -18px rgba(0, 0, 0, .9);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tg-top: var(--tg-content-safe-area-inset-top, 0px);
  --dock-h: 64px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; overflow: hidden; overflow: clip; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Vazirmatn", "IRANSans", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
a { color: var(--accent-2); }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- backdrop */
#sky { position: fixed; inset: 0; z-index: 0; background: var(--bg); overflow: hidden; }
#sky .glow { position: absolute; left: 50%; top: -30vh; width: 120vw; height: 70vh; transform: translateX(-50%); background: radial-gradient(50% 60% at 50% 40%, rgba(91, 140, 255, .16), transparent 70%); }
#pulse { position: absolute; inset: 0; opacity: 0; pointer-events: none; background: radial-gradient(60% 50% at 50% 60%, var(--pulse, rgba(52, 211, 153, 1)), transparent 72%); }
#pulse.on { animation: pulse .8s ease-out; }
@keyframes pulse { 0% { opacity: 0; } 25% { opacity: .18; } 100% { opacity: 0; } }

/* ---------------------------------------------------------------- app */
#app {
  position: relative; z-index: 1; height: var(--vh, 100%);
  padding: calc(var(--tg-top) + var(--safe-top) + 8px) 16px calc(var(--dock-h) + var(--safe-bottom) + 16px);
  overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  scrollbar-width: none;
}
#app::-webkit-scrollbar { display: none; }
#app.no-dock { padding-bottom: calc(var(--safe-bottom) + 16px); }
#app { padding-bottom: calc(var(--dock-h) + var(--safe-bottom) + 40px); }
.screen { min-height: 100%; display: flex; flex-direction: column; gap: 12px; animation: inFade .28s var(--ease) both; }
.screen.in-forward { animation: inForward .36s var(--ease-out) both; }
.screen.in-back { animation: inBack .36s var(--ease-out) both; }
.screen.in-zoom { animation: inZoom .4s var(--ease-out) both; }
.screen.out { position: absolute; inset: 0 16px auto; pointer-events: none; animation: outFade .22s ease both; }
.screen.out-forward { animation: outForward .3s var(--ease) both; }
.screen.out-back { animation: outBack .3s var(--ease) both; }
.screen.out-zoom { animation: outZoom .3s var(--ease) both; }
@keyframes inFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes outFade { to { opacity: 0; } }
@keyframes inForward { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes outForward { to { opacity: 0; transform: translateX(28px); } }
@keyframes inBack { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes outBack { to { opacity: 0; transform: translateX(-28px); } }
@keyframes inZoom { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes outZoom { to { opacity: 0; transform: scale(1.04); } }
/* staggered entrances for lists: every item with --i arrives a beat after the one before */
.stagger { animation: rise .45s var(--ease-out) both; animation-delay: calc(60ms + var(--i, 0) * 45ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.chip.picked { animation: pick .35s var(--spring) both; }
@keyframes pick { 0% { transform: scale(1); } 40% { transform: scale(1.05); } 100% { transform: scale(1); } }

/* ---------------------------------------------------------------- surfaces */
.glass { position: relative; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); transition: background .2s, border-color .2s, transform .2s var(--ease); }
.card { padding: 16px; }

/* ---------------------------------------------------------------- top bar */
.top { display: flex; align-items: center; gap: 12px; padding: 6px 0 2px; }
.top h1 { font-size: 19px; font-weight: 700; margin: 0; line-height: 1.3; }
.top .sub { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--surface); border: 1px solid var(--line); transition: background .15s, transform .12s var(--ease); }
.iconbtn:active { transform: scale(.94); background: var(--surface-2); }
button svg, .ico svg, .empty svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-2); }
.avatar-fallback { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; background: var(--accent-tint); color: var(--accent-2); border: 1px solid var(--accent-line); }

/* ---------------------------------------------------------------- balance */
.hero { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.hero .eyebrow { font-size: 12.5px; color: var(--ink-2); display: flex; justify-content: space-between; align-items: center; }
.hero .eyebrow a, .hero .eyebrow button { font-size: 12.5px; color: var(--accent-2); font-weight: 600; }
.hero .bal { display: flex; align-items: baseline; gap: 8px; }
.hero .bal .v { font-size: 36px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.hero .bal .u { font-size: 13px; color: var(--ink-2); }
.meter { height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; display: flex; }
.meter i { display: block; height: 100%; transition: width .9s var(--ease-out); }
.meter .gift { background: var(--warn); }
.meter .paid { background: var(--accent); }
.hero .split { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-2); }
.hero .split i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-inline-end: 6px; vertical-align: 0; }
.hero .split b { color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------------- lists */
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 6px 2px -2px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.bento { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { padding: 14px; text-align: right; display: flex; flex-direction: column; gap: 12px; min-height: 104px; transition: background .15s, transform .12s var(--ease); }
.tile:active { transform: scale(.98); background: var(--surface-2); }
.tile .ico, .row .ico, .service-head .ico, .result-head .badge { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--accent-tint); color: var(--accent-2); font-size: 20px; }
.tile .t { font-weight: 600; font-size: 14.5px; line-height: 1.4; }
.tile .d, .tile .count { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.tile.wide { grid-column: 1 / -1; flex-direction: row; align-items: center; min-height: 0; }
.tile.wide .t { flex: 1; }
.rows { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: right; transition: background .15s, transform .12s var(--ease); }
.row:active { transform: scale(.99); background: var(--surface-2); }
.row .body { flex: 1; min-width: 0; }
.row .t { font-weight: 600; font-size: 15px; }
.row .d { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row .meta { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.row.locked { opacity: .5; }
.pill { font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.pill.cost { color: var(--ink); }
.pill.premium { color: var(--warn); }
.pill.tier-pro { color: var(--accent-2); }
.chev { color: var(--ink-3); transform: scaleX(-1); display: grid; }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: var(--r-sm); font-weight: 600; font-size: 15px; background: var(--surface-2); border: 1px solid var(--line-2); transition: transform .12s var(--ease), background .15s, opacity .15s; }
.btn:active { transform: scale(.98); background: var(--surface-3); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { color: #fff; background: var(--accent); border-color: transparent; }
.btn.primary:active { background: #4a7af0; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn.danger { color: var(--danger); background: transparent; border-color: rgba(240, 97, 109, .4); }
.btn.block { width: 100%; }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 13.5px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions .btn { flex: 1 1 auto; }

.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chip { min-height: 48px; padding: 10px 12px; border-radius: var(--r-sm); font-weight: 500; font-size: 14px; text-align: center; display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line-2); transition: background .15s, border-color .15s, transform .12s var(--ease); }
.chip.full { grid-column: 1 / -1; }
.chip:active { transform: scale(.98); }
.chip.on { background: var(--accent-tint); border-color: var(--accent-line); color: var(--ink); }
.chip.premium-chip { border-color: rgba(245, 177, 76, .4); }
.chip.sub { font-size: 13.5px; min-height: 42px; color: var(--ink-2); }

/* ---------------------------------------------------------------- service / wizard */
.service-head { display: flex; gap: 12px; align-items: flex-start; }
.service-head .ico { width: 48px; height: 48px; border-radius: 13px; font-size: 24px; }
.service-head h2 { margin: 2px 0 0; font-size: 18px; font-weight: 700; line-height: 1.35; }
.service-head p { margin: 6px 0 0; color: var(--ink-2); font-size: 13.5px; }
.costs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.progress { display: flex; gap: 4px; }
.progress i { flex: 1; height: 3px; border-radius: 2px; background: var(--surface-3); overflow: hidden; position: relative; }
.progress i::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform: translateX(100%); transition: transform .5s var(--ease-out); border-radius: 2px; }
.progress i.done::after { transform: none; }
.progress i.cur::after { transform: translateX(50%); }
.q-counter { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.q-prompt { font-size: 17px; font-weight: 700; margin: 4px 0 0; line-height: 1.5; }
.q-hint { font-size: 13px; color: var(--ink-2); margin: 6px 0 0; }
.field { position: relative; }
textarea.input, input.input { width: 100%; min-height: 120px; padding: 12px 14px 28px; border-radius: var(--r-sm); border: 1px solid var(--line-2); resize: none; outline: 0; background: var(--bg); color: var(--ink); line-height: 1.7; transition: border-color .15s, box-shadow .15s; }
input.input { min-height: 48px; padding: 11px 14px; }
textarea.input:focus, input.input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-tint); }
.counter { position: absolute; bottom: 8px; left: 12px; font-size: 11px; color: var(--ink-3); direction: ltr; }
.counter.over { color: var(--danger); }
.drop { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-sm); border: 1px dashed var(--line-2); color: var(--ink-2); font-size: 13px; text-align: right; width: 100%; background: transparent; transition: background .15s; }
.drop:active { background: var(--surface-2); }
.drop .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; }
.drop b { color: var(--ink); display: block; font-weight: 600; }
.preview { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; }
.wizard-foot { display: flex; gap: 8px; align-items: center; justify-content: flex-start; }
.summary { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.summary .kv { display: flex; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); }
.summary .k { color: var(--ink-3); flex: none; }
.summary .v { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- running */
.running { align-items: center; justify-content: center; text-align: center; gap: 18px; }
.spinner { width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.running h2 { margin: 0; font-size: 18px; }
.running .status { color: var(--ink-2); font-size: 14px; min-height: 1.7em; transition: opacity .25s; }
.running .status.swap { opacity: 0; }
.running .elapsed { font-size: 12.5px; color: var(--ink-3); }

/* ---------------------------------------------------------------- result */
.result-head { display: flex; align-items: center; gap: 10px; }
.result-head .t { font-weight: 600; flex: 1; }
.result-head .charge { font-size: 12.5px; color: var(--ink-2); }
.prose { font-size: 15px; line-height: 1.85; overflow-wrap: anywhere; }
.prose p { margin: 0 0 .7em; }
.prose p:last-child { margin-bottom: 0; }
.prose b { font-weight: 700; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; padding: 1px 6px; border-radius: 5px; background: var(--surface-3); direction: ltr; unicode-bidi: embed; }
.prose pre { direction: ltr; text-align: left; padding: 12px 14px; border-radius: var(--r-sm); background: var(--bg); border: 1px solid var(--line); overflow-x: auto; font-size: 12.5px; line-height: 1.6; }
.prose pre code { padding: 0; background: none; }
.prose blockquote { margin: 0 0 .7em; padding: 4px 12px; border-right: 2px solid var(--accent-line); color: var(--ink-2); }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gallery.one { grid-template-columns: 1fr; }
.gallery.one:not(.photos) figure { max-width: 260px; margin: 0 auto; width: 100%; }
.gallery figure { margin: 0; border-radius: var(--r); overflow: hidden; background: var(--surface); border: 1px solid var(--line); position: relative; }
.gallery img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; }
.gallery.photos img { aspect-ratio: auto; object-fit: cover; max-height: 60vh; }
.gallery figcaption { position: absolute; bottom: 6px; right: 8px; font-size: 15px; }
.emoji-grid { grid-template-columns: repeat(4, 1fr); }
.emoji-grid img { padding: 8px; }
.refine { display: flex; gap: 8px; align-items: flex-end; padding: 6px; }
.refine textarea.input { min-height: 44px; max-height: 120px; padding: 11px 12px; flex: 1; line-height: 1.5; border-color: transparent; background: transparent; }
.refine .send, .composer .send { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; flex: none; color: #fff; background: var(--accent); }
.refine .send:active, .composer .send:active { background: #4a7af0; }

/* ---------------------------------------------------------------- notice (generic reply) */
.notice { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.notice .text { white-space: pre-wrap; font-size: 14.5px; line-height: 1.8; }
.notice .text.md { white-space: normal; }
.kb { display: flex; flex-direction: column; gap: 8px; }
.kb .krow { display: flex; gap: 8px; }
.kb .krow .btn { flex: 1; min-height: 44px; font-size: 14px; padding: 0 12px; }

/* ---------------------------------------------------------------- chat */
.thread { display: flex; flex-direction: column; gap: 8px; flex: 1; padding-bottom: 4px; }
.bubble { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.7; animation: bubbleIn .2s var(--ease) both; overflow-wrap: anywhere; }
.bubble.user { align-self: flex-start; background: var(--accent); color: #fff; border-bottom-left-radius: 5px; }
.bubble.bot { align-self: flex-end; background: var(--surface-2); border: 1px solid var(--line); border-bottom-right-radius: 5px; }
.bubble.typing { display: inline-flex; gap: 5px; padding: 14px 16px; }
.bubble.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-2); animation: dots 1s infinite; }
.bubble.typing i:nth-child(2) { animation-delay: .16s; } .bubble.typing i:nth-child(3) { animation-delay: .32s; }
@keyframes dots { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.composer { position: sticky; bottom: 0; display: flex; gap: 8px; align-items: flex-end; padding: 6px; border-radius: var(--r); }
.composer textarea.input { flex: 1; min-height: 44px; max-height: 140px; padding: 11px 12px; background: transparent; border-color: transparent; }
.composer .attach { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; flex: none; color: var(--ink-2); background: var(--surface-2); }
.empty { text-align: center; color: var(--ink-2); padding: 28px 10px; font-size: 14px; }
.empty .big { width: 48px; height: 48px; margin: 0 auto 10px; border-radius: 14px; background: var(--accent-tint); color: var(--accent-2); display: grid; place-items: center; }

.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub .win { color: var(--accent-2); }
.cost { font-size: 11px; color: var(--ink-3); align-self: flex-end; margin: -4px 6px 2px 0; }
.bubble.faded { opacity: .55; }
.win-mark { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--ink-3); margin: 6px 0; }
.win-mark::before, .win-mark::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.chat-row .del { width: 36px; height: 36px; color: var(--ink-3); }
.chat-row.open { border-color: var(--accent-line); }

/* ---------------------------------------------------------------- profile / admin */
.announce .text { font-size: 13.5px; color: var(--ink); }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg-btn { flex: 1 0 auto; min-height: 36px; padding: 0 12px; border-radius: 9px; font-size: 13px; color: var(--ink-2); white-space: nowrap; transition: background .2s, color .2s; }
.seg-btn.on { background: var(--surface-3); color: var(--ink); font-weight: 600; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.stat span { font-size: 12px; color: var(--ink-2); }
.stat small { font-size: 11px; color: var(--ink-3); }
.list { padding: 4px 0; }
.lrow { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: right; width: 100%; }
.lrow:last-child { border-bottom: 0; }
.lrow .lmain { flex: 1; min-width: 0; }
.lrow .lt { font-size: 14px; font-weight: 500; }
.lrow .lt small, .stat .lt small { color: var(--ink-3); font-weight: 400; font-size: 11.5px; }
.lrow .ld { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.lrow .lv { font-size: 13.5px; font-weight: 600; flex: none; text-align: left; }
.lrow .lv small { font-weight: 400; color: var(--ink-3); font-size: 11px; }
.lrow .lv.pos { color: var(--ok); } .lrow .lv.neg { color: var(--ink-2); }
.lrow.btnrow:active { background: var(--surface-2); }
.st { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; font-size: 11px; font-weight: 700; vertical-align: middle; }
.st.ok { background: rgba(52, 211, 153, .18); color: var(--ok); } .st.err { background: rgba(240, 97, 109, .18); color: var(--danger); } .st.pend { background: var(--surface-3); color: var(--ink-2); }
.empty.small { padding: 16px; font-size: 13px; }
.adm-body, .adm-wrap { display: flex; flex-direction: column; gap: 12px; }
.bars-chart { display: flex; align-items: flex-end; gap: 3px; height: 90px; }
.bar-col { flex: 1; position: relative; height: 100%; display: flex; align-items: flex-end; }
.bar-col i { display: block; width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.bar-col em { position: absolute; left: 0; right: 0; bottom: 0; background: var(--danger); border-radius: 3px 3px 0 0; }
.trows { display: flex; flex-direction: column; }
.trow { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr .8fr; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; align-items: center; }
.trow:last-child { border-bottom: 0; }
.trow.head { color: var(--ink-3); font-size: 11.5px; }
.trow .tc small { display: block; color: var(--ink-3); font-size: 10.5px; }
.trow.alert .tc:last-child { color: var(--warn); font-weight: 600; }
.kvs { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; font-size: 13px; }
.kvs .kv { display: flex; gap: 10px; } .kvs .k { color: var(--ink-3); flex: none; min-width: 64px; } .kvs .v { color: var(--ink); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fld { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.fld textarea.input, .row2 input.input, .adm-body input.input, .adm-body textarea.input { min-height: 44px; padding: 10px 12px; }
.toggle { display: flex; align-items: center; gap: 10px; text-align: right; font-size: 14px; }
.toggle .knob { width: 40px; height: 24px; border-radius: 12px; background: var(--surface-3); position: relative; flex: none; transition: background .2s; }
.toggle .knob::after { content: ""; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.toggle.on .knob { background: var(--accent); } .toggle.on .knob::after { transform: translateX(-16px); }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.check small { color: var(--ink-3); font-size: 11px; }

/* ---------------------------------------------------------------- credits */
.packs { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.pack { padding: 14px 8px; text-align: center; display: flex; flex-direction: column; gap: 2px; align-items: center; transition: background .15s, transform .12s var(--ease); }
.pack:active { transform: scale(.98); background: var(--surface-2); }
.pack .c { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.pack .l { font-size: 11.5px; color: var(--ink-3); }
.pack .p { font-size: 12.5px; color: var(--ink); margin-top: 6px; font-weight: 600; }
.pack .p.soon { color: var(--ink-3); font-weight: 500; }
.pack.best { border-color: var(--accent-line); }
.pack .tag { font-size: 10.5px; color: var(--accent-2); background: var(--accent-tint); padding: 1px 8px; border-radius: 6px; margin-bottom: 4px; }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.bar .lbl { display: flex; justify-content: space-between; color: var(--ink-2); }
.bar .trk { height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.bar .fill { height: 100%; border-radius: 4px; transform-origin: right; transition: transform .8s var(--ease); }
.bar.gift .fill { background: var(--warn); }
.bar.paid .fill { background: var(--accent); }
.note { font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }

/* ---------------------------------------------------------------- dock */
/* A floating bar with a notch cut out of it (a mask that follows --nx), and a circle that
   glides to the active tab on a spring; the active icon lifts into the circle. */
@property --nx { syntax: "<length>"; inherits: true; initial-value: 0px; }
.dock { position: fixed; z-index: 5; left: 16px; right: 16px; bottom: calc(var(--safe-bottom) + 12px); height: var(--dock-h); padding: 0 6px; display: grid; grid-template-columns: repeat(4, 1fr); transition: transform .35s var(--ease), opacity .25s, --nx .55s var(--spring); --nx: 0px; }
.dock::before { content: ""; position: absolute; inset: 0; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 16px 40px -20px rgba(0, 0, 0, .9);
  -webkit-mask-image: radial-gradient(circle at var(--nx) 4px, transparent 36px, #000 37px); mask-image: radial-gradient(circle at var(--nx) 4px, transparent 36px, #000 37px); }
.dock.gone { transform: translateY(140%); opacity: 0; pointer-events: none; }
.dock-ind { position: absolute; top: -28px; left: 0; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); border: 4px solid var(--bg); box-sizing: content-box; transform: translate3d(0, 0, 0); transition: transform .55s var(--spring), opacity .2s; box-shadow: 0 10px 24px -10px rgba(91, 140, 255, .9); }
.dock-ind.hidden-ind { opacity: 0; }
.dock-btn { position: relative; z-index: 1; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--ink-3); transition: color .25s; }
.dock-btn svg { width: 22px; height: 22px; transition: transform .55s var(--spring), color .25s; }
.dock-btn span { transition: transform .45s var(--spring), opacity .25s; }
.dock-btn.on { color: var(--accent-2); }
.dock-btn.on svg { transform: translateY(-19px); color: #fff; }
.dock-btn.on span { transform: translateY(7px); font-weight: 600; }
.dock-btn:active svg { transform: scale(.9); }
.dock-btn.on:active svg { transform: translateY(-19px) scale(.92); }

/* ---------------------------------------------------------------- toast */
.toast { position: fixed; z-index: 9; left: 50%; bottom: calc(var(--dock-h) + var(--safe-bottom) + 48px); transform: translate(-50%, 14px) scale(.96); opacity: 0; pointer-events: none; max-width: calc(100% - 48px); padding: 10px 16px; border-radius: 12px; font-size: 13.5px; text-align: center; background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: var(--shadow); transition: transform .35s var(--spring), opacity .2s; }
.toast.show { transform: translate(-50%, 0) scale(1); opacity: 1; }
.toast.err { border-color: rgba(240, 97, 109, .5); }

/* ---------------------------------------------------------------- boot */
/* The intro: the ring draws itself, the core pops with a pulse, a satellite starts to
   orbit, the letters rise one by one, a loading line runs; then everything lifts away.
   Times are from page load; the page keeps the splash up for at least 1.6 s. */
.boot { position: fixed; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: var(--bg); overflow: hidden; }
.boot-glow { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; background: radial-gradient(circle, rgba(91, 140, 255, .22), rgba(91, 140, 255, 0) 60%); animation: bloom 1.4s var(--ease-out) .2s both; pointer-events: none; }
@keyframes bloom { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
.boot-mark { position: relative; width: 120px; height: 120px; }
.boot-mark svg { width: 120px; height: 120px; overflow: visible; }
.boot-mark .ring { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 264; stroke-dashoffset: 264; transform: rotate(-90deg); transform-origin: 50% 50%; animation: draw 1s var(--ease-out) .1s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.boot-mark .orbit-ring { fill: none; stroke: rgba(255, 255, 255, .12); stroke-width: 1; stroke-dasharray: 2 6; opacity: 0; animation: fadeIn .6s ease .9s forwards, slowspin 24s linear 0s infinite; transform-origin: 50% 50%; }
.boot-mark .core { fill: var(--accent-2); transform-origin: 50% 50%; transform: scale(0); animation: popCore .55s var(--spring) .75s forwards; }
@keyframes popCore { to { transform: scale(1); } }
.boot-mark .orbit { transform-origin: 50% 50%; opacity: 0; animation: fadeIn .4s ease 1.05s forwards, spin 3.2s linear 1.05s infinite; }
.boot-mark .sat { fill: #fff; }
@keyframes slowspin { to { transform: rotate(360deg); } }
.boot-mark .ping { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; animation: ping .9s var(--ease-out) .95s both; }
@keyframes ping { 0% { opacity: .7; transform: scale(.5); } 100% { opacity: 0; transform: scale(2.1); } }
@keyframes fadeIn { to { opacity: 1; } }
.wordmark { display: flex; direction: ltr; gap: .18em; font-weight: 700; font-size: 26px; letter-spacing: .06em; }
.wordmark i { font-style: normal; display: inline-block; opacity: 0; animation: letter .6s var(--ease-out) both; animation-delay: calc(.95s + var(--i, 0) * 70ms); }
.wordmark i:nth-child(1) { --i: 0; } .wordmark i:nth-child(2) { --i: 1; } .wordmark i:nth-child(3) { --i: 2; } .wordmark i:nth-child(4) { --i: 3; } .wordmark i:nth-child(5) { --i: 4; }
@keyframes letter { from { opacity: 0; transform: translateY(14px) scale(.9); filter: blur(6px); } 60% { filter: blur(0); } to { opacity: 1; transform: none; filter: blur(0); } }
.boot-sub { font-size: 13px; color: var(--ink-2); text-align: center; max-width: 280px; animation: bootIn .6s var(--ease-out) 1.35s both; }
.boot-line { width: 120px; height: 2px; border-radius: 2px; background: var(--surface-3); overflow: hidden; margin-top: 8px; animation: bootIn .5s ease 1.4s both; }
.boot-line i { display: block; height: 100%; width: 40%; border-radius: 2px; background: var(--accent); animation: slide 1.1s var(--ease) 1.4s infinite; }
@keyframes slide { 0% { transform: translateX(-120%); } 100% { transform: translateX(300%); } }
.boot.ready .boot-line i { animation: none; width: 100%; transform: none; transition: width .3s var(--ease-out); }
@keyframes bootIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* exit: the mark lifts and grows, the type drifts up, the backdrop fades last */
.boot.out { animation: bootBg .45s ease .2s forwards; pointer-events: none; }
.boot.out .boot-mark { animation: markOut .5s var(--ease) forwards; }
.boot.out .wordmark, .boot.out .boot-sub, .boot.out .boot-line { animation: typeOut .35s var(--ease) forwards; }
.boot.out .boot-glow { animation: bootBg .4s ease forwards; }
@keyframes bootBg { to { opacity: 0; } }
@keyframes markOut { to { opacity: 0; transform: translateY(-24px) scale(1.25); } }
@keyframes typeOut { to { opacity: 0; transform: translateY(-10px); } }
.perf-low .wordmark i { filter: none; animation-name: bootIn; }
.perf-low .boot-glow { display: none; }

/* ---------------------------------------------------------------- misc */
.sticky-foot { position: sticky; bottom: 0; padding-top: 8px; background: linear-gradient(180deg, transparent, var(--bg) 35%); }
.shake { animation: shake .4s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.fade-swap { animation: screenIn .25s var(--ease) both; }

@media (min-width: 560px) {
  #app { max-width: 560px; margin: 0 auto; }
  .dock { left: 50%; right: auto; width: 528px; transform: translateX(-50%); }
  .dock.gone { transform: translate(-50%, 140%); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .spinner { animation: spin 1.2s linear infinite !important; animation-iteration-count: infinite !important; }
}

/* ---------------------------------------------------------------- home: ask box, balance strip, services rail */
.ask { padding: 8px 8px 10px; display: flex; flex-direction: column; gap: 8px; }
.ask-row { display: flex; gap: 8px; align-items: flex-end; }
.ask textarea.input { flex: 1; min-height: 48px; max-height: 140px; padding: 13px 12px; background: transparent; border-color: transparent; font-size: 15.5px; }
.ask textarea.input:focus { box-shadow: none; border-color: transparent; }
.ask textarea.input::placeholder { color: var(--ink-3); }
.ask .go { width: 48px; height: 48px; border-radius: 14px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 6px 18px -8px var(--accent); transition: transform .18s var(--spring), filter .15s; }
.ask .go svg { width: 22px; height: 22px; }
.ask .go:active { transform: scale(.9); filter: brightness(1.1); }
.ask-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 4px 4px; margin: 0 -2px; -webkit-overflow-scrolling: touch; }
.ask-chips::-webkit-scrollbar { display: none; }
.ask-chips .chip { flex: none; min-height: 36px; padding: 6px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; background: var(--surface-2); }
.ask-chips .chip.more { color: var(--accent-2); border-color: var(--accent-line); background: var(--accent-tint); }
.ask-chips .chip svg { width: 15px; height: 15px; }
.strip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; width: 100%; text-align: right; }
.strip .lbl { font-size: 12.5px; color: var(--ink-2); flex: none; }
.strip .v { font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1; flex: none; }
.strip .meter { flex: 1; height: 5px; }
.strip .chev { color: var(--ink-3); flex: none; display: grid; }
.strip .chev svg { width: 18px; height: 18px; }
.section-title .link { font-size: 12.5px; color: var(--accent-2); font-weight: 600; }
.rail { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding: 2px 2px 8px; margin: 0 -2px; -webkit-overflow-scrolling: touch; }
.rail::-webkit-scrollbar { display: none; }
.rail .rcard { flex: none; width: 132px; min-height: 126px; scroll-snap-align: start; padding: 12px; display: flex; flex-direction: column; gap: 10px; text-align: right; transition: background .15s, transform .12s var(--ease); }
.rail .rcard:active { transform: scale(.97); background: var(--surface-2); }
.rail .rcard .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent-2); }
.rail .rcard .ico svg { width: 20px; height: 20px; }
.rail .rcard .t { font-weight: 600; font-size: 13.5px; line-height: 1.45; flex: 1; }
.rail .rcard .p { font-size: 11.5px; color: var(--ink-3); }
.rail .rcard.all { align-items: center; justify-content: center; text-align: center; border-style: dashed; }
.rail .rcard.all .t { flex: none; color: var(--accent-2); }
