/* ═══ GakiAI — dark, precise, frontier-grade ══════════════════════════════
   Near-black canvas, one electric-violet accent with a soft glow, glass
   surfaces, and JetBrains Mono for every number. The signature is the
   ambient aurora behind the hero and the glow that tracks primary actions. */

:root {
  --bg: #0A0A0F;
  --bg-2: #101017;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.14);
  --text: #ECECF1;
  --text-2: #9A9AAB;
  --text-3: #63636F;
  --violet: #7C5CFF;
  --violet-2: #9D84FF;
  --cyan: #35E0D8;
  --glow: rgba(124, 92, 255, 0.45);
  --danger: #FF5C7A;
  --radius: 16px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--violet-2); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 6px; }

/* Ambient aurora backdrop */
.aurora {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 400px at 15% -5%, rgba(124, 92, 255, 0.22), transparent 60%),
    radial-gradient(700px 500px at 100% 0%, rgba(53, 224, 216, 0.10), transparent 55%),
    radial-gradient(500px 500px at 50% 110%, rgba(124, 92, 255, 0.10), transparent 60%);
  animation: drift 22s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-2%, 1.5%, 0) scale(1.06); }
}

/* ─── Chrome ───────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(16px, 4vw, 44px);
  background: rgba(10, 10, 15, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand__mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: conic-gradient(from 140deg, var(--violet), var(--cyan), var(--violet));
  box-shadow: 0 0 18px var(--glow);
  position: relative;
}
.brand__mark::after {
  content: ""; position: absolute; inset: 6px; border-radius: 4px; background: var(--bg);
}
.brand__name { font-weight: 700; font-size: 20px; letter-spacing: -0.02em; color: var(--text); }
.brand__name span { color: var(--violet-2); }

.topnav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.topnav a, .topnav button {
  color: var(--text-2); background: none; border: none;
  font-size: 14.5px; font-weight: 500; padding: 8px 12px; border-radius: 9px;
  transition: color 0.15s, background 0.15s;
}
.topnav a:hover, .topnav button:hover { background: var(--surface-2); color: var(--text); }
.topnav a.is-active { color: var(--text); }
.topnav .nav-cta {
  background: var(--violet); color: #fff; padding: 9px 18px; border-radius: 999px; font-weight: 600;
  box-shadow: 0 0 0 0 var(--glow); transition: box-shadow 0.2s, transform 0.12s, background 0.15s;
}
.topnav .nav-cta:hover { background: var(--violet-2); box-shadow: 0 0 24px var(--glow); transform: translateY(-1px); color: #fff; }

.view { flex: 1; width: 100%; }
.foot { text-align: center; color: var(--text-3); font-size: 13px; padding: 30px 0; }

/* ─── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 999px; font-size: 15px; font-weight: 600;
  padding: 13px 26px; background: var(--violet); color: #fff;
  transition: transform 0.12s, box-shadow 0.2s, background 0.15s;
}
.btn:hover { background: var(--violet-2); transform: translateY(-1px); box-shadow: 0 8px 30px var(--glow); }
.btn--ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-2); }
.btn--ghost:hover { background: rgba(255,255,255,0.08); box-shadow: none; }
.btn--sm { padding: 8px 16px; font-size: 13.5px; }
.btn:disabled { opacity: 0.5; cursor: wait; transform: none; box-shadow: none; }

/* ─── Landing / hero ───────────────────────────────────────────────────── */
.hero { max-width: 860px; margin: 0 auto; padding: clamp(60px, 12vh, 130px) 20px 30px; text-align: center; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 26px;
  animation: rise 0.6s ease both;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.hero__title {
  font-size: clamp(38px, 7vw, 72px); font-weight: 800; line-height: 1.02;
  letter-spacing: -0.035em;
  animation: rise 0.6s 0.08s ease both;
}
.hero__title .grad {
  background: linear-gradient(100deg, var(--violet-2) 10%, var(--cyan) 90%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero__sub {
  color: var(--text-2); max-width: 560px; margin: 22px auto 0; font-size: 18px;
  animation: rise 0.6s 0.18s ease both;
}
.hero__cta { margin-top: 34px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; animation: rise 0.6s 0.28s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.section-head { text-align: center; margin: 70px 0 30px; }
.section-head .eyebrow {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--violet-2);
}
.section-head h2 { font-size: clamp(26px, 4vw, 36px); font-weight: 700; letter-spacing: -0.02em; margin-top: 8px; }

/* Plans */
.plans {
  display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  max-width: 1040px; margin: 0 auto; padding: 0 20px 40px;
}
.plan {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 26px; display: flex; flex-direction: column;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
  overflow: hidden;
}
.plan::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-2), transparent);
}
.plan:hover { transform: translateY(-5px); border-color: var(--border-2); }
.plan--featured {
  border-color: rgba(124, 92, 255, 0.5);
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.08), var(--surface));
  box-shadow: 0 20px 60px rgba(124, 92, 255, 0.14);
}
.plan__tag {
  position: absolute; top: 18px; right: 18px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--violet-2);
  background: rgba(124, 92, 255, 0.14); padding: 4px 10px; border-radius: 999px;
}
.plan__name { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.plan__model {
  align-self: flex-start; font-family: var(--mono); font-size: 12px; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 3px 10px; margin: 12px 0 18px;
}
.plan__price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 20px; }
.plan__price strong { font-family: var(--mono); font-size: 34px; font-weight: 600; letter-spacing: -0.02em; }
.plan__price span { color: var(--text-3); font-size: 14px; }
.plan ul { list-style: none; padding: 0; display: grid; gap: 11px; color: var(--text-2); font-size: 14.5px; margin-bottom: 24px; }
.plan ul li { display: flex; gap: 10px; align-items: flex-start; }
.plan ul li svg { flex: 0 0 auto; margin-top: 3px; color: var(--cyan); }
.plan .btn { margin-top: auto; width: 100%; }
.plan--featured .btn { box-shadow: 0 0 24px var(--glow); }

.paynote {
  max-width: 620px; margin: 10px auto 60px; padding: 18px 22px; text-align: center;
  color: var(--text-2); font-size: 14.5px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.paynote strong { color: var(--text); }

/* ─── Auth ─────────────────────────────────────────────────────────────── */
.authcard {
  max-width: 420px; margin: clamp(50px, 10vh, 110px) auto; padding: 36px 32px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.authcard h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.authcard .muted { color: var(--text-2); font-size: 14.5px; margin: 6px 0 26px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--text-2); }
.field input {
  width: 100%; padding: 12px 14px; font-size: 15px; font-family: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 11px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input::placeholder { color: var(--text-3); }
.field input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(124,92,255,0.18); }
.authcard .btn { width: 100%; margin-top: 8px; }
.authcard .swap { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-2); }

/* ─── Chat ─────────────────────────────────────────────────────────────── */
.chatwrap {
  display: grid; grid-template-columns: 272px 1fr;
  height: calc(100vh - 69px); max-width: 1240px; margin: 0 auto; width: 100%;
}
.chatside {
  border-right: 1px solid var(--border); padding: 24px 20px;
  display: flex; flex-direction: column; gap: 20px;
}
.chatside h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); }
.side-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.side-card .plan-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.side-card .plan-row strong { font-size: 15px; }
.side-card .badge { font-family: var(--mono); font-size: 11px; color: var(--text-2); background: var(--surface-2); padding: 3px 8px; border-radius: 6px; }
.meterbar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meterbar__fill { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, var(--violet), var(--cyan)); box-shadow: 0 0 12px var(--glow); transition: width 0.5s ease; }
.meter-nums { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11.5px; color: var(--text-3); margin-top: 8px; }

.thread { display: flex; flex-direction: column; height: 100%; min-width: 0; }
.msgs { flex: 1; overflow-y: auto; padding: 28px clamp(16px, 4vw, 48px); display: flex; flex-direction: column; gap: 16px; }
.msg { max-width: 74ch; padding: 13px 17px; border-radius: 16px; font-size: 15.5px; white-space: pre-wrap; line-height: 1.6; }
.msg--user { align-self: flex-end; background: var(--violet); color: #fff; border-bottom-right-radius: 5px; }
.msg--ai { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.msg--ai.is-thinking { color: var(--text-3); }
.msg--ai.is-thinking::after { content: "▍"; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.empty-thread { margin: auto; text-align: center; color: var(--text-3); max-width: 340px; }
.empty-thread .orb {
  width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 50%;
  background: conic-gradient(from 140deg, var(--violet), var(--cyan), var(--violet));
  box-shadow: 0 0 40px var(--glow); animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(1.08); } }
.empty-thread h3 { color: var(--text); font-size: 19px; font-weight: 600; margin-bottom: 6px; }

.composer { display: flex; gap: 10px; padding: 16px clamp(16px, 4vw, 48px) 24px; border-top: 1px solid var(--border); }
.composer textarea {
  flex: 1; resize: none; font-family: inherit; font-size: 15.5px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 14px;
  padding: 13px 16px; min-height: 52px; max-height: 180px; transition: border-color 0.15s, box-shadow 0.15s;
}
.composer textarea::placeholder { color: var(--text-3); }
.composer textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(124,92,255,0.16); }

/* ─── Usage ────────────────────────────────────────────────────────────── */
.usagepage { max-width: 780px; margin: 0 auto; padding: 52px 20px 70px; }
.usagepage h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
.usagepage .muted { color: var(--text-2); margin: 6px 0 30px; }
.bigmeter { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 30px; }
.bigmeter__bar { height: 16px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bigmeter__fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--violet), var(--cyan)); box-shadow: 0 0 18px var(--glow); width: 0%; transition: width 0.8s ease; }
.bigmeter__row { display: flex; justify-content: space-between; margin-top: 14px; font-family: var(--mono); font-size: 14px; color: var(--text-2); }
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
.stat .n { font-family: var(--mono); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.stat .l { color: var(--text-3); font-size: 13px; margin-top: 4px; }

/* ─── Admin ────────────────────────────────────────────────────────────── */
.adminpage { max-width: 1040px; margin: 0 auto; padding: 52px 20px 70px; }
.adminpage h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 22px; }
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-3); font-weight: 600; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: var(--surface-2); }
td select {
  padding: 7px 10px; border-radius: 9px; border: 1px solid var(--border-2); font-family: inherit;
  background: var(--bg-2); color: var(--text); font-size: 13.5px;
}
.mono { font-family: var(--mono); color: var(--text-2); }

/* ─── Toast ────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-2); color: var(--text); padding: 13px 22px; border-radius: 13px;
  border: 1px solid var(--border-2); font-size: 14.5px; opacity: 0; pointer-events: none;
  transition: all 0.25s ease; max-width: 90vw; box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Responsive & a11y ────────────────────────────────────────────────── */
@media (max-width: 780px) {
  .chatwrap { grid-template-columns: 1fr; height: auto; }
  .chatside { flex-direction: row; align-items: center; justify-content: space-between; border-right: none; border-bottom: 1px solid var(--border); gap: 12px; }
  .chatside h2 { display: none; }
  .side-card { flex: 1; }
  .msgs { min-height: 54vh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ═══ v2 additions ════════════════════════════════════════════════════════ */
.pagewrap { max-width: 1000px; margin: 0 auto; padding: 46px 20px 70px; }
.pagewrap h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }

/* Persistent upgrade CTA in chat sidebar */
.upgrade-cta {
  background: linear-gradient(100deg, var(--violet), var(--cyan)); color: #fff; text-align: center;
  box-shadow: 0 0 20px var(--glow); font-weight: 700;
}
.upgrade-cta:hover { transform: translateY(-1px); box-shadow: 0 0 30px var(--glow); color: #fff; }

/* Locked composer bar */
.lockbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin: 16px clamp(16px, 4vw, 48px) 24px; padding: 16px 20px;
  background: linear-gradient(180deg, rgba(124,92,255,0.12), var(--surface));
  border: 1px solid rgba(124,92,255,0.4); border-radius: 14px; color: var(--text);
  font-size: 14.5px;
}

/* Packages page current-plan state */
.plan--current { border-color: rgba(53,224,216,0.5); }
.plan__tag--current { color: var(--cyan); background: rgba(53,224,216,0.14); }
.pending-banner {
  max-width: 1040px; margin: 0 auto 24px; padding: 14px 20px; border-radius: 14px;
  background: rgba(232,163,23,0.10); border: 1px solid rgba(232,163,23,0.35);
  color: #E8C97A; font-size: 14.5px; text-align: center;
}

/* Payment page */
.paywrap { max-width: 640px; margin: 0 auto; padding: 46px 20px 70px; }
.paycard { background: var(--bg-2); border: 1px solid var(--border); border-radius: 20px; padding: 30px; box-shadow: 0 30px 80px rgba(0,0,0,0.4); }
.pay-amount { display: flex; align-items: center; justify-content: space-between; padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--border); }
.pay-amount .l { color: var(--text-2); font-size: 14px; }
.pay-amount .n { font-family: var(--mono); font-size: 30px; font-weight: 600; }
.pay-amount .n em { font-style: normal; font-size: 15px; color: var(--text-2); }
.pay-steps { list-style: none; padding: 0; display: grid; gap: 22px; }
.pay-steps li { display: flex; gap: 14px; }
.step-n { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: var(--violet); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.pay-steps strong { font-size: 15.5px; }
.pay-steps p { color: var(--text-2); font-size: 14px; margin: 4px 0 10px; }
.pay-steps .hint { font-size: 13px; color: var(--text-3); margin-top: 8px; }
.pay-method { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
.pay-method span { color: var(--text-2); font-size: 13px; }
.pay-method code { font-family: var(--mono); font-size: 15px; color: var(--text); }
.pay-actions { display: flex; gap: 12px; margin-top: 26px; }
.pay-actions .btn { flex: 1; }

/* Usage upsell */
.upsell { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 26px; color: var(--text-2); }

/* Admin extras */
.admin-h { font-size: 19px; font-weight: 600; margin: 34px 0 14px; letter-spacing: -0.01em; }
.row-actions { display: flex; gap: 8px; }
.ov-input, .pk-price, .pk-credits {
  width: 110px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border-2);
  background: var(--bg); color: var(--text); font-size: 13px;
}
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.settings-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.settings-grid input { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font-size: 14px; }

/* Payment confirm + done + muted plan (v3.1) */
.pay-confirm { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; }
.pay-confirm-btn { width: 100%; background: linear-gradient(100deg, var(--violet), var(--cyan)); box-shadow: 0 0 20px var(--glow); font-weight: 700; }
.pay-confirm .btn--ghost { width: 100%; }
.paycard--done { text-align: center; }
.done-check { width: 58px; height: 58px; margin: 0 auto 18px; border-radius: 50%; background: linear-gradient(135deg, var(--violet), var(--cyan)); color: #fff; font-size: 30px; display: grid; place-items: center; box-shadow: 0 0 30px var(--glow); }
.paycard--done h2 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.paycard--done .pay-actions { margin-top: 24px; }
.plan--muted { opacity: 0.55; }
.plan--muted:hover { transform: none; }

/* Saved chats + subscription banners (v4) */
.chatside h2 { margin-top: 6px; }
.chatlist { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.chatitem { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 9px 11px; border-radius: 9px; cursor: pointer; color: var(--text-2); font-size: 13.5px; transition: background 0.12s; }
.chatitem:hover { background: var(--surface-2); color: var(--text); }
.chatitem.is-active { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.chatitem__t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.chatitem__del { background: none; border: none; color: var(--text-3); font-size: 13px; padding: 2px 5px; border-radius: 5px; opacity: 0; transition: opacity 0.12s, color 0.12s; }
.chatitem:hover .chatitem__del { opacity: 1; }
.chatitem__del:hover { color: var(--danger); background: rgba(255,92,122,0.12); }
.chat-empty { color: var(--text-3); font-size: 13px; padding: 4px 2px; }
.renew-chip { margin-top: 10px; font-size: 12px; font-weight: 600; color: var(--gold); background: rgba(232,163,23,0.12); border: 1px solid rgba(232,163,23,0.3); border-radius: 8px; padding: 5px 10px; text-align: center; }
.renew-banner { margin: 14px clamp(16px,4vw,48px) 0; padding: 12px 16px; border-radius: 12px; background: rgba(232,163,23,0.10); border: 1px solid rgba(232,163,23,0.35); color: #E8C97A; font-size: 13.5px; }
.renew-banner a { color: var(--gold); font-weight: 600; margin-left: 4px; }

/* Email verification banner (v5) */
.verify-banner { margin: 14px clamp(16px,4vw,48px) 0; padding: 12px 16px; border-radius: 12px; background: rgba(91,157,255,0.10); border: 1px solid rgba(91,157,255,0.35); color: #A8C7FF; font-size: 13.5px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.verify-resend { background: rgba(91,157,255,0.18); border: 1px solid rgba(91,157,255,0.4); color: #CADCFF; font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: 8px; cursor: pointer; }
.verify-resend:hover { background: rgba(91,157,255,0.28); }

/* Add-on slider + warning banner + lock choice (Phase A) */
.addon-cta { background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text); text-align: center; }
.addon-cta:hover { background: rgba(255,255,255,0.08); }
.warn-banner { margin: 14px clamp(16px,4vw,48px) 0; padding: 12px 16px; border-radius: 12px; background: rgba(232,163,23,0.10); border: 1px solid rgba(232,163,23,0.35); color: #E8C97A; font-size: 13.5px; }
.warn-banner a { color: var(--gold); font-weight: 600; }
.lockbar--choice { flex-direction: column; align-items: flex-start; gap: 12px; }
.lock-actions { display: flex; gap: 10px; }

.addon-amount { text-align: center; margin: 24px 0 8px; }
.addon-credits { font-family: var(--mono); font-size: 42px; font-weight: 600; letter-spacing: -0.02em; background: linear-gradient(100deg, var(--violet-2), var(--cyan)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.addon-unit { color: var(--text-3); font-size: 15px; margin-left: 8px; }
.addon-slider { width: 100%; margin: 18px 0 6px; accent-color: var(--violet); height: 6px; }
.addon-scale { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--text-3); margin-bottom: 22px; }
.addon-price { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.addon-price .l { color: var(--text-2); }
.addon-price .n { font-family: var(--mono); font-size: 26px; font-weight: 600; }
.addon-price .n em { font-style: normal; font-size: 14px; color: var(--text-2); }

/* Chat search + favorite stars (Phase B) */
.chat-search { position: relative; margin-bottom: 10px; }
.chat-search input { width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 8px 30px 8px 11px; color: var(--text); font-size: 13px; }
.chat-search input::placeholder { color: var(--text-3); }
.chat-search #chat-search-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 13px; padding: 3px 6px; }
.chat-search #chat-search-clear:hover { color: var(--text); }
.chatitem__star { background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 14px; padding: 2px 4px; flex-shrink: 0; line-height: 1; }
.chatitem__star.is-fav { color: var(--gold, #E8A317); }
.chatitem__star:hover { color: var(--gold, #E8A317); }

/* Language toggle (Phase B) */
.lang-toggle { background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text-2); font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 8px; cursor: pointer; font-family: inherit; transition: all 0.15s; letter-spacing: 0.02em; }
.lang-toggle:hover { color: var(--text); border-color: var(--violet); background: rgba(139,92,246,0.1); }

/* Custom confirmation modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(6,7,15,0.72); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 200; animation: modalfade 0.15s ease; }
@keyframes modalfade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--surface); border: 1px solid var(--border-2); border-radius: 16px; padding: 26px; max-width: 400px; width: calc(100% - 40px); box-shadow: 0 24px 60px rgba(0,0,0,0.5); animation: modalpop 0.18s cubic-bezier(0.2,0.9,0.3,1.2); }
@keyframes modalpop { from { transform: scale(0.94) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.modal__body { color: var(--text-2); font-size: 14px; line-height: 1.5; margin-bottom: 22px; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; }
.modal__actions .btn { min-width: 90px; }

/* ═══ Chat page: slide-in sidebar layout (Phase B UI) ═══ */
body.is-chatpage .topbar,
body.is-chatpage .foot { display: none; }
body.is-chatpage .view { padding: 0; max-width: none; }
body.is-chatpage { overflow: hidden; }

.chatwrap { display: flex; height: 100vh; gap: 0; }
.chatwrap.no-side { display: block; }

/* Sidebar */
.sidebar { width: 270px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; height: 100vh; transition: width 0.22s cubic-bezier(0.4,0,0.2,1), margin 0.22s; overflow: hidden; }
.chatwrap.side-collapsed .sidebar { width: 0; margin-left: 0; border-right: none; }
.sidebar__top { padding: 14px 14px 6px; }
.sidebar__toggle { width: 38px; height: 38px; border-radius: 9px; background: none; border: none; color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.sidebar__toggle:hover { background: var(--surface-2); color: var(--text); }
.sidebar__toggle svg { width: 20px; height: 20px; }

.sidebar__nav { padding: 4px 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.navitem { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 11px; border-radius: 9px; background: none; border: none; color: var(--text); font-size: 14.5px; font-family: inherit; cursor: pointer; text-align: left; position: relative; }
.navitem svg { width: 19px; height: 19px; flex-shrink: 0; color: var(--text-2); }
.navitem:hover { background: var(--surface-2); }
.navitem:hover svg { color: var(--text); }
.navitem--soon { color: var(--text-3); cursor: default; }
.navitem--soon:hover { background: none; }
.navitem .soon { margin-left: auto; font-size: 10px; font-style: normal; background: var(--surface-2); color: var(--text-3); padding: 1px 7px; border-radius: 999px; }

.sidebar__search { max-height: 0; overflow: hidden; transition: max-height 0.2s, padding 0.2s; padding: 0 12px; display: flex; gap: 6px; align-items: center; }
.sidebar__search.is-open { max-height: 60px; padding: 4px 12px 10px; }
.sidebar__search input { flex: 1; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 8px 11px; color: var(--text); font-size: 13.5px; font-family: inherit; }
.sidebar__search button { background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 13px; padding: 4px; }

.sidebar__scroll { flex: 1; overflow-y: auto; padding: 6px 10px 10px; }
.navsection { margin-bottom: 14px; }
.navsection__h { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); padding: 6px 11px; }
.nav-empty { color: var(--text-3); font-size: 13px; padding: 4px 11px; }

.navchat { display: flex; align-items: center; gap: 6px; padding: 8px 11px; border-radius: 8px; cursor: pointer; color: var(--text-2); font-size: 14px; }
.navchat:hover { background: var(--surface-2); color: var(--text); }
.navchat.is-active { background: var(--surface-2); color: var(--text); }
.navchat__t { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navchat__actions { display: flex; align-items: center; gap: 2px; opacity: 0; transition: opacity 0.12s; }
.navchat:hover .navchat__actions, .navchat.is-active .navchat__actions { opacity: 1; }
.navchat__star, .navchat__del { background: none; border: none; cursor: pointer; padding: 3px; border-radius: 5px; color: var(--text-3); display: grid; place-items: center; }
.navchat__star { font-size: 14px; }
.navchat__star.is-fav { color: var(--gold); }
.navchat__star:hover { color: var(--gold); }
.navchat__del svg { width: 15px; height: 15px; }
.navchat__del:hover { color: var(--danger); background: rgba(255,92,122,0.12); }

/* Account card at the bottom (expands upward) */
.acct { border-top: 1px solid var(--border); padding: 10px; position: relative; }
.acct__head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 8px; border-radius: 10px; background: none; border: none; cursor: pointer; font-family: inherit; }
.acct__head:hover { background: var(--surface-2); }
.acct__avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--violet), var(--cyan)); color: #fff; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }
.acct__meta { flex: 1; text-align: left; display: flex; flex-direction: column; line-height: 1.25; overflow: hidden; }
.acct__meta strong { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct__meta span { font-size: 12px; color: var(--text-3); }
.acct__chev { color: var(--text-3); transition: transform 0.18s; }
.acct__chev svg { width: 16px; height: 16px; }
.acct.is-open .acct__chev { transform: rotate(180deg); }
.acct__menu { position: absolute; left: 10px; right: 10px; bottom: calc(100% - 4px); background: var(--surface); border: 1px solid var(--border-2); border-radius: 12px; padding: 6px; box-shadow: 0 -8px 30px rgba(0,0,0,0.4); display: flex; flex-direction: column; gap: 2px; opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity 0.16s, transform 0.16s, visibility 0.16s; z-index: 20; }
.acct.is-open .acct__menu { opacity: 1; visibility: visible; transform: translateY(0); }
.acct__item { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 8px; background: none; border: none; color: var(--text); font-size: 14px; font-family: inherit; cursor: pointer; text-align: left; width: 100%; text-decoration: none; }
.acct__item svg { width: 17px; height: 17px; color: var(--text-2); }
.acct__item:hover { background: var(--surface-2); }

/* Thread top bar (menu button when collapsed + plan badge) */
.thread { flex: 1; display: flex; flex-direction: column; height: 100vh; min-width: 0; }
.thread__bar { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.thread__menu { width: 36px; height: 36px; border-radius: 9px; background: none; border: none; color: var(--text-2); cursor: pointer; display: none; place-items: center; }
.thread__menu svg { width: 20px; height: 20px; }
.thread__menu:hover { background: var(--surface-2); color: var(--text); }
.chatwrap.side-collapsed .thread__menu { display: grid; }
.thread__plan { display: flex; align-items: center; gap: 12px; }
.meter-mini { font-size: 12px; color: var(--text-3); font-family: var(--mono); }

/* Mobile: sidebar overlays */
@media (max-width: 760px) {
  .sidebar { position: fixed; z-index: 60; box-shadow: 0 0 40px rgba(0,0,0,0.5); }
  .chatwrap:not(.side-collapsed) .sidebar { width: 82vw; max-width: 300px; }
  .thread__menu { display: grid !important; }
}

/* File attachments (Phase C) */
.composer-wrap { display: flex; flex-direction: column; gap: 8px; padding: 12px 20px 16px; }
.filechips { display: flex; flex-wrap: wrap; gap: 8px; }
.filechips:empty { display: none; }
.filechip { display: inline-flex; align-items: center; gap: 7px; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 999px; padding: 5px 10px 5px 11px; font-size: 12.5px; color: var(--text); max-width: 220px; }
.filechip__ic { font-size: 13px; }
.filechip__n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filechip__x { background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 12px; padding: 0 2px; border-radius: 4px; }
.filechip__x:hover { color: var(--danger); }
.composer { display: flex; align-items: flex-end; gap: 10px; }
.attach-btn { flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); cursor: pointer; display: grid; place-items: center; transition: all 0.15s; }
.attach-btn:hover { color: var(--text); border-color: var(--violet); background: rgba(139,92,246,0.1); }
.attach-btn svg { width: 19px; height: 19px; }

/* ═══ Projects (Phase C part 2) ═══ */
.projwrap { max-width: 780px; margin: 0 auto; padding: 40px 24px 60px; }
.projhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.proj-intro { margin-bottom: 24px; }
.proj-actions { display: flex; gap: 8px; }
.projgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 28px; }
.projcard { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; cursor: pointer; text-align: left; transition: all 0.15s; }
.projcard:hover { border-color: var(--violet); background: var(--surface-2); transform: translateY(-2px); }
.projcard__ic { color: var(--violet-2); } .projcard__ic svg { width: 26px; height: 26px; }
.projcard__name { font-size: 16px; font-weight: 600; color: var(--text); }
.projcard__meta { font-size: 12.5px; color: var(--text-3); }
.projcard__tag { font-size: 10.5px; color: var(--cyan); background: rgba(34,211,238,0.1); padding: 2px 8px; border-radius: 999px; margin-top: 2px; }
.proj-empty { padding: 40px; text-align: center; color: var(--text-3); background: var(--surface); border: 1px dashed var(--border-2); border-radius: 14px; margin-bottom: 24px; }
.proj-back { margin-bottom: 16px; } .proj-back a { color: var(--text-2); font-size: 13.5px; }
.projcard-edit { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin: 20px 0 28px; }
.proj-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); margin-bottom: 16px; }
.proj-field input, .proj-field textarea { background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; color: var(--text); font-size: 14px; font-family: inherit; }
.proj-field textarea { resize: vertical; line-height: 1.5; }
.proj-hint { color: var(--text-3); font-size: 11.5px; }
.proj-save-row { display: flex; align-items: center; justify-content: space-between; }
.proj-count { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.proj-chats-h { font-size: 15px; margin-bottom: 12px; }
.projchats { display: flex; flex-direction: column; gap: 6px; }
.projchat { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.projchat:hover { border-color: var(--violet); background: var(--surface-2); }
.projchat__t { font-size: 14px; color: var(--text); }
.projchat__date { font-size: 12px; color: var(--text-3); font-family: var(--mono); }

/* Project pill in chat top bar */
.proj-pill { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 5px 12px; background: rgba(139,92,246,0.12); border: 1px solid rgba(139,92,246,0.3); border-radius: 999px; color: var(--violet-2); font-size: 12.5px; text-decoration: none; }
.proj-pill:hover { background: rgba(139,92,246,0.2); }
.proj-pill svg { width: 14px; height: 14px; }

/* Prompt modal input */
.modal__label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); margin-bottom: 20px; }
.modal__input { background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 9px; padding: 10px 12px; color: var(--text); font-size: 14px; font-family: inherit; }

/* Page modals (Usage / Add-on / Upgrade over the chat) */
.pagemodal-overlay { align-items: flex-start; padding: 40px 20px; overflow-y: auto; }
.pagemodal { position: relative; background: var(--bg); border: 1px solid var(--border-2); border-radius: 18px; width: 100%; max-width: 760px; margin: auto; box-shadow: 0 30px 80px rgba(0,0,0,0.6); animation: modalpop 0.18s cubic-bezier(0.2,0.9,0.3,1.2); }
.pagemodal__close { position: absolute; top: 14px; right: 14px; z-index: 5; width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); cursor: pointer; font-size: 14px; }
.pagemodal__close:hover { color: var(--text); background: rgba(255,255,255,0.08); }
.pagemodal__body { padding: 12px 8px; }
.pagemodal__body .pagewrap, .pagemodal__body .paywrap { padding: 24px 28px; max-width: none; margin: 0; }
.pagemodal__body .section-head { margin-top: 4px; }
.bonus-note { margin: -8px 0 18px; color: var(--violet-2); font-size: 13.5px; }

/* Trial sidebar note */
.trial-side-note { padding: 14px 12px; }
.trial-side-note p { font-size: 13px; color: var(--text-3); line-height: 1.5; margin-bottom: 12px; }
.trial-side-note .btn { width: 100%; text-align: center; }
