@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@300;400;500;600;700&family=Noto+Sans:wght@300;400;500;700&display=swap');

:root {
    /* Base theme colors mapped to UI Pro Max design system */
    --primary-color: #0891B2;
    --primary-hover: #0e7490;
    --bg-main: #F0FDFA;
    --bg-glass: rgba(240, 253, 250, 0.9);
    --border-glass: rgba(8, 145, 178, 0.15);
    --text-primary: #134E4A;
    --text-secondary: #0891B2;
    --error-color: #DC2626;
    --warning-color: #f59e0b;
    --success-color: #16A34A;
    --card-bg: #ffffff;
    --gradient-start: #F0FDFA;
    --gradient-end: #CCFBF1;
    
    /* RGB values for generating transparency in rgba() */
    --primary-color-rgb: 8, 145, 178;
    --secondary-color-rgb: 34, 211, 238;

    /* Design System variables specifically mapped as in MASTER.md */
    --color-primary: #0891B2;
    --color-on-primary: #FFFFFF;
    --color-secondary: #22D3EE;
    --color-accent: #16A34A;
    --color-background: #F0FDFA;
    --color-foreground: #134E4A;
    --color-muted: #E8F1F6;
    --color-border: #CCFBF1;
    --color-destructive: #DC2626;
    --color-ring: #0891B2;

    /* Spacing variables from MASTER.md */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Shadow depths from MASTER.md */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, button, input, select, textarea {
    font-family: 'Noto Sans', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Figtree', sans-serif;
    font-weight: 700;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.glass-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-main);
    background-image:
        radial-gradient(at 20% 10%, #E0E7FF 0px, transparent 60%),
        radial-gradient(at 80% 20%, #EDE9FE 0px, transparent 60%),
        radial-gradient(at 10% 80%, #FAE8FF 0px, transparent 60%),
        radial-gradient(at 90% 90%, #F5F3FF 0px, transparent 60%),
        radial-gradient(at 50% 100%, #E0E7FF 0px, transparent 50%);
    z-index: -1;
    opacity: 0.9;
}

header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--primary-hover);
    letter-spacing: -0.5px;
}

.logo i {
    animation: pulse 3s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.nav-btn,
.icon-btn {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 0.6rem 1rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(255, 255, 255, 0.7);
}

.nav-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.container {
    max-width: 850px;
    margin: 0 auto;
    padding: 3rem 2rem;
    flex-grow: 1;
    width: 100%;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-hover), #818CF8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    font-weight: 400;
}

.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 1.5rem;
    padding: 3rem;
    box-shadow: 0 20px 50px rgba(var(--primary-color-rgb), 0.06), 0 5px 15px rgba(0, 0, 0, 0.02);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.8rem;
}

.form-sections-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
}

.form-section-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: visible;
    z-index: 1;
}

.form-section-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: rgba(var(--primary-color-rgb), 0.3);
}

.form-section-card:focus-within {
    z-index: 10;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 1.8rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 2px solid var(--border-glass);
    padding-bottom: 0.6rem;
}

.section-title i {
    color: var(--primary-color);
}

.section-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.8rem;
}

.vitals-note-wrapper {
    margin-top: 1.2rem;
}

.form-section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.form-section-header h2 {
    font-size: 2.2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-hover), #0891B2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.form-section-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    font-weight: 500;
}

.col-span-2 {
    grid-column: span 2;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.text-left {
    text-align: left;
}

.input-group label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-left: 2px;
}

input,
select,
textarea {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 1rem 1.2rem;
    color: var(--text-primary);
    font-size: 1.05rem;
    outline: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02) inset;
    width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 10px 20px rgba(var(--primary-color-rgb), 0.05), 0 0 0 4px rgba(var(--primary-color-rgb), 0.15);
    transform: translateY(-2px);
}

textarea {
    resize: vertical;
    min-height: 140px;
    line-height: 1.5;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #fff;
    border: none;
    border-radius: 0.85rem;
    padding: 1.1rem 1.8rem;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 2rem;
    box-shadow: 0 8px 16px -4px rgba(var(--primary-color-rgb), 0.4);
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 15px 25px -5px rgba(var(--primary-color-rgb), 0.5), 0 0 15px rgba(var(--primary-color-rgb), 0.2);
    filter: brightness(1.08);
}

.primary-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.96);
    box-shadow: 0 4px 8px -2px rgba(var(--primary-color-rgb), 0.3);
}

.primary-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: #cbd5e1;
    box-shadow: none;
    filter: none;
}

.secondary-btn {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 0.85rem;
    padding: 1.1rem 1.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.secondary-btn:hover:not(:disabled) {
    background: #e2e8f0;
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
}

.secondary-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.96);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.action-row {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    text-align: left;
    background: rgba(255, 255, 255, 0.6);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-glass);
}

.checkbox-group input {
    width: auto;
    margin-top: 4px;
    transform: scale(1.2);
    accent-color: var(--primary-color);
}

.checkbox-group label {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #334155;
    font-weight: 600;
}

/* Modal and Drawers */
.hidden {
    display: none !important;
}

.history-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    justify-content: flex-end;
}

.history-panel {
    border-radius: 0;
    border-left: 1px solid var(--primary-color);
    width: 100%;
    max-width: 400px;
    height: 100%;
    overflow-y: auto;
    animation: slideInRight 0.3s ease forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.history-item:hover {
    border-color: var(--primary-hover);
}

.history-item h4 {
    color: var(--primary-hover);
    margin-bottom: 0.3rem;
}

.history-item p {
    font-size: 0.85rem;
    color: #475569;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.onboarding-overlay {
    position: fixed;
    inset: 0;
    background: rgba(240, 253, 250, 0.85);
    backdrop-filter: blur(12px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.onboarding-card {
    width: 90%;
    max-width: 480px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 95vh;
    overflow-y: auto;
}

.onboarding-card h2 {
    font-size: 1.8rem;
    color: var(--primary-hover);
}

/* PRESCRIPTION PAD */
.results-container {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.prescription-pad {
    background: #ffffff;
    border-radius: 12px;
    padding: 3rem 4rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08), 0 5px 15px rgba(0, 0, 0, 0.03);
    color: #0f172a;
    font-family: 'Helvetica Neue', 'Outfit', Helvetica, Arial, sans-serif;
    position: relative;
    max-width: 100%;
    overflow: hidden;
}

.prescription-pad::before {
    content: "Sirona AI";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-size: 7rem;
    font-weight: 900;
    color: rgba(var(--primary-color-rgb), 0.03);
    pointer-events: none;
    z-index: 0;
}

.prescription-pad * {
    position: relative;
    z-index: 1;
}

.prescription-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 1.5rem;
    margin-bottom: 2.5rem;
}

.clinic-info h2 {
    color: var(--primary-hover);
    font-size: 2.4rem;
    font-weight: 900;
    margin-bottom: 0.2rem;
    letter-spacing: -1px;
}

.patient-info {
    text-align: right;
    font-size: 0.95rem;
    background: #f8fafc;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.rx-symbol {
    font-size: 4rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-family: 'Times New Roman', serif;
}

.prescription-section {
    margin-bottom: 2.5rem;
}

.prescription-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.25rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 6px;
    display: table;
}

.prescription-section p {
    font-size: 1.1rem;
    line-height: 1.7;
}

.clean-list {
    list-style-type: none;
    padding-left: 0;
}

.clean-list li {
    font-size: 1.1rem;
    line-height: 1.7;
    position: relative;
    padding-left: 1.8rem;
    margin-bottom: 0.8rem;
}

.clean-list li::before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.5rem;
    position: absolute;
    left: 0;
    top: -2px;
}

.alert-section {
    background: #fef2f2;
    padding: 1.5rem 2rem;
    border-left: 6px solid #ef4444;
    border-radius: 8px;
}

.alert-section h4 {
    color: #b91c1c;
    border-bottom: none;
}

.doc-signature {
    text-align: right;
    margin-top: 5rem;
}

.doc-signature .sign-line {
    width: 250px;
    border-bottom: 1.5px solid #0f172a;
    display: inline-block;
    margin-bottom: 0.8rem;
}

.doc-signature p {
    color: var(--primary-hover);
    font-weight: 700;
}

.prescription-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
}

.fallback-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--warning-color);
    color: #fff;
    padding: 1.2rem 2.5rem;
    border-radius: 50px;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.4);
    z-index: 1000;
    animation: toastPop 0.5s ease forwards;
}

@keyframes toastPop {
    from {
        opacity: 0;
        transform: translate(-50%, 20px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===================================== */
/* THEME PICKER (Onboarding)             */
/* ===================================== */
.theme-picker {
    display: flex;
    gap: 0.6rem;
    width: 100%;
}

.theme-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.9rem 0.6rem;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 0.85rem;
    font-family: inherit;
}

.theme-option i {
    font-size: 1.4rem;
    transition: transform 0.3s ease;
}

.theme-option:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.05);
    transform: translateY(-2px);
}

.theme-option:hover i {
    transform: scale(1.15);
}

.theme-option.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.1), rgba(var(--primary-color-rgb), 0.05));
    color: var(--primary-hover);
    box-shadow: 0 4px 15px rgba(var(--primary-color-rgb), 0.2);
}

[data-theme="dark"] .theme-option {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

[data-theme="dark"] .theme-option:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.08);
}

[data-theme="dark"] .theme-option.active {
    border-color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.12);
    color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(var(--primary-color-rgb), 0.15);
}

/* ===================================== */
/* CSS POLISH & MICRO-ANIMATIONS         */
/* ===================================== */
.glass-panel {
    transition: box-shadow 0.3s ease;
}

.glass-panel:hover {
    box-shadow: 0 25px 60px rgba(var(--primary-color-rgb), 0.08), 0 8px 20px rgba(0, 0, 0, 0.03);
}

.input-group label {
    transition: color 0.2s ease;
    letter-spacing: 0.3px;
}

.secondary-btn {
    transition: all 0.25s ease;
}

.secondary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.onboarding-card .logo {
    font-size: 2rem;
    margin-bottom: 0.3rem;
}

.onboarding-card .logo i {
    font-size: 2.2rem;
}

.onboarding-card h2 {
    background: linear-gradient(135deg, var(--primary-hover), #818CF8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.onboarding-card p {
    color: var(--text-secondary);
    line-height: 1.5;
}

.submit-btn {
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-25deg);
    pointer-events: none;
    z-index: 1;
}

.submit-btn:hover::before {
    animation: btn-shine 1.2s infinite;
}

@keyframes btn-shine {
    0% {
        left: -150%;
    }
    50% {
        left: 150%;
    }
    100% {
        left: 150%;
    }
}

.submit-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: 2;
}

.submit-btn:active::after {
    width: 300px;
    height: 300px;
}

.submit-btn:hover:not(:disabled) {
    box-shadow: 0 0 25px rgba(var(--primary-color-rgb), 0.55), 0 12px 20px -5px rgba(var(--primary-color-rgb), 0.45);
}

/* ===================================== */
/* DARK MODE                             */
/* ===================================== */
[data-theme="dark"] {
    --primary-color: #22D3EE;
    --primary-hover: #06B6D4;
    --bg-main: #041011;
    --bg-glass: rgba(6, 20, 22, 0.95);
    --border-glass: rgba(34, 211, 238, 0.15);
    --text-primary: #F0FDFA;
    --text-secondary: #99F6E4;
    --card-bg: #092123;
    --gradient-start: #06191B;
    --gradient-end: #041011;
    
    /* RGB values for generating transparency in dark mode */
    --primary-color-rgb: 34, 211, 238;
    --secondary-color-rgb: 6, 182, 212;

    /* Design system overrides for Dark Mode */
    --color-primary: #22D3EE;
    --color-secondary: #06B6D4;
    --color-background: #041011;
    --color-foreground: #F0FDFA;
    --color-muted: #0d2f32;
    --color-border: #0d2f32;
    --color-ring: #22D3EE;
}

[data-theme="dark"] .greeting-orb {
    mix-blend-mode: screen;
    opacity: 0.25;
}

[data-theme="dark"] .pain-label.mild {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.45);
}

[data-theme="dark"] .pain-label.moderate {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.45);
}

[data-theme="dark"] .pain-label.severe {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.45);
}

[data-theme="dark"] header {
    background: rgba(15, 23, 42, 0.9);
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .nav-btn,
[data-theme="dark"] .icon-btn {
    background: rgba(30, 41, 59, 0.8);
    border-color: var(--border-glass);
    color: var(--text-primary);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(var(--primary-color-rgb), 0.1), 0 2px 4px rgba(0, 0, 0, 0.1) inset;
}

[data-theme="dark"] .glass-background {
    background-color: var(--bg-main);
    background-image:
        radial-gradient(at 20% 10%, #1e1b4b 0px, transparent 60%),
        radial-gradient(at 80% 20%, #0b1329 0px, transparent 60%),
        radial-gradient(at 10% 80%, #1e1035 0px, transparent 60%),
        radial-gradient(at 90% 90%, #022c22 0px, transparent 60%);
}

[data-theme="dark"] .prescription-pad {
    background: #1e293b;
    color: #e2e8f0;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .prescription-pad::before {
    color: rgba(var(--primary-color-rgb), 0.04);
}

[data-theme="dark"] .patient-info {
    background: #0f172a;
    border-color: #334155;
}

[data-theme="dark"] .prescription-section h4 {
    border-bottom-color: #334155;
}

[data-theme="dark"] .doc-signature .sign-line {
    border-bottom-color: #94a3b8;
}

[data-theme="dark"] .prescription-footer {
    border-top-color: #334155;
}

[data-theme="dark"] .history-item {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .history-item p {
    color: #94a3b8;
}

[data-theme="dark"] .history-header {
    border-bottom-color: #334155;
}

[data-theme="dark"] .secondary-btn {
    background: #334155;
    color: #e2e8f0;
    border-color: #475569;
}

[data-theme="dark"] .checkbox-group {
    background: rgba(30, 41, 59, 0.6);
}

[data-theme="dark"] .checkbox-group label {
    color: #cbd5e1;
}

[data-theme="dark"] .guide-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .guide-card h4 {
    color: #e2e8f0;
}

[data-theme="dark"] .guide-card p {
    color: #94a3b8;
}

[data-theme="dark"] .onboarding-overlay {
    background: rgba(15, 23, 42, 0.92);
}

[data-theme="dark"] .alert-section {
    background: #2a1215;
}

body {
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Theme toggle icon animation */
#theme-toggle-btn i {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#theme-toggle-btn:hover i {
    transform: rotate(30deg);
}

/* ===================================== */
/* VOICE INPUT BUTTON                    */
/* ===================================== */
.textarea-wrapper {
    position: relative;
    width: 100%;
}

.textarea-wrapper textarea {
    padding-right: 3.5rem;
}

.voice-btn {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-glass);
    background: var(--bg-glass);
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
}

.voice-btn:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.voice-btn.recording {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
    animation: voicePulse 1.2s infinite ease-in-out;
}

@keyframes voicePulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
    }

    50% {
        box-shadow: 0 0 0 12px rgba(239, 68, 68, 0);
    }
}

/* ===================================== */
/* PAIN SCALE SLIDER                     */
/* ===================================== */
.pain-scale-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pain-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(90deg, #10b981 0%, #f59e0b 50%, #ef4444 100%) no-repeat;
    background-size: 22% 100%;
    background-color: var(--border-glass);
    outline: none;
    border: none;
    padding: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) inset;
    cursor: pointer;
}

.pain-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid var(--primary-color);
    cursor: grab;
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.25), 0 0 10px rgba(var(--primary-color-rgb), 0.2);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease, border-color 0.2s ease;
}

.pain-slider::-webkit-slider-thumb:hover {
    transform: scale(1.18);
    box-shadow: 0 6px 18px rgba(var(--primary-color-rgb), 0.4), 0 0 15px rgba(var(--primary-color-rgb), 0.3);
}

.pain-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.3);
    box-shadow: 0 6px 20px rgba(var(--primary-color-rgb), 0.5), 0 0 20px rgba(var(--primary-color-rgb), 0.4);
    animation: thumbPulse 1s infinite alternate ease-in-out;
}

.pain-slider::-moz-range-thumb {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid var(--primary-color);
    cursor: grab;
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.25), 0 0 10px rgba(var(--primary-color-rgb), 0.2);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease, border-color 0.2s ease;
}

.pain-slider::-moz-range-thumb:active {
    cursor: grabbing;
    transform: scale(1.3);
    box-shadow: 0 6px 20px rgba(var(--primary-color-rgb), 0.5), 0 0 20px rgba(var(--primary-color-rgb), 0.4);
    animation: thumbPulse 1s infinite alternate ease-in-out;
}

@keyframes thumbPulse {
    0% {
        box-shadow: 0 6px 20px rgba(var(--primary-color-rgb), 0.3), 0 0 10px rgba(var(--primary-color-rgb), 0.15);
    }
    100% {
        box-shadow: 0 6px 25px rgba(var(--primary-color-rgb), 0.6), 0 0 20px rgba(var(--primary-color-rgb), 0.45);
    }
}

.pain-scale-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 2px;
}

.pain-scale-labels span {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    width: 20px;
    text-align: center;
}

.pain-label {
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
}

.pain-label.mild {
    background: rgba(16, 185, 129, 0.12);
    color: #16A34A;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.pain-label.moderate {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.pain-label.severe {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ===================================== */
/* TOAST NOTIFICATIONS                   */
/* ===================================== */
.copy-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success-color);
    color: #fff;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
    z-index: 1000;
    animation: toastPop 0.5s ease forwards;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===================================== */
/* SHARE BUTTONS                         */
/* ===================================== */
.share-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.4rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    border: 1.5px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.share-btn:hover {
    background: rgba(var(--primary-color-rgb), 0.08);
    color: var(--primary-hover);
    border-color: rgba(var(--primary-color-rgb), 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.08);
}

.share-btn i {
    font-size: 1.1rem;
}

.share-btn.whatsapp-btn {
    background: rgba(22, 163, 74, 0.08);
    color: #16A34A;
    border: 1.5px solid rgba(22, 163, 74, 0.2);
}

.share-btn.whatsapp-btn:hover {
    background: #16A34A;
    color: #ffffff;
    border-color: #16A34A;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
}

[data-theme="dark"] .share-btn {
    background: rgba(6, 20, 22, 0.6);
    border-color: var(--border-glass);
    color: var(--text-primary);
}

[data-theme="dark"] .share-btn:hover {
    background: rgba(34, 211, 238, 0.1);
    color: var(--primary-color);
    border-color: rgba(34, 211, 238, 0.4);
}

[data-theme="dark"] .share-btn.whatsapp-btn {
    background: rgba(22, 163, 74, 0.12);
    color: #4ade80;
    border-color: rgba(22, 163, 74, 0.25);
}

[data-theme="dark"] .share-btn.whatsapp-btn:hover {
    background: #16A34A;
    color: #ffffff;
    border-color: #16A34A;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.4);
}

/* ------------------------------------- */
/* EXTREME MOBILE OPTIMIZATION ENGINE    */
/* ------------------------------------- */
@media (max-width: 768px) {
    .header-inner {
        padding: 1rem 5%;
    }

    .logo span {
        display: none;
    }

    /* Hide text logo on mobile, keep icon */
    .nav-btn span {
        display: none;
    }

    /* Hide text on button, keep icon */

    .container {
        padding: 1.5rem 1rem;
    }

    .hero {
        margin-bottom: 1.5rem;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .glass-panel {
        padding: 1.5rem 1.2rem;
        border-radius: 1rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .section-grid-2 {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .form-section-card {
        padding: 1.5rem 1.2rem;
        border-radius: 1rem;
    }

    .col-span-2 {
        grid-column: span 1;
    }

    input,
    select,
    textarea {
        font-size: 1rem;
        padding: 0.9rem 1rem;
    }

    .prescription-pad {
        padding: 1.8rem 1.2rem;
        border-radius: 8px;
    }

    .prescription-pad::before {
        font-size: 3rem;
        white-space: normal;
        text-align: center;
    }

    .prescription-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .clinic-info h2 {
        font-size: 1.6rem;
    }

    .patient-info {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0.2rem;
        padding: 0.8rem;
    }

    .rx-symbol {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }

    .prescription-section h4 {
        font-size: 1.1rem;
    }

    .clean-list li {
        font-size: 0.95rem;
    }

    .prescription-section p {
        font-size: 0.95rem;
    }

    .doc-signature {
        text-align: left;
        margin-top: 3rem;
    }

    .doc-signature .sign-line {
        width: 150px;
    }

    .action-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .primary-btn {
        margin-top: 1rem;
    }
}

@media print {
    body * {
        visibility: hidden !important;
    }

    #prescription-pad,
    #prescription-pad * {
        visibility: visible !important;
    }

    #prescription-pad {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        box-shadow: none;
        border-radius: 0;
    }
}




.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Hide standard header nav buttons because we use the hamburger menu drawer */
.nav-actions .nav-btn {
    display: none !important;
}

/* ===================================== */
/* SOS GUIDE — ENHANCED GRID & CARDS     */
/* ===================================== */
.emergency-panel {
    max-width: 700px;
    border-left: 5px solid #ef4444;
    width: 100%;
    border-radius: 0;
    padding-top: 1.5rem;
}

@media (min-width: 768px) {
    .emergency-panel {
        border-radius: 12px 0 0 12px;
    }
}

.emergency-btn {
    border-color: #fca5a5;
    color: #ef4444;
}

.emergency-btn:hover {
    background: #ef4444 !important;
    color: white !important;
    border-color: #ef4444 !important;
}

.emergency-btn i {
    animation: pulse 1.5s infinite;
}

.emergency-content {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding-bottom: 2rem;
}

.emergency-disclaimer {
    background: #fef2f2;
    padding: 1rem;
    border-radius: 8px;
    color: #b91c1c;
    font-size: 0.95rem;
    border: 1px solid #fecaca;
    line-height: 1.5;
}

/* Quick Call Emergency Button */
.sos-quick-call {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.1rem;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
    transition: all 0.3s ease;
    animation: sosGlow 2s infinite ease-in-out;
}

.sos-quick-call:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 28px rgba(239, 68, 68, 0.5);
}

@keyframes sosGlow {

    0%,
    100% {
        box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
    }

    50% {
        box-shadow: 0 8px 30px rgba(239, 68, 68, 0.55), 0 0 15px rgba(239, 68, 68, 0.2);
    }
}

.sos-quick-call i {
    font-size: 1.3rem;
    animation: phoneRing 1.5s infinite;
}

@keyframes phoneRing {

    0%,
    100% {
        transform: rotate(0);
    }

    20% {
        transform: rotate(15deg);
    }

    40% {
        transform: rotate(-10deg);
    }

    60% {
        transform: rotate(10deg);
    }

    80% {
        transform: rotate(-5deg);
    }
}

/* Search Bar */
.sos-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.sos-search-wrapper i {
    position: absolute;
    left: 14px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    pointer-events: none;
}

.sos-search-wrapper input {
    padding-left: 2.8rem;
    border-radius: 50px;
    border: 2px solid #fecaca;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.sos-search-wrapper input:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* SOS Guide Grid */
.sos-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 500px) {
    .sos-grid {
        grid-template-columns: 1fr;
    }
}

/* Guide Card Mini */
.guide-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    border-radius: 14px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.guide-card-link:hover {
    transform: translateY(-4px) scale(1.02);
}

.guide-card-link:hover .guide-card-mini {
    border-color: var(--primary-color);
    box-shadow: 0 12px 30px rgba(var(--primary-color-rgb), 0.15), 0 0 0 2px rgba(var(--primary-color-rgb), 0.1);
}

.guide-card-mini {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.35s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.guide-card-mini::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.guide-card-link:hover .guide-card-mini::after {
    opacity: 1;
}

.guide-card-mini img {
    width: 100%;
    height: 100px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 0.6rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.3rem;
}

.guide-card-mini h4 {
    color: #0f172a;
    font-size: 1rem;
    margin-bottom: 0.2rem;
    font-weight: 700;
}

.guide-card-mini p {
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.3;
}

/* Severity Badges */
.severity-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    z-index: 2;
}

.severity-badge.critical {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.severity-badge.moderate {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.severity-badge.low {
    background: rgba(16, 185, 129, 0.12);
    color: #7C3AED;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.sos-no-results {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding: 1.5rem;
    font-weight: 600;
}

/* ===================================== */
/* DARK MODE — SOS GUIDE                 */
/* ===================================== */
[data-theme="dark"] .guide-card-mini {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .guide-card-mini h4 {
    color: #e2e8f0;
}

[data-theme="dark"] .guide-card-mini p {
    color: #94a3b8;
}

[data-theme="dark"] .guide-card-mini img {
    background: #0f172a;
    border-color: #334155;
}

[data-theme="dark"] .guide-card-link:hover .guide-card-mini {
    border-color: var(--primary-color);
    box-shadow: 0 12px 30px rgba(var(--primary-color-rgb), 0.1);
}

[data-theme="dark"] .sos-search-wrapper input {
    background: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .sos-search-wrapper input:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.08);
}

[data-theme="dark"] .emergency-disclaimer {
    background: #2a1215;
    border-color: #7f1d1d;
}

/* ===================================== */
/* SOS DETAIL PAGE STYLES                */
/* ===================================== */
.sos-detail-page {
    animation: detailFadeIn 0.5s ease-out;
}

@keyframes detailFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sos-detail-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 5%;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

[data-theme="dark"] .sos-detail-header {
    background: rgba(15, 23, 42, 0.9);
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.sos-back-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.7);
    font-family: 'Outfit', sans-serif;
}

.sos-back-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

[data-theme="dark"] .sos-back-btn {
    background: rgba(30, 41, 59, 0.8);
    border-color: var(--border-glass);
    color: var(--text-primary);
}

.sos-detail-hero {
    text-align: center;
    padding: 3rem 2rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.sos-detail-hero img {
    width: 100%;
    max-width: 420px;
    max-height: 300px;
    object-fit: contain;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-glass);
    padding: 1rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.06);
}

.sos-detail-hero h1 {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.sos-detail-hero .subtitle {
    color: var(--text-secondary);
    font-size: 1.15rem;
}

.sos-detail-body {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

.sos-section {
    margin-bottom: 2.5rem;
}

.sos-section h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sos-section h2 i {
    color: var(--primary-color);
    font-size: 1.4rem;
}

/* Numbered Steps */
.sos-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sos-step {
    display: flex;
    gap: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.sos-step:hover {
    border-color: var(--primary-color);
    transform: translateX(4px);
    box-shadow: 0 8px 20px rgba(var(--primary-color-rgb), 0.08);
}

[data-theme="dark"] .sos-step {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .sos-step:hover {
    border-color: var(--primary-color);
}

.step-num {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
}

.step-content h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.step-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Do's and Don'ts */
.dos-donts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .dos-donts-grid {
        grid-template-columns: 1fr;
    }
}

.dos-col,
.donts-col {
    border-radius: 12px;
    padding: 1.5rem;
}

.dos-col {
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.donts-col {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.dos-col h3 {
    color: #7C3AED;
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.donts-col h3 {
    color: #dc2626;
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dos-col ul,
.donts-col ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dos-col li,
.donts-col li {
    font-size: 0.95rem;
    line-height: 1.5;
    padding-left: 1.4rem;
    position: relative;
    color: var(--text-primary);
}

.dos-col li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #7C3AED;
    font-weight: 800;
}

.donts-col li::before {
    content: "✗";
    position: absolute;
    left: 0;
    color: #dc2626;
    font-weight: 800;
}

[data-theme="dark"] .dos-col {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.15);
}

[data-theme="dark"] .donts-col {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.15);
}

/* Emergency Callout */
.sos-callout {
    background: linear-gradient(135deg, #fef2f2, #fff1f2);
    border: 2px solid #fecaca;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.sos-callout i {
    font-size: 2rem;
    color: #ef4444;
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.sos-callout h4 {
    color: #b91c1c;
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.sos-callout p {
    color: #7f1d1d;
    font-size: 0.95rem;
    line-height: 1.5;
}

[data-theme="dark"] .sos-callout {
    background: linear-gradient(135deg, #2a1215, #1f1315);
    border-color: #7f1d1d;
}

[data-theme="dark"] .sos-callout h4 {
    color: #fca5a5;
}

[data-theme="dark"] .sos-callout p {
    color: #fecaca;
}

/* Aftercare Tips */
.aftercare-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.aftercare-item {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.8rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.5;
    transition: all 0.2s ease;
}

.aftercare-item:hover {
    border-color: var(--primary-color);
    transform: translateX(3px);
}

.aftercare-item i {
    color: var(--primary-color);
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

[data-theme="dark"] .aftercare-item {
    background: #1e293b;
    border-color: #334155;
}

/* Page Transition Overlay with Spinner */
.page-transition-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-main);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
}

.page-transition-overlay::after {
    content: '';
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-glass);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: pageTransitionSpin 0.7s linear infinite;
    opacity: 0;
    transition: opacity 0.2s ease 0.1s;
}

.page-transition-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.page-transition-overlay.active::after {
    opacity: 1;
}

@keyframes pageTransitionSpin {
    to { transform: rotate(360deg); }
}

/* Detail Page Responsive */
@media (max-width: 768px) {
    .sos-detail-hero {
        padding: 2rem 1rem 1rem;
    }

    .sos-detail-hero h1 {
        font-size: 1.8rem;
    }

    .sos-detail-body {
        padding: 0 1rem 3rem;
    }

    .sos-step {
        padding: 1rem;
    }
}

/* ===================================== */
/* LEGAL LINKS (Onboarding)              */
/* ===================================== */
.legal-link {
    color: var(--primary-hover);
    text-decoration: underline;
    font-weight: 700;
    transition: color 0.2s ease;
}

.legal-link:hover {
    color: var(--primary-color);
}

[data-theme="dark"] .legal-link {
    color: var(--primary-color);
}

/* ===================================== */
/* SITE FOOTER                           */
/* ===================================== */
.site-footer {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 2.5rem 2rem;
    margin-top: 2rem;
    text-align: center;
}

.footer-inner {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-hover);
}

.footer-brand i {
    font-size: 1.4rem;
}

.footer-disclaimer {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 500px;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--primary-hover);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s ease;
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    border: 1px solid transparent;
}

.footer-links a:hover {
    background: rgba(var(--primary-color-rgb), 0.08);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.footer-divider {
    color: #cbd5e1;
    font-weight: 300;
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Dark mode footer */
[data-theme="dark"] .site-footer {
    background: rgba(15, 23, 42, 0.7);
    border-top-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .footer-divider {
    color: #475569;
}

[data-theme="dark"] .footer-links a:hover {
    background: rgba(var(--primary-color-rgb), 0.08);
}

/* ===================================== */
/* CONDITIONS CHIPS & RED FLAGS          */
/* ===================================== */
.conditions-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.condition-chip {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.condition-chip.primary {
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.12), rgba(45, 212, 191, 0.15));
    color: var(--primary-hover);
    border-color: var(--primary-color);
    font-weight: 700;
}

[data-theme="dark"] .condition-chip {
    background: #1e293b;
    color: #94a3b8;
    border-color: #334155;
}

[data-theme="dark"] .condition-chip.primary {
    background: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

[data-theme="dark"] .alert-section {
    background: rgba(254, 242, 242, 0.05) !important;
}

/* ===================================== */
/* HEADER USER PROFILE                   */
/* ===================================== */
.user-profile-display {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    border-radius: 50px;
    background: rgba(var(--primary-color-rgb), 0.08);
    border: 1px solid rgba(var(--primary-color-rgb), 0.2);
}

.user-profile-display.hidden {
    display: none;
}

.header-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.header-avatar-icon {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.header-user-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .header-user-name {
        display: none;
    }

    .user-profile-display {
        padding: 0.2rem;
        border-radius: 50%;
    }
}

/* ===================================== */
/* PROFILE PAGE                          */
/* ===================================== */
.profile-page-body {
    min-height: 100vh;
}

.profile-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex-grow: 1;
}

/* — Profile Hero — */
.profile-hero {
    text-align: center;
    padding: 3rem 2rem 2.5rem;
    position: relative;
    overflow: hidden;
    animation: profileFadeIn 0.6s ease backwards;
}

.profile-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.12), rgba(45, 212, 191, 0.06));
    border-radius: 1.5rem 1.5rem 0 0;
    z-index: 0;
}

@keyframes profileFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-avatar-ring {
    position: relative;
    width: 110px;
    height: 110px;
    margin: 0 auto 1.2rem;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, var(--primary-color), #4F46E5, #f43f5e, var(--primary-color));
    background-size: 300% 300%;
    animation: avatarRingGlow 4s ease infinite;
    z-index: 1;
}

@keyframes avatarRingGlow {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--card-bg, #fff);
    display: block;
}

.profile-avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--card-bg, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--card-bg, #fff);
}

.profile-avatar-fallback i {
    font-size: 3rem;
    color: var(--primary-color);
}

.avatar-status-dot {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    background: #10b981;
    border: 3px solid var(--card-bg, #fff);
    border-radius: 50%;
    z-index: 2;
}

.profile-name {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-hover), #818CF8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    z-index: 1;
    position: relative;
    margin-bottom: 0.3rem;
}

.profile-email {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.2rem;
    z-index: 1;
    position: relative;
}

.profile-badges {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    z-index: 1;
    position: relative;
}

.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.9rem;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 700;
    background: rgba(var(--primary-color-rgb), 0.08);
    color: var(--primary-hover);
    border: 1px solid rgba(var(--primary-color-rgb), 0.2);
}

.profile-badge i {
    font-size: 0.9rem;
}

.member-badge {
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.1), rgba(var(--secondary-color-rgb), 0.08));
    color: #4F46E5;
    border-color: rgba(var(--primary-color-rgb), 0.25);
}

/* — Stats Grid — */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.stat-card {
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: 1.2rem;
    animation: statFadeIn 0.5s ease backwards;
    animation-delay: var(--delay, 0s);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(var(--primary-color-rgb), 0.12), 0 5px 15px rgba(0, 0, 0, 0.04);
}

@keyframes statFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.stat-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.8rem;
    font-size: 1.4rem;
}

.stat-icon-consultations {
    background: rgba(var(--primary-color-rgb), 0.12);
    color: var(--primary-hover);
}

.stat-icon-streak {
    background: rgba(var(--primary-color-rgb), 0.12);
    color: #4F46E5;
}

.stat-icon-severity {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.stat-icon-theme {
    background: rgba(var(--secondary-color-rgb), 0.12);
    color: #8b5cf6;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
    letter-spacing: -0.5px;
}

.stat-value.severity-mild {
    color: #10b981;
}

.stat-value.severity-moderate {
    color: #f59e0b;
}

.stat-value.severity-severe {
    color: #ef4444;
}

.stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* — Profile Section (Activity / Settings) — */
.profile-section {
    padding: 2rem;
    border-radius: 1.2rem;
    animation: profileFadeIn 0.5s ease backwards;
}

.profile-section-header {
    margin-bottom: 1.5rem;
}

.profile-section-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-section-header h2 i {
    color: var(--primary-color);
    font-size: 1.3rem;
}

/* — Recent Activity — */
.recent-activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.activity-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
}

.activity-empty i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 0.8rem;
    display: block;
}

.activity-empty p {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.activity-item {
    background: var(--card-bg);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    transition: all 0.3s ease;
    animation: statFadeIn 0.4s ease backwards;
    animation-delay: var(--delay, 0s);
}

.activity-item:hover {
    border-color: var(--primary-color);
    transform: translateX(4px);
    box-shadow: 0 8px 20px rgba(var(--primary-color-rgb), 0.08);
}

.activity-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

.activity-date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.activity-date i {
    color: var(--primary-color);
    font-size: 1rem;
}

.activity-time {
    opacity: 0.6;
    font-weight: 500;
}

.activity-severity {
    padding: 0.2rem 0.7rem;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.activity-severity.mild {
    background: rgba(16, 185, 129, 0.12);
    color: #7C3AED;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.activity-severity.moderate {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.activity-severity.severe {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.activity-symptoms {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 0.4rem;
}

.activity-symptoms strong {
    color: var(--primary-hover);
}

.activity-assessment {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    border-top: 1px solid var(--border-glass);
    padding-top: 0.5rem;
    margin-top: 0.3rem;
}

/* — Settings List — */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.2rem;
    border-radius: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-glass);
    transition: all 0.2s ease;
}

.settings-item:hover {
    border-color: var(--primary-color);
    transform: translateX(3px);
}

.settings-item-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.settings-item-left>i {
    font-size: 1.3rem;
    color: var(--primary-color);
    width: 24px;
    text-align: center;
}

.settings-item-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.settings-item-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 0.1rem;
}

.settings-arrow {
    font-size: 1.2rem;
    color: var(--text-secondary);
    opacity: 0.5;
}

.settings-arrow-link {
    text-decoration: none;
    color: inherit;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    border-radius: 28px;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    left: 3px;
    bottom: 3px;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--primary-color);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(22px);
}

/* — Account Actions — */
.profile-actions-section {
    text-align: center;
    padding: 2rem;
}

.sign-out-btn {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem 2rem;
    border-radius: 12px;
    border: 2px solid #fca5a5;
    background: rgba(239, 68, 68, 0.06);
    color: #ef4444;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sign-out-btn:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

.sign-out-btn:active {
    transform: translateY(0);
}

.sign-out-note {
    margin-top: 0.8rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* — Dark Mode — Profile — */
[data-theme="dark"] .profile-hero::before {
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.08), rgba(var(--primary-color-rgb), 0.05));
}

[data-theme="dark"] .profile-badge {
    background: rgba(var(--primary-color-rgb), 0.08);
    border-color: rgba(var(--primary-color-rgb), 0.15);
}

[data-theme="dark"] .member-badge {
    background: rgba(var(--primary-color-rgb), 0.1);
    border-color: rgba(var(--primary-color-rgb), 0.2);
}

[data-theme="dark"] .stat-card {
    background: var(--bg-glass);
}

[data-theme="dark"] .activity-item {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .activity-item:hover {
    border-color: var(--primary-color);
}

[data-theme="dark"] .activity-assessment {
    border-top-color: #334155;
}

[data-theme="dark"] .settings-item {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .settings-item:hover {
    border-color: var(--primary-color);
}

[data-theme="dark"] .toggle-slider {
    background: #475569;
}

[data-theme="dark"] .sign-out-btn {
    background: rgba(239, 68, 68, 0.08);
    border-color: #7f1d1d;
}

[data-theme="dark"] .sign-out-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

[data-theme="dark"] .avatar-status-dot {
    border-color: var(--bg-glass);
}

[data-theme="dark"] .profile-avatar-fallback {
    background: #1e293b;
    border-color: #1e293b;
}

[data-theme="dark"] .profile-avatar {
    border-color: #1e293b;
}

/* — Mobile Responsive — Profile — */
@media (max-width: 768px) {
    .profile-container {
        padding: 1.2rem 1rem 2rem;
    }

    .profile-hero {
        padding: 2rem 1.5rem 2rem;
    }

    .profile-name {
        font-size: 1.6rem;
    }

    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .stat-icon-wrap {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .stat-card {
        padding: 1.2rem 0.8rem;
    }

    .profile-section {
        padding: 1.5rem 1.2rem;
    }
}

@media (max-width: 420px) {
    .profile-badges {
        flex-direction: column;
        align-items: center;
    }

    .profile-avatar-ring {
        width: 90px;
        height: 90px;
    }

    .profile-name {
        font-size: 1.4rem;
    }
}

/* — Clickable profile display in header — */
.user-profile-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.user-profile-link:hover {
    opacity: 0.85;
}

.user-profile-link .user-profile-display {
    cursor: pointer;
}

/* ===================================== */
/* SYMPTOM TRACKER PAGE                  */
/* ===================================== */
.tracker-page-body {
    min-height: 100vh;
}

.tracker-container {
    max-width: 780px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex-grow: 1;
}

.tracker-hero {
    text-align: center;
    margin-bottom: 0.5rem;
    animation: profileFadeIn 0.5s ease backwards;
}

.tracker-hero h1 {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--primary-hover), #818CF8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.tracker-hero h1 i {
    -webkit-text-fill-color: var(--primary-color);
    font-size: 2.2rem;
}

.tracker-hero p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* — Severity Alert Banner — */
.severity-alert-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 0;
    animation: alertSlideDown 0.5s ease;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

.severity-alert-banner.hidden {
    display: none;
}

@keyframes alertSlideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert-banner-inner {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
}

.alert-banner-inner>i {
    font-size: 1.6rem;
    flex-shrink: 0;
    animation: pulse 1.5s infinite;
}

.alert-banner-inner strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.1rem;
}

.alert-banner-inner span {
    font-size: 0.85rem;
    opacity: 0.9;
}

.alert-dismiss-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: auto;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.alert-dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* — Check-in Card — */
.tracker-checkin {
    animation: profileFadeIn 0.5s ease backwards;
}

.checkin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.checkin-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkin-header h2 i {
    color: var(--primary-color);
}

.checkin-date {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: rgba(var(--primary-color-rgb), 0.08);
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    border: 1px solid rgba(var(--primary-color-rgb), 0.15);
}

.already-logged-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #7C3AED;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.already-logged-banner.hidden {
    display: none;
}

.already-logged-banner i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.checkin-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.checkin-field label {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
}

.optional-tag {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.checkin-pain-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* — Symptom Chips — */
.symptom-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.symptom-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
}

.symptom-chip i {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.symptom-chip:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.04);
    transform: translateY(-1px);
}

.symptom-chip:hover i {
    transform: scale(1.15);
}

.symptom-chip.active {
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.12), rgba(45, 212, 191, 0.08));
    border-color: var(--primary-color);
    color: var(--primary-hover);
    box-shadow: 0 2px 10px rgba(var(--primary-color-rgb), 0.15);
}

/* — Mood Selector — */
.mood-selector {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.mood-btn {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    font-size: 1.6rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mood-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
}

.mood-btn.active {
    border-color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.08);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(var(--primary-color-rgb), 0.2);
}

/* — Chart Section — */
.tracker-chart-section {
    animation: statFadeIn 0.5s ease backwards;
    animation-delay: 0.1s;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.chart-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-header h2 i {
    color: var(--primary-color);
}

.chart-range-toggle {
    display: flex;
    gap: 0.3rem;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 10px;
    padding: 0.2rem;
}

.range-btn {
    padding: 0.45rem 1rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.82rem;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
}

.range-btn.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 2px 8px rgba(var(--primary-color-rgb), 0.3);
}

.range-btn:hover:not(.active) {
    color: var(--primary-color);
}

.chart-wrapper {
    position: relative;
    height: 280px;
    width: 100%;
}

.chart-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-secondary);
}

.chart-empty i {
    font-size: 3rem;
    opacity: 0.25;
    display: block;
    margin-bottom: 0.8rem;
}

.chart-empty p {
    font-size: 0.95rem;
}

/* — AI Trend Section — */
.tracker-trend-section {
    animation: statFadeIn 0.5s ease backwards;
    animation-delay: 0.2s;
    border: 1px solid rgba(var(--primary-color-rgb), 0.15);
}

.tracker-trend-section.hidden {
    display: none;
}

.trend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}

.trend-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trend-header h2 i {
    color: #8b5cf6;
}

.trend-badge {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    background: linear-gradient(135deg, rgba(var(--secondary-color-rgb), 0.1), rgba(var(--primary-color-rgb), 0.08));
    color: #7c3aed;
    border: 1px solid rgba(var(--secondary-color-rgb), 0.2);
}

.trend-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 2rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.trend-loading.hidden {
    display: none;
}

.trend-alert-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--alert-color);
    background: color-mix(in srgb, var(--alert-color) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--alert-color) 25%, transparent);
    margin-bottom: 1rem;
}

.trend-direction {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.trend-arrow {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
}

.trend-dir-label {
    font-size: 1rem;
    color: var(--text-secondary);
}

.trend-summary-text {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.trend-sub-section {
    margin-bottom: 1rem;
}

.trend-sub-section h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.trend-sub-section h4 i {
    color: var(--primary-color);
}

.trend-sub-section ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.trend-sub-section li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding-left: 1.2rem;
    position: relative;
    line-height: 1.5;
}

.trend-sub-section li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 700;
}

.trend-recommendation {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    background: rgba(var(--primary-color-rgb), 0.06);
    border: 1px solid rgba(var(--primary-color-rgb), 0.15);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin-top: 0.5rem;
}

.trend-recommendation i {
    color: var(--primary-color);
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.trend-recommendation p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.trend-fallback {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-secondary);
}

.trend-fallback i {
    font-size: 1.8rem;
    opacity: 0.4;
    display: block;
    margin-bottom: 0.5rem;
}

/* — Log History — */
.tracker-history {
    animation: statFadeIn 0.5s ease backwards;
    animation-delay: 0.3s;
}

.log-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.log-history-item {
    background: var(--card-bg);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    transition: all 0.25s ease;
    animation: statFadeIn 0.3s ease backwards;
    animation-delay: var(--delay, 0s);
}

.log-history-item:hover {
    border-color: var(--primary-color);
    transform: translateX(3px);
}

.log-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.log-item-date {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.log-item-body {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.log-item-mood {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.log-item-symptoms {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.log-item-notes {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-style: italic;
    border-top: 1px solid var(--border-glass);
    padding-top: 0.4rem;
    margin-top: 0.4rem;
    line-height: 1.4;
}

/* — Dark Mode — Tracker — */
[data-theme="dark"] .symptom-chip {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

[data-theme="dark"] .symptom-chip:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.06);
}

[data-theme="dark"] .symptom-chip.active {
    background: rgba(var(--primary-color-rgb), 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

[data-theme="dark"] .mood-btn {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .mood-btn:hover {
    border-color: var(--primary-color);
}

[data-theme="dark"] .mood-btn.active {
    border-color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.08);
}

[data-theme="dark"] .chart-range-toggle {
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .range-btn {
    color: #94a3b8;
}

[data-theme="dark"] .range-btn.active {
    background: var(--primary-color);
    color: #0f172a;
}

[data-theme="dark"] .checkin-date {
    background: rgba(var(--primary-color-rgb), 0.08);
    border-color: rgba(var(--primary-color-rgb), 0.12);
}

[data-theme="dark"] .already-logged-banner {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.15);
}

[data-theme="dark"] .log-history-item {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .log-history-item:hover {
    border-color: var(--primary-color);
}

[data-theme="dark"] .log-item-notes {
    border-top-color: #334155;
}

[data-theme="dark"] .trend-badge {
    background: rgba(var(--secondary-color-rgb), 0.12);
    border-color: rgba(var(--secondary-color-rgb), 0.2);
}

[data-theme="dark"] .trend-recommendation {
    background: rgba(var(--primary-color-rgb), 0.05);
    border-color: rgba(var(--primary-color-rgb), 0.1);
}

[data-theme="dark"] .tracker-trend-section {
    border-color: rgba(var(--primary-color-rgb), 0.12);
}

/* — Mobile Responsive — Tracker — */
@media (max-width: 768px) {
    .tracker-container {
        padding: 1.2rem 1rem 2rem;
    }

    .tracker-hero h1 {
        font-size: 1.8rem;
    }

    .tracker-hero h1 i {
        font-size: 1.6rem;
    }

    .tracker-hero p {
        font-size: 0.92rem;
    }

    .chart-wrapper {
        height: 220px;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .mood-btn {
        width: 46px;
        height: 46px;
        font-size: 1.4rem;
    }

    .checkin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 420px) {
    .symptom-chip {
        font-size: 0.82rem;
        padding: 0.4rem 0.8rem;
    }

    .mood-btn {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
        border-radius: 12px;
    }

    .alert-banner-inner {
        padding: 0.8rem 1rem;
        gap: 0.6rem;
    }

    .alert-banner-inner>i {
        font-size: 1.3rem;
    }
}

/* ===================================== */
/* TRACKER ENHANCEMENTS                  */
/* ===================================== */

/* — Toast Notifications — */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.3rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
    max-width: 380px;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(120%);
    opacity: 0;
}

.toast i {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast-success {
    background: rgba(16, 185, 129, 0.92);
    color: #fff;
}

.toast-error {
    background: rgba(239, 68, 68, 0.92);
    color: #fff;
}

.toast-warning {
    background: rgba(245, 158, 11, 0.92);
    color: #fff;
}

.toast-info {
    background: rgba(var(--primary-color-rgb), 0.92);
    color: #fff;
}

/* — Quick Stats Bar — */
.tracker-quick-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    animation: profileFadeIn 0.5s ease backwards;
    animation-delay: 0.1s;
}

.quick-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}

.quick-stat i {
    font-size: 1.2rem;
    margin-bottom: 0.1rem;
}

.quick-stat span {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.quick-stat label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.quick-stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border-glass);
}

.streak-fire {
    color: #f59e0b !important;
}

.severity-mild {
    color: #10b981 !important;
}

.severity-moderate {
    color: #f59e0b !important;
}

.severity-severe {
    color: #ef4444 !important;
}

/* — Today Badge — */
.today-badge {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 0.4rem;
    vertical-align: middle;
}

.time-of-day-tag {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-left: 0.3rem;
}

/* — Log Delete Button — */
.log-item-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.log-delete-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 8px;
    font-size: 1rem;
    opacity: 0;
    transition: all 0.2s ease;
}

.log-history-item:hover .log-delete-btn {
    opacity: 0.6;
}

.log-delete-btn:hover {
    opacity: 1 !important;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

/* — Retry Button — */
.retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.8rem;
    padding: 0.5rem 1.2rem;
    border-radius: 10px;
    border: 1.5px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.88rem;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
}

.retry-btn:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-1px);
}

/* — Success Pulse — */
.success-pulse {
    animation: successPulse 0.4s ease;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
    }

    100% {
        transform: scale(1);
    }
}

/* — Trend Assessment Text — */
.trend-assessment-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* — Dark Mode — Tracker Enhancements — */
[data-theme="dark"] .toast-container .toast {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .tracker-quick-stats {
    background: var(--bg-glass);
    border-color: rgba(148, 163, 184, 0.08);
}

[data-theme="dark"] .quick-stat-divider {
    background: rgba(148, 163, 184, 0.12);
}

[data-theme="dark"] .today-badge {
    background: var(--primary-color);
    color: #0f172a;
}

[data-theme="dark"] .log-delete-btn:hover {
    background: rgba(239, 68, 68, 0.12);
}

/* — Mobile — Tracker Enhancements — */
@media (max-width: 768px) {
    .tracker-quick-stats {
        gap: 1rem;
        padding: 0.8rem 1rem;
    }

    .quick-stat span {
        font-size: 1.3rem;
    }

    .toast-container {
        top: auto;
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }

    .toast {
        max-width: 100%;
    }
}

@media (max-width: 420px) {
    .quick-stat span {
        font-size: 1.1rem;
    }

    .quick-stat label {
        font-size: 0.65rem;
    }
}

/* ===================================== */
/* INTERACTIVE BODY MAP                  */
/* ===================================== */

/* Trigger Button & Input Row */
.body-map-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.body-map-input-row input {
    flex: 1;
    cursor: pointer;
}

.body-map-trigger-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #fff;
    border: none;
    border-radius: 0.85rem;
    padding: 0 1.1rem;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.3);
    min-width: 48px;
}

.body-map-trigger-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(var(--primary-color-rgb), 0.45);
}

.body-map-trigger-btn:active {
    transform: translateY(0) scale(0.97);
}

/* Modal Panel */
.body-map-panel {
    border-radius: 0;
    width: 100%;
    max-width: 540px;
    height: 100%;
    overflow-y: auto;
    animation: slideInRight 0.3s ease forwards;
    display: flex;
    flex-direction: column;
}

.body-map-hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

/* Side-by-side views */
.body-map-views {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex: 1;
    min-height: 0;
}

.body-map-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 220px;
}

.body-view-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* SVG Body Diagram */
.body-map-svg {
    width: 100%;
    max-height: 52vh;
}

.body-region {
    fill: #e0f2f1;
    stroke: #b2dfdb;
    stroke-width: 1.5;
    cursor: pointer;
    transition: fill 0.25s ease, stroke 0.25s ease, filter 0.25s ease;
}

.body-region:hover {
    fill: #b2dfdb;
    stroke: var(--primary-color);
    stroke-width: 2;
    filter: drop-shadow(0 0 6px rgba(var(--primary-color-rgb), 0.4));
}

.body-region.selected {
    fill: rgba(var(--primary-color-rgb), 0.45);
    stroke: var(--primary-color);
    stroke-width: 2.5;
    filter: drop-shadow(0 0 10px rgba(var(--primary-color-rgb), 0.5));
    animation: regionPulse 2s ease-in-out infinite;
}

@keyframes regionPulse {

    0%,
    100% {
        filter: drop-shadow(0 0 8px rgba(var(--primary-color-rgb), 0.4));
    }

    50% {
        filter: drop-shadow(0 0 16px rgba(var(--primary-color-rgb), 0.65));
    }
}

/* Chips / Tags */
.body-map-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 36px;
    padding: 0.5rem 0;
}

.body-map-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.15), rgba(var(--primary-color-rgb), 0.08));
    border: 1px solid rgba(var(--primary-color-rgb), 0.35);
    color: var(--primary-hover);
    padding: 0.35rem 0.8rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    animation: chipIn 0.3s ease forwards;
}

@keyframes chipIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(4px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.body-map-chip .chip-remove {
    background: none;
    border: none;
    color: var(--primary-hover);
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.body-map-chip .chip-remove:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* Empty state placeholder */
.body-map-chips:empty::before {
    content: 'No areas selected yet';
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
    opacity: 0.6;
}

/* ===================================== */
/* BODY MAP — DARK MODE                  */
/* ===================================== */
[data-theme="dark"] .body-region {
    fill: #1e3a3a;
    stroke: #2a5555;
}

[data-theme="dark"] .body-region:hover {
    fill: #2a5555;
    stroke: var(--primary-color);
    filter: drop-shadow(0 0 8px rgba(var(--primary-color-rgb), 0.35));
}

[data-theme="dark"] .body-region.selected {
    fill: rgba(var(--primary-color-rgb), 0.3);
    stroke: var(--primary-color);
    filter: drop-shadow(0 0 12px rgba(var(--primary-color-rgb), 0.5));
}

[data-theme="dark"] .body-map-chip {
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.15), rgba(var(--primary-color-rgb), 0.06));
    border-color: rgba(var(--primary-color-rgb), 0.3);
    color: var(--primary-color);
}

[data-theme="dark"] .body-map-chip .chip-remove {
    color: var(--primary-color);
}

/* ===================================== */
/* BODY MAP — RESPONSIVE                 */
/* ===================================== */
@media (max-width: 600px) {
    .body-map-panel {
        max-width: 100%;
    }

    .body-map-views {
        gap: 0.5rem;
    }

    .body-map-view {
        max-width: 48%;
    }

    .body-map-svg {
        max-height: 45vh;
    }

    .body-region {
        stroke-width: 2;
    }
}

/* ===================================== */
/* DIAGNOSIS QUIZ — CATEGORY PICKER      */
/* ===================================== */

.quiz-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.quiz-category-card {
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border-glass);
}

.quiz-category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.quiz-cat-icon {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.quiz-category-card:hover .quiz-cat-icon {
    transform: scale(1.1);
}

[data-theme="dark"] .quiz-category-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

/* ===================================== */
/* DIAGNOSIS QUIZ - CORE                 */
/* ===================================== */

/* Intro & Grid */
.quiz-intro {
    margin-bottom: 2rem;
}

.quiz-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.quiz-category-card {
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.quiz-category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.quiz-cat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

/* Question Card */
.quiz-card {
    max-width: 700px;
    margin: 0 auto;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
}

.quiz-header {
    margin-bottom: 2rem;
}

.quiz-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.quiz-progress-bar {
    height: 6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.8rem;
}

.quiz-progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.quiz-progress-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: right;
}

.quiz-question {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
    line-height: 1.4;
}

/* Options */
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quiz-option {
    background: var(--bg-glass);
    border: 2px solid var(--border-glass);
    border-radius: 1rem;
    padding: 1.2rem 1.5rem;
    font-size: 1.05rem;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quiz-option:hover {
    border-color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.05);
    transform: translateX(4px);
}

.quiz-option.selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #fff;
    transform: translateX(4px);
}

.quiz-option-letter {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.quiz-option:hover .quiz-option-letter {
    background: var(--primary-color);
    color: #fff;
}

.quiz-option.selected .quiz-option-letter {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Transitions */
.quiz-slide-out-left {
    animation: slideOutLeft 0.3s forwards ease-in-out;
}

.quiz-slide-in-right {
    animation: slideInRight 0.3s forwards ease-in-out;
}

@keyframes slideOutLeft {
    to {
        transform: translateX(-50px);
        opacity: 0;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(50px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading State */
.quiz-loading {
    text-align: center;
    padding: 4rem 2rem;
}

.quiz-loading .spinner-large {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(var(--primary-color-rgb), 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

.quiz-loading h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.quiz-loading p {
    color: var(--text-secondary);
}

/* Dark Mode Overrides */
[data-theme="dark"] .quiz-category-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .quiz-progress-bar {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .quiz-option {
    border-color: var(--border-glass);
}

[data-theme="dark"] .quiz-option-letter {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

[data-theme="dark"] .quiz-option:hover .quiz-option-letter {
    color: #fff;
}

@media (max-width: 600px) {
    .quiz-card {
        padding: 1.5rem;
    }

    .quiz-question {
        font-size: 1.25rem;
    }

    .quiz-option {
        padding: 1rem 1.2rem;
        font-size: 0.95rem;
    }
}

/* ===================================== */
/* DIAGNOSIS QUIZ - RESULTS UI           */
/* ===================================== */

.quiz-result-card {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
    padding: 2.5rem;
}

.quiz-result-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.quiz-result-header h2 {
    font-size: 2.2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.quiz-result-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.result-condition-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.condition-item {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 1rem;
    padding: 1.5rem;
}

.condition-item.primary {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.1), rgba(var(--primary-color-rgb), 0.02));
    box-shadow: 0 4px 20px rgba(var(--primary-color-rgb), 0.1);
}

.condition-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.condition-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.condition-match {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.15);
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
}

.confidence-track {
    height: 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.confidence-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 10px;
    transition: width 1s ease-out;
}

.condition-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.quiz-red-flag-alert {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.quiz-red-flag-alert i {
    font-size: 1.5rem;
    color: #ef4444;
}

.quiz-red-flag-content h4 {
    color: #ef4444;
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.quiz-red-flag-content p {
    color: var(--text-primary);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.quiz-action-area {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-glass);
}

[data-theme="dark"] .condition-item {
    border-color: var(--border-glass);
}

[data-theme="dark"] .confidence-track {
    background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 600px) {
    .quiz-result-card {
        padding: 1.5rem;
    }

    .condition-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

[data-theme="dark"] .quiz-option-letter {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

[data-theme="dark"] .quiz-option:hover .quiz-option-letter {
    color: #fff;
}

/* Responsive */
@media (max-width: 600px) {
    .quiz-card {
        padding: 1.5rem;
    }

    .quiz-question {
        font-size: 1.25rem;
    }

    .quiz-option {
        padding: 1rem 1.2rem;
        font-size: 0.95rem;
    }
}

/* ===================================== */
/* FOLLOW-UP CONSULTATION CHAT           */
/* ===================================== */
.followup-chat {
    background: var(--card-bg);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 1.75rem;
    margin-top: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
    animation: slideUp 0.5s ease backwards;
    animation-delay: 0.3s;
}

.followup-chat-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(var(--primary-color-rgb), 0.08);
}

.followup-chat-header i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.followup-chat-header h4 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.followup-chat-header span {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Message area */
.chat-messages {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.5rem 0.2rem;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-color-rgb), 0.25);
    border-radius: 10px;
}

/* Chat bubbles */
.chat-msg {
    max-width: 80%;
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
    line-height: 1.6;
    animation: chatBubbleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    word-wrap: break-word;
}

@keyframes chatBubbleIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #ffffff;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 4px 16px rgba(var(--primary-color-rgb), 0.2);
}

.chat-msg.ai {
    align-self: flex-start;
    background: #F0FDFA;
    color: #134E4A;
    border: 1px solid rgba(8, 145, 178, 0.15);
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.chat-msg.ai .chat-ai-label {
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--primary-color);
    margin-bottom: 0.4rem;
    display: block;
}

/* Typing indicator */
.chat-typing {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.9rem 1.3rem;
    align-self: flex-start;
    background: #F0FDFA;
    border: 1px solid rgba(8, 145, 178, 0.15);
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.chat-typing .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: typingPulse 1.4s ease-in-out infinite;
}

.chat-typing .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingPulse {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Input row */
.chat-input-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
    align-items: stretch;
}

.chat-input-row input {
    flex: 1;
    border-radius: 14px;
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
    background: var(--card-bg);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.chat-input-row input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.15);
}

.chat-send-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #ffffff;
    border: none;
    border-radius: 14px;
    padding: 0 1.5rem;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.2);
}

.chat-send-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(var(--primary-color-rgb), 0.35);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===================================== */
/* CHAT — DARK MODE                      */
/* ===================================== */
[data-theme="dark"] .followup-chat {
    border-color: var(--border-glass);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .followup-chat-header {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .chat-msg.user {
    color: #041011;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(34, 211, 238, 0.3);
}

[data-theme="dark"] .chat-msg.ai {
    background: rgba(8, 145, 178, 0.1);
    border-color: rgba(34, 211, 238, 0.15);
    color: #F0FDFA;
    box-shadow: none;
}

[data-theme="dark"] .chat-typing {
    background: rgba(8, 145, 178, 0.1);
    border-color: rgba(34, 211, 238, 0.15);
    box-shadow: none;
}

[data-theme="dark"] .chat-messages::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-color-rgb), 0.2);
}

/* ===================================== */
/* CHAT — RESPONSIVE                     */
/* ===================================== */
@media (max-width: 600px) {
    .chat-msg {
        max-width: 90%;
        font-size: 0.9rem;
    }

    .chat-messages {
        max-height: 300px;
    }

    .followup-chat {
        padding: 1.25rem;
    }
}



/* ===================================== */
/* MOBILE NAVIGATION DRAWER              */
/* ===================================== */

/* Custom Animated CSS Hamburger */
.mobile-hamburger {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.6rem;
    border-radius: 12px;
    transition: background-color 0.25s, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    width: 44px;
    height: 44px;
}

.mobile-hamburger:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

.mobile-hamburger:active {
    transform: scale(0.92);
}

[data-theme="dark"] .mobile-hamburger:hover {
    background: rgba(255, 255, 255, 0.08);
}

.hamburger-box {
    width: 24px;
    height: 18px;
    display: inline-block;
    position: relative;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 4px;
    position: absolute;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.hamburger-inner {
    display: block;
    top: 50%;
    margin-top: -1px;
    transition: background-color 0s 0.15s ease;
}

.hamburger-inner::before,
.hamburger-inner::after {
    content: "";
    display: block;
}

.hamburger-inner::before {
    top: -8px;
    transition: top 0.15s 0.15s ease, transform 0.15s ease;
}

.hamburger-inner::after {
    bottom: -8px;
    transition: bottom 0.15s 0.15s ease, transform 0.15s ease;
}

/* Open State */
.mobile-hamburger.is-active .hamburger-inner {
    background-color: transparent !important;
}

.mobile-hamburger.is-active .hamburger-inner::before {
    top: 0;
    transform: rotate(45deg);
    transition: top 0.15s ease, transform 0.15s 0.15s ease;
}

.mobile-hamburger.is-active .hamburger-inner::after {
    bottom: 0;
    transform: rotate(-45deg);
    transition: bottom 0.15s ease, transform 0.15s 0.15s ease;
}

/* Overlay */
.mobile-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.mobile-drawer-overlay.visible {
    display: block;
    opacity: 1;
}

/* Drawer Panel */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: -340px;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(248, 250, 252, 0.85); /* Glass background */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 9999;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.08);
    overflow-y: auto;
}

.mobile-drawer.open {
    right: 0;
}

[data-theme="dark"] .mobile-drawer {
    background: rgba(13, 21, 39, 0.85); /* Glass background dark */
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.4);
}

/* Drawer Header */
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--border-glass);
}

.drawer-header .logo {
    gap: 0.5rem;
}

.drawer-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.drawer-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

[data-theme="dark"] .drawer-close:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* User Info */
.drawer-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--border-glass);
}

.drawer-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

.drawer-avatar-fallback {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
}

.drawer-user-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.drawer-user-email {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Nav Links */
.drawer-nav {
    display: flex;
    flex-direction: column;
    padding: 0.8rem 0;
}

.drawer-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    background: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: inherit;
    opacity: 0;
    transform: translateX(15px);
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, color 0.2s ease;
}

.mobile-drawer.open .drawer-link {
    opacity: 1;
    transform: translateX(0);
}

.mobile-drawer.open .drawer-link:nth-child(1) { transition-delay: 0.04s; }
.mobile-drawer.open .drawer-link:nth-child(2) { transition-delay: 0.08s; }
.mobile-drawer.open .drawer-link:nth-child(3) { transition-delay: 0.12s; }
.mobile-drawer.open .drawer-link:nth-child(4) { transition-delay: 0.16s; }
.mobile-drawer.open .drawer-link:nth-child(5) { transition-delay: 0.20s; }
.mobile-drawer.open .drawer-link:nth-child(6) { transition-delay: 0.24s; }
.mobile-drawer.open .drawer-link:nth-child(7) { transition-delay: 0.28s; }
.mobile-drawer.open .drawer-link:nth-child(8) { transition-delay: 0.32s; }
.mobile-drawer.open .drawer-link:nth-child(9) { transition-delay: 0.36s; }
.mobile-drawer.open .drawer-link:nth-child(10) { transition-delay: 0.40s; }

.drawer-link i {
    font-size: 1.3rem;
    width: 24px;
    text-align: center;
}

.drawer-link:hover {
    background: rgba(var(--primary-color-rgb), 0.06);
    color: var(--primary-color);
    transform: translateX(3px);
}

.drawer-link:active {
    transform: scale(0.97) translateX(1px);
}

.drawer-link.active {
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.1);
    font-weight: 700;
    border-left: 3px solid var(--primary-color);
}

/* Divider */
.drawer-divider {
    height: 1px;
    background: var(--border-glass);
    margin: 0.5rem 1.5rem;
}

/* Actions */
.drawer-actions {
    padding: 0.5rem 0;
}

.drawer-signout {
    color: #ef4444 !important;
}

.drawer-signout:hover {
    background: rgba(239, 68, 68, 0.08) !important;
}

/* Footer */
.drawer-footer {
    margin-top: auto;
    padding: 1rem 1.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Body scroll lock when drawer is open */
body.drawer-open {
    overflow: hidden;
}

/* ===================================== */
/* MOBILE BREAKPOINT                     */
/* ===================================== */
@media (max-width: 768px) {

    /* Hide desktop nav, show hamburger */
    .nav-actions .nav-btn {
        display: none !important;
    }

    .nav-actions {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    /* Keep header clean */
    .header-inner {
        justify-content: space-between;
    }

    /* Floating SOS Button */
    .mobile-floating-sos {
        display: flex !important;
        position: fixed;
        bottom: 24px;
        right: 24px;
        background: #ef4444;
        color: white;
        padding: 0 1.2rem;
        height: 54px;
        border-radius: 27px;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        font-weight: 700;
        font-size: 1.1rem;
        box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
        z-index: 9990;
        text-decoration: none;
        transition: transform 0.2s, background 0.2s;
    }

    .mobile-floating-sos:active {
        transform: scale(0.95);
        background: #dc2626;
    }
}

/* ===================================== */
/* DIAGNOSIS QUIZ — MOBILE FIXES         */
/* ===================================== */
@media (max-width: 600px) {

    /* Hero fixes — prevent cutoff */
    .tracker-hero h1 {
        font-size: 1.8rem !important;
        flex-wrap: wrap;
        /* in case it needs to wrap */
        gap: 0.4rem;
        word-break: break-word;
    }

    .tracker-hero p {
        font-size: 0.95rem;
        padding: 0 0.5rem;
    }

    /* Grid fixes: Force 2 columns on small screens instead of 1 giant column */
    .quiz-category-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.8rem !important;
    }

    .quiz-category-card {
        padding: 1rem 0.5rem !important;
        gap: 0.5rem !important;
    }

    .quiz-cat-icon {
        width: 45px !important;
        height: 45px !important;
        font-size: 1.5rem !important;
    }

    .quiz-category-card h3 {
        font-size: 0.9rem !important;
    }

    /* How It Works section fixes */
    .how-it-works-section {
        padding: 1.5rem !important;
        margin-top: 2rem !important;
    }
}

/* ===================================== */
/* MEDICAL ID PROFILE STYLES             */
/* ===================================== */
/* Read-only appearance when disabled */
.medical-id-form input:disabled,
.medical-id-form select:disabled,
.medical-id-form textarea:disabled {
    background: transparent !important;
    border-color: transparent !important;
    padding-left: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    color: var(--text-primary) !important;
    font-weight: 500;
    opacity: 1 !important;
    resize: none !important;
}

/* Dark mode overrides for Medical ID */
[data-theme="dark"] #mid-last-consultation-text {
    background: rgba(var(--primary-color-rgb), 0.1) !important;
}

[data-theme="dark"] #qrcode-container {
    background: #fff !important;
    /* Keep QR code background white for scannability */
}

/* ===================================== */
/* SPLASH SCREEN                         */
/* ===================================== */
.splash-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0b0f19, #1e1b4b);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s;
    color: #ffffff;
}

.splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-content {
    text-align: center;
    animation: splashZoomIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.splash-lottie {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
}

.splash-logo {
    font-size: 2.8rem !important;
    color: #818CF8 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 900;
}

.splash-logo i {
    font-size: 3.2rem;
    animation: heartbeat 1.2s infinite ease-in-out;
}

.splash-subtitle {
    font-size: 1.1rem;
    color: #94a3b8;
    letter-spacing: 0.5px;
    margin-bottom: 2rem;
    font-weight: 500;
}

.splash-loader {
    width: 140px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
}

.splash-loader-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #4F46E5, #818CF8);
    border-radius: 10px;
    position: absolute;
    left: -100%;
    animation: loadingBar 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes splashZoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes loadingBar {
    0% {
        left: -100%;
    }
    50% {
        left: -30%;
    }
    100% {
        left: 0;
    }
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.1);
    }
    40% {
        transform: scale(1.05);
    }
    60% {
        transform: scale(1.15);
    }
}

/* ===================================== */
/* EMERGENCY LOCKDOWN OVERLAY            */
/* ===================================== */
.emergency-lockdown-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(25px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 1.5rem;
    color: var(--text-primary);
}

.lockdown-card {
    max-width: 460px;
    width: 100%;
    padding: 2.5rem;
    border-radius: 24px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    box-shadow: 0 25px 50px -12px rgba(220, 38, 38, 0.25);
    background: rgba(255, 255, 255, 0.95);
    text-align: center;
    animation: zoomInLockdown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

[data-theme="dark"] .lockdown-card {
    background: rgba(15, 23, 42, 0.95);
    border-color: rgba(239, 68, 68, 0.3);
}

.lockdown-header h2 {
    color: #ef4444;
    font-size: 1.4rem;
    font-weight: 800;
    margin-top: 0.5rem;
    letter-spacing: 0.5px;
}

.lockdown-siren {
    font-size: 3.5rem;
    color: #ef4444;
    display: inline-block;
    animation: flashSiren 0.8s infinite ease-in-out alternate;
}

.lockdown-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 1rem 0 1.5rem;
}

.countdown-timer-wrapper {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.1);
    border-radius: 16px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}

.countdown-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ef4444;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.3rem;
}

.countdown-clock {
    font-size: 3rem;
    font-family: 'Courier New', Courier, monospace;
    font-weight: 800;
    color: #ef4444;
    letter-spacing: 2px;
}

.action-alert-box {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 1.2rem;
    text-align: left;
}

[data-theme="dark"] .action-alert-box {
    background: #1e293b;
    border-color: #334155;
}

.action-alert-box h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}

.action-alert-box p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

@keyframes zoomInLockdown {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes flashSiren {
    0% {
        text-shadow: 0 0 5px rgba(239, 68, 68, 0.3);
        transform: scale(1);
    }
    100% {
        text-shadow: 0 0 25px rgba(239, 68, 68, 0.9);
        transform: scale(1.08);
    }
}

/* ===================================== */
/* TRIAGE CLINICAL DASHBOARD             */
/* ===================================== */
.triage-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-glass);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.triage-dashboard-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.triage-patient-meta {
    font-size: 0.85rem;
    background: rgba(var(--primary-color-rgb), 0.04);
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    display: flex;
    gap: 1.5rem;
}

.triage-patient-meta span strong {
    color: var(--primary-hover);
}

.triage-main-panel {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 2rem;
    align-items: center;
    background: rgba(var(--primary-color-rgb), 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 1.8rem;
    margin-bottom: 2rem;
}

@media (max-width: 600px) {
    .triage-main-panel {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
    }
}

.triage-gauge-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.triage-gauge-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1), 0 0 20px rgba(var(--primary-color-rgb), 0.1);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--border-glass);
}

.triage-gauge-circle:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15), 0 0 30px rgba(var(--primary-color-rgb), 0.25);
}

.triage-gauge-inner {
    width: 114px;
    height: 114px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: background-color 0.3s ease;
}

[data-theme="dark"] .triage-gauge-inner {
    background: rgba(9, 33, 35, 0.9);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

.triage-gauge-score {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
    font-family: 'Figtree', sans-serif;
    letter-spacing: -1px;
}

.triage-gauge-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.75px;
    margin-top: 0.1rem;
}

.triage-status-info {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    align-items: flex-start;
}

@media (max-width: 600px) {
    .triage-status-info {
        align-items: center;
    }
}

.triage-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 800;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    width: fit-content;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.triage-status-badge.critical {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    animation: pulseBorder 2s infinite;
}

.triage-status-badge.urgent {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.triage-status-badge.routine {
    background: rgba(16, 185, 129, 0.1);
    color: #16A34A;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

@keyframes pulseBorder {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
}

.triage-action-text {
    font-size: 1.05rem;
    line-height: 1.5;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
}

@media (max-width: 600px) {
    .triage-action-text {
        text-align: center;
    }
}

.triage-section {
    margin-bottom: 2rem;
    text-align: left;
}

.triage-section h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-left: 4px solid var(--primary-color);
    padding-left: 0.6rem;
}

.clinical-analysis-box {
    background: rgba(var(--primary-color-rgb), 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1.5rem 1.4rem;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-primary);
    white-space: pre-line;
    word-wrap: break-word;
}

/* ===================================== */
/* DOCTOR REFERRAL BANNER                */
/* ===================================== */
.doctor-referral-banner {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(245, 158, 11, 0.03));
    border: 1.5px solid rgba(239, 68, 68, 0.2);
    border-radius: 20px;
    padding: 1.75rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    animation: doctorBannerPulse 4s ease-in-out infinite;
}

[data-theme="dark"] .doctor-referral-banner {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(245, 158, 11, 0.04));
    border-color: rgba(239, 68, 68, 0.3);
}

@keyframes doctorBannerPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.1); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

.doctor-referral-icon {
    font-size: 2.2rem;
    color: #fff;
    background: linear-gradient(135deg, #ef4444, #f43f5e);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 8px 16px rgba(239, 68, 68, 0.25);
}

.doctor-referral-content {
    flex: 1;
}

.doctor-referral-content h4 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #dc2626;
    margin-bottom: 0.5rem;
}

[data-theme="dark"] .doctor-referral-content h4 {
    color: #f87171;
}

.doctor-referral-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.2rem;
}

.doctor-referral-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.doctor-call-btn,
.doctor-find-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.6rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    border: none;
}

.doctor-call-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.doctor-call-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
    filter: brightness(1.1);
}

.doctor-find-btn {
    background: linear-gradient(135deg, #16A34A, #15803d);
    color: #fff;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.2);
}

.doctor-find-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(22, 163, 74, 0.35);
    filter: brightness(1.1);
}

@media (max-width: 550px) {
    .doctor-referral-banner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.2rem;
    }

    .doctor-referral-actions {
        justify-content: center;
        width: 100%;
    }
    
    .doctor-call-btn, .doctor-find-btn {
        width: 100%;
    }
}

.clinical-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    margin-bottom: 2rem;
}

@media (max-width: 550px) {
    .clinical-summary-grid {
        grid-template-columns: 1fr;
    }
}

.snomed-icd-card {
    background: var(--card-bg);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: left;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .snomed-icd-card {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.snomed-icd-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.03), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.snomed-icd-card:hover {
    border-color: rgba(var(--primary-color-rgb), 0.4);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 30px rgba(var(--primary-color-rgb), 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.snomed-icd-card:hover::before {
    opacity: 1;
}

[data-theme="dark"] .snomed-icd-card:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.snomed-icd-icon {
    font-size: 1.75rem;
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.06);
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(var(--primary-color-rgb), 0.1);
    transition: all 0.3s ease;
}

.snomed-icd-card:hover .snomed-icd-icon {
    background: var(--primary-color);
    color: #ffffff;
    transform: rotate(5deg) scale(1.05);
}

.snomed-icd-details {
    flex: 1;
}

.snomed-icd-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.3rem;
}

.snomed-icd-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-word;
    line-height: 1.4;
}

.ai-justification-box {
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.03), rgba(var(--primary-color-rgb), 0.05));
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.8rem 1.5rem 1.5rem 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
    text-align: left;
}

.ai-justification-box::before {
    content: "⚡ AI MULTI-API INTEGRATION";
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.3rem 0.8rem;
    border-bottom-left-radius: 8px;
    letter-spacing: 0.5px;
}

/* ===================================== */
/* SYMPTOM PHOTO UPLOAD                  */
/* ===================================== */
.photo-upload-container {
    border: 2px dashed var(--border-glass);
    background: rgba(var(--primary-color-rgb), 0.02);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    min-height: 150px;
}

.photo-upload-container:hover {
    border-color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.05);
    box-shadow: 0 10px 20px -5px rgba(var(--primary-color-rgb), 0.05);
}

.photo-upload-container.dragover {
    border-color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.08);
    animation: dashed-border-pulse 1.5s infinite ease-in-out;
}

.photo-upload-container.dragover .photo-upload-placeholder i {
    transform: scale(1.2) translateY(-4px);
    color: var(--primary-color);
}

@keyframes dashed-border-pulse {
    0% {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0.2);
    }
    50% {
        border-color: #818CF8;
        box-shadow: 0 0 0 8px rgba(var(--primary-color-rgb), 0.12);
    }
    100% {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0.2);
    }
}

.hidden-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 5;
}

.photo-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    pointer-events: none;
    z-index: 1;
}

.photo-upload-placeholder i {
    font-size: 2.2rem;
    color: var(--primary-hover);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.3s ease;
}

.photo-upload-container:hover .photo-upload-placeholder i {
    transform: scale(1.15) translateY(-2px);
}

.file-size-limit {
    font-size: 0.75rem;
    opacity: 0.8;
}

.photo-upload-preview {
    position: relative;
    max-width: 200px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.photo-upload-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.remove-photo-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(15, 23, 42, 0.7);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    transition: background 0.2s ease;
    z-index: 15;
}

.remove-photo-btn:hover {
    background: rgba(239, 68, 68, 0.9);
}

/* ===================================== */
/* ANALYSIS LOADER OVERLAY               */
/* ===================================== */
.analysis-loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 1.5rem;
}

.analysis-loader-card {
    max-width: 400px;
    width: 100%;
    padding: 3rem 2rem;
    text-align: center;
    border-radius: 24px;
    border: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 25px 50px -12px rgba(var(--primary-color-rgb), 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    animation: zoomInLoader 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

[data-theme="dark"] .analysis-loader-card {
    background: rgba(15, 23, 42, 0.95);
}

.analysis-loader-spinner-box {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.analysis-loader-pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    animation: loaderPulse 1.5s infinite ease-in-out;
}

.analysis-loader-icon {
    font-size: 2.5rem;
    color: var(--primary-hover);
    animation: heartbeat 1.2s infinite ease-in-out;
}

.analysis-loader-card h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.analysis-loader-status {
    font-size: 0.95rem;
    color: var(--text-secondary);
    min-height: 24px;
    margin: 0;
}

.analysis-loader-progress {
    width: 100%;
    height: 6px;
    background: rgba(var(--primary-color-rgb), 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.analysis-loader-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), #818CF8);
    border-radius: 10px;
    transition: width 0.4s ease;
}

@keyframes zoomInLoader {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes loaderPulse {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
        box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0.4);
    }
    70% {
        transform: scale(1.1);
        opacity: 0.4;
        box-shadow: 0 0 0 10px rgba(var(--primary-color-rgb), 0);
    }
    100% {
        transform: scale(0.8);
        opacity: 0.8;
        box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0);
    }
}


/* ==========================================================================
   STARTUP-LEVEL UPGRADE: PREMIUM DESIGN SYSTEM UTILITIES & COMPONENTS
   ========================================================================= */

/* 1. Personalized Greeting Card */
.greeting-card {
    position: relative;
    border-radius: 24px;
    padding: 2.5rem;
    overflow: hidden;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 
        0 10px 15px -3px rgba(0, 0, 0, 0.04),
        0 20px 45px -12px rgba(var(--primary-color-rgb), 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.greeting-card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 15px 20px -3px rgba(0, 0, 0, 0.04),
        0 25px 55px -10px rgba(var(--primary-color-rgb), 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    border-color: rgba(var(--primary-color-rgb), 0.35);
}

.greeting-text {
    position: relative;
    z-index: 2;
    max-width: 60%;
}

.greeting-text h1 {
    font-size: 2.2rem;
    font-weight: 900;
    margin-bottom: 0.4rem;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.greeting-typewriter {
    font-size: 1.1rem;
    color: var(--text-secondary);
    min-height: 1.5rem;
    border-right: 2px solid var(--primary-color);
    width: fit-content;
    padding-right: 4px;
    animation: greetingBlink 0.75s step-end infinite;
}

@keyframes greetingBlink {
    from, to { border-color: transparent }
    50% { border-color: var(--primary-color); }
}

.greeting-visual {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.greeting-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.45;
    mix-blend-mode: multiply;
    pointer-events: none;
}

.orb-1 {
    width: 160px;
    height: 160px;
    top: -30px;
    right: -20px;
    animation: drift-orb-1 22s infinite ease-in-out;
}

.orb-2 {
    width: 140px;
    height: 140px;
    bottom: -40px;
    right: 60px;
    animation: drift-orb-2 28s infinite ease-in-out;
}

.orb-3 {
    width: 110px;
    height: 110px;
    top: 30%;
    right: -60px;
    animation: drift-orb-3 18s infinite ease-in-out;
}

@keyframes drift-orb-1 {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    33% { transform: translate3d(30px, -20px, 0) scale(1.15); }
    66% { transform: translate3d(-20px, 15px, 0) scale(0.9); }
    100% { transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes drift-orb-2 {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(-35px, 25px, 0) scale(1.2); }
    100% { transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes drift-orb-3 {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    40% { transform: translate3d(20px, 30px, 0) scale(0.85); }
    80% { transform: translate3d(-15px, -20px, 0) scale(1.1); }
    100% { transform: translate3d(0, 0, 0) scale(1); }
}

[data-theme="dark"] .greeting-orb {
    mix-blend-mode: plus-lighter;
    opacity: 0.25;
}

/* Greeting Card Time-Of-Day Gradient Themes */
.greeting-card.theme-morning {
    background: linear-gradient(135deg, rgba(204,251,241,0.8), rgba(167,243,208,0.4));
}
.greeting-card.theme-morning .orb-1 { background: #0d9488; }
.greeting-card.theme-morning .orb-2 { background: #059669; }
.greeting-card.theme-morning .orb-3 { background: #a7f3d0; }

.greeting-card.theme-afternoon {
    background: linear-gradient(135deg, rgba(224,242,254,0.8), rgba(204,251,241,0.4));
}
.greeting-card.theme-afternoon .orb-1 { background: #0284c7; }
.greeting-card.theme-afternoon .orb-2 { background: #0891B2; }
.greeting-card.theme-afternoon .orb-3 { background: #99f6e4; }

.greeting-card.theme-evening {
    background: linear-gradient(135deg, rgba(204,251,241,0.85), rgba(224,242,254,0.4));
}
.greeting-card.theme-evening .orb-1 { background: #0891B2; }
.greeting-card.theme-evening .orb-2 { background: #0284c7; }
.greeting-card.theme-evening .orb-3 { background: #22d3ee; }

.greeting-card.theme-night {
    background: linear-gradient(135deg, rgba(4,16,17,0.1), rgba(6,20,22,0.2));
}
.greeting-card.theme-night .orb-1 { background: #042f2e; }
.greeting-card.theme-night .orb-2 { background: #083344; }
.greeting-card.theme-night .orb-3 { background: #0f766e; }

[data-theme="dark"] .greeting-card.theme-morning {
    background: linear-gradient(135deg, rgba(13,148,136,0.2), rgba(5,150,105,0.15));
}
[data-theme="dark"] .greeting-card.theme-afternoon {
    background: linear-gradient(135deg, rgba(2,132,199,0.2), rgba(8,145,178,0.15));
}
[data-theme="dark"] .greeting-card.theme-evening {
    background: linear-gradient(135deg, rgba(8,145,178,0.2), rgba(2,132,199,0.15));
}
[data-theme="dark"] .greeting-card.theme-night {
    background: linear-gradient(135deg, rgba(2,44,34,0.8), rgba(6,20,22,0.6));
}

/* 2. Quick Action Cards Row */
.quick-actions-row {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    scrollbar-width: none; /* Firefox */
}

.quick-actions-row::-webkit-scrollbar {
    display: none; /* Safari/Chrome */
}

.quick-action-card {
    flex: 0 0 calc(20% - 0.8rem);
    min-width: 140px;
    background: var(--card-bg);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
    cursor: pointer;
}

.quick-action-card:hover {
    transform: translateY(-4px) scale(1.02);
    background: var(--bg-glass);
}

/* Unique colored glows and borders on hover */
.quick-action-card:nth-child(1):hover {
    box-shadow: 0 12px 24px -8px rgba(var(--primary-color-rgb), 0.35);
    border-color: #4F46E5;
}
.quick-action-card:nth-child(2):hover {
    box-shadow: 0 12px 24px -8px rgba(147, 51, 234, 0.35);
    border-color: #9333ea;
}
.quick-action-card:nth-child(3):hover {
    box-shadow: 0 12px 24px -8px rgba(var(--primary-color-rgb), 0.35);
    border-color: #4F46E5;
}
.quick-action-card:nth-child(4):hover {
    box-shadow: 0 12px 24px -8px rgba(16, 185, 129, 0.35);
    border-color: #10b981;
}
.quick-action-card:nth-child(5):hover {
    box-shadow: 0 12px 24px -8px rgba(239, 68, 68, 0.35);
    border-color: #ef4444;
}
.quick-action-card:nth-child(6):hover {
    box-shadow: 0 12px 24px -8px rgba(245, 158, 11, 0.35);
    border-color: #f59e0b;
}

.quick-action-card:active {
    transform: translateY(0) scale(0.96);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.qa-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.qa-icon i {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-block;
}

.quick-action-card:hover .qa-icon {
    transform: scale(1.12);
}

.quick-action-card:hover .qa-icon i {
    transform: rotate(12deg) scale(1.15);
}

/* SOS bounce animation */
.quick-action-card:nth-child(5):hover .qa-icon i {
    animation: sosBounce 0.6s infinite alternate ease-in-out;
}

@keyframes sosBounce {
    0% { transform: translateY(0) scale(1.1) rotate(-5deg); }
    100% { transform: translateY(-4px) scale(1.1) rotate(5deg); }
}

@media (max-width: 768px) {
    .quick-action-card {
        flex: 0 0 130px;
    }
}

/* 3. Live Stats Bar */
.live-stats-bar {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
    justify-content: space-between;
    width: 100%;
}

.stat-item {
    flex: 1;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.03),
        0 10px 15px -3px rgba(var(--primary-color-rgb), 0.05);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 
        0 15px 25px -5px rgba(var(--primary-color-rgb), 0.15),
        0 0 15px rgba(var(--primary-color-rgb), 0.05);
}

.stat-number {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-suffix {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

@media (max-width: 768px) {
    .live-stats-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    .live-stats-bar .stat-item:last-child {
        grid-column: span 2;
    }
}

/* 4. Autocomplete Suggestions */
.textarea-wrapper {
    position: relative;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
}

.autocomplete-suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.92rem;
    color: var(--text-primary);
    transition: background 0.15s ease;
    border-bottom: 1px solid var(--border-glass);
    text-align: left;
}

.autocomplete-suggestion-item:last-child {
    border-bottom: none;
}

.autocomplete-suggestion-item:hover {
    background: rgba(var(--primary-color-rgb), 0.08);
    color: var(--primary-hover);
}

/* 5. Floating AI Chat Widget */
.floating-chat-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 99999;
}

.floating-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 10px 25px -5px rgba(var(--primary-color-rgb), 0.5);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.floating-chat-toggle:hover {
    transform: scale(1.08) rotate(5deg);
    box-shadow: 0 15px 30px -5px rgba(var(--primary-color-rgb), 0.6);
}

.chat-status-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #10b981;
    border: 2px solid var(--bg-main);
    border-radius: 50%;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.floating-chat-container {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 360px;
    height: 480px;
    background: var(--card-bg);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    box-shadow: 0 15px 40px -10px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUpChat 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes slideUpChat {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.floating-chat-header {
    background: rgba(var(--primary-color-rgb), 0.05);
    border-bottom: 1px solid var(--border-glass);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-header-info i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.chat-header-info h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.chat-status-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.status-indicator {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
}

.floating-chat-container .chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.floating-chat-container .chat-msg {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.45;
}

.floating-chat-container .chat-msg.user {
    background: var(--primary-color);
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

[data-theme="dark"] .floating-chat-container .chat-msg.user {
    color: #041011;
    font-weight: 700;
}

.floating-chat-container .chat-msg.ai {
    background: rgba(var(--primary-color-rgb), 0.08);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-glass);
    text-align: left;
}

.floating-chat-container .chat-ai-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.floating-chat-container .chat-input-row {
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--border-glass);
    background: var(--card-bg);
}

@media (max-width: 480px) {
    .floating-chat-container {
        position: fixed;
        bottom: 0;
        right: 0;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        z-index: 999999;
    }
    .floating-chat-widget {
        bottom: 1rem;
        right: 1rem;
    }
}

/* 6. Powered By Trust Strip */
.powered-by-strip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2.5rem 1rem;
    border-top: 1px solid var(--border-glass);
    background: rgba(var(--primary-color-rgb), 0.02);
    margin-top: 4rem;
    overflow: hidden;
    width: 100%;
}

.powered-by-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 800;
    color: var(--text-secondary);
}

.marquee-container {
    overflow: hidden;
    width: 100%;
    position: relative;
    padding: 0.5rem 0;
    mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

.marquee-content {
    display: flex;
    gap: 0.8rem;
    width: max-content;
    animation: marquee-scroll 30s linear infinite;
}

.marquee-content:hover {
    animation-play-state: paused;
}

@keyframes marquee-scroll {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

.db-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    background: var(--card-bg);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
}

.db-badge i {
    color: var(--primary-color);
}

.db-badge:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    color: var(--primary-hover);
}

/* Medication Presets styling */
.medication-presets {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.preset-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-right: 0.2rem;
}

.preset-tag {
    background: var(--card-bg);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-tag:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.05);
}

.preset-tag.active {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(var(--primary-color-rgb), 0.25);
}

/* 7. WhatsApp Share Styling */
.whatsapp-btn {
    background: linear-gradient(135deg, #25d366, #128c7e) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3) !important;
}
.whatsapp-btn:hover {
    background: linear-gradient(135deg, #20ba5a, #0e7064) !important;
    transform: translateY(-2px) !important;
}

/* 8. Clinical Triage Results Watermark & Bars */
.prescription-pad {
    position: relative;
    overflow: hidden;
}

.prescription-pad::after {
    content: '🧬';
    position: absolute;
    bottom: -30px;
    right: -20px;
    font-size: 15rem;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

.bar-fill {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover)) !important;
}

/* OLED Mode Shadows and Focus */
[data-theme="dark"] .quick-action-card:hover {
    box-shadow: 0 12px 25px -8px rgba(var(--primary-color-rgb), 0.3);
}

[data-theme="dark"] .floating-chat-toggle {
    box-shadow: 0 10px 25px -5px rgba(var(--primary-color-rgb), 0.4);
}

[data-theme="dark"] .floating-chat-toggle:hover {
    box-shadow: 0 15px 30px -5px rgba(var(--primary-color-rgb), 0.5);
}

/* Urgency Pulse Ring Glow */
.urgency-badge.urgent-pulse {
    animation: urgentGlow 1.5s infinite alternate ease-in-out;
}

@keyframes urgentGlow {
    from { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.4); }
    to { box-shadow: 0 0 12px 4px rgba(244, 63, 94, 0.6); }
}

/* ===================================== */
/* AI WELLBEING COMPANION                */
/* ===================================== */
.wellbeing-panel {
    max-width: 480px !important;
    width: 100%;
}

.wellbeing-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1rem 0;
}

.wellbeing-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    padding: 1rem 0;
}

.avatar-glow-ring {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #7C3AED);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 2.2rem;
    z-index: 10;
    box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.4);
    transition: all 0.3s ease;
}

.avatar-core {
    position: relative;
    z-index: 12;
}

.wellbeing-status-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #10b981;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Speaking Avatar Ripple Effect */
.wave {
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.35);
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    top: 0;
    left: 0;
}

.avatar-glow-ring.speaking {
    animation: avatarPulse 2s infinite ease-in-out;
    box-shadow: 0 0 25px 8px rgba(16, 185, 129, 0.5);
}

.avatar-glow-ring.speaking .wave-1 {
    animation: ripple 2s infinite ease-out;
}

.avatar-glow-ring.speaking .wave-2 {
    animation: ripple 2s infinite ease-out 1s;
}

@keyframes avatarPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

.wellbeing-chat-box {
    height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

[data-theme="dark"] .wellbeing-chat-box {
    background: rgba(0, 0, 0, 0.2);
}

/* Persona Selector Layout */
.wellbeing-avatar-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    width: 100%;
}

.persona-card {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 0.6rem 0.4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0.7;
}

[data-theme="dark"] .persona-card {
    background: rgba(13, 21, 39, 0.4);
}

.persona-card:hover {
    transform: translateY(-2px);
    opacity: 0.95;
    border-color: var(--primary-color);
}

.persona-card.active {
    opacity: 1;
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.08);
    box-shadow: 0 4px 12px -3px rgba(16, 185, 129, 0.2);
}

.persona-emoji {
    font-size: 1.4rem;
}

.persona-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Avatar Glow Themes */
.avatar-glow-ring.avatar-sirona {
    background: linear-gradient(135deg, #10b981, #7C3AED);
    box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.4);
}
.avatar-glow-ring.avatar-sirona.speaking {
    box-shadow: 0 0 25px 8px rgba(16, 185, 129, 0.5);
}
.avatar-glow-ring.avatar-sirona .wave {
    background: rgba(16, 185, 129, 0.35);
}

.avatar-glow-ring.avatar-aurelius {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 10px 20px -5px rgba(245, 158, 11, 0.4);
}
.avatar-glow-ring.avatar-aurelius.speaking {
    box-shadow: 0 0 25px 8px rgba(245, 158, 11, 0.5);
}
.avatar-glow-ring.avatar-aurelius .wave {
    background: rgba(245, 158, 11, 0.35);
}

.avatar-glow-ring.avatar-lotus {
    background: linear-gradient(135deg, #9333ea, #7c3aed);
    box-shadow: 0 10px 20px -5px rgba(147, 51, 234, 0.4);
}
.avatar-glow-ring.avatar-lotus.speaking {
    box-shadow: 0 0 25px 8px rgba(147, 51, 234, 0.5);
}
.avatar-glow-ring.avatar-lotus .wave {
    background: rgba(147, 51, 234, 0.35);
}

.avatar-glow-ring.avatar-kai {
    background: linear-gradient(135deg, #f97316, #ea580c);
    box-shadow: 0 10px 20px -5px rgba(249, 115, 22, 0.4);
}
.avatar-glow-ring.avatar-kai.speaking {
    box-shadow: 0 0 25px 8px rgba(249, 115, 22, 0.5);
}
.avatar-glow-ring.avatar-kai .wave {
    background: rgba(249, 115, 22, 0.35);
}

/* ===================================== */
/* DEDICATED AI WELLBEING PAGE STYLING   */
/* ===================================== */

body.wellbeing-page-body {
    --bg-main: #0c0e12 !important;
    --bg-glass: rgba(18, 22, 30, 0.75) !important;
    --text-primary: #f8fafc !important;
    --text-secondary: #94a3b8 !important;
    --border-glass: rgba(255, 255, 255, 0.08) !important;
    --primary-color: #4F46E5 !important;
    --primary-hover: #3730A3 !important;
    --success-color: #10b981 !important;
    --success-hover: #7C3AED !important;
    background: #0c0e12 !important;
    color: #f8fafc !important;
    min-height: 100vh;
    font-family: 'Outfit', sans-serif;
    position: relative;
    overflow-x: hidden;
}

body.wellbeing-page-body .glass-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    opacity: 1;
    background-color: #0c0e12 !important;
    background-image: radial-gradient(circle at 10% 20%, rgba(15, 17, 21, 1) 0%, rgba(20, 24, 33, 1) 90%) !important;
}

.wellbeing-bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    pointer-events: none;
}
.wellbeing-bg-orb.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #10b981 0%, transparent 70%);
    top: -100px;
    right: -100px;
}
.wellbeing-bg-orb.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #4F46E5 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
}

/* Header Adjustments for Wellbeing Theme */
body.wellbeing-page-body header {
    background: rgba(18, 22, 30, 0.85) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(12px);
}
body.wellbeing-page-body header .logo span {
    color: #f8fafc !important;
}
body.wellbeing-page-body header .nav-btn {
    color: #94a3b8 !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
body.wellbeing-page-body header .nav-btn:hover {
    color: #f8fafc !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.1);
}

/* Wellbeing Grid Layout */
.wellbeing-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 7rem 1.5rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.wellbeing-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 2rem;
    width: 100%;
    align-items: stretch;
}

@media (max-width: 968px) {
    .wellbeing-grid {
        grid-template-columns: 1fr;
    }
    .wellbeing-container {
        padding-top: 6rem;
    }
}

/* Panel Styles */
.wellbeing-left-panel,
.wellbeing-right-panel {
    background: rgba(15, 18, 25, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 1.75rem;
    backdrop-filter: blur(24px);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-sizing: border-box;
}

.panel-subtitle {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f0f4f8;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 0.4rem 0;
}
.panel-subtitle i {
    font-size: 1.2rem;
    color: #10b981;
}

.panel-desc {
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.55;
    margin: 0;
}

/* 4-7-8 Breathing visualizer styling */
.breathing-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 2rem;
}

.breathing-visualizer-container {
    position: relative;
    width: 250px;
    height: 250px;
    margin: 2.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.breathing-glow-outer {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.12);
    filter: blur(25px);
    z-index: 1;
    pointer-events: none;
    transition: all 1s ease;
}

.breathing-circle-ring {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid rgba(16, 185, 129, 0.3) !important;
    background: rgba(16, 185, 129, 0.05) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 0 30px -5px rgba(16, 185, 129, 0.2);
    transform: scale(1);
    transform-origin: center center;
    will-change: transform, background, border-color, box-shadow;
}

/* Transition speed classes applied by JS dynamically */
.breathing-circle-ring.inhale-transition {
    transition: transform 4s linear, border-color 0.8s ease, background 0.8s ease, box-shadow 0.8s ease;
}
.breathing-circle-ring.hold-transition {
    transition: transform 7s linear, border-color 0.8s ease, background 0.8s ease, box-shadow 0.8s ease;
}
.breathing-circle-ring.exhale-transition {
    transition: transform 8s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.8s ease, background 0.8s ease, box-shadow 0.8s ease;
}
.breathing-circle-ring.static-transition {
    transition: transform 1s ease, border-color 0.8s ease, background 0.8s ease, box-shadow 0.8s ease;
}

/* Scaling/styling states */
.breathing-circle-ring.inhaling {
    transform: scale(1.6);
    border-color: rgba(16, 185, 129, 0.95) !important;
    background: rgba(16, 185, 129, 0.18) !important;
    box-shadow: 0 0 45px 12px rgba(16, 185, 129, 0.35);
}
.breathing-circle-ring.holding {
    transform: scale(1.6);
    border-color: rgba(147, 51, 234, 0.95) !important;
    background: rgba(147, 51, 234, 0.18) !important;
    box-shadow: 0 0 45px 12px rgba(147, 51, 234, 0.35);
}
.breathing-circle-ring.exhaling {
    transform: scale(1);
    border-color: rgba(245, 158, 11, 0.95) !important;
    background: rgba(245, 158, 11, 0.18) !important;
    box-shadow: 0 0 45px 12px rgba(245, 158, 11, 0.35);
}

.breathing-circle-core {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #f8fafc !important;
}

.breathing-text {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #10b981 !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.breathing-timer {
    font-size: 1rem;
    color: #94a3b8 !important;
    margin-top: 0.2rem;
    font-weight: 600;
}

body.wellbeing-page-body .breath-control-btn {
    width: 100% !important;
    max-width: 240px !important;
    border-radius: 50px !important;
    padding: 0.7rem 1.5rem !important;
    font-weight: 700 !important;
    background: linear-gradient(135deg, #10b981, #7C3AED) !important;
    border: none !important;
    box-shadow: 0 8px 20px -6px rgba(16, 185, 129, 0.35) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    margin: 0 auto !important;
}
body.wellbeing-page-body .breath-control-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 12px 28px -5px rgba(16, 185, 129, 0.45) !important;
}
body.wellbeing-page-body .breath-control-btn.active {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    box-shadow: 0 8px 20px -6px rgba(239, 68, 68, 0.35) !important;
}

/* Ambient Audio Controller Card styling */
.audio-session-section {
    display: flex;
    flex-direction: column;
}

.audio-control-card {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

.audio-info {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.audio-icon-container {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(var(--primary-color-rgb), 0.15) !important;
    color: #818CF8 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}
.audio-icon-container.playing {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #34d399 !important;
}

.audio-details {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.audio-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #f8fafc !important;
}

.audio-status {
    font-size: 0.78rem;
    color: #94a3b8 !important;
}

.audio-buttons-row {
    display: flex;
    gap: 0.65rem;
}

body.wellbeing-page-body .audio-play-btn {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border-radius: 10px;
    padding: 0.5rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
}
body.wellbeing-page-body .audio-play-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}
body.wellbeing-page-body .audio-play-btn.playing {
    background: #4F46E5;
    border-color: #4F46E5;
}

body.wellbeing-page-body .audio-sub-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    border-radius: 10px;
    padding: 0.5rem;
    font-size: 0.82rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
body.wellbeing-page-body .audio-sub-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #f0f4f8;
}
body.wellbeing-page-body .audio-sub-btn.active {
    color: #34d399;
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
}

/* Audio visualizer bar animation */
body.wellbeing-page-body .audio-visualizer-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 14px;
    position: relative !important;
    margin-left: auto !important;
    right: 0 !important;
    top: 0 !important;
}
.audio-visualizer-bars .bar {
    width: 2px;
    height: 3px;
    background-color: #34d399;
    border-radius: 1px;
    transition: height 0.2s ease;
}
.audio-visualizer-bars.playing .bar {
    animation: bounce 0.8s ease infinite alternate;
}
.audio-visualizer-bars.playing .bar:nth-child(2) { animation-delay: 0.1s; }
.audio-visualizer-bars.playing .bar:nth-child(3) { animation-delay: 0.3s; }
.audio-visualizer-bars.playing .bar:nth-child(4) { animation-delay: 0.2s; }
.audio-visualizer-bars.playing .bar:nth-child(5) { animation-delay: 0.4s; }
.audio-visualizer-bars.playing .bar:nth-child(6) { animation-delay: 0.15s; }
.audio-visualizer-bars.playing .bar:nth-child(7) { animation-delay: 0.35s; }
.audio-visualizer-bars.playing .bar:nth-child(8) { animation-delay: 0.25s; }

@keyframes bounce {
    0% { height: 3px; }
    100% { height: 14px; }
}

/* Right Panel: Chat styling overrides for dedicated page */
body.wellbeing-page-body .wellbeing-avatar-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

body.wellbeing-page-body .persona-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 0.7rem 0.3rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    opacity: 0.65;
}
body.wellbeing-page-body .persona-card:hover {
    transform: translateY(-2px);
    opacity: 0.9;
    border-color: rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.03);
}
body.wellbeing-page-body .persona-card.active {
    opacity: 1;
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.08);
    box-shadow: 0 4px 16px -5px rgba(16, 185, 129, 0.25);
}

.wellbeing-right-panel .wellbeing-avatar-section {
    padding: 1.25rem 0;
}

.wellbeing-right-panel .wellbeing-chat-box {
    height: 300px;
    background: rgba(8, 10, 14, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    border-radius: 16px;
    padding: 1rem;
    overflow-y: auto;
}

/* Chat bubbled styles */
body.wellbeing-page-body .chat-msg {
    border-radius: 16px;
    padding: 0.8rem 1rem;
    font-size: 0.88rem;
    line-height: 1.5;
    max-width: 85%;
    width: auto;
}
body.wellbeing-page-body .chat-msg.ai {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    align-self: flex-start;
}
body.wellbeing-page-body .chat-msg.user {
    background: linear-gradient(135deg, #10b981, #7C3AED);
    color: #ffffff;
    align-self: flex-end;
}
body.wellbeing-page-body .chat-ai-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
    color: #10b981;
}

/* Chat Input Overrides */
body.wellbeing-page-body .chat-input-row {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

body.wellbeing-page-body input[type="text"]#wellbeing-input {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: #f0f4f8;
    border-radius: 12px;
    padding: 0.7rem 1rem;
    outline: none;
    font-family: 'Outfit', sans-serif;
    transition: all 0.25s ease;
}
body.wellbeing-page-body input[type="text"]#wellbeing-input:focus {
    border-color: #10b981;
    background: rgba(255, 255, 255, 0.06);
}

body.wellbeing-page-body .chat-send-btn {
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}
body.wellbeing-page-body .chat-send-btn:hover {
    transform: scale(1.05);
}

/* Speech controller custom iOS toggle switch */
.wellbeing-speech-control {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

.speech-toggle-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    gap: 0.65rem;
    user-select: none;
    font-size: 0.82rem;
    color: #94a3b8 !important;
}

.speech-toggle-label input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.speech-toggle-slider {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.speech-toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: #f8fafc;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.speech-toggle-label input:checked + .speech-toggle-slider {
    background-color: #10b981;
}

.speech-toggle-label input:checked + .speech-toggle-slider:before {
    transform: translateX(14px);
}

.speech-toggle-text {
    font-weight: 500;
}

/* Scrollbar customization */
body.wellbeing-page-body .wellbeing-chat-box::-webkit-scrollbar {
    width: 6px;
}
body.wellbeing-page-body .wellbeing-chat-box::-webkit-scrollbar-track {
    background: transparent;
}
body.wellbeing-page-body .wellbeing-chat-box::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
body.wellbeing-page-body .wellbeing-chat-box::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Ensure emergency lockdown overlays properly on dark wellbeing page */
body.wellbeing-page-body .emergency-lockdown-overlay {
    background: rgba(10, 11, 14, 0.95) !important;
}
body.wellbeing-page-body .lockdown-card {
    background: #121419 !important;
    border: 1px solid rgba(239, 68, 68, 0.25) !important;
    color: #f8fafc !important;
}
body.wellbeing-page-body .lockdown-contacts .primary-btn {
    color: #ffffff !important;
    margin-top: 0 !important;
    width: 100% !important;
}

/* Sound category chips styling */
body.wellbeing-page-body .sound-category-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 0.9rem;
    width: 100%;
}

body.wellbeing-page-body .sound-cat-chip {
    flex: 1;
    text-align: center;
    font-size: 0.74rem;
    font-weight: 700;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(255, 255, 255, 0.03) !important;
    color: #94a3b8 !important;
    padding: 0.45rem 0.35rem;
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
    font-family: 'Outfit', sans-serif;
}

body.wellbeing-page-body .sound-cat-chip:hover {
    color: #f8fafc !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

body.wellbeing-page-body .sound-cat-chip.active {
    color: #34d399 !important;
    background: rgba(16, 185, 129, 0.12) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

/* =========================================================================
   FORM CONTROLS UI/UX UPGRADE (Age Spinner, Gender picker, Quick tags)
   ========================================================================= */

/* 1. Age Dropdown Styles */
.custom-select-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    z-index: 20;
    transition: transform 0.4s ease-in-out;
}

.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 1rem 1.2rem;
    color: var(--text-primary);
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02) inset;
    user-select: none;
    width: 100%;
    box-sizing: border-box;
}

.custom-select-trigger:active {
    transform: scale(0.96);
}

.custom-select-trigger:focus-visible {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 10px 20px rgba(var(--primary-color-rgb), 0.05), 0 0 0 4px rgba(var(--primary-color-rgb), 0.15);
    transform: translateY(-2px);
}

.custom-select-trigger span.placeholder {
    color: var(--text-secondary);
}

.custom-select-trigger i {
    font-size: 1.25rem;
    color: var(--text-secondary);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Open/Active Focus States */
.custom-select-wrapper.open .custom-select-trigger {
    border-color: var(--primary-color);
    box-shadow: 0 10px 20px rgba(var(--primary-color-rgb), 0.05), 0 0 0 4px rgba(var(--primary-color-rgb), 0.15);
    transform: translateY(-2px);
}

.custom-select-wrapper.open .custom-select-trigger i {
    transform: rotate(180deg);
}

/* Options Container styling */
.custom-options-container {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    min-width: 120px;
    max-height: 220px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 16px -8px rgba(0, 0, 0, 0.08);
    z-index: 100;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    pointer-events: none;
    transform-origin: top center;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-select-wrapper.open .custom-options-container {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Options Items */
.custom-option {
    padding: 0.75rem 1.2rem;
    font-size: 1rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    user-select: none;
}

.custom-option:first-child {
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
}

.custom-option:last-child {
    border-bottom-left-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
}

.custom-option:hover,
.custom-option.hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.custom-option.selected {
    background: rgba(var(--primary-color-rgb), 0.08);
    color: var(--primary-color);
    font-weight: 700;
}

/* Custom Scrollbar */
.custom-options-container::-webkit-scrollbar {
    width: 6px;
}
.custom-options-container::-webkit-scrollbar-track {
    background: transparent;
}
.custom-options-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.custom-options-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Visual Hidden Class for native select */
.hidden-select {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Invalid / Shake States */
@keyframes select-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.custom-select-wrapper.invalid-shake {
    animation: select-shake 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.custom-select-wrapper.invalid .custom-select-trigger {
    border-color: var(--error-color, #f43f5e) !important;
    box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.1);
}

/* Dark Mode Overrides */
[data-theme="dark"] .custom-select-trigger {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .custom-select-trigger:focus-visible {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(var(--primary-color-rgb), 0.15), 0 2px 4px rgba(0, 0, 0, 0.1) inset;
    transform: translateY(-2px);
}

[data-theme="dark"] .custom-select-trigger span.placeholder {
    color: #94a3b8;
}

[data-theme="dark"] .custom-select-trigger i {
    color: #94a3b8;
}

[data-theme="dark"] .custom-select-wrapper.open .custom-select-trigger {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(var(--primary-color-rgb), 0.15), 0 2px 4px rgba(0, 0, 0, 0.1) inset;
}

[data-theme="dark"] .custom-options-container {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), 0 5px 15px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .custom-option {
    color: #e2e8f0;
}

[data-theme="dark"] .custom-option:hover,
[data-theme="dark"] .custom-option.hover {
    background: #334155;
    color: var(--primary-color);
}

[data-theme="dark"] .custom-option.selected {
    background: rgba(var(--primary-color-rgb), 0.12);
    color: var(--primary-color);
}

[data-theme="dark"] .custom-options-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .custom-options-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}


/* 2. Gender Picker Styles */
.gender-picker-container {
    width: 100%;
}

.gender-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.gender-btn {
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    background: var(--bg-glass);
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .gender-btn {
    background: rgba(30, 41, 59, 0.6);
    border-color: #334155;
    color: #94a3b8;
}

.gender-btn i {
    font-size: 1.1rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

[data-theme="dark"] .gender-btn i {
    color: #94a3b8;
}

.gender-btn:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
    background: rgba(var(--primary-color-rgb), 0.04);
}

[data-theme="dark"] .gender-btn:hover {
    background: rgba(var(--primary-color-rgb), 0.04);
    border-color: #818CF8;
    color: #f8fafc;
}

.gender-btn.active {
    background: rgba(var(--primary-color-rgb), 0.08);
    color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color), 0 4px 15px rgba(var(--primary-color-rgb), 0.15);
    font-weight: 700;
}

.gender-btn.active i {
    color: var(--primary-color);
}

[data-theme="dark"] .gender-btn.active {
    background: rgba(var(--primary-color-rgb), 0.12);
    color: #818CF8;
    border-color: #818CF8;
    box-shadow: 0 0 0 1px #818CF8, 0 4px 15px rgba(var(--primary-color-rgb), 0.2);
}

[data-theme="dark"] .gender-btn.active i {
    color: #818CF8;
}


/* 3. Symptoms Quick Tags & Char Counter Styles */
.symptom-extra-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 0.6rem;
    width: 100%;
}

.symptom-quick-tags {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.quick-tag-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 0.2rem;
}

.symptom-tag {
    padding: 0.3rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--border-glass);
    background: var(--bg-glass);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .symptom-tag {
    background: rgba(30, 41, 59, 0.6);
    border-color: #334155;
    color: #94a3b8;
}

.symptom-tag:hover {
    background: rgba(var(--primary-color-rgb), 0.08);
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

[data-theme="dark"] .symptom-tag:hover {
    background: rgba(var(--primary-color-rgb), 0.12);
    color: #818CF8;
    border-color: #818CF8;
}

.symptom-tag:active {
    transform: translateY(0);
}

.symptom-char-counter {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

@media (max-width: 600px) {
    .gender-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }
}



/* ===================================== */
/* LEGAL PAGES (TERMS & PRIVACY)         */
/* ===================================== */

.legal-container {
    max-width: 1100px;
    margin: 2rem auto 4rem;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2.5rem;
    align-items: start;
    box-sizing: border-box;
}

@media (max-width: 900px) {
    .legal-container {
        grid-template-columns: 1fr;
        margin-top: 1rem;
        gap: 1.5rem;
    }
    
    .legal-sidebar {
        position: static !important;
        width: 100% !important;
    }
}

.legal-sidebar {
    position: sticky;
    top: 90px;
    background: var(--card-bg);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

[data-theme="dark"] .legal-sidebar {
    background: rgba(13, 21, 39, 0.8);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.legal-sidebar h3 {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-glass);
}

.legal-toc {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
}

.toc-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.toc-link i {
    font-size: 1.1rem;
}

.toc-link:hover {
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.05);
}

[data-theme="dark"] .toc-link:hover {
    background: rgba(var(--primary-color-rgb), 0.06);
}

.toc-link.active {
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.08);
    font-weight: 700;
}

[data-theme="dark"] .toc-link.active {
    color: #818CF8;
    background: rgba(var(--primary-color-rgb), 0.12);
}

.legal-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.legal-section {
    padding: 2.25rem;
    border-radius: 20px;
    text-align: left;
    scroll-margin-top: 100px;
    transition: all 0.3s ease;
}

.nav-btn,
.icon-btn {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 0.6rem 1rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(255, 255, 255, 0.7);
}

.nav-btn:hover,
.icon-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px) scale(1.02);
}

.nav-btn:active,
.icon-btn:active {
    transform: translateY(0) scale(0.95);
}

.legal-section h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 1.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.75rem;
}

.legal-section h2 i {
    color: var(--primary-color);
}

.legal-section p {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-secondary);
    margin: 0 0 1.2rem 0;
}

.legal-section p:last-child {
    margin-bottom: 0;
}

.legal-section h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 1.5rem 0 0.5rem 0;
}

.legal-section strong {
    color: var(--text-primary);
}

.legal-section p strong {
    font-weight: 700;
}

/* ===================================== */
/* POST-REPORT SUCCESS MODAL & TOOLKIT   */
/* ===================================== */
.report-success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200000;
    padding: 1.5rem;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
    opacity: 1;
    visibility: visible;
}

.report-success-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.success-modal-card {
    max-width: 440px;
    width: 100%;
    padding: 2.5rem 2rem;
    border-radius: 24px;
    background: var(--bg-glass);
    border: 1px solid rgba(var(--primary-color-rgb), 0.25);
    box-shadow: 0 25px 55px -10px rgba(var(--primary-color-rgb), 0.2), 0 0 0 1px rgba(var(--primary-color-rgb), 0.08);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: max-width 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    animation: zoomInSuccessModal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

[data-theme="dark"] .success-modal-card {
    border-color: rgba(var(--primary-color-rgb), 0.35);
    box-shadow: 0 30px 65px -15px rgba(0, 0, 0, 0.6), 0 0 40px rgba(var(--primary-color-rgb), 0.12);
}

/* Shrinking progress bar at the top of the modal */
.modal-countdown-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 4.5px;
    background: linear-gradient(90deg, var(--primary-color), #8b5cf6);
    width: 100%;
    transform-origin: left;
    z-index: 10;
    transition: transform 5000ms linear;
    transform: scaleX(1);
}

/* Countdown warning label */
.auto-dismiss-notice {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 0.65rem;
    opacity: 0.75;
    letter-spacing: 0.2px;
}

@keyframes zoomInSuccessModal {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Close Button */
.success-modal-card .modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
}

[data-theme="dark"] .success-modal-card .modal-close-btn {
    background: rgba(255, 255, 255, 0.05);
}

.success-modal-card .modal-close-btn:hover {
    background: var(--error-color);
    color: white;
    transform: rotate(90deg);
}

/* Success View Content */
.success-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.success-view.hidden {
    display: none !important;
    opacity: 0;
    transform: scale(0.95);
}

.success-icon-wrapper {
    position: relative;
    width: 76px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-icon {
    font-size: 3.8rem;
    color: #10b981;
    z-index: 2;
    filter: drop-shadow(0 4px 10px rgba(16, 185, 129, 0.3));
    animation: popIcon 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.success-pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.15);
    z-index: 1;
    animation: successPulse 2s infinite ease-out;
}

@keyframes popIcon {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

@keyframes successPulse {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.success-modal-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.success-description {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
    max-width: 380px;
    margin: 0;
}

/* Try Now glowing button */
.try-now-btn {
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    color: white;
    border: none;
    padding: 0.85rem 2.2rem;
    border-radius: 50px;
    font-size: 1.02rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    animation: tryNowGlow 2s infinite ease-in-out;
    box-shadow: 0 10px 25px -5px rgba(var(--primary-color-rgb), 0.4);
}

.try-now-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 15px 30px -5px rgba(var(--primary-color-rgb), 0.6);
    filter: brightness(1.1);
}

.try-now-btn:active {
    transform: translateY(0) scale(0.98);
}

@keyframes tryNowGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0.6), 0 10px 25px -5px rgba(var(--primary-color-rgb), 0.4);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(var(--primary-color-rgb), 0), 0 10px 25px -5px rgba(var(--primary-color-rgb), 0.4);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0), 0 10px 25px -5px rgba(var(--primary-color-rgb), 0.4);
    }
}

/* Recommendations View */
.recommendations-view {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    animation: fadeInRecommendations 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.recommendations-view.hidden {
    display: none !important;
    opacity: 0;
    transform: scale(0.95);
}

@keyframes fadeInRecommendations {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.recommendations-view h3 {
    font-size: 1.4rem;
    font-weight: 850;
    color: var(--text-primary);
    margin: 0;
    text-align: center;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.65rem;
}

.recommendations-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
    text-align: center;
}

/* Cards Grid */
.recommendations-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.recommendation-card {
    display: flex;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid var(--border-glass);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    align-items: center;
}

[data-theme="dark"] .recommendation-card {
    background: rgba(15, 23, 42, 0.45);
}

.recommendation-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(var(--primary-color-rgb), 0.4);
    box-shadow: 0 8px 16px -6px rgba(var(--primary-color-rgb), 0.15);
}

[data-theme="dark"] .recommendation-card:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(var(--primary-color-rgb), 0.4);
    box-shadow: 0 8px 16px -6px rgba(0, 0, 0, 0.3);
}

/* Icon Box styles */
.rec-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.rec-icon-box.wellbeing {
    background: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
}
.rec-icon-box.quiz {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}
.rec-icon-box.awareness {
    background: rgba(244, 63, 94, 0.1);
    color: #f43f5e;
}

/* Details and Actions */
.rec-details {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex-grow: 1;
}

.rec-details h4 {
    font-size: 0.98rem;
    font-weight: 750;
    color: var(--text-primary);
    margin: 0;
}

.rec-details p {
    font-size: 0.82rem;
    line-height: 1.35;
    color: var(--text-secondary);
    margin: 0 0 0.35rem 0;
}

.rec-action-btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 0.3rem 0;
    border-bottom: 1.5px solid transparent;
}

.rec-action-btn:hover {
    color: var(--primary-hover);
    border-bottom-color: currentColor;
    transform: translateX(2px);
}

/* Highlighted Action Button style */
.rec-action-btn.highlighted-glow-btn {
    color: white;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    padding: 0.4rem 1rem;
    border-radius: 30px;
    border: none;
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.25);
    animation: buttonSoftPulse 2.5s infinite ease-in-out;
    font-size: 0.8rem;
}

.rec-action-btn.highlighted-glow-btn:hover {
    transform: translateY(-1px) translateX(2px);
    box-shadow: 0 6px 16px rgba(var(--primary-color-rgb), 0.4);
    border-bottom-color: transparent;
    filter: brightness(1.08);
}

@keyframes buttonSoftPulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.25);
    }
    50% {
        box-shadow: 0 4px 18px rgba(var(--primary-color-rgb), 0.45);
    }
}

/* Critical Danger Overlay (Category A) */
.emergency-danger-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 10, 18, 0.93);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.emergency-danger-card {
    max-width: 500px;
    width: 100%;
    background: rgba(239, 68, 68, 0.03);
    border: 1px solid rgba(239, 68, 68, 0.25);
    box-shadow: 0 25px 60px -10px rgba(239, 68, 68, 0.25);
    border-radius: 24px;
    padding: 2.2rem;
    text-align: center;
    animation: scaleUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
    position: relative;
    overflow: hidden;
}
[data-theme="dark"] .emergency-danger-card {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.3);
}
.emergency-danger-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #ef4444, #f43f5e);
}
.danger-icon-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin: 0 auto 1.5rem;
    animation: dangerPulse 2s infinite ease-in-out;
}
.emergency-danger-card h2 {
    font-size: 1.35rem;
    font-weight: 850;
    color: var(--text-primary);
    margin-bottom: 0.8rem;
    line-height: 1.3;
}
.emergency-danger-card p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.8rem;
}
.danger-contacts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-bottom: 1rem;
}
.danger-contact-btn {
    background: linear-gradient(135deg, #ef4444, #f43f5e);
    color: white !important;
    font-weight: 700;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 0.9rem;
}
.danger-contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
    filter: brightness(1.05);
}
.danger-contact-btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary) !important;
    border: 1px solid var(--border-glass);
}
.danger-contact-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}
@keyframes dangerPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Symptom Validation Warning Box (Categories B and C) */
.symptom-warning-box {
    margin: 1.2rem 0;
    padding: 1.2rem;
    border-radius: 14px;
    animation: slideDownFade 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    position: relative;
    overflow: hidden;
}
.symptom-warning-box::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
}
/* Category B - Off-Topic style */
.symptom-warning-box.off-topic {
    background: rgba(var(--primary-color-rgb), 0.04);
    border: 1px solid rgba(var(--primary-color-rgb), 0.15);
}
.symptom-warning-box.off-topic::before {
    background: var(--primary-color);
}
/* Category C - Vague style */
.symptom-warning-box.vague {
    background: rgba(245, 158, 11, 0.04);
    border: 1px solid rgba(245, 158, 11, 0.15);
}
.symptom-warning-box.vague::before {
    background: var(--warning-color);
}
/* Category A - Dangerous style */
.symptom-warning-box.dangerous {
    background: rgba(239, 68, 68, 0.04);
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.symptom-warning-box.dangerous::before {
    background: #ef4444;
}
.warning-box-title {
    font-size: 0.92rem;
    font-weight: 750;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.symptom-warning-box.off-topic .warning-box-title {
    color: var(--primary-color);
}
.symptom-warning-box.vague .warning-box-title {
    color: var(--warning-color);
}
.symptom-warning-box.dangerous .warning-box-title {
    color: #ef4444;
}
.warning-box-message {
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}
.warning-box-action {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.2rem;
}
.warning-box-btn {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 0.35rem 0.8rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.warning-box-btn:hover {
    border-color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.04);
}

/* Footer Feedback Form Styling */
.footer-feedback-container {
    width: 100%;
    max-width: 500px;
    margin: 1.5rem auto 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    text-align: left;
    backdrop-filter: blur(8px);
}
.footer-feedback-container h4 {
    margin: 0 0 0.8rem 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}
.footer-feedback-form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
.feedback-inputs-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}
.feedback-inputs-row input,
.feedback-textarea-wrapper textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0.65rem 0.8rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
    font-family: inherit;
}
.feedback-textarea-wrapper textarea {
    resize: vertical;
    min-height: 70px;
}
.feedback-inputs-row input:focus,
.feedback-textarea-wrapper textarea:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.03);
    outline: none;
}
.feedback-rating-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
}
.rating-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}
.feedback-stars {
    display: flex;
    gap: 0.25rem;
}
.star-btn {
    cursor: pointer;
    font-size: 1.15rem;
    color: var(--text-secondary);
    transition: all 0.15s ease;
}
.star-btn:hover,
.star-btn.active {
    color: #f59e0b;
    transform: scale(1.15);
}
.feedback-submit-btn {
    background: var(--primary-color);
    color: white;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    padding: 0.55rem 1.1rem;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}
.feedback-submit-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}
.feedback-submit-btn:active {
    transform: scale(0.96);
}
.feedback-success-msg {
    font-size: 0.85rem;
    color: var(--success-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0.5rem 0 0 0;
    animation: fadeIn 0.3s ease both;
}

/* Vitals Option Input styling */
.vitals-note-group {
    margin-top: -0.6rem;
    margin-bottom: 0.2rem;
}

.vitals-ux-note {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    background: rgba(0, 0, 0, 0.02);
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    border-left: 2px solid var(--primary-color);
}

[data-theme="dark"] .vitals-ux-note {
    background: rgba(255, 255, 255, 0.02);
}

/* Form Corner FAQ button styling */
.form-faq-corner-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-glass);
    color: var(--primary-color);
    border: 1px solid var(--border-glass);
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.08);
}

.form-faq-corner-btn:hover {
    transform: translateY(-2px) scale(1.08);
    background: var(--card-bg);
    border-color: var(--primary-hover);
    color: var(--primary-hover);
    box-shadow: 0 6px 16px rgba(var(--primary-color-rgb), 0.18);
}

.form-faq-corner-btn:active {
    transform: scale(0.95);
}

[data-theme="dark"] .form-faq-corner-btn {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(var(--primary-color-rgb), 0.25);
    color: #818CF8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .form-faq-corner-btn:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 6px 16px rgba(var(--primary-color-rgb), 0.25);
}

@media (max-width: 768px) {
    .form-faq-corner-btn {
        top: 1rem;
        right: 1rem;
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }
}


/* ===================================== */
/* ACCESSIBILITY & FOCUS SYSTEMS         */
/* ===================================== */

/* Skip to content link (if present) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 0;
}

/* Accessible focus visible outlines */
a:focus-visible, 
button:focus-visible, 
input:focus-visible, 
select:focus-visible, 
textarea:focus-visible,
[role="button"]:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Ensure cursor-pointer on all clickables */
a, 
button, 
select, 
input[type="submit"], 
input[type="button"], 
input[type="checkbox"], 
input[type="radio"],
.gender-btn,
.preset-tag,
.symptom-tag,
.body-region,
.floating-chat-toggle,
.star-btn {
    cursor: pointer;
}

/* Hide mobile floating SOS by default on desktop */
.mobile-floating-sos {
    display: none !important;
}

/* Respect user's prefers-reduced-motion setting */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-delay: -1ms !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        background-attachment: initial !important;
        scroll-behavior: auto !important;
        transition-duration: 0s !important;
        transition-delay: 0s !important;
    }
}

/* ==========================================================================
   SIRONA AI - CLINICAL SOAP NOTE & EMR REPORT COMPONENTS
   ========================================================================== */

.emr-soap-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    text-align: left;
}

@media (max-width: 768px) {
    .emr-soap-summary {
        grid-template-columns: 1fr;
    }
}

.emr-soap-card {
    background: rgba(var(--primary-color-rgb), 0.02);
    border: 1px solid var(--border-glass);
    border-left: 5px solid var(--primary-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.01);
    transition: all 0.3s ease;
}

.emr-soap-card h4 {
    margin: 0 0 0.8rem 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary-hover);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.emr-soap-card p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Vital flag badges */
.vital-flag-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.15);
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.05);
}

[data-theme="dark"] .emr-soap-card {
    background: rgba(30, 41, 59, 0.4);
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.2);
}

/* EMR Tables styling */
.table-scroll-wrapper {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid var(--border-glass);
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .table-scroll-wrapper {
    background: rgba(15, 23, 42, 0.2);
}

.clinical-emr-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.clinical-emr-table th,
.clinical-emr-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-glass);
    vertical-align: middle;
}

.clinical-emr-table th {
    background: rgba(var(--primary-color-rgb), 0.05);
    color: var(--text-primary);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 1px;
}

.clinical-emr-table tr:last-child td {
    border-bottom: none;
}

.clinical-emr-table tr:hover td {
    background: rgba(var(--primary-color-rgb), 0.01);
}

[data-theme="dark"] .clinical-emr-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* DDx Table Specifics */
.emr-cell-condition {
    color: var(--primary-hover);
    font-size: 1rem;
}

.emr-cell-reasoning p {
    line-height: 1.5;
}

/* Likelihood progress bar */
.emr-progress-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.emr-progress-bar {
    height: 8px;
    border-radius: 10px;
    flex: 1;
    background: var(--border-glass);
    position: relative;
    overflow: hidden;
}

.emr-progress-text {
    font-size: 0.85rem;
    font-weight: 800;
    min-width: 38px;
    text-align: right;
    color: var(--text-primary);
}

/* Pathophysiology summary box */
.emr-pathophysiology {
    background: rgba(var(--primary-color-rgb), 0.015);
    border: 1px dashed var(--border-glass);
    border-radius: 12px;
    padding: 1.2rem;
    margin-top: 1rem;
    text-align: left;
}

.emr-pathophysiology h5 {
    margin: 0 0 0.5rem 0;
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.emr-pathophysiology p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Therapeutics Prescription table specifics */
.emr-cell-med {
    color: var(--primary-hover);
    font-size: 1rem;
}

.emr-cell-warnings {
    color: #ef4444 !important;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Plan grid for ordered workup and red flags */
.emr-plan-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

@media (max-width: 768px) {
    .emr-plan-grid {
        grid-template-columns: 1fr;
    }
}

.emr-checklist-card,
.emr-red-flags-card {
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.5rem;
}

.emr-checklist-card {
    background: rgba(59, 130, 246, 0.02);
}

.emr-red-flags-card {
    background: rgba(239, 68, 68, 0.02);
    border-color: rgba(239, 68, 68, 0.15);
}

.emr-checklist-card h4,
.emr-red-flags-card h4 {
    margin: 0 0 1rem 0;
    font-size: 1.05rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.emr-checklist-card h4 {
    color: #2563eb;
}

.emr-red-flags-card h4 {
    color: #dc2626;
}

[data-theme="dark"] .emr-checklist-card h4 {
    color: #60a5fa;
}

[data-theme="dark"] .emr-red-flags-card h4 {
    color: #f87171;
}

/* Lists styling */
.emr-checklist,
.emr-red-flags-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.emr-checklist li,
.emr-red-flags-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.92rem;
    line-height: 1.5;
}

.emr-checklist li i {
    color: #2563eb;
    margin-top: 0.2rem;
    font-size: 0.95rem;
}

[data-theme="dark"] .emr-checklist li i {
    color: #60a5fa;
}

.emr-red-flags-list li i {
    color: #dc2626;
    margin-top: 0.2rem;
    font-size: 0.95rem;
    animation: pulseRedIcon 1.5s infinite alternate ease-in-out;
}

[data-theme="dark"] .emr-red-flags-list li i {
    color: #f87171;
}

@keyframes pulseRedIcon {
    from { opacity: 0.5; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1.1); }
}

/* Prognosis timelines */
.emr-prognosis-box {
    background: rgba(var(--primary-color-rgb), 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: left;
}

.emr-prognosis-box h4 {
    margin: 0 0 0.6rem 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary-hover);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.emr-prognosis-box p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text-primary);
}

/* MyHealthfinder Recommendations Panel */
.myhealthfinder-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-glass);
}

.myhealthfinder-section h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.healthfinder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.healthfinder-card {
    background: var(--card-bg);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    gap: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.healthfinder-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 15px -3px rgba(8, 145, 178, 0.1), 0 4px 6px -2px rgba(8, 145, 178, 0.05);
}

.healthfinder-badge-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.healthfinder-badge {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary-color);
    background: rgba(8, 145, 178, 0.08);
    padding: 4px 10px;
    border-radius: 12px;
}

[data-theme="dark"] .healthfinder-badge {
    background: rgba(8, 145, 178, 0.15);
    color: #22d3ee;
}

.healthfinder-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    margin: 0;
    flex-grow: 1;
}

.healthfinder-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: white !important;
    background: var(--primary-color);
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
    width: 100%;
    justify-content: center;
}

.healthfinder-link-btn:hover {
    background: var(--primary-hover);
}

.healthfinder-link-btn:active {
    transform: scale(0.98);
}

