* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    /* Fix blue highlight on mobile */
}

button {
    -webkit-appearance: none;
    /* Normalize mobile button look */
    -moz-appearance: none;
    appearance: none;
    outline: none;
    /* Remove focus ring */
    touch-action: manipulation;
    /* Improve touch response */
    -webkit-user-select: none;
    /* Prevent text selection */
    user-select: none;
    z-index: 10;
    /* Ensure visibility for clicks */
}

.pill-btn {
    cursor: pointer;
}

/* Fix "white outline" issue by resetting borders on specific buttons explicitly if needed, but the global reset helper helps */

:root {
    --bg: #070709;
    --bg-2: #0b0b10;
    --card: rgba(255, 255, 255, 0.085);
    --card-2: rgba(255, 255, 255, 0.12);
    --stroke: rgba(255, 255, 255, 0.14);
    --stroke-2: rgba(255, 255, 255, 0.22);

    --text: #ffffff;
    --text-2: rgba(255, 255, 255, 0.78);
    --text-3: rgba(255, 255, 255, 0.54);

    --accent: #ffffff; /* full black + white accent */
    --accent-2: rgba(255, 255, 255, 0.85);
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.65);
    --shadow-2: 0 10px 30px rgba(0, 0, 0, 0.55);
    --radius: 18px;
    --radius-2: 14px;
    --radius-3: 12px;

    --space-1: 8px;
    --space-2: 12px;
    --space-3: 16px;
    --space-4: 20px;
    --space-5: 28px;
    --space-6: 40px;

    /* Telegram Mini App safe-area (defaults for non-Telegram) */
    --tg-top-inset: 56px;
    --tg-bottom-inset: 0px;

    /* App background (must also fill tg inset area) */
    --app-bg: radial-gradient(1200px 800px at 20% -10%, rgba(255,255,255,0.08) 0%, transparent 60%),
              radial-gradient(900px 600px at 90% 10%, rgba(255,255,255,0.06) 0%, transparent 55%),
              var(--bg);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

html,
body {
    background: var(--bg);
}

/* Typography polish */
.h1 {
    font-size: 30px;
    letter-spacing: -0.03em;
}

.h2 {
    font-size: 21px;
    letter-spacing: -0.025em;
}

.subtle {
    font-size: 13px;
    line-height: 1.35;
}

.section-title {
    font-size: 11px;
    letter-spacing: 0.11em;
}

.label {
    font-size: 10px;
    letter-spacing: 0.10em;
}

.pill {
    letter-spacing: 0.02em;
}

.day-card-title {
    line-height: 1.15;
}

.page,
.workout-container {
    padding-left: 16px;
    padding-right: 16px;
}

.page {
    max-width: 520px;
}

.topbar {
    margin-bottom: 18px;
}

.hero {
    margin-bottom: 20px;
}

.grid2 {
    gap: 14px;
}

.page.profile-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    min-height: calc(100dvh - var(--tg-top-inset, 56px));
    padding-top: 8px;
    padding-bottom: 96px;
}

.page.profile-page .hero {
    margin-top: 0;
    margin-bottom: 18px;
}

.page.profile-page .grid2 {
    margin-top: 6px;
}

.card-title {
    color: var(--text);
}

.card-sub {
    color: var(--text-2);
}

.card-btn {
    padding: 18px;
}

.card-title {
    font-size: 19px;
    line-height: 1.15;
}

.card-sub {
    font-size: 12px;
}

.day-buttons.v2 {
    gap: 14px;
}

.day-card {
    padding: 18px;
    gap: 16px;
}

.badge {
    padding: 6px 12px;
    margin-bottom: 12px;
}

.day-card-title {
    font-size: 19px;
}

.day-card-sub {
    font-size: 12px;
}

.kpi {
    min-width: 78px;
}

.kpi-val {
    font-size: 24px;
}

.kpi-lbl {
    font-size: 10px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 14px;
}

.pill {
    padding: 8px 12px;
}

.bottom-nav {
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
    gap: 12px;
}

.nav-btn {
    border-radius: 18px;
    padding: 12px 14px;
}

.nav-ic {
    width: 19px;
    height: 19px;
}

.nav-tx {
    font-size: 12px;
}

.nav-btn.active {
    box-shadow: 0 0 0 1px rgba(255,255,255,0.14) inset, 0 18px 60px rgba(0,0,0,0.55);
}
.app {
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: var(--tg-top-inset, 56px);
    padding-bottom: calc(var(--tg-bottom-inset, 0px) + env(safe-area-inset-bottom, 0px));
    background: var(--app-bg);
}

.page {
    max-width: 560px;
    margin: 0 auto;
    min-height: calc(100dvh - var(--tg-top-inset, 56px));
    padding: 18px 16px 96px;
}

.h1 {
    font-size: 28px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-weight: 800;
}

.h2 {
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-weight: 750;
}

.subtle {
    color: var(--text-2);
    font-size: 13px;
}

.hero {
    margin-top: 10px;
    margin-bottom: 18px;
}

.hero-compact {
    margin-top: 6px;
}

.hero-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow-2);
    margin-bottom: 12px;
}

.hero-icon {
    width: 24px;
    height: 24px;
    color: var(--text);
}

.hero-icon svg {
    width: 100%;
    height: 100%;
}

.grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.card {
    background: var(--card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    box-shadow: var(--shadow-2);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.card-btn {
    padding: 16px;
    text-align: left;
    cursor: pointer;
    transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.card-btn:active {
    transform: scale(0.99);
}

.card-title {
    font-weight: 850;
    letter-spacing: -0.02em;
    font-size: 18px;
}

.card-sub {
    margin-top: 6px;
    color: var(--text-3);
    font-size: 12px;
}

.hint-row {
    margin-top: 14px;
    display: flex;
    justify-content: center;
}

.link-btn {
    background: transparent;
    border: 1px solid var(--stroke);
    border-radius: 999px;
    padding: 10px 14px;
    color: var(--text-2);
    font-weight: 650;
    cursor: pointer;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--stroke);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 650;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--stroke);
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

.day-buttons.v2 {
    display: grid;
    gap: 12px;
}

.day-card {
    width: 100%;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow-2);
    cursor: pointer;
    text-align: left;
    color: var(--text);
}

.day-card-left {
    min-width: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--stroke);
    color: var(--text-2);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.badge-alt {
    background: rgba(255, 255, 255, 0.04);
}

.day-card-title {
    font-size: 18px;
    font-weight: 850;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    color: var(--text);
}

.day-card-sub {
    color: var(--text-2);
    font-size: 12px;
    line-height: 1.35;
}

.kpi {
    min-width: 72px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
}

.kpi-val {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--text);
}

.kpi-lbl {
    color: var(--text-3);
    font-size: 11px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(7, 7, 9, 0.70);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    z-index: 300;
}

.bottom-nav::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -18px;
    height: 18px;
    background: linear-gradient(to bottom, transparent, rgba(7, 7, 9, 0.70));
    pointer-events: none;
}

.nav-btn {
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 10px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-2);
    cursor: pointer;
}

.nav-btn:active {
    transform: translateY(1px);
}

.nav-btn .nav-ic {
    opacity: 0.9;
}

.nav-btn.active .nav-ic {
    opacity: 1;
}

.nav-btn:focus-visible {
    outline: 2px solid rgba(255,255,255,0.22);
    outline-offset: 2px;
}

.nav-btn.active {
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.10);
    color: var(--text);
}

.nav-ic {
    width: 18px;
    height: 18px;
    display: inline-flex;
}

.nav-ic svg {
    width: 100%;
    height: 100%;
}

.nav-tx {
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0.02em;
}

.section {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.section-title {
    font-size: 12px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
    margin-bottom: 12px;
}

.segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.seg-btn {
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 12px 12px;
    color: var(--text-2);
    cursor: pointer;
    font-weight: 850;
    letter-spacing: -0.02em;
}

.seg-btn.active {
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.10);
    color: var(--text);
}

.btn {
    width: 100%;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 12px 14px;
    font-weight: 800;
    cursor: pointer;
}

.btn-primary {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.20);
    color: var(--text);
    box-shadow: var(--shadow-2);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.list {
    display: grid;
    gap: 10px;
    margin-bottom: 10px;
}

.ex-row {
    padding: 14px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.ex-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.ex-row-title {
    font-weight: 850;
    letter-spacing: -0.02em;
    font-size: 14px;
}

.danger-btn {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 8px 10px;
    color: var(--text-2);
    cursor: pointer;
    font-weight: 800;
}

[data-reorder-handle="1"] {
    touch-action: none;
    cursor: grab;
}

.is-reordering [data-reorder-handle="1"] {
    cursor: grabbing;
}

.ex-row.is-dragging {
    outline: 2px solid rgba(255,255,255,0.22);
    outline-offset: 2px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.field {
    display: grid;
    gap: 6px;
}

.label {
    font-size: 11px;
    color: var(--text-3);
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.input {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text);
    padding: 10px 12px;
    outline: none;
}

.input:focus {
    border-color: rgba(255, 255, 255, 0.24);
}

/* Hide legacy layout blocks when v2 is active */
.container,
.logo,
.stats-bar,
.wiki-main-btn,
.day-btn {
    /* legacy blocks (kept for workout screen pieces) */
}

/* Main Screen background updated */
#main-screen {
    background: transparent;
}

/* Remove old conflicting main-screen background rules (legacy) */
#main-screen .container {
    min-height: unset;
    height: auto;
    display: block;
    overflow: visible;
}

/* -------------------------------------------------------------------------- */
/* Legacy tokens mapping for workout UI (temporary, will be refined)           */
/* -------------------------------------------------------------------------- */
:root {
    --bg-primary: var(--bg);
    --bg-secondary: var(--bg-2);
    --bg-card: rgba(255, 255, 255, 0.06);
    --bg-hover: rgba(255, 255, 255, 0.10);
    --border: rgba(255, 255, 255, 0.10);
    --text-primary: var(--text);
    --text-secondary: var(--text-2);
    --text-muted: var(--text-3);
    --success: rgba(255, 255, 255, 0.85);
    --accent: var(--accent);
    --accent-secondary: var(--accent-2);
    --accent-glow: rgba(255, 255, 255, 0.22);
    --gradient-1: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.75) 100%);
    --gradient-2: linear-gradient(135deg, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.65) 100%);
}

.screen {
    display: none;
    min-height: 100vh;
    min-height: 100dvh;
}

.screen.active {
    display: block;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 12px;
}

/* Main Screen (legacy rules disabled; v2 uses .page) */
#main-screen .container {
    display: block;
}

.logo {
    text-align: center;
}

.logo-icon {
    font-size: 48px;
    margin-bottom: 10px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.logo h1 {
    font-size: 22px;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.day-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.day-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
}

.day-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    /* CRITICAL: prevent blocking touches on mobile */
}

.day-a::before {
    background: var(--gradient-1);
}

.day-b::before {
    background: var(--gradient-2);
}

.day-btn:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.2);
}

.day-btn:hover::before {
    opacity: 0.1;
}

.day-btn:active {
    transform: translateY(-2px);
}

.day-letter {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    color: white;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.day-a .day-letter {
    background: var(--gradient-1);
}

.day-b .day-letter {
    background: var(--gradient-2);
}

.day-muscles {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 28px;
    padding: 14px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wiki-main-btn {
    width: 100%;
    padding: 12px;
    background: var(--bg-card);
    border: none;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.wiki-main-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

/* Workout Screen */
#workout-screen {
    background: transparent;
}

.workout-container {
    max-width: 520px;
    margin: 0 auto;
    min-height: calc(100dvh - var(--tg-top-inset, 0px));
    display: flex;
    flex-direction: column;
    padding: 14px 16px 18px;
    overflow: hidden;
}

.workout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0 10px;
}

.back-btn,
.info-btn {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.back-btn:hover,
.info-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

.workout-progress {
    flex: 1;
    text-align: center;
    padding: 0 16px;
}

#exercise-counter {
    font-size: 14px;
    color: var(--text-3);
    font-weight: 650;
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0.95), rgba(255,255,255,0.65));
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Exercise Display */
.exercise-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px;
}

.exercise-number {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 8px;
}

.exercise-title {
    font-size: 18px;
    font-weight: 850;
    margin-bottom: 4px;
    line-height: 1.2;
    padding: 0 8px;
}

.exercise-target {
    color: var(--text-2);
    font-size: 12px;
    margin-bottom: 12px;
}

.sets-info {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.06);
    padding: 10px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    margin-bottom: 10px;
}

.set-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.set-label {
    font-size: 12px;
    color: var(--text-3);
    text-transform: uppercase;
}

.set-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.set-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
}

.current-set-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.current-set-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.set-dots {
    display: flex;
    gap: 8px;
}

.set-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.set-dot.active {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.set-dot.done {
    background: var(--success);
    border-color: var(--success);
}

/* Timer Section */
/* Rest sheet (v2 timer UI) */
.rest-sheet {
    display: block;
    margin-top: 10px;
    opacity: 0.88;
    transition: opacity 180ms ease;
}

.rest-sheet.active {
    opacity: 1;
}

.rest-sheet:not(.active) .secondary-cta {
    display: none !important;
}

.rest-sheet:not(.active) .timer-progress {
    opacity: 0.22;
    filter: none;
}

.rest-sheet:not(.active) .timer-bg {
    stroke: rgba(255, 255, 255, 0.06);
}

.rest-sheet-inner {
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background:
        radial-gradient(900px 260px at 50% 0%, rgba(255,255,255,0.10) 0%, transparent 55%),
        rgba(255, 255, 255, 0.06);
    box-shadow: var(--shadow);
    padding: 16px;
    overflow: hidden;
}

.rest-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.rest-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(0,0,0,0.18);
    color: rgba(255,255,255,0.86);
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 10px;
}

.rest-sub {
    color: var(--text-3);
    font-size: 12px;
    font-weight: 650;
}

.rest-hero {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 168px;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}

.rest-time {
    display: grid;
    gap: 6px;
}

.rest-time-val {
    font-size: 46px;
    line-height: 1;
    font-weight: 950;
    letter-spacing: -0.04em;
    color: var(--text);
}

.rest-time-unit {
    color: rgba(255,255,255,0.65);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.rest-ring {
    width: 168px;
    height: 168px;
    display: grid;
    place-items: center;
    justify-self: end;
}

.timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 10;
}

.timer-progress {
    fill: none;
    stroke: rgba(255,255,255,0.92);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.08s linear;
    filter: drop-shadow(0 0 14px rgba(255,255,255,0.22));
}

.rest-actions {
    display: grid;
    gap: 10px;
}

.primary-cta {
    width: 100%;
    padding: 14px 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.12);
    color: var(--text);
    font-size: 15px;
    font-weight: 900;
    letter-spacing: -0.01em;
    cursor: pointer;
    box-shadow: var(--shadow-2);
}

.primary-cta:active {
    transform: translateY(1px);
}

.secondary-cta {
    width: 100%;
    padding: 13px 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(0,0,0,0.16);
    color: rgba(255,255,255,0.70);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    display: none;
}

.secondary-cta.visible {
    display: block;
}

/* Map old classes to new buttons */
.primary-cta.resting {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.22);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 200;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#modal-body h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    padding-right: 40px;
}

.modal-target {
    color: var(--accent);
    font-size: 14px;
    margin-bottom: 24px;
}

.modal-section {
    margin-bottom: 24px;
}

.modal-section h4 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.modal-section ul,
.modal-section ol {
    padding-left: 20px;
}

.modal-section li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.tip-good {
    color: var(--success);
}

.tip-bad {
    color: #ef4444;
}

.breathing-tip {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    border-left: 3px solid var(--accent);
}

.breathing-tip p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Wiki Modal */
.wiki-content {
    max-height: 90vh;
}

.wiki-body h2 {
    font-size: 24px;
    margin-bottom: 24px;
    text-align: center;
}

.wiki-section-block {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
}

.wiki-section-block h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--accent);
}

.wiki-table {
    width: 100%;
    border-collapse: collapse;
}

.wiki-table td {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.wiki-table td:last-child {
    text-align: right;
    color: var(--text-secondary);
}

.wiki-tips {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.wiki-tips p {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.progression-example {
    text-align: center;
}

.prog-step {
    background: var(--bg-hover);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    font-family: monospace;
}

.prog-step.highlight {
    background: var(--accent);
    color: white;
}

.prog-arrow {
    color: var(--accent);
    font-size: 20px;
}

.wiki-note {
    margin-top: 16px;
    color: var(--success);
    font-weight: 500;
    text-align: center;
}

.schedule p {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.wiki-section-block ul,
.wiki-section-block ol {
    padding-left: 20px;
    color: var(--text-secondary);
}

.wiki-section-block li {
    margin-bottom: 8px;
}

/* Complete Modal */
.complete-content {
    text-align: center;
    padding: 40px 24px;
}

.complete-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.complete-content h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
}

.complete-text {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 32px;
}

.complete-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 32px;
}

.complete-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.complete-stat-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--accent);
}

.complete-stat-label {
    font-size: 14px;
    color: var(--text-muted);
}

.complete-btn {
    width: 100%;
    padding: 18px;
    background: var(--gradient-1);
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.complete-btn:hover {
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 400px) {
    .logo h1 {
        font-size: 24px;
    }

    .day-btn {
        padding: 20px;
    }

    .day-letter {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .stats-bar {
        gap: 24px;
        padding: 20px;
    }

    .exercise-title {
        font-size: 20px;
    }

    .timer-ring {
        width: 160px;
        height: 160px;
    }

    #timer-value {
        font-size: 40px;
    }
}