/**
 * Pharma Index Core Platform
 * Global System Stylesheet (styles.css)
 * Theme Style: Pure Minimalist Light, High-Scannability
 * Layout Constraints: Max Width 900px Optimized
 */

/* ==========================================================================
   1. PREMIUM LIGHTWEIGHT DESIGN TOKENS
   ========================================================================== */
:root {
    /* Palette Spectrum */
    --primary: #1e293b;
    /* Refined Slate Core Gray */
    --primary-light: #f8fafc;
    /* Pure Cloud Panel Canvas */
    --accent: #216f98;
    /* Modern Electric Indigo Accent */
    --accent-hover: #2882b3;
    /* Indigo Transit State */
    --accent-danger: #e11d48;
    /* Precise Rose Alert Element */
    --accent-warning: #ea580c;
    /* Clean Burnt Amber Accent */
    --success: #15803d;
    /* Safe Botanical Green */
    --success-light: #f0fdf4;
    /* Soft Mint Canvas Wash */
    --info-bg: #f0f9ff;
    /* Clean Azure Diagnostic Canvas */
    --info-text: #0369a1;
    /* Pure Healthcare Blue Accent */
    --bg-muted: #f1f5f9;
    /* Sophisticated Off-White Foundation */
    --border-color: #e2e8f0;
    /* Razor-Thin Whisper Gray lines */
    --text-dark: #334155;
    /* Reduced Contrast Dark Charcoal Text */
    --text-muted: #64748b;
    /* Technical Slate Secondary Label */

    /* Elegant Dimensional Scale */
    --max-width: 900px;
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 6px;

    /* Fine Shadow Profiles */
    --shadow-soft: 0 4px 20px -2px rgba(15, 23, 42, 0.04), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
    --shadow-hover: 0 20px 25px -5px rgba(79, 70, 229, 0.06), 0 8px 10px -6px rgba(79, 70, 229, 0.04);
}

/* ==========================================================================
   2. TYPE SCALING AND STRUCTURAL RESET
   ========================================================================== */
html {
    box-sizing: border-box;
    font-size: 15px;
    /* Compact scannability scaling */
    scroll-behavior: smooth;
    background-color: #fafbfc;
}

*,
*:before,
*:after {
    box-sizing: inherit;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
 h4 {
    color: var(--primary);
    font-weight: 600;
    letter-spacing: -0.02em;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    background-color: var(--bg-muted);
    color: var(--primary);
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.85em;
    border: 1px solid var(--border-color);
}

.logo {
    position: absolute;
    width: 64px;
    height: 64px;
    object-fit: contain;
    flex-shrink: 0;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 10px;
    box-sizing: border-box;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.split-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 24px;
}

/* ==========================================================================
   4. SYSTEM DESIGN COMPONENTS (BUTTONS & BADGES)
   ========================================================================== */
.badge-ui {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.badge-danger {
    background-color: #fff1f2;
    color: var(--accent-danger);
    border: 1px solid #ffe4e6;
}

.badge-warning {
    background-color: #fff7ed;
    color: var(--accent-warning);
    border: 1px solid #ffedd5;
}

.badge-success {
    background-color: var(--success-light);
    color: var(--success);
    border: 1px solid #dcfce7;
}

.badge-info {
    background-color: var(--info-bg);
    color: var(--info-text);
    border: 1px solid #bae6fd;
}

.btn-submit {
    display: inline-block;
    background-color: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 0.92rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: center;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-submit:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.25);
}

/* ==========================================================================
   5. LANDING MAIN HUB SPECIFIC INTERFACES (index.php)
   ========================================================================== */
.home-header {
    position: relative;
    z-index: 10;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.home-header-inner {
    max-width: 1160px;
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.home-brand {
    display: inline-flex;
    align-items: center;
}

.home-brand img {
    display: block;
    width: 176px;
    height: auto;
}

.home-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.home-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
}

.home-nav a:hover {
    color: var(--accent);
}

.home-nav span {
    color: var(--accent);
    font-size: 1rem;
}

.home-main {
    overflow: hidden;
}

.hero-section {
    position: relative;
    background-color: #f5f9f7;
    background-image: linear-gradient(rgba(18, 59, 63, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(18, 59, 63, 0.035) 1px, transparent 1px);
    background-size: 34px 34px;
    padding: 18px 0 22px;
    border-bottom: 1px solid var(--border-color);
}

.hero-section::before {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(245, 249, 247, 0) 35%, rgba(245, 249, 247, 0.92) 100%);
    content: "";
    pointer-events: none;
}

.hero-wrap {
    position: relative;
    z-index: 1;
    max-width: 1160px;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 64px;
    align-items: center;
}

.hero-copy {
    max-width: 580px;
}

.eyebrow {
    display: inline-block;
    color: #0f766e;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero-section h1 {
    max-width: 640px;
    margin: 16px 0 18px;
    color: #123b60;
    font-size: 3.65rem;
    line-height: 1.06;
    letter-spacing: 0;
}

.hero-subtext {
    max-width: 520px;
    margin: 0;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.75;
}

.hero-search-shell {
    max-width: 560px;
    margin: 0;
    padding: 10px;
    background: #fff;
    border: 1px solid #dce7e2;
    border-radius: 4px;
    box-shadow: 0 16px 36px rgba(18, 59, 63, 0.08);
}

.search-form-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    max-width: none;
    margin: 0;
}

.search-form-wrapper:focus-within {
    outline: 2px solid rgba(21, 105, 93, 0.2);
    outline-offset: 3px;
}

.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    border: 1px solid #cbd8d3;
    border-radius: 4px;
    background: #fff;
}

.search-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    padding-left: 16px;
    user-select: none;
    pointer-events: none;
}

.search-input-group input[type="text"] {
    min-width: 0;
    width: 100%;
    border: none;
    outline: none;
    padding: 13px 10px;
    font-size: 0.92rem;
    color: var(--primary);
    background: transparent;
}

.search-icon svg {
    width: 21px;
    height: 21px;
    display: block;
}

.search-form-wrapper>.btn-submit {
    width: auto;
    margin: 0;
    padding: 12px 18px;
    white-space: nowrap;
    box-shadow: none;
}

.search-hint {
    margin: 14px 0 0;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.hint-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin: 0 7px 1px 0;
    border-radius: 50%;
    background: #14b8a6;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999;
    display: none;
    max-height: 350px;
    margin-top: 6px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.12);
}

.autocomplete-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--bg-muted);
}

.autocomplete-item:last-child {
    border-bottom: 0;
}

.autocomplete-item:hover {
    background: #f0fdfa;
}

.autocomplete-term {
    color: var(--primary);
    font-weight: 600;
}

.autocomplete-type {
    padding: 3px 7px;
    border-radius: 4px;
    background: var(--bg-muted);
    color: var(--text-muted);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-overview {
    padding: 16px 0;
    background: #fff;
}

.overview-grid {
    max-width: 1160px;
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 80px;
    align-items: start;
}

.overview-intro h2 {
    margin: 12px 0 12px;
    color: #123b60;
    font-size: 2.1rem;
    letter-spacing: 0;
    line-height: 1.2;
}

.overview-intro p {
    max-width: 360px;
    margin: 0;
    color: var(--text-muted);
}

.overview-list {
    border-top: 1px solid var(--border-color);
}

.overview-item {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 8px 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.overview-item>span {
    grid-row: span 2;
    color: #167667;
    font-size: 0.78rem;
    font-weight: 700;
}

.overview-item strong {
    color: var(--primary);
    font-size: 1rem;
}

.overview-item p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

.system-stats {
    padding: 14px 0 8px;
    background: #f5f8f7;
    border-top: 1px solid #e4ebe8;
    border-bottom: 1px solid #e4ebe8;
}

.stats-grid {
    max-width: 900px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
}

.stat-card {
    padding: 8px 12px;
    background: transparent;
    border: 0;
    border-right: 1px solid #d8e2de;
    border-radius: 0;
}

.stat-card:first-of-type {
    padding-left: 0;
}

.stat-card:last-child {
    border-right: 0;
}

.stat-kicker {
    color: #167667;
}

.stat-card h3 {
    margin: 8px 0 2px;
}

.stat-number {
    font-size: 2.25rem;
    line-height: 1.2;
}

.stat-card > span:last-child {
    color: var(--text-muted);
    font-size: 0.83rem;
}

.disclaimer-section {
    padding: 18px 0;
    background: #fff;
}

.disclaimer-content {
    max-width: 1160px;
    padding: 14px 18px;
    background: #fbf7f1;
}

.disclaimer-label {
    color: #8a4e19;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.disclaimer-content h2 {
    margin: 7px 0 12px;
    color: #4d3826;
    font-size: 1.35rem;
    letter-spacing: 0;
}

.disclaimer-content p {
    max-width: 980px;
    margin: 0 0 10px;
    color: #5e5145;
    font-size: 0.9rem;
    line-height: 1.7;
}

.disclaimer-content p:last-child {
    margin-bottom: 0;
    font-weight: 600;
}

/* Shared top navigation used by search and profile pages */
.site-navbar {
    position: sticky;
    top: 0;
    z-index: 1100;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.site-navbar-inner {
    width: 100%;
    max-width: 1100px;
    min-height: 68px;
    margin: 0 auto;
    padding: 5px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.site-navbar-brand:hover {
    color: var(--accent);
}

.site-navbar-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 5px 12px rgba(79, 70, 229, 0.2);
}

.site-navbar-brand .logo {
    position: static;
    display: block;
    width: 164px;
    height: 48px;
    object-fit: contain;
}

.site-navbar-search {
    display: flex;
    flex: 1;
    max-width: 520px;
    min-width: 0;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #f5f8f7;
}

.site-navbar-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(21, 105, 93, 0.12);
}

.site-navbar-search input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    padding: 3px 6px;
    color: var(--primary);
    background: transparent;
    font: inherit;
}

.site-navbar-search button {
    border: 0;
    border-radius: 3px;
    padding: 7px 14px;
    color: #fff;
    background: #216f98;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.site-navbar-search button:hover {
    background: #2882b3;
}

.search-page {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 8px 8px 12px;
}

.back-link {
    display: inline-block;
    margin-bottom: 10px;
    color: #45645e;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
}

.back-link:hover {
    color: #15695d;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.results-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.results-header h1 {
    margin: 10px 0 8px;
    color: #173c39;
    font-size: 2.35rem;
    line-height: 1.2;
    letter-spacing: 0;
}

.searched-term {
    color: #15695d;
    overflow-wrap: anywhere;
}

.results-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 18px;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.results-summary strong {
    color: var(--primary);
}

.results-source {
    color: #71817b;
    font-size: 0.8rem;
}

.results-wrapper {
    display: grid;
    gap: 14px;
}

.search-warning {
    margin-bottom: 18px;
    padding: 13px 16px;
    border: 1px solid #edc9bf;
    background: #fcf5f2;
    color: #713d31;
    font-size: 0.88rem;
}

.drug-card {
    background: #fff;
    padding: 11px 14px;
    border-radius: 5px;
    border: 1px solid #dfe7e3;
    box-shadow: 0 2px 9px rgba(29, 55, 48, 0.035);
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.drug-card:hover {
    border-color: #b7cbc3;
    box-shadow: 0 8px 22px rgba(29, 55, 48, 0.07);
}

.drug-card-row {
    display: grid;
    grid-template-columns: 320px minmax(360px, 1fr) 190px 180px;
    align-items: center;
    gap: 12px 18px;
}

.drug-names {
    width: 320px;
    min-width: 0;
}

.drug-names h2 {
    margin: 0 0 2px;
    font-size: 1.12rem;
    line-height: 1.25;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.drug-names h2 a {
    color: #15695d;
    text-decoration: none;
}

.drug-names h2 a:hover {
    color: #104f47;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.generic-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin: 0;
    font-size: 0.86rem;
}

.generic-summary span {
    color: var(--text-muted);
}

.generic-summary strong {
    color: #344942;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.match-reason {
    flex: 0 0 auto;
    max-width: 190px;
    padding: 4px 7px;
    border: 1px solid #d8e8e1;
    border-radius: 3px;
    background: #f1f7f4;
    color: #326552;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
}

.result-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 4px 16px;
    margin: 0;
}

.result-meta > div {
    min-width: 0;
}

.result-meta dt {
    display: inline;
    margin-right: 4px;
    color: #75827d;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.result-meta dd {
    display: inline;
    margin: 0;
    color: #354841;
    font-size: 0.84rem;
    overflow-wrap: anywhere;
}

.result-meta code {
    padding: 1px 4px;
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}

.indications-section {
    margin-top: 17px;
}

.indications-section h3 {
    margin: 0 0 8px;
    color: #30433c;
    font-size: 0.87rem;
    letter-spacing: 0;
}

.indications-box {
    background: #f7f9f8;
    padding: 12px 14px;
    font-size: 0.87rem;
    color: var(--text-dark);
    line-height: 1.65;
}

.indications-box mark {
    padding: 0 2px;
    background: #e7dca6;
    color: #292b24;
}

.result-actions {
    display: flex;
    justify-content: flex-end;
    flex: 0 0 auto;
    margin-left: 0;
}

.result-action {
    color: #15695d;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
}

.result-action:hover {
    color: #104f47;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.empty-results {
    padding: 22px 14px;
    border: 1px solid #dfe7e3;
    border-radius: 5px;
    background: #f8faf9;
    text-align: center;
}

.empty-results-mark {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid #c9d8d1;
    border-radius: 50%;
    color: #397365;
    font-size: 1.2rem;
    font-weight: 600;
}

.empty-results h2 {
    margin: 14px 0 8px;
    color: #253d35;
    font-size: 1.35rem;
    letter-spacing: 0;
}

.empty-results p {
    max-width: 560px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    margin: 28px 0 8px;
    color: var(--text-muted);
    font-size: 0.86rem;
}

.search-pagination a {
    padding: 8px 12px;
    border: 1px solid #d8e3de;
    border-radius: 3px;
    color: #15695d;
    font-weight: 600;
    text-decoration: none;
}

.search-pagination a:hover {
    background: #f1f7f4;
    border-color: #a7c5b7;
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.stat-kicker {
    color: #0f766e;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.stat-card h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
    letter-spacing: 0.05em;
}

.stat-number {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 2px 0;
}

/* ==========================================================================
   7. DEEP PROFILE ENGINE STYLES (details.php Navigation Fixes)
   ========================================================================== */
.top-navbar {
    background-color: rgba(255, 255, 255, 0.85);
    /* Frost White Glassmorphism Header */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.nav-brand-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.nav-brand h2 {
    font-size: 1.05rem;
    margin: 0;
    color: var(--primary);
}

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

.nav-brand strong {
    overflow: hidden;
    color: var(--primary);
    font-size: 0.95rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-context-label {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    white-space: nowrap;
}

.nav-exit-link {
    color: var(--text-muted);
}

.top-nav-links {
    justify-content: center;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 8px 0;
    scrollbar-width: none;
}

.top-nav-links::-webkit-scrollbar {
    display: none;
}

/* Tab-switching anchors override */
.nav-link,
.top-nav-links button {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    transition: all 0.15s ease;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-link:hover,
.top-nav-links button:hover {
    background-color: var(--bg-muted);
    color: var(--primary);
}

.nav-link.active,
.top-nav-links button.active {
    background-color: #e0e7ff;
    /* Soft Indigo Link Focus */
    color: var(--accent);
}

.record-hero {
    padding: 10px 12px;
}

.record-hero-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.record-hero h1 {
    margin: 12px 0 6px;
    color: #123b60;
    font-size: 2.2rem;
    letter-spacing: -0.04em;
}

.record-section-label {
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
}

.record-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.98rem;
}

.record-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin-top: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.78rem;
}

.record-meta strong {
    color: var(--primary);
}

/* Core Document Elements Grid */
.main-content {
    max-width: var(--max-width);
    margin: 10px auto;
    padding: 0 24px;
    box-sizing: border-box;
}

.header-banner,
.content-section {
    background: #fff;
    padding: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 14px;
    box-shadow: var(--shadow-soft);
}

.content-section {
    scroll-margin-top: 130px;
    /* Offset alignment tool for frosted header view jumps */
}

.section-title {
    font-size: 1.15rem;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--primary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.section-title span {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}

/* Document Data Presentation Matrices */
table.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.88rem;
}

table.data-table th {
    background: var(--primary-light);
    text-align: left;
    padding: 12px 10px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

table.data-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
}

.alert-box {
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid #fee2e2;
    background-color: #fff1f2;
    color: #9f1239;
    font-size: 0.88rem;
    margin-bottom: 16px;
}

.text-block-scroll {
    max-height: 200px;
    overflow-y: auto;
    background-color: var(--primary-light);
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-size: 0.88rem;
    color: var(--text-dark);
    line-height: 1.6;
}

/* Universal Legal Footer Overrides */
footer {
    border-top: 1px solid var(--border-color);
    background: #fff !important;
    color: var(--text-muted) !important;
    box-shadow: none !important;
    padding: 14px 0 !important;
    margin-top: 10px !important;
}

/* Medicine profile visual theme */
.nav-container {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}

.top-navbar {
    background: #f5f8f7;
    border-bottom: 1px solid #dfe8e3;
}

.nav-brand-row {
    min-height: 58px;
    padding: 10px 0;
    gap: 16px;
}

.nav-brand {
    align-items: center;
    flex-wrap: wrap;
}

.nav-context-label {
    color: #47766a;
}

.nav-exit-link {
    color: #42645b;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
}

.nav-exit-link:hover {
    color: #15695d;
}

.top-nav-links {
    justify-content: flex-start;
    gap: 4px;
    padding: 8px 0 10px;
}

.nav-link,
.top-nav-links button {
    padding: 7px 11px;
    border-radius: 3px;
    color: #536a61;
    font-size: 0.8rem;
}

.nav-link:hover,
.top-nav-links button:hover {
    background: #eaf1ed;
    color: #204c41;
}

.nav-link.active,
.top-nav-links button.active {
    background: #e3f0e9;
    color: #15695d;
    font-weight: 700;
}

.details-page {
    --accent: #15695d;
    --accent-hover: #10564d;
    --info-bg: #eef7f2;
    --info-text: #326552;
    --success: #257247;
    --success-light: #eef8f0;
    width: 100%;
    max-width: 1160px;
    margin: 28px auto 64px;
    padding: 0 24px;
}

.details-page .header-banner,
.details-page .content-section {
    margin-bottom: 16px;
    padding: 26px 28px;
    border: 1px solid #dfe7e3;
    border-radius: 5px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(29, 55, 48, 0.04);
}

.details-page .record-hero {
    padding: 28px 30px 24px;
}

.record-hero-topline {
    gap: 12px;
}

.record-hero h1 {
    margin: 15px 0 8px;
    color: #173c39;
    font-size: 2.35rem;
    line-height: 1.15;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.record-section-label {
    color: #15695d;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.record-subtitle {
    max-width: 680px;
    color: #62736c;
    font-size: 0.95rem;
}

.record-meta {
    gap: 8px 28px;
    margin-top: 18px;
    padding-top: 14px;
    border-top-color: #e8eeea;
}

.record-meta strong {
    color: #30483e;
}

.record-meta code {
    color: #344942;
    background: #f3f7f5;
}

.record-disclaimer {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 14px;
    align-items: baseline;
    margin: 0 0 16px;
    padding: 13px 16px;
    border: 1px solid #eadbc4;
    background: #fbf7f1;
    color: #5e5145;
    font-size: 0.83rem;
    line-height: 1.55;
}

.record-disclaimer strong {
    color: #8a4e19;
    white-space: nowrap;
}

.record-disclaimer p {
    margin: 0;
}

.details-page .content-section {
    scroll-margin-top: 24px;
}

.details-page .section-title {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom-color: #e6ece8;
    color: #25473c;
    font-size: 1.2rem;
    letter-spacing: 0;
    text-transform: none;
}

.details-page .section-title span {
    color: #74827b;
    font-size: 0.82rem;
}

.details-page .data-label {
    margin-bottom: 6px;
    color: #718078;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.details-page .data-label strong {
    font-weight: 700;
}

.details-page .data-value {
    color: #30483e;
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.details-page table.data-table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid #e4ebe7;
    border-radius: 3px;
}

.details-page table.data-table th {
    background: #f3f7f5;
    color: #596e64;
    font-size: 0.74rem;
    font-weight: 700;
}

.details-page table.data-table td,
.details-page table.data-table th {
    padding: 11px 12px;
    vertical-align: top;
}

.details-page .text-block-scroll {
    max-height: 360px;
    background: #f7f9f8;
    border-color: #e1e9e4;
    line-height: 1.7;
}

.details-page .alert-box {
    border-color: #efd4cc;
    background: #fcf4f1;
    color: #8a3e2e;
}

/* ========================================================================== 
   8. RESPONSIVE SCALE MEDIA RULES (900px Viewport Core Breakpoints)
   ========================================================================== */
@media screen and (max-width: 900px) {
    .hero-wrap {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .hero-section h1 {
        max-width: 700px;
        font-size: 3rem;
    }

    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .overview-grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }
}

@media screen and (max-width: 640px) {
    .home-header-inner {
        min-height: 70px;
    }

    .home-brand img {
        width: 148px;
    }

    .home-nav {
        display: none;
    }

    .hero-section {
        padding: 48px 0 54px;
    }

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

    .hero-search-shell {
        padding: 16px;
    }

    .search-form-wrapper {
        grid-template-columns: 1fr;
    }

    .search-form-wrapper > .btn-submit {
        width: 100%;
    }

    .home-overview {
        padding: 54px 0;
    }

    .overview-intro h2 {
        font-size: 1.7rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card,
    .stat-card:first-of-type {
        padding: 16px 0;
        border-right: 0;
        border-bottom: 1px solid #d8e2de;
    }

    .stat-card:last-child {
        border-bottom: 0;
    }

    .disclaimer-section {
        padding: 32px 0;
    }

    .disclaimer-content {
        padding: 20px;
    }

    .content-section,
    .header-banner {
        padding: 20px;
    }

    .nav-brand-row {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .btn-submit {
        width: 100%;
    }

    .site-navbar-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px 16px;
    }

    .site-navbar-brand {
        align-self: flex-start;
    }

    .site-navbar-search {
        max-width: none;
        width: 100%;
    }

    .search-page {
        padding-top: 24px;
        padding-bottom: 48px;
    }

    .results-header h1 {
        font-size: 1.8rem;
    }

    .drug-card {
        padding: 12px;
    }

    .drug-card-row {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .drug-names {
        width: 100%;
    }

    .result-meta {
        grid-template-columns: 1fr;
    }

    .result-actions {
        margin-left: 0;
        justify-content: flex-start;
    }

    .match-reason {
        max-width: 100%;
    }

    .empty-results {
        padding: 36px 18px;
    }

    .nav-brand-row {
        align-items: flex-start;
    }

    .nav-brand {
        max-width: 70%;
        flex-direction: column;
        align-items: flex-start;
        gap: 1px;
    }

    .nav-context-label {
        font-size: 0.62rem;
    }

    .record-hero {
        padding: 22px;
    }

    .record-hero h1 {
        font-size: 1.8rem;
    }

    .record-hero-topline {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .record-meta {
        flex-direction: column;
        gap: 6px;
    }

    .nav-container {
        padding: 0 16px;
    }

    .details-page {
        margin: 18px auto 44px;
        padding: 0 16px;
    }

    .details-page .header-banner,
    .details-page .content-section {
        padding: 20px 18px;
    }

    .details-page .record-hero {
        padding: 20px 18px;
    }

    .record-disclaimer {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 12px 14px;
    }
}