:root {
    /* Color Palette */
    --bg-dark: #211811;
    --bg-main: #2c2016;
    --card-bg: rgba(53, 40, 29, 0.6);
    --card-hover: rgba(69, 52, 38, 0.85);
    --border: rgba(217, 185, 155, 0.15);
    --border-glow: rgba(232, 184, 130, 0.35);
    
    --text-primary: #fcf9f5;
    --text-secondary: #dcd2c9;
    --text-muted: #9d8a7a;
    
    /* Brand Colors (Sourdough/Honey theme override for --teal) */
    --teal: #e8b882;
    --teal-glow: rgba(232, 184, 130, 0.45);
    --teal-hover: #cf9a5d;
    --purple: #dca7a7;
    --pink: #f4b4c6;
    --orange: #fb923c;
    --blue: #a3c9f7;
    --green: #a7f3d0;
    --yellow: #fbbf24;
    --rose: #fb7185;
    
    /* Semantic Colors */
    --success: #4ade80;
    --success-glow: rgba(74, 222, 128, 0.3);
    --danger: #f87171;
    --danger-hover: #ef4444;

    /* Fonts (themeable — see body.theme-light) */
    --font-body: 'Karla', sans-serif;
    --font-heading: 'Outfit', sans-serif;

    /* Modal surface (themeable) */
    --modal-bg: #35281d;
}

/* Light "warm cream/terracotta" theme — Landing/Dashboard/Analytics/Settings/
   Onboarding. Focus Session intentionally stays on the dark theme above
   (see the theme-light toggle in switchView(), app.js). Color values are
   taken verbatim from the design handoff's token spec. */
body.theme-light {
    --bg-dark: oklch(97% 0.012 75);
    --bg-main: oklch(97% 0.012 75);
    --card-bg: oklch(99% 0.006 75);
    --card-hover: oklch(97% 0.008 75);
    --border: oklch(91% 0.01 60);
    --border-glow: oklch(58% 0.14 45 / 0.35);

    --text-primary: oklch(24% 0.02 50);
    --text-secondary: oklch(45% 0.02 50);
    --text-muted: oklch(55% 0.02 50);

    --teal: oklch(58% 0.14 45);
    --teal-glow: oklch(58% 0.14 45 / 0.45);
    --teal-hover: oklch(52% 0.15 45);
    --purple: oklch(55% 0.16 300);
    --pink: oklch(60% 0.18 10);
    --orange: oklch(60% 0.17 60);
    --blue: oklch(58% 0.14 230);
    --green: oklch(55% 0.13 150);
    --yellow: oklch(65% 0.15 85);
    --rose: oklch(58% 0.19 20);

    --success: oklch(50% 0.13 150);
    --success-glow: oklch(50% 0.13 150 / 0.3);
    --danger: oklch(50% 0.15 30);
    --danger-hover: oklch(45% 0.16 30);

    --font-body: 'Figtree', sans-serif;
    --font-heading: 'Sora', sans-serif;

    --modal-bg: oklch(99% 0.006 75);
}

body.theme-light {
    background-image: none;
}

/* Light theme structural overrides — everything below isn't color/font
   driven, so it can't be solved by the token block above alone. */
body.theme-light .app-nav {
    background: transparent;
    border: none;
    padding: 0;
    gap: 1.75rem;
}

body.theme-light .nav-btn {
    padding: 0.3rem 0;
    border-radius: 0;
    border-bottom: 2.5px solid transparent;
}

body.theme-light .nav-btn.active {
    background: transparent;
    box-shadow: none;
    border-bottom-color: var(--teal);
}

body.theme-light .btn {
    border-radius: 100px;
}

body.theme-light .btn-primary:hover,
body.theme-light .btn-secondary:hover {
    transform: translateY(-1px);
}

body.theme-light .btn-lg {
    border-radius: 100px;
}

body.theme-light .dashboard-card {
    background: var(--card-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 18px;
    padding: 1.875rem;
    box-shadow: none;
}

body.theme-light .action-card,
body.theme-light .action-card:hover {
    box-shadow: none;
}

body.theme-light .goal-card {
    background: oklch(96% 0.008 75);
    border-radius: 14px;
    cursor: pointer;
}

body.theme-light .goal-card:hover {
    box-shadow: 0 4px 14px -6px oklch(20% 0.02 50 / 0.15);
}

body.theme-light input[type="text"],
body.theme-light input[type="url"],
body.theme-light select {
    background: var(--card-bg);
    border-radius: 10px;
    border-width: 1.5px;
}

body.theme-light .modal-card {
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 30px 70px -20px oklch(20% 0.02 50 / 0.4);
}

body.theme-light .stat-card,
body.theme-light .personal-best-card,
body.theme-light .heatmap-box,
body.theme-light .completed-goals-grid > * {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body.theme-light .goal-health-item {
    background: oklch(96% 0.008 75);
}

/* Reset & Basics */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(53, 40, 29, 0.85) 0, transparent 50%),
        radial-gradient(at 50% 0%, rgba(232, 184, 130, 0.08) 0, transparent 50%),
        radial-gradient(at 100% 100%, rgba(44, 32, 22, 0.95) 0, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 1100px;
    padding: 2rem;
    padding-top: calc(2rem + env(safe-area-inset-top));
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Prevent any one component's overflow from making the whole page
   horizontally scrollable — belt-and-suspenders alongside actually fixing
   the header below, since this is a wrapped native app, not a resizable
   browser tab; a stray overflow here has nowhere else to go. */
html, body {
    overflow-x: hidden;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-emoji {
    font-size: 2rem;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--teal);
}

/* Wordmark reveal — landing nav only, on page load */
.wordmark-reveal {
    position: relative;
    display: inline-block;
    animation: dissolveIn 0.9s ease-out 0.1s both;
}

@keyframes dissolveIn {
    0% { opacity: 0; filter: blur(7px); }
    60% { opacity: 0.5; filter: blur(3px); }
    100% { opacity: 1; filter: blur(0); }
}

.wordmark-crumb {
    position: absolute;
    top: -6px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--teal);
    animation: crumbFall 0.9s ease-in both;
}

@keyframes crumbFall {
    0% { opacity: 0; transform: translateY(-16px); }
    15% { opacity: 1; }
    75% { opacity: 1; transform: translateY(13px); }
    100% { opacity: 0; transform: translateY(16px); }
}

.app-nav {
    display: flex;
    gap: 0.5rem;
    background: rgba(53, 40, 29, 0.4);
    padding: 0.35rem;
    border-radius: 9999px;
    border: 1px solid var(--border);
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-btn:hover {
    color: var(--text-primary);
}

.nav-btn.active {
    background: var(--card-bg);
    color: var(--teal);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* On phone widths, logo + nav pills + login button don't fit in one row at
   their desktop sizing — wrap onto a second row and shrink everything down
   instead of overflowing the viewport (the whole page was scrolling
   horizontally on iPhone before this). The !important overrides are needed
   because the header markup sets gap inline (see index.html), which beats
   a plain stylesheet rule. */
@media (max-width: 576px) {
    .app-container {
        padding: 1.25rem 1rem;
        padding-top: calc(1.25rem + env(safe-area-inset-top));
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
    }

    .app-header {
        flex-wrap: wrap;
        row-gap: 0.75rem;
    }

    .app-header > div:first-child {
        gap: 0.75rem !important;
        flex-wrap: wrap !important;
        row-gap: 0.6rem;
    }

    .header-actions {
        gap: 0.5rem !important;
    }

    .logo-text {
        font-size: 1.4rem;
    }

    .app-nav {
        gap: 0.25rem;
        padding: 0.25rem;
    }

    .nav-btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.78rem;
    }

    #btn-header-login-signup {
        padding: 0.4rem 0.7rem !important;
        font-size: 0.78rem !important;
    }

    /* Same overflow pattern as the header: goal-card-top packs a title
       group and a tag+action-icons group side by side with no wrap, and the
       two 44px circular action buttons alone are wider than they have room
       for on a phone. Wrap onto two rows and shrink the buttons. */
    .goal-card-top {
        flex-wrap: wrap;
        row-gap: 0.6rem;
    }

    .goal-card-top > div:first-child {
        min-width: 0;
    }

    .goal-card-top > div:last-child {
        margin-left: auto;
    }

    .btn-complete-goal,
    .btn-delete-goal {
        width: 36px !important;
        height: 36px !important;
    }

    /* Same space-between-with-no-wrap pattern as the header and goal cards,
       caught here because a real iPhone (~390px) is narrower than the
       widest this environment's browser testing could be forced down to
       (~500px) — these fit at 500px but not at true phone width. */
    .card-header,
    .modal-header-row,
    .focus-sub-actions {
        flex-wrap: wrap;
        row-gap: 0.6rem;
    }
}

/* Main Layout */
.app-main {
    flex-grow: 1;
    position: relative;
}

.app-view {
    display: none;
    animation: fadeIn 0.3s ease forwards;
}

.app-view.active {
    display: block;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.5rem;
}

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

/* Dashboard Cards (Glassmorphism) */
.dashboard-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: border 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.action-card {
    border-color: var(--border-glow);
    box-shadow: 0 10px 30px rgba(45, 212, 191, 0.03);
}

.action-card:hover {
    border-color: var(--teal);
    box-shadow: 0 10px 30px rgba(45, 212, 191, 0.08);
}

/* Card Typography */
h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Form Styles */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.label-with-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.label-with-icon svg {
    flex-shrink: 0;
    color: var(--teal);
}

.label-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: -0.25rem;
}

.age-confirm-label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-secondary);
    cursor: pointer;
}

.age-confirm-label input[type="checkbox"] {
    flex-shrink: 0;
    width: 1.05rem;
    height: 1.05rem;
    margin-top: 0.1rem;
    accent-color: var(--teal);
    cursor: pointer;
}

input[type="text"], input[type="url"], select {
    background: rgba(33, 24, 17, 0.65);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus, input[type="url"]:focus, select:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--teal-glow);
}

/* Color Picker Radio Group */
.color-picker-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.25rem;
}

.color-swatch {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.color-swatch input[type="radio"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.color-swatch label {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.color-swatch input[type="radio"]:focus-visible + label {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
}

.color-swatch input[type="radio"]:checked + label {
    border-color: var(--text-primary);
    transform: scale(1.1);
}

/* Buttons System */
.btn {
    background: transparent;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--teal);
    color: var(--bg-dark);
}

.btn-primary:hover {
    background: var(--teal-hover);
    box-shadow: 0 4px 20px var(--teal-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-tertiary {
    background: transparent;
    color: var(--text-secondary);
    text-decoration: underline;
    font-size: 0.85rem;
}

.btn-tertiary:hover {
    color: var(--text-primary);
}

.btn-danger {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: var(--bg-dark);
    box-shadow: 0 4px 20px rgba(248, 113, 113, 0.3);
}

.btn-success {
    background: var(--success);
    color: var(--bg-dark);
}

.btn-success:hover {
    background: #22c55e;
    box-shadow: 0 4px 20px var(--success-glow);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

/* Goals Grid / Container */
.goals-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 999px;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 3rem 0;
}

/* Individual Goal Accent styles */
.goal-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    animation: cardEnter 0.3s cubic-bezier(0.16, 1, 0.3, 1) backwards;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.goal-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-glow);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

@keyframes cardEnter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.goal-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.goal-title {
    font-weight: 600;
    font-size: 1rem;
}

.goal-tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.goal-streak-tag {
    background: rgba(74, 222, 128, 0.1);
    color: var(--success);
    text-transform: none;
    border-radius: 100px;
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
}

body.theme-light .goal-streak-tag {
    background: oklch(93% 0.04 150);
}

/* Goal Accents */
.goal-color-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.goal-card-icon {
    color: var(--teal);
    flex-shrink: 0;
}

.goal-teal .goal-color-dot { background: var(--teal); box-shadow: 0 0 6px var(--teal-glow); }
.goal-teal .goal-tag { background: rgba(45, 212, 191, 0.1); color: var(--teal); }

.goal-purple .goal-color-dot { background: var(--purple); }
.goal-purple .goal-tag { background: rgba(167, 139, 250, 0.1); color: var(--purple); }

.goal-pink .goal-color-dot { background: var(--pink); }
.goal-pink .goal-tag { background: rgba(244, 114, 182, 0.1); color: var(--pink); }

.goal-orange .goal-color-dot { background: var(--orange); }
.goal-orange .goal-tag { background: rgba(251, 146, 60, 0.1); color: var(--orange); }

.goal-blue .goal-color-dot { background: var(--blue); }
.goal-blue .goal-tag { background: rgba(96, 165, 250, 0.1); color: var(--blue); }

.goal-green .goal-color-dot { background: var(--green); }
.goal-green .goal-tag { background: rgba(52, 211, 153, 0.1); color: var(--green); }

.goal-yellow .goal-color-dot { background: var(--yellow); }
.goal-yellow .goal-tag { background: rgba(251, 191, 36, 0.1); color: var(--yellow); }

.goal-rose .goal-color-dot { background: var(--rose); }
.goal-rose .goal-tag { background: rgba(251, 113, 133, 0.1); color: var(--rose); }

/* Modals Backdrops */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(9, 13, 22, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeInModal 0.2s ease forwards;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background: var(--modal-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: modalPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
    from { opacity: 0; transform: scale(0.94) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.modal-actions-split {
    justify-content: flex-start;
}

.modal-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header-row h3 {
    margin: 0;
}

.modal-close-x {
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.4rem;
    line-height: 1;
    font-weight: 600;
}

.modal-close-x:hover {
    color: var(--text-primary);
}

.modal-subtext {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: -0.75rem;
}

.privacy-body h4 {
    margin: 1.25rem 0 0.35rem;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.privacy-body h4:first-child {
    margin-top: 0;
}

.privacy-body p {
    margin: 0 0 1rem;
}

.privacy-body a {
    color: var(--teal);
}

.privacy-body strong {
    color: var(--text-primary);
}

.privacy-body ul {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.privacy-body li {
    margin-bottom: 0.35rem;
}

.privacy-table-wrap {
    overflow-x: auto;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.privacy-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    table-layout: fixed;
}

.privacy-table th,
.privacy-table td {
    padding: 0.5rem 0.6rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    word-wrap: break-word;
}

.privacy-table th {
    color: var(--text-primary);
    font-weight: 600;
    background: var(--bg-dark);
}

.privacy-table tr:last-child td {
    border-bottom: none;
}

.privacy-table td {
    color: var(--text-secondary);
}

.all-time-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.all-time-tile {
    background: var(--card-hover);
    border-radius: 14px;
    padding: 1.375rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.all-time-tile-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(232, 184, 130, 0.12);
    color: var(--teal);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.25rem;
}

body.theme-light .all-time-tile-icon {
    background: oklch(92% 0.05 45);
}

.all-time-tile-value {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.all-time-tile-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.radio-label:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.radio-label input[type="radio"] {
    accent-color: var(--teal);
    transform: scale(1.2);
}

/* 2. FOCUS MODE VIEW (MICRO-VIEW) */
.focus-mode-view {
    padding: 3rem 0;
}

.focus-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
}

.focus-subtitle {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--teal);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.focus-task {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

/* Timer SVG Ring */
.timer-wrapper {
    position: relative;
    width: 240px;
    height: 240px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* "Crossing the starting line" — warmup-to-flow signature moment */
.timer-wrapper.flow-pulse {
    animation: flowPulse 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.timer-wrapper.flow-pulse::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    animation: flowRingBurst 0.6s ease-out;
    pointer-events: none;
}

@keyframes flowPulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

@keyframes flowRingBurst {
    from { box-shadow: 0 0 0 0 var(--teal-glow); }
    to { box-shadow: 0 0 0 26px rgba(232, 184, 130, 0); }
}

.focus-actions.warmup-exit {
    animation: warmupExit 0.18s ease-in forwards;
}

@keyframes warmupExit {
    to { opacity: 0; transform: translateY(-6px); }
}

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

.timer-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.03);
    stroke-width: 6;
}

.timer-progress {
    fill: none;
    stroke: var(--teal);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 283; /* 2 * PI * r (r=45) */
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.timer-text {
    position: absolute;
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.focus-actions {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.focus-sub-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 0.5rem;
}

/* Active Flow State UI */
.focus-flow-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    animation: flowStateEnter 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes flowStateEnter {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.flow-message {
    background: rgba(74, 222, 128, 0.08);
    border: 1px solid var(--success);
    border-radius: 16px;
    padding: 1.5rem;
    color: var(--text-primary);
}

.flow-message h3 {
    color: var(--success);
    font-family: var(--font-heading);
    margin-bottom: 0.35rem;
}

.flow-message p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stopwatch-display {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--success);
}

/* 3. ANALYTICS VIEW */
.analytics-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.analytics-chart-row {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .analytics-chart-row {
        grid-template-columns: 1fr;
    }
}

.time-by-goal-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: -1rem;
}

.time-by-goal-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.time-by-goal-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.time-by-goal-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    background: rgba(232, 184, 130, 0.12);
    color: var(--teal);
    display: flex;
    align-items: center;
    justify-content: center;
}

body.theme-light .time-by-goal-icon {
    background: oklch(92% 0.05 45);
}

.time-by-goal-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.time-by-goal-time {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
}

.time-by-goal-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.analytics-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 576px) {
    .analytics-summary {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.stat-delta,
.stat-sub {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.stat-delta:not(:empty) {
    color: var(--success);
}

.stat-alltime-link {
    text-align: right;
    margin: -0.75rem 0 0;
}

.stat-num {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--teal);
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-label-icon {
    color: var(--teal);
    flex-shrink: 0;
}

.stat-link {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--success);
    cursor: pointer;
}

.stat-link:hover {
    text-decoration: underline;
}

/* History Logs Table */
.full-width {
    width: 100%;
}

.history-table-wrapper {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.history-table th, .history-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.history-table th {
    font-weight: 600;
    color: var(--text-secondary);
}

.history-table td {
    color: var(--text-primary);
}

.history-status-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
}

.status-completed {
    background: rgba(74, 222, 128, 0.1);
    color: var(--success);
}

.status-pivoted {
    background: rgba(248, 113, 113, 0.1);
    color: var(--danger);
}

/* Wrap Up Planning Card */
.wrap-up-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    width: 100%;
    text-align: left;
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.wrap-up-card h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
}

.wrap-up-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: -0.5rem;
    line-height: 1.4;
}

/* Complete Goal Button on Card */
.btn-complete-goal {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: var(--success);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 800;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn-complete-goal:hover {
    background: var(--success);
    color: var(--bg-dark);
    border-color: var(--success);
    transform: scale(1.1);
}

/* Delete Goal Button on Card */
.btn-delete-goal {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: var(--danger);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn-delete-goal:hover {
    background: var(--danger);
    color: var(--bg-dark);
    border-color: var(--danger);
    transform: scale(1.1);
}

/* Completed Goals Grid */
.completed-goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    width: 100%;
}

/* Launch and Onboarding Layouts */
.launch-container, .onboarding-container {
    max-width: 420px;
    width: 90%;
    margin: 4rem auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Helper Utilities */
.hidden {
    display: none !important;
}

/* Cloud sync status toast — every user action already applies instantly and
   locally (state is the source of truth), so this isn't a rollback UI; it
   just tells a signed-in user when their background cloud backup failed,
   since that fails silently otherwise. */
.sync-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    max-width: 340px;
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    background: var(--modal-bg);
    border: 1px solid var(--danger);
    border-radius: 12px;
    padding: 0.875rem 1rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    z-index: 2000;
    animation: modalPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sync-toast-icon {
    color: var(--danger);
    flex-shrink: 0;
}

.sync-toast-text {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.4;
}

/* =============================================
   LANDING PAGE
   ============================================= */

.landing-page {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4rem;
    padding-bottom: 0;
}

.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 2rem 0;
}

.landing-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

/* Hero */
.landing-hero {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 2rem 1rem;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 3rem;
    align-items: center;
}

.landing-hero-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
}

.landing-badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--teal);
    background: rgba(232, 184, 130, 0.1);
    border: 1px solid rgba(232, 184, 130, 0.25);
    border-radius: 999px;
    padding: 0.4rem 1.2rem;
    letter-spacing: 0.02em;
}

body.theme-light .landing-badge {
    background: oklch(92% 0.05 45);
    border-color: transparent;
    color: oklch(45% 0.14 45);
}

.landing-headline {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-primary);
}

.landing-subheadline {
    font-size: 1.1rem;
    line-height: 1.65;
    color: var(--text-secondary);
    max-width: 480px;
}

.landing-cta-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 0.25rem;
}

.landing-see-how {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.landing-microcopy {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.btn-lg {
    padding: 0.85rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 14px;
}

body.theme-light .btn-lg {
    border-radius: 100px;
}

/* Hero product-preview mockup */
.landing-hero-preview {
    position: relative;
}

.preview-card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.25);
}

.preview-card-top {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1.125rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.preview-progress-track {
    height: 8px;
    border-radius: 100px;
    background: var(--border);
    margin-bottom: 0.625rem;
    overflow: hidden;
}

.preview-progress-fill {
    height: 100%;
    width: 65%;
    border-radius: 100px;
    background: var(--teal);
}

.preview-next {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 1.375rem;
}

.preview-session-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding-top: 1.125rem;
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.preview-play-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--teal);
    color: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
}

/* Sections */
.landing-section {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    box-sizing: border-box;
}

.landing-section-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin: 0 0 0.75rem;
}

/* How It Works - 3 Steps */
.landing-steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    width: 100%;
}

.landing-step-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    transition: border-color 0.3s ease, transform 0.2s ease;
}

.landing-step-card:hover {
    border-color: var(--border-glow);
    transform: translateY(-4px);
}

.landing-step-num {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--teal);
    color: var(--bg-dark);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.landing-step-card h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.landing-step-card p {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

/* Why It Works Card */
.landing-why-card {
    background: linear-gradient(135deg, rgba(232, 184, 130, 0.08) 0%, rgba(53, 40, 29, 0.6) 100%);
    border: 1px solid rgba(232, 184, 130, 0.2);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    max-width: 700px;
    width: 100%;
}

body.theme-light .landing-why-card {
    background: oklch(92% 0.05 45);
    border-color: transparent;
}

.landing-why-card h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--teal);
    margin: 0 0 1rem;
}

.landing-why-card p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin: 0;
}

/* Features (full-bleed) */
.landing-features-section {
    width: 100%;
    box-sizing: border-box;
    padding: 1.25rem 4rem 3.5rem;
}

.landing-section-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    text-align: center;
    margin: 0;
}

.landing-features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: 1280px;
    margin: 2.5rem auto 0;
}

.landing-feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: border-color 0.3s ease, transform 0.2s ease;
}

.landing-feature-card:hover {
    border-color: var(--border-glow);
    transform: translateY(-2px);
}

.landing-feature-icon-tile {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(232, 184, 130, 0.12);
    color: var(--teal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
    margin-bottom: 0.75rem;
}

body.theme-light .landing-feature-icon-tile {
    background: oklch(92% 0.05 45);
}

.landing-feature-card h3 {
    font-family: var(--font-heading);
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.landing-feature-card p {
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text-secondary);
    margin: 0;
}

/* Final CTA (full-bleed solid) */
.landing-cta-band {
    width: 100%;
    box-sizing: border-box;
    background: var(--teal);
    padding: 4rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.landing-cta-band h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--bg-dark);
    max-width: 600px;
}

.landing-cta-band .btn-primary {
    background: var(--bg-dark);
    color: var(--teal);
}

body.theme-light .landing-cta-band .btn-primary {
    background: oklch(99% 0 0);
    color: oklch(45% 0.14 45);
}

/* Footer */
.landing-footer {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 1rem 2rem 3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

.landing-footer-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.landing-footer-link {
    color: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.landing-footer-link:hover {
    color: var(--text-secondary);
}

/* Landing Responsive */
@media (max-width: 900px) {
    .landing-hero {
        grid-template-columns: 1fr;
        padding: 1.5rem 1.5rem 1rem;
    }

    .landing-hero-copy {
        align-items: center;
        text-align: center;
    }

    .landing-cta-group {
        justify-content: center;
    }

    .landing-hero-preview {
        max-width: 420px;
        margin: 0 auto;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .landing-headline {
        font-size: 2.25rem;
    }

    .landing-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
        padding: 1.25rem 1.5rem 0;
    }

    .landing-nav-actions {
        width: 100%;
        justify-content: center;
    }

    .landing-section {
        padding: 0 1.5rem;
    }

    .landing-steps-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .landing-features-section {
        padding: 1rem 1.5rem 2.5rem;
    }

    .landing-features-grid {
        grid-template-columns: 1fr;
    }

    .landing-footer {
        padding: 1rem 1.5rem 2.5rem;
    }

    .landing-page {
        gap: 3rem;
    }
}

/* =============================================
   ANALYTICS COMPONENTS
   ============================================= */

/* ----- 1. Weekly Activity Heatmap ----- */
.heatmap-grid {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 1rem 0;
}

.heatmap-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.heatmap-box {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.heatmap-box:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: scale(1.08);
}

/* Activity intensity levels */
.heatmap-box.level-0 {
    background: var(--card-bg);
}

.heatmap-box.level-1 {
    background: rgba(232, 184, 130, 0.3);
    border-color: rgba(232, 184, 130, 0.2);
}

.heatmap-box.level-2 {
    background: rgba(232, 184, 130, 0.6);
    border-color: rgba(232, 184, 130, 0.35);
}

.heatmap-box.level-3 {
    background: var(--teal);
    border-color: var(--teal);
    box-shadow: 0 0 12px var(--teal-glow);
}

.heatmap-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 576px) {
    .heatmap-box {
        width: 32px;
        height: 32px;
        border-radius: 6px;
    }

    .heatmap-label {
        font-size: 0.6rem;
    }
}

/* ----- 3. Session Trend Chart ----- */
.trend-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.35rem;
    height: 130px;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.trend-bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    height: 100%;
    justify-content: flex-end;
}

.trend-bar {
    width: 100%;
    max-width: 24px;
    height: 100px;
    background: var(--teal);
    border-radius: 4px 4px 0 0;
    transform-origin: bottom;
    transition: transform 0.4s ease-out, opacity 0.3s ease;
    opacity: 0.85;
}

.trend-bar:hover {
    opacity: 1;
    box-shadow: 0 0 10px var(--teal-glow);
}

.trend-bar.empty {
    background: rgba(255, 255, 255, 0.05);
    opacity: 1;
}

.trend-day-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1;
}

.trend-bar-value {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-secondary);
    line-height: 1;
}

@media (max-width: 576px) {
    .trend-chart {
        gap: 0.2rem;
    }

    .trend-bar {
        max-width: 16px;
    }

    .trend-day-label {
        font-size: 0.55rem;
    }
}

/* ----- 4. Personal Bests Cards ----- */
.personal-bests-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.personal-best-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid transparent;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Gradient border via pseudo-element */
.personal-best-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(232, 184, 130, 0.35),
        rgba(217, 185, 155, 0.1),
        rgba(232, 184, 130, 0.2)
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.personal-best-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.personal-best-card:hover::before {
    background: linear-gradient(
        135deg,
        rgba(232, 184, 130, 0.55),
        rgba(217, 185, 155, 0.2),
        rgba(232, 184, 130, 0.4)
    );
}

.pb-icon {
    color: var(--teal);
}

.pb-emoji {
    font-size: 1.5rem;
    line-height: 1;
}

.pb-value {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--teal);
}

.pb-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

@media (max-width: 768px) {
    .personal-bests-grid {
        grid-template-columns: 1fr;
    }
}

/* ----- 5. Goal Health Alerts ----- */
.goal-health-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.goal-health-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(33, 24, 17, 0.5);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.goal-health-item:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(53, 40, 29, 0.45);
}

/* Left color accent bar */
.goal-health-bar {
    width: 4px;
    height: 36px;
    border-radius: 999px;
    flex-shrink: 0;
}

.goal-health-item.warning .goal-health-bar {
    background: var(--yellow);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.35);
}

.goal-health-item.danger .goal-health-bar {
    background: var(--danger);
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.35);
}

.goal-health-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    min-width: 0;
}

.goal-health-name,
.goal-health-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.goal-health-days,
.goal-health-msg {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.goal-health-item.warning .goal-health-days {
    color: var(--yellow);
}

.goal-health-item.danger .goal-health-days {
    color: var(--danger);
}

.goal-health-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.goal-health-item.warning .goal-health-badge {
    background: rgba(251, 191, 36, 0.1);
    color: var(--yellow);
}

.goal-health-item.danger .goal-health-badge {
    background: rgba(248, 113, 113, 0.1);
    color: var(--danger);
}
