: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; }
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; }
.project-controls .spacer { flex: 1; }
.project-controls label, .dialect { 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); }

/* ---- 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%; }
.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; }
.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); }
.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; }
.tw-projects { display: flex; flex-direction: column; gap: 5px; margin-top: 4px; }
.tw-proj { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; padding: 7px 10px; }
.tw-proj .tw-proj-name { font-weight: 600; }
.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; }
.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; }
.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; }
