:root {
  --bg: #f7f7f5; --panel: #fff; --ink: #1d1f23; --muted: #6b7078; --line: #dcdde0; --accent: #2f5fb3;
  --accent-soft: #e6eefb; --warn: #a3470d; --warn-soft: #fdf0e6; --ok: #1f7a43; --ok-soft: #e5f4ea;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); }
a { color: var(--accent); }
button, .button {
  font: inherit; padding: 5px 12px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent);
  color: #fff; cursor: pointer; text-decoration: none; display: inline-block;
}
button.ghost, .button.ghost { background: var(--panel); color: var(--accent); }
button.danger { color: #b3261e; border-color: #b3261e; }
button:disabled { opacity: .4; cursor: default; }
input, select { font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; width: 100%; }
input[type=checkbox] { width: auto; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 24px; text-align: center; }
.spacer { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

#top { display: flex; align-items: center; gap: 18px; padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
#top .brand { font-weight: 700; text-decoration: none; color: var(--ink); }
#top nav { display: flex; gap: 4px; flex: 1; }
#top nav a { padding: 4px 10px; border-radius: 6px; text-decoration: none; color: var(--ink); }
#top nav a.active { background: var(--accent-soft); color: var(--accent); }
.count { background: var(--accent); color: #fff; border-radius: 9px; padding: 0 7px; font-size: 12px; }
.private-switch { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
#banner { background: var(--warn-soft); color: var(--warn); padding: 6px 16px; }
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #222; color: #fff; padding: 8px 16px; border-radius: 8px; z-index: 20; max-width: 80vw; }
#toast.bad { background: #b3261e; }

.chip { font-size: 12px; padding: 1px 7px; border-radius: 9px; background: #eef0f3; color: #444; white-space: nowrap; }
.badge { font-size: 12px; padding: 1px 7px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.private { background: #fbe4e4; color: #b3261e; }
.badge.status-draft { background: #fff3c4; color: #7a5a00; }
.badge.status-checked { background: #e6edf7; color: #2f4f7f; }
.badge.status-rejected { background: #fbe4e4; color: #b3261e; }
.badge.status-approved { background: var(--ok-soft); color: var(--ok); }
.src { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.src.big { font-size: 13px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; }

/* browse */
.browse { display: grid; grid-template-columns: 260px minmax(320px, 1fr) minmax(380px, 1.3fr); height: calc(100vh - 47px); }
.filters { padding: 12px; overflow: auto; border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; gap: 8px; }
.filters label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 2px; }
.filters select, .filters input { font-size: 13px; color: var(--ink); }
.code-points { font-size: 12px; background: var(--accent-soft); border-radius: 6px; padding: 0; }
.code-points:not(:empty) { padding: 6px 8px; }
.code-points ul { margin: 4px 0 0; padding-left: 16px; }
.list { overflow: auto; border-right: 1px solid var(--line); }
.list-head { display: flex; gap: 8px; align-items: center; padding: 8px 12px; position: sticky; top: 0; background: var(--bg); border-bottom: 1px solid var(--line); z-index: 1; }
.row { display: flex; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; background: var(--panel); }
.row:hover { background: #fafbfd; }
.row.sel { background: var(--accent-soft); }
.row .add { width: 28px; height: 28px; padding: 0; flex: none; background: #fff; color: var(--accent); }
.row .add.on { background: var(--accent); color: #fff; }
.rtop { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rtop .lbl { font-weight: 600; }
.rtop .src { margin-left: auto; }
.sum { color: #3b3f46; font-size: 14px; }
.detail { overflow: auto; padding: 14px 20px 40px; background: var(--panel); }
.detail-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.detail-head h2 { margin: 0; font-size: 20px; }
.detail-actions { display: flex; gap: 8px; margin: 10px 0 14px; }
details > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
details.stim-wrap, details.answers, details.meta-wrap { border-top: 1px solid var(--line); margin-top: 10px; }
table.meta { border-collapse: collapse; font-size: 13px; width: 100%; }
table.meta th { text-align: left; vertical-align: top; color: var(--muted); font-weight: 500; padding: 4px 10px 4px 0; width: 120px; }
table.meta td { padding: 4px 0; }
table.meta ul { margin: 2px 0 4px; padding-left: 18px; color: var(--muted); }
details.ext pre { font-size: 11px; max-height: 300px; overflow: auto; background: #f4f4f4; padding: 8px; }

/* item content (shared by every view) */
.stem p, .abody p, .otext p, .stimulus p { margin: 0 0 .6em; }
.item pre, .stimulus pre, .answer pre { font-family: var(--mono); font-size: .9em; background: #f4f5f7; padding: 8px 10px; border-radius: 6px; overflow-x: auto; white-space: pre; }
.item table, .stimulus table, .answer table { border-collapse: collapse; margin: 6px 0 10px; }
.item th, .item td, .stimulus th, .stimulus td, .answer th, .answer td { border: 1px solid #b9bcc2; padding: 3px 8px; text-align: left; vertical-align: top; }
/* blank rows of a table students complete keep a full line of height */
.item td:empty::after, .stimulus td:empty::after { content: "\00a0"; display: inline-block; min-height: 1.6em; }
.item th, .stimulus th, .answer th { background: #f1f2f4; }
figure.asset { margin: 8px 0; }
figure.asset img, .stem img, .stimulus img { max-width: 100%; height: auto; }
figure.asset.original figcaption { font-size: 12px; color: var(--muted); }
/* original-layout cuts (the printed page) are for checking; projection shows them with O, print never */
.proj figure.asset.original { display: none; }
.proj.show-original figure.asset.original { display: block; }
ol.options { list-style: none; padding: 0; margin: 8px 0; }
li.option { display: flex; gap: 10px; padding: 4px 8px; border-radius: 6px; border: 1px solid transparent; }
li.option .olabel { font-weight: 700; min-width: 1.4em; }
li.option .otext > :last-child { margin-bottom: 0; }
li.option.correct { background: var(--ok-soft); border-color: #9fd3b3; }
.part { display: grid; grid-template-columns: 2em 1fr auto; gap: 6px; margin: 12px 0; }
.plabel { font-weight: 700; }
.pmarks { color: var(--muted); font-size: 13px; white-space: nowrap; }
.answer { border-left: 3px solid var(--ok); background: var(--ok-soft); padding: 6px 10px; margin: 8px 0; border-radius: 0 6px 6px 0; }
.alabel { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ok); }
.stimulus { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 8px 0; background: #fcfcfb; }
.stim-head { font-weight: 700; margin-bottom: 6px; }
.mermaid { margin: 6px 0; }
pre.code { font-family: var(--mono); font-size: .92em; line-height: 1.45; background: #f6f7f9; border: 1px solid #d5d8de; border-radius: 6px; padding: 10px 14px; overflow-x: auto; white-space: pre; tab-size: 4; }
pre.code b { font-weight: 700; color: #1b2a4a; }
.badge.code-badge { background: #ece6fb; color: #5b3aa8; }
.mermaid svg { max-width: 100%; height: auto; }

/* quiz */
.quiz { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; padding: 16px 20px; max-width: 1400px; margin: 0 auto; }
.quiz section { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; }
.quiz h2 { margin: 0 0 10px; font-size: 18px; }
.quiz h3 { font-size: 14px; margin: 14px 0 4px; color: var(--muted); }
.quiz-form { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.quiz-form label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.quiz-actions { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
ol.basket { padding-left: 24px; margin: 0; }
ol.basket li { padding: 5px 0; border-bottom: 1px solid var(--line); }
ol.basket li { display: list-item; }
ol.basket li > * { margin-right: 6px; }
ol.basket .lbl { font-weight: 600; }
ol.basket .move { float: right; display: inline-flex; gap: 3px; }
ol.basket .move button { padding: 0 7px; background: #fff; color: var(--accent); }
ul.setlist { list-style: none; padding: 0; margin: 0; }
ul.setlist li { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.set-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.set-actions button { padding: 2px 8px; font-size: 13px; }

/* projection */
body.projecting #top, body.projecting #banner { display: none; }
.proj { --proj-scale: 1; position: fixed; inset: 0; background: #fff; display: flex; flex-direction: column; }
.proj-bar { display: flex; gap: 14px; align-items: center; padding: 6px 16px; border-bottom: 1px solid var(--line); font-size: 14px; background: #fafafa; }
.proj-bar .keys { color: var(--muted); font-size: 12px; }
.proj-body { flex: 1; display: flex; min-height: 0; }
.proj-main { flex: 1; overflow: auto; padding: 2vh 4vw 12vh; font-size: calc(clamp(20px, 1.7vw, 34px) * var(--proj-scale)); line-height: 1.45; }
.proj-side { display: none; width: 46%; overflow: auto; border-left: 2px solid var(--line); padding: 2vh 2vw; background: #fcfcfb; font-size: calc(clamp(15px, 1.15vw, 24px) * var(--proj-scale)); }
.proj.side-open .proj-side { display: block; }
.proj-side .stimulus { border: 0; padding: 0; background: none; }
.proj-toggle { position: fixed; left: 16px; bottom: 16px; }
.proj-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3vw; align-items: start; }
.proj-code { position: sticky; top: 0; }
.proj-q > .stimulus { margin-top: 1.2em; }
.proj-q .stimulus table { font-size: .8em; }
.proj-code pre.code { margin-top: 0; }
.proj-main pre.code { font-size: calc(1em * var(--code-scale, 1)); }
.proj-code .stimulus { border: 0; padding: 0; background: none; }
.proj-main .answer { display: none; }
.proj-main .answer.revealed { display: block; animation: fade .25s; }
.proj-main .pmarks { font-size: .7em; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* print */
.print-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.print-bar label { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.print-bar input:not([type=checkbox]) { width: 280px; }
#pr-note { padding: 6px 16px; font-size: 13px; }
.print-doc { background: #fff; max-width: 210mm; margin: 12px auto 40px; padding: 18mm 16mm; box-shadow: 0 1px 6px rgba(0,0,0,.12); font-size: 11.5pt; }
.print-doc section.page { border-top: 2px dashed #ccc; margin-top: 18mm; padding-top: 10mm; }
.doc-head h1 { font-size: 18pt; margin: 0 0 6px; }
.doc-head .sub { font-weight: 400; color: #555; }
.doc-meta { display: flex; gap: 30px; margin: 0 0 14px; font-size: 11pt; }
.doc-meta .blank { display: inline-block; width: 60mm; border-bottom: 1px solid #000; }
h2.sec { font-size: 14pt; border-bottom: 1px solid #000; padding-bottom: 2px; margin: 16px 0 4px; }
p.instr { font-style: italic; margin: 0 0 10px; }
article.q, article.kq { margin: 0 0 14px; }
.qhead { margin-bottom: 4px; }
.qhead .src { margin-left: 8px; }
.lines .line { border-bottom: 1px solid #888; height: 8.5mm; }
.drawing { border: 1px solid #888; height: calc(var(--lines) * 8.5mm); margin: 2mm 0; }
.print-doc .answer table, .print-doc .answer th, .print-doc .answer td { border-color: #999; }
.print-doc .answer { background: none; border-left: 2px solid #999; }
.print-doc .alabel { color: #333; }
.print-doc pre { background: none; border: 1px solid #ccc; }

/* feedback (#7) */
.row .fb-btn, .fb-q { border: 0; background: none; padding: 0 4px; font-size: 14px; opacity: .35; cursor: pointer; color: inherit; }
.row:hover .fb-btn, .row.sel .fb-btn, .fb-q:hover, .fb-btn:focus-visible { opacity: 1; }
.fb-badge { border-color: var(--warn); color: var(--warn); font-size: 13px; padding: 2px 10px; }
dialog.fb-dialog { border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; width: min(640px, 92vw); font-size: 15px; }
dialog.fb-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.fb-dialog h3 { margin: 0 0 10px; }
.fb-label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 10px 0 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { background: #eef0f3; color: var(--ink); border: 1px solid transparent; border-radius: 14px; padding: 3px 11px; font-size: 14px; }
.chip-btn.on { background: var(--accent); color: #fff; }
.fb-dialog textarea { width: 100%; margin-top: 12px; font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; box-sizing: border-box; }
.fb-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 12px; }
.fb-list { border-top: 1px solid var(--line); margin-top: 6px; font-size: 13px; }
.fb-list ul { margin: 4px 0 8px; padding-left: 18px; }
.proj-bar #p-fb { padding: 2px 8px; }

/* review queue */
.review { max-width: 1100px; margin: 0 auto; padding: 14px 20px 60px; }
.review-head { display: flex; gap: 14px; align-items: center; }
.review-head select { width: auto; }
.rv-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin: 14px 0; }
.rv-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rv-body { margin: 8px 0; }
.rv-answers { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 6px; }
.rv-hist table { font-size: 13px; }
.rv-actions, .rv-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-top: 8px; }
.rv-inline label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.rv-inline select, .rv-inline input { width: auto; min-width: 220px; }
.rv-edit { display: grid; gap: 8px; margin-top: 8px; }
.rv-field { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.rv-field textarea, .rv-opt textarea { font: 14px/1.4 var(--mono); padding: 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); }
.rv-field.short input { width: 90px; }
.rv-opt { display: grid; grid-template-columns: 60px 1fr; gap: 6px; align-items: start; }
.rv-edit fieldset { border: 1px solid var(--line); border-radius: 6px; display: grid; gap: 8px; }

@media print {
  figure.asset.original { display: none; }
  @page { size: A4; margin: 15mm 14mm; }
  :root { font-size: 11pt; }
  body { background: #fff; }
  .no-print, #top, .print-bar { display: none !important; }
  .print-doc { box-shadow: none; margin: 0; padding: 0; max-width: none; }
  .print-doc section.page { break-before: page; border: 0; margin: 0; padding: 0; }
  li.option, .lines, .drawing, .part, .qhead, figure.asset, tr, pre.code.keep { break-inside: avoid; }
  pre.code { background: none; }
  .qhead, h2.sec, p.instr, .doc-head { break-after: avoid; }
  .answer { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* ---------- #8: quiz switcher, filter chips, my tags, customise, heatmap ---------- */
.quiz-switch { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.quiz-switch select { width: auto; max-width: 220px; font-size: 13px; padding: 2px 4px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; flex: none; }
.seg button { background: var(--panel); color: var(--ink); border: 0; border-right: 1px solid var(--line); border-radius: 0; padding: 3px 10px; font-size: 13px; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent); color: #fff; }
.active-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 12px; border-bottom: 1px solid var(--line); background: var(--bg); }
.fchip { background: var(--accent-soft); color: var(--accent); border: 1px solid transparent; border-radius: 14px; padding: 1px 10px; font-size: 13px; }
.fchip:hover { border-color: var(--accent); }
.row-tools { display: flex; flex-direction: column; gap: 2px; flex: none; }
.row .tag-btn { border: 0; background: none; padding: 0 4px; font-size: 13px; opacity: .35; cursor: pointer; }
.row:hover .tag-btn, .row.sel .tag-btn, .tag-btn:focus-visible { opacity: 1; }
.utag { font-size: 12px; padding: 1px 7px; border-radius: 9px; background: #fff4d6; color: #7a5300; border: 1px solid #f0d58c; white-space: nowrap; }
.my-tags { margin: 4px 0 8px; }
.my-tags .chip-btn { font-size: 13px; padding: 2px 10px; }
#p-tags { display: inline-flex; gap: 4px; }
.small { font-size: 12px; }
.customise .cust-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; font-size: 14px; }
.cust-tag, .cust-add { display: flex; gap: 8px; align-items: center; margin: 4px 0; }
.cust-tag input { flex: 1; }
.cust-tag button { padding: 2px 8px; }
.sets-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.setlist li.cur { border-color: var(--accent); }
.chip.on { background: var(--accent-soft); color: var(--accent); }
.pack-save { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 8px; }
.pack-save .quiz-form { display: flex; gap: 8px; align-items: end; }

.browse.heat-mode { grid-template-columns: 260px minmax(0, 1fr); }
.browse.heat-mode .detail { display: none; }
.heat { padding: 10px 12px 24px; display: grid; gap: 12px; }
.heat-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.heat-bar label { display: flex; gap: 4px; align-items: center; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; color: var(--muted); }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 3px; border: 1px solid var(--line); }
.heat-scroll { overflow-x: auto; }
.heat-map { display: grid; grid-template-columns: repeat(var(--cols), minmax(130px, 1fr)); gap: 8px; align-items: start; min-width: calc(var(--cols) * 130px); }
.heat-col { display: grid; gap: 4px; min-width: 0; }
.heat-head { display: grid; align-content: end; min-height: 3.4em; padding-bottom: 4px; border-bottom: 2px solid var(--ink); }
.heat-head b { font-size: 13px; line-height: 1.25; }
.heat-head small { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.tile { all: unset; box-sizing: border-box; border-radius: 5px; padding: 5px 7px; min-height: 58px; display: grid; grid-template-rows: auto 1fr auto; gap: 1px; cursor: pointer; border: 1px solid transparent; color: #fff; }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tile:hover:not([disabled]) { filter: brightness(1.08); border-color: var(--ink); }
.tile .c { font: 500 11px var(--mono); opacity: .9; }
.tile .l { font-size: 12px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .n { font: 500 12px var(--mono); display: flex; justify-content: space-between; gap: 4px; font-variant-numeric: tabular-nums; }
.h0 { background: #b3261e; } .h1 { background: #d9622b; } .h2 { background: #e3a72f; color: var(--ink); } .h3 { background: #8fb34a; } .h4 { background: #3f8f5a; }
.f1 { background: #e4ecf8; color: var(--ink); } .f2 { background: #bcd0ef; color: var(--ink); } .f3 { background: #86a9df; color: var(--ink); } .f4 { background: #4c7cc6; } .f5 { background: #24529c; }
.tile.nostat, .sw.nostat { background: #eceff3; color: var(--ink); }
.tile.zero { background: transparent; border: 1px dashed var(--line); color: var(--muted); cursor: default; }
.heat-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.heat-lists h3 { font-size: 14px; margin: 0 0 4px; }
.heat-lists ol { margin: 0; padding-left: 1.3em; font-size: 13px; display: grid; gap: 2px; }
.list-head { flex-wrap: wrap; }
.list-head button { white-space: nowrap; }
.sets > h2 + .setlist, .sets > h2 { margin-top: 0; } .sets > .setlist + h2, .sets > .setlist + .empty + h2 { margin-top: 20px; }

/* ---------- v2: sign-in, roles, users ---------- */
body[data-role=student] :is(.teacher-only, .fb-btn, #d-feedback, #d-fb-list, #p-fb, .fb-q, .pack-save, .setlist [data-act=delete], #fb-badge, .private-switch, #reload) { display: none !important; }
.account-btn { font-size: 13px; padding: 3px 10px; white-space: nowrap; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-box { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 24px 28px; width: min(380px, 100%); display: grid; gap: 6px; }
.login-box h1 { margin: 0; font-size: 22px; }
.login-box form { display: grid; gap: 10px; margin: 8px 0; }
.login-box label { display: grid; gap: 3px; font-size: 13px; color: var(--muted); }
.login-box input { font-size: 16px; padding: 7px 9px; }
.login-box button { padding: 8px; font-size: 15px; }
.login-err { margin: 0; color: #b3261e; font-size: 14px; }
.users { max-width: 1000px; margin: 0 auto; padding: 16px; display: grid; gap: 10px; }
.users h2, .users h3 { margin: 6px 0 0; }
.user-table { width: 100%; border-collapse: collapse; background: var(--panel); font-size: 14px; }
.user-table th, .user-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.user-table tr.off td { color: var(--muted); }
.user-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.user-actions button { font-size: 12px; padding: 2px 8px; }
.add-user { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.add-user label { flex: 1 1 160px; }
.add-user label { display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.banner-note { background: var(--warn-soft); color: var(--warn); padding: 8px 12px; border-radius: 6px; margin: 0; }
.pw-show code { font-size: 22px; letter-spacing: .06em; background: var(--accent-soft); padding: 4px 10px; border-radius: 6px; user-select: all; }
.pw-form { display: grid; gap: 8px; }
.pw-form label { display: grid; gap: 2px; font-size: 13px; color: var(--muted); }
/* ---------- generate ---------- */
.gen-parents .chip-btn { display: inline-flex; align-items: center; gap: 4px; }
.gen-parents .x { border: 0; background: none; color: inherit; padding: 0 2px; font-size: 15px; line-height: 1; }
.gen-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.gen-add button { font-size: 12px; padding: 2px 8px; }
.gen-dialog textarea { margin-top: 2px; }
.gen-row { display: flex; gap: 12px; margin-top: 8px; }
.gen-row label { display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.gen-row select { width: auto; }
.gen-status { margin: 6px 0 0; padding: 8px 10px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.gen-status.ok { background: var(--ok-soft); color: var(--ok); }
.gen-status.bad { background: #fbe4e4; color: #b3261e; }
