:root {
  color-scheme: dark;
  --bg: #101310;
  --surface: #191e19;
  --surface-up: #202720;
  --line: #303b31;
  --text: #f3f6ee;
  --muted: #adb8a9;
  --accent: #c8f36a;
  --accent-dark: #17220c;
  --error: #ffb6a8;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea { color: inherit; }
button, select { cursor: pointer; }
button { border: 0; }
button:disabled { opacity: .62; cursor: wait; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.skip { position: fixed; top: 10px; left: 10px; z-index: 5; transform: translateY(-150%); background: var(--bg); padding: 10px; }
.skip:focus { transform: translateY(0); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { letter-spacing: -.036em; line-height: 1.1; }
h1 { font-size: clamp(2.05rem, 4.75vw, 4.1rem); }
h2 { font-size: clamp(1.24rem, 2vw, 1.55rem); }
p { line-height: 1.6; }
small { color: var(--muted); }
label { font-weight: 650; }
button, .button { min-height: 42px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  border-radius: 10px; background: var(--accent); color: var(--accent-dark);
  text-decoration: none; padding: .65rem 1rem; font-weight: 760;
}
.button:hover { background: #d7fa8e; }
.button.quiet { background: var(--surface-up); color: var(--text); border: 1px solid var(--line); }
.button.quiet:hover { border-color: #8da37c; }
input, textarea, select {
  background: #121712; border: 1px solid #39453a; border-radius: 9px;
  min-height: 44px; padding: .7rem .8rem; width: 100%;
}
textarea { min-height: 11rem; resize: vertical; font-family: ui-monospace, monospace; font-size: .88rem; line-height: 1.5; }
[hidden] { display: none !important; }
.error { color: var(--error); }
.notice { color: var(--accent); padding: .7rem 0; }
.boot, .gate { min-height: 100vh; display: grid; align-items: center; justify-items: center; padding: 24px; }
.gate {
  background: radial-gradient(ellipse at 17% 0%, #25391d 0%, transparent 50%),
              radial-gradient(ellipse at 85% 100%, #283721 0%, transparent 42%), var(--bg);
}
.login { width: min(100%, 405px); padding: clamp(22px, 6vw, 38px); }
.login h1 { margin: 32px 0 9px; font-size: 2.5rem; }
.login form { display: grid; gap: 12px; margin-top: 26px; }
.frame { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  display: flex; flex-direction: column; gap: 35px; min-height: 100vh; position: sticky; top: 0;
  align-self: start; background: #151a15; border-right: 1px solid var(--line); padding: 28px 18px;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; font-weight: 800; letter-spacing: -.045em; }
.brand img { display: block; border-radius: 10px; }
.sidebar .brand { padding: 0 8px; }
.sidebar nav { display: grid; gap: 5px; }
.nav-button, .signout {
  display: flex; flex-shrink: 0; align-items: center; gap: 10px; text-align: left;
  white-space: nowrap; background: transparent; color: var(--muted); border-radius: 9px;
  padding: .55rem .75rem; font-size: .91rem; font-weight: 650;
}
.nav-button:hover, .signout:hover { background: var(--surface-up); color: var(--text); }
.nav-button[aria-current="page"] { background: #25331b; color: var(--accent); }
.signout { margin-top: auto; }
.nav-icon { min-width: 1.1rem; text-align: center; font-size: 1.1rem; }
.page { width: min(1350px, 100%); padding: clamp(22px, 4.2vw, 62px); margin: 0 auto; min-width: 0; }
.hero {
  position: relative; isolation: isolate; border: 1px solid #394935; border-radius: 21px;
  background: radial-gradient(ellipse at 85% 5%, #2e4929 0%, transparent 58%), #1a231a;
  padding: clamp(24px, 4vw, 43px); margin-bottom: 28px; overflow: hidden;
}
.hero::after {
  position: absolute; inset: 0 0 0 55%; z-index: -1; content: ""; opacity: .22;
  background: repeating-linear-gradient(138deg, transparent 0 22px, #89a680 23px, transparent 24px 38px);
  mask-image: linear-gradient(90deg, transparent, black 80%);
}
.hero p { margin-top: 13px; color: #c8d5c4; max-width: 52ch; overflow-wrap: anywhere; }
.hero h1 { overflow-wrap: anywhere; max-width: 24ch; }
.hero .line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; color: var(--accent); font-size: .88rem; font-weight: 740; }
.hero .separator { color: #8eaa7e; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.inset { padding: clamp(17px, 2.4vw, 26px); }
.muted { color: var(--muted); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(275px, .87fr); gap: 22px; align-items: start; }
.controls { display: grid; gap: 12px; margin-bottom: 24px; }
.controls label { display: block; font-size: .86rem; color: var(--muted); margin-bottom: 6px; }
.controls select { max-width: 430px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: transparent; padding: .44rem .86rem; font-weight: 650; overflow-wrap: anywhere; }
.tab:hover { color: var(--text); border-color: var(--muted); }
.tab[aria-pressed="true"] { color: var(--accent); border-color: #687d42; background: #26341a; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.section-title span { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.workout-note { margin-bottom: 16px; color: var(--muted); overflow-wrap: anywhere; }
.items { display: grid; gap: 8px; }
.item {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; text-align: left;
  position: relative; background: #191e19; border: 1px solid var(--line); color: var(--text);
  border-radius: 12px; padding: 13px; min-height: 69px; width: 100%;
}
.item:hover { border-color: #6c815c; }
.item[aria-pressed="true"] { background: #212b1d; border-color: #698648; }
.item > div { min-width: 0; }
.item strong { display: block; line-height: 1.3; font-size: 1rem; overflow-wrap: anywhere; }
.item small { display: block; margin-top: 3px; line-height: 1.4; overflow-wrap: anywhere; }
.item .num {
  display: grid; place-items: center; height: 33px; width: 33px;
  background: #283127; border-radius: 8px; color: #c0ceb8; font-size: .76rem; font-weight: 760;
  font-variant-numeric: tabular-nums;
}
.item[aria-pressed="true"] .num { background: var(--accent); color: var(--accent-dark); }
.chevron { color: var(--muted); font-size: 1.25rem; }
.detail { overflow: hidden; }
.detail h2 { overflow-wrap: anywhere; }
.detail .equipment { margin-top: 7px; }
.detail .body { display: grid; gap: 18px; }
.detail dl {
  margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 110px), 1fr));
  gap: 8px; font-variant-numeric: tabular-nums;
}
.detail dl div { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.detail dt { color: var(--muted); font-size: .78rem; }
.detail dd { margin: 2px 0 0; overflow-wrap: anywhere; font-weight: 650; }
.detail details { color: var(--muted); line-height: 1.5; font-size: .86rem; }
.detail details summary { cursor: pointer; color: var(--accent); }
.detail details p { margin-top: 6px; }
.detail ol { padding-left: 1.4rem; margin: 7px 0 0; line-height: 1.54; }
.detail ol li { padding-left: .25rem; margin-bottom: .43rem; overflow-wrap: anywhere; }
.detail ol li::marker { color: var(--accent); font-weight: 750; }
.detail a { line-height: 1.5; }
.stage { background: #111a13; border: 1px solid #34463a; border-radius: 10px; overflow: hidden; }
.stage canvas { width: 100%; height: auto; aspect-ratio: 4 / 2.7; display: block; }
.stage-info {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  column-gap: 12px; row-gap: 6px; padding: 0 .75rem .65rem;
}
.stage-info small { color: #c4d2c2; line-height: 1.35; }
.stage-variant { flex: 1 1 11rem; min-width: 0; max-width: 17rem; font-size: .78rem; color: var(--muted); }
.stage-variant select { display: block; margin-top: 3px; font-size: .85rem; min-height: 42px; }
.stage-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 8px 12px; padding: .6rem .7rem; background: #162017;
}
.stage-info + .stage-footer { border-top: 1px solid #34463a; }
.stage-clock { display: flex; align-items: center; gap: 10px; }
.stage-play { min-width: 6.75rem; padding: .45rem .65rem; font-size: .87rem; }
.stage-play svg { flex: none; }
.stage-play[data-playing="true"] .play-glyph,
.stage-play[data-playing="false"] .pause-glyph { display: none; }
.exercise-clock { min-width: 3.4em; font-size: 1.18rem; font-weight: 760; font-variant-numeric: tabular-nums; }
.stage-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.stage-actions button {
  background: #233322; color: #e3f1d8; border: 1px solid #3a5236; border-radius: 7px;
  padding: .35rem .6rem; font-size: .83rem; font-weight: 700;
}
.stage-actions button:hover { border-color: #8da37c; }
.stage-play:active, .stage-actions button:active { filter: brightness(.9); }
.empty { max-width: 590px; padding: clamp(19px, 4vw, 33px); }
.empty p { margin: 10px 0 18px; color: var(--muted); }
.actions { display: flex; gap: 9px; flex-wrap: wrap; }
.review-form { max-width: 680px; display: grid; gap: 12px; }
.review-actions { margin-bottom: 22px; align-items: center; }
.review-actions p { color: var(--muted); }
.status:empty { display: none; }
@media(max-width: 920px) and (min-width: 761px) {
  .frame { grid-template-columns: 180px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .page { padding-inline: 24px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
}
@media(max-width: 760px) {
  .frame { display: block; }
  .sidebar {
    display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; min-height: 0;
    border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 14px 7px; z-index: 4;
  }
  .sidebar nav { grid-row: 2; grid-column: 1 / -1; display: flex; overflow-x: auto; scrollbar-width: thin; }
  .sidebar .brand { padding: 0 3px; }
  .sidebar .brand img { width: 32px; height: 32px; }
  .signout { grid-column: 2; grid-row: 1; margin: 0; justify-self: end; }
  .nav-button, .signout { font-size: .83rem; padding: .45rem .6rem; }
  .nav-icon { display: none; }
  .page { padding: 20px 15px 30px; }
  .hero { margin-bottom: 20px; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  .detail { scroll-margin-top: 118px; }
}
