/* Shared palette for both signed-in workspaces. Component declarations
   retain their original colors as fallbacks in the dark theme. */
html[data-theme="light"],
body[data-auth-role="instructor"]:not(.dark) {
  color-scheme: light;

  --flb-light-ink: #132d35;
  --flb-light-muted: #38525b;
  --flb-light-accent-ink: #005b54;
  --flb-light-info: #174e7a;
  --flb-light-violet: #5b3883;
  --flb-light-success: #17603d;
  --flb-light-warning: #744809;
  --flb-light-danger: #8e2b3d;

  --flb-light-surface: #fff;
  --flb-light-raised: #f0f6f7;
  --flb-light-wash: #eaf3f4;
  --flb-light-line: #c6d9db;
  --flb-light-outline: #6b8c91;
  --flb-light-teal-soft: #e2f4f0;
  --flb-light-teal-strong: #b7e9de;
  --flb-light-blue-soft: #ebf4fc;
  --flb-light-blue-strong: #cde7fb;
  --flb-light-violet-soft: #f2ecfa;
  --flb-light-violet-strong: #e4d8f6;
  --flb-light-green-soft: #e7f6ec;
  --flb-light-green-strong: #c9ecd6;
  --flb-light-amber-soft: #fff5e0;
  --flb-light-amber-strong: #f8e4b7;
  --flb-light-red-soft: #fceef0;
  --flb-light-red-strong: #f6dbe0;

  --muted: var(--flb-light-muted);
  --line: var(--flb-light-line);
}
body[data-auth-role="instructor"]:not(.dark) {
  --ink: var(--flb-light-ink);
  --text: var(--flb-light-ink);
  --bg: #edf4f5;
  --card: var(--flb-light-surface);
  --soft: var(--flb-light-raised);
  --flb7-bg: var(--bg);
  --flb7-panel: var(--card);
  --flb7-panel2: var(--soft);
  --flb7-text: var(--ink);
  --flb7-muted: var(--muted);
  --flb7-line: var(--line);
  --muted-text: var(--muted);
  --control-text: var(--ink);
  --control-label: var(--muted);
  --control-placeholder: var(--muted);
  --control-bg: var(--flb-light-surface);
  --control-bg-hover: var(--flb-light-raised);
  --control-border: var(--flb-light-outline);
}

:is(html[data-theme="light"] body, body[data-auth-role="instructor"]:not(.dark))
  :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"]), select, textarea) {
  color-scheme: light !important;
}
:is(html[data-theme="light"] body, body[data-auth-role="instructor"]:not(.dark))
  :is(input, textarea)::placeholder {
  color: var(--flb-light-muted);
  opacity: 1;
}
:is(html[data-theme="light"] body, body[data-auth-role="instructor"]:not(.dark))
  :is(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--flb-light-accent-ink);
  outline-offset: 2px;
}
:is(html[data-theme="light"] body, body[data-auth-role="instructor"]:not(.dark))
  :is(input[type="checkbox"], input[type="radio"], input[type="range"]) {
  accent-color: var(--flb-light-accent-ink);
}

/* Selection remains visible against a white card or toolbar. */
body[data-auth-role="instructor"]:not(.dark) :is(.flb7-tab.active, .flb7-nav-main.is-active, .flb7-subnav button.is-active),
html[data-theme="light"] :is(.nav-item.active, .chip.active) {
  background: var(--flb-light-teal-strong);
  color: var(--flb-light-accent-ink);
}
html[data-theme="light"] .day-row.off :is(.slot-list, .add-slot) {
  opacity: 1;
}
html[data-theme="light"] .day-row.off :is(input, .slot-remove, .add-slot) {
  background: var(--flb-light-wash);
  color: var(--flb-light-muted);
}
html[data-theme="light"] .slot-row input {
  border-color: var(--flb-light-outline);
}
html[data-theme="light"] .slot-row.invalid input[type="time"] {
  border-color: var(--flb-light-danger);
}
html[data-theme="light"] .student-adk-meta,
html[data-theme="light"] .student-adk-score :is(small, span) {
  color: var(--flb-light-muted);
}
body[data-auth-role="instructor"]:not(.dark) #flbOfficeAgenda :is(.oa-cal-event.done, .oa-team-event.done) {
  opacity: 1;
  background: var(--flb-light-wash);
  color: var(--flb-light-muted);
}

/* Keep badges, colored labels and the controls for each state readable. */
body[data-auth-role="instructor"]:not(.dark)
  :is(.settings-nav-icon, .number-field b, .text-button, .team-role, .subscription-state, .flb7-exam-workbar button.active),
html[data-theme="light"] :is(.slot-offer-banner b, .slot-offer-icon) {
  color: var(--flb-light-accent-ink);
}
html[data-theme="light"] .avatar:not([style*="background-image"]) {
  background: linear-gradient(135deg, #d8f4ec, #abe0d4);
  color: var(--flb-light-ink);
}
html[data-theme="light"] :is(.switch, .day-toggle):not(.on) {
  background: var(--flb-light-outline);
}
html[data-theme="light"] :is(.switch, .day-toggle).on {
  background: var(--flb-light-accent-ink);
}
html[data-theme="light"] :is(.switch, .day-toggle) i {
  background: var(--flb-light-surface);
}
