/* ==========================================================================
   PatchMap - design system
   ========================================================================== */

:root {
  --bg:            #eef1f6;
  --surface:       #ffffff;
  --surface-2:     #f7f9fc;
  --surface-3:     #eef2f7;
  --line:          #dde3ec;
  --line-strong:   #c6d0dd;

  --ink:           #131a24;
  --ink-2:         #46536a;
  --ink-3:         #7a8798;
  --ink-inv:       #ffffff;

  --brand:         #2f6feb;
  --brand-ink:     #1b4bb8;
  --brand-soft:    #e8f0ff;
  --accent:        #f08c33;
  --good:          #23a06a;
  --warn:          #d9822b;
  --bad:           #dc4c47;

  --shell:         #101725;
  --shell-2:       #18202f;
  --shell-line:    #26314a;
  --shell-ink:     #aebbd0;
  --shell-ink-2:   #6d7d97;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --shadow-1: 0 1px 2px rgba(16,23,37,.08), 0 1px 3px rgba(16,23,37,.06);
  --shadow-2: 0 4px 12px rgba(16,23,37,.10), 0 2px 4px rgba(16,23,37,.06);
  --shadow-3: 0 24px 60px rgba(16,23,37,.28), 0 8px 20px rgba(16,23,37,.16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 13px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c3ccdb; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #a9b5c8; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- shell ---------- */
#app {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr) 340px;
  grid-template-rows: 52px minmax(0, 1fr);
  grid-template-areas: "brand topbar topbar" "sidebar main inspector";
  height: 100vh;
}
#app.no-inspector { grid-template-columns: 286px minmax(0,1fr) 0; }

.brand {
  grid-area: brand;
  background: var(--shell);
  color: #fff;
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  border-right: 1px solid var(--shell-line);
}
.brand .logo {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(140deg, var(--brand), #7a5cf0);
  display: grid; place-items: center; flex: none;
  box-shadow: 0 2px 8px rgba(47,111,235,.45);
}
.brand .logo svg { width: 15px; height: 15px; }
.brand b { font-size: 14px; letter-spacing: .2px; }
.brand small { color: var(--shell-ink-2); font-size: 10px; margin-left: auto; letter-spacing: .4px; }

.topbar {
  grid-area: topbar;
  background: var(--shell);
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px;
  color: var(--shell-ink);
}
.topbar .docname {
  background: transparent; border: 1px solid transparent; color: #fff;
  font-size: 14px; font-weight: 600; padding: 5px 9px; border-radius: var(--r-sm);
  min-width: 180px; max-width: 340px;
}
.topbar .docname:hover { background: var(--shell-2); }
.topbar .docname:focus { background: var(--shell-2); border-color: var(--brand); outline: none; }
.topbar .spacer { flex: 1; }
.topbar .chip {
  font-size: 11px; color: var(--shell-ink-2); background: var(--shell-2);
  border: 1px solid var(--shell-line); padding: 4px 9px; border-radius: 999px;
  white-space: nowrap;
}
.topbar .chip b { color: var(--shell-ink); font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-strong); background: var(--surface);
  padding: 6px 11px; border-radius: var(--r-sm); cursor: pointer;
  font-size: 12.5px; font-weight: 500; color: var(--ink-2);
  transition: background .12s, border-color .12s, color .12s, transform .06s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); color: var(--ink); border-color: #aebaca; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; }
.btn.danger { color: var(--bad); border-color: #f0c4c2; background: #fff6f5; }
.btn.danger:hover { background: #fdeceb; border-color: #e3a19d; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.dark { background: var(--shell-2); border-color: var(--shell-line); color: var(--shell-ink); }
.btn.dark:hover { background: #212b3e; color: #fff; border-color: #33405c; }
.btn.sm { padding: 4px 8px; font-size: 12px; }
.btn.icon { padding: 5px 7px; }

.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 6px 12px; cursor: pointer; font-size: 12.5px; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--brand); color: #fff; font-weight: 600; }

.menu-wrap { position: relative; display: inline-block; }
.menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-2);
  padding: 5px; min-width: 232px; display: none;
}
.menu.open { display: block; }
.menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 0; background: transparent; text-align: left;
  padding: 7px 10px; border-radius: var(--r-sm); cursor: pointer; font-size: 12.5px;
}
.menu button:hover { background: var(--brand-soft); color: var(--brand-ink); }
.menu .sep { height: 1px; background: var(--line); margin: 5px 4px; }
.menu .head { font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--ink-3); padding: 8px 10px 4px; }
.menu .sc { margin-left: auto; font-size: 11px; color: var(--ink-3); font-family: var(--mono); }

/* ---------- sidebar ---------- */
.sidebar {
  grid-area: sidebar; background: var(--shell-2);
  border-right: 1px solid var(--shell-line);
  display: flex; flex-direction: column; min-height: 0;
}
.sidebar .search { padding: 10px; border-bottom: 1px solid var(--shell-line); }.sidebar .search input {
  width: 100%; background: #0e1521; border: 1px solid var(--shell-line);
  color: #e7edf7; padding: 7px 10px; border-radius: var(--r-sm); font-size: 12.5px;
}
.sidebar .search input::placeholder { color: #5d6c85; }
.sidebar .search input:focus { outline: none; border-color: var(--brand); }
.treebar { display: flex; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--shell-line); }
.treebar .tbtn { flex: 1; background: #0e1521; border: 1px solid var(--shell-line); color: var(--shell-ink-2); font-size: 11px; padding: 5px 6px; border-radius: var(--r-sm); cursor: pointer; }
.treebar .tbtn:hover { background: #1f2939; color: #e8eefb; }
.tree { flex: 1; overflow: auto; padding: 6px 6px 20px; }
.tree .row {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 8px; border-radius: var(--r-sm); cursor: pointer;
  color: var(--shell-ink); font-size: 12.5px; user-select: none;
}
.tree .row:hover { background: #1f2939; color: #e8eefb; }
.tree .row.sel { background: var(--brand); color: #fff; }
.tree .row.sel .meta, .tree .row.sel .tw { color: rgba(255,255,255,.75); }
.tree .row .tw { width: 14px; text-align: center; color: var(--shell-ink-2); font-size: 9px; flex: none; cursor: pointer; border-radius: 3px; }
.tree .row .tw:hover { color: #fff; background: rgba(255,255,255,.12); }
.tree .row .dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.tree .row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree .row .meta { margin-left: auto; font-size: 10.5px; color: var(--shell-ink-2); font-family: var(--mono); }
.tree .row .dupflag { color: #f5b74e; font-size: 11px; margin-left: 5px; flex: none; cursor: help; }
.tree .row.sel .dupflag { color: #ffe08a; }
.tree .lvl1 { padding-left: 8px; }
.tree .lvl2 { padding-left: 22px; }
.tree .lvl3 { padding-left: 40px; }
.tree .site-row { font-weight: 600; color: #dae3f2; }
.sidebar .foot { border-top: 1px solid var(--shell-line); padding: 9px 12px; color: var(--shell-ink-2); font-size: 11px; display: flex; gap: 6px; align-items: center; }

/* ---------- main ---------- */
.main { grid-area: main; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.toolbar {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.crumb { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 650; }
.crumb .up { color: var(--ink-3); font-weight: 500; cursor: pointer; }
.crumb .up:hover { color: var(--brand); text-decoration: underline; }
.crumb .sepc { color: var(--line-strong); }
.crumb .sub { font-size: 12px; font-weight: 400; color: var(--ink-3); }
.zoom { display: inline-flex; align-items: center; gap: 2px; }
.zoom .val { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); width: 42px; text-align: center; }

.canvas-wrap { flex: 1; overflow: auto; padding: 22px; background:
  radial-gradient(circle at 1px 1px, #dbe2ec 1px, transparent 0) 0 0/22px 22px, var(--bg); }
.canvas-wrap.plain { background: var(--bg); }
.hintbar {
  padding: 6px 14px; font-size: 11.5px; color: var(--ink-3);
  background: var(--surface-2); border-bottom: 1px solid var(--line);
  display: flex; gap: 14px; align-items: center;
}
.hintbar kbd {
  font-family: var(--mono); font-size: 10.5px; background: var(--surface);
  border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: 4px; padding: 1px 5px; color: var(--ink-2);
}

/* cards on the overview */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1); overflow: hidden; cursor: pointer;
  transition: box-shadow .15s, transform .12s, border-color .15s;
}
.card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); border-color: var(--line-strong); }
.card.sel { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47,111,235,.16), var(--shadow-2); }
.card .cap { padding: 13px 16px; background: linear-gradient(135deg, var(--brand), #4d86f5); color: #fff; }
.card .cap b { font-size: 14.5px; }
.card .cap div { font-size: 11.5px; opacity: .85; margin-top: 2px; }
.card .body { padding: 13px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 8px; }
.stat .n { font-size: 19px; font-weight: 650; letter-spacing: -.3px; }
.stat .l { font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .6px; }

.empty { text-align: center; padding: 64px 20px; color: var(--ink-3); }
.empty .big { font-size: 16px; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }

/* ---------- inspector ---------- */
.inspector {
  grid-area: inspector; background: var(--surface);
  border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0;
}
.inspector .ihead {
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 9px;
}
.inspector .ihead .ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 700; flex: none; }
.inspector .ihead b { font-size: 13.5px; }
.inspector .ihead .sub { font-size: 11px; color: var(--ink-3); }
.ibody { flex: 1; overflow: auto; padding: 4px 16px 20px; }
.ifoot { border-top: 1px solid var(--line); padding: 10px 14px; display: flex; gap: 8px; background: var(--surface-2); }

.field { margin-top: 12px; }
.field label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-3); margin-bottom: 4px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; padding: 7px 9px; border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); background: var(--surface); font-size: 12.5px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47,111,235,.14);
}
.field textarea { resize: vertical; min-height: 62px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.section { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.section > h4 { margin: 0 0 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--ink-3); }
.linkline { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.linkline a { color: var(--brand); font-size: 12.5px; word-break: break-all; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; background: var(--surface-3); color: var(--ink-2); }
.pill.ok { background: #e4f6ee; color: #14764c; }
.bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--brand); }

/* ---------- modal ---------- */
.backdrop {
  position: fixed; inset: 0; background: rgba(13,19,30,.5);
  backdrop-filter: blur(3px); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-3);
  width: 100%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column;
  animation: pop .14s ease-out;
}
.modal.wide { max-width: 1080px; }
.modal.mid { max-width: 820px; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.modal header {
  padding: 15px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.modal header b { font-size: 15px; }
.modal header .sub { font-size: 11.5px; color: var(--ink-3); }
.modal header .x { margin-left: auto; }
.modal .content { padding: 16px 20px; overflow: auto; }
.modal footer {
  padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2);
  display: flex; gap: 8px; align-items: center; border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.modal footer .spacer { flex: 1; }

/* ---------- port editor ---------- */
.pe-grid {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px; overflow: auto; max-height: 190px;
}
.pe-face { display: inline-flex; flex-direction: column; gap: 3px; }
.pe-face .prow { display: flex; gap: 3px; }
.pe-face .p {
  width: 25px; height: 25px; border-radius: 4px; border: 1px solid var(--line-strong);
  background: var(--surface); font-size: 9px; color: var(--ink-3);
  display: grid; place-items: center; cursor: pointer; font-weight: 600;
}
.pe-face .p.on { color: #fff; border-color: rgba(0,0,0,.18); }
.pe-face .p.sel { outline: 2px solid var(--bad); outline-offset: 1px; }
.pe-face .p.gapafter { margin-right: 8px; }

.pe-tools { display: flex; gap: 8px; align-items: center; margin: 12px 0; flex-wrap: wrap; }
.pe-tools input[type=search] { padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); width: 210px; }
.pe-table { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.pe-head, .pe-row { display: grid; grid-template-columns: 44px minmax(120px,2fr) 140px 62px 108px minmax(110px,1.4fr) 150px; }
.pe-head { background: var(--surface-3); font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); font-weight: 700; }
.pe-head div { padding: 8px 8px; }
.pe-body { max-height: 44vh; overflow: auto; }
.pe-row { border-top: 1px solid var(--line); align-items: center; }
.pe-row:nth-child(even) { background: var(--surface-2); }
.pe-row.sel { background: #fff5e9; }
.pe-row .no { font-family: var(--mono); font-weight: 700; padding-left: 12px; color: var(--ink-2); }
.pe-row input, .pe-row select { width: 100%; border: 1px solid transparent; background: transparent; padding: 6px 7px; border-radius: 4px; font-size: 12.5px; }
.pe-row input:hover, .pe-row select:hover { border-color: var(--line); background: var(--surface); }
.pe-row input:focus, .pe-row select:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 2px rgba(47,111,235,.14); }
.pe-row .patched { font-size: 11px; color: var(--brand-ink); padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* import preview table */
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th { position: sticky; top: 0; background: var(--surface-3); text-align: left; padding: 7px 9px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); }
.tbl td { padding: 5px 9px; border-top: 1px solid var(--line); }
.tbl tbody tr:hover td { background: var(--surface-2); }
.scroller { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.cfgtext { width: 100%; height: 190px; font-family: var(--mono); font-size: 11.5px; border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 10px; resize: vertical; }
.checks { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.checks label { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.note { font-size: 12px; color: var(--ink-3); }
.callout { background: var(--brand-soft); border: 1px solid #c9dcff; color: var(--brand-ink); padding: 9px 12px; border-radius: var(--r-sm); font-size: 12.5px; }
.callout.bad { background: #fdecec; border-color: #f3c3c1; color: #96302c; }

/* ---------- toasts ---------- */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  background: var(--shell); color: #e9eefa; padding: 10px 14px; border-radius: var(--r-md);
  box-shadow: var(--shadow-2); font-size: 12.5px; max-width: 380px;
  animation: slidein .16s ease-out; border-left: 3px solid var(--brand);
}
.toast.warn { border-left-color: var(--warn); }
.toast.bad { border-left-color: var(--bad); }
.toast.good { border-left-color: var(--good); }
@keyframes slidein { from { opacity: 0; transform: translateX(14px); } }

/* ---------- svg canvases ---------- */
svg.stage { display: block; }
svg.stage text { user-select: none; }
.dev-hit { cursor: grab; }
.dev-hit:active { cursor: grabbing; }
.port-hit { cursor: pointer; }
.slot-hit { cursor: cell; }
.slot-hit:hover { fill: rgba(47,111,235,.08); }
.closet-card { cursor: grab; }
.cab-row { cursor: pointer; }
.statusline {
  font-size: 12px; color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 7px 12px; margin-bottom: 14px; display: inline-block; box-shadow: var(--shadow-1);
}
.cabbar { display: flex; gap: 10px; align-items: center; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cabbar select { padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; max-width: 260px; }
.cabbar .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-3); font-weight: 600; }

/* ==========================================================================
   Authentication screen + user management
   ========================================================================== */
.auth-wrap {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 30% -10%, #22304a, #0d131f);
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--surface);
  border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.5);
  padding: 32px 30px;
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-logo { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--brand), #7a5cf0); }
.auth-logo svg { width: 19px; height: 19px; }
.auth-brand b { font-size: 18px; }
.auth-card h1 { font-size: 20px; margin: 0 0 6px; }
.auth-sub { color: var(--ink-3); font-size: 13px; margin: 0 0 20px; line-height: 1.5; }
.auth-card label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2);
  margin-bottom: 14px; }
.auth-card label input {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: 8px; font-size: 14px;
}
.auth-card label input:focus { outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47,111,235,.15); }
.auth-btn { width: 100%; margin-top: 6px; padding: 11px; border: none; border-radius: 8px;
  background: var(--brand); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
.auth-btn:hover { background: var(--brand-ink); }
.auth-btn:disabled { opacity: .6; cursor: default; }
.auth-err { display: none; background: #fdecec; border: 1px solid #f3c3c1; color: #96302c;
  padding: 9px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }

/* header user chip */
.userchip { display: flex; align-items: center; gap: 8px; margin-left: 8px; }
.userchip .who { display: flex; flex-direction: column; line-height: 1.15; padding: 0 4px; }
.userchip .who b { font-size: 12.5px; color: #fff; }
.userchip .who small { font-size: 10.5px; color: var(--shell-ink-2); }

/* users table */
.users-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.users-tbl td { vertical-align: middle; }
.users-tbl .umeta { font-size: 11px; color: var(--ink-3); }
.users-tbl .uactions { text-align: right; white-space: nowrap; }
.users-tbl .uactions .btn { margin-left: 4px; }
.rolebadge { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.rolebadge.admin  { background: #ede4ff; color: #5b31c4; }
.rolebadge.editor { background: #e2f0ff; color: #1b5fb8; }
.rolebadge.viewer { background: var(--surface-3); color: var(--ink-2); }
.sitechecks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin: 6px 0; }
.sitecheck { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 400;
  text-transform: none; letter-spacing: 0; color: var(--ink); }

/* role-based hiding: viewers see no edit affordances */
body.role-viewer #btn-copy,
body.role-viewer #btn-paste,
body.role-viewer [data-menu="addmenu"],
body.role-viewer [data-menu="moremenu"] { display: none !important; }
/* only admins can add/delete whole sites (button hidden for editors via JS) */
