/* 
   =========================================
   OPTAG MODERN PREMIUM CSS Design System 
   =========================================
*/

:root {
    /* Premium Color Palette - More curated HSL values */
    --primary: #00d2ff;
    --primary-alt: #3a7bd5;
    --primary-gradient: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    --secondary-gradient: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    --bg-color: #0b0e14;
    --bg-card: rgba(23, 28, 36, 0.4);
    
    --text-main: #f0f6fc;
    --text-muted: #919eb1;
    
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    --transition-fast: all 0.2s ease;
    --transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
}

/* =========================================
   BACKGROUND EFFECTS (Blob Blurs)
   ========================================= */
.bg-blur {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.5;
}

.shape-1 {
    width: 600px;
    height: 600px;
    background: var(--primary);
    top: -200px;
    left: -200px;
}

.shape-2 {
    width: 500px;
    height: 500px;
    background: #ff416c;
    bottom: -150px;
    right: -150px;
}

/* =========================================
   NAVIGATION BAR
   ========================================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: rgba(13, 17, 23, 0.6);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 2.2rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.05rem;
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: var(--primary-gradient);
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 220px;
    background: rgba(15, 20, 28, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    list-style: none;
    padding: 0.8rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: var(--transition);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    margin-top: 15px; /* Gap for hover trigger */
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    padding: 0.5rem 1.5rem;
}

.dropdown-menu a::after { display: none; }
.dropdown-menu a:hover { padding-left: 5px; }

/* Buttons */
.btn {
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 210, 255, 0.5);
}

.btn-secondary {
    background: var(--glass-bg);
    color: white;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(4px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 1px solid white;
}
.btn-outline:hover {
    background: white;
    color: black;
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3.25rem 8% 2.75rem;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 640px;
}

/* Type scales with the viewport rather than sitting at one large fixed size.
   clamp() also removes the need for separate font-size overrides at each
   breakpoint, which is where the old sizes drifted out of step. */
.hero-title {
    font-size: clamp(2.1rem, 4.2vw, 3.1rem);
    line-height: 1.12;
    margin-bottom: 0.7rem;
    background: linear-gradient(180deg, #FFFFFF 0%, rgba(255, 255, 255, 0.5) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 1.35rem;
    animation: fadeInUp 1.2s ease-out;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    animation: fadeInUp 1.4s ease-out;
}

.live-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-top: 1.75rem;
    padding: 0.9rem 1.2rem;
    max-width: 560px;
    background: rgba(0, 210, 255, 0.07);
    border: 1px solid rgba(0, 210, 255, 0.22);
    border-radius: 14px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    animation: fadeInUp 1.6s ease-out;
}

.live-notice i {
    color: var(--primary);
    margin-top: 0.2rem;
    flex-shrink: 0;
}

@media (max-width: 760px) {
    .live-notice {
        max-width: 100%;
    }
}

/* =========================================
   HOME — WHAT'S INSIDE
   The site is gated, so this is the only place a logged-out visitor can find
   out what is behind the login.
   ========================================= */
.offer-section {
    padding: 1rem 8% 4rem;
}

.offer-head {
    max-width: 720px;
    margin-bottom: 1.75rem;
}

.offer-head h2 {
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    margin-bottom: 0.4rem;
}

.offer-head p {
    color: var(--text-muted);
    line-height: 1.6;
}

.offer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.offer-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.4rem 1.5rem;
    transition: var(--transition-fast);
}

.offer-card:hover {
    border-color: rgba(0, 210, 255, 0.35);
    transform: translateY(-2px);
}

.offer-card > i {
    display: block;
    font-size: 1.35rem;
    color: var(--primary);
    margin-bottom: 0.8rem;
}

.offer-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.45rem;
}

.offer-card p {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.65;
    margin: 0;
}

/* The gate itself, stated plainly rather than buried under the features. */
.offer-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1.75rem;
    padding: 1.6rem 1.75rem;
    background: rgba(0, 210, 255, 0.06);
    border: 1px solid rgba(0, 210, 255, 0.25);
    border-radius: 18px;
}

/* Allowed to shrink, so the buttons sit alongside the text on a wide screen
   instead of being pushed onto their own line by a rigid max-width. */
.offer-cta-text {
    flex: 1 1 340px;
    max-width: 640px;
}

.offer-cta-text h3 {
    font-size: 1.15rem;
    margin-bottom: 0.35rem;
}

.offer-cta-text p {
    color: var(--text-muted);
    font-size: 0.93rem;
    line-height: 1.65;
    margin: 0;
}

.offer-cta-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* .btn sets no display, so on an <a> it stays inline and ignores padding
   the way a button would not. */
.offer-cta-actions .btn,
.hero-buttons .btn {
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

@media (max-width: 760px) {
    .offer-section { padding: 0.5rem 6% 3rem; }
    .offer-cta { padding: 1.3rem 1.35rem; }
    .offer-cta-actions { width: 100%; }
    .offer-cta-actions .btn { flex: 1 1 auto; }
}

/* =========================================
   DESTINATION / PLACEHOLDER PAGES
   ========================================= */
/* The navbar is sticky, not fixed, so it already occupies layout space — the
   old 7rem of top padding was decoration, and it pushed real content below the
   fold on every gated page. */
.page-hero {
    padding: 2.1rem 8% 1.25rem;
}

/* Wider measure: the intro paragraph reads better across the screen than
   stacked into a narrow column that forces the page taller. */
.page-hero .hero-content {
    max-width: 1150px;
}

.page-hero .hero-title {
    font-size: clamp(1.75rem, 3.1vw, 2.4rem);
    background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.72) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-hero .hero-subtitle {
    max-width: 1000px;
    margin-bottom: 0;
    color: #b5c0d0;
}

.page-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.content-section {
    padding: 0.35rem 8% 3.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.info-card,
.cta-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(16px);
}

.info-card {
    padding: 1.6rem;
    scroll-margin-top: 120px;
}

.info-card i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 1.1rem;
    color: var(--primary);
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid rgba(0, 210, 255, 0.22);
    border-radius: 14px;
    font-size: 1.3rem;
}

.info-card h2,
.info-card h3 {
    margin-bottom: 0.7rem;
}

/* The program tagline, so a card matches the wording of the home-page link
   that leads here. */
.info-card h2 + .info-tagline {
    margin-top: -0.45rem;
    margin-bottom: 0.7rem;
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.98rem;
}

.info-card p {
    color: var(--text-muted);
}

.cta-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding: 2rem;
}

.cta-panel p {
    color: var(--text-muted);
    max-width: 720px;
}

@media (max-width: 760px) {
    .page-hero {
        padding: 1.5rem 6% 1rem;
    }

    .content-section {
        padding: 0.35rem 6% 3rem;
    }

    .cta-panel {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Glassmorphism Cards */
.glass-decoration {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: float 6s ease-in-out infinite;
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--glass-shadow);
    transform: perspective(1000px) rotateY(-15deg);
    transition: var(--transition);
}

.stat-card:hover,
.stat-card:focus-visible {
    transform: perspective(1000px) rotateY(0deg) scale(1.05);
    border-color: rgba(0, 210, 255, 0.4);
}

/* These are links now, so they must not inherit link styling — and they need
   to look reachable rather than decorative. */
.stat-card {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.stat-card-go {
    margin-left: auto;
    font-size: 1rem !important;
    color: var(--text-muted) !important;
    opacity: 0;
    transform: translateX(-6px);
    transition: var(--transition-fast);
}

.stat-card:hover .stat-card-go,
.stat-card:focus-visible .stat-card-go {
    opacity: 1;
    transform: translateX(0);
    color: var(--primary) !important;
}

/* Touch has no hover, so the affordance has to be permanent there. */
@media (hover: none) {
    .stat-card-go { opacity: 1; transform: none; }
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--primary);
}

.stat-card h3 {
    font-size: 1.5rem;
}

.stat-card p {
    color: var(--text-muted);
}

/* =========================================
   SIDEBAR CHATBOT
   ========================================= */
.chatbot-fab {
    position: fixed;
    top: 105px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.5);
    cursor: pointer;
    z-index: 999;
    transition: var(--transition);
}

.chatbot-fab:hover {
    transform: scale(1.1) rotate(15deg);
}

/* Pulse ring shown while the "talk to me" nudge is active */
.chatbot-fab.nudging {
    animation: fabPulse 1.4s ease-out 4;
}

@keyframes fabPulse {
    0% {
        box-shadow: 0 4px 15px rgba(0, 210, 255, 0.5),
                    0 0 0 0 rgba(0, 210, 255, 0.55);
    }
    100% {
        box-shadow: 0 4px 15px rgba(0, 210, 255, 0.5),
                    0 0 0 20px rgba(0, 210, 255, 0);
    }
}

/* Speech-bubble invitation that appears beside the launcher until the
   user opens the chat for the first time this session. */
.chatbot-nudge {
    position: fixed;
    top: 115px;
    right: 102px;
    max-width: 230px;
    background: var(--primary-gradient);
    color: white;
    padding: 0.65rem 1.1rem;
    border-radius: 14px;
    border-top-right-radius: 0;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.3;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.4);
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    transform: translateX(12px);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.chatbot-nudge.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--glass-border);
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.sidebar.active {
    transform: translateX(-400px);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-size: 1.2rem;
    color: var(--primary);
}

#close-sidebar {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

#close-sidebar:hover {
    color: white;
}

.sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Scrollbar styling for chat */
.sidebar-body::-webkit-scrollbar {
    width: 6px;
}
.sidebar-body::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-body::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 3px;
}

.message {
    padding: 1rem;
    border-radius: 12px;
    max-width: 85%;
    line-height: 1.4;
    font-size: 0.95rem;
    animation: fadeIn 0.3s ease-out;
}

.ai-message {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    align-self: flex-start;
    border-top-left-radius: 0;
}

.user-message {
    background: var(--primary-gradient);
    color: white;
    align-self: flex-end;
    border-top-right-radius: 0;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.input-container {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 0.5rem 1rem;
}

.input-container input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 0.5rem;
    outline: none;
    font-family: inherit;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0.5rem;
}

.icon-btn:hover {
    color: var(--primary);
}

.send-btn i {
    color: var(--primary);
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

/* =========================================
   TYPING INDICATOR (animated dots)
   ========================================= */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.85rem 1rem;
    width: fit-content;
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.4;
    animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30%            { transform: translateY(-6px); opacity: 1; }
}

/* =========================================
   VOICE RECORDING ACTIVE STATE
   ========================================= */
.icon-btn.recording {
    color: #ff4b2b;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1);    opacity: 1; }
    50%       { transform: scale(1.25); opacity: 0.7; }
}

/* =========================================
   MY PROGRAM / HISTORY DASHBOARD
   ========================================= */
/* Collapsible dashboard sections */
/* ─── Program section nodes ───────────────────────────────────────────────
   The row of entry points under the My Programs intro. Same visual language
   as the Atlas relationship nodes, so a "thing you can click through to"
   looks the same wherever it appears on the site. */
.prog-nodes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1.15rem;
}

.prog-node {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.58rem 1.05rem;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.prog-node i {
    font-size: 0.88rem;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.prog-node:hover,
.prog-node:focus-visible {
    border-color: rgba(0, 210, 255, 0.45);
    background: rgba(0, 210, 255, 0.08);
    color: var(--primary);
    transform: translateY(-1px);
}

.prog-node:hover i,
.prog-node:focus-visible i { color: var(--primary); }

/* Which section is currently open. */
.prog-node.is-active {
    border-color: rgba(0, 210, 255, 0.55);
    background: rgba(0, 210, 255, 0.13);
    color: var(--primary);
}

.prog-node.is-active i { color: var(--primary); }

@media (max-width: 760px) {
    /* Scroll rather than wrap: six wrapped pills would rebuild the tall header
       this change exists to remove. */
    .prog-nodes {
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        padding-bottom: 0.35rem;
        -webkit-overflow-scrolling: touch;
    }
    .prog-node { scroll-snap-align: start; }
}

/* Stalagmites with nothing behind them yet. Muted rather than hidden, so the five
   are all visible, but visibly not the same as a section holding real data. */
.dash-accordion.is-placeholder { opacity: 0.82; }
.dash-accordion.is-placeholder .acc-title > i { color: var(--text-muted); }

.acc-count.acc-soon {
    background: rgba(255, 176, 32, 0.12);
    border: 1px solid rgba(255, 176, 32, 0.35);
    color: #ffb020;
}

.soon-note {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 1.1rem 1.25rem;
    background: rgba(255, 176, 32, 0.06);
    border: 1px solid rgba(255, 176, 32, 0.22);
    border-radius: 14px;
}

.soon-note > i {
    color: #ffb020;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.soon-note p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 0.93rem;
}

.soon-note strong { color: var(--text); }

.soon-link {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.dash-accordion {
    background: rgba(16, 20, 27, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 20px;
    margin-bottom: 1.25rem;
    scroll-margin-top: 120px;
    transition: var(--transition-fast);
}

.dash-accordion:hover { border-color: rgba(0, 210, 255, 0.24); }

.dash-accordion summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.3rem 1.6rem;
}

.dash-accordion summary::-webkit-details-marker { display: none; }

.acc-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.acc-title > i {
    color: var(--primary);
    font-size: 1.2rem;
    width: 2.6rem;
    height: 2.6rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 210, 255, 0.08);
    border-radius: 12px;
}

.acc-title h2 {
    font-size: 1.35rem;
    line-height: 1.3;
}

.acc-title p {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-top: 0.15rem;
}

.acc-meta {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-shrink: 0;
}

.acc-count {
    color: var(--text-muted);
    font-size: 0.83rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    white-space: nowrap;
}

.acc-count:empty { display: none; }

.acc-chevron {
    color: var(--text-muted);
    transition: transform 0.25s ease;
}

.dash-accordion[open] > summary .acc-chevron { transform: rotate(180deg); }

.dash-accordion[open] > summary { border-bottom: 1px solid rgba(255, 255, 255, 0.06); }

.acc-body { padding: 1.4rem 1.6rem 1.6rem; }

.acc-toolbar {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

/* History lists inside sections */
.history-heading {
    font-size: 1.05rem;
    margin: 1.8rem 0 0.9rem;
    padding-top: 1.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.history-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2.2rem 1.5rem;
    border: 1px dashed var(--glass-border);
    border-radius: 16px;
    font-size: 0.92rem;
    line-height: 1.7;
}

.history-empty i {
    display: block;
    font-size: 1.4rem;
    margin-bottom: 0.6rem;
    color: var(--primary);
    opacity: 0.7;
}

.history-day { margin-bottom: 1.6rem; }
.history-day:last-child { margin-bottom: 0; }

.history-day-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.8rem;
    margin-bottom: 0.4rem;
}

.history-day-head h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.history-day-head span {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.td-sub {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.15rem;
}

.data-table th.row-del, .data-table td.row-del {
    width: 2.2rem;
    text-align: right;
}

/* KPI stat tiles */
.stat-tile-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.stat-tile {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.3rem 1.5rem;
    backdrop-filter: blur(16px);
}

.stat-tile .tile-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.stat-tile .tile-value {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.2;
}

.stat-tile .tile-delta {
    font-size: 0.82rem;
    margin-top: 0.25rem;
    color: var(--text-muted);
}

.stat-tile .tile-delta.up   { color: #35c98e; }
.stat-tile .tile-delta.down { color: #ff7a6e; }

/* Section headers inside dashboard */
.dash-section {
    margin-bottom: 3rem;
    scroll-margin-top: 120px;
}

.dash-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.dash-section-head h2 {
    font-size: 1.6rem;
}

.dash-section-head p {
    color: var(--text-muted);
    font-size: 0.92rem;
}

/* Plan cards */
.plan-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 900px) {
    .plan-grid { grid-template-columns: 1fr; }
}

.program-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.8rem;
}

.progress-track {
    flex: 1;
    height: 8px;
    background: rgba(0, 210, 255, 0.12);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 4px;
}

.schedule-list {
    list-style: none;
    display: flex;
    flex-direction: column;
}

.schedule-list li {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.95rem;
}

.schedule-list li:last-child { border-bottom: none; }

.schedule-day {
    width: 42px;
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
}

.schedule-status {
    margin-left: auto;
    font-size: 0.78rem;
    padding: 0.15rem 0.7rem;
    border-radius: 12px;
}

.schedule-status.done {
    color: #35c98e;
    background: rgba(53, 201, 142, 0.1);
    border: 1px solid rgba(53, 201, 142, 0.25);
}

.schedule-status.today {
    color: var(--primary);
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid rgba(0, 210, 255, 0.25);
}

.schedule-status.upcoming {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
}

.meal-suggestions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.meal-suggestion {
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

.meal-suggestion h4 { font-size: 1rem; margin-bottom: 0.2rem; }

.meal-suggestion p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.meal-tags {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.45rem;
    flex-wrap: wrap;
}

.meal-tag {
    font-size: 0.72rem;
    color: var(--primary);
    background: rgba(0, 210, 255, 0.08);
    border: 1px solid rgba(0, 210, 255, 0.2);
    padding: 0.1rem 0.55rem;
    border-radius: 10px;
}

/* Filter row (scopes the nutrition charts) */
.filter-row {
    display: flex;
    gap: 0.5rem;
}

.filter-chip {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    border-radius: 18px;
    padding: 0.3rem 0.95rem;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-chip:hover { color: var(--text-main); }

.filter-chip.active {
    color: var(--primary);
    background: rgba(0, 210, 255, 0.1);
    border-color: rgba(0, 210, 255, 0.35);
}

/* Chart cards */
.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 900px) {
    .chart-grid { grid-template-columns: 1fr; }
}

.chart-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.4rem 1.5rem;
    backdrop-filter: blur(16px);
}

.chart-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.2rem;
}

.chart-card .chart-sub {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-bottom: 1rem;
}

.chart-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.drill-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.drill-hint i { color: var(--primary); }

.drill-hint a {
    color: var(--primary);
    text-decoration: none;
}

.drill-hint a:hover { text-decoration: underline; }

.chart-wrap {
    position: relative;
    height: 260px;
}

.chart-wrap.tall { height: 300px; }

/* Meal drilldown */
.drilldown-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.25rem;
    margin-top: 1.25rem;
}

@media (max-width: 900px) {
    .drilldown-grid { grid-template-columns: 1fr; }
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8rem;
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--glass-border);
}

.data-table td {
    padding: 0.55rem 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table td.num, .data-table th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tfoot td {
    border-top: 1px solid var(--glass-border);
    border-bottom: none;
    font-weight: 600;
}

/* Supplement meters & checklist */
.supplement-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 900px) {
    .supplement-grid { grid-template-columns: 1fr; }
}

.meter-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.55rem 0;
}

.meter-label {
    width: 130px;
    font-size: 0.92rem;
}

.meter-track {
    flex: 1;
    height: 10px;
    border-radius: 5px;
    background: rgba(11, 155, 216, 0.15);
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    background: #0b9bd8;
    border-radius: 5px;
}

.meter-value {
    width: 46px;
    text-align: right;
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}

.checklist {
    list-style: none;
    display: flex;
    flex-direction: column;
}

.checklist li {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
}

.checklist li:last-child { border-bottom: none; }

.checklist input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #0b9bd8;
    cursor: pointer;
}

.checklist .dose-note {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Peptide section */
.peptide-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 1.25rem;
}

@media (max-width: 900px) {
    .peptide-grid { grid-template-columns: 1fr; }
}

.cycle-fact {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.92rem;
}

.cycle-fact:last-child { border-bottom: none; }

.cycle-fact span:first-child { color: var(--text-muted); }

/* =========================================
   MY PROGRAM — MODERN DASHBOARD TREATMENT
   ========================================= */
/* The fixed decorative blobs wash out long dashboard content — dim them
   and give every surface real opacity so text never sits on the gradient. */
.dashboard-page .bg-blur { opacity: 0.12; }

.dashboard-page .stat-tile,
.dashboard-page .info-card,
.dashboard-page .chart-card {
    background: rgba(16, 20, 27, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

/* Protocol rows — spreadsheet-like: wide description, then spec tiles
   stretched linearly across the page, ending in the expert link. */
.protocol-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.protocol-row {
    background: rgba(16, 20, 27, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
    padding: 1.35rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    transition: var(--transition-fast);
}

.protocol-row:hover { border-color: rgba(0, 210, 255, 0.24); }

.protocol-row-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.8rem;
}

.protocol-row-head h3 {
    font-size: 1.15rem;
    line-height: 1.3;
}

.protocol-row-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.6;
}

.protocol-row-specs {
    display: flex;
    align-items: stretch;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.spec {
    flex: 1 1 120px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 0.6rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.spec-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    white-space: nowrap;
}

.spec-value {
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.35;
}

.spec-note {
    font-size: 0.66rem;
    color: var(--text-muted);
    opacity: 0.85;
}

.spec-accent {
    background: rgba(0, 210, 255, 0.08);
    border-color: rgba(0, 210, 255, 0.28);
}

.spec-accent .spec-value { color: var(--primary); }

.spec-unset .spec-value {
    color: var(--text-muted);
    font-weight: 400;
    font-style: italic;
}

/* "What the experts recommend" — sits at the end of the tile row */
.expert-link {
    flex: 1 1 165px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: left;
    background: rgba(0, 210, 255, 0.06);
    border: 1px solid rgba(0, 210, 255, 0.22);
    border-radius: 12px;
    padding: 0.6rem 0.85rem;
    color: var(--primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    line-height: 1.3;
    cursor: pointer;
    transition: var(--transition-fast);
}

.expert-link:hover {
    background: rgba(0, 210, 255, 0.14);
    border-color: rgba(0, 210, 255, 0.5);
}

.expert-link i { font-size: 0.85rem; flex-shrink: 0; }

/* Expert pane dialog */
#expert-pane {
    background: rgba(15, 20, 28, 0.98);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: var(--text-main);
    padding: 0;
    max-width: 560px;
    width: 92%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

#expert-pane::backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

.expert-pane-inner { padding: 2rem; }

.expert-pane-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.expert-kicker {
    display: block;
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.expert-pane-head h3 { font-size: 1.4rem; }

.expert-optimal {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    background: rgba(0, 210, 255, 0.08);
    border: 1px solid rgba(0, 210, 255, 0.28);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    margin-bottom: 1.1rem;
}

.expert-optimal-value {
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
}

.expert-body {
    color: var(--text-main);
    font-size: 0.94rem;
    line-height: 1.7;
    margin-bottom: 1.2rem;
}

.expert-disclaimer {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.2rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

.expert-disclaimer i { color: var(--primary); margin-top: 0.15rem; }

.protocol-refs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.ref-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.42rem 0.9rem;
    border-radius: 18px;
    font-size: 0.78rem;
    text-decoration: none;
    transition: var(--transition-fast);
}

.ref-chip i {
    color: var(--primary);
    font-size: 0.72rem;
}

.ref-chip:hover {
    border-color: rgba(0, 210, 255, 0.45);
    color: var(--primary);
}

/* =========================================
   RELATIONSHIPS ("Connects to")
   Stage 1 of the Knowledge Atlas — the graph
   rendered as walkable text, no canvas yet.
   ========================================= */
.expert-pane-title {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.rel-block {
    margin-top: 1.4rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--glass-border);
}

.rel-heading {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.9rem;
}

.rel-group { margin-bottom: 1rem; }
.rel-group:last-of-type { margin-bottom: 0; }

.rel-group-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
}

.rel-group-label i { font-size: 0.72rem; }

.rel-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding-left: 0.9rem;
    border-left: 1px solid var(--glass-border);
}

.rel-item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.2rem 0.55rem;
}

.rel-node {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 0.3rem 0.75rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    color: var(--text-main);
    cursor: pointer;
    text-align: left;
    transition: var(--transition-fast);
}

.rel-node i { font-size: 0.7rem; color: var(--text-muted); }

.rel-node:hover,
.rel-node:focus-visible {
    border-color: rgba(0, 210, 255, 0.45);
    color: var(--primary);
    outline: none;
}

.rel-node:hover i,
.rel-node:focus-visible i { color: var(--primary); }

/* Processes are the connective tissue of the map — flagged so they read as a
   different kind of thing from something you can actually take. */
.rel-node.rel-concept {
    background: rgba(0, 210, 255, 0.07);
    border-color: rgba(0, 210, 255, 0.24);
}

.rel-node.rel-concept i { color: var(--primary); }

/* Depletion and caution edges. Declared after .rel-concept so the warning tint
   wins when a risk edge points at a process. */
.rel-node.rel-risk {
    background: rgba(255, 176, 32, 0.09);
    border-color: rgba(255, 176, 32, 0.35);
}

.rel-node.rel-risk i,
.rel-node.rel-risk:hover i,
.rel-node.rel-risk:focus-visible i { color: #ffb020; }

.rel-node.rel-risk:hover,
.rel-node.rel-risk:focus-visible {
    border-color: rgba(255, 176, 32, 0.65);
    color: #ffb020;
}

.rel-note {
    color: var(--text-muted);
    font-size: 0.79rem;
    line-height: 1.5;
    flex: 1 1 14rem;
}

.rel-footnote {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.1rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.5;
}

.rel-footnote i { color: var(--primary); margin-top: 0.15rem; }

/* Expert channel list inside the detail pane. */
.expert-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.expert-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.85rem;
}

.expert-chan {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-fast);
}

.expert-chan i { color: #ff0033; font-size: 0.95rem; }
.expert-chan:hover { color: var(--primary); }

.expert-search {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-decoration: none;
    transition: var(--transition-fast);
}

.expert-search i { font-size: 0.66rem; }
.expert-search:hover { color: var(--primary); }

.expert-block .rel-footnote i { color: #ff0033; }

/* Always-visible strip on a protocol row. */
.rel-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.7rem;
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px dashed var(--glass-border);
}

.rel-strip-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.rel-strip-label i { color: var(--primary); font-size: 0.78rem; }

.rel-strip-nodes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.rel-strip .rel-node {
    font-size: 0.76rem;
    padding: 0.24rem 0.62rem;
}

@media (max-width: 600px) {
    .rel-note { flex-basis: 100%; }
    .rel-strip-label { flex-basis: 100%; }
}

.protocol-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    padding: 2.5rem;
    border: 1px dashed var(--glass-border);
    border-radius: 16px;
}

/* =========================================
   PROTOCOL MATRICES (supplements / peptides)
   ========================================= */
.matrix-wrap {
    overflow-x: auto;
}

.matrix-table {
    width: 100%;
    min-width: 1000px;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.matrix-table th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.78rem;
    padding: 0.6rem;
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
}

.matrix-table td {
    padding: 0.85rem 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: top;
}

.matrix-table tr:last-child td { border-bottom: none; }

.matrix-table td.num, .matrix-table th.num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.matrix-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.matrix-desc {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.5;
    max-width: 340px;
}

.ref-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.ref-link:hover { text-decoration: underline; }
.ref-link i { font-size: 0.65rem; }

.row-actions {
    display: flex;
    gap: 0.35rem;
    white-space: nowrap;
}

.icon-action {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    border-radius: 8px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 0.75rem;
}

.icon-action:hover {
    color: var(--primary);
    border-color: rgba(0, 210, 255, 0.35);
}

.icon-action.remove-row:hover {
    color: #ff7a6e;
    border-color: rgba(255, 122, 110, 0.35);
}

.privacy-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 0.9rem;
}

.privacy-note i { color: var(--primary); }

/* Editor / picker dialog */
#protocol-editor {
    background: rgba(15, 20, 28, 0.98);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: var(--text-main);
    padding: 2rem;
    max-width: 620px;
    width: 92%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

#protocol-editor::backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

.editor-form h3 {
    font-size: 1.3rem;
    margin-bottom: 1.2rem;
}

.editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .editor-grid { grid-template-columns: 1fr; }
}

.editor-grid label {
    display: block;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.editor-grid .form-control {
    margin-top: 0.35rem;
}

.editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.7rem;
    margin-top: 1.5rem;
}

.picker-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 46vh;
    overflow-y: auto;
}

.picker-item {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
}

.picker-item:hover { border-color: rgba(0, 210, 255, 0.3); }

.picker-item input {
    margin-top: 0.25rem;
    width: 17px;
    height: 17px;
    accent-color: var(--primary);
    flex-shrink: 0;
}

/* =========================================
   CONCIERGE HINT CHIPS
   ========================================= */
.hint-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-self: flex-start;
    max-width: 95%;
}

.hint-label {
    width: 100%;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.hint-chip {
    background: rgba(0, 210, 255, 0.08);
    border: 1px solid rgba(0, 210, 255, 0.25);
    color: var(--primary);
    border-radius: 20px;
    padding: 0.4rem 0.9rem;
    font-size: 0.82rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition-fast);
}

.hint-chip:hover {
    background: rgba(0, 210, 255, 0.18);
    transform: translateY(-1px);
}

/* =========================================
   CONTACT PAGE (Hero Style)
   ========================================= */
.contact-hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2.5rem 6% 3rem;
}

.contact-hero-section .hero-content {
    max-width: 900px;
    margin-bottom: 1.75rem;
}

.contact-highlights {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 500;
}

.highlight-item i {
    font-size: 1.4rem;
    color: var(--primary);
    background: rgba(0, 210, 255, 0.1);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.centered-card {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    text-align: left;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3.5rem;
    box-shadow: var(--glass-shadow);
    animation: fadeInUp 1s ease-out;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group.full-width {
    grid-column: span 2;
}

@media (max-width: 600px) {
    .form-group.full-width {
        grid-column: span 1;
    }
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    color: white;
    outline: none;
    transition: var(--transition-fast);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
}

.form-control:focus {
    border-color: var(--primary);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 0 0 4px rgba(0, 210, 255, 0.1);
}

select.form-control option {
    background: #171c24;
    color: white;
}

textarea.form-control {
    resize: none;
    height: 130px;
}

#contact-status {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.95rem;
    min-height: 1.5em;
    padding: 0.8rem;
    border-radius: 8px;
}

.status-success { 
    color: #52c41a; 
    background: rgba(82, 196, 26, 0.1);
    border: 1px solid rgba(82, 196, 26, 0.2);
}

.status-error {
    color: #ff4d4f;
    background: rgba(255, 77, 79, 0.1);
    border: 1px solid rgba(255, 77, 79, 0.2);
}

/* =========================================
   CHARTS (Phase 4)
   Inline-SVG charts on My Program. Marks carry the series color; all text
   stays in text tokens. Grid/axes are recessive hairlines.
   ========================================= */
.chart-card {
    position: relative;
    margin-bottom: 1.4rem;
    padding: 1.2rem 1.3rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

.chart-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
    flex-wrap: wrap;
}

.chart-head h3 {
    font-size: 1.05rem;
}

.chart-head p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.chart-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.chart-grid {
    stroke: rgba(255, 255, 255, 0.07);
    stroke-width: 1;
}

.chart-baseline {
    stroke: rgba(255, 255, 255, 0.16);
    stroke-width: 1;
}

.chart-axis {
    fill: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.chart-axis-y { text-anchor: end; }
.chart-axis-x { text-anchor: middle; }

/* Selective direct label on the stack cap. */
.chart-cap {
    fill: var(--text-main);
    text-anchor: middle;
    font-size: 11px;
    font-weight: 600;
}

.chart-mark {
    transition: opacity 0.15s ease;
}

.chart-svg:hover .chart-mark { opacity: 0.82; }
.chart-mark:hover { opacity: 1; }

.chart-hit { cursor: pointer; }

/* Legend — the dependable identity channel. */
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.1rem;
    margin-top: 0.85rem;
}

.chart-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.chart-swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Headline figure for the adherence section. */
.chart-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 1rem;
}

.chart-stat-label {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.chart-stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.chart-stat-sub {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.chart-note {
    margin-top: 0.7rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

.chart-empty {
    padding: 1.6rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

/* Tooltips enhance; the table view guarantees access to every value. */
.chart-tip {
    position: absolute;
    z-index: 5;
    min-width: 150px;
    padding: 0.6rem 0.75rem;
    background: rgba(10, 14, 20, 0.97);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    color: var(--text-main);
    font-size: 0.8rem;
    line-height: 1.45;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.chart-tip.visible { opacity: 1; }

.chart-tip strong {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
}

.tip-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
}

.tip-row b {
    margin-left: auto;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}

.tip-total {
    margin-top: 0.2rem;
    padding-top: 0.25rem;
    border-top: 1px solid var(--glass-border);
}

.tip-list {
    display: block;
    margin-top: 0.15rem;
    color: var(--text-muted);
    font-size: 0.74rem;
}

.chart-table {
    margin-top: 0.9rem;
}

.chart-table > summary {
    cursor: pointer;
    color: var(--primary);
    font-size: 0.84rem;
    list-style: none;
}

.chart-table > summary::-webkit-details-marker { display: none; }

.chart-table > summary::before {
    content: '▸ ';
    display: inline-block;
    transition: transform 0.2s ease;
}

.chart-table[open] > summary::before { content: '▾ '; }

.chart-table .data-table { margin-top: 0.6rem; }

/* The viewBox is sized in real pixels (see charts.js), so chart type does not
   need scaling up on small screens — only the surrounding chrome tightens. */
@media (max-width: 600px) {
    .chart-card { padding: 1rem 0.75rem 0.9rem; }
    .chart-stat-value { font-size: 2.1rem; }
    .chart-axis { font-size: 10px; }
    .chart-cap { font-size: 10px; }
}

/* =========================================
   RESPONSIVE FOUNDATION (Phase 1)
   Injected hamburger nav + mobile layout.
   nav.js wraps .nav-links and .nav-actions in .nav-drawer and appends
   .nav-toggle. On desktop the drawer is display:contents, so the original
   flex row is unchanged.
   ========================================= */

/* Hamburger button — hidden until the nav collapses. */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0 10px;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text-main);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.2s ease;
}

/* Desktop: the drawer is transparent to layout. */
.nav-drawer {
    display: contents;
}

@media (max-width: 900px) {
    .navbar {
        padding: 1rem 5%;
    }

    .nav-toggle {
        display: flex;
    }

    /* Animate the hamburger into an X when open. */
    .navbar.nav-open .nav-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .navbar.nav-open .nav-toggle span:nth-child(2) {
        opacity: 0;
    }
    .navbar.nav-open .nav-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Collapsed panel below the bar. */
    .nav-drawer {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem 5% 1.5rem;
        background: rgba(13, 17, 23, 0.98);
        border-bottom: 1px solid var(--glass-border);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
        max-height: calc(100vh - 100%);
        overflow-y: auto;
    }

    .navbar.nav-open .nav-drawer {
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .nav-links > li {
        width: 100%;
        border-bottom: 1px solid var(--glass-border);
    }

    .nav-links > li:last-child {
        border-bottom: none;
    }

    .nav-links a {
        display: block;
        padding: 0.9rem 0.25rem;
        font-size: 1.05rem;
    }

    /* Underline animation is a desktop affordance. */
    .nav-links a::after {
        display: none;
    }

    /* Dropdowns expand inline on tap instead of on hover. */
    .dropdown-menu {
        position: static;
        width: 100%;
        opacity: 1;
        visibility: hidden;
        transform: none;
        max-height: 0;
        overflow: hidden;
        margin: 0;
        padding: 0;
        border: none;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.02);
        border-radius: 10px;
        transition: max-height 0.3s ease, padding 0.3s ease;
    }

    .dropdown.open .dropdown-menu {
        visibility: visible;
        max-height: 480px;
        padding: 0.4rem 0;
        margin: 0.2rem 0 0.6rem;
    }

    /* Keep the caret; rotate it when expanded. */
    .dropdown > a .fa-chevron-down {
        transition: transform 0.3s ease;
    }
    .dropdown.open > a .fa-chevron-down {
        transform: rotate(180deg);
    }

    .nav-actions {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
        margin-top: 0.75rem;
    }

    .nav-actions .btn {
        width: 100%;
    }

    /* Homepage hero stacks and centers. */
    .hero-section {
        flex-direction: column;
        text-align: center;
        padding: 4rem 6% 3rem;
        gap: 2.5rem;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }

    .live-notice {
        text-align: left;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Horizontal-scroll wrapper for wide data tables (added by my-program.js). */
.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 760px) {
    .table-scroll .data-table {
        min-width: 620px;
    }
}

/* Chat assistant goes full-screen on phones. */
@media (max-width: 600px) {
    .sidebar {
        width: 100%;
        right: -100%;
    }
    .sidebar.active {
        transform: translateX(-100%);
    }

    .chatbot-nudge {
        max-width: 180px;
        right: 84px;
        font-size: 0.82rem;
    }

    .btn-large {
        padding: 0.85rem 1.8rem;
        font-size: 1rem;
    }
}

/* =========================================
   HOW AM I FEELING TODAY
   ========================================= */

/* Trend line (charts.js renderTrendChart) */
.chart-line {
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.checkin-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.4rem 1.5rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.checkin-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.checkin-head h3 { font-size: 1.05rem; }

.checkin-status {
    font-size: 0.85rem;
    min-height: 1em;
}
.checkin-status.ok  { color: #52c41a; }
.checkin-status.err { color: #ff4d4f; }

.checkin-field { margin-bottom: 1.3rem; }

.checkin-label {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
}

.measure-focus {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 400;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 0.1rem 0.6rem;
}

.measure-help {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    line-height: 1;
}
.measure-help:hover { color: var(--primary); border-color: var(--primary); }

/* 0-10 scale — a real tap target per value, wraps on narrow screens. */
.scale-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.scale-btn {
    flex: 1 1 auto;
    min-width: 38px;
    min-height: 38px;
    padding: 0.4rem 0;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.scale-btn:hover { border-color: rgba(0, 210, 255, 0.4); }

.scale-btn.selected {
    background: var(--primary-gradient);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}

.yesno-row .scale-btn { min-width: 90px; flex: 0 1 120px; }

.scale-ends {
    display: flex;
    justify-content: space-between;
    margin-top: 0.35rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.measure-number {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.measure-number .form-control { max-width: 140px; }
.measure-unit { color: var(--text-muted); font-size: 0.85rem; }

/* A device-reported score carries the device with it — the number and the
   watch that produced it are one reading, so they sit on one row. */
.measure-score { flex-wrap: wrap; }
.measure-score .device-select {
    max-width: 220px;
    flex: 1 1 180px;
    margin-left: 0.4rem;
}

@media (max-width: 600px) {
    .measure-score .form-control { max-width: none; flex: 1 1 100%; }
    .measure-score .device-select { max-width: none; flex: 1 1 100%; margin-left: 0; }
}

/* ── Sleep phases ────────────────────────────────────────────────────────── */
/* An inset panel rather than four more loose fields: the stages are one
   reading of one night, taken off the same device as the score above. */
.phase-block {
    padding: 1.05rem 1.15rem 0.9rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

.phase-head { margin-bottom: 0.9rem; }
.phase-head h4 { margin: 0 0 0.2rem; font-size: 0.95rem; color: var(--text-main); }
.phase-head .chart-sub { margin: 0; }

/* Two by two, not four across: it pairs the two light phases on one row and
   REM against deep on the next, and it never leaves a lone fourth field
   orphaned on a second row the way an auto-fit track does at mid widths. */
.phase-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem 1.1rem;
}

.phase-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.phase-field .form-control { max-width: 110px; }

.phase-total {
    margin: 0.9rem 0 0;
    min-height: 1.1em;   /* held open, so the panel does not jump as you type */
}

/* History: the four stages read as one cell, so the table stays scannable. */
.phase-cells { display: flex; flex-wrap: wrap; gap: 0.35rem 0.6rem; }
.phase-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.phase-cell em {
    margin-right: 0.3rem;
    color: var(--text-muted);
    font-style: normal;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

@media (max-width: 600px) {
    .phase-block { padding: 0.9rem 0.85rem 0.8rem; }
    .phase-grid { grid-template-columns: 1fr; gap: 0.8rem; }
    .phase-field .form-control { max-width: none; }
}

.checkin-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}
.checkin-hint { margin: 0; }

.feeling-block { margin-top: 1.6rem; }

.feeling-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
}
.feeling-block-head h3 { font-size: 1.05rem; }

.trend-select { max-width: 260px; }

.focus-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.1rem 1.2rem;
    margin-bottom: 0.8rem;
}
.focus-item.inactive { opacity: 0.55; }

.focus-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}
.focus-item-head h4 { font-size: 1rem; }
.focus-item-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

.focus-measures {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.7rem;
}

.focus-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.25rem 0.7rem;
    background: rgba(0, 210, 255, 0.08);
    border: 1px solid rgba(0, 210, 255, 0.22);
    border-radius: 20px;
    color: var(--primary);
    font-size: 0.8rem;
}
.focus-chip em { color: var(--text-muted); font-style: normal; font-size: 0.72rem; }

@media (max-width: 600px) {
    .checkin-card { padding: 1.1rem 1rem; }
    .scale-btn { min-width: 30px; font-size: 0.82rem; padding: 0.35rem 0; }
    .trend-select { max-width: 100%; width: 100%; }
    .checkin-actions .btn { width: 100%; }
}

/* ── Tracker builder ─────────────────────────────────────────────────────── */
.builder-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.builder-lead {
    color: var(--text-main);
    font-size: 1rem;
    margin-bottom: 0.9rem;
}

.builder-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.1rem;
}

.builder-input {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.builder-input .form-control { flex: 1 1 240px; }

.builder-mic {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    cursor: pointer;
}
.builder-mic:hover { color: var(--primary); border-color: var(--primary); }
.builder-mic.recording {
    background: var(--primary-gradient);
    color: #fff;
    border-color: transparent;
    animation: fabPulse 1.4s ease-out infinite;
}

.builder-status { margin-top: 0.9rem; min-height: 1.2em; }

.builder-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 0.5rem;
    vertical-align: -1px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Suggested tracker preview ───────────────────────────────────────────── */
.preview-head { margin-bottom: 0.3rem; }
.preview-head h3 { font-size: 1.3rem; }

.preview-measure {
    padding: 0.9rem 1.1rem;
    margin-top: 0.7rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
}

.preview-measure.subjective {
    background: rgba(0, 210, 255, 0.07);
    border-color: rgba(0, 210, 255, 0.22);
}

.preview-measure strong { display: block; font-size: 0.98rem; }

.preview-unit {
    display: inline-block;
    margin-top: 0.15rem;
    color: var(--primary);
    font-size: 0.78rem;
}

.preview-measure p {
    margin-top: 0.45rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.preview-caution { margin-top: 1rem; }

/* ── Daily check-in, grouped per tracker ─────────────────────────────────── */
.checkin-card[hidden] { display: none; }
.checkin-tracker { margin-bottom: 1.4rem; }

.checkin-tracker-name {
    margin-bottom: 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
    color: var(--primary);
    font-size: 0.95rem;
}

.feeling-block-title { font-size: 1.05rem; margin-bottom: 0.9rem; }
.feeling-block[hidden] { display: none; }

@media (max-width: 600px) {
    .builder-card { padding: 1.1rem 1rem; }
    .builder-input .form-control { flex: 1 1 100%; order: 1; }
    .builder-mic { order: 2; }
    .builder-input .btn { order: 3; flex: 1; }
}
