/* Стиль «Студия»: тёплый графит, янтарь только на главном, Onest. */
@import url('https://fonts.googleapis.com/css2?family=Onest:wght@400;500;600&display=swap');

:root {
  --bg-deep: #12110f;
  --bg: #161513;
  --card: #1c1a18;
  --raised: #262421;
  --track: #2a2724;
  --line: rgba(239, 233, 222, 0.08);
  --text: #efe9de;
  --text-2: #aaa398;
  --muted: #8a847a;
  --accent: #e8a04f;
  --accent-ink: #161513;
  --accent-soft: rgba(232, 160, 79, 0.5);
  --muscle-2: #8c6e4a;
  --danger: #e5484d;
  --radius-card: 20px;
  --radius-ctl: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: Onest, system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num { font-variant-numeric: tabular-nums; }

#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.screen { flex: 1; padding: calc(16px + env(safe-area-inset-top)) 20px 28px; display: flex; flex-direction: column; gap: 24px; }
.screen.with-nav { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

h1 { margin: 0; font-size: 28px; font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; }
h2 { margin: 0; font-size: 17px; font-weight: 500; }
p { margin: 0; }
.t2 { color: var(--text-2); }
.mut { color: var(--muted); }
.small { font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }

.card { background: var(--card); border-radius: var(--radius-card); padding: 20px 16px; display: flex; flex-direction: column; gap: 12px; }
.list { background: var(--card); border-radius: var(--radius-card); padding: 4px 16px; }
.list > * + * { border-top: 1px solid var(--line); }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; padding: 6px 0; }

.btn { height: 52px; border: none; border-radius: var(--radius-ctl); background: var(--raised); color: var(--text); font-size: 15px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; transition: background-color 160ms var(--ease), transform 120ms var(--ease); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); font-size: 16px; font-weight: 600; }
.btn.ghost { background: transparent; color: var(--text-2); height: 44px; padding: 0; }
.btn.ghost[disabled] { opacity: 0.35; }
.btn.small { height: 44px; font-size: 14px; border-radius: 12px; }
.btn[disabled] { opacity: 0.5; }
.link { color: var(--accent); font-weight: 500; }
.icon-btn { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--card); border: none; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); }

.topbar { display: flex; align-items: center; gap: 12px; }
.topbar .title { flex: 1; color: var(--text-2); }

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.week .d { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; border-radius: 12px; }
.week .d.today { background: var(--raised); }
.week .wd { font-size: 12px; color: var(--muted); }
.week .tag { font-size: 15px; font-weight: 500; line-height: 18px; }
.week .tag.done { color: var(--muted); text-decoration: line-through; }
.week .today .tag { color: var(--accent); }
.week .dot { width: 4px; height: 4px; margin: 7px 0; border-radius: 2px; background: #5a544c; }

.plan { background: var(--card); border-radius: var(--radius-card); padding: 4px 16px; }
.plan-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; min-height: 56px; padding: 8px 0; }
.plan-row + .plan-row { border-top: 1px solid var(--line); }
.plan-row .n { font-size: 13px; color: var(--muted); }
.plan-row .name { font-weight: 500; line-height: 1.3; }
.plan-row .hint { font-size: 13px; color: var(--muted); }
.plan-row .sets { font-size: 14px; color: var(--text-2); text-align: right; white-space: nowrap; }
.plan-row.done .name { color: var(--muted); }
.plan-group { padding: 16px 0 4px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }

.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.chip { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 12px; background: var(--card); border: none; text-align: left; }
.chip .l { font-size: 12px; color: var(--muted); }
.chip .v { font-size: 17px; font-weight: 500; }
.chip.now { box-shadow: inset 0 0 0 1px var(--accent-soft); }
.chip.now .l { color: var(--accent); }

.big { font-size: 48px; font-weight: 500; line-height: 1; letter-spacing: -0.02em; }
.huge { font-size: 64px; font-weight: 500; line-height: 1; letter-spacing: -0.03em; }
.stepper { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 12px; }
.stepper button { height: 56px; border: none; border-radius: var(--radius-ctl); background: var(--raised); font-size: 24px; }
.stepper .val { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.stepper input { width: 100%; background: transparent; border: none; text-align: center; font-size: 40px; font-weight: 500; line-height: 1; padding: 0; }
.stepper .cap { font-size: 13px; color: var(--muted); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: var(--radius-ctl); background: var(--card); }
.seg button { height: 40px; border: none; border-radius: 10px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; }
.seg button[aria-selected='true'] { background: var(--raised); color: var(--text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }

.tempo { display: grid; gap: 6px; }
.tempo .beats { display: grid; gap: 4px; }
.tempo .beat { height: 10px; border-radius: 5px; background: #3a3631; transition: background-color 120ms var(--ease); }
.tempo .beat.on { background: var(--accent); }
.labels { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.divider { border-top: 1px solid var(--line); padding-top: 16px; }

.bar { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width 300ms linear; }
.thin { height: 4px; border-radius: 2px; background: var(--track); overflow: hidden; }
.thin > i { display: block; height: 100%; border-radius: 2px; background: #6b645a; }
.thin > i.short { background: var(--accent); }

.check { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-card); background: var(--card); }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.toggle { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text-2); font-size: 14px; }
.toggle input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }

.acc > button { width: 100%; height: 56px; display: flex; align-items: center; justify-content: space-between; background: transparent; border: none; padding: 0; font-size: 17px; font-weight: 500; }
.acc > button svg { transition: transform 160ms var(--ease); }
.acc[open] > button svg { transform: rotate(180deg); }
.acc ol, .acc ul { margin: 0; padding: 0 0 16px 20px; display: flex; flex-direction: column; gap: 10px; line-height: 1.45; }
.note { display: flex; flex-direction: column; gap: 4px; padding: 12px; margin-bottom: 16px; border-radius: 12px; background: var(--raised); }

.media-white { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 0 12px; border-radius: 16px; background: #fff; }
.media-white img { width: 180px; height: 180px; }
.media-white span { font-size: 11px; color: #5e554a; }
.photos img { width: 100%; border-radius: 16px; display: block; }
.photos { display: flex; flex-direction: column; gap: 8px; }
.legend { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.field input { height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); padding: 0 16px; font-size: 16px; color: var(--text); }
.error { color: var(--danger); font-size: 14px; }

.nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--bg-deep); padding: 8px 8px calc(16px + env(safe-area-inset-bottom)); }
.nav .in { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; color: var(--muted); font-size: 11px; font-weight: 500; }
.nav a[aria-current='page'] { color: var(--text); }

.toast { position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--raised); color: var(--text); padding: 12px 16px; border-radius: 12px; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); z-index: 10; }
.empty { padding: 32px 0; text-align: center; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
