:root {
    --primary: #254edb;
    --ink: #182942;
    --muted: #52627a;
    --background: #f2f5fa;
    --surface: #ffffff;
    --line: #dce3ee;
    --success: #176747;
    --warning: #815214;
    --danger: #b3303d;
    --primary-soft: #eaf0ff;
    --success-soft: #eaf5ef;
    --warning-soft: #fff5e5;
    --danger-soft: #fff0f1;
    --scroll-thumb: #aab7cb;
    --scroll-hover: #788aa7;
    --scroll-active: #52627a;
    --radius: 16px;
    --control-radius: 10px;
    --section: 28px;
    --page: 1120px;
    --font-display: "Avenir Next", Avenir, system-ui, sans-serif;
    --font-body: system-ui, sans-serif;
    --font-mono: ui-monospace, monospace;
    color-scheme: light;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--background);
    font-synthesis: none;
    scrollbar-color: var(--scroll-thumb) var(--background);
    scrollbar-width: thin;
}
* {
    box-sizing: border-box;
    scrollbar-color: var(--scroll-thumb) var(--background);
    scrollbar-width: thin;
}
::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}
::-webkit-scrollbar-track {
    background: var(--background);
}
::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--scroll-hover);
}
::-webkit-scrollbar-thumb:active {
    background: var(--scroll-active);
}
body {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
}
button,
input,
select,
textarea {
    font: inherit;
}
button,
a,
summary,
select {
    cursor: pointer;
}
button,
a,
input,
select,
textarea,
summary {
    -webkit-tap-highlight-color: transparent;
}
a {
    color: var(--primary);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}
button:active:not(:disabled) {
    transform: translateY(1px);
}
:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 4px;
}
h1,
h2,
h3,
p {
    margin-top: 0;
}
h1,
h2,
h3 {
    font-family: var(--font-display);
    line-height: 1.16;
    letter-spacing: -0.04em;
}
h1 {
    font-size: 38px;
    margin-bottom: 12px;
    font-weight: 750;
}
h2 {
    font-size: 23px;
    margin-bottom: 10px;
}
h3 {
    font-size: 18px;
    margin-bottom: 8px;
}
p {
    color: var(--muted);
}
button {
    border: 0;
}
svg {
    width: 21px;
    height: 21px;
    flex-shrink: 0;
    vertical-align: middle;
}
small {
    font-size: 13px;
    color: var(--muted);
}
[hidden] {
    display: none !important;
}
.small-label {
    font-size: 11px;
    letter-spacing: 0.12em;
    font-weight: 750;
    color: var(--muted);
}
.app-shell {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 224px minmax(0, 1fr);
}
.sidebar {
    position: sticky;
    top: 0;
    height: 100dvh;
    background: var(--surface);
    border-right: 1px solid var(--line);
    padding: 36px 22px;
    display: flex;
    flex-direction: column;
}
.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 29px;
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -1.8px;
    color: var(--ink);
}
.brand:hover {
    text-decoration: none;
}
.brand-dot {
    color: var(--primary);
    margin-left: -9px;
}
.brand-mark {
    display: grid;
    place-items: center;
    background: var(--primary);
    color: var(--surface);
    font-style: italic;
    font-size: 27px;
    border-radius: 10px;
    width: 37px;
    height: 39px;
    letter-spacing: 0;
}
.brand-caption {
    font-size: 9px;
    letter-spacing: 0.16em;
    margin: 15px 0 44px 3px;
}
nav {
    display: grid;
    gap: 8px;
}
nav a {
    min-height: 49px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--muted);
    font-weight: 600;
    font-size: 14px;
}
nav a:hover {
    background: var(--background);
    text-decoration: none;
}
nav a[aria-current="page"] {
    color: var(--primary);
    background: var(--primary-soft);
}
.sidebar-note {
    margin-top: auto;
    padding: 24px 10px 0;
    border-top: 1px solid var(--line);
}
.sidebar-note p {
    font-size: 20px;
    font-family: var(--font-display);
    letter-spacing: -0.04em;
    font-weight: 650;
    line-height: 1.4;
    margin: 12px 0;
    color: var(--ink);
}
.sidebar-note > span:last-child {
    font-size: 11px;
    color: var(--muted);
}
.workspace {
    padding: 0 48px;
    min-width: 0;
    max-width: calc(var(--page) + 96px);
    width: 100%;
    margin: auto;
}
.topbar {
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    margin-bottom: 38px;
}
.connection {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 12px;
    color: var(--muted);
}
.avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--line);
    display: grid;
    place-items: center;
    font-size: 10px;
    font-weight: 700;
}
main {
    outline: none;
}
.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}
.page-heading p {
    margin-bottom: 0;
}
.date-chip {
    font-size: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 13px;
    white-space: nowrap;
    color: var(--muted);
}
.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr);
    gap: 24px;
    align-items: start;
}
.stack {
    display: grid;
    gap: 24px;
}
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
}
.card-header,
.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card-header {
    margin-bottom: 22px;
}
.card-header h2,
.card-header h3 {
    margin: 0;
}
.hero-card {
    position: relative;
    overflow: hidden;
    padding: 30px;
    background: var(--primary);
    color: var(--surface);
    border: 0;
}
.hero-card .small-label,
.hero-card p {
    color: #dfe6ff;
}
.hero-card h2 {
    font-size: 36px;
    margin: 26px 0 12px;
    letter-spacing: -0.06em;
}
.hero-top {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}
.hero-tag {
    border: 1px solid #7390f1;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 10px;
    letter-spacing: 0.03em;
}
.hero-letter {
    position: absolute;
    right: 28px;
    top: 29px;
    font-family: var(--font-display);
    font-size: 210px;
    line-height: 1;
    font-weight: 800;
    color: #4467e0;
    transform: rotate(-8deg);
    pointer-events: none;
}
.hero-main {
    position: relative;
    max-width: 75%;
}
.hero-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #dfe6ff;
    margin: 25px 0;
}
.button {
    min-height: 48px;
    padding: 12px 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: var(--control-radius);
    font-weight: 650;
    font-size: 14px;
    line-height: 1.4;
    background: var(--primary);
    color: var(--surface);
    border: 1px solid transparent;
    transition: background 0.15s;
}
.button:hover {
    filter: brightness(0.94);
    text-decoration: none;
}
.button.secondary {
    background: var(--surface);
    border-color: var(--line);
    color: var(--ink);
}
.button.ghost {
    background: transparent;
    color: var(--muted);
    padding-inline: 12px;
}
.button.danger {
    background: var(--danger);
    color: var(--surface);
}
.button.light {
    background: var(--surface);
    color: var(--primary);
}
.button.full {
    width: 100%;
}
.button.small {
    min-height: 44px;
    padding: 9px 13px;
    font-size: 12px;
}
.hero-card .button {
    justify-content: space-between;
    width: 100%;
    position: relative;
}
.week-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin: 24px 0;
}
.day {
    text-align: center;
    font-size: 10px;
    color: var(--muted);
}
.day > span {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border: 1px solid var(--line);
    border-radius: 50%;
    margin-top: 9px;
    font-size: 12px;
    color: var(--muted);
}
.day.done > span {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--surface);
}
.day.today > span {
    border: 2px solid var(--primary);
    color: var(--primary);
    font-weight: 700;
}
.day.today.done > span {
    color: var(--surface);
}
.stat-number {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 750;
    letter-spacing: -0.07em;
}
.stat-number small {
    font-size: 17px;
    font-weight: 400;
    letter-spacing: 0;
}
.quiet-row {
    border-top: 1px solid var(--line);
    padding-top: 16px;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
}
.notice {
    background: var(--warning-soft);
    color: var(--warning);
    border-radius: 12px;
    padding: 16px 18px;
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.notice p {
    color: inherit;
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 1.6;
}
.notice strong {
    font-size: 13px;
}
.notice.info {
    color: var(--primary);
    background: var(--primary-soft);
}
.notice.success {
    color: var(--success);
    background: var(--success-soft);
}
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 32px 0 16px;
}
.section-heading h2 {
    font-size: 20px;
    margin: 0;
}
.program-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.program-letter {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 750;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.program-letter.b {
    background: #ebf1ee;
    color: var(--success);
}
.program-title {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 22px;
}
.program-title h3 {
    margin: 0 0 5px;
}
.program-card p {
    font-size: 13px;
}
.program-card .button {
    margin-top: 6px;
}
.tag {
    display: inline-flex;
    font-size: 10px;
    letter-spacing: 0.035em;
    font-weight: 650;
    padding: 5px 9px;
    border-radius: 6px;
    background: var(--background);
    color: var(--muted);
}
.tag.warning {
    background: var(--warning-soft);
    color: var(--warning);
}
.tag.success {
    background: var(--success-soft);
    color: var(--success);
}
.exercise-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.exercise-list li + li {
    border-top: 1px solid var(--line);
}
.exercise-link {
    padding: 17px 0;
    width: 100%;
    background: transparent;
    text-align: left;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 68px;
}
.exercise-link:hover {
    color: var(--primary);
}
.exercise-index {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
    width: 22px;
}
.exercise-link .grow {
    flex: 1;
}
.exercise-link strong {
    font-size: 14px;
    font-weight: 600;
    display: block;
    margin-bottom: 3px;
}
.exercise-link small {
    font-size: 11px;
}
.empty-state {
    padding: 24px 4px;
    text-align: center;
}
.empty-icon {
    width: 48px;
    height: 48px;
    background: var(--background);
    display: grid;
    place-items: center;
    border-radius: 50%;
    margin: 0 auto 16px;
    color: var(--muted);
}
.empty-state h3 {
    font-size: 17px;
}
.empty-state p {
    font-size: 13px;
    max-width: 260px;
    margin: 0 auto 18px;
}
.tip-list {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
    font-size: 13px;
}
.tip-list li + li {
    margin-top: 10px;
}
.footer {
    padding: 36px 0 24px;
    color: var(--muted);
    font-size: 11px;
}
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    margin-bottom: 22px;
    min-height: 32px;
}
.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
    gap: 24px;
}
.detail-grid .card p {
    font-size: 14px;
}
.metadata {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 18px 0;
}
.detail-section {
    margin-top: 24px;
}
.detail-section h3 {
    font-size: 15px;
}
.detail-section ul {
    padding-left: 21px;
    color: var(--muted);
    font-size: 14px;
}
.detail-section li + li {
    margin-top: 8px;
}
.workout-shell {
    max-width: 760px;
    margin: 0 auto;
}
.workout-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.workout-heading h1 {
    font-size: 24px;
    margin: 0;
}
.progress-line {
    display: flex;
    gap: 5px;
    margin: 18px 0 26px;
}
.progress-segment {
    height: 5px;
    border-radius: 4px;
    background: var(--line);
    flex: 1;
}
.progress-segment.complete {
    background: var(--success);
}
.progress-segment.current {
    background: var(--primary);
}
.progress-segment.skipped {
    background: var(--scroll-thumb);
}
.exercise-heading {
    margin-bottom: 24px;
}
.exercise-heading h2 {
    font-size: 30px;
    margin: 10px 0;
}
.exercise-heading p {
    font-size: 13px;
    margin: 0;
}
.set-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin: 22px 0;
}
.set-table th {
    text-align: center;
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 650;
    padding: 0 4px 12px;
}
.set-table th:first-child {
    width: 37px;
}
.set-table th:last-child {
    width: 61px;
}
.set-table td {
    padding: 6px 4px;
    text-align: center;
}
.set-table td:first-child {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
}
input,
select,
textarea {
    width: 100%;
    min-height: 48px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: var(--control-radius);
    color: var(--ink);
    font-size: 16px;
}
input::placeholder,
textarea::placeholder {
    color: var(--muted);
    opacity: 0.8;
}
input:disabled {
    color: var(--success);
    background: var(--success-soft);
    opacity: 1;
    -webkit-text-fill-color: var(--success);
}
input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}
input::-webkit-inner-spin-button {
    appearance: none;
}
input[type="checkbox"] {
    width: 22px;
    height: 22px;
    min-height: 22px;
    accent-color: var(--primary);
}
input[aria-invalid="true"] {
    border-color: var(--danger);
    background: var(--danger-soft);
}
.set-table input {
    text-align: center;
    padding: 11px 4px;
    min-width: 0;
    font-family: var(--font-mono);
}
.log-set {
    padding: 0;
    min-height: 48px;
    height: 48px;
    width: 48px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-grid;
    place-items: center;
}
.log-set:hover {
    background: var(--line);
}
.log-set.logged {
    background: var(--success);
    color: var(--surface);
}
.form-error {
    color: var(--danger);
    font-size: 13px;
    min-height: 21px;
    margin: 8px 0;
}
.exercise-fields {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 16px;
    margin: 24px 0;
}
label,
.field-label {
    display: block;
    font-size: 12px;
    font-weight: 650;
    margin-bottom: 7px;
}
textarea {
    resize: none;
    min-height: 96px;
    line-height: 1.5;
}
.exercise-fields textarea {
    min-height: 72px;
}
.field-hint {
    font-size: 11px;
    margin: 6px 0;
    color: var(--muted);
}
details {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 15px 18px;
    margin: 18px 0;
}
summary {
    font-size: 13px;
    font-weight: 650;
    min-height: 24px;
}
details[open] summary {
    margin-bottom: 12px;
}
details p,
details li {
    font-size: 13px;
}
details ul {
    padding-left: 20px;
    color: var(--muted);
}
.workout-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
}
.workout-actions .button:last-child {
    flex: 1;
}
.workout-subactions {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
}
.warmup-steps {
    list-style: none;
    padding: 0;
    margin: 28px 0;
}
.warmup-steps li {
    display: flex;
    gap: 15px;
    margin: 22px 0;
}
.warmup-steps .step-number {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    flex-shrink: 0;
}
.warmup-steps h3 {
    font-size: 16px;
}
.warmup-steps p {
    font-size: 13px;
    margin: 0;
}
.summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 24px 0;
}
.summary-stat {
    border-left: 2px solid var(--line);
    padding-left: 15px;
}
.summary-stat strong {
    display: block;
    font-size: 27px;
    letter-spacing: -0.05em;
}
.summary-stat span {
    color: var(--muted);
    font-size: 11px;
}
.history-item {
    display: flex;
    align-items: center;
    gap: 17px;
    width: 100%;
    background: transparent;
    text-align: left;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    padding: 20px 0;
}
.history-item:hover {
    color: var(--primary);
}
.history-item .grow {
    flex: 1;
}
.history-item strong {
    display: block;
}
.history-item small {
    font-size: 12px;
}
.history-item:last-child {
    border: 0;
}
.history-sets {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.history-set {
    padding: 8px 10px;
    background: var(--background);
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
}
.history-exercise {
    padding: 20px 0;
    border-top: 1px solid var(--line);
}
.history-exercise h3 {
    font-size: 16px;
}
.history-exercise p {
    font-size: 12px;
    margin: 8px 0;
}
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.field {
    margin-bottom: 23px;
}
.check-field {
    display: flex;
    align-items: center;
    gap: 12px;
}
.check-field label {
    margin: 0;
    font-size: 14px;
}
.settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.settings-copy {
    font-size: 13px;
    line-height: 1.7;
}
.loading {
    padding: 60px 20px;
    text-align: center;
    color: var(--muted);
}
#persistent-message {
    background: var(--danger-soft);
    color: var(--danger);
    padding: 16px;
    border: 1px solid var(--danger);
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 13px;
}
#toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ink);
    color: var(--surface);
    font-size: 13px;
    border-radius: 10px;
    padding: 13px 20px;
    z-index: 40;
    max-width: 90vw;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}
#toast.visible {
    opacity: 1;
}
#timer {
    position: fixed;
    bottom: 22px;
    right: 28px;
    background: var(--ink);
    color: var(--surface);
    padding: 14px 18px;
    border-radius: 14px;
    box-shadow: 0 6px 24px #18294226;
    display: flex;
    align-items: center;
    gap: 18px;
    z-index: 20;
}
#timer strong {
    font-family: var(--font-mono);
    font-size: 25px;
    font-weight: 500;
}
#timer small {
    color: #dce3ee;
    font-size: 10px;
    display: block;
}
#timer button {
    background: #354963;
    color: white;
    min-width: 44px;
    min-height: 44px;
    border-radius: 8px;
    font-size: 12px;
}
#timer button:hover {
    background: var(--muted);
}
dialog {
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 28px;
    max-width: 500px;
    width: calc(100% - 32px);
    color: var(--ink);
    background: var(--surface);
}
dialog::backdrop {
    background: #18294288;
}
dialog p {
    font-size: 14px;
}
.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}
.skip-link {
    position: fixed;
    left: 20px;
    top: -70px;
    z-index: 100;
    background: var(--surface);
    padding: 12px;
}
.skip-link:focus {
    top: 12px;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 90px;
    margin: 20px 0;
}
.chart-column {
    flex: 1;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 10px;
}
.chart-column meter {
    display: block;
    appearance: none;
    width: 100%;
    height: 12px;
    margin: 12px 0;
}
.chart-column meter::-webkit-meter-bar {
    background: var(--line);
    border: 0;
}
.chart-column meter::-webkit-meter-optimum-value {
    background: var(--primary);
}
.chart-column meter::-moz-meter-bar {
    background: var(--primary);
}
@media (min-width: 1450px) {
    .workspace {
        padding: 0 60px;
    }
    .topbar {
        margin-bottom: 45px;
    }
}
@media (max-width: 1100px) {
    .workspace {
        padding: 0 28px;
    }
    .app-shell {
        grid-template-columns: 190px minmax(0, 1fr);
    }
    .sidebar {
        padding: 30px 16px;
    }
    .dashboard-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .sidebar-note {
        padding-inline: 0;
    }
    .hero-main {
        max-width: 80%;
    }
    .settings-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 800px) {
    .app-shell {
        display: block;
    }
    .sidebar {
        position: static;
        height: auto;
        padding: 20px 22px;
        background: var(--background);
        border: 0;
        display: block;
    }
    .brand {
        font-size: 25px;
    }
    .brand-mark {
        width: 32px;
        height: 34px;
        font-size: 23px;
    }
    .brand-caption,
    .sidebar-note {
        display: none;
    }
    nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 30;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 0;
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--line);
        background: var(--surface);
    }
    nav a {
        flex-direction: column;
        gap: 4px;
        padding: 5px;
        min-height: 53px;
        font-size: 10px;
        border-radius: 8px;
    }
    nav a svg {
        width: 20px;
        height: 20px;
    }
    .workspace {
        padding: 0 22px;
    }
    .topbar {
        height: 0;
        border: 0;
        position: absolute;
        top: 36px;
        right: 22px;
        margin: 0;
    }
    .topbar > .small-label,
    .avatar {
        display: none;
    }
    .connection {
        font-size: 10px;
    }
    .page-heading {
        margin: 20px 0 26px;
    }
    .date-chip {
        display: none;
    }
    h1 {
        font-size: 31px;
    }
    .page-heading p {
        font-size: 13px;
    }
    .dashboard-grid {
        gap: 20px;
    }
    .stack {
        gap: 20px;
    }
    .card {
        padding: 22px;
    }
    .hero-card {
        padding: 25px;
    }
    .hero-card h2 {
        font-size: 34px;
    }
    .hero-letter {
        font-size: 190px;
        right: 16px;
    }
    .hero-main {
        max-width: 85%;
    }
    .hero-main > p {
        max-width: 230px;
        font-size: 13px;
    }
    .program-grid {
        gap: 14px;
    }
    .program-card {
        padding: 18px;
    }
    .program-title {
        gap: 10px;
        align-items: flex-start;
    }
    .program-letter {
        width: 38px;
        height: 40px;
        font-size: 21px;
    }
    .program-title h3 {
        font-size: 15px;
    }
    .program-title small {
        font-size: 10px;
    }
    .program-card p {
        font-size: 12px;
    }
    .program-card .button {
        padding: 10px;
        font-size: 12px;
    }
    .footer {
        padding-bottom: 110px;
    }
    .detail-grid {
        gap: 20px;
    }
    .exercise-heading h2 {
        font-size: 27px;
    }
    .workout-shell .card {
        padding: 18px;
    }
    .workout-heading h1 {
        font-size: 22px;
    }
    .workout-actions .button {
        padding: 12px 14px;
    }
    .exercise-fields {
        grid-template-columns: 110px 1fr;
        gap: 12px;
    }
    .set-table {
        margin-left: -3px;
        width: calc(100% + 6px);
    }
    .set-table th:last-child {
        width: 54px;
    }
    .set-table td {
        padding-inline: 3px;
    }
    .set-table th {
        font-size: 9px;
    }
    .summary-stat {
        padding-left: 10px;
    }
    .summary-stat strong {
        font-size: 24px;
    }
    .summary-stat span {
        font-size: 10px;
    }
    #timer {
        bottom: calc(85px + env(safe-area-inset-bottom));
        right: 14px;
        left: 14px;
        justify-content: space-between;
        padding: 10px 15px;
    }
    body:has(#timer:not([hidden])) .footer {
        padding-bottom: 180px;
    }
    #toast {
        bottom: calc(165px + env(safe-area-inset-bottom));
        width: max-content;
        max-width: 90vw;
    }
    .settings-grid {
        gap: 18px;
    }
    .section-heading {
        margin-top: 28px;
    }
    .back-link {
        margin-top: 14px;
    }
    .page-heading + .back-link {
        margin-top: 0;
    }
}
@media (max-width: 370px) {
    .workspace {
        padding-inline: 15px;
    }
    .sidebar {
        padding-inline: 15px;
    }
    .program-grid {
        grid-template-columns: 1fr;
    }
    .exercise-fields {
        grid-template-columns: 1fr;
    }
    .set-table th:first-child {
        width: 25px;
    }
    .hero-meta {
        gap: 10px;
    }
    .hero-tag {
        font-size: 9px;
    }
}
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
@media (forced-colors: active) {
    * {
        scrollbar-color: auto;
    }
    :focus-visible {
        outline: 3px solid Highlight;
    }
    .button,
    .log-set,
    .progress-segment {
        border: 1px solid ButtonText;
    }
    .tag {
        border: 1px solid CanvasText;
    }
}

input,
select,
textarea,
summary,
button,
a {
    scroll-margin-bottom: 190px;
    scroll-margin-top: 24px;
}

.exercise-media {
    margin: 22px 0;
}
.media-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
}
.media-heading small {
    font-size: 10px;
}
.equipment-label {
    margin: 7px 0 12px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
}
.movement-photos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.movement-photos figure {
    margin: 0;
    min-width: 0;
}
.movement-photos a {
    display: block;
    border: 1px solid var(--line);
    border-radius: var(--control-radius);
    background: var(--background);
    overflow: hidden;
    aspect-ratio: 850 / 567;
}
.movement-photos a:hover {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.movement-photos img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.movement-photos figcaption {
    display: flex;
    gap: 7px;
    align-items: baseline;
    font-size: 11px;
    color: var(--ink);
    line-height: 1.5;
    margin-top: 9px;
}
.movement-photos figcaption span {
    flex-shrink: 0;
    color: var(--primary);
    font-family: var(--font-mono);
    font-weight: 700;
}
.movement-steps {
    padding-left: 23px;
    margin: 20px 0 13px;
    font-size: 13px;
    color: var(--muted);
}
.movement-steps li {
    padding-left: 3px;
    margin-bottom: 9px;
}
.movement-steps li::marker {
    color: var(--primary);
    font-weight: 650;
}
.photo-credit {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.6;
}
.photo-credit a {
    text-decoration: underline;
    text-underline-offset: 3px;
    white-space: nowrap;
}
.photo-fallback {
    display: grid;
    place-items: center;
    height: 100%;
    padding: 12px;
    font-size: 12px;
    color: var(--muted);
}
.up-next {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 15px;
    margin: 20px 0;
    background: var(--background);
    border: 1px solid var(--line);
    border-radius: var(--control-radius);
}
.up-next p {
    margin: 4px 0 0;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
}
.up-next small {
    font-size: 11px;
}
.exercise-page-navigation {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
}
.exercise-page-navigation a {
    padding: 12px 20px;
}
#dialog.exercise-preview {
    width: calc(100% - 28px);
    max-width: 640px;
    max-height: calc(100dvh - 40px);
    padding: 0;
    overflow: hidden;
}
#dialog.exercise-preview[open] {
    display: flex;
    flex-direction: column;
}
.exercise-preview #dialog-title {
    padding: 24px 24px 16px;
    margin: 0;
    border-bottom: 1px solid var(--line);
    font-size: 23px;
    flex-shrink: 0;
}
.preview-content {
    padding: 20px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    min-height: 0;
}
.preview-context {
    font-size: 12px;
}
.exercise-preview .dialog-actions {
    padding: 14px 24px max(14px, env(safe-area-inset-bottom));
    margin: 0;
    border-top: 1px solid var(--line);
    background: var(--surface);
    flex-shrink: 0;
}
.exercise-preview .dialog-actions .button {
    width: 100%;
}
@media (max-width: 800px) {
    .exercise-page-navigation {
        position: static;
        background: transparent;
        border: 0;
        padding: 0;
        grid-template-columns: none;
    }
    .exercise-page-navigation a {
        flex-direction: row;
        font-size: 12px;
        padding: 12px;
        gap: 7px;
    }
    .exercise-preview #dialog-title {
        padding: 20px 18px 14px;
    }
    .preview-content {
        padding: 16px 18px;
    }
    .exercise-preview .dialog-actions {
        padding-inline: 18px;
    }
    .movement-photos {
        gap: 10px;
    }
    .up-next .button {
        min-height: 44px;
    }
}
