/* realistgpt — minimal */

:root {
  --bg-0: #0a0a0b;
  --surface: rgba(22, 22, 26, 0.62);
  --surface-2: rgba(28, 28, 33, 0.78);
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f4f5;
  --text-2: #b9b9c0;
  --text-3: #7a7a83;
  --accent: #dc2626;
  --accent-2: #ef4444;
  --bubble-me: #1d1d22;
  --shadow-lg: 0 30px 80px -20px rgba(0,0,0,.7), 0 8px 24px -8px rgba(0,0,0,.6);
  --shadow-md: 0 10px 30px -10px rgba(0,0,0,.55);
  --radius-lg: 22px;
  --radius-md: 16px;
  --blur: 28px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --font-display: "Inter", -apple-system, "SF Pro Display", system-ui, sans-serif;
  --ease: cubic-bezier(.2,.7,.2,1);
}

@supports (font-variation-settings: normal) {
  :root { --font: "Inter var", -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif; }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

body {
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(220,38,38,.14), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(220,38,38,.04), transparent 60%),
    var(--bg-0);
}

button { font: inherit; color: inherit; cursor: pointer; border: 0; background: transparent; }
input, textarea { font: inherit; color: inherit; }
input:focus, textarea:focus { outline: none; }

.glass {
  background: var(--surface);
  backdrop-filter: blur(var(--blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-md);
}

.app {
  height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 12px;
  padding: 12px;
  transition: grid-template-columns .26s var(--ease);
}
.app.collapsed { grid-template-columns: 0 1fr; gap: 0; }
.app.collapsed .sidebar {
  transform: translateX(-110%);
  opacity: 0;
  pointer-events: none;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  padding: 16px 12px 12px;
  min-height: 0;
  transition: transform .26s var(--ease), opacity .26s var(--ease);
}
.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 16px;
  color: #fff;
  background: radial-gradient(120% 120% at 30% 20%, #ff5252, var(--accent) 55%, #7a1212);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.35),
    inset 0 -8px 14px rgba(0,0,0,.35),
    0 6px 14px -4px rgba(220,38,38,.5);
  letter-spacing: -.04em;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.02em;
  font-size: 15px;
}
.brand-name-accent { color: var(--accent-2); }

.new-chat-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid var(--hairline-strong);
  color: var(--text);
  font-weight: 600;
  font-size: 13.5px;
  transition: background .15s var(--ease), transform .12s var(--ease);
}
.new-chat-btn:hover { background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.03)); }
.new-chat-btn:active { transform: scale(.985); }

.chat-list {
  margin-top: 10px;
  flex: 1;
  overflow-y: auto;
  padding-right: 2px;
}
.chat-list::-webkit-scrollbar { width: 8px; }
.chat-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.07); border-radius: 8px; }
.chat-list::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.12); }

.chat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--text-2);
}
.chat-item:hover { background: rgba(255,255,255,.05); color: var(--text); }
.chat-item.active {
  background: rgba(220,38,38,.10);
  color: var(--text);
  border: 1px solid rgba(220,38,38,.25);
}
.chat-item .title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-item .more {
  opacity: 0; transition: opacity .15s;
  width: 22px; height: 22px;
  border-radius: 6px;
  display: grid; place-items: center;
  color: var(--text-3);
}
.chat-item:hover .more { opacity: 1; }
.chat-item .more:hover { background: rgba(255,255,255,.08); color: var(--text); }

.settings-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 13px;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.settings-btn:hover { background: rgba(255,255,255,.05); color: var(--text); }

.sidebar-foot {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.login-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13.5px;
  color: #fff;
  background: radial-gradient(120% 120% at 30% 20%, #ff5252, var(--accent) 55%, #7a1212);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 6px 14px -4px rgba(220,38,38,.45);
  transition: transform .12s var(--ease);
}
.login-btn[hidden] { display: none !important; }
.login-btn:hover { transform: translateY(-1px); }
.login-btn:active { transform: translateY(0) scale(.985); }
.login-btn svg { flex: 0 0 16px; }
.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  text-align: left;
  transition: background .15s var(--ease);
}
.user-pill:hover { background: rgba(255,255,255,.05); }
.user-pill .avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #2a2a31, #16161a);
  border: 1px solid var(--hairline-strong);
  font-weight: 700;
  font-size: 12px;
  color: var(--text);
  flex: 0 0 28px;
  text-transform: uppercase;
}
.user-pill .user-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.user-pill .user-email {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-pill .user-action { font-size: 11px; color: var(--text-3); }
.user-pill:hover .user-action { color: var(--accent-2); }

/* Main */
.main {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 0;
  position: relative;
}
.show-sidebar-btn {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 10;
  width: 34px;
  height: 34px;
  background: var(--surface-2);
  border: 1px solid var(--hairline-strong);
  backdrop-filter: blur(var(--blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
  box-shadow: var(--shadow-md);
}
.show-sidebar-btn:hover { background: var(--surface-2); color: var(--text); }

.mode-pill {
  position: absolute;
  top: 14px;
  right: 18px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--hairline-strong);
  backdrop-filter: blur(var(--blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
  box-shadow: var(--shadow-md);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s var(--ease), transform .12s var(--ease);
}
.mode-pill:hover { transform: translateY(-1px); border-color: rgba(220,38,38,.45); }
.mode-pill:active { transform: translateY(0); }
.mode-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(220,38,38,.18), 0 0 12px rgba(220,38,38,.5);
}
.mode-pill.action .mode-dot {
  background: #d4af37;
  box-shadow: 0 0 0 3px rgba(212,175,55,.18), 0 0 12px rgba(212,175,55,.5);
}
.mode-pill .mode-label::before { content: ""; }
.mode-pill .mode-label { text-transform: lowercase; }

.chat {
  overflow-y: auto;
  scroll-behavior: smooth;
}
.chat::-webkit-scrollbar { width: 10px; }
.chat::-webkit-scrollbar-thumb { background: rgba(255,255,255,.06); border-radius: 10px; }
.chat::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.12); }

.chat-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 24px 100px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Empty */
.empty {
  margin: 14vh auto 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.empty-mark {
  width: 72px; height: 72px;
  border-radius: 20px;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 36px;
  letter-spacing: -.04em;
  color: #fff;
  background: radial-gradient(120% 120% at 30% 20%, #ff5252, var(--accent) 55%, #7a1212);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.4),
    inset 0 -10px 18px rgba(0,0,0,.45),
    0 18px 40px -10px rgba(220,38,38,.55);
  margin-bottom: 4px;
}
.empty-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -.03em;
  margin: 0;
  background: linear-gradient(180deg, #fff 0%, #c9c9d1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.empty-sub {
  margin: 0;
  color: var(--text-3);
  font-size: 15px;
}

/* Messages */
.msg {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  animation: in .35s var(--ease);
}
@keyframes in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg .who {
  flex: 0 0 30px;
  width: 30px; height: 30px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 13px;
  margin-top: 2px;
}
.msg.me .who {
  background: linear-gradient(140deg, #2a2a31, #16161a);
  border: 1px solid var(--hairline-strong);
  color: var(--text);
}
.msg.bot .who {
  background: radial-gradient(120% 120% at 30% 20%, #ff5252, var(--accent) 55%, #7a1212);
  color: #fff;
  box-shadow: 0 6px 14px -4px rgba(220,38,38,.5);
}
.msg .body { flex: 1; min-width: 0; }
.msg .bubble {
  font-size: 15px;
  line-height: 1.62;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.msg.me .bubble {
  background: var(--bubble-me);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 12px 14px;
}
.msg .bubble strong { color: #fff; font-weight: 700; }
.msg .bubble code {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--hairline);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* typing */
.typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: blink 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* Composer */
.composer-wrap {
  padding: 6px 16px 18px;
  display: flex;
  justify-content: center;
}
.composer {
  width: 100%;
  max-width: 720px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: end;
  padding: 8px 8px 8px 14px;
  border-radius: 22px;
  background: var(--surface-2);
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow-lg);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.composer:focus-within {
  border-color: rgba(220,38,38,.45);
  box-shadow: var(--shadow-lg), 0 0 0 4px rgba(220,38,38,.10);
}
.composer textarea {
  background: transparent;
  border: 0;
  resize: none;
  padding: 10px 4px;
  font-size: 15px;
  line-height: 1.5;
  max-height: 220px;
  color: var(--text);
}
.composer textarea::placeholder { color: var(--text-3); }
.composer .send {
  width: 36px; height: 36px;
  border-radius: 12px;
  display: grid; place-items: center;
  color: #fff;
  background: radial-gradient(120% 120% at 30% 20%, #ff5252, var(--accent) 55%, #7a1212);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.3),
    0 6px 18px -4px rgba(220,38,38,.55);
  transition: transform .12s var(--ease), opacity .15s;
}
.composer .send:hover { transform: translateY(-1px); }
.composer .send:active { transform: translateY(0) scale(.98); }
.composer .send:disabled { opacity: .35; cursor: not-allowed; }

/* Settings sheet */
.icon-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  color: var(--text-2);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.icon-btn:hover { background: rgba(255,255,255,.06); color: var(--text); }

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 70;
  animation: fade .18s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed;
  right: 14px;
  top: 14px;
  bottom: 14px;
  width: min(420px, 92vw);
  z-index: 80;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  animation: slide .26s var(--ease);
}
/* `display: flex` above outranks the user-agent [hidden] rule, so we have to
   re-state hidden behavior explicitly or the sheet stays visible after JS toggles it. */
.sheet[hidden],
.sheet-backdrop[hidden] { display: none !important; }
@keyframes slide { from { transform: translateX(20px); opacity: 0; } }
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--hairline);
}
.sheet-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.01em;
  font-size: 16px;
}
.sheet-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}
.sheet-body .row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-2);
}
.sheet-body .row input {
  background: rgba(0,0,0,.3);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
}
.sheet-body .row input:focus {
  border-color: rgba(220,38,38,.45);
  box-shadow: 0 0 0 3px rgba(220,38,38,.10);
}
.sheet-body .primary {
  padding: 11px 14px;
  border-radius: 10px;
  font-weight: 700;
  color: #fff;
  background: radial-gradient(120% 120% at 30% 20%, #ff5252, var(--accent) 55%, #7a1212);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 6px 18px -4px rgba(220,38,38,.5);
  transition: transform .12s var(--ease);
}
.sheet-body .primary:hover { transform: translateY(-1px); }
.sheet-body .primary:active { transform: translateY(0) scale(.98); }
.sheet-body .hint { color: var(--text-3); font-size: 12px; margin: 0; line-height: 1.5; }
.sheet-body .muted { color: var(--text-3); font-style: normal; font-weight: 400; font-size: 11.5px; }

.save-row { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.saved-flash {
  font-size: 13px;
  font-weight: 600;
  color: #4ade80;
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.saved-flash.show { opacity: 1; }
.saved-flash.error { color: var(--accent-2); }

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--hairline);
  font-size: 12.5px;
  color: var(--text-2);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-3);
  box-shadow: 0 0 0 3px rgba(255,255,255,.04);
}
.status-dot.ok { background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,.18); }
.status-dot.warn { background: #fbbf24; box-shadow: 0 0 0 3px rgba(251,191,36,.18); }
.status-dot.bad { background: var(--accent-2); box-shadow: 0 0 0 3px rgba(220,38,38,.18); }

/* Responsive */
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; padding: 12px; }
  .sidebar {
    position: absolute;
    top: 12px; bottom: 12px; left: 12px;
    width: 260px;
    z-index: 20;
    transform: translateX(-110%);
    opacity: 0;
    pointer-events: none;
  }
  .sidebar.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }
  .empty { margin-top: 8vh; }
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible { outline: 2px solid rgba(220,38,38,.7); outline-offset: 2px; }

/* ─────────────────────────────────────────────────────────────────
   Doc pages (pricing, terms, privacy, refund) — shared layout
   ───────────────────────────────────────────────────────────────── */
body.doc-page {
  overflow-y: auto;
  display: block;
  padding: 0;
  min-height: 100vh;
}
.doc-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: rgba(10,10,11,.78);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--hairline);
}
.doc-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
}
.doc-brand .brand-mark { width: 28px; height: 28px; font-size: 16px; }
.doc-brand .brand-name { font-family: var(--font-display); font-weight: 800; letter-spacing: -.02em; font-size: 15px; }
.doc-back {
  color: var(--text-2);
  text-decoration: none;
  font-size: 13.5px;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.doc-back:hover { background: rgba(255,255,255,.05); color: var(--text); }

.doc-main {
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.doc-foot {
  border-top: 1px solid var(--hairline);
  padding: 22px 24px 38px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 13px;
  color: var(--text-3);
  max-width: 1080px;
  margin: 0 auto;
}
.doc-foot a {
  color: var(--text-2);
  text-decoration: none;
  transition: color .15s var(--ease);
}
.doc-foot a:hover { color: var(--text); }
.doc-foot-copy { margin-left: auto; color: var(--text-3); font-size: 12px; }

/* Legal pages */
.doc-legal h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(32px, 5vw, 48px);
  letter-spacing: -.03em;
  margin: 0 0 6px;
  background: linear-gradient(180deg, #fff 0%, #c9c9d1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.doc-legal h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -.02em;
  margin: 36px 0 10px;
  color: var(--text);
}
.doc-legal p, .doc-legal li {
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.7;
}
.doc-legal a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.doc-legal a:hover { color: #fff; }
.doc-legal strong { color: var(--text); font-weight: 700; }
.doc-legal ul, .doc-legal ol { padding-left: 22px; }
.doc-legal li { margin-bottom: 8px; }
.doc-updated { color: var(--text-3); font-size: 13px; margin: 0 0 28px; }

/* Pricing page */
.pricing-hero {
  text-align: center;
  padding: 20px 0 28px;
}
.pricing-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(36px, 6vw, 56px);
  letter-spacing: -.035em;
  margin: 0 0 10px;
  background: linear-gradient(180deg, #fff 0%, #c9c9d1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pricing-sub {
  margin: 0 0 22px;
  color: var(--text-2);
  font-size: 16px;
}

.billing-toggle {
  display: inline-flex;
  padding: 4px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
}
.billing-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  border-radius: 999px;
  transition: all .15s var(--ease);
  display: inline-flex; align-items: center; gap: 8px;
}
.billing-btn:hover { color: var(--text); }
.billing-btn.active {
  background: radial-gradient(120% 120% at 30% 20%, #ff5252, var(--accent) 55%, #7a1212);
  color: #fff;
  box-shadow: 0 6px 14px -4px rgba(220,38,38,.45);
}
.save-tag {
  background: rgba(212,175,55,.18);
  color: var(--gold, #d4af37);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 99px;
  font-weight: 700;
  letter-spacing: .02em;
}
.billing-btn:not(.active) .save-tag { background: rgba(212,175,55,.10); color: #d4af37; }

.plans {
  margin-top: 42px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.plan {
  position: relative;
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--hairline);
  border-radius: 22px;
  padding: 28px 26px 32px;
  display: flex;
  flex-direction: column;
  transition: transform .18s var(--ease), border-color .18s var(--ease);
}
.plan:hover { transform: translateY(-3px); border-color: var(--hairline-strong); }
.plan-featured {
  border-color: rgba(220,38,38,.55);
  box-shadow: 0 18px 50px -16px rgba(220,38,38,.35);
}
.plan-ribbon {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(120% 120% at 30% 20%, #ff5252, var(--accent) 55%, #7a1212);
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  box-shadow: 0 4px 12px -2px rgba(220,38,38,.55);
}
.plan-head h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -.02em;
  color: var(--text);
}
.plan-tag { margin: 0 0 18px; color: var(--text-3); font-size: 13px; }
.plan-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 22px;
  font-family: var(--font-display);
}
.price-cur { color: var(--text-2); font-size: 18px; font-weight: 700; }
.price-num { color: var(--text); font-size: 44px; font-weight: 900; letter-spacing: -.03em; }
.price-cycle { color: var(--text-3); font-size: 13px; margin-left: 4px; }
.plan-feats {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.plan-feats li {
  color: var(--text-2);
  font-size: 14px;
  padding-left: 22px;
  position: relative;
  line-height: 1.5;
}
.plan-feats li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent-2);
  font-weight: 800;
}
.plan-cta {
  display: block;
  text-align: center;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  background: radial-gradient(120% 120% at 30% 20%, #ff5252, var(--accent) 55%, #7a1212);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 6px 16px -4px rgba(220,38,38,.45);
  transition: transform .12s var(--ease);
}
.plan-cta:hover { transform: translateY(-1px); }
.plan-cta-ghost {
  background: rgba(255,255,255,.05);
  color: var(--text);
  border: 1px solid var(--hairline-strong);
  box-shadow: none;
}
.plan-cta-ghost:hover { background: rgba(255,255,255,.08); }

.pricing-faq { margin-top: 64px; }
.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px 32px;
}
.faq-grid h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.01em;
  margin: 0 0 6px;
  color: var(--text);
}
.faq-grid p {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.6;
}
.faq-grid a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }

/* App footer (tiny link row under composer) */
.app-foot {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 4px 0 0;
  font-size: 11px;
  color: var(--text-3);
  flex-wrap: wrap;
}
.app-foot a {
  color: var(--text-3);
  text-decoration: none;
  transition: color .15s var(--ease);
}
.app-foot a:hover { color: var(--text-2); }
.app-foot .sep { opacity: .4; }

/* Hide reCAPTCHA v3 badge — disclosure text in footer keeps us ToS-compliant.
   See https://developers.google.com/recaptcha/docs/faq#id-like-to-hide-the-recaptcha-badge */
.grecaptcha-badge { visibility: hidden !important; }

@media (max-width: 520px) {
  .doc-main { padding: 28px 18px 60px; }
  .plans { gap: 14px; }
}

/* Auth modal — hard wall on send when not logged in */
.auth-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 90;
  animation: fade .2s var(--ease);
}
.auth-backdrop[hidden] { display: none !important; }

.auth-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(440px, 92vw);
  z-index: 100;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  animation: pop .26s var(--ease);
  background: var(--surface-2);
}
.auth-modal[hidden] { display: none !important; }
@keyframes pop {
  from { transform: translate(-50%, -50%) scale(.96); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.auth-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--hairline);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth-brand .brand-mark { width: 26px; height: 26px; font-size: 15px; border-radius: 8px; }
.auth-brand .brand-name { font-size: 14px; }

.auth-body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-title {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.02em;
  font-size: 22px;
  margin: 0 0 2px;
  background: linear-gradient(180deg, #fff 0%, #c9c9d1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-sub {
  margin: 0 0 6px;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.5;
}
.auth-info {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
}
.auth-info strong { color: var(--text); }

.auth-stage { display: flex; flex-direction: column; gap: 10px; }
.auth-stage[hidden] { display: none !important; }

.auth-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-3);
}
.auth-row input {
  background: rgba(0,0,0,.32);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14.5px;
  color: var(--text);
  letter-spacing: .01em;
}
.auth-row input:focus {
  border-color: rgba(220,38,38,.45);
  box-shadow: 0 0 0 3px rgba(220,38,38,.10);
}
#authCode { letter-spacing: .35em; font-size: 18px; text-align: center; font-weight: 700; }

.auth-primary {
  flex: 1;
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14.5px;
  color: #fff;
  background: radial-gradient(120% 120% at 30% 20%, #ff5252, var(--accent) 55%, #7a1212);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 6px 18px -4px rgba(220,38,38,.5);
  transition: transform .12s var(--ease), opacity .12s var(--ease);
}
.auth-primary:hover { transform: translateY(-1px); }
.auth-primary:active { transform: translateY(0) scale(.98); }
.auth-primary:disabled { opacity: .5; cursor: not-allowed; }

.auth-secondary {
  flex: 1;
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--hairline-strong);
  transition: transform .12s var(--ease), background .15s var(--ease);
}
.auth-secondary:hover { background: rgba(255,255,255,.08); transform: translateY(-1px); }
.auth-secondary:active { transform: translateY(0) scale(.98); }
.auth-secondary:disabled { opacity: .5; cursor: not-allowed; }

.auth-buttons { display: flex; gap: 8px; }

.auth-link {
  background: none;
  color: var(--text-3);
  font-size: 12.5px;
  padding: 4px 0;
  align-self: flex-start;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-link:hover { color: var(--text); }

.auth-err {
  margin: 0;
  color: var(--accent-2);
  font-size: 12.5px;
}

.auth-fine {
  margin: 8px 0 0;
  color: var(--text-3);
  font-size: 11.5px;
  line-height: 1.5;
  text-align: center;
}
