/* ==========================================================================
   /breath-test — the weekly breath test (js/breath-test.js)
   Grown Light (2026-11-27): the test itself sits on a panel of sky, like a
   session's stage; the history is a white card. Numbers are Figtree bold.
   ========================================================================== */

.bt-card {
    max-width: 40rem;
    margin: 0 auto 2rem;
    padding: 1.6rem 1.5rem 1.7rem;
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--lift);
    scroll-margin-top: 1rem;
}

/* The test: a panel of sky, white type, the ink pill. */
.bt-card[data-breath-test] {
    --ink: #FFFFFF;
    --muted: #E6F0FC;
    --link: #FFFFFF;
    --link-hover: #FFFFFF;
    --well: rgba(5, 26, 68, 0.24);
    --line: rgba(255, 255, 255, 0.22);
    --surface: #FFFFFF;
    max-width: 44rem;
    padding: clamp(1.5rem, 1.1rem + 1.6vw, 2.5rem);
    color: #FFFFFF;
    background: linear-gradient(180deg, #1B63C4 0%, #2B74D3 48%, #2468C6 100%);
    border-radius: var(--radius-panel, 32px);
    box-shadow: 0 30px 60px -38px rgba(27, 99, 196, 0.65);
    text-align: center;
}

body.night .bt-card[data-breath-test] { background: linear-gradient(180deg, #040C1C, #10233F); --muted: #B4C2D6; }

.bt-card[data-breath-test] .bt-result .bt-pill { color: #0A1A2B; }
.bt-card[data-breath-test] .bt-button { color: #FFFFFF; background: #0A1A2B; }
body.night .bt-card[data-breath-test] .bt-button { color: #0A1A2B; background: #FFC46E; }
.bt-card[data-breath-test] .bt-button[aria-disabled="true"] { color: #FFFFFF; background: rgba(5, 26, 68, 0.3); }
.bt-card[data-breath-test] :focus-visible { outline-color: #FFFFFF; }

.breath-test-page .bt-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0 0 1rem;
}

.breath-test-page .bt-card h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 0 0 0.4rem;
}

.bt-step {
    margin: 0 0 0.35rem;
    font-family: var(--sans);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.bt-instruction {
    margin: 0 0 1.25rem;
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--ink);
    min-height: 3.3em;
}

/* --------------------------------------------------------- dial and button */

.bt-dial {
    display: grid;
    justify-items: center;
    gap: 1rem;
    margin: 0.5rem 0 0.75rem;
}

.bt-clock {
    margin: 0;
    font-family: var(--sans);
    font-weight: 700;
    letter-spacing: -0.04em;
    font-size: clamp(4rem, 3rem + 4vw, 6rem);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: var(--ink);
}

.bt-button {
    position: relative;
    min-width: 11rem;
    min-height: 64px;
    padding: 0.9rem 2.25rem;
    font-family: var(--sans);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--on-action);
    background: var(--action);
    border: 0;
    border-radius: var(--radius-pill);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: opacity var(--dur-tap, 160ms) ease;
}

.bt-button:hover { opacity: 0.88; }

.bt-button:focus-visible,
.bt-pill:focus-visible,
.bt-text-btn:focus-visible {
    outline: 3px solid var(--link);
    outline-offset: 3px;
}

.bt-button[aria-disabled="true"] {
    color: var(--muted);
    background: var(--well);
    cursor: default;
    opacity: 1;
}

/* While the clock runs, one slow halo around the button. Off for reduced motion. */
[data-state="running"] .bt-button::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: inherit;
    box-shadow: 0 0 0 2px var(--link);
    opacity: 0.5;
    animation: bt-halo 3.2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes bt-halo {
    0%, 100% { opacity: 0.15; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
    [data-state="running"] .bt-button::after {
        animation: none;
        opacity: 0.45;
    }
    .bt-button { transition: none; }
}

.bt-safety-line {
    margin: 0 auto 0.5rem;
    max-width: 30rem;
    font-size: var(--fs-small);
    line-height: 1.55;
    text-align: center;
    color: var(--muted);
}

.bt-cancel-row { margin: 0; text-align: center; min-height: 2.25rem; }

/* ------------------------------------------------------------------ result */

.bt-result {
    margin: 1.25rem 0 0;
    padding: 1.25rem 1.25rem 1.35rem;
    background: var(--well);
    border-radius: calc(var(--radius-card) - 4px);
    text-align: center;
}

.bt-result-value {
    margin: 0 0 0.4rem;
    font-family: var(--sans);
    font-weight: 700;
    letter-spacing: -0.04em;
    font-size: 2.75rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    color: var(--ink);
}

.bt-result-value:empty { display: none; }

.bt-result-line {
    margin: 0 0 0.4rem;
    font-size: 1rem;
    line-height: 1.55;
    color: var(--ink);
}

.bt-result-change,
.bt-result-what {
    margin: 0 0 0.6rem;
    font-size: var(--fs-small);
    line-height: 1.55;
    color: var(--muted);
}

.bt-result-change:empty { display: none; }
.bt-result[data-kind="retry"] .bt-result-what { display: none; }

/* -------------------------------------------------------------- pills etc. */

.bt-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.55rem 1.2rem;
    font-family: var(--sans);
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--ink);
    background: var(--well);
    border: 0;
    border-radius: var(--radius-pill);
    text-decoration: none;
    cursor: pointer;
}

.bt-result .bt-pill { background: var(--surface); }

.prose a.bt-pill,
a.bt-pill { color: var(--ink); }

.bt-pill:hover { background: var(--line, var(--well)); }

.bt-pill-strong {
    color: var(--on-action);
    background: var(--action);
}

.bt-pill-strong:hover { background: var(--action); opacity: 0.88; }

.bt-text-btn {
    min-height: var(--hit);
    padding: 0.4rem 0.4rem;
    font-family: var(--sans);
    font-size: var(--fs-small);
    color: var(--link);
    background: none;
    border: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.bt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.6rem 0 0;
}

.bt-muted {
    margin: 0 0 0.75rem;
    font-size: var(--fs-small);
    line-height: 1.55;
    color: var(--muted);
}

.bt-status { margin: 0.6rem 0 0; }
.bt-status:empty { display: none; }

/* ----------------------------------------------------------------- history */

.bt-chart {
    display: block;
    width: 100%;
    height: auto;
    max-width: 32rem;
    margin: 0 auto 0.5rem;
    overflow: visible;
}

.bt-chart-axis { stroke: var(--muted); stroke-width: 1; opacity: 0.5; }
.bt-chart-grid { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 4; opacity: 0.35; }
.bt-chart-line { fill: none; stroke: var(--link); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.bt-chart-dot { fill: var(--surface); stroke: var(--link); stroke-width: 2.5; }
.bt-chart-label { font-family: var(--mono); font-size: 11px; fill: var(--muted); }
.bt-chart-value { font-family: var(--mono); font-size: 12px; fill: var(--ink); }

.bt-summary {
    margin: 0 0 0.75rem;
    font-size: var(--fs-small);
    line-height: 1.55;
    color: var(--ink);
}

.bt-locked {
    margin: 0 0 0.75rem;
    font-size: var(--fs-small);
    line-height: 1.55;
    color: var(--muted);
}

.bt-locked a { color: var(--link); }

.bt-reminder {
    margin: 1.5rem 0 0;
    padding: 1.1rem 1.15rem 1.2rem;
    background: var(--well);
    border-radius: calc(var(--radius-card) - 4px);
}

.bt-reminder .bt-pill { background: var(--surface); }

.bt-time-label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    font-size: var(--fs-small);
    font-weight: 600;
    color: var(--ink);
}

.bt-time {
    min-height: 44px;
    padding: 0.5rem 0.9rem;
    font-family: var(--mono);
    font-size: 1rem;
    color: var(--ink);
    background: var(--surface);
    border: 0;
    border-radius: 12px;
}

.bt-clear { margin: 1.25rem 0 0; }

.bt-confirm p {
    margin: 0 0 0.25rem;
    font-size: var(--fs-small);
    color: var(--ink);
}

@media (max-width: 480px) {
    .bt-card { padding: 1.3rem 1.1rem 1.4rem; }
    .bt-clock { font-size: 2.5rem; }
    .bt-button { width: 100%; }
}
