/* Дизайн B «Приборная панель» (docs/design-b). Шрифты IBM Plex лежат на нашем сервере (лицензия OFL). */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url(/static/fonts/plex/ibm-plex-sans-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url(/static/fonts/plex/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); 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-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url(/static/fonts/plex/ibm-plex-sans-cyrillic-500-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url(/static/fonts/plex/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); 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-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url(/static/fonts/plex/ibm-plex-sans-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url(/static/fonts/plex/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); 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-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url(/static/fonts/plex/ibm-plex-mono-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url(/static/fonts/plex/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); 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-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url(/static/fonts/plex/ibm-plex-mono-cyrillic-500-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url(/static/fonts/plex/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); 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; }

:root {
  --bg: #eef0f4; --surface: #ffffff; --text: #0e1320; --muted: #566075; --line: #d5d9e2;
  --accent: #2437e0; --accent-text: #ffffff; --soft: #e4e8ff;
  --danger: #c92a2a; --notice-bg: #fff4e0; --error-bg: #fde8e8;
  --map-bg: #e9edf2; --map-water: #c9d9ea; --map-park: #d6e6d9; --map-road: #ffffff;
  --route: #2437e0; --start: #2b8a3e; --finish: #c92a2a;
  --chart-ele: #6b7587; --chart-speed: #0e7fb4; --chart-hr: #c0267a; --chart-cad: #8a6d00; --chart-power: #6d4fd1;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-num: "IBM Plex Mono", ui-monospace, monospace;
  --r-card: 6px; --r-chip: 3px; --tap: 44px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0d14; --surface: #121722; --text: #e9ecf5; --muted: #98a2ba; --line: #232b3b;
    --accent: #8da2ff; --accent-text: #0a0d14; --soft: #1a2140;
    --danger: #ff6b6b; --notice-bg: #3a2e16; --error-bg: #3d1f1f;
    --map-bg: #141b27; --map-water: #12283a; --map-park: #16291f; --map-road: #232d40;
    --route: #8da2ff; --start: #69db7c; --finish: #ff8787;
    --chart-ele: #9aa5ba; --chart-speed: #5cc0ee; --chart-hr: #f08ac4; --chart-cad: #e3c04a; --chart-power: #b7a3ff;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); font-variant-numeric: tabular-nums; }
a { color: var(--accent); }
h1 { font-size: 34px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin: 0.2em 0 0.4em; }
h2 { font-size: 11px; font-weight: 500; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); margin: 1.4em 0 0.6em; }
main { max-width: 1200px; margin: 0 auto; padding: 20px 24px; }
footer { max-width: 1200px; margin: 0 auto; padding: 8px 24px 24px; color: var(--muted); font-size: 0.8rem; }
.top { display: flex; align-items: center; gap: 28px; padding: 0 24px; min-height: 60px; background: var(--surface); border-bottom: 1px solid var(--line); border-top: 3px solid var(--accent); }
.top .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; color: var(--text); text-decoration: none; min-height: var(--tap); }
.top .mark { width: 28px; height: 28px; border-radius: var(--r-card); background: var(--accent); display: grid; place-items: center; flex: none; }
.top .mark svg { display: block; stroke: var(--accent-text); }
.top nav { flex: 1; display: flex; gap: 0; align-self: stretch; }
.top nav a { display: inline-flex; align-items: center; padding: 0 16px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14px; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.top nav a:hover { color: var(--text); }
.top nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.top form { margin: 0; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.muted { color: var(--muted); }
.error { background: var(--error-bg); border-radius: 8px; padding: 10px 12px; }
.notice { background: var(--notice-bg); border-radius: 8px; padding: 10px 12px; font-size: 0.92rem; }
.card, .stats > div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.label { color: var(--muted); font-size: 0.82rem; }
.big { font-size: 1.35rem; font-weight: 650; }
.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 8px 0 16px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0; }
.upload { background: var(--surface); border: 2px dashed var(--line); border-radius: 10px; padding: 12px 16px; margin: 0 0 16px; }
.upload.drag { border-color: var(--accent); }
.upload p { margin: 0 0 8px; }
.upload input[type=file] { min-width: 0; width: 100%; }
.upload-log { list-style: none; padding: 0; margin: 8px 0 0; font-size: 0.9rem; }
.upload-log .ok { color: var(--chart-cad); } .upload-log .dup { color: var(--muted); } .upload-log .err { color: var(--danger); }
table.list { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.list th, table.list td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); font-size: 0.93rem; }
table.list th { color: var(--muted); font-weight: 600; font-size: 0.8rem; }
table.list tr:last-child td { border-bottom: 0; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pager { display: flex; gap: 16px; justify-content: center; margin: 16px 0; }
.map { height: 420px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); margin: 12px 0; }
.ride-head h1 { font-size: 2rem; margin-bottom: 0.1em; }
.hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 16px 0 6px; }
.hero-num { font-size: 2.2rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.minor { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 0 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.minor .label { margin-right: 4px; }
.ride-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.ride-grid .map { height: 460px; margin: 0; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 24px; align-items: start; }
.week-card { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-bottom: 16px; }
.streak-num { font-size: 2.6rem; font-weight: 700; line-height: 1; color: var(--accent); }
.dots { display: flex; gap: 10px; }
.dot-day { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dot-mark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); }
.dot-mark.on { background: var(--accent); border-color: var(--accent); }
.dot-day.today .label { color: var(--text); font-weight: 700; }
.dot-day.today .dot-mark:not(.on) { border-color: var(--text); }
.dot-day.future { opacity: 0.45; }
.period-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.period-head h2 { margin: 0; }
.period-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.bars-note { min-height: 1.6em; margin: 6px 0 0; font-size: 0.9rem; }
.bars { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px 0; }
.bars svg { display: block; width: 100%; overflow: visible; }
.bars text { fill: var(--muted); font-size: 11px; }
.side-block { margin-bottom: 22px; }
.side-block h2 { margin: 0 0 6px; font-size: 1.05rem; }
table.kv { width: 100%; border-collapse: collapse; }
table.kv td { padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 0.93rem; }
table.kv td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.small { font-size: 0.8rem; }
.journal h2 { margin: 18px 0 8px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: end; margin: 0 0 10px; }
.filters .grow { flex: 1 1 220px; }
.filters input, .filters select { min-width: 0; width: 100%; }
.filters label:not(.grow) { min-width: 150px; }
table.list th a { color: inherit; text-decoration: none; }
table.list th a:hover { color: var(--accent); }
.badge { display: inline-block; padding: 1px 8px; margin-left: 4px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 0.75rem; white-space: nowrap; }
.tags { margin: 4px 0; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions form { display: inline; margin: 0 0 0 10px; }
.row-actions a, .row-actions button.link { font-size: 0.85rem; }
button.danger-link { color: var(--danger); }
.tag-box { border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; margin: 0; min-width: 220px; }
.tag-box legend { font-size: 0.9rem; color: var(--muted); padding: 0 4px; }
label.check { display: block; margin: 2px 0; color: var(--text); }
label.check input { display: inline-block; min-width: 0; margin: 0 6px 0 0; vertical-align: middle; }
.dash { display: grid; grid-template-columns: 260px minmax(0, 1fr) 240px; gap: 22px; align-items: start; }
.dash h1 { margin-top: 0; }
.me-card { display: grid; gap: 14px; }
.me-name { font-weight: 700; overflow-wrap: anywhere; }
.me-stats { display: flex; gap: 22px; }
.me-streak .dots { margin: 8px 0; gap: 6px; }
.me-streak .dot-mark { width: 18px; height: 18px; }
.me-links { margin: 0; font-size: 0.9rem; }
.feed-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; }
.segment-create { margin: 16px 0; }
.seg-map { height: 340px; }
.me-row { background: color-mix(in srgb, var(--accent) 14%, transparent); font-weight: 600; }
.badge.pr { border-color: var(--accent); color: var(--accent); }
table.list.plain { background: var(--surface); }
.achievements { margin: 14px 0; }
.achievements h2 { margin: 0 0 6px; font-size: 1.05rem; }
.achievements ul { list-style: none; padding: 0; margin: 0; }
.achievements li { padding: 3px 0; }
.badge.ach-leader, .badge.ach-legend { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.badge.ach-pr { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.badge.ach-second, .badge.ach-third { border-color: var(--accent); color: var(--text); }
.feed-achs { margin: 2px 0 8px; }
.seg-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 6px 0 14px; }
.seg-facts .label { margin-right: 6px; }
.reactions { margin: 22px 0; max-width: 720px; }
.kudos-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.kudos-row form, .feed-react form { margin: 0; }
.kudos-btn { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 0.9rem; cursor: pointer; }
.kudos-btn.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.comment { padding: 8px 0; border-bottom: 1px solid var(--line); }
.comment-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.comment-head form { margin: 0 0 0 auto; }
.comment-body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.comment-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-top: 12px; }
.comment-form textarea { width: 100%; }
.comment-form button { padding: 6px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.feed-react { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 4px 0 10px; }
.feed-author { font-size: 0.85rem; color: var(--muted); margin-bottom: 2px; }
.friend-list { list-style: none; padding: 0; margin: 0; }
.friend-list li { padding: 3px 0; }
.settings-block { margin: 0 0 26px; max-width: 640px; }
.invite-link { width: 100%; }
.feed-title { font-size: 1.25rem; font-weight: 650; }
.feed-title a { color: var(--text); text-decoration: none; }
.feed-title a:hover { color: var(--accent); }
.feed-nums { display: flex; gap: 28px; margin: 10px 0; }
.feed-num { font-size: 1.35rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.mini { display: block; position: relative; color: var(--accent); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.mini img { display: block; width: 100%; height: auto; }
.mini-attr { position: absolute; right: 6px; bottom: 4px; padding: 0 5px; border-radius: 3px; background: rgba(255,255,255,0.75); color: #333; font-size: 10px; }
.mini svg + .mini-attr { display: none; }
.mini.has-img .mini-attr { display: block; }
.mini-stage { position: absolute; left: -10000px; top: 0; visibility: hidden; }
.mini svg { display: block; width: 100%; height: auto; max-height: 240px; }
.splits h2 { margin-top: 0; }
.splits-scroll { max-height: 460px; overflow-y: auto; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.splits-scroll table.list { border: 0; border-radius: 0; }
.splits-scroll th { position: sticky; top: 0; background: var(--surface); }
.spd { width: 90px; }
.spd .bar { display: block; height: 8px; border-radius: 4px; background: var(--chart-speed); opacity: 0.75; }
.analysis { margin: 22px 0 0; }
.analysis-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.analysis-head h2 { margin: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs button { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 0.9rem; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.charts { display: grid; gap: 10px; margin: 10px 0 12px; }
.chart[hidden] { display: none; }
.chart { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 4px; }
.chart .head { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--muted); }
.chart .head .val { color: var(--text); font-variant-numeric: tabular-nums; }
.chart svg { display: block; width: 100%; overflow: visible; touch-action: pan-y; }
.chart text { fill: var(--muted); font-size: 11px; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.3); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.button, button.primary, details button, .settings-block button:not(.link), .filters button { display: inline-block; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; text-decoration: none; cursor: pointer; }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--danger); border-color: var(--danger); }
details.edit { margin: 8px 0 24px; }
details.edit summary { cursor: pointer; color: var(--muted); }
form.inline { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin: 12px 0; }
label { display: block; font-size: 0.9rem; color: var(--muted); }
.description { white-space: pre-wrap; }
label.wide { flex: 1 1 100%; }
textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
input, select { display: block; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; min-width: 220px; }
.auth { max-width: 380px; margin: 40px auto; }
.auth form { display: grid; gap: 14px; margin: 16px 0; }
.auth input { width: 100%; }
.crumbs { margin: 0; font-size: 0.9rem; }

@media (max-width: 720px) {
  .totals { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .map, .ride-grid .map { height: 300px; }
  .ride-grid, .profile-grid, .dash { grid-template-columns: 1fr; }
  .dash-right { display: none; }
  .feed-nums { gap: 16px; }
  .hero { gap: 8px; }
  .hero-num { font-size: 1.45rem; }
  .ride-head h1 { font-size: 1.5rem; }
  .splits-scroll { max-height: 320px; }
  table.cards thead { display: none; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards tr { padding: 8px 4px; border-bottom: 1px solid var(--line); }
  table.cards td { border: 0; padding: 2px 10px; text-align: left; }
  table.cards td::before { content: attr(data-label) ": "; color: var(--muted); font-size: 0.8rem; }
  table.cards .num { text-align: left !important; }
  table.cards .row-actions { text-align: left; padding-top: 4px; }
  table.cards .row-actions::before { content: none; }
}
details.bike { margin: 8px 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; }
details.bike summary { cursor: pointer; }
details.bike.retired { opacity: 0.7; }
.mini.virtual { background: var(--surface); }
#map.world { background: var(--surface); }
.world-label { position: absolute; left: 10px; top: 10px; z-index: 2; padding: 2px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em; pointer-events: none; }

/* ===== Дизайн B: общие компоненты ===== */
button.link { min-height: 0; }
button.link.tap, .top button.link { min-height: var(--tap); padding: 0 6px; font-weight: 500; font-size: 14px; }
.button, button.primary, details button, .settings-block button:not(.link), .filters button, .comment-form button { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 0 16px; border-radius: var(--r-card); border: 1px solid var(--text); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.danger { color: var(--danger); border-color: var(--danger); }
input, select, textarea { min-height: var(--tap); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); color: var(--text); font: inherit; padding: 0 12px; }
textarea { padding: 10px 12px; min-height: 96px; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label { font-size: 12px; font-weight: 500; color: var(--muted); }
.card, .stats > div, .feed-card, .upload { border-radius: var(--r-card); }
.error, .notice { border-radius: var(--r-card); }
.badge { border-radius: var(--r-chip); padding: 2px 8px; }
table.list { border-radius: var(--r-card); }
.mini, .map, .splits-scroll, .chart, .bars, .tag-box, details.bike { border-radius: var(--r-card); }
.label, .big { font-variant-numeric: tabular-nums; }
.hero-num, .feed-num, .big, .num, table.kv td:last-child, .streak-num { font-family: var(--font-num); font-weight: 500; }
.crumbs a, .top nav a, .tabs button { min-height: var(--tap); }

@media (max-width: 900px) {
  .top { flex-wrap: wrap; gap: 0 12px; padding: 6px 16px 0; min-height: 0; }
  .top .brand { order: 1; }
  .top form { order: 2; margin-left: auto; }
  .top nav { order: 3; flex: 0 0 100%; overflow-x: auto; height: 48px; margin: 0 -16px; padding: 0 8px; }
  main { padding: 12px 16px; }
  footer { padding: 8px 16px 24px; }
  h1 { font-size: 24px; }
}

/* ===== Дизайн B: панели, подписи, показатели ===== */
.mono { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.strong { font-weight: 600; }
.cap { font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px; }
.ph { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 10px; gap: 8px; }
div.kv { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); gap: 8px; }
.ph + div.kv { border-top: 0; }
div.kv b { font-family: var(--font-num); font-weight: 500; font-size: 16px; }
.kv-link { font-family: var(--font-num); font-size: 13px; text-decoration: none; text-align: right; }
.sep { height: 1px; border: 0; background: var(--line); margin: 4px 0 12px; }
.streak { display: flex; align-items: baseline; gap: 8px; }
.streak b { font-family: var(--font-num); font-size: 40px; font-weight: 500; letter-spacing: -0.04em; line-height: 1; color: var(--accent); }
.weekrow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 8px; }
.wd { border: 1px solid var(--line); border-radius: 4px; text-align: center; padding: 6px 0 5px; font-size: 11px; color: var(--muted); background: var(--surface); }
.wd b { display: block; font-family: var(--font-num); font-size: 13px; font-weight: 500; color: var(--text); margin-top: 2px; }
.wd.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.wd.on b { color: var(--accent-text); }
.wd.today { border: 2px solid var(--text); padding: 5px 0 4px; }
.wd.future { opacity: 0.55; }
.me-links { margin: 0; padding: 0 2px; }
.bar { display: grid; grid-template-columns: 90px 1fr 56px; gap: 10px; align-items: center; min-height: 32px; font-size: 13px; }
.bar i { display: block; height: 10px; background: var(--bg); border-radius: 2px; overflow: hidden; }
.bar i span { display: block; height: 100%; background: var(--accent); }
.bar b { text-align: right; font-family: var(--font-num); font-weight: 500; }
.frow { display: flex; align-items: center; gap: 10px; min-height: var(--tap); border-top: 1px solid var(--line); }
.ph + .frow { border-top: 0; }
.grow { flex: 1; min-width: 0; }
.sq { width: 30px; height: 30px; border-radius: 4px; background: var(--soft); color: var(--accent); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.empty { font-size: 13px; color: var(--muted); border: 1px dashed var(--line); border-radius: 4px; padding: 12px; }
.button.wide { width: 100%; }

/* лента */
.dash { display: grid; grid-template-columns: 240px minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.ride { display: grid; grid-template-columns: 230px minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.ride.no-map { grid-template-columns: 1fr; }
.ride .mini { border: 0; border-radius: 0; border-right: 1px solid var(--line); min-height: 200px; height: 100%; background: var(--map-bg); display: flex; align-items: center; justify-content: center; color: var(--route); }
.ride .mini img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ride .mini svg { width: 100%; height: auto; max-height: 100%; padding: 14px; }
.mini.virtual { background-color: var(--bg); background-image: radial-gradient(var(--line) 1.3px, transparent 1.4px); background-size: 20px 20px; }
.rbody { padding: 14px 16px; min-width: 0; }
.rtop { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.rtitle { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; margin: 6px 0 2px; line-height: 1.25; }
.rtitle a { color: var(--text); text-decoration: none; }
.rtitle a:hover { color: var(--accent); }
.rsub { font-size: 13px; color: var(--muted); }
.type { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r-chip); background: var(--soft); color: var(--accent); font-size: 12px; font-weight: 600; }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); margin: 12px 0 4px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats3 > div { padding: 10px 0 9px 12px; border-left: 1px solid var(--line); }
.stats3 > div:first-child { border-left: 0; padding-left: 0; }
.stats3 b { display: block; font-family: var(--font-num); font-weight: 500; font-size: 24px; letter-spacing: -0.03em; line-height: 1.15; }
.stats3 b small { font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.feed-achs { margin: 8px 0 0; }
.acts { display: flex; gap: 4px; margin: 2px -10px -8px; flex-wrap: wrap; }
.acts form { margin: 0; }
.act { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 10px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; border-radius: 4px; text-decoration: none; }
.act.on { color: var(--accent); font-weight: 600; }
.act:hover { color: var(--text); }
.ride .mini-attr { display: block; }
.ride .mini svg + .mini-attr { display: none; }
.ride .mini.has-img .mini-attr { display: block; z-index: 1; }
.world-label { background: var(--accent); color: var(--accent-text); border-radius: var(--r-chip); padding: 3px 9px; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; top: 10px; left: 10px; }

@media (max-width: 900px) {
  .dash { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
  .dash > aside:first-child { order: 1; }
  .dash > .col:nth-child(2) { order: 2; }
  .dash-right { order: 3; }
  .ride { grid-template-columns: 1fr; }
  .ride .mini { border-right: 0; border-bottom: 1px solid var(--line); min-height: 150px; height: 150px; }
  .stats3 b { font-size: 19px; }
  .bar { grid-template-columns: 84px 1fr 52px; }
}
.mini svg path { vector-effect: non-scaling-stroke; stroke-width: 3px; }

/* ===== Дизайн B: страница поездки ===== */
.sr { position: absolute; left: -9999px; }
.crumbs { margin: 0; font-size: 13px; color: var(--muted); }
.crumbs a { display: inline-flex; align-items: center; min-height: var(--tap); }
#activity > h1, .journal > h1 { margin: 0; }
.tagrow { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px; }
.tag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-chip); font-size: 12px; color: var(--muted); background: var(--surface); }
.ribbon { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); margin: 0 0 12px; }
.big3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.big3 > div { padding: 16px 20px; border-left: 1px solid var(--line); }
.big3 > div:first-child { border-left: 0; }
.big3 b { display: block; font-family: var(--font-num); font-weight: 500; font-size: 46px; letter-spacing: -0.05em; line-height: 1.05; }
.big3 b small { font-size: 18px; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-left: 3px; }
.five { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); border-top: 1px solid var(--line); }
.five > div { padding: 10px 20px; border-left: 1px solid var(--line); }
.five > div:first-child { border-left: 0; }
.five b { display: block; font-family: var(--font-num); font-weight: 500; font-size: 17px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 12px; align-items: start; margin: 0 0 12px; }
.panel .map { height: 380px; border: 0; border-radius: 4px; margin: 0; }
.panel .map.world { background: var(--map-bg); }
.analysis .tabs { display: flex; border-bottom: 1px solid var(--line); margin: -14px -14px 12px; padding: 0 14px; overflow-x: auto; flex-wrap: nowrap; gap: 0; }
.tabs button { min-height: var(--tap); padding: 0 14px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; color: var(--muted); font: inherit; font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { background: none; color: var(--text); border-color: transparent transparent var(--accent); font-weight: 500; }
.chart { background: none; border: 0; padding: 0; }
.analysis .charts { margin: 0; }
.splits .splits-scroll { max-height: 460px; border: 0; background: none; border-radius: 0; margin: 0; }
.splits table.list { background: none; border: 0; font-family: var(--font-num); font-size: 13px; }
.splits table.list th { font-family: var(--font); font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; font-weight: 500; }
.splits-scroll th { background: var(--surface); }
.seg { display: grid; grid-template-columns: minmax(0, 1fr) 90px 80px 160px; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); min-height: 52px; }
.ph + .seg { border-top: 0; }
.seg .st { text-align: right; }
.seg .sb { text-align: right; }
.note { padding: 12px 14px; border-radius: var(--r-card); background: var(--soft); color: var(--text); font-size: 14px; }
.achievements ul { list-style: none; margin: 0; padding: 0; }
.badge { border: 0; background: var(--soft); color: var(--accent); font-weight: 600; font-size: 12px; margin-left: 0; }
.badge.ach-leader, .badge.ach-legend { background: var(--accent); color: var(--accent-text); }
.badge.ach-pr, .badge.ach-second, .badge.ach-third { background: var(--soft); color: var(--accent); }
.kudos-btn { border-radius: var(--r-card); min-height: var(--tap); padding: 0 14px; font-weight: 600; border-color: var(--text); }
.kudos-btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.reactions { margin: 0; max-width: none; }
.comment { padding: 10px 0; border-bottom: 0; border-top: 1px solid var(--line); }
.ph + .comment { border-top: 0; }
.comment-form textarea { min-height: var(--tap); }
.actions { margin: 12px 0; }
details.edit { padding: 14px; margin: 12px 0; }
details.edit summary { min-height: 28px; }
.segment-create { margin: 12px 0; }

@media (max-width: 900px) {
  .two { display: flex; flex-direction: column; align-items: stretch; }
  .big3 > div { padding: 12px 10px; }
  .big3 b { font-size: 25px; }
  .big3 b small { font-size: 12px; }
  .five { grid-template-columns: repeat(2, 1fr); }
  .five > div { padding: 8px 12px; border-top: 1px solid var(--line); }
  .five > div:nth-child(odd) { border-left: 0; }
  .five > div:nth-child(-n+2) { border-top: 0; }
  .panel .map { height: 250px; }
  .seg { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .seg .sn { order: 1; } .seg .sb { order: 2; text-align: right; } .seg .sd { order: 3; } .seg .st { order: 4; }
}
.pin { width: 16px; height: 16px; border: 3px solid var(--surface); box-shadow: 0 0 0 1px rgba(0,0,0,0.25); }
.pin.start { border-radius: 50%; background: var(--start); }
.pin.finish { border-radius: 3px; background: var(--finish); }
[hidden] { display: none !important; }

/* ===== Дизайн B: журнал, показатели, сегменты, настройки, вход ===== */
.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pagehead h1 { margin: 0; }
.lead { max-width: 760px; margin: 0 0 14px; }
.panel.flush { padding: 4px 0 0; overflow-x: auto; }
.totals { gap: 12px; margin: 0 0 12px; }
.totals .card { border-radius: var(--r-card); }
.totals .card .big { font-family: var(--font-num); font-weight: 500; font-size: 24px; }
.upload { border: 1px dashed var(--line); border-radius: var(--r-card); padding: 14px; margin: 0 0 12px; }
.filters.panel { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: end; margin: 0 0 12px; }
.filters .grow { flex: 1 1 240px; }
.filters input, .filters select { width: 100%; }
.filters label:not(.grow) { min-width: 150px; }
table.list { background: none; border: 0; border-radius: 0; }
table.list th { color: var(--muted); font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; font-weight: 500; padding: 10px; white-space: nowrap; }
table.list td { padding: 8px 10px; font-size: 14px; vertical-align: middle; }
table.list td.num, table.list th.num { font-family: var(--font-num); }
table.list th.num { font-family: var(--font); }
table.list a.t { color: var(--text); text-decoration: none; }
table.list a.t:hover { color: var(--accent); }
.small-tag { height: 22px; margin-left: 6px; font-size: 11px; }
.row-actions a, .row-actions button.link { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 6px; font-size: 13px; font-weight: 500; }
.me-row { background: var(--soft); font-weight: 500; }
.place { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 4px; border: 1px solid var(--line); font-family: var(--font-num); font-weight: 500; font-size: 13px; }
.place.top { background: var(--text); color: var(--bg); border-color: var(--text); }
.pager { display: flex; gap: 16px; justify-content: space-between; align-items: center; margin: 8px 0; font-size: 13px; color: var(--muted); }
.pager a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); text-decoration: none; }

.profile.two { margin-top: 12px; }
.period-head { align-items: center; flex-wrap: wrap; }
.seg-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; background: var(--surface); margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.seg-tabs button { min-height: var(--tap); padding: 0 14px; border: 0; border-left: 1px solid var(--line); background: none; color: var(--muted); font-size: 14px; border-bottom: 0; margin: 0; }
.seg-tabs button:first-child { border-left: 0; }
.seg-tabs button[aria-selected="true"] { background: var(--text); color: var(--bg); border: 0; border-left: 1px solid var(--text); }
.period-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.bars { background: none; border: 0; padding: 0; }
table.kv td { padding: 8px 0; font-size: 14px; }
table.kv td:last-child { font-family: var(--font-num); font-weight: 500; }

.settings-two { margin-top: 12px; align-items: start; }
.settings-block { max-width: none; margin: 0; }
.settings-block form.inline label { flex: 1 1 200px; }
.settings-block form.inline .wide { flex: 1 1 100%; }
.settings-block input[type=range] { width: 100%; min-height: var(--tap); padding: 0; accent-color: var(--accent); }
.settings-block label.check { display: flex; align-items: center; gap: 8px; min-height: 32px; font-size: 14px; font-weight: 400; color: var(--text); }
.settings-block input[type=checkbox], label.check input { min-height: 0; width: 18px; height: 18px; min-width: 0; padding: 0; margin: 0; accent-color: var(--accent); }
.invite-link { width: 100%; font-family: var(--font-num); font-size: 13px; }
details.bike { border-radius: var(--r-card); padding: 8px 12px; }
details.bike summary { min-height: 32px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.auth { display: grid; grid-template-columns: 1fr 1fr; max-width: 880px; margin: 32px auto; border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; background: var(--surface); }
.auth-brand { background: var(--accent); color: var(--accent-text); padding: 40px 32px; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.auth-brand .mark { width: 56px; height: 56px; border-radius: var(--r-card); background: var(--accent-text); display: grid; place-items: center; }
.auth-brand .mark svg { stroke: var(--accent); }
.auth-name { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.auth-brand p { margin: 0; opacity: 0.9; max-width: 28ch; }
.auth-form { padding: 32px; }
.auth-form h1 { font-size: 28px; margin-top: 0; }
.auth form { display: grid; gap: 14px; margin: 16px 0; }
.auth input { width: 100%; }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; margin: 12px auto; }
  .auth-brand { padding: 20px 16px; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .auth-brand p { display: none; }
  .auth-brand .mark { width: 40px; height: 40px; }
  .auth-name { font-size: 20px; }
  .auth-form { padding: 20px 16px; }
  .panel.flush { padding: 0; }
  .settings-two { margin-top: 12px; }
}
@media (max-width: 720px) {
  .totals { grid-template-columns: 1fr; }
  table.cards tr { padding: 10px 4px; border-bottom: 1px solid var(--line); }
}
.settings-block form.inline input:not([type=checkbox]):not([type=range]), .settings-block form.inline select { width: 100%; min-width: 0; }
.settings-block fieldset.tag-box { flex: 1 1 100%; min-width: 0; }
.tag-box { min-width: 0; }

/* тихий режим: скрыто только для самого пользователя */
.q-badges .qb, .q-kudos .qk, .q-ranks .qr { display: none !important; }

.auth-tabs { display: inline-flex; margin: 0 0 8px; }
.auth-tabs a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 16px; border-left: 1px solid var(--line); color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: none; }
.auth-tabs a:first-child { border-left: 0; }
.auth-tabs a[aria-current="page"] { background: var(--text); color: var(--bg); border-left-color: var(--text); }
.auth-note { color: var(--muted); font-size: 14px; text-align: center; margin: 0; }

.promises ol { margin: 0; padding-left: 20px; display: grid; gap: 12px; }
.promises li { line-height: 1.5; }
pre.code { margin: 0 0 10px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-card); font-family: var(--font-num); font-size: 13px; overflow-x: auto; }
code { font-family: var(--font-num); font-size: 0.9em; background: var(--bg); padding: 1px 5px; border-radius: 3px; }
details.danger-zone { margin: 14px 0 0; padding: 0; border: 0; }
details.danger-zone summary { color: var(--danger); min-height: var(--tap); display: flex; align-items: center; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: none; }
.chips a[aria-current="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.badge.hazard { background: var(--error-bg); color: var(--danger); }
