.stopwatch-page {
    min-height: 100vh;
}

.stopwatch-topbar {
    width: min(1480px, calc(100% - 48px));
    margin: 0 auto;
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.stopwatch-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ghost-link {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
}

.stopwatch-layout {
    width: min(1480px, calc(100% - 48px));
    margin: 0 auto 36px;
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 22px;
}

.stopwatch-main {
    min-width: 0;
}

.stopwatch-heading {
    min-height: 72px;
    margin: 8px 0 18px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.stopwatch-heading h1,
.stopwatch-card h2,
.laps-card h2 {
    margin: 0;
    letter-spacing: -0.04em;
}

.stopwatch-heading p:not(.eyebrow) {
    margin: 8px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.stopwatch-status {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-secondary);
    background: var(--surface);
    font-size: 12px;
    font-weight: 800;
}

.stopwatch-status.is-running {
    color: #0f8c65;
}

.stopwatch-status.is-paused {
    color: #b46a00;
}

.stopwatch-card,
.laps-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.stopwatch-card {
    padding: clamp(20px, 4vw, 34px);
}

.card-heading,
.laps-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.stopwatch-display {
    margin: clamp(40px, 7vw, 72px) 0 38px;
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 9px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.stopwatch-display > span:not(.stopwatch-separator):not(.stopwatch-milliseconds) {
    font-size: clamp(64px, 10vw, 148px);
    font-weight: 800;
    letter-spacing: -0.08em;
    line-height: 0.9;
}

.stopwatch-separator {
    color: var(--text-secondary);
    font-size: clamp(44px, 7vw, 86px);
    line-height: 1;
}

.stopwatch-milliseconds {
    color: var(--primary);
    font-size: clamp(24px, 3.2vw, 42px);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.stopwatch-controls {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1fr;
    gap: 10px;
}

.stopwatch-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.stopwatch-note {
    margin: 18px 0 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.laps-card {
    margin-top: 16px;
    padding: 22px;
}

.laps-heading {
    align-items: center;
}

.laps-heading > span {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.laps-empty {
    margin-top: 18px;
    padding: 28px 18px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    color: var(--text-secondary);
}

.laps-empty > span {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 10px;
    border-radius: 50%;
    background: var(--surface-soft);
    color: var(--primary);
    font-size: 20px;
}

.laps-empty strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.laps-empty p {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
}

.lap-list {
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.lap-item {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
}

.lap-number {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lap-total,
.lap-split {
    font-variant-numeric: tabular-nums;
}

.lap-total {
    font-weight: 800;
}

.lap-split {
    color: var(--text-secondary);
    font-size: 12px;
}

.is-hidden {
    display: none !important;
}

@media (max-width: 1024px) {
    .stopwatch-topbar,
    .stopwatch-layout {
        width: min(100% - 28px, 920px);
    }

    .stopwatch-layout {
        grid-template-columns: 190px minmax(0, 1fr);
    }

    .stopwatch-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    body {
        padding-bottom: 84px;
    }

    .stopwatch-topbar,
    .stopwatch-layout {
        width: calc(100% - 24px);
    }

    .stopwatch-topbar {
        min-height: 78px;
    }

    .stopwatch-layout {
        display: block;
        margin-bottom: 18px;
    }

    .stopwatch-sidebar {
        display: none;
    }

    .stopwatch-heading {
        min-height: auto;
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .stopwatch-card {
        padding: 18px 14px;
        border-radius: 20px;
    }

    .stopwatch-display {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 6px;
    }

    .stopwatch-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .laps-card {
        padding: 16px;
        border-radius: 20px;
    }

    .lap-item {
        grid-template-columns: 58px minmax(0, 1fr);
    }

    .lap-split {
        grid-column: 2;
    }

    .stopwatch-mobile-nav {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 10px;
        z-index: 10;
        min-height: 64px;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        align-items: center;
        gap: 4px;
        padding: 6px;
        background: rgba(255, 255, 255, 0.94);
        backdrop-filter: blur(16px);
        border: 1px solid var(--border);
        border-radius: 18px;
        box-shadow: 0 16px 36px rgba(15, 31, 58, 0.14);
    }

    .stopwatch-mobile-nav .mobile-nav-item {
        min-height: 52px;
        display: grid;
        place-items: center;
        gap: 2px;
        border-radius: 13px;
        color: var(--text-secondary);
        font-size: 18px;
    }

    .stopwatch-mobile-nav .mobile-nav-item small {
        font-size: 9px;
        font-weight: 800;
    }

    .stopwatch-mobile-nav .mobile-nav-item.is-active {
        background: #e9f0ff;
        color: var(--primary);
    }
}

@media (prefers-color-scheme: dark) {
    .stopwatch-mobile-nav {
        background: rgba(16, 28, 49, 0.94);
    }

    .stopwatch-mobile-nav .mobile-nav-item.is-active {
        background: #173464;
    }
}
