  html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg-0); }
  #root { position: fixed; inset: 0; }
  * { -webkit-tap-highlight-color: transparent; }
  ::selection { background: var(--accent); color: var(--accent-ink); }

  /* ---- tooltips ---- */
  [data-tip] { position: relative; }
  [data-tip]::after {
    content: attr(data-tip); position: absolute; z-index: 60; pointer-events: none; white-space: nowrap;
    background: rgba(20,20,20,0.97); color: var(--fg-0); border: 1px solid var(--line-3);
    font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.02em; padding: 4px 8px;
    border-radius: 6px; box-shadow: var(--shadow-2);
    opacity: 0; transition: opacity 0.12s var(--ease-out), transform 0.12s var(--ease-out);
  }
  [data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; }
  .tip-up::after { bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(3px); }
  .tip-up:hover::after { transform: translateX(-50%); }
  .tip-down::after { top: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(-3px); }
  .tip-down:hover::after { transform: translateX(-50%); }
  .tip-right::after { left: calc(100% + 10px); top: 50%; transform: translateY(-50%) translateX(-3px); }
  .tip-right:hover::after { transform: translateY(-50%); }
  .tip-left::after { right: calc(100% + 10px); top: 50%; transform: translateY(-50%) translateX(3px); }
  .tip-left:hover::after { transform: translateY(-50%); }

  /* ---- icon button (shared) ---- */
  .atr-icon-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
    background: transparent; border: 1px solid transparent; border-radius: 50%;
    color: var(--fg-2); cursor: pointer; transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast);
  }
  .atr-icon-btn:hover { background: var(--bg-3); color: var(--fg-0); }
  .atr-icon-btn.sm { width: 28px; height: 28px; }

  /* ---- thin icon rail ---- */
  .atr-rail {
    position: absolute; top: 12px; left: 12px; bottom: 12px; width: 56px; z-index: 30;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 10px 0; background: rgba(23,23,23,0.92); backdrop-filter: blur(16px);
    border: 1px solid var(--line-3); border-radius: 28px; box-shadow: var(--shadow-2);
  }
  .atr-rail-logo { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
  .atr-rail-items { display: flex; flex-direction: column; gap: 6px; }
  .atr-rail-btn {
    position: relative; width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 0; border-radius: 50%; color: var(--fg-3); cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast);
  }
  .atr-rail-btn:hover { background: var(--bg-3); color: var(--fg-1); }
  .atr-rail-btn.on { background: var(--bg-3); color: var(--accent); box-shadow: inset 0 0 0 1px var(--line-2); }
  .atr-rail-you { position: relative; margin-top: 8px; width: 38px; height: 38px; display: inline-flex;
    align-items: center; justify-content: center; background: var(--bg-3); border: 1px solid var(--line-3);
    border-radius: 50%; color: var(--fg-0);
    font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.04em; cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out); }
  .atr-rail-you:hover { background: var(--bg-3); }
  .atr-rail-you-dot { position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%;
    background: #4FD18B; border: 2px solid var(--bg-1); }
  .atr-rail-dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%;
    background: var(--cobalt); border: 1.5px solid var(--bg-1); }

  /* ---- contextual panel ---- */
  .atr-panel {
    position: absolute; top: 12px; left: 80px; bottom: 12px; width: 270px; z-index: 24;
    background: rgba(23,23,23,0.92); backdrop-filter: blur(16px);
    border: 1px solid var(--line-3); border-radius: 20px; box-shadow: var(--shadow-2);
    display: flex; flex-direction: column; overflow: hidden;
    animation: atr-panel-in 0.2s var(--ease-out);
  }
  @keyframes atr-panel-in { from { transform: translateX(-10px); } }
  .atr-panel-head { display: flex; align-items: center; justify-content: space-between; height: 52px;
    padding: 0 10px 0 16px; border-bottom: 1px solid var(--line-1); flex: 0 0 auto; }
  .atr-panel-title { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--fg-1); letter-spacing: 0.14em; text-transform: uppercase; }
  .atr-panel-body { flex: 1; overflow-y: auto; padding: 12px 10px; }
  .atr-panel-body.nopad { padding: 0; }

  .atr-search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px;
    background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-pill); }
  .atr-search.panel { width: 100%; box-sizing: border-box; }
  .atr-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--fg-1);
    font-family: var(--font-sans); font-size: 13px; }
  .atr-search input::placeholder { color: var(--fg-3); }

  .atr-sec { font-family: var(--font-mono); font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--fg-3); padding: 8px 8px 6px; }
  .atr-nav {
    display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 11px;
    background: transparent; border: 0; border-radius: 11px; cursor: pointer;
    color: var(--fg-1); font-family: var(--font-sans); font-size: 13px; font-weight: 500;
    transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast);
  }
  .atr-nav .msi { color: var(--fg-3); }
  .atr-nav:hover { background: var(--bg-2); color: var(--fg-0); }
  .atr-nav:hover .msi { color: var(--fg-1); }
  .atr-nav.active { background: var(--bg-3); color: var(--fg-0); }
  .atr-nav.active .msi { color: var(--accent); }
  .atr-badge { font-family: var(--font-mono); font-size: 10px; background: var(--bg-4); color: var(--fg-1);
    border: 1px solid var(--line-2); border-radius: var(--radius-pill); padding: 1px 7px; }

  /* ---- spaces as Discord-style voice channels ---- */
  .atr-vc { margin-bottom: 2px; }
  .atr-vc-row { display: flex; align-items: center; gap: 9px; width: 100%; height: 36px; padding: 0 10px;
    background: transparent; border: 0; border-radius: 11px; cursor: pointer; text-align: left;
    color: var(--fg-1); font-family: var(--font-sans); font-size: 13px; font-weight: 500;
    transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast); }
  .atr-vc-row:hover { background: var(--bg-2); color: var(--fg-0); }
  .atr-vc-row.here { background: rgba(198,244,50,0.06); color: var(--fg-0); box-shadow: inset 2px 0 0 var(--accent); }
  .atr-vc-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .atr-vc-count { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); }
  .atr-vc-join { color: var(--fg-3); opacity: 0; transition: opacity var(--dur-fast) var(--ease-out); }
  .atr-vc-row:hover .atr-vc-join { opacity: 1; }
  .atr-vc-row.here .atr-vc-join { display: none; }
  .atr-vc-members { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 6px 18px; }
  .atr-vc-member { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; border-radius: 8px;
    font-size: 12.5px; color: var(--fg-2); }
  .atr-vc-member:hover { background: var(--bg-2); }
  .atr-vc-member span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .atr-people-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px;
    background: transparent; border: 0; border-radius: 11px; cursor: pointer; text-align: left;
    transition: background var(--dur-fast) var(--ease-out); }
  .atr-people-row:hover { background: var(--bg-2); }
  .atr-people-row.on { background: var(--bg-3); }

  .atr-act-row { display: flex; gap: 11px; padding: 9px 8px; border-bottom: 1px solid var(--line-1); }
  .atr-act-ic { flex: 0 0 30px; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
    background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 50%; }

  /* ---- floating status chip ---- */
  .atr-statuschip {
    position: absolute; top: 12px; right: 12px; z-index: 22;
    display: flex; align-items: center; gap: 9px; height: 36px; padding: 0 14px;
    background: rgba(17,17,17,0.82); backdrop-filter: blur(12px);
    border: 1px solid var(--line-2); border-radius: var(--radius-pill);
  }
  .atr-mono { font-family: var(--font-mono); font-size: 12px; color: var(--fg-2); }

  /* ---- bottom media island ---- */
  .atr-island {
    display: flex; align-items: center; gap: 6px; padding: 7px 8px;
    background: rgba(15,15,15,0.9); backdrop-filter: blur(14px);
    border: 1px solid var(--line-2); border-radius: var(--radius-pill); box-shadow: var(--shadow-2);
  }
  .atr-island-btn { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg-3); border: 1px solid transparent; border-radius: var(--radius-pill); color: var(--fg-1); cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast); }
  .atr-island-btn:hover { background: var(--bg-4); color: var(--fg-0); }
  .atr-island-btn.primary { background: var(--accent); color: var(--accent-ink); }
  .atr-island-btn.primary .msi { transition: transform 0.2s var(--ease-out); }
  .atr-island-btn.primary.open { background: #d4ff4a; }
  .atr-island-btn.primary.open .msi { transform: rotate(45deg); }
  .atr-island-btn.primary:hover { background: #d4ff4a; }
  .atr-island-btn.off { background: var(--danger-soft); color: var(--danger); }
  .atr-island-btn.active { color: var(--accent); }
  .atr-island-div { width: 1px; height: 26px; background: var(--line-2); margin: 0 3px; }
  .atr-island-av { padding: 0 2px; }
  .atr-island-huddle { display: flex; align-items: center; gap: 8px; padding: 0 4px 0 10px; }
  .atr-h-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
    border-radius: var(--radius-pill); border: 1px solid var(--line-2); background: var(--bg-3); color: var(--fg-1); cursor: pointer; }
  .atr-h-btn.leave { background: #FF5A5A; border-color: #FF5A5A; color: #fff; margin-left: 4px; }
  .atr-h-btn.leave:hover { background: #ff7070; }
  .atr-live { width: 9px; height: 9px; position: relative; }
  .atr-live span { position: absolute; inset: 0; background: #FF5A5A; border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(255,90,90,0.6); animation: atr-pulse 1.6s infinite; }
  @keyframes atr-pulse { 70% { box-shadow: 0 0 0 7px rgba(255,90,90,0); } 100% { box-shadow: 0 0 0 0 rgba(255,90,90,0); } }
  .atr-diamond.sm { width: 6px; height: 6px; flex: 0 0 6px; }

  /* ---- editor panel ---- */
  .atr-edit-modes { display: flex; gap: 6px; padding: 4px; background: var(--bg-2); border: 1px solid var(--line-2);
    border-radius: var(--radius-pill); margin-bottom: 12px; }
  .atr-edit-mode { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px;
    background: transparent; border: 0; border-radius: var(--radius-pill); color: var(--fg-2); cursor: pointer;
    font-family: var(--font-sans); font-size: 13px; font-weight: 500; transition: background var(--dur-fast), color var(--dur-fast); }
  .atr-edit-mode:hover { color: var(--fg-0); }
  .atr-edit-mode.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

  .atr-cat-chips { display: flex; gap: 6px; margin-bottom: 10px; }
  .atr-cat-chips.wrap { flex-wrap: wrap; }
  .atr-cat-chips.build { gap: 5px; }
  .atr-cat-chips.build .atr-cat-chip { flex: 1; width: auto; }
  .atr-cat-chip { flex: 1; width: 40px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; color: var(--fg-3); cursor: pointer;
    transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast); }
  .atr-cat-chip:hover { background: var(--bg-3); color: var(--fg-0); }
  .atr-cat-chip.on { background: var(--bg-3); border-color: var(--line-3); color: var(--accent); }
  .atr-tool-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px;
    background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-pill); color: var(--fg-1); cursor: pointer;
    font-family: var(--font-sans); font-size: 12.5px; font-weight: 500; transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast); }
  .atr-tool-chip:hover { background: var(--bg-3); color: var(--fg-0); }
  .atr-tool-chip.on { background: var(--bg-3); border-color: var(--line-3); color: var(--accent); }
  .atr-cat-title { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--fg-3); margin: 6px 2px 8px; }

  .atr-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .atr-thumb { display: flex; flex-direction: column; gap: 2px; padding: 6px 6px 8px; background: var(--bg-2);
    border: 1px solid var(--line-2); border-radius: 14px; cursor: pointer; transition: background var(--dur-fast), border-color var(--dur-fast); }
  .atr-thumb:hover { background: var(--bg-3); border-color: var(--line-3); }
  .atr-thumb.on { border-color: var(--accent); background: var(--bg-3); box-shadow: 0 0 0 1px var(--accent); }
  .atr-thumb-art { height: 60px; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 50% 60%, rgba(255,255,255,0.03), transparent 70%); border-radius: 10px; }
  .atr-thumb-name { font-size: 11.5px; color: var(--fg-1); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .atr-swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .atr-swatch { aspect-ratio: 1; padding: 0; background: transparent; border: 1px solid var(--line-2); border-radius: 10px;
    cursor: pointer; overflow: hidden; transition: border-color var(--dur-fast), transform var(--dur-fast); }
  .atr-swatch span { display: block; width: 100%; height: 100%; }
  .atr-swatch:hover { transform: translateY(-1px); border-color: var(--line-3); }
  .atr-swatch.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
  .atr-edit-hint { font-size: 12.5px; color: var(--fg-2); line-height: 1.5; padding: 8px 2px; }

  /* editor island additions */
  .atr-island-edit .atr-island-btn.sm { width: 36px; height: 36px; }
  .atr-island-btn.sm { width: 36px; height: 36px; }
  .atr-island-btn.danger:hover:not([disabled]) { background: var(--danger-soft); color: var(--danger); }
  .atr-island-btn[disabled] { opacity: 0.32; cursor: default; }
  .atr-island-btn[disabled]:hover { background: var(--bg-3); color: var(--fg-1); }

  /* ---- view-mode toggle ---- */
  .atr-viewtoggle { position: absolute; top: 12px; z-index: 23; transform: translateX(-50%);
    display: flex; gap: 4px; padding: 4px; background: rgba(17,17,17,0.82); backdrop-filter: blur(12px);
    border: 1px solid var(--line-2); border-radius: var(--radius-pill); }
  .atr-view-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 13px;
    background: transparent; border: 0; border-radius: var(--radius-pill); color: var(--fg-2); cursor: pointer;
    font-family: var(--font-sans); font-size: 12.5px; font-weight: 500; transition: background var(--dur-fast), color var(--dur-fast); }
  .atr-view-btn:hover { color: var(--fg-0); }
  .atr-view-btn.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

  /* ---- world chat ---- */
  .atr-worldchat { position: absolute; top: 12px; right: 12px; bottom: 12px; z-index: 35; width: 330px; max-width: calc(100vw - 90px);
    display: flex; flex-direction: column;
    background: rgba(23,23,23,0.92); backdrop-filter: blur(16px);
    border: 1px solid var(--line-3); border-radius: 20px; box-shadow: var(--shadow-2);
    animation: atr-slide 0.2s var(--ease-out); }
  @keyframes atr-slide-up { from { transform: translateY(10px); } }
  @keyframes atr-slide { from { transform: translateX(12px); } to { transform: none; } }
  .atr-wc-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px; border-bottom: 1px solid var(--line-1); }
  .atr-wc-srclead { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding-left: 4px; }
  .atr-wc-srctext { display: flex; flex-direction: column; min-width: 0; flex: 1; }
  .atr-wc-srctitle { font-size: 13.5px; font-weight: 600; color: var(--fg-0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .atr-wc-srcsub { font-size: 11px; color: var(--fg-2); font-family: var(--font-mono); display: flex; align-items: center; }
  .atr-wc-scope { position: relative; display: flex; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line-1); }
  .atr-wc-scopebtn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px;
    background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-pill); color: var(--fg-2); cursor: pointer;
    font-family: var(--font-sans); font-size: 12px; font-weight: 500; white-space: nowrap;
    transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast); }
  .atr-wc-scopebtn:hover:not([disabled]) { background: var(--bg-3); color: var(--fg-0); }
  .atr-wc-scopebtn.on { background: var(--bg-3); border-color: var(--line-3); color: var(--accent); }
  .atr-wc-scopebtn[disabled] { opacity: 0.4; cursor: default; }
  .atr-wc-scopebtn.more { overflow: hidden; }
  .atr-wc-scopebtn.more > span, .atr-wc-scopebtn.more { text-overflow: ellipsis; }
  .atr-chatmenu { position: absolute; top: 46px; left: 10px; right: 10px; z-index: 5; max-height: 360px; overflow-y: auto;
    background: rgba(28,28,28,0.98); backdrop-filter: blur(16px); border: 1px solid var(--line-3); border-radius: 14px;
    box-shadow: var(--shadow-2); padding: 6px; animation: atr-slide-up 0.14s var(--ease-out); }
  .atr-chatmenu-sec { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--fg-3); padding: 8px 8px 4px; }
  .atr-chatmenu-row { display: flex; align-items: center; justify-content: flex-start; gap: 9px; width: 100%; height: 38px; padding: 0 9px;
    background: transparent; border: 0; border-radius: 9px; cursor: pointer; text-align: left;
    color: var(--fg-1); font-family: var(--font-sans); font-size: 13px; font-weight: 500;
    transition: background var(--dur-fast) var(--ease-out); }
  .atr-chatmenu-row > span:not(.atr-unread):not(.atr-diamond):not(.msi):not(.atr-cm-lead) { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .atr-cm-lead { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
  .atr-cm-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .atr-chatmenu-row .msi { color: var(--fg-3); }
  .atr-chatmenu-row:hover { background: var(--bg-2); color: var(--fg-0); }
  .atr-chatmenu-row.on { background: var(--bg-3); color: var(--fg-0); }
  .atr-chatmenu-row.on .msi { color: var(--accent); }
  .atr-wc-circ { width: 32px; height: 32px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 1px solid transparent; border-radius: 50%; color: var(--fg-2); cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast); }
  .atr-wc-circ:hover { background: var(--bg-3); color: var(--fg-0); }
  .atr-wc-live { width: 8px; height: 8px; position: relative; }
  .atr-wc-live span { position: absolute; inset: 0; background: var(--accent); border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(198,244,50,0.5); animation: atr-pulse-lime 1.8s infinite; }
  @keyframes atr-pulse-lime { 70% { box-shadow: 0 0 0 6px rgba(198,244,50,0); } 100% { box-shadow: 0 0 0 0 rgba(198,244,50,0); } }
  .atr-wc-list { flex: 1; overflow-y: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 9px; min-height: 80px; }
  .atr-wc-msg { display: flex; gap: 8px; align-items: flex-start; }
  .atr-wc-msg.mine { justify-content: flex-end; }
  .atr-wc-bubble { font-size: 13px; line-height: 1.4; color: var(--fg-1); background: var(--bg-3);
    border: 1px solid var(--line-2); border-radius: 14px; padding: 7px 12px; max-width: 230px; word-break: break-word; }
  .atr-wc-bubble.mine { color: var(--accent-ink); background: var(--accent); border-color: var(--accent);
    border-radius: 14px; font-weight: 500; }
  .atr-wc-input { display: flex; align-items: center; gap: 8px; padding: 11px; border-top: 1px solid var(--line-1); }
  .atr-wc-input input { flex: 1; height: 40px; background: var(--bg-2); border: 1px solid var(--line-2);
    border-radius: var(--radius-pill); padding: 0 16px; color: var(--fg-0); font-family: var(--font-sans); font-size: 13px; outline: none; }
  .atr-wc-input input:focus { border-color: var(--line-3); }
  .atr-wc-send { flex: 0 0 40px; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 50%; cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out); }
  .atr-wc-send:hover { background: #d4ff4a; }
  .atr-wc-pill { position: absolute; top: 12px; right: 12px; z-index: 36; display: inline-flex; align-items: center; gap: 8px;
    height: 40px; padding: 0 16px; background: rgba(23,23,23,0.92); backdrop-filter: blur(16px);
    border: 1px solid var(--line-3); border-radius: var(--radius-pill); cursor: pointer;
    color: var(--fg-1); font-family: var(--font-sans); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-2); }
  .atr-wc-pill:hover { background: var(--bg-3); color: var(--fg-0); }
  .atr-wc-count { font-family: var(--font-mono); font-size: 11px; color: var(--accent); background: var(--accent-soft);
    border-radius: var(--radius-pill); padding: 1px 7px; }

  /* ---- video call dock ---- */
  .atr-videodock { position: absolute; top: 12px; z-index: 23; transform: translateX(-50%);
    display: flex; flex-direction: column; gap: 8px; padding: 10px;
    background: rgba(23,23,23,0.92); backdrop-filter: blur(16px);
    border: 1px solid var(--line-3); border-radius: 18px; box-shadow: var(--shadow-2);
    max-width: calc(100vw - 730px); animation: atr-slide-up 0.2s var(--ease-out); }
  .atr-videodock-head { display: flex; align-items: center; gap: 8px; padding: 0 4px;
    font-family: var(--font-mono); font-size: 11px; color: var(--fg-2); text-transform: uppercase; letter-spacing: 0.08em; }
  .atr-vd-count { color: var(--fg-3); }
  .atr-vtiles { display: flex; gap: 8px; align-items: stretch; overflow-x: auto; padding-bottom: 2px; }
  .atr-vtile { position: relative; width: 150px; height: 100px; border-radius: 12px; overflow: hidden;
    border: 1px solid var(--line-2); background: #0c0d0f; flex: 0 0 auto; }
  .atr-vtile.speaking { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 16px rgba(198,244,50,0.22); }
  .atr-vtile-video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
  .atr-vtile-feed { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(120% 90% at 50% 28%, color-mix(in srgb, var(--c) 52%, #14171c), #0b0d10); overflow: hidden; }
  .atr-vtile-feed::after { content: ''; position: absolute; top: -30%; left: -60%; width: 55%; height: 160%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent); transform: skewX(-18deg);
    animation: atr-vsheen 5s linear infinite; }
  @keyframes atr-vsheen { from { left: -60%; } to { left: 170%; } }
  .atr-vtile-av { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: #0a0a0a; font-family: var(--font-mono); font-weight: 600; font-size: 16px;
    border: 2px solid rgba(0,0,0,0.4); box-shadow: 0 4px 14px rgba(0,0,0,0.45); }
  /* a coworker's real camera (moved in by VideoTile) fills the feed + hides the avatar */
  .atr-vtile-feed video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: #0b0d10; }
  .atr-vtile-feed:has(video) .atr-vtile-av { display: none; }
  .atr-vtile-eq { position: absolute; top: 8px; right: 8px; display: flex; align-items: flex-end; gap: 2px; height: 12px; }
  .atr-vtile-eq i { width: 3px; background: var(--accent); border-radius: 1px; animation: atr-eq 0.9s ease-in-out infinite; }
  .atr-vtile-eq i:nth-child(1) { height: 6px; animation-delay: 0s; }
  .atr-vtile-eq i:nth-child(2) { height: 12px; animation-delay: 0.15s; }
  .atr-vtile-eq i:nth-child(3) { height: 8px; animation-delay: 0.3s; }
  @keyframes atr-eq { 0%, 100% { transform: scaleY(0.4); } 50% { transform: scaleY(1); } }
  .atr-vtile-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 5px;
    padding: 6px 8px; background: linear-gradient(transparent, rgba(0,0,0,0.74)); }
  .atr-vtile-name { font-size: 11.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; flex: 1; }
  .atr-vtile-mic { display: inline-flex; color: #FF7A7A; flex: 0 0 auto; }
  .atr-vtile-react { position: absolute; left: 50%; bottom: 34%; transform: translateX(-50%); font-size: 30px; line-height: 1;
    pointer-events: none; filter: drop-shadow(0 3px 5px rgba(0,0,0,0.55)); animation: atr-react-rise 2.5s var(--ease-out) forwards; }
  .atr-screentile { position: relative; width: 150px; height: 100px; border-radius: 12px; overflow: hidden;
    border: 1px solid var(--accent-soft); background: #0e1014; flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(198,244,50,0.18); }
  /* live screen-share tile — hosts the real `#atr-screens` <video> node, moved in by ScreenView */
  .atr-screens-inner { width: 100%; height: 100%; display: flex; gap: 6px; }
  .atr-screens-inner video { flex: 1 1 0; min-width: 0; width: 100%; height: 100%; object-fit: contain; background: #000; border-radius: 12px; }

  /* ---- expanded call stage (Discord-style) ---- */
  .atr-vd-expand { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
    margin-left: 4px; background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 50%; color: var(--fg-1);
    cursor: pointer; transition: background var(--dur-fast), color var(--dur-fast); }
  .atr-vd-expand:hover { background: var(--bg-4); color: var(--accent); }

  .atr-callstage { position: absolute; z-index: 34; display: flex; flex-direction: column;
    background: rgba(12,13,16,0.97); backdrop-filter: blur(20px); border: 1px solid var(--line-3);
    border-radius: 20px; box-shadow: var(--shadow-3); overflow: hidden; animation: atr-fade 0.18s var(--ease-out); }
  .atr-callstage-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line-1); flex: 0 0 auto; }
  .atr-callstage-title { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--fg-1); }
  .atr-callstage-body { flex: 1; display: flex; gap: 12px; padding: 16px; min-height: 0; }
  .atr-gallery { flex: 1; display: grid; gap: 12px; min-height: 0; grid-auto-rows: 1fr; }
  .atr-gallery .atr-vtile { width: 100%; height: 100%; }
  .atr-stage-main { flex: 1; min-width: 0; display: flex; }
  .atr-stage-main .atr-screentile { width: 100%; height: 100%; }
  .atr-filmstrip { width: 196px; flex: 0 0 196px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
  .atr-filmstrip .atr-vtile { width: 100%; height: auto; aspect-ratio: 16 / 10; }
  .atr-callbar { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-top: 1px solid var(--line-1); flex: 0 0 auto; }

  /* ---- expanded chat stage ---- */
  .atr-chatstage { position: absolute; z-index: 34; display: flex;
    background: rgba(18,19,22,0.97); backdrop-filter: blur(20px); border: 1px solid var(--line-3);
    border-radius: 20px; box-shadow: var(--shadow-3); overflow: hidden; animation: atr-fade 0.18s var(--ease-out); }
  .atr-chatstage-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .atr-chatstage-head { display: flex; align-items: center; gap: 11px; padding: 14px 16px; border-bottom: 1px solid var(--line-1); flex: 0 0 auto; }
  .atr-chatstage-list { flex: 1; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; }
  .atr-chatstage-compose { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-top: 1px solid var(--line-1); flex: 0 0 auto; }
  .atr-chatstage-compose input { flex: 1; height: 44px; background: var(--bg-2); border: 1px solid var(--line-2);
    border-radius: var(--radius-pill); padding: 0 16px; color: var(--fg-0); font-family: var(--font-sans); font-size: 14px; outline: none; }
  .atr-chatstage-compose input:focus { border-color: var(--line-3); }

  /* ---- calendar stage ---- */
  .atr-cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 2px 12px; overflow: hidden; }
  .atr-cal-navday { flex: 1; min-width: 0; text-align: center; font-family: var(--font-mono); font-size: 12.5px; color: var(--fg-1); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .atr-calstage { position: absolute; z-index: 34; display: flex; flex-direction: column;
    background: rgba(18,19,22,0.97); backdrop-filter: blur(20px); border: 1px solid var(--line-3);
    border-radius: 20px; box-shadow: var(--shadow-3); overflow: hidden; animation: atr-fade 0.18s var(--ease-out); }
  .atr-cal-head { display: flex; align-items: center; gap: 10px; padding: 13px 14px 13px 18px; border-bottom: 1px solid var(--line-1); flex: 0 0 auto; }
  .atr-cal-title { font-family: var(--font-display); font-size: 16px; font-weight: 500; color: var(--fg-0); letter-spacing: -0.01em; }
  .atr-cal-day { font-family: var(--font-mono); font-size: 12px; color: var(--fg-2); }
  .atr-cal-body { flex: 1; overflow-y: auto; padding: 8px 18px 18px; }
  .atr-cal-grid { position: relative; width: 100%; box-sizing: border-box; }
  .atr-cal-hour { position: absolute; left: 0; right: 0; display: flex; align-items: center; gap: 12px; height: 0; }
  .atr-cal-hlabel { width: 44px; flex: 0 0 44px; font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); transform: translateY(-1px); }
  .atr-cal-hline { flex: 1; height: 1px; background: var(--line-1); }
  .atr-cal-now { position: absolute; left: 56px; right: 0; height: 0; z-index: 3; }
  .atr-cal-now::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--accent); opacity: 0.7; }
  .atr-cal-now span { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
  .atr-cal-events { position: absolute; left: 56px; right: 0; top: 0; bottom: 0; }
  .atr-cal-ev { position: absolute; box-sizing: border-box; overflow: hidden; padding: 4px 7px; border-radius: 8px;
    background: rgba(94,139,255,0.16); border: 1px solid rgba(94,139,255,0.4); cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast); }
  .atr-cal-ev:hover { background: rgba(94,139,255,0.26); }
  .atr-cal-ev.brk { background: rgba(255,255,255,0.05); border-color: var(--line-2); cursor: default; }
  .atr-cal-ev.brk:hover { background: rgba(255,255,255,0.07); }
  .atr-cal-ev.agent { background: rgba(198,244,50,0.1); border-color: var(--accent-soft); }
  .atr-cal-ev.agent:hover { background: rgba(198,244,50,0.16); }
  .atr-cal-ev-time { font-family: var(--font-mono); font-size: 10px; color: var(--fg-2); }
  .atr-cal-ev-title { font-size: 12px; font-weight: 600; color: var(--fg-0); line-height: 1.2; margin-top: 0;
    overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .atr-cal-ev.tight .atr-cal-ev-title { -webkit-line-clamp: 1; }
  .atr-cal-ev-time { font-family: var(--font-mono); font-size: 9.5px; color: var(--fg-2); margin-top: 2px; }
  .atr-island-btn.leave-wide { width: auto; padding: 0 16px; gap: 7px; font-family: var(--font-sans); font-size: 13px; font-weight: 500; color: var(--fg-1); }
  .atr-island-btn.leave-wide:hover { color: var(--fg-0); }

  /* ---- docs: page tree ---- */
  .atr-doc-new { display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 0 10px; margin-bottom: 4px;
    background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 9px; cursor: pointer; color: var(--fg-1);
    font-family: var(--font-sans); font-size: 13px; font-weight: 500; }
  .atr-doc-new:hover { background: var(--bg-3); color: var(--fg-0); }
  .atr-doc-row { display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 8px;
    background: transparent; border: 0; border-radius: 8px; cursor: pointer; text-align: left; color: var(--fg-1);
    font-family: var(--font-sans); font-size: 13px; transition: background var(--dur-fast) var(--ease-out); }
  .atr-doc-row:hover { background: var(--bg-2); color: var(--fg-0); }
  .atr-doc-row.on { background: var(--bg-3); color: var(--fg-0); }
  .atr-doc-row .msi { color: var(--fg-3); flex: 0 0 auto; }
  .atr-doc-row.on .msi { color: var(--accent); }
  .atr-doc-rowname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* ---- docs: stage ---- */
  .atr-docstage { position: absolute; z-index: 34; display: flex; flex-direction: column;
    background: rgba(18,19,22,0.97); backdrop-filter: blur(20px); border: 1px solid var(--line-3);
    border-radius: 20px; box-shadow: var(--shadow-3); overflow: hidden; animation: atr-fade 0.18s var(--ease-out); }
  .atr-doc-head { display: flex; align-items: center; gap: 8px; padding: 11px 12px 11px 18px; border-bottom: 1px solid var(--line-1); flex: 0 0 auto; }
  .atr-doc-crumb { font-family: var(--font-mono); font-size: 12px; color: var(--fg-2); }
  .atr-doc-collab { display: flex; align-items: center; gap: 0; margin-right: 6px; }
  .atr-doc-collab-av { margin-left: -8px; border-radius: 50%; box-shadow: 0 0 0 2px var(--bg-1); }
  .atr-doc-collab-av:first-child { margin-left: 0; }
  .atr-doc-collab-n { font-family: var(--font-mono); font-size: 10px; color: var(--fg-3); margin-left: 8px; }
  .atr-doc-body { flex: 1; overflow-y: auto; padding: 28px 24px 60px; }
  /* Left padding reserves room for the hover gutter (+ / drag handle); the title,
     emoji, and block text all align at the content edge, handles sit in the gap. */
  .atr-doc-page { max-width: 768px; margin: 0 auto; padding-left: 52px; }
  .atr-doc-emoji { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
    background: var(--accent-soft); border-radius: 14px; margin-bottom: 14px; }
  .atr-doc-title { font-family: var(--font-display); font-size: 34px; font-weight: 600; color: var(--fg-0); letter-spacing: -0.02em; line-height: 1.1; outline: none; margin: 0; }
  .atr-doc-meta { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); margin-top: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--line-1); }
  .atr-doc-blocks { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
  .atr-doc-h2 { font-family: var(--font-display); font-size: 20px; font-weight: 600; color: var(--fg-0); letter-spacing: -0.01em; margin: 12px 0 0; outline: none; }
  .atr-doc-p { font-size: 15px; line-height: 1.65; color: var(--fg-1); outline: none; margin: 0; }
  .atr-doc-p:focus { background: rgba(255,255,255,0.02); border-radius: 4px; }
  .atr-doc-ghost:empty::before { content: attr(data-ph); color: var(--fg-3); }
  .atr-doc-quote { border-left: 3px solid var(--accent); padding: 2px 0 2px 14px; font-size: 15px; color: var(--fg-1); font-style: italic; outline: none; margin: 0; }
  .atr-doc-bullet { display: flex; gap: 10px; font-size: 15px; line-height: 1.6; color: var(--fg-1); }
  .atr-doc-bullet span[contenteditable] { outline: none; flex: 1; }
  .atr-doc-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--fg-2); margin-top: 10px; flex: 0 0 auto; }
  .atr-doc-hr { border: 0; border-top: 1px solid var(--line-2); margin: 8px 0; }
  .atr-doc-code { font-family: var(--font-mono); font-size: 12.5px; color: var(--fg-1); background: var(--bg-0);
    border: 1px solid var(--line-2); border-left: 2px solid var(--accent); border-radius: 8px; padding: 12px 14px; white-space: pre-wrap; line-height: 1.5; margin: 0; }
  .atr-doc-callout { display: flex; gap: 11px; align-items: flex-start; background: var(--accent-soft);
    border: 1px solid var(--accent-soft); border-radius: 10px; padding: 13px 15px; font-size: 14px; line-height: 1.55; color: var(--fg-1); }
  .atr-doc-callout span { outline: none; }
  .atr-doc-todo { display: flex; gap: 9px; align-items: flex-start; font-size: 15px; line-height: 1.5; color: var(--fg-1); }
  .atr-doc-todo span { outline: none; flex: 1; }
  .atr-doc-todo.done span { color: var(--fg-3); text-decoration: line-through; }
  .atr-doc-check { background: none; border: 0; padding: 0; cursor: pointer; color: var(--fg-3); display: inline-flex; margin-top: 1px; }
  .atr-doc-todo.done .atr-doc-check { color: var(--accent); }

  /* ---- collaborative block editor (J4/J6) ---- */
  .atr-doc-block-wrap { position: relative; display: flex; align-items: flex-start; gap: 8px; padding: 1px 0; }
  .atr-doc-block-wrap:hover { background: rgba(255,255,255,0.015); border-radius: 6px; }
  .atr-doc-block { flex: 1; min-width: 0; outline: none; font-size: 15px; line-height: 1.65; color: var(--fg-1); margin: 0; white-space: pre-wrap; word-break: break-word; }
  .atr-doc-block:empty::before { content: attr(data-ph); color: var(--fg-3); pointer-events: none; }
  .atr-doc-paragraph { }
  .atr-doc-heading { font-family: var(--font-display); font-weight: 600; color: var(--fg-0); letter-spacing: -0.01em; line-height: 1.25; }
  .atr-doc-h1 { font-size: 26px; }
  .atr-doc-h2 { font-size: 21px; }
  .atr-doc-h3 { font-size: 17px; }
  .atr-doc-h4 { font-size: 15px; }
  .atr-doc-levelsel { display: inline-flex; gap: 2px; margin-right: 4px; }
  .atr-doc-lvl { height: 24px; padding: 0 6px; font-size: 11px; font-family: var(--font-mono); color: var(--fg-3);
    background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 6px; cursor: pointer; }
  .atr-doc-lvl.on, .atr-doc-lvl:hover { color: var(--fg-0); border-color: var(--accent); }
  .atr-doc-bullet_list { padding-left: 22px; position: relative; }
  .atr-doc-bullet_list::before { content: "•"; position: absolute; left: 6px; color: var(--fg-2); }
  .atr-doc-numbered_list { padding-left: 22px; position: relative; }
  .atr-doc-numbered_list::before { content: "–"; position: absolute; left: 6px; color: var(--fg-2); }
  .atr-doc-divider-row { align-items: center; }
  .atr-doc-divider { flex: 1; border: 0; border-top: 1px solid var(--line-2); margin: 10px 0; }
  .atr-doc-todobox { margin-top: 5px; accent-color: var(--accent); flex: 0 0 auto; cursor: pointer; }
  /* The per-block control bar — fades in on hover, never editable. */
  .atr-doc-bctl { position: absolute; top: 0; right: 0; display: flex; gap: 4px; align-items: center;
    opacity: 0; transition: opacity 0.12s ease; user-select: none; }
  .atr-doc-block-wrap:hover .atr-doc-bctl { opacity: 1; }
  .atr-doc-kindsel { height: 24px; font-size: 11px; font-family: var(--font-mono); color: var(--fg-2);
    background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 0 4px; cursor: pointer; }
  .atr-doc-bdel { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 16px; line-height: 1; color: var(--fg-3); background: var(--bg-2); border: 1px solid var(--line-2);
    border-radius: 6px; cursor: pointer; }
  .atr-doc-bdel:hover { color: var(--danger, #e5484d); border-color: var(--danger, #e5484d); }
  .atr-doc-bmove { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; line-height: 1; color: var(--fg-3); background: var(--bg-2); border: 1px solid var(--line-2);
    border-radius: 6px; cursor: pointer; }
  .atr-doc-bmove:hover { color: var(--fg-1); border-color: var(--accent); }
  /* Trailing click zone: empty space below the doc; clicking it adds a block. */
  .atr-doc-tail { min-height: 40vh; cursor: text; }
  /* ---- left gutter + drag-to-reorder + marquee multi-select (P3) ---- */
  /* Notion-style hover gutter sitting in the page's left padding. */
  .atr-doc-gutter { position: absolute; left: -50px; top: 0; height: 100%; width: 40px;
    display: flex; align-items: flex-start; justify-content: flex-end; gap: 1px; padding-top: 1px;
    opacity: 0; transition: opacity 0.12s ease; user-select: none; }
  .atr-doc-block-wrap:hover .atr-doc-gutter { opacity: 1; }
  .atr-doc-gbtn, .atr-doc-ghandle { width: 18px; height: 24px; display: inline-flex; align-items: center;
    justify-content: center; color: var(--fg-3); background: transparent; border: 0; border-radius: 5px; cursor: pointer; }
  .atr-doc-gbtn:hover, .atr-doc-ghandle:hover { color: var(--fg-1); background: var(--bg-3); }
  .atr-doc-ghandle { cursor: grab; }
  .atr-doc-ghandle:active { cursor: grabbing; }
  /* Marquee block-selection highlight (Notion fills the whole row). */
  .atr-doc-block-wrap.selected { background: var(--accent-soft); border-radius: 6px; }
  /* Dragged blocks fade in place; a faded copy of them (below) follows the cursor. */
  .atr-doc-block-wrap.dragging { opacity: 0.4; }
  /* The drag preview = a deep-cloned copy of the real block(s), faded (Notion-style).
     Off-screen until the browser snapshots it; gutter/menu hidden in the clone. */
  .atr-doc-dragghost { position: fixed; top: 0; left: -9999px; pointer-events: none;
    display: flex; flex-direction: column; gap: 8px; max-width: 760px;
    padding: 8px 12px; background: var(--bg-1); border: 1px solid var(--line-2);
    border-radius: 10px; box-shadow: var(--shadow-3); opacity: 0.65; }
  .atr-doc-dragghost .atr-doc-gutter { display: none; }
  .atr-doc-dragghost .atr-doc-block-wrap { background: transparent; box-shadow: none; }
  /* The blue drop indicator while dragging a block — spans gutter to right edge. */
  .atr-doc-block-wrap.drop-before::before,
  .atr-doc-block-wrap.drop-after::after { content: ""; position: absolute; left: -50px; right: 0;
    height: 2px; background: var(--accent); border-radius: 2px; z-index: 6; pointer-events: none;
    box-shadow: 0 0 6px var(--accent); }
  .atr-doc-block-wrap.drop-before::before { top: -6px; }
  .atr-doc-block-wrap.drop-after::after { bottom: -6px; }
  /* The marquee box: a stage-covering capture layer + the drawn rectangle
     (absolute, anchored to the layer — see DocMarquee for the offset rationale). */
  .atr-doc-marquee-layer { position: fixed; inset: 0; z-index: 60; }
  .atr-doc-marquee { position: absolute; background: var(--accent-soft); border: 1px solid var(--accent);
    border-radius: 3px; pointer-events: none; }
  /* Handle context menu (Turn into / Duplicate / Delete) + its outside-click scrim. */
  .atr-doc-menu-scrim { position: fixed; inset: 0; z-index: 71; }
  .atr-doc-bmenu { position: fixed; z-index: 72; width: 208px; max-height: 60vh; overflow-y: auto;
    padding: 6px; background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 12px;
    box-shadow: 0 16px 44px rgba(0,0,0,0.5); animation: atr-fade 0.12s var(--ease-out); }
  .atr-doc-bmenu .atr-doc-cmd-item { height: 34px; }
  .atr-doc-bmenu-sep { height: 1px; background: var(--line-1); margin: 5px 4px; }
  .atr-doc-bmenu-del:hover { color: var(--danger, #e5484d); }
  .atr-doc-bmenu-del:hover .atr-doc-cmd-ico { color: var(--danger, #e5484d); border-color: var(--danger, #e5484d); }
  /* slash menu (J7) — caret-anchored block-kind picker */
  .atr-doc-slash { position: fixed; z-index: 70; min-width: 180px; padding: 5px;
    background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.35); display: flex; flex-direction: column; gap: 1px; }
  .atr-doc-slash-item { display: flex; align-items: center; height: 30px; padding: 0 10px;
    font-size: 13px; color: var(--fg-1); background: transparent; border: 0; border-radius: 7px;
    cursor: pointer; text-align: left; }
  .atr-doc-slash-item:hover, .atr-doc-slash-item.on { background: var(--accent-soft); color: var(--fg-0); }
  /* @-mention popup reuses the slash menu's chrome */
  .atr-doc-at .atr-doc-slash-item { gap: 6px; }
  /* slash command palette (Notion-style): search + categorized rows + live preview */
  .atr-doc-cmd { position: fixed; z-index: 70; display: flex; align-items: flex-start; gap: 10px; }
  .atr-doc-cmd-list { width: 330px; max-height: 60vh; display: flex; flex-direction: column;
    background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 12px;
    box-shadow: 0 16px 44px rgba(0,0,0,0.5); overflow: hidden; animation: atr-fade 0.12s var(--ease-out); }
  .atr-doc-cmd-search { flex: 0 0 auto; display: flex; align-items: center; gap: 2px; height: 40px; padding: 0 13px;
    font-family: var(--font-mono); font-size: 14px; color: var(--fg-0); border-bottom: 1px solid var(--line-1); }
  .atr-doc-cmd-slash { color: var(--accent); }
  .atr-doc-cmd-ph { color: var(--fg-3); }
  .atr-doc-cmd-q { color: var(--fg-0); }
  .atr-doc-cmd-scroll { flex: 1; overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 1px; }
  .atr-doc-cmd-cat { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em;
    text-transform: uppercase; color: var(--fg-3); padding: 9px 8px 4px; }
  .atr-doc-cmd-item { display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 8px; width: 100%;
    font-family: var(--font-sans); font-size: 14px; color: var(--fg-1); background: transparent; border: 0;
    border-radius: 8px; cursor: pointer; text-align: left; }
  .atr-doc-cmd-item:hover, .atr-doc-cmd-item.on { background: var(--bg-3); color: var(--fg-0); }
  .atr-doc-cmd-ico { width: 30px; height: 30px; flex: 0 0 auto; display: inline-flex; align-items: center;
    justify-content: center; color: var(--fg-1); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 7px; }
  .atr-doc-cmd-item.on .atr-doc-cmd-ico { color: var(--accent); border-color: var(--accent-soft); }
  .atr-doc-cmd-ico .msi { font-size: 18px; }
  .atr-doc-cmd-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .atr-doc-cmd-sc { flex: 0 0 auto; font-family: var(--font-mono); font-size: 12px; color: var(--fg-3); }
  .atr-doc-cmd-item.on .atr-doc-cmd-sc { color: var(--fg-2); }
  .atr-doc-cmd-empty { padding: 18px 12px; font-size: 13px; color: var(--fg-3); text-align: center; }
  .atr-doc-cmd-foot { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
    height: 34px; padding: 0 13px; border-top: 1px solid var(--line-1); font-size: 12px; color: var(--fg-3); }
  .atr-doc-cmd-foot kbd { font-family: var(--font-mono); font-size: 11px; color: var(--fg-2);
    background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; }
  /* the side preview card */
  .atr-doc-cmd-preview { width: 248px; padding: 18px; background: var(--bg-2); border: 1px solid var(--line-2);
    border-radius: 12px; box-shadow: 0 16px 44px rgba(0,0,0,0.5); animation: atr-fade 0.12s var(--ease-out); }
  .atr-doc-cmd-pv { min-height: 56px; display: flex; flex-direction: column; justify-content: center; pointer-events: none; }
  .atr-doc-cmd-pv .atr-doc-heading { margin: 0; }
  .atr-doc-cmd-pvtodo { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--fg-1); }
  .atr-doc-cmd-pvtodo input { accent-color: var(--accent); }
  .atr-doc-cmd-pvmedia { height: 70px; display: flex; align-items: center; justify-content: center;
    color: var(--fg-3); background: var(--bg-0); border: 1px dashed var(--line-2); border-radius: 8px; }
  .atr-doc-cmd-pvdesc { margin-top: 13px; font-family: var(--font-sans); font-size: 12px; line-height: 1.5; color: var(--fg-2); }
  /* selection format bubble (P2): a floating pill above a text selection */
  .atr-doc-bubble { position: fixed; z-index: 72; display: flex; align-items: center; gap: 2px;
    padding: 4px; background: var(--bg-1); border: 1px solid var(--line-3); border-radius: 9px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.5); transform: translateY(calc(-100% - 8px));
    animation: atr-fade 0.1s var(--ease-out); }
  .atr-doc-bubble-turn { display: inline-flex; align-items: center; gap: 3px; height: 30px; padding: 0 9px;
    font-family: var(--font-sans); font-size: 13px; color: var(--fg-1); background: transparent;
    border: 0; border-radius: 7px; cursor: pointer; white-space: nowrap; }
  .atr-doc-bubble-turn:hover { background: var(--bg-3); color: var(--fg-0); }
  .atr-doc-bubble-btn { width: 30px; height: 30px; display: inline-flex; align-items: center;
    justify-content: center; color: var(--fg-1); background: transparent; border: 0; border-radius: 7px; cursor: pointer; }
  .atr-doc-bubble-btn:hover { background: var(--bg-3); color: var(--fg-0); }
  .atr-doc-bubble-btn.on { color: var(--accent); background: var(--accent-soft); }
  .atr-doc-bubble-div { width: 1px; height: 18px; background: var(--line-2); margin: 0 2px; flex: 0 0 auto; }
  /* the Turn-into dropdown inside the bubble (reuses the slash list chrome) */
  .atr-doc-turn { position: absolute; top: calc(100% + 4px); left: 0; width: 210px; max-height: 300px;
    overflow-y: auto; padding: 6px; }
  /* J8 collaboration — active editors strip, per-block peer cursor, presence */
  .atr-doc-editors { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
  .atr-doc-editor-chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px 0 7px;
    font-size: 11px; color: var(--fg-1); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 11px; }
  .atr-doc-editor-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; background: var(--peerc, var(--accent)); }
  .atr-doc-block-wrap.has-peer { box-shadow: inset 2px 0 0 var(--accent); }
  .atr-doc-peer-chip { position: absolute; top: 1px; right: 8px; font-size: 10px; font-family: var(--font-mono);
    color: #fff; background: var(--peerc, var(--accent)); padding: 1px 6px; border-radius: 7px; opacity: 0.85; pointer-events: none; }
  /* J9 image + embed media blocks */
  .atr-doc-media-row { align-items: flex-start; }
  .atr-doc-image { max-width: 100%; border-radius: 10px; display: block; }
  .atr-doc-embed { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; background: var(--bg-0); }
  .atr-doc-urlinput { flex: 1; height: 36px; padding: 0 12px; font-size: 13px; color: var(--fg-1);
    background: var(--bg-2); border: 1px dashed var(--line-2); border-radius: 8px; outline: none; }
  .atr-doc-urlinput:focus { border-color: var(--accent); border-style: solid; }

  /* ---- community feed ---- */
  .atr-feed { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
  .atr-feed-compose { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--bg-1);
    border: 1px solid var(--line-2); border-radius: 14px; }
  .atr-feed-compose input { flex: 1; height: 38px; background: var(--bg-2); border: 1px solid var(--line-2);
    border-radius: var(--radius-pill); padding: 0 14px; color: var(--fg-0); font-family: var(--font-sans); font-size: 13.5px; outline: none; }
  .atr-feed-compose input:focus { border-color: var(--line-3); }
  .atr-feed-card { background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 14px; padding: 16px; }
  .atr-feed-pin { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 10px;
    text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 10px; }
  .atr-feed-top { display: flex; align-items: flex-start; gap: 11px; }
  .atr-feed-author { font-size: 14px; font-weight: 600; color: var(--fg-0); }
  .atr-feed-meta { font-size: 12px; color: var(--fg-3); font-family: var(--font-mono); }
  .atr-feed-topic { font-family: var(--font-mono); font-size: 11px; color: var(--cobalt); }
  .atr-feed-body { font-size: 14.5px; line-height: 1.6; color: var(--fg-1); margin: 12px 0 14px; }
  .atr-feed-foot { display: flex; align-items: center; gap: 6px; }
  .atr-feed-act { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
    background: transparent; border: 1px solid var(--line-2); border-radius: var(--radius-pill); color: var(--fg-2);
    font-family: var(--font-sans); font-size: 12.5px; font-weight: 500; cursor: pointer; transition: background var(--dur-fast), color var(--dur-fast); }
  .atr-feed-act:hover { background: var(--bg-2); color: var(--fg-0); }
  .atr-feed-faces { display: flex; align-items: center; }

  /* ---- reactions ---- */
  .atr-reactpicker { position: absolute; bottom: 76px; z-index: 40; transform: translateX(-50%);
    display: flex; gap: 4px; padding: 7px 9px; background: rgba(23,23,23,0.94); backdrop-filter: blur(16px);
    border: 1px solid var(--line-3); border-radius: var(--radius-pill); box-shadow: var(--shadow-2);
    animation: atr-react-pop 0.16s var(--ease-out); }
  @keyframes atr-react-pop { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
  .atr-reactpicker.closing { animation: atr-react-pop-out 0.15s var(--ease-out) forwards; }
  @keyframes atr-react-pop-out { from { opacity: 1; transform: translateX(-50%) translateY(0); } to { opacity: 0; transform: translateX(-50%) translateY(8px); } }

  /* ---- quick actions menu (island +) ---- */
  .atr-quickmenu { position: absolute; bottom: 76px; z-index: 40; transform: translateX(-50%); width: 296px;
    display: flex; flex-direction: column; gap: 2px; padding: 8px; background: rgba(23,23,23,0.95); backdrop-filter: blur(16px);
    border: 1px solid var(--line-3); border-radius: 16px; box-shadow: var(--shadow-2);
    animation: atr-react-pop 0.16s var(--ease-out); }
  .atr-quick-head { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--fg-3); padding: 6px 8px 7px; }
  .atr-quick-row { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 9px; text-align: left;
    background: transparent; border: 0; border-radius: 11px; cursor: pointer; transition: background var(--dur-fast) var(--ease-out); }
  .atr-quick-row:hover { background: var(--bg-3); }
  .atr-quick-ic { flex: 0 0 36px; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-soft); border: 1px solid var(--accent-soft); border-radius: 50%; color: var(--accent); }
  .atr-quick-tx { display: flex; flex-direction: column; flex: 1; min-width: 0; }
  .atr-quick-t { font-size: 13.5px; font-weight: 600; color: var(--fg-0); }
  .atr-quick-s { font-size: 11.5px; color: var(--fg-2); }

  /* ---- quick settings menu (island ⋯) ---- */
  .atr-settingsmenu { width: 260px; }
  .atr-set-seg { display: flex; gap: 5px; padding: 2px; margin: 0 2px 4px; background: var(--bg-2);
    border: 1px solid var(--line-2); border-radius: var(--radius-pill); }
  .atr-set-segbtn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px;
    background: transparent; border: 0; border-radius: var(--radius-pill); color: var(--fg-2); cursor: pointer;
    font-family: var(--font-sans); font-size: 12.5px; font-weight: 500; transition: background var(--dur-fast), color var(--dur-fast); }
  .atr-set-segbtn:hover { color: var(--fg-0); }
  .atr-set-segbtn.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
  .atr-set-row { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 9px;
    background: transparent; border: 0; border-radius: 9px; cursor: pointer; color: var(--fg-1);
    font-family: var(--font-sans); font-size: 13px; font-weight: 500; transition: background var(--dur-fast) var(--ease-out); }
  .atr-set-row:hover { background: var(--bg-2); color: var(--fg-0); }
  .atr-set-row.on { background: var(--bg-3); color: var(--fg-0); }
  .atr-set-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
  .atr-quick-back { display: flex; align-items: center; gap: 7px; width: 100%; padding: 7px 8px; margin-bottom: 2px;
    background: transparent; border: 0; border-bottom: 1px solid var(--line-1); border-radius: 0; cursor: pointer;
    color: var(--fg-1); font-family: var(--font-sans); font-size: 12.5px; font-weight: 600; }
  .atr-quick-back:hover { color: var(--fg-0); }
  .atr-quick-back .msi { color: var(--fg-3); }
  .atr-quick-p { font-size: 12.5px; color: var(--fg-2); line-height: 1.5; padding: 8px 8px 4px; }
  .atr-quick-link { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin: 4px;
    background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 11px; }
  .atr-quick-link span { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 12px; color: var(--fg-1);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .atr-island-btn.primary.open-removed {}
  .atr-react-btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 0; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast); }
  .atr-react-btn:hover { background: var(--bg-3); transform: translateY(-2px) scale(1.12); }
  .atr-react-emoji { font-size: 30px; line-height: 1; text-align: center; filter: drop-shadow(0 3px 5px rgba(0,0,0,0.5));
    animation: atr-react-rise 2.5s var(--ease-out) forwards; }
  @keyframes atr-react-rise {
    0% { opacity: 0; transform: translateY(8px) scale(0.4); }
    12% { opacity: 1; transform: translateY(0) scale(1.18); }
    24% { transform: translateY(-2px) scale(1); }
    78% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-46px) scale(1); }
  }

  /* ---- buttons ---- */
  .atr-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 16px;
    background: var(--bg-3); border: 1px solid var(--line-2); border-radius: var(--radius-pill);
    color: var(--fg-0); font-family: var(--font-sans); font-size: 13px; font-weight: 500; cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast), transform var(--dur-fast);
  }
  .atr-btn:hover { background: var(--bg-4); border-color: var(--line-3); }
  .atr-btn:active { transform: translateY(1px); }
  .atr-btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
  .atr-btn.primary:hover { background: #d4ff4a; }
  .atr-btn.ghost { background: transparent; border-color: transparent; color: var(--fg-1); }
  .atr-btn.ghost:hover { background: var(--bg-2); color: var(--fg-0); }
  .atr-btn.wide { width: 100%; margin-top: 8px; }

  /* ---- profile drawer ---- */
  .atr-drawer {
    position: absolute; top: 60px; right: 12px; width: 320px; z-index: 38;
    background: rgba(32,32,34,0.96); backdrop-filter: blur(20px);
    border: 1px solid var(--line-3); border-radius: 18px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.6), 0 4px 14px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
    padding: 18px; animation: atr-drawer-in 0.2s var(--ease-out);
  }
  @keyframes atr-drawer-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: none; } }
  .atr-kv { margin-top: 14px; border-top: 1px solid var(--line-1); }
  .atr-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 13px;
    color: var(--fg-1); border-bottom: 1px solid var(--line-1); }
  .atr-row span:last-child { text-align: right; }
  .atr-agent-tag { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono);
    font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent);
    border: 1px solid var(--accent-soft); border-radius: var(--radius-1); padding: 2px 7px; }
  .atr-diamond { width: 8px; height: 8px; background: var(--accent); transform: rotate(45deg); flex: 0 0 8px;
    display: inline-block; border-radius: 1px; }
  .atr-agent-box { margin-top: 14px; background: rgba(198,244,50,0.05); border: 1px solid var(--accent-soft);
    border-radius: var(--radius-2); padding: 12px; }

  /* ---- chat ---- */
  .atr-chat {
    position: absolute; top: 64px; right: 12px; bottom: 12px; width: 340px; z-index: 26;
    background: var(--bg-1); border: 1px solid var(--line-2); border-radius: var(--radius-3);
    box-shadow: var(--shadow-2); display: flex; flex-direction: column; overflow: hidden;
    animation: atr-slide 0.18s var(--ease-out);
  }
  .atr-chat-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 14px;
    border-bottom: 1px solid var(--line-1); }
  .atr-chan-tabs { display: flex; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line-1); }
  .atr-chan { font-family: var(--font-mono); font-size: 12px; color: var(--fg-2); background: transparent;
    border: 1px solid transparent; border-radius: var(--radius-pill); padding: 4px 11px; cursor: pointer; }
  .atr-chan:hover { background: var(--bg-2); color: var(--fg-1); }
  .atr-chan.on { background: var(--bg-3); color: var(--fg-0); border-color: var(--line-2); }
  .atr-msgs { flex: 1; overflow-y: auto; padding: 8px 14px; }
  .atr-compose { display: flex; align-items: center; gap: 8px; padding: 11px; border-top: 1px solid var(--line-1); }
  .atr-compose input { flex: 1; height: 38px; background: var(--bg-2); border: 1px solid var(--line-2);
    border-radius: var(--radius-pill); padding: 0 14px; color: var(--fg-0); font-family: var(--font-sans); font-size: 13px; outline: none; }
  .atr-compose input:focus { border-color: var(--line-3); }

  /* ---- chat: unread, DM list, threads, presence ---- */
  .atr-unread { font-family: var(--font-mono); font-size: 10px; background: var(--cobalt); color: #fff;
    min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-pill); padding: 0 5px; flex: 0 0 auto; }
  .atr-dm-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px;
    background: transparent; border: 0; border-radius: 11px; cursor: pointer; text-align: left;
    transition: background var(--dur-fast) var(--ease-out); }
  .atr-dm-row:hover { background: var(--bg-2); }
  .atr-dm-name { font-size: 13px; font-weight: 600; color: var(--fg-0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .atr-dm-time { margin-left: auto; font-size: 10.5px; color: var(--fg-3); font-family: var(--font-mono); flex: 0 0 auto; }
  .atr-dm-last { font-size: 12px; color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
  .atr-dm-go { display: inline-flex; color: var(--fg-3); opacity: 0; transition: opacity var(--dur-fast) var(--ease-out); flex: 0 0 auto; }
  .atr-dm-row:hover .atr-dm-go { opacity: 1; }
  .atr-inline-link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit;
    color: var(--accent); font-weight: 600; }
  .atr-inline-link:hover { text-decoration: underline; }
  .atr-thread-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px; border-bottom: 1px solid var(--line-1); }
  .atr-thread-head.dm { gap: 9px; }
  .atr-thread-title { font-size: 14px; font-weight: 600; color: var(--fg-0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .atr-dm-presence { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--fg-2); font-family: var(--font-mono); margin-top: 1px; }
  .atr-dm-bubble { font-size: 13.5px; line-height: 1.4; padding: 7px 11px; max-width: 80%; word-break: break-word; }
  .atr-dm-bubble.mine { background: var(--accent); color: var(--accent-ink); font-weight: 500;
    border-radius: 13px 4px 13px 13px; }

  /* ---- huddle dock ---- */
  .atr-huddle {
    position: absolute; bottom: 18px; left: 50%; transform: translateX(calc(-50% + 116px)); z-index: 28;
    display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px;
    background: rgba(17,17,17,0.92); backdrop-filter: blur(12px);
    border: 1px solid var(--line-2); border-radius: var(--radius-pill); box-shadow: var(--shadow-2);
    animation: atr-pop 0.2s var(--ease-out);
  }
  @keyframes atr-pop { from { opacity: 0; transform: translateX(calc(-50% + 116px)) translateY(10px); } }
  .atr-live { width: 9px; height: 9px; position: relative; }
  .atr-live span { position: absolute; inset: 0; background: #FF5A5A; border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(255,90,90,0.6); animation: atr-pulse 1.6s infinite; }
  @keyframes atr-pulse { 70% { box-shadow: 0 0 0 7px rgba(255,90,90,0); } 100% { box-shadow: 0 0 0 0 rgba(255,90,90,0); } }
  .atr-h-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
    background: var(--bg-3); border: 1px solid var(--line-2); border-radius: var(--radius-pill); color: var(--fg-1); cursor: pointer; }
  .atr-h-btn:hover { background: var(--bg-4); color: var(--fg-0); }
  .atr-h-btn.on { color: var(--accent); }
  .atr-h-btn.leave { background: #FF5A5A; border-color: #FF5A5A; color: #fff; }
  .atr-h-btn.leave:hover { background: #ff7070; }

  /* ---- hint + zoom ---- */
  .atr-hint {
    position: absolute; bottom: 18px; left: 248px; z-index: 22;
    display: flex; align-items: center; gap: 8px; padding: 8px 12px;
    background: rgba(17,17,17,0.85); backdrop-filter: blur(10px);
    border: 1px solid var(--line-2); border-radius: var(--radius-pill);
    font-size: 12.5px; color: var(--fg-2);
  }
  .atr-zoom { position: absolute; right: 12px; bottom: 18px; z-index: 22; display: flex; flex-direction: column; gap: 6px; }
  .atr-zoom button { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(15,15,15,0.9); backdrop-filter: blur(14px); border: 1px solid var(--line-2);
    border-radius: 50%; color: var(--fg-1); cursor: pointer; }
  .atr-zoom button:hover { background: var(--bg-3); color: var(--fg-0); }

  /* ---- task modal ---- */
  .atr-modal-bg { position: absolute; inset: 0; z-index: 40; background: rgba(10,10,10,0.6);
    backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; animation: atr-fade 0.16s; }
  @keyframes atr-fade { from { opacity: 0; } }
  .atr-modal { width: 420px; max-width: 90vw; background: var(--bg-1); border: 1px solid var(--line-2);
    border-radius: 20px; box-shadow: var(--shadow-3); padding: 22px; }
  .atr-textarea { width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 14px;
    padding: 10px 12px; color: var(--fg-0); font-family: var(--font-sans); font-size: 13.5px; line-height: 1.5;
    resize: none; outline: none; box-sizing: border-box; }
  .atr-textarea:focus { border-color: var(--line-3); }

  /* responsive: tuck sidebar on small screens */
  @media (max-width: 760px) {
    .atr-hint { left: 12px; font-size: 11.5px; }
    .atr-drawer, .atr-chat { width: calc(100vw - 24px); }
  }

  /* ===== mobile shell ===== */
  .atr-mtopbar { position: absolute; top: 0; left: 0; right: 0; height: 52px; z-index: 36;
    display: flex; align-items: center; gap: 10px; padding: 0 14px;
    background: rgba(10,10,10,0.78); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line-1); }
  .atr-mtabbar { position: absolute; bottom: 0; left: 0; right: 0; height: 60px; z-index: 37;
    display: flex; align-items: stretch; padding-bottom: env(safe-area-inset-bottom, 0);
    background: rgba(12,12,12,0.92); backdrop-filter: blur(16px); border-top: 1px solid var(--line-2); }
  .atr-mtab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    background: none; border: 0; cursor: pointer; color: var(--fg-3); font-family: var(--font-sans); font-size: 10px; font-weight: 500; }
  .atr-mtab.on { color: var(--accent); }
  .atr-mtab-ic { position: relative; display: inline-flex; }
  .atr-mtab-dot { position: absolute; top: -2px; right: -5px; width: 7px; height: 7px; border-radius: 50%; background: var(--cobalt); border: 1.5px solid #0c0c0c; }
  .atr-mtab-lb { line-height: 1; }
  .atr-msheet { position: absolute; left: 0; right: 0; top: 52px; bottom: 60px; z-index: 33;
    display: flex; flex-direction: column; background: var(--bg-0); animation: atr-slide-up 0.2s var(--ease-out); }
  .atr-msheet-head { display: flex; align-items: center; gap: 10px; height: 52px; flex: 0 0 auto; padding: 0 10px 0 16px;
    border-bottom: 1px solid var(--line-1); font-family: var(--font-display); font-size: 16px; font-weight: 500; color: var(--fg-0); }
  .atr-msheet-head > span:first-child { flex: 1; }
  .atr-msheet .atr-panel-body { flex: 1; }
  .atr-mzoom { position: absolute; right: 12px; bottom: 132px; z-index: 30; display: flex; flex-direction: column; gap: 6px; }
  .atr-mzoom button { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(15,15,15,0.9); backdrop-filter: blur(14px); border: 1px solid var(--line-2); border-radius: 50%; color: var(--fg-1); cursor: pointer; }
  .atr-mmedia { position: absolute; bottom: 74px; left: 50%; transform: translateX(-50%); z-index: 30;
    display: flex; gap: 8px; padding: 7px 8px; background: rgba(15,15,15,0.9); backdrop-filter: blur(14px);
    border: 1px solid var(--line-2); border-radius: var(--radius-pill); box-shadow: var(--shadow-2); }
  /* mobile: chat dock fills the sheet area */
  .atr-mobile .atr-worldchat { left: 0 !important; right: 0 !important; top: 52px !important; bottom: 60px !important;
    width: auto !important; border-radius: 0 !important; border-left: 0; border-right: 0; z-index: 33; }
  .atr-mobile .atr-worldchat .atr-wc-circ[data-tip="Minimize"] .msi::before { content: 'close'; }
  .atr-mobile .atr-drawer { top: 60px; bottom: auto; max-height: calc(100vh - 132px); overflow-y: auto; }
