@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --bg: #050d18;
    --bg-alt: #081626;
    --surface: #0a1f33;
    --surface-light: #102a42;
    --surface-glass: rgba(10, 31, 51, 0.75);
    --border: #1e3d57;
    --border-bright: #00e5ff44;
    --muted: #8eaec4;
    --muted-dark: #587b94;
    --white: #f5fbff;
    --cyan: #00e5ff;
    --cyan-dim: #36d6e8;
    --mint: #00f5a0;
    --blue: #2979ff;
    --amber: #ffb703;
    --ruby: #ff3366;
    --coral: #ff6b8b;
    --mono: 'DM Mono', monospace;
    --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --heading: 'Space Grotesk', sans-serif;
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--bg);
}

body {
    margin: 0;
    color: var(--white);
    background: var(--bg);
    font: 15px/1.65 var(--sans);
    background-image: 
        radial-gradient(ellipse at 80% 8%, rgba(0, 229, 255, 0.08), transparent 45%),
        radial-gradient(circle at 10% 30%, rgba(0, 245, 160, 0.05), transparent 40%),
        radial-gradient(ellipse at 50% 90%, rgba(41, 121, 255, 0.06), transparent 50%);
    background-attachment: fixed;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, select {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

::selection {
    background: rgba(0, 229, 255, 0.35);
    color: #fff;
}

*:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
}

/* Accessibility skip link */
.skip {
    position: absolute;
    left: 12px;
    top: -80px;
    z-index: 99;
    padding: 12px 18px;
    background: var(--cyan);
    color: var(--bg);
    font-weight: 700;
    border-radius: 4px;
    transition: top 0.2s ease;
}

.skip:focus {
    top: 12px;
}

.app-shell {
    max-width: 1820px;
    margin: auto;
}

/* ----------------------------------------------------
   1. TOPBAR & NAVIGATION
   ---------------------------------------------------- */
.topbar {
    height: 84px;
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 0 clamp(20px, 4vw, 65px);
    border-bottom: 1px solid rgba(30, 61, 87, 0.7);
    background: rgba(5, 13, 24, 0.88);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 0.05em;
    font: 700 22px/1 var(--heading);
    white-space: nowrap;
}

.brand small {
    display: block;
    font: 9px var(--mono);
    letter-spacing: 0.22em;
    color: var(--muted);
    margin-top: 4px;
}

.brand-mark {
    font-size: 36px;
    color: var(--cyan);
    line-height: 1;
    filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.5));
}

.cyan, .period {
    color: var(--cyan);
}

.desktop-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, 1.6vw, 30px);
    flex: 1;
}

.desktop-nav a {
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
}

.desktop-nav a:hover,
.desktop-nav a.current {
    color: var(--cyan);
    background: rgba(0, 229, 255, 0.08);
}

.top-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.icon-btn, .sound-btn, .lang-btn, .tool-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--white);
    border-radius: 6px;
    height: 38px;
    min-width: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    transition: all 0.2s ease;
}

.sound-btn {
    padding: 0 12px;
    font-size: 11px;
    color: var(--mint);
    border-color: rgba(0, 245, 160, 0.3);
}

.sound-btn:hover {
    border-color: var(--mint);
    background: rgba(0, 245, 160, 0.1);
}

.icon-btn:hover, .tool-btn:hover, .lang-btn:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    background: rgba(0, 229, 255, 0.1);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.2);
}

.lang-btn {
    font-size: 11px;
    padding: 0 10px;
}

.primary, .secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 13px 22px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.04em;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.primary {
    background: linear-gradient(135deg, #00e5ff, #00b4d8);
    color: #03131e;
    border: 1px solid #00e5ff;
    box-shadow: 0 4px 18px rgba(0, 229, 255, 0.3);
}

.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(0, 229, 255, 0.45);
    background: linear-gradient(135deg, #38efff, #00c6eb);
}

.secondary {
    background: rgba(16, 42, 66, 0.6);
    color: var(--white);
    border: 1px solid #274b69;
    backdrop-filter: blur(8px);
}

.secondary:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    transform: translateY(-2px);
    background: rgba(16, 42, 66, 0.85);
}

.primary.small, .secondary.small {
    padding: 9px 15px;
    gap: 8px;
    font-size: 11px;
}

.mobile-menu {
    display: none;
}

/* ----------------------------------------------------
   2. UTILITY TELEMETRY STRIP
   ---------------------------------------------------- */
.utility-strip {
    height: 40px;
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 0 clamp(20px, 4vw, 65px);
    font: 10px/1 var(--mono);
    letter-spacing: 0.12em;
    color: var(--muted);
    background: #040c17;
    border-bottom: 1px solid #142a3b;
}

.status-light {
    width: 7px;
    height: 7px;
    display: inline-block;
    flex: none;
    background: var(--mint);
    border-radius: 50%;
    box-shadow: 0 0 10px #00f5a0;
    animation: statusPulse 2.5s infinite;
}

.strip-divider {
    color: #24465e;
}

.strip-end {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
}

.hud-stat strong {
    color: var(--cyan);
}

.spark {
    color: var(--cyan);
}

/* ----------------------------------------------------
   3. SECTIONS & GENERAL LAYOUT
   ---------------------------------------------------- */
.view {
    display: none;
    min-height: calc(100vh - 180px);
    padding: clamp(35px, 5vw, 65px) clamp(20px, 4vw, 65px) 75px;
}

.view.active {
    display: block;
    animation: fadeInView 0.35s ease-out;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 35px;
    border-bottom: 1px solid rgba(30, 61, 87, 0.45);
    padding-bottom: 24px;
}

.section-heading .eyebrow {
    margin-bottom: 10px;
}

.section-heading h2 {
    font-size: clamp(32px, 3.4vw, 48px);
    letter-spacing: -0.04em;
    margin-bottom: 10px;
    line-height: 1.15;
}

.section-heading p {
    max-width: 720px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 0;
}

.section-label {
    white-space: nowrap;
    font: 11px var(--mono);
    letter-spacing: 0.12em;
    color: var(--cyan);
    padding: 8px 14px;
    border: 1px solid rgba(0, 229, 255, 0.35);
    background: rgba(0, 229, 255, 0.05);
    border-radius: 4px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    color: #c0d8e8;
    font: 11px var(--mono);
    letter-spacing: 0.1em;
    background: rgba(8, 22, 38, 0.85);
}

.panel-heading span:last-child {
    color: var(--cyan);
}

/* ----------------------------------------------------
   4. HERO OVERVIEW SECTION
   ---------------------------------------------------- */
.hero-grid {
    min-height: 640px;
    display: grid;
    grid-template-columns: 54% 46%;
    align-items: center;
    gap: 40px;
}

.hero-copy {
    position: relative;
    z-index: 2;
    padding: 20px 0 40px;
}

.eyebrow {
    font: 11px var(--mono);
    letter-spacing: 0.2em;
    color: var(--cyan);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    text-transform: uppercase;
}

.eyebrow-line {
    width: 32px;
    height: 1px;
    background: var(--cyan);
    box-shadow: 0 0 8px var(--cyan);
}

h1, h2, h3, h4, p {
    margin-top: 0;
}

h1, h2, h3 {
    font-family: var(--heading);
}

h1 {
    font-size: clamp(44px, 4.8vw, 76px);
    letter-spacing: -0.05em;
    line-height: 1.1;
    font-weight: 600;
    margin-bottom: 24px;
}

h1 em, h2 em {
    font-style: normal;
    color: var(--cyan);
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
}

.hero-lead {
    max-width: 540px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.85;
    margin-bottom: 20px;
}

.owner-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.35);
    padding: 7px 16px 7px 10px;
    border-radius: 30px;
    font-size: 12px;
    color: #e0f6ff;
    margin-bottom: 26px;
    box-shadow: 0 4px 18px rgba(0, 229, 255, 0.15);
}

.owner-badge strong {
    color: var(--cyan);
}

.owner-avatar {
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, var(--cyan), var(--mint));
    color: #03141f;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font: 700 11px var(--mono);
    letter-spacing: -0.05em;
    flex-shrink: 0;
}

.button-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 35px;
}

/* Live Biometric Telemetry HUD */
.hero-telemetry-hud {
    background: rgba(8, 24, 40, 0.85);
    border: 1px solid rgba(0, 229, 255, 0.25);
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    max-width: 560px;
}

.hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font: 10px var(--mono);
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(30, 61, 87, 0.5);
    padding-bottom: 8px;
}

.hud-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e0f5ff;
}

.hud-tag {
    color: var(--mint);
    font-weight: 500;
}

.ecg-canvas-container {
    background: #040d17;
    border: 1px solid #142e42;
    border-radius: 4px;
    height: 70px;
    overflow: hidden;
    margin-bottom: 12px;
}

.ecg-canvas-container canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.vital-signs-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.vital-card {
    background: rgba(16, 42, 66, 0.5);
    border: 1px solid #1e3d57;
    padding: 8px 10px;
    border-radius: 4px;
    text-align: center;
}

.vital-name {
    display: block;
    font: 8px var(--mono);
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 4px;
}

.vital-val {
    font: 600 13px var(--mono);
    color: var(--white);
}

.vital-val small {
    font-size: 8px;
    color: var(--muted);
    font-weight: 400;
}

.heart-pulse {
    color: var(--mint);
    animation: heartTextPulse 0.83s ease-in-out infinite;
}

.hero-stats {
    display: flex;
    margin-top: 35px;
    gap: 40px;
}

.hero-stats > div {
    display: flex;
    flex-direction: column;
    border-left: 2px solid var(--cyan);
    padding-left: 14px;
}

.hero-stats strong {
    font: 600 32px var(--heading);
    color: var(--white);
    line-height: 1.1;
}

.hero-stats span {
    font: 9px var(--mono);
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-top: 4px;
}

/* Hero Holographic Graphic & Scanner */
.hero-art {
    min-height: 600px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, rgba(0, 229, 255, 0.08), transparent 70%);
}

.hero-art::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(0, 229, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 72%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 72%);
}

.orbital-circle {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(0, 229, 255, 0.18);
    border-radius: 50%;
    pointer-events: none;
}

.circle-one {
    width: 360px;
    height: 360px;
}

.circle-two {
    width: 500px;
    height: 500px;
    border-style: dashed;
    animation: spinSlow 65s linear infinite;
}

.circle-three {
    width: 620px;
    height: 620px;
    border: 1px dotted rgba(0, 245, 160, 0.12);
    animation: spinReverse 90s linear infinite;
}

.hero-figure {
    height: min(600px, 100%);
    width: 370px;
    position: relative;
    filter: drop-shadow(0 0 25px rgba(0, 229, 255, 0.35));
    animation: subtleFloat 5s ease-in-out infinite;
}

.holo-svg {
    width: 100%;
    height: 100%;
}

.hero-scan {
    position: absolute;
    width: 380px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00e5ff, #00f5a0, transparent);
    box-shadow: 0 0 20px #00e5ff;
    animation: scanSweep 6s ease-in-out infinite;
}

.floating-card {
    background: rgba(10, 31, 51, 0.88);
    border: 1px solid rgba(0, 229, 255, 0.35);
    padding: 12px 18px;
    position: absolute;
    min-width: 180px;
    border-radius: 6px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(14px);
    z-index: 3;
}

.floating-card small {
    display: block;
    font: 9px var(--mono);
    color: var(--muted);
    letter-spacing: 0.12em;
}

.floating-card b {
    display: block;
    font: 600 15px var(--heading);
    margin: 5px 0 3px;
    color: var(--white);
}

.floating-card span {
    display: flex;
    align-items: center;
    gap: 6px;
    font: 9px var(--mono);
    color: var(--cyan);
}

.floating-card i {
    width: 6px;
    height: 6px;
    background: var(--mint);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--mint);
}

.fc-top {
    top: 90px;
    left: 10px;
}

.fc-bottom {
    bottom: 80px;
    right: 10px;
}

.coordinate {
    position: absolute;
    right: 15px;
    top: 30px;
    color: #55879e;
    font: 9px/1.8 var(--mono);
    text-align: right;
    letter-spacing: 0.08em;
}

/* Feature Rail */
.feature-rail {
    border: 1px solid var(--border);
    border-radius: 8px;
    display: grid;
    grid-template-columns: 200px repeat(4, 1fr);
    background: var(--surface);
    overflow: hidden;
    margin-top: 25px;
}

.rail-label {
    font: 11px/1.8 var(--mono);
    letter-spacing: 0.1em;
    color: var(--muted);
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(8, 22, 38, 0.6);
}

.rail-label span {
    color: var(--cyan);
}

.feature-rail a {
    border-left: 1px solid var(--border);
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s ease;
}

.feature-rail a:hover {
    background: rgba(0, 229, 255, 0.06);
    border-color: rgba(0, 229, 255, 0.4);
}

.rail-num {
    color: var(--cyan);
    font: 11px var(--mono);
}

.rail-icon {
    font-size: 26px;
    color: var(--cyan);
    margin: 10px 0;
}

.feature-rail strong {
    font-size: 13px;
    letter-spacing: 0.04em;
    color: var(--white);
}

.feature-rail small {
    color: var(--muted);
    font-size: 11px;
    margin-top: 4px;
}

/* ----------------------------------------------------
   5. ANATOMY LAB SECTION
   ---------------------------------------------------- */
.lab-layout {
    display: grid;
    grid-template-columns: 240px minmax(360px, 1fr) 330px;
    gap: 16px;
    min-height: 670px;
}

.system-list {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 620px;
    overflow-y: auto;
}

.system-item {
    display: flex;
    width: 100%;
    text-align: left;
    align-items: center;
    gap: 12px;
    background: transparent;
    color: #a4bccb;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 11px 12px;
    transition: all 0.2s ease;
}

.system-item:hover {
    background: rgba(16, 42, 66, 0.7);
    color: var(--white);
}

.system-item.active {
    background: rgba(0, 229, 255, 0.12);
    border-color: rgba(0, 229, 255, 0.45);
    color: var(--cyan);
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.1);
}

.sys-icon {
    font-size: 20px;
    width: 26px;
    text-align: center;
    flex-shrink: 0;
}

.sys-meta {
    flex: 1;
}

.sys-meta strong {
    display: block;
    font-size: 13px;
}

.sys-meta small {
    display: block;
    font: 9px var(--mono);
    color: var(--muted);
    font-style: italic;
}

.sys-code {
    font: 10px var(--mono);
    color: var(--muted-dark);
}

.viewer {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.viewer-header {
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    font: 11px var(--mono);
    letter-spacing: 0.1em;
    background: rgba(8, 22, 38, 0.7);
}

.viewer-header small {
    color: #63869e;
    margin-left: 10px;
}

.viewer-status {
    color: var(--mint);
}

.viewer-stage {
    flex: 1;
    min-height: 480px;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #0f3248 0%, #071c2b 55%, #05121e 100%);
    touch-action: none;
}

.viewer-stage::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(0, 229, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.viewer-stage canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.viewer-placeholder {
    position: absolute;
    top: 48%;
    width: 100%;
    text-align: center;
    color: var(--muted);
    font: 12px var(--mono);
}

.axis-label {
    position: absolute;
    font: 10px var(--mono);
    color: #438f9f;
    pointer-events: none;
    letter-spacing: 0.08em;
}

.axis-x { right: 20px; bottom: 35px; }
.axis-y { right: 35px; bottom: 55px; }
.axis-z { right: 55px; bottom: 35px; }

.viewer-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    background: rgba(8, 22, 38, 0.85);
}

.viewer-controls-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.wire-label {
    font: 10px var(--mono);
    color: var(--muted);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.wire-label input {
    accent-color: var(--cyan);
}

.viewer-subbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 8px 16px;
    border-top: 1px solid rgba(30, 61, 87, 0.4);
    background: #05121e;
}

.slider-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font: 10px var(--mono);
    color: var(--muted);
}

.slider-control input[type="range"] {
    accent-color: var(--cyan);
    height: 4px;
    cursor: pointer;
}

.prototype-note {
    font-size: 11px;
    color: #64869c;
    margin: 0;
    text-align: right;
}

/* Anatomy Insights Panel (Right) */
.details {
    padding-bottom: 20px;
    max-height: 720px;
    overflow-y: auto;
}

.details > p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.75;
    padding: 0 20px;
}

.detail-index {
    display: block;
    margin: 20px 20px 0;
    font: 10px var(--mono);
    color: var(--cyan);
    letter-spacing: 0.12em;
}

.detail-symbol {
    font-size: 42px;
    color: var(--cyan);
    margin: 12px 20px 4px;
    line-height: 1;
}

.details h3 {
    font-size: 24px;
    line-height: 1.25;
    padding: 0 20px;
    margin: 10px 0 12px;
}

.detail-heading {
    font: 10px var(--mono);
    letter-spacing: 0.12em;
    color: var(--cyan);
    margin: 22px 20px 10px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 0 20px;
}

.metric-box {
    background: rgba(16, 42, 66, 0.6);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-val {
    font: 600 12px var(--mono);
    color: var(--mint);
}

.metric-lbl {
    font: 10px var(--mono);
    color: var(--muted);
}

.details ul {
    margin: 0 20px;
    padding-left: 18px;
    color: #bed5e3;
    font-size: 12px;
}

.details li {
    margin: 6px 0;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 20px;
}

.chip-list span {
    border: 1px solid #29516b;
    background: rgba(16, 48, 67, 0.75);
    border-radius: 3px;
    padding: 5px 9px;
    font-size: 11px;
    color: #c9e3f0;
}

.warning-chips span {
    border-color: rgba(255, 107, 139, 0.35);
    background: rgba(80, 20, 35, 0.5);
    color: #ffccd5;
}

.info-chips span {
    border-color: rgba(0, 229, 255, 0.35);
    background: rgba(0, 80, 110, 0.4);
    color: #d0f7ff;
}

.specialty-callout {
    margin: 0 20px;
    border-left: 3px solid var(--mint);
    padding: 12px 14px;
    background: rgba(16, 48, 62, 0.6);
    border-radius: 0 4px 4px 0;
    font-size: 13px;
}

/* ----------------------------------------------------
   6. DEPARTMENTS SECTION
   ---------------------------------------------------- */
.filterbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 20px 0 25px;
    flex-wrap: wrap;
}

.searchbox {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 16px;
    color: var(--cyan);
    width: min(100%, 480px);
    transition: border-color 0.2s ease;
}

.searchbox input {
    border: none;
    outline: none;
    background: transparent;
    color: var(--white);
    width: 100%;
    font-size: 14px;
}

.searchbox:focus-within {
    border-color: var(--cyan);
    box-shadow: 0 0 14px rgba(0, 229, 255, 0.25);
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.filter-actions select {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--white);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-family: var(--mono);
    outline: none;
}

.filterbar > span, .filter-actions span {
    font: 11px var(--mono);
    color: var(--muted);
}

.department-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.dept-card {
    border: 1px solid var(--border);
    background: linear-gradient(145deg, #0d263b, #071929);
    border-radius: 8px;
    text-align: left;
    color: var(--white);
    padding: 22px;
    display: flex;
    flex-direction: column;
    min-height: 240px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.dept-card:hover {
    border-color: var(--cyan);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 229, 255, 0.15);
}

.dept-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.dept-code {
    font: 11px var(--mono);
    color: var(--cyan);
    letter-spacing: 0.08em;
}

.dept-cat {
    font: 10px var(--mono);
    color: var(--muted);
}

.dept-icon-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.dept-big-icon {
    font-size: 32px;
}

.dept-icon-row strong {
    font: 600 17px var(--heading);
    color: var(--white);
}

.dept-tag {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 14px;
    flex: 1;
}

.dept-director {
    border-top: 1px solid rgba(30, 61, 87, 0.5);
    padding-top: 10px;
    margin-bottom: 12px;
}

.dept-director small {
    display: block;
    font: 9px var(--mono);
    color: var(--muted);
}

.dept-director span {
    font-size: 12px;
    color: #d0e7f5;
}

.dept-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font: 11px var(--mono);
    color: var(--cyan);
}

/* Expanded Detail Panels */
.expanded-panel {
    margin-top: 24px;
    padding: 30px;
    position: relative;
    background: #0b2236;
    border: 1px solid var(--cyan);
    border-radius: 8px;
    box-shadow: 0 15px 40px rgba(0, 229, 255, 0.15);
    animation: fadeInView 0.3s ease-out;
}

.expanded-header h3 {
    font-size: 28px;
    margin: 8px 0 8px;
}

.dept-lead-text {
    color: var(--muted);
    font-size: 15px;
    max-width: 850px;
}

.close-detail {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 20px;
}

.expanded-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 25px 0;
}

.meta-section {
    background: rgba(16, 42, 66, 0.6);
    border: 1px solid #1f425c;
    border-radius: 6px;
    padding: 16px 20px;
}

.meta-section b {
    display: block;
    color: var(--cyan);
    font: 10px var(--mono);
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.meta-section p {
    margin: 0;
    font-size: 13px;
    color: #d2e7f4;
    line-height: 1.65;
}

.meta-section ul {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    color: #d2e7f4;
}

.expanded-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* ----------------------------------------------------
   7. VIRTUAL HOSPITAL BLUEPRINT SECTION
   ---------------------------------------------------- */
.hospital-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.9fr);
    gap: 20px;
    min-height: 600px;
}

.floor-tabs {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(8, 22, 38, 0.7);
}

.floor-btn {
    flex: 1;
    background: #0c2338;
    border: 1px solid #204561;
    padding: 12px 14px;
    border-radius: 6px;
    color: var(--muted);
    text-align: left;
    transition: all 0.2s ease;
}

.flr-tag {
    display: block;
    font: 10px var(--mono);
    color: var(--cyan);
}

.flr-name {
    display: block;
    font-size: 12px;
    color: var(--white);
    font-weight: 500;
    margin-top: 2px;
}

.floor-btn.active {
    background: rgba(0, 229, 255, 0.15);
    border-color: var(--cyan);
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.2);
}

.floor-map {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 24px 20px;
    background: 
        linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
}

.room-blueprint {
    position: relative;
    border: 1px solid #234d6b;
    background: linear-gradient(150deg, #102e45, #0a1f30);
    border-radius: 6px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    text-align: left;
    color: var(--white);
    transition: all 0.2s ease;
    cursor: pointer;
    min-height: 120px;
}

.room-blueprint:hover {
    border-color: var(--cyan);
    background: #143b59;
    transform: translateY(-2px);
}

.room-blueprint.selected {
    border-color: var(--cyan);
    background: #18466b;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
}

.room-code-tag {
    font: 9px var(--mono);
    color: var(--cyan);
    letter-spacing: 0.1em;
    margin-bottom: 6px;
}

.room-blueprint .room-icon {
    font-size: 26px;
    margin-bottom: 6px;
}

.room-blueprint strong {
    font: 600 15px var(--heading);
    margin-bottom: 4px;
}

.room-type {
    font: 10px var(--mono);
    color: var(--muted);
}

.room-indicator-pulse {
    position: absolute;
    right: 14px;
    top: 14px;
    width: 6px;
    height: 6px;
    background: var(--mint);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--mint);
}

.map-legend {
    display: flex;
    gap: 20px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    font: 10px var(--mono);
    color: var(--muted);
    flex-wrap: wrap;
    background: rgba(8, 22, 38, 0.75);
}

.map-legend span:last-child {
    margin-left: auto;
}

.legend-sq {
    display: inline-block;
    width: 9px;
    height: 9px;
    border: 1px solid var(--cyan);
    margin-right: 5px;
    vertical-align: middle;
}

.active-sq { background: var(--cyan); }
.green-sq { background: var(--mint); border-color: var(--mint); }

.facility-panel {
    padding-bottom: 30px;
}

.telemetry-box {
    margin: 0 20px 16px;
    background: #071726;
    border: 1px solid #1c3c54;
    border-radius: 6px;
    padding: 12px 14px;
}

.telem-row {
    display: flex;
    justify-content: space-between;
    font: 11px var(--mono);
    margin: 5px 0;
    color: var(--muted);
}

.telem-row b {
    color: var(--white);
}

.facility-panel .full {
    margin: 25px 20px 0;
    width: calc(100% - 40px);
}

/* ----------------------------------------------------
   8. DOCTORS DIRECTORY SECTION
   ---------------------------------------------------- */
.doctor-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.doctor-card {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.doctor-card:hover {
    border-color: var(--cyan);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.doctor-portrait-box {
    height: 160px;
    background: radial-gradient(circle at 50% 10%, #153c52, #081a29);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-bottom: 1px solid var(--border);
}

.doc-portrait {
    width: 110px;
    height: 110px;
}

.rating-badge {
    position: absolute;
    right: 12px;
    top: 12px;
    background: rgba(8, 22, 38, 0.85);
    border: 1px solid rgba(255, 183, 3, 0.5);
    border-radius: 4px;
    padding: 4px 8px;
    color: var(--amber);
    font: 600 11px var(--mono);
}

.doctor-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.doc-specialty-tag {
    font: 10px var(--mono);
    letter-spacing: 0.1em;
    color: var(--cyan);
}

.doctor-info h3 {
    margin: 6px 0 2px;
    font-size: 19px;
}

.doc-role {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
    margin-bottom: 10px;
}

.doc-bio-short {
    font-size: 12px;
    color: #bdd2e0;
    line-height: 1.65;
    margin-bottom: 14px;
    flex: 1;
}

.doc-meta-row {
    font: 11px var(--mono);
    color: var(--muted);
    border-top: 1px solid rgba(30, 61, 87, 0.5);
    padding: 10px 0 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.doc-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.doctor-modal-head {
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 18px;
}

/* ----------------------------------------------------
   9. HEALTHCARE INNOVATION SECTION
   ---------------------------------------------------- */
.innovation-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.innovation-card {
    border: 1px solid var(--border);
    background: linear-gradient(150deg, #0d263b, #071929);
    border-radius: 8px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    transition: all 0.25s ease;
}

.innovation-card:hover {
    border-color: var(--cyan);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 229, 255, 0.15);
}

.inno-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.inno-code {
    font: 10px var(--mono);
    color: var(--muted);
}

.inno-cat {
    font: 10px var(--mono);
    color: var(--cyan);
}

.inno-icon {
    font-size: 34px;
    margin-bottom: 12px;
}

.innovation-card strong {
    font: 600 17px var(--heading);
    margin-bottom: 8px;
    color: var(--white);
}

.innovation-card p {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.65;
    margin-bottom: 16px;
    flex: 1;
}

.inno-specs {
    border-top: 1px solid rgba(30, 61, 87, 0.5);
    padding-top: 10px;
    margin-bottom: 12px;
}

.inno-specs small {
    display: block;
    font: 9px var(--mono);
    color: var(--muted);
}

.inno-specs span {
    font: 11px var(--mono);
    color: #cce7f5;
}

.inno-status {
    font: 10px var(--mono);
    color: var(--mint);
    display: flex;
    align-items: center;
    gap: 6px;
}

.innovation-note {
    padding: 18px 24px;
    margin-top: 25px;
    color: var(--muted);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ----------------------------------------------------
   10. MODALS, DIALOGS & APPOINTMENT ENGINE
   ---------------------------------------------------- */
.dialog {
    border: 1px solid rgba(0, 229, 255, 0.35);
    border-radius: 10px;
    background: #081c2d;
    color: var(--white);
    width: min(92vw, 560px);
    max-height: 85vh;
    overflow-y: auto;
    padding: 28px;
    box-shadow: 0 35px 100px rgba(0, 0, 0, 0.8);
}

.dialog::backdrop {
    background: rgba(3, 10, 18, 0.85);
    backdrop-filter: blur(8px);
}

.dialog-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 18px;
}

.dialog-head h3 {
    margin: 4px 0 0;
    font-size: 24px;
}

.search-results {
    margin-top: 18px;
    max-height: 380px;
    overflow-y: auto;
}

.search-item-btn {
    display: block;
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--border);
    padding: 13px 8px;
    background: transparent;
    color: var(--white);
    text-align: left;
    transition: all 0.2s ease;
}

.search-item-btn:hover {
    background: rgba(0, 229, 255, 0.08);
    color: var(--cyan);
}

.search-item-btn strong {
    display: block;
    font-size: 14px;
}

.search-item-btn small {
    display: block;
    color: var(--muted);
    font: 10px var(--mono);
    margin-top: 3px;
}

.dialog-foot {
    margin-top: 15px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
    color: var(--muted);
    font: 11px var(--mono);
}

.setting {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.setting input {
    accent-color: var(--cyan);
    width: 18px;
    height: 18px;
}

/* Appointment Wizard */
.appointment-dialog {
    width: min(92vw, 720px);
}

.demo-alert {
    padding: 12px 16px;
    background: rgba(255, 183, 3, 0.12);
    border: 1px solid rgba(255, 183, 3, 0.4);
    color: #ffe3a8;
    font: 12px/1.6 var(--sans);
    border-radius: 6px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 22px 0;
}

.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
}

.form-grid input, .form-grid select {
    background: #0d283e;
    border: 1px solid #234d6e;
    border-radius: 5px;
    padding: 12px 14px;
    color: var(--white);
    outline: none;
    transition: border-color 0.2s ease;
}

.form-grid input:focus, .form-grid select:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.25);
}

.form-grid select option {
    background: #081c2d;
    color: var(--white);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

/* Confirmed Clinical Encounter Pass */
.appointment-pass {
    margin-top: 24px;
    border: 1px solid var(--mint);
    border-radius: 8px;
    background: #092633;
    padding: 24px;
    box-shadow: 0 15px 40px rgba(0, 245, 160, 0.15);
    animation: fadeInView 0.3s ease-out;
}

.pass-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(0, 245, 160, 0.3);
    padding-bottom: 14px;
}

.pass-brand {
    font: 10px var(--mono);
    letter-spacing: 0.15em;
    color: var(--mint);
}

.pass-header h4 {
    margin: 4px 0 0;
    font-size: 20px;
    color: var(--white);
}

.pass-ref {
    text-align: right;
}

.pass-ref small {
    display: block;
    font: 9px var(--mono);
    color: var(--muted);
}

.pass-ref strong {
    font: 700 16px var(--mono);
    color: var(--cyan);
}

.pass-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 18px 0;
}

.pass-grid > div span {
    display: block;
    font: 9px var(--mono);
    color: var(--muted);
    letter-spacing: 0.08em;
}

.pass-grid > div strong {
    display: block;
    font-size: 14px;
    color: #e5f6ff;
    margin-top: 2px;
}

.pass-barcode-row {
    border-top: 1px solid rgba(0, 245, 160, 0.25);
    padding-top: 16px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.barcode-svg {
    width: 200px;
    height: 40px;
    border-radius: 4px;
}

.pass-instructions span {
    display: block;
    font: 11px var(--mono);
    color: var(--cyan);
}

.pass-instructions small {
    display: block;
    font-size: 11px;
    color: var(--muted);
    line-height: 1.5;
    margin-top: 3px;
}

.pass-actions {
    display: flex;
    gap: 12px;
    margin-top: 18px;
    border-top: 1px solid rgba(0, 245, 160, 0.25);
    padding-top: 14px;
}

/* Toast Notifications */
.toast {
    position: fixed;
    right: 25px;
    bottom: 25px;
    background: #082436;
    border: 1px solid var(--cyan);
    border-radius: 6px;
    color: #e0f8ff;
    padding: 13px 22px;
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font: 13px var(--mono);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.toast.show {
    opacity: 1;
    transform: translateY(-5px);
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 35px clamp(20px, 4vw, 65px);
    color: var(--muted);
    font-size: 12px;
    background: #040c17;
}

.footer-brand-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.footer-brand-row strong {
    font: 700 16px var(--heading);
    color: var(--white);
}

.footer-owner {
    font: 11px var(--mono);
    color: var(--muted);
    margin-top: 3px;
}

footer p {
    max-width: 900px;
    line-height: 1.7;
    margin: 0 0 16px;
}

.footer-meta {
    display: flex;
    justify-content: space-between;
    font: 10px var(--mono);
    color: var(--muted-dark);
}

/* Mobile Drawer */
.mobile-nav {
    position: fixed;
    z-index: 49;
    top: 84px;
    left: 0;
    right: 0;
    padding: 20px;
    background: #061524;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 20px 40px rgba(0,0,0,0.7);
}

.mobile-nav a {
    display: block;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(30, 61, 87, 0.5);
    font-size: 15px;
}

/* Accessibility Modifiers */
.large-text {
    font-size: 18px;
}

.high-contrast {
    --muted: #d5e8f5;
    --border: #4a84a6;
    --surface: #061726;
}

.reduce-motion * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

/* ----------------------------------------------------
   11. KEYFRAME ANIMATIONS
   ---------------------------------------------------- */
@keyframes spinSlow {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes spinReverse {
    to { transform: translate(-50%, -50%) rotate(-360deg); }
}

@keyframes scanSweep {
    0% { top: 12%; opacity: 0; }
    15% { opacity: 0.9; }
    85% { opacity: 0.9; }
    100% { top: 88%; opacity: 0; }
}

@keyframes subtleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes heartTextPulse {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.12); text-shadow: 0 0 12px #00f5a0; }
    30% { transform: scale(1); }
    45% { transform: scale(1.06); text-shadow: 0 0 8px #00f5a0; }
}

@keyframes statusPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.25); opacity: 0.7; }
}

@keyframes fadeInView {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ----------------------------------------------------
   12. RESPONSIVE BREAKPOINTS
   ---------------------------------------------------- */
@media (max-width: 1300px) {
    .department-grid { grid-template-columns: repeat(2, 1fr); }
    .doctor-grid { grid-template-columns: repeat(3, 1fr); }
    .innovation-grid { grid-template-columns: repeat(3, 1fr); }
    .lab-layout { grid-template-columns: 210px minmax(320px, 1fr) 280px; }
}

@media (max-width: 1024px) {
    .desktop-nav, .top-actions .small { display: none; }
    .mobile-menu { display: inline-flex; }
    .top-actions { margin-left: auto; }
    .hero-grid { grid-template-columns: 1fr; }
    .hero-art { min-height: 520px; }
    .lab-layout { grid-template-columns: 210px 1fr; }
    .details { grid-column: 1 / -1; }
    .hospital-layout { grid-template-columns: 1fr; }
    .doctor-grid { grid-template-columns: repeat(2, 1fr); }
    .innovation-grid { grid-template-columns: repeat(2, 1fr); }
    .feature-rail { grid-template-columns: repeat(2, 1fr); }
    .rail-label { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    .topbar { height: 70px; padding: 0 18px; }
    .brand { font-size: 18px; }
    .brand-mark { font-size: 30px; }
    .mobile-nav { top: 70px; }
    .top-actions .sound-btn { display: none; }
    .view { padding: 30px 16px 50px; }
    .section-heading { flex-direction: column; align-items: flex-start; gap: 12px; }
    .hero-stats { gap: 20px; flex-wrap: wrap; }
    .hero-stats strong { font-size: 26px; }
    .vital-signs-row { grid-template-columns: repeat(3, 1fr); }
    .lab-layout { grid-template-columns: 1fr; }
    .system-list { display: grid; grid-template-columns: repeat(2, 1fr); max-height: 300px; }
    .department-grid { grid-template-columns: 1fr; }
    .doctor-grid { grid-template-columns: 1fr; }
    .innovation-grid { grid-template-columns: 1fr; }
    .floor-map { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .pass-grid { grid-template-columns: 1fr; }
    .expanded-meta-grid { grid-template-columns: 1fr; }
}
