/**
 * LatestWin Enterprise Design System — Anti-AI Aesthetic (v3.0)
 * Inspired by Linear, Vercel, Raycast, Windows Admin Center & Microsoft Intune.
 * Editorial typography, functional minimalism, information density, hairline borders.
 */

:root {
  color-scheme: light;

  /* Layout Dimensions */
  --sidebar-width: 224px;
  --sidebar-collapsed-width: 56px;
  --topbar-height: 46px;
  --content-max-width: 1320px;

  /* Typography Scale — Bilingual Editorial Grade */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
  --font-mono: "Cascadia Code", "Cascadia Mono", ui-monospace, SFMono-Regular, "SF Mono", Monaco, Consolas, "Liberation Mono", monospace;

  --text-3xs: 0.625rem;  /* 10px */
  --text-2xs: 0.6875rem; /* 11px */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.8125rem;  /* 13px Standard Data Grid */
  --text-base: 0.875rem; /* 14px Standard Reading */
  --text-md: 0.9375rem;  /* 15px */
  --text-lg: 1.0625rem;  /* 17px Section Header */
  --text-xl: 1.25rem;    /* 20px Page Title */
  --text-2xl: 1.5rem;    /* 24px Headline */

  /* Spacing Scale (Strict 4px/8px) */
  --space-05: 2px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* Crisp Radii (Strictly 2px - 6px, NO 9999px pill shapes) */
  --radius-xs: 2px;
  --radius-sm: 3px;
  --radius-md: 4px;
  --radius-lg: 6px;

  /* Light Theme Surfaces & Palette (Specified in section 04) */
  --bg-canvas: #ffffff;
  --bg-surface: #ffffff;
  --bg-subtle: #f8f9fb;
  --bg-hover: #f1f3f6;
  --bg-active: #e9ecef;
  
  --border: #e5e7eb;
  --border-subtle: #f0f1f3;
  --border-strong: #d1d5db;
  --border-focus: #2563eb;
  --focus-ring: rgba(37, 99, 235, 0.18);

  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --text-tertiary: #9ca3af;
  --text-link: #2563eb;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-subtle: #eff6ff;
  --brand: var(--accent);

  /* Semantic Status Tokens (Quiet, Low-Saturation Enterprise Palette) */
  --status-rec-text: #065f46;
  --status-rec-bg: #f0fdf4;
  --status-rec-border: #bbf7d0;
  --status-rec-dot: #16a34a;

  --status-act-text: #1e40af;
  --status-act-bg: #eff6ff;
  --status-act-border: #bfdbfe;
  --status-act-dot: #2563eb;

  --status-warn-text: #92400e;
  --status-warn-bg: #fffbeb;
  --status-warn-border: #fde68a;
  --status-warn-dot: #d97706;

  --status-esu-text: #155e75;
  --status-esu-bg: #ecfeff;
  --status-esu-border: #a5f3fc;
  --status-esu-dot: #0891b2;

  --status-eol-text: #991b1b;
  --status-eol-bg: #fef2f2;
  --status-eol-border: #fecaca;
  --status-eol-dot: #dc2626;
}

/* Dark Theme Surfaces & Palette (Specified in section 04) */
[data-theme="dark"], body.dark-mode {
  color-scheme: dark;
  --bg-canvas: #111318;
  --bg-surface: #181b22;
  --bg-subtle: #1f232c;
  --bg-hover: #262b36;
  --bg-active: #2e3442;

  --border: #292e38;
  --border-subtle: #21252e;
  --border-strong: #383f4d;
  --border-focus: #3b82f6;
  --focus-ring: rgba(59, 130, 246, 0.25);

  --text-primary: #e5e7eb;
  --text-secondary: #9299a5;
  --text-muted: #6b7280;
  --text-tertiary: #4b5563;
  --text-link: #3b82f6;

  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-subtle: rgba(59, 130, 246, 0.12);
  --brand: var(--accent);

  --status-rec-text: #4ade80;
  --status-rec-bg: rgba(22, 163, 74, 0.12);
  --status-rec-border: rgba(34, 197, 94, 0.25);
  --status-rec-dot: #22c55e;

  --status-act-text: #60a5fa;
  --status-act-bg: rgba(37, 99, 235, 0.12);
  --status-act-border: rgba(59, 130, 246, 0.25);
  --status-act-dot: #3b82f6;

  --status-warn-text: #fbbf24;
  --status-warn-bg: rgba(217, 119, 6, 0.12);
  --status-warn-border: rgba(245, 158, 11, 0.25);
  --status-warn-dot: #f59e0b;

  --status-esu-text: #22d3ee;
  --status-esu-bg: rgba(8, 145, 178, 0.12);
  --status-esu-border: rgba(6, 182, 212, 0.25);
  --status-esu-dot: #06b6d4;

  --status-eol-text: #f87171;
  --status-eol-bg: rgba(220, 38, 38, 0.14);
  --status-eol-border: rgba(239, 68, 68, 0.28);
  --status-eol-dot: #ef4444;
}

/* ==========================================================================
   Base Reset & Typographic Hierarchy
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  background-color: var(--bg-canvas);
  color: var(--text-primary);
}

@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* Tabular Figures for Dates, Builds, Metric Strip, and Chips */
.data-table td,
.data-table th,
.code-val,
.metric-val,
.attr-val,
.countdown-chip,
.tag-badge,
.tab-counter,
.engine-subtext,
.badge-text,
.item-badge,
.audit-meta-row strong,
.audit-meta-row code,
.date-val {
  font-variant-numeric: tabular-nums;
  -webkit-font-feature-settings: "tnum" 1, "cv02" 1, "cv03" 1, "cv04" 1, "cv11" 1;
  font-feature-settings: "tnum" 1, "cv02" 1, "cv03" 1, "cv04" 1, "cv11" 1;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.12s ease;
}
a:hover {
  color: var(--text-link);
}

button, input, select {
  font: inherit;
  color: inherit;
}

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

/* Tabular figures for data density */
.tabular-nums, td, .code-val, .metric-val {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Application Shell: Layout Architecture
   ========================================================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Left Navigation Sidebar (Linear/Raycast style) */
aside.app-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 90;
  transition: width 0.16s ease;
  user-select: none;
}

.sidebar-brand-wrapper {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-primary);
  text-decoration: none;
}

.brand-icon-box {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: var(--radius-sm);
  background: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-canvas);
}

.brand-title {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.brand-version {
  font-size: var(--text-3xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-left: var(--space-1);
}

.sidebar-close-mobile {
  display: none;
  background: none;
  border: none;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.sidebar-nav-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-2) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.sidebar-nav-container::-webkit-scrollbar {
  width: 3px;
}
.sidebar-nav-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-section-title {
  font-size: var(--text-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: var(--space-1) var(--space-2);
  margin-top: var(--space-1);
}

/* Quick Search Button in Sidebar */
.sidebar-search-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 32px;
  padding: 0 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--text-2xs);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
  margin-bottom: var(--space-1);
  text-align: left;
}

.sidebar-search-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.search-btn-svg {
  flex-shrink: 0;
  color: var(--text-muted);
}
.sidebar-search-btn:hover .search-btn-svg {
  color: var(--text-primary);
}

.search-btn-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-btn-kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.sidebar-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 32px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.1s ease, color 0.1s ease;
}

.sidebar-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-item.active {
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-weight: 600;
}

/* Linear-style Left Hairline Accent Indicator */
.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2.5px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
}

.nav-svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke-width: 1.75;
  color: var(--text-muted);
}
.sidebar-item:hover .nav-svg,
.sidebar-item.active .nav-svg {
  color: var(--text-primary);
}

.item-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-badge {
  font-size: var(--text-3xs);
  font-family: var(--font-mono);
  font-weight: 500;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

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

/* Sidebar Row with Chevron Toggle */
.sidebar-item-row {
  display: flex;
  align-items: center;
  gap: 1px;
}

.sidebar-item-row .sidebar-item {
  flex: 1;
  min-width: 0;
}

.sidebar-chevron-btn {
  width: 22px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.12s ease, color 0.12s ease;
}

.sidebar-chevron-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-chevron-btn svg {
  transition: transform 0.18s ease;
}

/* Accordion Open / Collapsed States */
.sidebar-group:not(.open) .sidebar-sub-items {
  display: none;
}

.sidebar-group:not(.open) .sidebar-chevron-btn svg {
  transform: rotate(-90deg);
}

.sidebar-group.open .sidebar-chevron-btn svg {
  transform: rotate(0deg);
}

/* Sidebar Sub-classification Tree */
.sidebar-group {
  display: flex;
  flex-direction: column;
}

.sidebar-sub-items {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-left: 18px;
  margin-top: 1px;
  margin-bottom: 4px;
  border-left: 1px solid var(--border-subtle);
  margin-left: 15px;
}

.sidebar-sub-item {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 25px;
  font-size: var(--text-2xs);
  color: var(--text-muted);
  padding: 0 var(--space-2);
  border-radius: var(--radius-xs);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.1s ease, color 0.1s ease;
}

.sidebar-sub-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.sidebar-sub-item.active {
  color: var(--text-primary);
  background: var(--bg-active);
  font-weight: 600;
}

.sub-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sub-dot.rec { background: var(--status-rec-dot); }
.sub-dot.act { background: var(--status-act-dot); }
.sub-dot.warn { background: var(--status-warn-dot); }
.sub-dot.esu { background: var(--status-esu-dot); }
.sub-dot.eol { background: var(--status-eol-dot); }

/* Sidebar Footer Engine Status */
.sidebar-status-footer {
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  flex-shrink: 0;
}

.engine-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-2xs);
  font-weight: 500;
  color: var(--text-secondary);
}

.status-pulse-dot {
  width: 6px;
  height: 6px;
  min-width: 6px;
  border-radius: 50%;
  background: #16a34a;
}

.engine-subtext {
  font-size: var(--text-3xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
  margin-left: 12px;
}

/* Collapsed Sidebar (Desktop) */
@media (min-width: 1025px) {
  aside.app-sidebar.collapsed,
  html[data-sidebar-collapsed="true"] aside.app-sidebar {
    width: var(--sidebar-collapsed-width);
    min-width: var(--sidebar-collapsed-width);
  }

  aside.app-sidebar.collapsed .brand-title,
  aside.app-sidebar.collapsed .brand-version,
  aside.app-sidebar.collapsed .item-label,
  aside.app-sidebar.collapsed .item-badge,
  aside.app-sidebar.collapsed .sidebar-sub-items,
  aside.app-sidebar.collapsed .sidebar-chevron-btn,
  aside.app-sidebar.collapsed .search-btn-label,
  aside.app-sidebar.collapsed .search-btn-kbd,
  aside.app-sidebar.collapsed .nav-section-title,
  aside.app-sidebar.collapsed .engine-indicator-text,
  aside.app-sidebar.collapsed .engine-subtext,
  html[data-sidebar-collapsed="true"] aside.app-sidebar .brand-title,
  html[data-sidebar-collapsed="true"] aside.app-sidebar .brand-version,
  html[data-sidebar-collapsed="true"] aside.app-sidebar .item-label,
  html[data-sidebar-collapsed="true"] aside.app-sidebar .item-badge,
  html[data-sidebar-collapsed="true"] aside.app-sidebar .sidebar-sub-items,
  html[data-sidebar-collapsed="true"] aside.app-sidebar .sidebar-chevron-btn,
  html[data-sidebar-collapsed="true"] aside.app-sidebar .search-btn-label,
  html[data-sidebar-collapsed="true"] aside.app-sidebar .search-btn-kbd,
  html[data-sidebar-collapsed="true"] aside.app-sidebar .nav-section-title,
  html[data-sidebar-collapsed="true"] aside.app-sidebar .engine-indicator-text,
  html[data-sidebar-collapsed="true"] aside.app-sidebar .engine-subtext {
    display: none !important;
  }

  aside.app-sidebar.collapsed .sidebar-search-btn,
  html[data-sidebar-collapsed="true"] aside.app-sidebar .sidebar-search-btn {
    justify-content: center;
    padding: 0;
  }

  aside.app-sidebar.collapsed .sidebar-item,
  html[data-sidebar-collapsed="true"] aside.app-sidebar .sidebar-item {
    justify-content: center;
    padding: 0;
  }

  aside.app-sidebar.collapsed .sidebar-brand,
  html[data-sidebar-collapsed="true"] aside.app-sidebar .sidebar-brand {
    justify-content: center;
    width: 100%;
  }

  aside.app-sidebar.collapsed .sidebar-status-footer,
  html[data-sidebar-collapsed="true"] aside.app-sidebar .sidebar-status-footer {
    display: flex;
    justify-content: center;
    padding: var(--space-2) 0;
  }
}

/* ==========================================================================
   Top Navigation Bar (Linear / Vercel Hairline Strip)
   ========================================================================== */
.app-main-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-canvas);
  min-height: 100vh;
}

header.app-topbar {
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.btn-topbar-action {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.1s ease;
}

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

.mobile-only { display: none; }
.desktop-only { display: inline-flex; }

.topbar-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--text-muted);
  overflow: hidden;
  white-space: nowrap;
}

.breadcrumb-item {
  color: var(--text-muted);
  text-decoration: none;
}
.breadcrumb-item:hover { color: var(--text-primary); }
.breadcrumb-separator { color: var(--border-strong); font-size: 11px; }
.breadcrumb-current { color: var(--text-primary); font-weight: 500; }

.topbar-meta-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-2xs);
  font-family: var(--font-mono);
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.topbar-meta-badge .badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #16a34a;
}

.btn-control, .topbar-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--text-2xs);
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  transition: all 0.1s;
}

.btn-control:hover, .topbar-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 4px;
  z-index: 3000;
  padding: 6px 12px;
  background: var(--accent);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
}
.skip-link:focus {
  left: 8px;
}

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

/* ==========================================================================
   Workspace Content Area
   ========================================================================== */
.container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
  width: 100%;
}

main.app-content {
  flex: 1;
  padding: var(--space-5) 0 var(--space-8);
}

/* Workspace Editorial Header */
.workspace-header {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.workspace-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.workspace-title {
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.workspace-subtitle {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: 3px;
  max-width: 860px;
}

.workspace-meta-line {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: var(--text-2xs);
  color: var(--text-muted);
}
.meta-sep { color: var(--border-strong); }

/* Notice / Alert Box (Hairline Minimalist) */
.system-notice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--status-warn-bg);
  border: 1px solid var(--status-warn-border);
  border-radius: var(--radius-sm);
  color: var(--status-warn-text);
  font-size: var(--text-xs);
  line-height: 1.45;
  margin-bottom: var(--space-4);
}
.notice-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

/* ==========================================================================
   Executive Metric Strip (Linear / Vercel Density)
   No huge cards. High information density.
   ========================================================================== */
.metric-strip {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-4);
  overflow-x: auto;
}

.metric-strip-item {
  flex: 1;
  min-width: 140px;
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  transition: background 0.1s;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  text-align: left;
}

.metric-strip-item:hover {
  background: var(--bg-subtle);
}

.metric-strip-item.kpi-active {
  background: var(--accent-subtle);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.metric-strip-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
  flex-shrink: 0;
}

.metric-label-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-3xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.metric-val-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 2px;
}

.metric-val {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
  line-height: 1;
}

.metric-hint {
  font-size: var(--text-3xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Platform Tab Strip & Unified Filter Bar (Linear Style)
   ========================================================================== */
.platform-tabs {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-3);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.platform-tabs::-webkit-scrollbar {
  display: none;
}

.platform-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.12s, border-color 0.12s;
  margin-bottom: -1px;
}

.platform-tab-btn:hover {
  color: var(--text-primary);
}

.platform-tab-btn.active {
  color: var(--text-primary);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

.tab-counter {
  font-size: var(--text-3xs);
  font-family: var(--font-mono);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 0 4px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
}

/* Unified Filter Toolbar */
.unified-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.toolbar-controls-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  flex: 1;
  min-width: 260px;
}

.toolbar-controls-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* Search Input (Native 30px Box) */
.search-field {
  position: relative;
  min-width: 240px;
  flex: 1;
  max-width: 340px;
}

.search-field svg {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 28px;
  padding: 0 var(--space-2) 0 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--text-primary);
  transition: border-color 0.12s;
}

.search-input:focus {
  border-color: var(--border-focus);
}

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

/* Segmented Control Buttons (Strictly 3px-4px radius, NOT capsule pills) */
.segmented-control {
  display: inline-flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1px;
  gap: 1px;
}

.segmented-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: var(--text-2xs);
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
}

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

.segmented-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   Master Enterprise Data Matrix Table (High-Density Professional Grid)
   ========================================================================== */
.table-container {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: var(--text-xs);
}

.data-table thead th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: var(--text-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.08s ease;
}

.data-table tbody tr:last-child {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: var(--bg-hover);
}

.data-table td {
  padding: 8px 10px;
  color: var(--text-primary);
  vertical-align: middle;
  line-height: 1.45;
}

.cell-product {
  font-weight: 600;
  color: var(--text-primary);
}
.cell-product a {
  color: var(--text-primary);
  text-decoration: none;
}
.cell-product a:hover {
  color: var(--text-link);
}

.data-table .cell-action-link {
  white-space: nowrap;
}

.data-table .tag-badge {
  white-space: nowrap;
}

@media (min-width: 1280px) {
  .data-table td.cell-product {
    white-space: nowrap;
  }
}

.tag-badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-2xs);
  font-weight: 500;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  line-height: 1.35;
}

.code-val {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

/* Status Micro-Badge (Restrained, WCAG AA Compliant) */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-2xs);
  font-weight: 500;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.35;
}

.status-pill::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.status-pill.status-recommended {
  background: var(--status-rec-bg);
  color: var(--status-rec-text);
  border-color: var(--status-rec-border);
}
.status-pill.status-recommended::before { background: var(--status-rec-dot); }

.status-pill.status-active {
  background: var(--status-act-bg);
  color: var(--status-act-text);
  border-color: var(--status-act-border);
}
.status-pill.status-active::before { background: var(--status-act-dot); }

.status-pill.status-approaching_eol {
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
  border-color: var(--status-warn-border);
}
.status-pill.status-approaching_eol::before { background: var(--status-warn-dot); }

.status-pill.status-extended_support {
  background: var(--status-esu-bg);
  color: var(--status-esu-text);
  border-color: var(--status-esu-border);
}
.status-pill.status-extended_support::before { background: var(--status-esu-dot); }

.status-pill.status-critical_eol {
  background: var(--status-eol-bg);
  color: var(--status-eol-text);
  border-color: var(--status-eol-border);
}
.status-pill.status-critical_eol::before { background: var(--status-eol-dot); }

.cell-action-link {
  font-size: var(--text-2xs);
  color: var(--text-link);
  font-weight: 500;
  text-decoration: none;
}
.cell-action-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Latest Release Indicators & Badges (LatestWin Signature)
   ========================================================================== */
.badge-latest {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  font-size: var(--text-3xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.35);
  line-height: 1.3;
  vertical-align: middle;
  white-space: nowrap;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.12);
  margin-left: 6px;
}

[data-theme="dark"] .badge-latest, body.dark-mode .badge-latest {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.4);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}

.badge-latest::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 5px #10b981;
}

.latest-banner-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  margin-bottom: var(--space-4);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: #065f46;
  font-weight: 500;
}

[data-theme="dark"] .latest-banner-strip, body.dark-mode .latest-banner-strip {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(52, 211, 153, 0.3);
  color: #6ee7b7;
}

/* Executive Latest Baselines Spotlight Strip (Homepage) */
.latest-baselines-section {
  margin-bottom: var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.latest-baselines-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.latest-baselines-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.latest-baselines-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}

.latest-baselines-subtitle {
  font-size: var(--text-2xs);
  color: var(--text-muted);
}

.latest-baselines-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

@media (max-width: 1024px) {
  .latest-baselines-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .latest-baselines-section {
    padding: 10px 12px;
    margin-bottom: var(--space-3);
  }
  .latest-baselines-header {
    margin-bottom: 8px;
  }
  .latest-baselines-subtitle {
    display: none;
  }
  .latest-baselines-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .latest-card {
    padding: 8px 10px;
  }
  .latest-card-name {
    font-size: var(--text-xs);
    margin-bottom: 2px;
  }
  .latest-card-meta {
    font-size: 10px;
    flex-wrap: wrap;
    gap: 3px;
  }
}

.latest-card {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
}

.latest-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.latest-card.flagship {
  border-color: rgba(16, 185, 129, 0.35);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.05) 0%, var(--bg-subtle) 100%);
}

.latest-card.flagship:hover {
  border-color: rgba(16, 185, 129, 0.6);
}

.latest-card-tag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.latest-track-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.latest-track-badge.flagship {
  color: #059669;
}

[data-theme="dark"] .latest-track-badge.flagship, body.dark-mode .latest-track-badge.flagship {
  color: #34d399;
}

.latest-card-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.latest-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-2xs);
  color: var(--text-muted);
}

/* ==========================================================================
   Servicing Countdown Chip (EOL Countdown)
   ========================================================================== */
.countdown-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  font-size: var(--text-2xs);
  font-family: var(--font-mono);
  font-weight: 600;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
}

.countdown-chip .chip-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.countdown-chip.chip-active {
  border-color: var(--status-act-border);
  background: var(--status-act-bg);
  color: var(--status-act-text);
}
.countdown-chip.chip-active .chip-dot { background: var(--status-act-dot); }

.countdown-chip.chip-warn {
  border-color: var(--status-warn-border);
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
}
.countdown-chip.chip-warn .chip-dot { background: var(--status-warn-dot); }

.countdown-chip.chip-expired {
  border-color: var(--status-eol-border);
  background: var(--status-eol-bg);
  color: var(--status-eol-text);
}
.countdown-chip.chip-expired .chip-dot { background: var(--status-eol-dot); }

.countdown-chip .chip-label {
  font-weight: 500;
  opacity: 0.85;
}

.countdown-chip .chip-val {
  font-weight: 700;
}

/* ==========================================================================
   Secondary View: Domain Hubs / Category Columns
   ========================================================================== */
.release-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-3);
}

.release-column {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  overflow: hidden;
}

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

.column-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.card-entry {
  border-bottom: 1px solid var(--border-subtle);
}
.card-entry:last-child {
  border-bottom: none;
}

.card-header {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.08s;
}
.card-header:hover {
  background: var(--bg-hover);
}

.card-chevron {
  color: var(--text-muted);
  font-size: 10px;
  display: inline-block;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  margin-left: 8px;
}

.card-header[aria-expanded="true"] .card-chevron {
  transform: rotate(180deg);
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.version-tag {
  font-weight: 600;
  font-size: var(--text-xs);
}

.card-collapse {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease-out;
  background: var(--bg-subtle);
}

.card-body {
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--text-xs);
  border-top: 1px solid var(--border-subtle);
}

.data-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  border-bottom: 1px dotted var(--border);
}
.data-row:last-child { border-bottom: none; }
.data-label { color: var(--text-muted); }
.data-val { font-weight: 500; }

/* ==========================================================================
   Editorial Subpage: Audit Verdict Document
   ========================================================================== */
.audit-document {
  max-width: 960px;
  margin: 0 auto;
}

.audit-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-5);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.audit-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.audit-meta-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* Formal Technical Attribute Matrix Grid */
.attr-matrix {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  margin-bottom: var(--space-5);
}

.attr-box {
  padding: var(--space-2) var(--space-3);
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.attr-box:nth-child(4n) { border-right: none; }

.attr-key {
  font-size: var(--text-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.attr-val {
  font-size: var(--text-xs);
  font-weight: 600;
  margin-top: 2px;
  color: var(--text-primary);
}

/* Audit Evaluation Sections */
.verdict-sheet {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  margin-bottom: var(--space-5);
}

.verdict-summary-bar {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.verdict-body-section {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}
.verdict-body-section:last-child {
  border-bottom: none;
}

.verdict-heading {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}

.verdict-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

.evidence-list {
  list-style: square;
  padding-left: 20px;
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.7;
  margin-top: 6px;
}

/* Security Threat Telemetry (Sidecar) */
.telemetry-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  margin-bottom: var(--space-5);
}

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

.telemetry-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border-subtle);
}

.telemetry-kpi-cell {
  padding: var(--space-3);
  border-right: 1px solid var(--border-subtle);
}
.telemetry-kpi-cell:last-child { border-right: none; }

.telemetry-kpi-val {
  font-size: var(--text-xl);
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
  margin: 3px 0;
}

/* FAQ Accordion */
.faq-container {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  margin-bottom: var(--space-5);
}

.faq-item {
  border-bottom: 1px solid var(--border-subtle);
}
.faq-item:last-child { border-bottom: none; }

.faq-q {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-q:hover { background: var(--bg-subtle); }

.faq-a {
  padding: 0 var(--space-4) var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   Enterprise Footer
   ========================================================================== */
footer.app-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  padding: var(--space-5) 0;
  margin-top: auto;
}

.footer-inner {
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.footer-links a { color: var(--text-secondary); }
.footer-links a:hover { color: var(--text-link); }

.footer-copyright {
  font-size: var(--text-2xs);
  color: var(--text-muted);
  margin-bottom: 3px;
}

.footer-disclaimer {
  font-size: var(--text-3xs);
  color: var(--text-tertiary);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.4;
}

/* ==========================================================================
   Responsive Ladder (<= 1024px Tablet, <= 768px Mobile, <= 480px Small Phone)
   ========================================================================== */
@media (max-width: 1024px) {
  .mobile-only { display: inline-flex !important; }
  .desktop-only { display: none !important; }

  aside.app-sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    width: 280px;
    max-width: 82vw;
    height: 100vh;
    height: 100dvh;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    transform: none;
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    padding-bottom: env(safe-area-inset-bottom, 20px);
  }

  aside.app-sidebar.open {
    transform: translateX(280px);
  }

  .sidebar-close-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 16px;
    border-radius: var(--radius-sm);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.2s ease;
  }
  .sidebar-overlay.active {
    display: block;
    opacity: 1;
  }

  header.app-topbar { padding: 0 var(--space-3); }
  .container { padding: 0 var(--space-3); }

  .release-grid { grid-template-columns: 1fr 1fr; }
  .attr-matrix { grid-template-columns: repeat(2, 1fr); }
  .telemetry-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  /* Prevent horizontal document spillover */
  html, body, .app-layout {
    overflow-x: hidden;
  }

  /* Metric Strip: Native Touch Momentum Scrolling */
  .metric-strip {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 2px;
  }
  .metric-strip::-webkit-scrollbar {
    display: none;
  }
  .metric-strip-item {
    scroll-snap-align: start;
    min-width: 100px;
    padding: var(--space-1) var(--space-2);
  }
  .metric-val {
    font-size: var(--text-md);
  }
  .metric-hint {
    font-size: 9px;
  }

  /* Platform Tabs Horizontal Swiping */
  .platform-tabs {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: var(--space-3);
  }
  .platform-tabs::-webkit-scrollbar {
    display: none;
  }
  .platform-tab-btn {
    padding: 6px 4px;
    font-size: var(--text-xs);
  }

  /* Unified Toolbar Stack & Native Swipeable Pills */
  .unified-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
  }

  .toolbar-controls-left {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
    width: 100%;
  }

  .search-field {
    max-width: 100%;
    width: 100%;
  }

  .search-input {
    height: 38px;
    font-size: 16px; /* Critical: >= 16px stops iOS Safari auto-zoom on input focus */
    padding-left: 34px;
    border-radius: var(--radius-sm);
  }
  .search-field svg {
    left: 10px;
    width: 15px;
    height: 15px;
  }

  .segmented-control {
    display: flex;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    padding: 2px;
  }
  .segmented-control::-webkit-scrollbar {
    display: none;
  }

  .segmented-btn {
    flex-shrink: 0;
    min-height: 32px;
    padding: 4px 10px;
    font-size: 11.5px;
    white-space: nowrap;
  }

  .toolbar-controls-right {
    width: 100%;
    display: flex;
    justify-content: flex-end;
  }

  /* Data Table Mobile Freeze Sticky Column */
  .table-container {
    -webkit-overflow-scrolling: touch;
    position: relative;
    border-radius: var(--radius-sm);
  }

  .data-table th:first-child,
  .data-table td:first-child.cell-product {
    position: sticky;
    left: 0;
    z-index: 5;
    background: var(--bg-surface);
    box-shadow: 2px 0 6px -2px rgba(0, 0, 0, 0.08);
    min-width: 135px;
    max-width: 160px;
    white-space: normal;
    word-break: break-word;
  }

  [data-theme="dark"] .data-table td:first-child.cell-product,
  body.dark-mode .data-table td:first-child.cell-product {
    background: var(--bg-surface);
    box-shadow: 2px 0 6px -2px rgba(0, 0, 0, 0.4);
  }

  .data-table th:first-child {
    background: var(--bg-subtle);
    z-index: 6;
  }

  [data-theme="dark"] .data-table th:first-child,
  body.dark-mode .data-table th:first-child {
    background: var(--bg-subtle);
  }

  .data-table td, .data-table th {
    padding: 8px 10px;
    font-size: 11.5px;
  }

  /* Card View Optimization */
  .card-header {
    min-height: 44px;
    padding: 10px 12px;
  }
  .version-tag {
    font-size: 12px;
  }

  /* Editorial Subpage Optimization */
  .audit-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }
  .audit-header .btn-control {
    display: none; /* Hide print button on mobile */
  }
  .audit-title {
    font-size: var(--text-xl);
  }
  .audit-meta-row {
    font-size: var(--text-xs);
    flex-wrap: wrap;
    gap: 4px;
  }

  .attr-matrix {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .attr-box {
    padding: 8px 10px;
  }
  .attr-box:nth-child(2n) {
    border-right: none;
  }

  .telemetry-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .telemetry-kpi-box {
    padding: 10px;
  }
  .telemetry-kpi-box:nth-child(2n) {
    border-right: none;
  }
  .telemetry-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .verdict-summary-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 640px) {
  /* Topbar phone optimization: hide bulky date pill and button text labels */
  .topbar-meta-badge {
    display: none;
  }
  .topbar-btn .lang-text,
  .topbar-btn .theme-label {
    display: none;
  }
  .topbar-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
  }
  .btn-topbar-action.mobile-only {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
  }
  .topbar-left {
    max-width: 72%;
  }
  .topbar-breadcrumbs {
    font-size: 11px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace-title {
    font-size: var(--text-lg);
  }
  .workspace-subtitle {
    font-size: 11.5px;
  }
  .workspace-meta-line {
    font-size: 11px;
    flex-wrap: wrap;
    gap: 4px;
  }

  .system-notice {
    padding: 8px 10px;
    font-size: 11.5px;
  }

  .footer-links {
    gap: var(--space-2) var(--space-3);
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .metric-strip-item {
    min-width: 90px;
    padding: 4px 6px;
  }
  .data-table th:first-child,
  .data-table td:first-child.cell-product {
    min-width: 120px;
    max-width: 140px;
    font-size: 11px;
  }
}

@media print {
  aside.app-sidebar, header.app-topbar, .unified-toolbar, .platform-tabs { display: none !important; }
  body { background: #ffffff !important; color: #000000 !important; font-size: 10pt; }
  .table-container, .verdict-sheet, .attr-matrix { border: 1px solid #333 !important; }
}

/* ==========================================================================
   Google AdSense Policy-Compliant Ad Architecture
   ========================================================================== */
/* ==========================================================================
   Google AdSense Policy-Compliant Ad Architecture
   ========================================================================== */
.lw-ad-wrapper {
  margin: var(--space-6) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  clear: both;
}

.lw-ad-label {
  font-size: var(--text-3xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
  user-select: none;
}

.lw-ad-container {
  width: 100%;
  max-width: 100%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  contain: layout;
  transition: min-height 0.2s ease;
}

.lw-ad-horizontal {
  max-width: 970px;
}

.lw-ad-rectangle {
  max-width: 728px;
}

.lw-ad-in_content {
  max-width: 100%;
}

.lw-ad-dev-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: var(--space-3);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
}

.lw-ad-dev-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-size: var(--text-3xs);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--brand);
}

.ad-slot-wrapper {
  margin: var(--space-5) 0;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  padding: var(--space-2) var(--space-3);
  text-align: center;
  position: relative;
}

.ad-slot-label {
  font-size: var(--text-3xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.ad-slot-box {
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-placeholder-text {
  font-size: var(--text-2xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ==========================================================================
   Native Cookie Consent Banner (GDPR / ePrivacy)
   ========================================================================== */
.cookie-consent-bar {
  position: fixed;
  bottom: var(--space-4);
  right: var(--space-4);
  left: var(--space-4);
  max-width: 680px;
  margin: 0 auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: var(--space-3) var(--space-4);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.cookie-consent-content {
  flex: 1;
}

.cookie-consent-title {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.cookie-consent-text {
  font-size: var(--text-2xs);
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

.cookie-consent-text a {
  color: var(--text-link);
  text-decoration: underline;
}

.cookie-consent-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .cookie-consent-bar {
    flex-direction: column;
    align-items: stretch;
    bottom: var(--space-2);
    left: var(--space-2);
    right: var(--space-2);
  }
  .cookie-consent-actions {
    justify-content: flex-end;
  }
}

/* ==========================================================================
   Enhanced Enterprise Components: Sorting, Empty State, Timeline,
   Command Palette, Pricing/Tools Responsive Grids
   ========================================================================== */
.results-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  min-height: 22px;
  font-size: var(--text-2xs);
  color: var(--text-muted);
}

.results-meta-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.reset-inline-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: color 0.12s ease, background 0.12s ease;
}

.sortable-th:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.sortable-th.sorted {
  color: var(--text-primary);
}

.sort-indicator {
  font-size: 10px;
  opacity: 0.6;
  margin-left: 3px;
}

.sortable-th.sorted .sort-indicator {
  opacity: 1;
  color: var(--accent);
}

.phase-micro-note {
  display: block;
  margin-top: 2px;
  font-size: var(--text-3xs);
  color: var(--text-muted);
}

.risk-text {
  font-weight: 600;
  font-size: var(--text-2xs);
  text-transform: capitalize;
}
.risk-none { color: var(--status-rec-dot); }
.risk-low { color: var(--status-act-dot); }
.risk-medium { color: var(--status-warn-dot); }
.risk-high { color: var(--status-warn-text); }
.risk-critical { color: var(--status-eol-text); }
.risk-unknown { color: var(--text-muted); }

.empty-state-panel {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  padding: var(--space-8) var(--space-4);
  text-align: center;
  margin-bottom: var(--space-4);
}

.empty-state-title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.empty-state-desc {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto var(--space-4);
}

/* Visual Lifecycle Phase Timeline */
.timeline-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-5);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--space-2);
}

.timeline-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.timeline-today-tag {
  font-size: var(--text-2xs);
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.timeline-bar-track {
  position: relative;
  height: 12px;
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: flex;
  overflow: visible;
  margin-bottom: var(--space-2);
}

.timeline-seg {
  height: 100%;
}

.seg-mainstream {
  background: var(--status-rec-dot);
}

.seg-extended {
  background: var(--status-act-dot);
}

.seg-esu {
  background: var(--status-warn-dot);
}

.timeline-today-marker {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: var(--text-primary);
  box-shadow: 0 0 0 2px var(--bg-surface);
  transform: translateX(-1px);
}

.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--text-2xs);
  color: var(--text-secondary);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}

.ms-source-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  margin-bottom: var(--space-5);
  font-size: var(--text-xs);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Command Palette Modal (Ctrl+K) */
.cmd-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
  backdrop-filter: blur(2px);
  z-index: 2500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh var(--space-3) var(--space-4);
}

.cmd-modal-panel {
  width: 100%;
  max-width: 620px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.cmd-modal-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.cmd-modal-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: var(--text-sm);
  color: var(--text-primary);
  outline: none;
}

.cmd-close-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 2px 6px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  cursor: pointer;
}

.cmd-modal-results {
  max-height: 360px;
  overflow-y: auto;
}

.cmd-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-subtle);
  text-decoration: none;
  color: var(--text-primary);
}

.cmd-result-item:hover,
.cmd-result-item.selected {
  background: var(--bg-hover);
}

.cmd-result-main {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.cmd-result-name {
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmd-result-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cmd-empty-state {
  padding: var(--space-6) var(--space-4);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.cmd-modal-footer {
  padding: 7px 14px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  font-size: var(--text-3xs);
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* Pricing & Enterprise Decision Toolkit Layouts */
.pricing-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.partner-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  padding: var(--space-4);
}

.compare-selectors-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.compare-select-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.compare-select-box label,
.fleet-add-bar label {
  font-size: var(--text-3xs);
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.tool-select {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--text-primary);
}

.fleet-add-bar {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr auto;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  align-items: end;
}

.fleet-field-release,
.fleet-field-count,
.fleet-field-label,
.fleet-field-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

@media (max-width: 1024px) {
  .compare-selectors-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .pricing-grid,
  .partner-grid {
    grid-template-columns: 1fr;
  }
  .fleet-add-bar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .release-grid {
    grid-template-columns: 1fr;
  }
  .compare-selectors-grid,
  .fleet-add-bar {
    grid-template-columns: 1fr;
  }
  .cmd-result-meta .code-val:first-child {
    display: none;
  }
}

