/* Weekly brief (strategy.html), on top of styles.css: header badges, bottom line and scorecard lights, section layout,
   coverage dots, the scenario inputs, the narrow layout and the print layout (controls hidden, charts kept). */

.brief-shell {
  max-width: 1280px;
  padding: 24px 16px;
}

.brief-header {
  flex-wrap: wrap;
  align-items: flex-start;
}

.brief-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.brief-period {
  display: grid;
  gap: 6px;
}

.brief-period .segmented button {
  height: 32px;
}

.brief-print {
  height: 34px;
}

.brief-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.brief-badge {
  padding: 3px 9px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: rgba(2, 6, 23, 0.46);
  color: var(--muted);
  white-space: nowrap;
}

.brief-badge.brief-good { color: var(--green); border-color: rgba(22, 199, 132, 0.4); }
.brief-badge.brief-fair { color: var(--amber); border-color: rgba(250, 204, 21, 0.4); }
.brief-badge.brief-poor { color: var(--red); border-color: rgba(234, 57, 67, 0.4); }

/* "Data to …" turns amber when the newest closed day is more than 24 h old */
#dataTo.brief-stale {
  color: var(--amber);
  border-color: rgba(250, 204, 21, 0.5);
}

.brief-fixed-note {
  margin: 0 0 16px;
  padding: 0 4px;
  font-size: 12px;
}

.brief-section {
  padding: 18px;
  margin-bottom: 16px;
}

.brief-section h2 {
  font-size: 1.15rem;
  margin-bottom: 12px;
}

.brief-section h3 {
  margin: 18px 0 8px;
  font-size: 0.95rem;
  font-weight: 500;
}

.brief-section > p {
  margin-top: 8px;
}

.brief-section .kpi-strip {
  margin-bottom: 12px;
}

.brief-loading,
.brief-missing {
  color: var(--amber);
  font-size: 13px;
}

/* --- Bottom line --------------------------------------------------------------------------------------------------- */

.brief-sentences {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 8px;
  font-size: 16px;
  line-height: 1.45;
}

.brief-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}

.brief-scorecard {
  display: grid;
  gap: 10px;
}

.brief-score {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: var(--radius);
}

.brief-score-name {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.brief-score strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  margin-right: 8px;
}

.brief-score small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.brief-arrow {
  font-size: 12px;
  color: var(--text);
}

/* Lights carry their state in aria-label as well; grey = threshold still a placeholder */
.brief-light {
  width: 14px;
  height: 14px;
  margin-top: 3px;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.5);
  background: transparent;
}

.brief-light-green { background: var(--green); border-color: var(--green); }
.brief-light-amber { background: var(--amber); border-color: var(--amber); }
.brief-light-red { background: var(--red); border-color: var(--red); }

.brief-score-notes p {
  margin-top: 6px;
  font-size: 13px;
}

.brief-lines {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.brief-lines .kpi-note {
  list-style: none;
  margin-left: -18px;
}

/* A strategic number that opens the desk on its section */
.desk-link {
  color: inherit;
  text-decoration: underline dotted rgba(111, 134, 255, 0.7);
  text-underline-offset: 3px;
}

.desk-link:hover,
.desk-link:focus-visible {
  color: var(--accent-light);
}

/* --- Sections -------------------------------------------------------------------------------------------------------- */

.kpi-tile.brief-active {
  border-color: var(--accent-light);
}

.brief-chart {
  position: relative;
  height: 320px;
}

.brief-chart-small {
  height: 240px;
}

.brief-chart-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.brief-footnote {
  color: #64748b;
}

.brief-venues td small {
  color: var(--muted);
}

.brief-venues .brief-flag {
  white-space: normal;
  text-align: left;
  min-width: 220px;
  color: var(--amber);
  font-size: 11px;
}

.brief-excluded td {
  color: var(--muted);
}

.brief-partial {
  color: var(--amber);
}

.brief-econ-grid,
.brief-confidence-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}

.brief-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.brief-inputs input {
  width: 100%;
  height: 34px;
}

.brief-inputs button {
  height: 34px;
}

.brief-scenario-table {
  margin-bottom: 8px;
}

.brief-scenario-table td:first-child {
  white-space: normal;
}

.brief-total td {
  font-weight: 600;
  color: var(--text);
}

.brief-dots {
  display: inline-flex;
  gap: 3px;
  vertical-align: middle;
  margin-right: 6px;
}

.brief-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #334155;
}

.brief-dot.brief-good { background: var(--green); }
.brief-dot.brief-fair { background: var(--amber); }
.brief-dot.brief-poor { background: var(--red); }

.brief-definitions {
  margin: 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 12px;
  font-size: 12px;
}

.brief-definitions dt {
  color: var(--text);
}

.brief-definitions dd {
  margin: 0;
  color: var(--muted);
}

/* --- Narrow layout --------------------------------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .brief-bottom-grid,
  .brief-chart-row,
  .brief-econ-grid,
  .brief-confidence-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .brief-shell {
    padding: 16px 8px;
  }

  .brief-header {
    flex-direction: column;
  }

  .brief-section {
    padding: 14px;
  }

  .brief-sentences {
    font-size: 15px;
  }

  .brief-chart {
    height: 260px;
  }

  .brief-definitions {
    grid-template-columns: minmax(0, 1fr);
  }

  .brief-definitions dd {
    margin-bottom: 6px;
  }
}

/* --- Print (Print button or #print=1): light paper, controls hidden, charts and the confidence footer kept --------- */

@media print {
  :root {
    color-scheme: light;
    --bg: #ffffff;
    --panel: #ffffff;
    --panel-border: #d1d5db;
    --text: #111827;
    --muted: #4b5563;
    --amber: #a16207;
  }

  body.brief {
    border-top: none;
    background: #ffffff;
    color: #111827;
  }

  .brief-shell {
    max-width: none;
    padding: 0;
  }

  .view-switch,
  .brief-period .segmented,
  .brief-print,
  #scenarioReset {
    display: none !important;
  }

  .brief-section,
  .brief-header {
    break-inside: avoid;
    box-shadow: none;
  }

  .brief-chart {
    break-inside: avoid;
    height: 260px;
  }

  .kpi-tile,
  .brief-score,
  .brief-badge {
    background: #ffffff;
    border-color: #d1d5db;
  }

  .brief-inputs input {
    border: none;
    background: transparent;
    color: #111827;
    padding: 0;
  }

  .sim-table th,
  .sim-table td {
    border-bottom-color: #e5e7eb;
  }

  .desk-link {
    text-decoration: none;
  }

  /* Lights, coverage dots and badges carry meaning in their colour: printed even without "background graphics" */
  .brief-light,
  .brief-dot,
  .brief-badge {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Scorecard trends: growth or decline over the selected period */
.brief-trend {
  display: block;
  font-size: 13px;
  margin-top: 2px;
}

.brief-trend-green { color: var(--green); }
.brief-trend-red { color: var(--red); }
.brief-trend-grey { color: var(--muted); }
