/* Cobra account pages: warm paper, ink, terracotta accent and Inter type (same palette as the Studio). */
:root {
  --bg: #f0eee6; --surface: #FFFFFF; --surface-subtle: #f5f4ee; --ink: #1f1e1d; --muted: #4b4b52; --border: #e8e6e3;
  --accent: #c96442; --accent-hover: #b5573a; --accent-subtle: #f6e5dc; --accent-ink: #FFFFFF; --accent-deep: #9c4a2f;
  --dark-btn: #0d0d11; --dark-btn-hover: #24242c; --danger: #D93025; --danger-subtle: #FDECEA;
  --radius-s: 8px; --radius-m: 14px; --radius-l: 22px; --radius-xl: 30px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.04); --shadow-md: 0 8px 24px rgba(0,0,0,.06); --shadow-lg: 0 16px 36px rgba(0,0,0,.08);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; color: var(--ink); }
[hidden] { display: none !important; }
svg.i { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--radius-m);
  font-size: 14px; font-weight: 700; transition: all .2s ease; white-space: nowrap; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); box-shadow: 0 4px 16px rgba(195,242,58,.4); transform: translateY(-1px); }
.btn-dark { background: var(--dark-btn); color: #fff; font-weight: 600; }
.btn-dark:hover:not(:disabled) { background: var(--dark-btn-hover); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); border: 1px solid var(--border); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.btn-ghost:hover:not(:disabled) { border-color: #C7C7CC; box-shadow: var(--shadow-md); }
.btn-soft { background: var(--surface-subtle); border: 1px solid var(--border); }
.btn-soft:hover:not(:disabled) { background: var(--border); }
.btn-danger { background: var(--danger-subtle); color: var(--danger); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 12px; }
.btn-block { width: 100%; height: 48px; }
.auth-btn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 48px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-m); font-size: 14px; font-weight: 600; box-shadow: var(--shadow-sm); transition: all .2s ease; }
.auth-btn:hover { border-color: #C7C7CC; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.auth-btn svg { width: 18px; height: 18px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; }
.input, .select, .textarea { width: 100%; height: 48px; padding: 0 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m);
  font-size: 14px; outline: none; transition: border-color .2s, box-shadow .2s; }
.textarea { height: auto; min-height: 110px; padding: 14px 16px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(195,242,58,.35); }
.input-sm { height: 36px; border-radius: 10px; padding: 0 10px; font-size: 13px; }
.hint { font-size: 12px; color: var(--muted); }
.error-msg { background: var(--danger-subtle); color: var(--danger); font-size: 13px; padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; }
.ok-msg { background: var(--accent-subtle); color: var(--accent-deep); font-size: 13px; padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; }
.divider { text-align: center; color: var(--muted); font-size: 14px; margin: 14px 0; font-weight: 500; }
.switch { position: relative; display: inline-block; vertical-align: middle; width: 40px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--border); border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: var(--shadow-sm); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); background: #fff; }

/* ---------- Auth pages (login / signup / forgot / reset) ---------- */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; }
.auth-head { max-width: 1140px; width: 100%; margin: 0 auto; padding: 28px 24px; display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 24px; font-weight: 800; letter-spacing: -.03em; display: inline-flex; align-items: center; min-height: 44px; }
.auth-grid { flex: 1; max-width: 1140px; width: 100%; margin: 0 auto; padding: 16px 24px 64px; display: grid; grid-template-columns: 1fr 1.05fr; gap: 48px; align-items: center; }
.auth-card { max-width: 420px; }
.auth-card h1 { font-size: clamp(2.2rem, 1.4rem + 2.6vw, 3.2rem); font-weight: 800; line-height: 1.05; letter-spacing: -.035em; margin: 0 0 10px; }
.auth-card .sub { color: var(--muted); font-size: 15px; font-weight: 500; margin: 0 0 28px; }
.auth-card .foot { font-size: 14px; color: var(--muted); margin-top: 18px; text-align: center; }
.auth-card .foot a { color: var(--ink); font-weight: 700; }
.visual-frame { background: linear-gradient(135deg,#F5F5F8 0%,#E2E2E8 50%,#D8D8E0 100%); border-radius: var(--radius-xl); padding: 20px;
  box-shadow: 0 20px 40px -15px rgba(0,0,0,.08), 0 0 0 1px rgba(255,255,255,.8) inset; border: 1px solid rgba(255,255,255,.8); }
.visual-img { border-radius: var(--radius-l); overflow: hidden; background: radial-gradient(circle at center,#26262E 0%,#0A0A0F 100%); position: relative; aspect-ratio: 4/4.4; box-shadow: var(--shadow-lg); }
.visual-img img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; display: block; filter: brightness(122%) contrast(102%) saturate(117%); }
.visual-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(195,242,58,.22) 0%, rgba(134,239,172,.10) 45%, rgba(134,239,172,0) 75%); }
.demo-note { font-size: 12px; background: var(--accent-subtle); color: var(--accent-deep); border-radius: 12px; padding: 10px 12px; margin-bottom: 16px; font-weight: 500; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 22px 16px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.side .logo { padding: 0 10px; margin-bottom: 18px; }
.side a.nav { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--muted); transition: .15s; }
.side a.nav:hover { background: var(--surface-subtle); color: var(--ink); }
.side a.nav.on { background: var(--accent-subtle); color: var(--ink); box-shadow: inset 0 0 0 1px #ffd2bf; }
.side a.nav.on svg { color: var(--accent-deep); }
.side .grow { flex: 1; }
.side .me { border-top: 1px solid var(--border); padding: 14px 10px 0; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.me .who { overflow: hidden; } .me .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .me .who span { color: var(--muted); font-size: 12px; }
.main { padding: 32px 40px 64px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(1.8rem, 1.2rem + 1.6vw, 2.5rem); font-weight: 800; letter-spacing: -.03em; margin: 0; line-height: 1.1; }
.page-head p { color: var(--muted); margin: 6px 0 0; font-size: 15px; }
.mob-top { display: none; }

/* ---------- Cards & grids ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); padding: 24px; box-shadow: var(--shadow-sm); }
.card h2, .card h3 { margin: 0 0 6px; letter-spacing: -.02em; }
.card h2 { font-size: 20px; } .card h3 { font-size: 16px; }
.card .muted, .muted { color: var(--muted); font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; background: var(--surface-subtle); border: 1px solid var(--border); }
.badge.lime { background: var(--accent); border-color: var(--accent); }
.badge.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.badge.red { background: var(--danger-subtle); color: var(--danger); border-color: transparent; }

/* prompt box */
.prompt-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); padding: 8px; box-shadow: var(--shadow-md); }
.prompt-card textarea { border: 0; outline: none; width: 100%; min-height: 96px; resize: none; padding: 16px 16px 8px; font-size: 16px; background: transparent; line-height: 1.5; }
.prompt-bar { display: flex; align-items: center; gap: 10px; padding: 8px; flex-wrap: wrap; }
.prompt-bar .grow { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { font-size: 13px; font-weight: 500; padding: 8px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); transition: .15s; }
.chip:hover { color: var(--ink); border-color: #C7C7CC; }
.model-seg { display: inline-flex; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 14px; padding: 3px; }
.model-seg button { padding: 7px 14px; border-radius: 11px; font-size: 13px; font-weight: 600; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.model-seg button[aria-pressed="true"] { background: var(--accent-subtle); color: var(--accent-deep); box-shadow: inset 0 0 0 1px #ffd2bf; }
.model-seg button[disabled] { opacity: .45; cursor: not-allowed; }

/* variations */
.variants { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 28px; }
.variant { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); overflow: hidden; display: flex; flex-direction: column; transition: .25s; box-shadow: var(--shadow-sm); }
.variant:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.variant .thumb { position: relative; height: 300px; background: var(--surface-subtle); overflow: hidden; }
.variant .thumb iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 1200px; border: 0; transform: scale(.3); transform-origin: 0 0; pointer-events: none; background: #fff; }
.variant .meta { padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--border); }
.variant .meta b { font-size: 15px; }
.skeleton { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; font-weight: 600;
  background: linear-gradient(100deg, #F4F4F6 30%, #FFFFFF 50%, #F4F4F6 70%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.progress { height: 6px; background: var(--surface-subtle); border-radius: 99px; overflow: hidden; width: 70%; margin-top: 10px; }
.progress i { display: block; height: 100%; background: var(--ink); width: 0; transition: width .3s; }

/* projects */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.project { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); overflow: hidden; transition: .2s; display: flex; flex-direction: column; }
.project:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.project .pthumb { height: 150px; background: linear-gradient(135deg,#F5F5F8 0%,#E2E2E8 50%,#D8D8E0 100%); position: relative; overflow: hidden; }
.project .pthumb iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 900px; border: 0; transform: scale(.19); transform-origin: 0 0; pointer-events: none; background: #fff; }
.project .pbody { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.project .pbody b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { text-align: center; padding: 48px 24px; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius-l); background: var(--surface); }

/* usage meters */
.meters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.meter { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m); padding: 14px 16px; }
.meter .row b { font-size: 14px; }
.meter .bar { height: 8px; background: var(--surface-subtle); border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.meter .bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.meter .bar i.hot { background: #F59E0B; } .meter .bar i.full { background: var(--danger); }
.meter small { color: var(--muted); font-size: 12px; display: block; }

/* table */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }

/* modal + toast */
.modal-bg { position: fixed; inset: 0; background: rgba(17,17,19,.45); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: var(--surface); border-radius: var(--radius-l); padding: 28px; width: 100%; max-width: 460px; box-shadow: 0 30px 60px rgba(0,0,0,.2); max-height: 90vh; overflow: auto; }
.modal h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -.02em; }
.modal p { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--radius-m);
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); z-index: 200; max-width: calc(100vw - 32px); }
.lock-chip { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; background: var(--ink); color: var(--accent); }
.lock-chip svg { width: 11px; height: 11px; }

/* plans (settings) */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); padding: 28px 24px; display: flex; flex-direction: column; position: relative; }
.plan.featured { border: 2px solid var(--ink); }
.plan .price { font-size: 38px; font-weight: 800; letter-spacing: -.03em; margin: 14px 0; display: flex; align-items: baseline; gap: 6px; }
.plan .price span { font-size: 14px; font-weight: 500; color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; font-size: 14px; font-weight: 500; }
.plan li { display: flex; gap: 10px; align-items: center; }
.plan li svg { width: 16px; height: 16px; stroke-width: 2.5; }

/* lock screen */
.lock-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 0%, var(--accent-subtle) 0%, var(--bg) 55%); }
.lock-card { max-width: 520px; width: 100%; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 48px 36px; box-shadow: var(--shadow-lg); }
.lock-icon { width: 72px; height: 72px; border-radius: 24px; background: var(--ink); color: var(--accent); display: grid; place-items: center; margin: 0 auto 22px; }
.lock-icon svg { width: 32px; height: 32px; }
.countdown { display: flex; justify-content: center; gap: 12px; margin: 26px 0; }
.countdown div { background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--radius-m); padding: 14px 10px; min-width: 78px; }
.countdown b { display: block; font-size: 32px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.countdown span { font-size: 12px; color: var(--muted); font-weight: 600; }

@media (max-width: 1100px) { .variants, .grid-4 { grid-template-columns: repeat(2, 1fr); } .meters { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 90; left: 0; width: 260px; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .mob-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 80; }
  .main { padding: 24px 20px 56px; }
  .auth-grid { grid-template-columns: 1fr; } .auth-grid .visual-frame { display: none; } .auth-card { max-width: 100%; }
  .grid-2, .grid-3, .plans, .variants { grid-template-columns: 1fr; }
}

/* settings + billing */
.settings { display: grid; grid-template-columns: 210px 1fr; gap: 24px; align-items: start; }
.set-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 24px; }
.set-nav button { text-align: left; padding: 10px 14px; border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--muted); }
.set-nav button:hover { background: var(--surface); color: var(--ink); }
.set-nav button[aria-selected="true"] { background: var(--accent-subtle); color: var(--ink); box-shadow: inset 0 0 0 1px #ffd2bf; }
.set-nav button[data-t="danger"] { color: var(--danger); margin-top: 8px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: 0; }
.set-row b { font-size: 14px; }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 22px 0; }
.feat-list { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; font-weight: 500; }
.feat-list li { display: flex; align-items: center; gap: 10px; }
.feat-list svg { width: 16px; height: 16px; color: var(--accent-deep); }
.faq { border-bottom: 1px solid var(--border); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.faq p { margin: 8px 0 0; }
@media (max-width: 900px) { .settings { grid-template-columns: 1fr; } .set-nav { flex-direction: row; overflow-x: auto; position: static; } .set-nav button { white-space: nowrap; } }

/* ---------- v2: model picker (dropdown like Claude's) ---------- */
.mp { position: relative; display: inline-block; }
.mp-btn { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; height: 36px; padding: 0 10px 0 14px; border-radius: 12px; background: var(--surface-subtle); border: 1px solid var(--border); font-size: 13px; font-weight: 700; }
.mp-btn:hover { border-color: #C7C7CC; }
.mp-btn:focus-visible, .mp-item:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 2px; }
.mp-eff { font-weight: 600; color: var(--muted); text-transform: capitalize; padding-left: 8px; border-left: 1px solid var(--border); }
.mp-btn svg.i { width: 16px; height: 16px; color: var(--muted); }
.mp-menu { position: absolute; z-index: 60; left: 0; top: calc(100% + 6px); width: min(340px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m); box-shadow: var(--shadow-lg); padding: 6px; }
.mp-up .mp-menu { top: auto; bottom: calc(100% + 6px); }
.mp-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; border-radius: 10px; }
.mp-item:hover { background: var(--surface-subtle); }
.mp-item[aria-checked="true"] { background: var(--accent-subtle); }
.mp-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mp-text b { font-size: 13px; }
.mp-text small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.mp-check { color: var(--accent-deep); display: inline-flex; }
.mp-item.locked .mp-text { opacity: .6; }
.mp-item .badge { flex-shrink: 0; }
.mp-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.mp-val { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; color: var(--muted); }
.mp-val svg.i { width: 14px; height: 14px; }
.mp-back svg.i { transform: rotate(180deg); width: 14px; height: 14px; }

/* ---------- v2: attach screenshot ---------- */
#attachBtn { cursor: pointer; }
#attachBtn.need { border-color: var(--accent-deep); box-shadow: 0 0 0 3px var(--accent-subtle); }
.attach { display: flex; align-items: center; gap: 12px; margin: 0 8px 4px; padding: 8px; background: var(--surface-subtle); border-radius: 12px; }
.attach img { width: 56px; height: 40px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.attach .hint { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- v2: visible thinking ---------- */
.think { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m); padding: 4px 14px; }
.think summary { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 10px 0; list-style: none; font-size: 14px; }
.think summary::-webkit-details-marker { display: none; }
.think-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-subtle); animation: pulse 1.2s ease-in-out infinite; }
.think.fin .think-dot { animation: none; }
.think.bad .think-dot { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-subtle); }
@keyframes pulse { 50% { transform: scale(.7); opacity: .6; } }
.think-list { list-style: none; margin: 0 0 10px; padding: 0 0 0 4px; border-left: 2px solid var(--border); }
.think-list li { display: flex; gap: 10px; padding: 6px 0 6px 12px; position: relative; }
.think-list .ts { width: 18px; height: 18px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: var(--accent-subtle); color: var(--accent-deep); font-size: 12px; font-weight: 800; margin-top: 1px; }
.think-list .ts svg.i { width: 12px; height: 12px; }
.think-list li.warn .ts { background: #FEF3C7; color: #B45309; }
.think-list li.run .ts { background: transparent; }
.think-list b { font-size: 13px; display: block; }
.think-list small { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 2px; }
.spin { width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--accent-deep); border-radius: 50%; animation: spin .8s linear infinite; display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .think-dot, .spin { animation: none; } }

/* ---------- v2: usage panel (messages per 5 h / day / week) ---------- */
.usage-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m); padding: 6px 18px; }
.urow { display: grid; grid-template-columns: minmax(150px, 1fr) 2fr minmax(110px, auto); align-items: center; gap: 18px; padding: 14px 0; }
.urow + .urow { border-top: 1px solid var(--border); }
.ulabel b { display: block; font-size: 14px; }
.ulabel span { font-size: 12px; color: var(--muted); }
.ubar { height: 8px; background: var(--surface-subtle); border-radius: 99px; overflow: hidden; }
.ubar i { display: block; height: 100%; background: var(--accent-deep); border-radius: 99px; transition: width .4s ease; }
.ubar i.hot { background: #F59E0B; } .ubar i.full { background: var(--danger); }
.upct { text-align: right; font-size: 13px; font-weight: 700; }
.upct small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.more-usage { margin-top: 12px; }
.more-usage summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); padding: 6px 0; }
.more-usage .meters { margin-top: 10px; }
@media (max-width: 640px) {
  .urow { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .urow .ubar { grid-column: 1 / -1; grid-row: 2; }
  .prompt-bar { gap: 8px; }
  #cost { order: 5; width: 100%; }
}

/* ---------- v2: home ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.home-hero { margin: 24px 0 18px; }
.home-hero h1 { font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem); letter-spacing: -.035em; line-height: 1.05; margin: 0 0 8px; font-weight: 800; }
.home-hero p { color: var(--muted); margin: 0; font-size: 16px; }
.home-prompt textarea { min-height: 120px; }
.pthumb-empty { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 13px; }
.usage-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.usage-head h2 { margin: 0; }
.usage-head a { font-size: 13px; text-decoration: underline; color: var(--muted); }

/* ---------- password show / hide ---------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { padding-right: 46px; width: 100%; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.pw-eye:hover { background: var(--surface-subtle); color: var(--ink); }
.pw-eye:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 1px; }
.pw-eye svg { width: 18px; height: 18px; }

/* loading skeletons */
.sk { border-radius: 12px; margin: 0 0 10px; background: linear-gradient(90deg, var(--surface-subtle) 25%, #ECECF0 50%, var(--surface-subtle) 75%); background-size: 200% 100%; animation: sk 1.2s ease-in-out infinite; }
.plans .sk, .meters .sk { margin: 0; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }

/* ---------- v2.2: tighter sizes, content width, calm loading ---------- */
.app { grid-template-columns: 228px 1fr; }
.side { padding: 18px 14px; }
.side .logo { font-size: 20px; margin-bottom: 12px; min-height: 36px; }
.side a.nav { padding: 9px 12px; font-size: 13.5px; gap: 10px; }
.main { padding: 26px 36px 56px; }
.main > * { max-width: 1120px; margin-left: auto !important; margin-right: auto !important; }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: clamp(1.45rem, 1.1rem + 1vw, 1.9rem); }
.page-head p { font-size: 14px; }
.home-hero { margin: 10px auto 14px; }
.home-hero h1 { font-size: clamp(1.5rem, 1.15rem + 1.1vw, 2.1rem); line-height: 1.12; margin-bottom: 6px; }
.home-hero p { font-size: 14.5px; }
.prompt-card { border-radius: 20px; }
.prompt-card textarea { min-height: 64px; font-size: 15px; padding: 14px 14px 6px; }
.home-prompt textarea { min-height: 72px; }
.card { padding: 20px; border-radius: 20px; }
.card h2 { font-size: 18px; }
.projects { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.project .pthumb { height: 136px; }
.btn { min-height: 40px; }
/* nothing pops in: content fades in once it is ready */
.main > * { animation: lt-in .22s ease-out both; }
@keyframes lt-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .main > * { animation: none; } }
.side.sk-side a.nav, .side.sk-side .me { opacity: .55; }
@media (max-width: 900px) { .main { padding: 20px 18px 48px; } }

.prompt-card.dropping { border-color: var(--accent-deep); box-shadow: 0 0 0 4px var(--accent-subtle); }

/* delete button on project cards */
.project { position: relative; }
.p-del { position: absolute; top: 8px; right: 8px; z-index: 2; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.92); border: 1px solid var(--border); color: var(--muted); opacity: 0; transition: opacity .15s; }
.project:hover .p-del, .p-del:focus-visible { opacity: 1; }
.p-del:hover { color: var(--danger); border-color: #F5C2BE; background: #fff; }
.p-del svg { width: 16px; height: 16px; }
@media (hover: none) { .p-del { opacity: 1; } }

.think-list li.fail .ts { background: var(--danger-subtle); color: var(--danger); }
.think-list li.fail b { color: var(--danger); }
.m-retry { margin-top: 8px; }
/* The Cobra mark in front of the word, on every page. */
.logo { gap: 10px; font-family: 'Source Serif 4', Georgia, serif; font-weight: 600; letter-spacing: -0.015em; }
.logo::before { content: ''; flex: none; width: 1.25em; height: 1.25em; border-radius: 0.3em; background: url(/assets/cobra-mark.svg) center / contain no-repeat; }
/* Subscription: plan comparison */
.compare-card { padding: 0; overflow: hidden; }
.compare { overflow-x: auto; }
.compare table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.compare th, .compare td { padding: 12px 16px; text-align: center; border-bottom: 1px solid var(--border); }
.compare thead th { font-size: 15px; font-weight: 700; background: var(--surface-subtle); }
.compare thead th small { display: block; font-size: 11px; font-weight: 600; color: var(--accent); margin-top: 2px; }
.compare tbody th { text-align: left; font-weight: 500; color: var(--ink); }
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: 0; }
.compare .cur { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.cmp-yes { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-subtle); color: var(--accent); }
.cmp-yes svg { width: 14px; height: 14px; stroke-width: 2.5; }
.cmp-no { color: var(--muted); opacity: .6; }
