/* DÖGEM Hazırlık — mobil öncelikli arayüz */
:root {
  --bg: #f4f6f8;
  --bg2: #ffffff;
  --card: #ffffff;
  --ink: #0f172a;
  --ink2: #475569;
  --ink3: #94a3b8;
  --line: #e2e8f0;
  --pri: #0f766e;
  --pri2: #14b8a6;
  --pri-soft: #ccfbf1;
  --acc: #f59e0b;
  --ok: #16a34a;
  --ok-soft: #dcfce7;
  --bad: #dc2626;
  --bad-soft: #fee2e2;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --info: #2563eb;
  --info-soft: #dbeafe;
  --why: #7c3aed;
  --why-soft: #ede9fe;
  --code-bg: #f1f5f9;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
  --r: 16px;
  --nav-h: 64px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --reader: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --bg2: #0f172a; --card: #111a2e; --ink: #e2e8f0; --ink2: #a5b4c8; --ink3: #64748b;
    --line: #1e293b; --pri: #2dd4bf; --pri2: #14b8a6; --pri-soft: #0f3a37; --ok: #4ade80; --ok-soft: #12321f;
    --bad: #f87171; --bad-soft: #3b1515; --warn: #fbbf24; --warn-soft: #3a2a08; --info: #60a5fa; --info-soft: #132a4a;
    --why: #a78bfa; --why-soft: #2a1f4a; --code-bg: #0b1324; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220; --bg2: #0f172a; --card: #111a2e; --ink: #e2e8f0; --ink2: #a5b4c8; --ink3: #64748b;
  --line: #1e293b; --pri: #2dd4bf; --pri2: #14b8a6; --pri-soft: #0f3a37; --ok: #4ade80; --ok-soft: #12321f;
  --bad: #f87171; --bad-soft: #3b1515; --warn: #fbbf24; --warn-soft: #3a2a08; --info: #60a5fa; --info-soft: #132a4a;
  --why: #a78bfa; --why-soft: #2a1f4a; --code-bg: #0b1324; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); background: var(--bg); color: var(--ink);
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--pri); text-decoration: none; }
button { font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: var(--ink); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--pri); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Yerleşim ---------- */
.shell { min-height: 100vh; }
.side { display: none; }
.main { padding: 0 16px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); max-width: 980px; margin: 0 auto; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; margin: 0 -16px 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar h1 { font-size: 18px; margin: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  display: inline-grid; place-items: center; cursor: pointer; flex: none; font-size: 18px;
}
.icon-btn:active { transform: scale(.96); }

.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: var(--bg2); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink3); font-size: 11px; font-weight: 600;
}
.bottomnav a .ico { font-size: 21px; line-height: 1; filter: grayscale(1); opacity: .8; }
.bottomnav a.on { color: var(--pri); }
.bottomnav a.on .ico { filter: none; opacity: 1; }

@media (min-width: 960px) {
  .side {
    display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; width: 248px;
    background: var(--bg2); border-right: 1px solid var(--line); padding: 20px 14px; overflow-y: auto;
  }
  .bottomnav { display: none; }
  .main { margin-left: 248px; padding: 0 32px 48px; max-width: 1080px; }
  .topbar { margin: 0 -32px 12px; padding: 16px 32px; }
  .side .brand { display: flex; gap: 10px; align-items: center; font-weight: 800; font-size: 17px; margin: 0 6px 18px; }
  .side .brand img { width: 34px; height: 34px; }
  .side nav a {
    display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px; color: var(--ink2);
    font-weight: 600; font-size: 14px; margin-bottom: 2px;
  }
  .side nav a:hover { background: var(--bg); }
  .side nav a.on { background: var(--pri-soft); color: var(--pri); }
  .side nav .sep { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink3); margin: 14px 12px 6px; font-weight: 700; }
  .side .foot { margin-top: auto; font-size: 12px; color: var(--ink3); padding: 8px 12px; }
}

/* ---------- Bileşenler ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: 1fr 1fr; }
@media (min-width: 700px) { .grid.three { grid-template-columns: repeat(3, 1fr); } .grid.md-two { grid-template-columns: 1fr 1fr; } .grid.four { grid-template-columns: repeat(4, 1fr); } }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 2px 10px; }
.section-title h2 { font-size: 16px; margin: 0; }
.section-title a { font-size: 13px; font-weight: 600; }
.muted { color: var(--ink2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.mt { margin-top: 12px; } .mt2 { margin-top: 20px; } .mb { margin-bottom: 12px; }
.hidden { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); font-weight: 650; cursor: pointer; font-size: 14.5px; min-height: 44px;
  transition: transform .06s, background .15s;
}
.btn:active { transform: scale(.98); }
.btn.pri { background: var(--pri); border-color: var(--pri); color: #fff; }
:root[data-theme="dark"] .btn.pri { color: #042f2e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.pri { color: #042f2e; } }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 12px; min-height: 36px; font-size: 13px; border-radius: 10px; }
.btn.ai { background: linear-gradient(135deg, #7c3aed, #2563eb); color: #fff; border: 0; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); font-size: 13px; font-weight: 600; cursor: pointer; user-select: none; white-space: nowrap;
}
.chip.on { background: var(--pri-soft); border-color: var(--pri); color: var(--pri); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--bg); color: var(--ink2); border: 1px solid var(--line); white-space: nowrap; }
.badge.l1 { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.l2 { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.l3 { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.pri { background: var(--pri-soft); color: var(--pri); border-color: transparent; }
.badge.why { background: var(--why-soft); color: var(--why); border-color: transparent; }

.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--pri), var(--pri2)); border-radius: 99px; transition: width .4s; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 650; margin-bottom: 6px; color: var(--ink2); }
.input, textarea.input, select.input {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); outline: none; min-height: 46px;
}
.input:focus { border-color: var(--pri); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pri) 20%, transparent); }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
.alert { padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.alert.err { background: var(--bad-soft); color: var(--bad); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.info { background: var(--info-soft); color: var(--info); }

/* ---------- Giriş ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--pri) 25%, transparent), transparent),
  radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, #7c3aed 20%, transparent), transparent), var(--bg); }
.login-card { width: 100%; max-width: 400px; }
.login-card .logo { width: 64px; height: 64px; margin: 0 auto 12px; display: block; }
.login-card h1 { text-align: center; font-size: 24px; margin-bottom: 4px; }
.login-card p.sub { text-align: center; color: var(--ink2); margin: 0 0 22px; }

/* ---------- Ana sayfa ---------- */
.hero {
  background: linear-gradient(135deg, #0f766e, #115e59 55%, #1e3a8a); color: #fff; border-radius: 20px; padding: 20px; position: relative; overflow: hidden;
}
.hero h2 { font-size: 21px; margin-bottom: 4px; }
.hero p { margin: 0; opacity: .9; font-size: 14px; }
.hero .stats { display: flex; gap: 18px; margin-top: 16px; flex-wrap: wrap; }
.hero .stats b { display: block; font-size: 22px; }
.hero .stats span { font-size: 12px; opacity: .85; }
.hero .ring { position: absolute; right: -30px; top: -30px; width: 150px; height: 150px; border-radius: 50%; border: 22px solid rgba(255,255,255,.08); }
.tile {
  display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r); background: var(--card);
  border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); cursor: pointer; text-align: left; width: 100%;
}
.tile .ti { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; flex: none; background: var(--pri-soft); }
.tile b { display: block; font-size: 14.5px; }
.tile small { color: var(--ink2); font-size: 12.5px; display: block; line-height: 1.35; }
.tile:active { transform: scale(.99); }
.kpi { text-align: center; padding: 14px 8px; }
.kpi b { display: block; font-size: 22px; }
.kpi span { font-size: 12px; color: var(--ink2); }

/* ---------- Konu listesi ---------- */
.topic {
  display: flex; gap: 12px; align-items: center; padding: 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow); color: var(--ink); margin-bottom: 10px;
}
.topic .num { width: 42px; height: 42px; border-radius: 12px; background: var(--pri-soft); color: var(--pri); display: grid; place-items: center; font-weight: 800; flex: none; font-size: 15px; }
.topic h3 { font-size: 15px; margin: 0 0 2px; }
.topic p { margin: 0; font-size: 12.5px; color: var(--ink2); }
.topic .progress { margin-top: 8px; height: 5px; }

.tabs { display: flex; gap: 4px; background: var(--bg2); border: 1px solid var(--line); padding: 4px; border-radius: 14px; overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px 12px; border-radius: 10px; font-weight: 650; font-size: 13.5px; color: var(--ink2); cursor: pointer; white-space: nowrap; }
.tabs button.on { background: var(--pri); color: #fff; }
:root[data-theme="dark"] .tabs button.on { color: #042f2e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tabs button.on { color: #042f2e; } }

/* ---------- Okuma (markdown) ---------- */
.md { font-size: var(--reader); line-height: 1.7; overflow-wrap: anywhere; }
.md h1 { font-size: 1.45em; margin-top: .2em; }
.md h2 { font-size: 1.25em; margin-top: 1.4em; padding-bottom: .3em; border-bottom: 1px solid var(--line); }
.md h3 { font-size: 1.08em; margin-top: 1.3em; }
.md h4 { font-size: 1em; margin-top: 1.2em; }
.md p { margin: .7em 0; }
.md ul, .md ol { padding-left: 1.35em; margin: .6em 0; }
.md li { margin: .3em 0; }
.md code { font-family: var(--mono); font-size: .86em; background: var(--code-bg); padding: .12em .38em; border-radius: 6px; border: 1px solid var(--line); overflow-wrap: anywhere; }
.md pre { background: var(--code-bg); border: 1px solid var(--line); padding: 12px 14px; border-radius: 12px; overflow-x: auto; font-size: 12.5px; line-height: 1.45; }
.md pre code { background: none; border: 0; padding: 0; font-size: inherit; overflow-wrap: normal; white-space: pre; }
.md .tbl { overflow-x: auto; margin: .8em 0; border: 1px solid var(--line); border-radius: 12px; }
.md table { border-collapse: collapse; width: 100%; font-size: .9em; }
.md th, .md td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; min-width: 90px; }
.md th { background: var(--bg); font-weight: 700; }
.md tr:last-child td { border-bottom: 0; }
.md blockquote { margin: .8em 0; padding: 10px 14px; border-left: 4px solid var(--pri); background: var(--pri-soft); border-radius: 0 12px 12px 0; color: var(--ink); }
.md blockquote p { margin: .3em 0; }
.md hr { border: 0; border-top: 1px dashed var(--line); margin: 1.5em 0; }
.md .co { padding: 10px 14px; border-radius: 12px; margin: .8em 0; border: 1px solid transparent; }
.md .co.why { background: var(--why-soft); border-color: color-mix(in srgb, var(--why) 30%, transparent); }
.md .co.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.md .co.ok { background: var(--ok-soft); }
.md .co.doc { background: var(--info-soft); }
.md .co > p:first-child { margin-top: 0; } .md .co > p:last-child { margin-bottom: 0; }
.md li.why-li { background: var(--why-soft); border-radius: 8px; padding: 2px 8px; margin-left: -8px; list-style-position: inside; }
.md li.warn-li { background: var(--warn-soft); border-radius: 8px; padding: 2px 8px; margin-left: -8px; list-style-position: inside; }
.md li.task { list-style: none; margin-left: -1.2em; }
.md mark { background: color-mix(in srgb, var(--acc) 40%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }

.reader-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.step-nav { display: flex; gap: 10px; margin-top: 18px; }
.step-nav .btn { flex: 1; }
.sec-list a { display: flex; gap: 10px; align-items: center; padding: 11px 12px; border-radius: 12px; color: var(--ink); border: 1px solid var(--line); background: var(--card); margin-bottom: 8px; }
.sec-list a .dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 12px; flex: none; color: transparent; }
.sec-list a.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.sec-list a span.t { flex: 1; font-size: 14px; font-weight: 600; }

.keypoints li { margin: 6px 0; }
.summary-box { border-left: 4px solid var(--pri); }

/* ---------- Test ---------- */
.q-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.q-head .progress { flex: 1; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; padding: 4px 10px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); }
.timer.low { color: var(--bad); border-color: var(--bad); }
.q-text { font-size: 17px; font-weight: 650; line-height: 1.5; margin: 6px 0 16px; }
.q-text code { font-family: var(--mono); font-size: .85em; background: var(--code-bg); padding: .1em .35em; border-radius: 6px; }
.opt {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; padding: 14px; margin-bottom: 10px;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); cursor: pointer; font-size: 15px; line-height: 1.45;
}
.opt .k { width: 28px; height: 28px; flex: none; border-radius: 8px; background: var(--bg); display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--ink2); }
.opt code { font-family: var(--mono); font-size: .85em; background: var(--code-bg); padding: .1em .35em; border-radius: 6px; }
.opt:hover { border-color: color-mix(in srgb, var(--pri) 50%, var(--line)); }
.opt.sel { border-color: var(--pri); background: var(--pri-soft); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.right .k { background: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .k { background: var(--bad); color: #fff; }
.opt[disabled] { cursor: default; }
.explain { margin-top: 6px; border-radius: 14px; padding: 14px; background: var(--why-soft); border: 1px solid color-mix(in srgb, var(--why) 30%, transparent); }
.explain h4 { margin: 0 0 6px; font-size: 14px; color: var(--why); }
.explain p { margin: 0; }
.q-foot { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px); display: flex; gap: 10px; margin-top: 16px; }
@media (min-width: 960px) { .q-foot { bottom: 12px; } }
.q-foot .btn { flex: 1; box-shadow: var(--shadow); }
.qdots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.qdots button { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); font-size: 12px; font-weight: 700; cursor: pointer; }
.qdots button.ans { background: var(--pri-soft); border-color: var(--pri); }
.qdots button.cur { outline: 2px solid var(--pri); }
.qdots button.right { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.qdots button.wrong { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.score-ring { width: 150px; height: 150px; border-radius: 50%; margin: 6px auto 14px; display: grid; place-items: center; position: relative; }
.score-ring b { font-size: 36px; }
.score-ring span { display: block; font-size: 12px; color: var(--ink2); text-align: center; }
.pkg { padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); cursor: pointer; text-align: left; width: 100%; }
.pkg b { display: block; font-size: 14px; margin: 6px 0 2px; }
.pkg small { color: var(--ink2); font-size: 12px; }
.pkg .best { font-size: 12px; font-weight: 700; margin-top: 6px; }

/* ---------- Kartlar ---------- */
.flash { perspective: 1200px; height: 340px; margin: 6px 0 14px; cursor: pointer; }
.flash .in { position: relative; width: 100%; height: 100%; transition: transform .45s; transform-style: preserve-3d; }
.flash.flip .in { transform: rotateY(180deg); }
.flash .face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 20px; padding: 22px;
  display: flex; flex-direction: column; justify-content: center; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); overflow-y: auto;
}
.flash .face.back { transform: rotateY(180deg); background: linear-gradient(160deg, var(--pri-soft), var(--card)); }
.flash .face .lbl { position: absolute; top: 14px; left: 18px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink3); }
.flash .face .txt { font-size: 18px; font-weight: 650; text-align: center; }
.flash .face.back .txt { font-size: 15.5px; font-weight: 500; text-align: left; line-height: 1.6; }
.flash .face .txt code { font-family: var(--mono); font-size: .85em; background: var(--code-bg); padding: .1em .35em; border-radius: 6px; }
.rate { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

/* ---------- Prova ---------- */
.qa-q { font-size: 17px; font-weight: 700; line-height: 1.45; }
.qa-ans { border-left: 4px solid var(--ok); }
.qa-why { border-left: 4px solid var(--why); }

/* ---------- Sohbet / sheet ---------- */
.sheet-back { position: fixed; inset: 0; background: rgba(2, 6, 23, .5); z-index: 60; animation: fade .2s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; background: var(--bg2); border-radius: 22px 22px 0 0;
  max-height: 92vh; height: 92vh; display: flex; flex-direction: column; animation: up .25s ease-out; box-shadow: 0 -10px 40px rgba(0,0,0,.2);
}
@media (min-width: 960px) { .sheet { left: auto; right: 24px; bottom: 24px; top: 24px; width: 520px; height: auto; max-height: none; border-radius: 22px; } }
.sheet .grab { width: 44px; height: 5px; background: var(--line); border-radius: 9px; margin: 8px auto 0; }
.sheet .sh-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px 12px; border-bottom: 1px solid var(--line); }
.sheet .sh-head h3 { margin: 0; font-size: 16px; flex: 1; }
.sheet .sh-body { flex: 1; overflow-y: auto; padding: 14px 16px; }
.sheet .sh-foot { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: flex-end; }
.sheet .sh-foot textarea { flex: 1; min-height: 46px; max-height: 140px; resize: none; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.msg { margin-bottom: 12px; display: flex; }
.msg .b { max-width: 92%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; }
.msg.user { justify-content: flex-end; }
.msg.user .b { background: var(--pri); color: #fff; border-bottom-right-radius: 6px; white-space: pre-wrap; }
:root[data-theme="dark"] .msg.user .b { color: #042f2e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .msg.user .b { color: #042f2e; } }
.msg.model .b { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg.model .b.md { font-size: 14.5px; }
.msg.err .b { background: var(--bad-soft); color: var(--bad); }
.ctx-box { font-size: 12.5px; color: var(--ink2); background: var(--bg); border: 1px dashed var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 12px; max-height: 90px; overflow: hidden; }
.typing span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ink3); margin-right: 4px; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); z-index: 80; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); animation: up .2s; max-width: 90vw; }

.list-item { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 8px; }
.bar-chart div { flex: 1; background: linear-gradient(180deg, var(--pri2), var(--pri)); border-radius: 6px 6px 2px 2px; min-height: 3px; position: relative; }
.hbar { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 13px; }
.hbar .lbl { width: 150px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .progress { flex: 1; }
.hbar .v { width: 42px; text-align: right; font-weight: 700; }
@media (max-width: 500px) { .hbar .lbl { width: 96px; } }
.stage { position: relative; padding-left: 38px; padding-bottom: 18px; }
.stage::before { content: ""; position: absolute; left: 15px; top: 34px; bottom: 0; width: 2px; background: var(--line); }
.stage:last-child::before { display: none; }
.stage .sn { position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--line); font-weight: 800; color: var(--ink2); }
.stage.done .sn { background: var(--ok); color: #fff; }
.stage.cur .sn { background: var(--pri); color: #fff; }
.task { display: flex; gap: 10px; align-items: center; padding: 8px 0; font-size: 14px; border-bottom: 1px dashed var(--line); }
.task:last-child { border-bottom: 0; }
.task .ck { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; font-size: 12px; color: transparent; }
.task.done .ck { background: var(--ok); border-color: var(--ok); color: #fff; }
.task.done .tt { color: var(--ink2); text-decoration: line-through; }
.check-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; align-items: flex-start; }
.check-item .ck { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; color: transparent; font-size: 13px; margin-top: 1px; }
.check-item.done .ck { background: var(--ok); border-color: var(--ok); color: #fff; }
.empty { text-align: center; padding: 36px 16px; color: var(--ink2); }
.empty .e { font-size: 42px; margin-bottom: 6px; }
.search-hit { padding: 12px 0; border-bottom: 1px solid var(--line); display: block; color: var(--ink); }
.search-hit b { display: block; font-size: 14.5px; }
.search-hit p { margin: 4px 0 0; font-size: 13px; color: var(--ink2); }
.kbd { font-family: var(--mono); font-size: 12px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
