  /* ── loca · theme C: the table, in monospace ─────────────────────────
     dark terminal aesthetic · flat lines, no bubbles
     glyphs: * agent  ·  . human  ·  square = the table (logo)          */
  :root {
    --bg: #0b0e12; --panel: #10141a; --panel2: #161b23; --line: #232a35;
    --txt: #d7dde6; --muted: #778397; --dim: #5e697a;
    --accent: #2ee6c8; --accent2: #7ef0dd;
    --agent: #5ab8ff; --human: #57d9a3; --me: #2ee6c8;
    --iye: #c9a7ff; --iye-deep: #392654;
    --warn: #ffb066; --bad: #ff6b6b;
    --mono: ui-monospace, "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
  }
  * { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
  ::-webkit-scrollbar { width: 9px; height: 9px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px;
    border: 2px solid var(--bg); }
  ::-webkit-scrollbar-thumb:hover { background: var(--dim); }
  ::-webkit-scrollbar-corner { background: transparent; }
  html, body { height: 100%; margin: 0; }
  body {
    background: var(--bg); color: var(--txt);
    font: 13px/1.6 var(--mono);
    display: grid; grid-template-columns: 320px 1fr; height: 100vh;
  }
  .hidden { display: none !important; }
  .wikiview { position: relative; padding: 0 !important; background: var(--bg); }
  .wikiheader { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 30px 18px; border-bottom: 1px solid var(--line); }
  .wikikicker { font-size: 9px; letter-spacing: .16em; color: var(--dim); }
  .wikiheader h2 { font-size: 22px; font-weight: 600; letter-spacing: -.04em; margin: 3px 0 0; }
  .wikiactions { display: flex; align-items: center; gap: 10px; }
  .wikiheader .wikiactions { flex-wrap: wrap; justify-content: flex-end; }
  .wikiactions button, .wikisettingshead button { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 7px; padding: 6px 10px; cursor: pointer; }
  .wikiactions button:hover { color: var(--accent); border-color: var(--accent); }
  .wikieditorcontrol { display: flex; align-items: center; gap: 8px; font-size: 10px; color: var(--muted); }
  .wikieditorcontrol .leadselect { max-width: 190px; padding: 6px 10px; border-color: var(--line); color: var(--accent2); background: var(--panel2); }
  .wikieditorname, .wikimeta { color: var(--dim); font-size: 10px; }
  .wikimeta { padding: 10px 30px; border-bottom: 1px solid var(--line); }
  .wikiedit { margin: 24px auto; padding: 0 24px; max-width: 850px; }
  .wikiedit label { display: block; color: var(--muted); margin: 12px 0; }
  .wikiedit input, .wikiedit textarea { display: block; box-sizing: border-box; width: 100%; margin-top: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--txt); font: 13px/1.6 var(--mono); }
  .wikiedit textarea { resize: vertical; }
  .wikiedit p, #wikiEditStatus { color: var(--muted); font-size: 11px; margin: 12px 0; }
  .wikicompose { margin: 16px 30px; padding: 18px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
  .wikicompose h3 { font-size: 14px; margin: 0 0 14px; font-weight: 500; }
  .wikicompose label { display: block; color: var(--muted); font-size: 12px; }
  .wikicompose select, .wikicompose textarea { box-sizing: border-box; display: block; width: 100%; margin: 7px 0; padding: 10px; background: var(--bg); color: var(--txt); border: 1px solid var(--line); border-radius: 6px; font: 12px/1.5 var(--mono); }
  .wikicompose textarea { resize: vertical; }
  .wikicompose p, #wikiShareStatus, #wikiUpdateStatus { font-size: 11px; line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; }
  .wikicompose [role="status"] { margin-top: 10px; }
  .wikiactions button:disabled { opacity: .45; cursor: default; }
  .wikilayout { display: grid; grid-template-columns: 190px minmax(0, 1fr); min-height: 360px; }
  .wikiindex { padding: 24px 12px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
  .wikiindex:empty { display: none; }
  .wikilayout:has(.wikiindex:empty) { grid-template-columns: 1fr; }
  .wikiindex button { text-align: left; border: 0; background: transparent; color: var(--muted); padding: 10px 12px; border-radius: 6px; font: 11px var(--mono); cursor: pointer; overflow-wrap: anywhere; }
  .wikiindex button:hover { color: var(--txt); background: var(--panel2); }
  .wikiindex button.active { color: var(--accent2); background: rgba(46,230,200,.07); }
  .wikipages { min-width: 0; padding: 34px clamp(20px, 5vw, 64px) 60px; }
  .wikidocument { max-width: 800px; margin: auto; }
  .wikidocument h1 { margin: 0 0 28px; font-size: 28px; font-weight: 600; letter-spacing: -.04em; }
  .wikibody { font-family: system-ui, sans-serif; font-size: 15px; line-height: 1.85; overflow-wrap: anywhere; }
  .wikisources { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 36px; color: var(--dim); font-size: 10px; }
  .wikisources button { border: 0; background: transparent; color: var(--accent2); cursor: pointer; font: 11px var(--mono); }
  .wikiempty { text-align: center; max-width: 460px; margin: 40px auto; }
  .wikiemptyglyph { color: var(--accent); font-size: 42px; }
  .wikiempty h3 { font-size: 19px; font-weight: 500; margin: 18px 0 10px; }
  .wikiempty p { color: var(--muted); font-size: 12px; }
  .wikiprimary { margin-top: 18px; background: rgba(46,230,200,.08); border: 1px solid var(--accent); color: var(--accent2); padding: 9px 16px; border-radius: 7px; cursor: pointer; }
  .wikisettings { position: absolute; top: 0; right: 0; bottom: 0; width: min(360px, 100%); z-index: 4; background: var(--panel); border-left: 1px solid var(--line); box-shadow: -12px 0 30px rgba(0,0,0,.25); padding: 24px; }
  .wikisettingshead { display: flex; align-items: center; justify-content: space-between; }
  .wikisettingshead h3 { margin: 0; font-size: 16px; font-weight: 500; }
  .wikisettings p { color: var(--muted); font-size: 12px; margin: 24px 0; }
  .wikimaintenance { border-top: 1px solid var(--line); padding-top: 18px; display: flex; justify-content: space-between; gap: 12px; font-size: 11px; }
  .wikimaintenance b { font-weight: 400; color: var(--dim); }
  @media (max-width: 700px) {
    .wikiheader { flex-wrap: wrap; padding: 18px; gap: 14px; }
    .wikiactions { margin-left: auto; flex-wrap: wrap; }
    .wikimeta { padding: 10px 18px; }
    .wikicompose { margin: 14px 18px; }
    .wikilayout { grid-template-columns: 1fr; }
    .wikiindex { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px; }
    .wikiindex button { flex: 0 0 auto; }
    .wikipages { padding: 24px 20px 40px; }
  }
  /* Locked: the table is not merely empty, it is not shown. A stranger sees
     a door, not a dimmed room with clickable furniture. */
  body.locked .main { display: none; }
  body.locked { grid-template-columns: 1fr; place-items: center; background: var(--bg); }
  body.locked .side { width: min(420px, 92vw); height: auto; max-height: 92vh; border: 1px solid var(--line);
    border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.55); }
  body.locked .rooms, body.locked .newroom, body.locked .online, body.locked .whoami,
  body.locked .sideviewtabs, body.locked .sideview { display: none; }
  body.auth-pending .conn, body.auth-pending .sideviewtabs,
  body.auth-pending .sideview, body.auth-pending .main { visibility: hidden; }
  body.auth-pending .doorline { display: block; }
  body.locked .side h1 button { display: none; }
  /* ...but a first-time Host arrives at the locked door — keep the Getting
     Started "?" reachable there so the guide can be reopened before connecting. */
  body.locked .side h1 #helpBtn { display: inline-block; }
  body.locked .conn { border-bottom: 0; padding: 14px 18px 18px; }
  /* The sign-in page. Two halves on a wide screen: what loca is (.signinhero)
     and the sign-in card (the sidebar, which is all that is shown while
     locked). One column on a narrow one. Only looks: every control keeps its
     id and behaviour. */
  .signinhero { display: none; }
  body.locked { gap: 24px; padding: 24px 16px; min-height: 100vh; align-content: center;
    background:
      radial-gradient(900px 520px at 18% 12%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 62%),
      radial-gradient(700px 480px at 88% 92%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 60%),
      var(--bg); }
  body.locked .signinhero { display: flex; flex-direction: column; gap: 14px; width: min(440px, 92vw); }
  body.auth-pending .signinhero { visibility: hidden; }
  .herobrand { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 600; letter-spacing: .01em; color: var(--txt); }
  .herotitle { margin: 6px 0 0; font-size: clamp(22px, 3.1vw, 34px); line-height: 1.18; font-weight: 600; color: var(--txt);
    letter-spacing: -.01em; text-wrap: balance; }
  @media (min-width: 980px) {
    body.locked { grid-template-columns: minmax(0, 520px) auto; column-gap: clamp(32px, 6vw, 88px);
      justify-content: center; align-items: center; padding: 40px; }
    body.locked .signinhero { width: auto; gap: 18px; }
  }
  body.locked .herosource { margin: 18px 0 0; color: var(--dim); font-size: 11px; }
  body.locked .herosource a { color: var(--accent2); }
  /* The card. */
  /* The card may be taller than the window (a short laptop screen, the
     desktop client's default window): it scrolls inside itself, so no control
     is ever out of the mouse's reach. */
  body.locked .side { width: min(440px, 92vw); border-radius: 18px; background: var(--panel);
    border-color: color-mix(in srgb, var(--accent) 16%, var(--line)); overflow-y: auto; }
  body.locked .side h1 { padding: 18px 22px 14px; }
  body.locked .doorline { padding: 0 22px; color: var(--muted); font-size: 12px; line-height: 1.6; }
  body.locked .conn { padding: 16px 22px 22px; display: flex; flex-direction: column; gap: 6px; }
  body.locked .conn .signintitle { margin: 4px 0 8px; font-size: 20px; font-weight: 600; letter-spacing: -.01em; color: var(--txt); }
  body.locked .conn label { margin-top: 8px; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  body.locked .conn input, body.locked .conn select { width: 100%; min-height: 42px; padding: 0 12px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--panel2); color: var(--txt); font: inherit; font-size: 13px;
    transition: border-color .15s, box-shadow .15s; }
  body.locked .conn input::placeholder { color: var(--dim); }
  body.locked .conn input:focus-visible, body.locked .conn select:focus-visible { outline: none;
    border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
  body.locked .conn #memberEntry, body.locked .conn #masterEntry { display: flex; flex-direction: column; gap: 6px; }
  body.locked .conn #memberEntry.hidden, body.locked .conn #masterEntry.hidden { display: none; }
  body.locked .conn .devnote { margin: 2px 0 0; text-align: left; font-size: 11px; line-height: 1.5; color: var(--dim); }
  body.locked .conn #connectBtn { margin-top: 12px; width: 100%; min-height: 44px; border-radius: 10px; font: inherit;
    font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid var(--accent); background: var(--accent);
    color: var(--bg); transition: filter .15s, transform .05s; }
  body.locked .conn #connectBtn:hover { filter: brightness(1.08); }
  body.locked .conn #connectBtn:active { transform: translateY(1px); }
  body.locked .conn #connectBtn.off { background: color-mix(in srgb, var(--accent) 14%, var(--panel2));
    border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); color: var(--accent2); }
  body.locked .conn .entryswitch, body.locked .conn #joinRequestBtn { width: 100%; min-height: 38px; margin-top: 8px;
    border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: inherit;
    font-size: 12px; cursor: pointer; transition: color .15s, border-color .15s; }
  body.locked .conn .entryswitch:hover, body.locked .conn #joinRequestBtn:hover { color: var(--txt); border-color: var(--muted); }
  body.locked .conn .joinreq { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); display: flex;
    flex-direction: column; gap: 4px; }
  body.locked .conn .joinreq.hidden { display: none; }
  .signintitle { margin: 2px 0 4px; font-size: 15px; font-weight: 700; color: var(--txt); letter-spacing: .2px; }
  .doorline { padding: 0 18px 14px; color: var(--muted); font-size: 12px; line-height: 1.5; }
  /* Signed in, there is no door to talk at. Waiting on a held session there
     is: the line says what it waits for (app.js showAuthUnavailable). */
  body:not(.locked):not(.auth-pending) .doorline { display: none; }
  .doorline button { margin-top: 8px; }
  a { color: var(--accent2); }
  :where(button, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px;
  }

  /* ── sidebar ── */
  .side { background: var(--panel); border-right: 1px solid var(--line);
    display: flex; flex-direction: column; overflow: hidden; height: 100vh; }
  .side > h1, .side > .whoami, .side > .conn, .side > .newroom,
  .side > .lobby { flex: 0 0 auto; }
  .side > .rooms { flex: 0 1 auto; min-height: 60px; max-height: 38vh; }
  .side > .online { flex: 1 1 auto; min-height: 150px; max-height: none; }
  .sideviewtabs { flex: 0 0 auto; display: grid; grid-template-columns: 1fr 1fr;
    gap: 3px; padding: 7px 10px; border-bottom: 1px solid var(--line); background: var(--panel); }
  .sideviewtabs button { border: 1px solid transparent; border-radius: 7px; padding: 6px 8px;
    background: transparent; color: var(--muted); font: 700 10px var(--mono); cursor: pointer; }
  .sideviewtabs button:hover:not(:disabled) { color: var(--txt); background: var(--panel2); }
  .sideviewtabs button.active { color: var(--accent2); border-color: var(--line); background: var(--panel2); }
  .sideviewtabs button:disabled { opacity: .38; cursor: not-allowed; }
  .sideview { flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
  .buildingview .rooms { flex: 1 1 auto; min-height: 60px; max-height: none; }
  .buildingview .newroom, .buildingview .lobby { flex: 0 0 auto; }
  .hiddenlocas { flex: 0 0 auto; border-top: 1px solid var(--line); padding: 5px 12px 7px; }
  .hiddenlocas summary { cursor: pointer; color: var(--dim); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
  .hiddenlocas summary span { color: var(--muted); }
  .hiddenroom { display: flex; align-items: center; gap: 8px; padding: 4px 2px; color: var(--muted); font-size: 10px; }
  .hiddenroom span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
  .hiddenroom button { border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--accent2); font: 9px var(--mono); cursor: pointer; }
  .locaview .online { flex: 1 1 auto; min-height: 100px; max-height: none; }
  /* This Loca: what it is for, who answers for it, what it carries.
     Reading sizes, not captions: nothing here is under 10px. */
  .locasummary { flex: 0 0 auto; padding: 14px 14px 13px; border-bottom: 1px solid var(--line); }
  .locasummaryhead { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .locasummaryhead b { flex: 1 1 auto; min-width: 0; font-size: 15px; letter-spacing: -.01em;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .locasummaryhead .locamark, .locaglyph { flex: 0 0 auto; width: 30px; height: 30px; display: grid;
    place-items: center; border-radius: 8px; }
  .locaglyph { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent);
    font-weight: 800; font-size: 15px; }
  .lifecycle { flex: 0 0 auto; border: 1px solid currentColor; border-radius: 999px;
    padding: 2px 9px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
  .lifecycle.open { color: var(--human); background: color-mix(in srgb, var(--human) 10%, transparent); }
  .lifecycle.closed { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); }
  .lifecycle.loading { color: var(--dim); }
  .locafacts { display: grid; gap: 0; margin: 12px 0 0; }
  .locafacts > div { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; align-items: baseline;
    padding: 8px 0; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
  .locafacts dt { color: var(--dim); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
  .locafacts dd { margin: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
    min-width: 0; color: var(--txt); font-size: 12.5px; overflow-wrap: anywhere; }
  .locafacts dd small { flex: 0 0 auto; color: var(--dim); font-size: 10px; }
  .locafacts dd .extlink { flex: 0 0 auto; }
  .locafacts .myrole dd { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
  /* A titled loca keeps its id in reach under the title. */
  .locasummaryhead .locanamecol { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
  .locasummaryhead .locaid { color: var(--dim); font: 10px var(--mono); overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; }
  .side h1 { display: flex; align-items: center; gap: 9px; font-size: 14px; margin: 0;
    height: 56px; padding: 0 16px; border-bottom: 1px solid var(--line);
    letter-spacing: .5px; font-weight: 600; }
  .brandlink { display: inline-flex; align-items: center; gap: 9px; color: inherit;
    text-decoration: none; }
  .brandlink:hover, .brandlink:focus-visible { color: var(--accent2); outline: none; }
  /* logo mark: the table and those around it — * agent above, . human below */
  .mark { width: 13px; height: 13px; border: 1.5px solid var(--accent); border-radius: 3px;
    position: relative; flex: 0 0 auto; margin: 6px 2px; }
  .mark::before { content: "*"; position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
    color: var(--agent); font: 700 11px var(--mono); line-height: 1; }
  .mark::after { content: ""; position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%);
    width: 3.5px; height: 3.5px; border-radius: 50%; background: var(--human); }
  .side h1 button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; }
  .side h1 button:hover { color: var(--accent); }
  .side h1 #tabPeople { margin-left: auto; border: 1px solid var(--line); border-radius: 6px;
    padding: 3px 7px; font: 700 9px var(--mono); letter-spacing: .08em; }
  .side h1 #tabPeople.active { border-color: var(--agent); color: var(--agent); }
  .whoami { position: relative; padding: 0; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); display: none; z-index: 12; }
  .whoami.on { display: block; }
  .whoami b { color: var(--accent2); font-weight: 600; }
  .whoami .adm { color: var(--warn); font-size: 10px; margin-left: 6px; }
  .profilemenu > summary { list-style: none; padding: 9px 14px; display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
  .profilemenu > summary::-webkit-details-marker { display: none; }
  .profilemenu > summary:hover, .profilemenu > summary:focus-visible { background: color-mix(in srgb, var(--panel) 72%, transparent); outline: none; }
  .profilechevron { margin-left: auto; color: var(--dim); font-size: 18px; line-height: 1; transition: transform .15s ease; }
  .profilemenu[open] .profilechevron { transform: rotate(90deg); color: var(--accent2); }
  .profilepanel { position: absolute; top: calc(100% + 7px); left: 10px; right: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); box-shadow: 0 14px 40px rgba(0,0,0,.42);
    max-height: calc(100vh - 130px); overflow-y: auto; }
  .profilepanelhead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .profilepanelhead > span { color: var(--text); font-weight: 700; }
  .profilepanelhead small, .profileconnected, .profileempty { color: var(--dim); font-size: 9px; }
  .profileconnected { padding-top: 8px; }
  .profileidentity { display: flex; gap: 9px; align-items: center; min-width: 0; }
  .profileidentity > span:last-child { display: flex; flex-direction: column; min-width: 0; }
  .profileidentity b { color: var(--text); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
  .profileidentity small { color: var(--dim); font-size: 9px; margin-top: 1px; }
  .profileglyph { width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: color-mix(in srgb, var(--human) 15%, transparent); color: var(--human); font-size: 18px; }
  .profileroles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 9px; }
  .profileroles > span { border: 1px solid var(--line); border-radius: 7px; padding: 6px 7px; display: flex; flex-direction: column; min-width: 0; background: color-mix(in srgb, var(--panel) 65%, transparent); }
  .profileroles small, .profilesession small { color: var(--dim); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
  .profileroles b.role { font-size: 9px; line-height: 1.35; overflow-wrap: anywhere; }
  .profileroles b.building-master { color: #e7b95a; }
  .profileroles b.building-smaster { color: #d3a95d; }
  .profileroles b.loca-role { color: var(--warn); }
  .profileroles em { font-style: normal; font-size: 8px; color: var(--dim); }
  .profilesession { display: flex; justify-content: space-between; gap: 8px; margin: 7px 1px 0; font-size: 9px; }
  .profilesession span { text-align: right; color: var(--muted); }
  .profileaccess { margin-top: 7px; border-top: 1px solid var(--line); padding-top: 6px; }
  .profileaccess summary { cursor: pointer; color: var(--muted); font-size: 10px; user-select: none; }
  .profileaccess summary span { float: right; color: var(--accent2); }
  .credentiallist { display: flex; flex-direction: column; gap: 4px; margin-top: 7px; max-height: 190px; overflow: auto; }
  .credentialrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 5px; padding: 6px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); }
  .credentialrow > span:first-child { display: flex; flex-direction: column; min-width: 0; }
  .credentialrow b { color: var(--text); font-size: 10px; overflow: hidden; text-overflow: ellipsis; }
  .credentialrow small { font-size: 8px; color: var(--dim); }
  .credentialrow.revoked { opacity: .55; }
  .credentialstate { font-size: 8px; color: var(--accent2); }
  .credentialrow button { grid-column: 2; padding: 2px 5px; font-size: 8px; color: var(--bad); background: transparent; border: 1px solid color-mix(in srgb, var(--bad) 40%, var(--line)); border-radius: 4px; }
  .credentialcreate { display: flex; gap: 4px; margin-top: 6px; }
  .credentialcreate input { min-width: 0; width: 100%; padding: 5px 6px; font-size: 9px; }
  .credentialcreate button { flex: 0 0 auto; padding: 4px 7px; font-size: 9px; }
  .credentialsecret { margin-top: 6px; padding: 6px; border-radius: 6px; border: 1px solid var(--warn); background: color-mix(in srgb, var(--warn) 8%, transparent); }
  .credentialsecret b { display: block; color: var(--warn); font-size: 9px; }
  .credentialsecret code { display: block; margin: 4px 0; color: var(--text); font-size: 8px; overflow-wrap: anywhere; user-select: all; }
  .credentialsecret button { padding: 2px 6px; font-size: 8px; }
  /* Sign out, at the foot of the account menu (profile.js). */
  .profilesignout { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
  .profilesignout .leavebtn { width: 100%; padding: 7px 10px; background: transparent;
    border: 1px solid rgba(255,107,107,.35); color: var(--muted);
    border-radius: 7px; font: 11px var(--mono); cursor: pointer; }
  .profilesignout .leavebtn:hover { color: var(--bad); border-color: var(--bad); }
  .leaveconfirm { margin-top: 8px; padding: 9px; border: 1px solid rgba(255,107,107,.35);
    border-radius: 7px; color: var(--txt); font-size: 10px; line-height: 1.45; text-align: center; }
  .leaveconfirm .choices { display: flex; gap: 7px; margin-top: 7px; }
  .leaveconfirm button { margin: 0; padding: 6px; flex: 1; border-radius: 6px; cursor: pointer; font: 700 10px var(--mono); }
  .leaveconfirm .no { background: var(--panel2); color: var(--txt); border: 1px solid var(--line); }
  .leaveconfirm .yes { background: var(--bad); color: #2a0e0e; border: 0; }
  .profileserver span { overflow-wrap: anywhere; }
  body.locked .leavebtn { display: none; }
  /* An announcement is not a turn in the conversation — give it a shape that
     survives a fast-scrolling room. */
  .omem.away { opacity: .55; }
  .omem.away .oname::after { content: " · away"; color: var(--dim); font-size: 10px; }
  .leadtag { display: inline-flex; align-items: center; gap: 4px;
    background: rgba(245,199,107,.18); border: 1px solid rgba(245,199,107,.62);
    color: #ffe0a0; font-size: 9px; font-weight: 800; padding: 1px 6px;
    border-radius: 10px; margin-left: 6px; letter-spacing: .06em; text-transform: uppercase; }
  .leadtag::before { content: "◆"; color: #f5c76b; font-size: 8px; }
  /* Building rank worn beside a name: the name says who, the badge says what. */
  .rankbadge { display: inline-flex; align-items: center; font-size: 9px; font-weight: 800;
    padding: 1px 6px; border-radius: 10px; margin-left: 6px; letter-spacing: .06em;
    text-transform: uppercase; border: 1px solid var(--accent); color: var(--accent); }
  .rankbadge.rank-master { background: var(--accent); color: var(--bg); }
  .prow.rankrow .pname { font-weight: 700; }
  .profilerename { display: grid; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .profilerename label { font-size: 10px; color: var(--dim); letter-spacing: .06em; text-transform: uppercase; }
  .profilerenamerow { display: flex; gap: 6px; }
  .profilerenamerow input { flex: 1; min-width: 0; }
  .profilerenamehint { font-size: 11px; color: var(--accent); }
  .profilerenamenote { font-size: 11px; color: var(--dim); min-height: 1em; }
  .omem.is-lead { background: linear-gradient(90deg, rgba(245,199,107,.22), rgba(245,199,107,.04) 82%);
    box-shadow: inset 3px 0 #f5c76b; }
  .omem.is-lead .oname { color: #ffe0a0; font-weight: 800; }
  .memoryownertag { display: inline-flex; align-items: center;
    background: rgba(46,230,200,.14); border: 1px solid rgba(46,230,200,.52);
    color: var(--accent); font-size: 9px; font-weight: 800; padding: 1px 6px;
    border-radius: 10px; margin-left: 6px; letter-spacing: .04em; text-transform: uppercase; }
  .memoryownertag::before { content: "●"; font-size: 7px; margin-right: 4px; }
  .omem.is-memory-owner:not(.is-lead) { background: linear-gradient(90deg, rgba(46,230,200,.16), rgba(46,230,200,.03) 82%);
    box-shadow: inset 3px 0 var(--accent); }
  /* Building directory: one grid for ranks and members — who, status, where,
     actions — so every row reads the same way and actions never wrap. */
  .bblock { margin: 0 0 22px; }
  .bsection { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; padding: 0 4px;
    color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
  .bcount { min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--panel2);
    border: 1px solid var(--line); color: var(--txt); font-size: 10px; text-align: center; letter-spacing: 0; }
  /* The last column holds a member's three actions (Message · Suspend ·
     Revoke); at 170px they spilled left over Location. */
  .peoplehead, .prow { display: grid; grid-template-columns: minmax(0,1.6fr) 160px minmax(0,.9fr) minmax(0,.9fr) 244px;
    align-items: center; column-gap: 16px; }
  .peoplehead { padding: 6px 10px; color: var(--dim); font-size: 9px; letter-spacing: .08em;
    text-transform: uppercase; border-bottom: 1px solid var(--line); }
  .prow { padding: 10px; border-bottom: 1px solid var(--line); border-radius: 0; transition: background .12s; }
  .prow:hover { background: color-mix(in srgb, var(--panel2) 70%, transparent); }
  .prow.suspended .pnametext { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--dim); }
  .pname { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .pnametext { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--txt); font-weight: 600; }
  .pkind { color: var(--dim); font-size: 10px; }
  .kindmark { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
  .kindmark.agent { background: var(--agent); border-radius: 2px; }
  .kindmark.human { background: var(--human); }
  .pstatuses { display: flex; flex-wrap: wrap; gap: 6px; }
  .pwhere { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; font-size: 12px; color: var(--dim); }
  .pnowhere { color: var(--dim); font-size: 11px; }
  .locachip { padding: 1px 7px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--line);
    color: var(--accent2); font-size: 11px; white-space: nowrap; }
  .pflag { padding: 1px 6px; border-radius: 6px; font-size: 10px; border: 1px solid var(--line); white-space: nowrap; }
  .pflag.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
  .pflag.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
  .pacts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; min-width: 0; white-space: nowrap; }
  .pban { color: var(--bad); font-size: 11px; }
  /* One button vocabulary for the Building: quiet outline, accent primary,
     red only on hover for the destructive one. */
  .btn { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 7px;
    border: 1px solid var(--line); background: transparent; color: var(--muted);
    font: 600 11px var(--mono); white-space: nowrap; cursor: pointer; }
  .btn:hover, .btn:focus-visible { color: var(--txt); border-color: var(--muted); }
  .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
  .btn.primary:hover { background: var(--accent2); border-color: var(--accent2); color: var(--bg); }
  .btn.danger:hover, .btn.danger:focus-visible { color: var(--bad); border-color: var(--bad); }
  .btn:disabled { opacity: .5; cursor: default; }
  .pstatus { width: max-content; max-width: 100%; padding: 2px 6px; border: 1px solid var(--line);
    border-radius: 999px; font-size: 9px; white-space: nowrap; }
  .pstatus.ok { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
  .pstatus.off, .pstatus.unknown { color: var(--muted); }
  .pstatus.na { color: var(--dim); border-style: dashed; }
  .pstatus.bad { color: var(--danger, #e06c75); border-color: color-mix(in srgb, var(--danger, #e06c75) 45%, var(--line)); }
  .pstage { margin-left: 6px; padding: 1px 5px; border: 1px solid var(--line);
    border-radius: 999px; color: var(--muted); font-size: 9px; letter-spacing: .04em; }
  .pstage.accepted, .pstage.first { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
  .pstage.final { color: var(--human); border-color: color-mix(in srgb, var(--human) 45%, var(--line)); }
  .pstage.relay { color: var(--warn, #f5c76b); }
  .callbtn { width: calc(100% - 24px); margin: 8px 12px 4px; background: transparent; color: var(--muted);
    border: 1px dashed var(--line); border-radius: 6px; padding: 6px; font-size: 12px; cursor: pointer; }
  .callbtn:hover { color: var(--accent); border-color: var(--accent); }
  .calllist { margin: 0 12px 8px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
  .callrow { padding: 6px 10px; font-size: 12px; cursor: pointer; display: flex; justify-content: space-between; }
  button.callrow { width: 100%; border: 0; background: transparent; color: inherit;
    text-align: left; font-family: var(--mono); }
  .callrow:hover { background: var(--panel2, rgba(255,255,255,.04)); color: var(--accent); }
  .callrow .where { color: var(--dim); font-size: 11px; }
  .callnone { padding: 8px 10px; font-size: 11px; color: var(--dim); }
  .row.announce .bub { border-left: 3px solid var(--accent); background: var(--announce-bg, rgba(255,140,0,.10)); }
  .row.announce .bub::before { content: "announcement"; display: block; font-size: 10px; letter-spacing: .08em;
    text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
  .jday { font-size: 11px; color: var(--dim); margin: 14px 0 6px; letter-spacing: .04em; }
  .jrow { display: flex; gap: 10px; padding: 6px 2px; border-bottom: 1px solid var(--line); }
  .jwho { flex: 0 0 auto; color: var(--accent); font-size: 12px; min-width: 74px; }
  .jtxt { flex: 1; font-size: 13px; line-height: 1.45; }
  .jat  { flex: 0 0 auto; color: var(--dim); font-size: 11px; }
  .conn { padding: 10px 16px; border-bottom: 1px solid var(--line); overflow-y: auto; }
  .conn label { display: block; font-size: 10px; color: var(--muted); margin: 8px 0 3px; letter-spacing: .4px; }
  .conn input, .conn select { box-sizing: border-box; width: 100%; min-width: 0; min-height: 40px;
    background: var(--panel2); border: 1px solid var(--line); color: var(--txt);
    border-radius: 7px; padding: 9px 11px; font: 12px var(--mono); }
  .conn select { color-scheme: dark; cursor: pointer; }
  .conn input:focus, .conn select:focus { border-color: var(--accent); }
  .conn button { width: 100%; margin-top: 12px; background: var(--accent); color: #06231d; border: 0;
    border-radius: 8px; padding: 9px; font: 600 12px var(--mono); cursor: pointer; }
  .conn button.off { background: var(--panel2); color: var(--muted); }
  .conn .entryswitch { min-height: 40px; margin-top: 8px; background: transparent;
    border: 1px solid var(--line); color: var(--muted); font-weight: 400; }
  .conn .entryswitch:hover { color: var(--accent2); border-color: var(--accent2); }
  .conn .devnote { font-size: 10px; color: var(--dim); margin-top: 8px; text-align: center; }
  .rooms { overflow-y: auto; padding: 8px 0; min-height: 0; }
  .rlabel { font-size: 10px; color: var(--dim); padding: 6px 16px; letter-spacing: .12em; }
  .room { width: 100%; padding: 10px 12px 10px 13px; cursor: pointer;
    border: 0; border-left: 3px solid transparent; background: transparent;
    color: inherit; text-align: left; font: inherit; }
  .room:hover { background: var(--panel2); }
  /* The Lobby room: above the floors, where everyone lands first. */
  .lobbyroomlink { display: flex; align-items: center; gap: 8px; width: calc(100% - 20px);
    margin: 10px 10px 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--bg); color: var(--txt); font: inherit; cursor: pointer; text-align: left; }
  .lobbyroomlink:hover { background: var(--panel2); }
  .lobbyroomlink.active { background: var(--panel2); box-shadow: inset 3px 0 0 var(--accent); }
  .lobbyroomlink.has-unread .lobbyroomname { font-weight: 700; }
  .lobbyroomlink .lobbyroomcount { margin-left: auto; font-size: 11px; color: var(--dim); }
  .lobbyroomabout { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
  .roomitem { position: relative; display: flex; align-items: center; min-height: 48px;
    border-bottom: 1px solid rgba(255,255,255,.025); }
  .roomitem .room { flex: 1; min-width: 0; }
  .roomprefs { position: relative; flex: 0 0 auto; margin-right: 8px; }
  .roompreftrigger { width: 28px; height: 30px; display: inline-flex; align-items: center;
    justify-content: center; border: 1px solid transparent; border-radius: 7px; color: var(--muted);
    font: 700 17px/1 var(--mono); cursor: pointer; list-style: none; user-select: none; }
  .roompreftrigger::-webkit-details-marker { display: none; }
  .roompreftrigger:hover, .roompreftrigger:focus-visible, .roomprefs[open] .roompreftrigger {
    background: var(--panel2); color: var(--txt); border-color: var(--line); outline: none; }
  .roomprefmenu { position: absolute; top: calc(100% + 4px); right: 0; z-index: 35;
    width: 136px; padding: 5px; display: grid; gap: 2px; background: var(--panel2);
    border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 10px 30px rgba(0,0,0,.48); }
  .roompref { width: 100%; min-height: 30px; padding: 6px 9px; border: 0; border-radius: 6px;
    background: transparent; color: var(--muted); text-align: left; font: 600 11px/1.2 var(--mono);
    cursor: pointer; }
  .roompref:hover, .roompref:focus-visible { background: rgba(255,255,255,.055); color: var(--txt);
    outline: none; }
  .roompref.hide:hover, .roompref.hide:focus-visible { color: var(--bad); }
  .roompref:disabled { opacity: .45; cursor: not-allowed; }
  .room.active { background: var(--panel2); border-left-color: var(--accent); }
  .room .rrow { display: flex; align-items: baseline; gap: 8px; }
  /* One line per loca name: a long name (investment_gold_and_currency) used
     to wrap after "# " and leave the mark alone on its own line. */
  .room .rname { font-weight: 600; min-width: 0; flex: 1 1 auto;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .room .rname::before { content: "# "; color: var(--dim); font-weight: 400; }
  .room .pres { margin-left: auto; font-size: 10px; color: var(--muted); white-space: nowrap; }
  .room .rlastrow { display: flex; align-items: center; gap: 7px; min-height: 16px; padding-left: 13px; }
  .room .rlast { flex: 1; min-width: 0; font-size: 11px; color: var(--dim);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .room .unreadbadge { flex: 0 0 auto; min-width: 18px; height: 18px; padding: 0 5px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; background: var(--accent); color: #06231d;
    font: 800 10px/1 var(--mono); }
  .room.has-unread .rname { color: var(--accent2); font-weight: 700; }
  .room.archived { opacity: .58; }
  .room.special { margin: 3px 8px; padding-left: 10px; border: 1px solid #684a91;
    border-left: 3px solid var(--iye); border-radius: 7px;
    background: linear-gradient(105deg, rgba(87,52,126,.38), rgba(20,18,29,.35)); }
  .room.special:hover, .room.special.active {
    background: linear-gradient(105deg, rgba(112,66,163,.5), rgba(29,22,43,.65));
    border-color: var(--iye); }
  .room.special .rname { color: var(--iye); letter-spacing: .04em; }
  .room.special .rname::before { content: "✦ "; color: var(--iye); }
  .newroom { display: flex; gap: 5px; padding: 8px 13px; border-top: 1px solid var(--line); }
  .newroom input { flex: 1; min-width: 0; background: var(--panel2); border: 1px solid var(--line);
    color: var(--txt); border-radius: 7px; padding: 6px 9px; font: 11px var(--mono); }
  .newroom button { background: var(--accent); color: #06231d; border: 0; border-radius: 7px;
    padding: 6px 11px; font-weight: 700; cursor: pointer; }

  .online { overflow-y: auto; min-height: 0; border-top: 1px solid var(--line); padding: 6px 0 10px; }
  .online .rlabel { display: flex; justify-content: space-between; }
  .online #onlineCount { color: var(--accent); font-weight: 700; }
  /* Bottom-left Lobby drawer. Drag its top grip upward to make room for more
     waiting members; the current-loca roster yields space above it. */
  .lobby { height: 66px; min-height: 48px; max-height: 55vh; border-top: 1px solid var(--line);
    background: var(--panel); overflow: hidden; }
  .lobbyresize { height: 8px; cursor: ns-resize; position: relative; touch-action: none; }
  .lobbyresize::after { content: ""; position: absolute; left: 50%; top: 3px;
    width: 34px; height: 2px; transform: translateX(-50%); border-radius: 2px; background: var(--line); }
  .lobbyresize:hover::after { background: var(--agent); }
  .lobbyhead { display: flex; align-items: center; padding: 0 14px 3px; }
  .lobbyhead .lobbytitle { color: var(--agent); font-size: 10px; font-weight: 700;
    letter-spacing: .12em; }
  .lobby #lobbyCount { color: var(--warn); font-weight: 700; }
  .lobby #lobbyList { max-height: calc(100% - 31px); overflow-y: auto; }
  .lobby .omem { padding-top: 4px; padding-bottom: 4px; }
  .lobby .lobbycall { background: none; border: 1px solid rgba(46,230,200,.45); color: var(--accent);
    border-radius: 6px; cursor: pointer; font: 700 10px var(--mono); padding: 3px 8px; }
  .lobby .lobbycall:hover { border-color: var(--accent); background: rgba(46,230,200,.08); }
  .omem { display: flex; align-items: center; gap: 8px; padding: 3px 16px; font-size: 12px; }
  .omem .odot { display: none; }
  .omem .glyph { width: 10px; text-align: center; flex: 0 0 auto; font-weight: 700; }
  .omem .glyph.agent { color: var(--agent); } .omem .glyph.user { color: var(--human); }
  .omem .glyph.lead { color: #f5c76b; text-shadow: 0 0 9px rgba(245,199,107,.72); }
  .omem .oname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* With moderation acts in the row the name keeps its own width, tags and
     task number included, and the acts go to a second line when both do not
     fit: squeezed beside them the name was cut before its badges. */
  .omem:has(.omacts) { flex-wrap: wrap; row-gap: 2px; }
  .omem:has(.omacts) .oname { flex: 1 1 auto; max-width: 100%; }
  .omem:has(.omacts) .omacts { margin-left: auto; }
  .omem .otag { font-size: 9px; color: var(--dim); letter-spacing: .4px; }
  .omem.self .oname { color: var(--accent2); font-weight: 600; }
  .omem .mflag { font-size: 10px; }
  .omacts { display: inline-flex; align-items: center; gap: 3px; margin-left: 4px; }
  .omacts button { background: none; border: 0; cursor: pointer; font-size: 11px; padding: 0 2px; }
  .omacts button:not(.release) { opacity: .38; }
  .omem:hover .omacts button { opacity: 1; }
  .omacts button:hover { transform: scale(1.2); }
  .omacts button.release { border: 1px solid rgba(46,230,200,.6); border-radius: 7px;
    color: var(--accent); font: 700 11px var(--mono); padding: 5px 10px; opacity: 1;
    min-width: 68px; }
  .omacts button.release:hover { background: rgba(46,230,200,.1); transform: none; }

  /* ── main ── */
  .main { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100vh; overflow: hidden; position: relative; }
  /* One room header, aligned with the brand + identity rows in the sidebar.
     Room properties belong beside the room name; they are not a second nav. */
  .top { height: 92px; flex: 0 0 92px; padding: 0 20px; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 12px; }
  .ravatar { display: none; }
  .tophead { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; gap: 3px; }
  .roomline { display: flex; align-items: center; gap: 9px; min-width: 0; }
  .roomprops { display: flex; align-items: center; gap: 7px; min-width: 0; }
  .roomprops .detail { color: var(--muted); font-size: 10px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; }
  .roomprops .detail b { color: var(--txt); }
  .top .rname { font-weight: 700; line-height: 1.25; font-size: 14px; white-space: nowrap; flex: 0 0 auto; }
  .top .rname::before { content: "# "; color: var(--dim); font-weight: 400; }
  .main.lobbyroom .top .rname::before { content: ""; }
  .main.global .top .rname::before { content: ""; }
  .main.global .doorbar,
  .main.global .tabs, .main.global .roomprops, .main.global .roomactions,
  .main.global .adminbar { display: none !important; }
  .substatus { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .substatus .live { color: var(--accent2); }
  .substatus .typ { color: var(--accent); }
  /* Many tabs do not lie over the loca's name: the name keeps its room and the
     tab bar scrolls sideways inside itself. */
  .tophead { flex-basis: 220px; flex-shrink: 0; }
  .tabs { display: flex; align-items: center; gap: 3px; margin-left: auto; background: var(--panel2);
    border: 1px solid var(--line); border-radius: 8px; padding: 2px;
    flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs > * { flex: 0 0 auto; }
  /* The tab label and the dot are centred as FLEX children; they do not depend
     on the line box (baseline/strut) at all. Before, Chat had NO dot,
     the others did: how an inline inline-block aligns to the baseline
     differs from engine to engine, which is why tabs that looked aligned in Chromium
     could shift in the WebKit-based desktop (Tauri) build.
     Because the `font` shorthand reset line-height to `normal`, the height too
     was left to the font's metrics. 14px is EXACTLY the value Chromium derives
     from `normal` for this font: nothing looks different, only
     the engine-to-engine difference is prevented. */
  .tab { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px 12px;
    white-space: nowrap;
    border-radius: 6px; font: 12px var(--mono); line-height: 14px;
    display: inline-flex; align-items: center; justify-content: center; }
  .tab.active { background: var(--panel); color: var(--txt); box-shadow: inset 0 0 0 1px var(--line); }
  /* Being a flex child it gets flex: 0 0 auto — otherwise in a narrowing tab
     it could shrink and lose its roundness. visibility:hidden is kept:
     the hidden dot STILL KEEPS ITS PLACE, so when the dot lights up the tab's
     width does NOT JUMP. */
  .tab .dot { flex: 0 0 auto; width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
    margin-left: 5px; visibility: hidden; }
  .tab .dot.on { visibility: visible; }
  .conndot { width: 9px; height: 9px; border-radius: 50%; background: var(--bad); flex: 0 0 auto;
    box-shadow: 0 0 0 3px rgba(255,107,107,.12); }
  .conndot.on { background: var(--human); box-shadow: 0 0 0 3px rgba(87,217,163,.12); }

  .pill { padding: 1px 9px; border-radius: 12px; font-weight: 700; font-size: 10px; letter-spacing: .5px; }
  .pill.free { background: rgba(87,217,163,.14); color: var(--human); }
  .pill.restricted { background: rgba(90,184,255,.14); color: var(--agent); }
  .pill.roundrobin { background: rgba(255,176,102,.16); color: var(--warn); }
  .pill.paused { background: rgba(255,107,107,.14); color: var(--bad); }
  .livebadge { background: rgba(255,80,80,.14); color: var(--bad); font-weight: 700; font-size: 10px;
    padding: 1px 9px; border-radius: 12px; animation: livepulse 1.6s ease-in-out infinite; }
  @keyframes livepulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
  .archbadge { background: rgba(255,176,102,.14); color: var(--warn); font-weight: 700; font-size: 10px;
    padding: 1px 9px; border-radius: 12px; }
  .roomactions { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
  .leadkey { color: #f5c76b; font: 800 10px var(--mono); letter-spacing: .04em; }
  .leadselect { max-width: 170px; color-scheme: dark; background: rgba(245,199,107,.10);
    border: 1px solid rgba(245,199,107,.48); color: #ffe0a0; border-radius: 7px;
    padding: 4px 7px; font: 700 10px var(--mono); cursor: pointer; }
  .leadselect option { background: var(--panel2); color: var(--txt); }
  .leadselect:focus { outline: 1px solid #f5c76b; }
  .admintoggle { background: none; border: 0; color: var(--muted);
    cursor: pointer; font: 11px var(--mono); }
  .admintoggle:hover { color: var(--accent); }
  /* Properties is an anchored inspector, not a second page-wide header. The
     old full-width strip landed in the visual middle of the app and made the
     room hierarchy hard to read. */
  .adminbar { display: none; position: absolute; z-index: 45; top: 82px; right: 12px;
    width: min(720px, calc(100% - 24px)); border: 1px solid var(--line);
    border-radius: 11px; background: var(--panel2); box-shadow: 0 18px 48px rgba(0,0,0,.58);
    padding: 12px; font-size: 11px; max-height: min(72vh, 680px); overflow-y: auto; }
  .adminbar.on.open { display: block; }
  .propertygroup { min-width: 0; border: 1px solid var(--line); border-radius: 7px;
    background: var(--panel); margin-bottom: 8px; }
  .propertygroup summary { cursor: pointer; color: var(--muted); padding: 9px 11px;
    font: 700 11px var(--mono); letter-spacing: .04em; list-style-position: inside; }
  .propertygroup summary small { display: block; margin: 3px 0 0 18px; color: var(--dim);
    font-size: 10px; font-weight: 400; letter-spacing: 0; }
  .propertygroup[open] summary { color: var(--accent2); border-bottom: 1px solid var(--line); }
  .propertyfields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start; gap: 9px; padding: 10px; }
  .propertyfield { min-width: 0; display: flex; flex-direction: column; align-items: stretch;
    gap: 6px; border: 1px solid rgba(42,50,64,.75); border-radius: 7px; padding: 9px;
    background: rgba(11,14,18,.34); }
  .propertyfield .fieldlabel { color: var(--warn); font-weight: 700; font-size: 10px;
    letter-spacing: .06em; text-transform: uppercase; }
  .propertyfield .fieldcontrol { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
  .propertyfield .fieldhelp { color: var(--dim); font-size: 10px; line-height: 1.45; }
  .propertyfield.lifecycle { border-color: rgba(255,107,107,.20); }
  .propertyfooter { display: flex; align-items: center; gap: 10px; position: sticky; bottom: -12px;
    padding: 10px 0 2px; background: linear-gradient(transparent, var(--panel2) 28%); }
  .adminbar .lbl { color: var(--warn); font-weight: 700; font-size: 10px; letter-spacing: .5px; }
  .adminbar select, .adminbar input { background: var(--panel); border: 1px solid var(--line);
    color: var(--txt); border-radius: 6px; padding: 4px 8px; font: 11px var(--mono); }
  .adminbar input.wide { flex: 1; min-width: 180px; }
  .adminbar button { background: var(--accent); color: #06231d; border: 0; border-radius: 6px;
    padding: 4px 12px; font: 700 11px var(--mono); cursor: pointer; }
  .adminbar button.quiet { background: var(--panel); color: var(--muted); border: 1px solid var(--line); }
  .adminbar button.quiet:hover { color: var(--txt); border-color: var(--muted); }
  .adminbar button.danger { background: transparent; color: var(--bad); border: 1px solid rgba(255,107,107,.4); }
  .adminbar .locked { color: var(--dim); }
  .livebtn { background: var(--panel) !important; color: var(--muted) !important; border: 1px solid var(--line) !important; }
  .livebtn.on { background: var(--bad) !important; color: #2a0e0e !important; border-color: var(--bad) !important; }

  /* ── the feed: flat mono lines, no bubbles ── */
  .feed { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 20px 8px;
    display: flex; flex-direction: column; gap: 7px; }

  /* ── pinned message bar (personal, per-room; restored) ── */
  .pinnedbar { flex: 0 0 auto; margin: 8px 20px 0; padding: 8px 11px;
    border: 1px solid rgba(201,167,255,.38); border-left: 3px solid var(--iye);
    border-radius: 9px; background: linear-gradient(100deg, rgba(57,38,84,.42), var(--panel2));
    display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 9px; }
  .pinnedbar .pinmark { color: var(--iye); font-weight: 700; }
  .pinnedbar .pincontent { min-width: 0; cursor: pointer; }
  .pinnedbar .pinmeta { color: var(--iye); font-size: 10px; font-weight: 700; }
  /* Compact pins never get a tiny inner scrollbar. Click the preview to open
     the full message in-place; click it again to fold it back to three lines. */
  .pinnedbar .pintext { color: var(--txt); font-size: 11px; white-space: pre-wrap;
    overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical;
    -webkit-line-clamp: 3; overflow: hidden; }
  .pinnedbar.expanded .pintext { display: block; -webkit-line-clamp: unset;
    overflow: visible; }
  .pinnedbar .pinactions { display: flex; align-items: center; gap: 5px; }
  .pinnedbar button { background: none; border: 0; color: var(--muted);
    cursor: pointer; font: 10px var(--mono); padding: 1px 3px; }
  .pinnedbar button:hover { color: var(--bad); }
  .pinnedbar #pinJumpBtn:hover { color: var(--accent); }
  .row.pinned-source .bubble { box-shadow: inset 3px 0 0 var(--iye); }
  /* WhatsApp order, loca skin: others left, you right */
  .row { display: flex; align-items: flex-start; position: relative; width: 100%; min-width: 0; }
  .row.mine { justify-content: flex-end; }
  .row.nomatch { display: none; }
  /* Short messages hug their content; long ones stop at 70% of the chat
     column. min-width:0 is essential inside flex — without it a long token or
     code block can force the bubble past max-width. */
  .bubble { width: fit-content; max-width: 70%; min-width: 0; background: var(--panel2); border: 1px solid var(--line);
    border-radius: 12px; padding: 7px 12px 6px; }
  .row.mine .bubble { background: rgba(46,230,200,.07); border-color: rgba(46,230,200,.28); }
  .bubble.mentioned { box-shadow: inset 2px 0 0 var(--accent); }
  .row.locareminder .bubble { background: rgba(255,176,102,.11); border-color: rgba(255,176,102,.55);
    box-shadow: inset 3px 0 0 var(--warn); }
  .row.locareminder .sender, .row.locareminder .glyph { color: var(--warn); }
  .line { display: flex; gap: 8px; align-items: baseline; margin-bottom: 1px; }
  .line .glyph { width: 11px; text-align: center; font-weight: 700; flex: 0 0 auto; }
  .glyph.agent { color: var(--agent); } .glyph.user { color: var(--human); }
  .line .sender { font-weight: 700; white-space: nowrap; font-size: 12px; }
  .sender.agent { color: var(--agent); } .sender.user { color: var(--human); }
  .row.mine .sender { color: var(--me); }
  .line .time { margin-left: auto; padding-left: 14px; }
  .body { max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; color: var(--txt); }
  .body.chatmarkdown { white-space: normal; line-height: 1.5; }
  .body.chatmarkdown p { margin: 0; }
  .body.chatmarkdown p + p, .body.chatmarkdown p + ul, .body.chatmarkdown p + ol,
  .body.chatmarkdown ul + p, .body.chatmarkdown ol + p { margin-top: 6px; }
  .body.chatmarkdown ul, .body.chatmarkdown ol { margin-block: 4px; }
  .body.chatmarkdown h1, .body.chatmarkdown h2, .body.chatmarkdown h3 { margin-block: 5px 3px; }
  .row .txt { white-space: pre-wrap; word-break: break-word; min-width: 0; }
  .bubble .mention, .txt .mention { color: var(--accent); font-weight: 700; }
  .bubble .mention.leadkeyword, .txt .mention.leadkeyword { color: #f5c76b; }
  .bubble code.inline, .txt code.inline { background: var(--panel); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
  .bubble pre.code, .txt pre.code { background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
    padding: 8px 10px; overflow-x: auto; margin: 4px 0; }
  .line .time { font-size: 10px; color: var(--dim); white-space: nowrap; }
  .quote { font-size: 11px; color: var(--muted); border-left: 2px solid var(--dim);
    padding: 1px 8px; margin: 0 0 3px; cursor: pointer; }
  /* Message actions participate in the row layout so they remain attached to
     the end of their bubble instead of floating against the chat viewport. */
  .lineacts { flex: 0 0 auto; align-self: flex-start; display: inline-flex; gap: 4px;
    margin: 4px 0 0 5px; opacity: 0; pointer-events: none;
    background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
  .row:hover .lineacts, .row:focus-within .lineacts { opacity: 1; pointer-events: auto; }
  .lineacts button { appearance: none; background: none; border: 0; padding: 0;
    font: 10px var(--mono); color: var(--muted); cursor: pointer; }
  .lineacts button:hover, .lineacts button:focus-visible { color: var(--accent); outline: none; }
  .lineacts button:focus-visible { text-decoration: underline; text-underline-offset: 2px; }
  .reactions { display: flex; flex-wrap: wrap; gap: 4px; min-height: 0; margin-top: 4px; }
  .reactionchip { border: 1px solid var(--line); border-radius: 12px; background: var(--panel2);
    color: var(--muted); padding: 1px 7px; font: 12px var(--mono); cursor: pointer; }
  .reactionchip span { margin-left: 3px; font-size: 10px; }
  .reactionchip.mine { border-color: var(--dim); color: var(--muted); background: var(--panel); }
  .reactionpicker { align-self: flex-start; display: flex; gap: 3px; margin: 3px 0 0 5px;
    padding: 4px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel2);
    box-shadow: 0 6px 18px rgba(0,0,0,.35); }
  .reactionpicker.hidden { display: none; }
  .reactionpicker button { border: 0; border-radius: 50%; background: transparent; color: var(--txt);
    width: 28px; height: 28px; font-size: 16px; cursor: pointer; }
  .reactionpicker button:hover, .reactionpicker button:focus-visible { background: var(--panel); outline: 1px solid var(--accent); }
  .to { display: none; }
  .sysline { text-align: center; color: var(--dim); font-size: 11px; padding: 4px; }
  .daychip { text-align: center; color: var(--dim); font-size: 11px; margin: 10px 0 4px; }
  .daychip::before { content: "— "; } .daychip::after { content: " —"; }
  .unread-line { display: flex; align-items: center; gap: 10px; color: var(--accent);
    font-size: 10px; font-weight: 700; margin: 4px 0; letter-spacing: .1em; }
  .unread-line::before, .unread-line::after { content: ""; flex: 1; border-top: 1px solid var(--accent); opacity: .4; }
  .jump { position: absolute; right: 28px; bottom: 130px; z-index: 15;
    background: var(--accent); color: #06231d; border: 0; border-radius: 18px;
    padding: 7px 14px; font: 700 12px var(--mono); cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,.45); }
  .jump:hover { background: var(--accent2); }
  .typing { height: 18px; padding: 0 26px; font-size: 11px; color: var(--accent2); font-style: italic; }
  .flash { animation: flash 1s ease; }
  @keyframes flash { from { background: rgba(46,230,200,.14); } to { background: transparent; } }

  /* ── composer: the claude.ai/code feel ── */
  .replybar { padding: 5px 20px; font-size: 11px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
  .replybar span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .replybar button { background: none; border: 0; color: var(--muted); cursor: pointer; }
  .composer { margin: 6px 20px 6px; padding: 10px 12px; display: grid;
    grid-template-columns: auto 1fr auto auto auto; gap: 8px 10px; align-items: center;
    background: var(--panel2); border: 1px solid var(--line); border-radius: 14px;
    transition: border-color .15s ease; }
  .composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(46,230,200,.25); }
  .composer.gated { opacity: .5; }
  .composer select { background: var(--panel); border: 1px solid var(--line); color: var(--muted);
    border-radius: 8px; padding: 7px 8px; font: 11px var(--mono);
    grid-column: 1; grid-row: 2; justify-self: start; }
  .composer textarea#msg { width: 100%; grid-column: 1 / -1; grid-row: 1;
    background: none; border: 0; color: var(--txt);
    font: 13px/1.5 var(--mono); padding: 7px 2px; resize: none; overflow-y: auto;
    max-height: 40vh; min-height: 22px; }
  .composer textarea#msg:focus { outline: none; }
  .composer button.send { background: var(--accent); color: #06231d; border: 0; border-radius: 9px;
    padding: 7px 16px; font: 700 12px var(--mono); cursor: pointer;
    grid-column: 3; grid-row: 2; }
  .composer button.send:hover { background: var(--accent2); }
  .composer button.send:disabled { background: var(--line); color: var(--muted);
    cursor: wait; }
  .composer.sending { border-color: rgba(46,230,200,.45); }
  .composer button.ctl { background: none; border: 1px solid var(--line); color: var(--muted);
    border-radius: 9px; padding: 6px 10px; font: 11px var(--mono); cursor: pointer; }
  .composer button.stop { color: var(--bad); }
  .composer button.stop { grid-column: 4; grid-row: 2; }
  .composer #clearBtn { grid-column: 5; grid-row: 2; }
  .hint { padding: 0 26px 10px; color: var(--dim); font-size: 10px; }
  .hint b { color: var(--muted); }

  /* ── attachments: composer button, staged strip, in-message render ── */
  .composer button.attach { grid-column: 2; grid-row: 2; justify-self: start;
    font-size: 14px; line-height: 1; padding: 5px 9px; }
  .composer button.attach:hover { color: var(--accent2); border-color: var(--accent); }
  .attachstrip { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 20px 0; }
  .pendingchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 8px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--panel2);
    color: var(--txt); font: 11px var(--mono); max-width: 240px; }
  .pendingchip .pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pendingchip .psize { color: var(--dim); font-size: 10px; }
  .pendingchip .premove { background: none; border: 0; color: var(--muted); cursor: pointer;
    font-size: 12px; padding: 0 2px; line-height: 1; }
  .pendingchip .premove:hover { color: var(--bad); }
  .attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
  .attachimg { max-width: min(320px, 100%); max-height: 320px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--panel); cursor: zoom-in; }
  .attachchip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--panel2);
    color: var(--accent2); font: 11px var(--mono); cursor: pointer; }
  .attachchip:hover { border-color: var(--accent); }
  .attachchip .asize { color: var(--dim); }
  .attachchip { max-width: 100%; min-height: 44px; flex-wrap: wrap; }
  .attachchip .aname { overflow-wrap: anywhere; min-width: 0; }
  #feed.dropping { outline: 2px dashed var(--accent); outline-offset: -6px; }
  #composer.dropping { outline: 2px dashed var(--accent); outline-offset: -2px; }

  /* ── notes & tasks panels ── */
  .notes { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px; }
  .memorytitle { display:flex; align-items:baseline; gap:10px; margin-bottom:12px; }
  .memorytitle span { color:var(--dim); font-size:11px; text-transform:uppercase; letter-spacing:.08em; }
  .memorytitle b { color:var(--accent2); font-size:18px; }
  .memorygrid { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:8px; }
  .memorycard, .memorybody, .memoryentry { background:var(--panel2); border:1px solid var(--line); border-radius:10px; padding:12px; }
  .memorycard small, .memorymeta { display:block; color:var(--dim); font-size:10px; margin-bottom:4px; }
  .memorybody { white-space:pre-wrap; word-break:break-word; line-height:1.55; min-height:56px; }
  .memoryentry { margin-bottom:8px; }
  .memoryentry .memorymeta { margin-top:7px; margin-bottom:0; }
  .memorywarn { color:var(--warn); }
  .memorysteward { margin-bottom:8px; padding:10px 12px; border:1px solid rgba(46,230,200,.52);
    border-radius:10px; background:rgba(46,230,200,.10); color:var(--txt); }
  .memorysteward b { color:var(--accent); }
  .memoryeditor { margin:8px 0 14px; }
  .memoryeditor textarea { width:100%; min-height:110px; resize:vertical; }
  .memoryeditbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:6px; }
  .memoryeditbar span { font-size:11px; color:var(--muted); }
  .note, .newnote { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
    padding: 12px 14px; margin-bottom: 12px; }
  .newnote { border-style: dashed; }
  .note .nhead { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
  .note .nkey { color: var(--accent2); background: rgba(46,230,200,.08); padding: 1px 7px;
    border-radius: 5px; font-size: 11px; }
  .note .ntitle { font-weight: 700; }
  .note .nmeta { margin-left: auto; font-size: 10px; color: var(--dim); }
  .note .nbody { white-space: pre-wrap; word-break: break-word; font-size: 12px; margin: 4px 0 8px; }
  .note .nbody.markdown, .nhist .hbody.markdown { white-space: normal; line-height: 1.6; }
  .markdown > :first-child { margin-top: 0; }
  .markdown > :last-child { margin-bottom: 0; }
  .markdown h1, .markdown h2, .markdown h3 { color: var(--txt); line-height: 1.3;
    margin: 14px 0 7px; }
  .markdown h1 { font-size: 17px; } .markdown h2 { font-size: 15px; }
  .markdown h3 { font-size: 13px; color: var(--accent2); }
  .markdown p { margin: 7px 0; }
  .markdown ul, .markdown ol { margin: 7px 0; padding-left: 24px; }
  .markdown li { margin: 3px 0; }
  .markdown blockquote { margin: 8px 0; padding: 3px 10px; border-left: 2px solid var(--agent);
    color: var(--muted); background: rgba(90,184,255,.05); }
  .markdown a { color: var(--agent); text-decoration-thickness: 1px; }
  .markdown code.inline { background: var(--panel); border: 1px solid var(--line);
    padding: 1px 5px; border-radius: 4px; }
  .markdown pre.code { background: var(--panel); border: 1px solid var(--line); border-radius: 7px;
    padding: 9px 11px; overflow-x: auto; white-space: pre; }
  .markdown .tablewrap { max-width: 100%; overflow-x: auto; margin: 7px 0; border: 1px solid var(--line);
    border-radius: 7px; }
  .markdown table { width: 100%; border-collapse: collapse; font-size: 11px; }
  .markdown th, .markdown td { padding: 6px 9px; border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
  .markdown th { color: var(--accent2); background: var(--panel); font-weight: 700; }
  .markdown th:last-child, .markdown td:last-child { border-right: 0; }
  .markdown tbody tr:last-child td { border-bottom: 0; }
  .markdown hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
  .markdownhint { display: block; margin: -1px 0 8px; color: var(--dim); font-size: 10px; }
  .note .nwrite { font-size: 10px; color: var(--muted); }
  .note .nwrite b { color: var(--human); }
  .note .nactions { margin-top: 8px; display: flex; gap: 6px; }
  .note .nactions button, .newnote button { background: var(--panel); border: 1px solid var(--line);
    color: var(--txt); border-radius: 6px; padding: 4px 11px; font: 11px var(--mono); cursor: pointer; }
  .newnote button { background: var(--accent); color: #06231d; border: 0; font-weight: 700; }
  .note textarea, .note input.nedit, .newnote input, .newnote textarea { width: 100%;
    background: var(--panel); border: 1px solid var(--line); color: var(--txt); border-radius: 6px;
    padding: 6px 9px; font: 12px var(--mono); margin-bottom: 6px; }
  .newnote textarea, .note textarea { min-height: 80px; resize: vertical; }
  .nhist { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 6px; }
  .nhist .hrow { font-size: 11px; padding: 5px 6px; border-radius: 6px; }
  .nhist .hrow:hover { background: var(--panel); }
  .nhist .hmeta { color: var(--dim); font-size: 10px; }
  .nhist .hbody { white-space: pre-wrap; word-break: break-word; opacity: .85; }
  .task { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
    padding: 10px 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
  .task .tid { color: var(--dim); font-size: 11px; }
  .task .ttitle { flex: 1; }
  .task .ttitle .tmeta { display: block; font-size: 10px; color: var(--dim); }
  .tchip { font-size: 10px; font-weight: 700; padding: 2px 9px; border-radius: 12px; letter-spacing: .3px; }
  .tchip.open { background: rgba(90,184,255,.14); color: var(--agent); }
  .tchip.taken { background: rgba(255,176,102,.16); color: var(--warn); }
  .tchip.done { background: rgba(87,217,163,.14); color: var(--human); }
  .tchip.claimed { background: rgba(255,176,102,.16); color: var(--warn); }
  .tchip.resolved { background: rgba(87,217,163,.14); color: var(--human); }
  .tchip.cancelled { background: rgba(255,107,107,.12); color: var(--bad); text-decoration: line-through; }
  .task .tacts button { background: var(--panel); border: 1px solid var(--line); color: var(--txt);
    border-radius: 6px; padding: 3px 9px; font: 10px var(--mono); cursor: pointer; margin-left: 4px; }
  /* Loca Board (board.js): four columns while the `board` extension is on. */
  .tchip.review { background: rgba(245,199,107,.16); color: var(--accent2); }
  .taskboard { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .boardcol { min-width: 0; }
  .boardhead { margin: 0 2px 8px; color: var(--dim); font-size: 10px; font-weight: 800;
    letter-spacing: .1em; text-transform: uppercase; }
  /* A card in a column is narrow: number and state on the first line, the
     title on a line of its own at the column's full width, the acts last.
     Beside the chip the title had a few letters per line. */
  .taskboard .task { flex-wrap: wrap; align-items: baseline; gap: 6px 8px; padding: 9px 10px; }
  .taskboard .task .tid { order: 0; }
  .taskboard .task .tchip { order: 1; margin-left: auto; }
  .taskboard .task .ttitle { order: 2; flex: 1 1 100%; min-width: 0; overflow-wrap: break-word; }
  .taskboard .task .tacts { order: 3; width: 100%; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
  .taskboard .task .tacts button { margin-left: 0; }
  @media (max-width: 760px) { .taskboard { grid-template-columns: 1fr; } }
  .sectionlabel { margin: 18px 2px 8px; color: var(--accent2); font-size: 10px;
    font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
  .sectionhelp { margin: -4px 2px 10px; color: var(--dim); font-size: 10px; line-height: 1.45; }
  .goalbar { flex: 0 0 auto; border-bottom: 1px solid rgba(245,199,107,.22);
    background: rgba(245,199,107,.035); padding: 6px 20px; display: flex;
    align-items: center; gap: 9px; }
  .goalbar .goalmark { color: #f5c76b; font-size: 13px; }
  .goalbar #goalCard { min-width: 0; flex: 1; display: flex; align-items: center; gap: 9px; }
  .goalbar .goallabel { color: #f5c76b; font-size: 9px; font-weight: 800;
    letter-spacing: .11em; text-transform: uppercase; }
  .goalbar .goaloutcome { min-width: 0; flex: 1; color: var(--txt); font-size: 11px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .goalbar .goalproof { color: var(--dim); font-size: 9px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; max-width: 34%; }
  .goalbar button { background: transparent; border: 1px solid var(--line); color: var(--muted);
    border-radius: 6px; padding: 3px 8px; font: 9px var(--mono); cursor: pointer; }
  .goalbar button:hover { color: var(--txt); border-color: var(--muted); }
  .taskcreate { margin-top: 12px; color: var(--muted); font-size: 11px; }
  .taskcreate summary { cursor: pointer; user-select: none; }
  .taskcreate .newnote { margin-top: 8px; }
  .focuspanelrow { min-height: 36px; display: flex; align-items: center; gap: 10px;
    padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--panel2); color: var(--muted); font-size: 11px; }
  .focuspanelrow > span:first-child { min-width: 0; flex: 1; }
  .focuspanelrow button, .reminderview button { background: var(--panel); border: 1px solid var(--line);
    color: var(--txt); border-radius: 6px; padding: 4px 10px; font: 10px var(--mono); cursor: pointer; }
  .reminderview { display: grid; gap: 12px; border: 1px solid var(--line); border-radius: 12px;
    padding: 13px; background: var(--panel2); box-shadow: 0 12px 30px rgba(0,0,0,.12); }
  .reminderstatus { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center;
    gap: 10px; padding: 2px 1px 10px; border-bottom: 1px solid var(--line); }
  .reminderstatuscopy { min-width: 0; display: grid; gap: 2px; }
  .reminderstatuscopy strong { color: var(--txt); font-size: 12px; font-weight: 700; }
  .reminderstatus .remindersummary { color: var(--muted); font-size: 10px; line-height: 1.4;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .reminderstate { padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px;
    color: var(--dim); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
  .reminderstatus.on .reminderstate { color: var(--accent2); border-color: rgba(125,242,213,.32);
    background: rgba(125,242,213,.07); }
  .reminderblock { display: grid; gap: 8px; }
  .reminderblockhead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
  .reminderblockhead b { color: var(--txt); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
  .reminderblockhead small { color: var(--dim); font-size: 9px; }
  .reminderrecipientcontrol { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px;
    padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
  .reminderrecipientcontrol button { min-height: 31px; background: transparent; color: var(--muted);
    border: 0; border-radius: 6px; padding: 6px 10px; }
  .reminderrecipientcontrol button:hover:not(:disabled) { color: var(--txt); background: var(--panel2); }
  .reminderrecipientcontrol button.selected { color: var(--txt); background: rgba(125,242,213,.10);
    box-shadow: inset 0 0 0 1px rgba(125,242,213,.27); }
  .reminderrecipientcontrol button.selected::before { content: "✓ "; color: var(--accent2); }
  .reminderpersonrow { display: grid; grid-template-columns: minmax(0,1fr); }
  .reminderpersonrow select { width: 100%; background: var(--panel); border: 1px solid var(--line);
    color: var(--txt); border-radius: 8px; padding: 8px 9px; font: 10px var(--mono); }
  .reminderto { display: grid; grid-template-columns: auto auto minmax(0,1fr); align-items: baseline;
    gap: 6px; color: var(--muted); font-size: 10px; line-height: 1.45; }
  .reminderto b { color: var(--accent2); }
  .reminderto small { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .reminderrules { display: grid; gap: 6px; }
  .reminderrow { display: grid; grid-template-columns: auto minmax(180px,1fr) auto;
    align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line);
    border-radius: 9px; background: var(--panel); color: var(--txt); transition: border-color .15s, background .15s; }
  .reminderrow:has(> input:checked) { border-color: rgba(125,242,213,.25); background: rgba(125,242,213,.025); }
  .reminderrow > input[type="checkbox"] { appearance: none; width: 27px; height: 16px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--panel2); position: relative; cursor: pointer; }
  .reminderrow > input[type="checkbox"]::after { content: ""; position: absolute; width: 10px; height: 10px;
    left: 2px; top: 2px; border-radius: 50%; background: var(--dim); transition: transform .15s, background .15s; }
  .reminderrow > input[type="checkbox"]:checked { border-color: rgba(125,242,213,.48); background: rgba(125,242,213,.14); }
  .reminderrow > input[type="checkbox"]:checked::after { transform: translateX(11px); background: var(--accent2); }
  .reminderrow .remindercopy { min-width: 0; font-size: 11px; }
  .reminderrow .remindercopy small { display: block; margin-top: 2px; color: var(--dim); line-height: 1.35; }
  .reminderrow .reminderafter { display: flex; align-items: center; gap: 5px;
    color: var(--muted); font-size: 10px; white-space: nowrap; }
  .reminderview input[type="number"] { width: 66px; background: var(--panel); border: 1px solid var(--line);
    color: var(--txt); border-radius: 6px; padding: 5px 7px; font: 11px var(--mono); }
  .reminderview input:disabled { opacity: .45; }
  .reminderview small { color: var(--dim); }
  .reminderadvanced { color: var(--muted); font-size: 10px; }
  .reminderadvanced summary { cursor: pointer; margin: 3px 0; }
  .reminderadvanced[open] { display: grid; gap: 7px; padding: 7px;
    border: 1px dashed var(--line); border-radius: 7px; }
  .reminderlast { padding-top: 9px; border-top: 1px solid var(--line); color: var(--dim);
    font-size: 10px; line-height: 1.45; }
  .reminderhistory { border-top: 1px solid var(--line); padding-top: 8px; color: var(--muted); }
  .reminderhistory summary { cursor: pointer; font-size: 10px; }
  .reminderhistory summary span { color: var(--dim); }
  #reminderHistoryList { display: grid; gap: 6px; margin-top: 8px; }
  .reminderhistoryrow { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 10px;
    padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
  .reminderhistoryrow .rhsubject { min-width: 0; color: var(--txt); font-size: 10px; line-height: 1.4; }
  .reminderhistoryrow .rhmeta { grid-column: 1; color: var(--dim); font-size: 9px; }
  .reminderhistoryrow .rhstate { grid-column: 2; grid-row: 1; align-self: start; color: var(--accent2);
    font-size: 9px; font-weight: 800; text-transform: uppercase; }
  .reminderhistoryrow.resolved .rhstate { color: var(--dim); }
  .reminderhistoryrow button { grid-column: 2; grid-row: 2; justify-self: end; padding: 2px 7px; }
  .reminderactions { display: flex; justify-content: flex-end; align-items: center; gap: 9px; }
  .remindersavestate { color: var(--dim); font-size: 10px; }
  .remindersavestate.saved { color: var(--human); }
  .remindersavestate.error { color: var(--bad); }
  .reminderview #saveReminders { background: var(--accent);
    color: #06231d; border: 0; font-weight: 700; }
  .newnote select { background: var(--panel); border: 1px solid var(--line); color: var(--txt);
    border-radius: 6px; padding: 6px 8px; font: 11px var(--mono); }

  /* ── overlays ── */
  .mentionpop { position: absolute; bottom: 76px; left: 24px; background: var(--panel2);
    border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.5);
    overflow: hidden; z-index: 20; min-width: 170px; }
  .mentionpop div { padding: 6px 12px; cursor: pointer; font-size: 12px; display: flex; gap: 8px; align-items: center; }
  .mentionpop div.sel, .mentionpop div:hover { background: var(--accent); color: #06231d; }
  .mentionpop .mtag { font-size: 9px; opacity: .7; }
  .searchres { position: absolute; top: 130px; left: 50%; transform: translateX(-50%);
    width: min(660px, 92%); max-height: 62vh; overflow-y: auto; background: var(--panel);
    border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.55);
    z-index: 30; padding: 10px 14px; }
  .searchres h3 { margin: 6px 0; font-size: 10px; color: var(--dim); letter-spacing: .1em;
    display: flex; justify-content: space-between; }
  .searchres h3 button { background: none; border: 0; color: var(--muted); cursor: pointer; }
  .sres { padding: 6px 8px; border-radius: 8px; font-size: 12px; }
  .sres:hover { background: var(--panel2); }
  .sres .smeta { font-size: 10px; color: var(--dim); }
  .sres .snote { color: var(--accent2); font-size: 11px; }
  .mobiletoggle, .sidebackdrop { display: none; }
  @media (max-width: 760px) {
    body { display: block; }
    body.locked { display: grid; }
    body:not(.locked) .side { position: fixed; inset: 0 auto 0 0; width: min(320px, 88vw);
      z-index: 80; transform: translateX(-102%); transition: transform .18s ease;
      box-shadow: 14px 0 36px rgba(0,0,0,.55); }
    body.sidebar-open .side { transform: translateX(0); }
    body.locked .side { position: static; transform: none; box-shadow: 0 20px 60px rgba(0,0,0,.55); }
    .sidebackdrop { position: fixed; inset: 0; z-index: 70; border: 0;
      background: rgba(0,0,0,.58); }
    body.sidebar-open:not(.locked) .sidebackdrop { display: block; }
    .mobiletoggle { display: inline-flex; align-items: center; justify-content: center;
      width: 34px; height: 34px; flex: 0 0 auto; background: var(--panel2);
      border: 1px solid var(--line); border-radius: 7px; color: var(--txt); cursor: pointer; }
    body.locked .mobiletoggle { display: none; }
    .top { min-height: 76px; height: auto; flex-basis: auto; padding: 10px 12px;
      gap: 8px; flex-wrap: wrap; }
    .tophead { min-width: 150px; }
    .roomprops .detail { display: none; }
    .tabs { order: 5; width: 100%; margin-left: 0; overflow-x: auto; }
    .tab { flex: 1 0 auto; padding-inline: 9px; }
    .roomactions { margin-left: auto; }
    .leadselect { max-width: 124px; }
    .adminbar { top: 118px; right: 8px; width: calc(100% - 16px); max-height: 62vh; padding: 8px; }
    .goaloptions[open] { grid-template-columns: 1fr; }
    .propertyfields { grid-template-columns: 1fr; }
    .reminderrow { grid-template-columns: auto minmax(0,1fr); }
    .reminderrow .reminderafter { grid-column: 2; justify-self: start; }
    .reminderstatus .remindersummary { white-space: normal; }
    .reminderto { grid-template-columns: auto minmax(0,1fr); }
    .reminderto small { grid-column: 1 / -1; white-space: normal; }
    .feed { padding-inline: 10px; }
    .bubble, .bub { max-width: 92%; }
    .lineacts { opacity: 1; pointer-events: auto; }
    .composer { margin: 6px 8px; grid-template-columns: 1fr auto auto auto; }
    .composer select { grid-column: 1; }
    .composer button.send { grid-column: 2; }
    .composer button.stop { grid-column: 3; }
    .composer #clearBtn { grid-column: 4; }
    .composer button.attach { grid-column: 1 / -1; grid-row: 3; justify-self: start; }
    .hint { padding-inline: 12px; }
    .notes { padding: 12px 10px; }
  }

/* Building-view Join requests (main-app admissions surface) */
.jrsection { margin: 0 0 22px; padding: 0 0 10px; border-bottom: 1px solid var(--line); }
.jrsection.waiting { padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  border-radius: 10px; background: var(--panel2); }
.jrhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.jrhead .bsection { margin: 0; }
.jrstock { display: inline-flex; align-items: center; gap: 10px; color: var(--dim); font-size: 11px; }
.jrrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0 2px; margin-top: 8px; border-top: 1px solid var(--line); }
.jrwho { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.jrwho b { color: var(--txt); }
.jracts { display: flex; gap: 8px; }
.jrnone { color: var(--dim); font-size: 11px; padding: 4px 4px 0; }
.jrnotice { color: var(--accent); font-size: 11px; min-height: 1em; margin-top: 6px; }
.jrerr { color: #f0a; font-size: 11px; padding: 6px 0; }
.jrstale { color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 4px; }

/* Getting Started overlay — first-open guide + reopen via ? Help. */
.gsoverlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; }
.gsoverlay.hidden { display: none; }
.gsbackdrop { position: absolute; inset: 0; border: 0; padding: 0; background: rgba(3,5,8,.66); cursor: default; }
.gscard { position: relative; width: min(520px, 94vw); max-height: 90vh; overflow-y: auto; padding: 22px 24px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel2); box-shadow: 0 24px 70px rgba(0,0,0,.5); }
.gsclose { position: absolute; top: 12px; right: 12px; border: 0; background: transparent; color: var(--dim); font-size: 16px; line-height: 1; padding: 4px; cursor: pointer; }
.gsclose:hover { color: var(--txt); }
.gscard h2 { margin: 0 0 4px; font-size: 18px; color: var(--txt); letter-spacing: .01em; }
.gslede { margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.gssteps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.gssteps li { color: var(--muted); font-size: 12px; line-height: 1.5; }
.gssteps li b { color: var(--txt); font-weight: 600; }
.gssteps li::marker { color: var(--accent); font-weight: 700; }
.gsfoot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.gshint { color: var(--dim); font-size: 10px; }
.gshint b { color: var(--accent2); }
.gsgot { border: 1px solid var(--accent); border-radius: 8px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent2); font-size: 12px; font-weight: 600; padding: 8px 18px; cursor: pointer; }
.gsgot:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
/* Getting Started: audience-aware views (Host vs client) + runtime toggle. */
.gsoverlay:not(.as-host) .gs-host { display: none; }
.gsoverlay.as-host .gs-client { display: none; }
.gsplat { display: inline-flex; gap: 4px; margin-top: 6px; vertical-align: middle; }
.gsplat button { font-family: var(--mono); font-size: 10px; font-weight: 600; cursor: pointer; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--muted); padding: 3px 9px; }
.gsplat button.on { border-color: var(--accent); color: var(--accent2); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.gsplatbody { display: block; margin-top: 6px; color: var(--muted); }
.gsplatnote { display: block; margin-top: 6px; color: var(--dim); font-size: 11px; }
.gscard code { font-family: var(--mono); font-size: 11px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; color: var(--accent2); }
.gsdoclink { margin: 14px 0 0; font-size: 11px; color: var(--dim); }
.gsdoclink a { color: var(--accent2); }
/* Tabbed Getting Started */
.gstabs { display: flex; flex-wrap: wrap; gap: 2px; margin: 2px 0 14px; border-bottom: 1px solid var(--line); }
.gstab { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .02em; cursor: pointer; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); padding: 7px 10px; margin-bottom: -1px; }
.gstab:hover { color: var(--txt); }
.gstab.on { color: var(--accent2); border-bottom-color: var(--accent); }
.gspanel { animation: gsfade .18s ease; }
.gspanel.hidden { display: none; }
@keyframes gsfade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .gspanel { animation: none; } }
.gscmd { display: flex; align-items: stretch; gap: 6px; margin-top: 8px; }
.gscmd.hidden { display: none; }
.gscmd code { flex: 1 1 auto; min-width: 0; overflow-x: auto; white-space: nowrap; padding: 7px 9px; font-size: 11px; }
.gscopy { flex: 0 0 auto; font-family: var(--mono); font-size: 10px; font-weight: 700; cursor: pointer; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--accent2); padding: 0 12px; }
.gscopy:hover { border-color: var(--accent); }
.gsmore { margin-top: 10px; }
.gsmore summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.gsmore[open] summary { color: var(--txt); }
.gsmore p { margin-top: 6px; }
/* The map in Getting Started (index.html #gsMap). The block between the two
   "concepts map" lines is the style element of docs/concepts-at-a-glance.svg,
   character for character (test_concepts_figure.py). */
/* concepts map: begin */
.locamap .lm-bg { fill: var(--panel, #ffffff); }
.locamap text { font-family: var(--mono, ui-monospace, "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace); font-size: 11px; fill: var(--txt, #1a1f27); }
.locamap .lm-h { font-weight: 700; fill: var(--accent, #00766b); }
.locamap .lm-b { font-weight: 700; }
.locamap .lm-box { fill: none; stroke: var(--muted, #4a5568); stroke-width: 1; }
.locamap .lm-building { stroke-width: 2; }
.locamap .lm-lobby { stroke-dasharray: 2 3; }
.locamap .lm-floor { stroke-dasharray: 7 4; }
.locamap .lm-loca { stroke-width: 1.5; }
.locamap .lm-arrow { fill: none; stroke: var(--muted, #4a5568); stroke-width: 1.5; }
.locamap .lm-tip { fill: var(--muted, #4a5568); }
/* concepts map: end */
.gsmap { margin: 0 0 12px; }
.gsmap svg { display: block; width: 100%; max-width: 360px; height: auto; margin: 0 auto; }
.gsmap figcaption { margin-top: 8px; color: var(--muted); font-size: 12px; text-align: center; }
.gsmapwords ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.gsmapwords li { color: var(--muted); font-size: 12px; line-height: 1.5; }
.gsmapwords li b { color: var(--txt); font-weight: 600; }
.gspath { margin: 8px 0; padding: 7px 9px; font-family: var(--mono); font-size: 11px; color: var(--accent2); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow-x: auto; white-space: nowrap; }
.gspath.hidden { display: none; }
.gserror { margin: 8px 0; padding: 7px 9px; font-size: 11px; color: #ffb4a2; background: rgba(255,107,107,.08); border: 1px solid rgba(255,107,107,.3); border-radius: 6px; }
.gserror.hidden { display: none; }

  /* The door: a Building rank looking into a loca without sitting at it. */
  /* Header icon pair: seat (chair / door) beside Properties. */
  .iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; background: none; border: 1px solid transparent; border-radius: 7px; color: var(--muted); cursor: pointer; }
  .iconbtn:hover, .iconbtn:focus-visible { color: var(--accent); border-color: var(--line); }
  .iconbtn.on { color: var(--accent); border-color: var(--line); background: var(--panel2); }
  .seattoggle.watching { color: var(--accent2); }
  .iconbtn.hidden { display: none; }
  .doorbar b { color: var(--txt); font-weight: 600; }
  .doorbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 16px 8px; padding: 9px 12px; border: 1px dashed var(--line); border-radius: 9px; background: var(--panel2); color: var(--muted); font-size: 12px; }
  .doorbar button { background: var(--accent); color: var(--bg); border: 0; border-radius: 7px; padding: 6px 12px; font-weight: 700; cursor: pointer; }
  /* Building directory on a phone: each row becomes a small card. */
  @media (max-width: 760px) {
    .peoplehead { display: none; }
    .prow { grid-template-columns: 1fr auto; grid-template-areas: "name acts" "status status" "groups groups" "where where";
      row-gap: 6px; padding: 12px 8px; }
    .prow .pname { grid-area: name; }
    .prow .pgroups { grid-area: groups; }
    .prow .pstatuses { grid-area: status; }
    .prow .pwhere { grid-area: where; }
    .prow .pacts { grid-area: acts; flex-wrap: wrap; }
    .jrrow { flex-wrap: wrap; }
  }

  /* Header tooltips (tooltip.js): one fixed bubble, mono, panel-coloured,
     with a small arrow pointing at the control it describes. */
  .tip { position: fixed; z-index: 1000; max-width: 260px; pointer-events: none;
    background: var(--panel2); color: var(--txt); border: 1px solid var(--line);
    border-radius: 7px; padding: 6px 9px; font: 11px/1.4 var(--mono);
    box-shadow: 0 6px 18px rgba(0,0,0,.35); animation: tipin .12s ease-out; }
  .tip[hidden] { display: none; }
  .tip b { display: block; font-weight: 700; }
  .tip span { display: block; color: var(--muted); margin-top: 2px; }
  .tip::before { content: ""; position: absolute; left: var(--tip-arrow, 50%); top: -5px;
    width: 8px; height: 8px; margin-left: -4px; background: var(--panel2);
    border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg); }
  .tip.above::before { top: auto; bottom: -5px; transform: rotate(225deg); }
  @keyframes tipin { from { opacity: 0; transform: translateY(-2px); } to { opacity: 1; transform: none; } }
  .conndot:focus-visible, .pill:focus-visible, .livebadge:focus-visible, .archbadge:focus-visible {
    outline: 1px solid var(--accent); outline-offset: 2px; }
  @media (prefers-reduced-motion: reduce) { .tip { animation: none; } .livebadge { animation: none; } }

  /* Direct message (dm.js): Messages in the sidebar, the privacy bar above the
     composer, and the Master's existence-only list in the Building view. */
  .dmsection { margin-top: 14px; }
  .buildingview .rooms.dmsection { flex: 0 0 auto; max-height: 32vh; min-height: 0; }
  .dmsection.empty .dmhint { color: var(--dim); font-size: 11px; padding: 2px 10px 6px; }
  .room.dm .dmname { display: inline-flex; align-items: center; gap: 6px; }
  .room.dm .dmname::before { content: none; }
  .dmmaster { font-size: 10px; color: var(--warn); border: 1px solid var(--line); border-radius: 10px; padding: 0 6px; margin-left: auto; }
  .dmbtn { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
    padding: 0; margin-left: 4px; background: none; border: 1px solid transparent; border-radius: 6px;
    color: var(--muted); cursor: pointer; flex: 0 0 auto; }
  .dmbtn:hover, .dmbtn:focus-visible { color: var(--accent); border-color: var(--line); }
  .dmbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
    margin: 0 16px 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px;
    background: var(--panel2); color: var(--muted); font-size: 12px; }
  .dmbar b { color: var(--txt); font-weight: 600; }
  .dmbar .bbacts { display: flex; gap: 6px; flex-wrap: wrap; }
  .main.dm .tabs, .main.dm .roomprops, .main.dm #liveToggle,
  .main.dm #adminToggle, .main.dm #leadKey, .main.dm #leadSelect,
  .main.dm #seatToggle, .main.dm #target, .main.dm #hint,
  .main.dm #stopBtn { display: none !important; }
  .main.dm .top .rname::before { content: "@ "; }
  .main.global .dmbar { display: none !important; }
  .dmoverview { margin: 18px 0 8px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel); }
  .dmoverview.hidden { display: none; }
  .bbhead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 6px; }
  .bbhead span { color: var(--muted); }
  .bbhead small { flex-basis: 100%; color: var(--muted); font-size: 11px; }
  .bbrow { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto; gap: 10px;
    align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 12px; }
  .bbpair { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bbamp { color: var(--dim); }
  .bbwhen { color: var(--muted); font-size: 11px; }
  .bbempty { color: var(--dim); font-size: 12px; padding: 6px 0; }
  .bbwitness { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; max-height: 320px; overflow: auto; }
  .bbwitness.hidden { display: none; }
  .bbwhead { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; margin-bottom: 6px; }
  .bbline { font-size: 12px; padding: 3px 0; overflow-wrap: anywhere; }
  .bbtime { color: var(--dim); margin-right: 8px; font-size: 11px; }
  @media (max-width: 760px) {
    .bbrow { grid-template-columns: 1fr auto; grid-template-areas: "pair acts" "when when"; }
    .bbrow .bbpair { grid-area: pair; } .bbrow .bbwhen { grid-area: when; } .bbrow .pacts { grid-area: acts; }
  }

  /* Keys (keys.js): the Master's one place to issue codes, and the ledger. */
  .keyform { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
  .keyform select, .keyform input { background: var(--panel2); color: var(--txt); border: 1px solid var(--line);
    border-radius: 7px; padding: 6px 8px; font: 12px var(--mono); color-scheme: dark; min-width: 0; }
  .keyform select { flex: 1 1 260px; }
  .keyform input { flex: 1 1 160px; }
  .keyform input.hidden { display: none; }
  .keyissued { border: 1px solid var(--accent); border-radius: 9px; padding: 9px 11px; margin: 4px 0 10px;
    font-size: 12px; display: grid; gap: 6px; background: var(--panel2); }
  .keyissued.hidden { display: none; }
  .keyissued .bad { color: var(--bad); }
  .keysecret { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .keysecret code { overflow-wrap: anywhere; color: var(--accent2); font-size: 12px; }
  .keyfilters { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
  .chip { background: none; border: 1px solid var(--line); border-radius: 12px; padding: 2px 10px;
    color: var(--muted); font: 11px var(--mono); cursor: pointer; }
  .chip.on { color: var(--txt); background: var(--panel2); border-color: var(--accent); }
  .keyrow { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1.4fr) 90px 76px;
    gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 12px; }
  .keykind { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .keykind code { color: var(--muted); font-size: 11px; }
  .keywho { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .keyloca { color: var(--muted); }
  .keydates { font-size: 11px; color: var(--muted); }
  .keydim { color: var(--dim); }
  .keystate { justify-self: start; font-size: 10px; font-weight: 700; padding: 1px 8px; border-radius: 10px;
    border: 1px solid var(--line); color: var(--muted); }
  .keystate.state-unused { color: var(--warn); border-color: rgba(255,176,102,.4); }
  .keystate.state-active, .keystate.state-used { color: var(--human); border-color: rgba(87,217,163,.35); }
  .keystate.state-expired, .keystate.state-revoked, .keystate.state-superseded { color: var(--dim); }
  .prow.unusedcode .pnametext { color: var(--muted); font-style: italic; }
  .pstatus.warn { color: var(--warn); }
  @media (max-width: 760px) {
    .keyrow { grid-template-columns: 1fr auto; grid-template-areas: "kind state" "who who" "dates acts"; }
    .keyrow .keykind { grid-area: kind; } .keyrow .keystate { grid-area: state; justify-self: end; }
    .keyrow .keywho { grid-area: who; } .keyrow .keydates { grid-area: dates; } .keyrow .pacts { grid-area: acts; }
  }
  .keylisthead { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--txt); font-weight: 600; }
  .keylisthead span { color: var(--muted); font-weight: 400; }
  .keylisthead small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; margin-top: 2px; }

  /* Building sub-tabs: People · Keys · Private messages. Same pill row as the
     loca tabs, so the Building reads like a place with rooms of its own. */
  .buildingtabs { display: inline-flex; align-items: center; gap: 3px; margin: 0 0 16px;
    background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; max-width: 100%;
    overflow-x: auto; }
  .btab { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 5px 14px;
    white-space: nowrap; border-radius: 6px; font: 12px var(--mono); line-height: 14px; }
  .btab:hover { color: var(--txt); }
  .btab.active { background: var(--panel); color: var(--txt); box-shadow: inset 0 0 0 1px var(--line); }
  .btab.hidden { display: none; }
  .buildingpane { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: var(--panel); }
  .buildingpane.hidden { display: none; }
  #peopleList.hidden { display: none; }

  /* Loca extensions (extensions.js): the This Loca block, the create screen
     and the manage list. One card, one row shape, the shared .btn. */
  .locaext { margin-top: 0; padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
  .locaexthead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .locaexthead > span { color: var(--dim); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
  .extlink { border: 0; background: transparent; padding: 0; color: var(--accent2); font: 600 11px var(--mono); cursor: pointer; }
  .extlink:hover, .extlink:focus-visible { color: var(--txt); text-decoration: underline; outline: none; }
  .extchips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
  .extchip { padding: 2px 8px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--line);
    color: var(--accent2); font-size: 11px; white-space: nowrap; }
  .extnone { color: var(--dim); font-size: 11px; }
  .extoverlay { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; }
  .extbackdrop { position: absolute; inset: 0; border: 0; padding: 0; background: rgba(3,5,8,.66); cursor: default; }
  .extcard { position: relative; width: min(460px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
    overflow-y: auto; box-sizing: border-box; padding: 20px 20px 16px; border: 1px solid var(--line); border-radius: 14px;
    background: var(--panel2); box-shadow: 0 24px 70px rgba(0,0,0,.5); }
  .extcard h2 { margin: 0 0 14px; font-size: 16px; color: var(--txt); font-weight: 600; overflow-wrap: anywhere; }
  .extcard h2 small { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 6px; }
  .extfield { display: flex; flex-direction: column; gap: 5px; }
  .extfield > span, .extsectionhead, .extgrouplabel { color: var(--dim); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
  .extfield input { box-sizing: border-box; width: 100%; background: var(--panel); border: 1px solid var(--line);
    color: var(--txt); border-radius: 7px; padding: 8px 10px; font: 12px var(--mono); }
  .extfield input:focus { outline: none; border-color: var(--accent); }
  .extsection { margin-top: 16px; }
  .extsectionhead { color: var(--muted); margin-bottom: 8px; }
  .extgroup + .extgroup { margin-top: 10px; }
  .extgrouplabel { margin: 0 0 4px; }
  .extrow, .extitem { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line);
    border-radius: 8px; background: var(--panel); min-width: 0; }
  .extrow + .extrow, .extitem + .extitem { margin-top: 4px; }
  .extrow { cursor: pointer; }
  .extrow.fixed { cursor: default; opacity: .75; }
  .extrow input { flex: 0 0 auto; margin: 0; width: 14px; height: 14px; accent-color: var(--accent); }
  .extrow:has(input:checked:not(:disabled)) { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
  .extrowtext { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
  .extrowtext b { color: var(--txt); font-size: 12px; font-weight: 600; }
  .extrowtext small { color: var(--muted); font-size: 10px; line-height: 1.4; }
  .extitem .btn { flex: 0 0 auto; gap: 5px; min-width: 72px; justify-content: center; }
  .extitem .btn.extadded { color: var(--accent2); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
  .extitem .btn.extadded:hover, .extitem .btn.extadded:focus-visible { color: var(--bad); border-color: var(--bad); }
  .extitem.fixed { opacity: .75; }
  .extstate { flex: 0 0 auto; color: var(--dim); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
  .extstate.on { color: var(--accent2); }
  .exttabs { margin: 14px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
  .exttabs b { color: var(--txt); font-weight: 600; }
  .extnote { margin: 12px 0 0; color: var(--dim); font-size: 10px; line-height: 1.5; }
  #locaDeleteName { width: 100%; margin-top: 6px; }
  .exterror { color: var(--bad); font-size: 11px; min-height: 0; margin-top: 8px; overflow-wrap: anywhere; }
  .exterror:empty { display: none; }
  .extactions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ── personal appearance: tokens ─────────────────────────────────────────
   Appended (not merged into the rules above) so concurrent stylesheet work
   merges cleanly. New tokens and the theme/accent overrides come first;
   then every rule above that hard-coded a colour is re-declared with the
   matching token, so it follows the light theme and the chosen accent. In
   the default dark/teal look each re-declaration computes to the original. */
:root {
  --scheme: dark; --me: var(--accent); --on-accent: #06231d; --on-bad: #2a0e0e;
  --gold: #f5c76b; --gold-txt: #ffe0a0; --master: #e7b95a; --smaster: #d3a95d;
}
/* Personal appearance (GET/PUT /profile/preferences). theme.js sets
   data-theme / data-accent / data-density / data-font-size on <html>.
   Every accent has a bright dark-theme pair and a deep light-theme pair so
   accent text keeps 4.5:1 on --bg, --panel and --panel2 in both themes. */
:root[data-accent="blue"] { --accent: #7aa7ff; --accent2: #a8c4ff; }
:root[data-accent="violet"] { --accent: #b99aff; --accent2: #d3bfff; }
:root[data-accent="amber"] { --accent: #ffbe4d; --accent2: #ffd585; }
:root[data-accent="rose"] { --accent: #ff7eaa; --accent2: #ffaac8; }
:root[data-theme="light"] {
  --scheme: light;
  --bg: #f5f7fa; --panel: #ffffff; --panel2: #e9edf2; --line: #c9d1db;
  --txt: #1a1f27; --muted: #4a5568; --dim: #566173;
  --accent: #00766b; --accent2: #006a60; --on-accent: #ffffff;
  --agent: #0a5fa8; --human: #0b6e47;
  --iye: #6a3db5; --iye-deep: #ece3fb;
  --warn: #8f4a00; --bad: #b8212a; --on-bad: #ffffff;
  --gold: #7d5200; --gold-txt: #6e4800; --master: #7d5200; --smaster: #6e4800;
}
:root[data-theme="light"][data-accent="blue"] { --accent: #2c56cf; --accent2: #2448b3; }
:root[data-theme="light"][data-accent="violet"] { --accent: #6c3fd0; --accent2: #5c32b5; }
:root[data-theme="light"][data-accent="amber"] { --accent: #8c5400; --accent2: #7a4800; }
:root[data-theme="light"][data-accent="rose"] { --accent: #c02460; --accent2: #a61f53; }
/* Hard-coded colours above, re-declared with tokens. */
.wikiindex button.active { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.wikiprimary { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.profileroles b.building-master { color: var(--master); }
.profileroles b.building-smaster { color: var(--smaster); }
.profilesignout .leavebtn { border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }
.leaveconfirm { border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }
.leaveconfirm .yes { color: var(--on-bad); }
.leadtag { background: color-mix(in srgb, var(--gold) 18%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 62%, transparent); color: var(--gold-txt); }
.leadtag::before { color: var(--gold); }
.omem.is-lead { background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 22%, transparent), color-mix(in srgb, var(--gold) 4%, transparent) 82%); box-shadow: inset 3px 0 var(--gold); }
.omem.is-lead .oname { color: var(--gold-txt); }
.memoryownertag { background: color-mix(in srgb, var(--accent) 14%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 52%, transparent); }
.omem.is-memory-owner:not(.is-lead) { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 16%, transparent), color-mix(in srgb, var(--accent) 3%, transparent) 82%); }
.pstatus.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.pstage.relay { color: var(--warn); }
.callrow:hover { background: var(--panel2, color-mix(in srgb, var(--txt) 4%, transparent)); }
.row.announce .bub { background: color-mix(in srgb, var(--warn) 10%, transparent); }
.conn select { color-scheme: var(--scheme); }
.conn button { color: var(--on-accent); }
.roomitem { border-bottom: 1px solid color-mix(in srgb, var(--txt) 2.5%, transparent); }
.roompref:hover, .roompref:focus-visible { background: color-mix(in srgb, var(--txt) 5.5%, transparent); }
.room .unreadbadge { color: var(--on-accent); }
.newroom button { color: var(--on-accent); }
.lobby .lobbycall { border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.lobby .lobbycall:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.omem .glyph.lead { color: var(--gold); text-shadow: 0 0 9px color-mix(in srgb, var(--gold) 72%, transparent); }
.omacts button.release { border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent); }
.omacts button.release:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.conndot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 12%, transparent); }
.conndot.on { box-shadow: 0 0 0 3px color-mix(in srgb, var(--human) 12%, transparent); }
.pill.free { background: color-mix(in srgb, var(--human) 14%, transparent); }
.pill.restricted { background: color-mix(in srgb, var(--agent) 14%, transparent); }
.pill.roundrobin { background: color-mix(in srgb, var(--warn) 16%, transparent); }
.pill.paused { background: color-mix(in srgb, var(--bad) 14%, transparent); }
.livebadge { background: color-mix(in srgb, var(--bad) 14%, transparent); }
.archbadge { background: color-mix(in srgb, var(--warn) 14%, transparent); }
.leadkey { color: var(--gold); }
.leadselect { color-scheme: var(--scheme); background: color-mix(in srgb, var(--gold) 10%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 48%, transparent); color: var(--gold-txt); }
.leadselect:focus { outline: 1px solid var(--gold); }
.propertyfield { border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 34%, transparent); }
.propertyfield.lifecycle { border-color: color-mix(in srgb, var(--bad) 20%, transparent); }
.adminbar button { color: var(--on-accent); }
.adminbar button.danger { border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); }
.livebtn.on { color: var(--on-bad) !important; }
.pinnedbar { border-color: color-mix(in srgb, var(--iye) 38%, transparent); border-left-color: var(--iye); background: linear-gradient(100deg, color-mix(in srgb, var(--iye-deep) 42%, transparent), var(--panel2)); }
.row.mine .bubble { background: color-mix(in srgb, var(--accent) 7%, transparent); border-color: color-mix(in srgb, var(--accent) 28%, transparent); }
.row.locareminder .bubble { background: color-mix(in srgb, var(--warn) 11%, transparent); border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.bubble .mention.leadkeyword, .txt .mention.leadkeyword { color: var(--gold); }
.jump { color: var(--on-accent); }
@keyframes flash { from { background: color-mix(in srgb, var(--accent) 14%, transparent); } to { background: transparent; } }
.composer:focus-within { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent); }
.composer button.send { color: var(--on-accent); }
.composer.sending { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.memorysteward { border:1px solid color-mix(in srgb, var(--accent) 52%, transparent); background:color-mix(in srgb, var(--accent) 10%, transparent); }
.note .nkey { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.markdown blockquote { background: color-mix(in srgb, var(--agent) 5%, transparent); }
.newnote button { color: var(--on-accent); }
.tchip.open { background: color-mix(in srgb, var(--agent) 14%, transparent); }
.tchip.taken { background: color-mix(in srgb, var(--warn) 16%, transparent); }
.tchip.done { background: color-mix(in srgb, var(--human) 14%, transparent); }
.tchip.claimed { background: color-mix(in srgb, var(--warn) 16%, transparent); }
.tchip.resolved { background: color-mix(in srgb, var(--human) 14%, transparent); }
.tchip.cancelled { background: color-mix(in srgb, var(--bad) 12%, transparent); }
.goalbar { border-bottom: 1px solid color-mix(in srgb, var(--gold) 22%, transparent); background: color-mix(in srgb, var(--gold) 3.5%, transparent); }
.goalbar .goalmark { color: var(--gold); }
.goalbar .goallabel { color: var(--gold); }
.reminderstatus.on .reminderstate { border-color: color-mix(in srgb, var(--accent2) 32%, transparent); background: color-mix(in srgb, var(--accent2) 7%, transparent); }
.reminderrecipientcontrol button.selected { background: color-mix(in srgb, var(--accent2) 10%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent2) 27%, transparent); }
.reminderrow:has(> input:checked) { border-color: color-mix(in srgb, var(--accent2) 25%, transparent); background: color-mix(in srgb, var(--accent2) 2.5%, transparent); }
.reminderrow > input[type="checkbox"]:checked { border-color: color-mix(in srgb, var(--accent2) 48%, transparent); background: color-mix(in srgb, var(--accent2) 14%, transparent); }
.reminderview #saveReminders { color: var(--on-accent); }
.mentionpop div.sel, .mentionpop div:hover { color: var(--on-accent); }
.jrerr { color: var(--bad); }
.gserror { color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, transparent); border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent); }

/* ── personal appearance ─────────────────────────────────────────────── */
/* Light theme: the few dark-only gradients keep their shape, lighter. */
:root[data-theme="light"] .room.special { border-color: color-mix(in srgb, var(--iye) 45%, var(--line));
  background: linear-gradient(105deg, color-mix(in srgb, var(--iye) 12%, transparent), transparent); }
:root[data-theme="light"] .room.special:hover, :root[data-theme="light"] .room.special.active {
  background: linear-gradient(105deg, color-mix(in srgb, var(--iye) 20%, transparent), color-mix(in srgb, var(--iye) 6%, transparent)); }
:root[data-theme="light"] .omem .glyph.lead { text-shadow: none; }
/* Compact density: tighter sidebar rows and feed, nothing else moves. */
:root[data-density="compact"] .rooms { padding: 4px 0; }
:root[data-density="compact"] .roomitem { min-height: 36px; }
:root[data-density="compact"] .room { padding: 5px 12px 5px 13px; }
:root[data-density="compact"] .rlabel { padding: 3px 16px; }
:root[data-density="compact"] .omem { padding: 1px 16px; }
:root[data-density="compact"] .feed { padding: 8px 20px 6px; gap: 3px; }
:root[data-density="compact"] .bubble { padding: 4px 10px 3px; border-radius: 9px; }
:root[data-density="compact"] .composer { padding: 7px 10px; }
/* Large text: reading surfaces only, so the chrome keeps its layout. */
:root[data-font-size="large"] .body, :root[data-font-size="large"] .row .txt,
:root[data-font-size="large"] .composer textarea#msg { font-size: 15px; }
:root[data-font-size="large"] .line .sender { font-size: 13px; }
:root[data-font-size="large"] .note .nbody { font-size: 14px; }
:root[data-font-size="large"] .wikibody { font-size: 17px; }
/* Small and larger text: the same reading surfaces, one step either side. */
:root[data-font-size="small"] .body, :root[data-font-size="small"] .row .txt,
:root[data-font-size="small"] .composer textarea#msg { font-size: 12px; }
:root[data-font-size="small"] .line .sender { font-size: 11px; }
:root[data-font-size="small"] .note .nbody { font-size: 11px; }
:root[data-font-size="small"] .wikibody { font-size: 14px; }
:root[data-font-size="larger"] .body, :root[data-font-size="larger"] .row .txt,
:root[data-font-size="larger"] .composer textarea#msg { font-size: 17px; }
:root[data-font-size="larger"] .line .sender { font-size: 15px; }
:root[data-font-size="larger"] .note .nbody { font-size: 16px; }
:root[data-font-size="larger"] .wikibody { font-size: 19px; }
/* Spacious density: the compact rules' mirror, more air in the same places. */
:root[data-density="spacious"] .rooms { padding: 12px 0; }
:root[data-density="spacious"] .roomitem { min-height: 56px; }
:root[data-density="spacious"] .room { padding: 14px 12px 14px 13px; }
:root[data-density="spacious"] .rlabel { padding: 9px 16px; }
:root[data-density="spacious"] .omem { padding: 6px 16px; }
:root[data-density="spacious"] .feed { padding: 20px 28px 12px; gap: 12px; }
:root[data-density="spacious"] .bubble { padding: 10px 15px 9px; }
:root[data-density="spacious"] .composer { padding: 13px 15px; }
/* Font family. --mono is the app's one type token (the name predates the
   choice); a choice swaps its face. Every face is already on the device:
   no download, no external request (the CSP allows none). */
:root {
  --font-mono: ui-monospace, "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}
:root[data-font-family="sans"] { --mono: var(--font-sans); }
:root[data-font-family="serif"] { --mono: var(--font-serif); }
/* Commands and paths stay monospace whatever the face. */
.gscard code, .gspath { font-family: var(--font-mono); }
@media (max-width: 760px) {
  :root[data-density="compact"] .feed { padding-inline: 10px; }
  :root[data-density="spacious"] .feed { padding-inline: 12px; }
}
/* Appearance block in the profile menu: real radios, styled as chips. */
.profileappearance { margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line); display: grid; gap: 5px; }
.profileappearance > small { color: var(--dim); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.appearancerow { display: grid; grid-template-columns: 54px minmax(0, 1fr); align-items: center; gap: 6px; }
.appearancerow > span { color: var(--muted); font-size: 9px; }
.appearanceopts { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.appearanceopt { position: relative; display: inline-flex; cursor: pointer; }
.appearanceopt input { position: absolute; inset: 0; z-index: 1; margin: 0; opacity: 0; cursor: pointer; }
.appearanceopt > span { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 7px;
  border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 9px; background: var(--panel); }
.appearanceopt:hover > span { color: var(--txt); }
.appearanceopt input:checked + span { border-color: var(--accent); color: var(--accent2);
  background: color-mix(in srgb, var(--accent) 12%, var(--panel)); font-weight: 700; }
.appearanceopt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.appearanceopt > span.swatch { width: 22px; padding: 0; justify-content: center; border-radius: 50%;
  border: 2px solid var(--panel2); box-shadow: 0 0 0 1px var(--line); background: var(--sw); }
.appearanceopt input:checked + span.swatch { border-color: var(--panel2); box-shadow: 0 0 0 2px var(--txt); background: var(--sw); }
.appearanceopt input:checked + span.swatch::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--panel2); }
.swatch.teal { --sw: #2ee6c8; } .swatch.blue { --sw: #7aa7ff; } .swatch.violet { --sw: #b99aff; }
.swatch.amber { --sw: #ffbe4d; } .swatch.rose { --sw: #ff7eaa; }
:root[data-theme="light"] .swatch.teal { --sw: #00766b; } :root[data-theme="light"] .swatch.blue { --sw: #2c56cf; }
:root[data-theme="light"] .swatch.violet { --sw: #6c3fd0; } :root[data-theme="light"] .swatch.amber { --sw: #8c5400; }
:root[data-theme="light"] .swatch.rose { --sw: #c02460; }
.visuallyhidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.appearanceopt > span.fontface.mono { font-family: var(--font-mono); }
.appearanceopt > span.fontface.sans { font-family: var(--font-sans); }
.appearanceopt > span.fontface.serif { font-family: var(--font-serif); }
/* The sample uses the chat's own rules; only its frame is fitted here. */
.appearancepreview { font-size: 13px; line-height: 1.6; min-width: 0; }
.appearancepreview .bubble { max-width: 100%; }
.appearancestatus { color: var(--bad); font-size: 9px; min-height: 0; }
.appearancestatus:empty { display: none; }
/* The closed off-canvas sidebar keeps no shadow: on the light theme it would
   leave a grey band along the left edge of the phone layout. */
@media (max-width: 760px) {
  body:not(.locked):not(.sidebar-open) .side { box-shadow: none; }
}
/* The sign-in card floats on a light page: a softer shadow keeps its edge. */
:root[data-theme="light"] body.locked .side { box-shadow: 0 16px 48px rgba(16,24,40,.14); }

  /* New private message (dm.js): + beside MESSAGES and a person picker. */
  .rlabel.dmhead { display: flex; align-items: center; justify-content: space-between; }
  .dmnew { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0;
    background: none; border: 1px solid transparent; border-radius: 6px; color: var(--muted); cursor: pointer; }
  .dmnew:hover, .dmnew:focus-visible, .dmnew[aria-expanded="true"] { color: var(--accent); border-color: var(--line); }
  .dmpicker { margin: 0 10px 8px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel2); }
  .dmpicker.hidden { display: none; }
  .dmpicker input { box-sizing: border-box; width: 100%; background: var(--panel); border: 1px solid var(--line);
    border-radius: 7px; padding: 6px 8px; color: var(--txt); font: 12px var(--mono); }
  .dmpicker input:focus { outline: none; border-color: var(--accent); }
  #dmCandidates { margin-top: 6px; max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
  .dmcand { display: flex; align-items: center; gap: 7px; width: 100%; padding: 7px 8px; background: none; border: 0;
    border-radius: 7px; color: var(--txt); font: 12px var(--mono); text-align: left; cursor: pointer; min-height: 32px; }
  .dmcand:hover, .dmcand:focus-visible { background: var(--panel); outline: none; }
  .dmcandname { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* The operator wears its title on every line, like the lead. */
  .roletags { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
  .roletags:empty { display: none; }
  .optag { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; border-radius: 9px;
    font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    color: var(--accent2); border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
    background: color-mix(in srgb, var(--accent) 12%, transparent); }
  .optag::before { content: "▲"; font-size: 7px; }
  .roletags .leadtag, .roletags .rankbadge { margin-left: 0; }
  /* The number of the task a person holds, worn like a title. */
  .tasktag { display: inline-flex; align-items: center; padding: 0 6px; border-radius: 9px; margin-left: 6px;
    font-size: 9px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--txt);
    border: 1px solid color-mix(in srgb, var(--txt) 30%, transparent); }
  .roletags .tasktag { margin-left: 0; }

  /* Groups (groups.js): the Groups tab, the People group column and filter,
     the sidebar group headers, the create choice and a person's card. */
  .pgroups, .grpchips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
  .grpchip { display: inline-block; max-width: 100%; padding: 1px 7px; border-radius: 6px; border: 1px solid
      color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--txt); font-size: 10px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pnamebtn { min-width: 0; padding: 0; border: 0; background: none; font: inherit; color: var(--txt);
    font-weight: 600; cursor: pointer; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pnamebtn:hover, .pnamebtn:focus-visible { color: var(--accent2); text-decoration: underline; outline: none; }
  .grpfilter { margin: 0 0 14px; }
  .grpform input { flex: 1 1 220px; }
  .grpnotice { color: var(--muted); font-size: 11px; min-height: 0; margin: 0 0 8px; overflow-wrap: anywhere; }
  .grpnotice:empty { display: none; }
  .grplist { display: grid; gap: 10px; }
  .grpcard { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--panel2); min-width: 0; }
  .grpcard.archived { opacity: .8; border-style: dashed; }
  .grphead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
  .grpname { display: inline-flex; align-items: center; gap: 7px; min-width: 0; flex: 1 1 160px; }
  .grpname b { color: var(--txt); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .grpicon { flex: 0 0 auto; color: var(--accent2); }
  .grpacts { flex-wrap: wrap; justify-content: flex-end; }
  .grpowner { flex-basis: 100%; color: var(--muted); font-size: 11px; }
  .grplocas { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
  .grplabel { color: var(--dim); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; margin-right: 4px; }
  .grpmembers { margin-top: 10px; }
  .grpmembers > .grplabel { display: block; margin-bottom: 2px; }
  .grpmember { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0;
    border-top: 1px solid var(--line); min-width: 0; }
  .grpmember .pname { flex: 1 1 auto; }
  .grpmember .pname b { color: var(--txt); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .grpremove { gap: 4px; }
  .grpadd { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
  .grpadd select { flex: 1 1 200px; min-width: 0; background: var(--panel); color: var(--txt); border: 1px solid var(--line);
    border-radius: 7px; padding: 5px 8px; font: 12px var(--mono); color-scheme: var(--scheme, dark); }
  .rgrouphead { display: flex; align-items: center; gap: 6px; padding: 10px 16px 4px; color: var(--muted);
    font-size: 10px; letter-spacing: .1em; text-transform: uppercase; border-top: 1px solid var(--line); }
  .rgroupname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* A named floor's heading reads "<name> floor", beside "Ground floor". The
     word is drawn here, so the element's text stays the group's own name. */
  .rgrouphead.saysfloor .rgroupname::after { content: " floor"; }
  .caretag { flex: none; margin-left: 6px; padding: 0 5px; border-radius: 6px; font-size: 9px;
    letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
    border: 1px solid color-mix(in srgb, var(--muted) 45%, transparent); }
  .rgroupcount { color: var(--dim); letter-spacing: 0; }
  /* A floor of "Your Locas": its heading opens and closes it. */
  .floor > summary.rgrouphead { list-style: none; cursor: pointer; user-select: none; }
  .floor > summary.rgrouphead::-webkit-details-marker { display: none; }
  .floor > summary.rgrouphead::before { content: "▸"; color: var(--dim); font-size: 9px; width: 8px;
    transition: transform .12s ease; }
  .floor[open] > summary.rgrouphead::before { transform: rotate(90deg); }
  .floor > summary.rgrouphead:hover { color: var(--txt); }
  .floor > summary.rgrouphead .unreadbadge { min-width: 16px; height: 16px; padding: 0 4px; display: inline-flex;
    align-items: center; justify-content: center; border-radius: 9px; background: var(--accent);
    color: var(--on-accent, #06231d); font: 800 9px/1 var(--mono); letter-spacing: 0; }
  #roomList > .floor:first-child > summary.rgrouphead { border-top: 0; }
  .extfield select { box-sizing: border-box; width: 100%; background: var(--panel); border: 1px solid var(--line);
    color: var(--txt); border-radius: 7px; padding: 7px 10px; font: 12px var(--mono); color-scheme: var(--scheme, dark); }
  .extfield select:focus { outline: none; border-color: var(--accent); }
  .extgroupfield { margin-top: 12px; }
  .extgroupnote { color: var(--muted); font-size: 10px; }
  .personcard h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .personcard .grpmember .pname { gap: 7px; }
  .profilegroups { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 7px 1px 0; }
  .profilegroups small { color: var(--dim); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
  .profilegroups .grpchips { justify-content: flex-end; }
  .grpfilter .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  @media (max-width: 520px) {
    .grpremove { padding: 0 8px; }
    .grpremove span { display: none; }
  }

  /* MESSAGES sits at the bottom of the sidebar: its row menu opens upward,
     or it would fall behind the new-loca bar and never be seen. */
  #dmList .roomprefmenu { top: auto; bottom: calc(100% + 4px); }
  .roomprefmenu .roompref.danger { color: var(--bad); }

  /* This Loca › Group: the Master moves a loca after seeing what changes. */
  .groupmove { margin-top: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px;
    background: var(--panel2); display: grid; gap: 7px; font-size: 11px; }
  .gmfield { display: flex; flex-direction: column; gap: 4px; }
  .gmfield > span { color: var(--dim); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
  .gmfield select { background: var(--panel); color: var(--txt); border: 1px solid var(--line); border-radius: 7px;
    padding: 6px 8px; font: 12px var(--mono); color-scheme: var(--scheme, dark); }
  .gmline { color: var(--muted); line-height: 1.45; overflow-wrap: anywhere; }
  .gmline b { color: var(--txt); font-weight: 600; }
  .gmline.bad b { color: var(--bad); }
  .gmerror { color: var(--bad); }
  .gmacts { display: flex; justify-content: flex-end; gap: 6px; }

  /* Location chips never spill out of their column: a long loca name is cut
     with an ellipsis (full name on hover), extra locas fold into "+N". */
  .pwhere, .pgroups { overflow: hidden; }
  .locachip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; box-sizing: border-box; }
  .locachip.more { flex: 0 0 auto; color: var(--muted); }

  /* Notifications (notifications.js): the bell in the sidebar header, its
     panel, the composer for senders, and the arrival toast. */
  .side h1 .notifbell { position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; padding: 0; border-radius: 7px; }
  .side h1 .notifbell.hidden { display: none; }
  .side h1 .notifbell[aria-expanded="true"] { color: var(--accent); background: var(--panel2); }
  .notifbadge { position: absolute; top: -2px; right: -5px; min-width: 15px; height: 15px; padding: 0 4px;
    box-sizing: border-box; border-radius: 999px; background: var(--accent); color: var(--on-accent, var(--bg));
    font: 700 9px/15px var(--mono); text-align: center; letter-spacing: 0; pointer-events: none;
    box-shadow: 0 0 0 2px var(--panel); }
  .notifpanel { position: fixed; z-index: 90; top: var(--notif-top, 60px); left: var(--notif-left, 12px);
    width: min(400px, calc(100vw - 16px)); max-height: calc(100vh - var(--notif-top, 60px) - 12px);
    box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden;
    background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 18px 50px rgba(0,0,0,.5); font-family: var(--mono); color: var(--txt); }
  .notifhead { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px;
    border-bottom: 1px solid var(--line); }
  .notifhead h2 { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 7px; margin: 0;
    font-size: 13px; font-weight: 600; outline: none; }
  .notifhead h2 svg { color: var(--accent2); flex: 0 0 auto; }
  .notifcount { color: var(--accent2); font-size: 10px; font-weight: 400; white-space: nowrap; }
  .notifclose { width: 26px; height: 26px; }
  .notifstatus { flex: 0 0 auto; padding: 7px 14px; color: var(--accent2); font-size: 11px;
    border-bottom: 1px solid var(--line); }
  .notifcompose { flex: 0 0 auto; border-bottom: 1px solid var(--line); }
  .notifcompose summary { cursor: pointer; padding: 9px 14px; color: var(--accent2); font-size: 11px; font-weight: 600; }
  .notifcompose summary:hover { color: var(--txt); }
  .notifcompose form { display: grid; gap: 9px; padding: 0 14px 12px; }
  .notifauds { margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
  .notifauds legend { padding: 0; margin-bottom: 5px; color: var(--dim); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
  .notifaud { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 9px; box-sizing: border-box;
    border: 1px solid var(--line); border-radius: 7px; font-size: 11px; color: var(--txt); cursor: pointer; min-width: 0; }
  .notifaud span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .notifaud small { color: var(--dim); font-size: 9px; white-space: nowrap; }
  .notifaud input { margin: 0; accent-color: var(--accent); }
  .notifaud:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
  .notifaud:has(input:disabled) { opacity: .5; cursor: default; }
  .notiffield { display: grid; gap: 4px; }
  .notiffield > span { display: flex; justify-content: space-between; color: var(--dim); font-size: 9px;
    text-transform: uppercase; letter-spacing: .08em; }
  .notiffield small { text-transform: none; letter-spacing: 0; }
  .notiffield input, .notiffield textarea { box-sizing: border-box; width: 100%; background: var(--panel2);
    border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; color: var(--txt); font: 12px var(--mono); }
  .notiffield textarea { resize: vertical; min-height: 64px; max-height: 40vh; }
  .notiffield input:focus, .notiffield textarea:focus { outline: none; border-color: var(--accent); }
  .notiferr { color: var(--bad); font-size: 11px; overflow-wrap: anywhere; }
  .notiferr:empty { display: none; }
  .notifformacts { display: flex; justify-content: flex-end; }
  .notiftabs { flex: 0 0 auto; display: flex; gap: 6px; padding: 9px 14px 0; }
  .notifscroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 6px 0 10px; }
  .notiflist { list-style: none; margin: 0; padding: 0; }
  .notifitem { position: relative; padding: 10px 14px 10px 17px; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); min-width: 0; }
  .notifitem.unread::before { content: ""; position: absolute; left: 7px; top: 15px; width: 5px; height: 5px;
    border-radius: 50%; background: var(--accent); }
  .notifitemhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-width: 0; }
  .notiftitle { font-size: 12px; font-weight: 600; color: var(--txt); overflow-wrap: anywhere; min-width: 0; }
  .notifitem:not(.unread) .notiftitle { font-weight: 400; color: var(--muted); }
  .notifmark { flex: 0 0 auto; height: 22px; padding: 0 7px; font-size: 10px; }
  .notifmeta { display: flex; flex-wrap: wrap; gap: 0 5px; margin-top: 3px; color: var(--dim); font-size: 10px; min-width: 0; }
  .notifmeta span { overflow-wrap: anywhere; }
  .notifbody { margin: 6px 0 0; color: var(--txt); font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
  .notifitem:not(.unread) .notifbody { color: var(--muted); }
  .notifcounts { margin-top: 5px; color: var(--accent2); font-size: 10px; }
  .notifempty { padding: 22px 14px; color: var(--muted); font-size: 12px; text-align: center; }
  .notifolder { margin: 10px 14px 0; }
  .notiftoast { position: fixed; z-index: 95; right: 16px; bottom: 16px; width: min(340px, calc(100vw - 32px));
    box-sizing: border-box; display: flex; align-items: flex-start; gap: 4px; padding: 6px 6px 6px 4px;
    background: var(--panel2); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 10px;
    box-shadow: 0 14px 40px rgba(0,0,0,.45); font-family: var(--mono); animation: tipin .16s ease-out; }
  .notiftoastopen { flex: 1 1 auto; min-width: 0; display: flex; align-items: flex-start; gap: 9px; padding: 6px 8px;
    background: none; border: 0; border-radius: 7px; color: var(--txt); text-align: left; cursor: pointer; font: inherit; }
  .notiftoastopen:hover { background: var(--panel); }
  .notiftoastopen svg { flex: 0 0 auto; margin-top: 2px; color: var(--accent2); }
  .notiftoastopen > span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .notiftoastopen b { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .notiftoastopen small { color: var(--muted); font-size: 10px; }
  .notiftoast .iconbtn { width: 26px; height: 26px; flex: 0 0 auto; }
  @media (max-width: 760px) {
    .notifpanel { left: 8px; right: 8px; top: 8px; width: auto; max-height: calc(100dvh - 16px); }
    .notiftoast { left: 8px; right: 8px; bottom: 8px; width: auto; }
    body.notif-unread:not(.sidebar-open) .mobiletoggle { position: relative; }
    body.notif-unread:not(.sidebar-open) .mobiletoggle::after { content: ""; position: absolute; top: 4px; right: 4px;
      width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--panel2); }
  }
  @media (prefers-reduced-motion: reduce) { .notiftoast { animation: none; } }
  .notifitem.sent .notiftitle { font-weight: 600; color: var(--txt); }
  .notifitem.sent .notifbody { color: var(--txt); }

  /* A loca's identity (identity.js): its mark (icon in its colour) beside
     its name, its description, its labels, and the identity fields of the
     create / Loca identity panel. The palette is Okabe–Ito: a bright shade
     for the dark theme and a deep one for the light theme, each at least
     3:1 against the panels; the icon carries the meaning too. */
  [data-loca-color="orange"] { --loca-c: #e69f00; }
  [data-loca-color="sky"] { --loca-c: #56b4e9; }
  [data-loca-color="green"] { --loca-c: #2bb38a; }
  [data-loca-color="yellow"] { --loca-c: #f0e442; }
  [data-loca-color="blue"] { --loca-c: #4d8fd1; }
  [data-loca-color="vermillion"] { --loca-c: #e0712a; }
  [data-loca-color="purple"] { --loca-c: #cc79a7; }
  :root[data-theme="light"] [data-loca-color="orange"] { --loca-c: #8f5500; }
  :root[data-theme="light"] [data-loca-color="sky"] { --loca-c: #1b6fa8; }
  :root[data-theme="light"] [data-loca-color="green"] { --loca-c: #00704f; }
  :root[data-theme="light"] [data-loca-color="yellow"] { --loca-c: #6b6200; }
  :root[data-theme="light"] [data-loca-color="blue"] { --loca-c: #0b3d8c; }
  :root[data-theme="light"] [data-loca-color="vermillion"] { --loca-c: #a84300; }
  :root[data-theme="light"] [data-loca-color="purple"] { --loca-c: #8e4577; }
  .locamark { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; align-self: center;
    width: 18px; height: 18px; border-radius: 5px; color: var(--loca-c, var(--muted));
    background: color-mix(in srgb, var(--loca-c, var(--muted)) 16%, transparent);
    font: 700 11px/1 var(--mono); }
  .top .locamark { width: 24px; height: 24px; border-radius: 7px; font-size: 13px; }
  .room .rrow > .locamark + .rname::before, .top .rname.marked::before { content: ""; }
  .main.global .top .locamark { display: none !important; }
  .main.global .top .rname.marked::before { content: ""; }
  /* Shown only where there is room: it gives way before the mode detail. */
  .roomdesc { flex: 0 1000 auto; min-width: 0; max-width: 360px; color: var(--muted); font-size: 10px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; }
  @media (max-width: 1360px) { .roomdesc { display: none; } }
  .locaident { margin-top: 12px; padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
  .locadesc { margin: 7px 0 0; color: var(--txt); font-size: 12.5px; line-height: 1.5; overflow-wrap: anywhere; }
  .locadesc.empty { color: var(--dim); font-size: 11.5px; }
  .locaseats { display: block; margin-top: 7px; color: var(--dim); font-size: 11px; }
  /* A label is not a badge: square corners, a dashed outline, plain case,
     regular weight, no fill. Rank and role badges are rounded, filled or
     solid, bold and upper-case. */
  .localabels { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
  .localabel { display: inline-block; max-width: 100%; padding: 0 5px; border: 1px dashed var(--line); border-radius: 2px;
    color: var(--muted); background: transparent; font: 400 11px/1.6 var(--mono); text-transform: none; letter-spacing: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .identfields { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
  .extfield textarea { box-sizing: border-box; width: 100%; resize: vertical; min-height: 44px; background: var(--panel);
    border: 1px solid var(--line); color: var(--txt); border-radius: 7px; padding: 8px 10px; font: 12px/1.45 var(--mono); }
  .extfield textarea:focus { outline: none; border-color: var(--accent); }
  .extfield input:disabled, .extfield textarea:disabled { opacity: .7; }
  .identcount { align-self: flex-end; color: var(--dim); font-size: 9px; }
  .identrow { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; }
  .identnote { color: var(--dim); font-size: 10px; line-height: 1.4; margin-top: -4px; }
  .identpick { margin: 0; padding: 0; border: 0; min-width: 0; }
  .identpick legend { padding: 0; margin-bottom: 5px; color: var(--dim); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
  .identopts { display: flex; flex-wrap: wrap; gap: 4px; }
  .identopt { position: relative; display: inline-flex; cursor: pointer; }
  .identopt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
  .identopt .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .identswatch { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; box-sizing: border-box;
    border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--loca-c, var(--txt));
    font: 600 12px var(--mono); }
  .identswatch.none { color: var(--dim); }
  .identdot { width: 14px; height: 14px; border-radius: 50%; background: var(--loca-c); }
  .identopt input:checked + .identswatch { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
  .identopt input:focus-visible + .identswatch { outline: 2px solid var(--accent); outline-offset: 2px; }
  .identopt input:disabled + .identswatch { opacity: .55; cursor: default; }
  .identopt input:disabled:checked + .identswatch { opacity: 1; }
  @media (max-width: 520px) { .identswatch { width: 34px; height: 34px; } }
  /* The create panel's preset (Loca or Lounge): two rows like the extension
     rows, the chosen one outlined. */
  .createpreset { margin-bottom: 12px; }
  .presetopts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .presetopt { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border: 1px solid var(--line);
    border-radius: 8px; background: var(--panel); cursor: pointer; min-width: 0; }
  .presetopt input { flex: 0 0 auto; margin: 2px 0 0; width: 14px; height: 14px; accent-color: var(--accent); }
  .presetopt:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
  .presetopt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* ── full name and profile icon (people.js personLabelHtml) ─────────────
   The full name leads; the @name stays beside it, quieter but always there.
   Icons are line glyphs in the text colour, sized to the text. */
.picon { width: 1em; height: 1em; flex: 0 0 auto; vertical-align: -0.15em; margin-right: 4px;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
bdi.fullname { unicode-bidi: isolate; font-weight: inherit; }
.atname { color: var(--dim); font-weight: 400; font-size: .9em; }
.line .sendercard { display: inline-flex; align-items: baseline; gap: 0; color: inherit; font-weight: 700; }
.line .sendercard:empty { display: none; }
.line .sendercard bdi.fullname { color: var(--txt); white-space: nowrap; }
/* With a full name the @name reads as the address it is. */
.line .sendercard:has(bdi.fullname) + .sender { font-weight: 400; color: var(--dim); }
.line .sendercard:has(bdi.fullname) + .sender::before { content: "@"; }
.mentionpop bdi.fullname { color: inherit; opacity: .8; font-weight: 400; margin-left: 4px; }
.profileicons { margin-top: 6px; }
.iconopt > span { min-width: 26px; justify-content: center; }
.iconopt .picon { margin-right: 0; }
.profilecardhint { font-size: 9px; color: var(--dim); margin-top: 4px; }
/* In a narrow row the full name gives way first: the @name is never cut. */
.omem .oname:has(bdi.fullname), .pnamebtn:has(bdi.fullname) { display: inline-flex; align-items: baseline; gap: 4px; min-width: 0; }
.oname bdi.fullname, .pnamebtn bdi.fullname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oname .atname, .pnamebtn .atname, .oname .picon, .pnamebtn .picon { flex: 0 0 auto; }
.profilecard label.iconopt { text-transform: none; letter-spacing: 0; color: inherit; font-size: inherit; }
