:root {
  color-scheme: dark;
  --bg: #070707;
  --elev: #121212;
  --card: #1a1a1a;
  --modal: #1c1c1e;
  --border: rgba(255,255,255,.08);
  --text: #f5f5f5;
  --muted: #9a9aa0;
  --gold: #ffd34d;
  --orange: #ff7a18;
  --accent-text: #14110b;
  --header-bg: rgba(7,7,7,.92);
  --surface: #1a1a1a;
  --surface-2: #151515;
  --surface-3: #111;
  --surface-4: #222;
  --surface-5: #141414;
  --hover: #1a1a1a;
  --chip-on: #1c1a12;
  --input-bg: #121212;
  --tag-bg: #22242a;
  --tag-text: #c8cad0;
  --warn-bg: #191919;
  --warn-text: #cfcfcf;
  --toast-bg: #222;
  --scrim: rgba(0,0,0,.72);
  --promo-bg: linear-gradient(135deg, #2a1f0a, #161616);
  --promo-border: rgba(255,211,77,.15);
  --dock-fade: linear-gradient(transparent, #000 40%);
  --icon-on: #221c10;
  --login-card: #181818;
  --login-muted: #b0b0b4;
  --login-link: #d8d8dc;
  --check-bg: #2a2a2a;
  --cookie-bg: #181818;
  --cookie-muted: #a0a0a0;
  --ava-bg: #333;
  --plus: #3dd68c;
  --minus: #ff8a8a;
  --dock-btn-h: 34px;
  --dock-pad-y: 36px;
  --dock: calc(var(--dock-btn-h) + var(--dock-pad-y));
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eceef2;
  --elev: #ffffff;
  --card: #ffffff;
  --modal: #ffffff;
  --border: rgba(20,22,30,.12);
  --text: #16181f;
  --muted: #646874;
  --gold: #c99700;
  --orange: #e56a00;
  --accent-text: #14110b;
  --header-bg: rgba(236,238,242,.92);
  --surface: #ffffff;
  --surface-2: #f3f4f7;
  --surface-3: #e8eaef;
  --surface-4: #e2e4ea;
  --surface-5: #f7f8fa;
  --hover: #e8eaef;
  --chip-on: #fff6d9;
  --input-bg: #f7f8fa;
  --tag-bg: #eef0f4;
  --tag-text: #3d414c;
  --warn-bg: #fff4e5;
  --warn-text: #5a4630;
  --toast-bg: #2a2d36;
  --scrim: rgba(20,22,30,.48);
  --promo-bg: linear-gradient(135deg, #fff4d6, #f3f4f7);
  --promo-border: rgba(201,151,0,.28);
  --dock-fade: linear-gradient(transparent, #eceef2 45%);
  --icon-on: #fff6d9;
  --login-card: #ffffff;
  --login-muted: #646874;
  --login-link: #2a2d36;
  --check-bg: #e8eaef;
  --cookie-bg: #ffffff;
  --cookie-muted: #646874;
  --ava-bg: #d8dae0;
  --plus: #1f9d63;
  --minus: #d94a4a;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; max-width: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: calc(var(--dock) + env(safe-area-inset-bottom));
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.muted { color: var(--muted); }

.top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  max-width: 100%;
  overflow: visible;
}
.logo { font-weight: 800; letter-spacing: .02em; white-space: nowrap; flex-shrink: 1; min-width: 0; font-size: 14px; }
.logo-mark { color: var(--gold); flex-shrink: 0; }
.logo-name {
  color: var(--text);
  display: inline-block;
  max-width: 9em;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}
.menu {
  display: flex; gap: 4px; flex: 1; justify-content: center; flex-wrap: wrap;
}
.menu a {
  list-style: none;
  padding: 8px 10px; border-radius: 10px;
  color: var(--muted); font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.menu a.is-on, .menu a:hover { color: var(--text); background: var(--hover); }

.suno-style-block {
  padding: 14px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-5);
}
.suno-core-settings {
  margin: 8px 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-5);
}
.suno-core-settings > .fg:last-child { margin-bottom: 0; }
.suno-extras-wrap {
  margin: 8px 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-5);
}
.suno-extras-wrap > summary {
  padding: 12px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}
.suno-extras-wrap > summary::-webkit-details-marker { display: none; }
.suno-extras-body { padding: 0 14px 14px; }
.suno-extras-body > .fg:first-child { margin-top: 0; }
.suno-advanced-inner { margin-top: 4px; }
.suno-style-extras-categories {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.suno-style-extras-categories .suno-style-section:last-child { margin-bottom: 0; }
.suno-style-section-count[hidden] { display: none !important; }
.suno-advanced-details {
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.suno-advanced-details > summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
  padding: 6px 0;
}
.suno-advanced-details > summary::-webkit-details-marker { display: none; }

.suno-create-form[data-suno-mode="simple"] .suno-prompt-field textarea {
  min-height: 148px;
  font-size: 15px;
  line-height: 1.45;
}
.suno-create-form[data-suno-mode="author"] .suno-prompt-field textarea {
  min-height: 96px;
}
.suno-simple-hint {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}
.suno-create-form[data-suno-mode="simple"] .suno-extras-wrap {
  display: none;
}
.suno-create-form[data-suno-mode="author"] .suno-style-block {
  margin-top: 2px;
}

.model-catalog { display: grid; gap: 20px; margin-bottom: 22px; }
.model-catalog-section { display: grid; gap: 10px; }
.model-catalog-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .02em;
}
.model-catalog-grid {
  display: grid;
  grid-template-columns: repeat(var(--cat-cols, 1), minmax(0, 1fr));
  gap: 8px;
}
.model-catalog-card {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-5);
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.model-catalog-card:hover {
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.1);
  transform: translateY(-1px);
}
.model-catalog-name { font-size: 13px; font-weight: 700; line-height: 1.3; }
.model-catalog-hint {
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.model-quick-title { margin-top: 4px; }
@media (max-width: 640px) {
  .model-catalog-grid { grid-template-columns: 1fr; }
  .suno-style-sheet-h .x {
    width: 72px;
    height: 72px;
    font-size: 40px;
  }
}
.top-right { display: flex; align-items: center; gap: 8px; margin-left: auto; min-width: 0; flex-shrink: 1; }
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  min-width: 72px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}
.lang-switch a {
  color: var(--muted);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 999px;
}
.lang-switch a.is-on {
  color: #111;
  background: #ffd34d;
}
html[data-theme="light"] .lang-switch {
  border-color: rgba(0,0,0,.12);
}
.buy {
  border: 1px solid var(--border); background: transparent;
  border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 700;
}
.theme-toggle, .help-ico {
  position: relative; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-4); border: 1px solid var(--border);
  text-decoration: none; font-size: 14px; line-height: 1;
  color: var(--text); padding: 0;
}
.theme-toggle:hover, .help-ico:hover {
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.1);
}
.theme-toggle:focus-visible, .help-ico:focus-visible {
  outline: none;
  border-color: rgba(168, 85, 247, 0.55);
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.16), 0 0 10px rgba(168, 85, 247, 0.1);
}
.top-right .bal { flex-shrink: 0; white-space: nowrap; }
.theme-toggle .ico-sun { display: none; }
.theme-toggle .ico-moon { display: inline; }
html[data-theme="light"] .theme-toggle .ico-sun { display: inline; }
html[data-theme="light"] .theme-toggle .ico-moon { display: none; }
.nav-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: #e85d5d; color: #fff;
  font-size: 10px; font-weight: 800; line-height: 16px; text-align: center;
}
.bal {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 10px; font-weight: 700; font-size: 13px;
}
.bal-topup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.coin { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #ffe08a, #e09100); }
.ava { width: 32px; height: 32px; border-radius: 50%; background: var(--ava-bg); display: grid; place-items: center; font-size: 14px; overflow: hidden; }

.wrap { width: min(1080px, 100%); margin: 0 auto; padding: 16px 12px 28px; box-sizing: border-box; }

.promos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }
.promo {
  border-radius: 16px; padding: 18px 16px; min-height: 72px;
  background: var(--promo-bg);
  border: 1px solid var(--promo-border);
  font-weight: 700;
}
.promo small { display: block; font-weight: 500; color: var(--muted); margin-top: 4px; }

.h-row { display: flex; align-items: baseline; justify-content: space-between; margin: 8px 0 12px; }
.h-row h2 { margin: 0; font-size: 20px; }
.h-row p, .h-row a { margin: 0; color: var(--muted); font-size: 13px; }

.icons { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 12px; }
.icon {
  flex: 0 0 auto; width: 76px; text-align: center; color: var(--muted); font-size: 11px; font-weight: 600;
}
.icon i {
  display: grid; place-items: center;
  width: 56px; height: 56px; margin: 0 auto 8px;
  border-radius: 18px; background: var(--surface-5); border: 1px solid var(--border);
  font-style: normal; font-size: 22px; color: var(--text);
}
.icon.is-on i, .icon:hover i {
  border-color: rgba(168, 85, 247, 0.55);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.12);
  background: var(--icon-on);
}
.icon.is-on { color: var(--text); }

.classic { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.c-card {
  flex: 0 0 200px; height: 280px; border-radius: 16px; overflow: hidden;
  position: relative; background: var(--surface-4);
}
.c-card img, .c-card .ph { width: 100%; height: 100%; object-fit: cover; }
.c-card .ph { display: grid; place-items: center; color: var(--muted); }
.c-card .tag {
  position: absolute; top: 10px; right: 10px;
  font-size: 10px; font-weight: 700; background: rgba(0,0,0,.7); color: #fff; padding: 4px 7px; border-radius: 999px;
}
.c-card .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 10px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,.8));
  color: #fff;
  font-size: 12px; font-weight: 800; text-transform: uppercase;
}

.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(var(--dock-pad-y) / 2) 10px calc(var(--dock-pad-y) / 2 + env(safe-area-inset-bottom));
  max-width: 100%;
  box-sizing: border-box;
  pointer-events: none;
  isolation: isolate;
}
.dock::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  height: auto;
  background: var(--dock-fade);
  pointer-events: none;
  z-index: 0;
}
.dock-bar {
  pointer-events: auto;
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  width: min(100%, 560px);
  padding: 6px;
  border-radius: 18px;
  /* Opaque plate: page content (e.g. textarea focus ring) must not bleed through nav */
  background: var(--bg);
  border: 1px solid var(--border);
  box-sizing: border-box;
  isolation: isolate;
}
html[data-theme="light"] .dock-bar {
  background: var(--bg);
  border: 1px solid var(--border);
}
.dock a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1 1 0;
  min-width: 0;
  height: var(--dock-btn-h);
  padding: 0 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.15;
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--border);
}
.dock .nav-badge { top: 2px; right: 4px; }
.dock .go {
  background: linear-gradient(90deg, var(--gold), var(--orange));
  color: var(--accent-text); border: none; padding-inline: 28px;
}
.dock-lbl-short { display: none; }

.job-audio-id {
  font-size: 12px;
  margin-top: 8px;
  word-break: break-all;
  line-height: 1.4;
}
.job-audio-id code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

/* Compact layout: phones + Telegram Mini App */
@media (max-width: 860px) {
  :root {
    --dock-btn-h: 32px;
    --dock-pad-y: 34px;
  }
  .top {
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: max(8px, env(safe-area-inset-top)) 10px 10px;
  }
  .logo {
    flex: 1 1 100%;
    width: 100%;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .logo-name {
    max-width: min(14em, 72vw);
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .top-right {
    flex: 1 1 100%;
    margin-left: 0;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
  }
  .help-ico { display: none; }
  .theme-toggle {
    width: 34px;
    height: 34px;
    font-size: 14px;
    flex-shrink: 0;
  }
  .lang-switch { font-size: 10px; padding: 1px; flex-shrink: 0; min-width: 72px; }
  .lang-switch a { padding: 3px 6px; }
  .buy { padding: 6px 10px; font-size: 11px; white-space: nowrap; }
  .bal { padding: 6px 10px; font-size: 12px; gap: 4px; white-space: nowrap; max-width: 38vw; overflow: hidden; text-overflow: ellipsis; }
  .ava { width: 30px; height: 30px; font-size: 12px; flex-shrink: 0; }

  .dock {
    padding: 0 8px calc(10px + env(safe-area-inset-bottom));
  }
  .dock-bar {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    width: 100%;
    max-width: 100%;
    padding: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    isolation: isolate;
  }
  .dock a {
    justify-content: center;
    height: var(--dock-btn-h);
    padding: 0 6px;
    font-size: 11px;
    line-height: 1.1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
  }
  .dock .go { padding-inline: 10px; }

  .cookie {
    left: 10px;
    width: calc(100% - 20px);
    max-width: none;
    padding: 14px 12px;
    bottom: calc(var(--dock) + 8px);
  }
  .cookie h2 { font-size: 14px; }
  .cookie p { font-size: 12px; margin-bottom: 10px; }
  .cookie-actions { gap: 6px; }
  .cookie-accept,
  .cookie-decline { padding: 9px 8px; font-size: 12px; }

  .wrap { padding: 12px 10px 24px; }

  .composer {
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 10px 10px 12px;
    max-width: 100%;
  }
  .composer input {
    flex: 1 1 0;
    min-width: 0;
    order: 1;
  }
  .composer .send { order: 2; flex-shrink: 0; }
  .composer .cost {
    order: 3;
    flex: 1 1 100%;
    justify-content: flex-end;
    font-size: 11px;
    line-height: 1.25;
    white-space: normal;
    text-align: right;
  }

  .genbar {
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
  }
  .qty { flex: 0 0 auto; }
  .gen {
    flex: 1 1 100%;
    min-width: 0;
    font-size: 12px;
    line-height: 1.25;
    padding: 12px 10px;
    white-space: normal;
    text-align: center;
  }

  .sheet {
    border-radius: 16px;
    padding: 12px 12px 88px;
  }
  .model-row { gap: 8px; }
  .model-row > div { min-width: 0; }
  .model-row small { overflow-wrap: anywhere; }
}

html.is-tg {
  --dock-btn-h: 32px;
  --dock-pad-y: 34px;
}
html.is-tg .top {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: max(8px, env(safe-area-inset-top)) 10px 10px;
}
html.is-tg .logo {
  flex: 1 1 100%;
  width: 100%;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html.is-tg .logo-name {
  max-width: min(14em, 72vw);
  overflow: hidden;
  text-overflow: ellipsis;
}
html.is-tg .menu { display: none; }
html.is-tg .wrap { padding: 12px 10px 24px; }
html.is-tg .composer {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 10px 12px;
  max-width: 100%;
}
html.is-tg .composer input {
  flex: 1 1 0;
  min-width: 0;
  order: 1;
}
html.is-tg .composer .send { order: 2; flex-shrink: 0; }
html.is-tg .composer .cost {
  order: 3;
  flex: 1 1 100%;
  justify-content: flex-end;
  font-size: 11px;
  line-height: 1.25;
  white-space: normal;
  text-align: right;
}
html.is-tg .genbar {
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
}
html.is-tg .gen {
  flex: 1 1 100%;
  min-width: 0;
  font-size: 12px;
  line-height: 1.25;
  padding: 12px 10px;
  white-space: normal;
  text-align: center;
}
html.is-tg .sheet {
  border-radius: 16px;
  padding: 12px 12px 88px;
}
html.is-tg .top-right {
  flex: 1 1 100%;
  margin-left: 0;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}
html.is-tg .help-ico { display: none; }
html.is-tg .lang-switch { font-size: 10px; padding: 1px; }
html.is-tg .lang-switch a { padding: 3px 6px; }
html.is-tg .buy { padding: 6px 10px; font-size: 11px; white-space: nowrap; }
html.is-tg .bal { padding: 6px 10px; font-size: 12px; gap: 4px; white-space: nowrap; max-width: 38vw; overflow: hidden; text-overflow: ellipsis; }
html.is-tg .ava { width: 30px; height: 30px; font-size: 12px; flex-shrink: 0; }
html.is-tg .dock {
  padding: 0 8px calc(10px + env(safe-area-inset-bottom));
}
html.is-tg .dock-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  padding: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  isolation: isolate;
}
html.is-tg .dock a {
  justify-content: center;
  height: var(--dock-btn-h);
  padding: 0 6px;
  font-size: 11px;
  line-height: 1.1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
html.is-tg .dock .go { padding-inline: 10px; }
html.is-tg .cookie {
  left: 10px;
  width: calc(100% - 20px);
  max-width: none;
  padding: 14px 12px;
  bottom: calc(var(--dock) + 8px);
}
html.is-tg .cookie h2 { font-size: 14px; }
html.is-tg .cookie p { font-size: 12px; margin-bottom: 10px; }
html.is-tg .cookie-actions { gap: 6px; }
html.is-tg .cookie-accept,
html.is-tg .cookie-decline { padding: 9px 8px; font-size: 12px; }

.sheet {
  background: var(--modal);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px 16px 88px;
  position: relative;
}
.sheet-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet-h h1 { margin: 0; font-size: 20px; }
.x {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-3);
  font-size: 20px;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}
.ctabs { display: flex; gap: 12px; overflow-x: auto; padding: 4px 0 16px; }
.ctab { flex: 0 0 auto; text-align: center; width: 72px; font-size: 11px; color: var(--muted); }
.ctab i {
  display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 6px;
  border-radius: 50%; background: var(--surface-5); border: 1px solid var(--border); font-style: normal; font-size: 20px;
}
.ctab.is-on { color: var(--text); }
.ctab.is-on i { box-shadow: 0 0 0 3px rgba(255,211,77,.2); border-color: var(--gold); background: var(--icon-on); }

.fg { margin-bottom: 14px; }
.lbl { font-size: 13px; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.lbl-txt { line-height: 1.2; }
.lbl i { color: #ff5a5a; font-style: normal; }
.field-max {
  font-size: 12px;
  color: #8eb8ff;
  font-weight: 500;
  white-space: nowrap;
}
.field-char {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  margin-top: 6px;
}
.fg-limited > .lbl + .field-char { margin-top: 0; margin-bottom: 8px; }
.field-char.is-warn { color: #ffb347; }
.field-char.is-full { color: #ff5a5a; font-weight: 600; }
.gemini-tts-price-tier {
  margin-top: 6px;
  font-size: 0.92em;
  opacity: 0.85;
}
.help {
  width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border);
  display: inline-grid; place-items: center; font-size: 11px; color: var(--muted);
  cursor: pointer;
  padding: 0;
  background-color: var(--surface-3);
  font: inherit;
  line-height: 1;
  flex: 0 0 18px;
}
.help-wrap {
  position: relative;
  display: inline-flex;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  vertical-align: middle;
}
.field-help-tip {
  position: absolute; z-index: 30; left: 50%; bottom: calc(100% + 8px);
  transform: translateX(-50%);
  min-width: 180px; max-width: min(280px, 70vw);
  padding: 10px 12px; border-radius: 10px;
  background: var(--modal); border: 1px solid var(--border);
  color: var(--text); font-size: 12px; font-weight: 500; line-height: 1.45;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
  white-space: normal;
}
.field-help-tip::after {
  content: ""; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--border);
}
html[data-ui-theme="magicbox"] button.help:hover,
html[data-ui-theme="magicbox"] button.help:focus-visible {
  border-color: rgba(0, 212, 255, .6);
  color: #fff;
  box-shadow: 0 0 12px rgba(160, 32, 240, .35);
}
button.help:hover,
button.help:focus-visible {
  color: var(--text);
  border-color: rgba(168, 85, 247, 0.4);
}
.model-row, select, textarea, input[type="text"], .pill, .upload-sq {
  width: 100%; background-color: var(--surface-3); border: 1px solid var(--border); border-radius: 12px;
}
.model-row {
  display: flex; align-items: center; justify-content: space-between; text-align: left; padding: 12px;
  width: 100%; cursor: pointer;
}
.model-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.model-row > span:first-child { min-width: 0; }
.model-picker-single .model-row { cursor: default; }

.model-sheet {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.model-sheet[hidden] { display: none !important; }
.model-sheet-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,.55);
}
.model-sheet-panel {
  position: relative; z-index: 1;
  width: min(520px, 100%); max-height: min(70vh, 520px);
  background: var(--modal); border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  overflow: auto;
}
.model-sheet-h {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; padding: 0 4px;
}
.model-sheet-search-wrap { display: block; margin: 0 4px 12px; }
.model-sheet-search {
  width: 100%; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-3); color: inherit;
  font-size: 14px;
}
.model-sheet-search::placeholder { color: var(--muted); }
.model-sheet-list { display: grid; gap: 12px; }
.model-group-h {
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  color: var(--muted); padding: 0 4px 6px;
}
.model-group-list { display: grid; gap: 8px; }
.model-group[hidden] { display: none !important; }
.model-opt[hidden] { display: none !important; }
.model-sheet-empty {
  margin: 8px 4px 0; text-align: center; color: var(--muted); font-size: 13px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.model-row-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.model-provider-kicker {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--gold, #ffd34d);
  margin-bottom: 4px;
}
.model-picker-audio .model-provider-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-3);
}
.model-provider-card-icon { font-size: 20px; line-height: 1.2; flex: 0 0 auto; }
.model-provider-card-body { min-width: 0; }
.model-provider-card-label { display: block; font-size: 14px; line-height: 1.25; }
.model-provider-card-tagline {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.model-badges { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.model-badges-inline { margin-left: 2px; }
.model-badge {
  display: inline-block; padding: 2px 6px; border-radius: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: .02em;
  background: rgba(255,211,77,.15); color: var(--gold); border: 1px solid rgba(255,211,77,.25);
}
.model-opt-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.model-opt-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.model-opt-radio {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border);
  box-sizing: border-box;
}
.model-opt.is-on .model-opt-radio {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: none;
}
.model-opt-lock { font-size: 16px; line-height: 1; opacity: .85; }
.model-opt-lock-note { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.model-opt.is-locked { cursor: not-allowed; opacity: .82; }
.model-opt.is-locked:hover { border-color: var(--border); }
.model-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-3); text-decoration: none; color: inherit;
}
.model-opt.is-on { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(255,211,77,.25); }
.model-opt-body { min-width: 0; }
.model-opt-body strong { display: block; font-size: 14px; }
.model-opt-title strong { display: inline; }
.model-opt-body small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.model-opt-meta { flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--gold); white-space: nowrap; }

.chev { color: var(--muted); font-size: 22px; flex-shrink: 0; }
textarea { min-height: 92px; padding: 12px; resize: vertical; }
input[type="text"] { padding: 12px; }
select {
  padding: 12px 36px 12px 12px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239a9aa0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}
html[data-theme="light"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23646874' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}
.fg-voice .voice-row { display: flex; gap: 8px; align-items: stretch; }
.fg-voice .voice-row select { flex: 1; min-width: 0; }
.voice-preview-btn {
  flex-shrink: 0; width: 44px; padding: 0;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-3); color: var(--text);
  font-size: 14px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.voice-preview-btn:hover {
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: var(--glow-hover, 0 0 12px rgba(168, 85, 247, .25));
}
.voice-preview-btn.is-playing {
  border-color: var(--neon-blue, var(--gold));
  color: var(--neon-blue, var(--gold));
  box-shadow: var(--glow-hover, 0 0 12px rgba(160, 32, 240, .35));
}
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  width: auto; padding: 8px 12px; font-size: 13px; font-weight: 700;
  border-radius: 999px; cursor: pointer;
}
.pill.is-on { border-color: var(--gold); color: var(--gold); }
.seg { display: flex; background: var(--surface-3); border-radius: 999px; padding: 4px; width: fit-content; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; color: var(--muted); }
.seg .is-on { background: var(--text); color: var(--bg); font-weight: 700; }
.upload-line { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; width: 100%; }
.upload-line p { margin: 0; color: var(--muted); font-size: 13px; flex: 1 1 160px; min-width: 0; }
.upload-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.upload-thumbs[hidden] { display: none !important; }
.upload-thumb { position: relative; width: 52px; height: 52px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.upload-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-thumb-rm {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; padding: 0;
  border: none; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff;
  font-size: 12px; line-height: 18px; cursor: pointer;
}
.upload-sq {
  width: 72px; height: 72px; display: grid; place-items: center; flex: 0 0 auto;
}
.upload-sq span { font-size: 10px; color: var(--muted); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair .upload-sq { width: 100%; height: 96px; }
.warn {
  background: var(--warn-bg); border-radius: 12px; padding: 12px; color: var(--warn-text); font-size: 13px; margin-bottom: 14px;
}
.gallery-frame {
  height: 220px; border-radius: 16px; background: var(--surface-4); display: grid; place-items: end start;
  padding: 12px; font-size: 12px; font-weight: 700;
}
.dots { display: flex; justify-content: center; gap: 6px; margin: 8px 0 14px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); display: block; opacity: .45; }
.dots .on { background: var(--text); opacity: 1; }

.genbar {
  position: sticky; bottom: calc(var(--dock) + 8px);
  display: flex; gap: 10px; align-items: center;
  padding-top: 12px;
}
.qty {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-3); border: 1px solid var(--border); border-radius: 999px; padding: 8px 10px;
}
.qty button { border: 0; background: transparent; width: 28px; font-size: 18px; }
.gen {
  flex: 1; border: 0; border-radius: 14px; padding: 14px;
  font-weight: 800; font-size: 15px;
  background: linear-gradient(90deg, var(--gold), var(--orange));
  color: var(--accent-text);
}

.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.t-card {
  aspect-ratio: 3/4; border-radius: 14px; background: var(--surface-5); position: relative; overflow: hidden;
  border: 1px solid var(--border);
}
.t-card span {
  position: absolute; left: 8px; right: 8px; bottom: 10px;
  font-size: 11px; font-weight: 800; text-transform: uppercase;
}
.t-card .tag { top: 8px; right: 8px; bottom: auto; font-size: 10px; color: var(--gold); }

.chat { display: grid; grid-template-columns: 240px 1fr; gap: 16px; min-height: 70vh; }
.side { background: var(--surface-3); border: 1px solid var(--border); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; }
.side h3 { margin: 16px 0 8px; font-size: 11px; color: var(--muted); letter-spacing: .08em; }
.new {
  width: 100%; border: 0; border-radius: 12px; padding: 12px; font-weight: 700; background: var(--text); color: var(--bg);
}
.hello { text-align: center; padding: 40px 12px 20px; }
.hello h1 { margin: 12px 0 18px; font-size: 22px; }
.acts { display: grid; gap: 8px; max-width: 420px; margin: 0 auto; }
.act {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-radius: 14px; background: var(--elev); border: 1px solid var(--border);
}
.composer {
  margin-top: 24px; display: flex; gap: 8px; align-items: center;
  background: var(--elev); border: 1px solid var(--border); border-radius: 18px; padding: 8px 8px 8px 14px;
}
.composer input { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; outline: none; padding: 10px 0; }
.send {
  width: 42px; height: 42px; border-radius: 50%; border: 0;
  background: linear-gradient(90deg, var(--gold), var(--orange)); color: var(--accent-text); font-size: 18px;
}
.cost { color: var(--muted); font-size: 12px; white-space: nowrap; display: flex; align-items: center; gap: 6px; }

.beta-notice {
  margin: 0;
  padding: 10px 16px;
  text-align: center;
  font-size: 13px;
  line-height: 1.35;
  background: rgba(79, 134, 198, 0.18);
  border-bottom: 1px solid rgba(79, 134, 198, 0.35);
  color: var(--text, #e7eef8);
}
html[data-theme="light"] .beta-notice {
  background: rgba(79, 134, 198, 0.12);
  color: #1a2332;
}

.toast {
  position: fixed; left: 50%; bottom: calc(var(--dock) + 16px); transform: translateX(-50%);
  background: var(--toast-bg); color: #f5f5f5; border: 1px solid var(--border); padding: 10px 14px; border-radius: 12px;
  font-size: 13px; z-index: 80; display: none;
}

.job-list { display: flex; flex-direction: column; gap: 10px; text-align: left; max-width: 640px; margin: 0 auto; }
.job-card {
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px;
}
.job-main { min-width: 0; flex: 1; }
.job-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.job-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.job-tag {
  display: inline-block; max-width: 100%;
  padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--tag-bg); color: var(--tag-text); border: 1px solid var(--border);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.job-tag-price { background: rgba(255, 211, 77, .12); color: var(--gold); border-color: rgba(255, 211, 77, .25); }
.job-prompt { color: var(--muted); font-size: 13px; margin-top: 8px; word-break: break-word; line-height: 1.4; }
.job-prompt-empty { opacity: .55; font-style: italic; }
.hist-filters {
  display: flex; flex-wrap: wrap; gap: 8px;
  max-width: 640px; margin: 0 auto 12px; text-align: left;
}
.hist-filters-cmd { margin-top: -4px; }
.hist-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}
.hist-chip span {
  font-size: 11px; opacity: .85; background: var(--surface-4); padding: 1px 6px; border-radius: 999px;
}
.hist-chip.is-on, .hist-chip:hover {
  color: var(--text); border-color: rgba(168, 85, 247, 0.4); background: var(--chip-on); text-decoration: none;
}
.hist-chip.is-on span { background: rgba(168, 85, 247, 0.2); color: var(--neon-purple, #a855f7); }
.hist-search {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  max-width: 640px; margin: 0 auto 14px; text-align: left;
}
.hist-search input[type="search"] {
  flex: 1; min-width: 160px;
  background: var(--input-bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; color: var(--text);
}
.hist-search button {
  border: 0; border-radius: 12px; padding: 10px 14px; font-weight: 700;
  background: var(--gold); color: var(--accent-text); cursor: pointer;
}
.hist-clear { color: var(--muted); font-size: 13px; font-weight: 600; }
.flash {
  max-width: 640px; margin: 0 auto 14px; text-align: left;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(61,214,140,.12); border: 1px solid rgba(61,214,140,.35);
}
.flash.err { background: rgba(255,107,107,.12); border-color: rgba(255,107,107,.35); }
.support-form {
  display: grid; gap: 12px; max-width: 640px; margin: 0 auto; text-align: left;
}
.support-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.support-form select, .support-form textarea {
  background: var(--input-bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; color: var(--text); font: inherit;
}
.support-form .gen { width: 100%; border: 0; }
.job-open {
  flex-shrink: 0; background: var(--gold); color: var(--accent-text);
  font-weight: 700; font-size: 13px; padding: 8px 12px; border-radius: 999px;
  text-decoration: none; text-align: center;
}
.job-actions {
  flex-shrink: 0; display: flex; flex-direction: column; gap: 6px; align-items: stretch;
}
.job-reuse {
  flex-shrink: 0; background: var(--tag-bg); color: var(--text);
  border: 1px solid var(--border);
  font-weight: 700; font-size: 13px; padding: 8px 12px; border-radius: 999px;
  text-decoration: none; text-align: center;
}
.job-reuse:hover { border-color: rgba(168, 85, 247, 0.4); color: var(--text); }
.job-copy, .linkish {
  margin-top: 8px; border: 0; background: transparent; padding: 0;
  color: var(--gold); font-size: 12px; font-weight: 700; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.flash .linkish { margin-top: 0; font: inherit; font-size: inherit; font-weight: 700; }
.ticket-status { color: var(--gold); font-weight: 600; }
.ledger-balance { color: var(--text); font-size: 15px; }
.ledger-list { display: flex; flex-direction: column; gap: 8px; text-align: left; max-width: 640px; margin: 0 auto; }
.ledger-row {
  display: flex; gap: 12px; align-items: flex-start; justify-content: space-between;
  background: var(--elev); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px;
}
.ledger-main { min-width: 0; }
.ledger-meta, .ledger-desc { color: var(--muted); font-size: 12px; margin-top: 4px; }
.ledger-amt { font-weight: 800; white-space: nowrap; font-size: 14px; }
.ledger-amt.is-plus { color: var(--plus); }
.ledger-amt.is-minus { color: var(--minus); }

.ava {
  width: 32px; height: 32px; border-radius: 50%; background: var(--ava-bg);
  display: grid; place-items: center; font-size: 14px;
  border: 0; padding: 0; cursor: pointer; color: inherit;
  text-decoration: none;
  overflow: hidden;
  flex-shrink: 0;
}
.ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

/* Account menu — anchored popover (overlays; never reflows page) */
.account-menu-wrap {
  position: relative;
  flex-shrink: 0;
}
.account-menu-backdrop {
  display: none;
}
.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  bottom: auto;
  z-index: 90;
  width: min(240px, calc(100vw - 24px));
  max-width: calc(100vw - 16px);
  box-sizing: border-box;
  /* Overlay only — must not participate in header/page flow */
  margin: 0;
}
.account-menu[hidden] {
  display: none !important;
}
.account-menu-panel {
  background: var(--elev, var(--surface-3, #141414));
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  padding: 6px;
  box-sizing: border-box;
  overflow: hidden;
}
.account-menu-divider {
  height: 1px;
  margin: 4px 6px;
  background: var(--border);
  border: 0;
}
.account-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  box-sizing: border-box;
  outline: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.account-menu-item-label {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  color: inherit;
}
.account-menu-item:hover {
  background: rgba(168, 85, 247, 0.1);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.18);
}
.account-menu-item:focus-visible {
  background: rgba(168, 85, 247, 0.1);
  box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.45);
}
.account-menu-item.is-on {
  color: var(--text);
  background: var(--hover);
}
.account-menu-item--logout {
  color: var(--muted);
}
.account-menu-item--logout:hover {
  color: var(--minus, #ff5a5a);
  background: rgba(255, 90, 90, 0.08);
}
.account-menu-item--logout:focus-visible {
  color: var(--minus, #ff5a5a);
  background: rgba(255, 90, 90, 0.08);
  box-shadow: var(--ui-focus-danger-glow, 0 0 0 2px rgba(255, 77, 94, 0.35));
}
.account-menu-wrap.is-open .account-menu {
  animation: account-menu-in 0.16s ease-out;
}
@keyframes account-menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .account-menu-wrap.is-open .account-menu {
    animation: none;
  }
}

/* Touch: transparent catcher for outside-tap; still overlays, never reflows */
@media (max-width: 860px) {
  .account-menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 85;
    background: transparent;
  }
  .account-menu-backdrop[hidden] {
    display: none !important;
  }
}
html.is-tg .account-menu-backdrop {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 85;
  background: transparent;
}
html.is-tg .account-menu-backdrop[hidden] {
  display: none !important;
}

.login-scrim {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 20px 16px;
  background: var(--scrim);
}
.login-scrim[hidden] { display: none !important; }
.login-card {
  position: relative;
  width: min(400px, 100%);
  background: var(--login-card);
  border-radius: 22px;
  padding: 28px 22px 22px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.login-x {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border: 0; background: transparent;
  color: var(--text); font-size: 26px; line-height: 1; opacity: .85;
}
.login-x:hover {
  opacity: 1;
  background: rgba(168, 85, 247, 0.1);
  border-radius: 8px;
}
.login-x:focus-visible {
  outline: none;
  opacity: 1;
  border-radius: 8px;
  box-shadow: var(--ui-focus-glow-quiet, 0 0 0 1px rgba(168, 85, 247, 0.22), 0 0 8px rgba(168, 85, 247, 0.14));
}
.login-card h2 {
  margin: 8px 0 10px; text-align: center; font-size: 22px; font-weight: 800;
}
.login-lead {
  margin: 0 0 22px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.45;
}
.login-providers { display: grid; gap: 10px; margin-bottom: 18px; }
.login-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; border: 0; border-radius: 999px; padding: 13px 16px;
  font-size: 15px; font-weight: 700; text-align: center;
}
.login-ico {
  display: inline-grid; place-items: center; width: 22px; height: 22px; flex: 0 0 auto;
}
.login-tg { background: #2aabee; color: #fff; }
.login-google { background: #fff; color: #1f1f1f; border: 1px solid rgba(0,0,0,.12); }
.login-ya { background: #fff; color: #111; border: 1px solid rgba(0,0,0,.12); }
.login-ico-ya {
  width: 22px; height: 22px; border-radius: 50%; background: #fc3f1d; color: #fff;
  font-size: 13px; font-weight: 800; font-family: Arial, sans-serif;
}
.account-logins { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.account-login-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border, rgba(255,255,255,.08));
}
.account-login-row:last-child { border-bottom: 0; }
.account-login-info { display: grid; gap: 2px; min-width: 0; }
.account-login-name { font-weight: 700; color: var(--text); }
.account-login-meta { font-size: 12px; color: var(--muted); }
.account-login-actions { flex: 0 0 auto; }
.account-unlink-form { margin: 0; }
.login-check {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 12px; color: var(--login-muted); font-size: 12px; line-height: 1.4; cursor: pointer;
}
.login-check input {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; margin-top: 1px; flex: 0 0 auto;
  border-radius: 5px; border: 1px solid var(--border); background: var(--check-bg);
  display: grid; place-items: center;
}
.login-check input:checked {
  background: #f5a623; border-color: #f5a623;
}
.login-check input:checked::after {
  content: ""; width: 10px; height: 6px;
  border-left: 2px solid #111; border-bottom: 2px solid #111;
  transform: rotate(-45deg) translateY(-1px);
}
.login-check a { color: var(--login-link); text-decoration: underline; text-underline-offset: 2px; }
.app-confirm-card { padding: 22px 20px 18px; }
.app-confirm-title { margin: 0 0 12px; text-align: center; font-size: 18px; font-weight: 800; }
.app-confirm-message { margin: 0 0 18px; text-align: center; color: var(--text); font-size: 14px; line-height: 1.45; }
.app-confirm-actions { display: flex; gap: 10px; }
.app-confirm-btn {
  flex: 1; border: 1px solid var(--border); border-radius: 12px;
  padding: 11px 14px; font-size: 14px; font-weight: 700; cursor: pointer;
  background: var(--surface-3); color: var(--text);
}
.app-confirm-btn.app-confirm-ok {
  background: var(--accent, #7c5cff); border-color: transparent; color: #fff;
}
.app-confirm-btn:hover { opacity: 1; }
.suno-style-custom-hint {
  display: block; font-size: 12px; line-height: 1.4; color: var(--muted); margin: 0 0 6px;
}

.cookie {
  position: fixed; z-index: 90;
  left: 16px; bottom: calc(var(--dock) + 12px);
  width: calc(100% - 32px); max-width: 400px;
  background: var(--cookie-bg); border: 1px solid var(--border);
  border-radius: 16px; padding: 20px;
}
.cookie[hidden] { display: none !important; }
.cookie h2 { margin: 0 0 8px; font-size: 16px; }
.cookie p { margin: 0 0 14px; color: var(--cookie-muted); font-size: 13px; }
.cookie-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cookie-accept { border: 0; border-radius: 10px; padding: 10px; font-weight: 700; background: linear-gradient(90deg, var(--gold), var(--orange)); color: var(--accent-text); }
.cookie-decline { border-radius: 10px; padding: 10px; font-weight: 600; background: var(--surface-4); border: 1px solid var(--border); }

.plans { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.plan {
  background: var(--surface-5); border: 1px solid var(--border); border-radius: 16px; padding: 16px;
}
.plan.is-hot { border-color: rgba(255, 170, 60, .55); box-shadow: 0 0 0 1px rgba(255,170,60,.2); }
.plan h3 { margin: 0 0 6px; }
.plan-price { font-size: 22px; font-weight: 800; }
.plan-price small { font-size: 13px; color: var(--muted); font-weight: 500; }
.plan-cr {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-3); border-radius: 999px; padding: 6px 10px; margin: 8px 0; font-size: 13px;
}
.plan a.buy { display: inline-flex; margin-top: 8px; }
.buy-hero {
  text-align: left;
  background: var(--surface-5); border: 1px solid var(--border);
  border-radius: 16px; padding: 16px; margin-bottom: 8px;
}
.buy-lead { color: var(--muted); margin: 10px 0 14px; font-size: 14px; line-height: 1.45; }
.buy-cta-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.buy-cta-row .gen { width: auto; border: 0; text-decoration: none; }
.buy-secondary {
  display: inline-flex; align-items: center;
  padding: 10px 14px; border-radius: 999px; font-weight: 700; font-size: 13px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  text-decoration: none; cursor: pointer; font: inherit;
}
.buy-steps {
  margin: 14px 0 0; padding-left: 18px; color: var(--muted);
  font-size: 13px; line-height: 1.55;
}
.ptable-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.ptable { width: 100%; border-collapse: collapse; font-size: 13px; }
.ptable th, .ptable td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.ptable th { color: var(--muted); background: var(--surface-3); }

.ideas-page { text-align: left; padding-top: 12px; }
.ideas-page > h1 { text-align: center; }
.ideas-page > p:first-of-type { text-align: center; }
.ideas-section { margin-bottom: 18px; }
.ideas-section-title {
  margin: 8px 0 12px; font-size: 16px; font-weight: 800;
  max-width: 1080px;
}
.ideas-page .classic { justify-content: flex-start; }
.ideas-page .hist-filters,
.ideas-page .hist-search { max-width: none; }

@media (max-width: 860px) {
  .promos { grid-template-columns: 1fr; }
  .menu { display: none; }
  .chat { grid-template-columns: 1fr; }
  .side { display: none; }
  .tools { grid-template-columns: repeat(2, 1fr); }
  .plans { grid-template-columns: 1fr; }
  .hello { padding: 28px 8px 16px; }
  .hello h1 { font-size: 20px; }
  .acts { max-width: 100%; }
  .act { padding: 12px 14px; font-size: 14px; }
  .h-row { flex-wrap: wrap; gap: 8px; }
  .h-row h2 { font-size: 18px; }
}

/* Suno generate form */
.suno-advanced-wrap { margin-bottom: 14px; }
.suno-advanced-summary {
  cursor: pointer; font-size: 13px; font-weight: 700; color: var(--muted);
  padding: 8px 0; list-style: none;
}
.suno-advanced-summary::-webkit-details-marker { display: none; }
.suno-advanced-body { padding-top: 4px; }
.suno-tuning { margin-bottom: 14px; }
.suno-tuning-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  width: 100%;
}
.suno-tuning-head .help-wrap {
  flex-shrink: 0;
}
.suno-tuning-head .help {
  width: 22px;
  height: 22px;
  font-size: 12px;
}
.suno-tuning-head .suno-tuning-toggle {
  margin-left: auto;
}
.suno-tuning-label { font-size: 13px; font-weight: 700; }
.suno-tuning-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.suno-tuning-toggle { position: relative; flex-shrink: 0; cursor: pointer; }
.suno-tuning-enable-cb {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.suno-tuning-switch {
  display: block; width: 40px; height: 22px; border-radius: 999px;
  background: var(--surface-5); border: 1px solid var(--border);
  position: relative; transition: background .15s, border-color .15s, box-shadow .15s;
}
.suno-tuning-switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--muted); transition: transform .15s, background .15s;
}
.suno-tuning-enable-cb:checked + .suno-tuning-switch {
  background: rgba(255, 122, 24, 0.22);
  border-color: var(--orange, #ff7a18);
}
.suno-tuning-enable-cb:checked + .suno-tuning-switch::after {
  transform: translateX(18px);
  background: linear-gradient(90deg, var(--gold), var(--orange));
}
.suno-tuning-range {
  flex: 1; min-width: 0; height: 24px;
  accent-color: var(--gold);
  cursor: pointer;
}
.suno-tuning.is-disabled .suno-tuning-range,
.suno-tuning.is-disabled .el-range-input { opacity: 0.35; cursor: not-allowed; }
.suno-tuning.is-disabled .el-range-value { opacity: 0.5; }
.suno-tuning-endpoints {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 0 0;
  padding: 0 68px 0 0;
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
}
.suno-tuning-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.suno-tuning-range { flex: 1; min-width: 0; }
.suno-wav-note { font-size: 12px; line-height: 1.4; margin: 8px 0 0; }
.suno-style-picker { margin: 0 0 12px; }
.suno-style-selected-wrap { margin-top: 0; margin-bottom: 12px; }
.suno-style-selected-wrap-top { padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.suno-style-custom-wrap-bottom { margin-top: 12px; margin-bottom: 0; }
.suno-style-selected-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 6px;
}
.suno-style-selected-title { font-size: 12px; color: var(--muted); font-weight: 600; }
.suno-style-selected {
  display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px;
}
.suno-style-selected-empty { font-size: 12px; color: var(--muted); }
.suno-style-selected-chip {
  border: 1px solid rgba(255, 211, 77, 0.45); background: var(--chip-on);
  color: var(--text); border-radius: 999px; padding: 4px 10px;
  font-size: 11px; font-weight: 600; cursor: pointer;
}
.suno-style-section { margin-bottom: 10px; }
.suno-style-section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 4px;
}
.suno-style-section-count { font-size: 11px; color: var(--muted); }
.suno-style-chips-row {
  display: flex; align-items: flex-start; gap: 8px;
}
.suno-style-chips-row .suno-style-chips {
  flex: 1; min-width: 0;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.suno-style-chips-row .suno-style-chips.suno-style-chips-scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
.suno-style-inline-more {
  margin-top: 6px;
}
.suno-style-inline-more .suno-style-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.suno-style-more-btn {
  flex: 0 0 auto; border: 1px dashed var(--border); background: transparent;
  color: var(--muted); border-radius: 999px; padding: 4px 10px;
  font-size: 11px; font-weight: 700; cursor: pointer;
}
.suno-style-more-btn:hover { color: var(--text); border-color: rgba(168, 85, 247, 0.4); }
.suno-style-custom-wrap { display: block; margin-bottom: 10px; }
.suno-style-custom-wrap-primary {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-3);
}
.suno-style-custom-wrap-primary .suno-style-custom-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.suno-style-custom-wrap-bottom {
  margin-top: 12px;
  margin-bottom: 0;
}
.suno-style-custom-wrap-bottom .suno-style-custom-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.suno-style-or-tags {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .02em;
}
.suno-style-custom-label {
  display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px;
}
.suno-style-preview-wrap {
  margin-top: 12px;
  margin-bottom: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.suno-style-preview-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 4px;
}
.suno-style-preview-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.suno-style-preview {
  margin: 0; font-size: 12px; line-height: 1.45; color: var(--text);
  word-break: break-word;
}
.suno-style-preview.is-empty { color: var(--muted); }
.suno-style-sheet {
  position: fixed; inset: 0; z-index: 80;
}
.suno-style-sheet[hidden] { display: none !important; }
.suno-style-sheet-backdrop {
  position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55);
}
.suno-style-sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 72px; max-height: min(78vh, calc(100vh - 96px));
  overflow: auto; background: var(--modal); border: 1px solid var(--border);
  border-radius: 16px 16px 0 0; padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
}
@media (min-width: 640px) {
  .suno-style-sheet-panel {
    left: 50%; right: auto; top: 50%; bottom: auto;
    transform: translate(-50%, -50%);
    width: min(480px, 92vw);
    max-height: 80vh;
    border-radius: 16px;
    padding: 16px;
  }
}
.suno-style-sheet-footer {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}
.suno-style-sheet-done {
  min-width: 120px;
}
.suno-style-sheet-h {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 10px;
}
.suno-style-sheet-h h2 { margin: 0; font-size: 18px; }
.suno-style-sheet-h .x {
  text-decoration: none;
  margin-top: 0;
}
.suno-style-sheet-search-wrap { display: block; margin-bottom: 10px; }
.suno-style-sheet-search {
  width: 100%; box-sizing: border-box; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface-3); color: var(--text);
  padding: 10px 12px; font-size: 14px;
}
.suno-style-sheet-search::placeholder { color: var(--muted); }
.suno-style-sheet-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.suno-style-sheet-empty {
  margin: 8px 0 0; font-size: 13px; color: var(--muted); text-align: center;
}
.suno-style-presets { margin: -6px 0 14px; }
.suno-style-presets-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.suno-style-presets-title { font-size: 12px; color: var(--muted); }
.form-reset-row { margin: 4px 0 12px; text-align: right; }
.field-with-clear { position: relative; }
.field-with-clear input,
.field-with-clear textarea {
  width: 100%;
  padding-right: 36px;
  box-sizing: border-box;
}
.field-clear-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.field-clear-btn:hover { color: var(--text); border-color: rgba(168, 85, 247, 0.4); }
.field-clear-btn[hidden] { display: none !important; }
.suno-style-chip.is-on {
  border-color: rgba(255, 211, 77, 0.55);
  background: var(--chip-on);
  color: var(--text);
}
.select-option-hint { font-size: 12px; line-height: 1.4; margin: 8px 0 0; min-height: 1.4em; }
.field-inline-hint { font-size: 12px; line-height: 1.4; margin: 8px 0 0; }
.suno-style-preset-row { margin-bottom: 8px; }
.suno-style-preset-label {
  display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px;
}
.suno-style-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.suno-style-chip {
  border: 1px solid var(--border); background: var(--surface-4);
  color: var(--text); border-radius: 999px; padding: 4px 10px;
  font-size: 11px; font-weight: 600; cursor: pointer;
}
.suno-style-chip:hover { border-color: rgba(168, 85, 247, 0.4); }
