/* Teacher workbench (the Class view). Plain flow layout with one sheet layer:
   nothing floats except the sheets, which share the modal layer. */
.nh-wb{ max-width:1240px; margin:0 auto; padding:24px 24px 80px; }
.nh-wb-head{ display:flex; align-items:flex-end; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:18px; }
.nh-wb-head h1{ font:600 clamp(24px,3.4vw,32px)/1.15 var(--font-display,'Montserrat',sans-serif); color:var(--ink); margin:0; letter-spacing:-0.01em; }
.nh-wb-head p{ font-size:13.5px; color:var(--sepia); margin:4px 0 0; }
.nh-wb-actions{ display:flex; gap:10px; flex-wrap:wrap; }
.nh-btn{ all:unset; cursor:pointer; box-sizing:border-box; min-height:44px; padding:0 18px; display:inline-flex; align-items:center; justify-content:center; gap:6px; border-radius:var(--radius-md); font:600 14px/1 'Montserrat',sans-serif; color:var(--ink); border:1.5px solid var(--rule-strong); background:var(--ivory); }
.nh-btn:hover{ border-color:var(--red-accent); }
.nh-btn:focus-visible, .nh-chip-btn:focus-visible, .nh-wb-class:focus-visible, .nh-wb-row:focus-visible{ outline:2px solid var(--red-accent); outline-offset:2px; }
.nh-btn-primary{ background:var(--red); color:#FBF7EC; border-color:var(--red); }
.nh-btn-primary:hover{ background:var(--red-deep); border-color:var(--red-deep); }
.nh-btn[disabled]{ opacity:.5; cursor:not-allowed; }
.nh-btn-quiet{ border-color:transparent; background:none; color:var(--sepia); }
.nh-wb-switch{ display:inline-flex; border:1.5px solid var(--rule); border-radius:999px; padding:3px; gap:2px; margin-bottom:16px; }
.nh-wb-switch button{ all:unset; cursor:pointer; box-sizing:border-box; min-height:40px; padding:0 20px; border-radius:999px; font:600 13.5px/1 'Montserrat',sans-serif; color:var(--ink-soft); display:flex; align-items:center; }
.nh-wb-switch button.on{ background:var(--ink); color:var(--paper); }
.nh-wb-body{ display:grid; grid-template-columns:230px 1fr; gap:24px; align-items:start; }
.nh-wb-classes{ display:flex; flex-direction:column; gap:4px; }
.nh-wb-class{ all:unset; cursor:pointer; box-sizing:border-box; min-height:44px; padding:0 14px; border-radius:var(--radius-md); display:flex; align-items:center; justify-content:space-between; gap:8px; font:600 13.5px/1.2 'Montserrat',sans-serif; color:var(--ink); }
.nh-wb-class:hover{ background:var(--paper-light); }
.nh-wb-class.on{ background:var(--ivory); box-shadow:inset 3px 0 0 var(--red-accent); border:1px solid var(--rule); }
.nh-wb-class small{ font-weight:600; color:var(--sepia); font-size:12px; }
.nh-wb-classpick{ display:none; }
.nh-wb-main{ min-width:0; background:var(--ivory); border:1px solid var(--rule); border-radius:var(--radius-lg); padding:6px 0; }
.nh-wb-tools{ display:flex; gap:10px; align-items:center; padding:12px 16px; border-bottom:1px solid var(--rule); flex-wrap:wrap; }
.nh-input{ box-sizing:border-box; min-height:44px; border:1.5px solid var(--rule); border-radius:var(--radius-md); padding:0 12px; font:500 14px/1.2 'Montserrat',sans-serif; color:var(--ink); background:var(--paper-light); }
textarea.nh-input{ padding:10px 12px; min-height:96px; line-height:1.5; width:100%; resize:vertical; }
.nh-wb-row{ all:unset; cursor:pointer; box-sizing:border-box; width:100%; display:grid; grid-template-columns:minmax(0,1.6fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr); gap:12px; align-items:center; min-height:56px; padding:8px 16px; border-top:1px solid var(--rule); }
.nh-wb-row:first-of-type{ border-top:none; }
.nh-wb-row:hover{ background:var(--paper-light); }
.nh-wb-hrow{ display:grid; grid-template-columns:minmax(0,1.6fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr); gap:12px; padding:10px 16px 6px; font:700 10.5px/1 'Montserrat',sans-serif; letter-spacing:.08em; text-transform:uppercase; color:var(--sepia); }
.nh-wb-name{ font:600 14px/1.3 'Montserrat',sans-serif; color:var(--ink); overflow:hidden; text-overflow:ellipsis; }
.nh-wb-sub{ font-size:12px; color:var(--sepia); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.nh-wb-cell{ font-size:13px; color:var(--ink-soft); }
.nh-pill{ display:inline-flex; align-items:center; padding:3px 10px; border-radius:999px; font:700 11.5px/1.4 'Montserrat',sans-serif; background:var(--paper-light); color:var(--ink-soft); border:1px solid var(--rule); }
.nh-pill.ok{ background:var(--success-soft); color:var(--success-ink); border-color:transparent; }
.nh-pill.warn{ background:#F8D7D3; color:#8A1F17; border-color:#E4A59F; }
[data-theme="dark"] .nh-pill.warn{ background:#3A211C; color:#F2B8B0; border-color:#7A3A32; }
.nh-wb-empty{ padding:36px 20px; text-align:center; color:var(--sepia); font-size:14px; line-height:1.6; }
.nh-sheet-wrap{ position:fixed; inset:0; z-index:var(--z-modal); background:rgba(7,9,14,.55); display:flex; justify-content:flex-end; overflow:hidden; }
.nh-sheet-wrap.center{ justify-content:center; align-items:center; padding:24px; }
.nh-sheet{ background:var(--paper); color:var(--ink); width:min(520px,100%); height:100%; overflow-y:auto; padding:22px 22px 28px; box-sizing:border-box; display:flex; flex-direction:column; gap:14px; border-left:1px solid var(--rule); }
.nh-sheet.wide{ width:min(640px,100%); }
.nh-sheet-wrap.center .nh-sheet{ height:auto; max-height:100%; border-radius:var(--radius-lg); border:1px solid var(--rule); }
.nh-sheet h2{ font:600 22px/1.2 var(--font-display,'Montserrat',sans-serif); margin:0; color:var(--ink); }
.nh-sheet-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.nh-label{ font:700 11px/1 'Montserrat',sans-serif; letter-spacing:.1em; text-transform:uppercase; color:var(--sepia); margin-bottom:6px; display:block; }
.nh-chips{ display:flex; flex-wrap:wrap; gap:8px; }
.nh-chip-btn{ all:unset; cursor:pointer; box-sizing:border-box; min-height:40px; padding:0 14px; border-radius:999px; border:1.5px solid var(--rule-strong); font:600 13px/1 'Montserrat',sans-serif; color:var(--ink); display:inline-flex; align-items:center; background:var(--ivory); }
.nh-chip-btn.on{ background:var(--ink); color:var(--paper); border-color:var(--ink); }
.nh-targets{ max-height:180px; overflow-y:auto; border:1.5px solid var(--rule); border-radius:var(--radius-md); background:var(--ivory); }
.nh-target{ all:unset; cursor:pointer; box-sizing:border-box; width:100%; min-height:44px; padding:0 14px; display:flex; align-items:center; gap:10px; font:500 14px/1.2 'Montserrat',sans-serif; color:var(--ink); border-top:1px solid var(--rule); }
.nh-target:first-child{ border-top:none; }
.nh-target.on{ background:var(--paper-light); font-weight:700; }
.nh-target .box{ width:18px; height:18px; border-radius:4px; border:1.5px solid var(--rule-strong); display:inline-flex; align-items:center; justify-content:center; font-size:12px; flex:0 0 18px; }
.nh-target.on .box{ background:var(--red); border-color:var(--red); color:#FBF7EC; }
.nh-msg{ font-size:13px; padding:10px 12px; border-radius:var(--radius-md); background:var(--paper-light); color:var(--ink-soft); }
.nh-msg.err{ background:var(--red-soft); color:var(--red-ink); }
.nh-msg.ok{ background:var(--success-soft); color:var(--success-ink); }
.nh-work-row{ padding:14px 16px; border-top:1px solid var(--rule); display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.nh-work-row:first-child{ border-top:none; }
@media (max-width:720px){
  .nh-wb{ padding:16px 16px 64px; }
  .nh-wb-body{ grid-template-columns:1fr; gap:14px; }
  .nh-wb-classes{ display:none; }
  .nh-wb-classpick{ display:block; width:100%; }
  .nh-wb-row, .nh-wb-hrow{ grid-template-columns:minmax(0,1fr) auto; }
  .nh-wb-row .nh-wb-extra, .nh-wb-hrow .nh-wb-extra{ display:none; }
  .nh-wb-actions .nh-btn{ flex:1 1 auto; }
  .nh-sheet{ width:100%; border-left:none; }
}
@media (prefers-reduced-motion: reduce){ .nh-wb-row, .nh-btn{ transition:none; } }

/* "Assigned to you": a short list on the learner's Learn and Tools homes. */
.nh-mywork{ background:var(--ivory); border:1px solid var(--rule); border-radius:var(--radius-lg); padding:14px 16px 10px; margin-bottom:20px; }
.nh-mywork .nh-label{ margin-bottom:2px; }

/* The round "this is the right answer" button in the quiz editor. */
.nh-chip-btn.nh-mark{ width:40px; height:40px; padding:0; border-radius:50%; justify-content:center; flex:0 0 40px; }
/* File pickers follow the theme instead of the browser's white button. */
input[type=file].nh-input::file-selector-button{ all:unset; cursor:pointer; box-sizing:border-box; min-height:32px; padding:0 12px; margin-right:12px; border-radius:var(--radius-sm); background:var(--ink); color:var(--paper); font:600 13px/32px 'Montserrat',sans-serif; }
input[type=file].nh-input{ display:flex; align-items:center; width:100%; max-width:100%; min-width:0; overflow:hidden; padding:6px 10px; color:var(--sepia); font-size:13px; }

/* Assigned rows keep their title readable on phones: the pill and button wrap
   underneath instead of squeezing it. */
.nh-work-row > span:first-child{ flex:1 1 200px; }
.nh-mywork .nh-work-row{ padding-left:0; padding-right:0; }
.nh-mywork .nh-label{ margin-bottom:8px; }
/* Primary actions stay reachable at the bottom of a long sheet. */
.nh-sheet .nh-sticky{ position:sticky; bottom:-28px; background:var(--paper); padding:10px 0; z-index:1; }
.nh-sheet .nh-btn-primary.nh-sticky{ box-shadow:0 0 0 10px var(--paper); }
/* Inline styles on the title span would otherwise win: on phones the title gets
   the whole row and the pill and button wrap onto the next line. */
.nh-mywork .nh-work-row > span:first-child{ flex:1 1 100% !important; min-width:0; }
@media (min-width:721px){ .nh-mywork .nh-work-row > span:first-child{ flex:1 1 260px !important; } }
