:root {
  --bg: #0b0c10;
  --bg-soft: #121318;
  --panel: #16171e;
  --line: #262833;
  --text: #eceef4;
  --muted: #9096a8;
  --accent: #6d5efc;
  --accent-soft: #8b80ff;
  --ok: #35d0a5;
  --warn: #f2b544;
  --err: #f2596b;
  --radius: 14px;
}

* { box-sizing: border-box; }

/* The author `display` rules below beat the UA rule for [hidden], which has
   bitten us twice (views, form fields). Make the attribute authoritative. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(109, 94, 252, 0.18), transparent 60%),
    radial-gradient(700px 400px at 95% 0%, rgba(53, 208, 165, 0.08), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  background: rgba(11, 12, 16, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
}

.brand .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--ok));
  box-shadow: 0 0 18px rgba(109, 94, 252, 0.7);
}

.spacer { flex: 1; }

.balance {
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(109, 94, 252, 0.13);
  border: 1px solid rgba(109, 94, 252, 0.35);
  font-variant-numeric: tabular-nums;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-soft);
}

.balance.low {
  background: rgba(242, 181, 68, 0.12);
  border-color: rgba(242, 181, 68, 0.4);
  color: var(--warn);
}

button {
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  padding: 9px 15px;
  transition: 0.15s ease;
}

button:hover:not(:disabled) { border-color: #3a3d4d; background: #1b1d25; }
button:disabled { opacity: 0.55; cursor: not-allowed; }

.primary {
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 24px -10px rgba(109, 94, 252, 0.9);
}

.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #9a90ff, #7767ff);
  border-color: transparent;
}

.ghost { background: transparent; }
.wide { width: 100%; }

.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(320px, 400px) 1fr;
  gap: 20px;
  padding: 22px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
}

.panel {
  background: linear-gradient(180deg, rgba(22, 23, 30, 0.92), rgba(18, 19, 24, 0.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.composer { position: sticky; top: 78px; }

@media (max-width: 900px) {
  .composer { position: static; }
}

h2 {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.chips { display: grid; gap: 10px; margin-bottom: 16px; }
.chip-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.chip-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6d7285;
  width: 44px;
}

.chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 12px;
  line-height: 1.25;
  font-size: 13px;
}

.chip span { color: var(--muted); font-size: 11.5px; }

.chip.active {
  border-color: rgba(109, 94, 252, 0.65);
  background: rgba(109, 94, 252, 0.14);
}

.chip.active strong { color: var(--accent-soft); }

.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.field em { font-style: normal; color: #6d7285; }

textarea, input, select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: #0e0f14;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  outline: none;
  transition: 0.15s ease;
}

textarea { resize: vertical; min-height: 96px; }

textarea:focus, input:focus, select:focus {
  border-color: rgba(109, 94, 252, 0.7);
  box-shadow: 0 0 0 3px rgba(109, 94, 252, 0.14);
}

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.cost {
  padding: 11px 13px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--accent-soft);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.fineprint {
  margin: 12px 0 0;
  font-size: 12px;
  color: #6d7285;
  line-height: 1.5;
}

.results-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.muted { color: var(--muted); font-size: 12.5px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-soft);
}

.media {
  aspect-ratio: 16 / 10;
  background: #0e0f14;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}

.media.is-openable { cursor: zoom-in; }

.media-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.media:hover .media-actions,
.media:focus-within .media-actions {
  opacity: 1;
}

.icon-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 14px;
  line-height: 1;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 11, 16, 0.72);
  backdrop-filter: blur(6px);
}

.icon-btn:hover {
  background: rgba(109, 94, 252, 0.85);
  border-color: transparent;
}

.reuse {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1;
}

.reuse:hover:not(:disabled) {
  background: none;
  border-color: transparent;
  color: var(--accent-soft);
}

.media img, .media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.state {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.state small { font-size: 11.5px; color: #6d7285; }
.state.failed span { color: var(--err); font-weight: 600; }

.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(109, 94, 252, 0.25);
  border-top-color: var(--accent-soft);
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.card-body { padding: 11px 12px; }

.prompt {
  margin: 0 0 9px;
  font-size: 12.5px;
  color: #c9cede;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
}

.meta .right { margin-left: auto; }

.tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(109, 94, 252, 0.14);
  color: var(--accent-soft);
  font-size: 11px;
  white-space: nowrap;
}

.link { color: var(--ok); text-decoration: none; }
.link:hover { text-decoration: underline; }

.empty {
  color: #6d7285;
  font-size: 13px;
  text-align: center;
  padding: 48px 12px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 7, 10, 0.72);
  backdrop-filter: blur(6px);
}

.modal[hidden] { display: none; }

.modal-card {
  position: relative;
  width: min(560px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 30px 80px -30px #000;
}

.modal-card h2 { text-transform: none; letter-spacing: -0.01em; font-size: 19px; color: var(--text); }

.close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.packs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.pack {
  display: grid;
  gap: 4px;
  padding: 14px 12px;
  text-align: left;
  background: var(--bg-soft);
}

.pack-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 12.5px; }
.pack-head em {
  font-style: normal;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ok);
}
.pack-price { font-size: 21px; font-weight: 650; letter-spacing: -0.02em; }
.pack-credits { font-size: 12.5px; color: var(--accent-soft); }
.pack-rate { font-size: 11px; color: #6d7285; }

.code {
  margin: 16px 0 10px;
  padding: 14px;
  border-radius: 10px;
  background: #0e0f14;
  border: 1px dashed var(--line);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  word-break: break-all;
  color: var(--ok);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 200;
  padding: 11px 18px;
  border-radius: 10px;
  background: #1d1f28;
  border: 1px solid #333647;
  font-size: 13.5px;
  box-shadow: 0 18px 40px -18px #000;
}

.toast[hidden] { display: none; }
.toast[data-kind="ok"] { border-color: rgba(53, 208, 165, 0.5); color: var(--ok); }
.toast[data-kind="warn"] { border-color: rgba(242, 181, 68, 0.5); color: var(--warn); }
.toast[data-kind="error"] { border-color: rgba(242, 89, 107, 0.5); color: var(--err); }

/* --------------------------------------------------------------------------
   Auth screen
   -------------------------------------------------------------------------- */

.auth {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth[hidden] { display: none; }

.auth-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, rgba(22, 23, 30, 0.96), rgba(18, 19, 24, 0.96));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  box-shadow: 0 40px 90px -40px #000;
}

.brand.big {
  font-size: 20px;
  margin-bottom: 6px;
}

.auth-lead, .auth-card .muted {
  margin: 0 0 18px;
  font-size: 13px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  margin-bottom: 18px;
  background: #0e0f14;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.auth-tabs button {
  border: 0;
  background: transparent;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--muted);
  border-radius: 8px;
}

.auth-tabs button:hover:not(.active) {
  background: transparent;
  color: var(--text);
  border-color: transparent;
}

.auth-tabs button.active {
  background: rgba(109, 94, 252, 0.16);
  color: var(--accent-soft);
  font-weight: 600;
}

.auth-error {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(242, 89, 107, 0.1);
  border: 1px solid rgba(242, 89, 107, 0.35);
  color: #ff9aa6;
  font-size: 12.5px;
}

.auth-error[hidden] { display: none; }

/* Password field with a reveal toggle */
.pw { position: relative; }

.pw input { padding-right: 64px; }

.pw-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  height: 26px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.pw-toggle:hover:not(:disabled) {
  background: #1b1d25;
  border-color: #2c3040;
  color: var(--text);
}

.oauth { display: grid; gap: 8px; margin-bottom: 12px; }
.oauth[hidden] { display: none; }

.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border-radius: 10px;
  background: #16171e;
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
}

.oauth-btn:hover { background: #1b1d25; border-color: #3a3d4d; }

.auth-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 14px;
  color: #565b6b;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.auth-or[hidden] { display: none; }
.auth-or::before,
.auth-or::after { content: ""; flex: 1; height: 1px; background: #1d1f28; }

.who {
  font-size: 13px;
  color: var(--muted);
  margin-right: 4px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .who { display: none; }
}

/* --------------------------------------------------------------------------
   Lightbox
   -------------------------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
  padding: 24px;
  background: rgba(6, 7, 10, 0.94);
  backdrop-filter: blur(10px);
}

.lightbox[hidden] { display: none; }

.lightbox-stage {
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: auto;
}

.lightbox-stage img,
.lightbox-stage video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  box-shadow: 0 40px 90px -40px #000;
}

.lightbox-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.lightbox-prompt {
  margin: 0;
  max-width: 72ch;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  max-height: 3.4em;
  overflow: auto;
}

.lightbox-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.lb-btn {
  padding: 9px 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
}

.lb-btn:hover {
  border-color: #3a3d4d;
  background: #1b1d25;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  border-radius: 50%;
  background: rgba(20, 21, 28, 0.85);
  border: 1px solid var(--line);
  color: var(--muted);
}

.banner {
  position: relative;
  z-index: 20;
  padding: 10px 18px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #ffd9a0;
  background: rgba(242, 181, 68, 0.12);
  border-bottom: 1px solid rgba(242, 181, 68, 0.35);
}

.banner code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 12px;
}

.banner[hidden] { display: none; }

.banner.verify {
  color: #cfe9ff;
  background: rgba(70, 140, 255, 0.14);
  border-bottom-color: rgba(70, 140, 255, 0.35);
}

.banner .link-btn {
  margin-left: 6px;
  color: #fff;
  text-decoration: underline;
  font-size: 12.5px;
}

@media (max-width: 720px) {
  .lightbox { padding: 12px; }
  .lightbox-bar { flex-direction: column; align-items: stretch; }
  .lightbox-actions { justify-content: stretch; }
  .lb-btn { flex: 1; text-align: center; }
}

/* --------------------------------------------------------------------------
   Landing (logged out)
   -------------------------------------------------------------------------- */

.auth {
  align-items: start;
  padding: 34px 24px 0;
  overflow-y: auto;
}

.landing {
  width: min(760px, 100%);
  display: grid;
  gap: 16px;
  justify-items: center;
  text-align: center;
  padding-bottom: 40px;
}

.hero-title {
  margin: 4px 0 0;
  font-size: clamp(26px, 4.4vw, 38px);
  line-height: 1.14;
  letter-spacing: -0.025em;
  font-weight: 680;
  max-width: 18ch;
}

.hero-lede {
  margin: 0;
  max-width: 48ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.hero-points {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  justify-content: center;
  font-size: 12.5px;
  color: var(--muted);
}

.hero-points strong { color: var(--text); font-weight: 600; }

.landing-packs {
  width: min(600px, 100%);
  margin: 4px 0 6px;
}

.pack.static { cursor: default; }
.pack.static:hover { border-color: var(--line); background: var(--bg-soft); }

.auth-card {
  width: min(390px, 100%);
  text-align: left;
  margin-top: 4px;
}

.landing-foot {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 4px 0 26px;
  font-size: 12px;
  color: #585d6d;
}

.landing-foot a,
.app-foot a {
  color: var(--muted);
  text-decoration: none;
}

.landing-foot a:hover,
.app-foot a:hover { color: var(--accent-soft); }

.app-foot {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  padding: 10px 12px 44px;
  font-size: 12px;
  color: #585d6d;
}

/* --------------------------------------------------------------------------
   Legal pages
   -------------------------------------------------------------------------- */

.doc {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 44px 24px 90px;
}

.doc-back {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}

.doc-back:hover { color: var(--accent-soft); }

.doc h1 {
  margin: 20px 0 6px;
  font-size: 30px;
  letter-spacing: -0.02em;
  font-weight: 680;
}

.doc-meta {
  margin: 0 0 26px;
  font-size: 12.5px;
  color: #6d7285;
}

.doc h2 {
  margin: 30px 0 8px;
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 650;
  color: var(--text);
}

.doc p,
.doc li {
  color: #b4bacb;
  font-size: 14px;
  line-height: 1.72;
}

.doc ul { padding-left: 20px; }
.doc li { margin: 4px 0; }
.doc a { color: var(--accent-soft); }
.doc strong { color: var(--text); }
.doc code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #14151b;
  font-size: 12.5px;
}

/* --------------------------------------------------------------------------
   Studio: chat thread + composer
   -------------------------------------------------------------------------- */

.chat {
  display: grid;
  grid-template-rows: 1fr auto;
  height: calc(100dvh - 58px);
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
}

.thread {
  overflow-y: auto;
  padding: 20px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.thread-empty {
  margin: 40px auto;
  max-width: 46ch;
  text-align: center;
  color: #6d7285;
  font-size: 13.5px;
  line-height: 1.7;
}

.thread-empty strong { color: var(--muted); }

.turn { display: flex; flex-direction: column; gap: 10px; }

.row { display: flex; }
.row.right { justify-content: flex-end; }
.row.left { justify-content: flex-start; }

.bubble {
  max-width: min(78%, 620px);
  padding: 11px 14px;
  border-radius: 14px 14px 4px 14px;
  background: rgba(109, 94, 252, 0.16);
  border: 1px solid rgba(109, 94, 252, 0.3);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.ref-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.ref-strip img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.result {
  width: min(560px, 88%);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-soft);
}

.result-media {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  background: #0e0f14;
  cursor: zoom-in;
}

.result .state { min-height: 190px; justify-content: center; }

.result-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 11px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
}

.mini-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.mini-link:hover:not(:disabled) {
  background: none;
  border-color: transparent;
  color: var(--accent-soft);
}

.composer {
  border-top: 1px solid var(--line);
  padding: 12px 0 14px;
  background: linear-gradient(180deg, rgba(11, 12, 16, 0), rgba(11, 12, 16, 0.9) 40%);
}

.composer textarea {
  min-height: 52px;
  max-height: 180px;
  resize: none;
  line-height: 1.5;
}

.composer-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.models {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  scrollbar-width: none;
}

.models::-webkit-scrollbar { display: none; }

/* Model picker: two labelled rows, wraps instead of scrolling sideways. */
.model-row { display: grid; gap: 6px; margin-bottom: 8px; }

.model-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.model-label {
  width: 44px;
  flex: none;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #565b6b;
}

.chip.mini {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.chip.mini span { font-size: 11px; }

.composer-bar select {
  width: auto;
  padding: 7px 10px;
  font-size: 12.5px;
  background: #0e0f14;
}

.cost {
  padding: 0;
  border: 0;
  font-size: 12px;
  color: var(--accent-soft);
  white-space: nowrap;
}

.templates {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.templates::-webkit-scrollbar { display: none; }

.tpl {
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  white-space: nowrap;
}

.tpl:hover:not(:disabled) {
  color: var(--text);
  border-color: #3a3d4d;
  background: #1b1d25;
}

.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 9px;
}

.attachments[hidden] { display: none; }

.ref-warning {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 9px;
  padding: 8px 11px;
  border-radius: 9px;
  background: rgba(242, 181, 68, 0.1);
  border: 1px solid rgba(242, 181, 68, 0.32);
  color: #ffd9a0;
  font-size: 12px;
  line-height: 1.5;
}

.ref-warning[hidden] { display: none; }

.attachment {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.attachment img { width: 100%; height: 100%; object-fit: cover; display: block; }.attachment button {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  padding: 0;
  font-size: 12px;
  line-height: 1;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

.attachment.mentionable { cursor: copy; }

.att-badge {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(109, 94, 252, 0.88);
  color: #fff;
  font-size: 9.5px;
  font-weight: 600;
  pointer-events: none;
}

.att-badge.plain {
  background: rgba(16, 17, 23, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #dfe2ec;
}

.ref-hint {
  margin: 0 0 8px;
  font-size: 11.5px;
  line-height: 1.5;
  color: #7d8298;
}

.ref-hint[hidden] { display: none; }

/* Reference library ------------------------------------------------------- */

.modal-card.wide { width: min(720px, 100%); }

.lib-tabs {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}

.lib-tabs button {
  padding: 7px 13px;
  font-size: 12.5px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
}

.lib-tabs button.active {
  background: rgba(109, 94, 252, 0.16);
  border-color: rgba(109, 94, 252, 0.4);
  color: var(--accent-soft);
}

.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  max-height: 46vh;
  overflow-y: auto;
  margin: 12px 0;
}

.lib-item {
  position: relative;
  padding: 0;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #0e0f14;
}

.lib-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-item.selected { border-color: var(--accent); }

.tick {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  display: grid;
  place-items: center;
}

.lib-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lib-foot .fineprint { margin: 0; }

@media (max-width: 720px) {
  .chat { padding: 0 10px; }
  .result { width: 100%; }
  .bubble { max-width: 88%; }
  .composer-bar { gap: 6px; }
}

/* --------------------------------------------------------------------------
   App shell: sidebar + main
   -------------------------------------------------------------------------- */

.shell {
  display: grid;
  grid-template-columns: 258px 1fr;
  height: 100dvh;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 16px 12px 14px;
  background: #0c0d12;
  border-right: 1px solid var(--line);
}

.side-head { padding: 0 4px; }

.new-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(109, 94, 252, 0.45);
  background: rgba(109, 94, 252, 0.16);
  color: var(--accent-soft);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.new-btn:hover:not(:disabled) {
  background: rgba(109, 94, 252, 0.26);
  border-color: rgba(109, 94, 252, 0.7);
}

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  text-align: left;
}

.nav-item:hover:not(:disabled) { background: #16171e; border-color: transparent; }

.nav-item.active {
  background: rgba(109, 94, 252, 0.15);
  color: var(--accent-soft);
  font-weight: 600;
}

.side-recent {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
}

.side-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #565b6b;
  padding-left: 4px;
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  overflow-y: auto;
  align-content: start;
}

.recent-item {
  padding: 0;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0e0f14;
}

.recent-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

.side-empty { font-size: 11.5px; color: #4f5464; padding-left: 4px; }

.side-actions { display: grid; gap: 6px; }

.side-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  text-align: left;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text);
}

.side-btn:hover:not(:disabled) { border-color: #3a3d4d; background: #1b1d25; }

.tpl-label {
  align-self: center;
  margin-right: 2px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #565b6b;
  white-space: nowrap;
}

.side-foot {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.credits-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(109, 94, 252, 0.1);
  border: 1px solid rgba(109, 94, 252, 0.26);
}

.credits-num { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.credits-label { font-size: 11px; color: var(--muted); margin-left: 4px; }

.buy-mini {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
  border: 0;
  background: var(--accent);
  color: #fff;
}

.buy-mini:hover:not(:disabled) { background: var(--accent-soft); border-color: transparent; }

.who-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px;
  font-size: 12.5px;
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
}

.link-btn:hover:not(:disabled) { background: none; border-color: transparent; color: var(--err); }

.side-legal {
  display: flex;
  gap: 6px;
  padding: 0 4px;
  font-size: 11px;
  color: #4f5464;
}

.side-legal a { color: #4f5464; text-decoration: none; }
.side-legal a:hover { color: var(--muted); }

.main {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  height: 100dvh;
}

.viewbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
}

.viewbar h1 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }

.burger {
  display: none;
  padding: 4px 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
}

.view { display: grid; min-height: 0; }

/* An author `display` beats the UA rule for [hidden], so restate it. */
.view[hidden] { display: none; }

#viewStudio { grid-template-rows: 1fr auto; }

#viewLibrary {
  grid-template-rows: auto 1fr;
  padding: 16px 20px 0;
  overflow: hidden;
}

.thread { padding: 20px; }

.composer { padding: 12px 20px 16px; }

.tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 12.5px;
  border-radius: 9px;
  white-space: nowrap;
}

.tool-icon { font-size: 11px; color: var(--muted); }

.lib-toolbar { display: flex; align-items: center; gap: 12px; }
.lib-toolbar input { max-width: 320px; padding: 8px 12px; font-size: 13px; }

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  overflow-y: auto;
  align-content: start;
  padding: 14px 0 24px;
}

.asset {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-soft);
}

.asset-media {
  position: relative;
  aspect-ratio: 1;
  background: #0e0f14;
  cursor: zoom-in;
  overflow: hidden;
}

.asset-media img,
.asset-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.asset-actions {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px;
  opacity: 0;
  transition: opacity 0.15s ease;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
}

.asset-media:hover .asset-actions { opacity: 1; }

.asset-actions .icon-btn {
  width: auto;
  height: 28px;
  padding: 0 11px;
  font-size: 11.5px;
  border-radius: 7px;
}

.asset-prompt {
  margin: 0;
  padding: 8px 10px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lib-actions { display: flex; gap: 8px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 262px;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.18s ease;
  }

  .shell.nav-open .sidebar {
    transform: none;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.75);
  }

  .burger { display: block; }
  .thread { padding: 14px; }
  .composer { padding: 10px 14px 14px; }
  #viewLibrary { padding: 12px 14px 0; }
}

/* --------------------------------------------------------------------------
   Polish: video badges, library filters, scrollbars
   -------------------------------------------------------------------------- */

.bubble-text { margin: 0; }

.video-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.66);
  color: #e8eaf2;
  font-size: 10px;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.recent-item { position: relative; cursor: copy; }
.recent-item:hover { border-color: rgba(109, 94, 252, 0.6); }

.recent-item img,
.recent-item video { width: 100%; height: 100%; object-fit: cover; display: block; }

.recent-add {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 18px;
  height: 18px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(109, 94, 252, 0.92);
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.recent-add:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: transparent;
  transform: scale(1.08);
}

.side-recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 4px;
}

.side-count { font-size: 10.5px; color: #565b6b; font-variant-numeric: tabular-nums; }

/* Whole sidebar library scrolls as one column: images first, then videos. */
.side-lib {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 8px;
  align-content: start;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: #262935 transparent;
}

.side-lib .recent-grid { overflow: visible; }

/* ==========================================================================
   Visual pass: sidebar, thread and composer as one designed surface
   ========================================================================== */

.sidebar {
  padding: 14px 12px 12px;
  gap: 11px;
  background: #0a0b10;
  border-right: 1px solid #1d1f28;
}

.side-head { padding: 2px 6px 2px; }
.sidebar .brand { font-size: 14.5px; letter-spacing: -0.01em; }

.new-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(109, 94, 252, 0.42);
  background: linear-gradient(180deg, rgba(109, 94, 252, 0.26), rgba(109, 94, 252, 0.14));
  color: #d2cdff;
  font-size: 13px;
  font-weight: 600;
}

.new-btn:hover:not(:disabled) {
  background: rgba(109, 94, 252, 0.32);
  border-color: rgba(109, 94, 252, 0.7);
}

.side-lib { gap: 5px; padding-right: 4px; }

.lib-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 6px 7px;
  border-top: 1px solid #1a1c24;
}

.lib-title {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8b90a3;
}

.lib-total {
  font-size: 10px;
  color: #6b7085;
  background: #15171e;
  border: 1px solid #23262f;
  border-radius: 999px;
  padding: 1px 7px;
}

.lib-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 6px 1px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #565b6b;
}

.lib-count { color: #4a4f60; }

.side-lib .recent-grid { grid-template-columns: repeat(3, 1fr); gap: 5px; }
.side-lib .recent-item { border-radius: 9px; border-color: #22252f; }
.side-lib .recent-item:hover { border-color: rgba(109, 94, 252, 0.55); }
.recent-add { width: 17px; height: 17px; font-size: 10px; }

.side-btn {
  height: 34px;
  justify-content: center;
  font-size: 12.5px;
  border-radius: 9px;
  background: #12141b;
  border-color: #23262f;
  color: #c6cad8;
}

.side-btn:hover:not(:disabled) { background: #171a22; border-color: #333746; }

.side-foot { gap: 8px; padding-top: 11px; border-top: 1px solid #1a1c24; }
.credits-card { padding: 9px 11px; border-radius: 11px; }
.credits-num { font-size: 15px; }
.buy-mini {
  height: 26px;
  padding: 0 12px;
  font-size: 11.5px;
  border-radius: 8px;
  background: linear-gradient(180deg, #8b80ff, #6d5efc);
}
.who-row { padding: 0 6px; font-size: 12px; }
.side-legal { padding: 0 6px; font-size: 10.5px; }

/* Main surface ----------------------------------------------------------- */

.viewbar {
  padding: 12px 24px;
  border-bottom: 1px solid #1d1f28;
  background: rgba(10, 11, 16, 0.55);
  backdrop-filter: blur(8px);
}

.viewbar h1 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8b90a3;
}

.thread { padding: 26px 24px 12px; gap: 22px; }

.bubble {
  background: #1a1c25;
  border: 1px solid #272a36;
  border-radius: 14px 14px 4px 14px;
  color: #dfe3ee;
}

.result {
  border-color: #242732;
  border-radius: 14px;
  box-shadow: 0 24px 50px -34px #000;
}

/* Composer ---------------------------------------------------------------- */

.composer { padding: 12px 24px 18px; }

.composer-box {
  padding: 12px 14px;
  border: 1px solid #262935;
  border-radius: 16px;
  background: #12131a;
  box-shadow: 0 30px 70px -40px rgba(0, 0, 0, 0.9);
  transition: border-color 0.15s ease;
}

.composer-box:focus-within { border-color: #3b4054; }

.composer-box textarea {
  min-height: 58px;
  padding: 4px 2px 10px;
  border: 0;
  background: transparent;
  font-size: 14.5px;
}

.composer-box textarea:focus { border: 0; box-shadow: none; }

.composer .model-row {
  padding-bottom: 9px;
  margin-bottom: 9px;
  border-bottom: 1px solid #1b1e26;
}

.composer .templates { margin: 0 0 9px; }

.chip.mini {
  height: 28px;
  padding: 0 11px;
  font-size: 11.5px;
  border-radius: 8px;
  background: #171920;
  border-color: #252833;
}

.chip.mini.active {
  background: rgba(109, 94, 252, 0.18);
  border-color: rgba(109, 94, 252, 0.6);
}

.composer-bar select {
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 9px;
  background: #171920;
  border-color: #252833;
}

.composer .cost { font-size: 12px; font-weight: 600; color: #9b93ff; }

#generate {
  height: 36px;
  padding: 0 22px;
  border-radius: 10px;
  font-size: 13px;
}

.lib-filters {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: #0e0f14;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.fbtn {
  padding: 5px 12px;
  font-size: 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}

.fbtn:hover:not(:disabled) { background: #16171e; border-color: transparent; }

.fbtn.active {
  background: rgba(109, 94, 252, 0.16);
  color: var(--accent-soft);
  font-weight: 600;
}

/* No scrollbar inside the prompt box - it resizes nothing and looks broken. */
.composer textarea {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.composer textarea::-webkit-scrollbar { display: none; }

.thread,
.asset-grid,
.recent-grid,
.lib-grid {
  scrollbar-width: thin;
  scrollbar-color: #262935 transparent;
}

.thread::-webkit-scrollbar,
.asset-grid::-webkit-scrollbar,
.recent-grid::-webkit-scrollbar,
.lib-grid::-webkit-scrollbar { width: 8px; height: 8px; }

.thread::-webkit-scrollbar-thumb,
.asset-grid::-webkit-scrollbar-thumb,
.recent-grid::-webkit-scrollbar-thumb,
.lib-grid::-webkit-scrollbar-thumb {
  background: #262935;
  border-radius: 8px;
}

.thread::-webkit-scrollbar-track,
.asset-grid::-webkit-scrollbar-track,
.recent-grid::-webkit-scrollbar-track,
.lib-grid::-webkit-scrollbar-track { background: transparent; }

/* ==========================================================================
   Account overlay
   ========================================================================== */

.who {
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.who:hover:not(:disabled) { background: none; border-color: transparent; color: var(--text); }

.account {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 26px;
  background: rgba(6, 7, 10, 0.92);
  backdrop-filter: blur(10px);
}

.account[hidden] { display: none; }

.account-shell {
  width: min(980px, 100%);
  height: min(720px, 100%);
  display: grid;
  grid-template-columns: 200px 1fr;
  overflow: hidden;
  background: #0f1016;
  border: 1px solid #23262f;
  border-radius: 16px;
  box-shadow: 0 40px 100px -40px #000;
}

.account-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 18px 12px;
  background: #0b0c11;
  border-right: 1px solid #1d1f28;
}

.account-title {
  padding: 0 10px 12px;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b7085;
}

.acct-tab {
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}

.acct-tab:hover:not(:disabled) { background: #16181f; border-color: transparent; }

.acct-tab.active {
  background: rgba(109, 94, 252, 0.16);
  color: var(--accent-soft);
  font-weight: 600;
}

.account-body { overflow-y: auto; padding: 26px 28px 40px; }

.acct-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.acct-card {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid #23262f;
  border-radius: 12px;
  background: #12141b;
}

.acct-label {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6b7085;
}

.acct-big { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }

.acct-card .primary {
  justify-self: start;
  margin-top: 6px;
  height: 32px;
  padding: 0 15px;
  font-size: 12.5px;
}

.acct-h {
  margin: 28px 0 10px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8b90a3;
}

.acct-h.danger { color: #f2596b; }

.acct-table { width: 100%; border-collapse: collapse; font-size: 13px; }

.acct-table th {
  padding: 8px 0;
  text-align: left;
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7085;
  border-bottom: 1px solid #23262f;
}

.acct-table td { padding: 9px 0; border-bottom: 1px solid #1a1c24; color: #c9cede; }
.acct-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.acct-prompt { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-empty { padding: 22px 0; text-align: center; color: #6d7285; }

.pill { padding: 2px 8px; border-radius: 999px; font-size: 11px; background: #1b1e26; color: #9aa0b5; }
.pill.captured { background: rgba(53, 208, 165, 0.14); color: #35d0a5; }
.pill.created { background: rgba(242, 181, 68, 0.14); color: #f2b544; }

.acct-form { display: grid; gap: 12px; max-width: 380px; }
.acct-form .field { margin: 0; }

.acct-status {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 9px;
  background: #12141b;
  border: 1px solid #23262f;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  flex: none;
}

.dot.ok { background: var(--ok); box-shadow: 0 0 8px rgba(53, 208, 165, 0.6); }
.dot.warn { background: var(--warn); box-shadow: 0 0 8px rgba(242, 181, 68, 0.5); }

.acct-note {
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  line-height: 1.5;
}

.acct-note[hidden] { display: none; }

.acct-note.ok {
  background: rgba(53, 208, 165, 0.1);
  border: 1px solid rgba(53, 208, 165, 0.35);
  color: #9df0d8;
}

.acct-note.warn {
  background: rgba(242, 181, 68, 0.1);
  border: 1px solid rgba(242, 181, 68, 0.35);
  color: #ffd9a0;
}

.acct-note.error {
  background: rgba(242, 89, 107, 0.1);
  border: 1px solid rgba(242, 89, 107, 0.35);
  color: #ff9aa6;
}

.danger-btn {
  justify-self: start;
  height: 36px;
  padding: 0 16px;
  border-radius: 9px;
  border: 1px solid rgba(242, 89, 107, 0.4);
  background: rgba(242, 89, 107, 0.12);
  color: #ff8f9c;
  font-size: 13px;
}

.danger-btn:hover:not(:disabled) { background: rgba(242, 89, 107, 0.2); border-color: rgba(242, 89, 107, 0.6); }

@media (max-width: 760px) {
  .account { padding: 0; }
  .account-shell { grid-template-columns: 1fr; height: 100%; border-radius: 0; }
  .account-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid #1d1f28; }
  .account-title { display: none; }
  .acct-cards { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Composer v3: one card, pickers instead of chip walls
   ========================================================================== */

.viewbar {
  display: none;
  padding: 8px 14px;
  border-bottom: 1px solid #1d1f28;
}

.composer-box { position: relative; }

.composer-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.picker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid #262935;
  background: #171920;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
}

.picker:hover:not(:disabled) { background: #1c1f28; border-color: #363b4c; }
.picker.small { height: 28px; font-size: 12px; font-weight: 500; color: var(--muted); }
.picker-sub { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.chev { color: #6b7085; flex: none; }

.composer-box textarea {
  min-height: 108px;
  padding: 6px 2px 8px;
  border: 0;
  background: transparent;
  font-size: 14.5px;
  line-height: 1.55;
}

.composer-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 9px;
  border-top: 1px solid #1b1e26;
}

/* Popover menus ---------------------------------------------------------- */

.menu {
  position: absolute;
  z-index: 30;
  left: 14px;
  bottom: 62px;
  width: min(430px, calc(100% - 28px));
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid #2a2e3b;
  background: #14161d;
  box-shadow: 0 32px 60px -26px #000;
}

#styleMenu { width: min(240px, calc(100% - 28px)); bottom: 58px; }

.menu-group + .menu-group {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #1d2029;
}

.menu-label {
  display: block;
  padding: 6px 9px 4px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #5d6273;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #dfe3ee;
  font-size: 13px;
  text-align: left;
}

.menu-item:hover:not(:disabled) { background: #1c1f29; border-color: transparent; }
.menu-item.active { background: rgba(109, 94, 252, 0.14); color: var(--accent-soft); }
.menu-item-name { flex: 1; }
.menu-item-meta { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.menu-check { color: var(--accent-soft); }

/* Eye toggle replaces the Show/Hide text -------------------------------- */

.pw input { padding-right: 44px; }

.pw-toggle {
  width: 30px;
  height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #8b90a3;
}

.pw-toggle:hover:not(:disabled) { color: var(--text); background: #1b1d25; }

@media (max-width: 860px) {
  .viewbar { display: flex; }
}

