/* Base Styles */
:root {
    --navy: #0c2d48;
    --deep-navy: #04192d;
    --accent: #1e74ff;
    --accent-soft: #b9d9ff;
    --text-main: #102b43;
    --text-sub: #47627a;
    --card: #ffffff;
    --muted: #eef2f7;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    margin: 0;
    padding: 0;
    text-align: left;
    transition: background 0.5s, color 0.5s;
    background: linear-gradient(180deg, #f4f8fc 0%, #eef2f7 100%);
    color: var(--text-main);
}

/* Light Mode */
body:not(.dark-mode) {
    color: var(--text-main);
}

/* Dark Mode */
body.dark-mode {
    background: #0d1420;
    color: #eee;
}

main {
    padding-bottom: 110px;
}

@media (max-width: 720px) {
    main {
        padding-bottom: 96px;
    }
}

body.dark-mode a {
    color: #66ccff; /* A light blue that contrasts well on dark backgrounds */
    text-decoration: underline;
}

/* Optional: Add a hover effect for better visibility */
body.dark-mode a:hover {
    color: #99ddff;
}

.container {
    background: #ffffff;
    padding: 16px;
    margin: 0 auto;
    width: 100%;
    max-width: 1200px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    box-sizing: border-box;
    transition: background 0.5s;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.dashboard-section {
    width: 100%;
    max-width: 1200px;
    padding: 16px;
    margin: 10px auto 40px;
    box-sizing: border-box;
}

.bioclock-section {
    width: 100%;
    max-width: 1200px;
    padding: 16px;
    margin: 28px auto 24px;
    box-sizing: border-box;
}

.bioclock-card {
    background: var(--card);
    border-radius: 18px;
    padding: clamp(18px, 2.4vw, 28px);
    border: 1px solid rgba(12, 45, 72, 0.08);
    box-shadow: 0 18px 40px rgba(12, 45, 72, 0.12);
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

body.dark-mode .bioclock-card {
    background: #1b2230;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}

.bioclock-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.bioclock-actions {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.bioclock-refresh {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    max-width: 100%;
    white-space: nowrap;
}

.bioclock-refresh:hover {
    background: #0d5bdb;
}

.bioclock-info {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(30, 116, 255, 0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--accent);
    background: rgba(30, 116, 255, 0.08);
}

.bioclock-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bioclock-time {
    font-size: clamp(44px, 12vw, 84px);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--deep-navy);
}

body.dark-mode .bioclock-time {
    color: #f0f4ff;
}

.bioclock-subtitle {
    font-size: 14px;
    color: var(--text-sub);
}

body.dark-mode .bioclock-subtitle {
    color: rgba(255, 255, 255, 0.7);
}

.bioclock-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 14px;
    color: var(--text-sub);
}

.bioclock-badge {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(30, 116, 255, 0.12);
    color: #0d4db7;
}

.bioclock-badge.is-fresh {
    background: rgba(24, 159, 105, 0.12);
    color: #0f7f55;
}

.bioclock-badge.is-recent {
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
}

.bioclock-badge.is-stale {
    background: rgba(239, 68, 68, 0.16);
    color: #b91c1c;
}

.bioclock-status {
    min-height: 18px;
    font-size: 13px;
    color: var(--text-sub);
}

.bioclock-status-offline {
    color: #b45309;
}

@media (max-width: 720px) {
    .bioclock-section {
        padding: 16px;
    }
}

/* Force left alignment for all dashboard content, even if an ancestor applies centering */
.container,
.container * {
    text-align: left !important;
}

/* Preserve intentional centering where needed */
.container .progress-bar {
    text-align: center;
}

.container > * {
    align-self: flex-start;
    width: 100%;
}

body.dark-mode .container {
    background: #2a2a2a;
}

input, select, button {
    padding: 10px;
    margin: 8px 0;
    border-radius: 4px;
    border: 1px solid #bbb;
    transition: border-color 0.3s;
}

input:focus, select:focus, button:focus {
    border-color: #007BFF;
}

button {
    background-color: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    padding: 10px 20px;
}

button:hover {
    background-color: #0d5bdb;
}

.progress {
    width: 100%;
    background: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar {
    width: 0%;
    height: 20px;
    background: #4e73df;
    text-align: center;
    line-height: 20px;
    color: #fff;
    transition: width 0.5s;
}

.crs-results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 15px;
    text-align: left;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    border-radius: 10px;
}

.crs-results-table th, .crs-results-table td {
    padding: 12px 15px;
}

.crs-results-table thead {
    background-color: #4e73df;
    color: #ffffff;
}

.crs-results-table tbody tr {
    background-color: #f8f9fc;
    transition: background-color 0.3s ease;
}

.crs-results-table tbody tr:nth-child(even) {
    background-color: #ffffff;
}

.crs-results-table tbody tr:hover {
    background-color: #dde4f0;
    cursor: pointer;
}

.crs-results-table .actions-cell {
    text-align: right !important;
    white-space: nowrap;
}

.crs-actions {
    display: inline-flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.crs-explanation {
    margin-top: 20px;
    margin-inline: 6px;
    padding: 16px 20px;
    background-color: #f0f4ff;
    border-radius: 8px;
    box-sizing: border-box;
}

body.dark-mode .crs-results-table tbody tr {
    background-color: #2a2d37;
    color: #e1e1e1;
}

body.dark-mode .crs-results-table tbody tr:nth-child(even) {
    background-color: #383c47;
}

body.dark-mode .crs-results-table tbody tr:hover {
    background-color: #4a5062;
}
body.dark-mode .crs-explanation {
    background-color: #2c2f38;
    color: #ffffff;
    border: 1px solid #555;
}

body.dark-mode .crs-explanation h3 {
    color: #89c5ff;
}

body.dark-mode .crs-explanation strong {
    color: #a1cfff;
}

.site-header {
    background-color: #003366;
    color: #ffffff;
    padding: 15px 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 24px;
    box-sizing: border-box;
    border-radius: 8px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.site-logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.site-page-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    font-size: 1.8em;
    font-weight: 700;
    text-align: center;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.dark-mode .site-header {
    background-color: #111;
    color: #fff;
}

/* Global Header */
.global-header {
    width: 100%;
    box-sizing: border-box;
    padding: clamp(14px, 2vw, 18px) clamp(18px, 3vw, 32px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(14px, 2vw, 20px);
    flex-wrap: wrap;
    background: linear-gradient(120deg, var(--deep-navy) 0%, var(--navy) 60%, #0a3f6d 100%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-text strong {
    font-size: 18px;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    margin: 0;
}

.menu-links {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2vw, 20px);
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
    flex-wrap: wrap;
}

.menu-links a {
    color: #d7e8ff;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 20px;
    transition: background 0.25s, color 0.25s;
}

.menu-links a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.primary-button,
.ghost-button,
.text-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 24px;
    padding: 10px 16px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    max-width: 100%;
    white-space: nowrap;
}

.primary-button {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 12px 26px rgba(30, 116, 255, 0.25);
}

.primary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 32px rgba(30, 116, 255, 0.35);
}

.ghost-button {
    background: #eaf2ff;
    color: var(--accent);
    border: 1px solid #c7dcff;
}

.ghost-button:hover {
    background: #d9e8ff;
    border-color: var(--accent);
    transform: translateY(-1px);
}

body.dark-mode .ghost-button {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

body.dark-mode .ghost-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.45);
}

.text-link {
    padding: 0;
    color: var(--accent);
}

/* Hero */
.hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: clamp(24px, 4vw, 32px);
    align-items: center;
    padding: clamp(48px, 7vw, 70px) clamp(18px, 4vw, 34px) 40px;
    max-width: 1180px;
    margin: 0 auto;
}

.hero-copy h1 {
    font-size: 2.6rem;
    margin: 8px 0 12px;
    color: #0a1a2f;
}

h1,
.welcome-title,
.big-heading {
    font-size: clamp(28px, 7vw, 56px);
    line-height: 1.05;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.welcome-email {
    overflow-wrap: anywhere;
}

.lead {
    color: var(--text-sub);
    font-size: 1.05rem;
    margin: 0 0 14px;
    line-height: 1.6;
}

.cta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.hero-device {
    display: grid;
    place-items: center;
    position: relative;
}

.device-bezel {
    width: 320px;
    height: 260px;
    background: linear-gradient(140deg, #cfd6e1 0%, #eef2f7 100%);
    border-radius: 32px;
    box-shadow: 0 22px 38px rgba(0, 0, 0, 0.12), 0 6px 18px rgba(0, 0, 0, 0.1);
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
}

.device-face {
    width: 260px;
    height: 200px;
    border-radius: 26px;
    background: radial-gradient(circle at 25% 20%, #3b7ee7, #0a2950 70%);
    color: #fff;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 16px;
    box-sizing: border-box;
}

.dial {
    font-size: 48px;
    font-weight: 700;
}

.dial-sub {
    opacity: 0.9;
    font-weight: 600;
}

.device-strap {
    position: absolute;
    width: 120px;
    height: 460px;
    background: linear-gradient(180deg, #d8dde6 0%, #f4f7fb 100%);
    border-radius: 60px;
    z-index: -1;
    transform: rotate(-12deg);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

/* Intro */
.intro {
    max-width: 1080px;
    margin: 10px auto 30px;
    padding: 0 34px;
}

.intro h2 {
    margin: 6px 0 10px;
    font-size: 1.9rem;
    color: #0f2138;
}

/* Feature Grid */
.feature-grid {
    max-width: 1100px;
    margin: 0 auto clamp(48px, 6vw, 72px);
    padding: 0 34px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    column-gap: 22px;
    row-gap: clamp(36px, 5vw, 52px);
    align-items: stretch;
}

.feature-card {
    background: var(--card);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
    border: 1px solid #e3e8ee;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.feature-card h3 {
    margin: 4px 0 6px;
    color: #0c223a;
}

.feature-card p {
    margin: 0 0 12px;
    color: var(--text-sub);
    line-height: 1.5;
}

.feature-card .text-link,
.feature-card .pill-row {
    margin-top: auto;
}

.pill-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pill {
    background: var(--muted);
    color: #0f2a43;
    padding: 6px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
}
.link-pill {
    text-decoration: none;
    border: 1px solid #d0d6e0;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.link-pill:hover {
    background: #e2ecf8;
    color: #0b2541;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

/* Forms */
.form-panels {
    width: 100%;
    max-width: 1200px;
    margin: 40px auto 70px;
    padding: 0 20px 10px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 20px;
    align-items: stretch;
}

.panel {
    background: var(--card);
    border-radius: 18px;
    padding: clamp(18px, 2.4vw, 24px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e9ef;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.card {
    width: 100%;
    max-width: 100%;
    padding: 18px;
    box-sizing: border-box;
}

.panel-header h3 {
    margin: 6px 0 4px;
    color: #0c223a;
}

.panel .helper {
    margin: 0 0 12px;
    color: var(--text-sub);
}

.stacked-form {
    display: grid;
    gap: 12px;
}

.stacked-form label {
    display: grid;
    gap: 6px;
    font-weight: 600;
    color: #16304f;
}

.stacked-form input {
    width: 100%;
    box-sizing: border-box;
}

.stacked-form button {
    width: fit-content;
    padding: 12px 20px;
}

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

/* Dark mode tweaks for new elements */
body.dark-mode .global-header {
    background: linear-gradient(120deg, #050c14 0%, #081529 60%, #0b2b50 100%);
}

body.dark-mode .menu-links a {
    color: #b8d5ff;
}

body.dark-mode .menu-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

body.dark-mode .hero-copy h1,
body.dark-mode .intro h2,
body.dark-mode .feature-card h3,
body.dark-mode .panel-header h3 {
    color: #f6f8fb;
}

body.dark-mode .lead,
body.dark-mode .feature-card p,
body.dark-mode .panel .helper,
body.dark-mode .text-link {
    color: #cfd9e6;
}

body.dark-mode .feature-card,
body.dark-mode .panel {
    background: #1b2433;
    border-color: #233145;
}

body.dark-mode .pill {
    background: #2a3345;
    color: #d9e2f0;
}

body.dark-mode .link-pill {
    border-color: #2f3a4e;
    background: #1f2635;
    color: #d9e2f0;
}

body.dark-mode .link-pill:hover {
    background: #27314b;
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

body.dark-mode .primary-button {
    box-shadow: 0 12px 26px rgba(30, 116, 255, 0.35);
}

@media (max-width: 900px) {
    .global-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .menu-links {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .header-actions {
        order: 2;
    }
}

@media (max-width: 720px) {
    .global-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 16px;
        gap: 10px;
    }

    .brand-mark {
        width: 100%;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }

    .header-actions .primary-button,
    .header-actions .ghost-button {
        width: auto;
        padding: 9px 14px;
        font-size: 15px;
    }

    .menu-links {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 6px;
        gap: 12px;
        scroll-snap-type: x mandatory;
    }

    .menu-links a {
        white-space: nowrap;
        font-size: 14px;
        padding: 7px 12px;
        scroll-snap-align: start;
    }

    .hero-device .device-bezel {
        width: 260px;
        height: 210px;
    }

    .hero-device .device-strap {
        display: none;
    }
}

@media (max-width: 540px) {
    .global-header {
        row-gap: 12px;
    }

    .menu-links {
        padding-bottom: 10px;
    }

    .header-actions {
        gap: 10px;
    }

    .header-actions .primary-button,
    .header-actions .ghost-button {
        flex: 1 1 0;
        justify-content: center;
    }

    .hero-copy h1 {
        font-size: 2.25rem;
    }

    .lead {
        font-size: 1rem;
    }

    .hero-device .device-bezel {
        width: 240px;
        height: 190px;
    }
}

/* Profile Page */
.profile-page {
    width: 100%;
    max-width: 1200px;
    margin: 28px auto 60px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

@media (max-width: 480px) {
    .container {
        padding: 12px;
    }

    .global-header {
        justify-content: flex-start;
    }

    .header-actions .primary-button,
    .header-actions .ghost-button {
        flex: 1 1 auto;
    }
}

.profile-hero {
    background: linear-gradient(135deg, #f1f6ff 0%, #ffffff 100%);
    border: 1px solid #dce1e6;
    border-radius: 14px;
    padding: 22px 26px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
}

.hero-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hero-text .eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    font-weight: 700;
    color: #003366;
    margin: 0;
}

.hero-text h2 {
    margin: 0;
    font-size: 1.65rem;
    color: #0f2138;
}

.hero-text .subhead {
    margin: 0;
    color: #4b5b6c;
}

.profile-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 18px;
    align-items: start;
}

.profile-card {
    background: #ffffff;
    border: 1px solid #dce1e6;
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
}

.card-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #0f2138;
}

.card-header .helper-text {
    margin: 4px 0 0;
    color: #516278;
    font-size: 0.95rem;
}

.profile-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 4px 0 10px;
}

.profile-form.two-column {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.profile-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-form label {
    font-weight: 600;
    color: #1e2936;
}

.profile-form input,
.profile-form select {
    width: 100%;
    box-sizing: border-box;
}

.profile-form .form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.profile-form button {
    width: auto;
}

.form-message {
    border-radius: 10px;
    padding: 10px 12px;
    margin: 4px 0 6px;
    font-weight: 600;
}

.form-message.success {
    background: #e7f8ef;
    color: #0f7b3e;
    border: 1px solid #c1ebd4;
}

.form-message.error {
    background: #ffecec;
    color: #b10d0d;
    border: 1px solid #f5bcbc;
}

.back-link {
    margin: 10px 0 0;
    align-self: flex-start;
}

@media (max-width: 720px) {
    .hero {
        padding: 44px 16px 24px;
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .hero-copy h1 {
        font-size: 2.1rem;
        line-height: 1.2;
    }

    .lead {
        font-size: 1rem;
    }

    .form-panels {
        padding: 0 12px 8px;
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 720px) {
    .site-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 16px;
        gap: 8px;
    }

    .site-page-title {
        position: static;
        transform: none;
        font-size: 1.5em;
    }

    .profile-page {
        width: 94%;
        margin: 20px auto 48px;
        gap: 18px;
    }

    .profile-hero {
        padding: 18px 18px;
    }

    .profile-card-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

body.dark-mode .profile-hero {
    background: linear-gradient(135deg, #1f2937 0%, #121212 100%);
    border-color: #2f3b4a;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

body.dark-mode .hero-text .eyebrow {
    color: #66ccff;
}

body.dark-mode .hero-text h2 {
    color: #e3e9f4;
}

body.dark-mode .hero-text .subhead {
    color: #c2c9d4;
}

body.dark-mode .profile-card {
    background: #1f1f1f;
    border-color: #3a3a3a;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}

body.dark-mode .card-header h3 {
    color: #e3e9f4;
}

body.dark-mode .card-header .helper-text {
    color: #c2c9d4;
}

body.dark-mode .form-message.success {
    background: #163626;
    color: #9be0b8;
    border-color: #235237;
}

body.dark-mode .form-message.error {
    background: #3a1f1f;
    color: #ffb8b8;
    border-color: #5a2d2d;
}

.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    padding: 12px 14px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    font-weight: 700;
    cursor: pointer;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.insight-list {
    margin-left: 18px;
    padding-left: 0;
    list-style-position: outside;
}

.insight-subtitle {
    margin: 16px 0 10px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary, #1f2937);
}

.insight-subtitle + .insight-list {
    margin-top: 4px;
}

.insight-list li {
    margin-bottom: 8px;
    line-height: 1.45;
}

.insight-label {
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    display: inline-block;
    min-width: 132px;
    margin-right: 6px;
}

body.dark-mode .insight-label {
    color: #d9e2ef;
}

@media (max-width: 640px) {
    .insight-label {
        display: inline;
        min-width: 0;
    }
}

body.dark-mode .back-to-top {
    background: linear-gradient(135deg, #1e74ff, #5aa8ff);
    color: #0c1a2c;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}
