/* ============================================================================
   TCU WebInsight v3 — shared report CSS
   Single stylesheet for all 4 depts. Plain CSS, no preprocessor.
   Color palette sourced from shared/style.css (TCGA colors).
   ============================================================================ */

:root {
  /* Brand palette */
  --navy: #15334a;
  --navy2: #214f68;
  --teal: #1d7d78;
  --teal2: #3f9d96;
  --blue: #2563eb;
  --green: #047857;
  --amber: #b45309;
  --red: #b91c1c;
  --ink: #20313d;
  --muted: #647581;
  --line: #dce5e9;
  --soft: #f4f7f8;
  --bg: #ffffff;
  --card: #ffffff;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);

  /* Status */
  --ok-bg: #ecfdf5;
  --ok-fg: #047857;
  --warn-bg: #fffbeb;
  --warn-fg: #b45309;
  --bad-bg: #fef2f2;
  --bad-fg: #b91c1c;
  --info-bg: #eff6ff;
  --info-fg: #1d4ed8;
}

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

/* ===== THREE.JS BACKGROUND ===== */
#three-bg {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: -1 !important;
  pointer-events: none;
  background: linear-gradient(135deg, #f4f7f8 0%, #e8eef2 100%);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Microsoft JhengHei", "Segoe UI", "PingFang TC", sans-serif;
  background: transparent;
  color: var(--ink);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* ===== HEADER ===== */
.site-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy2) 100%);
  color: white;
  padding: 28px 32px 22px;
}
.site-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.site-header h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.3;
  margin-bottom: 6px;
}
.site-header .breadcrumb {
  font-size: 13px;
  opacity: 0.85;
}
.site-header .breadcrumb a { color: #bde8ec; text-decoration: none; }
.site-header .breadcrumb a:hover { text-decoration: underline; }
.site-header .actions { display: flex; gap: 8px; }
.site-header button {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.site-header button:hover { background: rgba(255,255,255,0.22); }
.meta-bar {
  max-width: 1280px;
  margin: 12px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
  opacity: 0.92;
}
.meta-bar .pill {
  background: rgba(255,255,255,0.1);
  padding: 4px 10px;
  border-radius: 999px;
}
.meta-bar .pill.date-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
}
.meta-bar .pill.date-picker label {
  font-size: 12px;
  opacity: 0.85;
  margin-right: 2px;
}
.meta-bar .pill.date-picker input[type="date"] {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  width: 130px;
}
.meta-bar .pill.date-picker input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}
/* Time-range selector (1d/2d/3d/…/6mo) — primary window control */
.meta-bar .pill.date-picker select {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.meta-bar .pill.date-picker select option {
  background: var(--navy);
  color: white;
}
.meta-bar .pill.date-picker button {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}
.meta-bar .pill.date-picker button:hover {
  background: rgba(255,255,255,0.3);
}
.meta-bar .pill.date-picker select {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  min-width: 110px;
}
.meta-bar .pill.date-picker select:hover { background: rgba(255,255,255,0.22); }
.meta-bar .pill.date-picker select option {
  background: var(--navy);
  color: white;
}

/* 套用 button — bright accent so users immediately see it as the action button */
.meta-bar .pill.date-picker button#btn-apply-range {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
  font-weight: 700;
  padding: 6px 16px;
  box-shadow: 0 2px 8px rgba(29, 125, 120, 0.35);
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.meta-bar .pill.date-picker button#btn-apply-range:hover {
  background: #155f5b;
  box-shadow: 0 3px 12px rgba(29, 125, 120, 0.45);
  transform: translateY(-1px);
}
.meta-bar .pill.date-picker button#btn-apply-range:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(29, 125, 120, 0.35);
}

/* When the dropdown has changed but the user hasn't clicked 套用 yet, the
   apply button pulses teal to signal "pending". */
.meta-bar .pill.date-picker button#btn-apply-range.btn-pending {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
  font-weight: 700;
  animation: btnPulse 1.2s ease-in-out infinite;
}
@keyframes btnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(29, 125, 120, 0.5); transform: scale(1); }
  50% { box-shadow: 0 0 0 8px rgba(29, 125, 120, 0); transform: scale(1.04); }
}


/* When 套用 is clicked, briefly flash to confirm the action */
.meta-bar .pill.date-picker button#btn-apply-range.applied-flash {
  animation: appliedFlash 0.6s ease-out;
}
@keyframes appliedFlash {
  0%   { background: #4ee0c1; box-shadow: 0 0 0 6px rgba(78, 224, 193, 0.5); }
  100% { background: var(--teal); box-shadow: 0 2px 8px rgba(29, 125, 120, 0.35); }
}

/* ===== CUSTOM DATE PICKER ===== */
.meta-bar .pill.date-picker .date-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.meta-bar .pill.date-picker .date-trigger label {
  font-size: 12px;
  opacity: 0.85;
  margin-right: 2px;
}
.date-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.date-btn:hover { background: rgba(255,255,255,0.28); }
.date-display {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.cal-popup {
  position: absolute;
  z-index: 1000;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.18);
  padding: 12px;
  width: 280px;
  font-family: -apple-system, BlinkMacSystemFont, "Microsoft JhengHei", "Segoe UI", "PingFang TC", sans-serif;
  color: var(--ink);
  user-select: none;
  text-align: center;       /* center-justified everywhere */
}
.cal-popup[hidden] { display: none; }
.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 4px 0;
}
.cal-title {
  font-weight: 700;
  font-size: 14px;
  text-align: center;        /* center-justified */
  flex: 1;
  color: var(--navy);
}
.cal-nav {
  background: transparent;
  border: 1px solid var(--line);
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.cal-nav:hover { background: var(--soft); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;        /* center-justified */
}
.cal-dow > div {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  padding: 6px 0;
  text-align: center;        /* center-justified */
}
.cal-days { font-size: 13px; }
.cal-day {
  background: transparent;
  border: none;
  padding: 8px 0;
  border-radius: 4px;
  cursor: pointer;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  text-align: center;        /* center-justified */
  width: 100%;
  font-variant-numeric: tabular-nums;
}
.cal-day:hover { background: var(--soft); }
.cal-day.cal-other-month { color: #cbd5e1; }
.cal-day.cal-today { font-weight: 700; color: var(--teal); }
.cal-day.cal-selected { background: var(--teal); color: white; font-weight: 700; }
.cal-day.cal-selected:hover { background: var(--teal2); }
.cal-day.cal-disabled { color: #e2e8f0; cursor: not-allowed; }
.cal-day.cal-disabled:hover { background: transparent; }

.cal-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.cal-action {
  background: transparent;
  border: 1px solid var(--line);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  color: var(--navy);
  font-family: inherit;
}
.cal-action:hover { background: var(--soft); }

/* ===== MAIN LAYOUT ===== */
main {
  max-width: 1280px;
  margin: 24px auto;
  padding: 0 24px 80px;
}
/* ===== SECTION ===== */
.section {
  background: var(--card);
  border-radius: 10px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  /* No overflow:hidden here — would clip glossary tooltips that extend beyond the section.
     The section-body-wrap still has overflow:hidden (line ~190) so the collapse animation works. */
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.5s ease-out forwards;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.section:hover { box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08); }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* Stagger entrance for the first few sections */
.section:nth-of-type(1) { animation-delay: 0.05s; }
.section:nth-of-type(2) { animation-delay: 0.15s; }
.section:nth-of-type(3) { animation-delay: 0.25s; }

.section-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background 0.2s ease;
}
.section-header:hover { background: rgba(0,0,0,0.015); }
.section-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-header h2 .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--teal);
  color: white;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.section:hover .section-header h2 .num {
  transform: scale(1.08) rotate(-3deg);
}
.section-header .lead {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 400;
}
.section-header .toggle {
  font-size: 13px;
  color: var(--muted);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
}
.section.collapsed .toggle { transform: rotate(-90deg); }

/* ===== TREND CONTROLS (from / to / interval / 套用) — injected into Section 3 header ===== */
.trend-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  margin-right: 12px;
  flex-wrap: wrap;
}
.trend-controls .trend-field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.trend-controls input[type="date"],
.trend-controls input[type="number"],
.trend-controls select {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--ink);
  background: white;
  cursor: pointer;
}
.trend-controls input[type="number"] { width: 52px; }
.trend-controls input:focus,
.trend-controls select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(29, 125, 120, 0.15);
}
.trend-controls button#trend-apply {
  background: var(--teal);
  border: 1px solid var(--teal);
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, box-shadow 0.15s;
}
.trend-controls button#trend-apply:hover {
  background: #155f5b;
  box-shadow: 0 2px 8px rgba(29, 125, 120, 0.35);
}

/* Smooth expand/collapse using grid-template-rows trick */
.section-body-wrap {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease;
  opacity: 1;
}
.section.collapsed .section-body-wrap {
  grid-template-rows: 0fr;
  opacity: 0;
}
.section-body-wrap > .section-body {
  overflow: hidden;
  min-height: 0;
}
.section-body {
  padding: 20px 24px;
  transform: translateY(0);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.section.collapsed .section-body {
  transform: translateY(-8px);
}

/* ===== KPI CARDS (top of report) ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}
.kpi-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  position: relative;
}
.kpi-card .label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}
.kpi-card .value {
  font-size: 32px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.kpi-card .trend {
  margin-top: 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi-card .trend .arrow {
  display: inline-flex;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.kpi-card .trend.up .arrow { background: var(--ok-bg); color: var(--ok-fg); }
.kpi-card .trend.down .arrow { background: var(--bad-bg); color: var(--bad-fg); }
.kpi-card .trend.flat .arrow { background: #f1f5f9; color: var(--muted); }
.kpi-card .vs-avg {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.kpi-card .source {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 11px;
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Mono", monospace;
}

/* ===== CHARTS ===== */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) { .charts-row { grid-template-columns: 1fr; } }
.chart-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: white;
  min-width: 0;  /* prevent grid blowout from long canvas content */
}
.chart-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}
.chart-card .sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}
.chart-card canvas {
  width: 100% !important;
  /* Responsive height: never taller than the chart is wide, capped */
  height: 320px !important;
  max-height: 360px;
  display: block;
}
@media (max-width: 1200px) {
  .chart-card canvas { height: 280px !important; }
}
@media (max-width: 900px) {
  .chart-card canvas { height: 260px !important; }
}

/* ===== TOOLTIPS (jargon glossary on hover) ===== */
.term {
  border-bottom: 1px dotted var(--teal);
  cursor: help;
  position: relative;
  color: var(--navy);
  font-weight: 600;
}
.term:hover { color: var(--teal); }

/* The tooltip box — uses CSS only, no JS positioning needed */
.term::after,
.term::before {
  position: fixed;
  /* Position is set inline by positionTooltip() via --tx/--ty on each hover */
  left: 0;
  top: 0;
  transform: translate(var(--tx, 0px), var(--ty, 0px));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 9999;
  white-space: normal;
}
.term::before {
  content: '';
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-top-color: var(--navy);
  margin-left: -6px; /* center the arrow on the term */
}
.term::after {
  content: attr(data-tip);
  background: var(--navy);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.5;
  width: max-content;
  max-width: 280px;
  text-align: left;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.18);
  margin-bottom: 8px; /* gap between tooltip and term */
}
.term:hover::after,
.term:hover::before {
  opacity: 1;
}


/* ===== TABLES ===== */
.tbl-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data th {
  background: #f8fafc;
  text-align: left;
  padding: 10px 12px;
  font-weight: 700;
  color: var(--navy);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
table.data td {
  padding: 9px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover { background: #fafbfc; }
table.data td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, "Cascadia Mono", monospace;
}
table.data td.url {
  font-size: 12.5px;
  word-break: break-all;
  max-width: 380px;
}
table.data td.url a {
  color: var(--blue);
  text-decoration: none;
}
table.data td.url a:hover { text-decoration: underline; }

/* ===== ISSUES LIST ===== */
.issues-list {
  display: grid;
  gap: 10px;
}
.issue-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 12px;
  align-items: center;
  background: white;
}
.issue-item .sev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.issue-item .sev.high { background: var(--bad-bg); color: var(--bad-fg); }
.issue-item .sev.med { background: var(--warn-bg); color: var(--warn-fg); }
.issue-item .sev.low { background: var(--info-bg); color: var(--info-fg); }
.issue-item .title { font-weight: 600; color: var(--ink); }
.issue-item .desc { font-size: 13px; color: var(--muted); margin-top: 2px; }
.issue-item .who {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}
.issue-item .who strong { color: var(--navy); }

/* ===== BAR LISTS (country/device/source) ===== */
.bar-list { display: grid; gap: 8px; }
.bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 70px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.bar-row .name { color: var(--ink); font-weight: 500; }
.bar-row .bar {
  height: 14px;
  background: var(--soft);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.bar-row .bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--teal2));
  border-radius: 999px;
}
.bar-row .val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, monospace;
  color: var(--muted);
}

/* ===== EVIDENCE GRID ===== */
.ev-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}
.ev-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: white;
  transition: border-color 0.15s;
}
.ev-card:hover { border-color: var(--teal); }
.ev-card .ev-id {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.ev-card .ev-title {
  font-weight: 700;
  margin: 4px 0 6px;
  color: var(--navy);
  font-size: 14px;
}
.ev-card .ev-rows {
  font-size: 12px;
  color: var(--muted);
}
.ev-card .ev-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  margin-top: 8px;
}
.ev-card .ev-status.ok { background: var(--ok-bg); color: var(--ok-fg); }
.ev-card .ev-status.warn { background: var(--warn-bg); color: var(--warn-fg); }
.ev-card .ev-status.bad { background: var(--bad-bg); color: var(--bad-fg); }

/* ===== GEO SCORE RING ===== */
.geo-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: center;
}
@media (max-width: 640px) { .geo-grid { grid-template-columns: 1fr; } }
.geo-ring {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  display: block;
}
.geo-info h3 {
  font-size: 16px;
  color: var(--navy);
  margin-bottom: 8px;
}
.geo-subscores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.geo-subscores .item {
  background: var(--soft);
  border-radius: 6px;
  padding: 8px 12px;
  border-left: 3px solid var(--teal);
}
.geo-subscores .item .lab {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
}
.geo-subscores .item .val {
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
  margin-top: 2px;
}
.geo-findings {
  margin-top: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: 6px;
  border-left: 3px solid var(--amber);
  font-size: 13px;
  color: var(--ink);
}
.geo-findings ul { margin-left: 18px; margin-top: 4px; }

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 30px 20px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
  background: white;
}
footer a { color: var(--teal); text-decoration: none; }

/* ===== HEALTH SCORE CARD ===== */
.health-score-wrap {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 10px;
  margin-bottom: 24px;
  padding: 22px 28px;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 28px;
  align-items: center;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.hs-circle {
  width: 124px;
  height: 124px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.hs-inner {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.hs-score {
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
}
.hs-inner .hs-label {
  font-size: 11px;
  font-weight: 700;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.hs-breakdown h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}
.hs-sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}
.hs-row {
  display: grid;
  grid-template-columns: 110px 1fr 36px;
  gap: 12px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
}
.hs-row .hs-label {
  color: var(--ink);
}
.hs-row .hs-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--navy);
}
.hs-bar {
  height: 8px;
  background: var(--soft);
  border-radius: 999px;
  overflow: hidden;
}
.hs-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (max-width: 720px) {
  .health-score-wrap {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 18px 20px;
  }
  .hs-circle { margin: 0 auto; }
  .hs-row { grid-template-columns: 90px 1fr 32px; gap: 8px; }
}


/* ===== PRINT ===== */

/* ============================================================
   SKELETON LOADER — left-to-right shimmer animation
   ============================================================ */
.skeleton-wrap {
  padding: 20px 0 80px;
  max-width: 1280px;
  margin: 0 auto;
}
.skeleton-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.skeleton-row.sk-cols-2 { grid-template-columns: 1fr 1fr; }
.skeleton-row.sk-cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.skeleton-row.sk-cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.skeleton-card {
  height: 120px;
  border-radius: 10px;
  background: #e5e7eb;
  position: relative;
  overflow: hidden;
}
.skeleton-card.sk-h-score { height: 156px; }
.skeleton-card.sk-tall { height: 240px; }
.skeleton-card.sk-small { height: 80px; }

/* The shimmer: a diagonal gradient that travels across the card left to right */
.skeleton-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 0%,
    transparent 30%,
    rgba(255, 255, 255, 0.85) 50%,
    transparent 70%,
    transparent 100%
  );
  animation: shimmer 1.4s infinite linear;
  background-size: 200% 100%;
  background-position: 100% 0;
}
@keyframes shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Slight delay so multiple cards shimmer in a wave */
.skeleton-row:nth-child(1) .skeleton-card::after { animation-delay: 0s; }
.skeleton-row:nth-child(2) .skeleton-card::after { animation-delay: 0.1s; }
.skeleton-row:nth-child(3) .skeleton-card::after { animation-delay: 0.2s; }
.skeleton-row:nth-child(4) .skeleton-card::after { animation-delay: 0.3s; }
.skeleton-row:nth-child(5) .skeleton-card::after { animation-delay: 0.4s; }
.skeleton-row:nth-child(6) .skeleton-card::after { animation-delay: 0.5s; }

/* When data is ready, fade the skeleton out gracefully */
.skeleton-wrap.is-fading {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}

@media (max-width: 720px) {
  .skeleton-row.sk-cols-2,
  .skeleton-row.sk-cols-3,
  .skeleton-row.sk-cols-4 {
    grid-template-columns: 1fr;
  }
}


/* ============================================================
   INNER SKELETON — applied to each section during initial load
   ============================================================ */
.inner-skeleton {
  padding: 16px 24px;
  border-top: 1px dashed #e5e7eb;
  margin-top: 8px;
}
.inner-skeleton.is-fading {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}
.skel-line {
  height: 12px;
  background: linear-gradient(90deg, #e5e7eb 0%, #f3f4f6 50%, #e5e7eb 100%);
  background-size: 200% 100%;
  border-radius: 4px;
  margin-bottom: 8px;
  animation: skelShimmer 1.4s ease-in-out infinite;
}
.skel-line.skel-h1 { width: 60%; height: 18px; margin-bottom: 12px; }
.skel-line.skel-h2 { width: 80%; }
.skel-line.skel-h3 { width: 50%; }
.skel-kpis {
  height: 64px;
  margin: 12px 0;
  background: linear-gradient(90deg, #e5e7eb 0%, #f3f4f6 50%, #e5e7eb 100%);
  background-size: 200% 100%;
  border-radius: 6px;
  animation: skelShimmer 1.4s ease-in-out infinite;
}

@keyframes skelShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media print {
  .skeleton-wrap { display: none !important; }
}

@media print {
  body { background: white; font-size: 11pt; }
  .site-header { background: white !important; color: black; border-bottom: 2px solid var(--navy); }
  .site-header button, .section-header .toggle { display: none; }
  .section { box-shadow: none; border: 1px solid var(--line); page-break-inside: avoid; margin-bottom: 12px; }
  .section.collapsed .section-body { display: block !important; }
  main { padding: 0; margin: 0; }
  .charts-row { grid-template-columns: 1fr 1fr; }
}

/* ===== EXPERT SECTIONS (10-20) ===== */

/* Placeholder box (used for sections needing manual BQ) */
.placeholder-box {
  background: #f8fafc;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  font-size: 13.5px;
}
.placeholder-box p { margin: 6px 0; }
.placeholder-box pre { margin: 8px 0; }

/* Content matrix (11) — 2x2 quadrant grid */
.qm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 720px) { .qm-grid { grid-template-columns: 1fr; } }
.qm-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}
.qm-card h4 { font-size: 14px; margin-bottom: 4px; }
.qm-card ul { color: var(--ink); }

/* Persona cards (15) */
.persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.persona-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}
.persona-card h4 {
  font-size: 14px;
  color: var(--navy);
  margin-bottom: 4px;
}
.persona-card .tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.persona-card .tag {
  background: var(--soft);
  color: var(--ink);
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

/* Marketing funnel (16) */
.funnel { display: grid; gap: 10px; }
.funnel-row {
  display: grid;
  grid-template-columns: 200px 1fr 90px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
@media (max-width: 640px) {
  .funnel-row { grid-template-columns: 1fr; gap: 4px; }
}
.funnel-bar {
  height: 18px;
  background: var(--soft);
  border-radius: 999px;
  overflow: hidden;
}
.funnel-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--blue));
  transition: width 0.4s ease;
}
.funnel-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, monospace;
  color: var(--navy);
  font-weight: 700;
}

/* GEO question cards (19) */
.geo-q-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.geo-q-card {
  background: white;
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: 8px;
  padding: 12px 14px;
}
.geo-q-card.pass { border-left-color: var(--ok-fg); }
.geo-q-card.warn { border-left-color: var(--warn-fg); }
.geo-q-card.fail { border-left-color: var(--bad-fg); }
.geo-q-card .geo-q-label {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.geo-q-card .geo-q-name {
  font-weight: 700;
  color: var(--navy);
  font-size: 14px;
  margin: 2px 0 6px;
}
.geo-q-card .geo-q-score {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
}
.geo-q-card .geo-q-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ============================================================
   MOBILE RESPONSIVE — single comprehensive breakpoint
   ============================================================ */
@media (max-width: 720px) {
  body {
    overflow-x: hidden;
  }

  /* Header */
  .site-header {
    padding: 18px 16px 14px;
  }
  .site-header h1 {
    font-size: 20px;
  }
  .site-header .breadcrumb {
    font-size: 12px;
  }
  .site-header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .site-header .actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .site-header .actions button {
    padding: 8px 12px;
    min-height: 36px;
    font-size: 12px;
  }
  .meta-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .meta-bar .pill {
    text-align: center;
  }
  .meta-bar .pill.date-picker {
    flex-direction: column;
    gap: 8px;
    padding: 12px;
  }
  .meta-bar .pill.date-picker > label {
    align-self: flex-start;
    font-size: 12px;
  }
  .meta-bar .pill.date-picker .date-trigger {
    width: 100%;
    justify-content: flex-start;
  }
  .meta-bar .pill.date-picker .date-btn {
    flex: 1;
    min-height: 36px;
    font-size: 14px;
  }
  .meta-bar .pill.date-picker button#btn-apply-range {
    width: 100%;
    min-height: 44px;
    font-size: 15px;
    padding: 10px 16px;
  }
  .meta-bar .pill.date-picker button#btn-reset-range {
    min-height: 44px;
    font-size: 16px;
  }

  /* Main padding */
  main {
    padding: 0 12px 60px;
  }

  /* Sections — make headers wrap better */
  .section {
    margin-bottom: 16px;
    border-radius: 8px;
  }
  .section-header {
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .section-header h2 {
    font-size: 16px;
    line-height: 1.4;
  }
  .section-header h2 .num {
    width: 22px;
    height: 22px;
    font-size: 12px;
    flex-shrink: 0;
  }
  .section-header .lead {
    font-size: 12.5px;
    line-height: 1.5;
  }
  .section-body {
    padding: 14px 16px;
  }

  /* KPI cards — stack to 1 column on phones */
  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .kpi-card {
    padding: 14px 16px;
  }
  .kpi-card .value {
    font-size: 28px;
  }

  /* Charts — single column, smaller height */
  .charts-row {
    grid-template-columns: 1fr;
  }
  .chart-card {
    padding: 12px 12px;
  }
  .chart-card h3 {
    font-size: 13px;
  }
  .chart-card canvas {
    height: 220px !important;
  }

  /* Tables — sticky first column + horizontal scroll */
  .tbl-wrap {
    margin: 0 -16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  table.data {
    font-size: 12.5px;
  }
  table.data th {
    font-size: 11px;
    padding: 8px 10px;
    white-space: normal;
  }
  table.data td {
    padding: 7px 10px;
  }
  table.data td.url {
    max-width: 200px;
  }

  /* Bar lists — name column smaller */
  .bar-row {
    grid-template-columns: 80px 1fr 60px;
    gap: 8px;
    font-size: 12px;
  }
  .bar-row .val {
    font-size: 11px;
  }

  /* Issue cards */
  .issue-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .issue-item .who {
    text-align: left;
  }

  /* Evidence grid */
  .ev-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .ev-card {
    padding: 12px 14px;
  }

  /* Mobile tap targets */
  .kpi-card,
  .issue-item,
  .ev-card,
  button {
    min-height: 44px;
  }

  /* Footer */
  footer {
    padding: 20px 12px;
    font-size: 11px;
  }

  /* Three.js canvas — reduce particle count for low-end mobile */
  /* (handled in JS, not CSS) */
}

@media (max-width: 480px) {
  .site-header h1 {
    font-size: 18px;
  }
  .kpi-card .value {
    font-size: 24px;
  }
  table.data td.num {
    font-size: 11px;
  }
}

/* ============================================================================
   MOBILE SIDE-NAV (hamburger menu) — mobile-only, hidden on desktop
   ============================================================================ */

/* Hamburger button — fixed top-left, hidden by default (only shows ≤720px) */
#hamburger-btn {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  width: 44px;
  height: 44px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: none;                /* hidden by default — shown only at ≤720px */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
#hamburger-btn .ham-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
/* Hamburger → X animation when menu is open */
#hamburger-btn.open .ham-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#hamburger-btn.open .ham-bar:nth-child(2) { opacity: 0; }
#hamburger-btn.open .ham-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Slide-out panel — hidden by default via [hidden] attribute, slides in from left */
#side-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 80vw;
  max-width: 320px;
  height: 100vh;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy2) 100%);
  color: white;
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.25);
  -webkit-overflow-scrolling: touch;
}
#side-nav:not([hidden]) {
  transform: translateX(0);
}

/* Backdrop overlay */
#side-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
#side-nav-overlay:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}

/* Side-nav inner layout */
.side-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.side-nav-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
#side-nav-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}
#side-nav-close:hover { background: rgba(255, 255, 255, 0.1); }
#side-nav-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
}
.side-nav-item {
  display: block;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1.4;
}
.side-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}
.side-nav-item.active {
  background: rgba(78, 224, 193, 0.15);
  color: #4ee0c1;
  border-left-color: #4ee0c1;
  font-weight: 600;
}
.side-nav-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  gap: 8px;
}
.side-nav-footer button {
  flex: 1;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.side-nav-footer button:hover { background: rgba(255, 255, 255, 0.18); }

/* Mobile-only: show hamburger button */
@media (max-width: 720px) {
  #hamburger-btn { display: flex; }
}

/* Defensive desktop-hide (in case anything above is overridden) */
@media (min-width: 721px) {
  #hamburger-btn { display: none !important; }
  #side-nav, #side-nav-overlay { display: none !important; }
}

/* Desktop: top taskbar (replaces right-side version). Sticks to viewport top,
   scrolls with the page. Site-header sits below in DOM order so no header offset
   needed — auto-hide slides the bar up on scroll-down past y=200.

   ponytail: pill ("squircle") buttons in a responsive grid. The list is
   laid out in columns (auto-fit 140px) so it doesn't horizontally scroll —
   instead it wraps to multiple rows when the viewport is narrow. Each item
   is a rounded pill. Active section gets a teal background. */
@media (min-width: 721px) {
  #side-nav {
    position: sticky;
    top: 0;
    right: auto;
    left: 0;
    width: 100%;
    max-width: none;
    /* Auto height — grid wraps, not a fixed 44px bar */
    height: auto;
    max-height: none;
    padding: 10px 16px;
    background: var(--navy);
    color: white;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
    transform: translateY(0);
    transition: transform 0.25s ease;
    display: block !important; /* beats the [hidden] UA rule + defensive desktop-hide above */
    z-index: 100;
  }
  #side-nav.is-hidden { transform: translateY(-100%); }
  .side-nav-header, .side-nav-footer, #side-nav-overlay { display: none !important; }
  /* Items size to content (flex-wrap) instead of a 140px-min grid that
     stretched pills wider than the labels needed and clipped longer
     Chinese titles with "...". flex: 0 0 auto keeps items from shrinking. */
  #side-nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
  }
  .side-nav-item {
    padding: 6px 12px;
    border-radius: 999px; /* squircle */
    background: rgba(255, 255, 255, 0.08);
    text-align: center;
    white-space: nowrap;
    flex: 0 0 auto;
    font-size: 13px;
  }
  .side-nav-item:hover {
    background: rgba(255, 255, 255, 0.2);
  }
  .side-nav-item.active {
    background: var(--teal);
    color: var(--navy);
    font-weight: 600;
  }
}

/* Print: never show the hamburger */
@media print {
  #hamburger-btn, #side-nav, #side-nav-overlay { display: none !important; }
}

/* Mobile (≤720px): stack header + meta-bar so pills stop colliding and the
   hamburger menu doesn't overlap the title. Keeps the desktop layout intact. */
@media (max-width: 720px) {
  .site-header { padding: 20px 16px 14px; }
  .site-header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .site-header h1 { font-size: 20px; margin-bottom: 4px; }
  .site-header .actions { flex-wrap: wrap; }
  .site-header button { padding: 6px 10px; font-size: 12px; }
  .meta-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .meta-bar .pill,
  .meta-bar .pill.date-picker { width: 100%; box-sizing: border-box; }
  .meta-bar .pill.date-picker select { flex: 1; min-width: 0; }
}

/* ============================================================
   MOBILE BENTO (≤720px) — varied tile weights so the page scans
   top-down: featured health tile → 2x2 KPI tiles → regular sections.
   Must stay LAST: four earlier ≤720px blocks set the same
   properties at equal specificity, so source order decides.
   Spacing/sizing only — no colors, no HTML, no desktop rules.
   ============================================================ */
@media (max-width: 720px) {
  /* #hamburger-btn is position:fixed at (12,12)–(56,56) and was painting
     over the breadcrumb and h1. Reserve its gutter on the title block only,
     so .actions and .meta-bar keep the full width. */
  .site-header-inner > div:first-child { padding-left: 56px; min-height: 44px; }

  /* Banner pills: even rhythm, thumb-sized targets */
  .meta-bar { gap: 10px; }
  .meta-bar .pill { padding: 9px 14px; font-size: 13.5px; }

  /* Featured tile — the health score is the first thing worth reading */
  .health-score-wrap { padding: 22px 18px; gap: 18px; }
  .hs-circle { width: 148px; height: 148px; }
  .hs-inner { width: 114px; height: 114px; }
  .hs-score { font-size: 50px; }
  .hs-breakdown { text-align: left; }   /* wrapper centres; rows scan better left */
  .hs-sub { margin-bottom: 16px; }
  .hs-row { grid-template-columns: 74px 1fr 30px; gap: 10px; margin-bottom: 9px; }
  .hs-bar { height: 10px; }

  /* KPI tiles: 2x2 instead of four full-width stacks */
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-card { padding: 12px 13px; min-width: 0; overflow-wrap: break-word; }
  .kpi-card .value { font-size: 23px; }
  .kpi-card .trend { flex-wrap: wrap; gap: 4px; }
  .kpi-card .source { margin-top: 8px; padding-top: 8px; font-size: 10px; }

  /* Banner pills: the date-range/vs/updatedAt/version pills hug their
     content (not full-width), the period string shrinks so a 50-char
     "2026/08/27 – 2026/08/27 ← vs → 2026/08/26 – 2026/08/26" fits on
     one line at 360px, and the date-picker stays full-width as a card
     with Apply as a compact inline pill (not a full-width strip). */
  .meta-bar .pill {
    align-self: flex-start;
    width: auto;
    max-width: 100%;
    text-align: left;
    white-space: nowrap;
  }
  #report-period { font-size: 12px; letter-spacing: -0.2px; }
  .meta-bar .pill.date-picker {
    flex-direction: row;          /* was: column — label/select/apply now sit side-by-side */
    align-items: center;
    align-self: stretch;
    width: 100%;
    padding: 4px 6px;             /* was: 12px — slimmer capsule pill */
    gap: 6px;
    white-space: normal;
    border-radius: 10px;          /* was: 999px — capsule radius looks wrong on a tall card */
  }
  .meta-bar .pill.date-picker > label {
    display: none;                /* "區間" was eating vertical space; rely on aria-label on select */
  }
  .meta-bar .pill.date-picker select {
    flex: 1;
    font-size: 13px;
    padding: 4px 6px;
  }
  .meta-bar .pill.date-picker button#btn-apply-range {
    width: auto;
    min-height: 32px;
    font-size: 13px;
    padding: 6px 14px;
    align-self: center;
  }
}
