:root {
  --ink: #0f172a; --ink2: #334155; --muted: #475569; --line: #e2e8f0; --soft: #f1f5f9; --bg: #ffffff;
  --side: #0f172a; --side-ink: #cbd5e1; --side-hi: #1e293b; --amber: #f59e0b; --amber-soft: #fef3c7; --amber-ink: #92400e;
  --green: #047857; --green-soft: #d1fae5; --green-ink: #065f46; --red: #b91c1c;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, system-ui, sans-serif; }
a { color: var(--green); }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.shell { min-height: 100vh; display: flex; }

/* sidebar */
.sidebar { width: 280px; flex: 0 0 280px; background: var(--side); color: var(--side-ink); padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 16px; text-decoration: none; }
.sun { width: 32px; height: 32px; border-radius: 10px; background: var(--amber); display: inline-flex; align-items: center; justify-content: center; }
.sun-sm { width: 26px; height: 26px; border-radius: 8px; margin-right: 8px; }
.brand-name { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 19px; color: #f8fafc; }
.brand-by { font-size: 12px; color: #94a3b8; }
.new-chat { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--amber); color: var(--ink); font-weight: 700; padding: 12px; border-radius: 12px; text-decoration: none; margin-bottom: 10px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.group { margin: 14px 10px 4px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #94a3b8; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; color: var(--side-ink); text-decoration: none; min-height: 44px; }
.sidebar nav a svg { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.sidebar nav a:hover { background: var(--side-hi); color: #f8fafc; }
.sidebar nav a.active { background: var(--side-hi); color: #f8fafc; font-weight: 600; }
.tag { margin-left: auto; font-size: 11px; }
.tag.soon { color: #fcd34d; } .tag.later { color: #94a3b8; }
.account { margin-top: auto; padding: 14px 6px 0; border-top: 1px solid var(--side-hi); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.avatar { width: 36px; height: 36px; border-radius: 999px; background: #334155; color: #f8fafc; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.account .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.account .who b { color: #f8fafc; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account .who span { font-size: 12px; color: #94a3b8; }
.link-btn { background: none; border: 0; color: #fcd34d; font-weight: 600; font-size: 13px; padding: 10px 6px; cursor: pointer; text-decoration: none; }

/* small screens: a top bar and a sliding menu */
.topbar { display: none; }
.scrim[hidden] { display: none; }
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .topbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--side); color: #f8fafc; position: sticky; top: 0; z-index: 20; }
  .brand-sm { display: flex; align-items: center; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 18px; }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 30; }
}
.icon-btn { width: 44px; height: 44px; border: 0; background: transparent; color: inherit; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { background: rgba(148, 163, 184, .15); }

/* main */
main { flex: 1; min-width: 0; padding: 40px 24px 64px; outline: none; }
.page { max-width: 880px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
h1 { margin: 0; font-family: 'Space Grotesk', sans-serif; font-size: 34px; line-height: 1.15; }
h2 { margin: 0; font-size: 20px; }
.lead { margin: 0; font-size: 16px; color: var(--muted); line-height: 1.6; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.spread { justify-content: space-between; }
.badge { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.badge.green { background: var(--green-soft); color: var(--green-ink); }
.badge.amber { background: var(--amber-soft); color: var(--amber-ink); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.amber { background: var(--amber); color: var(--ink); }
.btn.ghost { background: #fff; color: var(--ink); border-color: #cbd5e1; }
.btn.danger { background: #fff; color: var(--red); border-color: #fecaca; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.mono { font-family: 'JetBrains Mono', monospace; }
.note { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.6; }
.msg { padding: 12px 14px; border-radius: 12px; font-size: 15px; line-height: 1.5; }
.msg.ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: var(--green-ink); }
.msg.info { background: var(--amber-soft); border: 1px solid #fde68a; color: var(--amber-ink); }
.msg.err { background: #fef2f2; border: 1px solid #fecaca; color: var(--red); }
label { font-size: 14px; font-weight: 500; color: var(--ink2); }
.field { display: flex; flex-direction: column; gap: 6px; }
input[type=text], input[type=email], input[type=password], textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 12px; padding: 12px 14px; font-size: 16px; color: var(--ink); background: #fff; }
textarea { resize: vertical; }
.seg { display: inline-flex; border: 1px solid #cbd5e1; border-radius: 12px; overflow: hidden; }
.seg button { border: 0; background: #fff; color: var(--ink2); padding: 10px 16px; min-height: 44px; cursor: pointer; font-weight: 500; }
.seg button[aria-pressed=true] { background: var(--ink); color: #fff; font-weight: 600; }
.bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: #10b981; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; }
th { text-align: left; color: var(--muted); font-size: 13px; font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid var(--soft); }
.keybox { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.keybox code { flex: 1 1 360px; min-width: 0; overflow-x: auto; background: #fff; border: 1px solid #d1fae5; padding: 12px 14px; border-radius: 10px; font-size: 14px; }
pre.code { margin: 0; background: var(--ink); color: #e2e8f0; border-radius: 12px; padding: 16px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; overflow-x: auto; }
.voice-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.play { width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }

/* home */
.home { min-height: calc(100vh - 104px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; }
.home .big-sun { width: 76px; height: 76px; border-radius: 22px; background: var(--amber-soft); display: flex; align-items: center; justify-content: center; }
.home h1 { font-size: 44px; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 760px; }
.chip { background: #fff; border: 1px solid var(--line); color: var(--ink2); padding: 10px 14px; border-radius: 999px; cursor: pointer; min-height: 44px; }
.chip.amber { background: var(--amber-soft); border-color: #fde68a; color: var(--amber-ink); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; }
.ask { width: 100%; max-width: 760px; border: 1px solid #cbd5e1; border-radius: 20px; box-shadow: 0 8px 24px rgba(15, 23, 42, .06); background: #fff; text-align: left; }
.ask textarea { border: 0; border-radius: 20px 20px 0 0; padding: 18px 20px 6px; font-size: 17px; outline: none; resize: none; }
.ask .tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px 12px; }
.ask .tools .grow { flex: 1; }
.ask .dialect { background: var(--soft); border: 0; border-radius: 12px; padding: 10px 14px; font-weight: 600; min-height: 44px; }
.ask .send { background: var(--ink); color: #fff; }
.ask .icon-btn { color: var(--ink2); }
.fine { font-size: 13px; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
