/* DCB v2 Design System — "Calm Clarity" */

/* ─── DCB Brand Fonts (matches dcberne.com) ────────── */
@font-face {
  font-family: 'Calibri';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/Calibri-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Calibri';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/Calibri-Bold.ttf') format('truetype');
}
@font-face {
  font-family: 'ITC Avant Garde Gothic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/ITC-Avant-Garde-Gothic-Std-Demi.otf') format('opentype');
}
@font-face {
  font-family: 'ITC Avant Garde Gothic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/ITC-Avant-Garde-Gothic-Std-Bold.otf') format('opentype');
}

/* ─── Reset & Base ───────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ─── Color Tokens ───────────────────────────── */
:root {
  /* Brand */
  --brand-50: #EFF6FF;
  --brand-100: #DBEAFE;
  --brand-500: #3B82F6;
  --brand-700: #1D4ED8;
  --brand-900: #1E3A5F;
  
  /* Accent — sparingly */
  --accent: #16A34A;
  --accent-light: #DCFCE7;
  --accent-dark: #15803D;
  
  /* Neutral scale */
  --gray-0: #FFFFFF;
  --gray-50: #FAFAFA;
  --gray-100: #F5F5F5;
  --gray-200: #E5E5E5;
  --gray-300: #D4D4D4;
  --gray-400: #A3A3A3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;
  --gray-1000: #0A0A0A;
  
  /* Category chips — pastel, equal weight */
  --cat-aid-bg: #DBEAFE;
  --cat-aid-fg: #1E40AF;
  --cat-cgm-bg: #DCFCE7;
  --cat-cgm-fg: #166534;
  --cat-pump-bg: #EDE9FE;
  --cat-pump-fg: #5B21B6;
  --cat-insulin-bg: #FFEDD5;
  --cat-insulin-fg: #9A3412;
  --cat-app-bg: #FAE8FF;
  --cat-app-fg: #86198F;
  --cat-news-bg: #FEF3C7;
  --cat-news-fg: #92400E;
  
  /* Status */
  --status-available: #16A34A;
  --status-development: #EAB308;
  --status-discontinued: #EF4444;
  --status-research: #3B82F6;
  
  /* Semantic */
  --bg-app: var(--gray-50);
  --bg-card: var(--gray-0);
  --bg-elevated: var(--gray-0);
  --bg-subtle: var(--gray-100);
  --border-subtle: var(--gray-200);
  --border-strong: var(--gray-300);
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-tertiary: var(--gray-500);
  --text-muted: var(--gray-400);
  
  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-xl: 0 24px 48px rgba(0,0,0,0.1), 0 8px 24px rgba(0,0,0,0.06);
  
  /* Radii */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-2xl: 28px;
  --r-full: 999px;
  
  /* Spacing — 8px grid */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;
  --s-24: 96px;
  
  /* Typography */
  --font-sans: 'Calibri', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-display: 'ITC Avant Garde Gothic', 'Calibri', 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
  
  /* Type scale — only 6 sizes */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 20px;
  --text-2xl: 28px;
  --text-3xl: 40px;
  --text-display: 56px;
  
  /* Weights */
  --w-regular: 400;
  --w-medium: 500;
  --w-semibold: 600;
  --w-bold: 700;
  
  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 150ms;
  --t-base: 220ms;
  --t-slow: 400ms;
  
  /* Layout */
  --container-max: 1440px;
  --header-h: 64px;
  --bottom-tab-h: 64px;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"], :root[data-theme="dark"] {
    --bg-app: #0A0A0A;
    --bg-card: #161616;
    --bg-elevated: #1F1F1F;
    --bg-subtle: #1A1A1A;
    --border-subtle: #262626;
    --border-strong: #404040;
    --text-primary: #FAFAFA;
    --text-secondary: #A3A3A3;
    --text-tertiary: #737373;
    --text-muted: #525252;
    
    --cat-aid-bg: #1E3A5F33;
    --cat-aid-fg: #93C5FD;
    --cat-cgm-bg: #14532D33;
    --cat-cgm-fg: #86EFAC;
    --cat-pump-bg: #4C1D9533;
    --cat-pump-fg: #C4B5FD;
    --cat-insulin-bg: #7C2D1233;
    --cat-insulin-fg: #FDBA74;
    --cat-app-bg: #701A7533;
    --cat-app-fg: #F0ABFC;
    --cat-news-bg: #78350F33;
    --cat-news-fg: #FCD34D;
  }
}

:root[data-theme="dark"] {
  --bg-app: #0A0A0A;
  --bg-card: #161616;
  --bg-elevated: #1F1F1F;
  --bg-subtle: #1A1A1A;
  --border-subtle: #262626;
  --border-strong: #404040;
  --text-primary: #FAFAFA;
  --text-secondary: #A3A3A3;
  --text-tertiary: #737373;
  --text-muted: #525252;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--w-regular);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-app);
  letter-spacing: -0.011em;
}

/* Tabular numbers for data */
.tabular { font-variant-numeric: tabular-nums; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ─── Typography Components ────────────────── */
.h-display, .h-3xl, .h-2xl, .h-xl, .h-lg, .h-md,
h1, h2, h3 { font-family: var(--font-display); }
.h-display { font-size: var(--text-display); font-weight: 700; line-height: 1.02; letter-spacing: -0.03em; }
.h-3xl     { font-size: var(--text-3xl); font-weight: 700; line-height: 1.08; letter-spacing: -0.025em; }
.h-2xl     { font-size: var(--text-2xl); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.h-xl      { font-size: var(--text-xl, 22px); font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; }
.h-lg      { font-size: var(--text-lg); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.h-md      { font-size: var(--text-md, 17px); font-weight: 600; line-height: 1.35; letter-spacing: -0.005em; }
/* Tabular numbers for stats — JetBrains Mono on demand */
.tabular, .stat-card .value, [data-mono] { font-family: var(--font-mono); font-feature-settings: 'tnum'; font-variant-numeric: tabular-nums; }
.t-base { font-size: var(--text-base); line-height: 1.6; }
.t-sm { font-size: var(--text-sm); line-height: 1.5; }
.t-xs { font-size: var(--text-xs); line-height: 1.4; }
.t-mono { font-family: var(--font-mono); font-size: 0.92em; }
.t-muted { color: var(--text-secondary); }
.t-subtle { color: var(--text-tertiary); }

/* ─── Layout ───────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--s-6);
}
@media (max-width: 768px) {
  .container { padding: 0 var(--s-4); }
}

.stack-1 { display: flex; flex-direction: column; gap: var(--s-1); }
.stack-2 { display: flex; flex-direction: column; gap: var(--s-2); }
.stack-3 { display: flex; flex-direction: column; gap: var(--s-3); }
.stack-4 { display: flex; flex-direction: column; gap: var(--s-4); }
.stack-6 { display: flex; flex-direction: column; gap: var(--s-6); }
.stack-8 { display: flex; flex-direction: column; gap: var(--s-8); }
.row-2 { display: flex; align-items: center; gap: var(--s-2); }
.row-3 { display: flex; align-items: center; gap: var(--s-3); }
.row-4 { display: flex; align-items: center; gap: var(--s-4); }
.row-between { display: flex; align-items: center; justify-content: space-between; }

/* ─── Header ───────────────────────────────── */
.app-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}
:root[data-theme="dark"] .app-header { background: rgba(10, 10, 10, 0.85); }

.app-header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--s-6);
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--s-6);
}
.app-logo {
  display: flex; align-items: center; gap: var(--s-3);
  font-weight: var(--w-bold);
  font-size: var(--text-base);
  letter-spacing: -0.02em;
}
/* Legacy logo-mark — kept for backward compat, but no longer rendered */
.app-logo-mark {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--brand-500), var(--brand-900));
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: var(--w-bold); font-size: 13px;
}

/* DCB official logo image (header + footer) */
.app-logo-img {
  display: inline-flex;
  align-items: center;
  height: 32px;
  flex-shrink: 0;
}
.app-logo-img img {
  height: 32px;
  width: auto;
  display: block;
}
/* Manual dark-mode toggle: invert the gray DCB text via filter, since <picture> only reacts to OS prefs */
:root[data-theme="dark"] .app-logo-img img {
  /* Replace with explicit dark variant via CSS image swap */
  content: url('/v2-preview/img/dcb-logo-dark-32.png');
}
.app-nav {
  display: flex; align-items: center; gap: var(--s-1);
  flex: 1;
}
.app-nav a {
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  font-weight: var(--w-medium);
  color: var(--text-secondary);
  transition: all var(--t-fast) var(--ease-out);
}
.app-nav a:hover { color: var(--text-primary); background: var(--bg-subtle); }
.app-nav a.active { color: var(--text-primary); background: var(--bg-subtle); }

.app-header-right { display: flex; align-items: center; gap: var(--s-2); }
@media (max-width: 768px) {
  .app-nav { display: none; }
}

/* ─── Search ───────────────────────────────── */
.search-trigger {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2) var(--s-3) var(--s-2) var(--s-3);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  transition: border-color var(--t-fast) var(--ease-out);
  min-width: 240px;
}
.search-trigger:hover { border-color: var(--border-strong); }
.kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xs);
  color: var(--text-tertiary);
  margin-left: auto;
}

/* ─── Buttons ──────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  font-weight: var(--w-medium);
  transition: all var(--t-fast) var(--ease-out);
  white-space: nowrap;
}
.btn-primary {
  background: var(--gray-900);
  color: var(--gray-0);
}
.btn-primary:hover { background: var(--gray-800); }
:root[data-theme="dark"] .btn-primary { background: var(--gray-0); color: var(--gray-900); }
:root[data-theme="dark"] .btn-primary:hover { background: var(--gray-100); }

.btn-accent {
  background: var(--accent);
  color: white;
}
.btn-accent:hover { background: var(--accent-dark); }

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}
.btn-ghost:hover { background: var(--bg-subtle); border-color: var(--border-strong); }

.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-md);
  color: var(--text-secondary);
  transition: all var(--t-fast) var(--ease-out);
}
.btn-icon:hover { background: var(--bg-subtle); color: var(--text-primary); }

/* Language switcher — enlarged for better visibility */
.lang-switcher { position: relative; }
.lang-switcher .btn-icon {
  width: auto;
  height: 38px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-full);
  background: var(--bg-card);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.lang-switcher .btn-icon:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}
.lang-switcher .btn-icon #lang-flag {
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.lang-switcher .btn-icon #lang-code {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.lang-switcher .btn-icon::after {
  content: '';
  width: 0;
  height: 0;
  margin-left: 2px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.5;
}
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  min-width: 170px;
  padding: 6px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lang-menu[hidden] { display: none; }
.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  border-radius: var(--r-sm);
  text-align: left;
  transition: background var(--t-fast);
}
.lang-option:hover { background: var(--bg-subtle); }
.lang-option > span:first-child { font-size: 20px; line-height: 1; }
:root[data-theme="dark"] .lang-menu {
  background: var(--gray-900);
  border-color: var(--gray-800);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}
:root[data-theme="dark"] .lang-switcher .btn-icon {
  background: var(--gray-900);
  border-color: var(--gray-800);
}

.btn-lg { padding: var(--s-3) var(--s-5); font-size: var(--text-base); }

/* ─── Pills / Chips ────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: var(--w-medium);
  letter-spacing: 0.01em;
}
.pill-aid { background: var(--cat-aid-bg); color: var(--cat-aid-fg); }
.pill-cgm { background: var(--cat-cgm-bg); color: var(--cat-cgm-fg); }
.pill-pump { background: var(--cat-pump-bg); color: var(--cat-pump-fg); }
.pill-insulin { background: var(--cat-insulin-bg); color: var(--cat-insulin-fg); }
.pill-app { background: var(--cat-app-bg); color: var(--cat-app-fg); }
.pill-news { background: var(--cat-news-bg); color: var(--cat-news-fg); }
.pill-neutral { background: var(--bg-subtle); color: var(--text-secondary); border: 1px solid var(--border-subtle); }

.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.status-dot.available { background: var(--status-available); }
.status-dot.development { background: var(--status-development); }
.status-dot.discontinued { background: var(--status-discontinued); }
.status-dot.research { background: var(--status-research); }

/* Filter pills (toggleable) */
.filter-pill {
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  font-weight: var(--w-medium);
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  transition: all var(--t-fast) var(--ease-out);
}
.filter-pill:hover { color: var(--text-primary); border-color: var(--border-strong); }
.filter-pill.active {
  background: var(--gray-900);
  color: var(--gray-0);
  border-color: var(--gray-900);
}
:root[data-theme="dark"] .filter-pill.active {
  background: var(--gray-0); color: var(--gray-900); border-color: var(--gray-0);
}

/* ─── Cards ────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  transition: all var(--t-base) var(--ease-out);
}
.card-hover:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-product {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all var(--t-base) var(--ease-out);
  cursor: pointer;
  position: relative;
}
.card-product::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: transparent;
  transition: background var(--t-fast) var(--ease-out);
}
.card-product:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.card-product:hover::before { background: var(--accent); }

.card-product-image {
  aspect-ratio: 16 / 10;
  background: var(--bg-subtle);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.card-product-image img {
  width: 70%; height: 70%; object-fit: contain;
}
.card-product-body {
  padding: var(--s-5);
  display: flex; flex-direction: column; gap: var(--s-3);
}
.card-product-title {
  font-size: var(--text-lg);
  font-weight: var(--w-semibold);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.card-product-meta {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.card-product-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: auto;
  padding-top: var(--s-2);
}

/* ─── Bento grid (Home & Intelligence) ───────── */
.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(180px, auto);
  gap: var(--s-4);
}

/* Single-viewport layout — fill the screen, no vertical scroll on ≥ 720px height. */
.bento-fullscreen {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  /* Row 1 (with hero) bigger than Row 2 (action shortcuts) for visual balance */
  grid-template-rows: 1.4fr 1fr;
  gap: var(--s-3);
  flex: 1;            /* fills the remaining height of the page-fullscreen wrapper */
  min-height: 0;      /* allow children to shrink */
}
.bento-fullscreen .bento-tile {
  padding: var(--s-6);
  min-height: 0;      /* defeats the implicit min-content height */
  overflow: hidden;
}

/* ─── Bento tile content anatomy (UNIFIED) ──────────────────────── */
/* Every bento-tile content uses the same anatomy: pill → headline → body → footer.
   Sizes scale with viewport via clamp() so big screens get bigger text. */
.bento-tile .tile-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: var(--s-3);
  position: relative;
  z-index: 1;
}
.bento-tile .tile-pill {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.18);
  color: white;
  backdrop-filter: blur(10px);
  font-size: clamp(13px, 0.95vw, 15px);
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.bento-tile .tile-icon {
  width: clamp(40px, 3vw, 52px);
  height: clamp(40px, 3vw, 52px);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bento-tile .tile-icon svg {
  width: clamp(20px, 1.6vw, 26px);
  height: clamp(20px, 1.6vw, 26px);
}
.bento-tile .tile-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: inherit;
}
.bento-tile .tile-title-xl {
  font-size: clamp(28px, 2.6vw, 44px);   /* hero headline */
  letter-spacing: -0.025em;
  line-height: 1.08;
}
.bento-tile .tile-title-lg {
  font-size: clamp(20px, 1.6vw, 26px);   /* row-1 mid tiles */
}
.bento-tile .tile-title-md {
  font-size: clamp(17px, 1.25vw, 20px);  /* row-2 short tiles */
}
.bento-tile .tile-stat {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: clamp(48px, 5vw, 88px);
  letter-spacing: -0.04em;
  line-height: 0.95;
}
.bento-tile .tile-body {
  font-size: clamp(14px, 1vw, 17px);
  line-height: 1.5;
  opacity: 0.92;
}
.bento-tile .tile-body-sm {
  font-size: clamp(13px, 0.9vw, 15px);
  line-height: 1.45;
  opacity: 0.85;
}
.bento-tile .tile-footer {
  margin-top: auto;
  font-size: clamp(12px, 0.85vw, 14px);
  opacity: 0.78;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.bento-tile .tile-footer .pill,
.bento-tile .tile-footer .tile-pill {
  font-size: clamp(12px, 0.85vw, 14px);
  padding: 4px 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.18);
  color: white;
  border-radius: 999px;
}
.bento-tile .tile-cta {
  align-self: flex-start;
  margin-top: auto;
  background: white;
  color: #14532D;
  font-weight: 700;
  font-size: clamp(13px, 0.9vw, 15px);
  padding: 8px 16px;
  border-radius: var(--r-md);
  border: none;
  cursor: pointer;
}
.page-fullscreen {
  /* container around <main> that consumes the viewport minus header */
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h));
  min-height: 560px;        /* don't squish on tiny laptops */
  padding-top: var(--s-4);
  padding-bottom: var(--s-4);
  gap: var(--s-3);
  overflow: hidden;
}
body:has(.page-fullscreen) {
  overflow: hidden;            /* prevent body scrolling when fullscreen */
}
.page-fullscreen > .page-title {
  flex: 0 0 auto;
}
@media (max-height: 720px), (max-width: 768px) {
  /* On short viewports OR on phones, allow scrolling — readability beats fitting. */
  .page-fullscreen {
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  body:has(.page-fullscreen) {
    overflow: auto;
  }
  .bento-fullscreen {
    grid-template-rows: auto;
    grid-auto-rows: minmax(160px, auto);
  }
}

/* On fullscreen pages: hide the (long) footer so the viewport-fit page
   actually fits without forcing a scrollbar. The footer remains available
   on every other page. */
body:has(.page-fullscreen) #footer-mount {
  display: none;
}
@media (max-height: 720px), (max-width: 768px) {
  body:has(.page-fullscreen) #footer-mount { display: block; }
}
.bento-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out), border-color var(--t-base) var(--ease-out);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.bento-tile:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
/* Default (≥ 1280): 12-col grid with consistent shapes */
.bento-1x1 { grid-column: span 4; }
.bento-2x1 { grid-column: span 6; }
.bento-3x1 { grid-column: span 8; }
.bento-4x1 { grid-column: span 12; }
.bento-1x2 { grid-column: span 4; grid-row: span 2; }
.bento-2x2 { grid-column: span 8; grid-row: span 2; }  /* 8-col hero pairs with 1x1 (4-col) on side */
.bento-3x2 { grid-column: span 8; grid-row: span 2; }

/* Tablet 1024-1279 — Pipeline-style 4x2 hero shrinks gracefully */
@media (max-width: 1279px) and (min-width: 1024px) {
  .bento-1x1 { grid-column: span 6; }
  .bento-2x1 { grid-column: span 6; }
  .bento-3x1 { grid-column: span 12; }
  .bento-1x2 { grid-column: span 6; grid-row: span 2; }
  .bento-2x2 { grid-column: span 12; grid-row: span 2; }
}
@media (max-width: 1023px) {
  .bento-1x1, .bento-2x1, .bento-1x2, .bento-2x2 {
    grid-column: span 6;
    grid-row: auto;
  }
  .bento-3x1, .bento-4x1 { grid-column: span 12; }
}
@media (max-width: 640px) {
  .bento-1x1, .bento-2x1, .bento-3x1, .bento-4x1, .bento-1x2, .bento-2x2 {
    grid-column: span 12;
    grid-row: auto;
  }
}

/* Hero tile */
.bento-hero {
  background: linear-gradient(135deg, var(--brand-900) 0%, var(--brand-700) 100%);
  color: white;
  padding: var(--s-8);
  display: flex; flex-direction: column; gap: var(--s-3);
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.bento-hero::before {
  content: '';
  position: absolute; top: -50%; right: -20%;
  width: 80%; height: 200%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.4) 0%, transparent 60%);
  pointer-events: none;
}

/* ─── Colored Bento Tiles ──────────────────── */
.tile-color {
  color: white;
  position: relative;
  overflow: hidden;
  border: none;
  padding: var(--s-6);
}
.tile-color::before {
  content: '';
  position: absolute; top: -30%; right: -20%;
  width: 70%; height: 160%;
  background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 60%);
  pointer-events: none;
  transition: transform var(--t-slow) var(--ease-out);
}
.tile-color:hover::before { transform: scale(1.2) translate(-10%, 10%); }
.tile-color:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}
.tile-color svg { color: rgba(255,255,255,0.9); }

/* Products tile — deep teal */
.tile-products {
  background: linear-gradient(135deg, #0F766E 0%, #134E4A 60%, #042F2E 100%);
}

/* News tile — warm amber/orange */
.tile-news {
  background: linear-gradient(135deg, #C2410C 0%, #9A3412 60%, #7C2D12 100%);
}

/* Compare tile — purple */
.tile-compare {
  background: linear-gradient(135deg, #7C3AED 0%, #5B21B6 60%, #4C1D95 100%);
}

/* Tech Radar tile — magenta/rose */
.tile-radar {
  background: linear-gradient(135deg, #BE185D 0%, #9F1239 60%, #831843 100%);
}

/* AI Assistant tile — emerald green */
.tile-ai {
  background: linear-gradient(135deg, #059669 0%, #047857 60%, #064E3B 100%);
}

/* AID Compatibility tile — cyan to indigo (CGM → Pump connection feel) */
.tile-aidcompat {
  background: linear-gradient(135deg, #0EA5E9 0%, #4F46E5 60%, #312E81 100%);
}

/* Subtle texture overlay for depth */
.tile-color::after {
  content: '';
  position: absolute; inset: 0;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.06) 0%, transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(0,0,0,0.15) 0%, transparent 40%);
  pointer-events: none;
}
.bento-hero h1 {
  font-size: var(--text-3xl);
  font-weight: var(--w-bold);
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.bento-hero p {
  color: rgba(255,255,255,0.8);
  max-width: 480px;
}

/* ─── Sections ─────────────────────────────── */
.section {
  padding: var(--s-12) 0;
}
.section-header {
  display: flex; align-items: end; justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
}
.section-title {
  font-size: var(--text-2xl);
  font-weight: var(--w-semibold);
  letter-spacing: -0.02em;
}
.section-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: 4px;
}
.section-link {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: var(--w-medium);
  display: flex; align-items: center; gap: 4px;
  transition: color var(--t-fast) var(--ease-out);
}
.section-link:hover { color: var(--text-primary); }

/* ─── Tabs ─────────────────────────────────── */
.tabs {
  display: flex;
  gap: var(--s-1);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--s-6);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: var(--s-3) var(--s-4);
  font-size: var(--text-sm);
  font-weight: var(--w-medium);
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--t-fast) var(--ease-out);
  white-space: nowrap;
  display: flex; align-items: center; gap: var(--s-2);
}
.tab:hover { color: var(--text-primary); }
.tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}
.tab-count {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  padding: 1px 6px;
  border-radius: var(--r-full);
  font-variant-numeric: tabular-nums;
}
.tab.active .tab-count { background: var(--gray-900); color: var(--gray-0); }
:root[data-theme="dark"] .tab.active .tab-count { background: var(--gray-0); color: var(--gray-900); }

/* ─── Compare table ────────────────────────── */
.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
}
.compare-table th, .compare-table td {
  padding: var(--s-4);
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: top;
}
.compare-table th {
  position: sticky; top: var(--header-h); z-index: 10;
  background: var(--bg-app);
  font-weight: var(--w-semibold);
  text-align: left;
}
.compare-table td.label {
  font-weight: var(--w-medium);
  color: var(--text-secondary);
  width: 200px;
}
.compare-table .diff {
  background: var(--accent-light);
  color: var(--accent-dark);
  position: relative;
}
:root[data-theme="dark"] .compare-table .diff { background: rgba(34, 197, 94, 0.15); }

/* ─── News Magazine ────────────────────────── */
.news-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--s-6);
}
@media (max-width: 1024px) {
  .news-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .news-grid { grid-template-columns: 1fr; }
}
.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  cursor: pointer;
  transition: all var(--t-base) var(--ease-out);
}
.news-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.news-card-image {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
}
.news-card-body {
  padding: var(--s-5);
  display: flex; flex-direction: column; gap: var(--s-3);
  flex: 1;
}
.news-card-meta {
  display: flex; align-items: center; gap: var(--s-3);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}
.news-card-title {
  font-size: var(--text-base);
  font-weight: var(--w-semibold);
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.news-card-summary {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card-featured .news-card-image { aspect-ratio: 16 / 10; }
.news-card-featured .news-card-title { font-size: var(--text-xl, 24px); font-size: var(--text-lg); }

/* ─── Bottom Tab (Mobile) ─────────────────── */
.bottom-tabs {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bottom-tab-h);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  z-index: 50;
  padding: var(--s-2);
  align-items: center;
  justify-content: space-around;
}
:root[data-theme="dark"] .bottom-tabs { background: rgba(10, 10, 10, 0.95); }
.bottom-tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: var(--s-2);
  font-size: 10px;
  color: var(--text-tertiary);
  border-radius: var(--r-md);
  transition: all var(--t-fast) var(--ease-out);
}
.bottom-tab.active { color: var(--text-primary); }
.bottom-tab svg { width: 22px; height: 22px; }
@media (max-width: 768px) {
  .bottom-tabs { display: flex; }
  body { padding-bottom: var(--bottom-tab-h); }
}

/* ─── Sticky Compare Bar ───────────────────── */
.compare-bar {
  position: fixed; bottom: var(--s-6); left: 50%; transform: translateX(-50%) translateY(120%);
  background: var(--gray-900);
  color: var(--gray-0);
  padding: var(--s-3) var(--s-4) var(--s-3) var(--s-5);
  border-radius: var(--r-full);
  display: flex; align-items: center; gap: var(--s-4);
  box-shadow: var(--shadow-xl);
  z-index: 100;
  transition: transform var(--t-base) var(--ease-out);
}
.compare-bar.visible { transform: translateX(-50%) translateY(0); }
.compare-bar-count {
  background: var(--accent);
  color: white;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: var(--w-bold);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}
:root[data-theme="dark"] .compare-bar { background: var(--gray-0); color: var(--gray-900); }

/* ─── Drawer / Modal ───────────────────────── */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-base) var(--ease-out);
}
.drawer-backdrop.visible { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 90%; max-width: 720px;
  background: var(--bg-card);
  z-index: 201;
  transform: translateX(100%);
  transition: transform var(--t-base) var(--ease-out);
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}
.drawer.visible { transform: translateX(0); }
@media (max-width: 640px) {
  .drawer { width: 100%; max-width: 100%; }
}

/* ─── Search Modal (Cmd+K) ─────────────────── */
.search-modal {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 300;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-base) var(--ease-out);
  display: flex;
  justify-content: center;
  padding-top: 10vh;
}
.search-modal.visible { opacity: 1; pointer-events: auto; }
.search-panel {
  width: 90%; max-width: 640px;
  height: fit-content;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: translateY(-12px);
  transition: transform var(--t-base) var(--ease-out);
}
.search-modal.visible .search-panel { transform: translateY(0); }
.search-input {
  width: 100%;
  padding: var(--s-5);
  font-size: var(--text-base);
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  outline: none;
}
.search-results { max-height: 60vh; overflow-y: auto; padding: var(--s-2); }
.search-result {
  padding: var(--s-3);
  border-radius: var(--r-md);
  cursor: pointer;
  display: flex; align-items: center; gap: var(--s-3);
  transition: background var(--t-fast) var(--ease-out);
}
.search-result:hover, .search-result.focused { background: var(--bg-subtle); }
.search-result-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  background: var(--bg-subtle);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

/* ─── Skeleton ─────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-subtle) 0%, var(--border-subtle) 50%, var(--bg-subtle) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite;
  border-radius: var(--r-sm);
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Utilities ────────────────────────────── */
.divider { height: 1px; background: var(--border-subtle); }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-1 { flex: 1; }
.gap-1 { gap: var(--s-1); }
.gap-2 { gap: var(--s-2); }
.gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.hidden { display: none; }
@media (max-width: 768px) { .desktop-only { display: none; } }
@media (min-width: 769px) { .mobile-only { display: none; } }

/* ─── Iconic Product Cards (v2.1) ─────────────────────── */
.card-product-v2 {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all var(--t-base) var(--ease-out);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}
.card-product-v2:hover {
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* Visual area with category-tinted gradient */
.card-product-v2 .visual {
  aspect-ratio: 16 / 11;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.visual.cat-aid { background: linear-gradient(135deg, #1E3A5F 0%, #1D4ED8 100%); }
.visual.cat-cgm { background: linear-gradient(135deg, #047857 0%, #059669 100%); }
.visual.cat-pump { background: linear-gradient(135deg, #5B21B6 0%, #7C3AED 100%); }
.visual.cat-insulin { background: linear-gradient(135deg, #9A3412 0%, #C2410C 100%); }
.visual.cat-app { background: linear-gradient(135deg, #86198F 0%, #BE185D 100%); }
.visual.cat-pen { background: linear-gradient(135deg, #4338CA 0%, #6366F1 100%); }
.visual.cat-startup { background: linear-gradient(135deg, #1E3A5F 0%, #0F766E 100%); }
.visual.cat-startup.sector-cgm    { background: linear-gradient(135deg, #1E3A5F 0%, #1D4ED8 100%); }
.visual.cat-startup.sector-niCgm  { background: linear-gradient(135deg, #047857 0%, #10B981 100%); }
.visual.cat-startup.sector-pumps  { background: linear-gradient(135deg, #5B21B6 0%, #7C3AED 100%); }
.visual.cat-startup.sector-aid    { background: linear-gradient(135deg, #1E40AF 0%, #4338CA 100%); }
.visual.cat-startup.sector-apps   { background: linear-gradient(135deg, #86198F 0%, #BE185D 100%); }
.visual.cat-startup.sector-other  { background: linear-gradient(135deg, #475569 0%, #64748B 100%); }

/* Big initials / logo display when no product image is available */
.card-product-v2 .visual .startup-monogram {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: 'Satoshi', 'General Sans', system-ui, sans-serif;
  font-weight: 800;
  font-size: 56px;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.card-product-v2 .visual .startup-monogram img {
  max-width: 70%;
  max-height: 70%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.18));
}

/* DCB Innovation Challenge pill — used inside .tags row */
.card-product-v2 .pill.dcb-pill,
.pill.dcb-pill {
  background: rgba(20, 130, 70, 0.10);
  color: #146A3A;
  border: 1px solid rgba(20, 130, 70, 0.28);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.card-product-v2 .pill.dcb-pill.dcb-winner,
.pill.dcb-pill.dcb-winner {
  background: linear-gradient(135deg, #FFD740, #FF9100);
  color: #6B4400;
  border: 1px solid #FFB000;
  box-shadow: 0 1px 3px rgba(255, 145, 0, 0.25);
}

/* Dark-mode adjustments for the DCB pill */
[data-theme="dark"] .pill.dcb-pill {
  background: rgba(74, 222, 128, 0.10);
  color: #4ADE80;
  border-color: rgba(74, 222, 128, 0.30);
}

/* Subtle texture overlay */
.card-product-v2 .visual::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.12) 0%, transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(0,0,0,0.20) 0%, transparent 40%);
  pointer-events: none;
}

/* Product image — large, white BG circle for transparent PNGs */
.card-product-v2 .product-img-wrap {
  width: 75%;
  height: 75%;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-product-v2 .product-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.25));
}

/* Logo badge on image */
.card-product-v2 .logo-badge {
  position: absolute;
  bottom: 12px; left: 12px;
  width: 32px; height: 32px;
  background: white;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  padding: 4px;
}
.card-product-v2 .logo-badge img {
  width: 100%; height: 100%; object-fit: contain;
}

/* Status indicator, top right */
.card-product-v2 .status-pill-overlay {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 55%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Category tag */
.card-product-v2 .cat-tag {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Hover: subtle scale on image */
.card-product-v2:hover .product-img-wrap { transform: scale(1.05); transition: transform 400ms var(--ease-out); }
.card-product-v2 .product-img-wrap { transition: transform 400ms var(--ease-out); }

/* Body */
.card-product-v2 .body {
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  flex: 1;
}
.card-product-v2 .body .name {
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.card-product-v2 .body .mfr {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.card-product-v2 .body .tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: auto;
  padding-top: var(--s-3);
}
.card-product-v2 .body .status-note {
  font-size: 11px;
  color: var(--text-tertiary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.card-product-v2 .body .tags .pill {
  padding: 3px 8px;
  font-size: 11px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border-radius: var(--r-full);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Compare checkbox */
.card-product-v2 .compare-btn {
  position: absolute;
  bottom: 12px; right: 12px;
  z-index: 2;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  border: none;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
  color: var(--text-primary);
}
.card-product-v2 .compare-btn:hover { background: white; transform: scale(1.1); }
.card-product-v2.in-compare {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.card-product-v2.in-compare .compare-btn {
  background: var(--accent);
  color: white;
}

/* ─────────────────────────────────────────────────────────────────
   Mobile P0 fixes (2026-05-08)
   These rules use !important to override inline `style="grid-column:..."`
   on bento tiles in home, intelligence, and more.
   ───────────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .bento-fullscreen {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
    grid-auto-rows: auto !important;
  }
  .bento-fullscreen .bento-tile {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    min-height: 180px;
    padding: var(--s-5) !important;
  }
  /* Slightly larger pills/titles since each tile is now full-width */
  .bento-fullscreen .bento-tile .tile-title-xl { font-size: clamp(26px, 7vw, 36px); }
  .bento-fullscreen .bento-tile .tile-title-lg { font-size: clamp(20px, 5.5vw, 26px); }
  .bento-fullscreen .bento-tile .tile-title-md { font-size: clamp(18px, 5vw, 22px); }
}

/* Products grid: collapse to 1 column on small screens.
   #product-grid uses inline grid-template-columns, so override with !important. */
@media (max-width: 600px) {
  #product-grid,
  .products-grid,
  .grid-products,
  .product-grid,
  .grid.grid-cols-2,
  .grid.grid-cols-3,
  .grid.grid-cols-4 {
    grid-template-columns: 1fr !important;
  }
  .card-product-v2 .visual { aspect-ratio: 16/10; }
}

/* Compare table: switch to a vertical card layout on small screens.
   Each product becomes its own card; rows stack as label / value. */
@media (max-width: 720px) {
  .compare-mobile-cards { display: block !important; }
  .compare-desktop-table { display: none !important; }
}
@media (min-width: 721px) {
  .compare-mobile-cards { display: none !important; }
}

/* Mobile header tightening: hide app subtitle text below 480px to prevent
   logo from wrapping into 2 lines next to icon buttons. */
@media (max-width: 480px) {
  .app-header-inner { gap: var(--s-3) !important; padding: 0 var(--s-3) !important; }
  .app-logo-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; font-size: 13px; }
  .app-logo-text > span:last-child { display: none; } /* hide "v2 preview" subtitle */
  .search-trigger.desktop-only { display: none !important; }
}

/* ─────────────────────────────────────────────────────────────────
   Header Refinement v2 (2026-05-08) — better logo lockup,
   active nav state, search/lang/theme alignment.
   These rules supersede the older inline styles in renderHeader().
   ───────────────────────────────────────────────────────────────── */
.app-logo {
  gap: 12px !important;
  text-decoration: none;
  padding: 4px 0;
}
.app-logo:hover { opacity: 0.85; }
.app-logo-divider {
  width: 1px; height: 24px;
  background: var(--border-subtle);
  flex-shrink: 0;
}
.app-logo-text {
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
  gap: 1px;
  margin-left: 0 !important;
}
.app-logo-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}
.app-logo-subtitle {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
  text-transform: uppercase;
}
/* Active navigation pill — clearer than just bg-subtle */
.app-nav a {
  position: relative;
}
.app-nav a.active {
  color: var(--text-primary);
  background: var(--bg-subtle);
  font-weight: 600;
}
/* Active dot indicator placed inside the pill — avoids being clipped by the header bottom-border */
.app-nav a.active::before {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
  vertical-align: middle;
}
/* Search trigger refinements — tighter, better-aligned */
.search-trigger {
  height: 36px;
  width: 280px;
  max-width: 100%;
  background: var(--bg-subtle) !important;
  border-radius: 10px !important;
}
.search-trigger:hover { background: var(--bg-card) !important; box-shadow: 0 0 0 1px var(--border-strong); }
.search-trigger .kbd { margin-left: auto; }
/* Icon buttons in header — uniform 36px height */
.app-header-right .btn-icon {
  height: 36px;
  border-radius: 10px;
}
.lang-switcher .btn-icon {
  height: 36px !important;
  padding: 0 10px !important;
}
/* Mobile — tighten further */
@media (max-width: 480px) {
  .app-logo-divider { display: none; }
  .app-logo-subtitle { display: none; }
  .app-logo { gap: 8px !important; }
}

/* ─────────────────────────────────────────────────────────────────
   Page-Title Harmonisation v2 (2026-05-08)
   Unified page header typography across all 16 V2 pages.
   Wins over .h-2xl / .h-3xl / .h-xl utilities applied to <h1>.
   ───────────────────────────────────────────────────────────────── */
.page-title {
  padding: var(--s-8) 0 var(--s-5);
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 70ch;
}
.page-title h1,
.page-title .page-h1,
main > h1:first-of-type,
main > .page-title h1,
.news-page-header h1,
.trend-content h1,
main h1.h-2xl,
main h1.h-3xl,
main h1.h-xl {
  font-family: var(--font-display);
  font-size: 36px !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  letter-spacing: -0.025em !important;
  color: var(--text-primary);
  margin: 0;
}
.page-title p,
.page-title .page-sub,
.news-page-header .lead,
.trend-content > .page-title p {
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1.5;
  color: var(--text-secondary) !important;
  margin: 0;
  max-width: 60ch;
}
.page-title .page-meta,
.page-title .t-xs {
  font-size: 13px;
  color: var(--text-tertiary);
}
/* Section H2 / H3 inside main content area — consistent across pages */
main h2:not([class*="tile-"]):not(.h-display):not(.h-3xl) {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}
main h3:not([class*="tile-"]):not(.h-display) {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}
/* Mobile — slightly smaller H1 */
@media (max-width: 720px) {
  .page-title h1,
  .page-title .page-h1,
  main > h1:first-of-type {
    font-size: 28px !important;
  }
  .page-title { padding: var(--s-5) 0 var(--s-4); }
}
/* Header subtitle cache-bust hint: re-assert v2 values */
.app-logo-subtitle {
  font-size: 10px !important;
  font-weight: 500 !important;
  letter-spacing: 0.05em !important;
  color: var(--text-tertiary) !important;
  text-transform: uppercase !important;
}
