:root {
      --bg: #0F1418;
      --on-bg: #E1E6E4;
      --surface: #0F1418;
      --s-low: #12181C;
      --s: #161D21;
      --s-high: #1C2428;
      --s-highest: #273236;
      --s-bright: #1F282C;
      --on-var: #B4C0BC;
      --outline: #7D8A86;
      --outline-v: #2E393D;
      --primary: #1FB89A;
      --on-primary: #00201A;
      --primary-c: #0B3D35;
      --on-primary-c: #B8F5E6;
      --bubble-out: #0B3D35;
      --on-out: #E1F5EF;
      --bubble-in: #1C2428;
      --on-in: #E1E6E4;
      --warn: #E5A23A;
      --warn-c: #3A2A10;
      --on-warn: #FFDDB0;
      --error: #FF8A80;
      --on-error: #3B0906;
      --error-c: #4A1F1C;
      --admin: #C9B4E8;
      --scrim: rgba(0,0,0,.62);
      --win-border: #2E393D;
      --caption-h: 32px;
      --rail: 72px;
      --list: 300px;
      --radius: 12px;
      --bubble-r: 18px;
    }
    html.light {
      --bg: #F6FAF8;
      --on-bg: #171D1B;
      --surface: #F6FAF8;
      --s-low: #F0F5F3;
      --s: #EAF1EE;
      --s-high: #DCE5E1;
      --s-highest: #CED9D4;
      --s-bright: #FFFFFF;
      --on-var: #3F4945;
      --outline: #6F7975;
      --outline-v: #BFC9C4;
      --primary: #00806A;
      --on-primary: #FFFFFF;
      --primary-c: #B8F5E6;
      --on-primary-c: #00201A;
      --bubble-out: #CFEFE6;
      --on-out: #0D2621;
      --bubble-in: #FFFFFF;
      --on-in: #171D1B;
      --warn: #8A5A00;
      --warn-c: #FFE6C2;
      --on-warn: #2E1A00;
      --error: #BA1A1A;
      --on-error: #FFFFFF;
      --error-c: #FFDAD6;
      --admin: #6A4C93;
      --scrim: rgba(0,0,0,.32);
      --win-border: #BFC9C4;
    }
    * { box-sizing: border-box; }
    html, body { height: 100%; margin: 0; }
    body {
      font: 14px/20px "Segoe UI", system-ui, sans-serif;
      background: #1a1f24;
      color: var(--on-bg);
      overflow: hidden;
    }
    html.light body { background: #d8e0dc; }
    button, input, textarea { font: inherit; color: inherit; }
    button { cursor: pointer; border: 0; background: none; }
    .page {
      display: grid;
      grid-template-columns: 220px 1fr;
      height: 100%;
    }
    .review {
      background: #11161a;
      border-right: 1px solid #2a3338;
      padding: 12px 10px;
      overflow: auto;
      color: #d5ddd9;
    }
    html.light .review { background: #eef3f1; color: #171D1B; border-right-color: #BFC9C4; }
    .review h1 { font-size: 13px; font-weight: 600; margin: 0 0 4px; letter-spacing: .02em; }
    .review p { margin: 0 0 12px; font-size: 12px; line-height: 16px; color: #9aa8a3; }
    html.light .review p { color: #3F4945; }
    .review .note {
      font-size: 11px; line-height: 15px; color: #c9a06a; margin-bottom: 12px;
      padding: 8px; background: #3A2A10; border-radius: 8px;
    }
    html.light .review .note { background: #FFE6C2; color: #2E1A00; }
    .review h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #7D8A86; margin: 14px 0 6px; }
    .chip {
      display: block; width: 100%; text-align: left;
      padding: 7px 10px; margin: 0 0 4px; border-radius: 8px;
      background: transparent; color: inherit;
    }
    .chip:hover { background: #1C2428; }
    html.light .chip:hover { background: #DCE5E1; }
    .chip.on { background: #0B3D35; color: #B8F5E6; }
    html.light .chip.on { background: #B8F5E6; color: #00201A; }
    .desk {
      display: flex; align-items: center; justify-content: center;
      padding: 18px; min-width: 0;
    }
    .window {
      width: min(1280px, 100%);
      height: min(820px, 100%);
      background: var(--bg);
      border: 1px solid var(--win-border);
      border-radius: 8px;
      display: flex; flex-direction: column;
      overflow: hidden;
      position: relative;
    }
    .window.max { width: 100%; height: 100%; border-radius: 0; }
    .caption {
      height: var(--caption-h);
      background: var(--s);
      display: flex; align-items: center;
      flex: 0 0 var(--caption-h);
      user-select: none;
    }
    .caption .brand {
      display: flex; align-items: center; gap: 8px;
      padding: 0 10px; font-size: 12px; color: var(--on-bg);
    }
    .logo {
      width: 16px; height: 16px; border-radius: 4px;
      background: var(--primary); color: var(--on-primary);
      display: grid; place-items: center; font-size: 10px; font-weight: 700;
    }
    .caption .spacer { flex: 1; }
    .cap-btn {
      width: 46px; height: var(--caption-h); color: var(--on-bg);
      display: grid; place-items: center;
    }
    .cap-btn:hover { background: var(--s-high); }
    .cap-btn.close:hover { background: #c42b1c; color: #fff; }
    .client { flex: 1; display: flex; min-height: 0; position: relative; }
    .rail {
      width: var(--rail); background: var(--s-low);
      border-right: 1px solid var(--outline-v);
      display: flex; flex-direction: column; align-items: center;
      padding: 10px 0;
    }
    .rail-btn {
      width: 56px; padding: 8px 0 6px; border-radius: 12px;
      display: flex; flex-direction: column; align-items: center; gap: 2px;
      color: var(--on-var); position: relative;
    }
    .rail-btn:hover { background: var(--s-high); }
    .rail-btn.on { color: var(--primary); background: var(--primary-c); }
    .rail-btn span { font-size: 10px; line-height: 12px; }
    .badge {
      position: absolute; top: 4px; right: 8px;
      min-width: 16px; height: 16px; padding: 0 4px;
      background: var(--primary); color: var(--on-primary);
      border-radius: 8px; font-size: 10px; font-weight: 600;
      display: grid; place-items: center;
    }
    .list {
      width: var(--list); background: var(--surface);
      border-right: 1px solid var(--outline-v);
      display: flex; flex-direction: column; min-width: 0;
    }
    .list-head {
      padding: 14px 16px 8px;
      display: flex; align-items: center; justify-content: space-between;
    }
    .list-head h3 { margin: 0; font-size: 22px; font-weight: 500; line-height: 28px; }
    .search {
      margin: 0 16px 10px; padding: 8px 12px; border-radius: 999px;
      background: var(--s-high); color: var(--on-var); border: 0; width: calc(100% - 32px);
    }
    .rows { flex: 1; overflow: auto; }
    .row {
      display: flex; gap: 12px; align-items: center;
      padding: 10px 16px; width: 100%; text-align: left; color: var(--on-bg);
    }
    .row:hover { background: var(--s-low); }
    .row.on { background: var(--s-high); }
    .row .meta { flex: 1; min-width: 0; }
    .row .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
    .name { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; min-width: 0; }
    .name .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .time { font-size: 12px; color: var(--on-var); flex: 0 0 auto; }
    .preview { font-size: 13px; color: var(--on-var); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .preview.warn { color: var(--warn); }
    .preview.miss { color: var(--error); }
    .av {
      width: 44px; height: 44px; border-radius: 50%; flex: 0 0 44px;
      display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 16px;
    }
    .main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
    .chat-bar {
      height: 56px; padding: 0 12px; display: flex; align-items: center; gap: 10px;
      border-bottom: 1px solid var(--outline-v); background: var(--s-low);
    }
    .chat-bar .who { flex: 1; min-width: 0; }
    .chat-bar .who .sub { font-size: 12px; color: var(--on-var); }
    .icon-btn {
      width: 40px; height: 40px; border-radius: 20px; color: var(--on-var);
      display: grid; place-items: center;
    }
    .icon-btn:hover { background: var(--s-high); }
    .messages {
      flex: 1; overflow: auto; padding: 16px 20px;
      display: flex; flex-direction: column; gap: 6px;
    }
    .day {
      align-self: center; font-size: 12px; color: var(--on-var);
      background: var(--s); padding: 4px 10px; border-radius: 999px; margin: 8px 0;
    }
    .e2ee {
      align-self: center; max-width: 420px; text-align: center;
      font-size: 13px; color: var(--on-var); padding: 8px 16px; margin-bottom: 8px;
    }
    .bubble {
      max-width: 68%; padding: 8px 12px 6px; border-radius: var(--bubble-r);
      font-size: 15px; line-height: 21px;
    }
    .bubble.in { align-self: flex-start; background: var(--bubble-in); color: var(--on-in); border-bottom-left-radius: 6px; }
    .bubble.out { align-self: flex-end; background: var(--bubble-out); color: var(--on-out); border-bottom-right-radius: 6px; }
    html.light .bubble.in { border: 1px solid #DCE5E1; }
    .b-meta { display: flex; justify-content: flex-end; gap: 6px; font-size: 11px; opacity: .75; margin-top: 2px; }
    .author { font-size: 12px; font-weight: 600; color: var(--primary); margin-bottom: 2px; }
    .composer {
      display: flex; align-items: center; gap: 8px;
      padding: 10px 12px; border-top: 1px solid var(--outline-v); background: var(--s-low);
    }
    .composer input {
      flex: 1; background: var(--s-high); border: 0; border-radius: 20px;
      padding: 10px 14px; outline: none;
    }
    .send {
      width: 40px; height: 40px; border-radius: 20px;
      background: var(--primary); color: var(--on-primary); display: grid; place-items: center;
    }
    .banner {
      margin: 12px 16px 0; padding: 12px 14px; border-radius: 16px;
      background: var(--warn-c); color: var(--on-warn);
    }
    .banner strong { display: block; margin-bottom: 4px; }
    .banner .acts { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
    .tbtn { color: var(--primary); padding: 4px 8px; font-weight: 600; }
    .warn-t { color: var(--warn); }
    .empty {
      flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
      text-align: center; padding: 32px; color: var(--on-var); gap: 8px;
    }
    .empty h4 { margin: 0; color: var(--on-bg); font-size: 18px; font-weight: 500; }
    .empty p { margin: 0; max-width: 320px; }
    .prim, .ghost, .danger {
      padding: 10px 16px; border-radius: 12px; font-weight: 600;
    }
    .prim { background: var(--primary); color: var(--on-primary); }
    .ghost { background: var(--s-high); color: var(--on-bg); }
    .danger { background: var(--error); color: var(--on-error); }
    .auth {
      flex: 1; display: flex; align-items: center; justify-content: center;
      overflow: auto; padding: 32px;
    }
    .card { width: min(440px, 100%); }
    .card h2 { font-size: 24px; font-weight: 500; margin: 0 0 8px; }
    .muted { color: var(--on-var); font-size: 14px; line-height: 20px; }
    .field { width: 100%; margin: 10px 0; padding: 12px 14px; border-radius: 12px;
      background: var(--s-high); border: 1px solid var(--outline-v); outline: none; }
    .stack { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
    .words {
      display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 16px 0;
    }
    .word {
      background: var(--s-high); border-radius: 8px; padding: 8px;
      font-family: ui-monospace, Consolas, monospace; font-size: 13px;
    }
    .word b { color: var(--on-var); font-weight: 500; margin-right: 6px; }
    .warn-box { background: var(--warn-c); color: var(--on-warn); padding: 12px; border-radius: 12px; font-size: 13px; }
    .check { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0; font-size: 13px; }
    .voice {
      display: flex; align-items: center; gap: 8px; min-width: 228px; max-width: 280px;
    }
    .play {
      width: 42px; height: 42px; border-radius: 21px; flex: 0 0 42px;
      display: grid; place-items: center;
    }
    .bubble.in .play { background: var(--on-in); color: var(--bubble-in); }
    .bubble.out .play { background: var(--on-out); color: var(--bubble-out); }
    .wave { flex: 1; height: 28px; display: flex; align-items: center; gap: 2px; }
    .wave i { display: block; width: 3px; border-radius: 2px; opacity: .32; }
    .wave i.on { opacity: 1; }
    .bubble.in .wave i { background: var(--on-in); }
    .bubble.out .wave i { background: var(--on-out); }
    .file {
      display: flex; align-items: center; gap: 10px; min-width: 200px;
    }
    .file-ico {
      width: 40px; height: 40px; border-radius: 8px; background: var(--primary-c);
      color: var(--primary); display: grid; place-items: center; font-size: 11px; font-weight: 700;
    }
    .members {
      width: 240px; border-left: 1px solid var(--outline-v); background: var(--s-low);
      overflow: auto; padding: 12px 0;
    }
    .members h4 { margin: 0 16px 8px; font-size: 12px; color: var(--on-var); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
    .set { flex: 1; overflow: auto; padding: 8px 0 32px; }
    .set-search { margin: 8px 20px; }
    .sec { padding: 16px 24px 4px; font-size: 12px; color: var(--on-var); font-weight: 600; }
    .navrow {
      width: 100%; display: flex; align-items: center; gap: 14px;
      padding: 12px 24px; text-align: left; color: var(--on-bg);
    }
    .navrow:hover { background: var(--s-low); }
    .navrow .sub { font-size: 13px; color: var(--on-var); }
    .locked { opacity: .85; }
    .locked .always { font-size: 11px; color: var(--primary); }
    .wallet { padding: 20px 28px; overflow: auto; flex: 1; }
    .wallet h2 { margin: 0 0 8px; font-size: 22px; font-weight: 500; }
    .bal { font-size: 28px; line-height: 36px; margin: 12px 0; }
    .mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; letter-spacing: .4px; word-break: break-all; }
    .overlay {
      position: absolute; inset: 0; background: var(--scrim);
      display: flex; align-items: center; justify-content: center; z-index: 5;
    }
    .call {
      width: min(420px, 92%); text-align: center; color: var(--on-bg);
      background: var(--s); border-radius: 16px; padding: 28px 24px 24px;
    }
    .call.full {
      width: 100%; height: 100%; border-radius: 0; background: var(--surface);
      display: flex; flex-direction: column; align-items: center; justify-content: space-between;
      padding: 28px 24px 36px;
    }
    .chip-relay {
      display: inline-flex; align-items: center; gap: 6px;
      background: var(--s-high); border-radius: 999px; padding: 6px 12px;
      font-size: 12px; color: var(--on-var);
    }
    .av-lg { width: 96px; height: 96px; border-radius: 48px; font-size: 32px; margin: 20px auto 12px; }
    .round {
      width: 72px; height: 72px; border-radius: 36px; color: #fff;
      display: grid; place-items: center;
    }
    .round.ok { background: #2E7D32; }
    .round.no { background: var(--error); color: var(--on-error); }
    .round.tog { background: var(--s-highest); color: var(--on-bg); width: 56px; height: 56px; border-radius: 28px; }
    .round.tog.on { background: var(--primary); color: var(--on-primary); }
    .call-acts { display: flex; justify-content: space-evenly; width: 100%; margin-top: 28px; }
    .pin-wrap { text-align: center; }
    .dots { display: flex; justify-content: center; gap: 10px; margin: 20px 0; }
    .dot { width: 12px; height: 12px; border-radius: 6px; border: 2px solid var(--outline); }
    .dot.fill { background: var(--primary); border-color: var(--primary); }
    .pad { display: grid; grid-template-columns: repeat(3, 64px); gap: 10px; justify-content: center; }
    .pad button {
      width: 64px; height: 64px; border-radius: 32px; background: var(--s-high); font-size: 22px;
    }
    .pad button:hover { background: var(--s-highest); }
    .mark {
      display: inline-flex; align-items: center; gap: 4px;
      font-size: 11px; font-weight: 600; line-height: 14px;
      padding: 1px 6px; border-radius: 6px; white-space: nowrap;
    }
    .mark.team { color: var(--primary); background: var(--primary-c); }
    .mark.admin { color: var(--admin); background: color-mix(in srgb, var(--admin) 18%, transparent); }
    .qr {
      width: 168px; height: 168px; margin: 12px auto;
      display: grid; grid-template-columns: repeat(21, 1fr); gap: 1px;
      background: #fff; padding: 8px; border-radius: 8px;
    }
    .qr b { background: #111; }
    .qr i { background: transparent; }
    .tabs { display: flex; gap: 6px; margin: 12px 0; }
    .tabs button { padding: 8px 12px; border-radius: 999px; background: var(--s-high); }
    .tabs button.on { background: var(--primary-c); color: var(--on-primary-c); }
    .toast {
      position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
      background: var(--s-highest); padding: 8px 14px; border-radius: 8px;
      font-size: 13px; z-index: 8; display: none;
    }
    .tray {
      position: absolute; right: 18px; bottom: 12px;
      background: var(--s); border: 1px solid var(--outline-v);
      border-radius: 8px; padding: 8px 12px; font-size: 12px;
      display: none; z-index: 9; max-width: 280px;
    }
    .hidden { display: none !important; }
    .status-conn { color: var(--warn); }
    svg { display: block; }
