:root { --ink: #1d1d1f; --muted: #6e6e73; --line: #e2e2e6; --bg: #f6f6f8; --accent: #2457d6; --bad: #b42318; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
.bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { font-weight: 600; }
nav { display: flex; gap: 18px; align-items: center; }
nav a, .link { color: var(--accent); text-decoration: none; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.link { margin: 0; }
main { max-width: 880px; margin: 24px auto; padding: 0 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 20px 24px; margin-bottom: 16px; }
.narrow { max-width: 420px; margin: 48px auto; }
h1 { font-size: 22px; margin: 0 0 8px; }
h2 { font-size: 17px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.flash { background: #eef4ff; border: 1px solid #c9d8ff; padding: 10px 14px; border-radius: 8px; }
.error { color: var(--bad); }
label { display: block; margin: 12px 0; font-weight: 500; }
input, select { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
input[type=file] { border: 0; padding: 0; }
button { background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: 9px 16px; font: inherit; cursor: pointer; margin-top: 8px; }
form.inline { display: inline; }
.upload { display: flex; gap: 12px; align-items: center; }
.upload input[type=file] { width: auto; margin: 0; }
.upload button { margin: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
th { font-weight: 600; color: var(--muted); font-size: 13px; }
.num { text-align: right; }
nav a.on { font-weight: 600; text-decoration: underline; }
.subnav { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 14px; }
.subnav a { color: var(--accent); text-decoration: none; }
.subnav a.on { font-weight: 600; text-decoration: underline; }
.row-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.small { font-size: 13px; }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: #eef0f3; color: var(--muted); margin-left: 4px; }
.badge.good { background: #e6f4ea; color: #1e7b34; }
.badge.warn { background: #fff4e0; color: #9a5b00; }
.badge.bad { background: #fdecea; color: var(--bad); }
.warnline { background: #fff8eb; border: 1px solid #f5dfb3; padding: 8px 12px; border-radius: 8px; }
a.button { display: inline-block; background: var(--accent); color: #fff; border-radius: 6px; padding: 8px 14px; text-decoration: none; }
button.secondary { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
button.small { padding: 4px 10px; font-size: 13px; margin-top: 0; }
button.danger, .danger { color: var(--bad); }
textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
code { background: #f1f1f4; padding: 1px 5px; border-radius: 4px; font-size: 13px; word-break: break-all; }
.tasks { list-style: decimal; padding-left: 22px; margin: 0; }
.task { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.task::marker { color: var(--muted); }
.task.done .task-title { color: var(--muted); text-decoration: line-through; }
.task-main { flex: 1; }
.task-title { font-weight: 500; }
.task-actions { display: flex; gap: 8px; align-items: center; }
.small-file { width: 180px; font-size: 12px; }
.staff { color: #3a4a8a; margin-top: 2px; }
.check { width: 24px; font-size: 18px; color: #1e7b34; }
.facts td { vertical-align: top; }
.facts .field { width: 150px; color: var(--muted); }
.facts .actions { width: 260px; }
.fact.pending { background: #fffbf2; }
.source { margin-top: 4px; color: #444; }
mark { background: #ffe58a; padding: 0 2px; }
.correct { display: flex; gap: 6px; margin-top: 6px; }
.correct input { margin: 0; padding: 4px 8px; font-size: 13px; }
.preview { width: 100%; height: 520px; border: 1px solid var(--line); border-radius: 6px; }
.preview-img { max-width: 100%; border: 1px solid var(--line); border-radius: 6px; }
.narrow-wide { max-width: 620px; }
.delete { margin: 8px 0 24px; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.grid4 label { margin: 0; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.slot { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.slot.low { border-color: #e9b44c; background: #fff8eb; }
.slot.off { opacity: .45; }
.chart { width: 100%; height: auto; }
.chart .bar { fill: var(--accent); opacity: .85; }
.chart .axis { font-size: 11px; fill: var(--muted); }
.chart .baseline { stroke: var(--line); }
.chat { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 78%; padding: 8px 12px; border-radius: 12px; background: #eef0f3; align-self: flex-start; }
.bubble.out { background: #e7f6e9; align-self: flex-end; }
.bubble .text { white-space: pre-wrap; }
.bubble .meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.lcard { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-top: 6px; }
.ltitle { font-weight: 600; margin-bottom: 2px; }
.lcard form { margin-top: 6px; }
@media (max-width: 700px) {
  .bar { flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px 14px; }
  nav { flex-wrap: wrap; gap: 10px 14px; }
  main { margin: 12px auto; padding: 0 8px; }
  .card { padding: 14px 14px; }
  .task { flex-direction: column; }
  .task-actions { flex-wrap: wrap; }
  .facts .field, .facts .actions { width: auto; }
  .facts tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .facts td { display: block; border: 0; padding: 2px 0; }
  .upload { flex-wrap: wrap; }
  .bubble { max-width: 95%; }
  table { font-size: 13px; }
}
.question { background: #f4f6fb; border-radius: 8px; padding: 10px 14px; margin: 0 0 12px; white-space: pre-wrap; }
.answer { margin: 0 0 18px; }
.answer p { margin: 0 0 10px; }
.answer h3 { font-size: 15px; margin: 14px 0 6px; }
.answer ul, .answer ol { margin: 0 0 10px; padding-left: 22px; }
.answer table { margin: 0 0 10px; font-size: 14px; }
.scroll { overflow-x: auto; }
.sources { font-size: 13px; color: var(--muted); margin: -8px 0 18px; }
.sources a { color: var(--accent); }
.thinking { color: var(--muted); font-style: italic; }
