:root {
  color-scheme: dark;
  --bg: #0d1018;
  --sheet: #181e28;
  --sheet-light: #202832;
  --line: #323c48;
  --text: #f5f7fb;
  --muted: #9aa8b8;
  --lime: #c7ff63;
  --aqua: #6be6dd;
  --violet: #a993ff;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); overflow-x: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.ambient { position: fixed; pointer-events: none; border-radius: 50%; filter: blur(80px); opacity: .09; }
.ambient-one { width: 260px; height: 260px; right: -150px; top: -140px; background: var(--lime); }
.ambient-two { width: 220px; height: 220px; left: -170px; top: 50vh; background: var(--violet); }
.shell { position: relative; max-width: 720px; min-height: 100vh; margin: auto; padding: 0 18px calc(102px + env(safe-area-inset-bottom)); }
.topbar { height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 900; font-size: 16px; letter-spacing: .06em; line-height: 1; }
.brand-light { font-weight: 400; }
.brand small { display: block; color: var(--muted); text-transform: uppercase; font-size: 8px; letter-spacing: .15em; margin-top: 5px; }
.brand-mark { display: flex; align-items: flex-end; justify-content: center; gap: 3px; width: 31px; height: 31px; padding: 7px; border: 1.5px solid var(--lime); border-radius: 8px; }
.brand-mark i { width: 3px; background: var(--lime); border-radius: 2px; }
.brand-mark i:nth-child(1) { height: 8px; }.brand-mark i:nth-child(2) { height: 15px; }.brand-mark i:nth-child(3) { height: 11px; }
.top-date { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(27px, 6vw, 35px); line-height: 1.1; letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 18px; letter-spacing: -.025em; }
h3 { margin-bottom: 0; font-size: 16px; }
.muted, .hint, .lead { color: var(--muted); }
.hint { margin: 10px 0; font-size: 12px; line-height: 1.5; }
.lead { font-size: 13px; line-height: 1.5; }
.eyebrow { margin-bottom: 7px; color: var(--lime); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .17em; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 10px; padding: 25px 0 21px; }
.page-index { color: #687585; font-size: 10px; white-space: nowrap; letter-spacing: .12em; }
.page-subtitle { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.section { margin-top: 27px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 16px; }
.text-button, .subtle-button { padding: 4px 0; border: 0; background: none; color: var(--lime); font-size: 12px; font-weight: 700; }
.subtle-button { color: var(--muted); font-weight: 500; }
.button { min-height: 41px; padding: 10px 15px; border: 0; border-radius: 9px; background: var(--lime); color: #17200a; font-size: 13px; font-weight: 800; }
.button.secondary { background: #2b3541; color: var(--text); }
.button.ghost { background: transparent; color: var(--lime); border: 1px solid #637e48; }
.button.danger { background: #4b2e36; color: #ffc1c3; }
.button.small { min-height: 34px; padding: 7px 11px; font-size: 11px; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.primary-wide { width: 100%; display: flex; align-items: center; justify-content: space-between; text-align: left; }
.primary-wide span { font-size: 17px; line-height: 1; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; }
.space-top { margin-top: 14px; }
.number { font-variant-numeric: tabular-nums; }

/* Главная: одна запись вместо набора рекламных карточек. */
.journal-sheet, .exercise-sheet { border: 1px solid var(--line); border-left: 3px solid var(--lime); border-radius: 8px 12px 12px 8px; background: var(--sheet); }
.journal-sheet { padding: 18px; }
.sheet-top, .sheet-heading, .exercise-head, .catalog-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-kicker { color: var(--lime); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.sheet-date { color: var(--muted); font-size: 11px; }
.sheet-heading { margin-top: 17px; margin-bottom: 9px; }
.sheet-heading .muted { font-size: 11px; white-space: nowrap; }
.notebook-lines { margin: 8px 0 19px; border-top: 1px solid var(--line); }
.notebook-line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.notebook-line > span { min-width: 0; }
.notebook-line strong { flex: 0 0 auto; text-align: right; font-weight: 600; }
.multiply { color: var(--aqua); padding: 0 2px; }
.quick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 10px; }
.quick-row button { display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #161c25; color: var(--text); text-align: left; font-size: 11px; font-weight: 650; }
.quick-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: #35472f; color: var(--lime); font-size: 17px; flex: 0 0 auto; }
.export-link { margin-top: 21px; color: var(--muted); }

/* Список записей — строчки, как в журнале. */
.record-list { border-top: 1px solid var(--line); }
.record-row { display: flex; align-items: center; width: 100%; min-height: 62px; padding: 8px 2px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; }
.record-symbol { display: grid; place-items: center; width: 29px; height: 29px; margin-right: 11px; border-radius: 7px; background: #293533; color: var(--aqua); font-size: 16px; }
.record-main { display: grid; gap: 3px; flex: 1; min-width: 0; }
.record-main strong { font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.record-main small { color: var(--muted); font-size: 10px; }
.record-date { margin-left: 8px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.record-arrow { margin-left: 10px; color: var(--lime); font-size: 21px; line-height: 1; }

/* Ввод подхода расположен прямо под выбранным упражнением. */
.exercise-stack { display: grid; gap: 11px; }
.exercise-sheet { border-left-color: #53616b; overflow: hidden; }
.exercise-sheet.selected-sheet { border-left-color: var(--lime); }
.exercise-head { padding: 16px 16px 10px; }
.exercise-head small { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.set-list { margin: 0 16px; border-top: 1px solid var(--line); }
.set-row { display: flex; align-items: center; gap: 13px; min-height: 41px; border-bottom: 1px solid #2d3641; font-size: 13px; }
.set-row:last-child { border-bottom: 0; }
.set-index { width: 25px; color: var(--aqua); font-size: 10px; font-weight: 800; font-variant-numeric: tabular-nums; }
.set-values { flex: 1; line-height: 1.4; }
.set-row .subtle-button { width: 25px; font-size: 17px; }
.empty-line { padding: 13px 0; color: var(--muted); font-size: 12px; }
.entry-area { padding: 15px 16px 17px; border-top: 1px solid var(--line); background: #1c2730; }
.entry-title { display: flex; justify-content: space-between; color: var(--text); font-size: 12px; font-weight: 800; }
.entry-title span { color: var(--aqua); }
.entry-area .previous { margin: 10px 0 13px; padding: 0; border: 0; background: none; }
.entry-area .previous strong { color: var(--muted); font-size: 10px; font-weight: 650; }
.entry-area .previous p { margin: 4px 0 0; font-size: 11px; color: #cbd6d7; line-height: 1.5; }
.entry-area .hint { margin: 8px 0 13px; font-size: 11px; }
.add-under { margin: 6px 16px 14px; }
.add-exercise { margin-top: 24px; }
.add-exercise-form { display: flex; gap: 8px; }
.add-exercise-form .select { flex: 1; min-width: 0; }
.note-fold { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 13px; }
.note-fold summary { color: var(--muted); font-size: 12px; cursor: pointer; }
.note-fold form { margin-top: 13px; }
.workout-footer { display: grid; gap: 7px; margin-top: 25px; }
.workout-footer .subtle-button { justify-self: start; }

/* Формы, подробности записи, графики. */
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.field label, .selector-strip label { color: #b8c5d0; font-size: 11px; font-weight: 700; }
.input, .select, .textarea { width: 100%; min-height: 41px; padding: 9px 11px; border: 1px solid #43505c; border-radius: 8px; outline: 0; background: #101720; color: var(--text); font-size: 13px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--lime); box-shadow: 0 0 0 2px #c7ff6320; }
.textarea { min-height: 85px; resize: vertical; }
.input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 11px; }
.empty { padding: 20px; border: 1px dashed #56616d; border-radius: 9px; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }
.previous { padding: 12px; border: 1px solid #3b6058; border-radius: 9px; background: #202c2d; }
.previous strong { color: var(--aqua); font-size: 11px; }
.previous p { margin: 7px 0 0; font-size: 12px; }
.card, .chart-card { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--sheet); }
.card + .card { margin-top: 9px; }
.list { display: grid; gap: 9px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { padding: 5px 8px; border-radius: 6px; background: #27323c; color: #c4d0db; font-size: 10px; }
.badge { padding: 5px 7px; border: 1px solid #536a42; border-radius: 6px; color: var(--lime); font-size: 10px; white-space: nowrap; }
.badge.violet { border-color: #615588; color: #bbaeff; }.badge.aqua { border-color: #397b78; color: var(--aqua); }
.selector-strip { display: grid; gap: 7px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.chart-card { margin-top: 10px; }
.chart-title { color: #dce6ed; font-size: 12px; font-weight: 700; }
.chart-value { color: var(--lime); font-size: 12px; font-weight: 800; }
.chart-svg { width: 100%; height: 100px; display: block; overflow: visible; }
.chart-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.chart-grid { stroke: #42505b; stroke-width: .7; }.chart-dot { fill: var(--lime); stroke: var(--sheet); stroke-width: 2; }
.exercise-catalog { margin-top: 19px; border-top: 1px solid var(--line); }
.catalog-row { padding: 18px 2px; border-bottom: 1px solid var(--line); }
.catalog-top h2 { font-size: 15px; }.catalog-top span { color: var(--muted); font-size: 10px; }
.catalog-metrics { margin-top: 7px; color: #becad3; font-size: 11px; }.catalog-metrics span { color: var(--lime); padding: 0 4px; }
.catalog-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 13px; }
.catalog-actions button { padding: 0; border: 0; background: none; color: var(--muted); font-size: 11px; }.catalog-actions button:first-child { color: var(--lime); }
.error { padding: 12px; border: 1px solid #75434c; border-radius: 9px; background: #38272c; color: #ffc2c2; font-size: 12px; }
.loading { padding: 40px 0; text-align: center; color: var(--muted); }

/* Нижняя навигация и диалоги. */
.bottom-nav { position: fixed; z-index: 10; left: 50%; bottom: 0; transform: translateX(-50%); display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; width: min(720px, 100%); padding: 8px 12px calc(9px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #141922f2; backdrop-filter: blur(16px); }
.bottom-nav button { display: grid; justify-items: center; gap: 2px; padding: 5px 0; border: 0; background: none; color: #8897a8; font-size: 10px; }
.bottom-nav button.active { color: var(--lime); }.nav-icon { font-size: 21px; line-height: 1; }
.modal { position: fixed; inset: 0; z-index: 20; display: flex; justify-content: center; align-items: flex-end; padding: 12px; background: #05070bca; }
.modal.hidden, .toast.hidden { display: none; }
.modal-sheet { width: min(520px, 100%); max-height: 88vh; overflow: auto; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); border: 1px solid #4b5762; border-radius: 15px; background: #1a202c; box-shadow: 0 20px 70px #0008; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }.modal-head h2 { font-size: 18px; }
.toast { position: fixed; z-index: 30; left: 50%; bottom: calc(83px + env(safe-area-inset-bottom)); transform: translateX(-50%); min-width: 210px; max-width: calc(100% - 30px); padding: 10px 14px; border-radius: 9px; background: #d4ff8d; color: #15200a; font-size: 12px; font-weight: 700; text-align: center; }

@media (min-width: 600px) {
  .shell { padding-left: 28px; padding-right: 28px; }
  .modal { align-items: center; }
  .modal-sheet { padding-bottom: 20px; }
}

/* Более простой режим: журнал важнее оформления. */
body { background: #11151c; font-size: 15px; }
.shell { max-width: 620px; padding-left: 16px; padding-right: 16px; }
.topbar { height: 62px; }
.brand { display: block; font-size: 16px; letter-spacing: .03em; }
.top-date { font-size: 12px; }
.page-heading { padding: 24px 0 17px; }
.page-heading h1 { font-size: 26px; letter-spacing: -.025em; }
.page-index, .eyebrow { display: none; }
.page-subtitle { font-size: 13px; }
.section { margin-top: 27px; }
.section-head h2 { font-size: 17px; }
.hint, .lead { font-size: 13px; }
.button { border-radius: 6px; font-size: 15px; min-height: 46px; }
.text-button { font-size: 13px; }
.select, .input, .textarea { border-radius: 6px; font-size: 15px; min-height: 45px; }
.field label { font-size: 13px; }

.current-session { padding: 17px; border: 1px solid var(--line); border-radius: 6px; background: #1a2029; }
.current-session .status { margin-bottom: 8px; color: var(--aqua); font-size: 12px; font-weight: 700; }
.current-session > strong { font-size: 17px; }
.current-session p { margin: 9px 0 15px; color: #c0cbd5; font-size: 13px; line-height: 1.45; }
.current-session .button { width: 100%; text-align: center; }
.start-button { display: block; width: 100%; }
.plain-action { display: block; width: 100%; min-height: 46px; margin-top: 9px; padding: 10px 14px; border: 1px solid #657d4b; border-radius: 6px; background: none; color: var(--lime); text-align: left; font-size: 14px; font-weight: 700; }
.secondary-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }
.secondary-actions button { padding: 3px 0; border: 0; background: none; color: var(--muted); font-size: 12px; }
.record-row { min-height: 70px; }
.record-main strong { font-size: 15px; }
.record-main small { font-size: 12px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.record-date { font-size: 12px; }
.record-arrow { font-size: 19px; }
.record-list { border-top-color: #3d4752; }
.exercise-sheet, .journal-sheet, .card, .chart-card { border-radius: 6px; }
.exercise-sheet { border-left-width: 1px; }
.exercise-sheet.selected-sheet { border-color: #789250; }
.exercise-head small { font-size: 11px; }
.exercise-head h2 { font-size: 18px; }
.set-row { min-height: 46px; font-size: 15px; }
.set-index { font-size: 12px; }
.entry-area { background: #202830; }
.entry-title { font-size: 14px; }
.entry-area .previous strong { font-size: 12px; }
.entry-area .previous p { font-size: 13px; }
.entry-area .hint { font-size: 12px; }
.note-fold summary { font-size: 13px; }

.bottom-nav { max-width: 620px; padding: 0 8px env(safe-area-inset-bottom); background: #192029; }
.bottom-nav button { display: block; min-height: 56px; padding: 14px 1px 10px; border-top: 2px solid transparent; color: #bbc6d0; font-size: 11px; font-weight: 600; white-space: nowrap; }
.bottom-nav button.active { border-top-color: var(--lime); color: var(--text); }

.form-label { display: block; margin: 18px 0 7px; color: #cbd5de; font-size: 13px; font-weight: 700; }
.stat-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 20px 0 18px; border-bottom: 1px solid var(--line); }
.stat-tabs button { min-height: 43px; padding: 8px 4px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-size: 12px; font-weight: 700; }
.stat-tabs button.active { border-bottom-color: var(--lime); color: var(--text); }
.stat-summary { display: grid; gap: 5px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: #1a2029; }
.stat-summary span, .stat-summary small { color: var(--muted); font-size: 12px; }
.stat-summary strong { color: var(--text); font-size: 29px; font-variant-numeric: tabular-nums; }
.stat-counts { display: flex; gap: 10px; }
.stat-counts div { flex: 1; display: grid; gap: 3px; padding: 15px; border: 1px solid var(--line); border-radius: 6px; background: #1a2029; }
.stat-counts strong { font-size: 23px; font-variant-numeric: tabular-nums; }
.stat-counts span { color: var(--muted); font-size: 12px; }
.stat-list-title { margin-top: 25px; }
.stat-list-title > span { color: var(--muted); font-size: 12px; }
.stat-table { border-top: 1px solid var(--line); }
.stat-table > div { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; min-height: 48px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.stat-table > div span { color: var(--muted); }
.stat-table > div strong { text-align: right; font-weight: 650; }
.metric-picker { margin-top: 23px; }
.chart-fold { margin-top: 20px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; }
.chart-fold summary { color: var(--lime); font-size: 13px; font-weight: 700; cursor: pointer; }
.readable-chart { display: block; width: 100%; height: auto; margin-top: 4px; }
.chart-axis { fill: #aab7c4; font-size: 11px; font-family: inherit; }
.chart-path { fill: none; stroke: var(--aqua); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-grid { stroke: #3b4751; stroke-width: 1; }
.chart-dot { fill: var(--lime); stroke: #1a2029; stroke-width: 2; }

.stat-entries { border-top: 1px solid var(--line); }
.stat-entry { padding: 16px 0; border-bottom: 1px solid var(--line); }
.stat-entry-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 9px; font-size: 14px; }
.stat-entry-head span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.stat-entry-value { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 14px; line-height: 1.4; }
.stat-entry-value > span { flex: 0 0 77px; color: var(--muted); font-size: 12px; }
.stat-entry-value > div { flex: 1; }
.stat-entry-value .number { font-variant-numeric: tabular-nums; }

.stat-note { margin: 15px 0; line-height: 1.5; }
.metric-summaries { display: grid; gap: 9px; margin-top: 18px; }
.metric-summary { padding: 15px; border: 1px solid var(--line); border-radius: 6px; background: #1a2029; }
.metric-summary h2 { margin: 0 0 13px; font-size: 16px; }
.metric-summary small { display: block; margin-top: 12px; color: var(--muted); font-size: 11px; }
.metric-values { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.metric-values div { display: grid; gap: 5px; min-width: 0; }
.metric-values span { color: var(--muted); font-size: 11px; }
.metric-values strong { font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.combined-legend { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; font-weight: 700; }
.legend-first { color: var(--aqua); }.legend-second { color: var(--lime); text-align: right; }
.chart-panel { margin-top: 11px; padding: 14px 10px 8px; border: 1px solid var(--line); border-radius: 6px; background: #1a2029; }
.chart-panel .hint { margin: 0 4px 7px; line-height: 1.45; }
.first-line { stroke: var(--aqua); }.second-line { stroke: var(--lime); }
.first-line-dot { fill: var(--aqua); }.second-line-dot { fill: var(--lime); }
.first-line-dot, .second-line-dot { stroke: #1a2029; stroke-width: 1.5; }
.stat-history-fold { margin-top: 23px; border-top: 1px solid var(--line); padding-top: 15px; }
.stat-history-fold summary { color: var(--muted); font-size: 13px; cursor: pointer; }
.stat-history-fold .stat-entries { margin-top: 14px; }

.stat-help { display: block; width: 28px; height: 28px; margin: 12px 0 0 auto; border: 1px solid #6b7a86; border-radius: 50%; background: none; color: #c6d1dc; font-size: 16px; font-weight: 700; cursor: pointer; }
.chart-panel { padding: 16px 7px 8px; }
.chart-lane-title { fill: #ecf3f7; font-size: 15px; font-weight: 700; font-family: inherit; }
.chart-lane-last { font-size: 16px; font-weight: 800; font-family: inherit; }

@media (min-width: 760px) {
  .shell.stats-wide { max-width: 960px; }
  .shell.stats-wide .chart-panel { padding: 20px 16px 12px; }
  .shell.stats-wide .metric-summaries { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bottom-nav.stats-wide { max-width: 960px; }
}

@media (max-width: 390px) {
  .bottom-nav button { font-size: 10px; }
  .record-date { font-size: 11px; }
  .stat-tabs button { font-size: 11px; }
}


.chart-grid-minor { stroke: #35414a; opacity: .52; }
.chart-grid-edge { stroke: #45525c; opacity: .75; }

.chart-group-divider { stroke: #60717d; stroke-width: 1; stroke-dasharray: 3 4; opacity: .45; }
.chart-group-date { fill: #afbdc7; font-size: 11px; font-family: inherit; }

.metric-direction { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 15px; padding-top: 11px; border-top: 1px solid var(--line); }
.metric-direction span { color: var(--muted); font-size: 11px; }
.metric-direction strong { color: var(--aqua); font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty-direction { color: var(--muted); font-size: 11px; }

.metric-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.metric-title-row h2 { margin: 0; }
.metric-title-row .metric-direction { display: inline; margin: 0; padding: 0; border: 0; color: var(--aqua); font-size: 14px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
