/* ── add-work-class.css — Add Work for the Class (teacher/add-work-class.js) ── */

/* Over the Assignments page and the Work Wall (3800), under the grader (3900). */
.awc-overlay {
  position: fixed;
  inset: 0;
  z-index: 3850;
  background: var(--bg);
  padding: 24px;
  box-sizing: border-box;
  display: flex;
}
.awc-page {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 12px;
  box-shadow:
    0 0 0 1px var(--divider-subtle),
    0 8px 28px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.awc-gap {
  flex: 1;
}

/* ── The bar ── */
.awc-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  box-shadow: inset 0 -0.5px 0 var(--divider-heavy);
}
.awc-back {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 16px;
  border: 0;
  background: var(--seg-track);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}
.awc-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.awc-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}
.awc-sub {
  font-size: 12px;
  color: var(--text-3);
}
.awc-note {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  min-width: 0;
}
.awc-note:empty {
  display: none;
}
.awc-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
.awc-seg {
  display: flex;
  padding: 2px;
  border-radius: 9px;
  background: var(--seg-track);
}
.awc-seg-btn {
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.awc-seg-btn.is-on {
  background: var(--seg-thumb);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.awc-cancel,
.awc-primary {
  height: 34px;
  padding: 0 16px;
  border-radius: 17px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.awc-cancel {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.awc-primary {
  border: 0;
  background: var(--active-fill);
  color: #fff;
}
.awc-overlay button:disabled {
  opacity: 0.45;
  cursor: default;
}
.awc-overlay button:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 2px;
}

/* ── The scroll and the foot ── */
.awc-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.awc-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 16px;
  background: var(--bg);
  box-shadow: inset 0 0.5px 0 var(--divider-heavy);
  font-size: 13px;
}
.awc-count {
  font-weight: 600;
}
.awc-hint {
  color: var(--text-3);
}

/* ── The body: the tray beside the students (Column) or above them (Grid) ── */
.awc-body {
  flex: 1;
  min-height: 0;
  display: flex;
}
.awc-body > .awc-scroll {
  min-width: 0;
}

/* ── The tray (teacher/add-work-tray.js) ── */
.awt-tray {
  width: 340px;
  flex: none;
  box-sizing: border-box;
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: inset -0.5px 0 0 var(--divider-heavy);
}
.awt-drop {
  box-sizing: border-box;
  border: 2px dashed var(--border-2);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px 12px;
  text-align: center;
}
.awt-drop.is-over {
  border-color: var(--active);
  background: var(--active-light);
  color: var(--link);
}
.awt-drop-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.awt-drop-hint {
  font-size: 12px;
}
.awt-pick {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}
.awt-pick-btn {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  color: var(--link);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.awt-status {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
.awt-status:empty {
  display: none;
}
.awt-wait {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.awt-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.awt-title {
  flex: 1;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}
.awt-count,
.awt-hint,
.awt-empty {
  font-size: 12px;
  color: var(--text-3);
}
.awt-hint,
.awt-empty {
  margin: -4px 0 0;
}
.awt-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.awt-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--divider-medium);
  cursor: grab;
  min-width: 0;
}
.awt-item.is-refused {
  cursor: default;
  background: var(--bg);
}
.awt-item.is-dragging {
  opacity: 0.5;
}
.awt-pic {
  width: 56px;
  height: 74px;
  flex: none;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
}
button.awt-pic {
  padding: 0;
  cursor: zoom-in;
}
.awt-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}
.awt-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.awt-file {
  font-size: 13px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.awt-file-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.awt-why {
  font-size: 12px;
  color: var(--text-2);
}
.awt-why.is-note {
  color: var(--danger);
  font-weight: 600;
}
.awt-ask {
  font-size: 13px;
  font-weight: 700;
}
.awt-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.awt-act {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.awt-act.is-main {
  border-color: var(--active-fill);
  background: var(--active-fill);
  color: #fff;
}
.awt-act.is-quiet {
  border-color: transparent;
  color: var(--link);
}
.awt-choose {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.awt-off {
  width: 24px;
  height: 24px;
  flex: none;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}
.awt-picker {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.awt-find {
  height: 30px;
  box-sizing: border-box;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.awt-find:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 1px;
}
.awt-options {
  list-style: none;
  margin: 0;
  padding: 2px;
  max-height: 180px;
  overflow: auto;
  border-radius: 7px;
  box-shadow: 0 0 0 1px var(--divider-medium);
}
.awt-option {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.awt-option:hover,
.awt-option:focus-visible {
  background: var(--active-light);
}
.awt-none {
  padding: 6px 8px;
  font-size: 12px;
  color: var(--text-3);
}
.awt-note {
  margin: auto 0 0;
  padding: 12px;
  border-radius: 10px;
  background: var(--bg);
  font-size: 12px;
  color: var(--text-2);
}

/* Grid: the tray is a strip above the cards. */
.awt-tray.is-strip {
  width: auto;
  overflow: visible;
  margin: 16px 16px 0;
  padding: 10px 12px;
  border-radius: 12px;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 0 0 1px var(--divider-medium);
}
.awt-tray.is-strip .awt-drop {
  width: 260px;
  flex: none;
  padding: 10px;
  gap: 4px;
}
.awt-tray.is-strip .awt-drop svg {
  display: none;
}
.awt-tray.is-strip .awt-drop-title {
  font-size: 13px;
}
.awt-tray.is-strip .awt-status {
  flex-basis: 100%;
  order: 3;
}
.awt-tray.is-strip .awt-wait {
  flex: 1;
  min-width: 240px;
}
.awt-tray.is-strip .awt-list {
  flex-direction: row;
  flex-wrap: wrap;
}
.awt-tray.is-strip .awt-item {
  width: 300px;
  box-sizing: border-box;
}

/* ── Column ── */
.awc-head,
.awc-row {
  display: grid;
  grid-template-columns: minmax(140px, 210px) minmax(0, 1fr) minmax(170px, 320px);
  gap: 16px;
  align-items: center;
  padding: 8px 16px;
}
.awc-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  box-shadow: inset 0 -0.5px 0 var(--divider-heavy);
}
.awc-row {
  min-height: 54px;
  box-sizing: border-box;
  box-shadow: inset 0 -0.5px 0 var(--divider-subtle);
}
.awc-row.is-over,
.awc-card.is-over {
  background: var(--active-light);
}
.awc-name {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.awc-work {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.awc-in {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  min-width: 0;
}
.awc-had {
  font-size: 13px;
  color: var(--text-3);
}

/* The drop space: also a button. */
.awc-drop {
  flex: 1;
  min-width: 160px;
  height: 38px;
  box-sizing: border-box;
  border: 2px dashed var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-3);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.awc-drop.is-more {
  flex: none;
  min-width: 0;
  height: 32px;
  padding: 0 12px;
}
.is-over .awc-drop {
  border-color: var(--active);
  background: var(--active-light);
  color: var(--link);
  font-weight: 700;
}
.awc-paper,
.awc-leave-in {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.awc-paper.is-on {
  border-color: var(--active);
  background: var(--active-light);
  color: var(--link);
}
.awc-paper-set {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--link);
}
.awc-reading {
  font-size: 13px;
  color: var(--text-3);
}
.awc-row-note,
.awc-warn {
  flex-basis: 100%;
  margin: 0;
  font-size: 12px;
  color: var(--text-2);
}
.awc-warn {
  color: var(--danger);
  font-weight: 600;
}

/* A file waiting: its first page, its name, its pages. */
.awc-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--active-light);
  box-shadow: 0 0 0 1px var(--divider-medium);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  cursor: grab;
}
.awc-chip.is-dragging {
  opacity: 0.5;
}
.awc-thumb {
  width: 26px;
  height: 34px;
  flex: none;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
}
.awc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.awc-file-name {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.awc-pages {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
}
.awc-move-wrap {
  position: relative;
  flex: none;
}
.awc-move {
  height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--link);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.awc-move-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  max-height: 260px;
  overflow: auto;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.awc-move-item {
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.awc-move-item:hover,
.awc-move-item:focus-visible {
  background: var(--active-light);
}
.awc-off {
  width: 22px;
  height: 22px;
  flex: none;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

/* A student with work in: what to do. */
.awc-choices {
  display: flex;
  flex-wrap: wrap;
  padding: 2px;
  border-radius: 8px;
  background: var(--seg-track);
}
.awc-choice {
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.awc-choice.is-on {
  background: var(--seg-thumb);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

/* ── Grid ── */
.awc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  padding: 16px;
}
.awc-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--divider-medium);
  min-width: 0;
}
.awc-card.is-over {
  box-shadow: 0 0 0 2px var(--active);
}
.awc-card-pic {
  height: 150px;
  margin: -10px -10px 0;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  background: var(--bg);
  border-bottom: 1px solid var(--divider-subtle);
}
.awc-card-pic img {
  width: 100%;
  display: block;
}
.awc-card .awc-drop {
  flex: 1 1 100%;
  height: 120px;
  min-width: 0;
}
.awc-card .awc-drop.is-more {
  height: 32px;
  flex: none;
}
.awc-card .awc-chip {
  width: 100%;
  height: auto;
  flex-wrap: wrap;
  gap: 2px 8px;
  padding: 6px 4px 4px 8px;
}
.awc-card .awc-file-name {
  flex: 1 1 100%;
  font-weight: 600;
}
.awc-card .awc-pages {
  flex: 1;
}
.awc-card .awc-choices {
  flex-direction: column;
  width: 100%;
}
.awc-card .awc-choice {
  text-align: left;
}
.awc-drop {
  padding: 0 10px;
}

/* ── After the run ── */
.awc-done {
  padding: 20px 24px;
}
.awc-done-title {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 700;
}
.awc-done-paper {
  margin: -8px 0 16px;
  font-size: 14px;
  color: var(--text-2);
}
.awc-done-sub {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
}
.awc-done-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 560px;
}
.awc-done-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  box-shadow: inset 0 -0.5px 0 var(--divider-subtle);
}
.awc-done-row .awc-name {
  flex: 1;
}

/* The Work Wall's Add Work (shared/work-wall.js), on the computer only. */
.ww-add-work {
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* ── Too narrow for the tray beside the students: it goes above them, and
   the two scroll as one. ── */
@media (max-width: 1000px) {
  .awc-body.is-column {
    flex-direction: column;
    overflow: auto;
  }
  .awc-body.is-column > .awc-scroll {
    flex: none;
    overflow: visible;
  }
  .awc-body.is-column .awt-tray {
    width: auto;
    overflow: visible;
    box-shadow: inset 0 -0.5px 0 var(--divider-heavy);
  }
  .awc-body.is-column .awt-note {
    margin-top: 0;
  }
  .awc-body.is-column .awt-list {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .awc-body.is-column .awt-item {
    flex: 1 1 280px;
  }
}

/* ── A narrow window: each student's row stacks. ── */
@media (max-width: 760px) {
  .awc-overlay {
    padding: 0;
  }
  .awc-page {
    border-radius: 0;
  }
  .awc-bar {
    padding: 10px 16px;
  }
  .awc-head {
    display: none;
  }
  .awc-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 12px 16px;
  }
  .awc-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    padding: 12px;
  }
  .awc-chip {
    flex-wrap: wrap;
    height: auto;
    padding: 4px;
  }
  .awt-tray.is-strip .awt-drop,
  .awt-tray.is-strip .awt-item {
    width: 100%;
  }
}

/* ── B6: one pile, two classes (teacher/add-work-two-classes.js) ── */
.awc-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.awc-two {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 10px 16px;
  box-shadow: inset 0 -0.5px 0 var(--divider-heavy);
  font-size: 13px;
}
.awc-two-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.awc-two-track {
  width: 34px;
  height: 20px;
  border-radius: 10px;
  background: var(--seg-track);
  position: relative;
  flex: none;
}
.awc-two-knob {
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s ease;
}
.awc-two-switch[aria-checked='true'] .awc-two-track {
  background: var(--active);
}
.awc-two-switch[aria-checked='true'] .awc-two-knob {
  transform: translateX(14px);
}
.awc-two-name {
  font-weight: 600;
}
.awc-two-pick select,
.awc-for select {
  font: inherit;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 2px 4px;
  max-width: 180px;
}
.awc-two-line {
  flex-basis: 100%;
  margin: 0;
  color: var(--text-3);
}
.awc-class-head {
  padding: 12px 16px 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  box-shadow: inset 0 -0.5px 0 var(--divider-heavy);
}
.awc-class-head.is-card {
  grid-column: 1 / -1;
  margin: 0;
  padding: 4px 0;
}
.awc-class-tag {
  font-size: 12px;
  color: var(--text-3);
}

/* ── B6: a late paper's assessment ── */
.awc-for {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-2);
}
.awc-chip.is-late {
  background: var(--bg);
}
.awc-late-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.awc-late-hint {
  margin: 0;
  width: 100%;
  font-size: 12px;
  color: var(--text-3);
}

@media (prefers-reduced-motion: reduce) {
  .awc-two-knob {
    transition: none;
  }
}
