/* Shared final theme layer. Keep foregrounds and surfaces paired so later
   customer-layout rules cannot leave light cards with dark-theme text. */
.criterion-row .expand-copy {
  gap: 8px;
  padding: 7px 11px;
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: .8rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.criterion-row .details-open,
.criterion-row[open] .details-closed { display: none; }
.criterion-row[open] .details-open { display: inline; }
.criterion-row[open] .details-chevron { transform: rotate(180deg); }
.criterion-row summary:hover .expand-copy { border-color: var(--accent); }
.criterion-row summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; border-radius: 6px; }
body.studio-page[data-theme="light"] .criterion-detail-card p,
body.studio-page[data-theme="light"] .criterion-evidence,
body.studio-page[data-theme="light"] .feedback-item p,
body.studio-page[data-theme="light"]:not(.is-editor) .review-panel-heading p { color: #475569; }

body[data-theme="dark"] {
  --feedback-surface: #16263c;
  --feedback-text: #d4dfed;
  --feedback-border: #3b5271;
}
body.studio-page[data-theme="dark"] .criterion-row {
  background: var(--surface);
  border-color: var(--feedback-border);
}
body.studio-page[data-theme="dark"] .criterion-detail-card {
  background: var(--feedback-surface);
  border-color: var(--feedback-border);
  border-left: 3px solid #60a5fa;
}
body.studio-page[data-theme="dark"] .criterion-detail-card strong { color: #93c5fd; }
body.studio-page[data-theme="dark"] .criterion-detail-card p,
body.studio-page[data-theme="dark"] .criterion-summary,
body.studio-page[data-theme="dark"] .criterion-evidence,
body.studio-page[data-theme="dark"] .feedback-reference { color: var(--feedback-text); }
body.studio-page[data-theme="dark"] .criterion-row .expand-copy {
  background: #1c3555;
  border-color: #50739e;
  color: #bfdbfe;
}
body.studio-page[data-theme="dark"] .bar-track { background: #30435c; }
body.studio-page[data-theme="dark"]:not(.is-editor) .section-heading { color: var(--ink); }
body.studio-page[data-theme="dark"] .results-tab.is-active { color: #10233f; }

body.studio-page[data-theme="dark"]:not(.is-editor) .feedback-item {
  background: var(--feedback-surface);
  border-color: var(--feedback-border);
  border-left: 3px solid #60a5fa;
}
body.studio-page[data-theme="dark"]:not(.is-editor) .feedback-item.warning {
  background: #2c261b;
  border-color: #7d6435;
  border-left-color: #fbbf24;
}
body.studio-page[data-theme="dark"]:not(.is-editor) .feedback-item.risk {
  background: #302032;
  border-color: #815069;
  border-left-color: #fb7185;
}
body.studio-page[data-theme="dark"]:not(.is-editor) .feedback-item p { color: var(--feedback-text); }
body.studio-page[data-theme="dark"]:not(.is-editor) .feedback-item .feedback-icon {
  background: #244c79;
  border-color: #5c8cbe;
  color: #fff;
}
body.studio-page[data-theme="dark"]:not(.is-editor) .feedback-item.warning .feedback-icon {
  background: #fbbf24;
  border-color: #fbbf24;
  color: #30210b;
}
body.studio-page[data-theme="dark"]:not(.is-editor) .feedback-item.risk .feedback-icon {
  background: #fda4af;
  border-color: #fda4af;
  color: #3b1020;
}
body.studio-page[data-theme="dark"] .studio-kicker,
body.account-page[data-theme="dark"] .cinematic-kicker { color: #93c5fd; }
body.studio-page[data-theme="dark"]:not(.is-editor) .review-panel-heading p,
body.studio-page[data-theme="dark"]:not(.is-editor) .secondary-review-label { color: #b9c9dd; }
body.studio-page[data-theme="dark"] #studio .draft-stats > span { background: var(--surface-alt); border-color: var(--line); }
body.studio-page[data-theme="dark"] .studio-setup-progress [aria-current="step"] > span { color: #10233f; }

body.studio-page[data-theme="dark"]:not(.is-editor) .coach-limit-notice {
  background: #30261a;
  border-color: #8b6a36;
  color: #fde5bd;
}
body.studio-page[data-theme="dark"]:not(.is-editor) .coach-limit-notice strong,
body.studio-page[data-theme="dark"]:not(.is-editor) .coach-limit-notice > i { color: #fcd38d; }
body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder { color: #aebed3; opacity: 1; }
body[data-theme="dark"] a:focus-visible,
body[data-theme="dark"] button:focus-visible { outline: 3px solid #93c5fd; outline-offset: 3px; }

body.studio-page[data-theme="dark"]:not(.is-editor) .app-card-heading > span,
body.studio-page[data-theme="dark"]:not(.is-editor) .metric-grid > div > span,
body.studio-page[data-theme="dark"]:not(.is-editor) .work-review-topline > span,
body.studio-page[data-theme="dark"]:not(.is-editor) .review-record-item span,
body.studio-page[data-theme="dark"]:not(.is-editor) .review-record-item small,
body.studio-page[data-theme="dark"]:not(.is-editor) .score-progress-list small,
body.studio-page[data-theme="dark"]:not(.is-editor) .work-review-card p,
body.account-page[data-theme="dark"] .account-page-hero p { color: #b9c9dd; }
body.studio-page[data-theme="dark"]:not(.is-editor) .review-record-item strong { color: var(--ink); }
body.studio-page[data-theme="dark"] .free-criterion-peek,
body.studio-page[data-theme="dark"] .free-criterion-peek-grid > div { background: var(--feedback-surface); border-color: var(--feedback-border); }
body.studio-page[data-theme="dark"] .free-criterion-peek-grid strong { color: #93c5fd; }
body.studio-page[data-theme="dark"] .free-criterion-peek-grid p,
body.studio-page[data-theme="dark"] .free-criterion-peek-note { color: var(--feedback-text); }
body.studio-page[data-theme="dark"]:not(.is-editor) .primary-action {
  background: #2563eb;
  border-color: #60a5fa;
  color: #fff;
}
body.studio-page[data-theme="dark"]:not(.is-editor) .primary-action:hover { background: #1d4ed8; }
body.studio-page[data-theme="dark"]:not(.is-editor) .subscription-plan-card.is-featured-plan .primary-action {
  background: #fff;
  color: #0f2a4f;
}

/* Report hierarchy: blue identifies scores/evidence, amber identifies a priority.
   Marks and wording carry meaning independently of colour. */
body.studio-page {
  --report-blue: #1d4ed8;
  --report-blue-soft: #eff6ff;
  --report-blue-line: #93b4e5;
  --report-priority: #92400e;
  --report-priority-soft: #fef3c7;
}
body.studio-page[data-theme="dark"] {
  --report-blue: #93c5fd;
  --report-blue-soft: #172f4b;
  --report-blue-line: #50739e;
  --report-priority: #fde68a;
  --report-priority-soft: #46341a;
}
body.studio-page #scoreValue,
body.studio-page #gradeLabel,
body.studio-page .criterion-score { color: var(--report-blue); font-variant-numeric: tabular-nums; }
body.studio-page #gradeLabel { font-size: clamp(1.5rem, 2.3vw, 2rem); }
body.studio-page .criterion-score {
  background: var(--report-blue-soft);
  border-radius: 6px;
  padding: 4px 8px;
}
body.studio-page:not(.is-editor) .feedback-item .feedback-icon {
  background: var(--report-blue-soft);
  border-color: var(--report-blue-line);
  color: var(--report-blue);
}
body.studio-page:not(.is-editor) .feedback-item.warning .feedback-icon {
  background: var(--report-priority-soft);
  border-color: var(--report-priority);
  color: var(--report-priority);
}
body.studio-page .feedback-passage {
  border: 0;
  border-top: 1px solid var(--report-blue-line);
  margin: 14px 0 0;
  padding: 12px 0 0;
}
body.studio-page .feedback-passage > span {
  color: var(--report-blue);
  font-size: .8rem;
  font-weight: 750;
}
body.studio-page .feedback-passage p { font-size: .9rem; line-height: 1.6; }
body.studio-page .feedback-item > div { min-width: 0; }
body.studio-page .feedback-item p,
body.studio-page .criterion-detail-card p,
body.studio-page .criterion-evidence { overflow-wrap: anywhere; }
body.studio-page .feedback-item ::selection,
body.studio-page .criterion-row ::selection { background: var(--report-blue); color: var(--surface); }
