:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #1d2733;
  --muted: #64748b;
  --line: #d7dde5;
  --accent: #2563eb;
  --accent-soft: #e8f0fe;
  --ok: #15803d;
  --err: #b91c1c;
  --warn: #b45309;
  --shape: #fbfbfd;
  --entity: #1e3a8a;
  --rel: #7c3aed;
  --weak: #0f766e;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
/* The browser hides [hidden] with `display: none`, but any author rule that
   sets `display` beats it - which silently turned every `el.hidden = true` on
   a flex banner or toolbar into a no-op (a student's name stayed on screen
   after leaving their work).  Say it once, with the weight to hold. */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  display: flex; flex-direction: column; font-size: 14px;
}

/* ---- top bar ---- */
#topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; letter-spacing: .2px; color: var(--accent); }
.project-controls { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.project-controls .spacer { flex: 1; }
.project-controls label { color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; }
select, input[type=text], textarea {
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px;
}
button {
  font: inherit; cursor: pointer; border-radius: 6px; padding: 5px 11px;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
}
button.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
button.ghost:hover { border-color: var(--accent); color: var(--accent); }
button.danger { color: var(--err); border-color: #f0c9c9; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.small { padding: 2px 8px; font-size: 12px; }

/* ---- tabs ---- */
#tabs { display: flex; gap: 2px; padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.tab {
  background: transparent; color: var(--muted); border: none; border-bottom: 2px solid transparent;
  border-radius: 0; padding: 10px 14px; font-weight: 600;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- staleness banner ---- */
#staleBanner {
  padding: 6px 16px; background: #fff7ed; color: var(--warn);
  border-bottom: 1px solid #fed7aa; font-size: 13px;
}
#staleBanner button { margin-left: 10px; }

#changeBanner {
  padding: 6px 16px; background: #eef2ff; color: #3730a3;
  border-bottom: 1px solid #c7d2fe; font-size: 13px;
}
#changeBanner button { margin-left: 10px; }
.presence-chip { align-self: center; font-size: 12px; color: var(--muted);
  background: #eef2f7; border: 1px solid var(--line); border-radius: 999px;
  padding: 2px 9px; white-space: nowrap; }

/* ---- main view ---- */
#view { flex: 1; overflow: auto; position: relative; }
.stage { padding: 16px 20px; max-width: 1200px; }
.stage h2 { margin: 0 0 4px; font-size: 18px; }
.stage .lede { color: var(--muted); margin: 0 0 16px; max-width: 70ch; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }

/* ---- ER editor ---- */
#erWrap { position: absolute; inset: 0; display: flex; overflow: hidden; }
#erCanvasCol { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#erToolbar { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
#erToolbar .hint { color: var(--muted); font-size: 12px; }
#erSvg { flex: 1; background:
  linear-gradient(90deg, rgba(0,0,0,.035) 1px, transparent 1px) 0 0 / 24px 24px,
  linear-gradient(rgba(0,0,0,.035) 1px, transparent 1px) 0 0 / 24px 24px, #fff;
  cursor: grab; user-select: none; }
#erSvg.panning { cursor: grabbing; }

.node { cursor: move; }
.node .shape { fill: var(--shape); stroke: var(--entity); stroke-width: 2; }
.node.weak .shape { stroke: var(--weak); }
.node.rel .shape { fill: #faf5ff; stroke: var(--rel); }
.node.sel .shape { stroke: var(--accent); filter: drop-shadow(0 0 0 2px var(--accent-soft)); }
.node .label { font-size: 13px; font-weight: 600; fill: var(--ink); text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.node.rel .label { font-weight: 600; }

.edge { stroke: #94a3b8; stroke-width: 1.5; fill: none; }
.edge.total { stroke-width: 1.5; }
.edge-card { font-size: 11px; fill: var(--muted); font-weight: 600; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.spec-tri { fill: #eef2ff; stroke: var(--rel); stroke-width: 1.5; }
.spec-letter { font-size: 11px; font-weight: 700; fill: var(--rel); text-anchor: middle; dominant-baseline: middle; }

.attr { cursor: move; }
.attr:hover .attr-ellipse { stroke: var(--accent); }

/* teammate cursors */
.peers { pointer-events: none; }
.peer-outline { fill: none; stroke-width: 2; stroke-dasharray: 5 3; opacity: .9; }
.peer-cursor { stroke: #fff; stroke-width: 1.2; paint-order: stroke; }
.peer-pill { }
.peer-name { fill: #fff; font-size: 10px; font-weight: 600; dominant-baseline: middle; }
.attr-ellipse { fill: #fff; stroke: #9aa7b6; stroke-width: 1.2; }
.attr-ellipse.mv { stroke-width: 1.2; }
.attr-ellipse.derived { stroke-dasharray: 4 3; }
.attr-line { stroke: #b8c2ce; stroke-width: 1; }
.attr-text { font-size: 10px; fill: #475569; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.attr-underline { stroke: #475569; stroke-width: 1; pointer-events: none; }
.attr-underline.partial { stroke-dasharray: 2.5 2; }  /* weak-entity discriminator */

/* ---- properties panel ---- */
#erPanel { flex: 0 0 340px; width: 340px; border-left: 1px solid var(--line); background: var(--panel); overflow: auto; padding: 14px; }
#erWrap.panel-anim #erPanel { transition: transform .25s ease, margin-right .25s ease; }
#erWrap.panel-collapsed #erPanel { transform: translateX(100%); margin-right: -340px; }
#erPanel h3 { margin: 0 0 10px; font-size: 14px; }
#erPanel .empty { color: var(--muted); font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.field > label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.row { display: flex; gap: 6px; align-items: center; }
.checkbox-row { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; font-size: 13px; }
.sublist { border: 1px solid var(--line); border-radius: 6px; padding: 8px; margin-bottom: 8px; }
.sublist .item { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.sublist .item:last-child { border-bottom: none; }
.sublist .item .line { display: flex; gap: 4px; }
.sublist .item input[type=text] { flex: 1; min-width: 0; }
.sublist .item select { flex: 1; min-width: 0; }
.mini { font-size: 11px; color: var(--muted); }

/* What is actually in the built database: one chip per table with its row
   count.  The shape of the schema is drawn at stage 2, so this is only ever
   about how full it is. */
.fill-counts { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.fill-count { display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
  background: #fff; color: var(--muted); }
.fill-count b { color: var(--ink); font-variant-numeric: tabular-nums; }
.fill-count.none { color: var(--muted); border-style: dashed; }
.fill-count.none b { color: var(--muted); }

/* ---- schema cards / mapping log ---- */
.cards { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; min-width: 240px; max-width: 340px; overflow: hidden; }
.card > header { background: #f8fafc; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.card > header .tname { font-weight: 700; }
.card > header .src { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.card table { width: 100%; border-collapse: collapse; font-size: 12px; }
.card td { padding: 4px 12px; border-bottom: 1px solid #eef1f5; }
.card tr:last-child td { border-bottom: none; }
.card .col-name { font-weight: 600; }
.card .col-type { color: var(--muted); }
.badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; margin-left: 4px; }
.badge.pk { background: #fef9c3; color: #854d0e; }
.badge.fk { background: #dbeafe; color: #1e40af; }
.badge.u  { background: #ede9fe; color: #5b21b6; }
.badge.nn { background: #f1f5f9; color: #475569; }
.card .fkline { padding: 4px 12px; font-size: 11px; color: var(--muted); border-top: 1px dashed var(--line); }

/* ---- editable schema cards (stage 2) ---- */
.card.edit { max-width: 440px; }
.card.edit > header { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.card.edit > header .src { flex-basis: 100%; margin-top: 3px; }
.card.edit .tname-input { flex: 1; min-width: 0; font-weight: 700; font-size: 13px;
  border: 1px solid transparent; background: transparent; border-radius: 4px; padding: 2px 4px; }
.card.edit .tname-input:hover { border-color: var(--line); }
.card.edit .tname-input:focus { border-color: var(--accent); background: #fff; }
.card.edit table.cols { width: 100%; border-collapse: collapse; }
.card.edit table.cols th { text-align: left; font-size: 9.5px; font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase; color: var(--muted); padding: 5px 4px; border-bottom: 1px solid var(--line); }
.card.edit table.cols td { padding: 3px 4px; border-bottom: 1px solid #eef1f5; }
.card.edit table.cols td.ck, .card.edit table.cols th.ck { text-align: center; width: 24px; padding-left: 0; padding-right: 0; }
.card.edit input:not([type=checkbox]), .card.edit select {
  font: inherit; font-size: 12px; padding: 2px 4px; border: 1px solid var(--line);
  border-radius: 4px; background: #fff; max-width: 100%; }
.card.edit .c-name { width: 96px; }
.card.edit .c-type { width: 100%; }
.card.edit .c-def { width: 66px; }
.card.edit .fk-cols { width: 74px; }
.card.edit .chk { width: 160px; }
.card.edit .x { border: none; background: transparent; color: var(--err); font-size: 15px;
  line-height: 1; padding: 0 3px; cursor: pointer; }
.card.edit .x:hover { color: #7f1d1d; }
.card.edit .card-actions, .card.edit .sec { padding: 6px 10px; border-top: 1px dashed var(--line); }
.card.edit .sec-h { font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; }
.card.edit .fk-row { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; margin-bottom: 4px; }

.spec-strategies { background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; margin: 10px 0; }
.spec-strategies .row { margin-top: 6px; gap: 8px; }
.log-wrap { margin-top: 20px; }
.log-wrap > summary { cursor: pointer; font-weight: 600; color: var(--ink); margin-bottom: 6px; }

.log { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); overflow: hidden; margin-top: 8px; }
.log .step { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.log .step:last-child { border-bottom: none; }
.log .rule { font-weight: 700; color: var(--accent); }
.log .kv { font-size: 12px; margin-top: 3px; }
.log .kv b { color: var(--muted); font-weight: 600; }
.warnbox { background: #fff7ed; border: 1px solid #fed7aa; color: var(--warn); border-radius: 8px; padding: 8px 12px; margin: 10px 0; font-size: 13px; }
.warnbox ul { margin: 4px 0 0 18px; }

/* ---- code / results ---- */
textarea.code { width: 100%; min-height: 340px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.5; tab-size: 2; }
.stmtlist { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-top: 10px; background: var(--panel); }
.stmtlist .stmt { padding: 7px 12px; border-bottom: 1px solid var(--line); font-family: ui-monospace, monospace; font-size: 12px; white-space: pre-wrap; }
.stmtlist .stmt:last-child { border-bottom: none; }
.stmt .mark { font-weight: 700; margin-right: 8px; }
.stmt.ok .mark { color: var(--ok); }
.stmt.bad { background: #fef2f2; }
.stmt.bad .mark { color: var(--err); }
.stmt .err { display: block; color: var(--err); margin-top: 4px; }

.grid-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); max-height: 60vh; }
table.grid { border-collapse: collapse; width: 100%; font-size: 12.5px; }
table.grid th, table.grid td { border: 1px solid #e5e9ef; padding: 4px 8px; text-align: left; white-space: nowrap; }
table.grid th { background: #f8fafc; position: sticky; top: 0; z-index: 1; }
table.grid td.pk { background: #fffef2; }
table.grid input { width: 100%; min-width: 90px; border: 1px solid transparent; background: transparent; padding: 2px 4px; }
table.grid input:focus { border-color: var(--accent); background: #fff; }
table.grid td.actions { white-space: nowrap; }
.msg { font-size: 13px; margin: 8px 0; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--err); white-space: pre-wrap; font-family: ui-monospace, monospace; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-size: 12px; color: var(--muted); }

.saved-queries { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.saved-queries .chip { font-size: 12px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; }
.saved-queries .chip:hover { border-color: var(--accent); }

#toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: #1d2733; color: #fff; padding: 8px 16px; border-radius: 8px; font-size: 13px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 50;
}
#toast.err { background: var(--err); }

/* ---- hosted-mode sign in ---- */
.user-chip { font-size: 12px; color: var(--muted); padding: 0 6px; align-self: center; white-space: nowrap; }
.backlink { align-self: center; font-size: 12px; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; white-space: nowrap; }
.backlink:hover { border-color: var(--accent); color: var(--accent); }

/* ---- instructor portal ---- */
.stage-admin { max-width: 1000px; }
.admin-add { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.admin-add textarea { width: 100%; }
.assignment-card { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  margin-bottom: 8px; }
.assignment-card .toolbar { flex-wrap: wrap; gap: 6px; }
.assignment-card p.mini { margin: 4px 0 0; }
.subs-panel { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 6px; }
.subs-panel input.bad { border-color: var(--err); background: #fef2f2; }
.new-codes { background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; }
.new-codes h4 { margin: 0 0 6px; font-size: 13px; }
.new-codes .pair { font-size: 12.5px; line-height: 1.8; }
table.roster { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
table.roster th { text-align: left; background: #f8fafc; padding: 8px 10px; border-bottom: 1px solid var(--line);
  font-size: 10px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
table.roster td { padding: 7px 10px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
table.roster tr:last-child td { border-bottom: none; }
table.roster tr.inactive td { opacity: .5; }
.code-chip { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: #f1f5f9;
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-size: 12px;
  white-space: nowrap; }
.code-chip.flash { background: #fde68a; }
.code-chip.masked { color: var(--muted); letter-spacing: 2px; }
.code-cell { display: inline-flex; align-items: center; gap: 5px; }
.code-cell .reveal { border: 0; background: none; color: var(--muted); padding: 2px; margin: 0;
  cursor: pointer; border-radius: 4px; display: inline-flex; align-items: center; }
.code-cell .reveal:hover { color: var(--ink); }
.code-cell .reveal svg { display: block; }
.roster-actions { display: flex; gap: 4px; flex-wrap: wrap; }
/* the material toggle on a class meeting, with its reason beside it */
.sess-material { display: inline-flex; gap: 6px; align-items: center; }
.role-tag { font-size: 9px; font-weight: 700; text-transform: uppercase; padding: 1px 5px;
  border-radius: 4px; background: #ede9fe; color: #5b21b6; margin-left: 6px; vertical-align: 1px; }
.role-tag.student { background: #e0f2fe; color: #075985; }

.portal-nav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.ptab { background: transparent; border: none; border-bottom: 2px solid transparent; border-radius: 0;
  color: var(--muted); font-weight: 600; padding: 8px 12px; }
.ptab:hover { color: var(--ink); }
.ptab.active { color: var(--accent); border-bottom-color: var(--accent); }
/* the pages inside a page: which part of a section you are building or marking */
.portal-subnav { display: flex; gap: 4px; margin: 4px 0 14px; }
.portal-subnav .ptab { border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px; font-size: 13px; }
.portal-subnav .ptab.active { background: var(--accent-soft); border-color: var(--accent); }

/* ---- marking one submission: the work beside the mark ---- */
.grade-split { display: flex; gap: 14px; align-items: stretch; min-height: 62vh; }
.grade-frame { flex: 1 1 auto; min-width: 0; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; }
.grade-side { flex: 0 0 340px; width: 340px; display: flex; flex-direction: column;
  gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 12px;
  background: var(--panel); overflow: auto; }
.grade-head { display: flex; flex-direction: column; gap: 2px; }
.mark-box { width: 80px; font-size: 16px; font-weight: 700; }
/* one chip per thing that carries a mark, so the whole submission is in view */
.grade-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.step-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 3px 11px; font-size: 12px; color: var(--muted); }
.step-chip.done { color: var(--ok); border-color: #bbf7d0; background: #f0fdf4; }
.step-chip.active { border-color: var(--accent); color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft); }
.grade-comments { border-top: 1px solid var(--line); padding-top: 8px; }
.grade-comments textarea { width: 100%; }
.comment-row { align-items: flex-start; gap: 8px; }
.mark-chip { background: var(--accent-soft); color: var(--accent); border-radius: 999px;
  padding: 3px 12px; font-size: 13px; }
.role-tag.warn { background: #fff7ed; color: var(--warn); border-color: #fed7aa; }
.course-head h3 { margin: 0 0 6px; }
.teams-grid { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.team-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 260px; }
.team-card.new { background: transparent; border-style: dashed; }
.team-card-h { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.team-card-h .spacer { flex: 1; }
.member-list { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; min-height: 20px; }
.member-chip { font-size: 12px; background: #eef2f7; border: 1px solid var(--line); border-radius: 999px; padding: 1px 4px 1px 8px; display: inline-flex; align-items: center; gap: 2px; }
.member-chip .x { border: none; background: transparent; color: var(--err); cursor: pointer; font-size: 13px; line-height: 1; padding: 0 3px; }
.team-card select { width: 100%; font-size: 12px; }
.enrol-picks { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 10px; }
.enrol-pick { display: inline-flex; align-items: center; gap: 4px; }

.proj-groups { display: flex; flex-direction: column; gap: 10px; }
.proj-group { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); overflow: hidden; }
.proj-group-h { background: #f8fafc; padding: 6px 12px; font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--line); }
.proj-row { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-bottom: 1px solid #eef1f5; font-size: 13px; }
.proj-row:last-child { border-bottom: none; }
.proj-row .spacer { flex: 1; }
.proj-name { font-weight: 600; }
.lineage { color: var(--muted); }

/* ---- instructor inspect banner (main app) ---- */
#inspectBanner { padding: 6px 16px; font-size: 13px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--line); }
#inspectBanner.inspecting { background: #eff6ff; color: #1e40af; border-bottom-color: #bfdbfe; }
#inspectBanner.editing-other { background: #fef2f2; color: #991b1b; border-bottom-color: #fecaca; }
/* ---- show & tell: high contrast, it goes on a projector ---- */
#showTellBanner { padding: 8px 16px; font-size: 14px; font-weight: 600; display: flex;
  align-items: center; gap: 10px; background: #faf5ff; color: #6b21a8;
  border-bottom: 1px solid #e9d5ff; }
dialog.show-tell { max-width: min(560px, 94vw); width: min(560px, 94vw); }
dialog.show-tell .proj-groups { max-height: 50vh; overflow-y: auto; margin-top: 8px; }
.login-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg); }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 26px 30px 22px; width: min(360px, 92vw); box-shadow: 0 12px 44px rgba(15,23,42,.14); }
.login-card h1 { margin: 0 0 2px; font-size: 20px; color: var(--accent); }
.login-card p.mini { margin: 0 0 6px; }
.login-card input { width: 100%; margin: 12px 0 2px; padding: 8px 10px; font-size: 15px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.login-code { position: relative; margin: 12px 0 2px; }
.login-code input { margin: 0; padding-right: 42px; }
.login-code .reveal { position: absolute; right: 4px; top: 0; bottom: 0; width: 34px;
  margin: 0; padding: 0; background: none; border: 0; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; }
.login-code .reveal:hover { color: var(--ink); }
.login-card .row { margin-top: 12px; }
.login-card button { width: 100%; padding: 9px; font-size: 14px; }
.login-err { color: var(--err); font-size: 12px; min-height: 15px; }

dialog { border: 1px solid var(--line); border-radius: 10px; padding: 18px; max-width: 420px; }
dialog::backdrop { background: rgba(15,23,42,.35); }
dialog h3 { margin: 0 0 12px; }
dialog .row { justify-content: flex-end; margin-top: 14px; }
dialog.wide { max-width: min(640px, 94vw); width: min(640px, 94vw); }
dialog.wide .proj-groups { max-height: 60vh; overflow-y: auto; margin-top: 4px; }
/* stacked label/field pairs for the course-material dialog */
.field-grid { display: flex; flex-direction: column; gap: 10px; }
.field-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px;
  color: var(--muted); }
.field-grid label input, .field-grid label select { font-size: 13px; }
.field-grid .mini { margin: -2px 0 0; }
.proj-row select.small { max-width: 150px; }
#scopeNote { padding: 6px 16px; font-size: 13px; background: #f0fdfa; color: #115e59;
  border-bottom: 1px solid #99f6e4; }
.scope-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; }
/* a phase, its tick and its points on one line - `.field-grid label` stacks
   its children, and these are the exception */
.field-grid .scope-pick, .scope-pick { display: flex; flex-direction: row;
  align-items: center; gap: 6px; font-size: 12px; color: var(--fg); }
.scope-pick > span { flex: 1; min-width: 0; }
.scope-pick > input[type=checkbox] { flex: 0 0 auto; margin: 0; }
/* what a phase is worth, beside the phase itself */
.scope-pts { width: 58px; flex: 0 0 auto; }
.scope-pts:disabled { opacity: .45; }

/* ---- what an exercise assesses, in the portal ---- */
.phase-row > span:first-child { min-width: 170px; font-weight: 600; }
.phase-list { display: flex; flex-direction: column; gap: 2px; margin: 10px 0; }
.phase-line { display: flex; align-items: center; gap: 8px; font-size: 13px;
  padding: 3px 4px; border-radius: 5px; }
.phase-line:hover { background: var(--accent-soft); }
.phase-line > span { flex: 1; min-width: 0; }
/* a gradebook column group: the exercise, with its phases beneath */
.subs-panel { overflow-x: auto; }
th.ex-group { text-align: center; border-bottom: 1px solid var(--line); }
th.phase-head { font-weight: 600; white-space: nowrap; }
/* the box and the two buttons onto the work belong on one line */
td.score-cell { white-space: nowrap; }
/* ---- instructor feedback dock: comment while reading the work ---- */
#fbDock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; max-height: 46vh;
  display: flex; flex-direction: column; background: var(--panel);
  border-top: 2px solid #c4b5fd; box-shadow: 0 -6px 18px rgba(15,23,42,.12); }
#fbDock .fb-head { display: flex; align-items: center; gap: 10px; padding: 7px 14px;
  background: #faf5ff; border-bottom: 1px solid var(--line); }
#fbDock .fb-items { overflow-y: auto; padding: 4px 14px; }
#fbDock .fb-item { display: flex; align-items: center; gap: 8px; padding: 5px 0;
  border-bottom: 1px solid var(--line); }
#fbDock .fb-compose { display: flex; align-items: center; gap: 8px; padding: 8px 14px;
  border-top: 1px solid var(--line); }
#fbDock .fb-compose textarea { flex: 1; font-size: 13px; resize: vertical; }
#fbDock .fb-comment { flex: 1; font-size: 13px; }
.feedback-block { border: 1px solid var(--line); border-radius: 8px; margin: 6px 0; }
.feedback-block .fb-comment { flex: 1; font-size: 13px; }
.role-tag.issue { background: #fef2f2; color: #991b1b; }
.role-tag.suggestion { background: #fffbeb; color: #92400e; }
.role-tag.praise { background: #f0fdf4; color: #166534; }
dialog.feedback { max-width: min(640px, 94vw); width: min(640px, 94vw); }
dialog.feedback .proj-groups { max-height: 40vh; overflow-y: auto; margin-bottom: 10px; }
dialog.feedback textarea { width: 100%; font-size: 13px; }
.assignment-block { border: 1px solid var(--line); border-radius: 8px; margin: 6px 0; }
.assignment-block .proj-row.sub { padding-left: 22px; background: var(--bg-soft, transparent); }
.assignment-block .proj-row.sub .mini { color: var(--muted); }
.proj-toolbar { display: flex; gap: 6px; margin: 0 0 12px; }
.proj-row .proj-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* per-row Shared toggle in the projects manager */
.share-ctl { display: inline-flex; align-items: center; gap: 6px; }
.share-ctl select.small { max-width: 120px; }
.rs-switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  user-select: none; font-size: 12px; font-weight: 600; color: var(--muted); }
.rs-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.rs-slider { position: relative; flex: none; width: 34px; height: 18px; border-radius: 999px;
  background: var(--line); transition: background .15s; }
.rs-slider::before { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.rs-switch input:checked + .rs-slider { background: var(--accent); }
.rs-switch input:checked + .rs-slider::before { transform: translateX(16px); }
.rs-switch input:checked ~ span:last-child { color: var(--accent); }
.rs-switch input:disabled + .rs-slider { opacity: .4; }
.rs-switch input:disabled { cursor: not-allowed; }
.rs-switch input:focus-visible + .rs-slider { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- stage 7: star schema ---- */
.dw-wrap { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-top: 12px; }
.dw-panel { flex: 1 1 420px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dw-side { flex: 0 1 330px; display: flex; flex-direction: column; gap: 10px; }
.dw-side-h { font-weight: 600; font-size: 12px; color: var(--muted); }
.dw-card { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 10px 12px; }
.dw-card-h { display: flex; align-items: center; gap: 6px; font-weight: 600; margin-bottom: 8px; }
.dw-card-h input { font-weight: 600; }
.dw-card .x { border: none; background: transparent; color: var(--err); font-size: 15px;
  line-height: 1; padding: 0 4px; cursor: pointer; }
.dw-card-h .x { margin-left: auto; }
.dw-sub-h { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  margin: 12px 0 5px; }
.dw-field { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.dw-field > label { font-size: 11px; color: var(--muted); }
.dw-field select, .dw-field input { width: 100%; }
.dw-line { display: flex; gap: 6px; align-items: center; margin-bottom: 5px; }
.dw-line select, .dw-line input { flex: 1; min-width: 0; }
.dw-measure { border-left: 2px solid var(--line); padding-left: 8px; margin-bottom: 8px; }
.dw-inl { flex: 0 0 auto; font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); }
.dw-checks { display: flex; flex-wrap: wrap; gap: 3px 12px; }
.dw-check { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; }
.dw-hop { margin-top: 4px; }
.dw-hop > summary { font-size: 11px; color: var(--muted); cursor: pointer; }
.dw-hop .dw-checks { padding: 4px 0 4px 14px; }
.dw-sql { max-height: 300px; overflow: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; line-height: 1.45; background: #0f172a; color: #e2e8f0; padding: 10px 12px;
  border-radius: 6px; white-space: pre; }
.dw-star { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 6px; }
.dw-star-svg { width: 100%; height: auto; display: block; }
.dw-star-fact { fill: var(--accent); }
.dw-star-dim { fill: #eef2ff; stroke: var(--line); }
.dw-star-edge { stroke: var(--line); stroke-width: 1.5; }
.dw-star-t { font-size: 9px; text-anchor: middle; fill: var(--ink); pointer-events: none; }
.dw-star-ft { fill: #fff; font-weight: 600; }

/* ---- stage 2 as a diagram: table boxes + foreign-key links ---- */
/* Mirrors the ER canvas so the second diagram in the sequence handles the
   same way; the stage keeps its heading and toolbar above it. */
.stage.sd-stage { height: 100%; max-width: none; display: flex; flex-direction: column;
  padding-bottom: 16px; }
.stage.sd-stage > div:last-child { flex: 1; position: relative; min-height: 360px; }
#sdWrap { position: absolute; inset: 0; display: flex; overflow: hidden;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
#sdCanvasCol { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#sdToolbar { display: flex; gap: 8px; align-items: center; padding: 7px 10px;
  border-bottom: 1px solid var(--line); background: #f8fafc; flex-wrap: wrap; }
#sdToolbar .hint { color: var(--muted); font-size: 12px; }
#sdSvg { flex: 1; width: 100%; background:
  radial-gradient(circle at 1px 1px, #e2e8f0 1px, transparent 0) 0 0/22px 22px; cursor: default; }
#sdSvg.panning { cursor: grabbing; }
#sdPanel { flex: 0 0 320px; width: 320px; border-left: 1px solid var(--line);
  background: var(--panel); overflow: auto; padding: 14px; }
#sdWrap.panel-anim #sdPanel { transition: transform .25s ease, margin-right .25s ease; }
#sdWrap.panel-collapsed #sdPanel { transform: translateX(100%); margin-right: -320px; }
#sdPanel h3 { margin: 0 0 10px; font-size: 14px; }
#sdPanel .empty { color: var(--muted); font-size: 13px; }
#sdPanel .sd-col-item { display: flex; gap: 6px; align-items: center; cursor: pointer;
  padding: 5px 4px; border-radius: 4px; }
#sdPanel .sd-col-item:hover { background: var(--accent-soft); }
#sdPanel .sd-col-item-n { font-weight: 600; font-size: 12.5px; }

/* table box */
.sd-box { fill: var(--panel); stroke: var(--line); stroke-width: 1.2; }
.sd-head, .sd-head-sq { fill: #eef2f7; stroke: none; }
.sd-table.sel .sd-box { stroke: var(--accent); stroke-width: 2; }
.sd-table.sel .sd-head, .sd-table.sel .sd-head-sq { fill: var(--accent-soft); }
.sd-tname { font-size: 13px; font-weight: 700; fill: var(--entity); }
.sd-col-hit { fill: transparent; }
.sd-col:hover .sd-col-hit { fill: var(--accent-soft); }
.sd-col.sel .sd-col-hit { fill: #dbeafe; }
.sd-cname { font-size: 12px; fill: var(--ink); }
.sd-cname.pk { font-weight: 700; }
.sd-ctype { font-size: 11px; fill: var(--muted); }
.sd-badge { font-size: 8.5px; font-weight: 700; }
.sd-badge.pk { fill: #b45309; }
.sd-badge.fk { fill: #7c3aed; }
.sd-badge.u { fill: var(--muted); }
.sd-port { fill: #cbd5e1; stroke: var(--panel); stroke-width: 1.5; cursor: crosshair; }
.sd-col:hover .sd-port { fill: var(--accent); }

/* foreign-key link: a line into the key it references */
.sd-edge { fill: none; stroke: #94a3b8; stroke-width: 1.6; }
.sd-edge.sel { stroke: var(--accent); stroke-width: 2.4; }
.sd-edge.linking { stroke: var(--accent); stroke-dasharray: 5 4; }
.sd-arrowhead { fill: #94a3b8; }
.sd-edge-hit { fill: none; stroke: transparent; stroke-width: 12; cursor: pointer; }
.sd-table { cursor: grab; }
/* crow's foot: the glyphs sit on the line, so the circle has to mask it */
.sd-foot { stroke: #64748b; stroke-width: 1.5; fill: none; }
.sd-foot-o { fill: var(--panel); }
.sd-foot.sel { stroke: var(--accent); stroke-width: 2; }

/* ---- stage 0: the requirements brief ---- */
.req-body { max-width: 78ch; }
textarea.req-edit { width: 100%; min-height: 58vh; line-height: 1.5; }
.req-read { background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 18px 24px; line-height: 1.6; }
.req-read h2 { font-size: 17px; margin: 18px 0 8px; }
.req-read h3 { font-size: 15px; margin: 16px 0 6px; }
.req-read h4, .req-read h5 { font-size: 13.5px; margin: 14px 0 6px; color: var(--muted); }
.req-read > :first-child { margin-top: 0; }
.req-read p { margin: 0 0 10px; }
.req-read ul, .req-read ol { margin: 0 0 12px; padding-left: 24px; }
.req-read li { margin: 3px 0; }
.req-read code { background: #f1f5f9; border-radius: 4px; padding: 1px 5px;
  font-size: 12.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.req-read blockquote { margin: 0 0 12px; padding: 4px 14px; color: var(--muted);
  border-left: 3px solid var(--line); }
.req-read hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
.req-read a { color: var(--accent); }

/* A workspace embedded in the portal's grading pages: no chrome, because the
   page around it is doing the navigating. */
body.bare #topbar, body.bare #tabs, body.bare #staleBanner, body.bare #scopeNote,
body.bare #changeBanner, body.bare #inspectBanner, body.bare #showTellBanner,
body.bare #fbDock { display: none !important; }
body.bare #view { border-top: none; }

/* ---- header: three segments in one row ---- */
/* What you are working on | what the class is doing | who you are. Separated by
   a rule rather than by spacing, and every part allowed to shrink, so a narrow
   window truncates instead of pushing controls off the edge. */
#topbar { flex-wrap: nowrap; }
#topbar button, #topbar summary, #topbar label, #topbar .presence-chip,
#topbar .user-chip, .class-now { white-space: nowrap; }
.project-controls > .seg { display: flex; align-items: center; gap: 8px; }
.project-controls > .seg + .seg,
.project-controls > .spacer + .seg { border-left: 1px solid var(--line);
  padding-left: 12px; }
/* Only the work segment gives ground, and all of it comes out of the project
   <select>: the select carries the explicit min-width that is the floor, while
   the segments keep the default `auto` so a button is never squeezed under its
   neighbour.  Without this the row ran straight past the right edge. */
#workSeg { flex: 0 1 auto; }
#classSeg, #acctSeg { flex: 0 0 auto; }
/* The 230px is a flex-basis, not a width: a definite `width` would become the
   select's minimum size and the segment would refuse to narrow at all. */
#workSeg label { flex: 0 1 230px; min-width: 88px; }
#projectSelect { width: 100%; min-width: 0; }
#courseChip { overflow: hidden; text-overflow: ellipsis; max-width: 230px; }

/* Under a narrow window, in this order: the word "Project" (the select beside
   it already names one), the breathing room, and the second half of the
   wordmark - so the class and account segments never have to go. */
@media (max-width: 1120px) {
  #workSeg label > .lbl { display: none; }
  #topbar { gap: 10px; padding-left: 10px; padding-right: 10px; }
  .project-controls { gap: 6px; }
  .project-controls > .seg { gap: 6px; }
  .project-controls > .seg + .seg,
  .project-controls > .spacer + .seg { padding-left: 8px; }
}
/* Last to go, and only once the row genuinely cannot hold it: the headcount,
   and the project select down to a stub.  Everything left in the row is a
   control somebody has to be able to reach. */
@media (max-width: 960px) {
  #classChip { display: none; }
  #workSeg label { min-width: 64px; }
}
/* Past that there is nothing left to give, so the row wraps onto a second
   line.  Clipping would put "Sign out" off the edge; wrapping only costs
   height. */
@media (max-width: 880px) {
  #topbar, .project-controls { flex-wrap: wrap; row-gap: 6px; }
  /* whichever segment drops to the second line still hugs the right edge,
     and loses the separator, which only reads as one on a shared row */
  #acctSeg { margin-left: auto; }
  .project-controls > .spacer + .seg { border-left: none; padding-left: 0; }
}
/* a menu is a <details>, so open/close needs no script */
#topbar details.menu { position: relative; }
#topbar details.menu > summary { list-style: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 11px;
  background: #fff; font-size: 14px; display: flex; align-items: center; gap: 5px; }
#topbar details.menu > summary::-webkit-details-marker { display: none; }
#topbar details.menu > summary::after { content: "▾"; color: var(--muted); font-size: 11px; }
#topbar details.menu > summary:hover { border-color: var(--accent); color: var(--accent); }
#topbar details.menu[open] > summary { border-color: var(--accent); color: var(--accent); }
#topbar .menu-items { position: absolute; right: 0; top: calc(100% + 5px); z-index: 70;
  min-width: 190px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px; display: flex; flex-direction: column;
  box-shadow: 0 8px 26px rgba(15,23,42,.14); }
#topbar .menu-items > * { text-align: left; background: none; border: none;
  color: var(--ink); font: inherit; padding: 7px 10px; border-radius: 5px;
  text-decoration: none; cursor: pointer; }
#topbar .menu-items > *:hover { background: var(--accent-soft); color: var(--accent); }

/* ---- a class in progress ---- */
.class-now { font-weight: 700; color: var(--rel); display: flex; align-items: center;
  gap: 6px; font-size: 13px; }
.class-now::before { content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--rel); box-shadow: 0 0 0 3px #ede9fe; }
#classBtn { border-color: var(--rel); color: var(--rel); background: #faf5ff; }
#classAgenda { flex: 0 1 auto; max-width: 230px; min-width: 110px; }
#classOffer { padding: 8px 16px; font-size: 14px; font-weight: 600; display: flex;
  align-items: center; gap: 10px; background: #f5f3ff; color: #5b21b6;
  border-bottom: 1px solid #ddd6fe; }
.class-agenda-h { margin-top: 14px; }
.class-agenda-h:first-of-type { margin-top: 0; }

/* A folder's name inside "My own work" — quieter than a group heading, since
   it sits under one. */
.proj-subgroup-h {
  padding: 8px 12px 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #667);
}

/* A foldable group: the heading is its own control, so it needs to look like
   one without turning into a button. */
details.proj-group > summary.proj-group-h {
  cursor: pointer;
  list-style: none;
  user-select: none;
}
details.proj-group > summary.proj-group-h::-webkit-details-marker { display: none; }
details.proj-group > summary.proj-group-h::before {
  content: "\25B8";
  display: inline-block;
  width: 1em;
  font-size: 10px;
  transition: transform .12s ease;
}
details.proj-group[open] > summary.proj-group-h::before { transform: rotate(90deg); }

/* ---- the normalization workbench ---- */
/* Its own pane rather than a numbered stage, so it reads as a workshop beside
   the pipeline: sections stacked, and one panel at the bottom that whatever you
   last asked for writes into. */
.nf-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px;
  border-radius: 4px; margin-left: 6px; background: #f1f5f9; color: #475569; }
.nf-badge.ok   { background: #dcfce7; color: var(--ok); }
.nf-badge.warn { background: #fef3c7; color: var(--warn); }
.nf-badge.bad  { background: #fee2e2; color: var(--err); }
.nf-badge.mute { background: #f1f5f9; color: var(--muted); }

.nf-section { margin-top: 18px; }
.nf-section h3 { margin: 0 0 4px; font-size: 14px; }

.nf-fd { border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  padding: 8px 12px; margin-bottom: 6px; }
.nf-fd-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nf-fd code { font-size: 12.5px; }
.nf-fd .mini { margin-top: 4px; color: var(--muted); line-height: 1.5; }

.nf-add { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px;
  padding: 8px 12px; border: 1px dashed var(--line); border-radius: 8px; }
.nf-add select { min-width: 150px; }

.nf-node { border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 8px; background: var(--panel); padding: 8px 12px; margin-bottom: 6px; }
/* a table that has been split is kept in view - it is what its two halves get
   rejoined and compared against - but it is no longer one of your tables */
.nf-node.spent { border-left-color: var(--line); opacity: .6; }
.nf-node > div { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nf-node .cols { display: block; color: var(--muted); margin-top: 4px; }

.nf-panel { margin-top: 18px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--panel); }
.nf-panel h4 { margin: 0 0 8px; font-size: 14px; }
.nf-panel p { line-height: 1.55; margin: 8px 0; }
.nf-panel pre.code { background: var(--shape); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 10px; overflow-x: auto; white-space: pre; }

.nf-anom { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 12px; }
.nf-anom > strong { text-transform: capitalize; }
/* the point of the whole demonstration is the difference between two grids, so
   the second one is marked rather than left for the reader to diff by eye */
.nf-panel table.grid.after { outline: 2px solid #fecaca; }

.nf-match { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.nf-match:last-child { border-bottom: 0; }
/* one pass of the minimal cover: its reason once, its changes under it */
.nf-pass { margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--line); }
.nf-pass .cols { margin: 2px 0; }

/* DB-Publish: the Publish dialog.  The published site itself has its own
   stylesheet under static/pub/ - this is only the door to it. */
dialog.publish-dlg { max-width: min(560px, 94vw); width: min(560px, 94vw); }
dialog.publish-dlg .field { display: flex; flex-direction: column; gap: 4px;
  margin: 10px 0; font-size: 12px; color: var(--muted); }
dialog.publish-dlg .field input { padding: 7px 9px; font-size: 14px; }
dialog.publish-dlg label.preset { display: flex; gap: 8px; align-items: flex-start;
  padding: 9px 10px; margin-top: 8px; border: 1px solid var(--line);
  border-radius: 8px; cursor: pointer; }
dialog.publish-dlg label.preset:hover { border-color: var(--accent); }
dialog.publish-dlg label.preset input { margin-top: 3px; }
/* the per-preset consequence of a stage-4 rebuild: the one thing in this
   dialog a student must read before they click */
dialog.publish-dlg .mini.warn { margin-top: 10px; padding: 8px 10px;
  border-left: 3px solid var(--warn); background: #fff7ed; color: #7c4a03;
  border-radius: 0 6px 6px 0; }
dialog.publish-dlg .site-row { padding: 10px 0; border-top: 1px solid var(--line); }
dialog.publish-dlg .site-row:first-of-type { border-top: 0; }
dialog.publish-dlg .site-row .row { justify-content: flex-start; margin-top: 0; }
dialog.publish-dlg .site-row label.mini { display: flex; gap: 6px; align-items: center;
  margin-top: 4px; }
/* name, font and colour side by side, with the result shown underneath */
dialog.publish-dlg .site-row .look {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 8px;
  margin: 8px 0 6px;
}
dialog.publish-dlg .site-row .look label.mini {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: stretch;
  margin-top: 0;
}
dialog.publish-dlg .site-row .look input,
dialog.publish-dlg .site-row .look select {
  padding: 5px 7px;
  font-size: 13px;
}
dialog.publish-dlg .title-preview-wrap {
  padding: 10px 8px;
  margin-bottom: 6px;
  text-align: center;
  background: #f6f7f9;
  border: 1px solid var(--line);
  border-radius: 8px;
}
dialog.publish-dlg .title-preview { font-size: 22px; font-weight: 700; line-height: 1.2; }
@media (max-width: 520px) {
  dialog.publish-dlg .site-row .look { grid-template-columns: 1fr; }
}

/* deleting hangs off "may add and correct", because it is gated on both */
dialog.publish-dlg .site-row label.mini.indent { margin-left: 20px; }
dialog.publish-dlg .site-row label.mini input:disabled { opacity: .45; }
dialog.publish-dlg .site-row label.mini:has(input:disabled) { opacity: .55; }
dialog.publish-dlg .url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all; margin: 2px 0 6px; }
