/* ==========================================================================
   Central Open-Science & Clinical AI Observatory — Dr Prajwal Ghimire (@prazg)
   Aesthetic: Nature Medicine / Editorial Scientific Observatory
   Zero external CDN fonts/assets · WCAG 2.1 AA compliant (Dark & Light modes)
   ========================================================================== */

:root,
[data-theme="dark"] {
  color-scheme: dark;

  /* Core Obsidian-Navy Surfaces */
  --bg-primary: #070d18;
  --bg-secondary: #0b1424;
  --bg-elevated: #0e192d;
  --bg-elevated-hover: #13223c;
  --bg-subtle: #111f36;
  --bg-suite-bar: rgba(7, 13, 24, 0.92);
  --bg-code: #050a13;

  /* Borders & Dividers */
  --border-subtle: #1b2d48;
  --border-strong: #2b456e;
  --border-focus: #38bdf8;

  /* High-Contrast Typography (all >= 6.7:1 on dark surfaces) */
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  /* Domain Accents (all >= 6.4:1 text contrast on dark surfaces) */
  --accent-cyan: #38bdf8;
  --accent-cyan-soft: rgba(56, 189, 248, 0.13);
  --accent-cyan-border: rgba(56, 189, 248, 0.38);

  --accent-emerald: #10b981;
  --accent-emerald-text: #34d399;
  --accent-emerald-soft: rgba(16, 185, 129, 0.14);
  --accent-emerald-border: rgba(16, 185, 129, 0.4);

  --accent-amber: #f59e0b;
  --accent-amber-soft: rgba(245, 158, 11, 0.14);
  --accent-amber-border: rgba(245, 158, 11, 0.4);

  --accent-rose: #f472b6;
  --accent-rose-soft: rgba(244, 114, 182, 0.14);
  --accent-rose-border: rgba(244, 114, 182, 0.4);

  /* Solid Primary Action Button (8.98:1 contrast) */
  --btn-primary-bg: #38bdf8;
  --btn-primary-bg-hover: #7dd3fc;
  --btn-primary-text: #04101d;

  /* Shadows & Grid Overlay */
  --shadow-card: 0 12px 32px rgba(2, 6, 14, 0.48);
  --shadow-hover: 0 18px 40px rgba(2, 6, 14, 0.68);
  --grid-line: rgba(56, 189, 248, 0.045);
}

[data-theme="light"] {
  color-scheme: light;

  /* High-Contrast Ivory-Slate Surfaces */
  --bg-primary: #f6f7f9;
  --bg-secondary: #eef2f7;
  --bg-elevated: #ffffff;
  --bg-elevated-hover: #f8fafc;
  --bg-subtle: #e7edf5;
  --bg-suite-bar: rgba(246, 247, 249, 0.94);
  --bg-code: #0f172a;

  /* Borders & Dividers */
  --border-subtle: #cbd5e1;
  --border-strong: #94a3b8;
  --border-focus: #0369a1;

  /* High-Contrast Typography (all >= 6.7:1 on light surfaces) */
  --text-primary: #0b1324;
  --text-secondary: #27364b;
  --text-muted: #475569;

  /* Domain Accents (all >= 5.1:1 text contrast on white & soft tints) */
  --accent-cyan: #0369a1;
  --accent-cyan-soft: #e0f2fe;
  --accent-cyan-border: #7dd3fc;

  --accent-emerald: #047857;
  --accent-emerald-text: #047857;
  --accent-emerald-soft: #ecfdf5;
  --accent-emerald-border: #6ee7b7;

  --accent-amber: #a1440b;
  --accent-amber-soft: #fef3c7;
  --accent-amber-border: #fcd34d;

  --accent-rose: #be185d;
  --accent-rose-soft: #fce7f3;
  --accent-rose-border: #f9a8d4;

  /* Solid Primary Action Button (5.93:1 contrast) */
  --btn-primary-bg: #0369a1;
  --btn-primary-bg-hover: #075985;
  --btn-primary-text: #ffffff;

  /* Shadows & Grid Overlay */
  --shadow-card: 0 6px 22px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 14px 32px rgba(15, 23, 42, 0.11);
  --grid-line: rgba(3, 105, 161, 0.055);
}

/* Typography Stacks (100% System Native, Zero External Fonts) */
:root {
  --font-serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --container-max: 1280px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;
}

/* Base Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg-primary);
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: var(--accent-cyan);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

/* Universal Keyboard Focus Visibility (WCAG 2.4.7 / 2.4.11) */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.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;
}

/* Skip Link */
.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 9999;
  padding: 0.65rem 1.1rem;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-weight: 700;
  border-radius: var(--radius-md);
  text-decoration: none;
  box-shadow: var(--shadow-card);
}

.skip-link:focus {
  top: 0.75rem;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   Top Ribbon: .prazg-suite-bar (Cross-Portal Visual Continuity)
   ========================================================================== */
.prazg-suite-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-suite-bar);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.suite-bar-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0.5rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.suite-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--accent-cyan-soft);
  border: 1px solid var(--accent-cyan-border);
}

.suite-brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 0 3px var(--accent-emerald-soft);
  flex-shrink: 0;
}

.suite-nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 0.15rem 0;
}

.suite-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.suite-nav-link:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.suite-nav-divider {
  width: 1px;
  height: 16px;
  background: var(--border-subtle);
  margin: 0 0.25rem;
  flex-shrink: 0;
}

.suite-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.suite-dropdown {
  position: relative;
}

.suite-dropdown-summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.suite-dropdown-summary::-webkit-details-marker {
  display: none;
}

.suite-dropdown-summary:hover {
  border-color: var(--accent-cyan);
  color: var(--text-primary);
}

.suite-dropdown[open] .suite-dropdown-summary {
  border-color: var(--accent-cyan);
  color: var(--text-primary);
}

.suite-dropdown-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  width: min(340px, 88vw);
  max-height: 75vh;
  overflow-y: auto;
  padding: 0.65rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hover);
  z-index: 200;
}

.suite-dropdown-group-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  padding: 0.35rem 0.5rem 0.25rem;
}

.suite-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
}

.suite-dropdown-item:hover {
  background: var(--accent-cyan-soft);
  color: var(--accent-cyan);
  text-decoration: none;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.theme-toggle-btn:hover {
  border-color: var(--accent-cyan);
  background: var(--bg-elevated-hover);
}

.theme-toggle-btn svg {
  width: 15px;
  height: 15px;
  color: var(--accent-cyan);
}

/* ==========================================================================
   Hero Masthead & Interactive Stereotactic Neural-Mesh Observatory
   ========================================================================== */
.hero-section {
  position: relative;
  padding: 3rem 0 2.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.85fr);
  gap: 2rem;
  align-items: stretch;
}

.hero-overline {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 0.85rem;
}

.hero-overline-line {
  display: inline-block;
  width: 24px;
  height: 2px;
  background: var(--accent-cyan);
}

.hero-title {
  margin: 0 0 0.45rem;
  font-family: var(--font-serif);
  font-size: clamp(2.15rem, 3.8vw, 3.1rem);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.hero-handle {
  font-family: var(--font-mono);
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 0.4rem;
}

.hero-headline {
  margin: 0 0 1.15rem;
  font-size: clamp(1.08rem, 1.6vw, 1.28rem);
  font-weight: 600;
  color: var(--accent-cyan);
  line-height: 1.4;
}

.affiliation-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.affiliation-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.72rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  color: var(--text-secondary);
}

.affiliation-chip strong {
  color: var(--text-primary);
  font-weight: 600;
}

.hero-lead {
  margin: 0 0 1.45rem;
  color: var(--text-secondary);
  font-size: 0.98rem;
  max-width: 68ch;
}

/* Hero Action Pills */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.15rem;
}

.action-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.action-pill:hover {
  border-color: var(--accent-cyan);
  background: var(--bg-elevated-hover);
  transform: translateY(-1px);
  text-decoration: none;
}

.action-pill--primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-color: transparent;
  font-weight: 700;
}

.action-pill--primary:hover {
  background: var(--btn-primary-bg-hover);
  color: var(--btn-primary-text);
  border-color: transparent;
}

.action-pill svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Secondary Profile Social Strip */
.profile-social-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.95rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.825rem;
  color: var(--text-muted);
}

.profile-social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  padding: 0.2rem 0.35rem;
  border-radius: var(--radius-sm);
}

.profile-social-link:hover {
  color: var(--accent-cyan);
  text-decoration: underline;
}

/* Stereotactic Neural-Mesh Viewport Card */
.stereotactic-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.stereotactic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.95rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.stereotactic-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent-emerald-text);
  font-weight: 600;
}

.stereotactic-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, var(--accent-cyan-soft), transparent 72%);
}

#stereotactic-canvas {
  display: block;
  width: 100%;
  height: 256px;
}

.stereotactic-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0.95rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.mesh-legend {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.mesh-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.legend-dot--cyan { background: var(--accent-cyan); }
.legend-dot--emerald { background: var(--accent-emerald); }
.legend-dot--rose { background: var(--accent-rose); }
.legend-dot--amber { background: var(--accent-amber); }

/* Ecosystem KPI Strip */
.kpi-grid {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.kpi-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-top: 3px solid var(--accent-cyan);
  border-radius: var(--radius-md);
  padding: 1.05rem 1.2rem;
  box-shadow: var(--shadow-card);
}

.kpi-card[data-accent="rose"] { border-top-color: var(--accent-rose); }
.kpi-card[data-accent="emerald"] { border-top-color: var(--accent-emerald); }
.kpi-card[data-accent="amber"] { border-top-color: var(--accent-amber); }

.kpi-value {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 2.6vw, 2.35rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.25rem;
}

.kpi-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

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

/* ==========================================================================
   Shared Editorial Section Headers
   ========================================================================== */
.portal-section {
  padding: 3.25rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent-cyan);
  margin-bottom: 0.35rem;
}

.section-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 2.5vw, 2.05rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

.section-subtitle {
  margin: 0.45rem 0 0;
  color: var(--text-secondary);
  font-size: 0.96rem;
  max-width: 72ch;
}

/* ==========================================================================
   Section 01: "Find the Right Tool" Interactive Workflow Selector
   ========================================================================== */
.workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.workflow-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  width: 100%;
  padding: 1.2rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.workflow-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
  background: var(--bg-elevated-hover);
  box-shadow: var(--shadow-hover);
}

.workflow-card[aria-pressed="true"] {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px var(--accent-cyan-border), var(--shadow-hover);
  background: var(--bg-elevated-hover);
}

.workflow-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.workflow-icon-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-cyan-soft);
  border: 1px solid var(--accent-cyan-border);
  color: var(--accent-cyan);
}

.workflow-card[data-accent="rose"] .workflow-icon-box {
  background: var(--accent-rose-soft);
  border-color: var(--accent-rose-border);
  color: var(--accent-rose);
}

.workflow-card[data-accent="emerald"] .workflow-icon-box {
  background: var(--accent-emerald-soft);
  border-color: var(--accent-emerald-border);
  color: var(--accent-emerald-text);
}

.workflow-card[data-accent="amber"] .workflow-icon-box {
  background: var(--accent-amber-soft);
  border-color: var(--accent-amber-border);
  color: var(--accent-amber);
}

.workflow-icon-box svg {
  width: 20px;
  height: 20px;
}

.workflow-step {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.workflow-goal-title {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
}

.workflow-domain-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.95rem;
}

.workflow-rec-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  width: 100%;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-cyan);
}

/* Active Workflow Recommendation Banner */
.workflow-banner {
  margin-bottom: 1.35rem;
  padding: 1.15rem 1.35rem;
  border-radius: var(--radius-md);
  background: var(--accent-cyan-soft);
  border: 1px solid var(--accent-cyan-border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.workflow-banner[hidden] {
  display: none;
}

.workflow-banner-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.workflow-banner-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.workflow-banner-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-weight: 700;
}

.workflow-banner-tip {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-primary);
  line-height: 1.55;
}

.workflow-banner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.workflow-banner-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ==========================================================================
   Section 02: 10-App Suite Explorer Controls & Cards
   ========================================================================== */
.explorer-toolbar {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.search-input-wrap {
  position: relative;
  flex: 1 1 320px;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  width: 17px;
  height: 17px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  min-height: 42px;
  padding: 0.55rem 5.5rem 0.55rem 2.6rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.94rem;
}

.search-input::placeholder {
  color: var(--text-muted);
}

/* Hide WebKit native search cancel button since we provide an accessible custom clear button */
.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search-shortcut-hint {
  position: absolute;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.kbd-badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 0.14rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.clear-search-btn {
  min-height: 28px;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.clear-search-btn[hidden] {
  display: none;
}

.results-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.filter-rows {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.filter-row-label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-right: 0.35rem;
  min-width: 74px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 36px;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.filter-pill:hover {
  border-color: var(--accent-cyan);
  color: var(--text-primary);
}

.filter-pill[aria-pressed="true"] {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-color: transparent;
}

.filter-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  opacity: 0.88;
}

.reset-filters-btn {
  min-height: 34px;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--accent-cyan);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.reset-filters-btn:hover {
  background: var(--accent-cyan-soft);
}

.reset-filters-btn[hidden] {
  display: none;
}

/* App Cards Grid */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.app-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.45rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.app-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
}

.app-card--recommended {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 1px var(--accent-cyan-border), var(--shadow-card);
}

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

.app-identity {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.app-icon-frame {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--accent-cyan-soft);
  border: 1px solid var(--accent-cyan-border);
  color: var(--accent-cyan);
}

.app-card[data-accent="rose"] .app-icon-frame {
  background: var(--accent-rose-soft);
  border-color: var(--accent-rose-border);
  color: var(--accent-rose);
}

.app-card[data-accent="emerald"] .app-icon-frame {
  background: var(--accent-emerald-soft);
  border-color: var(--accent-emerald-border);
  color: var(--accent-emerald-text);
}

.app-card[data-accent="amber"] .app-icon-frame {
  background: var(--accent-amber-soft);
  border-color: var(--accent-amber-border);
  color: var(--accent-amber);
}

.app-icon-frame svg {
  width: 22px;
  height: 22px;
}

.app-order-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.1rem;
}

.app-title {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

.app-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.domain-badge,
.runtime-badge,
.recommended-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.22rem 0.62rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
}

.domain-badge {
  background: var(--accent-cyan-soft);
  border: 1px solid var(--accent-cyan-border);
  color: var(--accent-cyan);
}

.domain-badge[data-accent="rose"] {
  background: var(--accent-rose-soft);
  border-color: var(--accent-rose-border);
  color: var(--accent-rose);
}

.domain-badge[data-accent="emerald"] {
  background: var(--accent-emerald-soft);
  border-color: var(--accent-emerald-border);
  color: var(--accent-emerald-text);
}

.domain-badge[data-accent="amber"] {
  background: var(--accent-amber-soft);
  border-color: var(--accent-amber-border);
  color: var(--accent-amber);
}

.runtime-badge {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.recommended-pill {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-weight: 700;
}

.app-summary {
  margin: 0 0 1rem;
  color: var(--text-secondary);
  font-size: 0.925rem;
  line-height: 1.58;
}

.capability-tags {
  list-style: none;
  padding: 0;
  margin: 0 0 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.capability-tag {
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--border-subtle);
}

.btn-launch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.btn-launch:hover {
  background: var(--btn-primary-bg-hover);
  color: var(--btn-primary-text);
  text-decoration: none;
}

.btn-repo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.btn-repo:hover {
  border-color: var(--accent-cyan);
  background: var(--bg-subtle);
  text-decoration: none;
}

.empty-state {
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: var(--bg-elevated);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

.empty-state[hidden] {
  display: none;
}

.empty-state h3 {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
  color: var(--text-primary);
}

.empty-state p {
  margin: 0 0 1.1rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Sections 03 & 04: Radiogenomics Frameworks & Nepal Open-Science Portals
   ========================================================================== */
.compact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
}

.research-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.3rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.research-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.research-card-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.research-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-word;
}

/* ==========================================================================
   Section 05: 1-Click Suite Citation & Markdown Directory Exporter
   ========================================================================== */
.exporter-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.exporter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.95rem 1.25rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.export-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.export-tab-btn {
  min-height: 36px;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
}

.export-tab-btn[aria-selected="true"] {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-color: transparent;
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.btn-copy-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 38px;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-copy-primary:hover {
  background: var(--btn-primary-bg-hover);
}

.btn-download-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 38px;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-download-secondary:hover {
  border-color: var(--accent-cyan);
}

.copy-status {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-emerald-text);
}

.export-preview-pre {
  margin: 0;
  padding: 1.15rem 1.35rem;
  max-height: 320px;
  overflow: auto;
  background: var(--bg-code);
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ==========================================================================
   Footer & Non-SaMD Regulatory Governance Notice
   ========================================================================== */
.portal-footer {
  padding: 2.75rem 0 3.25rem;
  background: var(--bg-secondary);
}

.samd-notice {
  padding: 1.15rem 1.35rem;
  border-radius: var(--radius-md);
  background: var(--accent-amber-soft);
  border: 1px solid var(--accent-amber-border);
  margin-bottom: 2rem;
}

.samd-notice-title {
  margin: 0 0 0.3rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent-amber);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.samd-notice p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.footer-columns {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.footer-heading {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.86rem;
}

.footer-bottom {
  padding-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1080px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

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

  .workflow-grid,
  .compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .suite-bar-inner {
    padding: 0.45rem 1rem;
  }

  .container {
    padding: 0 1rem;
  }

  .apps-grid,
  .workflow-grid,
  .compact-grid,
  .footer-columns {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 520px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* Honor Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .prazg-suite-bar,
  .stereotactic-panel,
  .explorer-toolbar,
  .exporter-toolbar {
    display: none !important;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  .app-card,
  .research-card,
  .kpi-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #94a3b8;
  }
}
