/* ══════════════════════════════════════════════════════
   GREENVILLE TRIUMPH — MATCH DAY GUIDE
   Design System: Triumph Dashboard Design System v2
   ══════════════════════════════════════════════════════ */
@layer reset, base, components, utilities;

:root {
  /* ── Dashboard-specific tokens ── */
  --accent-border: color-mix(in oklch, var(--accent) 30%, transparent);
  --accent-hover: color-mix(in oklch, var(--accent) 20%, transparent);
  --fg-on-accent: #fff;

  /* ── Legacy aliases (used throughout components) ── */
  --bg-base: var(--bg);
  --bg-raised: var(--surface);
  --bg-overlay: var(--surface2);
  --bg-sunken: var(--surface3);
  --bg-glass: light-dark(rgba(248,250,252,0.8), rgba(10,13,18,0.75));
  --bg-glass-solid: light-dark(rgba(248,250,252,0.95), rgba(10,13,18,0.95));
  --fg-default: var(--text);
  --fg-muted: var(--text-dim);
  --fg-subtle: var(--text-muted);
  --border-default: var(--border);
  --border-muted: light-dark(rgba(0,0,0,0.04), rgba(255,255,255,0.04));

  /* ── Spacing (granular, dashboard-specific) ── */
  --space-0: 0;
  --space-px: 1px;
  --space-0-5: 0.125rem;
  --space-1: 0.25rem;
  --space-1-5: 0.375rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* ── Typography (dashboard-specific) ── */
  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.5;

  /* ── Radii (dashboard-specific) ── */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.875rem;
  --radius-full: 9999px;

  /* ── Focus ── */
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);

  /* ── Layout ── */
  --content-width: min(100% - 2rem, 840px);
}

body.light { color-scheme: light; }

/* ── RESET ── */
@layer reset {
  *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
  a, button, input, select, textarea { touch-action: manipulation; }
  html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
    scroll-padding-top: 56px;
  }
}

/* ── BASE ── */
@layer base {
  body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    background-color: var(--bg);
    background-image:
      radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
      radial-gradient(ellipse 80% 60% at 20% 80%, rgba(34,197,94,0.10), transparent 50%),
      radial-gradient(ellipse 60% 80% at 85% 20%, rgba(59,130,246,0.08), transparent 50%);
    background-size: 24px 24px, 100% 100%, 100% 100%;
    background-attachment: fixed;
    color: var(--text);
    min-height: 100dvh;
    overflow-x: hidden;
    position: relative;
    z-index: 0;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-weight: 400;
  }

  /* Noise grain overlay */
  html::after {
    content: '';
    position: fixed;
    inset: 0;
    opacity: 0.018;
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 9999;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") repeat;
    background-size: 256px 256px;
  }

  h1, h2, h3, h4 { line-height: var(--leading-tight); }
  p { max-width: 65ch; }
  code, pre { font-family: var(--font-mono); }

  .skip-link {
    position: absolute; top: -100%; left: var(--space-4);
    padding: var(--space-2) var(--space-4);
    background: var(--accent); color: var(--fg-on-accent);
    border-radius: var(--radius-md); font-weight: 600; font-size: var(--text-sm);
    z-index: 9999; text-decoration: none;
  }
  .skip-link:focus { top: var(--space-2); }

  @supports (padding: env(safe-area-inset-top)) {
    .header { padding-top: max(var(--space-2), env(safe-area-inset-top)); }
    .bottom-nav { padding-bottom: env(safe-area-inset-bottom); }
  }
}

/* ── COMPONENTS ── */
@layer components {

  /* ── Animations (reduced-motion-first) ── */
  .animate-in, .animate-stagger > * { opacity: 1; transform: none; }
  @media (prefers-reduced-motion: no-preference) {
    @keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
    @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
    @keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
    .animate-in { animation: fadeInUp 0.3s var(--ease-out) both; }
    .animate-stagger > * { animation: fadeInUp 0.25s var(--ease-out) both; }
    .animate-stagger > *:nth-child(1) { animation-delay: 20ms; }
    .animate-stagger > *:nth-child(2) { animation-delay: 40ms; }
    .animate-stagger > *:nth-child(3) { animation-delay: 60ms; }
    .animate-stagger > *:nth-child(4) { animation-delay: 80ms; }
    .animate-stagger > *:nth-child(5) { animation-delay: 100ms; }
    .animate-stagger > *:nth-child(6) { animation-delay: 120ms; }
    .animate-stagger > *:nth-child(7) { animation-delay: 140ms; }
    .animate-stagger > *:nth-child(8) { animation-delay: 160ms; }
  }

  /* ══ HEADER ══ */
  .header {
    background: var(--bg-glass);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: var(--space-2) var(--space-4);
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 200;
    height: 48px;
  }
  .header::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: var(--accent);
  }
  .header.scrolled { background: var(--bg-glass-solid); border-bottom-color: var(--border-default); }
  .header-left { display: flex; align-items: center; gap: var(--space-2); }
  .header h1 { font-size: var(--text-sm); font-weight: 700; white-space: nowrap; color: var(--fg-default); letter-spacing: -0.01em; }
  .header h1 span { color: var(--accent); }
  .header-right { display: flex; align-items: center; gap: var(--space-1-5); }
  .header-badge {
    font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.02em;
    background: var(--accent-muted); color: var(--accent);
    padding: 2px var(--space-2); border-radius: var(--radius-sm);
  }
  .live-clock {
    font-family: var(--font-mono); font-size: var(--text-xs);
    color: var(--fg-muted); font-weight: 600; font-variant-numeric: tabular-nums;
  }

  /* ══ ICON BUTTON ══ */
  .icon-btn {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: var(--radius-full);
    border: 1px solid var(--border-default); background: var(--bg-overlay);
    color: var(--fg-muted); cursor: pointer; flex-shrink: 0;
    transition: color var(--duration-fast), border-color var(--duration-fast);
  }
  .icon-btn:hover { border-color: var(--accent); color: var(--fg-default); }
  .icon-btn:focus-visible { box-shadow: var(--focus-ring); outline: none; }

  /* ══ HERO ══ */
  .hero {
    background: var(--bg-sunken);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-default);
    padding: var(--space-5) var(--space-4) var(--space-4);
    text-align: center;
  }
  .hero-teams { margin-bottom: var(--space-2); }
  .hero-home {
    font-size: var(--text-xl); font-weight: 800; color: var(--accent);
    text-transform: uppercase; letter-spacing: -0.01em;
  }
  .hero-sep {
    font-size: var(--text-sm); color: var(--fg-subtle); font-weight: 400;
    margin: 0 var(--space-2);
  }
  .hero-away {
    font-size: var(--text-xl); font-weight: 800; color: var(--fg-default);
    text-transform: uppercase; letter-spacing: -0.01em;
  }
  .hero-details {
    font-size: var(--text-xs); color: var(--fg-muted); margin-bottom: var(--space-3);
    line-height: var(--leading-normal);
  }
  .hero-kickoff-time {
    font-family: var(--font-mono); font-size: var(--text-2xl);
    font-weight: 800; color: var(--fg-default); display: block;
    font-variant-numeric: tabular-nums;
  }
  .hero-kickoff-label {
    font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.12em; color: var(--fg-subtle); margin-top: 2px;
  }
  .hero-countdown {
    font-family: var(--font-mono); font-size: var(--text-xs);
    color: var(--fg-muted); font-weight: 600; margin-top: var(--space-2);
    font-variant-numeric: tabular-nums;
  }
  .hero-countdown .cd-num { color: var(--accent); font-weight: 700; }

  /* ══ TAB BAR (desktop) ══ */
  .tab-bar {
    display: none;
    background: var(--bg-glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-default);
    position: sticky; top: 48px; z-index: 190;
    justify-content: center; gap: 0; padding: 0 var(--space-2);
  }
  .tab-bar::-webkit-scrollbar { display: none; }
  .tab-btn {
    display: flex; align-items: center; gap: var(--space-1-5);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-xs); font-weight: 600; color: var(--fg-subtle);
    background: none; border: none; border-bottom: 2px solid transparent;
    cursor: pointer; white-space: nowrap;
    transition: color var(--duration-fast), border-color var(--duration-fast);
  }
  .tab-btn:focus-visible { box-shadow: var(--focus-ring); outline: none; border-radius: var(--radius-sm); }
  .tab-btn:hover { color: var(--fg-muted); }
  .tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
  .tab-btn svg { flex-shrink: 0; }

  /* ══ TAB CONTENT ══ */
  .tab-content { display: none; padding: var(--space-3); }
  .tab-content.active { display: block; }
  @media (prefers-reduced-motion: no-preference) {
    .tab-content.active { animation: fadeIn var(--duration-normal) var(--ease-out); }
  }

  /* ══ BOTTOM NAV (mobile) ══ */
  .bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--bg-glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-default);
    display: flex; z-index: 300;
    padding: var(--space-1) 0 var(--space-0-5);
  }
  .bnav-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    gap: 2px; padding: var(--space-1) 0;
    background: none; border: none; color: var(--fg-subtle);
    font-size: 0.58rem; font-weight: 600; font-family: var(--font-sans);
    cursor: pointer; transition: color var(--duration-fast);
    letter-spacing: 0.01em;
  }
  .bnav-btn svg { width: 22px; height: 22px; flex-shrink: 0; }
  .bnav-btn.active { color: var(--accent); }
  .bnav-btn:focus-visible { box-shadow: var(--focus-ring); outline: none; border-radius: var(--radius-sm); }

  /* ══ SEARCH ══ */
  .search-wrap { position: relative; margin-bottom: var(--space-3); }
  .search-wrap input {
    width: 100%; padding: var(--space-2-5, 0.625rem) var(--space-3) var(--space-2-5, 0.625rem) var(--space-10);
    background: var(--bg-sunken); border: 1px solid var(--border-default);
    border-radius: var(--radius-md); color: var(--fg-default);
    font-size: 16px; font-family: inherit; outline: none;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
  }
  .search-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-muted); }
  .search-wrap input::placeholder { color: var(--fg-subtle); }
  .search-icon { position: absolute; left: var(--space-3); top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--fg-subtle); }
  .search-count { position: absolute; right: var(--space-3); top: 50%; transform: translateY(-50%); font-size: var(--text-xs); color: var(--fg-subtle); font-weight: 500; }

  /* ══ CARDS ══ */
  .card {
    background: var(--bg-raised);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-default);
    border-radius: 14px; padding: var(--space-4); margin-bottom: var(--space-3);
  }
  .card-header {
    font-size: var(--text-sm); font-weight: 600; color: var(--fg-default);
    margin-bottom: var(--space-3); padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border-muted);
    display: flex; align-items: center; justify-content: space-between;
  }
  .card-count {
    font-size: var(--text-xs); font-weight: 600; color: var(--fg-subtle);
    font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  }

  /* ══ KPI ══ */
  .kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); margin-bottom: var(--space-3); }
  .kpi {
    background: var(--bg-raised);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-default);
    border-radius: 14px; padding: var(--space-3);
    position: relative; overflow: hidden;
  }
  .kpi::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    opacity: 0.5; transition: opacity 0.2s ease;
  }
  @media (hover: hover) {
    .kpi:hover::before { opacity: 1; }
  }
  .kpi-label { font-size: var(--text-xs); color: var(--fg-subtle); font-weight: 500; margin-bottom: var(--space-0-5); }
  .kpi-value {
    font-size: var(--text-xl); font-weight: 700; color: var(--fg-default);
    font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  }
  .kpi-sub { font-size: var(--text-xs); color: var(--fg-subtle); margin-top: var(--space-0-5); }

  /* ══ CONTACTS ══ */
  .contact-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--space-2-5, 0.625rem) 0; border-bottom: 1px solid var(--border-muted);
  }
  .contact-row:last-child { border-bottom: none; }
  .contact-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-2); }
  .contact-avatar {
    width: 32px; height: 32px; border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: var(--text-xs); flex-shrink: 0;
    background: var(--accent-muted); color: var(--accent);
  }
  .contact-avatar.vn { background: rgba(34,197,94,0.10); color: var(--fg-muted); }
  .contact-text { min-width: 0; }
  .contact-name { font-size: var(--text-sm); font-weight: 600; }
  .contact-title { font-size: var(--text-xs); color: var(--fg-subtle); line-height: var(--leading-snug); }
  .phone-btn {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; background: var(--accent-muted);
    border-radius: var(--radius-full); color: var(--accent);
    border: none; cursor: pointer; flex-shrink: 0; margin-left: var(--space-2);
    min-width: 44px; min-height: 44px; padding: 0; font-family: inherit;
    transition: background var(--duration-fast);
  }
  .phone-btn:active { background: var(--accent); color: var(--fg-on-accent); }
  .phone-btn:focus-visible { box-shadow: var(--focus-ring); outline: none; }

  /* ══ TIMELINE ══ */
  .tl-section { margin-bottom: var(--space-4); }
  .tl-section-header {
    font-size: var(--text-xs); font-weight: 600; color: var(--fg-muted);
    padding: var(--space-2) var(--space-3); border-radius: var(--radius-md);
    margin-bottom: var(--space-2); display: flex; align-items: center;
    justify-content: space-between; background: var(--bg-overlay);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    cursor: pointer; user-select: none;
  }
  .tl-section-header-left { display: flex; align-items: center; gap: var(--space-2); }
  .tl-toggle-arrow {
    width: 0; height: 0;
    border-left: 4px solid transparent; border-right: 4px solid transparent;
    border-top: 4px solid currentColor; flex-shrink: 0;
    transition: transform var(--duration-fast) var(--ease-out);
  }
  .tl-section-header.collapsed .tl-toggle-arrow { transform: rotate(-90deg); }
  .tl-count { font-size: var(--text-xs); color: var(--fg-subtle); font-weight: 500; }
  .tl-body { overflow: hidden; max-height: 5000px; opacity: 1; }
  @media (prefers-reduced-motion: no-preference) {
    .tl-body { transition: max-height 0.3s var(--ease-out), opacity var(--duration-fast) var(--ease-out); }
  }
  .tl-body.collapsed { max-height: 0; opacity: 0; }

  .tl-list { position: relative; padding-left: var(--space-5); }
  .tl-list::before {
    content: ''; position: absolute; left: 5px; top: 0; bottom: 0;
    width: 2px; background: var(--border-default); border-radius: 1px;
  }
  .tl-item {
    display: grid; grid-template-columns: 80px 1fr; gap: var(--space-2);
    padding: var(--space-2) 0; font-size: var(--text-sm); position: relative;
  }
  .tl-item::before {
    content: ''; position: absolute; left: -17px; top: 12px;
    width: 8px; height: 8px; border-radius: var(--radius-full);
    background: var(--fg-subtle); border: 2px solid var(--bg-base); z-index: 1;
  }
  .tl-time {
    font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 600;
    color: var(--fg-muted); text-align: right; white-space: nowrap;
    font-variant-numeric: tabular-nums; padding-top: 1px;
  }
  .tl-activity { font-weight: 500; }
  .tl-detail { font-size: var(--text-xs); color: var(--fg-subtle); margin-top: 2px; }
  .tl-item.highlight {
    background: var(--accent-subtle); border-radius: var(--radius-md);
    padding: var(--space-2); margin: var(--space-1) 0;
    border: 1px solid var(--accent-muted);
  }
  .tl-item.highlight .tl-activity { color: var(--accent); font-weight: 700; }
  .tl-item.highlight::before { background: var(--accent); }

  /* ══ RADIO ══ */
  .radio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: var(--space-2); }
  .radio-chip {
    background: var(--bg-overlay);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-default);
    border-radius: 14px; padding: var(--space-3); text-align: center;
  }
  .radio-ch {
    font-family: var(--font-mono); font-size: var(--text-2xl); font-weight: 800;
    color: var(--accent); font-variant-numeric: tabular-nums;
  }
  .radio-dept { font-size: var(--text-xs); color: var(--fg-muted); font-weight: 500; margin-top: 2px; }

  /* ══ WRISTBANDS ══ */
  .wb-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--border-muted); }
  .wb-row:last-child { border-bottom: none; }
  .wb-dot { width: 24px; height: 24px; border-radius: var(--radius-full); flex-shrink: 0; border: 2px solid rgba(255,255,255,0.1); }
  .wb-name { font-size: var(--text-sm); font-weight: 600; }
  .wb-meaning { font-size: var(--text-xs); color: var(--fg-subtle); }

  /* ══ DATA TABLE ══ */
  .data-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
  .data-table th {
    text-align: left; padding: var(--space-2);
    background: var(--surface3);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    color: var(--fg-muted); font-weight: 600; font-size: var(--text-xs);
    white-space: nowrap; position: sticky; top: 0;
  }
  .data-table td { padding: var(--space-2); border-top: 1px solid var(--border-muted); vertical-align: top; }
  .scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 14px; border: 1px solid var(--border-default); }

  /* ══ ROSTER ══ */
  .roster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-2); }
  .roster-card {
    background: var(--bg-overlay);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md); padding: var(--space-2-5, 0.625rem); display: flex;
    align-items: center; gap: var(--space-2);
  }
  .roster-num {
    width: 28px; height: 28px; border-radius: var(--radius-full);
    background: var(--accent-muted); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-weight: 700; font-size: var(--text-xs);
    flex-shrink: 0; font-variant-numeric: tabular-nums;
  }
  .roster-pname { font-size: var(--text-sm); font-weight: 500; }

  /* ══ STAFF CHIP ══ */
  .staff-card {
    display: inline-flex; align-items: center; gap: var(--space-2);
    background: var(--bg-overlay);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); margin: var(--space-1);
  }
  .staff-avatar {
    width: 30px; height: 30px; border-radius: var(--radius-full);
    background: var(--accent-muted); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: var(--text-xs); flex-shrink: 0;
  }
  .staff-name { font-size: var(--text-sm); font-weight: 600; }
  .staff-role { font-size: var(--text-xs); color: var(--fg-subtle); }

  /* ══ METERS ══ */
  .meter-row { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
  .meter-label { font-size: var(--text-xs); font-weight: 600; width: 90px; text-align: right; color: var(--fg-muted); }
  .meter-track {
    flex: 1; height: 20px; background: var(--bg-sunken); border-radius: var(--radius-sm);
    overflow: hidden; position: relative; border: 1px solid var(--border-default);
  }
  .meter-fill { height: 100%; border-radius: var(--radius-sm); position: relative; }
  @media (prefers-reduced-motion: no-preference) {
    .meter-fill { transition: width 0.6s var(--ease-out); }
    .meter-fill::after {
      content: ''; position: absolute; inset: 0;
      background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
      background-size: 200% 100%; animation: shimmer 2.5s infinite;
    }
  }
  .meter-text {
    position: absolute; right: var(--space-2); top: 50%; transform: translateY(-50%);
    font-size: var(--text-xs); font-family: var(--font-mono); font-weight: 700;
    color: var(--fg-default); text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    font-variant-numeric: tabular-nums;
  }
  .meter-pct {
    position: absolute; left: var(--space-2); top: 50%; transform: translateY(-50%);
    font-size: var(--text-xs); font-family: var(--font-mono); font-weight: 700;
    color: rgba(255,255,255,0.8); text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    font-variant-numeric: tabular-nums;
  }

  /* ══ INFO ROW ══ */
  .info-row {
    display: flex; justify-content: space-between; padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border-muted); font-size: var(--text-sm);
  }
  .info-row:last-child { border-bottom: none; }
  .info-label { color: var(--fg-subtle); font-weight: 500; }
  .info-value { font-weight: 600; text-align: right; max-width: 60%; }

  /* ══ PA CALLOUT ══ */
  .pa-callout {
    margin-top: var(--space-3); padding: var(--space-3);
    background: var(--accent-subtle); border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: var(--text-sm); color: var(--fg-default); font-weight: 500;
  }
  .pa-label {
    font-size: var(--text-xs); font-weight: 700; color: var(--accent);
    margin-bottom: var(--space-1); display: block;
  }

  /* ══ ELEMENT ROW ══ */
  .el-row { padding: var(--space-2) 0; border-bottom: 1px solid var(--border-muted); font-size: var(--text-sm); }
  .el-row:last-child { border-bottom: none; }
  .el-name { font-weight: 600; }
  .el-meta { color: var(--fg-subtle); font-size: var(--text-xs); margin-top: 2px; }
  .el-item { padding: var(--space-1) 0; font-size: var(--text-sm); font-weight: 500; }

  /* ══ NOW WIDGET ══ */
  .now-widget {
    background: var(--accent-subtle); border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: var(--space-3) var(--space-4); margin-bottom: var(--space-3);
  }
  .now-widget-label {
    font-size: var(--text-xs); font-weight: 700; color: var(--accent);
    margin-bottom: var(--space-1-5); display: flex; align-items: center; gap: var(--space-1);
  }
  .now-dot {
    width: 6px; height: 6px; border-radius: var(--radius-full);
    background: var(--accent); display: inline-block;
  }
  .now-activity { font-size: var(--text-lg); font-weight: 700; color: var(--fg-default); margin-bottom: 2px; }
  .now-meta { font-size: var(--text-xs); color: var(--fg-muted); }
  .now-next {
    margin-top: var(--space-2); padding-top: var(--space-2);
    border-top: 1px solid var(--border-muted);
    font-size: var(--text-xs); color: var(--fg-subtle);
  }
  .now-next strong { color: var(--fg-muted); font-weight: 600; }

  /* ══ KEY CONTACTS ══ */
  .key-contacts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); margin-bottom: var(--space-3); }
  .key-contact {
    background: var(--bg-raised);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-default);
    border-radius: 14px; padding: var(--space-3);
    display: flex; flex-direction: column; align-items: center;
    text-align: center; gap: var(--space-1); cursor: pointer;
    text-decoration: none; color: inherit;
    transition: border-color var(--duration-fast);
  }
  .key-contact:active { background: var(--bg-overlay); }
  .key-contact-avatar {
    width: 36px; height: 36px; border-radius: var(--radius-full);
    background: var(--accent-muted); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: var(--text-xs);
  }
  .key-contact-name { font-size: var(--text-xs); font-weight: 600; line-height: 1.3; }
  .key-contact-role { font-size: 0.6rem; color: var(--fg-subtle); line-height: 1.2; }

  /* ══ CESA BANNER ══ */
  .cesa-banner {
    background: var(--accent-subtle); border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: var(--space-2) var(--space-4); margin-bottom: var(--space-3);
    font-size: var(--text-sm); font-weight: 600; color: var(--accent);
  }

  /* ══ TIMELINE NOW MARKER ══ */
  .tl-item.tl-now {
    background: var(--accent-subtle); border-radius: var(--radius-md);
    padding: var(--space-2); margin: var(--space-1) 0;
    border-left: 3px solid var(--accent);
  }
  .tl-now-badge {
    display: inline-block; font-size: 0.55rem; font-weight: 700;
    background: var(--accent); color: var(--fg-on-accent);
    padding: 1px 5px; border-radius: var(--radius-sm); margin-left: var(--space-1);
    vertical-align: middle; letter-spacing: 0.04em;
  }

  /* ══ CONTACT SHEET ══ */
  .contact-sheet {
    position: fixed; inset: 0; z-index: 500;
    display: flex; align-items: flex-end; justify-content: center;
    background: rgba(0,0,0,0.5);
    opacity: 0; pointer-events: none;
    transition: opacity var(--duration-fast) var(--ease-out);
  }
  .contact-sheet.open { opacity: 1; pointer-events: auto; }
  .contact-sheet-card {
    background: var(--bg-raised);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: var(--space-6) var(--space-5);
    padding-bottom: max(var(--space-8), env(safe-area-inset-bottom, var(--space-8)));
    width: 100%; max-width: 400px; text-align: center;
    transform: translateY(100%);
    transition: transform var(--duration-normal) var(--ease-out);
  }
  .contact-sheet.open .contact-sheet-card { transform: translateY(0); }
  .contact-sheet-avatar {
    width: 52px; height: 52px; border-radius: var(--radius-full);
    background: var(--accent-muted); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: var(--text-lg);
    margin: 0 auto var(--space-3);
  }
  .contact-sheet-name { font-size: var(--text-xl); font-weight: 700; margin-bottom: var(--space-1); }
  .contact-sheet-title { font-size: var(--text-sm); color: var(--fg-muted); margin-bottom: var(--space-1); line-height: var(--leading-normal); }
  .contact-sheet-phone { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--fg-subtle); margin-bottom: var(--space-5); font-variant-numeric: tabular-nums; }
  .contact-sheet-actions {
    display: flex; gap: var(--space-3); justify-content: center; width: 100%; max-width: 320px; margin: 0 auto;
  }
  .contact-sheet-action {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    font-weight: 700; font-size: var(--text-base);
    padding: var(--space-3) var(--space-5); border-radius: var(--radius-md);
    text-decoration: none; min-height: 48px; flex: 1;
    transition: transform var(--duration-fast);
  }
  .contact-sheet-action:active { transform: scale(0.97); }
  .cs-call { background: var(--accent); color: var(--fg-on-accent); }
  .cs-text { background: var(--bg-glass); color: var(--fg-default); border: 1px solid var(--border-default); }

  /* ══ TOUCH DEVICES ══ */
  @media (hover: none) {
    .kpi::before { opacity: 0.5; }
    .card, .key-contact, .roster-card, .staff-card { transform: none !important; }
  }

  /* ══ RESPONSIVE ══ */

  /* Mobile (<480px) */
  @media (max-width: 479px) {
    .header h1 { font-size: var(--text-xs); }
    .header-badge { font-size: 0.55rem; }
    .live-clock { font-size: 0.6rem; }
    .hero { padding: var(--space-4) var(--space-3) var(--space-3); }
    .hero-home, .hero-away { font-size: var(--text-lg); }
    .hero-kickoff-time { font-size: var(--text-xl); }
    .tab-content { padding: var(--space-2); padding-bottom: 72px; }
    .card { padding: var(--space-3); margin-bottom: var(--space-2); }
    .card-header { font-size: var(--text-xs); }
    .kpi { padding: var(--space-2-5, 0.625rem); }
    .kpi-value { font-size: var(--text-lg); }
    .kpi-label { font-size: 0.6rem; }
    .kpi-sub { font-size: 0.6rem; }
    .contact-avatar { width: 30px; height: 30px; font-size: 0.6rem; }
    .phone-btn { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
    .tl-item { grid-template-columns: 70px 1fr; font-size: var(--text-sm); }
    .tl-time { font-size: 0.6rem; }
    .tl-detail { font-size: 0.58rem; }
    .radio-grid { grid-template-columns: repeat(3, 1fr); }
    .radio-ch { font-size: var(--text-xl); }
    .radio-dept { font-size: 0.58rem; }
    .meter-label { width: 70px; font-size: 0.6rem; }
    .roster-grid { grid-template-columns: 1fr 1fr; }
    .roster-card { padding: var(--space-2); }
    .roster-num { width: 24px; height: 24px; font-size: 0.6rem; }
    .roster-pname { font-size: var(--text-xs); }
    .staff-card { padding: var(--space-2); margin: 2px; }
    .staff-avatar { width: 26px; height: 26px; font-size: 0.55rem; }
    .staff-name { font-size: var(--text-xs); }
    .staff-role { font-size: 0.58rem; }
    .key-contacts-grid { grid-template-columns: repeat(3, 1fr); gap: var(--space-1-5); }
    .key-contact { padding: var(--space-2); }
    .key-contact-avatar { width: 32px; height: 32px; }
    .search-wrap input { padding: var(--space-2) var(--space-3) var(--space-2) 34px; }
    .data-table { font-size: var(--text-xs); }
    .data-table th { padding: var(--space-1-5); font-size: 0.55rem; }
    .data-table td { padding: var(--space-1-5); }
    .bottom-nav { padding: var(--space-0-5) 0 0; }
    .bnav-btn svg { width: 20px; height: 20px; }
    .bnav-btn { font-size: 0.55rem; }
  }

  /* Tablet (480–767px) */
  @media (min-width: 480px) and (max-width: 767px) {
    .tab-content { padding: var(--space-3); padding-bottom: 72px; }
    .key-contacts-grid { grid-template-columns: repeat(3, 1fr); }
  }

  /* Desktop (768px+) */
  @media (min-width: 768px) {
    html { scroll-padding-top: 100px; }
    .tab-bar { display: flex; }
    .bottom-nav { display: none; }
    .tab-content { padding: var(--space-5) var(--space-6); }
    .kpi-grid { grid-template-columns: repeat(4, 1fr); }
    .hero { padding: var(--space-6); }
    .hero-home, .hero-away { font-size: var(--text-2xl); }
    .tl-item { grid-template-columns: 90px 1fr; }
    .header { height: 52px; padding: var(--space-2) var(--space-6); }
    .header h1 { font-size: var(--text-base); }
    .roster-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .key-contacts-grid { grid-template-columns: repeat(6, 1fr); }
  }
  @media (min-width: 1024px) {
    .tab-content { max-width: var(--content-width); margin: 0 auto; }
  }

  /* Print */
  @media print {
    body { background: #fff !important; color: #000; }
    html::after { display: none; }
    .header, .tab-bar, .bottom-nav, .search-wrap, .contact-sheet { display: none; }
    .tab-content { display: block !important; padding: var(--space-2); }
    .card { background: #fff; border: 1px solid #ccc; break-inside: avoid; backdrop-filter: none; }
    .kpi { background: #fff; backdrop-filter: none; }
    .kpi::before { display: none; }
  }

  /* High contrast */
  @media (prefers-contrast: more) {
    :root {
      --border: rgba(255,255,255,0.2);
      --border-default: rgba(255,255,255,0.2);
      --border-muted: rgba(255,255,255,0.12);
      --text-dim: #b0bec5;
      --text-muted: #78909c;
      --fg-muted: #b0bec5;
      --fg-subtle: #78909c;
    }
  }

} /* end @layer components */
