:root {
  color-scheme: light;
  --ink: #111111;
  --muted: #6b7280;
  --line: #e5e7eb;
  --panel: #ffffff;
  --bg: #ffffff;
  --primary: #78F735;
  --primary-hover: #78F735;
  --accent: #78F735;
  --accent-2: #78F735;
  --accent-3: #374151;
  --soft: #f3f4f6;
  --field: #ffffff;
  --panel-highlight: transparent;
  --shadow: 0 1px 3px rgba(17, 17, 17, 0.08);
  --dashboard-icon-button-size: 24px;
  --heading-font: "Horizon", "Arial Black", "Avenir Next", Arial, sans-serif;
}

.app-shell,
.app-shell * {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.app-shell .toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.app-shell h1,
.app-shell h2,
.app-shell p {
  margin: 0;
}

.brand-title {
  color: var(--ink);
  font-size: clamp(2.25rem, 5.2vw, 4.1rem);
  line-height: 1;
}

.brand-artwork:not([hidden]) {
  display: block;
  width: clamp(132px, 14vw, 180px);
  height: auto;
}

.header-controls {
  position: relative;
  display: grid;
  align-self: stretch;
  align-content: end;
  padding-top: 60px;
  gap: 8px;
  min-width: 0;
}

.report-controls-title {
  position: absolute;
  inset-inline-start: 0;
  /* Halfway from page top to the 42px controls, below 28px + 22px header padding. */
  top: calc(50% - 46px);
  transform: translateY(-50%);
  width: 100%;
  color: #000000;
  font-family: "Arial Narrow", "Arial Black", Impact, sans-serif;
  font-size: clamp(1.1rem, 1.75vw, 1.5rem);
  font-style: oblique 12deg;
  font-weight: 900;
  font-stretch: condensed;
  letter-spacing: -0.055em;
  line-height: 0.95;
  text-align: center;
  text-transform: uppercase;
}

.app-shell :is(h1, h2, h3, h4, .panel-heading strong) {
  font-family: var(--heading-font);
  font-weight: 900;
  letter-spacing: -0.025em;
}

.app-shell h2 {
  font-size: 1rem;
}

.app-shell .controls {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.is-hidden {
  display: none;
}

.app-shell .manager {
  display: grid;
  min-width: 0;
  gap: 14px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}

.app-shell .manager-actions {
  display: flex;
  align-items: end;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.app-shell .artist-management-actions {
  justify-content: center;
}

.app-shell .manager-actions:not(:has(> :not(.is-hidden, [hidden], .platform-connection-group), form:not([hidden], .is-hidden), [role="status"]:not(:empty))) {
  display: none;
}

.app-shell .platform-connection-actions {
  align-items: flex-start;
}

.app-shell .platform-connection-group {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.app-shell .platform-connection-group > [role="status"] {
  max-width: 100%;
  width: 0;
  min-width: 100%;
  overflow-wrap: anywhere;
}

.app-shell .platform-connection-group:not(:has(> form:not([hidden], .is-hidden), > [role="status"]:not(:empty))),
.app-shell .platform-connection-group > [role="status"]:empty {
  display: none;
}

.app-shell .inline-form {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.app-shell .account-control-pair {
  display: flex;
  align-items: end;
  gap: 8px;
  min-width: 0;
}

.app-shell .account-control-pair input {
  width: clamp(120px, 11vw, 150px);
  min-width: 0;
}

.app-shell .account-control-pair button {
  white-space: nowrap;
}

.app-shell .platform-profile-form input {
  width: clamp(150px, 15vw, 210px);
}

.app-shell #spotifySourceStatus {
  overflow-wrap: anywhere;
}

.app-shell .manager:has(#spotifySourceForm.is-hidden) #spotifySourceStatus,
.app-shell #spotifySourceStatus:empty {
  display: none;
}

.app-shell .widget-settings {
  position: relative;
}

.app-shell .widget-settings summary {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.app-shell .checkbox-grid {
  position: absolute;
  right: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 8px;
  width: min(420px, calc(100vw - 32px));
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.app-shell .admin-menu {
  position: absolute;
  right: 0;
  z-index: 2;
  display: grid;
  gap: 8px;
  width: min(420px, calc(100vw - 32px));
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.app-shell .admin-create-form {
  display: grid;
  gap: 8px;
}

.app-shell .admin-menu input,
.app-shell .admin-menu select,
.app-shell .admin-menu button,
.app-shell .admin-create-form input,
.app-shell .admin-create-form select,
.app-shell .admin-create-form button {
  width: 100%;
}

.app-shell .user-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.app-shell .user-row {
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.app-shell .user-row span,
.app-shell .user-row small {
  color: var(--muted);
}

.app-shell .reset-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.app-shell .status-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-shell .small-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-shell {
  width: min(420px, calc(100% - 32px));
}

.login-panel {
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-panel > h1 {
  font-size: 2.4rem;
}

.app-shell .checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.app-shell .checkbox-row input {
  width: auto;
  min-height: auto;
}

.app-shell label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.app-shell input,
.app-shell select,
.app-shell button,
.app-shell .button-link {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--ink);
  font: inherit;
}

.app-shell input,
.app-shell select {
  width: 170px;
  padding: 0 12px;
}

.app-shell input:focus,
.app-shell select:focus,
.app-shell button:focus-visible,
.app-shell .button-link:focus-visible,
.app-shell .widget-settings summary:focus-visible {
  outline: 3px solid #111111;
  outline-offset: 2px;
}

.app-shell select {
  color-scheme: light;
}

.app-shell button:not(.secondary),
.app-shell .button-link:not(.secondary) {
  padding: 0 16px;
  border-color: #111111;
  background: var(--primary);
  color: #111111;
  font-weight: 800;
  cursor: pointer;
}

.app-shell button:not(.secondary):hover,
.app-shell .button-link:not(.secondary):hover {
  background: var(--primary-hover);
  box-shadow: inset 0 0 0 2px #111111;
}

.app-shell button.secondary,
.app-shell .button-link.secondary {
  border-color: var(--line);
  background: #f3f4f6;
  color: var(--ink);
}

.app-shell button.secondary:hover,
.app-shell .button-link.secondary:hover {
  background: #e5e7eb;
}

.app-shell .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  font-weight: 800;
  text-decoration: none;
}

.app-shell #exportLink {
  font-weight: 400;
}

.app-shell button:disabled,
.app-shell .button-link.disabled {
  cursor: not-allowed;
  opacity: 0.45;
  pointer-events: none;
}

.app-shell .status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.status-pill.live {
  background: #e8f2ff;
  color: #1d4ed8;
}

.status-pill.report-refreshed {
  background: #78F735;
  color: #000000;
}

.status-pill.error {
  background: #fff0e8;
  color: #9a3412;
}

.muted {
  color: var(--muted);
  font-size: 0.88rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.roster-summary-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr);
  gap: 14px;
  min-width: 0;
  margin-top: 14px;
  align-items: start;
}

.app-shell .weekly-roster-brief {
  margin-bottom: 1rem;
  min-width: 0;
  overflow: hidden;
}

.app-shell .weekly-brief-content,
.app-shell .weekly-brief-header,
.app-shell .weekly-brief-section,
.app-shell .weekly-brief-list,
.app-shell .weekly-brief-item {
  min-width: 0;
}

.app-shell .weekly-brief-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.app-shell .weekly-brief-header h2,
.app-shell .weekly-brief-header p,
.app-shell .weekly-brief-item h4,
.app-shell .weekly-brief-item p {
  margin: 0;
}

.app-shell .weekly-brief-header p,
.app-shell .weekly-brief-item p,
.app-shell .weekly-brief-reasons {
  color: var(--muted);
}

.app-shell .weekly-brief-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.8rem 0;
  padding: 0;
  list-style: none;
}

.app-shell .weekly-brief-summary li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.82rem;
}

.app-shell .weekly-brief-freshness {
  margin: 0.75rem 0;
  color: var(--muted);
}

.app-shell .weekly-brief-section {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

.app-shell .weekly-brief-section h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.app-shell .weekly-brief-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 0.55rem;
}

.app-shell .weekly-brief-item {
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  padding: 0.65rem;
  overflow-wrap: anywhere;
}

.app-shell .weekly-brief-item[role="button"] {
  cursor: pointer;
}

.app-shell .weekly-brief-item[role="button"]:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.app-shell .weekly-brief-data {
  border-left: 3px solid var(--muted);
}

.app-shell .weekly-brief-performance {
  border-left: 3px solid var(--accent-2);
}

.app-shell .weekly-brief-reasons {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}

.roster-kpi-grid {
  grid-auto-rows: 1fr;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-self: start;
}

.roster-kpi-grid .metric {
  min-height: 174px;
  min-width: 0;
}

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  display: grid;
  gap: 8px;
  min-height: 142px;
  padding: 18px;
  position: relative;
  overflow: visible;
}

.metric span,
.panel-heading span,
th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.app-shell .metric-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
}

.app-shell .roster-kpi-grid .metric-label {
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.app-shell .roster-kpi-grid .kpi-label-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.app-shell button.info-tip {
  position: relative;
  cursor: help;
  appearance: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  display: inline-flex;
  width: var(--dashboard-icon-button-size);
  height: var(--dashboard-icon-button-size);
  min-width: 0;
  min-height: 0;
  padding: 0;
  flex: 0 0 var(--dashboard-icon-button-size);
  align-self: flex-start;
  border: 1px solid #000;
  border-radius: 50%;
  background: #78f735;
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  text-transform: none;
}

.app-shell button.info-tip:focus-visible {
  outline: 3px solid #000;
  outline-offset: 2px;
}

.app-shell .info-tip::after {
  position: absolute;
  bottom: calc(100% + 8px);
  left: auto;
  right: 0;
  z-index: 5;
  width: min(220px, 72vw);
  padding: 9px 10px;
  border-radius: 8px;
  background: #111827;
  border: 1px solid var(--line);
  color: #fff;
  content: attr(data-tip);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  text-transform: none;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.app-shell .info-tip:hover::after,
.app-shell .info-tip:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.app-shell #instagramCampaign {
  container: campaign / inline-size;
}

.app-shell #instagramCampaign > p {
  position: relative;
}

.app-shell #instagramCampaign .info-tip::after {
  box-sizing: border-box;
  top: 50%;
  bottom: auto;
  left: calc(100% + 8px);
  right: auto;
  width: 220px;
  white-space: normal;
  overflow-wrap: anywhere;
  transition: opacity 140ms ease;
  transform: translateY(-50%);
}

@container campaign (max-width: 26rem) {
  .app-shell #instagramCampaign .info-tip {
    position: static;
  }

  .app-shell #instagramCampaign .info-tip::after {
    top: calc(100% + 8px);
    left: 0;
    width: min(220px, 100%);
    transform: none;
  }
}

.metric strong {
  font-size: 2rem;
  line-height: 1;
  color: var(--ink);
}

.metric small {
  color: var(--muted);
  font-size: 0.9rem;
}

.metric .kpi-comparison {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.metric .kpi-comparison[data-state="unavailable"] {
  color: var(--muted);
  font-weight: 700;
}

.report-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 14px;
  margin-top: 14px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel.wide {
  grid-column: span 1;
}

.panel[data-widget="trend"] {
  grid-column: 1 / -1;
}

.panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

canvas {
  width: 100%;
  height: 320px;
  display: block;
}

.bar-list {
  display: grid;
  gap: 15px;
}

.content-mix-helper {
  margin: -8px 0 16px;
  font-size: 0.82rem;
}

.bar-row {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.bar-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 800;
}

.content-mix-format {
  color: var(--accent-3);
}

.content-mix-metrics {
  min-width: 0;
  color: var(--muted);
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.segments {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.demographic-group h3 {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.segment {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--accent-3);
}

.audience-meta {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  color: var(--muted);
  line-height: 1.45;
}

.audience-meta strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.content-ath {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.content-ath > strong {
  color: var(--ink);
}

.ath-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ath-stat {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}

.ath-stat span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ath-stat strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
}

.ath-change {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.ath-change.positive {
  color: var(--ink);
}

.ath-change.negative {
  color: #fb923c;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

td {
  color: #374151;
}

td:first-child {
  color: var(--ink);
  font-weight: 800;
}

tbody tr:hover {
  background: #f3f4f6;
}

.recommendations {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  line-height: 1.45;
  color: #1f2937;
}

.app-shell .invitation-delivery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.app-shell .invitation-delivery:empty {
  display: none;
}

.invitation-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: #ffffff;
  color: #111111;
}

.invitation-shell {
  width: min(100%, 34rem);
  padding: clamp(1.5rem, 5vw, 3rem);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.invitation-status {
  color: var(--muted);
}

.invitation-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1rem;
}

.chart-wrap {
  position: relative;
}

.chart-tooltip {
  position: absolute;
  z-index: 2;
  max-width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.76rem;
  line-height: 1.35;
  pointer-events: none;
}

.recommendation-card {
  display: grid;
  gap: 7px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  background: #fafafa;
}

.recommendation-card p,
.recommendation-card small {
  color: var(--muted);
}

.recommendation-label {
  display: block;
  margin-bottom: 3px;
  color: var(--accent-3);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.recommendation-reason {
  font-size: 0.82rem;
}

.recommendation-card small {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
}

.trend-details {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.metric-toggle {
  display: inline-flex;
  gap: 4px;
  margin: 4px 0 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f3f4f6;
}

.historical-trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
}

.historical-trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.historical-trend-legend span::before {
  width: 16px;
  height: 3px;
  border-radius: 999px;
  background: var(--history-series-color);
  content: "";
}

.historical-trend-legend [data-history-series="followers"] {
  --history-series-color: #757575;
}

.historical-trend-legend [data-history-series="reach"] {
  --history-series-color: #78F735;
}

.historical-trend-legend [data-history-series="engagements"] {
  --history-series-color: #000000;
}

.historical-chart-wrap canvas {
  height: 300px;
}

.historical-event-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  max-width: 100%;
  overflow: hidden;
  pointer-events: none;
}

.historical-event-marker-list {
  position: relative;
  width: 100%;
  height: 100%;
}

.historical-event-marker {
  position: absolute;
  top: 18px;
  max-width: min(280px, 72vw);
  pointer-events: auto;
  transform: translateX(-50%);
}

.historical-event-marker summary {
  width: max-content;
  max-width: 180px;
  padding: 4px 8px;
  border: 1px solid #78F735;
  border-radius: 999px;
  background: #78F735;
  color: #000000;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
  list-style: none;
}

.historical-event-details {
  display: grid;
  gap: 8px;
  width: min(280px, 72vw);
  max-height: 220px;
  margin: 6px 0 0;
  padding: 10px 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--shadow);
  list-style: none;
}

.historical-event-details p {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.context-events-surface {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.context-events-heading,
.context-event-summary,
.context-event-actions,
.context-event-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.context-events-heading h3,
.context-event-item p,
.context-events-message {
  margin: 0;
}

.context-events-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  overflow-wrap: anywhere;
  list-style: none;
}

.context-event-item,
.selected-artist-context {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafa;
}

.context-event-item {
  display: grid;
  gap: 6px;
}

.context-event-actions {
  justify-content: flex-start;
}

.app-shell .danger-button {
  border-color: #dc2626;
  color: #991b1b;
}

.context-event-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafa;
}

.app-shell .context-event-form label {
  display: grid;
  gap: 6px;
}

.app-shell .context-event-form textarea {
  min-height: 88px;
  resize: vertical;
}

.context-event-form-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.selected-artist-context {
  margin-top: 14px;
  overflow-wrap: anywhere;
}

.selected-artist-context h3,
.selected-artist-context p {
  margin: 0;
}

.selected-artist-context-list {
  display: grid;
  gap: 10px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.selected-artist-context-list li {
  display: grid;
  gap: 4px;
}

.historical-comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.historical-comparison-summary {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafa;
}

.historical-comparison-summary h3 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 0.82rem;
}

.roster-intelligence {
  min-width: 0;
}

.roster-intelligence-view-toggle {
  width: fit-content;
  max-width: 100%;
  margin: 10px 0 2px;
}

.roster-map-shell {
  min-width: 0;
  max-width: 100%;
  margin-top: 12px;
}

.roster-map-note,
.roster-map-excluded,
.roster-map-selection-note {
  margin: 8px 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.roster-map-chart-wrap {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.roster-map-svg {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.roster-map-axis {
  stroke: #9ca3af;
  stroke-width: 1;
}

.roster-map-reference {
  stroke: #d1d5db;
  stroke-width: 1;
  stroke-dasharray: 5 5;
}

.roster-map-median {
  stroke: var(--accent);
}

.roster-map-axis-label,
.roster-map-reference-label,
.roster-map-quadrant {
  fill: var(--muted);
  font-size: 12px;
}

.roster-map-quadrant {
  font-size: 10px;
}

.roster-map-point {
  cursor: pointer;
  outline: none;
}

.roster-map-point circle,
.roster-map-point .roster-map-unavailable-marker {
  fill: #78F735;
  stroke: #111111;
  stroke-width: 2;
  transition: stroke-width 120ms ease, fill 120ms ease;
}

.roster-map-point .roster-map-unavailable-marker {
  fill: #f3f4f6;
  stroke-dasharray: 3 2;
}

.roster-map-point text {
  fill: #111111;
  font-size: 10px;
  font-weight: 900;
  pointer-events: none;
}

.roster-map-point.is-selected circle,
.roster-map-point:hover circle,
.roster-map-point.is-selected .roster-map-unavailable-marker,
.roster-map-point:hover .roster-map-unavailable-marker {
  fill: #78F735;
  stroke-width: 4;
}

.roster-map-point:focus-visible circle,
.roster-map-point:focus-visible .roster-map-unavailable-marker {
  stroke: #111111;
  stroke-width: 5;
}

.roster-map-point-card {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.roster-map-point-card strong {
  width: 100%;
  color: var(--ink);
}

.roster-intelligence-table-wrap {
  max-width: 100%;
  overflow-x: clip;
}

.roster-intelligence-table {
  min-width: 0;
  table-layout: fixed;
  font-size: 0.82rem;
}

.roster-intelligence-table th,
.roster-intelligence-table td {
  padding: 10px 6px;
  vertical-align: middle;
}

.roster-intelligence-table th {
  font-size: 0.68rem;
  line-height: 1.2;
}

.roster-intelligence-table th:nth-child(1) { width: 23%; }
.roster-intelligence-table th:nth-child(2) { width: 12%; }
.roster-intelligence-table th:nth-child(3) { width: 10%; }
.roster-intelligence-table th:nth-child(4) { width: 12%; }
.roster-intelligence-table th:nth-child(5) { width: 11%; }
.roster-intelligence-table th:nth-child(6) { width: 9%; }
.roster-intelligence-table th:nth-child(7) { width: 13%; }
.roster-intelligence-table th:nth-child(8) { width: 10%; }

.roster-intelligence-table td:first-child {
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.roster-intelligence-table td:not(:first-child):not(:nth-child(3)) {
  white-space: nowrap;
}

.roster-intelligence-table td:nth-child(3) {
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.roster-squeeze-unit {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}

.roster-squeeze-value {
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 900;
  line-height: 1;
}

.roster-squeeze-delta {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.roster-intelligence-state {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.roster-intelligence-table tbody tr {
  cursor: pointer;
}

.roster-intelligence-table tbody tr[aria-selected="true"] {
  background: #f3f4f6;
  box-shadow: inset 3px 0 0 var(--accent);
}

.roster-intelligence-table tbody tr:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

.roster-intelligence-explanation {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafa;
}

.roster-intelligence-explanation h3,
.roster-intelligence-explanation p {
  margin: 0;
}

.roster-squeeze-summary {
  display: grid;
  gap: 3px;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}

.roster-squeeze-kicker {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.roster-squeeze-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.roster-squeeze-score {
  color: var(--ink);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.roster-squeeze-change {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 800;
}

.roster-squeeze-summary h3 {
  color: var(--ink);
  font-size: 0.9rem;
}

.roster-intelligence-explanation ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.82rem;
  list-style: none;
}

.selected-artist-layout {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
  gap: 14px;
  min-width: 0;
  align-items: start;
}

.selected-artist-side-stack {
  display: grid;
  gap: 14px;
  min-width: 0;
  align-content: start;
}

.selected-artist-side-stack > .panel {
  align-self: start;
}

.selected-artist-side-stack:not(:has(> .panel:not(.is-hidden):not([hidden]))) {
  display: none;
}

.selected-artist-layout:not(:has(> .selected-artist-main-stack > .panel:not(.is-hidden, [hidden]))),
.selected-artist-layout:not(:has(> .selected-artist-side-stack > .panel:not(.is-hidden):not([hidden]))) {
  grid-template-columns: minmax(0, 1fr);
}

.selected-artist-main-stack {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.selected-artist-main-stack:not(:has(> .panel:not(.is-hidden, [hidden]))) {
  display: none;
}

.selected-artist-intelligence,
.all-time-highs-panel {
  min-width: 0;
}

.audience-panel {
  grid-column: 1 / -1;
}

.audience-panel .segments {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.top-posts-panel .table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.top-posts-panel td:first-child {
  min-width: 12rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.m7-intelligence-layout {
  display: grid;
  gap: 14px;
}

.m7-intelligence-section {
  min-width: 0;
}

.m7-what-changed-section {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.m7-intelligence-section h3,
.m7-intelligence-section h4,
.m7-intelligence-section p {
  margin-top: 0;
}

.m7-what-changed,
.m7-recommendations,
.m7-evidence {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.m7-recommendations {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.m7-recommendations[data-recommendation-count="1"] {
  grid-template-columns: minmax(0, 1fr);
}

.m7-recommendation {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafa;
}

.m7-recommendation h4 {
  margin-bottom: 0;
}

.m7-recommendation-basis {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.m7-recommendation-primary,
.m7-recommendation-details-body {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.m7-recommendation-primary p,
.m7-recommendation-primary ol,
.m7-recommendation-details-body p {
  margin: 0;
}

.m7-recommendation-primary strong,
.m7-recommendation-details-body strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.m7-recommendation-primary ol {
  display: grid;
  gap: 4px;
  padding-left: 1.25rem;
}

.m7-recommendation,
.m7-recommendation-primary,
.m7-recommendation-details-body,
.m7-content-evidence {
  overflow-wrap: anywhere;
}

.m7-recommendation > p,
.m7-recommendation-primary,
.m7-recommendation-details-body,
.m7-recommendation details p,
.m7-evidence,
.m7-history-context,
.m7-history-start,
.m7-empty-state p {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.m7-recommendation summary {
  color: var(--accent-3);
  cursor: pointer;
  font-weight: 800;
}

.m7-recommendation summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.m7-recommendation-details-body {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.m7-evidence {
  gap: 4px;
  margin-top: 8px;
}

.m7-highs-grid {
  display: grid;
  gap: 10px;
  margin: 0;
}

.m7-high {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.m7-high dt {
  color: var(--muted);
  font-size: 0.78rem;
}

.m7-high dd {
  margin: 0;
  font-weight: 800;
}

.m7-high dd:nth-of-type(2) {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
}

.historical-coverage {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.historical-coverage-details {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.historical-coverage-details summary {
  width: fit-content;
  cursor: pointer;
  font-weight: 700;
}

.historical-coverage-details p {
  margin: 4px 0 0;
}

.app-shell .metric-toggle button {
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.app-shell .metric-toggle button[aria-pressed="true"] {
  background: var(--accent);
  color: #07111f;
}

.trend-note {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.trend-detail-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) repeat(3, minmax(90px, 1fr));
  gap: 10px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

.trend-detail-row strong {
  color: var(--ink);
}

.empty {
  color: var(--muted);
  line-height: 1.45;
}

.history-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.history-row {
  display: grid;
  grid-template-columns: 1.2fr repeat(4, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.history-row strong {
  color: var(--ink);
}

.history-row small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

@media (max-width: 1200px) {
  .audience-panel .segments {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .roster-summary-layout {
    grid-template-columns: 1fr;
  }

  .roster-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selected-artist-layout {
    grid-template-columns: 1fr;
  }

  .app-shell .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .header-controls {
    width: 100%;
    padding-top: 0;
  }

  .report-controls-title {
    position: static;
    transform: none;
  }

  .app-shell .controls {
    justify-content: stretch;
  }

  .app-shell input,
  .app-shell select,
  .app-shell button,
  .app-shell label,
  .app-shell .button-link {
    width: 100%;
  }

  .app-shell .manager-actions,
  .app-shell .inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .app-shell .platform-connection-group {
    width: 100%;
  }

  .app-shell .account-control-pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .app-shell .account-control-pair input {
    width: 100%;
  }

  .trend-detail-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .app-shell .checkbox-grid {
    position: static;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .app-shell .admin-menu {
    position: static;
    width: 100%;
  }

  .history-row {
    grid-template-columns: 1fr;
  }

  .ath-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .historical-comparison-grid {
    grid-template-columns: 1fr;
  }

  .context-event-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .audience-panel .segments {
    grid-template-columns: minmax(0, 1fr);
  }

  .m7-recommendations {
    grid-template-columns: 1fr;
  }

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

  .m7-high dd:nth-of-type(2) {
    grid-column: 1;
  }

  .roster-intelligence-table-wrap {
    overflow-x: auto;
  }

  .roster-intelligence-table {
    min-width: 720px;
  }

  .roster-map-quadrant {
    display: none;
  }

  .roster-map-point-card {
    display: grid;
  }
}

@media (max-width: 560px) {
  .app-shell .weekly-brief-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

  .app-shell .weekly-brief-list {
    grid-template-columns: minmax(0, 1fr);
  }
  .roster-kpi-grid {
    grid-template-columns: 1fr;
  }

  .segments {
    grid-template-columns: 1fr;
  }

  .bar-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .content-mix-metrics {
    text-align: left;
  }

  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
  }

  .app-shell .status-row,
  .app-shell .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric {
    min-height: 118px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .shell {
    width: 100%;
    padding: 0;
  }

  .app-shell .no-print,
  .app-shell .controls,
  .app-shell .status-pill,
  .app-shell .button-link,
  .app-shell button {
    display: none !important;
  }

  .app-shell .toolbar,
  .app-shell .status-row {
    border-bottom: 1px solid #cfd6df;
    margin-bottom: 16px;
  }

  .metric-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .report-grid {
    grid-template-columns: 1fr;
  }

  .metric,
  .panel {
    box-shadow: none;
    break-inside: avoid;
  }

  .metric {
    background: #fff;
    border-color: #e2e8f0;
    color: #1f2937;
  }

  .metric span {
    color: #4b5563;
  }

  .metric strong {
    color: #111827;
  }

  .metric small {
    color: #64748b;
  }
}

/* Shared platform scope follows the existing Table / Roster Map pills. */
.app-shell .platform-controls{ min-width:0; margin:12px 0 20px; }
.app-shell .platform-controls p{ margin:6px 0; font-size:.8rem; }
.app-shell .platform-toggle{ display:flex; flex-wrap:wrap; width:fit-content; max-width:100%; }
.app-shell .platform-toggle button{ display:inline-flex; align-items:center; gap:7px; width:auto; }
.app-shell .platform-toggle svg{ width:20px; height:20px; flex:none; }
.app-shell .platform-toggle button[aria-pressed="true"]{ outline:2px solid var(--ink); outline-offset:-2px; }
.app-shell .platform-toggle button:focus-visible{ outline:3px solid #1877d2; outline-offset:3px; }
.app-shell .platform-toggle button:disabled{ opacity:.42; cursor:not-allowed; }
.app-shell .platform-kpi{ font-size:.78rem; margin-top:10px; overflow-wrap:anywhere; }
.app-shell .platform-kpi:empty{ display:none; }
.app-shell .platform-kpi small{ display:block; }
.app-shell #spotifyTopTracks, .app-shell #spotifyAudience, .app-shell .platform-highs, .app-shell .platform-changes, .app-shell .spotify-trends{ min-width:0; max-width:100%; }
.app-shell #spotifyTopTracks:not(:empty), .app-shell #spotifyAudience:not(:empty), .app-shell .platform-highs, .app-shell .platform-changes, .app-shell .spotify-trends{ border-top:1px solid var(--line); margin-top:16px; padding-top:12px; }
.app-shell #spotifyTopTracks p, .app-shell #spotifyAudience p, .app-shell .spotify-trends p{ font-size:.78rem; }
.app-shell .spotify-trends figure{ margin:8px 0; min-width:0; }
.app-shell .platform-trend{ display:block; width:100%; height:auto; }
.app-shell .platform-trend text{ font:12px sans-serif; fill:var(--muted); }
.app-shell .platform-trend circle{ fill:#218648; }
.app-shell .monthly-listeners-card { grid-column: 1; }
@media (max-width: 560px) {
  .roster-kpi-grid .monthly-listeners-card { grid-row: 4; }
}
.app-shell .spotify-trend-details { margin-top:12px; overflow-x:auto; }
.app-shell .historical-trend-legend [data-history-series="monthlyListeners"] { --history-series-color:#FFD149; color:#000000; }
.app-shell .historical-trend-legend [data-history-series="monthlyListeners"]::before { background:#FFD149; }
.app-shell [hidden]{ display:none !important; }
@media(max-width:560px) { .app-shell .platform-toggle { width:100%; } .app-shell .platform-toggle button { flex:1; justify-content:center; padding:10px 5px; gap:4px; } .app-shell .platform-toggle svg { width:17px; height:17px; } }
@media print { .app-shell .platform-controls form { display:none !important; } }

/* Dashboard visibility and platform panels. */
.app-shell .is-hidden { display:none !important; }
.app-shell .platform-kpi strong { font-size:1.15rem; line-height:1.2; }
.app-shell .platform-kpi span { display:block; font-size:.78rem; }
.app-shell .platform-roster-table { overflow-x:auto; }
.app-shell .platform-roster-table table { min-width:920px; table-layout:auto; }
.app-shell .platform-roster-table th { width:auto; white-space:nowrap; }
.app-shell .platform-roster-table td:first-child { min-width:150px; }
.app-shell #spotifyTopTracks table { min-width:0; table-layout:fixed; }
.app-shell #spotifyTopTracks th:first-child { width:65%; }
.app-shell #spotifyTopTracks td { overflow-wrap:anywhere; }
.app-shell .platform-roster-table td:nth-child(3) { min-width:110px; white-space:normal; overflow-wrap:normal; }

/* Measured platform sources share a compact, icon-only footer on every data card. */
.app-shell .metric,
.app-shell .weekly-brief-item,
.app-shell .historical-comparison-summary { display:flex; flex-direction:column; }
.app-shell .platform-sources {
  display:flex;
  align-items:center;
  justify-content:flex-start;
  flex-wrap:wrap;
  gap:8px;
  min-width:0;
  margin:14px 0 0;
  padding:0;
  grid-column:1 / -1;
}
.app-shell .metric > .platform-sources,
.app-shell .weekly-brief-item > .platform-sources,
.app-shell .historical-comparison-summary > .platform-sources { margin-top:auto; padding-top:14px; }
.app-shell .platform-source-icon {
  display:inline-flex;
  flex:0 0 20px;
  width:20px;
  height:20px;
  margin:0;
  padding:0;
  color:var(--muted);
}
.app-shell .platform-source-icon svg { display:block; width:100%; height:100%; }
.app-shell .m7-high > .platform-sources { margin-top:6px; }
.app-shell .m7-recommendation > .platform-sources { margin-top:4px; }
.app-shell .roster-intelligence-explanation > .platform-sources { margin-top:6px; }

.app-shell button.platform-source-icon {
  padding: 0;
  justify-content: center;
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  min-height: var(--dashboard-icon-button-size);
  min-width: var(--dashboard-icon-button-size);
}
.app-shell button.platform-source-icon[aria-pressed="true"] { background: var(--primary); border-radius: 50%; }
.app-shell button.platform-source-icon[aria-pressed="false"] { background: transparent; opacity: .55; }
.app-shell button.platform-source-icon:focus-visible { outline: 2px solid currentColor; }
.app-shell .platform-filter-empty > :not(.trend-controls, .platform-sources, .card-filter-message, .metric-label, .panel-heading, h2, h3) { display: none !important; }

.app-shell button.platform-source-icon svg { flex: none; width: 20px; height: 20px; }

.app-shell [data-minimize] { position: relative; }
@media screen {
  .app-shell [data-minimize] > .panel-heading,
  .app-shell .roster-kpi-grid [data-minimize] > .metric-label { box-sizing: border-box; padding-right: 34px; }
  .app-shell .weekly-roster-brief > #weeklyRosterBrief > :first-child { padding-right: 34px; }
  .app-shell button.minimize-panel {
    position: absolute; top: 12px; right: 10px; width: 28px; height: 28px; min-height: 28px;
    display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--line);
    border-radius: 6px; background: var(--panel); color: var(--ink, #151515); cursor: pointer;
  }
  .app-shell .minimize-panel::after { content: "−"; font: bold 17px/1 Arial,sans-serif; }
  .app-shell .minimize-panel:hover, .app-shell .minimize-panel:focus-visible { border-color: currentColor; }
  .app-shell .roster-kpi-grid:has(.is-minimized) { grid-auto-rows: auto; }
  .app-shell [data-minimize].is-minimized {
    min-height: 0; height: auto; align-self: start; padding: 0; gap: 0;
  }
  .app-shell [data-minimize].is-minimized > :not(.minimize-panel) { display: none !important; }
  .app-shell [data-minimize].is-minimized > button.minimize-panel {
    position: static; display: flex !important; width: 100%; height: auto; min-height: 40px; padding: 8px 12px;
    justify-content: space-between; gap: 8px; border: 0; text-align: left; color: inherit; font-weight: 700;
  }
  .app-shell [data-minimize].is-minimized > .minimize-panel::after { content: "+"; }
  .app-shell .platform-filter-empty > button.minimize-panel { display: inline-flex !important; }
}
@media print { .app-shell button.minimize-panel { display: none !important; } }

.app-shell .trend-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 12px; }
.app-shell .trend-controls > .metric-toggle,
.app-shell .trend-controls > .platform-sources { margin: 0; }

.app-shell .platform-roster-snapshots {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px 24px;
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 12px;
}

.app-shell .platform-roster-snapshots > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.app-shell .platform-roster-snapshots:not(:has(> div:not([hidden], :empty))),
.app-shell .platform-roster-snapshots > div:empty {
  display: none;
}

@media (min-width: 761px) {
  .app-shell .platform-roster-snapshots:has(#spotifyRosterBrief:not([hidden], :empty)):has(#youtubeRosterBrief:not([hidden], :empty)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.app-shell .historical-comparison-summary .platform-source-icon {
  justify-content: center;
  align-items: center;
  flex-basis: var(--dashboard-icon-button-size);
  width: var(--dashboard-icon-button-size);
  height: var(--dashboard-icon-button-size);
  background: var(--primary);
  border-radius: 50%;
}

.app-shell .historical-comparison-summary .platform-source-icon svg {
  width: 20px;
  height: 20px;
}
