@font-face { font-family: Lato; src: url("fonts/Lato-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; }
@font-face { font-family: Lato; src: url("fonts/Lato-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; }
@font-face { font-family: Lato; src: url("fonts/Lato-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; }
@font-face { font-family: Lato; src: url("fonts/Lato-Black.woff2") format("woff2"); font-weight: 900; font-style: normal; }

/* The Open Workshop colours of Pocket Grader and the Grading Packet
   (03-Active/Pocket Grader/Outputs/Open Workshop Reskin Design Brief.md): the green cutting mat,
   warm-white cards, gold for the one action that matters, and never white text on gold. */
:root {
  --mat: #173F33; --deep: #0F2D25; --gold: #EDBD4F; --soft-gold: #F7DF9E;
  --card: #FFFDF8; --ink: #1A2923; --muted: #5C6963; --soft: #EDF2EF; --line: rgba(23, 63, 51, 0.22);
  --field: #ffffff; --field-line: rgba(23, 63, 51, 0.32); --grid: rgba(255, 255, 255, 0.045);
  --on-mat: #F7F8F4; --on-mat-muted: #C9D8D0;
  --danger: #A12C1F; --warn: #7A5300; --ok: #1F6B3A;
  --problem-bg: #F8E6E2; --suggest-bg: #FBF0D5; --fine-bg: #E3F1E7;
  --shadow: 0 4px 14px rgba(15, 45, 37, 0.14);
  --round: ui-rounded, "SF Pro Rounded", Lato, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --mat: #0F2D25; --deep: #091E19; --card: #182C25; --ink: #F7F8F4; --muted: #BDC8C2; --soft: #213C33;
    --line: rgba(255, 255, 255, 0.18); --field: #10241E; --field-line: rgba(255, 255, 255, 0.28); --grid: rgba(255, 255, 255, 0.06);
    --danger: #F2A08F; --warn: #F2CE7A; --ok: #8FD3A5;
    --problem-bg: #3A2320; --suggest-bg: #3A3220; --fine-bg: #1D3A2A;
    --shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  background-color: var(--mat);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  min-height: 100%;
}
body { margin: 0; color: var(--ink); font-family: Lato, system-ui, sans-serif; font-size: 16px; line-height: 1.5; }
h1, h2, h3 { line-height: 1.2; margin: 0; font-family: var(--round); }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; margin: 28px 0 10px; }
p { margin: 0 0 10px; }
.sr-only { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.hint { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.card { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }

.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 24px 4px; color: var(--on-mat); }
.brand { display: flex; align-items: center; gap: 12px; }
.mark { width: 42px; height: 42px; border-radius: 12px; background: var(--card); border: 2px dashed var(--gold); display: grid; place-items: center; flex: 0 0 auto; }
.mark svg { width: 24px; height: 24px; fill: none; stroke: #173F33; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.bar h1 { font-size: 24px; font-weight: 700; }
.tagline { display: block; color: var(--on-mat-muted); font-size: 14px; margin-top: 2px; }
.bar-actions, .row-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.btn { font: inherit; font-family: var(--round); font-size: 15px; font-weight: 700; min-height: 44px; padding: 8px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--soft); color: var(--ink); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { filter: brightness(0.97); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible, .linkish:focus-visible, .menu-list button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #0F2D25; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink); }
.btn.small { min-height: 40px; font-size: 14px; padding: 6px 14px; }
.btn.wide { width: 100%; }
.btn.big { width: 100%; min-height: 54px; font-size: 18px; }
.btn.icon { min-width: 44px; padding: 8px 10px; }
.btn.danger, .danger { color: var(--danger); }
.btn[disabled] { opacity: 0.45; cursor: default; }
.bar .btn { background: var(--card); }
.linkish { font: inherit; background: none; border: 0; padding: 4px; color: inherit; text-decoration: underline; cursor: pointer; }

.shared { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 16px 24px 0; padding: 14px 18px; }
.shared p { margin: 0; }

.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr) minmax(360px, 440px); gap: 20px; padding: 20px 24px 32px; align-items: start; }
.library, .editor, .preview { padding: 20px; }
.library { position: sticky; top: 16px; }
.library h2 { margin-bottom: 12px; }
#libList { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
#libList button { width: 100%; text-align: left; font: inherit; color: var(--ink); padding: 10px 12px; border-radius: 12px; border: 1px solid transparent;
  background: transparent; cursor: pointer; min-height: 44px; }
#libList button:hover { background: var(--soft); }
#libList button[aria-current="true"] { background: var(--soft-gold); color: #1A2923; }
#libList button[aria-current="true"] .m { color: #3F4A45; }
#libList .t { display: block; font-weight: 700; }
#libList .m { display: block; font-size: 13px; color: var(--muted); }
.examples { display: flex; flex-direction: column; gap: 8px; margin: 18px 0; }
.examples h3 { margin: 0 0 4px; font-size: 15px; }
.examples .btn { justify-content: flex-start; text-align: left; border-radius: 12px; }

.empty h2 { margin-bottom: 12px; }
.field { margin: 0 0 18px; border: 0; padding: 0; }
.field label, legend { display: block; font-weight: 700; margin-bottom: 6px; }
input[type="text"], input[type="number"], textarea, select { width: 100%; font: inherit; color: var(--ink); background: var(--field);
  border: 1px solid var(--field-line); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
textarea { resize: vertical; line-height: 1.45; }
input[type="number"] { width: 90px; }
.inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.inline label { font-weight: 700; }
.inline input[type="text"] { width: 160px; }
.check { display: flex !important; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; }
.check input { width: 20px; height: 20px; accent-color: var(--mat); }
.segmented { display: inline-flex; flex-wrap: wrap; border-radius: 999px; padding: 3px; gap: 3px; background: var(--soft); }
.segmented label { display: flex; align-items: center; gap: 6px; margin: 0; padding: 8px 16px; border-radius: 999px; cursor: pointer; min-height: 40px; font-weight: 700; font-family: var(--round); color: var(--muted); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.segmented label:has(input:focus-visible) { outline: 3px solid var(--gold); }

.criteria { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.crit { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--field); }
.crit-head { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.crit-head .field { margin: 0; flex: 1 1 220px; }
.crit-head .pts { flex: 0 0 auto; }
.crit-head .pts input { width: 100px; }
.crit-tools { display: flex; gap: 6px; }
.crit .field:last-child { margin-bottom: 0; }
.crit .lab-needs::before { content: "🛠️" / ""; margin-right: 6px; }
.crit .lab-met::before { content: "✅" / ""; margin-right: 6px; }
.levels { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.levels .lv-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.levels .lv-head label { font-weight: 700; }
.levels select { width: auto; min-width: 150px; }
.lv-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.lv { display: grid; grid-template-columns: minmax(0, 1fr) 100px auto; gap: 8px; align-items: end; }
.lv .field { margin: 0; }
.lv .lv-text { grid-column: 1 / -1; }
.lv label { font-size: 14px; }
.letters { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.letters li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.letters input[type="text"] { width: 80px; }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; margin-top: 12px; }
details summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }

.checks ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.checks li { padding: 8px 12px; border-radius: 10px; font-size: 15px; }
.checks li.problem { background: var(--problem-bg); color: var(--danger); }
.checks li.suggestion { background: var(--suggest-bg); color: var(--warn); }
.checks li.fine { background: var(--fine-bg); color: var(--ok); }
.out { border-top: 1px solid var(--line); margin-top: 26px; padding-top: 18px; }
.status { min-height: 1.5em; margin: 10px 0 0; font-weight: 700; color: var(--ok); }

.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: "▾" / ""; font-size: 12px; }
.menu-list { position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 5; min-width: 220px; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; }
.menu-list button { font: inherit; text-align: left; background: none; border: 0; border-radius: 10px; padding: 10px 12px; min-height: 44px; color: var(--ink); cursor: pointer; }
.menu-list button:hover { background: var(--soft); }
.menu-list button.danger { color: var(--danger); }

.preview { position: sticky; top: 16px; }
.preview h2 { margin-bottom: 6px; }
.marks { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 4px; }
.mark-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mark-row span { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mark-row select { width: auto; min-width: 150px; }
.mark-row input[type="number"] { width: 90px; }
.page-wrap { margin-top: 16px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; position: relative; }
.page-wrap iframe { border: 0; width: 816px; height: 1056px; transform-origin: 0 0; display: block; }

/* Send to iPhone or iPad */
dialog.send { max-width: 560px; width: calc(100% - 32px); padding: 26px 28px; }
dialog.send::backdrop { background: rgba(9, 30, 25, 0.6); }
dialog.send h2 { font-size: 22px; margin-bottom: 6px; }
.steps { margin: 14px 0 18px; padding-left: 22px; }
.steps li { margin-bottom: 8px; }
.push { margin-left: auto; }
.fine { color: var(--muted); font-size: 13px; margin: 14px 0 0; border-top: 1px solid var(--line); padding-top: 12px; }

/* A rubric opened on an iPhone or iPad */
.receive { max-width: 460px; margin: 0 auto; padding: 12px 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.rc { position: relative; padding: 22px 20px 12px; }
.rc h2 { font-size: 24px; margin-bottom: 4px; }
.tape { position: absolute; top: -9px; left: 28px; width: 84px; height: 20px; background: var(--soft-gold); transform: rotate(-2deg); }
.rc-list { list-style: none; margin: 10px 0 0; padding: 0; }
.rc-list li { padding: 11px 0; border-top: 1px solid var(--line); font-size: 16px; }
.rc-note { color: var(--on-mat-muted); text-align: center; font-size: 15px; margin: 0; }

@media (max-width: 1180px) {
  .layout { grid-template-columns: 240px minmax(0, 1fr); }
  .preview { grid-column: 1 / -1; position: static; }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 16px; }
  .library { position: static; }
  .bar { padding: 14px 16px 0; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .lv { grid-template-columns: minmax(0, 1fr) 90px; }
  .lv .lv-remove { grid-column: 1 / -1; justify-self: start; }
  .shared { margin: 12px 16px 0; }
}
