/* D2L Grading Packet, web app. Starts from the Python app's App/index.html
   (04-Stable/Apps/D2L Grading Packet/), so the two look the same. */
@font-face { font-family: Lato; src: url("vendor/fonts/Lato-Regular.ttf") format("truetype"); font-weight: 400; }
@font-face { font-family: Lato; src: url("vendor/fonts/Lato-Bold.ttf") format("truetype"); font-weight: 700 900; }
@font-face { font-family: Lato; src: url("vendor/fonts/Lato-Italic.ttf") format("truetype"); font-style: italic; }
:root {
  --bg: #f1f1f3; --chrome: #f7f7f8; --card: #fff; --ink: #1f2430; --muted: #6e6e76; --line: #e3e3e6;
  --accent: #FBAE3D; --accent-h: #E89A2A; --accent-ink: #9a6400; --ok: #1d7a46; --ok-bg: #e8f5ee;
  --warn: #9a3b12; --warn-bg: #fdeee6; --sel: #fff7e8; --soft: #fafafb; --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 Lato, system-ui, -apple-system, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
/* The app's own elements are styled by class or id, never by element name:
   Word documents are laid out in #stage, and docx-preview draws a Word page
   header as <header> and Word tables as <table>, which a page-wide
   "header" or "table" rule would restyle (2026-10-24: the title bar's
   sticky gray band was drawn over a student's first line). */
.app-header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 10px 20px; background: var(--chrome); border-bottom: 1px solid var(--line); }
.mark { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-weight: 900; color: #141416; font-size: 15px; }
.app-header h1 { font-size: 17px; margin: 0; font-weight: 900; }
.app-header .private { margin-left: auto; font-size: 12px; color: var(--muted); }
#main { padding: 22px 26px 60px; max-width: 1180px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.card h2 { margin: 0 0 4px; font-size: 18px; }
.card h3 { margin: 16px 0 6px; font-size: 14px; }
.sub { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 13px; cursor: pointer; min-height: 34px; }
.btn:hover { border-color: #c9c9cf; }
.btn.primary { background: var(--accent); border-color: var(--accent); font-weight: 700; color: #141416; }
.btn.primary:hover { background: var(--accent-h); }
.btn.small { padding: 3px 9px; min-height: 28px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, .tab:focus-visible, .seg button:focus-visible, .file:focus-visible, .drop:focus-visible { outline: 2px solid var(--accent-h); outline-offset: 2px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.drop { border: 2px dashed #cfcfd5; border-radius: var(--radius); padding: 34px 20px; text-align: center; color: var(--muted); background: var(--soft); transition: .15s; }
.drop.over { border-color: var(--accent); background: var(--sel); color: var(--ink); }
.drop strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.linklike { color: var(--accent-ink); text-decoration: underline; cursor: pointer; }
.tabs { display: flex; gap: 4px; margin: 0 0 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab { border: 0; background: none; padding: 9px 14px; cursor: pointer; border-bottom: 3px solid transparent; font-weight: 700; color: var(--muted); }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.tab .n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #e7e7ea; font-size: 12px; margin-right: 6px; }
.tab.active .n { background: var(--accent); color: #141416; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 6px 12px; cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--sel); font-weight: 700; color: var(--accent-ink); }
.student { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; overflow: hidden; background: var(--card); }
.student.none { opacity: .6; }
.shead { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--soft); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.shead b { font-size: 15px; }
.shead .id { color: var(--muted); font-size: 12px; }
.shead .count { margin-left: auto; font-size: 12px; color: var(--muted); }
.file { display: grid; grid-template-columns: 22px 170px 1fr auto; gap: 10px; align-items: center; padding: 6px 12px; border-top: 1px solid #f1f1f3; cursor: pointer; }
.file:first-of-type { border-top: 0; }
.file.sel { background: var(--sel); }
.file .date { font-size: 13px; color: var(--muted); white-space: nowrap; }
.file .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 99px; background: #efeff2; color: var(--muted); white-space: nowrap; }
.tag.dup { background: var(--warn-bg); color: var(--warn); }
input[type=date] { border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; background: #fff; }
.note { border-radius: 8px; padding: 10px 12px; margin: 10px 0; font-size: 14px; }
.note.ok { background: var(--ok-bg); color: #14532d; }
.note.warn { background: var(--warn-bg); color: #6b2a0c; }
.note.info { background: #eef2fb; color: #23365e; }
.card table { border-collapse: collapse; width: 100%; font-size: 14px; }
.card th, .card td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #f0f0f2; vertical-align: top; }
.card th { font-size: 12px; color: var(--muted); font-weight: 700; }
.card td { overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.list { display: flex; flex-direction: column; gap: 6px; }
.dl { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; flex-wrap: wrap; }
.dl small { color: var(--muted); }
ol.steps { margin: 6px 0 0 18px; padding: 0; }
ol.steps li { margin: 3px 0; }
.hidden { display: none !important; }
.empty { color: var(--muted); text-align: center; padding: 40px; }
progress { width: 100%; height: 8px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
label.f { display: block; margin: 10px 0 3px; font-size: 13px; font-weight: 700; }
label.f span { font-weight: 400; color: var(--muted); }
input[type=text], input[type=number], select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; background: #fff; }
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #f7cf8c; border-color: var(--accent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.preview { position: sticky; top: 70px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); padding: 10px; }
.preview canvas { width: 100%; height: auto; display: block; border: 1px solid var(--line); background: #fff; border-radius: 4px; }
.preview p { margin: 6px 2px 0; font-size: 12px; color: var(--muted); }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } .preview { position: static; } }
/* A hidden file picker shows its focus on the label around it. */
label:has(> input.sr:focus-visible) { outline: 2px solid var(--accent-h); outline-offset: 2px; border-radius: 4px; }
details.how summary { cursor: pointer; font-weight: 700; font-size: 16px; }
details.how h3 { margin: 14px 0 4px; font-size: 14px; }
details.how p, details.how li { font-size: 14px; }
details.how ol, details.how ul { margin: 6px 0 0 20px; padding: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 720px) {
  #main { padding: 16px 16px 48px; }
  .file { grid-template-columns: 22px 1fr; }
  .file .date, .file .tags { grid-column: 2; }
}

/* Where Word documents are laid out, off screen, while renderer A draws them.
   It starts from Word's defaults instead of this page's: docx-preview sets
   the fonts and spacing a document names, and anything it leaves unset would
   otherwise be inherited from the page (Lato, 15 px, line height 1.45). */
#stage { position: absolute; left: -20000px; top: 0; width: 1000px; background: #fff;
  color: #000; font: 12pt/normal "Times New Roman", Times, serif; text-align: left; }

/* ---- Grade tab (grade.js): a focus view. The header and step tabs fold away,
   the student list slides out over the pages, and the draft takes the width. ---- */
body.wide #main { max-width: none; padding-bottom: 12px; }
body.grading .app-header, body.grading #main > .row:first-child, body.grading .tabs { display: none; }
body.grading #main { padding: 8px 8px 8px; }
.gw { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); min-height: 420px; }
.gw-list { position: absolute; left: 0; top: 0; bottom: 0; width: 270px; max-width: 85%; z-index: 8; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow-y: auto; box-shadow: 0 8px 28px rgba(0,0,0,.18); transform: translateX(-110%); transition: transform .18s ease; visibility: hidden; }
.gw.list-open .gw-list { transform: none; visibility: visible; }
@media (prefers-reduced-motion: reduce) { .gw-list { transition: none; } }
.gw-list ol { list-style: none; margin: 0; padding: 6px; }
.gw-st { display: block; width: 100%; text-align: left; border: 0; background: none; border-radius: 8px; padding: 7px 10px; cursor: pointer; }
.gw-st:hover { background: var(--soft); }
.gw-st[aria-current="true"] { background: var(--sel); box-shadow: inset 3px 0 0 var(--accent); }
.gw-st:focus-visible { outline: 2px solid var(--accent-h); outline-offset: -2px; }
.gw-name { display: block; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gw-meta { font-size: 12px; color: var(--muted); }
.gw-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid #9a9aa2; margin-right: 5px; vertical-align: 0; }
.gw-st[data-status="progress"] .gw-dot { border-color: var(--accent-h); background: linear-gradient(90deg, var(--accent-h) 50%, transparent 50%); }
.gw-st[data-status="done"] .gw-dot { border-color: var(--ok); background: var(--ok); }
.gw-main { display: flex; flex-direction: column; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gw-bar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: var(--chrome); }
.gw-pageinfo { font-size: 13px; white-space: nowrap; }
.gw-spacer { flex: 1; }
.gw-done { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; cursor: pointer; }
.gw-done input { width: 18px; height: 18px; accent-color: var(--ok); }
.gw-zoom { display: inline-flex; gap: 2px; }
.gw-zoom .btn { min-width: 34px; }
.gw-select { width: auto; max-width: 34ch; font-weight: 700; }
/* Pages scroll inside the workspace; a finger pans, and the pinch is the workspace's own zoom. */
.gw-scroll { flex: 1; overflow: auto; background: #e9e9ec; padding: 10px; touch-action: pan-x pan-y; overscroll-behavior: contain; }
.gw-scroll:focus-visible { outline: 2px solid var(--accent-h); outline-offset: -2px; }
.gw-page { position: relative; margin: 0 auto 12px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.gw-page canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gw-err { position: absolute; top: 40%; width: 100%; text-align: center; color: var(--muted); }
@media (max-width: 760px) {
  .gw-select { max-width: 46vw; }
  .gw-scroll { padding: 6px; }
}

/* ---- marks on the Grade tab (ink.js) ---- */
.gw-bar2 { padding-top: 6px; padding-bottom: 6px; background: var(--card); }
.gw-tools { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.gw-tools + .gw-tools { margin-left: 8px; padding-left: 10px; border-left: 1px solid var(--line); }
.gw-tool.on { background: var(--sel); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.gw-colors { display: inline-flex; gap: 3px; margin: 0 4px 0 2px; }
.gw-color { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: var(--sw); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.gw-color.on { box-shadow: 0 0 0 2px var(--ink); }
.gw-color:focus-visible, .gw-tool:focus-visible { outline: 2px solid var(--accent-h); outline-offset: 2px; }
.gw-saved { font-size: 12px; }
/* The ink sits over the page and multiplies with it, so a highlight never hides the words. */
.gw-page canvas.gw-ink { mix-blend-mode: multiply; pointer-events: none; }
.gw-scroll[data-tool="pen"] .gw-page, .gw-scroll[data-tool="hl"] .gw-page { cursor: crosshair; }
.gw-scroll[data-tool="erase"] .gw-page { cursor: cell; }
.gw-scroll[data-tool="comment"] .gw-page { cursor: copy; }
.gw-notes { position: absolute; inset: 0; pointer-events: none; }
.gw-note { position: absolute; pointer-events: auto; background: #fffbea; border: 1px solid #e8c766; border-radius: 6px; padding: .35em .5em .35em 1.9em;
  box-shadow: 0 1px 3px rgba(0,0,0,.12); line-height: 1.3; z-index: 2; }
.gw-note-n { position: absolute; left: .35em; top: .35em; width: 1.3em; height: 1.3em; border-radius: 50%; border: 0; background: #c62828; color: #fff;
  font: 700 .8em/1.3em Lato, sans-serif; padding: 0; cursor: grab; touch-action: none; }
.gw-note textarea { display: block; width: 100%; border: 0; background: transparent; padding: 0; margin: 0; resize: none; min-height: 1.3em;
  font: inherit; line-height: 1.3; color: #1f2430; overflow: hidden; outline: none; }
.gw-note:focus-within { border-color: var(--accent-h); box-shadow: 0 0 0 2px #f7cf8c; }
.gw-note-tools { display: none; gap: 4px; justify-content: flex-end; margin-top: .25em; }
.gw-note:focus-within .gw-note-tools, .gw-note:hover .gw-note-tools { display: flex; }
.gw-note-tools button { border: 1px solid var(--line); background: #fff; border-radius: 5px; font-size: 11px; padding: 1px 6px; cursor: pointer; }
.gw-snips { position: absolute; left: 0; top: 100%; margin-top: 4px; width: 320px; max-width: 80vw; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.18); padding: 8px; z-index: 5; font-size: 13px; }
.gw-snips input { margin-bottom: 6px; }
.gw-snips ul { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow-y: auto; }
.gw-snips li { padding: 5px 7px; border-radius: 6px; cursor: pointer; }
.gw-snips li[aria-selected="true"] { background: var(--sel); }
.gw-snips li b { display: block; }
.gw-snips li span { color: var(--muted); font-size: 12px; }
.gw-snips li.none { color: var(--muted); cursor: default; }
.gw-snips p { margin: 0; }
