/* memgres panel — one stylesheet, dark by design. Fonts: fonts.css. */
[hidden] { display: none !important; }
  :root {
    color-scheme: dark;
    --ground: #0d111c;
    --canvas: #121829;
    --panel: #161d30;
    --panel-2: #1c2440;
    --line: #28314f;
    --line-soft: #1f2842;
    --text: #c9d0e6;
    --muted: #707aa0;
    --bright: #eff2fb;
    --brand: #62e38d;
    --admin: #ffa24c;
    --ok: #62e38d;
    --warn: #ff6b6b;
    --focus: #4fd6f2;
    --sc: #4fd6f2;
    --sans: "Onest", "Segoe UI", system-ui, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  }
  html, body { height: 100%; }
  body { margin: 0; background: var(--ground); color: var(--text); font: 400 14px/1.5 var(--sans); overflow: hidden; -webkit-font-smoothing: antialiased; }
  button, input, select, textarea { font: inherit; color: inherit; }
  :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
  code, .mono { font-family: var(--mono); }
  code { font-size: .92em; color: var(--bright); }
  .hexi { flex: none; display: block; }

  /* ─── shell ─── */
  .shell { height: 100%; display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 12px; padding-inline: 16px; padding-block: 12px; box-sizing: border-box; }
  .shell.collapsed { grid-template-columns: 64px minmax(0, 1fr); }
  .content { min-width: 0; min-height: 0; }
  .area { height: 100%; min-height: 0; }

  /* sidebar */
  .side { min-height: 0; display: flex; flex-direction: column; gap: 14px; background: var(--panel); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line-soft); padding: 12px 8px; box-sizing: border-box; }
  .side-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 2px 4px 0 8px; min-height: 30px; }
  .brand { font: 600 20px/1 var(--mono); color: var(--bright); letter-spacing: -.03em; white-space: nowrap; }
  .brand i { font-style: normal; color: var(--brand); }
  .brand .short { display: none; }
  .ghost { width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; flex: none; }
  .ghost:hover { background: var(--panel-2); color: var(--text); }
  .nav { display: grid; gap: 2px; }
  .navbtn { border: 0; background: transparent; border-radius: 9px; padding: 7px 10px; cursor: pointer; color: var(--muted); display: flex; align-items: center; gap: 10px; text-align: left; white-space: nowrap; }
  .navbtn svg { width: 18px; height: 18px; flex: none; }
  .navbtn .txt { flex: 1; }
  .navbtn:hover { color: var(--text); background: var(--panel-2); }
  .navbtn[aria-current="true"] { color: var(--bright); background: var(--panel-2); }
  .navbtn.admin[aria-current="true"] { color: var(--admin); }
  .badge { min-width: 18px; height: 18px; border-radius: 9px; background: var(--admin); color: #1d1204; font: 600 10.5px/18px var(--sans); padding: 0 5px; box-sizing: border-box; text-align: center; }
  .spaces-sec { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
  .sec-h { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 10px; display: flex; justify-content: space-between; }
  .space-filter { position: relative; margin: 0 2px; }
  .space-filter input { width: 100%; box-sizing: border-box; background: var(--canvas); border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: 8px; padding: 6px 8px 6px 28px; color: var(--bright); font-size: 13px; }
  .space-filter svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); }
  .spacelist { flex: 1; min-height: 0; overflow: auto; display: grid; gap: 2px; align-content: start; padding: 1px 2px; }
  .spaceitem { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 8px; border: 0; border-radius: 9px; background: transparent; color: var(--text); cursor: pointer; text-align: left; }
  .spaceitem:hover { background: var(--panel-2); }
  .spaceitem .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .spaceitem .ct { font: 500 11.5px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
  .spaceitem[aria-current="true"] { color: var(--bright); background: color-mix(in srgb, var(--c) 13%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 42%, transparent); }
  .spaceitem[aria-current="true"] .ct { color: var(--c); }
  .side-empty { font-size: 12.5px; color: var(--muted); padding: 4px 10px; margin: 0; }
  .side-foot { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 6px 0; border-top: 1px solid var(--line-soft); }
  .me { width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; background: var(--canvas); color: var(--focus); box-shadow: inset 0 0 0 1.5px var(--focus); font: 600 12px var(--sans); flex: none; }
  .me-name { min-width: 0; line-height: 1.25; }
  .me-name b { display: block; color: var(--bright); font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .me-name small { color: var(--muted); font-size: 12px; }
  .menu { position: absolute; left: 4px; bottom: 50px; z-index: 30; background: var(--panel-2); border-radius: 12px; padding: 6px; min-width: 210px; box-shadow: 0 0 0 1px var(--line), 0 18px 40px rgba(0,0,0,.5); display: grid; }
  .menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
  .menu .who b { display: block; color: var(--bright); font-weight: 500; }
  .menu .who small { color: var(--muted); }
  .menu button { text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
  .menu button:hover { background: var(--panel); }
  .shell.collapsed .side .txt, .shell.collapsed .side .badge, .shell.collapsed .sec-h, .shell.collapsed .space-filter,
  .shell.collapsed .spaceitem .nm, .shell.collapsed .spaceitem .ct, .shell.collapsed .me-name, .shell.collapsed .brand .full { display: none; }
  .shell.collapsed .brand .short { display: inline; }
  .shell.collapsed .side-head { flex-direction: column; padding: 0; }
  .shell.collapsed .navbtn, .shell.collapsed .spaceitem { justify-content: center; grid-template-columns: 18px; padding-inline: 0; justify-items: center; }
  .shell.collapsed .side-foot { justify-content: center; padding-inline: 0; }
  .shell.collapsed .navbtn { position: relative; }
  .mbar { display: none; }
  .scrim { display: none; }

  /* ─── memory area ─── */
  .mem { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 10px; }
  .toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
  .spacetitle { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .spacetitle h1 { margin: 0; font: 600 18px/1.2 var(--mono); color: var(--bright); letter-spacing: -.02em; white-space: nowrap; }
  .spacetitle small { font: 12px var(--mono); color: var(--muted); white-space: nowrap; }
  .perm-badge { font: 500 11px/1.8 var(--mono); padding: 0 8px; border-radius: 6px; background: var(--canvas); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
  .search { flex: 1 1 260px; min-width: 0; position: relative; }
  .search input { width: 100%; box-sizing: border-box; background: var(--panel); border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: 10px; padding: 8px 12px 8px 32px; color: var(--bright); }
  .search input::placeholder { color: var(--muted); }
  .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); }

  .workspace { display: grid; grid-template-columns: minmax(0, 1fr) 12px var(--insp-w, 360px); gap: 0; min-height: 0; }
  .workspace.with-results { grid-template-columns: minmax(0, 1fr) 310px 12px var(--insp-w, 360px); }
  .stage { position: relative; min-height: 0; border-radius: 14px; overflow: hidden; background: radial-gradient(1200px 800px at 50% 50%, #182038 0%, var(--canvas) 55%, #0f1424 100%); box-shadow: inset 0 0 0 1px var(--line-soft); }
  .viz-host { position: absolute; inset: 0; }
  .stagebar { position: absolute; left: 10px; right: 10px; top: 10px; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; pointer-events: none; }
  .stagebar > * { pointer-events: auto; }
  .segm { display: inline-flex; gap: 2px; background: rgba(13,17,28,.85); border-radius: 9px; padding: 3px; box-shadow: inset 0 0 0 1px var(--line); }
  .segm button { border: 0; background: transparent; color: var(--muted); border-radius: 7px; padding: 4px 10px; cursor: pointer; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
  .segm button:hover { color: var(--text); }
  .segm button[aria-pressed="true"] { background: var(--panel-2); color: var(--bright); }
  .segm .lbl { font-size: 11.5px; color: var(--muted); padding: 0 4px 0 6px; align-self: center; }
  .count { font: 12px var(--mono); color: var(--muted); white-space: nowrap; margin-left: auto; background: rgba(13,17,28,.85); padding: 4px 9px; border-radius: 8px; }
  .count b { color: var(--text); font-weight: 500; }
  .crumbs { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; width: max-content; max-width: 100%; }
  .crumbs nav { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; background: rgba(13,17,28,.85); border-radius: 9px; padding: 4px 8px 4px 6px; box-shadow: inset 0 0 0 1px var(--line); font: 12.5px var(--mono); }
  .crumbs button { border: 0; background: transparent; cursor: pointer; padding: 2px 5px; border-radius: 6px; color: var(--c, var(--text)); display: inline-flex; align-items: center; gap: 6px; font: inherit; }
  .crumbs button:hover { background: var(--panel-2); }
  .crumbs button[aria-current="true"] { color: var(--bright); cursor: default; background: transparent; }
  .crumbs .sep { color: var(--line); }
  .suggest { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 4; width: max-content; max-width: calc(100% - 120px); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: rgba(28,36,64,.95); border-radius: 12px; padding: 8px 8px 8px 14px; box-shadow: 0 0 0 1px var(--line), 0 14px 30px rgba(0,0,0,.4); font-size: 13px; }
  .zoom { position: absolute; right: 10px; bottom: 10px; z-index: 4; display: grid; gap: 5px; }
  .iconbtn { width: 32px; height: 32px; border-radius: 9px; border: 0; background: rgba(13,17,28,.85); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; display: grid; place-items: center; color: var(--text); }
  .iconbtn:hover { background: var(--panel-2); }
  .demo-flag { position: absolute; left: 10px; bottom: 10px; z-index: 3; font: 500 11px var(--mono); color: var(--muted); border: 1px dashed var(--line); padding: 2px 8px; border-radius: 6px; background: rgba(13,17,28,.6); }
  .keys-pop { position: absolute; right: 52px; bottom: 10px; z-index: 6; background: var(--panel-2); border-radius: 12px; padding: 12px 14px; box-shadow: 0 0 0 1px var(--line), 0 18px 40px rgba(0,0,0,.5); display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13px; }
  .keys-pop kbd { font: 500 11px/20px var(--mono); color: var(--bright); background: var(--canvas); border-radius: 5px; padding: 0 6px; box-shadow: inset 0 0 0 1px var(--line); justify-self: start; }
  .viz-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); padding: 16px; text-align: center; }

  /* graph */
  svg.graph { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; user-select: none; }
  svg.graph:active { cursor: grabbing; }
  .edge { fill: none; stroke-linecap: round; transition: opacity .2s; }
  .wiki { fill: none; stroke: #aeb6d6; stroke-width: 1.3; stroke-dasharray: 3 6; stroke-linecap: round; transition: opacity .2s; }
  .node { cursor: pointer; transition: opacity .2s; }
  .node .ring { stroke-width: 2; fill-opacity: .1; stroke-linejoin: round; }
  .node .ring.bare { stroke-dasharray: 4 4; stroke-width: 1.6; fill-opacity: .03; }
  .node .ring.hub { stroke-width: 2.6; fill-opacity: .1; }
  .node .bg { fill: var(--canvas); }
  .node .halo { fill: none; stroke-width: 10; opacity: 0; transition: opacity .2s; stroke-linejoin: round; }
  .node.sel .halo { opacity: .2; }
  .node.sel .ring { stroke-width: 3; fill-opacity: .2; }
  .node text { pointer-events: none; text-anchor: middle; dominant-baseline: central; font-family: var(--sans); font-weight: 500; }
  .node:focus-visible { outline: none; }
  .node:focus-visible .ring { stroke-dasharray: 6 3; }

  /* tree list */
  .treeviz { position: absolute; inset: 0; overflow: auto; padding: 58px 12px 60px; box-sizing: border-box; }
  .treeviz.local { padding-top: 96px; }
  .trow { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 2px; padding-left: calc(var(--lvl) * 20px); border-radius: 8px; }
  .trow:hover { background: rgba(28,36,64,.6); }
  .trow.sel { background: var(--panel-2); }
  .trow.ctx { opacity: .45; }
  .caret { width: 22px; height: 26px; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; display: grid; place-items: center; }
  .caret svg { transition: transform .15s; }
  .caret[aria-expanded="true"] svg { transform: rotate(90deg); }
  .tmain { display: flex; align-items: center; gap: 9px; min-width: 0; border: 0; background: none; text-align: left; cursor: pointer; padding: 5px 6px; border-radius: 7px; }
  .tseg { font: 500 13px var(--mono); color: var(--c); white-space: nowrap; }
  .tttl { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .tmeta { font: 11.5px var(--mono); color: var(--muted); white-space: nowrap; padding-right: 8px; display: flex; gap: 10px; }

  .tip { position: fixed; z-index: 20; pointer-events: none; max-width: 320px; padding: 10px 12px; border-radius: 10px; background: rgba(22,29,48,.97); box-shadow: 0 0 0 1px var(--line), 0 12px 30px rgba(0,0,0,.45); }
  .tip b { display: block; color: var(--bright); font-weight: 600; line-height: 1.3; text-wrap: balance; }
  .tip small { display: block; font: 11.5px var(--mono); color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
  .tip .tags { margin-top: 6px; }

  /* inspector */
  .inspector { min-height: 0; overflow: auto; border-radius: 14px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-soft); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
  .eyebrow { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
  .inspector h2 { margin: 0; font-size: 19px; line-height: 1.3; font-weight: 600; color: var(--bright); text-wrap: balance; overflow-wrap: anywhere; }
  .path { font: 12px/1.5 var(--mono); color: var(--muted); display: flex; flex-wrap: wrap; gap: 0 4px; }
  .path button { border: 0; background: none; padding: 0; cursor: pointer; color: var(--muted); font: inherit; }
  .path button:hover { color: var(--bright); }
  .tags { display: flex; flex-wrap: wrap; gap: 5px; }
  .tag { font: 11.5px/1.7 var(--mono); padding: 0 8px; border-radius: 999px; background: var(--canvas); box-shadow: inset 0 0 0 1px var(--line); }
  .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 1px; background: var(--line-soft); border-radius: 9px; overflow: hidden; }
  .stat { background: var(--canvas); padding: 8px 10px; min-width: 0; }
  .stat small { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .stat b { font: 500 16px/1.3 var(--mono); color: var(--bright); font-variant-numeric: tabular-nums; }
  .updated { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
  .updated b { color: var(--text); font-weight: 500; }
  .pill { font: 500 11px/1.7 var(--sans); padding: 0 8px; border-radius: 999px; color: var(--ok); box-shadow: inset 0 0 0 1px rgba(98,227,141,.45); }
  .body { line-height: 1.6; white-space: pre-wrap; }
  .body code { font-size: 12.5px; background: var(--canvas); padding: 1px 5px; border-radius: 5px; }
  .wl { border: 0; background: none; padding: 0; cursor: pointer; font: 12.5px var(--mono); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
  .h3 { margin: 0 0 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
  .list { display: grid; gap: 3px; }
  .list button { display: grid; grid-template-columns: 12px minmax(0, 1fr); align-items: center; column-gap: 9px; width: 100%; text-align: left; border: 0; background: transparent; border-radius: 8px; padding: 6px 8px; cursor: pointer; }
  .list button:hover { background: var(--panel-2); }
  .list button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
  .list button small { grid-column: 2; font: 11px var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: -2px; }
  .note { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin: 0; }
  .row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
  .btn { border: 0; box-shadow: inset 0 0 0 1px var(--line); background: var(--panel-2); color: var(--bright); border-radius: 9px; padding: 7px 13px; cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
  .btn:hover { box-shadow: inset 0 0 0 1px #3a4470; }
  .btn.primary { background: var(--focus); color: #041419; box-shadow: none; font-weight: 500; }
  .btn.primary:hover { filter: brightness(1.08); }
  .btn.quiet { background: transparent; }
  .btn.small { padding: 4px 10px; font-size: 12.5px; }
  .btn.danger { color: var(--warn); background: transparent; box-shadow: inset 0 0 0 1px rgba(255,107,107,.4); }
  .btn.adminbtn { background: var(--admin); color: #1d1204; box-shadow: none; font-weight: 500; }
  .btn[disabled] { opacity: .45; cursor: not-allowed; }
  .sw { border: 0; padding: 0; background: none; cursor: pointer; border-radius: 8px; display: grid; place-items: center; }
  .preview { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--canvas); font-size: 13px; }

  /* ─── pages ─── */
  .page { height: 100%; overflow: auto; }
  .page-in { max-width: 1000px; margin: 0 auto; display: grid; gap: 18px; padding-block: 6px 28px; }
  .page-head { display: grid; gap: 4px; }
  .page-head h1 { margin: 0; font-size: 26px; font-weight: 600; color: var(--bright); letter-spacing: -.01em; }
  .page-head p { margin: 0; color: var(--muted); max-width: 66ch; }
  .admin-band { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(255,162,76,.08); box-shadow: inset 0 0 0 1px rgba(255,162,76,.35); color: var(--admin); font-size: 13px; }
  .subnav { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
  .subnav button { border: 0; background: none; padding: 9px 12px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
  .subnav button[aria-selected="true"] { color: var(--bright); border-color: var(--focus); }
  .area-admin .subnav button[aria-selected="true"] { border-color: var(--admin); }
  .pane { display: grid; gap: 14px; }
  .card { background: var(--panel); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line-soft); padding: 16px; }
  .card-h { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
  .card-h h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--bright); }
  .x { overflow-x: auto; }
  table { width: 100%; border-collapse: collapse; font-size: 13px; }
  th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
  td { padding: 10px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; vertical-align: middle; }
  tr:last-child td { border-bottom: 0; }
  td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
  .strong { color: var(--bright); }
  .perm { font: 500 11px/1.8 var(--mono); padding: 0 8px; border-radius: 6px; background: var(--canvas); }
  .perm.write { color: var(--focus); }
  .perm.read { color: var(--muted); }
  .perm.admin { color: var(--admin); }
  .dot { display: inline-flex; align-items: center; gap: 7px; }
  .dot i { width: 7px; height: 7px; border-radius: 50%; }
  .dot.on i { background: var(--ok); }
  .dot.off { color: var(--muted); }
  .dot.off i { background: var(--muted); }
  .dot.wait { color: var(--admin); }
  .dot.wait i { background: var(--admin); }
  .kv { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; align-items: baseline; margin: 0; }
  .kv dt { color: var(--muted); font-size: 13px; }
  .kv dd { margin: 0; color: var(--bright); overflow-wrap: anywhere; }
  .kv select { background: var(--canvas); border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: 8px; padding: 5px 8px; color: var(--bright); }
  .verified { color: var(--ok); font-size: 12px; margin-left: 8px; }
  .item { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; border-radius: 12px; background: var(--canvas); }
  .item .grow { flex: 1 1 220px; min-width: 0; }
  .item b { color: var(--bright); font-weight: 500; }
  .item small { display: block; color: var(--muted); font: 12px var(--mono); overflow-wrap: anywhere; }
  .prov { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 600 12px var(--sans); flex: none; background: var(--canvas); box-shadow: inset 0 0 0 2px currentColor; }
  .stack { display: grid; gap: 8px; }
  .why { flex-basis: 100%; font-size: 13px; color: var(--text); padding-left: 46px; }
  .why em { font-style: normal; color: var(--admin); }
  .rule { font: 12px var(--mono); }
  .act-link, .act-create { color: var(--ok); }
  .act-pending { color: var(--admin); }
  .act-deny { color: var(--warn); }
  .filter { position: relative; max-width: 320px; }
  .filter input { width: 100%; box-sizing: border-box; background: var(--canvas); border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: 9px; padding: 7px 10px 7px 30px; color: var(--bright); }
  .filter svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); }
  .spacecell { display: inline-flex; align-items: center; gap: 8px; }
  pre.code { margin: 0; background: var(--ground); border-radius: 10px; padding: 12px; font: 12px/1.6 var(--mono); overflow-x: auto; color: var(--text); }

  /* ─── sign-in ─── */
  .gate { height: 100%; display: grid; grid-template-columns: 1.15fr 1fr; gap: 12px; padding-inline: 16px; padding-block: 12px; box-sizing: border-box; }
  .gate-art { position: relative; border-radius: 16px; overflow: hidden; background: radial-gradient(900px 640px at 50% 45%, #1a2240 0%, var(--canvas) 60%, #0e1322 100%); box-shadow: inset 0 0 0 1px var(--line-soft); }
  .gate-art canvas { width: 100%; height: 100%; display: block; }
  .gate-art .words { position: absolute; left: 32px; right: 32px; bottom: 30px; }
  .word { font: 600 46px/1 var(--mono); color: var(--bright); letter-spacing: -.04em; }
  .word i { font-style: normal; color: var(--brand); }
  .gate-art p { margin: 12px 0 0; font-size: 16px; max-width: 40ch; color: var(--text); }
  .gate-door { position: relative; display: grid; align-content: center; justify-items: center; border-radius: 16px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-soft); padding: 56px 16px 28px; overflow: auto; }
  .gate-lang { position: absolute; top: 14px; right: 14px; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
  .gate-lang select { background: var(--canvas); border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: 8px; padding: 4px 8px; color: var(--bright); }
  .door { width: 100%; max-width: 380px; display: grid; gap: 16px; }
  .route { font: 12px var(--mono); color: var(--muted); }
  .door h1 { margin: 0; font-size: 24px; font-weight: 600; color: var(--bright); }
  .door .lead { margin: -8px 0 0; color: var(--muted); font-size: 13.5px; }
  .door .providers { display: grid; gap: 8px; }
  .door .providers button { display: flex; align-items: center; gap: 12px; border: 0; box-shadow: inset 0 0 0 1px var(--line); background: var(--canvas); border-radius: 12px; padding: 11px 12px; cursor: pointer; text-align: left; }
  .door .providers button:hover { box-shadow: inset 0 0 0 1px #3a4470; background: var(--panel-2); }
  .door .providers b { display: block; color: var(--bright); font-weight: 500; }
  .door .providers small { color: var(--muted); font-size: 12.5px; }
  .fine { font-size: 12.5px; color: var(--muted); margin: 0; }
  .redirected { padding: 10px 12px; border-radius: 10px; background: rgba(255,162,76,.07); box-shadow: inset 0 0 0 1px rgba(255,162,76,.35); color: var(--text); font-size: 13px; }
  .err { color: var(--warn); font-size: 12.5px; margin: 0; }
  .linkbtn { border: 0; background: none; padding: 0; color: var(--focus); cursor: pointer; font-size: 13px; justify-self: start; }
  .demo-box { display: grid; gap: 8px; border-top: 1px dashed var(--line); padding-top: 12px; font: 12px var(--mono); color: var(--muted); }
  .demo-box label { display: flex; gap: 8px; align-items: center; cursor: pointer; }

  /* dialog + toast */
  .veil { position: fixed; inset: 0; z-index: 40; background: rgba(5,8,15,.7); display: grid; place-items: center; padding: 16px; }
  .dialog { width: 100%; max-width: 580px; max-height: calc(100% - 32px); overflow: auto; box-sizing: border-box; background: var(--panel); border-radius: 16px; box-shadow: 0 0 0 1px var(--line), 0 30px 70px rgba(0,0,0,.55); padding: 20px; display: grid; gap: 14px; }
  .dialog h3 { margin: 0; font-size: 18px; font-weight: 600; color: var(--bright); overflow-wrap: anywhere; }
  .field { display: grid; gap: 5px; }
  .field label { font-size: 12.5px; color: var(--muted); }
  .field input, .field select { background: var(--canvas); border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: 9px; padding: 8px 10px; color: var(--bright); min-width: 0; }
  .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .secret { display: flex; gap: 8px; align-items: center; background: var(--canvas); border-radius: 10px; padding: 10px; box-shadow: inset 0 0 0 1px rgba(98,227,141,.45); }
  .secret code { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ok); overflow-wrap: anywhere; }
  .snips { display: flex; gap: 4px; flex-wrap: wrap; }
  .snips button { border: 0; background: none; border-radius: 7px; padding: 4px 10px; cursor: pointer; color: var(--muted); font-size: 12.5px; box-shadow: inset 0 0 0 1px var(--line); }
  .snips button[aria-selected="true"] { color: var(--bright); background: var(--panel-2); }
  .toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; background: var(--panel-2); color: var(--bright); padding: 9px 14px; border-radius: 10px; box-shadow: 0 0 0 1px var(--line), 0 12px 30px rgba(0,0,0,.45); font-size: 13px; max-width: calc(100% - 32px); box-sizing: border-box; }

  @media (max-width: 1100px) {
    .workspace { grid-template-columns: minmax(0, 1fr) 12px var(--insp-w, 320px); }
    .workspace.with-results { grid-template-columns: minmax(0, 1fr) 280px 12px var(--insp-w, 320px); }
  }
  @media (max-width: 960px) {
    body { overflow: auto; }
    .workspace, .workspace.with-results { grid-template-columns: 1fr; grid-template-rows: minmax(380px, 1fr) auto auto; gap: 10px; }
    .splitter { display: none; }
    .results { margin-left: 0 !important; max-height: 50vh; }
    .inspector { max-height: none; }
    .gate { grid-template-columns: 1fr; grid-template-rows: 200px auto; height: auto; min-height: 100%; }
    .word { font-size: 32px; }
    .kv { grid-template-columns: 1fr; gap: 2px 0; }
    .kv dd { margin-bottom: 10px; }
    .two { grid-template-columns: 1fr; }
    .suggest { max-width: calc(100% - 70px); left: 10px; transform: none; }
  }
  @media (max-width: 760px) {
    .shell, .shell.collapsed { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: auto; min-height: 100%; }
    .mbar { display: flex; align-items: center; gap: 10px; }
    .mbar .cur { display: flex; align-items: center; gap: 7px; margin-left: auto; font: 500 13px var(--mono); color: var(--bright); }
    .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(280px, 85vw); z-index: 50; border-radius: 0 14px 14px 0; transform: translateX(-105%); transition: transform .2s; padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
    .shell.drawer .side { transform: none; }
    .shell.drawer .scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(5,8,15,.6); }
    #collapse { display: none; }
    .shell.collapsed .side .txt, .shell.collapsed .sec-h, .shell.collapsed .space-filter, .shell.collapsed .spaceitem .nm, .shell.collapsed .spaceitem .ct, .shell.collapsed .me-name, .shell.collapsed .brand .full { display: revert; }
    .shell.collapsed .brand .short { display: none; }
    .spacetitle { display: none; }
    .count { display: none; }
    .why { padding-left: 0; }
    .demo-flag { display: none; }
    .tttl { display: none; }
  }
  @media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ─── panel additions (links styled as buttons, provider links) ─── */
a.navbtn, .subnav a, .menu a, a.linkbtn, a.prov-btn { text-decoration: none; }
.subnav a { padding: 9px 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a[aria-selected="true"] { color: var(--bright); border-color: var(--focus); }
.menu a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.menu a:hover { background: var(--panel); }
.door .providers .prov-btn { display: flex; align-items: center; gap: 12px; box-shadow: inset 0 0 0 1px var(--line); background: var(--canvas); border-radius: 12px; padding: 11px 12px; color: var(--text); }
.door .providers .prov-btn:hover { box-shadow: inset 0 0 0 1px #3a4470; background: var(--panel-2); }
.door .providers .prov { color: var(--focus); }
.empty-prov { padding: 12px; border-radius: 12px; background: var(--canvas); color: var(--muted); font-size: 13px; }
.gate[hidden], .shell[hidden] { display: none !important; }

a.spaceitem { text-decoration: none; }
.node text.sub { fill: var(--muted); font-family: var(--mono); }
.qmark { font: 600 14px var(--sans); }
.snippet { margin: -2px 8px 6px 29px; font-size: 12.5px; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.wl.dangling { color: var(--muted); text-decoration-style: dotted; cursor: help; }
.tmore { margin: 10px 0 0 22px; }
.viz-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); padding: 16px; text-align: center; }

.auth-note { padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.5; }
.auth-note.wait { background: rgba(255,162,76,.07); box-shadow: inset 0 0 0 1px rgba(255,162,76,.35); color: var(--text); }
.auth-note.bad { background: rgba(255,107,107,.07); box-shadow: inset 0 0 0 1px rgba(255,107,107,.35); color: var(--text); }
.auth-note.good { background: rgba(98,227,141,.07); box-shadow: inset 0 0 0 1px rgba(98,227,141,.35); color: var(--text); }
.item .prov { color: var(--focus); font-size: 11px; }
a.btn { text-decoration: none; }

/* ─── people & spaces ─── */
a.person { color: var(--bright); text-decoration: none; box-shadow: inset 0 -1px 0 var(--line); }
a.person:hover { color: var(--focus); box-shadow: inset 0 -1px 0 var(--focus); }
.cell-sub { display: block; font: 12px var(--mono); color: var(--muted); margin-top: 2px; }
.person-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.person-head .page-head p { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--canvas); color: var(--focus); box-shadow: inset 0 0 0 1.5px var(--focus); font: 600 17px var(--sans); }
.sel { background: var(--canvas); border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: 8px; padding: 5px 8px; color: var(--bright); font-size: 13px; }
.invite-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.invite-row .field.grow { flex: 1 1 240px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); padding-bottom: 8px; cursor: pointer; }
.secret.plain { box-shadow: inset 0 0 0 1px var(--line); }
.secret.plain code { color: var(--text); }
.subnav a .badge { display: inline-block; margin-left: 4px; vertical-align: 1px; }
.card-h .badge { display: inline-block; }
.item.pick { width: 100%; border: 0; text-align: left; cursor: pointer; color: var(--text); }
.item.pick:hover { background: var(--panel-2); }
.wait-dot { font: 600 10.5px/18px var(--sans); min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; box-sizing: border-box; text-align: center; background: var(--admin); color: #1d1204; }
.shell.collapsed .spaceitem .wait-dot { display: none; }

/* activity heatmap */
.heatmap { display: block; }
.page-in, .pane { grid-template-columns: minmax(0, 1fr); }
.person-head .page-head { min-width: 0; flex: 1 1 200px; }
.person-head h1 { overflow-wrap: anywhere; }
.heatmap .hm-lbl { fill: var(--muted); font: 10px var(--sans); }
.hm { fill: var(--brand); }
.hm.l0 { fill: var(--line-soft); }
.hm.l1 { fill-opacity: .28; }
.hm.l2 { fill-opacity: .5; }
.hm.l3 { fill-opacity: .74; }
.hm.l4 { fill-opacity: 1; }
.hm-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-start; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.hm-legend span { padding: 0 4px; }
.act-split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; margin-top: 14px; }
.bars { display: grid; gap: 6px; }
.bar { display: grid; grid-template-columns: minmax(0, 140px) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 12.5px; }
.bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.bar i { display: block; height: 8px; border-radius: 4px; background: var(--brand); opacity: .75; }
.bar b { font: 500 12px var(--mono); color: var(--bright); font-variant-numeric: tabular-nums; }

/* record history in the inspector */
.hist { display: grid; gap: 6px; }
.hrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 10px; align-items: baseline; font-size: 13px; }
.hrow .op { font: 500 11px var(--mono); color: var(--muted); }
.hrow a.person, .hrow > span.note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hrow small { grid-column: 2 / -1; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }

/* a space you cannot open */
.noaccess { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; overflow: auto; }
.noaccess .card { max-width: 440px; display: grid; gap: 12px; justify-items: start; background: rgba(22,29,48,.94); }
.noaccess h2 { margin: 0; font-size: 20px; color: var(--bright); }
.noaccess #na-state { width: 100%; }

@media (max-width: 760px) {
  .act-split { grid-template-columns: 1fr; }
  .bar { grid-template-columns: minmax(0, 100px) minmax(0, 1fr) auto; }
}

/* spaces a superadmin opened by its role, not as a member */
.visiting-h { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); color: var(--admin); }
.spaceitem.visiting { grid-template-columns: 18px minmax(0, 1fr) auto; }
.spaceitem.visiting .nm { color: var(--muted); font-style: italic; }
.spaceitem.visiting[aria-current="true"] .nm { color: var(--bright); }
.spaceitem .forget { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; border-radius: 5px; }
.spaceitem .forget:hover { color: var(--bright); background: var(--panel); }
.every-link { margin: 8px 8px 4px; justify-self: start; border: 0; background: none; padding: 2px 0; color: var(--admin); cursor: pointer; font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,162,76,.4); }
.every-link:hover { text-decoration-color: var(--admin); }
.perm-badge.role { color: var(--admin); box-shadow: inset 0 0 0 1px rgba(255,162,76,.45); }
.every-list { max-height: min(60vh, 520px); overflow: auto; }
.shell.collapsed .visiting-h, .shell.collapsed .every-link, .shell.collapsed .spaceitem .forget { display: none; }

/* the sign-in picture can be pulled about; the words over it stay out of the way */
.gate-art canvas { touch-action: none; }
.gate-art .words { pointer-events: none; }

/* ─── search results column, the record panel's edge, markdown bodies ─── */
.results { margin-left: 10px; min-height: 0; overflow: auto; border-radius: 14px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-soft); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.res-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.res-head b { display: block; color: var(--bright); font-weight: 600; font-size: 14px; margin-top: 4px; overflow-wrap: anywhere; }
.res-wait { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; padding: 6px 2px; }
.list.stale { opacity: .5; transition: opacity .15s; }
.list button[aria-current="true"] { background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--focus); animation: spin .8s linear infinite; flex: none; box-sizing: border-box; }
@keyframes spin { to { transform: rotate(360deg); } }
.search.busy svg { visibility: hidden; }
.search.busy::before { content: ""; position: absolute; left: 10px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--focus); animation: spin .8s linear infinite; box-sizing: border-box; }

.splitter { cursor: col-resize; position: relative; touch-action: none; outline: none; }
.splitter::after { content: ""; position: absolute; top: 18%; bottom: 18%; left: 50%; width: 2px; margin-left: -1px; border-radius: 2px; background: transparent; transition: background .15s; }
.splitter:hover::after, .splitter.on::after, .splitter:focus-visible::after { background: var(--focus); }

.body.md { white-space: normal; overflow-wrap: anywhere; }
.body.md > :first-child { margin-top: 0; }
.body.md > :last-child { margin-bottom: 0; }
.body.md p { margin: .55em 0; }
.body.md h1, .body.md h2, .body.md h3, .body.md h4, .body.md h5, .body.md h6 { color: var(--bright); line-height: 1.3; margin: 1.1em 0 .45em; font-weight: 600; }
.body.md h1 { font-size: 1.25em; } .body.md h2 { font-size: 1.15em; } .body.md h3 { font-size: 1.05em; } .body.md h4, .body.md h5, .body.md h6 { font-size: 1em; }
.body.md ul, .body.md ol { margin: .5em 0; padding-left: 1.35em; }
.body.md li { margin: .2em 0; }
.body.md li > p { margin: .2em 0; }
.body.md strong { color: var(--bright); font-weight: 600; }
.body.md a { color: var(--focus); text-underline-offset: 3px; }
.body.md blockquote { margin: .6em 0; padding: .1em 0 .1em 12px; border-left: 3px solid var(--line); color: var(--muted); }
.body.md hr { border: 0; border-top: 1px solid var(--line); margin: 1em 0; }
.body.md pre { background: var(--canvas); border-radius: 8px; padding: 10px 12px; overflow-x: auto; margin: .6em 0; }
.body.md pre code { background: none; padding: 0; font-size: 12px; line-height: 1.55; white-space: pre; }
.body.md table { display: block; overflow-x: auto; max-width: 100%; border-collapse: collapse; margin: .7em 0; font-size: 12.5px; width: max-content; }
.body.md th, .body.md td { border: 1px solid var(--line); padding: 5px 9px; white-space: normal; vertical-align: top; text-align: left; min-width: 60px; }
.body.md th { background: var(--canvas); color: var(--bright); font-weight: 600; font-size: 12.5px; }
.body.md tr:last-child td { border-bottom: 1px solid var(--line); }
.body.md input[type=checkbox] { margin-right: 6px; }
.body.md .md-img { color: var(--muted); font-style: italic; }

/* the space's own node */
.node.hubnode .hub-ring { fill: none; stroke-width: 1.4; opacity: .5; stroke-linejoin: round; }
.node.hubnode .ring.hub { stroke-width: 3.2; fill-opacity: .22; }
.node.hubnode .halo { opacity: .12; stroke-width: 18; }
.node.hubnode.sel .halo { opacity: .22; }
@media (prefers-reduced-motion: reduce) { .spinner, .search.busy::before { animation-duration: 2.4s; } }
/* the results header — the query and × — stays put while the list scrolls under it */
.results > .res-head { position: sticky; top: -14px; z-index: 2; margin: -14px -14px 0; padding: 14px 14px 10px; background: var(--panel); border-radius: 14px 14px 0 0; box-shadow: 0 1px 0 var(--line-soft); }

/* people directory pages, recent edits, switches, connection how-to */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pager .note { margin-right: auto; }
.recent { display: grid; gap: 2px; }
.rrow { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 7px 8px; border-radius: 8px; text-decoration: none; color: var(--text); }
.rrow:hover { background: var(--panel-2); }
.rrow .op { font: 500 11px var(--mono); color: var(--muted); }
.rrow .rt { min-width: 0; }
.rrow .rt b { display: block; font-weight: 500; color: var(--bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rrow .rt small { display: flex; align-items: center; gap: 6px; font: 11.5px var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rrow time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text); }
.switch input { width: 16px; height: 16px; accent-color: var(--admin); }
.howto .steps { margin: 0; padding-left: 1.3em; display: grid; gap: 10px; }
.howto .steps li { line-height: 1.55; }
.howto .snips { margin: 8px 0 6px; }
.howto pre.code { margin-top: 6px; }
@media (max-width: 760px) { .rrow { grid-template-columns: minmax(0, 1fr) auto; } .rrow .op { display: none; } }
.every-link.make { color: var(--focus); text-decoration-color: rgba(79,214,242,.4); }
.every-link.make:hover { text-decoration-color: var(--focus); }
/* blame: the same text, banded by whoever wrote each piece of it */
.blame-key { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 12px;
  margin-bottom: 9px; font-size: 12px; }
.blame-key .who { display: inline-flex; align-items: center; gap: 5px; color: var(--c); }
.blame-key .who small { color: var(--muted); font: 11px var(--mono); }
.blame-key a { text-decoration: none; }
.blame-key .note { flex-basis: 100%; font-size: 11.5px; }
.body.blame [data-bt]:not(tr) { border-left: 3px solid var(--c, var(--line));
  padding: 2px 0 2px 9px; border-radius: 0 6px 6px 0;
  background: color-mix(in srgb, var(--c, transparent) 8%, transparent); }
.body.blame [data-bt]:hover { background: color-mix(in srgb, var(--c, transparent) 18%, transparent); }
/* a table row is banded on its first cell: under border-collapse a border on
   the row itself is the browser's to ignore */
.body.blame tr[data-bt] { background: color-mix(in srgb, var(--c, transparent) 8%, transparent); }
.body.blame tr[data-bt] > :first-child { border-left: 3px solid var(--c, var(--line)); }
.body.blame > [data-bt] { margin: 3px 0 3px -12px; }
.body.blame > [data-bt] > :first-child { margin-top: 0; }
.body.blame > [data-bt] > :last-child { margin-bottom: 0; }
.body.blame ul, .body.blame ol { padding-left: 2em; }
.body.blame li[data-bt] { margin: 3px 0; }
.tip .bt + .bt { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.tip .bt small:first-of-type { color: var(--text); }

/* choosing a colour for a space or a branch: a palette behind one button */
.pal-dialog { max-width: 380px; }
.pal-now { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text); }
.palgrid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.palgrid .sw { width: 100%; aspect-ratio: 1; border-radius: 8px; background: var(--c);
  border: 2px solid transparent; }
.palgrid .sw:hover { border-color: var(--text); }
.palgrid .sw[aria-pressed="true"] { border-color: var(--bright); box-shadow: 0 0 0 2px var(--canvas), 0 0 0 4px var(--bright); }
.pal-opts { display: grid; gap: 6px; }
.pal-opt { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  border: 0; box-shadow: inset 0 0 0 1px var(--line); background: transparent;
  color: var(--text); border-radius: 9px; padding: 8px 10px; cursor: pointer; font-size: 13px; }
.pal-opt:hover { box-shadow: inset 0 0 0 1px #3a4470; }
.pal-opt[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--bright); color: var(--bright); }
