/* Edify Mini App — dark navy by default, light theme via [data-theme="light"]. */

/* The Mini App's own fonts: Inter for text, Mulish for headings, variable WOFF2 (fetch_assets.py UI_FONTS). */
@font-face { font-family: "Inter"; font-weight: 400 900; font-display: swap; src: url("/fonts/Inter-var.web1.woff2") format("woff2"); }
@font-face { font-family: "Mulish"; font-weight: 400 1000; font-display: swap; src: url("/fonts/Mulish-var.web1.woff2") format("woff2"); }
/* Montserrat, the default title font, as the video draws it (fetch_assets.py UI_WEIGHTS). */
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url("/fonts/Montserrat-700.web1.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 800; font-display: swap; src: url("/fonts/Montserrat-800.web1.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 900; font-display: swap; src: url("/fonts/Montserrat-900.web1.woff2") format("woff2"); }
/* The other title fonts, for the font chips and the preview: Latin + Cyrillic copies made by fetch_assets.py. */
@font-face { font-family: "Onest"; font-weight: 900; font-display: swap; src: url("/fonts/Onest-900.web1.woff2") format("woff2"); }
@font-face { font-family: "Onest"; font-weight: 800; font-display: swap; src: url("/fonts/Onest-800.web1.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 900; font-display: swap; src: url("/fonts/Nunito-900.web1.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 800; font-display: swap; src: url("/fonts/Nunito-800.web1.woff2") format("woff2"); }
@font-face { font-family: "Oswald"; font-weight: 700; font-display: swap; src: url("/fonts/Oswald-700.web1.woff2") format("woff2"); }
@font-face { font-family: "Oswald"; font-weight: 600; font-display: swap; src: url("/fonts/Oswald-600.web1.woff2") format("woff2"); }
@font-face { font-family: "Exo 2"; font-weight: 900; font-display: swap; src: url("/fonts/Exo2-900.web1.woff2") format("woff2"); }
@font-face { font-family: "Exo 2"; font-weight: 800; font-display: swap; src: url("/fonts/Exo2-800.web1.woff2") format("woff2"); }
/* Styles named for their look; Nouveau (Ruslan Display) has a Reserved Font Name and is served as released. */
@font-face { font-family: "Widescreen"; font-weight: 900; font-display: swap; src: url("/fonts/Unbounded-900.web1.woff2") format("woff2"); }
@font-face { font-family: "Widescreen"; font-weight: 800; font-display: swap; src: url("/fonts/Unbounded-800.web1.woff2") format("woff2"); }
@font-face { font-family: "Notebook"; font-weight: 700; font-display: swap; src: url("/fonts/Caveat-700.web1.woff2") format("woff2"); }
@font-face { font-family: "Silk"; font-weight: 700; font-display: swap; src: url("/fonts/CormorantGaramondItalic-700.web1.woff2") format("woff2"); }
@font-face { font-family: "Heavyweight"; font-weight: 400; font-display: swap; src: url("/fonts/DelaGothicOne-400.web1.woff2") format("woff2"); }
@font-face { font-family: "Marble"; font-weight: 400; font-display: swap; src: url("/fonts/Prata-400.web1.woff2") format("woff2"); }
@font-face { font-family: "Invitation"; font-weight: 400; font-display: swap; src: url("/fonts/GreatVibes-400.web1.woff2") format("woff2"); }
@font-face { font-family: "Boardwalk"; font-weight: 400; font-display: swap; src: url("/fonts/Pacifico-400.web1.woff2") format("woff2"); }
@font-face { font-family: "Deco Line"; font-weight: 400; font-display: swap; src: url("/fonts/PoiretOne-400.web1.woff2") format("woff2"); }
@font-face { font-family: "Editorial"; font-weight: 900; font-display: swap; src: url("/fonts/NotoSerifDisplay-900.web1.woff2") format("woff2"); }
@font-face { font-family: "Editorial"; font-weight: 800; font-display: swap; src: url("/fonts/NotoSerifDisplay-800.web1.woff2") format("woff2"); }
@font-face { font-family: "Billboard"; font-weight: 900; font-display: swap; src: url("/fonts/AlumniSans-900.web1.woff2") format("woff2"); }
@font-face { font-family: "Billboard"; font-weight: 800; font-display: swap; src: url("/fonts/AlumniSans-800.web1.woff2") format("woff2"); }
@font-face { font-family: "Feather"; font-weight: 400; font-display: swap; src: url("/fonts/BadScript-400.web1.woff2") format("woff2"); }
@font-face { font-family: "Nouveau"; font-weight: 400; font-display: swap; src: url("/fonts/RuslanDisplay-400.ttf") format("truetype"); }
@font-face { font-family: "Modernist"; font-weight: 900; font-display: swap; src: url("/fonts/Jost-900.web1.woff2") format("woff2"); }
@font-face { font-family: "Modernist"; font-weight: 800; font-display: swap; src: url("/fonts/Jost-800.web1.woff2") format("woff2"); }
@font-face { font-family: "Chisel"; font-weight: 700; font-display: swap; src: url("/fonts/CormorantSC-700.web1.woff2") format("woff2"); }

:root,
[data-theme="dark"] {
  --bg: #0b0b0f;
  --card: #17161d;
  --card-2: #211f29;
  --card-3: #2c2a35;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.15);
  --text: #f5f4fa;
  --muted: #9894ab; /* 5.9:1 on --card */
  --muted-2: #5f5d77; /* decoration only (lines, chevrons, empty thumbnails): text takes --muted, 4.5:1 and up */
  --invert-bg: #f5f4fa;
  --invert-text: #0b0b0f;
  --dot: #c6ff33;
  --ok: #37c978;
  --warn: #f0643c;
  --err: #ff5a5f;
  /* the palette: black, violet, lime, white. White text on violet reads at 5.7:1, black on lime at 17.8:1 */
  --accent: #7d39eb;
  --accent-text: #a77bf3; /* violet as text on the dark page, 5.2:1 */
  --lime: #c6ff33;
  --ink: #0b0b0f;
  --bar: #1c1b22;
  --grad: var(--accent);
  --grad-fab: var(--lime);
  --glow: 0 10px 24px -14px rgba(0, 0, 0, 0.6);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  --chart-a: #7d39eb;
  --chart-b: #c6ff33;
  --radius: 26px;
  --tile-violet: rgba(125, 57, 235, 0.22); --tile-violet-ink: #c3a3f7;
  --tile-lime: rgba(198, 255, 51, 0.16); --tile-lime-ink: #c6ff33;
  --tile-sky: rgba(92, 168, 255, 0.18); --tile-sky-ink: #93c4ff;
  --tile-peach: rgba(255, 150, 90, 0.18); --tile-peach-ink: #ffb48a;
  --tile-pink: rgba(255, 110, 180, 0.18); --tile-pink-ink: #ff9fcf;
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --safe-top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --ui: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Mulish", var(--ui);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f3f1f8;
  --card: #ffffff;
  --card-2: #f0eef6;
  --card-3: #e5e2ef;
  --line: rgba(21, 20, 40, 0.07);
  --line-2: rgba(21, 20, 40, 0.14);
  --text: #0b0b0f;
  --muted: #6b6880; /* 4.8:1 on --bg, 5.4:1 on --card */
  --muted-2: #a4a2b6;
  --invert-bg: #0b0b0f;
  --invert-text: #ffffff;
  --accent-text: #6c2bd9;
  --bar: #0b0b0f;
  --shadow: 0 14px 34px -18px rgba(40, 20, 90, 0.18);
  --glow: 0 12px 26px -16px rgba(60, 20, 140, 0.45);
  --dot: #7d39eb;
  --chart-a: #7d39eb;
  --chart-b: #9bd400;
  --tile-violet: #ece3fd; --tile-violet-ink: #6c2bd9;
  --tile-lime: #eaffbf; --tile-lime-ink: #3d5a00;
  --tile-sky: #dcecff; --tile-sky-ink: #1d5fb4;
  --tile-peach: #ffe7d8; --tile-peach-ink: #a8431a;
  --tile-pink: #ffe0ef; --tile-pink-ink: #a3205f;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  min-height: var(--tg-viewport-stable-height, 100vh);
  font: 500 16px/1.4 var(--ui);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  transition: background-color 0.25s ease;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ic { display: block; flex: none; }
.hidden { display: none !important; }

/* the page never scrolls sideways: anything too wide is cut at the screen edge instead of dragging the app along */
#app { max-width: 560px; margin: 0 auto; padding: calc(var(--safe-top) + 12px) 18px 0; overflow-x: clip; }
.view { outline: none; padding-bottom: calc(124px + var(--safe-bottom)); animation: fade-in 0.22s ease both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------- header */
.topbar { display: flex; align-items: center; justify-content: space-between; height: 58px; margin-bottom: 10px; }
.wordmark { font: 800 28px/1 var(--display); letter-spacing: -0.03em; text-decoration: none; color: var(--text); }
.wordmark-dot { color: var(--dot); }
.topbar-actions { display: flex; gap: 10px; }
.balance-chip {
  height: 44px; padding: 0 16px 0 13px; border-radius: 999px; display: flex; align-items: center; gap: 8px;
  background: var(--card); box-shadow: var(--shadow); font: 800 15.5px/1 var(--display); transition: transform 0.12s;
}
.balance-chip:active { transform: scale(0.94); }

/* ------------------------------------------------------------- tab bar */
.tabbar {
  position: fixed; z-index: 30; left: 12px; right: 12px; bottom: calc(10px + var(--safe-bottom));
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  max-width: 536px; margin: 0 auto; padding: 8px 6px;
  background: var(--bar); border-radius: 32px; box-shadow: 0 14px 34px -14px rgba(0, 0, 0, 0.55);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0;
  color: rgba(255, 255, 255, 0.72); font-size: 11.5px; font-weight: 650; text-decoration: none; position: relative;
  transition: color 0.15s;
}
.tab.active {
  color: #fff;
}
.tab-icon {
  position: relative; display: grid; place-items: center; width: 44px; height: 32px; border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}
.tab.active .tab-icon { background: #fff; color: var(--ink, #0b0b0f); }
.tab-fab { padding-top: 0; }
.fab {
  width: 50px; height: 50px; border-radius: 50%; margin-top: -2px;
  display: grid; place-items: center; color: #0b0b0f; background: var(--lime, #c6ff33);
  transition: transform 0.15s;
}
.tab-fab:active .fab { transform: scale(0.93); }
/* on the create screen the FAB has nothing to call for: the gradient button above it does the asking */
.tab-fab.active .fab {
  background: var(--lime, #c6ff33); color: #0b0b0f;
}

/* ------------------------------------------------------------- basics */
.card {
  background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.caps {
  margin: 28px 2px 12px; font: 800 12.5px/1.2 var(--display); letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--muted);
}
.caps:first-child { margin-top: 4px; }
.h1 { font: 900 34px/1.1 var(--display); letter-spacing: -0.025em; margin: 6px 0 12px; }
.sub { color: var(--muted); font-size: 16px; line-height: 1.45; margin: 0 0 22px; }
.muted { color: var(--muted); }
.stack > * + * { margin-top: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.spacer { flex: 1; }

.btn {
  height: 50px; border-radius: 999px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; font: 800 15.5px/1 var(--display); white-space: nowrap; min-width: 0; transition: transform 0.12s, opacity 0.2s;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn.grad { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.btn.outline { border: 1.5px solid var(--line-2); }
.btn.white { background: var(--invert-bg); color: var(--invert-text); }
.btn.ghost { color: var(--muted); height: 48px; }
.btn.danger { color: var(--err); height: 48px; }
.btn.block { width: 100%; }
.btn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.btn-row .btn { padding: 0 12px; }
.btn > span { overflow: hidden; text-overflow: ellipsis; }

.badge-grad {
  display: inline-block; padding: 5px 11px 4px; border-radius: 999px; background: var(--grad); color: #fff;
  font: 800 11.5px/1 var(--display); letter-spacing: 0.07em; text-transform: uppercase;
}

/* ------------------------------------------------------------- chips */
.chips { display: flex; gap: 12px; }
/* every choice in sight: chips wrap onto more rows instead of scrolling sideways */
.chips.chips-all { flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative; flex: none; height: 44px; padding: 0 20px; border-radius: 999px;
  border: 1.5px solid var(--line-2); display: inline-flex; align-items: center; gap: 9px;
  font: 700 16.5px/1 var(--ui); transition: background 0.15s, color 0.15s, transform 0.12s;
}
.chip:active:not(:disabled) { transform: scale(0.96); }
.chip.active { background: var(--invert-bg); color: var(--invert-text); border-color: transparent; }
.chip:disabled { color: var(--muted); }
.chips-all .chip { height: 44px; padding: 0 16px; font-size: 16px; }
.chip.sm { height: 44px; padding: 0 15px; font-size: 15px; gap: 8px; }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; }
/* the three title sizes always fit in one row: no scrolling for three choices */
.chips.sizes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px 0 4px; }
.chips.sizes .chip { justify-content: center; padding: 0 8px; min-width: 0; }
.chips.place { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 2px 0 14px; }
.chips.place .chip { justify-content: center; min-width: 0; }
.place-hint { margin: -6px 2px 14px; }

/* ------------------------------------------------------------- style preview */
.preview {
  position: relative; width: 62%; max-width: 300px; margin: 4px auto 18px; aspect-ratio: 2 / 3;
  border-radius: var(--radius); overflow: hidden; background: #1b1512; box-shadow: var(--shadow);
  container-type: inline-size; isolation: isolate;
}
.preview-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.preview-img + .cap { text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); }

.look-card {
  position: relative; display: flex; align-items: center; gap: 16px; width: 100%; padding: 12px 16px 12px 12px;
  text-align: left; transition: transform 0.12s;
}
.look-card:active { transform: scale(0.985); }
.preview.preview-mini { flex: none; width: 108px; margin: 0; border-radius: 14px; box-shadow: none; }
.look-sum { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ls-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ls-l { flex: none; color: var(--muted); font-size: 14.5px; }
.ls-v {
  min-width: 0; display: inline-flex; align-items: center; gap: 7px; font-size: 15.5px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ls-edit {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 2px; height: 36px; margin-top: 2px;
  padding: 0 10px 0 16px; border-radius: 999px; border: 1.5px solid var(--line-2); font-size: 15px; font-weight: 700;
}
.look-card .badge-new { position: absolute; top: 18px; left: 18px; }
/* effects: what is on, in one card; the switches are in a sheet */
.effects-card {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 14px 14px 18px;
  text-align: left; transition: transform 0.12s;
}
.effects-card:active { transform: scale(0.985); }
.effects-sum { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.es-on { display: flex; align-items: center; gap: 8px; font-size: 15.5px; font-weight: 650; }
.es-on .ic {
  color: var(--accent-text);
}
.es-none { color: var(--muted); font-size: 15.5px; }
.effects-card .ls-edit { align-self: center; margin-top: 0; }
.effects-card .badge-new { position: absolute; top: 12px; right: 14px; }

/* the caption look sheet: the page colour behind white blocks, one block per choice */
.sheet.look-sheet { background: var(--bg); }
.look-sheet .look-preview { background: var(--bg); }
.look-sheet .look-preview::after { background: linear-gradient(var(--bg), transparent); }
.look-group { background: var(--card); border-radius: 24px; padding: 16px; box-shadow: var(--shadow); margin-top: 12px; }
.lg-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.lg-title { margin: 0; font: 900 20px/1.2 var(--display); letter-spacing: -0.01em; }
.look-group .chips-all { gap: 8px; }
.look-group .chip { border-color: transparent; background: var(--card-2); }
.look-group .chip.active { background: var(--accent); color: #fff; }
.look-group .chips.sizes { padding: 0; }
.swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.swatch {
  display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 84px; padding: 12px 4px 10px;
  border-radius: 18px; background: var(--card-2); border: 2px solid transparent; transition: border-color 0.15s;
}
.swatch.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.sw-dot { width: 32px; height: 32px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.sw-name { font-size: 14px; font-weight: 700; }
.look-sheet .opts { margin-top: 12px; }
.look-sheet .opt-row { background: var(--card); box-shadow: var(--shadow); }
.look-sheet .look-done { margin-top: 16px; }

/* effects: one tile per function; an off tile is plain, an on tile takes its colour */
.fx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.fx {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 132px;
  padding: 14px; border-radius: 24px; text-align: left; box-shadow: var(--shadow); transition: transform 0.12s, background 0.2s;
}
.fx:active { transform: scale(0.97); }
.fx[aria-checked="false"] { background: var(--card); color: var(--text); }
.fx[aria-checked="true"] { color: var(--text); }
.fx-top { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-bottom: 8px; }
.fx-ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: color-mix(in srgb, var(--card) 70%, transparent); }
.fx[aria-checked="false"] .fx-ic { background: var(--card-2); color: var(--muted); }
.fx .switch { transform: scale(0.84); transform-origin: right center; }
.fx-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font: 500 16.5px/1.2 var(--ui); }
.fx-sub { color: var(--muted); font-size: 13.5px; line-height: 1.3; }
[data-theme="light"] .fx[aria-checked="true"] .fx-sub { color: color-mix(in srgb, var(--text) 72%, transparent); }
#picturesAtSlot:not(:empty) { margin-top: 12px; }

/* the free first video: a lime banner above the upload card while it is unused */
.free-banner {
  display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding: 16px 18px;
  border-radius: 24px; background: var(--lime); color: #0b0b0f; box-shadow: var(--shadow);
}
.free-ic { flex: none; width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: #0b0b0f; color: var(--lime); }
.free-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.free-title { font: 900 18px/1.2 var(--display); }
.free-sub { font-size: 14px; line-height: 1.35; color: #2a3500; }
.pay-badge {
  display: inline-block; margin-left: 8px; padding: 4px 8px 3px; border-radius: 999px; vertical-align: 2px;
  background: var(--lime); color: #0b0b0f; font: 800 11px/1 var(--display);
}

/* how to pay: two plain choices, said before the button is pressed */
.pay-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 6px; }
.pay-opt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 84px; padding: 16px;
  border-radius: 22px; border: 2px solid transparent; background: var(--card); box-shadow: var(--shadow); text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.pay-opt.active {
  border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--card));
}
.pay-title { font: 500 17.5px/1.15 var(--ui); }
.pay-sub { color: var(--muted); font-size: 14px; line-height: 1.3; }
.pay-opt.active .pay-sub { color: var(--text); }

/* the sheet keeps its preview in sight while the choices scroll under it */
.look-preview { position: sticky; top: -10px; z-index: 4; margin: 0 -26px; padding: 4px 26px 10px; background: var(--card); }
.look-preview::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 16px; pointer-events: none;
  background: linear-gradient(var(--card), transparent);
}
.look-preview .preview { width: 44%; max-width: 220px; margin: 0 auto; }
.look-sheet .caps { margin: 16px 2px 10px; }
.look-sheet .chips.sizes { padding-top: 0; }
.look-sheet .opts { margin-top: 10px; }
.look-done { margin-top: 18px; }
.scene { position: absolute; inset: 0; filter: blur(1.3px) saturate(1.05); }
.scene > i { position: absolute; display: block; }
.scene-wall { inset: 0; background: radial-gradient(120% 75% at 30% 28%, #4d3e32 0%, #2e241e 52%, #16110f 100%); }
.scene-lamp { inset: 0; background: radial-gradient(circle at 15% 60%, rgba(255, 205, 130, 0.95) 0 2.5%, rgba(255, 170, 90, 0.4) 9%, transparent 27%); }
.scene-shelf { left: 0; width: 42%; height: 2.5%; background: #6b4c35; box-shadow: 0 1px 0 #2a1d15; }
.scene-shelf.s1 { top: 22%; } .scene-shelf.s2 { top: 34%; }
.scene-slats {
  top: 0; bottom: 0; right: 0; width: 34%;
  background: repeating-linear-gradient(90deg, #8a6040 0 7%, #4b3120 7% 10%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%); mask-image: linear-gradient(90deg, transparent, #000 40%);
  opacity: 0.85;
}
.scene-body {
  left: 9%; right: 9%; top: 47%; bottom: -8%;
  border-radius: 46% 46% 0 0 / 24% 24% 0 0; background: linear-gradient(#17120f, #080606);
  box-shadow: inset 7px 4px 12px -6px rgba(255, 185, 115, 0.45);
}
.scene-neck { left: 43.5%; width: 13%; top: 38%; height: 11%; background: #100b09; border-radius: 0 0 40% 40%; box-shadow: inset 3px 0 5px -2px rgba(255, 185, 115, 0.4); }
.scene-head {
  left: 35%; width: 30%; top: 17%; height: 26%; border-radius: 47% 47% 44% 44%;
  background: radial-gradient(75% 65% at 30% 42%, #3b2a20 0%, #1b1310 58%, #0d0908 100%);
  box-shadow: -2px 0 9px -1px rgba(255, 190, 120, 0.5), inset 5px 0 8px -4px rgba(255, 200, 140, 0.55);
}
.scene-hair { left: 34%; width: 32%; top: 14.5%; height: 10%; border-radius: 50% 50% 28% 28%; background: #0c0807; box-shadow: -2px -1px 7px -1px rgba(255, 190, 120, 0.4); }
.scene-vignette { inset: 0; background: radial-gradient(ellipse at 50% 42%, transparent 45%, rgba(0, 0, 0, 0.55) 100%), linear-gradient(transparent 55%, rgba(0, 0, 0, 0.35)); }
.cap {
  position: absolute; z-index: 3; left: 4%; right: 4%; top: 61%;
  font-family: var(--cap-font, "Montserrat"), var(--ui); text-align: center; line-height: 0.92; pointer-events: none;
}
/* Another title font keeps Montserrat ExtraBold's x-height (0.542 em), as the engine sizes it. */
.cap-adjust .cap { font-size-adjust: 0.542; }
.cap-row {
  display: flex; justify-content: space-between; padding: 0 13%;
  font-weight: var(--cap-support-w, 800); color: #fff;
  font-size: calc(19px * var(--cap-scale, 1)); font-size: calc(7.6cqw * var(--cap-scale, 1));
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.cap-hero {
  display: block; font-weight: var(--cap-hero-w, 900);
  font-size: calc(34px * var(--cap-scale, 1)); font-size: calc(14.2cqw * var(--cap-scale, 1));
  letter-spacing: var(--cap-track, -0.035em);
  color: var(--hero, #ffe24d); text-transform: lowercase; margin: 0.02em 0;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.35); transition: color 0.25s ease;
}
/* Without accent words the phrase is rows of words alike, centred. */
.cap-row.plain { justify-content: center; gap: 0.28em; padding: 0; margin-bottom: 0.08em; }
/* The caption styles play in the preview (app.js playPreview): a word shows once it is "said", popping in. */
.cap [data-i] { visibility: hidden; }
.cap [data-i].said { visibility: visible; animation: cap-pop 0.2s cubic-bezier(0.34, 1.7, 0.6, 1) both; }
@keyframes cap-pop { from { opacity: 0; transform: scale(0.85); } }
/* Titles on one line, sized against the 1080 px frame like the engine's (style.py WORD_SIZE, CHUNK_SIZE, LINE_SIZE). */
.cap.caps-word, .cap.caps-chunk, .cap.caps-sentence, .cap.caps-karaoke {
  top: 63%; white-space: nowrap; font-weight: var(--cap-support-w, 800); color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.cap.caps-word { font-size: calc(26px * var(--cap-scale, 1)); font-size: calc(10.3cqw * var(--cap-scale, 1)); }
.cap.caps-chunk { font-size: calc(20px * var(--cap-scale, 1)); font-size: calc(8cqw * var(--cap-scale, 1)); }
.cap.caps-sentence, .cap.caps-karaoke {
  font-size: calc(17px * var(--cap-scale, 1)); font-size: calc(6.7cqw * var(--cap-scale, 1));
}
.cap-words { display: inline-flex; align-items: baseline; gap: 0.26em; }
.cap-words .cw { display: inline-block; }
.cap-words .acc {
  font-size: 1.3em; font-weight: var(--cap-hero-w, 900); letter-spacing: var(--cap-track, -0.035em);
  color: var(--hero, #ffe24d);
}
.caps-word .cap-words .acc { font-size: 1.4em; }
.caps-sentence .cap-words .acc, .caps-karaoke .cap-words .acc { font-size: 1.25em; }
.caps-karaoke .cap-words .cw { color: #fff; transition: color 0.12s linear; }
.caps-karaoke .cap-words .cw.on { color: var(--hero, #ffe24d); }

/* ------------------------------------------------------------- create form */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 32px 2px 14px; }
.section-title {
  font: 900 26px/1.2 var(--display); letter-spacing: -0.015em; margin: 0;
}
.link-dashed {
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px; margin: -10px 0; color: var(--muted);
  font-size: 15.5px; font-weight: 600;
}
.link-dashed span { border-bottom: 1.5px dashed var(--muted-2); padding-bottom: 2px; }

.create-title { margin-top: 10px; }
.create-sub { margin-bottom: 18px; }
/* the first thing to do, and the biggest thing on the screen */
.dropzone {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 30px 22px 24px;
  border-radius: 30px; background: var(--accent); color: #fff; cursor: pointer;
  box-shadow: var(--glow); transition: transform 0.15s, background 0.2s;
}
.dropzone:active {
  transform: scale(0.985);
}
.dz-icon {
  width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center; margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.16); color: #fff;
}
.dz-btn {
  display: inline-flex; align-items: center; min-height: 50px; margin-top: 14px; padding: 0 26px; border-radius: 999px;
  background: var(--lime, #c6ff33); color: #0b0b0f; font: 800 16px/1 var(--display);
}
.dz-formats {
  margin-top: 8px; color: rgba(255, 255, 255, 0.86); font-size: 13.5px;
}
.dz-req { display: flex; width: max-content; margin: 2px auto -6px; }
.dropzone.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.dropzone.shake { animation: shake 0.4s; border-color: var(--err); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.dz-title { font: 900 25px/1.15 var(--display); }
.dz-sub {
  color: rgba(255, 255, 255, 0.9); font-size: 15px;
}
.file-card { display: flex; align-items: center; gap: 16px; padding: 14px; }
.file-thumb {
  flex: none; width: 56px; height: 76px; border-radius: 14px; background: var(--card-2) center / cover no-repeat;
  display: grid; place-items: center; color: var(--muted-2);
}
.file-info { min-width: 0; flex: 1; }
.file-name { font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { color: var(--muted); font-size: 15px; margin-top: 4px; }
.file-meta.bad { color: var(--err); }
.x-btn { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); color: var(--muted); }

.opts {
  display: grid; gap: 10px; margin-top: 10px;
}
.opt { position: relative; }
.opt-row {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 14px 16px;
  border-radius: 22px; background: var(--card); box-shadow: var(--shadow); text-align: left;
}
.sheet .opt-row { background: var(--card-2); box-shadow: none; }
.tile { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; }
.tile-violet { background: var(--tile-violet); color: var(--tile-violet-ink); }
.tile-lime { background: var(--tile-lime); color: var(--tile-lime-ink); }
.tile-sky { background: var(--tile-sky); color: var(--tile-sky-ink); }
.tile-peach { background: var(--tile-peach); color: var(--tile-peach-ink); }
.tile-pink { background: var(--tile-pink); color: var(--tile-pink-ink); }
.opts .opt:last-child .opt-row {
  border-bottom: 0;
}
.opt-text { flex: 1; min-width: 0; }
.opt-label { display: flex; align-items: center; gap: 8px; font: 500 17px/1.25 var(--ui); }
.opt-sub { display: block; margin-top: 3px; color: var(--muted); font-size: 14px; line-height: 1.35; }
.badge-new {
  flex: none; padding: 5px 9px 4px; border-radius: 999px; background: var(--lime, #c6ff33); color: #0b0b0f;
  font: 800 11.5px/1 var(--display); letter-spacing: 0.03em;
}

.switch {
  position: relative; flex: none; width: 50px; height: 30px; border-radius: 999px;
  background: var(--card-2); border: 1px solid var(--line); transition: background 0.2s;
}
.switch::after {
  content: ""; position: absolute; top: 2.5px; left: 3px; width: 23px; height: 23px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); transition: transform 0.22s cubic-bezier(0.3, 0.8, 0.3, 1.1), background 0.2s;
}
/* on: the accent colour, not only the knob's side, tells it apart */
[aria-checked="true"] > .switch, .fx[aria-checked="true"] .switch { background: var(--accent); border-color: transparent; }
[aria-checked="true"] > .switch::after, .fx[aria-checked="true"] .switch::after { transform: translateX(19px); }

.figure-pick { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin: 4px 0 14px; cursor: pointer; }
.figure-thumb {
  flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: var(--muted);
  background: var(--card-2) center / contain no-repeat;
}

.brand-fields { margin-top: 4px; }
.fields { display: grid; gap: 10px; }
.field {
  display: block; background: var(--card); border-radius: 18px; padding: 12px 18px 11px;
  border: 1.5px solid transparent; transition: border-color 0.15s;
}
.field:focus-within { border-color: var(--line-2); }
.field.invalid { border-color: var(--err); }
.field-error { display: block; margin-top: 6px; color: var(--err); font-size: 14px; font-weight: 600; }
.field-error:empty { display: none; }
.field-label { display: block; font-size: 13px; font-weight: 650; color: var(--muted); margin-bottom: 3px; }
.field input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 17px; font-weight: 650; padding: 0; }
.field input::placeholder { color: var(--muted); font-weight: 500; }
.hint { color: var(--muted); font-size: 14.5px; margin: 10px 4px 0; line-height: 1.4; }
.platforms { flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* The create screen's button rides on the tab bar; the room below it is the FAB's. */
.cta-bar {
  position: fixed; z-index: 29; left: 0; right: 0; bottom: calc(var(--tabbar-h, 66px) + 10px + var(--safe-bottom));
  max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px; padding: 14px 18px 12px;
  background: linear-gradient(to bottom, transparent, var(--bg) 22px);
}
.cta-bar[hidden] { display: none; }
.cta-bar .cta { box-shadow: var(--glow); }
body.has-cta .view { padding-bottom: calc(124px + 96px + var(--safe-bottom)); }
body.has-cta .toast-root { bottom: calc(var(--tabbar-h, 74px) + 104px); }
.cta-cancel {
  flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card-2); color: var(--text);
}
.cta {
  position: relative; width: 100%; min-height: 60px; border-radius: 999px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: var(--grad); color: #fff; box-shadow: var(--glow); transition: transform 0.12s, opacity 0.2s;
}
.cta:active:not(:disabled) { transform: scale(0.98); }
.cta-title { font: 800 20px/1.1 var(--display); position: relative; }
.cta-sub { font-size: 14.5px; font-weight: 600; position: relative; }
.cta-progress { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(255, 255, 255, 0.2); transition: width 0.2s linear; }
.cta:disabled { background: var(--card-3); color: var(--muted); box-shadow: none; }
.cta.busy:disabled { background: var(--grad); color: #fff; }

/* ------------------------------------------------------------- segmented */
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 5px; border-radius: 999px; background: var(--card); gap: 4px; }
.seg button { height: 42px; border-radius: 999px; font-weight: 700; font-size: 16px; color: var(--muted); transition: background 0.2s, color 0.2s; }
.seg button.active { background: var(--card-3); color: var(--text); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18); }
.seg.sm { display: inline-grid; padding: 4px; background: var(--card-2); }
.seg.sm button { height: 44px; padding: 0 14px; font-size: 15px; }
.seg.sm button.active { background: var(--card); }
.seg.seg-3 { grid-template-columns: repeat(3, auto); }

/* ------------------------------------------------------------- job list */
/* one column no wider than the screen: a long title must not stretch the cards and push the page sideways */
.jobs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 18px; }
.job-card { display: flex; gap: 18px; padding: 14px 18px 14px 14px; text-decoration: none; align-items: center; transition: transform 0.12s; }
.job-card:active { transform: scale(0.985); }
.job-thumb {
  flex: none; width: 54px; height: 78px; border-radius: 13px; display: grid; place-items: center; color: var(--muted-2);
  background: color-mix(in srgb, var(--bg) 60%, var(--card)) center / cover no-repeat;
}
.job-info { min-width: 0; flex: 1; }
/* titles come from the speech and run long: two lines, then an ellipsis */
.job-title {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  font-size: 17px; font-weight: 750; line-height: 1.3; overflow-wrap: anywhere;
}
.job-meta { color: var(--muted); font-size: 15px; margin: 4px 0 6px; }
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15.5px; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.status.queued::before { background: var(--muted); }
.status.processing::before { background: var(--warn); animation: pulse 1.4s ease-in-out infinite; }
.status.done::before { background: var(--ok); }
.status.failed::before { background: var(--err); }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ------------------------------------------------------------- job detail */
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 17px; font-weight: 700; margin: 0 0 14px; padding: 4px 0; }
.player {
  position: relative; width: 74%; margin: 0 auto; aspect-ratio: 9 / 16; border-radius: var(--radius); overflow: hidden;
  background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 26px; color: var(--muted); font-size: 16px; line-height: 1.45;
}
.player video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; object-fit: contain; }
.player .poster { position: absolute; inset: 0; background: center / cover no-repeat; opacity: 0.18; filter: blur(8px); }
.player > :not(video):not(.poster) { position: relative; }
.stage { color: var(--text); font-weight: 750; margin-top: 22px; font-size: 16px; }
.bar { width: 78%; height: 6px; border-radius: 3px; background: var(--card-3); overflow: hidden; margin-top: 12px; }
.bar > i { display: block; height: 100%; border-radius: 3px; background: var(--grad); transition: width 0.6s ease; }
.pct { font: 800 15px/1 var(--display); color: var(--muted); margin-top: 10px; }
.err-ic { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--err) 14%, transparent); color: var(--err); margin-bottom: 16px; }
.err-title { color: var(--text); font-weight: 750; margin-bottom: 8px; }
.refund-note { margin-top: 14px; color: var(--ok); font-weight: 700; font-size: 15px; }
.detail-actions { margin-top: 18px; grid-template-columns: minmax(0, 1fr) auto; }
.detail-actions .btn.outline { padding: 0 18px; }

.table { background: var(--card); border-radius: var(--radius); padding: 2px 20px; }
.tr { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; border-bottom: 1px solid var(--line); }
.tr:last-child { border-bottom: 0; }
.td-l { color: var(--muted); font-size: 16px; }
.td-r { font-weight: 750; font-size: 16px; text-align: right; overflow-wrap: anywhere; }
.td-r.off { color: var(--muted); font-weight: 650; }
.warn-list { margin: 0; padding: 16px 22px 16px 40px; background: var(--card); border-radius: var(--radius); color: var(--muted); }
.warn-list li + li { margin-top: 6px; }

/* ------------------------------------------------------------- balance */
.bal-card { padding: 22px 22px 20px; }
.bal-num { display: flex; align-items: baseline; gap: 14px; margin: 14px 0 8px; }
.bal-num b { font: 800 46px/1 var(--display); letter-spacing: -0.02em; }
.bal-num span { color: var(--muted); font-size: 22px; font-weight: 650; }
.bal-enough { color: var(--muted); font-size: 16px; margin-bottom: 18px; }
.pkgs { display: grid; gap: 12px; }
.pkg {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; width: 100%;
  padding: 18px 20px; border: 2px solid transparent; transition: border-color 0.15s, transform 0.12s;
}
.pkg:active { transform: scale(0.985); }
.pkg.selected { border-color: var(--text); }
.pkg-videos { display: flex; align-items: baseline; gap: 10px; }
.pkg-videos b { font: 800 27px/1.05 var(--display); }
.pkg-videos span { color: var(--muted); font-size: 18px; font-weight: 700; }
.pkg-title { font-size: 17px; font-weight: 700; margin-top: 5px; color: color-mix(in srgb, var(--text) 80%, var(--muted)); }
.pkg-tokens { color: var(--muted); font-size: 15px; margin-top: 3px; }
.pkg-price { text-align: right; flex: none; }
.pkg-price b { display: block; font: 800 21px/1.1 var(--display); }
.pkg-price span { color: var(--muted); font-size: 15px; }
.pkg .badge-grad { margin-bottom: 8px; }
.methods { display: grid; gap: 10px; }
.method {
  display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 58px; padding: 0 20px;
  border: 2px solid transparent; font-size: 17px; font-weight: 750; text-align: left; position: relative;
}
.method.selected { border-color: var(--text); }
.method:disabled { opacity: 0.45; }
.method-price { color: var(--muted); font-size: 15px; font-weight: 600; }
.method .soon-tag { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 800; }
.agree { display: flex; gap: 12px; align-items: flex-start; margin: 22px 2px 0; font-size: 15.5px; color: var(--muted); line-height: 1.45; cursor: pointer; }
.agree a { color: var(--text); }
.checkbox {
  flex: none; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line-2);
  display: grid; place-items: center; color: transparent; transition: background 0.15s;
}
.checkbox.on { background: var(--invert-bg); border-color: transparent; color: var(--invert-text); }
.pay-btn { min-height: 56px; margin-top: 20px; }
.pay-btn .cta-title { font-size: 18px; }

.tx { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.tx:last-child { border-bottom: 0; }
.tx-ic { width: 42px; height: 42px; border-radius: 50%; background: var(--card-2); display: grid; place-items: center; color: var(--muted); flex: none; }
.tx-main { flex: 1; min-width: 0; }
.tx-title { font-weight: 700; }
.tx-date { color: var(--muted); font-size: 14px; }
.tx-delta { font: 800 17px/1 var(--display); }
.tx-delta.plus { color: var(--ok); }

/* ------------------------------------------------------------- profile */
.profile-name { font: 800 25px/1.15 var(--display); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.profile-user { color: var(--muted); font-size: 16px; margin-top: 6px; }
.stat-card { display: flex; align-items: center; gap: 18px; }
.stat-ic { width: 48px; height: 48px; border-radius: 50%; background: var(--card-2); display: grid; place-items: center; flex: none; }
.stat-num { font: 800 24px/1 var(--display); }
.stat-label { color: var(--muted); font-size: 16px; margin-top: 5px; }
.list { background: var(--card); border-radius: var(--radius); padding: 0 20px; }
.list-item {
  display: flex; align-items: center; gap: 16px; width: 100%; min-height: 56px; border-bottom: 1px solid var(--line);
  font-size: 16.5px; font-weight: 650; text-align: left; text-decoration: none;
}
.list-item:last-child { border-bottom: 0; }
.list-item .ic:first-child { color: var(--muted); }
.list-item .chev { margin-left: auto; color: var(--muted-2); }
/* the choices go under the label when they don't fit beside it (the three themes on a 320 px screen) */
.lang-card {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 20px;
  font-size: 16.5px; font-weight: 650;
}
.lang-card .seg { margin-left: auto; }
/* three language names don't fit beside the label: they go under it, in equal thirds of the card */
.lang-pick { flex-direction: column; align-items: stretch; gap: 10px; padding-top: 16px; }
.lang-pick .seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-left: -10px; }
.lang-pick .seg button { padding: 0 4px; }

/* ------------------------------------------------------------- invite */
.link-text { font-size: 16px; margin: 10px 0 18px; overflow-wrap: anywhere; font-weight: 550; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.tile-num { font: 800 30px/1 var(--display); }
.tile-label { color: var(--muted); font-size: 15.5px; margin-top: 8px; }
.week-card { margin-top: 12px; }
.week-card .caps { margin: 0 0 14px; }
.chart-wrap { position: relative; margin-top: 8px; }
.chart { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; height: 118px; border-bottom: 1px solid var(--line-2); }
.chart-grid { position: absolute; left: 0; right: 0; top: 0; border-top: 1px solid var(--line); pointer-events: none; }
.chart-grid span { position: absolute; right: 0; top: -18px; font-size: 12px; color: var(--muted); }
.chart-col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; cursor: pointer; }
.chart-col.sel { background: color-mix(in srgb, var(--text) 5%, transparent); border-radius: 8px 8px 0 0; }
.chart-bar { width: 11px; border-radius: 4px 4px 0 0; }
.chart-bar.a { background: var(--chart-a); }
.chart-bar.b { background: var(--chart-b); }
.chart-days { display: grid; grid-template-columns: repeat(7, 1fr); margin-top: 8px; text-align: center; font-size: 12.5px; color: var(--muted); }
.chart-legend { display: flex; gap: 18px; margin-top: 14px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.chart-tip { min-height: 20px; font-size: 14px; color: var(--text); margin-bottom: 10px; }

/* ------------------------------------------------------------- sheet / toast / states */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(5, 4, 12, 0.6); opacity: 0; transition: opacity 0.25s;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.sheet-backdrop.open { opacity: 1; }
.sheet {
  position: fixed; z-index: 51; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto;
  max-height: calc(var(--tg-viewport-height, 100vh) - 40px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); border-radius: 30px 30px 0 0; padding: 10px 26px calc(26px + var(--safe-bottom));
  transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet.open { transform: none; }
.sheet-grab { width: 42px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 18px; }
.sheet-title { font: 900 28px/1.15 var(--display); margin: 18px 0 12px; }
.sheet p { color: color-mix(in srgb, var(--text) 78%, var(--muted)); font-size: 16px; line-height: 1.5; margin: 0 0 14px; }
.sheet ol { margin: 0 0 18px; padding-left: 24px; color: color-mix(in srgb, var(--text) 78%, var(--muted)); font-size: 16px; line-height: 1.5; }
.sheet ol li + li { margin-top: 6px; }
.sheet h4 { font: 800 17px/1.3 var(--display); margin: 20px 0 10px; }
.req-visual { position: relative; aspect-ratio: 16 / 10; border-radius: 22px; overflow: hidden; background: #1b1512; container-type: inline-size; }
.req-ok {
  position: absolute; z-index: 3; top: 7%; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px;
  padding: 8px 16px 8px 8px; border-radius: 999px; background: #3fc56e; color: #0d2615; font-weight: 800; font-size: 15px; white-space: nowrap;
}
.req-ok b { width: 26px; height: 26px; border-radius: 50%; background: #fff; color: #2d9c55; display: grid; place-items: center; }
.req-card {
  position: absolute; z-index: 3; left: 6%; right: 6%; bottom: 8%; display: flex; gap: 12px; align-items: center; padding: 12px 14px;
  border-radius: 16px; background: rgba(16, 28, 20, 0.78); border: 1px solid rgba(80, 200, 120, 0.35);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; text-align: left;
}
.req-card b { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; background: rgba(80, 200, 120, 0.2); color: #5fe08d; }
.req-card strong { display: block; font-size: 14.5px; }
.req-card small { display: block; color: rgba(255, 255, 255, 0.7); font-size: 12.5px; margin-top: 2px; }
.sheet .btn.white { margin-top: 10px; min-width: 150px; }

.toast-root { position: fixed; z-index: 80; left: 0; right: 0; bottom: calc(108px + var(--safe-bottom)); display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 20px; }
.toast {
  max-width: 440px; padding: 14px 20px; border-radius: 18px; background: var(--invert-bg); color: var(--invert-text);
  font-weight: 650; font-size: 15.5px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); animation: toast-in 0.25s ease both;
  text-align: center;
}
.toast.error { background: var(--err); color: #fff; }
.toast.out { animation: toast-out 0.25s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

.skel { border-radius: var(--radius); background: linear-gradient(90deg, var(--card) 20%, var(--card-2) 50%, var(--card) 80%); background-size: 220% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.empty { text-align: center; padding: 56px 18px 20px; color: var(--muted); font-size: 16px; line-height: 1.5; }
.empty-ic { width: 72px; height: 72px; border-radius: 50%; background: var(--card); display: grid; place-items: center; margin: 0 auto 18px; color: var(--muted); }
.empty .btn { margin-top: 20px; }

@media (max-width: 370px) {
  #app { padding-left: 14px; padding-right: 14px; }
  .chip { padding: 0 18px; font-size: 16.5px; }
  .tab { font-size: 11.5px; }
}
/* short screens: a slimmer button bar leaves more of the form in sight */
@media (max-height: 700px) {
  .cta-bar { padding-top: 10px; padding-bottom: 26px; }
  .cta-bar .cta { min-height: 54px; }
  .cta-bar .cta-title { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
