/**
 * CM-LAB Showcase Master Stylesheet
 * File: apps/showcase/styles/main.css
 * Follows W3C DTCG 3-Tier Design System & WCAG 2.1 AA/AAA Specifications
 */

@import "./tokens.css";

/* ==========================================================================
   1. MODERN RESET & BOX-SIZING
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  color-scheme: light dark;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  min-height: var(--height-viewport);
  background-color: var(--color-surface-canvas);
  color: var(--color-text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color 200ms ease, color 200ms ease;
}

/* Typography elements */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-text-primary);
  font-weight: 700;
  line-height: 1.25;
}

p {
  color: var(--color-text-secondary);
}

a {
  color: var(--color-brand-primary);
  text-decoration: none;
  transition: color 150ms ease;
}

a:hover {
  color: var(--color-brand-accent);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

code, pre, .font-mono {
  font-family: var(--font-mono);
}

/* ==========================================================================
   2. ACCESSIBILITY & FOCUS INVARIANTS (WCAG SC 2.4.11 / 1.4.11)
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--color-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-width: 0;
}

/* Coarse-pointer touch target expansion (WCAG SC 2.5.8) */
@media (pointer: coarse) {
  .btn, .btn-compact, .chip, .calendar-tab-btn, .theme-toggle-btn {
    min-height: 44px;
    min-width: 44px;
  }
}

/* ==========================================================================
   3. LAYOUT SHELL & CONTAINER GEOMETRY
   ========================================================================== */
.showcase-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.layout-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

@media (min-width: 600px) {
  .layout-container {
    padding: 0 var(--space-6);
  }
}

@media (min-width: 1200px) {
  .layout-container {
    padding: 0 var(--space-8);
  }
}

.section-spacing {
  padding: var(--space-12) 0;
}

.card {
  background-color: var(--color-surface-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--elevation-sm);
  transition: background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.card:hover {
  box-shadow: var(--elevation-md);
}

/* ==========================================================================
   4. STICKY UTILITY HEADER
   ========================================================================== */
.showcase-header {
  position: sticky;
  top: 0;
  z-index: var(--z-index-navbar);
  background-color: var(--color-surface-card);
  border-bottom: 1px solid var(--color-border-subtle);
  backdrop-filter: blur(8px);
  padding-top: var(--padding-safe-top);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-primary);
  font-weight: 700;
  font-size: 18px;
}

.brand-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-brand-primary), var(--color-brand-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 18px;
}

.nav-links {
  display: none;
  gap: var(--space-6);
}

@media (min-width: 900px) {
  .nav-links {
    display: flex;
    align-items: center;
  }
}

.nav-item {
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.nav-item:hover {
  color: var(--color-text-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  min-height: 40px;
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 150ms ease;
}

.btn-compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-3);
  min-height: 34px;
  font-weight: 600;
  font-size: 13px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 150ms ease;
}

.btn-primary {
  background-color: var(--color-brand-primary);
  color: #FFFFFF;
}

.btn-primary:hover {
  background-color: var(--color-brand-primary-hover);
}

/* Ratified High-Contrast Accent Button */
.btn-accent {
  background-color: var(--color-brand-accent-contrast); /* #B44A2D */
  color: #FFFFFF;
}

.btn-accent:hover {
  background-color: var(--color-primitive-coral-700);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--color-border-default);
  color: var(--color-text-primary);
}

.btn-outline:hover {
  background-color: var(--color-surface-subtle);
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
}

/* ==========================================================================
   5. HERO SECTION: "TWO FACES OF GROUND TRUTH"
   ========================================================================== */
.hero-section {
  padding: var(--space-16) 0 var(--space-12) 0;
  background: radial-gradient(circle at 50% 0%, var(--color-surface-subtle) 0%, var(--color-surface-canvas) 70%);
  border-bottom: 1px solid var(--color-border-subtle);
}

.hero-inner {
  text-align: center;
  max-width: 880px;
  margin: 0 auto;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background-color: var(--color-status-protected-bg);
  color: var(--color-status-protected-text);
  border: 1px solid var(--color-status-protected-border);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.hero-title {
  font-size: 38px;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 52px;
  }
}

.hero-title .text-gradient {
  background: linear-gradient(135deg, var(--color-brand-primary), var(--color-brand-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-8);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-10);
}

.hero-pillars-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  text-align: left;
}

@media (min-width: 768px) {
  .hero-pillars-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.pillar-card {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background-color: var(--color-surface-card);
  border: 1px solid var(--color-border-subtle);
}

.pillar-icon {
  font-size: 24px;
  margin-bottom: var(--space-2);
}

.pillar-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.pillar-desc {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

/* ==========================================================================
   6. SPLIT-SCREEN MCP PLAYGROUND (FEATURE 5)
   ========================================================================== */
.playground-section {
  padding: var(--space-12) 0;
}

.section-header {
  margin-bottom: var(--space-8);
}

.section-tag {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-brand-accent-contrast);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-1);
  display: block;
}

.section-title {
  font-size: 28px;
  margin-bottom: var(--space-2);
}

.section-subtitle {
  font-size: 15px;
  max-width: 680px;
}

.playground-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 1024px) {
  .playground-grid {
    grid-template-columns: 7fr 5fr;
  }
}

/* Left Sub-Panel: MCP Protocol Console */
.mcp-console-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  border-bottom: 1px solid var(--color-border-subtle);
  padding-bottom: var(--space-3);
}

.controls-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 600px) {
  .controls-row {
    grid-template-columns: 1fr 1fr;
  }
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-1);
}

.form-select, .form-textarea {
  width: 100%;
  background-color: var(--color-surface-subtle);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-size: 13px;
}

.form-textarea {
  font-family: var(--font-mono);
  font-size: 12px;
  min-height: 120px;
  resize: vertical;
}

.actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.actions-left, .actions-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Latency badge */
.latency-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 12px;
  font-family: var(--font-mono);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background-color: var(--color-surface-subtle);
  border: 1px solid var(--color-border-subtle);
}

.latency-badge.status-protected {
  background-color: var(--color-status-protected-bg);
  color: var(--color-status-protected-text);
  border-color: var(--color-status-protected-border);
}

/* Wire Protocol Streamer */
.stream-output-wrapper {
  background-color: var(--color-surface-sunken);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  max-height: 380px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
}

.stream-empty {
  padding: var(--space-8);
  text-align: center;
  color: var(--color-text-muted);
}

.stream-frame {
  margin-bottom: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background-color: var(--color-surface-card);
  overflow: hidden;
}

.stream-frame-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  background-color: var(--color-surface-subtle);
  border-bottom: 1px solid var(--color-border-subtle);
  font-size: 11px;
}

.stream-frame-badge {
  font-weight: 700;
}

.stream-outbound .stream-frame-badge {
  color: var(--color-primitive-blue-600);
}

.stream-inbound .stream-frame-badge {
  color: var(--color-status-protected);
}

.stream-error .stream-frame-badge {
  color: var(--color-status-urgent);
}

.stream-frame-body {
  padding: var(--space-3);
  margin: 0;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Right Sub-Panel: Live App Simulator */
.app-simulator-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.simulator-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  border-bottom: 1px solid var(--color-border-subtle);
  padding-bottom: var(--space-3);
}

.simulator-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-brand-primary);
  text-transform: uppercase;
}

.simulator-items-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.sim-card {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  background-color: var(--color-surface-card);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.sim-card-active {
  transform: scale(1.02);
  border-color: var(--color-interactive-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.sim-card-header {
  display: flex;
  flex-direction: column;
}

.sim-card-brand-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.sim-card-name {
  font-size: 15px;
  font-weight: 700;
}

.sim-card-merchant {
  font-size: 12px;
}

/* Status Badges with Geometric Cues */
.sim-status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
}

.status-urgent {
  background-color: var(--color-status-urgent-bg);
  color: var(--color-status-urgent-text);
  border: 1px solid var(--color-status-urgent-border);
}

.status-warning {
  background-color: var(--color-status-warning-bg);
  color: var(--color-status-warning-text);
  border: 1px solid var(--color-status-warning-border);
}

.status-protected {
  background-color: var(--color-status-protected-bg);
  color: var(--color-status-protected-text);
  border: 1px solid var(--color-status-protected-border);
}

.status-urgent-text {
  color: var(--color-status-urgent);
}

.status-warning-text {
  color: var(--color-status-warning);
}

.status-protected-text {
  color: var(--color-status-protected);
}

.sim-card-statutory {
  font-size: 11px;
}

.sim-card-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.simulator-footer-hint {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--color-text-muted);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border-subtle);
}

/* Quick Capture Progress Simulator */
.sim-capture-progress {
  padding: var(--space-3);
  background-color: var(--color-surface-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
}

.capture-progress-bar {
  height: 6px;
  background-color: var(--color-border-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.capture-progress-fill {
  height: 100%;
  background-color: var(--color-status-protected);
  transition: width 300ms ease;
}

.capture-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

/* ==========================================================================
   7. SHOWCASE UNIFIED OMNIBAR SEARCH (FEATURE 10)
   ========================================================================== */
.omnibar-section {
  padding: var(--space-8) 0;
}

.omnibar-card {
  position: relative;
  padding: var(--space-4);
}

.omnibar-input-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background-color: var(--color-surface-subtle);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  padding: 0 var(--space-4);
  height: 52px;
}

.omnibar-input-row:focus-within {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.omnibar-search-icon {
  font-size: 18px;
}

.omnibar-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--color-text-primary);
  font-size: 16px;
  outline: none;
}

.omnibar-badges-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.omnibar-hotkey-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background-color: var(--color-surface-canvas);
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-muted);
}

.omnibar-clear-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 14px;
}

.omnibar-filter-chips {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
  overflow-x: auto;
}

.chip {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-full);
  background-color: var(--color-surface-subtle);
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-secondary);
  cursor: pointer;
}

.chip:hover {
  background-color: var(--color-surface-canvas);
}

.chip-active {
  background-color: var(--color-brand-primary);
  color: #FFFFFF;
  border-color: var(--color-brand-primary);
}

.omnibar-dropdown {
  margin-top: var(--space-3);
  border-top: 1px solid var(--color-border-subtle);
  padding-top: var(--space-3);
  max-height: 400px;
  overflow-y: auto;
}

.omnibar-timing-row {
  font-size: 11px;
  margin-bottom: var(--space-2);
}

.omnibar-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  margin: var(--space-3) 0 var(--space-2) 0;
}

.omnibar-match-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 100ms ease;
}

.omnibar-match-item:hover {
  background-color: var(--color-surface-subtle);
}

.match-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.match-icon {
  font-size: 20px;
}

.match-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 14px;
}

.match-sub {
  font-size: 11px;
}

.badge-subtle {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background-color: var(--color-surface-sunken);
  color: var(--color-text-muted);
}

.badge-protected {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background-color: var(--color-status-protected-bg);
  color: var(--color-status-protected-text);
  font-weight: 600;
}

.badge-price {
  font-weight: 700;
  font-size: 13px;
  margin-right: var(--space-2);
}

/* Fallback suggestions */
.omnibar-fallback-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.omnibar-fallback-action {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px dashed var(--color-border-default);
  background-color: var(--color-surface-subtle);
  color: var(--color-text-primary);
  text-align: left;
  cursor: pointer;
}

.omnibar-fallback-action:hover {
  background-color: var(--color-surface-sunken);
  border-color: var(--color-brand-accent);
}

.action-icon {
  font-size: 20px;
}

.action-text {
  display: flex;
  flex-direction: column;
  font-size: 13px;
}

/* Command items */
.command-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: 13px;
}

.command-verb {
  color: var(--color-brand-accent);
  width: 90px;
}

.command-desc {
  flex: 1;
}

/* ==========================================================================
   8. THREE DISTINCT CALENDAR WIDGETS (FEATURES 7, 8, 9)
   ========================================================================== */
.calendar-section {
  padding: var(--space-12) 0;
}

.calendar-suite-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.calendar-view-tabs {
  display: flex;
  gap: var(--space-2);
  background-color: var(--color-surface-subtle);
  padding: 4px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
}

.calendar-tab-btn {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.calendar-tab-btn.active {
  background-color: var(--color-surface-card);
  color: var(--color-text-primary);
  box-shadow: var(--elevation-sm);
}

/* Calendar 1: DIN Monthly Grid */
.calendar-grid-card {
  padding: var(--space-6);
}

.cal-grid-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.cal-nav-left {
  display: flex;
  gap: var(--space-2);
}

.cal-current-label {
  font-size: 18px;
}

.cal-din-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  background-color: var(--color-surface-subtle);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
}

.cal-weekdays-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-secondary);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border-subtle);
}

.cal-grid-matrix {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background-color: var(--color-border-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: var(--space-2);
}

.cal-cell {
  min-height: 90px;
  background-color: var(--color-surface-card);
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
}

.cal-cell-pad {
  background-color: var(--color-surface-subtle);
  opacity: 0.5;
}

.cal-cell-today {
  background-color: var(--color-surface-subtle);
}

.cal-cell-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.today-marker {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: var(--radius-xs);
  background-color: var(--color-brand-primary);
  color: #FFFFFF;
}

.cal-cell-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.cal-event-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  border-radius: var(--radius-xs);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.pill-urgent {
  background-color: var(--color-status-urgent-bg);
  color: var(--color-status-urgent-text);
  border-left: 2px solid var(--color-status-urgent-border);
}

.pill-warning {
  background-color: var(--color-status-warning-bg);
  color: var(--color-status-warning-text);
  border-left: 2px solid var(--color-status-warning);
}

.pill-protected {
  background-color: var(--color-status-protected-bg);
  color: var(--color-status-protected-text);
  border-left: 2px solid var(--color-status-protected);
}

.cal-event-more {
  font-size: 9px;
  color: var(--color-text-muted);
  padding-left: 4px;
}

/* Calendar 2: Timeline Agenda Horizon */
.calendar-timeline-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.timeline-spotlight-banner {
  background-color: var(--color-surface-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.spotlight-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-brand-accent-contrast);
  margin-bottom: var(--space-1);
}

.spotlight-text {
  font-size: 14px;
  margin-bottom: var(--space-4);
}

.dual-phase-bar-wrapper {
  margin-top: var(--space-4);
}

.dual-phase-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: var(--space-2);
  color: var(--color-text-secondary);
}

.dual-phase-bar {
  position: relative;
  height: 28px;
  background-color: var(--color-surface-sunken);
  border-radius: var(--radius-md);
  overflow: visible;
  display: flex;
}

.phase-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  height: 100%;
}

.phase-protected {
  background-color: var(--color-status-protected-bg);
  color: var(--color-status-protected-text);
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
}

.phase-warning {
  background-color: var(--color-status-warning-bg);
  color: var(--color-status-warning-text);
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

.cliff-divider {
  width: 2px;
  height: 100%;
  background-color: var(--color-status-urgent);
  z-index: 2;
}

.progress-pin {
  position: absolute;
  top: -18px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pin-marker {
  font-size: 10px;
  font-family: var(--font-mono);
  background-color: var(--color-text-primary);
  color: var(--color-text-inverse);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}

.timeline-horizons-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.horizon-title {
  font-size: 16px;
  margin-bottom: var(--space-3);
}

.horizon-items-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 768px) {
  .horizon-items-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.timeline-item-card {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background-color: var(--color-surface-subtle);
  border-left: 4px solid var(--color-border-default);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.timeline-item-card.status-urgent {
  border-left-color: var(--color-status-urgent);
}

.timeline-item-card.status-warning {
  border-left-color: var(--color-status-warning);
}

.timeline-item-card.status-protected {
  border-left-color: var(--color-status-protected);
}

.timeline-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.timeline-glyph {
  font-size: 16px;
  margin-right: var(--space-2);
}

.timeline-name {
  flex: 1;
  font-size: 14px;
}

.timeline-meta {
  font-size: 11px;
}

.timeline-urgency-badge {
  font-size: 12px;
}

/* Calendar 3: Countdown & Risk Heatmap */
.calendar-heatmap-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.heatmap-kpi-banner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 600px) {
  .heatmap-kpi-banner {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .heatmap-kpi-banner {
    grid-template-columns: repeat(4, 1fr);
  }
}

.kpi-block {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background-color: var(--color-surface-subtle);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.kpi-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.kpi-value {
  font-size: 24px;
  font-weight: 800;
}

.kpi-subtext {
  font-size: 12px;
}

.heatmap-matrix-wrapper {
  background-color: var(--color-surface-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.heatmap-matrix-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.heatmap-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.heatmap-grid {
  display: grid;
  grid-template-rows: repeat(7, 12px);
  grid-auto-flow: column;
  grid-auto-columns: 12px;
  gap: 3px;
  overflow-x: auto;
  padding-bottom: var(--space-2);
}

.hm-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  cursor: pointer;
  transition: transform 100ms ease;
}

.hm-cell:hover {
  transform: scale(1.3);
  z-index: 5;
}

.level-0 { background-color: var(--color-border-subtle); }
.level-1 { background-color: #94A3B8; }
.level-2 { background-color: #F59E0B; }
.level-3 { background-color: #D97706; }
.level-4 { background-color: #DC2626; }

.heatmap-months-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  padding: 0 var(--space-2);
}

/* ==========================================================================
   9. MODULAR DASHBOARD WIDGETS
   ========================================================================== */
.widgets-section {
  padding: var(--space-12) 0;
}

.widgets-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 900px) {
  .widgets-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .widgets-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Urgent Attention Banner */
.urgent-banner {
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.banner-urgent {
  background-color: var(--color-status-urgent-bg);
  border: 1px solid var(--color-status-urgent-border);
}

.banner-safe {
  background-color: var(--color-status-protected-bg);
  border: 1px solid var(--color-status-protected-border);
}

.banner-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.banner-pulsing-icon {
  font-size: 28px;
  animation: pulseIcon 2s infinite ease-in-out;
}

@keyframes pulseIcon {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.banner-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-status-urgent-text);
  letter-spacing: 0.05em;
}

.banner-title {
  font-size: 18px;
  color: var(--color-status-urgent-text);
}

/* Radar widget */
.radar-metrics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.radar-metric-item {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background-color: var(--color-surface-subtle);
  display: flex;
  flex-direction: column;
}

.metric-label { font-size: 12px; }
.metric-value { font-size: 20px; }
.metric-note { font-size: 11px; }

/* GoBD Feed */
.gobd-feed-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.gobd-feed-item {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background-color: var(--color-surface-subtle);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}

.feed-item-top {
  display: flex;
  justify-content: space-between;
}

.feed-hash {
  font-size: 11px;
  word-break: break-all;
}

.feed-meta {
  font-size: 11px;
}

/* Safe Harbor Legal */
.safe-harbor-section {
  padding: var(--space-8) 0;
}

.safe-harbor-box {
  border-left: 4px solid var(--color-brand-primary);
}

.safe-harbor-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.safe-harbor-title {
  font-size: 15px;
}

.safe-harbor-text {
  font-size: 13px;
  margin-bottom: var(--space-2);
  line-height: 1.5;
}

.safe-harbor-citations {
  font-size: 11px;
  color: var(--color-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border-subtle);
}

/* ==========================================================================
   10. AI AGENT QUICK-CONNECT DRAWER (DIALOG)
   ========================================================================== */
.drawer-modal {
  border: none;
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  background-color: var(--color-surface-card);
  color: var(--color-text-primary);
  max-width: 680px;
  width: 90%;
  margin: auto;
  box-shadow: var(--elevation-xl);
}

.drawer-modal::backdrop {
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border-subtle);
}

.drawer-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  overflow-x: auto;
}

.drawer-tab {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background-color: var(--color-surface-subtle);
  color: var(--color-text-secondary);
  cursor: pointer;
}

.drawer-tab.active {
  background-color: var(--color-brand-primary);
  color: #FFFFFF;
  border-color: var(--color-brand-primary);
}

.drawer-tab-panel {
  display: none;
  flex-direction: column;
  gap: var(--space-3);
}

.drawer-tab-panel.active {
  display: flex;
}

.drawer-pre {
  background-color: var(--color-surface-sunken);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-x: auto;
}

/* ==========================================================================
   11. FOOTER
   ========================================================================== */
.showcase-footer {
  margin-top: auto;
  background-color: var(--color-surface-card);
  border-top: 1px solid var(--color-border-subtle);
  padding: var(--space-8) 0;
  font-size: 13px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-links {
  display: flex;
  gap: var(--space-4);
}

/* ==========================================================================
   MOBILE RESPONSIVE CALENDAR OPTIMIZATIONS (<= 600px / 375px Viewports)
   ========================================================================== */

@media (max-width: 600px) {
  /* 1. Reclaim card horizontal margins: 48px -> 24px (recovers 24px) */
  .calendar-grid-card {
    padding: var(--space-3);
  }

  /* 2. Touch-scrollable tabs to prevent horizontal viewport breakout */
  .calendar-view-tabs {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 3px;
    gap: var(--space-1);
  }
  .calendar-view-tabs::-webkit-scrollbar {
    display: none;
  }
  .calendar-tab-btn {
    flex-shrink: 0;
    padding: 6px 10px;
    font-size: 12px;
  }

  /* 3. Reflow navigation controls into clean vertical hierarchy */
  .cal-grid-nav {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
  }
  .cal-current-label {
    text-align: center;
    font-size: 16px;
    order: -1; /* Month label placed prominently at top */
  }
  .cal-nav-left {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: var(--space-1);
  }
  .cal-nav-left .btn-compact {
    flex: 1;
    padding: 0 4px;
    font-size: 11px;
    height: 36px; /* Compact mobile touch target */
    text-align: center;
  }
  .cal-nav-right {
    text-align: center;
  }

  /* 4. Cell padding optimization: reduce from 8px to 2px horizontal */
  .cal-cell {
    min-height: 58px; /* Reduced from 90px to prevent 540px+ scroll lock */
    padding: var(--space-1) 2px;
  }

  /* 5. Clean top row with subtle today indicator */
  .cal-cell-top {
    font-size: 11px;
    margin-bottom: 2px;
    justify-content: center;
  }
  .today-marker {
    display: none; /* Hide bulky text badge on mobile */
  }
  .cal-cell-today {
    outline: 2px solid var(--color-brand-primary);
    outline-offset: -2px;
  }

  /* 6. Event pill mobile ergonomics: centered glyph, tap for details */
  .cal-cell-events {
    gap: 2px;
  }
  .cal-event-pill {
    padding: 2px 2px;
    justify-content: center;
    gap: 0;
    min-height: 18px;
  }
  .pill-glyph {
    font-size: 12px;
    line-height: 1;
  }
  .pill-name {
    display: none; /* Hide truncated text name on mobile screens */
  }
  .cal-event-more {
    font-size: 8px;
    text-align: center;
    padding-left: 0;
  }
}

