/* app.css - Branded Realities analytics report styles */

body {
  font-family: 'Inter', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  background: #f4f5f7;
  padding-top: 28px;
}

/* ---- cards: frosted glass with corner ticks ---- */
:root { --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }
.metric-card {
  position: relative;
  background: rgba(255, 255, 255, 0.62);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid color-mix(in srgb, var(--accent, #333333) 16%, transparent);
  border-radius: 10px;
  padding: 20px 22px;
  margin-bottom: 20px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset,
              0 10px 24px color-mix(in srgb, var(--accent, #333333) 9%, transparent);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.metric-card::before, .metric-card::after {
  content: ""; position: absolute; width: 10px; height: 10px; pointer-events: none;
  border: 1.5px solid var(--accent, #333333); opacity: 0.55;
}
.metric-card::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.metric-card::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset,
              0 16px 32px color-mix(in srgb, var(--accent, #333333) 16%, transparent);
}
@media (prefers-reduced-motion: reduce) {
  .metric-card, .metric-card:hover { transition: none; transform: none; }
}

/* ---- date range + actions ---- */
.date-range-inline { display: flex; align-items: center; gap: 8px; }
.date-range-inline .form-group { margin-bottom: 0; }
.date-range-inline .input-daterange { width: 260px; }
.date-range-inline .input-daterange input {
  font-size: 13px; height: 34px; padding: 4px 8px; text-align: center;
}
.date-range-inline .input-daterange .input-group-addon {
  font-size: 12px; padding: 4px 8px;
}
.date-range-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.date-range-actions .btn {
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 18px;
  border: none;
}
.date-range-actions .btn-apply {
  background: var(--accent, #333333);
  color: #ffffff;
}
.date-range-actions .btn-apply:hover { filter: brightness(1.15); }
.date-range-actions .btn-reset {
  background: #eceef1;
  color: #55595f;
}
.date-range-actions .btn-reset:hover { background: #dfe2e6; }

/* ---- metrics ---- */
.html-card {
  background: transparent;
  box-shadow: none;
  border: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
}
.html-card::before, .html-card::after { display: none; }
.html-card:hover { transform: none; box-shadow: none; }
.tile-empty { color: #8a8f98; font-size: 14px; margin: 8px 0; }
.chart-title {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #2b3a4f;
}
.chart-sub {
  margin: -6px 0 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: #6b7a8d;
}
.section-title {
  margin: 22px 4px 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8f98;
}
.metric-label {
  margin: 0 0 12px 0;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4b5a6e;
}
/* numbered like instrument readouts: 01, 02, ... counted per tab */
.tab-pane { counter-reset: readout; }
.scorecard-card .metric-label::before {
  counter-increment: readout;
  content: counter(readout, decimal-leading-zero);
  margin-right: 9px;
  font-weight: 700;
  color: var(--accent, #333333);
}
.metric-value {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 0;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 38px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--accent, #222222);
}
/* Summary and By Experience: the numbers are black; rings, sparklines and
   charts keep the page colour. (Team pages keep coloured numbers.) */
.numbers-dark .metric-value { color: #111111; }
/* The same two pages use a pale accent (blue), which washes the page behind
   the cards bright. So the cards stand out: solid white with a clear edge and
   a soft shadow, on a page that is a little deeper and cooler than white. */
.team-page.numbers-dark {
  background-color: color-mix(in srgb, var(--accent, #888888) 16%, #e8ecf1);
}
.numbers-dark .metric-card {
  background: #ffffff;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 1px solid color-mix(in srgb, var(--accent, #333333) 34%, #cfd5dd);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.06),
              0 8px 20px color-mix(in srgb, var(--accent, #333333) 16%, transparent);
}
.numbers-dark .metric-card:hover {
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.08),
              0 14px 28px color-mix(in srgb, var(--accent, #333333) 24%, transparent);
}
.metric-unique {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
  color: #8a97a8;
  white-space: nowrap;
}
.metric-unique b { font-weight: 700; color: #5b6b80; }


/* ---- page-load animation: cards rise in, one after another, as a tab opens ---- */
@keyframes br-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.tab-pane.active .metric-card { animation: br-rise 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.tab-pane.active [class*="col-sm-"]:nth-child(2) .metric-card { animation-delay: 60ms; }
.tab-pane.active [class*="col-sm-"]:nth-child(3) .metric-card { animation-delay: 120ms; }
.tab-pane.active [class*="col-sm-"]:nth-child(4) .metric-card { animation-delay: 180ms; }
.tab-pane.active [class*="col-sm-"]:nth-child(n+5) .metric-card { animation-delay: 240ms; }
#br-export .metric-card { animation: none; }
/* The printed copy is shown fresh, so a "grows in" animation would be caught at its
   first frame (a bar with no height). Nothing in the copy animates: every bar, dot
   and card prints in the state it ends in. */
#br-export *, #br-export *::before, #br-export *::after {
  animation: none !important;
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) { .tab-pane.active .metric-card { animation: none; } }

/* ---- page tint ---- */
.team-page {
  padding: 22px;
  border-radius: 14px;
  background-color: color-mix(in srgb, var(--accent, #888888) 7%, white);
  background-image:
    radial-gradient(520px 320px at 10% 0%, color-mix(in srgb, var(--accent, #888888) 16%, transparent), transparent),
    radial-gradient(460px 300px at 96% 100%, color-mix(in srgb, var(--accent, #888888) 11%, transparent), transparent),
    linear-gradient(color-mix(in srgb, var(--accent, #888888) 7%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--accent, #888888) 7%, transparent) 1px, transparent 1px);
  background-size: auto, auto, 24px 24px, 24px 24px;
}

/* ---- tab bar (pill style) ---- */
.nav-tabs {
  border-bottom: none;
  display: flex;
  gap: 6px;
  padding-bottom: 10px;
}
.nav-tabs::before, .nav-tabs::after { display: none; }   /* Bootstrap clearfix would add gaps in a flex row */
.nav-tabs > li { float: none; margin: 0; }
.nav-tabs > li > a {
  font-weight: 600;
  color: #6b7280;
  border: none !important;
  background: transparent !important;
  border-radius: 999px !important;
  padding: 8px 20px;
  transition: background 0.15s, color 0.15s;
}
.nav-tabs > li > a:hover { background: rgba(0, 0, 0, 0.05) !important; }
.nav-tabs > li.active > a {
  background: #111827 !important;
  color: #ffffff !important;
}
.tabbable { position: relative; }

/* ---- hero header ---- */
.hero-header {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 28px 32px;
  border-radius: 20px;
  margin-bottom: 24px;
  box-shadow: 0 14px 34px rgba(15, 15, 15, 0.16), 0 2px 8px rgba(15, 15, 15, 0.08);
  position: relative;
}
.logo-chip {
  background: #ffffff;
  border-radius: 16px;
  padding: 10px 16px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(15, 15, 15, 0.18);
}
.logo-monogram {
  font-weight: 800;
  font-size: 26px;
  letter-spacing: 0.02em;
}
.hero-title {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 32px;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
.hero-corner {
  position: absolute; top: 14px; right: 18px;
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 6px; border-radius: 10px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.9); font-size: 12px; font-weight: 600;
}

/* ---- refresh control ---- */
.page-refresh {
  display: flex; align-items: center; gap: 12px;
  padding-left: 18px; border-left: 1px solid rgba(0,0,0,0.12);
}
.page-refresh .btn {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.15);
  color: #333333;
  border-radius: 8px; padding: 6px 16px;
  font-size: 13px; font-weight: 600;
}
.page-refresh .btn:hover { background: #eceef1; color: #333333; }
.hero-updated {
  font-size: 12px; color: #55595f; text-align: right;
  line-height: 1.35;
}
.hero-updated .hero-updated-label {
  display: block; font-size: 11px; color: #8a8f98;
}

/* ---- save-as-PDF button: icon that turns into a spinner while working ---- */
.page-refresh .btn-pdf { margin-left: 4px; min-width: 38px; }
.btn-pdf .pdf-spinner {
  display: none; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #d5d9df; border-top-color: #6b7280;
  animation: br-spin 0.8s linear infinite; vertical-align: middle;
}
.btn-pdf.is-loading .fa, .btn-pdf.is-loading svg { display: none; }
.btn-pdf.is-loading .pdf-spinner { display: inline-block; }

/* ---- loading overlay ---- */
#loadingOverlay {
  display: none;
  position: fixed; inset: 0; z-index: 9999;
  align-items: center; justify-content: center;
  background: rgba(247, 248, 250, 0.92);
}
html.shiny-busy #loadingOverlay {
  display: flex;
  animation: br-fade-in 0.2s ease 0.4s both;
}
@keyframes br-fade-in { from { opacity: 0; } to { opacity: 1; } }
.loading-box { text-align: center; }
.loading-spinner {
  width: 34px; height: 34px; margin: 0 auto 14px;
  border: 3px solid #e3e6ea; border-top-color: #9aa0a6;
  border-radius: 50%;
  animation: br-spin 0.8s linear infinite;
}
@keyframes br-spin { to { transform: rotate(360deg); } }
.loading-text {
  font-size: 14px; font-weight: 600; color: #6b7178;
  letter-spacing: 0.01em;
}
.loading-note { font-size: 12px; color: #9aa0a6; margin-top: 4px; }

/* Initial load: app_head() puts br-loading on <html> from first paint and
   app.js removes it once the first report is ready. It shows the overlay at
   once (no fade-in delay) with a percentage and progress line in place of the
   spinner. Later loads get the same look through html.br-progress. */
html.br-loading #loadingOverlay { display: flex; animation: none; }
/* Later loads (app.js "Later loading screens") hold the overlay up, without
   restarting its fade, while the line runs to 100%. */
html.br-finishing #loadingOverlay { display: flex; animation: none; }
html.br-loading .loading-spinner,
html.br-progress .loading-spinner { display: none; }
.loading-percent, .loading-bar { display: none; }
html.br-loading .loading-percent,
html.br-progress .loading-percent {
  display: block; margin: 4px 0 0;
  font-size: 30px; font-weight: 700; color: #4b5057;
  font-variant-numeric: tabular-nums;   /* digits keep their width so the number doesn't jitter */
}
html.br-loading .loading-bar,
html.br-progress .loading-bar {
  display: block; width: 240px; height: 4px; margin: 10px auto 12px;
  border-radius: 2px; background: #e3e6ea; overflow: hidden;
}
.loading-bar span {
  display: block; height: 100%; width: 0;
  background: #9aa0a6; transition: width 0.15s linear;
}

/* ---- empty states ---- */
.rpt-empty {
  border: 2px dashed #d5d9df;
  border-radius: 14px;
  padding: 72px 24px;
  text-align: center;
  color: #6b7280;
  background: #ffffff;
}
.rpt-empty h2 { font-size: 19px; font-weight: 700; color: #374151; margin: 0 0 6px; }
.rpt-empty p  { font-size: 14px; margin: 0; }
.rpt-detail   { font-size: 12px; color: #9aa0a6; margin-top: 8px; }

/* ---- kiosk activity list (By Experience) ---- */
.ka-list { max-height: 296px; overflow-y: auto; padding-right: 6px; margin-top: 6px; }
.ka-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px; border-bottom: 1px solid #f0f1f3;
}
.ka-row:last-child { border-bottom: 0; }
.ka-dot {
  flex: 0 0 12px; height: 12px; border-radius: 50%; background: var(--c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent);
  animation: ka-pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4) both;
  animation-delay: var(--delay);
}
.ka-main { flex: 1 1 auto; min-width: 0; }
.ka-line { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.ka-name { font-weight: 700; font-size: 13px; color: #1f2430; white-space: nowrap; }
.ka-lead {
  font-size: 11px; color: #8a8f98; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.ka-track { position: relative; height: 8px; border-radius: 4px; background: #eef0f3; overflow: hidden; }
.ka-started, .ka-done {
  position: absolute; top: 0; bottom: 0; left: 0; border-radius: 4px;
  animation: ts-grow 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: var(--delay);
}
.ka-started { width: var(--s); --w: var(--s); background: color-mix(in srgb, var(--c) 28%, #ffffff); }
.ka-done    { width: var(--d); --w: var(--d); background: var(--c); }
.ka-last { margin-top: 4px; font-size: 11px; color: #9aa0a6; }
.ka-nums { flex: 0 0 auto; min-width: 56px; text-align: right; font-variant-numeric: tabular-nums; }
.ka-started-n { font-weight: 800; font-size: 15px; color: #1f2430; line-height: 1.1; }
.ka-done-n { font-size: 11px; color: #6b7280; }
.ka-rate {
  flex: 0 0 auto; min-width: 46px; text-align: center; padding: 3px 8px;
  border-radius: 999px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.ka-rate-good { background: #e6f6ec; color: #0b7a3b; }
.ka-rate-ok   { background: #fff3d6; color: #8a5a00; }
.ka-rate-low  { background: #fde8e8; color: #b42318; }
.ka-rate-none { background: #f1f2f4; color: #6b7280; }
@keyframes ka-pop { from { transform: scale(0); } to { transform: scale(1); } }

/* ---- team distribution bars (Summary) ---- */
.tb-wrap {
  display: flex; align-items: flex-end; justify-content: center; gap: 28px;
  min-height: 258px; margin-top: 4px; padding: 0 12px;
}
.tb-col { flex: 1 1 0; max-width: 150px; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.tb-val { font-weight: 800; font-size: 18px; color: #1f2430; font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.tb-track { width: 100%; height: 175px; display: flex; align-items: flex-end; border-bottom: 1px solid #e5e7eb; }
.tb-bar {
  width: 100%; height: var(--h); background: var(--c); border-radius: 8px 8px 0 0;
  transform-origin: bottom; animation: tb-grow 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: var(--delay);
}
@keyframes tb-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.tb-logo { width: 36px; height: 36px; margin-top: 12px; object-fit: contain; }
.tb-logo-empty { visibility: hidden; }
.tb-name {
  margin-top: 6px; font-size: 15px; font-weight: 700; color: #1f2430; line-height: 1.2; text-align: center;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tb-pct { margin-top: 2px; font-size: 12px; color: #8a8f98; font-variant-numeric: tabular-nums; }

/* ---- compare days (Summary) ---- */
.compare-card { padding-bottom: 14px; }
.compare-sub { margin: -4px 0 12px; font-size: 12px; color: #8a8f98; }
.compare-controls {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 18px; margin-bottom: 10px;
}
.compare-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.compare-field > label {
  margin: 0; font-size: 11px; font-weight: 700; color: #8a8f98;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.compare-field .form-group, .compare-field .shiny-input-container { margin-bottom: 0; }
.compare-days { flex: 1 1 260px; max-width: 420px; }
.compare-windows { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 4px; }
.compare-win { padding: 8px 12px 4px; background: #f6f7f9; border-radius: 10px; }
.compare-win-day { font-size: 12px; font-weight: 600; color: #1f2430; margin-bottom: 4px; }
.compare-win-times { display: flex; gap: 8px; }
.compare-win .form-group { margin-bottom: 4px; }
.compare-win label { font-size: 10px; font-weight: 600; color: #6b7280; margin-bottom: 1px; text-transform: uppercase; letter-spacing: 0.04em; }
.compare-win input { height: 30px; padding: 4px 8px; font-size: 13px; text-align: center; }
.compare-note { margin: 4px 0 0; font-size: 11px; color: #9aa0a6; }
/* The Overlap toggle next to Stack days: grey until it is on, then the page colour. */
.compare-overlap {
  height: 34px; padding: 0 16px; border: 0; border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 600; background: #eceef1; color: #55595f;
}
.compare-overlap:hover { background: #dfe2e6; }
.compare-overlap.is-on { background: var(--accent, #333333); color: #ffffff; }
.compare-overlap.is-on:hover { filter: brightness(1.1); }

/* The controls mean nothing on paper: leave them out of a saved PDF. */
#br-export .compare-controls, #br-export .compare-sub { display: none; }

/* Respect a reduced-motion preference: show the final state, no animation. */
@media (prefers-reduced-motion: reduce) {
  .ts-fill, .ka-started, .ka-done, .ka-dot, .tb-bar { animation: none; }
}

/* ---- talent selection list (Summary) ---- */
.ts-list { max-height: 292px; overflow-y: auto; padding-right: 6px; margin-top: 6px; }
.ts-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 4px; border-bottom: 1px solid #f0f1f3;
}
.ts-row:last-child { border-bottom: 0; }
.ts-rank {
  flex: 0 0 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #f1f2f4; color: #6b7280; font-size: 12px; font-weight: 700;
}
.ts-rank-1 { background: #f6c945; color: #5a4300; }
.ts-rank-2 { background: #d5d9df; color: #3f4650; }
.ts-rank-3 { background: #e0a878; color: #5b3512; }
.ts-avatar {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%;
  object-fit: cover; object-position: top; background: #f1f2f4;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px var(--c);
}
.ts-monogram {
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: var(--c);
}
.ts-main { flex: 1 1 auto; min-width: 0; }
.ts-line { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.ts-name {
  font-weight: 600; font-size: 13px; color: #1f2430;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ts-group { font-size: 11px; color: #8a8f98; white-space: nowrap; }
.ts-track { height: 8px; border-radius: 4px; background: #eef0f3; overflow: hidden; }
.ts-fill {
  height: 100%; width: var(--w); border-radius: 4px;
  background: var(--c);
  background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 65%, #ffffff));
  animation: ts-grow 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: var(--delay);
}
.ts-count {
  flex: 0 0 auto; min-width: 44px; text-align: right;
  font-weight: 800; font-size: 15px; color: #1f2430;
  font-variant-numeric: tabular-nums;
}
@keyframes ts-grow { from { width: 0; } to { width: var(--w); } }

/* ---- top-players podium ---- */
.podium-floor {
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 340px;
}
.podium-row {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 0; flex-wrap: wrap;
}
.podium-col { display: flex; flex-direction: column; align-items: center; }
.podium-figure { width: 150px; margin: 0; padding: 0; line-height: 0; }
.podium-img { width: 150px; height: auto; display: block; margin: 0; padding: 0; }
.podium-monogram-box {
  width: 150px; height: 150px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 48px;
}
.podium-plate {
  width: 150px;
  display: flex; flex-direction: column; align-items: center;
  box-shadow: 0 10px 20px rgba(15, 15, 15, 0.18),
              inset 0 1px 0 rgba(255, 255, 255, 0.5),
              inset 0 -2px 0 rgba(0, 0, 0, 0.3);
  padding: 14px 10px 16px;
}
.podium-plate-top {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.podium-rank-num { font-weight: 800; font-size: 44px; line-height: 1; color: #ffffff; }
.podium-plate-name {
  color: #ffffff; font-weight: 700; font-size: 15px; text-align: center; line-height: 1.2;
}
.podium-selections-line {
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  margin-top: auto;
}

/* ---- experience / group toggle buttons ---- */
/* shinyWidgets::radioGroupButtons(status = "br", individual = TRUE) */
.br-toggle-group-wrapper {
  padding: 20px 26px 4px;
}
.br-toggle-group-wrapper .form-group { margin-bottom: 0; }
.br-toggle-group-wrapper .btn-group-container-sw {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}
.radio-group-buttons .btn-br {
  padding: 10px 26px;
  border-radius: 24px;
  border: 2px solid rgba(0,0,0,0.12);
  background: #ffffff;
  color: #6b7280;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(15,15,15,0.06);
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}
.radio-group-buttons .btn-br:hover,
.radio-group-buttons .btn-br:focus {
  border-color: var(--accent, #333333);
  color: var(--accent, #333333);
  box-shadow: 0 4px 12px rgba(15,15,15,0.10);
  outline: none;
}
.radio-group-buttons .btn-br.active,
.radio-group-buttons .btn-br.active:hover,
.radio-group-buttons .btn-br.active:focus {
  background: var(--accent, #333333);
  border-color: var(--accent, #333333);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(15,15,15,0.18);
}

/* ---- controls row (toggle buttons + date filter + refresh) ---- */
.br-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 4px 4px;
  margin-bottom: 8px;
}
.br-controls-subtitle {
  font-size: 15px;
  font-weight: 600;
  color: #6b7280;
  padding: 10px 0;
}
.br-controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---- info icon ---- */
.info-icon {
  display: inline-block;
  margin-left: 6px;
  color: #b0b4ba;
  cursor: help;
  font-size: 0.8em;
  vertical-align: middle;
}
.info-icon:hover {
  color: #8a8f98;
}

/* ---- responsive: laptops, tablets, phones ---- */
@media (max-width: 1200px) {
  .br-controls-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .br-toggle-group-wrapper { padding: 8px 0 0; }
  .br-toggle-group-wrapper .btn-group-container-sw { margin-bottom: 6px; }
  .br-controls-right { justify-content: flex-start; }
  .page-refresh { border-left: none; padding-left: 0; flex-wrap: wrap; }
}

@media (max-width: 767px) {
  body { padding-top: 12px; }
  .hero-header { flex-direction: column; text-align: center; padding: 48px 16px 20px; gap: 12px; }
  .hero-title { font-size: 24px; }
  .team-page { padding: 12px; }
  .metric-value { font-size: 32px; }
  .nav-tabs { flex-wrap: nowrap; overflow-x: auto; }
  .date-range-inline { flex-wrap: wrap; }
  .date-range-inline .input-daterange { width: 100%; max-width: 280px; }
  .podium-figure, .podium-img, .podium-plate, .podium-monogram-box { width: 100px; }
}

/* ---- save as PDF: dialog ---- */
.br-pdf-overlay {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(17, 24, 39, 0.45);
}
.br-pdf-card {
  background: #ffffff; border-radius: 16px; padding: 24px 26px;
  width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  box-shadow: 0 20px 50px rgba(15, 15, 15, 0.25);
}
.br-pdf-title { margin: 0 0 4px; font-size: 18px; font-weight: 800; color: #111827; }
.br-pdf-hint { margin: 0 0 14px; font-size: 13px; color: #6b7280; }
.br-pdf-dates {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px; font-size: 13px; color: #6b7280;
}
.br-pdf-dates-label { font-weight: 700; color: #111827; margin-right: 6px; }
.br-pdf-date {
  border: 1px solid transparent; border-radius: 10px; padding: 8px 12px;
  font-family: inherit; font-size: 13px; color: #111827;
  background: #eceef1;
  transition: background 0.15s, border-color 0.15s;
}
.br-pdf-date:hover { background: #e3e6ea; }
.br-pdf-date:focus { outline: none; background: #ffffff; border-color: #9aa0a6; }
.br-pdf-error { margin: -6px 0 10px; font-size: 12px; color: #b91c1c; }
.br-pdf-error:empty { display: none; }
.br-pdf-links { display: flex; gap: 14px; margin-bottom: 8px; }
.br-pdf-link {
  background: none; border: none; padding: 0;
  font-size: 12px; font-weight: 600; color: #6b7280; cursor: pointer;
}
.br-pdf-link:hover { color: #111827; text-decoration: underline; }
.br-pdf-list { overflow-y: auto; margin: 0 -6px 16px; padding: 0 6px; }
.br-pdf-row {
  display: flex; align-items: center; gap: 10px;
  margin: 0; padding: 9px 10px; border-radius: 10px;
  font-size: 14px; font-weight: 500; color: #374151; cursor: pointer;
}
.br-pdf-row:hover { background: #f4f5f7; }
.br-pdf-row input { margin: 0; width: 16px; height: 16px; accent-color: #111827; }
.br-pdf-actions { display: flex; justify-content: flex-end; gap: 10px; }
.br-pdf-btn {
  border: none; border-radius: 8px; padding: 9px 18px;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.br-pdf-cancel { background: #eceef1; color: #55595f; }
.br-pdf-cancel:hover { background: #dfe2e6; }
.br-pdf-go { background: #111827; color: #ffffff; }
.br-pdf-go:hover { filter: brightness(1.2); }
.br-pdf-go:disabled { opacity: 0.4; cursor: not-allowed; }
/* Same look as the report's loading screens: a percentage and a progress line. */
.br-pdf-percent {
  margin: 8px 0 0; text-align: center;
  font-size: 30px; font-weight: 700; color: #4b5057;
  font-variant-numeric: tabular-nums;
}
.br-pdf-bar {
  width: 240px; max-width: 100%; height: 4px; margin: 10px auto 12px;
  border-radius: 2px; background: #e3e6ea; overflow: hidden;
}
.br-pdf-bar span {
  display: block; height: 100%; width: 0;
  background: #9aa0a6; transition: width 0.3s ease;
}

/* ---- save as PDF: the printed copy ---- */
/* app.js builds #br-export (one .br-export-page per ticked section) just before printing */
#br-export { display: none; }

@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  html, body { background: #ffffff !important; padding-top: 0 !important; }

  /* print only the copy, not the live report */
  body.br-exporting > *:not(#br-export) { display: none !important; }
  body.br-exporting #br-export { display: block !important; }
  .br-export-page { break-after: page; }
  .br-export-page:last-child { break-after: auto; }

  .nav-tabs, .page-refresh .btn, .date-range-actions, #loadingOverlay { display: none !important; }

  /* soft shadows turn into grey boxes in PDFs, so drop them */
  * { box-shadow: none !important; text-shadow: none !important; }
  .metric-card { background: #ffffff; -webkit-backdrop-filter: none; backdrop-filter: none; border: 1px solid #d9dde4; }
  .team-page { background-image: none; }
  .html-card { border: none; }

  /* keep the desktop grid in the PDF whatever the window width */
  [class*="col-sm-"] { float: left; }
  .col-sm-1 { width: 8.3333%; }  .col-sm-2 { width: 16.6667%; }
  .col-sm-3 { width: 25%; }      .col-sm-4 { width: 33.3333%; }
  .col-sm-5 { width: 41.6667%; } .col-sm-6 { width: 50%; }
  .col-sm-7 { width: 58.3333%; } .col-sm-8 { width: 66.6667%; }
  .col-sm-9 { width: 75%; }      .col-sm-10 { width: 83.3333%; }
  .col-sm-11 { width: 91.6667%; } .col-sm-12 { width: 100%; }
}

/* Compare: mode tabs and metrics table */
.compare-mode { margin: 4px 0 10px; }
.compare-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13px; }
.compare-table th, .compare-table td { padding: 8px 10px; text-align: left; border-top: 1px solid rgba(0,0,0,0.06); }
.compare-table thead th { border-top: 0; font-weight: 600; color: #111827; }
.compare-table td:first-child { color: #6b7280; }
.compare-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }

/* ---- peak day card (By Talent) ---- */
.pk-hero { margin: 18px 0 20px; }
.pk-date { font-weight: 800; font-size: 34px; line-height: 1.1; color: #1f2430; letter-spacing: -0.01em; }
.pk-count { margin-top: 6px; font-size: 14px; color: #6b7280; font-variant-numeric: tabular-nums; }
.pk-next-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #8a8f98; margin-bottom: 8px; }
.pk-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid #eef0f3; font-size: 13px; }
.pk-row-date { flex: 0 0 92px; color: #374151; font-weight: 600; }
.pk-bar { flex: 1 1 auto; height: 8px; border-radius: 4px; background: #eef0f3; overflow: hidden; }
.pk-bar > span { display: block; height: 100%; border-radius: 4px; opacity: 0.85; }
.pk-row-n { flex: 0 0 auto; font-weight: 700; color: #1f2430; font-variant-numeric: tabular-nums; }

/* comparison chips */
.compare-chip { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; vertical-align: 1px; white-space: nowrap; }
.compare-chip-up   { background: #e6f6ec; color: #17803d; }
.compare-chip-down { background: #fde8e8; color: #b42318; }
.compare-chip-flat { background: #f1f2f4; color: #6b7280; }
.compare-table caption { caption-side: bottom; text-align: left; padding-top: 8px; }

/* ---- scorecard extras: ring, sparkline, caption, LIVE marker ---- */
.sc-body { position: relative; }
.sc-live {
  position: absolute; bottom: -14px; right: 0; display: flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; color: #17803d;
}
.sc-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #17803d; }
.sc-spark { display: block; width: 100%; height: 34px; margin: 14px 0 12px; overflow: visible; }
.scorecard-card { min-height: 168px; }
.sc-spark-line { fill: none; stroke: var(--accent, #333333); stroke-width: 1.6; stroke-linejoin: round; }
.sc-spark-area { fill: var(--accent, #333333); opacity: 0.08; }
.sc-ring-row { display: flex; align-items: center; gap: 14px; }
.sc-ring { flex: 0 0 64px; width: 64px; height: 64px; }
.sc-ring-track { fill: none; stroke: color-mix(in srgb, var(--accent, #333333) 14%, transparent); stroke-width: 5; stroke-dasharray: 2 3; }
.sc-ring-fill { fill: none; stroke: var(--accent, #333333); stroke-width: 5; }
.sc-caption { margin-top: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; color: #6b7a8d; }
.sc-ring-row .metric-value { font-size: 30px; }
