@font-face { font-family: Notebook; src: local("Arial"); font-display: swap; }
:root {
  color-scheme: dark;
  --paper: #191916;
  --card: #23231f;
  --raised: #2c2c26;
  --ink: #f2eee3;
  --muted: #b3b1a3;
  --line: #414138;
  --accent: #d7e6a0;
  --accent-ink: #202815;
  --warning: #e5bd85;
  --danger: #f0a292;
  font-family: Notebook, Arial, sans-serif;
  font-synthesis: none;
  font-size: 16px;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; }
button, a, input, summary { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .46; }
button, input { border-radius: 9px; }
button { min-height: 48px; border: 1px solid transparent; font-weight: 700; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
input:focus-visible { outline-offset: 2px; }
input { min-width: 0; min-height: 52px; width: 100%; padding: 12px; background: var(--paper); border: 1px solid #626254; color: var(--ink); font-variant-numeric: tabular-nums; }
input:user-invalid { border-color: var(--danger); }
input[type="checkbox"] { accent-color: var(--accent); width: 24px; height: 24px; min-height: 24px; flex-shrink: 0; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2.1rem, 8vw, 3rem); font-weight: 650; letter-spacing: -.055em; line-height: 1.05; margin-bottom: 16px; white-space: pre-line; }
h2 { font-size: 1.5rem; line-height: 1.2; font-weight: 600; letter-spacing: -.025em; margin-bottom: 12px; }
h3 { font-size: 1rem; font-weight: 600; }
p { line-height: 1.5; }
.app-shell { width: min(100%, 640px); margin-inline: auto; padding: 0 20px calc(116px + env(safe-area-inset-bottom)); }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: calc(25px + env(safe-area-inset-top)) 0 22px; border-bottom: 1px solid var(--line); }
.wordmark { font-size: 31px; line-height: 1; font-weight: 800; text-decoration: none; letter-spacing: -.08em; }
.wordmark > span:first-child { font-weight: 400; }
.wordmark .brand-dot { color: var(--accent); margin-left: 2px; }
.edition { font-family: monospace; font-size: 10px; letter-spacing: .13em; color: var(--muted); }
.sync-strip { display: flex; align-items: center; gap: 9px; min-height: 53px; padding: 7px 0; }
.sync-strip p { font-size: .78rem; margin: 0; flex: 1; }
.status-dot { height: 6px; width: 6px; flex-shrink: 0; background: var(--muted); border-radius: 50%; }
.status-dot.synced { background: var(--accent); }
.status-dot.pending, .status-dot.syncing, .status-dot.offline { background: var(--warning); }
.status-dot.auth, .status-dot.rejected, .status-dot.storage, .status-dot.conflict { background: var(--danger); }
.sync-strip .text-button { min-height: 40px; padding: 6px 8px; }
.page-title { padding: 28px 0 16px; }
.page-title > p:last-child { max-width: 38ch; margin-bottom: 13px; }
.eyebrow { font-family: monospace; font-size: .65rem; line-height: 1.5; letter-spacing: .15em; color: var(--muted); font-weight: 400; margin-bottom: 12px; }
.muted { color: var(--muted); }
.fine-print { font-size: .78rem; line-height: 1.6; color: var(--muted); }
.primary { background: var(--accent); color: var(--accent-ink); padding: 16px 20px; min-height: 56px; }
.secondary { background: var(--raised); border-color: var(--line); color: var(--ink); padding: 12px 16px; }
.text-button { background: transparent; color: var(--ink); padding: 12px 16px; }
.danger { color: var(--danger); }
.wide { width: 100%; }
.compact { min-height: 44px; padding: 8px 12px; font-size: .85rem; }
.button-stack { display: grid; gap: 10px; }
.notice, .conflict-panel { padding: 18px; margin: 12px 0 20px; border: 1px solid #766343; background: #302b20; border-radius: 12px; line-height: 1.5; }
.notice { font-size: .9rem; overflow-wrap: anywhere; }
.conflict-panel h2 { font-size: 1.25rem; }
.conflict-panel p { font-size: .85rem; }
.conflict-panel .fine-print:last-child { margin: 12px 0 0; }
#auth-panel { padding: 26px 0 12px; }
#auth-panel > p { max-width: 43ch; }
.login-form { display: grid; gap: 16px; margin: 24px 0 12px; }
.field { display: grid; gap: 8px; font-size: .82rem; color: var(--muted); }
.field input { font-size: 1.05rem; }
.form-error { color: var(--danger); font-size: .88rem; margin: 0; }
.form-error:empty { display: none; }
.ready-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px 18px 8px; }
.section-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-line h2 { font-size: 1.1rem; margin: 0; }
.pill { flex-shrink: 0; font-family: monospace; font-size: .73rem; border: 1px solid var(--line); border-radius: 20px; padding: 7px 10px; color: var(--muted); }
.preview-row { display: grid; grid-template-columns: 1fr auto 75px; gap: 12px; align-items: center; min-height: 66px; border-top: 1px solid var(--line); font-size: .88rem; }
.preview-row strong { font-family: monospace; font-size: .82rem; color: var(--muted); font-weight: normal; }
.preview-row .load { text-align: right; color: var(--accent); font-variant-numeric: tabular-nums; }
.ready-card .primary { margin-top: 20px; }
.ready-card > .fine-print { text-align: center; margin: 16px 0 12px; }
.rotation { padding: 34px 0 22px; }
.rotation-phases { display: flex; gap: 6px; margin-bottom: 18px; }
.rotation-phases span { border-top: 2px solid var(--line); flex: 1; padding-top: 12px; font-size: .82rem; color: var(--muted); }
.rotation-phases .current-phase { border-color: var(--accent); color: var(--accent); }
.last-session { border-top: 1px solid var(--line); padding-top: 22px; }
.last-session h3 { margin-bottom: 8px; }
.session-progress { display: flex; gap: 16px; align-items: center; padding: 0 0 24px; }
.session-progress span { white-space: nowrap; font-family: monospace; font-size: .75rem; color: var(--muted); }
progress { display: block; width: 100%; height: 4px; border: 0; border-radius: 2px; background: var(--line); accent-color: var(--accent); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }
.exercise-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px 14px 14px; margin-bottom: 20px; }
.exercise-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 2px; }
.exercise-heading .eyebrow { font-size: .6rem; margin-bottom: 6px; }
.exercise-heading h2 { margin-bottom: 18px; }
.exercise-heading .pill { margin-bottom: 14px; }
.warmups { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 0 16px; }
.warmups summary { color: var(--muted); font-size: .8rem; min-height: 46px; padding: 14px 0; cursor: pointer; }
.warmup-content { padding: 0 0 4px; }
.warmup-line { font-family: monospace; font-size: .86rem; margin-bottom: 10px; }
.set-columns, .set-row { display: grid; grid-template-columns: minmax(95px, 1fr) 76px 60px 48px; gap: 8px; align-items: center; }
.set-columns { color: var(--muted); font-family: monospace; font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; text-align: center; }
.set-columns > :first-child { text-align: left; }
.set-row { margin-bottom: 12px; }
.target { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-family: monospace; font-size: .86rem; }
.set-number { color: var(--muted); font-family: monospace; font-size: .68rem; }
.set-input { text-align: center; padding: 12px 4px; min-height: 52px; font-size: 1.1rem; -moz-appearance: textfield; }
.set-input::-webkit-inner-spin-button, .set-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.done-toggle { padding: 0; height: 52px; width: 48px; font-size: 1.4rem; color: var(--muted); background: var(--raised); border-color: var(--line); }
.is-done .done-toggle { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.is-done .set-input { border-color: #69754b; }
.is-done .target { color: var(--accent); }
.is-short .target { color: var(--warning); }
.is-short .done-toggle { background: var(--warning); border-color: var(--warning); }
.is-short .set-input { border-color: #8a6f42; }
.hold-control { display: flex; align-items: center; gap: 12px; min-height: 54px; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; font-size: .81rem; cursor: pointer; }
.hold-control input { margin: 0; }
.exercise-note { margin: 3px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.finish-note { text-align: center; margin-top: 14px; }
.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 640px); z-index: 5; display: grid; grid-template-columns: repeat(3, 1fr); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--paper); }
.bottom-nav button { color: var(--muted); background: transparent; border-radius: 8px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; font-size: .8rem; min-height: 52px; }
.bottom-nav span { font-family: monospace; font-size: .58rem; font-weight: 400; }
.bottom-nav button[aria-current] { color: var(--accent); background: #292e20; }
.rest-panel { position: fixed; z-index: 6; left: 50%; transform: translateX(-50%); bottom: calc(83px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 8px; width: min(calc(100% - 32px), 592px); padding: 10px 12px; border-radius: 12px; border: 1px solid #76765e; background: #34352b; box-shadow: 0 8px 24px #0006; }
.rest-panel > div { flex: 1; display: flex; align-items: center; gap: 12px; }
.rest-panel .eyebrow { margin: 0; font-size: .58rem; }
.rest-panel strong { font-family: monospace; font-size: 1.65rem; letter-spacing: -.04em; font-variant-numeric: tabular-nums; font-weight: 400; }
.rest-panel .text-button { padding: 10px 8px; font-size: .8rem; }
.rest-ready strong { color: var(--accent); }
.has-timer .app-shell { padding-bottom: calc(194px + env(safe-area-inset-bottom)); }
.history-entry { margin-bottom: 12px; border: 1px solid var(--line); background: var(--card); border-radius: 12px; overflow: hidden; }
.history-entry > summary { display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer; padding: 20px 18px; }
.history-entry > summary::-webkit-details-marker { display: none; }
.history-entry summary .eyebrow { display: block; font-size: .58rem; margin-bottom: 7px; }
.history-entry summary strong { font-size: 1.15rem; font-weight: 500; }
.history-arrow { color: var(--accent); font-size: 1.5rem; font-weight: 300; }
.history-entry[open] .history-arrow { transform: rotate(45deg); }
.history-exercise { border-top: 1px solid var(--line); margin: 0 18px; padding: 18px 0 14px; }
.history-exercise h3 { margin-bottom: 3px; }
.history-exercise > .fine-print { margin-bottom: 12px; }
.history-set { display: grid; grid-template-columns: 22px 1fr; gap: 5px 7px; font-size: .76rem; line-height: 1.5; padding: 8px 0; border-top: 1px dashed var(--line); }
.history-set strong { grid-column: 2; font-weight: 400; }
.empty-state { padding: 38px 24px; border: 1px dashed var(--line); border-radius: 14px; }
.empty-mark { display: block; font-family: monospace; font-size: 4rem; color: #626351; margin-bottom: 24px; }
.settings-form { display: grid; gap: 24px; }
.settings-section { min-width: 0; margin: 0; padding: 22px 16px; border: 1px solid var(--line); border-radius: 12px; }
.settings-section legend { font-size: 1rem; padding: 0 8px; margin-left: -2px; }
.settings-section > .field + .field { margin-top: 18px; }
.settings-section > .fine-print:last-child { margin: 18px 0 0; }
.lift-settings { padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line); }
.lift-settings h3 { margin-bottom: 14px; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-pair .field { font-size: .72rem; }
.device-section { margin-top: 36px; }
.device-section h2 { font-size: 1.2rem; }
.page-foot { margin: 38px 0 0; text-align: center; color: var(--muted); font-size: .65rem; letter-spacing: .04em; }
@media (max-width: 360px) {
  .app-shell { padding-left: 12px; padding-right: 12px; }
  .exercise-card { padding-left: 10px; padding-right: 10px; }
  .set-columns, .set-row { grid-template-columns: minmax(78px, 1fr) 65px 50px 44px; gap: 6px; }
  .done-toggle { width: 44px; }
  .target { font-size: .76rem; }
  .edition { font-size: 9px; }
}
@media (min-width: 600px) {
  .app-shell { padding-inline: 32px; }
  .exercise-card { padding: 24px; }
  .set-columns, .set-row { grid-template-columns: 1fr 110px 90px 56px; gap: 14px; }
  .done-toggle { width: 56px; }
  .target { font-size: 1rem; gap: 12px; }
  .history-set { grid-template-columns: 22px 1fr 1fr; }
  .history-set strong { grid-column: auto; text-align: right; }
}
@media (prefers-reduced-motion: no-preference) {
  button { transition: background-color .15s ease, border-color .15s ease; }
}
