/* CelebraClip — "adire night": indigo resist-dyed cloth, aso-oke gold, a coral spark of celebration.
   One bold element (the adire hero), everything else quiet. */
:root {
  --bg: #161941;        /* adire indigo, the page */
  --surface: #1F2357;   /* cards, panels */
  --raised: #2A2F72;    /* inputs, bubbles, chips */
  --line: #3A408C;      /* borders */
  --dye: #4E58CF;       /* pattern lines */
  --gold: #F5B83D;      /* aso-oke gold: the one action colour */
  --gold-ink: #2A1E00;
  --gold-soft: rgba(245, 184, 61, 0.14);
  --coral: #FF7A63;     /* celebration accent, used sparingly */
  --ink: #F6EFE2;       /* text */
  --muted: #AEB2E3;
  --ok: #6FDDA8;
  --error: #FF9180;
  --warn: #F5B83D;
  --radius: 18px;
  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
  font-family: var(--font);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.5; font-size: 16px; display: flex; flex-direction: column; min-height: 100vh; -webkit-font-smoothing: antialiased; }
body.in-studio { height: 100vh; height: 100dvh; overflow: hidden; }
h1, h2, h3 { font-variation-settings: "opsz" 72; letter-spacing: -0.02em; }
h1 { font-size: 1.9rem; line-height: 1.08; font-weight: 800; margin: 8px 0 12px; }
h2 { font-size: 1.2rem; line-height: 1.2; font-weight: 750; margin: 0 0 10px; }
h2.section { margin-top: 32px; }
a { color: var(--gold); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); font-size: 0.94rem; margin: 0 0 10px; }
.error { color: var(--error); font-weight: 600; margin: 0; font-size: 0.94rem; }
.error:empty { display: none; }
::selection { background: var(--gold); color: var(--gold-ink); }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: rgba(22, 25, 65, 0.88); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(58, 64, 140, 0.6); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.18rem; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.brand img { border-radius: 9px; }
nav { display: flex; align-items: center; gap: 8px; }
.top-right { display: flex; align-items: center; gap: 8px; }
.top-cur { display: flex; align-items: center; gap: 6px; }
.top-cur-label { font-size: 0.78rem; font-weight: 700; color: var(--gold); }
.top-cur select { width: auto; min-width: 0; max-width: 46vw; min-height: 40px; padding: 6px 28px 6px 12px; border-radius: 999px; font-weight: 700; font-size: 0.9rem;
  background-color: rgba(245, 184, 61, 0.12); color: var(--ink); border: 2px solid var(--gold); cursor: pointer; }
.wallet-note { margin: 0 0 14px; padding: 10px 14px; border-left: 3px solid var(--gold); background: var(--surface); border-radius: 8px; color: var(--muted); }
.wallet-note strong { color: var(--ink); }
@media (max-width: 520px) { .top-cur-label { display: none; } body.signed-in .brand .appname { display: none; } }
.top-cur select:hover, .top-cur select:focus-visible { border-color: var(--gold); }
@media (max-width: 340px) { .brand .appname { display: none; } }
.credits { background: var(--gold); color: var(--gold-ink); border-radius: 999px; padding: 8px 14px; text-decoration: none; font-weight: 700; font-size: 0.92rem; min-height: 40px; display: inline-flex; align-items: center; gap: 5px; }
.iconbtn { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--ink); border: 1px solid var(--line); background: var(--surface); }
.iconbtn:hover { border-color: var(--gold); }

main { flex: 1; width: 100%; max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; min-height: 0; }
.page { padding: 18px 16px 90px; }

/* ---------- controls ---------- */
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.95rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], textarea, select {
  font: inherit; font-weight: 400; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); min-height: 48px; width: 100%; color: var(--ink); }
input::placeholder, textarea::placeholder { color: #8C90C8; }
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, .tool:focus-within { outline: 3px solid rgba(245, 184, 61, 0.55); outline-offset: 2px; }
.btn { font: inherit; font-weight: 700; border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; min-height: 46px; cursor: pointer; background: var(--raised); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:hover { border-color: #5A61B8; }
.btn.primary { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.btn.primary:hover { background: #FFC85A; }
.btn.big { min-height: 56px; font-size: 1.06rem; padding: 12px 22px; border-radius: 14px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--gold); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 44px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; margin: 8px 0; }
.check input { width: 22px; height: 22px; margin-top: 1px; flex: none; accent-color: var(--gold); }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button { font: inherit; font-weight: 700; border: 0; background: transparent; border-radius: 9px; padding: 8px 14px; min-height: 40px; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed=true] { background: var(--gold); color: var(--gold-ink); }
.currency-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 12px; font-weight: 600; color: var(--muted); }

/* ---------- welcome ---------- */
.welcome { padding-top: 10px; }
/* The adire pattern: resist-dye circles and stitch lines, drawn as a repeating tile. */
.hero {
  position: relative; overflow: hidden; border-radius: 28px; padding: 26px 22px 0;
  background-color: #1B1F52;
  background-image:
    radial-gradient(circle at 70% 20%, rgba(245, 184, 61, 0.16), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%234E58CF' stroke-width='1.5' opacity='.32'%3E%3Ccircle cx='30' cy='30' r='14'/%3E%3Ccircle cx='30' cy='30' r='8'/%3E%3Ccircle cx='30' cy='30' r='2' fill='%234E58CF'/%3E%3Ccircle cx='90' cy='90' r='14'/%3E%3Ccircle cx='90' cy='90' r='8'/%3E%3Ccircle cx='90' cy='90' r='2' fill='%234E58CF'/%3E%3Cpath d='M70 14l36 36M14 70l36 36' stroke-dasharray='2 6'/%3E%3C/g%3E%3C/svg%3E");
  display: grid; gap: 22px; align-items: end;
}
.hero h1 { font-size: clamp(2.3rem, 9vw, 3.6rem); line-height: 0.98; letter-spacing: -0.035em; margin: 0 0 14px; font-variation-settings: "opsz" 96; max-width: 12ch; }
.hero p { font-size: 1.06rem; color: #D4D6F2; margin: 0 0 18px; max-width: 34ch; }
.hero-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.phone { margin: 0 auto -2px; width: min(220px, 62vw); border-radius: 30px 30px 0 0; padding: 10px 10px 0; background: #0E1033; border: 2px solid #2F3480; border-bottom: 0; box-shadow: 0 -10px 40px rgba(245, 184, 61, 0.12); }
.phone video { display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 22px 22px 0 0; background: #23286A; }
.phone figcaption { position: absolute; left: -9999px; }
@media (min-width: 700px) {
  .hero { grid-template-columns: 1.25fr 1fr; padding: 40px 36px 0; }
  .hero-copy { padding-bottom: 40px; }
  .phone { width: 240px; margin-right: 0; }
}
.steps { list-style: none; counter-reset: step; padding: 0; margin: 28px 0 8px; display: grid; gap: 18px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 44px 1fr; gap: 2px 14px; align-items: baseline; }
.steps li::before { content: counter(step); grid-row: span 2; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--gold); color: var(--gold); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem; }
.steps b { font-size: 1.08rem; }
.steps span { color: var(--muted); }
@media (min-width: 700px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.promise { font-size: 1.05rem; margin: 26px 0 6px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.promise strong { color: var(--gold); }
.why { list-style: none; padding: 0; margin: 10px 0 26px; display: grid; gap: 10px 22px; }
.why li { display: flex; gap: 10px; align-items: baseline; font-size: 0.95rem; color: var(--muted); }
.why li b { color: var(--ink); font-weight: 650; }
.why .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); flex: none; transform: translateY(-2px); }
@media (min-width: 620px) { .why { grid-template-columns: 1fr 1fr; } }
#authForm { scroll-margin-top: 80px; }
#authForm h2 { font-size: 1.35rem; }

/* ---------- studio ---------- */
.studio { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.feed { flex: 1; overflow-y: auto; padding: 16px 14px 10px; display: flex; flex-direction: column; gap: 18px; }
.empty { text-align: left; padding: 22px 4px 6px; }
.empty h1 { font-size: clamp(1.8rem, 7vw, 2.5rem); line-height: 1.02; letter-spacing: -0.03em; max-width: 14ch; }
.empty p { color: var(--muted); max-width: 44ch; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-weight: 600; font-size: 0.93rem; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 15px; min-height: 42px; cursor: pointer; color: var(--ink); }
.chip:hover { border-color: var(--gold); }
.chip small { color: var(--muted); font-weight: 500; }

.turn { display: flex; flex-direction: column; gap: 8px; }
.bubble { align-self: flex-end; max-width: 88%; background: var(--raised); color: var(--ink); border-radius: 18px 18px 6px 18px; padding: 11px 15px; font-size: 0.97rem; white-space: pre-wrap; word-break: break-word; }
.bubble .meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; font-size: 0.76rem; color: var(--muted); white-space: normal; }
.bubble .meta i { font-style: normal; background: rgba(22, 25, 65, 0.55); border-radius: 6px; padding: 2px 7px; }
.result { align-self: flex-start; width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px 18px 18px 6px; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.result.wide { max-width: 100%; }
.result video { width: 100%; border-radius: 12px; background: #0E1033; display: block; max-height: 70vh; }
.status { display: flex; align-items: center; gap: 10px; font-weight: 600; padding: 8px 4px; }
.status.pending { color: var(--gold); }
.status.failed { color: var(--error); }
.spinner { width: 20px; height: 20px; border: 3px solid rgba(245, 184, 61, 0.25); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions .btn { flex: 1 1 auto; min-height: 42px; padding: 8px 12px; font-size: 0.92rem; }
.tip { font-size: 0.86rem; color: var(--muted); margin: 0; }

/* composer */
.composer { position: sticky; bottom: 0; background: linear-gradient(to top, var(--bg) 82%, rgba(22, 25, 65, 0)); padding: 10px 12px max(12px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; }
.prompt-box { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 8px; }
.prompt-box:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245, 184, 61, 0.15); }
.prompt-box textarea { border: 0; background: transparent; min-height: 52px; max-height: 180px; resize: none; padding: 6px 8px; outline: none; }
.tools { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.tool { font: inherit; font-size: 0.89rem; font-weight: 600; display: inline-flex; flex-direction: row; align-items: center; gap: 6px; border: 0; background: var(--raised); color: var(--ink); border-radius: 999px; padding: 6px 13px; min-height: 40px; cursor: pointer; }
.tool:hover { background: #343A86; }
.settings-toggle { margin-left: auto; background: var(--gold-soft); color: var(--gold); }
.go-row { display: flex; align-items: center; gap: 10px; }
.consent { flex: 1; flex-direction: row; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 500; color: var(--muted); }
.consent input { width: 20px; height: 20px; accent-color: var(--gold); flex: none; }
.go { min-height: 52px; padding: 10px 20px; border-radius: 14px; white-space: nowrap; }
.attach-row { display: flex; gap: 8px; flex-wrap: wrap; }
.attach { position: relative; display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; font-size: 0.88rem; font-weight: 600; max-width: 100%; }
.attach img, .attach video { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; background: #0E1033; }
.attach .name { display: flex; flex-direction: column; gap: 3px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 6px; }
.attach button { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.attach .badge { position: absolute; left: 4px; bottom: 4px; background: rgba(14, 16, 51, 0.8); color: #fff; font-size: 0.62rem; padding: 0 4px; border-radius: 4px; }
.attach.bad { border-color: var(--error); }
.prog { display: block; width: 72px; height: 4px; background: var(--raised); border-radius: 2px; overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; background: var(--gold); transition: width 0.2s; }
.ref-sub { font-size: 0.75rem; color: var(--muted); }
.ref-low { font-size: 0.72rem; color: var(--coral); font-weight: 700; }
.ref-err { font-size: 0.72rem; color: var(--error); white-space: normal; }
.ref-counts { width: 100%; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.78rem; color: var(--muted); padding: 2px 4px 0; }
.ref-counts .over { color: var(--error); font-weight: 700; }
.drop-overlay { position: absolute; inset: 8px; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(22, 25, 65, 0.85); border: 3px dashed var(--gold); border-radius: 20px; pointer-events: none; }
.drop-overlay > div { text-align: center; color: var(--ink); }
.drop-overlay svg { color: var(--gold); }
.drop-overlay p { margin: 8px 0 4px; font-weight: 750; font-size: 1.15rem; }
.drop-overlay small { color: var(--muted); }
.studio { position: relative; }

/* settings sheet */
.settings { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 16px; max-height: 52vh; overflow-y: auto; }
.setting h3 { font-size: 0.95rem; font-weight: 700; color: var(--ink); margin: 0 0 8px; letter-spacing: -0.01em; }
.models { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.model { text-align: left; font: inherit; border: 2px solid var(--line); background: var(--raised); border-radius: 14px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
.model[aria-pressed=true] { border-color: var(--gold); background: var(--gold-soft); }
.model strong { font-size: 1.02rem; }
.model .engine { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.model .blurb { font-size: 0.86rem; color: var(--muted); }
.model .from { font-size: 0.86rem; font-weight: 700; color: var(--gold); }
.opts { display: flex; gap: 6px; flex-wrap: wrap; }
.opt { font: inherit; border: 1px solid var(--line); background: var(--raised); border-radius: 12px; padding: 8px 12px; min-height: 44px; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; color: var(--ink); }
.opt b { font-size: 0.93rem; }
.opt small { font-size: 0.78rem; color: var(--muted); }
.opt[aria-pressed=true] { border-color: var(--gold); background: var(--gold-soft); }
.opt:disabled { opacity: 0.45; cursor: not-allowed; }
.note { font-size: 0.85rem; background: var(--gold-soft); border: 1px solid rgba(245, 184, 61, 0.4); border-radius: 10px; padding: 8px 10px; margin: 8px 0 0; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; }
.inline > * { flex: 1 1 160px; }

/* ---------- buy ---------- */
.cards { display: grid; gap: 12px; }
@media (min-width: 620px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.pack { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.pack .price { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.02em; }
.pack .badge { position: absolute; top: 14px; right: 14px; background: var(--coral); color: #2B0D06; font-weight: 700; font-size: 0.78rem; border-radius: 999px; padding: 3px 10px; }
.pack .makes { color: var(--muted); font-size: 0.92rem; }
.price-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.price-table table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.price-table th, .price-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.price-table th { color: var(--muted); font-weight: 600; }
.store-note { background: var(--gold-soft); border-radius: 12px; padding: 14px; }

/* ---------- account ---------- */
.logo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo-row img { height: 48px; max-width: 140px; object-fit: contain; background: repeating-conic-gradient(#3A408C 0% 25%, #2A2F72 0% 50%) 50% / 12px 12px; border-radius: 8px; padding: 4px; }
.row-form { display: flex; gap: 8px; align-items: flex-end; margin: 12px 0; }
.row-form .grow { flex: 1; }
.newkey { background: var(--gold-soft); border: 1px solid rgba(245, 184, 61, 0.4); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.newkey code { word-break: break-all; background: var(--bg); padding: 10px; border-radius: 8px; font-size: 0.9rem; }
.keys { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }
.keys li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.keys li span { color: var(--muted); font-size: 0.88rem; }

/* ---------- modals, toast, install ---------- */
.modal { position: fixed; inset: 0; background: rgba(8, 9, 30, 0.7); z-index: 50; display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
@media (min-width: 620px) { .modal { align-items: center; } }
.modal-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px; width: 100%; max-width: 440px; }
.cur-options { display: grid; gap: 10px; margin-top: 14px; }
.cur-options button { font: inherit; text-align: left; border: 2px solid var(--line); background: var(--raised); border-radius: 14px; padding: 14px 16px; cursor: pointer; display: flex; align-items: center; gap: 14px; min-height: 60px; color: var(--ink); }
.cur-options button:hover { border-color: var(--gold); }
.cur-options .sym { font-size: 1.5rem; font-weight: 800; width: 36px; text-align: center; color: var(--gold); }
.cur-options small { color: var(--muted); display: block; }
#toast { position: fixed; left: 50%; bottom: 130px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 650; max-width: 90vw; z-index: 60; }
.installbar { background: var(--surface); border: 1px solid var(--line); color: var(--ink); border-radius: 14px; padding: 8px 12px; display: flex; align-items: center; gap: 10px; margin: 10px 12px 0; flex: none; }
.installbar span { flex: 1; font-weight: 600; font-size: 0.92rem; }

/* AI tools sheet */
.tools-card { max-height: 88vh; overflow-y: auto; }
.tools-head { display: flex; justify-content: space-between; align-items: center; }
.tools-head h2 { margin: 0; }
.icon-btn { border: 1px solid var(--line); background: var(--raised); color: var(--ink); border-radius: 50%; width: 40px; height: 40px; font-size: 1rem; cursor: pointer; }
.tool-tabs { margin: 12px 0 4px; display: flex; flex-wrap: nowrap; width: 100%; }
.tool-tabs button { flex: 1; padding: 8px 4px; font-size: 0.86rem; white-space: nowrap; }
#toolFields { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
#toolFields textarea { min-height: 84px; }
.btn.wide { width: 100%; justify-content: center; }
.tool-badge { display: inline-block; background: var(--gold-soft); color: var(--gold); border-radius: 8px; padding: 2px 8px; font-size: 0.8rem; font-weight: 700; margin-bottom: 4px; }
.hint { font-size: 0.85rem; color: var(--muted); font-weight: 400; }

/* ---------- ad spaces ---------- */
.ad { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px dashed #4A50A0; border-radius: 16px; padding: 10px 12px; margin: 14px 0; }
.ad:hover { border-color: var(--gold); }
.ad img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; flex: none; }
.ad-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ad-body small { color: var(--muted); font-size: 0.72rem; }
.ad-body b { font-size: 1rem; }
.ad-body span { color: var(--muted); font-size: 0.9rem; }
.ad-body em { font-style: normal; color: var(--gold); font-weight: 700; font-size: 0.9rem; }
.result .ad { margin: 0; }
.ad-editors { display: grid; gap: 12px; }
@media (min-width: 900px) { .ad-editors { grid-template-columns: repeat(3, 1fr); } }
.ad-editor-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ad-editor-head .check { margin: 0; }
.invite-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.invite input[readonly] { font-size: 0.92rem; }
.invited { margin: 0; background: var(--gold-soft); color: var(--gold); border-radius: 10px; padding: 8px 12px; font-weight: 650; }
.cur-select { width: auto; min-width: 210px; min-height: 42px; padding: 8px 12px; }
.cur-options { grid-template-columns: 1fr 1fr; }
.cur-options button { min-height: 56px; padding: 10px 12px; gap: 10px; }
.cur-options .sym { font-size: 1.05rem; width: auto; min-width: 34px; }

/* ---------- owner dashboard ---------- */
.wide-page { max-width: 1100px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 16px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.stat span { font-size: 0.82rem; color: var(--muted); }
.stat strong { font-size: 1.45rem; letter-spacing: -0.02em; }
.stat small { color: var(--muted); }
.grant { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; align-items: center; }
.grant input { flex: 1 1 160px; min-width: 0; }
.grant .btn { flex: 0 0 auto; }
.grant .error { width: 100%; margin: 0; color: var(--ink); }
.admin-search { width: 100%; max-width: 320px; margin-bottom: 8px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); margin-bottom: 8px; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
.table-wrap th, .table-wrap td { text-align: left; padding: 9px 11px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap th { background: var(--raised); font-weight: 700; white-space: nowrap; }
.st { font-weight: 700; font-size: 0.8rem; }
.st-done, .st-paid { color: var(--ok); }
.st-failed { color: var(--error); }
.st-pending, .st-generating, .st-queued, .st-finishing { color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- footer, contact ---------- */
.site-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; padding: 28px 16px max(28px, env(safe-area-inset-bottom)); margin-top: auto; border-top: 1px solid var(--line); }
.site-foot a { color: var(--muted); text-decoration: none; font-weight: 600; min-height: 40px; display: inline-flex; align-items: center; }
.site-foot a:hover { color: var(--gold); }
.site-foot .only-in { display: none; }
body.signed-in .site-foot .only-in { display: inline-flex; }
body.in-studio .site-foot { display: none; }
.contact-direct { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; line-height: 1.9; }
.contact-direct a { color: var(--gold); }

/* ---------- phones: a little smaller, and a create box that gets out of the way ---------- */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .composer { padding: 6px 8px max(8px, env(safe-area-inset-bottom)); gap: 6px; }
  .prompt-box { border-radius: 16px; padding: 6px; }
  .prompt-box textarea { min-height: 40px; padding: 4px 6px; }
  .tool { min-height: 36px; padding: 4px 10px; font-size: 0.84rem; }
  .consent { font-size: 0.74rem; gap: 6px; }
  .go { min-height: 44px; padding: 8px 14px; }
  .composer.compact .attach-row, .composer.compact .settings, .composer.compact .tools,
  .composer.compact .consent { display: none; }
  .composer.compact .prompt-box textarea { min-height: 0; height: 40px; }
  .composer.compact .go-row { position: absolute; right: 14px; bottom: max(12px, env(safe-area-inset-bottom)); }
  .composer.compact .prompt-box { padding-right: 120px; }
}
