/* =====================================================================
   HelvetiaVeritas v2.0 - Sovereign Swiss Dark-Theme Enterprise Styling
   Track 1B: Swiss Voices • Apertus 70B & 8B Multi-Tier Normalization
   ===================================================================== */

:root {
  /* Core Sovereign Dark Palette */
  --bg-core: #060B13;
  --bg-sidebar: #09101C;
  --bg-surface: #0D1624;
  --bg-card: #111C2E;
  --bg-card-hover: #16243A;
  --bg-card-subtle: #0A121F;
  --border-subtle: #1C2B42;
  --border-prominent: #283D5D;
  --border-active: #3D5A85;

  /* Swiss National Accent */
  --swiss-red: #D52B1E;
  --swiss-red-hover: #B82015;
  --swiss-red-glow: rgba(213, 43, 30, 0.28);
  --swiss-red-subtle: rgba(213, 43, 30, 0.12);
  --swiss-white: #FFFFFF;

  /* Sovereign & Status Accents */
  --sovereign-emerald: #10B981;
  --sovereign-emerald-glow: rgba(16, 185, 129, 0.22);
  --sovereign-emerald-subtle: rgba(16, 185, 129, 0.12);
  --apertus-cyan: #06B6D4;
  --apertus-cyan-glow: rgba(6, 182, 212, 0.22);
  --law-gold: #F59E0B;
  --law-gold-bg: rgba(245, 158, 11, 0.12);
  --fedlex-blue: #3B82F6;
  --fedlex-blue-subtle: rgba(59, 130, 246, 0.12);

  /* Cantonal Heraldic Accents */
  --canton-zh: #2563EB;
  --canton-be: #DC2626;
  --canton-bs: #64748B;
  --canton-sg: #16A34A;

  /* High-Contrast Typography */
  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #8E9FB8;
  --text-code: #38BDF8;

  /* Geometry & Shadows */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 24px rgba(213, 43, 30, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-core);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

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

/* =====================================================================
   SIDEBAR NAVIGATION (LEFT PANEL)
   ===================================================================== */
.app-sidebar {
  width: 260px;
  min-width: 260px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 120;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.35rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(6, 11, 19, 0.4);
}

.swiss-cross-icon {
  width: 40px;
  height: 40px;
  background-color: var(--swiss-red);
  border-radius: 9px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 14px var(--swiss-red-glow);
  flex-shrink: 0;
}

.cross-v {
  position: absolute;
  width: 9px;
  height: 25px;
  background-color: var(--swiss-white);
  border-radius: 2px;
}

.cross-h {
  position: absolute;
  width: 25px;
  height: 9px;
  background-color: var(--swiss-white);
  border-radius: 2px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-tag {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--swiss-red);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Sidebar Nav Menu */
.sidebar-nav {
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.nav-item {
  padding: 0.7rem 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.18s ease;
  position: relative;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  color: var(--text-primary);
  background: var(--swiss-red-subtle);
  border: 1px solid rgba(213, 43, 30, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-icon {
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
}

.nav-label {
  flex: 1;
}

.nav-active-indicator {
  width: 4px;
  height: 18px;
  background-color: var(--swiss-red);
  border-radius: 2px;
  position: absolute;
  right: 8px;
}

/* Sidebar Footer & Alpine Vector */
.sidebar-footer {
  margin-top: auto;
  padding: 1rem 0.85rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(6, 11, 19, 0.3);
}

.alpine-vector-graphic {
  width: 100%;
  height: 48px;
  opacity: 0.85;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.slogan-badge {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.slogan-title {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--swiss-red);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.slogan-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
  line-height: 1.35;
}

.slogan-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* =====================================================================
   MAIN APP CONTENT SHELL
   ===================================================================== */
.app-main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-core);
}

/* =====================================================================
   HEADER STRIP
   ===================================================================== */
.app-header-strip {
  padding: 0.85rem 1.75rem;
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pipeline-subtitle {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.status-badge.status-cscs {
  background: var(--sovereign-emerald-subtle);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34D399;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.green-pulse {
  background-color: var(--sovereign-emerald);
  box-shadow: 0 0 8px #10B981;
  animation: pulse-emerald 2s infinite;
}

@keyframes pulse-emerald {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.status-badge.status-fadp {
  background: var(--fedlex-blue-subtle);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #60A5FA;
}

.status-badge.status-fedlex {
  background: var(--law-gold-bg);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #FBBF24;
}

/* User Avatar Cluster */
.user-avatar-cluster {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-prominent);
  padding: 0.25rem 0.75rem 0.25rem 0.35rem;
  border-radius: 24px;
}

.avatar-shield {
  width: 28px;
  height: 28px;
  background: var(--swiss-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: white;
  box-shadow: 0 2px 6px var(--swiss-red-glow);
}

.avatar-meta {
  display: flex;
  flex-direction: column;
}

.avatar-name {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.15;
}

.avatar-role {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* =====================================================================
   PRESETS SELECTION BAR
   ===================================================================== */
.presets-section {
  background: #090F1A;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1.75rem;
}

.presets-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.presets-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 700;
  white-space: nowrap;
}

.presets-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: 1;
}

.preset-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-prominent);
}

.preset-btn.active {
  background: var(--bg-card);
  border-color: var(--swiss-red);
  color: var(--text-primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.canton-tag {
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 800;
}

.canton-tag.zh { background: rgba(37, 99, 235, 0.25); color: #60A5FA; }
.canton-tag.be { background: rgba(220, 38, 38, 0.25); color: #F87171; }
.canton-tag.bs { background: rgba(100, 116, 139, 0.35); color: #E2E8F0; }
.canton-tag.sg { background: rgba(22, 163, 74, 0.25); color: #4ADE80; }

/* =====================================================================
   DUAL COLUMN WORKSPACE GRID
   ===================================================================== */
.workspace-grid {
  padding: 1.5rem 1.75rem;
  display: grid;
  grid-template-columns: 1fr 1.18fr;
  gap: 1.5rem;
  width: 100%;
}

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

.column-left,
.column-right {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* =====================================================================
   LEFT COLUMN 1: SWISS ALPS HERO BANNER
   ===================================================================== */
.hero-banner-alpine {
  background: linear-gradient(180deg, #101B2E 0%, #0A1220 100%);
  border: 1px solid var(--border-prominent);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.hero-banner-backdrop {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 50%;
  height: 100%;
  opacity: 0.15;
  pointer-events: none;
}

.hero-banner-content {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.hero-badge-icon {
  width: 44px;
  height: 44px;
  background: rgba(213, 43, 30, 0.15);
  border: 1px solid rgba(213, 43, 30, 0.4);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.hero-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.hero-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-pill-hero {
  background: var(--sovereign-emerald-subtle);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34D399;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 0 12px var(--sovereign-emerald-glow);
}

/* =====================================================================
   LEFT COLUMN 2: RED ACTION BANNER
   ===================================================================== */
.action-banner-red {
  background: linear-gradient(135deg, #D52B1E 0%, #A11B12 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: 0 4px 20px rgba(213, 43, 30, 0.35);
}

.action-banner-text {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.action-banner-icon {
  font-size: 1.6rem;
}

.action-banner-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.action-banner-sub {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.85);
}

.action-banner-btns {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-open-report {
  background: white;
  color: var(--swiss-red);
  border: none;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
}

.btn-open-report:hover {
  background: #F8FAFC;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.btn-banner-transform {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.btn-banner-transform:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
}


/* =====================================================================
   LEFT COLUMN 3: CANTONAL HEURISTIC CARD
   ===================================================================== */
.canton-heuristic-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  box-shadow: var(--shadow-card);
}

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

.card-header-label {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.confidence-pill {
  background: var(--sovereign-emerald-subtle);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 800;
}

.canton-details-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #09101C;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}

.canton-flag {
  font-size: 2.2rem;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.canton-meta {
  display: flex;
  flex-direction: column;
}

.canton-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
}

.canton-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* Distribution Bar */
.distribution-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.distribution-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
}

.distribution-bar {
  height: 8px;
  background: #080C14;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
}

.dist-seg {
  height: 100%;
  transition: width 0.4s ease;
}

.dist-zh { background-color: var(--canton-zh); }
.dist-be { background-color: var(--canton-be); }
.dist-bs { background-color: var(--canton-bs); }
.dist-sg { background-color: var(--canton-sg); }

/* Cantonal Gauges Grid */
.cantonal-gauges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

@media (max-width: 580px) {
  .cantonal-gauges-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.canton-gauge-card {
  background: #09101C;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition: all 0.2s ease;
}

.canton-gauge-card.active-canton {
  border-color: var(--swiss-red);
  background: rgba(213, 43, 30, 0.08);
}

.canton-gauge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 700;
}

.canton-gauge-pct {
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  font-weight: 800;
}

.gauge-meter-bg {
  width: 100%;
  height: 5px;
  background: #111C2E;
  border-radius: 3px;
  overflow: hidden;
}

.gauge-meter-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease-out;
}

.gauge-zh { background: var(--canton-zh); }
.gauge-be { background: var(--canton-be); }
.gauge-bs { background: var(--canton-bs); }
.gauge-sg { background: var(--canton-sg); }

/* Dialect Marker Chips */
.markers-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.markers-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.tags-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.marker-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.marker-token {
  font-weight: 800;
  color: #38BDF8;
}

.marker-arrow {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.marker-gloss {
  color: var(--text-secondary);
}

/* Phonology Alemannic Traits */
.phonology-group {
  background: rgba(13, 22, 36, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
}

.phonology-list {
  padding-left: 1.1rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.35rem;
}

.empty-hint {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-style: italic;
}

/* =====================================================================
   LEFT COLUMN 4: CRYPTOGRAPHIC ATTESTATION CARD
   ===================================================================== */
.attestation-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-card);
}

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

.attestation-shield {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.shield-icon {
  font-size: 1.3rem;
}

.attestation-title {
  font-size: 0.95rem;
  display: block;
}

.attestation-status {
  font-size: 0.76rem;
  color: #34D399;
  font-weight: 700;
}

.cert-btn {
  background: var(--apertus-cyan-glow);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: #38BDF8;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.cert-btn:hover {
  background: rgba(6, 182, 212, 0.25);
}

.hashes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

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

.hash-item {
  background: #09101C;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 0.55rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.hash-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
}

.hash-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.76rem;
  color: var(--text-code);
  word-break: break-all;
  line-height: 1.3;
}

.attestation-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.2rem;
}

.dossier-pdf-btn {
  width: 100%;
  background: linear-gradient(135deg, #1C2738 0%, #101826 100%);
  border: 1px solid var(--swiss-red);
  color: white;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(213, 43, 30, 0.2);
}

.dossier-pdf-btn:hover {
  background: linear-gradient(135deg, #D52B1E 0%, #B82015 100%);
  box-shadow: 0 6px 18px rgba(213, 43, 30, 0.4);
  transform: translateY(-1px);
}

.download-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-prominent);
  color: var(--text-secondary);
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.download-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--apertus-cyan);
}

/* =====================================================================
   RIGHT COLUMN 1: DIALECT INPUT CARD (QUOTE STYLING)
   ===================================================================== */
.dialect-input-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-card);
}

.input-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.language-badge {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38BDF8;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.canton-select {
  background: #09101C;
  border: 1px solid var(--border-prominent);
  color: var(--text-primary);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.canton-select:focus {
  outline: none;
  border-color: var(--apertus-cyan);
}

.textarea-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Quote styling on textarea */
.dialect-textarea {
  width: 100%;
  background: #070D17;
  border: 1px solid var(--border-prominent);
  border-left: 4px solid var(--swiss-red);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  color: #F1F5F9;
  font-size: 0.98rem;
  line-height: 1.65;
  font-family: inherit;
  resize: vertical;
  min-height: 160px;
  transition: border-color 0.2s ease;
  font-style: italic;
}

.dialect-textarea:focus {
  outline: none;
  border-color: var(--apertus-cyan);
  border-left-color: var(--swiss-red);
  background: #09101C;
}

.textarea-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.text-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
}

.text-action-btn:hover {
  color: #F87171;
}

/* Model Switcher Cluster */
.model-selection-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  background: #09101C;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.model-switch-cluster {
  display: flex;
  background: #060B13;
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-prominent);
  gap: 3px;
}

.model-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.35rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.model-toggle-btn:hover {
  color: var(--text-primary);
}

.model-toggle-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-prominent);
}

.model-toggle-btn.active.tier-70b {
  color: #38BDF8;
  border-color: rgba(6, 182, 212, 0.4);
}

.model-toggle-btn.active.tier-8b {
  color: #34D399;
  border-color: rgba(16, 185, 129, 0.4);
}

/* Submit Action Button */
.primary-btn {
  width: 100%;
  background: linear-gradient(135deg, #D52B1E 0%, #A11B12 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  box-shadow: 0 4px 18px rgba(213, 43, 30, 0.35);
  transition: all 0.2s ease;
}

.primary-btn:hover {
  background: linear-gradient(135deg, #EA2E20 0%, #B82015 100%);
  box-shadow: 0 6px 24px rgba(213, 43, 30, 0.5);
  transform: translateY(-1px);
}

.primary-btn:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
}

.btn-badge {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* =====================================================================
   RIGHT COLUMN 2: TELEMETRY DASHBOARD STRIP
   ===================================================================== */
.telemetry-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  background: #09101C;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

@media (max-width: 680px) {
  .telemetry-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

.telemetry-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.telemetry-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.telemetry-val {
  font-size: 0.92rem;
  font-weight: 800;
  color: #F8FAFC;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.telemetry-val.highlight {
  color: #38BDF8;
}

/* =====================================================================
   RIGHT COLUMN 3: NORMALIZED SCHWEIZER HOCHDEUTSCH OUTPUT CARD
   ===================================================================== */
.output-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-prominent);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: var(--shadow-card);
}

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

.output-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--border-prominent);
}

.normalized-box {
  background: #070D17;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  font-size: 1.02rem;
  line-height: 1.65;
  color: #F1F5F9;
  white-space: pre-wrap;
  min-height: 140px;
}

.placeholder-text {
  color: var(--text-muted);
  font-style: italic;
}

/* Pipeline runtime badge */
.pipeline-runtime-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: #09101C;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

.runtime-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

.runtime-dot.active {
  background-color: #10B981;
  box-shadow: 0 0 6px #10B981;
}

/* =====================================================================
   RIGHT COLUMN 4: IDENTIFIZIERTE SCHWEIZER GESETZESARTIKEL CARD
   ===================================================================== */
.statutes-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-card);
}

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

.statutes-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.statutes-icon {
  font-size: 1.4rem;
}

.statutes-title {
  font-size: 1.1rem;
  font-weight: 800;
}

.statutes-domain {
  font-size: 0.82rem;
  color: var(--law-gold);
  font-weight: 700;
}

.articles-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.article-row {
  background: #09101C;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: border-color 0.2s;
}

.article-row:hover {
  border-color: var(--border-prominent);
}

.article-headline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.article-badge-law {
  background-color: var(--law-gold-bg);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 800;
}

.article-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.article-relevance {
  font-size: 0.78rem;
  color: #34D399;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.12);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.article-summary {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.article-remedy {
  font-size: 0.84rem;
  color: #93C5FD;
  background: rgba(37, 99, 235, 0.12);
  padding: 0.55rem 0.75rem;
  border-radius: 4px;
  border-left: 3px solid #3B82F6;
}

.article-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  margin-top: 0.25rem;
}

.article-authority {
  color: var(--text-muted);
}

.article-fedlex-link {
  color: #38BDF8;
  text-decoration: none;
  font-weight: 600;
}

.article-fedlex-link:hover {
  text-decoration: underline;
}

/* Procedural steps */
.procedural-steps-card {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}

.steps-title {
  font-size: 0.88rem;
  color: #34D399;
  margin-bottom: 0.4rem;
  font-weight: 700;
}

.steps-list {
  padding-left: 1.2rem;
  font-size: 0.84rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* =====================================================================
   CERTIFICATE MODAL
   ===================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-prominent);
  border-radius: var(--radius-lg);
  max-width: 820px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.modal-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #09101C;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.modal-crest {
  font-size: 1.8rem;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
}

.modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.cert-formal-header {
  display: flex;
  gap: 1.5rem;
  background: #070D17;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  align-items: center;
}

.cert-stamp {
  width: 130px;
  height: 90px;
  border: 2px dashed var(--swiss-red);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--swiss-red);
  font-weight: 800;
  padding: 0.4rem;
  flex-shrink: 0;
}

.stamp-title {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.stamp-code {
  font-size: 0.7rem;
}

.stamp-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.cert-metadata {
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: var(--text-secondary);
}

.cert-metadata span {
  color: var(--text-primary);
  font-family: ui-monospace, monospace;
}

.raw-json-viewer {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.json-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.copy-json-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
}

.copy-json-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-prominent);
}

.json-pre {
  background: #05080E;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem;
  max-height: 280px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  color: #38BDF8;
  line-height: 1.45;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background-color: #09101C;
}

.modal-action-btn {
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
}

.modal-action-btn.primary {
  background: var(--swiss-red);
  color: white;
}

.modal-action-btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

/* =====================================================================
   APP FOOTER
   ===================================================================== */
.app-footer {
  background-color: var(--bg-sidebar);
  border-top: 1px solid var(--border-subtle);
  padding: 0.9rem 1.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: auto;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* =====================================================================
   RESPONSIVE LAYOUT & MEDIA QUERIES
   ===================================================================== */
@media (max-width: 900px) {
  .app-layout {
    flex-direction: column;
  }
  .app-sidebar {
    width: 100%;
    min-width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
  .sidebar-brand {
    padding: 1rem 1.25rem;
  }
  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 0.5rem 1rem;
    gap: 0.35rem;
    white-space: nowrap;
  }
  .sidebar-footer {
    display: none;
  }
  .workspace-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  .telemetry-strip {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .app-header-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .header-right {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .telemetry-strip {
    grid-template-columns: 1fr;
  }
  .hashes-grid {
    grid-template-columns: 1fr;
  }
  .cert-formal-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .canton-details-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .action-banner-red {
    flex-direction: column;
    align-items: flex-start;
  }
  .action-banner-btns {
    width: 100%;
    justify-content: flex-start;
  }
}
