:root {
  --bg: #eef1f5;
  --bg-side: #ffffff;
  --bg-elev: #ffffff;
  --text: #141925;
  --muted: #6b7280;
  --accent: #189f92;
  --accent-soft: rgba(24, 159, 146, 0.12);
  --line: rgba(20, 25, 37, 0.1);
  --hover: rgba(20, 25, 37, 0.05);
  --btn: #141925;
  --btn-text: #fff;
  --danger: #b42318;
  --ok: #027a48;
  --font-d: "Syne", system-ui, sans-serif;
  --font-b: "Outfit", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 14px 40px rgba(15, 23, 42, 0.07);
  --radius: 14px;
}

html[data-theme="dark"] {
  --bg: #0c1018;
  --bg-side: #0a0c10;
  --bg-elev: #141a24;
  --text: #f2f4f7;
  --muted: #a8b0c0;
  --accent: #3dd6c6;
  --accent-soft: rgba(61, 214, 198, 0.12);
  --line: rgba(255, 255, 255, 0.1);
  --hover: rgba(255, 255, 255, 0.06);
  --btn: #3dd6c6;
  --btn-text: #041412;
  --danger: #f97066;
  --ok: #32d583;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-b);
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(24, 159, 146, 0.1), transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(232, 160, 74, 0.08), transparent 45%),
    var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
html[data-theme="dark"] body {
  background:
    radial-gradient(ellipse 70% 45% at 15% -5%, rgba(61, 214, 198, 0.1), transparent 50%),
    radial-gradient(ellipse 50% 35% at 95% 5%, rgba(232, 160, 74, 0.08), transparent 45%),
    var(--bg);
}
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.is-off { display: none !important; }
[hidden] { display: none !important; }

.banner {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.45rem 1rem;
  background: linear-gradient(90deg, #fff7e8, #e8faf7);
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}
html[data-theme="dark"] .banner {
  background: linear-gradient(90deg, rgba(232, 160, 74, 0.18), rgba(61, 214, 198, 0.1));
}
.banner-x {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.15rem 0.35rem;
}

/* —— Gate —— */
.gate-wrap {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.gate {
  width: min(420px, 100%);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.85rem 1.55rem;
  text-align: center;
  box-shadow: var(--shadow);
  animation: rise 0.45s var(--ease) both;
}
.brand-lg {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-d);
  font-weight: 800;
  font-size: 1.15rem;
  margin-bottom: 0.85rem;
  color: inherit;
  text-decoration: none;
}
.brand-lg:hover { opacity: 0.88; }
.brand-lg i, .brand i {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3dd6c6, #e8a04a);
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 0.72rem;
  color: #041412;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.gate h1 {
  font-family: var(--font-d);
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
}
.gate .lead { color: var(--muted); margin: 0 0 1.3rem; line-height: 1.45; }
.gate .hint { color: var(--muted); font-size: 0.8rem; margin: 0.85rem 0 0; line-height: 1.4; }
.btn-primary, .btn-secondary {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 0.78rem 1.15rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  margin-top: 0.45rem;
  transition: transform 0.15s var(--ease), filter 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.btn-primary { background: var(--btn); color: var(--btn-text); }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 600;
}
.btn-primary:hover, .btn-secondary:hover { transform: translateY(-1px); }

/* —— Shell —— */
.shell {
  flex: 1;
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 0;
}
.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.side {
  background: var(--bg-side);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0.55rem;
  min-height: 0;
  z-index: 25;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.55rem 0.95rem;
  font-family: var(--font-d);
  font-weight: 800;
  font-size: 1.05rem;
  color: inherit;
  text-decoration: none;
  border-radius: 10px;
}
.brand:hover { background: var(--hover); }
.nav-item {
  appearance: none;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  padding: 0.62rem 0.72rem;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: var(--hover); color: var(--text); font-weight: 650; }
.nav-item .ico { width: 1.1rem; opacity: 0.7; text-align: center; }
.side-mid { flex: 1; overflow: auto; min-height: 0; margin-top: 0.5rem; }
.side-label {
  margin: 0.7rem 0.7rem 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.hist-empty, .side-recent-item {
  padding: 0.4rem 0.7rem;
  font-size: 0.84rem;
  color: var(--muted);
}
.side-recent-item {
  cursor: pointer;
  border-radius: 8px;
  display: block;
  width: 100%;
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
}
.side-recent-item:hover { background: var(--hover); color: var(--text); }
.user-card {
  border-top: 1px solid var(--line);
  padding: 0.65rem 0.45rem 0.35rem;
}
.user-btn {
  appearance: none;
  border: 0;
  background: transparent;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}
.user-btn:hover, .user-btn.open { background: var(--hover); }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.75rem;
  flex: 0 0 auto;
}
.avatar.sm { width: 28px; height: 28px; font-size: 0.68rem; }
.user-meta { min-width: 0; }
.user-meta strong {
  display: block;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-meta span { font-size: 0.8rem; color: var(--muted); }
.avatar-pill {
  padding: 0.2rem;
  display: inline-flex;
  align-items: center;
}

/* —— Profile popover —— */
.prof-menu {
  position: fixed;
  z-index: 50;
  width: min(280px, calc(100vw - 1.5rem));
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
  padding: 0.55rem;
  animation: rise 0.2s var(--ease) both;
}
html[data-theme="dark"] .prof-menu {
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.45);
}
.prof-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.45rem 0.4rem 0.65rem;
}
.prof-bal {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.prof-topup {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--text);
  background: var(--hover);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.38rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
}
.prof-topup:hover { border-color: var(--accent); color: var(--accent); }
.prof-list { display: grid; gap: 0.1rem; }
.prof-item {
  appearance: none;
  border: 0;
  background: transparent;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.62rem 0.55rem;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  cursor: pointer;
  text-align: left;
}
.prof-item svg { flex: 0 0 auto; color: var(--muted); }
.prof-item:hover { background: var(--hover); }
.prof-foot {
  border-top: 1px solid var(--line);
  margin-top: 0.35rem;
  padding-top: 0.35rem;
}
.prof-item.danger { color: var(--danger); }
.prof-item.danger svg { color: var(--danger); }

/* —— Topbar —— */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 1.2rem;
  flex: 0 0 auto;
  border-bottom: 1px solid transparent;
}
.top-left, .top-right { display: flex; align-items: center; gap: 0.45rem; }
.crumb {
  font-family: var(--font-d);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}
.pill {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s;
}
.pill:hover { border-color: var(--accent); }
.pill.primary {
  background: var(--btn);
  border-color: transparent;
  color: var(--btn-text);
  font-weight: 650;
}
.bal-pill {
  cursor: default;
  font-weight: 650;
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}
.ghost {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
}
.ghost:hover { background: var(--hover); color: var(--text); }
.mob-only { display: none; }

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  flex: 1;
}
.panel {
  flex: 1;
  padding: 0.35rem 1.25rem 2rem;
  animation: rise 0.35s var(--ease) both;
}
.studio-wrap { max-width: 820px; margin: 0 auto; width: 100%; }
.studio-head h1 {
  font-family: var(--font-d);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0.15rem 0 0.25rem;
}
.lead { color: var(--muted); margin: 0 0 0.95rem; font-size: 0.95rem; }

/* —— Chat —— */
.main:has(#panel-chat:not([hidden])) {
  overflow: hidden;
}
#panel-chat:not([hidden]) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding-bottom: 0.65rem;
}
.chat-layout {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: none;
  margin: 0 0 0.75rem;
  width: 100%;
  flex: 0 0 auto;
}
.chat-models,
.chat-roles {
  margin: 0 0 0.85rem;
  flex: 0 0 auto;
}
.chat-models .seg.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.chat-feed {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.25rem 0.15rem 0.85rem;
  scroll-behavior: smooth;
}
.chat-empty {
  margin: 2.5rem auto;
  text-align: center;
  color: var(--muted);
  max-width: 28rem;
  line-height: 1.45;
}
.chat-msg {
  max-width: 92%;
  padding: 0.75rem 0.95rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  animation: rise 0.25s var(--ease) both;
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--accent-soft);
  border-color: rgba(24, 159, 146, 0.28);
  border-radius: 14px 14px 4px 14px;
}
.chat-msg.bot {
  align-self: flex-start;
  border-radius: 14px 14px 14px 4px;
}
.chat-msg .meta {
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.chat-composer {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.55rem 0.55rem 0.55rem 0.85rem;
  box-shadow: var(--shadow);
  flex: 0 0 auto;
  margin-top: 0.25rem;
}
#chatStatus { flex: 0 0 auto; }
.chat-composer textarea {
  flex: 1;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  min-height: 1.4em;
  max-height: 140px;
  padding: 0.45rem 0;
  line-height: 1.4;
}
.chat-send {
  margin: 0;
  padding: 0.65rem 1rem;
  flex: 0 0 auto;
}

.center-hero {
  max-width: 640px;
  margin: 10vh auto 0;
  text-align: center;
}
.center-hero h1 {
  font-family: var(--font-d);
  font-weight: 800;
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.45rem;
}
.center-hero .sub { color: var(--muted); margin: 0 0 1.2rem; }
.composer.fake {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.7rem 0.7rem 0.7rem 1rem;
  box-shadow: var(--shadow);
}
.composer.fake .placeholder { color: var(--muted); }
.composer.fake .go {
  background: var(--btn);
  color: var(--btn-text);
  text-decoration: none;
  padding: 0.55rem 0.95rem;
  border-radius: 11px;
  font-weight: 700;
  font-size: 0.88rem;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 0.9rem;
}
.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.84rem;
  color: var(--muted);
  cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
  margin-bottom: 0.95rem;
}
.tab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.48rem 0.78rem;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
}
.tab.active { background: var(--hover); color: var(--text); font-weight: 650; }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.05rem;
  box-shadow: var(--shadow);
}
.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.85rem;
  background: var(--hover);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  min-height: 88px;
  transition: border-color 0.15s, background 0.15s;
}
.drop-ico {
  font-size: 1.1rem;
  opacity: 0.55;
}
.drop:hover { border-color: rgba(24, 159, 146, 0.45); background: var(--accent-soft); }
.drop.has-file { padding: 0; border-style: solid; gap: 0; }
.drop.has-file .drop-ico,
.drop.has-file #imgDropText,
.drop.has-file #vidDropText { display: none; }
.drop img {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
}
.field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  background: transparent;
  resize: vertical;
  min-height: 100px;
  outline: none;
  line-height: 1.45;
  transition: border-color 0.15s;
}
.field:focus { border-color: var(--accent); }
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.8rem;
}
.label { font-size: 0.8rem; color: var(--muted); margin-right: 0.25rem; }
.seg {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--muted);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.seg.on {
  background: var(--btn);
  color: var(--btn-text);
  border-color: transparent;
}
.card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}
.price-btn {
  appearance: none;
  border: 0;
  background: var(--btn);
  color: var(--btn-text);
  padding: 0.78rem 1.25rem;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s var(--ease), filter 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.price-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.price-btn:not(:disabled):hover { transform: translateY(-1px); filter: brightness(1.05); }
.status {
  font-size: 0.88rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 1.25rem;
}
.status.busy { color: var(--accent); }
.status.ok { color: var(--ok); }
.status.err { color: var(--danger); }

@keyframes izi-spin {
  to { transform: rotate(360deg); }
}
.spin {
  width: 0.95rem;
  height: 0.95rem;
  border: 2px solid color-mix(in srgb, currentColor 28%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: izi-spin 0.7s linear infinite;
  flex: 0 0 auto;
}
.spin.spin-lg {
  width: 1.55rem;
  height: 1.55rem;
  border-width: 2.5px;
}
.wait-row {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.gen-wait {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 9rem;
  padding: 1.25rem;
  color: var(--muted);
  text-align: center;
}
.gate .hint.wait-row {
  justify-content: center;
  color: var(--accent);
}

.insp-row {
  margin-top: 1.1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.55rem;
}
.insp {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: 12px;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--muted);
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s var(--ease);
  min-height: 96px;
  display: flex;
  flex-direction: column;
}
.insp:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-2px);
}
.insp .thumb {
  height: 44px;
  background: var(--g, linear-gradient(135deg, #3dd6c6, #189f92));
}
.insp .body { padding: 0.65rem 0.75rem 0.8rem; }
.insp b { display: block; color: var(--text); margin-bottom: 0.2rem; font-size: 0.86rem; }

.result-stage {
  margin-top: 1.1rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem;
  box-shadow: var(--shadow);
  animation: rise 0.35s var(--ease) both;
}
.result-stage img,
.result-stage video {
  display: block;
  width: 100%;
  border-radius: 12px;
  background: #0c1018;
}
.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-top: 0.7rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.result-meta b { color: var(--accent); }
.result-meta a.dl {
  margin-left: auto;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.result-meta a.dl:hover { border-color: var(--accent); color: var(--accent); }

.hist-list {
  display: grid;
  gap: 0.65rem;
  max-height: min(32rem, 65vh);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.15rem;
}
.hist-card {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 0.9rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.7rem;
  align-items: center;
  animation: rise 0.3s var(--ease) both;
}
.hist-card img, .hist-card video {
  width: 104px;
  height: 78px;
  object-fit: cover;
  border-radius: 8px;
  background: #0c1018;
}
.hist-card h3 { margin: 0 0 0.2rem; font-size: 0.95rem; }
.muted { color: var(--muted); }
.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--hover);
}

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 16, 0.4);
  z-index: 20;
}

#toast {
  position: fixed;
  bottom: 1.15rem;
  left: 50%;
  transform: translateX(-50%);
  background: #141925;
  color: #fff;
  padding: 0.72rem 1.1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  z-index: 60;
  box-shadow: var(--shadow);
  max-width: min(90vw, 420px);
  text-align: center;
  animation: rise 0.25s var(--ease) both;
}
html[data-theme="dark"] #toast { background: #f2f4f7; color: #0c1018; }
#toast.err { background: var(--danger); color: #fff; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    display: none;
    position: fixed;
    inset: 0 auto 0 0;
    width: min(280px, 86vw);
    box-shadow: var(--shadow);
  }
  .side.open { display: flex; }
  .mob-only { display: inline-flex; }
  .panel { padding: 0.25rem 0.9rem 1.75rem; }
  .bal-pill { display: none; }
}
