/* ============================================
   HOMEOPATHIC REMEDY FINDER — PREMIUM REDESIGN
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:wght@600;700&display=swap');

/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
    /* Brand Colors */
    --primary: #1a6b4a;
    --primary-dark: #104232;
    --primary-mid: #2d8560;
    --primary-light: #3aaa7a;
    --accent: #52c78a;
    --accent-pale: #b7e4c7;
    --accent-faint: #e8f5ee;

    /* Neutrals */
    --bg: #f0f7f4;
    --surface: #ffffff;
    --surface-2: #f7faf8;
    --border: #d4ead8;
    --border-light: #e9f5ec;

    /* Text */
    --text: #0f2219;
    --text-mid: #2e4d39;
    --text-muted: #607a6a;
    --text-light: #8fa99a;

    /* Semantic */
    --gold: #c9a227;
    --gold-light: #fdf3d0;
    --warn: #d97706;
    --warn-light: #fff7ed;
    --blue: #1d6fa4;
    --blue-light: #e0f0fb;
    --purple: #6d3fa0;
    --purple-light: #f3edf9;
    --rose: #c0405c;
    --rose-light: #fdedf0;

    /* Sidebar */
    --sidebar-w: 260px;
    --sidebar-bg: #0d3324;
    --sidebar-hover: #1a5238;
    --sidebar-active: #22693f;
    --sidebar-text: rgba(255, 255, 255, 0.85);
    --sidebar-muted: rgba(255, 255, 255, 0.45);
    --sidebar-border: rgba(255, 255, 255, 0.08);

    /* Topbar */
    --topbar-h: 64px;

    /* Shadows */
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.07);
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.09);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.16);

    /* Radii */
    --r-sm: 6px;
    --r: 10px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-xl: 28px;

    /* Transitions */
    --t: 0.22s ease;
    --t-slow: 0.4s ease;
}

/* ============================================
   RESET & BASE
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ============================================
   APP LAYOUT — SIDEBAR + MAIN
   ============================================ */
.app-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 200;
    transition: transform var(--t-slow), width var(--t-slow);
    overflow: hidden;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
}

.sidebar-header {
    padding: 1.5rem 1.25rem 1rem;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
    box-shadow: none;
    color: var(--accent);
}

.sidebar-logo-icon svg {
    width: 30px;
    height: 30px;
    stroke-width: 2.2px;
}

.sidebar-logo-text {
    display: flex;
    flex-direction: column;
}

.sidebar-logo-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.sidebar-logo-sub {
    font-size: 0.75rem;
    color: var(--sidebar-muted);
    font-weight: 400;
    margin-top: 0.15rem;
}

/* Nav */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0;
    scrollbar-width: thin;
    scrollbar-color: var(--sidebar-hover) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--sidebar-hover);
    border-radius: 99px;
}

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sidebar-muted);
    padding: 1rem 1.25rem 0.35rem;
}

.nav-item {
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.68rem 1.25rem;
    text-decoration: none;
    color: var(--sidebar-text);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0;
    cursor: pointer;
    transition: background var(--t), color var(--t);
    position: relative;
    user-select: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.nav-link.active {
    background: var(--sidebar-active);
    color: #fff;
    font-weight: 600;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 2px;
}

.nav-label {
    flex: 1;
}

.nav-badge {
    font-size: 0.6rem;
    font-weight: 700;
    background: var(--accent);
    color: var(--primary-dark);
    padding: 0.1em 0.5em;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Subcategory accordion */
.nav-chevron {
    font-size: 0.7rem;
    transition: transform var(--t);
    color: var(--sidebar-muted);
    margin-left: auto;
    flex-shrink: 0;
}

.nav-item.open>.nav-link .nav-chevron {
    transform: rotate(90deg);
}

.nav-sub {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.15);
}

.nav-item.open .nav-sub {
    max-height: 500px;
}

.nav-sub-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem 0.5rem 3rem;
    text-decoration: none;
    color: var(--sidebar-muted);
    font-size: 0.8rem;
    font-weight: 400;
    cursor: pointer;
    transition: color var(--t), background var(--t);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.nav-sub-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

/* Sidebar footer */
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-version {
    font-size: 0.7rem;
    color: var(--sidebar-muted);
    text-align: center;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--t-slow);
}

/* ============================================
   TOPBAR WITH SEARCH
   ============================================ */
.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.topbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-mid);
    font-size: 1.3rem;
    padding: 0.4rem;
    border-radius: var(--r-sm);
    transition: background var(--t);
    flex-shrink: 0;
}

.topbar-toggle:hover {
    background: var(--accent-faint);
}

.topbar-search-wrap {
    flex: 1;
    max-width: 560px;
    position: relative;
}

.topbar-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-mid);
    font-size: 1rem;
    pointer-events: none;
}

.topbar-search {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.75rem;
    border: 2px solid var(--primary-light);
    border-radius: var(--r-xl);
    background: var(--surface);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text);
    transition: border-color var(--t), box-shadow var(--t), background var(--t);
    outline: none;
    box-shadow: 0 2px 8px rgba(26, 107, 74, 0.06);
}

.topbar-search::placeholder {
    color: var(--text-light);
}

.topbar-search:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(26, 107, 74, 0.12);
}

.topbar-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
    max-height: 380px;
    overflow-y: auto;
    display: none;
    z-index: 300;
}

.topbar-search-results.show {
    display: block;
}

.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--t);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--accent-faint);
}

.search-result-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.search-result-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--primary);
}

.search-result-sub {
    font-size: 0.77rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.search-result-tag {
    font-size: 0.65rem;
    background: var(--accent-pale);
    color: var(--primary);
    padding: 0.15em 0.5em;
    border-radius: 99px;
    font-weight: 600;
    margin-left: auto;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
}

.search-no-results {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.topbar-spacer {
    flex: 1;
}

.topbar-pills {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.topbar-pill {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 0.3rem 0.75rem;
    border-radius: 99px;
    white-space: nowrap;
}

/* ============================================
   PAGE CONTENT
   ============================================ */
.page-content {
    flex: 1;
    padding: 2rem;
}

.medical-notice {
    margin: 0 0 1.5rem;
    padding: 1rem 1.25rem;
    border: 1px solid #e8c978;
    border-left: 4px solid #b7791f;
    border-radius: var(--r);
    background: #fff9e8;
    color: #493a1b;
    font-size: 0.88rem;
    line-height: 1.6;
}

.medical-notice strong {
    display: block;
    margin-bottom: 0.2rem;
    color: #694b0b;
}

/* Section visibility */
section {
    display: none;
    animation: fadeUp 0.35s ease forwards;
}

section.active {
    display: block;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   HOME — HERO
   ============================================ */
#home {
    display: none;
}

#home.active {
    display: block;
}

.hero {
    background: url('Images/hero-background.png') no-repeat center center;
    background-size: cover;
    border-radius: var(--r-xl);
    padding: 4rem 3rem;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
    color: var(--text);
}

.hero-bg-pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 80% 50%, rgba(82, 199, 138, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 10% 80%, rgba(0, 0, 0, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.hero-botanicals {
    position: absolute;
    right: -40px;
    top: -40px;
    width: 340px;
    height: 340px;
    opacity: 0.04;
    font-size: 280px;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    filter: blur(2px);
}

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 680px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent-faint);
    border: 1px solid var(--accent-pale);
    padding: 0.35rem 1rem;
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.hero-badge-dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.4);
    }
}

.hero h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text);
}

.hero h1 em {
    font-style: normal;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 1.05rem;
    color: var(--text-mid);
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 540px;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.btn-hero-primary {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.85rem 2rem;
    border: none;
    border-radius: var(--r-xl);
    cursor: pointer;
    transition: all var(--t);
    box-shadow: 0 4px 20px rgba(26, 107, 74, 0.25);
    font-family: 'Inter', sans-serif;
}

.btn-hero-primary:hover {
    background: var(--primary-mid);
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(26, 107, 74, 0.35);
}

.btn-hero-outline {
    background: var(--surface);
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.85rem 1.75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--r-xl);
    cursor: pointer;
    transition: all var(--t);
    font-family: 'Inter', sans-serif;
    box-shadow: var(--shadow-sm);
}

.btn-hero-outline:hover {
    background: var(--accent-faint);
    border-color: var(--accent-pale);
    transform: translateY(-2px);
}

.hero-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.hero-stat-num {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.hero-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ============================================
   HOME — FEATURE CARDS
   ============================================ */
.home-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.feature-card {
    background: var(--surface);
    border: 1.5px solid var(--border-light);
    border-radius: var(--r-md);
    padding: 1.75rem;
    transition: transform var(--t), box-shadow var(--t), border-color var(--t);
    cursor: default;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-pale);
}

.feature-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: var(--r);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.feature-icon-wrap.green {
    background: var(--accent-faint);
}

.feature-icon-wrap.blue {
    background: var(--blue-light);
}

.feature-icon-wrap.gold {
    background: var(--gold-light);
}

.feature-icon-wrap.purple {
    background: var(--purple-light);
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.feature-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.feature-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    margin-top: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    font-family: 'Inter', sans-serif;
    transition: gap var(--t);
}

.feature-card-link:hover {
    gap: 0.5rem;
}

/* ============================================
   HOME — QUICK ACCESS SECTION
   ============================================ */
.home-quick-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-mid);
    margin-bottom: 1rem;
}

.home-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.quick-nav-card {
    background: var(--surface);
    border: 1.5px solid var(--border-light);
    border-radius: var(--r-md);
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all var(--t);
    text-decoration: none;
    color: var(--text);
    border: none;
    font-family: 'Inter', sans-serif;
    text-align: left;
    border: 1.5px solid var(--border-light);
}

.quick-nav-card:hover {
    background: var(--accent-faint);
    border-color: var(--accent-pale);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.quick-nav-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.quick-nav-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-mid);
}

/* ============================================
   SECTION SHARED STYLES
   ============================================ */
.section-card {
    background: var(--surface);
    border-radius: var(--r-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1.5px solid var(--border-light);
}

.section-header {
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1.5px solid var(--border-light);
}

.section-header h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.35rem;
}

.section-header p {
    font-size: 0.92rem;
    color: var(--text-muted);
}

#children .section-header {
    background: url('Images/children.png') no-repeat center center;
    background-size: cover;
    padding: 3rem 2rem;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
    text-align: center;
}

#children .section-header h2 {
    justify-content: center;
}

#adolescence .section-header {
    background: url('Images/Adolescent.png') no-repeat center center;
    background-size: cover;
    padding: 3rem 2rem;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
    text-align: center;
}

#adolescence .section-header h2 {
    justify-content: center;
}

#womens .section-header {
    background: url('Images/women.png') no-repeat center center;
    background-size: 100% 100%;
    padding: 3rem 2rem;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
    text-align: center;
}

#womens .section-header h2 {
    justify-content: center;
}

#mens .section-header {
    background: url('Images/men.png') no-repeat center center;
    background-size: 100% 100%;
    padding: 3rem 2rem;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
    text-align: center;
}

#mens .section-header h2 {
    justify-content: center;
}

#materia .materia-header {
    background: url('Images/materia.png') no-repeat center center;
    background-size: 100% 100%;
    padding: 3rem 2rem;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
    text-align: center;
}

#materia .materia-header h2 {
    justify-content: center;
}

#azguide .section-header {
    background: url('Images/atoz.png') no-repeat center center;
    background-size: 100% 100%;
    padding: 3rem 2rem;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
    text-align: center;
}

#azguide .section-header h2 {
    justify-content: center;
}

#laterlife .section-header {
    background: url('Images/old.png') no-repeat center center;
    background-size: 100% 100%;
    padding: 3rem 2rem;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
    text-align: center;
}

#laterlife .section-header h2 {
    justify-content: center;
}

#assess .section-header {
    background: url('Images/assess.png') no-repeat center center;
    background-size: 100% 100%;
    padding: 3rem 2rem;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
    text-align: center;
}

#assess .section-header h2 {
    justify-content: center;
}

#about .section-header {
    background: url('Images/about.png') no-repeat center center;
    background-size: 100% 100%;
    padding: 3rem 2rem;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
    text-align: center;
}

#about .section-header h2 {
    justify-content: center;
    color: var(--primary);
}

#about .section-header p {
    color: var(--text-muted);
}

.assessment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.assessment-card {
    background: var(--surface);
    border: 1.5px solid var(--border-light);
    border-radius: var(--r-md);
    padding: 1.25rem;
}

.assessment-card h3 {
    font-size: 1rem;
    margin-bottom: 0.9rem;
}

.assessment-card ul {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.assessment-card ul li {
    margin-bottom: 0.5rem;
}

/* Section intro banner */
.section-banner {
    border-radius: var(--r-md);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.section-banner.green {
    background: var(--accent-faint);
    border-left: 4px solid var(--accent);
}

.section-banner.blue {
    background: var(--blue-light);
    border-left: 4px solid var(--blue);
}

..section-banner.purple {
    background: var(--purple-light);
    border-left: 4px solid var(--purple);
}

.section-banner.rose {
    background: var(--rose-light);
    border-left: 4px solid var(--rose);
}

.section-banner.gold {
    background: var(--gold-light) url('Images/old.png') no-repeat right center;
    background-size: 140px;
    border-left: 4px solid var(--gold);
}

.section-banner-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.section-banner-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 0.3rem;
}

.section-banner-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ============================================
   AILMENT CARDS (shared: children / adolescence / mens / womens)
   ============================================ */
.ailment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.ailment-card {
    background: var(--surface);
    border: 1.5px solid var(--border-light);
    border-radius: var(--r-md);
    padding: 1.5rem;
    scroll-margin-top: calc(var(--topbar-h) + 1rem);
    transition: transform var(--t), box-shadow var(--t), border-color var(--t);
    position: relative;
    overflow: hidden;
}

.ailment-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--primary-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--t);
}

.ailment-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-pale);
}

.ailment-card:hover::after {
    transform: scaleX(1);
}

.ailment-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.ailment-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.ailment-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.3;
}

/* Symptoms */
.ailment-symptoms-label {
    font-size: 0.73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    margin-bottom: 0.4rem;
    display: block;
}

.ailment-symptoms-list {
    list-style: none;
    margin-bottom: 1rem;
}

.ailment-symptoms-list li {
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 0.18rem 0 0.18rem 1.1rem;
    position: relative;
    line-height: 1.4;
}

.ailment-symptoms-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

/* Psychological symptoms */
.psych-symptoms {
    background: var(--purple-light);
    border-radius: var(--r-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.psych-symptoms .ailment-symptoms-label {
    color: var(--purple);
}

.psych-symptoms li::before {
    color: var(--purple);
}

/* Remedy block */
.ailment-remedy {
    background: var(--accent-faint);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 0.6rem;
}

.remedy-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--primary);
    margin-bottom: 0.2rem;
}

.remedy-dosage {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Better / Worse */
.ailment-bw {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.78rem;
}

.bw-block {
    background: var(--surface-2);
    border-radius: var(--r-sm);
    padding: 0.6rem 0.75rem;
}

.bw-label {
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
    display: block;
}

.bw-better .bw-label {
    color: #16a34a;
}

.bw-worse .bw-label {
    color: #dc2626;
}

.bw-text {
    color: var(--text-muted);
    line-height: 1.4;
    font-size: 0.78rem;
}

/* Self-help tip */
.ailment-selfhelp {
    margin-top: 0.75rem;
    background: var(--gold-light);
    border: 1px solid #e9d180;
    border-radius: var(--r-sm);
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    color: var(--text-mid);
    line-height: 1.5;
}

.ailment-selfhelp strong {
    display: block;
    color: var(--warn);
    margin-bottom: 0.2rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   REMEDY FINDER SECTION
   ============================================ */
#finder {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

#finder.active {
    display: block;
}

.finder-wrapper {
    display: grid;
    gap: 1.5rem;
}

.finder-search-card {
    background: var(--surface);
    border: 1.5px solid var(--border-light);
    border-radius: var(--r-lg);
    padding: 1.75rem;
}

.finder-header {
    background: url('Images/remedy.png') no-repeat center center;
    background-size: 100% 100%;
    padding: 3rem 2rem;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    border: 1.5px solid var(--border-light);
    border-bottom: 1.5px solid var(--border-light);
    margin: -1.75rem -1.75rem 1.5rem;
    text-align: center;
}

.finder-header h2,
.finder-header p {
    margin: 0;
}

.finder-search-card h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 0.35rem;
}

.finder-search-card>p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.finder-input-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.finder-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--r);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--surface-2);
    outline: none;
    transition: border-color var(--t), box-shadow var(--t);
}

.finder-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(82, 199, 138, 0.15);
    background: var(--surface);
}

.finder-input::placeholder {
    color: var(--text-light);
}

.btn-search {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary-light) 100%);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    border-radius: var(--r);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all var(--t);
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(82, 199, 138, 0.3);
}

.btn-search:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(82, 199, 138, 0.4);
}

.finder-tips {
    background: var(--blue-light);
    border-radius: var(--r);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    font-size: 0.82rem;
    color: var(--blue);
    line-height: 1.6;
}

.finder-tips strong {
    font-weight: 700;
}

.finder-tips ul {
    margin: 0.4rem 0 0 1rem;
}

.finder-tips li {
    margin-bottom: 0.2rem;
}

.quick-symptoms-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    display: block;
}

.quick-symptoms {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.symptom-tag {
    background: var(--accent-faint);
    color: var(--primary);
    border: 1px solid var(--accent-pale);
    padding: 0.35rem 0.85rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t);
    font-family: 'Inter', sans-serif;
}

.symptom-tag:hover {
    background: var(--accent);
    color: var(--primary-dark);
    border-color: var(--accent);
    transform: scale(1.04);
}

/* Results */
.results-container {
    margin-top: 0;
}

.results-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.remedy-result {
    background: var(--surface);
    border: 1.5px solid var(--border-light);
    border-radius: var(--r-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all var(--t);
    border-left: 4px solid var(--accent);
}

.remedy-result:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.remedy-result h3 {
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.remedy-result-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 0.75rem;
}

.match-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary-light) 100%);
    color: var(--primary-dark);
    padding: 0.2rem 0.7rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.remedy-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.info-block {
    background: var(--surface-2);
    border: 1px solid var(--border-light);
    border-radius: var(--r-sm);
    padding: 0.75rem 1rem;
}

.info-block-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    margin-bottom: 0.25rem;
    display: block;
}

.info-block-value {
    font-size: 0.85rem;
    color: var(--text-mid);
    line-height: 1.45;
}

/* ============================================
   MATERIA MEDICA
   ============================================ */
#materia {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

#materia.active {
    display: block;
}

.materia-header {
    background: var(--surface);
    border: 1.5px solid var(--border-light);
    border-radius: var(--r-lg);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.materia-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.materia-header>p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.materia-filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding: 0 0.25rem;
}

.search-input {
    padding: 0.65rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--r);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--surface-2);
    outline: none;
    transition: border-color var(--t), box-shadow var(--t);
    flex: 1;
    min-width: 200px;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(82, 199, 138, 0.15);
}

.filter-select {
    padding: 0.65rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--r);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--surface-2);
    outline: none;
    cursor: pointer;
    transition: border-color var(--t);
    min-width: 180px;
}

.filter-select:focus {
    border-color: var(--accent);
}

.az-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.az-letter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.letter-pill {
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    transition: background var(--t), border-color var(--t), color var(--t);
    font-size: 0.82rem;
}

.letter-pill:hover,
.letter-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.az-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.az-card {
    background: linear-gradient(180deg, rgba(236, 249, 243, 0.95), rgba(255, 255, 255, 0.98));
    border: 1px solid rgba(82, 199, 138, 0.22);
    border-radius: var(--r-md);
    padding: 1.5rem;
    box-shadow: 0 18px 40px rgba(28, 88, 56, 0.05);
    transition: transform var(--t), box-shadow var(--t);
}

.az-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 48px rgba(28, 88, 56, 0.12);
}

.az-card-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.az-card-header h3,
.az-card-header h4,
.az-card-header h2 {
    color: var(--primary);
}

.az-card-latin {
    font-size: 0.95rem;
    color: var(--primary-dark);
    margin-top: 0.25rem;
}

.az-card-body ul {
    margin: 0.5rem 0 0 1.1rem;
}

.az-card-footer {
    margin-top: 0.85rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.section-banner.teal {
    background: linear-gradient(135deg, rgba(88, 209, 231, 0.1), rgba(69, 123, 204, 0.08));
    border-color: rgba(88, 209, 231, 0.25);
}

.remedies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.remedy-card {
    background: var(--surface);
    border: 1.5px solid var(--border-light);
    border-radius: var(--r-md);
    padding: 1.5rem;
    transition: transform var(--t), box-shadow var(--t), border-color var(--t);
    cursor: default;
    position: relative;
    overflow: hidden;
    animation: fadeUp 0.3s ease forwards;
}

.remedy-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-pale);
}

.remedy-card-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.15rem;
}

.remedy-card-common {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 0.85rem;
}

.remedy-card-indications {
    background: var(--accent-faint);
    border-radius: var(--r-sm);
    padding: 0.6rem 0.85rem;
    font-size: 0.82rem;
    color: var(--text-mid);
    margin-bottom: 0.85rem;
    line-height: 1.45;
}

.remedy-card-desc {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 0.85rem;
}

.remedy-potency-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.potency-tag {
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary-light) 100%);
    color: var(--primary-dark);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
}

/* ============================================
   DOSAGE GUIDE
   ============================================ */
#dosage {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

#dosage.active {
    display: block;
}

.dosage-wrapper {
    display: grid;
    gap: 1.5rem;
}

.dosage-card {
    background: var(--surface);
    border: 1.5px solid var(--border-light);
    border-radius: var(--r-lg);
    padding: 1.75rem;
}

#dosage .section-header {
    background: url('Images/dosage.png') no-repeat center center;
    background-size: 100% 100%;
    padding: 3rem 2rem;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
    text-align: center;
}

#dosage .section-header h2 {
    justify-content: center;
    color: var(--primary);
}

.dosage-card h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.dosage-card>p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.dosage-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.potency-chart {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.potency-item {
    background: var(--surface-2);
    border: 1.5px solid var(--border-light);
    border-radius: var(--r);
    padding: 1.25rem;
    transition: border-color var(--t), box-shadow var(--t);
}

.potency-item:hover {
    border-color: var(--accent-pale);
    box-shadow: var(--shadow-sm);
}

.potency-item h4 {
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 0.6rem;
    font-weight: 700;
}

.potency-item p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    line-height: 1.5;
}

.dosage-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    border-radius: var(--r);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.dosage-table thead {
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    color: #fff;
}

.dosage-table th,
.dosage-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

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

.dosage-table tbody tr:hover {
    background: var(--accent-faint);
}

.dosage-table tbody td {
    color: var(--text-muted);
}

.dosage-table tbody td:first-child {
    color: var(--text);
    font-weight: 600;
}

.dosage-tips-list {
    list-style: none;
}

.dosage-tips-list li {
    display: flex;
    gap: 0.75rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.dosage-tips-list li:last-child {
    border-bottom: none;
}

.dosage-tips-list li::before {
    content: '✓';
    color: var(--accent);
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.potency-scale {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.scale-item {
    padding: 1.5rem;
    border-radius: var(--r-md);
    text-align: center;
    color: white;
    font-weight: 600;
    transition: transform var(--t);
}

.scale-item:hover {
    transform: translateY(-3px);
}

.scale-item.low {
    background: linear-gradient(135deg, #74c69d 0%, #52b788 100%);
}

.scale-item.medium {
    background: linear-gradient(135deg, #40916c 0%, #2d6a4f 100%);
}

.scale-item.high {
    background: linear-gradient(135deg, #2d6a4f 0%, #1b4332 100%);
}

.scale-item strong {
    display: block;
    font-size: 1.15rem;
    margin-bottom: 0.35rem;
}

.scale-item p {
    font-size: 0.88rem;
    opacity: 0.9;
    margin-bottom: 0.2rem;
}

.scale-item small {
    opacity: 0.75;
    font-size: 0.75rem;
}

/* ============================================
   ABOUT
   ============================================ */
#about {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

#about.active {
    display: block;
}

.about-wrapper {
    background: var(--surface);
    border: 1.5px solid var(--border-light);
    border-radius: var(--r-lg);
    padding: 2rem;
}

.about-wrapper h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.about-wrapper>p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.terms-wrapper {
    display: grid;
    gap: 1rem;
}

.terms-intro,
.terms-item {
    background: var(--surface);
    border: 1.5px solid var(--border-light);
    border-radius: var(--r-md);
    padding: 1.25rem 1.5rem;
}

.terms-intro {
    color: var(--text-mid);
    line-height: 1.6;
}

.terms-item h3 {
    color: var(--primary);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.terms-item p {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.65;
}

.principles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.principle {
    background: var(--accent-faint);
    border: 1.5px solid var(--border-light);
    border-radius: var(--r-md);
    padding: 1.5rem;
}

.principle h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.6rem;
}

.principle p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.disclaimer {
    background: var(--warn-light);
    border: 1.5px solid #fcd34d;
    border-radius: var(--r-md);
    padding: 1.25rem 1.5rem;
}

.disclaimer h3 {
    font-size: 0.95rem;
    color: var(--warn);
    margin-bottom: 0.6rem;
    font-weight: 700;
}

.disclaimer p {
    font-size: 0.85rem;
    color: #92400e;
    line-height: 1.6;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--primary-dark);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 1.25rem 2rem;
    font-size: 0.8rem;
    line-height: 1.7;
    margin-top: auto;
}

.footer a {
    color: var(--accent);
    text-decoration: none;
}

/* ============================================
   OVERLAY (mobile sidebar)
   ============================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 150;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.show {
    display: block;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    display: block;
}

.empty-state p {
    font-size: 0.95rem;
}

/* ============================================
   UTILITY
   ============================================ */
.hidden {
    display: none !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1150px) {
    .topbar-search-wrap {
        max-width: 100%;
    }

    .page-content {
        padding: 1.75rem;
    }

    .section-banner,
    .section-header,
    .finder-search-card,
    .materia-header,
    .az-controls,
    .assessment-card,
    .dosage-card,
    .about-wrapper {
        max-width: 100%;
    }
}

@media (max-width: 900px) {
    :root {
        --sidebar-w: 260px;
    }

    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        z-index: 300;
        width: var(--sidebar-w);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
    }

    .topbar-toggle {
        display: flex;
    }

    .topbar-pills {
        display: none;
    }

    .topbar {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
        flex-wrap: wrap;
        height: auto;
    }

    .topbar-search-wrap {
        width: 100%;
        max-width: 100%;
    }

    .topbar-search {
        width: 100%;
    }

    .hero {
        padding: 2.25rem 1.5rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero-botanicals {
        display: none;
    }

    .hero-stats {
        gap: 1rem;
    }

    .ailment-grid,
    .home-features,
    .home-quick-grid,
    .az-grid,
    .remedies-grid,
    .section-banner,
    .finder-wrapper,
    .materia-filters,
    .assessment-grid,
    .dosage-wrapper {
        grid-template-columns: 1fr;
    }

    .finder-input-row {
        flex-direction: column;
    }

    .finder-search-card {
        padding: 1.5rem;
    }

    .finder-header {
        padding: 2rem 1.5rem;
        margin: -1.5rem -1.5rem 1rem;
    }

    .section-header,
    .materia-header,
    .az-controls {
        padding: 2rem 1.25rem;
    }

    .section-banner {
        padding: 1.25rem 1rem;
    }

    .btn-search {
        width: 100%;
    }

    .topbar-search-wrap {
        max-width: 100%;
    }
}

@media (max-width: 700px) {
    .page-content {
        padding: 1rem;
    }

    .topbar {
        padding: 0.75rem 0.9rem;
    }

    .hero {
        padding: 1.75rem 1rem;
    }

    .hero h1 {
        font-size: 1.55rem;
    }

    .hero p,
    .section-header p,
    .finder-header p,
    .section-banner-text,
    .finder-tips {
        font-size: 0.95rem;
    }

    .section-header,
    .materia-header,
    .finder-header,
    .section-banner {
        padding: 1.75rem 1rem;
    }

    .section-banner-title {
        font-size: 0.95rem;
    }

    .section-banner-text {
        line-height: 1.55;
    }

    .nav-link {
        padding: 0.65rem 1rem;
    }

    .nav-section-label {
        padding: 0.8rem 1rem 0.3rem;
    }

    .materia-filters {
        gap: 0.5rem;
        padding: 0;
    }

    .search-input,
    .filter-select {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .page-content {
        padding: 0.85rem;
    }

    .topbar {
        gap: 0.65rem;
    }

    .topbar-search-wrap {
        width: 100%;
    }

    .hero {
        padding: 1.4rem 0.85rem;
    }

    .hero h1 {
        font-size: 1.4rem;
    }

    .home-features,
    .home-quick-grid,
    .ailment-grid,
    .az-grid,
    .remedies-grid,
    .section-banner,
    .finder-wrapper,
    .materia-filters,
    .assessment-grid,
    .dosage-wrapper {
        grid-template-columns: 1fr;
    }

    .topbar-search {
        padding-left: 2.4rem;
    }

    .finder-input-row {
        gap: 0.6rem;
    }

    .finder-search-card,
    .section-card,
    .assessment-card,
    .dosage-card,
    .about-wrapper,
    .materia-header {
        padding: 1.3rem;
    }

    .finder-header,
    .section-header,
    .materia-header {
        padding: 1.65rem 1rem;
        margin: -1.3rem -1.3rem 1rem;
    }

    .section-header h2,
    .finder-header h2 {
        font-size: 1.3rem;
    }

    .section-header p,
    .finder-header p,
    .section-banner-text {
        font-size: 0.9rem;
    }

    .topbar-toggle {
        font-size: 1.25rem;
    }

    .dosage-table {
        font-size: 0.78rem;
    }

    .dosage-table th,
    .dosage-table td {
        padding: 0.6rem 0.7rem;
    }

    .topbar-search-wrap {
        max-width: 100%;
    }
}

/* ============================================
   ASSESS A PATIENT FLOW REDESIGN
   ============================================ */
.assessment-flow {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    position: relative;
    padding-left: 2rem;
    margin-top: 2.5rem;
}

/* The vertical connecting line */
.assessment-flow::before {
    content: '';
    position: absolute;
    top: 2rem;
    bottom: 2rem;
    left: 4.5rem;
    width: 2px;
    background: var(--border);
    z-index: 0;
}

.assessment-phase {
    display: flex;
    gap: 2.5rem;
    position: relative;
    z-index: 1;
}

.phase-graphic {
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    background-color: var(--surface);
    border: 4px solid var(--bg);
}

.phase-graphic svg {
    width: 2.2rem;
    height: 2.2rem;
}

/* Theme Colors for Icons */
.theme-blue { background-color: #eff6ff; color: #3b82f6; border-color: #eff6ff; }
.theme-green { background-color: #f0fdf4; color: #22c55e; border-color: #f0fdf4; }
.theme-amber { background-color: #fffbeb; color: #f59e0b; border-color: #fffbeb; }
.theme-purple { background-color: #faf5ff; color: #a855f7; border-color: #faf5ff; }
.theme-rose { background-color: #fff1f2; color: #f43f5e; border-color: #fff1f2; }
.theme-teal { background-color: #f0fdfa; color: #14b8a6; border-color: #f0fdfa; }

.phase-content {
    background: var(--surface);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    flex: 1;
    border: 1px solid var(--border);
}

.phase-title {
    font-size: 1.4rem;
    color: var(--text);
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
}

.phase-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.phase-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.phase-list li svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    color: var(--primary-light);
    margin-top: 0.15rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .assessment-flow {
        padding-left: 0;
        gap: 2rem;
    }
    .assessment-flow::before {
        display: none;
    }
    .assessment-phase {
        flex-direction: column;
        gap: 0.75rem;
    }
    .phase-graphic {
        width: 4rem;
        height: 4rem;
        margin-bottom: -1.5rem; /* Overlap effect */
        z-index: 2;
        margin-left: 1.5rem;
        border: 4px solid var(--bg);
    }
    .phase-graphic svg {
        width: 1.8rem;
        height: 1.8rem;
    }
    .phase-content {
        padding: 1.5rem;
        padding-top: 2.5rem;
    }
}


/* ============================================
   ASSESS A PATIENT IMAGE STYLES
   ============================================ */
.phase-content {
    /* Override previous padding to allow edge-to-edge images */
    padding: 0 !important;
    display: flex !important;
    overflow: hidden;
}

.phase-text {
    padding: 2rem;
    flex: 1;
}

.phase-image {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    border-left: 1px solid var(--border);
}

.phase-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive adjustments for images */
@media (max-width: 900px) {
    .phase-content {
        flex-direction: column-reverse !important;
    }
    .phase-image {
        width: 100%;
        height: 180px;
        border-left: none;
        border-bottom: 1px solid var(--border);
    }
}

@media (max-width: 768px) {
    .phase-text {
        padding: 1.5rem;
        padding-top: 2.5rem;
    }
}


/* ============================================
   ASSESS A PATIENT LARGE GRAPHICS
   ============================================ */
.phase-graphic-right {
    width: 250px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid var(--border);
}

.phase-graphic-right svg {
    width: 8rem;
    height: 8rem;
    stroke-width: 1.5;
    opacity: 0.85;
}

/* Hide the old phase-image rules */
.phase-image {
    display: none !important;
}

/* Responsive adjustments for large graphics */
@media (max-width: 900px) {
    .phase-graphic-right {
        width: 100%;
        height: 160px;
        border-left: none;
        border-bottom: 1px solid var(--border);
    }
    
    .phase-graphic-right svg {
        width: 5rem;
        height: 5rem;
    }
}
/* ============================================
   ADVERTISEMENTS
   ============================================ */
.ad-space {
    background-color: #f8f9fa;
    border: 1px dashed #ced4da;
    border-radius: 4px;
    padding: 10px;
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ad-label {
    font-size: 0.7rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.ad-placeholder {
    background-color: #e9ecef;
    color: #495057;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    width: 100%;
}

/* Sidebar Ad */
.sidebar-ad {
    margin: 20px 15px;
    padding: 15px 10px;
}

.sidebar-ad .ad-placeholder {
    height: 250px;
    max-width: 300px;
}

/* Top Banner Ad */
.top-banner-ad {
    margin: 20px auto;
    max-width: 800px;
    padding: 15px;
}

.top-banner-ad .ad-placeholder {
    height: 90px;
    max-width: 728px;
}
