/* PinClass · «Графит». Minimal, chart-first, iPhone/iPad. */
:root {
  --bg: #F4F5F7; --surface: #FFFFFF; --border: #E2E5EA; --divider: #EEF0F3; --track: #EEF0F3;
  --text: #16191D; --muted: #59616C; --slate: #3A4A5C; --slate-mid: #5E7087; --slate-light: #A9B4C2;
  --slate-pale: #DDE2E8; --teal: #1F9E8A; --teal-text: #13705F; --teal-tint: #DFF3EE;
  --red: #D9583B; --red-text: #A23B1F; --red-tint: #FDECE7; --seg-bg: #E6E9EE; --chart-bg: #F7F8FA;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418; --surface: #1A1E24; --border: #2A3038; --divider: #242A31; --track: #262C34;
    --text: #E9ECF0; --muted: #9AA3AF; --slate: #C9D3DE; --slate-mid: #8FA1B6; --slate-light: #5F6E80;
    --slate-pale: #3A4452; --teal: #2BB39C; --teal-text: #5FD3BE; --teal-tint: #173A34;
    --red: #E2735A; --red-text: #F29A85; --red-tint: #3A231E; --seg-bg: #252B33; --chart-bg: #20252C;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: var(--teal-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }

.page { max-width: 1080px; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top)) 12px calc(96px + env(safe-area-inset-bottom)); }
.head { padding: 4px 4px 10px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.head h1 { font-size: 28px; line-height: 1.1; font-weight: 700; margin-top: 2px; }
.head .sub { font-size: 13px; color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; font-size: 16px; font-weight: 500; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--slate); flex-shrink: 0; }

.stack { display: flex; flex-direction: column; gap: 10px; }
.columns { display: grid; gap: 10px; }
@media (min-width: 860px) {
  .columns { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .page { padding-left: 24px; padding-right: 24px; }
}

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px;
  display: flex; flex-direction: column; gap: 10px; }
.card.flush { padding: 0; gap: 0; overflow: hidden; }
.card.flush > .card-title { padding: 12px 12px 6px; }
.card-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-title h2 { font-size: 15px; font-weight: 600; }
.card-title span, .note { font-size: 12px; color: var(--muted); }
.text { font-size: 15px; line-height: 1.45; }

.alert { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px;
  background: var(--red-tint); color: var(--red-text); font-size: 14px; font-weight: 600; }
.alert .dot, .dot { width: 8px; height: 8px; border-radius: 4px; background: var(--red); flex-shrink: 0; }
.ok { color: var(--teal-text); font-weight: 600; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.kpis.two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 8px;
  display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpis.two .kpi { padding: 12px; }
.kpi .v { font-size: 22px; font-weight: 700; color: var(--slate); line-height: 1; }
.kpis.two .kpi .v { font-size: 26px; }
.kpi .v small { font-size: 15px; color: var(--muted); font-weight: 500; }
.kpi .l { font-size: 12px; color: var(--muted); line-height: 1.25; }
.kpi .d { font-size: 11px; font-weight: 600; color: var(--muted); }
.v.red, .red-text { color: var(--red-text); }
.up { color: var(--teal-text); }

.track { height: 8px; border-radius: 3px; background: var(--track); overflow: hidden; }
.track > div { height: 100%; background: var(--slate); }
.track.teal > div { background: var(--teal); }
.track.red > div { background: var(--red); }
.track.mid > div { background: var(--slate-mid); }
.track.tall { height: 12px; }
.seg { display: flex; gap: 2px; height: 18px; border-radius: 3px; overflow: hidden; }
.seg > div { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; min-width: 0; overflow: hidden; }
.seg.thin { height: 5px; } .seg.mid { height: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.sw { width: 9px; height: 9px; border-radius: 2px; display: inline-block; flex-shrink: 0; }
.sw.dash { border: 1.5px dashed var(--muted); }

.bars-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) 72px; gap: 8px; align-items: center; font-size: 13px; }
.bars-row.wide { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.bars-row .val { text-align: right; color: var(--slate); }
.labeled { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; align-items: center; }
.labeled > span { font-size: 12px; color: var(--muted); }

.cols { display: grid; gap: 8px; align-items: end; }
.col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.col b { font-size: 11px; font-weight: 600; color: var(--slate); }
.col i { display: block; width: 100%; border-radius: 3px 3px 0 0; background: var(--slate); }
.col i.teal { background: var(--teal); } .col i.pale { background: var(--slate-pale); } .col i.mid { background: var(--slate-mid); }
.col-labels { display: grid; gap: 8px; text-align: center; font-size: 11px; color: var(--muted); }
.col-labels .today { color: var(--text); font-weight: 700; }

.list-row { display: grid; gap: 10px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--divider);
  color: var(--text); min-height: 44px; }
.list-row:hover { text-decoration: none; background: var(--chart-bg); }
.list-row .t { font-size: 14px; font-weight: 600; }
.list-row .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { color: var(--muted); }
.avatar { width: 36px; height: 36px; border-radius: 18px; background: var(--seg-bg); color: var(--slate);
  font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; padding: 0 7px;
  border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--divider); color: var(--muted); white-space: nowrap; }
.badge.red { background: var(--red-tint); color: var(--red-text); }
.badge.green { background: var(--teal-tint); color: var(--teal-text); }

.heat { display: grid; gap: 3px; }
.heat > span { height: 12px; border-radius: 2px; background: var(--divider); }
.heat > span.on { background: var(--red); }
.heat > span.on.done { background: var(--slate-light); }
.heat > span.empty { background: transparent; border: 1px dashed var(--divider); }
.steps { display: flex; gap: 3px; } .steps > span { width: 12px; height: 12px; border-radius: 2px; background: var(--border); }
.steps > span.on { background: var(--slate); }
.dots { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.dots > span { width: 26px; height: 26px; border-radius: 13px; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; }
.section-label { padding: 8px 12px 4px; border-top: 1px solid var(--divider); display: flex; justify-content: space-between;
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.topic-row { padding: 6px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto 50px; gap: 8px;
  align-items: center; font-size: 14px; min-height: 32px; }
.topic-row .when { text-align: right; font-size: 12px; color: var(--muted); }

.quote { font-size: 13px; color: var(--slate); font-style: italic; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.meta .ts { color: var(--teal-text); font-weight: 600; }
.item { padding: 10px 12px; border-top: 1px solid var(--divider); display: flex; flex-direction: column; gap: 6px; }
.item .top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.item .top b { font-size: 14px; font-weight: 600; line-height: 1.35; }
.mark-row { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 6px; font-size: 14px; line-height: 1.4; }
.mark-row b.plus { color: var(--teal-text); } .mark-row b.minus { color: var(--red-text); }
ol.plain { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.45; display: flex; flex-direction: column; gap: 3px; }

.timeline { position: relative; height: 56px; border-radius: 6px; background: var(--chart-bg); }
.timeline > i { position: absolute; height: 16px; border-radius: 4px; }
.timeline > i.stt { top: 8px; background: var(--slate-mid); } .timeline > i.llm { top: 32px; background: var(--teal); }
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.lane { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; align-items: center; }
.lane > span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane > span.rec { color: var(--text); font-weight: 600; }
.lane > div { position: relative; height: 18px; border-radius: 4px; background: var(--chart-bg); }
.lane > div > i { position: absolute; top: 0; height: 18px; border-radius: 4px; background: var(--slate-light); }
.lane > div > i.rec { background: var(--teal); }

.segmented { display: grid; padding: 3px; border-radius: 10px; background: var(--seg-bg); }
.segmented a { height: 36px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--muted);
  display: flex; align-items: center; justify-content: center; }
.segmented a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.segmented a:hover { text-decoration: none; }

form.choices { display: flex; flex-direction: column; gap: 6px; }
.choice { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--border); font-size: 14px; cursor: pointer; }
.choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--teal); }
.choice:has(input:checked) { border: 1.5px solid var(--teal); background: var(--teal-tint); }
.btn { height: 44px; border: 0; border-radius: 10px; background: var(--teal); color: #fff; font: inherit;
  font-size: 15px; font-weight: 600; cursor: pointer; padding: 0 16px; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field input { height: 48px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; font-size: 17px; padding: 0 12px; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.5; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); z-index: 10; }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px;
  color: var(--muted); font-size: 11px; font-weight: 500; }
.tabbar a.on { color: var(--teal-text); font-weight: 600; }
.tabbar a:hover { text-decoration: none; }
@media (min-width: 860px) { .tabbar { max-width: 520px; margin: 0 auto 12px; border: 1px solid var(--border); border-radius: 16px; } }
.login { max-width: 380px; margin: 12vh auto 0; padding: 0 16px; display: flex; flex-direction: column; gap: 14px; }
.login h1 { font-size: 28px; }
.error { color: var(--red-text); font-size: 14px; font-weight: 600; }
