/* Gopher Quest — mobile-first, iOS-like. Цвета — токены, тёмная тема по системе. */
:root {
  --bg: #f2f2f7;
  --surface: #ffffff;
  --surface-2: #f2f2f7;
  --text: #0b0b0f;
  --text-2: #5e5e66;
  --text-3: #8e8e95;
  --line: rgba(60, 60, 67, 0.14);
  --accent: #007d9c;
  --accent-fill: #00add8;
  --accent-soft: rgba(0, 173, 216, 0.12);
  --on-accent: #ffffff;
  --xp: #c98a00;
  --xp-fill: #f5b301;
  --xp-soft: rgba(245, 179, 1, 0.16);
  --good: #1f9d45;
  --good-soft: rgba(52, 199, 89, 0.15);
  --bad: #d70015;
  --bad-soft: rgba(255, 59, 48, 0.12);
  --rare: #0a6cff;
  --epic: #9b3fd1;
  --legendary: #e07800;
  --tabbar: rgba(249, 249, 251, 0.86);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --text: #f5f5f7;
    --text-2: #a1a1a8;
    --text-3: #6e6e75;
    --line: rgba(84, 84, 88, 0.45);
    --accent: #3fd0f2;
    --accent-fill: #00add8;
    --accent-soft: rgba(0, 173, 216, 0.2);
    --xp: #ffc933;
    --xp-soft: rgba(245, 179, 1, 0.18);
    --good: #32d74b;
    --good-soft: rgba(50, 215, 75, 0.18);
    --bad: #ff6961;
    --bad-soft: rgba(255, 69, 58, 0.18);
    --rare: #4c9bff;
    --epic: #c77dff;
    --legendary: #ffa53d;
    --tabbar: rgba(22, 22, 24, 0.86);
    --shadow: none;
  }
}

:root[data-theme="dark"] {
  --bg: #000000;
  --surface: #1c1c1e;
  --surface-2: #2c2c2e;
  --text: #f5f5f7;
  --text-2: #a1a1a8;
  --text-3: #6e6e75;
  --line: rgba(84, 84, 88, 0.45);
  --accent: #3fd0f2;
  --accent-soft: rgba(0, 173, 216, 0.2);
  --xp: #ffc933;
  --xp-soft: rgba(245, 179, 1, 0.18);
  --good: #32d74b;
  --good-soft: rgba(50, 215, 75, 0.18);
  --bad: #ff6961;
  --bad-soft: rgba(255, 69, 58, 0.18);
  --rare: #4c9bff;
  --epic: #c77dff;
  --legendary: #ffa53d;
  --tabbar: rgba(22, 22, 24, 0.86);
  --shadow: none;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
code, pre { font-family: var(--mono); font-size: 0.86em; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 6px; }

#app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 8px) 16px calc(env(safe-area-inset-bottom) + 96px);
}

/* ---------- заголовки ---------- */

.top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.back {
  display: inline-flex; align-items: center; gap: 2px;
  border: 0; background: none; color: var(--accent); font-size: 17px; padding: 8px 8px 8px 0;
}
.back svg { width: 22px; height: 22px; }
.large-title { font-size: 34px; line-height: 1.15; font-weight: 750; letter-spacing: -0.02em; margin: 4px 0 2px; }
.subtitle { color: var(--text-2); font-size: 15px; margin: 0 0 16px; }
.section-title {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-2); font-weight: 600; margin: 24px 4px 8px;
}

/* ---------- карточки и списки ---------- */

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.card h3 { margin: 0 0 4px; font-size: 17px; }
.card p { margin: 6px 0 0; color: var(--text-2); font-size: 15px; }
.card.tap { display: block; color: inherit; }
.card.banner, .card.act-card { display: flex; }
.card.tap:active, .row.tap:active { opacity: 0.6; }

.list { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 12px; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; min-height: 52px; color: inherit; width: 100%;
  background: none; border: 0; text-align: left; position: relative;
}
.row + .row::before {
  content: ""; position: absolute; top: 0; left: 56px; right: 0;
  border-top: 0.5px solid var(--line);
}
.row .icon {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: grid; place-items: center; font-size: 17px; background: var(--surface-2);
}
.row .body { flex: 1; min-width: 0; }
.row .title { font-size: 16px; }
.row .meta { font-size: 13px; color: var(--text-2); margin-top: 1px; }
.row .end { color: var(--text-3); font-size: 15px; display: flex; align-items: center; gap: 6px; flex: none; }
.chev { width: 8px; height: 13px; color: var(--text-3); flex: none; }

/* ---------- кнопки ---------- */

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 50px; border-radius: 14px; border: 0;
  background: var(--accent-fill); color: var(--on-accent); font-weight: 600; font-size: 17px;
  padding: 0 16px;
}
.btn:active { transform: scale(0.98); opacity: 0.9; }
.btn.secondary { background: var(--accent-soft); color: var(--accent); }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.gold { background: var(--xp-fill); color: #1d1600; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

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

/* ---------- чипы, бейджи ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: var(--surface-2); color: var(--text-2);
}
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.xp { background: var(--xp-soft); color: var(--xp); }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }

.status { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.status.todo { background: var(--surface-2); color: var(--text-3); }
.status.active { background: var(--accent-soft); color: var(--accent); }
.status.done { background: var(--good-soft); color: var(--good); }

/* ---------- прогресс ---------- */

.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--accent-fill); transition: width 0.4s ease; }
.bar.xp > i { background: linear-gradient(90deg, var(--xp-fill), #ffd95c); }
.bar.good > i { background: var(--good); }
.bar.thin { height: 6px; }

/* ---------- герой (уровень) ---------- */

.hero {
  background: linear-gradient(135deg, #00add8 0%, #0079a8 55%, #2b3a8f 100%);
  color: #fff; border-radius: 22px; padding: 18px; margin-bottom: 12px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.08);
}
.hero .lvl { display: flex; align-items: center; gap: 12px; }
.hero .badge {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  font-size: 28px; background: rgba(255, 255, 255, 0.18); flex: none;
}
.hero .name { font-size: 13px; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.hero .rank { font-size: 21px; font-weight: 700; }
.hero .xpline { display: flex; justify-content: space-between; font-size: 13px; margin: 14px 0 6px; opacity: 0.95; }
.hero .bar { background: rgba(255, 255, 255, 0.22); }
.hero .bar > i { background: #ffd95c; }

/* ---------- неделя ---------- */

.week { display: flex; justify-content: space-between; margin: 12px 0 4px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); width: 36px; }
.day .dot {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-3); font-weight: 600; font-size: 13px;
}
.day.played .dot { background: var(--accent-fill); color: #fff; }
.day.today .dot { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent-fill); }
.day.today { color: var(--text); font-weight: 600; }

.stat-line { display: flex; gap: 16px; margin-top: 12px; font-size: 15px; color: var(--text-2); }
.stat-line b { color: var(--text); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.stat .v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 13px; color: var(--text-2); margin-top: 2px; }

/* ---------- чек-лист фаз ---------- */

.check {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--text-3); flex: none;
  display: grid; place-items: center; color: transparent; transition: all 0.15s;
}
.check.on { background: var(--good); border-color: var(--good); color: #fff; }
.check svg { width: 14px; height: 14px; }
.row.is-done .title { color: var(--text-3); text-decoration: line-through; }

/* ---------- баннер дня ---------- */

.banner { display: flex; gap: 12px; align-items: center; }
.banner .emoji { font-size: 30px; flex: none; }
.banner .body { flex: 1; }
.banner .kicker { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); font-weight: 700; }
.banner h3 { margin: 2px 0 0; }

/* ---------- акты ---------- */

.act-card { display: flex; gap: 14px; align-items: flex-start; }
.act-card .num {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  font-size: 24px; background: var(--surface-2); flex: none;
}
.act-card.current { outline: 2px solid var(--accent-fill); outline-offset: -2px; }
.act-card .body { flex: 1; min-width: 0; }
.act-card .kicker { font-size: 12px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.act-card h3 { margin: 2px 0 8px; }
.act-card .foot { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); margin-top: 6px; }

/* ---------- квест ---------- */

.callout {
  border-radius: 14px; padding: 14px 16px; margin-bottom: 12px;
  background: var(--accent-soft); color: var(--text);
}
.callout .label { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.callout.gold { background: var(--xp-soft); }
.callout.gold .label { color: var(--xp); }
.legend { font-style: italic; color: var(--text-2); }

ul.tasks { margin: 0; padding: 0; list-style: none; }
ul.tasks li { padding: 8px 0 8px 26px; position: relative; font-size: 15px; }
ul.tasks li + li { border-top: 0.5px solid var(--line); }
ul.tasks li::before { content: "▸"; position: absolute; left: 4px; color: var(--accent); }

.cmd {
  display: flex; align-items: center; gap: 8px; background: #0d1117; color: #e6edf3;
  border-radius: 12px; padding: 12px 12px 12px 14px; margin-top: 10px;
}
.cmd code { background: none; padding: 0; color: inherit; flex: 1; overflow-x: auto; white-space: nowrap; font-size: 13px; }
.cmd button { border: 0; background: rgba(255, 255, 255, 0.12); color: #fff; border-radius: 8px; padding: 6px 10px; font-size: 13px; flex: none; }

.hint { border-radius: 12px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.hint button { width: 100%; display: flex; justify-content: space-between; align-items: center; border: 0; background: none; padding: 12px 14px; font-size: 15px; font-weight: 500; }
.hint .cost { color: var(--bad); font-size: 13px; font-weight: 600; }
.hint .text { padding: 0 14px 12px; font-size: 15px; color: var(--text); }

textarea, input[type="text"], input[type="password"], input[type="number"] {
  width: 100%; border: 0; border-radius: 12px; background: var(--surface-2);
  padding: 12px 14px; font-size: 16px; resize: vertical; outline: none;
}
textarea { min-height: 120px; line-height: 1.45; }
textarea:focus, input:focus { box-shadow: 0 0 0 2px var(--accent-fill); }
label.field { display: block; font-size: 13px; color: var(--text-2); margin: 12px 0 6px; font-weight: 500; }

.seg { display: flex; background: var(--surface-2); border-radius: 10px; padding: 2px; gap: 2px; }
.seg button {
  flex: 1; border: 0; background: none; border-radius: 8px; padding: 7px 4px; font-size: 14px; font-weight: 500; color: var(--text-2);
}
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); font-weight: 600; }
:root[data-theme="dark"] .seg button.on { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button.on { background: #636366; } }

.rubric-row { padding: 10px 0; }
.rubric-row + .rubric-row { border-top: 0.5px solid var(--line); }
.rubric-row .q { font-size: 14px; margin-bottom: 6px; }

.stepper { display: flex; align-items: center; gap: 14px; justify-content: center; margin: 8px 0; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface-2); font-size: 22px; font-weight: 600; }
.stepper .val { font-size: 34px; font-weight: 700; min-width: 90px; text-align: center; font-variant-numeric: tabular-nums; }

.toggle-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.toggle-row .body { flex: 1; font-size: 15px; }

.done-banner { text-align: center; padding: 22px 16px; }
.done-banner .big { font-size: 44px; }
.done-banner h3 { margin: 6px 0 2px; font-size: 20px; }

/* ---------- босс ---------- */

.boss-hero {
  background: linear-gradient(135deg, #3b1d5e 0%, #7a1f3d 100%); color: #fff;
  border-radius: 22px; padding: 18px; margin-bottom: 12px;
}
.boss-hero .kicker { font-size: 12px; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.boss-hero h2 { margin: 4px 0 6px; font-size: 26px; }
.boss-hero p { margin: 0 0 12px; opacity: 0.9; font-size: 15px; }
.boss-hero .bar { background: rgba(255, 255, 255, 0.2); }
.boss-hero .bar > i { background: #ff7a90; }
.boss-hero.won { background: linear-gradient(135deg, #0f6b3a, #1f9d45); }
.grasps { display: grid; grid-template-columns: 28px 1fr; gap: 8px 10px; font-size: 15px; }
.grasps b { color: var(--accent); font-family: var(--mono); }

/* ---------- карточки ---------- */

.flash {
  background: var(--surface); border-radius: 22px; padding: 24px 20px; min-height: 260px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; margin-bottom: 14px;
}
.flash .tags { display: flex; gap: 6px; margin-bottom: 14px; }
.flash .q { font-size: 21px; font-weight: 650; line-height: 1.3; letter-spacing: -0.01em; }
.flash .a { margin-top: 18px; padding-top: 16px; border-top: 0.5px solid var(--line); font-size: 16px; line-height: 1.5; color: var(--text); }
.flash .a b { color: var(--accent); }
.conf { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.conf button { height: 52px; border-radius: 14px; border: 0; background: var(--surface); font-size: 19px; font-weight: 700; box-shadow: var(--shadow); }
.conf-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); margin: 6px 2px 0; }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grades button { border: 0; border-radius: 14px; padding: 10px 4px; font-size: 14px; font-weight: 600; min-height: 56px; }
.grades .again { background: var(--bad-soft); color: var(--bad); }
.grades .hard { background: var(--xp-soft); color: var(--xp); }
.grades .good { background: var(--good-soft); color: var(--good); }
.grades .easy { background: var(--accent-soft); color: var(--accent); }
.grades small { display: block; font-weight: 500; font-size: 11px; opacity: 0.8; margin-top: 2px; }
.progress-top { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.progress-top .bar { flex: 1; }
.progress-top span { font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }

.boxes { display: flex; align-items: flex-end; gap: 6px; height: 90px; margin-top: 10px; }
.boxes div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; font-size: 11px; color: var(--text-3); }
.boxes i { width: 100%; border-radius: 6px 6px 3px 3px; background: var(--accent-fill); min-height: 3px; opacity: 0.85; }

/* ---------- навыки ---------- */

.pips { display: flex; gap: 3px; }
.pips i { width: 14px; height: 6px; border-radius: 3px; background: var(--surface-2); }
.pips i.on { background: var(--accent-fill); }
.level-pick { display: grid; gap: 8px; }
.level-pick button {
  display: flex; gap: 12px; align-items: center; text-align: left; border: 0; border-radius: 14px;
  background: var(--surface-2); padding: 12px 14px;
}
.level-pick button.on { background: var(--accent-soft); outline: 2px solid var(--accent-fill); outline-offset: -2px; }
.level-pick .e { font-size: 22px; width: 28px; text-align: center; }
.level-pick .t { font-weight: 600; font-size: 15px; }
.level-pick .h { font-size: 13px; color: var(--text-2); }

/* ---------- профиль ---------- */

.profile-head { text-align: center; padding: 8px 0 16px; }
.avatar {
  width: 88px; height: 88px; border-radius: 28px; margin: 0 auto 10px; display: grid; place-items: center;
  font-size: 46px; background: linear-gradient(135deg, #00add8, #2b3a8f);
}
.profile-head h2 { margin: 0; font-size: 24px; }
.profile-head p { margin: 2px 0 0; color: var(--text-2); }
.loot-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.loot-common { background: var(--good); }
.loot-rare { background: var(--rare); }
.loot-epic { background: var(--epic); }
.loot-legendary { background: var(--legendary); }

.empty { text-align: center; color: var(--text-3); padding: 28px 16px; font-size: 15px; }

/* ---------- таб-бар ---------- */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--tabbar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar nav { max-width: 520px; margin: 0 auto; display: flex; }
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 0 5px; font-size: 10.5px; font-weight: 500; color: var(--text-3); position: relative;
}
.tabbar a svg { width: 26px; height: 26px; }
.tabbar a.on { color: var(--accent-fill); }
.tabbar .badge-n {
  position: absolute; top: 3px; left: calc(50% + 8px); background: #ff3b30; color: #fff;
  font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 5px; min-width: 18px; line-height: 18px; text-align: center;
}

/* ---------- шит и тост ---------- */

.backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); z-index: 40;
  display: flex; align-items: flex-end; justify-content: center; animation: fade 0.2s ease;
}
.sheet {
  width: 100%; max-width: 520px; background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(env(safe-area-inset-bottom) + 16px); animation: up 0.25s ease;
  max-height: 88dvh; overflow-y: auto;
}
.sheet .grab { width: 36px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet h2 { margin: 0 0 6px; font-size: 21px; }
.sheet p { color: var(--text-2); margin: 0 0 14px; }
.sheet .actions { display: grid; gap: 10px; margin-top: 16px; }
.sheet.celebrate { text-align: center; }
.sheet.celebrate .big { font-size: 64px; margin: 8px 0; animation: pop 0.5s ease; }

.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 12px); transform: translateX(-50%);
  z-index: 50; padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 16px;
  background: var(--surface); color: var(--xp); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  animation: toast 2.2s ease forwards; white-space: nowrap; pointer-events: none;
}
.toast.neg { color: var(--bad); }

@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop { 0% { transform: scale(0.4); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes toast {
  0% { opacity: 0; transform: translate(-50%, -12px); }
  12%, 80% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -12px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.mt8 { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.center { text-align: center; }

/* ---------- Claude ---------- */

.ai-result { margin-top: 14px; padding-top: 14px; border-top: 0.5px solid var(--line); }
.ai-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 17px; margin-bottom: 8px; }
.ai-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-2); margin: 14px 0 4px; }
.ai-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ai-table th { font-size: 12px; color: var(--text-3); font-weight: 600; text-align: left; padding: 4px 0; }
.ai-table td { padding: 6px 0; border-top: 0.5px solid var(--line); vertical-align: top; }
.ai-table .num { text-align: center; width: 52px; font-variant-numeric: tabular-nums; }
.ai-details { margin-top: 12px; border-radius: 12px; background: var(--surface-2); padding: 10px 14px; font-size: 15px; }
.ai-details summary { font-weight: 600; cursor: pointer; }
.ai-details div { margin-top: 8px; }
.ai-code, .bubble pre { background: #0d1117; color: #e6edf3; border-radius: 10px; padding: 10px 12px; overflow-x: auto; font-size: 12.5px; line-height: 1.45; margin: 8px 0; }
.ai-code code, .bubble pre code { background: none; padding: 0; color: inherit; white-space: pre; }
.code-input { font-family: var(--mono); font-size: 13px; min-height: 160px; white-space: pre; overflow-wrap: normal; overflow-x: auto; }

.chat { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.bubble { max-width: 88%; padding: 10px 14px; border-radius: 18px; font-size: 15.5px; line-height: 1.45; overflow-wrap: anywhere; }
.bubble.assistant { align-self: flex-start; background: var(--surface); box-shadow: var(--shadow); border-bottom-left-radius: 6px; }
.bubble.user { align-self: flex-end; background: var(--accent-fill); color: #fff; border-bottom-right-radius: 6px; }
.bubble.user code { background: rgba(255, 255, 255, 0.2); }
.typing { color: var(--text-3); }
.composer { position: sticky; bottom: calc(env(safe-area-inset-bottom) + 64px); background: var(--bg); padding: 8px 0 4px; display: grid; gap: 8px; z-index: 5; }
.composer textarea { min-height: 84px; }
