:root {
    color-scheme: dark;
    --bg: #0a0b0d;
    --panel: #121418;
    --panel-hover: #181b20;
    --text: #f6f7f8;
    --muted: #9298a3;
    --line: rgba(255, 255, 255, 0.09);
    --accent: #c7ff3d;
    --radius: 18px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 12% -10%, rgba(199, 255, 61, 0.08), transparent 30rem),
        var(--bg);
    font-family: "DM Sans", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { color: inherit; }
button:disabled { cursor: not-allowed; opacity: .55; }

.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px clamp(20px, 5vw, 72px);
    border-bottom: 1px solid var(--line);
    background: rgba(10, 11, 13, 0.82);
    backdrop-filter: blur(18px);
}

.main-nav { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.03); }
.nav-button { padding: 8px 14px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 600; cursor: pointer; transition: .2s; }
.nav-button:hover { color: var(--text); }
.nav-button.active { color: #0a0b0d; background: var(--accent); }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    padding: 0;
    border: 0;
    background: none;
    font-family: Manrope, sans-serif;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.12em;
    cursor: pointer;
}

.brand-mark {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 11px;
    color: #0a0b0d;
    background: var(--accent);
    box-shadow: 0 0 30px rgba(199, 255, 61, 0.16);
}

.brand-mark svg { width: 23px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

.search {
    display: flex;
    width: min(390px, 48vw);
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.045);
    transition: border-color .2s, background .2s, box-shadow .2s;
}

.search:focus-within {
    border-color: rgba(199, 255, 61, 0.52);
    background: rgba(255, 255, 255, 0.065);
    box-shadow: 0 0 0 4px rgba(199, 255, 61, 0.06);
}

.search svg { width: 19px; flex: none; fill: none; stroke: #a1a6ae; stroke-width: 1.8; stroke-linecap: round; }
.search input { width: 100%; padding: 0; border: 0; outline: 0; color: var(--text); background: transparent; }
.search input::placeholder { color: #777d87; }
.search kbd { padding: 2px 7px; border: 1px solid var(--line); border-radius: 6px; color: #747a84; background: #0d0f12; font-size: 12px; }

.account-button { display: flex; min-height: 42px; align-items: center; gap: 9px; padding: 5px 11px 5px 5px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.045); font-size: 13px; font-weight: 600; cursor: pointer; }
.account-button:hover { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.075); }
.account-avatar { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; color: #0a0b0d; background: var(--accent); font-weight: 800; }

main { width: min(1500px, 100%); margin: 0 auto; padding: 0 clamp(20px, 5vw, 72px) 72px; }

.hero { padding: clamp(32px, 3.4vw, 52px) 0 clamp(24px, 2.5vw, 36px); }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .16em; }
.hero h1 { max-width: 850px; margin: 0; font: 800 clamp(40px, 5vw, 68px)/.98 Manrope, sans-serif; letter-spacing: -.055em; }
.summary { min-height: 24px; margin: 14px 0 0; color: var(--muted); font-size: 16px; }

.back-button {
    align-items: center;
    gap: 7px;
    margin: 0 0 25px;
    padding: 8px 12px 8px 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #111317;
    cursor: pointer;
}
.back-button:not([hidden]) { display: inline-flex; }
.back-button:hover { border-color: rgba(255,255,255,.2); background: #171a1f; }
.back-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }

.card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    text-align: left;
    cursor: pointer;
    isolation: isolate;
    transition: transform .25s ease, border-color .25s ease, background .25s ease;
    animation: card-in .45s both;
}

.card:hover { transform: translateY(-4px); border-color: rgba(255, 255, 255, 0.2); background: var(--panel-hover); }
.card:focus-visible { outline: 3px solid rgba(199, 255, 61, .7); outline-offset: 3px; }
.card-media { position: relative; overflow: hidden; aspect-ratio: 16 / 10; background: #181b20; }
.card-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(5,6,7,.55)); }
.card-media img { width: 100%; height: 100%; object-fit: cover; opacity: .88; user-select: none; -webkit-user-drag: none; transition: transform .45s ease, opacity .3s; }
.card:hover .card-media img { transform: scale(1.045); opacity: 1; }
.card-body { display: flex; min-height: 84px; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 18px 18px; }
.card-title { overflow: hidden; margin: 0; font: 700 17px/1.25 Manrope, sans-serif; text-overflow: ellipsis; }
.card-meta { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; }
.card-arrow, .play-badge { display: grid; flex: none; place-items: center; border-radius: 50%; }
.card-arrow { width: 35px; height: 35px; border: 1px solid var(--line); transition: color .2s, background .2s; }
.card:hover .card-arrow { color: #08090a; background: var(--accent); }
.card-arrow svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.play-badge { position: absolute; z-index: 2; right: 14px; bottom: 14px; width: 42px; height: 42px; color: #08090a; background: var(--accent); box-shadow: 0 7px 22px rgba(0,0,0,.3); }
.play-badge svg { width: 18px; margin-left: 2px; fill: currentColor; }
.exercise-card .card-body { min-height: 88px; align-items: flex-start; }
.exercise-card .card-title { display: -webkit-box; font-size: 15px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; }

.media-placeholder { display: grid; width: 100%; height: 100%; place-items: center; background: linear-gradient(135deg, #20242a, #111317); color: #555b65; }
.media-placeholder svg { width: 42px; fill: none; stroke: currentColor; stroke-width: 1.4; }

.empty { padding: 80px 20px; color: var(--muted); text-align: center; }
.empty span { display: block; color: #626873; font-size: 56px; line-height: 1; }
.empty p { margin: 12px 0 0; }

.viewer { position: fixed; z-index: 200; inset: 0; display: grid; padding: clamp(14px, 3vw, 36px); place-items: center; }
.viewer[hidden] { display: none; }
.viewer-backdrop { position: absolute; inset: 0; background: rgba(2, 3, 4, .89); backdrop-filter: blur(16px); animation: fade-in .2s both; }
.viewer-content { position: relative; z-index: 1; width: min(1120px, 100%); animation: viewer-in .3s both; }
.viewer-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 16px; }
.viewer-header span { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.viewer-header h2 { margin: 5px 0 0; font: 700 clamp(17px, 2vw, 23px)/1.2 Manrope, sans-serif; }
.close-button { display: grid; width: 44px; height: 44px; flex: none; place-items: center; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; background: rgba(255,255,255,.07); cursor: pointer; }
.close-button:hover { color: #08090a; background: var(--accent); }
.close-button svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.video-frame { overflow: hidden; border: 1px solid rgba(255,255,255,.12); border-radius: 20px; background: #000; box-shadow: 0 30px 100px rgba(0,0,0,.6); }
.video-frame video { display: block; width: 100%; max-height: calc(100vh - 150px); aspect-ratio: 16 / 9; object-fit: contain; background: #000; user-select: none; -webkit-user-drag: none; }
.no-scroll { overflow: hidden; }

.primary-button, .secondary-button, .danger-button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 17px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s, background .2s, border-color .2s;
}
.primary-button { border: 1px solid var(--accent); color: #0a0b0d; background: var(--accent); }
.primary-button:hover { transform: translateY(-1px); background: #d3ff68; }
.secondary-button { border: 1px solid var(--line); background: #17191e; }
.secondary-button:hover { border-color: rgba(255,255,255,.22); background: #1d2026; }
.danger-button { border: 1px solid rgba(255,92,92,.25); color: #ff8383; background: rgba(255,70,70,.08); }
.full-button { width: 100%; }

.workouts-view { padding: clamp(36px, 5vw, 68px) 0 30px; }
.workouts-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 40px; }
.workouts-heading h1 { margin: 0; font: 800 clamp(40px, 5vw, 68px)/1 Manrope, sans-serif; letter-spacing: -.055em; }
.workout-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.workout-card { position: relative; overflow: hidden; min-height: 280px; padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, #16191d, #0f1114); text-align: left; cursor: pointer; animation: card-in .4s both; transition: transform .25s, border-color .25s; }
.workout-card:hover { transform: translateY(-4px); border-color: rgba(199,255,61,.36); }
.workout-card-top { display: flex; align-items: center; justify-content: space-between; }
.workout-index { color: var(--accent); font: 800 12px Manrope, sans-serif; letter-spacing: .12em; }
.workout-edit { color: var(--muted); font-size: 12px; }
.workout-edit b { margin-left: 5px; color: var(--accent); font-size: 16px; }
.workout-card h2 { max-width: 90%; margin: 28px 0 10px; font: 700 25px/1.15 Manrope, sans-serif; letter-spacing: -.025em; }
.workout-stats { display: flex; gap: 7px; color: var(--muted); font-size: 12px; }
.workout-stats span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; }
.workout-preview { position: absolute; right: 22px; bottom: 20px; left: 22px; display: flex; height: 74px; align-items: center; }
.workout-preview-button { position: relative; overflow: hidden; width: 74px; height: 74px; margin-right: -13px; padding: 0; border: 3px solid #121418; border-radius: 50%; background: #fff; cursor: pointer; transition: transform .2s, z-index .2s; }
.workout-preview-button:hover, .workout-preview-button:focus-visible { z-index: 2; transform: translateY(-4px) scale(1.04); }
.workout-preview-button img { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.workout-preview-button span { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.36); font-size: 12px; opacity: 0; transition: opacity .2s; }
.workout-preview-button:hover span, .workout-preview-button:focus-visible span { opacity: 1; }
.workout-preview.no-preview { justify-content: center; border: 1px dashed var(--line); border-radius: 13px; color: #646a74; font-size: 13px; }
.workouts-locked { display: grid; max-width: 570px; margin: 70px auto; justify-items: center; padding: 45px 30px; border: 1px solid var(--line); border-radius: 24px; background: radial-gradient(circle at top, rgba(199,255,61,.09), transparent 60%), var(--panel); text-align: center; }
.locked-icon { display: grid; width: 58px; height: 58px; place-items: center; margin-bottom: 20px; border-radius: 18px; color: #0a0b0d; background: var(--accent); font-size: 28px; font-weight: 800; }
.workouts-locked h2, .workout-empty h2 { margin: 0; font: 700 25px/1.2 Manrope, sans-serif; }
.workouts-locked p, .workout-empty p { margin: 10px 0 25px; color: var(--muted); }
.workout-empty { padding-top: 70px; }
.workout-search-empty { grid-column: 1 / -1; padding: 70px 20px; color: var(--muted); text-align: center; }

.mobile-nav { display: none; }
.modal { position: fixed; z-index: 120; inset: 0; display: grid; padding: 18px; place-items: center; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(2,3,4,.84); backdrop-filter: blur(12px); animation: fade-in .2s both; }
.modal-card { position: relative; z-index: 1; width: min(470px, 100%); max-height: calc(100vh - 36px); overflow: auto; padding: 30px; border: 1px solid rgba(255,255,255,.12); border-radius: 24px; background: #111317; box-shadow: 0 30px 100px rgba(0,0,0,.55); animation: viewer-in .25s both; }
.modal-close { position: absolute; top: 17px; right: 17px; display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #181b20; font-size: 24px; line-height: 1; cursor: pointer; }
.modal-close:hover { color: #0a0b0d; background: var(--accent); }
.modal-close.static-close { position: static; flex: none; }
.auth-mark { display: grid; width: 48px; height: 48px; margin-bottom: 25px; place-items: center; border-radius: 14px; color: #0a0b0d; background: var(--accent); }
.auth-mark svg { width: 30px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.auth-card h2, .editor-header h2, .picker-header h2 { margin: 0; font: 700 28px/1.15 Manrope, sans-serif; letter-spacing: -.03em; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 27px 0 22px; padding: 4px; border-radius: 12px; background: #0b0d0f; }
.auth-tab { padding: 9px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-weight: 600; cursor: pointer; }
.auth-tab.active { color: var(--text); background: #202329; }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field > span, .compact-field > span { color: #aeb3bb; font-size: 12px; font-weight: 600; }
.field input, .compact-field input { width: 100%; border: 1px solid var(--line); outline: none; color: var(--text); background: #0b0d10; transition: border-color .2s, box-shadow .2s; }
.field input { height: 48px; padding: 0 14px; border-radius: 11px; }
.field input:focus, .compact-field input:focus { border-color: rgba(199,255,61,.6); box-shadow: 0 0 0 3px rgba(199,255,61,.07); }
.form-message { min-height: 20px; margin: 4px 0 11px; color: #ff8383; font-size: 13px; }

.workout-editor { width: min(1180px, 100%); padding: 0; }
.editor-header, .picker-header { position: sticky; z-index: 4; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 25px 28px 20px; border-bottom: 1px solid var(--line); background: rgba(17,19,23,.94); backdrop-filter: blur(15px); }
.workout-editor form { padding: 24px 28px 28px; }
.routine-name-field input { font-weight: 600; }
.exercise-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 25px 0 13px; }
.exercise-list-heading > div { display: grid; gap: 3px; }
.exercise-list-heading span { color: var(--muted); font-size: 12px; }
.selected-exercises { display: grid; gap: 9px; }
.selected-exercise { display: grid; grid-template-columns: 64px minmax(180px, 1fr) 76px 96px 96px auto; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #0d0f12; }
.selected-thumb { position: relative; overflow: hidden; width: 64px; height: 54px; padding: 0; border: 0; border-radius: 9px; background: #fff; cursor: pointer; }
.selected-thumb img { width: 100%; height: 100%; object-fit: cover; }
.selected-thumb > span { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.24); font-size: 13px; opacity: 0; transition: opacity .2s; }
.selected-thumb:hover > span { opacity: 1; }
.selected-info { display: grid; min-width: 0; gap: 3px; }
.selected-info span { color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.selected-info strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.compact-field { display: grid; gap: 5px; }
.compact-field input { height: 38px; padding: 0 9px; border-radius: 8px; text-align: center; }
.row-actions { display: flex; gap: 4px; }
.row-actions button { display: grid; width: 31px; height: 31px; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #17191d; cursor: pointer; }
.row-actions .remove-exercise { color: #ff8383; }
.selected-empty { padding: 35px 20px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; }
.selected-empty span { font-size: 30px; }
.selected-empty p { margin: 7px 0 0; }
.editor-actions { position: sticky; z-index: 3; bottom: -28px; display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; margin: 22px -28px -28px; padding: 16px 28px; border-top: 1px solid var(--line); background: rgba(17,19,23,.96); backdrop-filter: blur(15px); }
.modal:not(.is-editing) .workout-editor { width: min(980px, 100%); }
.modal:not(.is-editing) .editor-actions { position: static; display: flex; justify-content: flex-end; margin-top: 25px; }
.edit-workout-button { min-width: 180px; }
.routine-exercise-view { grid-template-columns: 70px 34px minmax(180px, 1fr) auto 72px; min-height: 88px; padding: 9px 15px 9px 9px; border-left: 3px solid transparent; transition: border-color .2s, background .2s; }
.routine-exercise-view:hover { border-left-color: var(--accent); background: #121519; }
.routine-exercise-view .selected-thumb { width: 70px; height: 66px; }
.routine-exercise-view .selected-thumb > span { opacity: 1; background: linear-gradient(135deg, rgba(0,0,0,.08), rgba(0,0,0,.46)); }
.routine-position { color: #59606a; font: 800 12px Manrope, sans-serif; letter-spacing: .08em; text-align: center; }
.routine-prescription { display: grid; grid-template-columns: repeat(3, minmax(72px, 1fr)); align-items: center; }
.routine-prescription span { display: grid; min-height: 42px; place-content: center; padding: 0 15px; border-left: 1px solid var(--line); color: var(--muted); font-size: 10px; text-align: center; text-transform: uppercase; }
.routine-prescription b { display: block; margin-bottom: 3px; color: var(--text); font-size: 14px; text-transform: none; }
.routine-play-hint { color: var(--accent); font-size: 11px; font-weight: 700; text-align: right; }

.picker-modal { z-index: 140; }
.picker-card { width: min(820px, 100%); padding: 0; }
.picker-search { position: sticky; z-index: 3; top: 99px; display: flex; align-items: center; gap: 10px; margin: 0; padding: 15px 28px; border-bottom: 1px solid var(--line); background: rgba(17,19,23,.96); }
.picker-search svg { width: 20px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.picker-search input { width: 100%; padding: 8px 0; border: 0; outline: 0; color: var(--text); background: transparent; }
.picker-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; padding: 18px 28px 28px; }
.picker-group, .picker-exercise { display: grid; grid-template-columns: 62px 1fr auto; min-width: 0; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #0d0f12; text-align: left; cursor: pointer; transition: border-color .2s, background .2s; }
.picker-group:hover, .picker-exercise:hover { border-color: rgba(199,255,61,.4); background: #15181c; }
.picker-group img, .picker-exercise img { width: 62px; height: 52px; border-radius: 8px; object-fit: cover; background: #fff; }
.picker-group > span, .picker-exercise > span { display: grid; min-width: 0; gap: 3px; }
.picker-group strong, .picker-exercise strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.picker-group small, .picker-exercise small { color: var(--muted); font-size: 10px; }
.picker-exercise.added { border-color: rgba(199,255,61,.25); }
.picker-exercise > b { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; color: #0a0b0d; background: var(--accent); }
.picker-back { grid-column: 1 / -1; padding: 10px 0 14px; border: 0; color: var(--accent); background: transparent; text-align: left; cursor: pointer; }
.picker-empty { grid-column: 1 / -1; padding: 70px 20px; color: var(--muted); text-align: center; }

.account-menu { position: fixed; z-index: 90; top: 72px; right: clamp(20px, 5vw, 72px); display: grid; min-width: 230px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #15171b; box-shadow: 0 18px 50px rgba(0,0,0,.45); }
.account-menu[hidden] { display: none; }
.account-menu strong { font-size: 14px; }
.account-menu span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.account-menu button { margin-top: 14px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; color: #ff9393; background: #101215; cursor: pointer; }
.toast { position: fixed; z-index: 220; right: 24px; bottom: 24px; padding: 13px 17px; border: 1px solid rgba(199,255,61,.28); border-radius: 12px; color: var(--text); background: #171a1e; box-shadow: 0 15px 45px rgba(0,0,0,.45); animation: viewer-in .25s both; }
.toast[hidden] { display: none; }
.toast.error { border-color: rgba(255,100,100,.35); }

@keyframes card-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes viewer-in { from { opacity: 0; transform: scale(.97) translateY(8px); } }

@media (max-width: 1100px) {
    .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .workout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .main-nav { display: none; }
    .selected-exercise { grid-template-columns: 58px minmax(150px, 1fr) 68px 86px 86px auto; gap: 8px; }
}
@media (max-width: 760px) {
    .topbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 14px; }
    .brand > span:last-child { display: none; }
    .brand-mark { width: 38px; height: 38px; }
    .topbar-actions { min-width: 0; grid-column: 2 / 4; }
    .search { width: auto; min-width: 0; flex: 1; }
    .search kbd { display: none; }
    .account-button { flex: none; padding-right: 5px; }
    .account-button > span:last-child { display: none; }
    main { padding: 0 14px 100px; }
    .hero { padding-top: 32px; }
    .hero h1 { font-size: clamp(38px, 12vw, 54px); }
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .card { border-radius: 15px; }
    .card-body { min-height: 76px; padding: 14px; }
    .card-title { font-size: 15px; }
    .card-arrow { display: none; }
    .exercise-card .card-title { font-size: 13px; }
    .viewer { padding: 12px; }
    .viewer-header { align-items: center; }
    .video-frame { border-radius: 14px; }
    .mobile-nav { position: fixed; z-index: 80; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); left: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 5px; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; background: rgba(17,19,23,.94); box-shadow: 0 12px 40px rgba(0,0,0,.5); backdrop-filter: blur(18px); }
    .mobile-nav-button { display: flex; height: 50px; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 11px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 700; }
    .mobile-nav-button.active { color: #0a0b0d; background: var(--accent); }
    .mobile-nav-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .workouts-view { padding-top: 34px; }
    .workouts-heading { align-items: flex-end; margin-bottom: 25px; }
    .workouts-heading h1 { font-size: 42px; }
    .workouts-heading .primary-button { width: 46px; min-width: 46px; padding: 0; font-size: 0; }
    .workouts-heading .primary-button span { font-size: 24px; }
    .workout-grid { grid-template-columns: 1fr; gap: 12px; }
    .workout-card { min-height: 245px; }
    .workout-preview-button { width: 68px; height: 68px; }
    .workout-preview-button span { opacity: 1; }
    .workouts-locked { margin: 30px auto; padding: 36px 20px; }
    .modal { padding: 0; align-items: end; }
    .auth-card { width: 100%; max-height: 94dvh; padding: 27px 22px calc(24px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; }
    .workout-editor, .picker-card { width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
    .editor-header, .picker-header { padding: 18px 16px 15px; }
    .editor-header h2, .picker-header h2 { font-size: 23px; }
    .workout-editor form { padding: 17px 14px 24px; }
    .exercise-list-heading { margin-top: 20px; }
    .selected-exercise { grid-template-columns: 56px minmax(0, 1fr) repeat(3, minmax(62px, .65fr)); gap: 8px; padding: 9px; }
    .selected-thumb { width: 56px; height: 50px; }
    .selected-info { grid-column: 2 / 6; }
    .compact-field { grid-row: 2; }
    .selected-exercise .compact-field:nth-of-type(1) { grid-column: 1 / 2; }
    .selected-exercise .compact-field:nth-of-type(2) { grid-column: 2 / 3; }
    .selected-exercise .compact-field:nth-of-type(3) { grid-column: 3 / 5; }
    .row-actions { grid-column: 5 / 6; grid-row: 2; justify-content: flex-end; }
    .row-actions button { width: 29px; }
    .routine-exercise-view { grid-template-columns: 62px minmax(0, 1fr); min-height: 104px; padding: 9px; }
    .routine-exercise-view .selected-thumb { grid-column: 1; grid-row: 1 / 3; width: 62px; height: 62px; }
    .routine-exercise-view .routine-position { display: none; }
    .routine-exercise-view .selected-info { grid-column: 2; grid-row: 1; }
    .routine-exercise-view .routine-prescription { grid-column: 2; grid-row: 2; grid-template-columns: repeat(3, 1fr); }
    .routine-exercise-view .routine-prescription span { min-height: 34px; padding: 0 7px; font-size: 8px; }
    .routine-exercise-view .routine-prescription span:first-child { border-left: 0; }
    .routine-exercise-view .routine-prescription b { font-size: 12px; }
    .routine-exercise-view .routine-play-hint { display: none; }
    .editor-actions { bottom: -24px; grid-template-columns: auto 1fr auto; margin: 18px -14px -24px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
    .editor-actions > span { display: none; }
    .editor-actions .secondary-button { display: none; }
    .modal:not(.is-editing) .editor-actions { margin: 18px -14px -24px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
    .edit-workout-button { width: 100%; }
    .picker-search { top: 82px; padding: 12px 16px; }
    .picker-grid { grid-template-columns: 1fr; padding: 12px 14px 90px; }
    .account-menu { top: 66px; right: 14px; }
    .toast { right: 14px; bottom: calc(79px + env(safe-area-inset-bottom)); left: 14px; text-align: center; }
}

@media (max-width: 420px) {
    .grid { grid-template-columns: 1fr 1fr; }
    .card-media { aspect-ratio: 1.2; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
