/* =========================================================
   PACE66 shared stylesheet
   ========================================================= */

:root {
    --pace66-navy: #0b1f33;
    --pace66-teal: #16a6a1;
    --pace66-blue: #2978d0;
    --pace66-surface: #ffffff;
    --pace66-text: #10273b;
    --pace66-muted: #5d6e7d;
    --pace66-wash: #f4f8fa;
    --pace66-border: #dfe8ec;
    --pace66-gradient: linear-gradient(110deg, var(--pace66-teal), var(--pace66-blue));
    --pace66-shadow: 0 12px 36px rgba(11, 31, 51, 0.09);
    --background: #f5f5f5;
    --surface: #ffffff;
    --text: #222222;
    --muted: #666666;
    --border: #dddddd;
    --soft-border: #eeeeee;
    --accent: #222222;
    --facebook: #1877f2;

    --radius: 12px;
    --small-radius: 6px;

    --shadow:
        0 4px 18px rgba(0, 0, 0, 0.10);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --pace66-navy: #e8f2f7;
    --pace66-teal: #43c9c3;
    --pace66-blue: #67aaf3;
    --pace66-surface: #17252e;
    --pace66-text: #e8eef2;
    --pace66-muted: #a9b8c2;
    --pace66-wash: #0e181f;
    --pace66-border: #344752;
    --pace66-shadow: 0 12px 36px rgba(0, 0, 0, .3);
    --background: #0e181f;
    --surface: #17252e;
    --text: #e8eef2;
    --muted: #a9b8c2;
    --border: #344752;
    --soft-border: #293b45;
    --accent: #43c9c3;
    --shadow: 0 4px 18px rgba(0, 0, 0, .3);
}

html[data-theme="dark"] body:not(.landing-page),
html[data-theme="dark"] .app-page,
html[data-theme="dark"] .login-page,
html[data-theme="dark"] .auth-callback-page {
    background-color: var(--pace66-wash);
    color: var(--pace66-text);
}

html[data-theme="dark"] .dashboard-header,
html[data-theme="dark"] .app-nav,
html[data-theme="dark"] .app-card,
html[data-theme="dark"] .auth-callback-card,
html[data-theme="dark"] .login-container,
html[data-theme="dark"] .goal-modal,
html[data-theme="dark"] .history-modal,
html[data-theme="dark"] .activity-modal,
html[data-theme="dark"] .feedback-modal,
html[data-theme="dark"] .signup-consent-dialog,
html[data-theme="dark"] .legal-consent-card,
html[data-theme="dark"] .legal-document {
    background: var(--pace66-surface);
    color: var(--pace66-text);
    border-color: var(--pace66-border);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] button:not(.button-primary):not(.goal-history-action):not(.activities-load-more):not(.activities-retry) {
    background-color: #1c2c36;
    color: var(--pace66-text);
    border-color: #49606d;
}

html[data-theme="dark"] .dashboard-page .goal-period,
html[data-theme="dark"] .history-overview,
html[data-theme="dark"] .history-overview-item,
html[data-theme="dark"] .history-period-card,
html[data-theme="dark"] .onboarding-integration-card,
html[data-theme="dark"] .integration-row,
html[data-theme="dark"] .activity-provider-details,
html[data-theme="dark"] .performance-empty,
html[data-theme="dark"] .way-card,
html[data-theme="dark"] .step-card,
html[data-theme="dark"] .feature-card,
html[data-theme="dark"] .progress-preview {
    background: #1c2c36;
    color: var(--pace66-text);
    border-color: var(--pace66-border);
}

html[data-theme="dark"] .dashboard-page h1,
html[data-theme="dark"] .dashboard-page h2,
html[data-theme="dark"] .dashboard-page h3,
html[data-theme="dark"] .app-page h1,
html[data-theme="dark"] .app-page h2,
html[data-theme="dark"] .app-page h3,
html[data-theme="dark"] .app-header-brand,
html[data-theme="dark"] .app-nav nav a {
    color: var(--pace66-text);
}

html[data-theme="dark"] .app-nav nav a:hover,
html[data-theme="dark"] .app-nav nav a[aria-current="page"] {
    background: #263a45;
}

html[data-theme="dark"] .history-table th,
html[data-theme="dark"] .history-table td,
html[data-theme="dark"] .performance-table th,
html[data-theme="dark"] .performance-table td,
html[data-theme="dark"] .activity-detail-grid dt,
html[data-theme="dark"] .activity-detail-grid dd {
    border-color: var(--pace66-border);
}

html[data-theme="dark"] .history-current-row { background: #213845; }
html[data-theme="dark"] .performance-chart-grid-line { stroke: #344752; }
html[data-theme="dark"] .performance-chart-y-label { fill: #a9b8c2; }

html[data-theme="dark"] .landing-page {
    --landing-navy: #e8f2f7;
    --landing-teal: #43c9c3;
    --landing-blue: #67aaf3;
    --landing-ink: #e8eef2;
    --landing-muted: #a9b8c2;
    --landing-wash: #132129;
    background: #0e181f;
}

html[data-theme="dark"] .landing-nav { background: rgba(14, 24, 31, .96); border-color: #344752; }
html[data-theme="dark"] .landing-page { background: #0e181f; }
html[data-theme="dark"] .hero {
    background:
        radial-gradient(circle at 83% 20%, rgba(67, 201, 195, .12), transparent 29%),
        linear-gradient(145deg, #0e181f 15%, #13242d 100%);
}
html[data-theme="dark"] .intro-section,
html[data-theme="dark"] .insights-section,
html[data-theme="dark"] .privacy-section { background: #0e181f; }
html[data-theme="dark"] .features-section { background: #132129; }
html[data-theme="dark"] .insight-visual { background: #132d40; }
html[data-theme="dark"] .why-section { background: #102838; }
html[data-theme="dark"] .progress-track { background: #344752; }
html[data-theme="dark"] .preview-period { background: #193b3b; color: #55d4cf; }
html[data-theme="dark"] .preview-footnote { border-color: #344752; }
html[data-theme="dark"] .button-secondary { background: #1c2c36; border-color: #49606d; }
html[data-theme="dark"] .button-light { color: #0b1f33; }
html[data-theme="dark"] .coming-soon,
html[data-theme="dark"] .feature-card > span,
html[data-theme="dark"] .privacy-mark { background: #1b393d; border-color: #326064; }
html[data-theme="dark"] .signup-consent-dialog { background: #17252e; }

html[data-theme="dark"] .activity-detail-grid dt,
html[data-theme="dark"] .activity-modal-type,
html[data-theme="dark"] .activity-detail-loading,
html[data-theme="dark"] .history-metric-meta,
html[data-theme="dark"] .history-overview-label,
html[data-theme="dark"] .history-overview-secondary,
html[data-theme="dark"] .activity-summary-metrics,
html[data-theme="dark"] .way-metadata,
html[data-theme="dark"] .disclaimer,
html[data-theme="dark"] .location-coordinate-help {
    color: var(--pace66-muted);
}

html[data-theme="dark"] .dashboard-page .welcome-card {
    background: linear-gradient(125deg, #102d42, #164964) !important;
    color: #ffffff;
}

html[data-theme="dark"] .dashboard-page .welcome-card h1 { color: #ffffff; }
html[data-theme="dark"] .dashboard-page .welcome-card .eyebrow { color: #55d4cf; }
html[data-theme="dark"] .dashboard-page .dashboard-tagline { color: #c8dce7; }
html[data-theme="dark"] .dashboard-page .welcome-card .user-info { color: #dce8ee; }

html[data-theme="dark"] #unit-system {
    background: #1c2c36;
    color: var(--pace66-text);
    border-color: #49606d;
}

html[data-theme="dark"] .onboarding-import-status { background: #223944; }
html[data-theme="dark"] .onboarding-import-complete { background: #193b3b; }
html[data-theme="dark"] .onboarding-import-warning { background: #43371f; }

html[data-theme="dark"] .activity-technical-details {
    border-color: var(--pace66-border);
}

html[data-theme="dark"] .activity-technical-details summary,
html[data-theme="dark"] .activity-technical-content h4 {
    color: var(--pace66-text);
}

html[data-theme="dark"] .activity-provider-details {
    background: #0e181f;
    color: #c7d5dc;
    border: 1px solid var(--pace66-border);
}

#theme-preference {
    min-width: 190px;
    padding: 10px;
    border: 1px solid var(--pace66-border);
    border-radius: 6px;
    background: var(--pace66-surface);
    color: var(--pace66-text);
}

/* =========================================================
   Authenticated dashboard theme
   ========================================================= */

.dashboard-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 90% 0, rgba(22, 166, 161, .1), transparent 28rem),
        var(--pace66-wash);
    color: var(--pace66-text);
    line-height: 1.5;
}

.dashboard-page button,
.dashboard-page a {
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.dashboard-page button:focus-visible,
.dashboard-page a:focus-visible,
.dashboard-page input:focus-visible,
.dashboard-page select:focus-visible {
    outline: 3px solid rgba(41, 120, 208, .35);
    outline-offset: 3px;
}

.dashboard-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    min-height: 72px;
    padding: 12px max(24px, calc((100% - 1140px) / 2));
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--pace66-border);
    backdrop-filter: blur(10px);
}

.dashboard-brand { text-decoration: none; }
.app-header-brand { display: inline-flex; align-items: center; gap: 11px; color: var(--pace66-navy); }
.app-brand-icon { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 10px; object-fit: contain; }
.app-brand-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.app-brand-wordmark { font-size: 21px; font-weight: 850; line-height: 1; letter-spacing: -.025em; }
.app-brand-tagline { color: var(--pace66-muted); font-size: 12px; font-weight: 500; line-height: 1.2; letter-spacing: 0; }

#progress,
#goals,
#activities {
    scroll-margin-top: 96px;
}

.dashboard-header .logout {
    padding: 10px 18px;
    color: var(--pace66-navy);
    background: #fff;
    border: 1px solid #cbd7de;
    border-radius: 8px;
    font-weight: 800;
}

.dashboard-header .logout:hover { border-color: var(--pace66-teal); }

.dashboard-page .container {
    width: min(1140px, calc(100% - 48px));
    max-width: none;
    margin: 40px auto 72px;
    padding: 0;
}

.dashboard-page .card {
    margin-bottom: 24px;
    padding: 30px;
    background: var(--pace66-surface);
    border: 1px solid rgba(16, 39, 59, .07);
    border-radius: 18px;
    box-shadow: var(--pace66-shadow);
}

.welcome-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(125deg, var(--pace66-navy), #123f5c) !important;
    color: #fff;
}

.welcome-card::after {
    position: absolute;
    top: -90px;
    right: -50px;
    width: 260px;
    height: 260px;
    border: 45px solid rgba(22, 166, 161, .13);
    border-radius: 50%;
    content: "";
}

.welcome-card .eyebrow { color: #55d4cf; }
.welcome-card h1 { position: relative; z-index: 1; margin: 0; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.035em; }
.dashboard-tagline { position: relative; z-index: 1; margin: 5px 0 20px; color: #c8dce7; font-weight: 700; }
.welcome-card .user-info { position: relative; z-index: 1; color: #dce8ee; font-size: 13px; }
.welcome-card .user-info div:last-child { display: none; }

.card-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.card-heading h2 { margin: 0; color: var(--pace66-navy); font-size: 28px; letter-spacing: -.025em; }
.card-heading > p { margin: 0; color: var(--pace66-muted); font-size: 14px; }

.dashboard-page .goal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.dashboard-page .goal-period {
    padding: 22px;
    background: linear-gradient(180deg, #fff, #fbfdfe);
    border: 1px solid var(--pace66-border);
    border-radius: 14px;
}

.dashboard-page .goal-period h3 { display: inline-block; margin: 0; color: var(--pace66-navy); font-size: 21px; }
.goal-period-label { float: right; margin: 3px 0 0; color: var(--pace66-muted); font-size: 12px; font-weight: 700; }
.dashboard-page .goal-item { clear: both; padding: 20px 0; border-bottom-color: #e8eef1; }
.dashboard-page .goal-metric { color: var(--pace66-navy); font-size: 15px; }
.dashboard-page .goal-progress-values { color: var(--pace66-muted); font-size: 14px; }
.dashboard-page .goal-progress-values strong { color: var(--pace66-text); font-size: 19px; }
.dashboard-page .goal-progress-track { height: 9px; background: #e8eef1; }
.dashboard-page .goal-progress-fill { background: var(--pace66-gradient); }
.dashboard-page .goal-progress-percentage { color: var(--pace66-teal); font-weight: 800; }
.dashboard-page .goal-item.goal-met .goal-progress-fill { background: #27895d; }
.dashboard-page .goal-item.goal-met .goal-progress-percentage { color: #21754f; }

.dashboard-page .goal-history-action,
.dashboard-page .primary-button,
.dashboard-page .activities-load-more,
.dashboard-page .activities-retry {
    color: #fff;
    background: var(--pace66-gradient);
    border: 0;
    border-radius: 8px;
    box-shadow: 0 7px 18px rgba(24, 125, 167, .18);
}

.dashboard-page .goal-edit-action { color: var(--pace66-muted); font-weight: 600; }
.dashboard-page .integration-row { padding: 4px 0; }
.dashboard-page .integration-name { color: var(--pace66-navy); font-weight: 800; }
.dashboard-page .integration-description { color: var(--pace66-muted); }

.integration-actions {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 9px;
}

.integration-secondary-action {
    padding: 3px 0;
    color: var(--pace66-muted);
    background: transparent;
    border: 0;
    font-size: 13px;
    text-decoration: underline;
}

.integration-disconnected-status {
    color: var(--pace66-muted);
    font-size: 12px;
    font-weight: 800;
}

.integration-confirmation { margin: 14px 0 0; color: #087a77; font-weight: 700; }
.disconnect-modal p { color: var(--pace66-muted); }
.disconnect-action { padding: 10px 16px; color: #fff; background: #a52832; border: 0; }

.onboarding-state {
    width: min(680px, 100%);
    margin: 8vh auto 0 !important;
}

.onboarding-loading,
.onboarding-error {
    padding: 34px 12px;
    text-align: center;
}

.onboarding-brand {
    display: inline-flex;
    text-decoration: none;
}

.onboarding-loading p,
.onboarding-copy > p:not(.eyebrow),
.onboarding-integration-card > p {
    color: var(--pace66-muted);
}

.onboarding-copy h1,
.onboarding-error h1 {
    margin: 4px 0 10px;
    color: var(--pace66-navy);
    font-size: clamp(27px, 5vw, 38px);
    line-height: 1.15;
}

.onboarding-integration-card {
    margin-top: 26px;
    padding: 24px;
    background: #fbfdfe;
    border: 1px solid var(--pace66-border);
    border-radius: 14px;
}

.onboarding-integration-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--pace66-navy);
    letter-spacing: .08em;
}

.onboarding-supporting-copy {
    max-width: 520px;
    margin: 18px 0 0;
    font-size: 13px;
}

.onboarding-connected-card h2 {
    margin: 14px 0 4px;
    color: var(--pace66-navy);
}

.onboarding-connected-status {
    color: #087a77;
    font-size: 13px;
    font-weight: 800;
}

.onboarding-goals-copy {
    margin-top: 30px;
}

.onboarding-primary-action {
    width: auto;
    margin-top: 10px;
    padding: 13px 22px;
    font-weight: 800;
}

.onboarding-import-status {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-top: 18px;
    padding: 14px;
    color: var(--pace66-text);
    background: #eef7fa;
    border-radius: 10px;
}

.onboarding-import-status p {
    margin: 2px 0 0;
    color: var(--pace66-muted);
    font-size: 13px;
}

.onboarding-import-complete { background: #eef9f8; }
.onboarding-import-warning { background: #fff8e8; }

.onboarding-spinner {
    width: 17px;
    height: 17px;
    margin-top: 2px;
    border: 2px solid rgba(41, 120, 208, .2);
    border-top-color: var(--pace66-blue);
    border-radius: 50%;
    animation: onboarding-spin .8s linear infinite;
}

@keyframes onboarding-spin {
    to { transform: rotate(360deg); }
}

.dashboard-page .activity-group-heading {
    margin: 28px 0 10px;
    color: var(--pace66-muted);
    font-size: 12px;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.dashboard-page .activity-summary {
    background: #fff;
    border-color: var(--pace66-border);
    border-radius: 12px;
}

.dashboard-page .activity-summary:hover {
    border-color: rgba(22, 166, 161, .55);
    box-shadow: 0 8px 22px rgba(11, 31, 51, .07);
    transform: translateY(-1px);
}

.dashboard-page .activity-type,
.dashboard-page .activity-provider { color: var(--pace66-teal); }
.dashboard-page .activity-name { color: var(--pace66-navy); }
.dashboard-page .activity-date,
.dashboard-page .activity-summary-metric-label { color: var(--pace66-muted); }

.dashboard-page .history-modal,
.dashboard-page .activity-modal {
    border: 1px solid var(--pace66-border);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(11, 31, 51, .2);
}

.dashboard-page .history-modal-header,
.dashboard-page .activity-modal-header { background: var(--pace66-wash); border-bottom-color: var(--pace66-border); }
.activities-card-heading { align-items: center; }
.activities-card-heading h2 { margin-bottom: 4px; }
.activities-card-heading p { margin: 0; }
#log-activity-shortcut { border-color: var(--pace66-teal); color: var(--pace66-teal); font-weight: 700; white-space: nowrap; }
.manual-activity-modal { width: min(600px, 100%); }
.manual-activity-form { padding: 22px 24px 24px; overflow-y: auto; }
.manual-activity-form label { display: grid; gap: 6px; margin-bottom: 15px; color: var(--pace66-navy); font-weight: 700; }
.manual-activity-form label span, .manual-form-hint { color: var(--pace66-muted); font-size: 12px; font-weight: 400; }
.manual-activity-form input, .manual-activity-form select, .manual-activity-form textarea { width: 100%; padding: 10px; border: 1px solid var(--pace66-border); border-radius: 7px; font: inherit; }
.manual-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.manual-activity-form details { margin: 12px 0 18px; }
.manual-activity-form summary { margin-bottom: 16px; color: var(--pace66-teal); cursor: pointer; font-weight: 700; }
.manual-form-error { min-height: 20px; color: #b42318; }
.manual-form-actions, .activity-detail-actions { display: flex; justify-content: flex-end; gap: 10px; }
.activity-delete-action { color: #b42318; border-color: #f0b4ad; }
.goal-inherited-unit { min-width: 86px; color: var(--pace66-muted); font-size: 14px; }
#units-form { display: grid; max-width: 420px; gap: 12px; }
#unit-system { padding: 10px; border: 1px solid var(--pace66-border); border-radius: 7px; background: white; font: inherit; }
#units-submit { justify-self: start; }
#units-status { min-height: 20px; margin: 0; color: var(--pace66-muted); }
.dashboard-page .history-current-row { background: #eef9f8; }
.dashboard-page .history-current-label { background: #dff4f2; color: #087a77; }

@media (max-width: 850px) {
    .dashboard-page .goal-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .dashboard-header { min-height: 64px; padding: 10px 15px 10px 64px; }
    .app-header-brand { gap: 9px; }
    .app-brand-icon { width: 36px; height: 36px; border-radius: 9px; }
    .app-brand-wordmark { font-size: 19px; }
    .app-brand-tagline { font-size: 11px; }
    .dashboard-page .container { width: min(100% - 28px, 1140px); margin: 22px auto 48px; }
    .dashboard-page .card { padding: 20px; border-radius: 14px; }
    .card-heading { display: block; }
    .card-heading > p { margin-top: 6px; }
    .dashboard-page .activity-summary { grid-template-columns: 1fr; gap: 14px; }
    .dashboard-page .activity-summary-metrics { justify-content: flex-start; }
    .activities-card-heading, .manual-form-row { display: grid; grid-template-columns: 1fr; }
    #log-activity-shortcut { width: 100%; margin-top: 14px; }
    .onboarding-state { margin-top: 24px !important; }
    .onboarding-integration-card { padding: 19px; }
    .onboarding-primary-action { width: 100%; }
    .dashboard-page .integration-row { align-items: flex-start; flex-direction: column; gap: 18px; }
    .integration-actions { width: 100%; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
    .onboarding-spinner { animation: none; }
}


/* =========================================================
   Base
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

.auth-callback-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--pace66-wash);
}

.auth-callback-card {
    width: min(440px, 100%);
    padding: 42px 28px;
    color: var(--pace66-text);
    background: var(--pace66-surface);
    border: 1px solid var(--pace66-border);
    border-radius: 18px;
    box-shadow: var(--pace66-shadow);
    text-align: center;
}

.auth-callback-brand { display: inline-flex; text-decoration: none; }
.auth-callback-card p { color: var(--pace66-muted); }
.auth-callback-card h1 { margin: 0 0 24px; color: var(--pace66-navy); font-size: 27px; }
.auth-callback-return { display: inline-block; text-decoration: none; }

body {
    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: var(--background);
    color: var(--text);
}

a {
    color: inherit;
}

/* =========================================================
   Goal create/edit modal
   ========================================================= */

.goal-modal-overlay {
    position: fixed;
    inset: 0;

    background:
        rgba(0, 0, 0, 0.45);

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 20px;

    z-index: 1000;
}


.goal-modal {
    width: 100%;
    max-width: 460px;

    background: white;

    border-radius: 12px;

    padding: 28px;

    box-shadow:
        0 8px 30px
        rgba(0, 0, 0, 0.20);
}


.goal-modal h2 {
    margin-top: 0;
}


.goal-form-group {
    margin-bottom: 20px;
}


.goal-form-group label {
    display: block;

    margin-bottom: 8px;

    font-weight: bold;
}


.goal-form-row {
    display: flex;
    gap: 10px;
}


.goal-form-group input,
.goal-form-group select {

    width: 100%;

    padding: 10px;

    border:
        1px solid #ccc;

    border-radius:
        6px;

    font-size:
        16px;
}


.goal-form-row input {
    flex: 2;
}


.goal-form-row select {
    flex: 1;
}


.goal-form-actions {

    display: flex;

    justify-content:
        flex-end;

    gap: 10px;

    margin-top: 24px;
}


#goal-form-status {

    min-height: 20px;

    color: #666;

    margin-top: 10px;
}
/* =========================================================
   Login page
   ========================================================= */

.login-page {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 380px;

    background: var(--surface);

    padding: 40px;

    border-radius: var(--radius);

    box-shadow: var(--shadow);

    text-align: center;
}

.login-container h1 {
    margin-top: 0;
    margin-bottom: 6px;

    font-size: 34px;
}

.tagline {
    color: var(--muted);

    margin-bottom: 30px;
}


/* =========================================================
   Buttons
   ========================================================= */

button {
    font-family: inherit;
    font-size: 16px;

    cursor: pointer;

    border-radius: var(--small-radius);

    transition:
        opacity 0.15s ease,
        transform 0.05s ease;
}

button:hover {
    opacity: 0.9;
}

button:active {
    transform: translateY(1px);
}

.login-button {
    width: 100%;

    padding: 14px;

    margin-top: 12px;

    border: 1px solid var(--border);
}

.google {
    background: var(--surface);
    color: var(--text);
}

.facebook {
    background: var(--facebook);
    color: white;

    border: none;
}

.primary-button {
    padding: 10px 16px;

    background: var(--accent);
    color: white;

    border: none;
}

.secondary-button {
    padding: 10px 16px;

    background: var(--surface);
    color: var(--text);

    border: 1px solid var(--border);
}

.logout {
    padding: 10px 16px;

    background: var(--accent);
    color: white;

    border: none;
}

.strava-connect-button {
    padding: 0;
    margin: 0;

    border: none;
    background: transparent;

    cursor: pointer;
}

.strava-connect-button img {
    display: block;

    width: 193px;
    height: auto;
}

.strava-connect-button:hover {
    opacity: 0.9;
}

.strava-connect-button:active {
    transform: translateY(1px);
}
/* =========================================================
   Status / messages
   ========================================================= */

#status,
.status {
    margin-top: 20px;

    font-size: 14px;

    color: var(--muted);
}

.error {
    color: #b00020;
}

.success {
    color: #176b2c;
}


/* =========================================================
   Dashboard header
   ========================================================= */

header {
    background: var(--surface);

    border-bottom:
        1px solid var(--border);

    padding:
        18px 30px;

    display: flex;

    justify-content:
        space-between;

    align-items: center;
}

header h1 {
    margin: 0;

    font-size: 26px;
}


/* =========================================================
   Main layout
   ========================================================= */

.container {
    max-width: 1000px;

    margin:
        40px auto;

    padding:
        0 20px;
}

.card {
    background: var(--surface);

    padding: 24px;

    border-radius: var(--radius);

    margin-bottom: 20px;

    box-shadow:
        0 2px 10px
        rgba(0, 0, 0, 0.08);
}

.card h2 {
    margin-top: 0;
}


/* =========================================================
   User information
   ========================================================= */

.user-info {
    color: var(--muted);

    line-height: 1.8;
}


/* =========================================================
   Goal / metric cards
   ========================================================= */

.goal-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(200px, 1fr)
        );

    gap: 16px;
}

.metric {
    background: #fafafa;

    border:
        1px solid var(--soft-border);

    padding: 20px;

    border-radius: 10px;
}

.metric h3 {
    margin-top: 0;
    margin-bottom: 8px;
}

.metric p {
    margin-bottom: 0;

    color: var(--muted);
}


/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 600px) {

    .login-container {
        padding: 28px 22px;
    }

    header {
        padding:
            16px 18px;
    }

    .container {
        margin:
            24px auto;

        padding:
            0 14px;
    }

    .card {
        padding: 18px;
    }

}

/* =========================================================
   Public landing page
   ========================================================= */

.landing-page {
    --landing-navy: #0b1f33;
    --landing-teal: #16a6a1;
    --landing-blue: #2978d0;
    --landing-ink: #10273b;
    --landing-muted: #5d6e7d;
    --landing-wash: #f4f8fa;
    background: #fff;
    color: var(--landing-ink);
    line-height: 1.6;
}

.landing-page a { text-decoration: none; }
.landing-page h1, .landing-page h2, .landing-page h3 { line-height: 1.12; letter-spacing: -.025em; }
.landing-shell { width: min(1140px, calc(100% - 48px)); margin-inline: auto; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 100; padding: 10px 14px; background: #fff; color: var(--landing-navy); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.landing-nav { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); border-bottom: 1px solid #e4ebef; backdrop-filter: blur(10px); }
.nav-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand-wordmark { display: inline-flex; align-items: baseline; color: var(--landing-navy); font-size: 25px; font-weight: 800; letter-spacing: -.06em; }
.brand-wordmark img { width: 42px; height: 42px; margin-right: 10px; border-radius: 8px; object-fit: cover; align-self: center; }
.brand-wordmark strong { margin-left: 3px; color: var(--landing-teal); font-size: 29px; }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 14px; font-weight: 700; }
.nav-links > a:not(.button):hover { color: var(--landing-teal); }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 8px; font-weight: 800; transition: transform .15s ease, box-shadow .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: linear-gradient(110deg, var(--landing-teal, #147d8f), var(--landing-blue, #176fa8)); box-shadow: 0 8px 24px rgba(24,125,167,.22); }
.button-secondary { color: var(--landing-navy, #172b3a); background: #fff; border: 1px solid #cbd7de; }
.button-light { color: var(--landing-navy, #172b3a); background: #fff; }
.button:focus-visible, .landing-page a:focus-visible { outline: 3px solid #f4b942; outline-offset: 3px; }
.nav-cta { min-height: 42px; padding-inline: 18px; }
.hero { overflow: hidden; padding: 88px 0 96px; background: radial-gradient(circle at 83% 20%, rgba(24,166,161,.13), transparent 29%), linear-gradient(145deg, #fff 15%, #f3f8fa 100%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(420px, .96fr); gap: 76px; align-items: center; }
.eyebrow { margin: 0 0 14px; color: var(--landing-teal); font-size: 12px; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.hero h1 { margin: 0; color: var(--landing-navy); font-size: clamp(48px, 6vw, 76px); letter-spacing: -.055em; }
.hero h1 span { color: var(--landing-teal); }
.hero-copy > p:not(.eyebrow) { max-width: 650px; color: var(--landing-muted); font-size: 17px; }
.hero-copy .hero-lead { margin: 26px 0 8px; color: var(--landing-ink); font-size: 22px; font-weight: 700; line-height: 1.4; }
.hero-actions { display: flex; align-items: center; gap: 14px; margin-top: 30px; }
.hero-copy .hero-note { margin-top: 22px; font-size: 13px; }
.progress-preview { position: relative; padding: 30px; background: #fff; border: 1px solid rgba(16,39,59,.08); border-radius: 20px; box-shadow: 0 24px 70px rgba(11,31,51,.16); }
.progress-preview::before { content: ""; position: absolute; inset: -9px 34px auto; height: 9px; background: linear-gradient(90deg, var(--landing-teal), var(--landing-blue)); border-radius: 9px 9px 0 0; }
.preview-header, .metric-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.preview-kicker { margin: 0; color: var(--landing-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.preview-header h2 { margin: 4px 0 0; font-size: 25px; }
.preview-period { padding: 6px 10px; border-radius: 20px; background: #e9f7f6; color: #087a77; font-size: 12px; font-weight: 800; }
.preview-metric { margin-top: 27px; }
.metric-heading span { color: var(--landing-teal); font-weight: 900; }
.preview-metric p { margin: 5px 0 9px; color: var(--landing-muted); font-size: 13px; }
.preview-metric p strong { color: var(--landing-ink); font-size: 19px; }
.progress-track { overflow: hidden; height: 8px; background: #e8eef1; border-radius: 10px; }
.progress-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--landing-teal), var(--landing-blue)); border-radius: inherit; }
.preview-footnote { display: flex; align-items: center; gap: 8px; margin: 28px 0 0; padding-top: 18px; border-top: 1px solid #edf1f3; color: var(--landing-muted); font-size: 12px; }
.preview-footnote span { width: 7px; height: 7px; background: var(--landing-teal); border-radius: 50%; }
.landing-section { padding: 104px 0; }
.features-section { background: var(--landing-wash); }
.section-heading { max-width: 660px; }
.section-heading h2, .why-section h2, .final-cta h2 { margin: 0 0 20px; font-size: clamp(36px, 4vw, 52px); color: var(--landing-navy); }
.section-heading > p:not(.eyebrow) { color: var(--landing-muted); font-size: 17px; }
.centered-heading { margin: 0 auto 52px; text-align: center; }
.steps-grid, .feature-grid { display: grid; gap: 22px; }
.steps-grid { grid-template-columns: repeat(3, 1fr); }
.step-card { padding: 30px; border: 1px solid #dfe8ec; border-radius: 16px; }
.step-number { display: block; color: var(--landing-teal); font-size: 14px; font-weight: 900; letter-spacing: .1em; }
.step-card h3, .feature-card h3 { margin: 20px 0 10px; font-size: 21px; }
.step-card p, .feature-card p { margin: 0; color: var(--landing-muted); }
.coming-soon { display: inline-block; margin-top: 18px; padding: 5px 9px; background: #edf5f7; border-radius: 5px; color: var(--landing-muted); font-size: 11px; font-weight: 800; }
.feature-grid { grid-template-columns: repeat(4, 1fr); margin-top: 45px; }
.feature-card { padding: 28px; background: #fff; border-radius: 16px; box-shadow: 0 8px 28px rgba(11,31,51,.06); }
.feature-card > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #e7f6f5; color: var(--landing-teal); font-size: 20px; font-weight: 900; }
.insights-grid, .privacy-grid { display: grid; grid-template-columns: .9fr 1.1fr; align-items: center; gap: 90px; }
.insight-visual { min-height: 330px; padding: 38px; color: #fff; background: var(--landing-navy); border-radius: 20px; box-shadow: 0 24px 60px rgba(11,31,51,.18); }
.insight-label { color: #a8c2d3; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.week-bars { height: 150px; display: flex; align-items: end; gap: 13px; margin: 26px 0; border-bottom: 1px solid rgba(255,255,255,.18); }
.week-bars i { flex: 1; height: 55%; background: linear-gradient(180deg, #1ac4bc, #2584d6); border-radius: 6px 6px 0 0; }
.week-bars i:nth-child(2), .week-bars i:nth-child(6) { height: 82%; }
.week-bars i:nth-child(3) { height: 40%; }
.week-bars i:nth-child(4) { height: 94%; }
.week-bars i:nth-child(7) { height: 67%; }
.insight-stat { display: flex; align-items: baseline; gap: 10px; }
.insight-stat strong { font-size: 30px; }
.insight-stat span { color: #a8c2d3; }
.pull-quote { margin-top: 25px; padding-left: 18px; border-left: 3px solid var(--landing-teal); color: var(--landing-ink) !important; font-weight: 800; }
.why-section { padding: 112px 0; color: #d8e6ee; background: var(--landing-navy); }
.why-grid { display: grid; grid-template-columns: .75fr 1.25fr; align-items: center; gap: 80px; }
.big-66 { color: transparent; font-size: clamp(170px, 25vw, 320px); font-weight: 900; line-height: .75; letter-spacing: -.13em; -webkit-text-stroke: 3px rgba(27,188,183,.72); }
.why-section h2 { color: #fff; }
.why-section h3 { margin: 0 0 24px; color: #fff; font-size: 24px; }
.why-finish { margin-top: 30px; color: #fff; font-size: 20px; font-weight: 900; }
.privacy-grid { grid-template-columns: 210px 1fr; max-width: 900px; }
.privacy-mark { display: grid; place-items: center; width: 160px; height: 160px; color: var(--landing-teal); background: #e8f7f6; border: 2px solid #c6ecea; border-radius: 50%; font-size: 68px; font-weight: 800; }
.final-cta { padding: 92px 0; text-align: center; color: #dceaf2; background: linear-gradient(120deg, #0b1f33, #133f5b); }
.final-cta h2 { color: #fff; }
.final-cta > div > p:not(.eyebrow) { max-width: 650px; margin-inline: auto; font-size: 18px; }
.centered-actions { justify-content: center; }
.text-link { color: #fff; font-weight: 800; text-decoration: underline !important; text-underline-offset: 4px; }
.landing-footer { padding: 42px 0; background: #071725; color: #afc1cc; }
.footer-inner { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 50px; }
.footer-brand { color: #fff; }
.footer-inner p { margin: 6px 0 0; font-size: 13px; }
.footer-links { display: flex; gap: 24px; font-weight: 700; }

/* Legal documents and blocking consent flow. */
.legal-page, .legal-document-page { min-height: 100vh; margin: 0; background: #f3f7f8; color: var(--pace66-navy); }
.legal-consent-card, .legal-document { width: min(680px, calc(100% - 40px)); margin: 56px auto; padding: 36px; box-sizing: border-box; background: #fff; border-radius: 18px; box-shadow: 0 12px 40px rgba(7, 23, 37, .1); }
.legal-consent-card h1, .legal-document h1 { margin-bottom: 8px; }
.legal-document { line-height: 1.65; }
.legal-document-list { padding: 0; list-style: none; margin: 24px 0; }
.legal-document-list li { display: flex; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid #dbe5e8; }
.legal-document-list li span { color: var(--pace66-muted); font-size: 14px; }
.legal-check { display: flex; align-items: flex-start; gap: 12px; margin: 24px 0; line-height: 1.5; }
.legal-check input { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 2px; }
.legal-status { min-height: 24px; margin-top: 18px; }
.legal-placeholder { padding: 16px; border: 2px solid #b45309; background: #fff8e8; border-radius: 8px; }
.signup-consent-dialog { width: min(520px, calc(100% - 32px)); border: 0; border-radius: 18px; padding: 30px; color: var(--pace66-navy); box-shadow: 0 18px 60px rgba(0, 0, 0, .28); }
.signup-consent-dialog::backdrop { background: rgba(7, 23, 37, .7); }
.signup-consent-note { color: var(--pace66-muted); font-size: 14px; }
.legal-dialog-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.login-legal-links { margin-top: 18px; font-size: 14px; }
.copyright { white-space: nowrap; }

@media (max-width: 900px) {
    .nav-links > a:not(.button):not(.nav-signin) { display: none; }
    .hero-grid, .insights-grid, .why-grid { grid-template-columns: 1fr; }
    .hero { padding-top: 64px; }
    .hero-grid { gap: 60px; }
    .steps-grid { grid-template-columns: 1fr; }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .insights-grid { gap: 48px; }
    .big-66 { font-size: 210px; }
}

@media (max-width: 600px) {
    .landing-shell { width: min(100% - 30px, 1140px); }
    .nav-inner { min-height: 66px; }
    .nav-links { gap: 10px; }
    .nav-links .nav-cta { display: inline-flex; min-height: 40px; padding-inline: 14px; }
    .hero { padding: 54px 0 68px; }
    .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 50px; }
    .hero h1 { font-size: 48px; }
    .hero-copy .hero-lead { font-size: 19px; }
    .hero-actions { align-items: stretch; flex-direction: column; }
    .hero-actions .button { width: 100%; }
    .progress-preview { padding: 24px 20px; }
    .landing-section, .why-section { padding: 76px 0; }
    .feature-grid { grid-template-columns: 1fr; }
    .insight-visual { min-height: 290px; padding: 28px 22px; }
    .big-66 { font-size: 160px; }
    .privacy-grid { grid-template-columns: 1fr; gap: 34px; }
    .privacy-mark { width: 110px; height: 110px; font-size: 48px; }
    .final-cta { padding: 72px 0; }
    .footer-inner { grid-template-columns: 1fr; gap: 24px; text-align: center; }
    .footer-links { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .landing-page *, .landing-page *::before, .landing-page *::after { transition: none !important; }
}
/* Shared authenticated application navigation. */
.app-nav{position:fixed;inset:0 auto 0 0;width:220px;padding:22px 18px;background:#fff;border-right:1px solid #ddd;z-index:25;box-sizing:border-box;display:flex;flex-direction:column}
.app-nav nav{display:flex;flex-direction:column;gap:5px;margin-top:4px}.app-nav nav a{padding:11px 12px;border-radius:7px;color:#333;text-decoration:none}.app-nav nav a:hover,.app-nav nav a[aria-current=page]{background:#f1f1f1;font-weight:700}.app-nav hr{width:100%;border:0;border-top:1px solid #ddd;margin:14px 0}
.app-nav nav a.app-nav-action{color:var(--pace66-teal);font-weight:700}.app-nav nav a.app-nav-action:hover,.app-nav nav a.app-nav-action[aria-current=page]{background:#eaf8f7}
.app-nav-support{display:grid;gap:9px;margin-top:auto}.app-nav-support>hr{width:100%;margin:0 0 5px;border:0;border-top:1px solid #ddd}.app-nav-feedback{padding:10px 12px;border:0;border-radius:7px;background:#eaf8f7;color:var(--pace66-teal);font-weight:700;text-align:left;cursor:pointer}.app-nav-feedback:hover{background:#d8f1ef}.app-nav-signout{padding:10px 12px;border:1px solid #bbb;border-radius:7px;background:#fff;color:#333;text-align:left;cursor:pointer}.app-nav-toggle,.app-nav-close,.app-nav-backdrop{display:none}.app-page{margin-left:220px}.app-content{max-width:900px;margin:0 auto;padding:42px 28px}.app-card{background:#fff;border-radius:12px;padding:24px;margin-bottom:20px;box-shadow:0 2px 10px rgba(0,0,0,.08)}
.feedback-modal{width:min(580px,calc(100% - 32px));max-height:calc(100vh - 40px);overflow:auto}.feedback-modal-header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px}.feedback-modal-header h2{margin-top:0}.feedback-close{border:0;background:transparent;font-size:28px;line-height:1;cursor:pointer}.feedback-modal form{display:grid;gap:9px}.feedback-modal label{font-weight:700}.feedback-modal label span,.feedback-file-help{font-weight:400;color:var(--pace66-muted)}.feedback-modal select,.feedback-modal textarea,.feedback-modal input[type=file]{width:100%;box-sizing:border-box;padding:10px;border:1px solid #b9c7cf;border-radius:7px;font:inherit}.feedback-modal textarea{resize:vertical}.feedback-character-count{text-align:right;color:var(--pace66-muted);font-size:13px}.feedback-file-help{margin:0;font-size:13px}.feedback-preview{display:flex;align-items:flex-start;gap:14px;padding:12px;background:var(--pace66-wash);border-radius:8px}.feedback-preview[hidden]{display:none}.feedback-preview img{width:150px;max-height:100px;object-fit:contain;border:1px solid var(--pace66-border);background:#fff}.feedback-preview button{border:0;background:transparent;color:var(--pace66-teal);font-weight:700;cursor:pointer}.feedback-status{min-height:22px;margin:8px 0 0}.feedback-modal .goal-form-actions{margin-top:5px}

html[data-theme="dark"] .feedback-preview img { background: #0e181f; }
.location-form{display:grid;grid-template-columns:2fr 1fr 1fr;gap:12px}.location-form label{display:flex;flex-direction:column;gap:6px}.location-form input{padding:10px;border:1px solid #bbb;border-radius:6px}.location-coordinate-help,.location-form-actions{grid-column:1/-1}.location-coordinate-help{margin:0;color:#666;font-size:14px}.ways-city-group{margin-bottom:28px}.ways-city-heading{margin:0 0 12px}.ways-grid{display:grid;gap:16px}.unverified-events{display:grid;gap:12px;margin-top:16px;padding-top:24px;border-top:1px solid #ddd}.unverified-events>.disclaimer{margin:0}.way-card h2{margin-bottom:6px}.way-metadata,.way-feedback{color:#555}.way-actions{display:flex;gap:10px;align-items:center}.way-actions button{min-width:42px;min-height:38px}.app-empty-state,.app-error-state{text-align:center}.disclaimer{color:#666;font-size:14px}
@media(max-width:760px){.app-page{margin-left:0}.dashboard-header{padding-left:64px}.app-nav{transform:translateX(-100%);transition:transform .2s}.app-nav nav{margin-top:36px}.nav-open .app-nav{transform:none}.app-nav-toggle{display:block;position:fixed;top:14px;left:14px;z-index:26;background:#fff;border:1px solid #ccc;border-radius:6px;padding:8px 11px}.app-nav-close{display:block;position:absolute;right:12px;top:12px;border:0;background:transparent;font-size:25px}.app-nav-backdrop{position:fixed;inset:0;z-index:24;border:0;background:rgba(0,0,0,.4)}.nav-open .app-nav-backdrop{display:block}.app-content{padding:70px 18px 28px}.location-form{grid-template-columns:1fr}.way-actions{flex-wrap:wrap}}

.performance-controls{display:flex;align-items:end;gap:24px;flex-wrap:wrap}.performance-controls>label,.performance-trend-heading label{display:grid;gap:7px;font-weight:700}.performance-controls select,.performance-trend-heading select{min-width:190px;padding:10px;border:1px solid #bbb;border-radius:6px;background:#fff}.performance-controls fieldset{border:0;padding:0;margin:0}.performance-controls legend{margin-bottom:7px;font-weight:700}.performance-periods{display:flex;gap:7px}.performance-periods button{padding:10px 16px;border:1px solid #b9c7cf;border-radius:7px;background:#fff;cursor:pointer}.performance-periods button[aria-pressed=true]{border-color:#168f99;background:#e8f7f6;color:#087a77;font-weight:800}.performance-table-wrap{overflow-x:auto}.performance-table{width:100%;border-collapse:collapse}.performance-table th,.performance-table td{padding:13px 10px;border-bottom:1px solid #e1e7ea;text-align:right}.performance-table th:first-child{text-align:left}.performance-empty{padding:12px;background:#f5f8f9;border-radius:7px}.performance-trend-heading{display:flex;align-items:end;justify-content:space-between;gap:20px}.performance-trend-heading h2,.performance-trend-heading p{margin-top:0}.performance-chart{margin-top:18px;min-height:260px}.performance-chart svg{display:block;width:100%;max-height:300px;overflow:visible}.performance-chart-line{fill:none;stroke:#168f99;stroke-width:4;stroke-linejoin:round;stroke-linecap:round}.performance-chart-point{fill:#2584d6;stroke:#fff;stroke-width:3}.performance-chart-labels{display:flex;justify-content:space-between;gap:4px;color:#667780;font-size:11px}.performance-chart-labels span{overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}@media(max-width:760px){.performance-trend-heading{align-items:stretch;flex-direction:column}.performance-chart-labels span:nth-child(even){display:none}.performance-table{min-width:620px}}

/* Beta survey shares the application shell and remains usable on narrow screens. */
.app-nav-survey { display: block; padding: 12px; border: 1px solid currentColor; border-radius: 8px; text-decoration: none; }
.app-nav-survey small { display: block; font-size: .75rem; margin-top: 4px; }
.beta-survey { max-width: 820px; }
.beta-survey fieldset { min-width: 0; margin: 0 0 24px; padding: 16px; border: 1px solid var(--border-color, #888); border-radius: 8px; }
.beta-survey legend { font-weight: 600; padding: 0 4px; }
.survey-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.survey-choices label { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; cursor: pointer; border: 1px solid var(--border-color, #888); border-radius: 6px; box-sizing: border-box; }
.survey-choices input { width: auto; margin: 0; flex-shrink: 0; }
.beta-survey textarea { width: 100%; box-sizing: border-box; font: inherit; }
.beta-survey small { display: block; }
.beta-survey [hidden] { display: none !important; }
@media (max-width: 480px) {
  .beta-survey fieldset { padding: 12px; }
  .survey-choices label { max-width: 100%; }
}

/* Homepage: connect goal progress with an illustrative next activity. */
.landing-page .hero-grid { gap: 48px; }
.landing-page .hero { padding-block: 64px 72px; }
.landing-page .hero-copy .hero-lead { font-size: 20px; }
.landing-page .hero-note, .landing-page .example-note { font-size: 14px; line-height: 1.5; color: var(--landing-muted); }
.landing-page .goal-discovery-preview h2 { font-size: 23px; }
.landing-page .goal-discovery-preview .preview-header { margin-top: 20px; }
.landing-page .goal-total { margin: 12px 0; font-size: 17px; }
.landing-page .goal-total strong { font-size: 36px; color: var(--landing-ink); letter-spacing: -.04em; }
.landing-page .goal-remaining { font-weight: 700; }
.landing-page .preview-next { padding: 22px; margin-top: 24px; background: var(--landing-wash); border-left: 3px solid var(--landing-teal); border-radius: 0 12px 12px 0; }
.landing-page .preview-next h3 { margin: 0 0 8px; font-size: 23px; }
.landing-page .preview-next p:last-child { margin-bottom: 0; }
.landing-page .preview-impact { font-weight: 700; }
.landing-page .discovery-section { background: var(--landing-wash); }
.landing-page .discovery-section .section-heading { max-width: 760px; }
.landing-page .discovery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 28px; }
.landing-page .discovery-card { border: 1px solid #cbdade; border-radius: 18px; overflow: hidden; background: #fff; }
.landing-page .event-summary, .landing-page .event-goal { padding: 28px; }
.landing-page .event-summary { border-bottom: 1px solid #dce6e9; }
.landing-page .event-summary h3 { margin: 0 0 12px; font-size: 28px; }
.landing-page .event-summary p { margin-bottom: 8px; }
.landing-page .event-proximity { color: var(--landing-muted); font-size: 14px; }
.landing-page .event-goal h4 { margin: 0; font-size: 18px; }
.landing-page .goal-outcome { margin-top: 24px; padding-top: 12px; border-top: 1px dashed #9db5bd; }
.landing-page .outcome-label { font-weight: 800; color: #08736f; }
.landing-page .steps-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.landing-page .step-card { padding: 22px; }
.landing-page .features-section { padding-block: 64px; }
.landing-page .features-section h2 { font-size: 36px; }
.landing-page .nav-links { gap: 18px; }
.landing-page .nav-links a, .landing-page .footer-links a, .landing-page .text-link { min-height: 44px; display: inline-flex; align-items: center; }
.landing-page .button-primary { background: linear-gradient(110deg, #087b77, #226abd); color: #fff; }
html:not([data-theme="dark"]) .landing-page .eyebrow { color: #08736f; }
html[data-theme="dark"] .landing-page .discovery-card,
html[data-theme="dark"] .landing-page .goal-discovery-preview { background: #17252e; border-color: #49606d; }
html[data-theme="dark"] .landing-page .event-summary { border-color: #49606d; }
html[data-theme="dark"] .landing-page .outcome-label { color: #55d4cf; }
@media (max-width: 1000px) {
    .landing-page .steps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .landing-page .hero { padding-block: 28px 44px; }
    .landing-page .hero-grid { gap: 36px; }
    .landing-page .hero h1 { font-size: clamp(38px, 10vw, 48px); }
    .landing-page .hero-copy .hero-lead { margin-top: 18px; font-size: 18px; }
    .landing-page .hero-actions { flex-direction: row; gap: 10px; margin-top: 22px; }
    .landing-page .hero-actions .button { padding-inline: 14px; }
    .landing-page .hero-copy .hero-note { margin-top: 16px; }
    .landing-page .discovery-grid { grid-template-columns: minmax(0, 1fr); }
    .landing-page .event-summary, .landing-page .event-goal { padding: 22px; }
    .landing-page .steps-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .landing-page .step-card { padding: 18px 20px; }
    .landing-page .step-card h3 { margin-top: 10px; }
    .landing-page .landing-section, .landing-page .why-section { padding-block: 52px; }
    .landing-page .final-cta .hero-actions { flex-direction: column; }
    .landing-page .goal-discovery-preview { padding: 22px; }
}
.landing-page .why-section .eyebrow, .landing-page .final-cta .eyebrow { color: #55d4cf; }

/* Goal-linked event recommendations. Canonical values use the shared units helper. */
.way-card { min-width: 0; }
.way-card h2, .way-metadata { overflow-wrap: anywhere; }
.way-goal { margin: 22px 0; padding: 20px; border: 1px solid #d2e3e7; border-radius: 12px; background: #f4f9fa; }
.way-goal-title { margin: 0 0 12px; font-size: 18px; line-height: 1.35; }
.way-goal-values { margin: 0; font-size: 24px; font-weight: 750; }
.way-goal-remaining { margin: 6px 0 14px; }
.way-goal-track { max-width: 480px; }
.way-goal-track span { background: linear-gradient(90deg, #087b77, #226abd); }
.way-contribution-label { margin: 20px 0 0; font-weight: 650; }
.way-contribution-percent { margin: 0; color: #08736f; font-size: 44px; font-weight: 800; line-height: 1.2; }
.way-contribution-caption { margin: 0; }
.way-contribution-amount { margin: 10px 0 0; font-weight: 700; }
.way-goal-reached { margin-bottom: 0; color: #08736f; font-weight: 700; }
.way-contribution-note { margin-bottom: 0; }
.way-actions a, .way-actions button { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
.way-actions a { margin-right: auto; font-weight: 700; }
.way-actions :focus-visible { outline: 3px solid #d99a16; outline-offset: 3px; }
html[data-theme="dark"] .way-goal { background: #132b36; border-color: #49606d; }
html[data-theme="dark"] .way-contribution-percent,
html[data-theme="dark"] .way-goal-reached { color: #55d4cf; }
@media (max-width: 600px) {
    .way-card { padding: 18px; }
    .way-goal { padding: 16px; }
    .way-goal-values { font-size: 22px; }
}

/* Pace shares the canonical progress card and keeps the required rate primary. */
.pace-section-heading { display:flex; justify-content:space-between; align-items:start; gap:16px; flex-wrap:wrap; }
.pace-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; margin:24px 0; }
.pace-dimension { min-width:0; }
.pace-dimension h3 { margin:0 0 14px; }
.pace-goal { border:1px solid var(--border, #d5dfe4); border-radius:14px; margin-bottom:12px; overflow:hidden; }
.pace-goal summary { cursor:pointer; padding:18px; }
.pace-goal summary > span, .pace-goal summary > strong { display:block; }
.pace-goal summary:focus-visible { outline:3px solid #398d91; outline-offset:-3px; }
.pace-goal-period { text-transform:capitalize; font-size:.85rem; opacity:.8; margin-bottom:12px; }
.pace-summary-values { font-size:.95rem; margin-bottom:10px; }
.pace-status { font-size:.73rem; text-transform:uppercase; letter-spacing:.08em; font-weight:750; margin:12px 0 8px; }
.pace-summary-action { font-size:1.2rem; line-height:1.4; margin-top:10px; overflow-wrap:anywhere; }
.pace-goal summary > .pace-status-positive,
.pace-goal summary > .pace-status-complete { display:flex; align-items:center; gap:.5em; color:#176b3a; }
.pace-goal summary > .pace-status-complete { font-size:1.2rem; line-height:1.4; text-transform:none; letter-spacing:normal; }
.pace-status-check { width:1.3em; height:1.3em; flex-shrink:0; fill:none; stroke:currentColor; stroke-width:3; stroke-linecap:round; stroke-linejoin:round; }
html[data-theme="dark"] .pace-goal summary > .pace-status-positive,
html[data-theme="dark"] .pace-goal summary > .pace-status-complete { color:#79dfa0; }
.pace-expand { font-size:.8rem; text-decoration:underline; margin-top:16px; opacity:.8; }
.pace-expanded { padding:0 18px 18px; }
.goal-pace { margin-top:18px; border-top:1px solid var(--border, #d5dfe4); padding-top:8px; }
.pace-explanation { font-size:.88rem; line-height:1.5; }
.pace-remaining { text-transform:uppercase; letter-spacing:.06em; font-size:.8rem; text-align:center; margin:24px 0 8px; }
.pace-action { text-align:center; font-size:clamp(1.25rem,2vw,1.65rem); font-weight:750; line-height:1.35; margin:8px 0 16px; overflow-wrap:anywhere; }
.pace-action span { display:block; font-size:.87rem; font-weight:400; margin-top:4px; }
.pace-time { font-size:.8rem; line-height:1.5; opacity:.8; }
.goal-pace .pace-time { text-align:center; }
.goal-pace-reached .pace-status { color:var(--text-primary, inherit); }
.pace-empty { font-size:.9rem; opacity:.8; }
@media (max-width:1000px) { .pace-grid { grid-template-columns:1fr; } }

/* Current goals hand off detailed pacing to Pace. */
.goal-current-pace { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.goal-current-pace a { font-size:.85rem; color:var(--pace66-text); text-decoration:underline; text-underline-offset:3px; }

/* One received activity, kept compact within the Welcome card. */
.latest-activity { position:relative; z-index:1; margin-top:20px; padding-top:16px; border-top:1px solid rgba(220,232,238,.25); min-width:0; }
.latest-activity h2 { font-size:1rem; margin:0 0 10px; }
.latest-activity p { margin:5px 0; font-size:.88rem; line-height:1.4; overflow-wrap:anywhere; }
.latest-activity-name { font-weight:700; }
.latest-activity-time { color:#c5d6df; }
.latest-activity-status { color:#79dfa0; }
.latest-activity-link { display:inline-block; margin-top:10px; font-size:.88rem; }

.session-reconnect {
    position: fixed;
    inset: 16px 16px auto;
    z-index: 10000;
    max-width: 560px;
    margin-inline: auto;
    padding: 20px;
    border: 1px solid #49606d;
    border-radius: 12px;
    background: #fff;
    color: #172b3a;
    box-shadow: 0 8px 24px #0003;
}
.session-reconnect p { margin: 0 0 16px; }
html[data-theme="dark"] .session-reconnect { background: #1c2c36; color: #eef4f7; }

/* Native dialog supplies keyboard focus containment and Escape dismissal. */
#privacy-dialog {
    max-width: 36rem;
    width: calc(100% - 2rem);
    max-height: 90vh;
    overflow: auto;
    padding: 1.5rem;
    border: 1px solid var(--border-color, #8b949e);
    border-radius: 12px;
    color: inherit;
    background: var(--pace66-surface, #fff);
}
#privacy-dialog::backdrop { background: rgb(0 0 0 / 55%); }
#privacy-dialog input { max-width: 100%; padding: .6rem; }
#privacy-download[hidden] { display: none; }
