@font-face { font-family: 'Geologica'; src: url('../fonts/geologica-cyrillic.woff2') format('woff2'); font-weight: 100 900; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; font-display: swap; }
@font-face { font-family: 'Geologica'; src: url('../fonts/geologica-latin.woff2') format('woff2'); font-weight: 100 900; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../fonts/jetbrains-mono-cyrillic.woff2') format('woff2'); font-weight: 100 800; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2'); font-weight: 100 800; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; font-display: swap; }

:root {
  --ink: #18181B; --muted: #A1A1AA; --accent: #D6336C; --ok: #15803D;
  --bg: #FAFAFA; --panel: #FFFFFF; --line: #E4E4E7; --text2: #52525B;
  --accent-soft: rgba(214, 51, 108, .08);
  --font: 'Geologica', system-ui, sans-serif; --mono: 'JetBrains Mono', ui-monospace, monospace;
  --menu-w: 248px;
}
html, body { height: 100%; }
body { font-family: var(--font); font-weight: 400; color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.55; }
a { color: var(--ink); text-decoration-color: var(--muted); text-underline-offset: 3px; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.mono { font-family: var(--mono); font-feature-settings: 'zero' 0; }
.muted { color: var(--text2); }
.faint { color: var(--muted); }
.label { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
h1, h2, h3, h4 { font-weight: 500; letter-spacing: -.01em; }
h1 { font-size: 26px; } h2 { font-size: 19px; } h3 { font-size: 16px; }

/* layout */
.app { display: flex; min-height: 100vh; }
.side { width: var(--menu-w); flex: none; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 22px 16px; position: sticky; top: 0; height: 100vh; }
.side .logo { padding: 0 8px 22px; display: block; }
.side .logo svg { width: 118px; height: auto; }
.nav-link-d { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 400; }
.nav-link-d svg { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-link-d:hover { background: var(--bg); color: var(--ink); }
.nav-link-d.active { color: var(--accent); background: var(--accent-soft); font-weight: 500; }
.nav-link-d.disabled { color: var(--muted); }
.side .spacer { flex: 1; }
.btn-accent { background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 500; text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-accent:hover { background: #b92a5c; color: #fff; }
.btn-accent svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.btn-line { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.btn-line:hover { border-color: var(--ink); color: var(--ink); }
.btn-line[disabled], .btn-line.disabled { color: var(--muted); pointer-events: none; }
.userbox { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; }
.userbox .email { word-break: break-all; color: var(--text2); }
.main { flex: 1; min-width: 0; }
.content { max-width: 1040px; margin: 0 auto; padding: 32px 28px 64px; }
.head { margin-bottom: 22px; }
.head p { color: var(--text2); max-width: 680px; margin: 6px 0 0; }
.tabs-d { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 18px 0 24px; overflow-x: auto; }
.tabs-d a { padding: 9px 14px; text-decoration: none; color: var(--text2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs-d a.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 500; }

/* cards */
.card-d { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 14px; }
.block-title { display: flex; align-items: baseline; justify-content: space-between; margin: 30px 0 12px; }
.block-title h2 { margin: 0; }
.badge-d { display: inline-block; font-family: var(--mono); font-size: 11px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--text2); white-space: nowrap; }
.badge-d.abn { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.badge-d.ok { color: var(--ok); border-color: #bbf7d0; background: #f0fdf4; }
.badge-d.none { color: var(--muted); }
.disclaimer { margin-top: 34px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--text2); font-size: 13px; }
.stage-note { background: var(--accent-soft); border: 1px dashed var(--accent); color: var(--accent); border-radius: 10px; padding: 8px 14px; font-size: 13px; margin-bottom: 18px; display: inline-block; }
.empty { text-align: center; padding: 56px 20px; }
.empty h2 { margin-bottom: 8px; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; text-decoration: none; color: var(--ink); display: block; }
.tile:hover { border-color: var(--ink); color: var(--ink); }
.tile .v { font-family: var(--mono); font-size: 24px; font-weight: 500; line-height: 1.2; }
.tile .v small { font-size: 12px; color: var(--muted); font-weight: 400; }
.tile.abn .v { color: var(--accent); }
.tile svg.spark { width: 100%; height: 24px; margin-top: 6px; }
.tile svg.spark polyline { fill: none; stroke: var(--muted); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.tile.abn svg.spark polyline { stroke: var(--accent); }

/* findings */
.finding { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.finding .t { font-weight: 500; }
.finding .gen { grid-column: 1 / -1; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 13.5px; }
.gen .tag { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; margin-right: 6px; }
details.fold > summary { cursor: pointer; list-style: none; color: var(--text2); }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: '+'; font-family: var(--mono); display: inline-block; width: 18px; color: var(--muted); }
details.fold[open] > summary::before { content: '−'; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 16px; }
.kv dt { color: var(--muted); font-weight: 400; font-size: 13px; padding-top: 2px; }
.kv dd { margin: 0; }
.dx { display: flex; gap: 10px; padding: 4px 0; font-size: 14px; }
.dx .code { font-family: var(--mono); color: var(--accent); width: 56px; flex: none; }

/* indicators table */
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pill { padding: 5px 13px; border: 1px solid var(--line); border-radius: 99px; text-decoration: none; color: var(--text2); background: var(--panel); font-size: 13.5px; }
.pill.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill:hover { color: var(--ink); border-color: var(--ink); }
.pill.active:hover { color: #fff; }
.tbl-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
table.ind { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
table.ind th, table.ind td { padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: right; vertical-align: top; }
table.ind th { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--text2); background: var(--bg); }
table.ind td.name, table.ind th.name { position: sticky; left: 0; background: var(--panel); text-align: left; min-width: 190px; max-width: 260px; white-space: normal; z-index: 1; border-right: 1px solid var(--line); }
table.ind th.name { background: var(--bg); }
table.ind td.ref { text-align: left; font-family: var(--mono); font-size: 12.5px; color: var(--text2); min-width: 110px; }
table.ind td.val { font-family: var(--mono); }
table.ind td.val.abn { color: var(--accent); font-weight: 500; }
table.ind td.val .u { font-size: 11px; color: var(--muted); }
table.ind tr.ind-row { cursor: pointer; }
table.ind tr.ind-row:hover td { background: #fcfcfd; }
table.ind tr.ind-row:hover td.name { background: #fcfcfd; }
table.ind tr.hl td, table.ind tr.hl td.name { background: var(--accent-soft); }
table.ind tr.chart-row td { white-space: normal; text-align: left; background: var(--panel); }
table.ind .col-hidden { display: none; }
.trend { font-family: var(--mono); }
.trend.up, .trend.down { color: var(--text2); }
.noref { font-size: 11.5px; color: var(--muted); font-family: var(--font); }
.chart-box { position: relative; height: 240px; }
.chart-note { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.toggle-abn { margin-left: auto; font-size: 13.5px; }

/* timeline */
.year { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.year > summary { padding: 14px 18px; cursor: pointer; font-weight: 500; display: flex; justify-content: space-between; list-style: none; }
.year > summary::-webkit-details-marker { display: none; }
.event { display: grid; grid-template-columns: 96px 22px 1fr; gap: 10px; padding: 9px 18px; border-top: 1px solid var(--line); align-items: baseline; }
.event .date { font-family: var(--mono); font-size: 13px; color: var(--text2); }
.event .ico svg { width: 16px; height: 16px; stroke: var(--text2); fill: none; stroke-width: 1.7; vertical-align: -3px; }
.event .det { color: var(--text2); font-size: 13.5px; }
.event a { text-decoration: none; font-weight: 500; }

/* genetics */
.cat-head { display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; align-items: center; }
.scale { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text2); }
.scale .bars { display: inline-flex; gap: 2px; }
.scale .bars i { width: 14px; height: 6px; border-radius: 2px; background: var(--line); display: block; }
.scale .bars i.on { background: var(--accent); }
.scale .bars.ev i.on { background: var(--ink); }
.scales { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.marker { padding: 10px 0; border-top: 1px solid var(--line); }
.marker .g { font-family: var(--mono); font-weight: 500; }
.gt { font-family: var(--mono); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; font-size: 13px; }
.review { color: var(--accent); font-size: 13px; }
.tech { font-size: 13px; color: var(--text2); margin-top: 6px; }
.tech span { font-family: var(--mono); }

/* chat stub */
.chat-win { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; height: calc(100vh - 300px); min-height: 360px; overflow-y: auto; padding: 20px; }
.msg { max-width: 640px; margin-bottom: 16px; }
.msg.dana .who { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: .08em; text-transform: uppercase; }
.msg .sources { font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
.rate { display: inline-flex; gap: 6px; margin-top: 4px; }
.rate span { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.rate svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.suggest span { padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 13.5px; }
.chat-input { display: flex; gap: 8px; }
.dropzone { border: 1.5px dashed var(--line); border-radius: 14px; padding: 56px 20px; text-align: center; color: var(--muted); background: var(--panel); }

/* auth */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .logo svg { width: 190px; height: auto; }
.slogan { color: var(--text2); margin: 14px 0 28px; }
.form-control { border-radius: 10px; border-color: var(--line); padding: 10px 12px; font-family: var(--font); }
.form-control:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(24, 24, 27, .08); }
.form-label { font-size: 13px; color: var(--text2); }
.errorlist { color: var(--accent); list-style: none; padding: 0; margin: 4px 0; font-size: 13px; }

.tabbar, .fab { display: none; }
.print-only { display: none; }

@media (max-width: 719px) {
  .side { display: none; }
  .app { display: block; }
  .content { padding: 20px 16px 110px; }
  h1 { font-size: 22px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--panel); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; text-decoration: none; color: var(--muted); font-size: 11px; }
  .tabbar a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a.active { color: var(--accent); }
  .fab { display: flex; position: fixed; right: 16px; bottom: 76px; z-index: 21; width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #fff; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(214, 51, 108, .35); text-decoration: none; }
  .fab svg { width: 24px; height: 24px; stroke: #fff; fill: none; stroke-width: 1.8; stroke-linecap: round; }
  .mobile-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  .mobile-head svg { width: 88px; height: auto; }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dd { margin-bottom: 8px; }
  .event { grid-template-columns: 82px 18px 1fr; padding: 9px 12px; }
  .cat-head { grid-template-columns: 1fr; }
  .scales { align-items: flex-start; }
  .chat-win { height: calc(100vh - 360px); }
}
@media (min-width: 720px) { .mobile-head { display: none; } }

@media print {
  .side, .tabbar, .fab, .tabs-d, .no-print, .mobile-head { display: none !important; }
  .app { display: block; }
  .content { max-width: none; padding: 0; }
  body { background: #fff; }
  .card-d { break-inside: avoid; }
  details.cat > *:not(summary) { display: block !important; }
  .print-only { display: block; }
}
