/* Faculty console organization (requested November 29, 2026). Loaded after the faculty sheets. Lecture rows group their actions into two menus, the Workflow console keeps one action row,
   Anki jobs carries the deck queue, and the Upload/Dropbox sections get their artwork. Every control keeps its controller. */

/* ---- Lecture rows: Questions and Actions menus ---- */
body[data-route="faculty"] .library-row-actions { align-items: center; }
body[data-route="faculty"] .library-row-dropdown { position: relative; }
body[data-route="faculty"] .library-row-dropdown > summary { display: inline-flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; }
body[data-route="faculty"] .library-row-dropdown > summary::-webkit-details-marker { display: none; }
body[data-route="faculty"] .library-row-dropdown__chevron { flex: 0 0 auto; transition: transform .16s ease; }
body[data-route="faculty"] .library-row-dropdown[open] .library-row-dropdown__chevron { transform: rotate(180deg); }
body[data-route="faculty"] .library-row-dropdown__badge { color: var(--owen-muted); font-size: .6875rem; font-weight: 600; }
body[data-route="faculty"] .library-row-dropdown__badge[hidden] { display: none; }
body[data-route="faculty"] .library-row-dropdown__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  display: grid;
  gap: 6px;
  box-sizing: border-box;
  min-width: 252px;
  max-width: min(340px, calc(100vw - 32px));
  padding: 10px;
  border: 1px solid var(--owen-border);
  border-radius: 14px;
  background: var(--owen-surface);
  box-shadow: var(--shadow-md);
}
body[data-route="faculty"] .library-row-dropdown__panel > .btn { justify-content: flex-start; width: 100%; text-align: left; }
/* Near the bottom of a scrolling list the menu opens upward (placeLibraryRowDropdown in chat.js). */
body[data-route="faculty"] .library-row-dropdown--up > .library-row-dropdown__panel { top: auto; bottom: calc(100% + 6px); }
/* The row with an open menu paints above the rows after it. */
body[data-route="faculty"] .library-manager__row:has(.library-row-dropdown[open]) { position: relative; z-index: 6; }
/* Add TSV inside the Questions menu: its label on top, Easy / Medium / Hard in one row, then Upload Qbank. */
body[data-route="faculty"] .library-row-dropdown__panel .library-quick-upload { gap: 6px; padding: 0 0 8px; border-bottom: 1px solid var(--owen-border); }
body[data-route="faculty"] .library-row-dropdown__panel .library-quick-upload__label { flex-basis: 100%; margin: 0; }
body[data-route="faculty"] .library-row-dropdown__panel .library-quick-upload__hint { flex-basis: 100%; }
@media (prefers-reduced-motion: reduce) {
  body[data-route="faculty"] .library-row-dropdown__chevron { transition: none; }
}
/* Phones: the open menu spans the row's action bar so it never runs past the screen edge. */
@media (max-width: 600px) {
  body[data-route="faculty"] .library-row-actions { position: relative; }
  body[data-route="faculty"] .library-row-dropdown { position: static; }
  body[data-route="faculty"] .library-row-dropdown__panel { right: 0; min-width: 0; max-width: none; }
}

/* ---- Workflow console ---- */
/* Manual sits to the right of the lecture picker (stacked on phones). */
@media (min-width: 601px) {
  body[data-route="faculty"] .faculty-lecture-selection { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; }
  body[data-route="faculty"] .faculty-lecture-selection .pipeline-manual-toggle { align-self: center; }
}
/* Generate Anki Cards, Refresh progress, Publish APKG in one row. */
body[data-route="faculty"] .workflow-anki .faculty-preparation__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
body[data-route="faculty"] #workflowAnkiStatus:empty { display: none; }
body[data-route="faculty"] .workflow-anki__progress-head:has(> #workflowAnkiRefreshStatus:empty):not(:has(> :not(#workflowAnkiRefreshStatus))) { display: none; }
/* The primary action (e.g. Review saved questions) sits beside "Correct answers by set", or beside "Lecture preparation"
   while no answers are saved yet. */
body[data-route="faculty"] #facultyPreparationWorkflow:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 14px; align-items: start; }
body[data-route="faculty"] #facultyPreparationWorkflow > * { grid-column: 1 / -1; }
body[data-route="faculty"] #facultyPreparationWorkflow > .faculty-preparation-workflow__answers,
body[data-route="faculty"] #facultyPreparationWorkflow > .faculty-preparation-workflow__disclosure:has(+ [data-preparation-slot]) { grid-column: 1; }
body[data-route="faculty"] #facultyPreparationWorkflow > [data-preparation-slot] { grid-column: 2; display: flex; justify-content: flex-end; padding-top: 2px; }
body[data-route="faculty"] #facultyPreparationWorkflow > .faculty-preparation-workflow__answers + [data-preparation-slot] { margin-top: 1rem; }
body[data-route="faculty"] #facultyPreparationWorkflow > [data-preparation-slot]:empty { display: none; }
@media (max-width: 600px) {
  body[data-route="faculty"] #facultyPreparationWorkflow > :is(.faculty-preparation-workflow__answers, .faculty-preparation-workflow__disclosure, [data-preparation-slot]) { grid-column: 1 / -1; }
  body[data-route="faculty"] #facultyPreparationWorkflow > [data-preparation-slot] { justify-content: flex-start; margin-top: 0; }
}

/* ---- Anki jobs (last section) with the deck queue inside ---- */
body[data-route="faculty"] .faculty-anki-jobs-host { display: contents; }
body[data-route="faculty"] .anki-background-jobs .anki-deck-queue {
  margin: 12px 0 0;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid var(--owen-border);
  border-radius: 0;
  background: none;
  box-shadow: none;
}

/* ---- Section artwork ---- */
/* Upload: the book is the nucleus of an atom, five science symbols orbit it on dotted paths. */
body[data-route="faculty"] #facultyBatchPreparation .faculty-preparation__heading {
  min-height: 120px;
  padding-inline-end: 184px;
  background: url('/ui/illustrations/faculty-upload-atom.svg') right center / 160px 120px no-repeat;
}
@media (max-width: 600px) {
  body[data-route="faculty"] #facultyBatchPreparation .faculty-preparation__heading { min-height: 84px; padding-inline-end: 124px; background-size: 112px 84px; }
}
/* Dropbox lectures: a flat cardboard office box beside the heading (the Workflow console uses the same 44px icon size). */
body[data-route="faculty"] #facultyDropbox .faculty-preparation__heading h2 { display: flex; align-items: center; gap: 12px; }
body[data-route="faculty"] #facultyDropbox .faculty-preparation__heading h2::before {
  content: "";
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  background: url('/ui/illustrations/dropbox-box.svg') center / contain no-repeat;
}

/* ---- OWEN wordmark: the landing page's letter colours ---- */
body[data-route="faculty"] .faculty-wordmark__letter--o { color: var(--kz-yellow, #ffd166); }
body[data-route="faculty"] .faculty-wordmark__letter--w { color: var(--kz-pink, #ff5c8a); }
body[data-route="faculty"] .faculty-wordmark__letter--e { color: var(--kz-cyan, #42c9e8); }
body[data-route="faculty"] .faculty-wordmark__letter--n { color: var(--kz-orange, #ff9f43); }

/* ---- Theme toggle: the student header's illustrated bulb and moon instead of the line icons ---- */
body[data-route="faculty"] [data-role="faculty-theme-toggle"] > svg { display: none; }
body[data-route="faculty"] [data-role="faculty-theme-toggle"]::before {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  flex: none;
  background: url('/ui/illustrations/chat-bulb.svg') center / contain no-repeat;
}
body[data-route="faculty"].theme-dark [data-role="faculty-theme-toggle"]::before { background-image: url('/ui/illustrations/chat-moon.svg'); }
