/* Map study components to Cirene's existing aprueba-cobalt.css theme.
   The public landing and the clinical application's palette are untouched. */
html[data-theme="light"] {
  color-scheme: light;
}
html[data-theme="dark"] {
  color-scheme: dark;
}
.cw-shell {
  --white: var(--bg-surface);
  --ink: var(--text-primary);
  --muted: var(--text-secondary);
  --muted-light: var(--text-tertiary);
  --line: var(--border);
  --soft: var(--bg-page);
  --blue: var(--accent);
  --blue-dark: var(--accent-text);
  --on-accent: #fff;
  --c-bg: var(--white);
  --c-border: var(--line);
  --c-accent: var(--accent-text);
  --c-muted: var(--muted);
  --study-success-bg: #edf7f1;
  --study-success-text: #18623f;
  --study-success-border: #438b65;
  --study-error-bg: #fff1ed;
  --study-error-text: #91331d;
  --study-error-border: #b42318;
  --study-warning-bg: #faf4e4;
  --study-warning-text: #6f550f;
  color: var(--ink);
}
html[data-theme="dark"] .cw-shell {
  --study-success-bg: #142b21;
  --study-success-text: #90dfb0;
  --study-success-border: #64b989;
  --study-error-bg: #35201d;
  --study-error-text: #ffb4a5;
  --study-error-border: #ed8e7b;
  --study-warning-bg: #302a18;
  --study-warning-text: #e6ca7f;
}
.cw-shell :is(input, select, textarea) {
  color: var(--ink);
  background-color: var(--white);
  accent-color: var(--accent);
}
.cw-shell :focus-visible {
  outline-color: var(--accent-text);
}
.cw-shell .cw-sidebar nav a[aria-current="page"] {
  background: var(--line);
}
.cw-shell .ped-option:has(input:checked) {
  background: var(--accent-subtle);
}
.cw-shell .ped-option.is-correct {
  border-color: var(--study-success-border);
}
.cw-shell .ped-grid button.is-correct {
  background: var(--study-success-bg);
  color: var(--study-success-text);
  border-color: var(--study-success-border);
}
.cw-shell .ped-grid button.is-error {
  background: var(--study-error-bg);
  color: var(--study-error-text);
  border-color: var(--study-error-border);
}
.cw-shell .mixed-counts input[aria-invalid="true"] {
  border-color: var(--study-error-border);
}
.cw-shell #study-mixed-summary[data-state="invalid"],
.cw-shell .ad-row[data-overdue="true"] time {
  color: var(--study-error-text);
}
.cw-shell .study-origin,
.cw-shell .ad-deadline,
.cw-shell .ped-footer {
  border-color: var(--line);
  background: var(--soft);
}
.cw-shell .study-origin {
  color: var(--muted);
}
.cw-shell :is(.study-origin, .ad-key-dates, .ad-sources, .ad-instructions) a {
  color: var(--accent-text);
}
.cw-shell .ad-status-dot {
  border-color: var(--accent-text);
}
.cw-shell .ad-notice:not(:empty) {
  color: var(--study-warning-text);
  background: var(--study-warning-bg);
  border-color: var(--study-warning-text);
}
.cw-shell #ad-window,
.cw-shell .ad-calendar-row time {
  color: var(--muted);
}
.cw-shell .ad-calendar-row {
  border-color: var(--line);
}
.cw-shell .ad-toolbar button[aria-pressed="true"] {
  background: var(--accent-subtle);
  color: var(--accent-text);
}
.cw-shell .ad-row:hover,
.cw-shell .ad-task-state {
  background: var(--soft);
}
.cw-shell .ad-row[data-status="done"] .ad-task-state {
  background: var(--study-success-bg);
  color: var(--study-success-text);
}
.cw-shell .ad-row[data-status="doing"] .ad-task-state {
  background: var(--study-warning-bg);
  color: var(--study-warning-text);
}
.cw-account .pe-evidence > a {
  display: inline-block;
  margin: 0 20px 10px 0;
  color: var(--accent-text);
  text-underline-offset: 3px;
}
