  /* Room canvas pixel size -- defaults to the classic 512x384 Palace room; set to a
     larger size via JS (updateRoomFrameSize in room-nav.js) when the current room's
     background exceeds that (roomdimensions.json on the server). Every element that
     used to be hardcoded to 512px/384px below now tracks these instead. */
  html { --room-w: 512px; --room-h: 384px; }
  html { scrollbar-gutter: stable; }
  body { font-family: -apple-system, Segoe UI, Helvetica, Arial, sans-serif; background:#222; color:#eee; margin:0; overflow-x:hidden; }
  .layout { display:flex; gap:0; align-items:flex-start; }
  .sidebar { position:sticky; top:0; width:300px; flex-shrink:0; background:#222222; padding:16px;
              height:100vh; overflow:hidden; box-sizing:border-box;
              display:flex; flex-direction:column;
              border-right:1px solid #333; }
  /* Inner scroll region -- content scrolls here while .footer stays pinned as a
     non-scrolling flex child at the bottom, so the version/email footer can
     never overlap a long worn-props / controls list. */
  .sidebar-content { flex:1 1 auto; min-height:0; overflow-y:auto; scrollbar-gutter:stable; }
  .sidebar h3 { margin:18px 0 8px; font-size:12px; text-transform:uppercase; color:#888; letter-spacing:.05em; }
  .sidebar h3:first-child { margin-top:0; }
  .sidebar-header { display:flex; align-items:center; gap:8px; margin-bottom:12px; }
  .sidebar-header .title { flex:1; font-size:12px; color:#888; text-transform:uppercase; letter-spacing:.05em;
                             text-align:center; }
  .sidebar.collapsed { width:56px; padding:12px 8px; overflow:visible; }
  .sidebar.collapsed .sidebar-header { flex-direction:column; gap:10px; margin-bottom:0; }
  .sidebar.collapsed .sidebar-header .title { display:none; }
  .sidebar.collapsed .sidebar-content { display:none; }
  .iconbtn { width:32px; height:32px; border:none; padding:0; cursor:pointer; image-rendering:pixelated;
              background-size:contain; background-repeat:no-repeat; background-position:center;
              background-color:transparent; flex-shrink:0; }
  .iconbtn:disabled { cursor:default; opacity:.4; }
  #sidebarToggleBtn { background-image:url(data:image/gif;base64,R0lGODdhIAAgAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAAIAAgAAAI/wBFCBxIsKDBgwgTKlyIcEYVRLuYueu2C1GVGQwPzkDE7J/HfxMnUrxDJOPAO+4+enTHsls3Zrt2ZTKTccYulR9bvoypquedhTM6/nOpsqWqO3cy9cyEiGZCoarMqCrqjhkijGaUMr1TBeHUf8yIzPia0ypGIogybTVTsqCZj6ocdsNZ9WoEIkkRNTXTteBckIiIZMI5lFmmiw/X8sV4MqcqRH/Lwmx6Ry+iO3zFEiQLMiXOnbtUMdWLtMpFxiKIpGTp+TMzmD1Fk86MWkQV1rhzgo6t9jLmKpoHmtHZjfjupVt/E2k7ELLL5y5fwwyN3LeZxbVFcGT2XPp06qKT84QFnl2799cx0yMXT7t8lfTweVa33l4j+NjrLWO+Tr68wBlK4RfeaPSZJpZ/J6mlIIG+7WfgDAgOhNZlZiBlIVL8AXegQBFEkFCFpxFh2ogaQjhQhwB42BBfInSYUIcoApCiQiKKBaOMOOaYo4o0LtcWjBHoKKOLJkFopElIJqnkkkwuGRAAOw==); }
  #sidebarToggleBtn:active { background-image:url(data:image/gif;base64,R0lGODdhIAAgAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAAIAAgAAAI/wBFCBxIsKDBgwgTKlyIkMidXf8iRtx1pwrDg1WYSdy4UZXFiwJVcRwpsVumGQyJkFz5z103VSgTqmQZ0Z2qTN1adtt1sqFEd4jckdxVZQaibi53qUKEUGhEMzNH7iIyw8yubsx4ZjITcyCikg5XThVR5WrWTIjudBUxYyOzjCu73XG4K+vNtEQIZtroDiJLZplUMbOb6Y6Zj2yd0uSLdZdStBWpCjSzeKQ7l3bTHu56pzLjxncNU52Bcq9nnaAhHx6N0m9ll6BDV2GNUjHNy7FVFyVNWoTrlbhza57Nu/dX4MHthl5dvHcVksEbP9ZNu2sVpJezd8OaVend4dW7znPAyZ17d1U3IRsm3rz35Lo30ctHr94M84HFCY5XNZeImTsABmhfFcQNFEEEvBlURWF5IdhebwceCEAEbLmnnxmIQCVChBxGCMCHHzq4VkH2rZaXQBGAqCKFFS5ExIswWmhQggw9aCONIFV4o4w5CmTjRQEBADs=); }
  #propbagToggleBtn { background-image:url(data:image/gif;base64,R0lGODlhIAAgALMAAFVVVd3d3YiIiP///3d3d6qqqkRERBEREQAAACIiIgAAAAAAAAAAAAAAAAAAAAAAACH5BAAAAAAALAAAAAAgACAAAATwMMlJZZko58r7vFqoeaSViOh0lJWxdSNyzCt7IlQsETxtowieMFEoGI4+j0hIKBqPUEkSk2ESi4lBIsqZ3oTOy9Zgm4qwEnIn0JlJDyFiKQAAUGi17Wwk9tDtCXhJNHxzdYEre3l7hSQBbkeBGXkGcI1tBwSRIgdqlZY4fSo0PBIonWmMoRd4BQICBKZAqHqgFgUHYbJAk56MblcgvKc1SBqqw8PFlcfIyZzLoJ2gz5yeLiHM1SE01yLa290UR9/UvN2R49ga4LMzXC3rGcbu8Bzk5cT2HvLz0u/pbOxCgATPPoGyPnUKiFDJPDUNJ0QAADs=); }
  #propbagToggleBtn:active { background-image:url(data:image/gif;base64,R0lGODlhIAAgAKIAAMzMzERERKqqqlVVVXd3d////yIiIjMzMyH5BAAAAAAALAAAAAAgACAAAAP2aLqsRfBI2apdxcw9r3cEJy7D1wiU1R1DW5rawaxQYbuweNg8YQtA3IXDKwKPAohwMSn6bD7CEUJVtma7IlSarHqtr1jzAel+yd6robWJfqkFAKDqCgvYEvfbJwfXFS4Tem9xcy0EbGF4eWiEh0CIEmEBA22NaQMFkBwDAgqUlYxfdVsinZ+LT4guTiE6pwaggk+ZPa46kp6xeIdPD7ivLwGUE4vAwMLEksbHnMmhLHfNuLDDHNLTGy661hvY2dsM3RPfyC1HDeMS5abnQBbqB0HUne8X8fLQxfW6HwEi37bZg6HA25066AhWWCewn8Ih6xw+NJAAADs=); }
  #stageWrap { background:#2c2c2c; border-radius:8px; padding:10px; text-align:center; overflow-x:auto; }
  /* Default legacy size; JS (syncAvatarStageCanvas) grows this for Modern props up to ~220px+. */
  #stage { width:132px; height:132px; max-width:100%; image-rendering:pixelated; background:#666; border-radius:4px; box-sizing:border-box; }
  #stage.transparent-bg { background: repeating-conic-gradient(#3a3a3a 0% 25%, #2c2c2c 0% 50%) 0 0/16px 16px; }
  .controlrow { display:flex; gap:6px; flex-wrap:wrap; margin-top:8px; align-items:center; }
  .rowspacer { width:1px; align-self:stretch; background:#3c3c3c; margin:0 4px; }
  .exportrow { display:flex; gap:6px; flex-wrap:wrap; margin-top:8px; align-items:center; }
  .zoombtn { padding:5px 10px; border-radius:4px; border:1px solid #555; background:#222; color:#eee;
              cursor:pointer; font-size:12px; }
  .zoombtn.sel { background:#555; border-color:#aaa; color:#fff; }
  .bgswatch { width:24px; height:24px; border-radius:4px; cursor:pointer; border:2px solid transparent; }
  .bgswatch.sel { border-color:#fff; }
  .bgswatch.neutral { background:repeating-conic-gradient(#888 0% 25%, #bbb 0% 50%) 0 0/8px 8px; }
  .exportrow select { padding:5px; border-radius:4px; background:#222; color:#eee; border:1px solid #555; font-size:12px; }
  .exportbtn { width:32px; height:19px; padding:0; border-radius:0; border:1px solid;
                border-color:#888 #333 #333 #888; background:#555; color:#fff;
                cursor:pointer; font-size:8px; line-height:17px; font-weight:600; }
  .exportbtn:hover { background:#666; }
  .exportbtn:active { border-color:#333 #888 #888 #333; background:#444; }
  .nakedbtn { width:32px; height:19px; background-image:url(data:image/gif;base64,R0lGODlhIAATAKIAAFVVVYiIiCIiIv///0RERAAAAAAAAAAAACH5BAAAAAAALAAAAAAgABMAAANmGLrc/osEQqu9OFMxtf9bB44XR56VOQ5rKn4sEWezKg8DQOE6GwM8AhDnqsRmspsRAJQxa6KjEOdL3ojSkHFn9fWsu2eRmxxWy8RpmmBDjdruDzyumdMx9rslr9+wBYCBgoOEhYAJADs=);
               background-size:contain; background-repeat:no-repeat; image-rendering:pixelated;
               border:1px solid; border-color:#888 #333 #333 #888; cursor:pointer; }
  .nakedbtn:active { background-image:url(data:image/gif;base64,R0lGODlhIAATAKIAAFVVVd3d3URERP///2ZmZgAAAAAAAAAAACH5BAAAAAAALAAAAAAgABMAAANhGLrc/osEQqu9OFMxtf9bB44XR56VOQ5rKn4sEWezKg8zTrExgAMEny5Uic1kt+JOBvC5lMgbL4rTGZ9L5HUAnBabNdFVSg0OhWEUyqYGsdueNzwjn5dedoxgz+/7/4B+CQA7);
                       border-color:#333 #888 #888 #333; background-color:#444; }
  .removefacecolorbtn { padding:5px 10px; border-radius:4px; border:1px solid #555; background:#222; color:#eee;
                          cursor:pointer; font-size:12px; }
  .removefacecolorbtn:hover { background:#333; }
  .removefacecolorbtn:active { background:#111; }
  .layerbtn.sel { background:#555; border-color:#aaa; color:#fff; }
  .layerbtn.sel:hover { background:#666; }
  #wornlist { display:flex; flex-direction:column; gap:4px; margin-top:6px; }
  .wornrow { display:flex; align-items:center; gap:8px; background:#2c2c2c; border-radius:4px; padding:4px 6px; font-size:12px; }
  .wornrow img { width:22px; height:22px; image-rendering:pixelated; }
  .wornrow .rm { margin-left:auto; cursor:pointer; color:#c77; background:none; border:none; font-size:14px; }
  #wornCount, #wornMax { color:#aaa; font-size:12px; }
  .macros-heading { margin-top:16px; display:flex; align-items:center; gap:6px; position:relative; }
  /* Info glyph via CSS mask, painted black (light plate so it reads on the dark sidebar). */
  .macros-info-btn {
    width:14px; height:14px; border:none; padding:0; cursor:pointer; flex-shrink:0;
    border-radius:50%; background:#e6e6e6; position:relative; z-index:31;
  }
  .macros-info-btn::after {
    content:""; position:absolute; inset:1px;
    background-color:#000; background-image:none;
    -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M8 1.25a6.75 6.75 0 100 13.5 6.75 6.75 0 000-13.5zM8 2.75a5.25 5.25 0 110 10.5A5.25 5.25 0 018 2.75z'/%3E%3Ccircle fill='%23000' cx='8' cy='5.15' r='1.05'/%3E%3Crect fill='%23000' x='7.15' y='6.9' width='1.7' height='4.5' rx='.45'/%3E%3C/svg%3E");
    mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M8 1.25a6.75 6.75 0 100 13.5 6.75 6.75 0 000-13.5zM8 2.75a5.25 5.25 0 110 10.5A5.25 5.25 0 018 2.75z'/%3E%3Ccircle fill='%23000' cx='8' cy='5.15' r='1.05'/%3E%3Crect fill='%23000' x='7.15' y='6.9' width='1.7' height='4.5' rx='.45'/%3E%3C/svg%3E");
    -webkit-mask-size:contain; mask-size:contain;
    -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat;
    -webkit-mask-position:center; mask-position:center;
  }
  .macros-info-btn:hover { background:#f2f2f2; }
  .macros-info-btn[aria-expanded="true"] { background:#fff; }
  .macros-hint { margin:4px 0 8px; font-size:11px; color:#999; line-height:1.35; }
  /* Floating thought balloon — no plate; ear dots aim at the (i) button.
     left/top are set in JS from the info button's offset. */
  .macros-info-balloon {
    position:absolute; left:0; top:0; width:210px; height:150px;
    z-index:30; margin:0; padding:0; background:transparent; overflow:visible;
    pointer-events:none;
  }
  .macros-info-balloon.hidden { display:none; }
  .macros-info-balloon canvas { display:block; width:210px; height:150px; }
  .macros-info-balloon-text {
    position:absolute; left:34px; top:42px; width:142px; margin:0; padding:0;
    font:bold 11px/1.4 Tahoma,"MS Sans Serif",Geneva,sans-serif;
    color:#2d2a10; text-align:center; pointer-events:none;
  }
  .macros-keys { display:flex; flex-wrap:wrap; gap:5px 4px; padding:2px 0 10px; }
  /* Tactile keycap — cool gray for dark sidebar.
     Outer box is ~28×28; ::after borders must equal that size or the bevel clips. */
  .macrobtn {
    appearance:none; -webkit-appearance:none;
    box-sizing:content-box; border:none; cursor:pointer; user-select:none;
    position:relative; isolation:isolate; overflow:hidden;
    width:16px; height:8px; padding:10px 6px; border-radius:4px;
    flex:0 0 auto;
    text-align:center; font:bold 8px Arial, sans-serif; line-height:8px;
    color:#6e6e6e; background:transparent;
    transition:box-shadow .02s cubic-bezier(.79,.03,.43,1);
    box-shadow:inset 0 0 0 0 #2e2e2e, 0 0 0 1px #2e2e2e, 0 6px 4px 0 rgba(0,0,0,.28);
  }
  .macrobtn:hover { color:#555; }
  .macrobtn:active {
    transition:box-shadow .1s cubic-bezier(0,0,0,1);
    box-shadow:inset 0 0 2px 0 #2e2e2e, 0 0 0 1px #2e2e2e, 0 4px 4px 0 rgba(0,0,0,.22);
  }
  .macrobtn::before {
    content:""; position:absolute; z-index:-1;
    left:4px; top:4px; width:20px; height:20px; border-radius:2.5px;
    box-shadow:0 -1px 0 0 #d4d4d4, 0 1px 0 0 #7a7a7a;
    background:linear-gradient(0deg, #cfcfcf, #a8a8a8);
    transition:background .02s cubic-bezier(.79,.03,.43,1);
  }
  .macrobtn:active::before {
    background:linear-gradient(0deg, #c4c4c4, #949494);
    transition:background .1s cubic-bezier(0,0,0,1);
  }
  .macrobtn::after {
    content:""; position:absolute; z-index:-2; left:0; top:0;
    filter:blur(.5px);
    /* 14+14=28 — matches ~28×28 outer box */
    border-top:14px solid #dcdcdc;
    border-bottom:14px solid #6e6e6e;
    border-left:14px solid #b0b0b0;
    border-right:14px solid #b0b0b0;
  }
  /* Set macros: sage-tinted keycap (keeps “filled” signal from before). */
  .macrobtn.set { color:#4a6352; }
  .macrobtn.set:hover { color:#3a5242; }
  .macrobtn.set::before {
    background:linear-gradient(0deg, #c5d4c8, #9aaf9e);
    box-shadow:0 -1px 0 0 #d8e4dc, 0 1px 0 0 #6a8070;
  }
  .macrobtn.set:active::before {
    background:linear-gradient(0deg, #b8cabc, #8a9f8e);
  }
  .macrobtn.set::after {
    border-top-color:#d0ddd4;
    border-bottom-color:#6a7a68;
    border-left-color:#b0c0b4;
    border-right-color:#b0c0b4;
  }
  .footer { text-align:center; flex:0 0 auto; background:#222222;
             margin-top:10px; padding-top:10px; border-top:1px solid #333;
             font-size:10px; color:#666; }
  .contact { font-size:10px; margin-bottom:6px; }
  .contact a { color:#8ab; text-decoration:none; }
  .contact a:hover { text-decoration:underline; color:#adf; }
  .main { flex:1; min-width:0; background:#444444; }
  .main.collapsed { display:none; }
  .toolbar { position:sticky; top:0; background:#3a3a3a; padding:10px 14px; display:flex; gap:8px;
              align-items:center; flex-wrap:wrap; box-shadow:0 2px 6px rgba(0,0,0,.4); z-index:10; }
  .toolbar .search-input { padding:6px 10px; border-radius:4px; border:1px solid #555; background:#222; color:#eee; min-width:200px; }
  .chip { display:inline-flex; align-items:center; gap:5px; padding:5px 10px; border-radius:14px;
           border:1px solid #555; background:#2a2a2a; color:#aaa; font-size:12px; white-space:nowrap;
           cursor:pointer; user-select:none; }
  .chip input { accent-color:#6a9; margin:0; }
  .chip:has(input:checked) { background:#345; border-color:#6a9; color:#dff0ff; }
  #propsCount { margin-left:4px; font-size:11px; color:#888; white-space:nowrap; }
  .sidebar-header #sidebarToggleBtn { margin-left:auto; }
  .sidebar.collapsed .sidebar-header #sidebarToggleBtn { margin-left:0; }
  .grid { display:flex; flex-wrap:wrap; gap:8px; padding:14px; align-content:flex-start; background:#222; }
  .card { position:relative; background:#2c2c2c; border-radius:6px; padding:8px; display:flex; gap:8px;
           align-items:flex-start; cursor:pointer; outline:1px solid transparent; flex:0 0 auto;
           transition:padding .12s ease; }
  .card:hover { background:#343434; }
  .card.worn {
    outline:1px solid #fff;
    background:#3a3a3a;
  }
  .thumb { width:44px; height:44px; image-rendering:pixelated; flex-shrink:0;
            background:transparent; border-radius:3px; pointer-events:none; }
  .thumb.err { display:flex; align-items:center; justify-content:center; color:#a55; font-size:20px; font-weight:bold; }
  .meta { font-size:11px; line-height:1.5; overflow:hidden; max-width:140px; }
  .meta.forcehide { display:none !important; }
  .meta.forceshow { display:block !important; }
  .grid.hidemeta .meta { display:none; }
  /* Prop names stay hidden until Option/Alt is held (same as Modern / room tags). */
  .card > .name {
    display:none; align-self:center; max-width:120px; margin:0;
    font-size:12px; font-weight:600; color:#eee; word-break:break-word;
  }
  body.alt-labels-visible .card > .name { display:block; }
  .muted { color:#999; }
  .warn { color:#e0a030; }
  .errtext { color:#e07070; }
  .badge { display:inline-block; background:#39506b; color:#cfe3ff; border-radius:3px; padding:1px 6px;
            margin:2px 3px 0 0; font-size:10px; }
  .card[data-err="1"] { outline:1px solid #663333; cursor:default; }
  .infobtn { position:absolute; top:4px; right:4px; width:16px; height:16px; border-radius:50%;
              background:#444; color:#ccc; border:none; font-size:10px; cursor:pointer; line-height:16px; padding:0; }
  .grid:not(.hidemeta) .infobtn { display:none; }
  .hidden { display:none !important; }
  #toast { position:fixed; bottom:20px; left:50%; transform:translateX(-50%) translateY(20px);
            background:#222; color:#eee; border:1px solid #567; padding:10px 18px; border-radius:6px;
            font-size:13px; opacity:0; pointer-events:none; transition:opacity .2s ease, transform .2s ease;
            z-index:100; box-shadow:0 4px 12px rgba(0,0,0,.5); }
  #toast.show { opacity:1; transform:translateX(-50%) translateY(0); }

  /* ---- "New version available" reload banner (non-blocking, dismissible) ---- */
  #updateBanner { position:fixed; left:50%; bottom:16px;
    transform:translateX(-50%); z-index:2000; display:flex; align-items:center;
    gap:12px; background:#1d2b1d; border:1px solid #3a5a3a; border-radius:8px;
    padding:8px 10px 8px 14px; box-shadow:0 6px 24px rgba(0,0,0,.5);
    font-size:13px; color:#dfe; max-width:92vw; }
  #updateBanner .update-reload { border:1px solid #4a7; background:#2a5a2a;
    color:#dff; padding:4px 12px; border-radius:5px; cursor:pointer;
    font-size:12px; font-weight:600; }
  #updateBanner .update-reload:hover { background:#367036; }
  #updateBanner .update-dismiss { border:none; background:transparent;
    color:#9ab; cursor:pointer; font-size:18px; line-height:1; padding:0 4px; }
  #updateBanner .update-dismiss:hover { color:#fff; }

  .hiddeninput { display:none; }
  #emptyState { display:flex; flex:1; flex-direction:column; align-items:center; justify-content:center;
                gap:16px; padding:30px; text-align:center; color:#999; }
  #emptyState img { width:64px; height:64px; image-rendering:pixelated; opacity:.85; }
  #emptyState p { max-width:420px; font-size:15px; line-height:1.5; margin:0; }
  .modal-bigbtn-secondary { margin-top:8px; background:#2a2a2a; border-color:#555; color:#ccc; }
  .modal-bigbtn-secondary:hover:not(:disabled) { background:#384450; }
  .modal-bigbtn:disabled { opacity:.45; cursor:default; }
  .exportbagbtn { padding:6px 14px; border-radius:4px; border:1px solid #567; background:#2a2a2a;
                  color:#dff0ff; cursor:pointer; font-size:12px; font-weight:600; }
  .exportbagbtn:hover { background:#384450; }
  /* In a live multiplayer session, hide prop-picker controls that don't apply. */
  body.mp-live #q,
  body.mp-live #metaChip,
  body.mp-live #bagChip,
  body.mp-live #animChip,
  body.mp-live #errChip,
  body.mp-live #exportBagBtn { display:none; }
  .helplinkrow { display:flex; justify-content:center; margin-top:14px; }
  .helplinkrow a { display:inline-block; line-height:0; }
  .helplinkrow img { width:32px; height:32px; image-rendering:pixelated; }
  .collapsed-footer { display:none; position:absolute; bottom:12px; left:0; right:0;
                       flex-direction:column; align-items:center; gap:10px; }
  .sidebar.collapsed .collapsed-footer { display:flex; }
  .collapsed-footer a { display:block; line-height:0; }
  .collapsed-footer img { width:28px; height:28px; image-rendering:pixelated; }
  #loadingOverlay { position:fixed; inset:0; background:rgba(10,10,12,.88); z-index:1000;
                    display:flex; align-items:center; justify-content:center; }
  #loadingOverlay.hidden { display:none; }
  .loadingbox { background:#222; border:1px solid #456; border-radius:10px; padding:28px 36px;
                text-align:center; max-width:420px; box-shadow:0 8px 30px rgba(0,0,0,.5); }
  .loadingspinner { width:36px; height:36px; margin:0 auto 16px; border-radius:50%;
                     border:4px solid #345; border-top-color:#8cf; animation:loadspin 0.9s linear infinite; }
  @keyframes loadspin { to { transform:rotate(360deg); } }
  #loadingTitle { font-size:15px; font-weight:600; color:#dff0ff; margin-bottom:6px; }
  #loadingDetail { font-size:12px; color:#9ab; }
  .footer { text-align:center; }
  .disclaimer { font-size:9px; color:#555; line-height:1.4; margin-bottom:6px; }
  .version { font-size:10px; color:#666; }
  .modal-backdrop { position:fixed; inset:0; background:rgba(10,10,12,.78); z-index:1000;
                     display:flex; align-items:center; justify-content:center; }
  .modal-backdrop.hidden { display:none; }
  /* psConfirm (confirm-prompt.js) is invoked from all over the app -- including from inside
     the prop editor's own overlay stack (.prop-editor-backdrop z-index:12000, .pce-pixelize-
     backdrop z-index:12500) and the modern-avatar right-click menu (z-index:100000) -- so its
     shared #psConfirmModal must always render above every other stacking context in the app,
     not just the base .modal-backdrop z-index:1000 it would otherwise inherit. Without this,
     e.g. clicking Cancel in the prop editor rendered the confirm dialog BEHIND the editor,
     making it unusable. Keep this above the highest z-index anywhere else in the app. */
  #psConfirmModal { z-index:200000; }
  .modal-box { position:relative; background:#262626; border:1px solid #456; border-radius:10px;
               padding:24px 26px; width:340px; max-width:90vw; max-height:80vh; overflow-y:auto;
               box-shadow:0 8px 30px rgba(0,0,0,.5); }
  .modal-box h3 { margin:0 0 16px; font-size:15px; color:#dff0ff; text-align:center; }
  #introModal h3 { color:#e08a8a; }
  #introModal .modal-box { border:1px solid #e08a8a; }
  .modal-close { position:absolute; top:10px; right:10px; width:24px; height:24px; border-radius:50%;
                 background:#383838; color:#ccc; border:none; font-size:15px; cursor:pointer; line-height:24px;
                 padding:0; }
  .modal-close:hover { background:#484848; }
  /* Visual chrome (background/border/title-bar gradient/close-button look) is
     intentionally NOT set here anymore -- it comes from the classic-stylesheets
     theme (dialog-classic-themes.generated.css) via the .window/.title-bar/
     .window-body classes on this element, scoped by body[data-dialog-os].
     Only structural/behavioral rules (position, sizing, drag cursor, click-
     through) that classic-stylesheets doesn't know about stay here. */
  #connectModal { position:fixed; z-index:1000; width:max-content; min-width:420px; max-width:90vw; user-select:none; }
  #connectModal.hidden { display:none; }
  #connectModal .pp-title { cursor:move; }
  #connectModal .pp-title-text { pointer-events:none; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  #connectModal .modal-box { position:static; width:auto; max-width:none; border:none; border-radius:0;
    box-shadow:none; max-height:70vh; padding:12px 14px 14px; }
  #connectModal .conn-user-row select { flex:1; padding:5px 8px; border-radius:4px; border:1px solid #555;
    background:#1a1a1a; color:#eee; font-size:12px; }
  .modal-bigbtn { display:block; width:100%; padding:10px 14px; border-radius:6px; border:1px solid #567;
                  background:#345; color:#dff0ff; cursor:pointer; font-size:13px; font-weight:600; }
  .modal-bigbtn:hover { background:#456; }
  .modal-bigbtn-naked { display:block; width:100%; padding:10px 14px; border-radius:0; border:none;
                        border-top:1px solid #aaa; border-left:1px solid #aaa;
                        border-bottom:1px solid #222; border-right:1px solid #222;
                        background:#555; color:#fff; cursor:pointer; font-size:13px;
                        font-family:"Pixelify Sans", sans-serif; font-optical-sizing:auto; font-weight:700;
                        font-style:normal; }
  .modal-bigbtn-naked:hover:not(:disabled) { background:#666; }
  .modal-bigbtn-naked:active:not(:disabled) { border-top-color:#222; border-left-color:#222;
                                               border-bottom-color:#aaa; border-right-color:#aaa; }
  .modal-bigbtn-naked:disabled { opacity:.45; cursor:default; }
  #signInFormFields .modal-bigbtn-naked + .modal-bigbtn-naked { margin-top:8px; }
  .modal-divider { text-align:center; font-size:11px; color:#888; margin:16px 0 10px;
                    text-transform:uppercase; letter-spacing:.05em; }
  .example-list { display:flex; flex-direction:column; gap:6px; margin-top:12px; }
  .example-item { padding:8px 12px; border-radius:6px; border:1px solid #555; background:#2c2c2c;
                  color:#dde; cursor:pointer; font-size:12px; text-align:left; }
  .example-item:hover { background:#384450; border-color:#789; }
  .example-status { font-size:12px; color:#888; text-align:center; padding:8px 0; }
  .connect-directory-tabs { display:flex; flex-wrap:nowrap; align-items:flex-end; gap:2px; margin-top:16px;
    border-bottom:1px solid #777; }
  .connect-directory-tab { position:relative; top:1px; padding:6px 12px; border:1px solid #555;
    border-bottom-color:#777; border-radius:5px 5px 0 0; background:#333; color:#aaa;
    cursor:pointer; font:600 12px "Pixelify Sans", sans-serif; white-space:nowrap; }
  .connect-directory-tab:hover { background:#444; color:#eee; }
  .connect-directory-tab.active { z-index:1; background:#262626; color:#fff; border-color:#888;
    border-bottom-color:#262626; }
  .connect-directory-panel { min-height:240px; max-height:600px; overflow-y:auto;
    padding-top:8px; }
  .connect-directory-panel.hidden { display:none; }
  .serverlist-json-link { display:block; margin-top:10px; font-size:11px;
    color:#6cf; text-decoration:underline; }
  .serverlist-json-link:hover { color:#9df; }
  .server-item { display:block; width:100%; }
  .favorite-item-row { display:flex; align-items:stretch; gap:6px; }
  .favorite-item-row .favorite-item { flex:1; min-width:0; }
  .favorite-remove-btn {
    flex:0 0 auto; align-self:center; width:22px; height:22px; border-radius:4px;
    border:1px solid #555; background:#2c2c2c; color:#999; cursor:pointer; font-size:14px; line-height:1;
  }
  .favorite-remove-btn:hover { background:#4a2a2a; border-color:#a55; color:#f88; }
  .server-item-main { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; min-width:0; flex:1; }
  .server-item-body { min-width:0; flex:1; }
  .server-item-name-row { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
  .server-item-name { font-size:13px; font-weight:700; color:#e8f0ff; min-width:0; line-height:1.25; }
  .server-item-stats { flex:0 0 auto; display:flex; flex-direction:column; align-items:flex-end;
    gap:1px; line-height:1.2; }
  .server-item-users, .server-item-rooms { font-size:13px; font-weight:700; color:#e03333;
    font-variant-numeric:tabular-nums; white-space:nowrap; }
  .server-item-sysop { font-size:11px; color:#9ab; margin-top:1px; font-style:italic; line-height:1.25; }
  .server-item-blurb { font-size:11px; color:#aaa; margin-top:2px; line-height:1.35; }
  .user-space-item-guests-blocked {
    position: relative;
    opacity: 0.72;
  }
  .user-space-item-guests-blocked::after {
    content: '';
    position: absolute;
    inset: 4px 6px;
    pointer-events: none;
    background:
      linear-gradient(to top left,
        transparent calc(50% - 1.5px), #e03333 0, #e03333 calc(50% + 1.5px), transparent 0),
      linear-gradient(to top right,
        transparent calc(50% - 1.5px), #e03333 0, #e03333 calc(50% + 1.5px), transparent 0);
  }
  .user-space-item-guests-blocked .server-item-name {
    text-decoration: line-through;
    text-decoration-color: #e03333;
  }
  .help-modal-box { width:640px; max-width:92vw; max-height:85vh; overflow:hidden;
                     display:flex; flex-direction:column; }
  /* .help-content no longer sits directly inside .help-modal-box (it's now
     nested one level deeper, inside .retro-body/.window-body, since these
     modals gained a real title-bar). Pass flex-grow + scrolling down through
     that wrapper so .help-content's own flex/overflow rules still apply. */
  .help-modal-box .retro-body { flex:1 1 auto; overflow:hidden; display:flex; flex-direction:column; min-height:0; }
  .help-content { flex:1 1 auto; overflow-y:auto; min-height:0; margin-top:4px; padding-right:6px; }
  .help-content h2 { font-size:16px; color:#dff0ff; margin:18px 0 8px; }
  .help-content h2:first-child { margin-top:0; }
  .help-content h3 { font-size:13px; color:#cde; margin:14px 0 6px; }
  .help-content p { font-size:13px; color:#ccc; line-height:1.6; margin:0 0 10px; }
  .help-content ul, .help-content ol { margin:0 0 10px 20px; padding:0; font-size:13px; color:#ccc; line-height:1.6; }
  .help-content li { margin-bottom:4px; }
  .help-content img { max-width:100%; border-radius:4px; margin:8px 0; display:block; }
  .help-content strong { color:#fff; }
  .help-content code { background:#1a1a1a; border-radius:3px; padding:1px 5px; font-size:12px; color:#9ec; }
  .help-content a { color:#8cf; text-decoration:underline; }
  .help-content hr { border:none; border-top:1px solid #444; margin:16px 0; }
  .room-sim { background:#222222; padding:14px 16px 18px; }
  .room-sim.hidden { display:none; }

  /* ---- Layout toggle button in the toolbar ---- */
  .layout-toggle-btn { padding:4px 6px; border-radius:4px; border:1px solid #567; background:#2a2a2a;
                        color:#9ab; cursor:pointer; line-height:0; vertical-align:middle; flex-shrink:0; }
  .layout-toggle-btn:hover:not(:disabled) { background:#384450; color:#dff0ff; }
  .layout-toggle-btn:disabled { opacity:.35; cursor:default; }

  /* ---- Tabs dock toggle (move Log/Sounds/Rooms/Prefs/Debug to right column) ---- */
  .tabs-dock-toggle-btn { margin-left:auto; padding:3px 5px; border-radius:4px; border:1px solid #567;
                            background:#2a2a2a; color:#9ab; cursor:pointer; line-height:0; flex-shrink:0; }
  .tabs-dock-toggle-btn:hover:not(:disabled) { background:#384450; color:#dff0ff; }
  .tabs-dock-toggle-btn:disabled { opacity:.35; cursor:default; }
  .tabs-dock-toggle-btn.on { background:#345; border-color:#6a9; color:#dff0ff; }

  /* ---- Column layout (default): simulator is sticky so it stays put while the
     prop grid scrolls beneath it. Works on any screen width. ---- */
  .layout-row-mode #roomSim { display:none; } /* handled below; this is the column default */

  .main { flex:1; min-width:0; background:#444444; }
  #roomSim { position:sticky; top:0; z-index:20; }

  /* ---- Row layout: simulator becomes a fixed-width side panel; only the
     prop picker scrolls. Applied via .row-layout class on .layout. ---- */
  .row-layout { overflow:hidden; height:100vh; align-items:stretch; }

  /* Toolbar height in row-layout (bottom prop picker) - prevent spacer collapse */
  .row-layout .pal-toolbar { height: 100vh; }
  .row-layout .main { display:flex; flex-direction:row; overflow:hidden; align-items:stretch; }
  /* Fixed-width side panel -- deliberately NOT tied to --room-w: a larger room's canvas
     is fitted (shrunk to fit if needed, see fitRoomFrameToViewport in ui-shell.js) to
     whatever space is available INSIDE this panel, rather than growing the panel itself,
     which would eat into #rightCol's prop-picker space. */
  /* position:relative (not static) so a docked-but-covered simulator can still raise its
     z-index above an overlapping floating window (see bringWindowToFront in panel-detach.js) --
     static elements ignore z-index entirely. */
  .row-layout #roomSim { position:relative; width:544px; max-width:100%; flex-shrink:0; overflow-y:auto;
                           border-right:1px solid #333; }
  .row-layout #rightCol { flex:1; min-width:0; display:flex; flex-direction:column; overflow:hidden; }
  /* overflow:hidden (not auto): scroll lives in the Legacy/Modern grids so the
     Props header + Naked toolbar stay pinned while browsing mid-list. */
  .row-layout #propViewerArea { flex:1; min-width:0; min-height:0; overflow:hidden; }
  .row-layout #propViewerArea.hidden { display:none; }
  /* Prop picker hidden -> nothing left to protect its space from, so let the simulator
     grow to fill #main instead of staying pinned to the fixed 544px panel width (fed
     into fitRoomFrameToViewport in ui-shell.js via #roomSim.clientWidth, so the room
     itself scales up to use the freed space too, not just this panel). */
  .row-layout .main:has(#propViewerArea.hidden),
  .row-layout .main:has(#propViewerArea.floating) { justify-content:center; }
  .row-layout .main:has(#propViewerArea.hidden) #roomSim,
  .row-layout .main:has(#propViewerArea.floating) #roomSim { border-right:none; flex:1 1 auto; width:auto; }
  /* When the prop picker floats it leaves the flow (position:fixed) but #rightCol keeps
     its flex:1 -- an empty column that would hold open dead gray space to the right of
     the (now centered) simulator. Collapse it so the simulator truly centers. Skipped
     when tabs are docked into #rightCol, which still needs the space (handled below). */
  .row-layout:not(.tabs-stacked-right) .main:has(#propViewerArea.floating) #rightCol {
    flex:0 0 0; width:0; min-width:0; overflow:hidden;
  }
  .row-layout #roomSim.hidden { display:none; }
  .row-layout #roomSim.hidden ~ #rightCol { width:100%; }

  /* ---- Vertical splitter between the docked simulator and the prop bag (#rightCol) ----
     Only makes sense in row layout, with both actually sitting side by side -- hidden the
     moment either one leaves that arrangement (floats, detaches, is hidden, or the prop bag
     closes). All the exclusions live in this one selector's specificity so there's no fight
     with the #roomSim.hidden rule above over which display value wins. */
  #mainColSplitter { display:none; }
  .row-layout .main:not(:has(#roomSim.floating)):not(:has(#roomSim.hidden)):not(:has(#propViewerArea.floating)):not(:has(#propViewerArea.hidden)) #mainColSplitter {
    display:block; flex:0 0 6px; width:6px; cursor:col-resize; background:transparent;
  }
  #mainColSplitter:hover, #mainColSplitter.dragging { background:#4a90d9; }

  /* ---- Tabs stacked to the right: tabs panel moves into #rightCol above prop picker ---- */
  .tabs-stacked-right.row-layout #roomSim { overflow:hidden; }
  .tabs-stacked-right.row-layout .room-tabs {
    width:auto; margin:0; flex:1 1 50%; min-height:0; display:flex; flex-direction:column;
    overflow:hidden; border-left:1px solid #333; background:#222222;
  }
  .tabs-stacked-right.row-layout .room-tabs-bar { flex-shrink:0; padding:0 4px; }
  .tabs-stacked-right.row-layout .room-tab-content {
    flex:1; min-height:0; height:auto !important; overflow-y:auto;
  }
  .tabs-stacked-right.row-layout #rightCol:has(#propViewerArea.hidden) .room-tabs,
  .tabs-stacked-right.row-layout #rightCol:has(#propViewerArea.floating) .room-tabs { flex:1 1 100%; }

  /* ---- Horizontal splitter between the stacked tabs and the prop bag (#rightColSplitter) ----
     Only shown in the actual stacked arrangement -- hidden the moment either side of it leaves
     (prop bag hides/floats, or tabs get undocked from #rightCol entirely). */
  #rightColSplitter { display:none; }
  .tabs-stacked-right.row-layout #rightCol:not(:has(#propViewerArea.hidden)):not(:has(#propViewerArea.floating)) #rightColSplitter {
    display:block; flex:0 0 6px; height:6px; cursor:row-resize; background:transparent;
  }
  #rightColSplitter:hover, #rightColSplitter.dragging { background:#4a90d9; }

  /* ---- Mobile: force column layout regardless of saved preference ---- */
  @media (max-width:900px) {
    .row-layout { overflow:auto; height:auto; align-items:flex-start; }
    .row-layout .main { flex-direction:column; overflow:visible; }
    .row-layout #roomSim { position:sticky; top:0; width:auto; border-right:none;
                             overflow-y:visible; }
    .row-layout #rightCol { overflow:visible; }
    .row-layout #propViewerArea { overflow-y:visible; }
    .tabs-stacked-right.row-layout .room-tabs {
      flex:0 0 auto; max-height:50vh; min-height:200px; border-left:none;
    }
    .tabs-stacked-right.row-layout .room-tab-content { max-height:calc(50vh - 32px); }
  }
  #roomToggleBtn { background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADCElEQVR4AbxVCXarMAyc/IuhmzG+mXMy/ozAxAbaZnmtn2Xt0lg16T98tpbP0oFPAXza/yMAC5n9P5rCuxPI5vMMkDuIt4C8CsBNtuYL7veKiAoSIN8D8gqAbFxrxTwv6nYTAdMUiLgEkv6fjmcBZHM3csNSCqD+U8TOUwYQUUFKAIwyhe+OZwBk83neyqhxROCuSfRUSEC7RiCigoTXjyCeAaCRA/57t1u68jRNsN4oIhAC1XA65hn6CUDe/qrQ/X4fzAbSDK9MIQGQXJRsEhv3PvrRjEkTKOTB+lAnPc6HNkp9vwQwup/XZnIP9nvYlRcEA1hCf7+tVD+FL8ff6rupCcua1v8ZWgyZ0hqQIoZ+BoBpCoBc3f0pk7+4opdfa+Bq5Nn0dkNyAPpAgS0PXpLNeur7JQCoAcg+ZpVlmvWsZ+GfzWdegliDgWyeCuH4iAqoBo6r65cAUj8GWVdyUdWigLJxV8zbdrd2qNxmdosIx9eI1XY4VQ4qDa8E4J9X0upOujNgE3nmLnAkhX0Zj3VlTYt9vwQwTZPtA2VBEg5e9MjeIedSNThUBvp+CeDwo7IjjYhMtf8dcnKrYVmUtV1Lcu4E0COyldQpqjVwRRGBuKCrWNugWtpoq++XAHpEJFW8Yp6XE0VUkADJrPXgAAmQQMQXubWCZOb1/RJAj8hBRl3KTS95JNtdwTEPSouPJMeUMuaVcoPtznFQ3y8B9IgcdHUL20inA45ptFnEKDtAAhHnKdhGUnHQf9Z7ch8JoEfkIKMtZbyFbU6wfyQg1BBYi0PLsaWc850n9/dfgYNc8PgGbHOy/TvJQAIRIarS1h3xBxPIVmoOEwDfWiy35VJ+cQLuQurcKJkO31xWxG9PwE2ghgMB8M3FkpfyyxPABQDfHFrmV2+IpLw4fwUNub0OqhGn3wBsy/4UXasnGWsNnesu5TCBCJCEVx+Xn6GNWH3IZdlkZeM1whpaEdjeEx6rxcJ+aJmbJO570xMACWijLXLVyZE3vzl59pH2jHbyoa9e6ZvN+n8AAAD//wMDTjwAAAAGSURBVAMA3nN0P9tr4gIAAAAASUVORK5CYII=); border-radius:3px; }
  .room-frame { position:relative; width:var(--room-w); max-width:100%; margin:0 auto; }
  /* height:auto lets the canvas's intrinsic width/height attributes (set to the
     room's real pixel size in JS) drive its aspect ratio, so native-size rooms that
     get shrunk by max-width:100% scale down without distortion. */
  #roomCanvas { width:var(--room-w); max-width:100%; height:auto; display:block; image-rendering:pixelated; background:#000; cursor:default; }
  .room-canvas-interactive { cursor:pointer !important; }
  .room-statusbar { width:var(--room-w); max-width:100%; height:14px; background:#2a2a2a; color:#ddd; font-size:10px;
                     display:flex; align-items:center; justify-content:space-between; padding:0 4px;
                     box-sizing:border-box; font-family: Geneva, Verdana, sans-serif; white-space:nowrap;
                     margin:0 auto; }
  .room-statusbar .rsb-center { flex:1; text-align:center; overflow:hidden; }
  .room-statusbar .rsb-link { color:#6cb2ff; text-decoration:underline; cursor:pointer; }
  .room-statusbar .rsb-link:hover { color:#9ecbff; }
  /* Server-name slot doubles as the whisper indicator: clickable to defocus */
  .room-statusbar #rsbServerName.rsb-whisper { color:#fff; cursor:pointer; }
  .room-statusbar #rsbServerName.rsb-whisper:hover { text-decoration:underline; }
  /* Persistent Authoring Mode indicator -- stays visible the whole time the mode is on,
     not just a transient flash, so it's impossible to forget it's enabled (see authoring.js). */
  .room-statusbar .rsb-authoring { color:#ffb300; font-weight:bold; cursor:pointer; margin:0 4px; flex-shrink:0; }
  .room-statusbar .rsb-authoring:hover { text-decoration:underline; }
  .room-statusbar .rsb-authoring.hidden { display:none; }
  .room-input-row { width:var(--room-w); max-width:100%; height:26px; background:#444; margin:3px auto 0;
                     box-sizing:border-box; display:flex; align-items:stretch; }
  /* #emojiPickerBtn itself is sized/centered by emoji-picker.js's own injected styles
     (26x26, flex-centered) -- this just sizes the sunglasses.webp icon inside it. */
  .emoji-btn-icon { width:16px; height:16px; object-fit:contain; display:block; }
  .room-input-row input { flex:1 1 auto; min-width:0; height:100%; box-sizing:border-box; border:none; background:transparent;
                           color:#fff; font-size:12px; padding:0 6px; outline:none;
                           font-family: Geneva, Verdana, sans-serif; }
  .splash-overlay { position:absolute; inset:0; cursor:pointer; }
  /* Splash screens are pre-connect and always the classic 512x384 size -- not room-dimension dependent. */
  .splash-overlay img { width:512px; height:384px; image-rendering:pixelated; display:block; }
  .splash-cycle-btn { position:absolute; top:10px; padding:4px 10px; border-radius:4px; border:1px solid #555;
                       background:rgba(0,0,0,.55); color:#ccc; font-size:13px; cursor:pointer; z-index:2; }
  .splash-cycle-prev { left:10px; }
  .splash-cycle-next { right:10px; }
  .splash-cycle-btn:hover { background:rgba(0,0,0,.75); }
  .splash-cycle-btn.hidden { display:none; }

  /* Neon "Now" splash (index 0) -- sits in the same 512x384 frame as legacy artwork. */
  .splash-neon {
    --sn-bg: #050508;
    --sn-primary: #0ff;
    --sn-secondary: #f0f;
    --sn-tertiary: #ff0;
    --sn-text: #fff;
    --sn-dim: #667;
    position: relative;
    width: 512px;
    height: 384px;
    overflow: hidden;
    background: var(--sn-bg);
    color: var(--sn-text);
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
  }
  .splash-neon.hidden { display: none !important; }
  .splash-neon-scene {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
  }
  .splash-neon-grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
      linear-gradient(90deg, rgba(0, 255, 255, 0.04) 1px, transparent 1px),
      linear-gradient(rgba(0, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: splashNeonGridMove 20s linear infinite;
  }
  @keyframes splashNeonGridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(40px, 40px); }
  }
  .splash-neon-scanlines {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.12) 2px,
      rgba(0, 0, 0, 0.12) 4px
    );
  }
  .splash-neon-shapes {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
  }
  .splash-neon-shape {
    position: absolute;
    border: 1.5px solid;
    opacity: 0.22;
    animation: splashNeonFloat 10s ease-in-out infinite;
  }
  .splash-neon-shape-1 {
    width: 36px;
    height: 36px;
    top: 12%;
    left: 8%;
    border-color: var(--sn-primary);
    transform: rotate(45deg);
  }
  .splash-neon-shape-2 {
    width: 52px;
    height: 52px;
    top: 62%;
    right: 10%;
    border-color: var(--sn-secondary);
    border-radius: 50%;
    animation-delay: -2s;
  }
  .splash-neon-shape-3 {
    width: 28px;
    height: 28px;
    bottom: 18%;
    left: 16%;
    border-color: var(--sn-tertiary);
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    animation-delay: -4s;
  }
  @keyframes splashNeonFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
  }
  .splash-neon-corner {
    position: absolute;
    width: 36px;
    height: 36px;
    border: 1.5px solid var(--sn-primary);
    opacity: 0.35;
    z-index: 2;
    pointer-events: none;
  }
  .splash-neon-corner-tl { top: 10px; left: 10px; border-right: none; border-bottom: none; }
  .splash-neon-corner-tr { top: 10px; right: 10px; border-left: none; border-bottom: none; }
  .splash-neon-corner-bl { bottom: 10px; left: 10px; border-right: none; border-top: none; }
  .splash-neon-corner-br { bottom: 10px; right: 10px; border-left: none; border-top: none; }
  .splash-neon-body {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 16px 28px;
    text-align: center;
  }
  .splash-neon-badge {
    font-size: 0.55rem;
    letter-spacing: 3px;
    color: var(--sn-primary);
    text-transform: uppercase;
    margin-bottom: 8px;
    opacity: 0;
    animation: splashNeonFadeIn 0.8s ease 0.35s forwards;
  }
  .splash-neon-badge::before {
    content: '// ';
    color: var(--sn-secondary);
  }
  .splash-neon-title {
    margin: 0 0 10px;
    font-size: 2.05rem;
    font-weight: 900;
    line-height: 1.05;
  }
  .splash-neon-welcome {
    background: linear-gradient(135deg, var(--sn-primary) 0%, var(--sn-secondary) 50%, var(--sn-tertiary) 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: splashNeonGlow 3s ease-in-out infinite, splashNeonGradient 5s linear infinite;
    filter: drop-shadow(0 0 14px rgba(0, 255, 255, 0.45));
  }
  @keyframes splashNeonGradient {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
  }
  @keyframes splashNeonGlow {
    0%, 100% { filter: drop-shadow(0 0 14px rgba(0, 255, 255, 0.45)); }
    50% { filter: drop-shadow(0 0 28px rgba(255, 0, 255, 0.75)); }
  }
  .splash-neon-subtitle {
    margin: 0 0 18px;
    font-size: 0.62rem;
    color: var(--sn-dim);
    letter-spacing: 4px;
    text-transform: uppercase;
    opacity: 0;
    animation: splashNeonFadeIn 0.8s ease 0.7s forwards;
  }
  .splash-neon-btn-wrap {
    opacity: 0;
    animation: splashNeonFadeIn 0.8s ease 1.05s forwards;
  }
  .splash-neon-btn {
    display: inline-block;
    padding: 8px 22px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--sn-primary);
    border: 1.5px solid var(--sn-primary);
    border-radius: 3px;
    background: transparent;
    position: relative;
    overflow: hidden;
    transition: color 0.25s ease;
  }
  .splash-neon-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--sn-primary);
    transition: left 0.25s ease;
    z-index: -1;
  }
  .splash-neon-btn:hover {
    color: var(--sn-bg);
  }
  .splash-neon-btn:hover::before {
    left: 0;
  }
  @keyframes splashNeonFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .splash-neon-version,
  .splash-neon-time {
    position: absolute;
    bottom: 10px;
    z-index: 2;
    font-size: 0.52rem;
    letter-spacing: 1.5px;
    pointer-events: none;
  }
  .splash-neon-version {
    left: 12px;
    color: var(--sn-dim);
  }
  .splash-neon-time {
    right: 12px;
    color: var(--sn-primary);
  }
  .splash-neon-trail {
    position: absolute;
    width: 12px;
    height: 12px;
    border: 1.5px solid var(--sn-primary);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 4;
    opacity: 0;
  }
  .splash-neon-trail.on { opacity: 0.55; }
  .room-namecontrols-btn { padding:3px 10px; border-radius:4px; border:1px solid #555; background:#2a2a2a;
                            color:#ccc; font-size:11px; cursor:pointer; }
  .room-namecontrols-btn:hover { background:#384450; }
  .name-edit-popover { position:absolute; top:32px; left:0; z-index:5; background:#2a2a2a;
                        border:1px solid #567; border-radius:6px; padding:8px; display:flex; gap:6px; }
  .name-edit-popover.hidden { display:none; }
  .name-edit-popover input { background:#1a1a1a; border:1px solid #555; color:#eee; border-radius:4px;
                              padding:4px 6px; font-size:12px; width:140px; }
  .name-edit-popover button { padding:4px 10px; border-radius:4px; border:1px solid #567; background:#345;
                               color:#dff0ff; font-size:12px; cursor:pointer; }
  .reset-everything-btn { border-color:#644; background:#3a2424; color:#e8b8b8; }
  .reset-everything-btn:hover { background:#4a2c2c; }
  .room-info-popover { flex-direction:column; align-items:stretch; width:220px; }
  .room-info-popover label { font-size:11px; color:#9ab; margin-top:2px; }
  .room-info-popover input[type="text"] { width:100%; box-sizing:border-box; }
  .room-info-popover input[type="file"] { font-size:11px; color:#ccc; }
  .room-info-popover .room-info-actions { display:flex; gap:6px; margin-top:6px; }
  .room-info-popover .room-info-actions button { flex:1; }
  .intro-getstarted-btn { margin-top:14px; }
  .room-list-wrap { display:flex; gap:4px; height:100%; padding:4px; box-sizing:border-box; }
  .room-list { flex:1; overflow-y:auto; font-size:11px; color:#ccc; min-width:0; }
  .room-list-btns { display:flex; flex-direction:column; gap:4px; align-items:stretch; }
  .room-list-find { display:flex; flex-direction:row; align-items:center; gap:4px; justify-content:flex-end; }
  .room-list-find-input { width:120px; box-sizing:border-box; padding:3px 6px; border-radius:4px;
                           border:1px solid #555; background:#1a1a1a; color:#eee; font-size:11px; }
  .room-list-find-input:focus { outline:none; border-color:#6a9; }
  .room-list-find .room-namecontrols-btn.on { background:#345; border-color:#6a9; color:#dff0ff; }
  .sound-list-wrap { height:100%; padding:4px; box-sizing:border-box; overflow-y:auto; }
  .rlist-item { display:grid; grid-template-columns:36px minmax(0, 1fr) 40px 40px 110px; gap:4px; padding:2px 4px;
                cursor:pointer; border-radius:3px; user-select:none; }
  .rlist-item.rlist-reorderable { grid-template-columns:16px 36px minmax(0, 1fr) 40px 40px 110px; }
  /* Non-operators: hide room/user ID columns (see listViewerSeesIds). */
  .room-list.rlist-no-ids .rlist-item { grid-template-columns:minmax(0, 1fr) 40px 40px 110px; }
  .room-list.rlist-no-ids .rlist-item.rlist-reorderable { grid-template-columns:16px minmax(0, 1fr) 40px 40px 110px; }
  .room-list.rlist-no-ids .rlist-item.users-row { grid-template-columns:minmax(0,1fr) 52px minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) 32px; }
  .rlist-item:hover:not(.rlist-header) { background:#334; }
  .rlist-item.selected { background:#345; color:#dff0ff; }
  .rlist-item.rlist-header { cursor:default; color:#678; font-size:10px; border-bottom:1px solid #444;
                              padding-bottom:3px; margin-bottom:2px; border-radius:0;
                              position:sticky; top:0; z-index:1; background:#2c2c2c; }
  .rlist-item .rlist-id { color:#678; font-size:10px; }
  .rlist-item.selected .rlist-id { color:#9bc; }
  .rlist-item .rlist-name {
    display:flex; align-items:baseline; gap:4px; min-width:0; overflow:hidden; white-space:nowrap;
  }
  .rlist-item .rlist-name-text { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .rlist-item .rlist-artist { color:#678; font-size:10px; text-align:right; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  /* Users column: Ø (empty room) stays dim; an occupied room's count is highlighted. */
  .rlist-item .rlist-users { color:#678; font-size:10px; text-align:center; }
  .rlist-item .rlist-users.occupied { color:#9fd49f; }
  .rlist-item.rlist-header .rlist-users { color:#678; }
  .rlist-item .rlist-mph { color:#9ab0c8; font-size:10px; text-align:right; }
  .rlist-item.rlist-header .rlist-mph { color:#678; }
  /* Architect room reorder: grip handle is the only drag source (row stays clickable). */
  .rlist-item .rlist-handle {
    display:inline-flex; align-items:center; justify-content:center;
    width:16px; margin:0 -2px 0 -2px; color:#5a6a7a; border-radius:3px;
    cursor:grab; touch-action:none;
  }
  .rlist-item .rlist-handle-header { cursor:default; pointer-events:none; }
  .rlist-item .rlist-handle-icon { display:block; fill:currentColor; opacity:0.75; }
  .rlist-item:hover:not(.rlist-header) .rlist-handle,
  .rlist-item.selected .rlist-handle { color:#9ab0c8; }
  .rlist-item .rlist-handle:hover { color:#d0e4f8; background:rgba(255,255,255,0.06); }
  .rlist-item .rlist-handle:active { cursor:grabbing; }
  .room-list.rlist-reordering .rlist-item { cursor:grabbing; }
  .rlist-item.rlist-dragging { opacity:0.35; background:#2a3340; }
  .rlist-item.rlist-drag-over:not(.rlist-dragging) {
    box-shadow: inset 0 2px 0 0 #6aa8e0;
    background:#2f3a48;
  }
  .rlist-item.users-row { grid-template-columns:36px minmax(0,1fr) 52px minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) 32px; }
  .rlist-item .rlist-rank { color:#9ab0c8; font-size:10px; text-transform:capitalize; }
  .rlist-item .rlist-room { color:#9ab0c8; font-size:10px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .rlist-item .rlist-connected,
  .rlist-item .rlist-total { color:#9ab0c8; font-size:10px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .rlist-item.rlist-header .rlist-rank,
  .rlist-item.rlist-header .rlist-room,
  .rlist-item.rlist-header .rlist-connected,
  .rlist-item.rlist-header .rlist-total { color:#678; }
  .rlist-item.rlist-hidden { opacity: 0.55; }
  .rlist-item.rlist-closed:not(.rlist-hidden) { opacity: 0.75; }
  .rlist-item .rlist-status-tag,
  .rlist-item .rlist-hidden-tag { flex-shrink:0; font-style: italic; opacity: 0.85; color:#9ab0c8; }
  .slist-item { padding:2px 4px; cursor:pointer; border-radius:3px; font-size:11px; color:#ccc; }
  .slist-item:hover { background:#334; }
  .slist-item.selected { background:#345; color:#dff0ff; }
  .sound-list-wrap.sounds-disabled .slist-item { opacity:0.45; cursor:default; pointer-events:none; }

  /* ---- Tabbed panel under the room + chat input: Log, Sounds, Rooms,
     Preferences, Debug. Sounds/Rooms are currently empty placeholders to
     shake out layout/space issues ahead of their real implementation.
     Shares the simulator's fixed width/centering since it lives inside #roomSim.
     Content height is set dynamically via JS (see updateTabPanelHeight)
     to use available vertical space rather than a fixed 120px. ---- */
  .room-tabs { width:var(--room-w); max-width:100%; margin:6px auto 0; }
  .room-tabs-bar { display:flex; align-items:center; gap:2px; }
  .room-tab-btn { padding:5px 10px; border:1px solid #444; border-bottom:none; background:#2a2a2a;
                   color:#999; font-size:11px; cursor:pointer; border-radius:5px 5px 0 0; }
  .room-tab-btn.active { background:#383838; color:#dff0ff; }
  .room-tab-btn:hover:not(.active) { background:#333; color:#bbb; }
  .disconnect-btn { margin-left:auto; padding:5px 14px; border:1px solid #644; border-radius:4px;
                     background:#3a2424; color:#e8b8b8; font-size:11px; cursor:pointer; }
  .disconnect-btn:hover { background:#4a2c2c; }
  .disconnect-btn.hidden { display:none; }
  .room-tab-content { border:1px solid #444; background:#2c2c2c; height:120px; overflow-y:auto;
                        padding:8px 10px; box-sizing:border-box; }
  .room-tab-content.hidden { display:none; }
  .chat-log { font-family: Geneva, Verdana, sans-serif; font-size:11px; color:#ccc; line-height:1.5;
              white-space:pre-wrap; }
  .chat-log .log-system { color:#e08a8a; }
  .chat-log .log-link { color:#6cb2ff; text-decoration:underline; word-break:break-all; }
  .chat-log .log-link:hover { color:#9ecbff; }
  .chat-emoji { height:1.3em; width:auto; vertical-align:-0.3em; cursor:default; }
  .chat-emoji-preview { position:fixed; width:64px; height:64px; z-index:300; pointer-events:none;
    display:none; background:#000; border:1px solid #444; border-radius:4px; padding:2px;
    box-sizing:border-box; object-fit:contain; box-shadow:0 4px 14px rgba(0,0,0,.6); }
  .chat-emoji-preview.visible { display:block; }
  /* Per-line local-time stamp (from the stored UTC time) -- hidden until the
     mouse is over the log, then shown along the right edge. */
  .chat-log .log-time { display:none; float:right; margin-left:10px; color:#7a7a7a; font-size:10px; }
  .chat-log:hover .log-time { display:block; }
  .prefs-row { position:relative; margin-bottom:10px; }
  .prefs-checkbox { display:flex; align-items:center; gap:6px; font-size:12px; color:#ccc; margin-bottom:8px; }
  .prefs-group { margin-top:4px; }
  .prefs-group-label { font-size:11px; color:#888; text-transform:uppercase; letter-spacing:.04em; margin-bottom:4px; }
  .prefs-radio { display:inline-flex; align-items:center; gap:4px; font-size:12px; color:#ccc; margin-right:14px; }
  .prefs-slider { display:flex; align-items:center; gap:8px; margin-top:8px; font-size:12px; color:#ccc; }
  .prefs-slider input { width:120px; }
  .prefs-slider output { min-width:34px; color:#aaa; font-variant-numeric:tabular-nums; }

  /* ---- Room / Spot Info viewer (Debug tab) ---- */
  /* Floating Room Info window (shares the paint palette's floating-window feel) */
  .floating-window { position:fixed; z-index:60; width:320px; max-width:92vw; background:#34343a;
    border:1px solid rgba(0,0,0,.35); border-radius:5px; box-shadow:0 6px 22px rgba(0,0,0,.55);
    display:flex; flex-direction:column; font-family:system-ui,sans-serif; }
  .floating-window.hidden { display:none; }
  .floating-window .fw-title { cursor:move; background:#3a3a40; color:#ddd; font-size:11px;
    font-weight:600; padding:5px 9px; border-radius:5px 5px 0 0; display:flex;
    justify-content:space-between; align-items:center; user-select:none; }
  .floating-window .fw-close { cursor:pointer; color:#aaa; font-size:13px; line-height:1; padding:0 2px; }
  .floating-window .fw-close:hover { color:#fff; }
  /* Every classic-stylesheets OS skin already draws its own close affordance
     on button[data-close] -- winxp/win9x/cde a real icon (mask-image or
     background-image), macos9 a plain small square with no icon at all --
     body always carries a data-dialog-os (see index.html's <body> default),
     so this literal "X" text is only ever layered on top of that, not a
     fallback for a themeless state. Under winxp specifically the theme's
     ::after icon and this text rendered as two overlapping X's; zeroing the
     font-size here removes the glyph everywhere without touching each
     theme's own close-button styling. */
  body[data-dialog-os] .floating-window .fw-close { font-size: 0; }
  .floating-window .fw-toolbar { display:flex; gap:10px; align-items:center; padding:7px 9px 4px;
    border-bottom:1px solid #333; flex-wrap:wrap; }
  .floating-window .fw-toolbar .prefs-checkbox { margin-bottom:0; }
  .floating-window .room-info-debug { overflow-y:auto; max-height:min(60vh,460px); padding:8px 9px 10px; }

  /* Room Inspector: larger + split panes (list + detail). */
  #roomInfoWindow {
    width: min(920px, 96vw);
    height: min(660px, 86vh);
    max-width: 96vw;
  }
  #roomInfoWindow .room-info-debug {
    flex: 1;
    max-height: none;
    overflow: hidden;
  }

  /* Profile / DM social windows */
  .social-window { width:340px; left:40px; top:80px; z-index:70; }
  .social-window-body { padding:10px 12px 12px; max-height:min(70vh,520px); overflow-y:auto; font-size:12px; color:#ddd; }
  .social-profile-head { display:flex; gap:10px; align-items:flex-start; margin-bottom:8px; }
  .social-avatar { width:72px; height:72px; flex-shrink:0; background:transparent; border:none;
    display:flex; align-items:center; justify-content:center; overflow:hidden; }
  .social-avatar img { width:100%; height:100%; object-fit:contain; image-rendering:pixelated; }
  /* Profile window: no frame — prop transparency shows the dialog surface. */
  #profileWindow .social-avatar {
    background: transparent; border: none; box-shadow: none;
  }
  .social-avatar-placeholder { color:#666; font-size:28px; font-weight:bold; }
  .social-username { font-size:14px; font-weight:700; color:#fff; }
  .social-handle { color:#9ab; font-size:11px; margin-bottom:4px; }
  .social-tagline { color:#cde; font-style:italic; margin-bottom:4px; }
  .social-presence { color:#8c8; font-size:11px; }
  .social-desc { white-space:pre-wrap; color:#ccc; margin:6px 0; line-height:1.35; }
  .social-link a { color:#8cf; word-break:break-all; font-size:11px; }
  .social-actions { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
  .social-muted { color:#888; font-size:11px; }
  .social-muted.err { color:#e88; }
  .social-danger { color:#c44 !important; }
  .acct-profile-section textarea { width:100%; box-sizing:border-box; resize:vertical; font:inherit; }
  .acct-profile-preview { align-items:center; }

  /* ---- Contact Center (AIM/ICQ-style persistent contact window, dm-ui.js) --
     ONE window. Online/All/Pending/Blocked (dmhubRenderFriendsMain) is the
     home screen inside #dmhubDetailPane; picking a buddy/thread row or a
     system-mail item swaps that same pane's content over to DM chat /
     account settings / a system folder, with a back button to return home.
     It's a real classic-stylesheets .window/.title-bar box (see
     dialog-classic-themes.generated.css); rules below are the app-specific
     bits that theme can't know about (avatar colors, tree-row layout, badges). ---- */
  .floating-window.dmhub-window {
    /* Sized for the detail pane (account/chat forms), not just the tree --
       it's the same window now, so it needs to fit both. */
    width: min(320px, 90vw);
    height: min(480px, 84vh);
    left: 44px;
    top: 52px;
    z-index: 72;
    /* Clip to the rounded corners -- without this, a form pane that grows
       past the fixed height (see .dmhub-main min-height fix below) renders
       past the window's own bottom edge instead of being clipped/scrolled. */
    overflow: hidden;
  }
  /* My Account is a separate window from Buddy List now (see index.html) --
     offset its default position so opening both doesn't stack them exactly
     on top of each other. Each is still independently draggable afterward. */
  #accountWindow.dmhub-window { left: 96px; top: 96px; }
  .floating-window.dmhub-window.hidden { display: none; }

  /* Conversations: starts docked to #messagesWindow's right edge (JS:
     dmhubSyncConversationsDock overwrites left/top/height from the Buddy
     List's own rect while docked). Draggable by its own title bar like any
     other floating window (dmhubMakeConversationsDraggable) -- dragging it
     (or the Buddy List) back within snapping distance re-docks it, see the
     HTML comment on #conversationsWindow. */
  #conversationsWindow.dmhub-window { width: min(360px, 90vw); }

  /* Conversation tabs reuse the exact same real <div class="tabs"><menu>
     <button aria-selected> markup as Contact Center's Online/All/Pending/
     Blocked strip (see the "Online/All/Pending/Blocked..." comment above and
     dmhubFriendChip) -- .dmhub-conv-tabs just adds .dmhub-tabs to that same
     contract, so every OS skin renders its own native tab chrome here too
     instead of a hand-rolled look that reads as a different widget. Only the
     label+close layout inside each tab button is ours to supply. */
  #conversationsWindow .dmhub-conv-tabs > menu { overflow-x: auto; overflow-y: hidden; }
  #conversationsWindow .dmhub-conv-tab { display: inline-flex; align-items: center; gap: 6px; max-width: 150px; white-space: nowrap; }
  .dmhub-conv-tab-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dmhub-conv-tab-close { flex-shrink: 0; opacity: .6; cursor: pointer; font-size: 12px; line-height: 1; }
  .dmhub-conv-tab-close:hover { opacity: 1; }

  /* Unread conversation tab: animated red-gradient label so a background
     tab that just got a message reads as urgent at a glance, distinct from
     the theme's plain aria-selected tab-active look. Text-only (not the
     whole tab button) so the native tab chrome/seam is untouched. */
  @supports (background-clip: text) or (-webkit-background-clip: text) {
    .dmhub-conv-tab.unread .dmhub-conv-tab-label {
      background-image: linear-gradient(to right, #4a0000, #7a0000, #b30000, #ff1a1a, #ff5c5c, #d40000, #8f0000, #5c0000, #b30000);
      -webkit-background-clip: text;
      background-clip: text;
      --dmhub-unread-bg-size: 200%;
      color: transparent;
      background-size: var(--dmhub-unread-bg-size) 100%;
      font-weight: 700;
      animation: dmhubUnreadTabGlow 12s linear infinite;
    }
  }
  @keyframes dmhubUnreadTabGlow {
    to { background-position: var(--dmhub-unread-bg-size) 0; }
  }

  /* Bottom-right resize ear (dmhubMakeResizable in dm-ui.js), same look as
     the other retro floating windows' ears (e.g. #cyborgModal). The window's
     min-width is enforced in JS from the tab rows' actual content width
     (dmhubTabsMinWidth) rather than a fixed constant, since it depends on
     the active theme's font/button metrics. */
  .dmhub-window .dmhub-resize-ear { position: absolute; right: 1px; bottom: 1px; width: 14px; height: 14px;
    cursor: nwse-resize; z-index: 5;
    background: linear-gradient(135deg, transparent 0 55%, #808080 55% 70%, transparent 70% 75%, #808080 75% 88%, transparent 88%); }

  /* Buddy List content follows the active classic-theme skin instead of a
     fixed dark palette -- otherwise the title bar/menu/buttons (which the
     theme skins directly) end up light while every custom-div surface here
     (tree/detail panes, account text) stays hardcoded dark, and the two
     halves read as different apps stitched together. mac9/win9x/winxp all
     expose --window-bg/--window-fg; cde has no separate "window content"
     tone, so its own dialogs reuse --button-bg/--button-fg for that role. */
  body[data-dialog-os="macos9"] .dmhub-window,
  body[data-dialog-os="win9x"] .dmhub-window,
  body[data-dialog-os="winxp"] .dmhub-window {
    --dmhub-surface: var(--window-bg);
    --dmhub-surface-2: var(--window-frame-bg, var(--window-bg));
    --dmhub-ink: var(--window-fg);
    --dmhub-ink-soft: color-mix(in srgb, var(--window-fg) 55%, var(--window-bg));
  }
  body[data-dialog-os="cde"] .dmhub-window {
    --dmhub-surface: var(--button-bg);
    --dmhub-surface-2: var(--button-light, var(--button-bg));
    --dmhub-ink: var(--button-fg);
    --dmhub-ink-soft: color-mix(in srgb, var(--button-fg) 55%, var(--button-bg));
  }
  .floating-window.dmhub-window { background: var(--dmhub-surface, #ddd); border-color: rgba(0,0,0,.35); }

  .dmhub-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }

  /* Contact Center banner: full-width logo strip above the home screen.
     object-fit:contain (not cover) so tcc.png's own artwork is never
     cropped -- the strip's height instead follows the window's width via
     aspect-ratio, capped so a wide window doesn't turn it into a giant slab. */
  .dmhub-banner { display: block; width: 100%; aspect-ratio: 662 / 377; max-height: 110px;
    object-fit: contain; background: var(--dmhub-surface, #c0c0c0); flex-shrink: 0; }
  .dmhub-detail-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .dmhub-back-btn { flex-shrink: 0; align-self: flex-start; margin: 4px 6px 0; background: transparent;
    border: 0; color: inherit; cursor: pointer; font-size: 11px; padding: 2px 4px; }
  .dmhub-back-btn:hover { text-decoration: underline; }

  #messagesWindow .dmhub-rail-search { padding: 4px 6px; flex-shrink: 0; }
  .dmhub-rail-search input { width: 100%; box-sizing: border-box; background: #202026; border: 1px solid #45454e;
    color: #eee; border-radius: 5px; padding: 6px 8px; font-size: 11px; }
  /* Sits flush against the Online/All/Pending/Blocked tab strip right below
     it -- no bottom padding/border, so it reads as part of the tabs rather
     than a separate header section. */
  #messagesWindow .dmhub-rail-search--tight { padding: 4px 6px 0; }
  #messagesWindow .dmhub-tree { overflow-y: auto; padding: 2px; margin: 0; list-style: none; }
  #messagesWindow .dmhub-tree ul { list-style: none; padding-left: 14px; margin: 0; }
  /* Other Conversations/system-mail extras: a small capped-height strip above
     the Online/All/Pending/Blocked tabs, not the tabs' own flex:1 scroller
     (see .dmhub-tabs) -- only takes space when it actually has rows. */
  #messagesWindow .dmhub-tree.dmhub-extras { flex: 0 0 auto; max-height: 140px; }
  #messagesWindow .dmhub-rail-empty { list-style: none; color: var(--dmhub-ink-soft, #777); font-size: 11px; padding: 10px 8px; line-height: 1.4; }
  .dmhub-guest-prompt { padding: 10px 8px; font-size: 11px; line-height: 1.4; }
  .dmhub-guest-prompt p { margin: 0 0 8px; }
  .dmhub-guest-actions { display: flex; gap: 6px; }
  #messagesWindow .dmhub-guest-actions .retro-btn { flex: 1; }
  /* .icon/[role=treeitem] from the theme is inline-flex, sized to content --
     buddy rows need to be full-width, hoverable rows instead. */
  #messagesWindow .dmhub-buddy,
  #messagesWindow summary.icon { display: flex; width: 100%; box-sizing: border-box; gap: 6px;
    padding: 3px 4px; cursor: pointer; }
  /* Color: the classic theme's own .list ul[role=tree] .icon-label rules
     never match here (this tree has no .list ancestor), so with nothing set
     it fell all the way back to body's global color:#eee -- near-white,
     invisible against this light window surface. Same bug as the buddy-row
     names and the DM chat names, different selector. */
  #messagesWindow .dmhub-buddy .icon-label,
  #messagesWindow summary.icon .icon-label { flex: 1; min-width: 0; text-align: left; display: flex;
    align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
    color: #000; }
  #messagesWindow .dmhub-buddy:hover { background: rgba(120, 120, 140, .18); }
  /* Nickname on top, @accountid underneath -- same two-line shape as the
     friend rows below, so a buddy still reads the same whether they're a
     friend or just showing up in Other Conversations. */
  #messagesWindow .dmhub-buddy .icon-label.dmhub-tree-label,
  #messagesWindow summary.icon .icon-label.dmhub-tree-label { flex-direction: column;
    align-items: flex-start; gap: 1px; }
  .dmhub-tree-name-row { display: flex; align-items: center; gap: 6px; width: 100%;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .dmhub-tree-sub { font-size: 10px; color: var(--dmhub-ink-soft, #777); width: 100%;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .dmhub-badge { background: #f23f5c; color: #fff; font-size: 10px; font-weight: 700; border-radius: 9px;
    min-width: 16px; height: 16px; line-height: 16px; text-align: center; padding: 0 4px; }

  .dmhub-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: flex;
    align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 700; position: relative;
    overflow: hidden; }
  .dmhub-avatar-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
  .dmhub-avatar-dot { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%;
    background: #747480; border: 2px solid #1c1c20; }
  .dmhub-avatar-dot.on { background: #3ba55d; }
  .dmhub-avatar-dot.away { background: #faa61a; }
  .dmhub-avatar-dot.busy { background: #ed4245; }
  .dmhub-system-avatar { background: #3a3a40; font-size: 15px; }

  /* Fixed dark, not themed -- see the "Rail footer status popup" comment
     below: this bar is deliberately Discord-style dark no matter which OS
     skin the rest of the window wears. It used to read --dmhub-surface-2
     for its background, which classic skins define (window-frame-bg is
     light), so the bar silently went light-on-white while its text stayed
     hardcoded near-white -- your own name/status became unreadable, which
     is what made status changes look like they weren't doing anything. */
  .dmhub-rail-footer { display: flex; align-items: center; gap: 8px; padding: 8px; border-top: 1px solid rgba(0,0,0,.3);
    background: #2a2a30; }
  .dmhub-rail-footer .dmhub-avatar-dot { border-color: #2a2a30; }
  .dmhub-rail-footer-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
  .dmhub-rail-footer-name { font-size: 12px; color: #eee; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; }
  .dmhub-rail-footer-status { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: #aaa;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Rail footer status popup: clicking your own name/avatar picks Online/Away/
     Busy/Invisible. Deliberately its own plain div/click-toggle popup (JS:
     dmhubRenderRailFooter/dmhubEnsureStatusPopupHandlers) rather than the
     app's [role=menu] flyout -- that mechanism is keyed to the active
     classic OS theme (theme.css skins it silver/white to match native Windows/
     Mac menus), which fought this deliberately dark, Discord-style rail
     footer no matter which OS skin the rest of the dialog wears. */
  .dmhub-status-trigger { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1;
    cursor: pointer; border-radius: 5px; padding: 4px; margin: -4px; }
  .dmhub-status-trigger:hover { background: rgba(255,255,255,.08); }
  .dmhub-status-trigger .dmhub-rail-footer-main { flex: 1; }
  .dmhub-status-menu { display: none; position: absolute; bottom: 100%; left: -4px; margin-bottom: 6px; min-width: 160px;
    border-radius: 6px; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,.4); background: #18181c;
    border: 1px solid #3a3a42; z-index: 20; }
  .dmhub-status-trigger.open .dmhub-status-menu { display: block; }
  .dmhub-status-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 12px;
    color: #eee; cursor: pointer; }
  .dmhub-status-item:hover, .dmhub-status-item:focus { background: #2a2a30; outline: none; }
  .dmhub-status-item[aria-selected="true"] { font-weight: 700; }
  .dmhub-status-swatch { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: #747480; }
  .dmhub-status-swatch.on { background: #3ba55d; }
  .dmhub-status-swatch.away { background: #faa61a; }
  .dmhub-status-swatch.busy { background: #ed4245; }

  /* Chat header hamburger (Profile / Delete conversation): a plain div
     trigger, same reasoning as .dmhub-status-trigger -- a real <button>
     inside .window picks up the theme's native raised-button chrome
     (body[data-dialog-os=...] .window button), which is the wrong look for a
     compact icon control. Reuses .dmhub-status-menu/.dmhub-status-item for
     the dropdown itself, just anchored below-right instead of above-left. */
  .dmhub-chat-menu-trigger { position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 5px; cursor: pointer; color: var(--dmhub-ink, #333); font-size: 15px;
    flex-shrink: 0; }
  .dmhub-chat-menu-trigger:hover { background: rgba(0,0,0,.08); }
  .dmhub-chat-menu { display: none; position: absolute; top: 100%; right: 0; margin-top: 6px; min-width: 170px;
    border-radius: 6px; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,.4); background: #18181c;
    border: 1px solid #3a3a42; z-index: 20; text-align: left; font-size: 12px; font-weight: 400; }
  .dmhub-chat-menu-trigger.open .dmhub-chat-menu { display: block; }
  .dmhub-chat-menu .dmhub-status-item { color: #eee; }
  .dmhub-chat-menu .dmhub-danger-item { color: #f38; }
  .dmhub-chat-menu .dmhub-danger-item:hover { background: #3a2228; color: #f88; }

  /* Report dialog (dmhubOpenReportDialog) -- its own backdrop/modal, same
     dark-card look as report-abuse-ui.js's #reportAbuseModal (the side
     menu's "Report Abuse" flow this hooks into the same psNetReportAbuse
     pipeline as), styled here instead of injected via JS since dm-ui.js
     already ships its own stylesheet. */
  .dmhub-report-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 12000;
    display: flex; align-items: center; justify-content: center; padding: 16px; }
  .dmhub-report-modal { background: #1e1e2e; color: #cdd6f4; border: 1px solid #45475a; border-radius: 10px;
    width: min(420px, 100%); max-height: 84vh; overflow-y: auto; padding: 16px;
    font: 13px/1.4 system-ui, sans-serif; }
  .dmhub-report-modal h3 { margin: 0 0 10px; font-size: 15px; }
  .dmhub-report-modal label { display: block; margin: 10px 0 4px; color: #a6adc8; font-size: 12px; }
  .dmhub-report-modal textarea { width: 100%; box-sizing: border-box; background: #11111b; color: #cdd6f4;
    border: 1px solid #45475a; border-radius: 6px; padding: 8px; font: inherit; resize: vertical; }
  .dmhub-report-types { display: flex; flex-direction: column; gap: 6px; }
  .dmhub-report-type-opt { display: flex !important; align-items: center; gap: 8px; margin: 0 !important;
    color: #cdd6f4; font-size: 12px; cursor: pointer; }
  .dmhub-report-note { margin-top: 10px; font-size: 11px; color: #6c7086; }
  .dmhub-report-err { color: #f38ba8; font-weight: 700; margin-top: 8px; min-height: 14px; }
  .dmhub-report-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
  .dmhub-report-actions button { border: 1px solid #45475a; background: #313244; color: #cdd6f4;
    border-radius: 6px; padding: 7px 12px; cursor: pointer; font-size: 12px; }
  .dmhub-report-actions button.dmhub-btn-primary { background: #89b4fa; color: #11111b; border-color: #89b4fa;
    font-weight: 700; }
  .dmhub-report-actions button:disabled { opacity: .6; cursor: default; }

  .dmhub-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column;
    background: var(--dmhub-surface, #34343a); animation: dmhubFadeIn .12s ease; }
  @keyframes dmhubFadeIn { from { opacity: 0; } to { opacity: 1; } }
  .dmhub-main-header { padding: 10px 14px; border-bottom: 1px solid rgba(0,0,0,.3); display: flex; flex-wrap: wrap;
    align-items: center; gap: 10px; }
  .dmhub-chat-header { gap: 10px; flex-wrap: nowrap; }
  /* Same recurring bug as the buddy-row/DM/tree names -- hardcoded white,
     invisible against .dmhub-main's themed (often light) background. Used
     for both the DM chat header's peer name and the My Account window's
     "My Account" title. */
  .dmhub-chat-peer-stack { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
  .dmhub-chat-peer { font-size: 13px; font-weight: 700; color: var(--dmhub-ink, #111); overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; }
  .dmhub-chat-peer-sub { font-size: 11px; color: var(--dmhub-ink-soft, #555); overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; }
  .dmhub-chat-header-actions { display: flex; gap: 6px; flex-shrink: 0; }

  /* Online/All/Pending/Blocked (friends list) and Profile/Username &
     Password/My Spaces (account) are both a real <div class="tabs"> with a
     <menu> of aria-selected buttons + a [role=tabpanel] -- the exact
     contract classic-stylesheets' own tab widget targets (see
     ".tabs > menu > button[aria-selected=true]" / ".tabs > [role=tabpanel]"
     in each vendor/classic-stylesheets/themes/<name>/theme.css). That means each
     OS skin renders its own native tab chrome for free (mac9's tab.svg caps,
     win9x's raised tab, XP's Luna-gradient tab, CDE's flat tab) instead of
     us hand-rolling one generic look that fights the theme's button/box
     styling. Only the outer flex/scroll plumbing below is ours to supply --
     the theme has no opinion on how tall the tab strip's content area is. */
  .dmhub-tabs { display: flex; flex-direction: column; flex: 1; min-height: 0; }
  .dmhub-tabs > menu { flex-shrink: 0; margin: 0; list-style: none; }
  /* win9x/winxp both ship `.tabs > menu { margin: 0 2px; }` in the vendor
     theme (classic-stylesheets), which reads as a visible gap/notch before
     the first tab and after the last one at this window's scale. cde ships
     none, and macos9's own left/right padding on .tabs > menu is load-
     bearing (it reserves room for the first/last tab's slanted-cap ::before/
     ::after bleed) so it's deliberately excluded here -- zeroing it would
     clip that cap instead of fixing anything. Framework-wide normalization
     belongs in palacespace.css, not a per-window override, since every
     .tabs strip in the app (Buddy List, My Account, Conversations) inherits
     the same vendor rule. */
  body[data-dialog-os="win9x"] .tabs > menu,
  body[data-dialog-os="winxp"] .tabs > menu {
    margin-left: 0;
    margin-right: 0;
  }
  /* Higher specificity than any theme's own `.tabs > menu > button` rule
     (id + class beats [data-dialog-os] + 2 classes) so a tab label never
     wraps to a second line inside its pill when the window gets narrow --
     dmhubTabsMinWidth() in dm-ui.js is what actually keeps the window wide
     enough that this never has to kick in as a real constraint. */
  #messagesWindow .dmhub-chip, #accountWindow .dmhub-chip { white-space: nowrap; }
  .dmhub-chip-count { opacity: .75; font-weight: 400; }
  /* Find-a-buddy search that matched nobody in the current tab, for a
     username you don't already know (dmhubRenderAddFriendFlyout): offers
     Add Friend right there instead of just "no results" -- this replaced
     the old standalone "Add a friend by username" input+button row, so the
     status message (dmhubAddFriendMsg) now lives inside the flyout itself
     instead of a header that no longer exists. Named for the little flip-in
     entrance, distinguishing it from a plain static empty state. */
  .dmhub-add-flyout { display: flex; flex-direction: column; align-items: center; gap: 10px;
    text-align: center; padding: 20px 14px; }
  .dmhub-add-flyout p { color: var(--dmhub-ink-soft, #777); font-size: 12px; margin: 0; }
  .dmhub-add-flyout-btn { animation: dmhubAddFlyoutIn .18s ease; transform-origin: top center; }
  @keyframes dmhubAddFlyoutIn { from { transform: rotateX(-90deg); opacity: 0; } to { transform: rotateX(0deg); opacity: 1; } }
  .dmhub-add-friend-msg { width: 100%; font-size: 11px; color: #8c8; min-height: 14px; }
  .dmhub-add-friend-msg.err { color: #f33; font-weight: 700; }

  .dmhub-friends-list { flex: 1; overflow-y: auto; padding: 6px 10px 10px; }
  .dmhub-friend-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 6px;
    cursor: default; transition: background .12s ease; }
  /* Neutral overlay instead of a fixed dark hover fill -- this row sits on
     the theme's own (often light, e.g. classic Windows/Mac skins) surface,
     so a hardcoded dark hover background would fight the themed text color
     below exactly like the rail-footer bug above. */
  .dmhub-friend-row:hover { background: rgba(120, 120, 140, .18); }
  .dmhub-friend-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
  .dmhub-friend-name-row { display: flex; align-items: center; gap: 5px; min-width: 0; flex-wrap: wrap; }
  /* Was hardcoded near-white, invisible against the themed (light-by-default)
     window surface -- follow the theme's ink color like the rest of the
     account/profile text already does, so buddy names/status are actually
     readable under the classic Windows/Mac skins.
     min-width: a flex item with overflow:hidden and no explicit min-width
     defaults to a 0 automatic minimum, so once the always-reserved (opacity-
     only, still laid out) action buttons and the fixed-width status word
     were sharing this row, the name itself could get squeezed all the way
     down to nothing at the Buddy List window's default ~320px width --
     showing the status dot/word with no name next to it at all. Floor it so
     the name always keeps some visible width; the status word wraps to its
     own line (flex-wrap above) before that happens. */
  .dmhub-friend-name { font-size: 12px; color: var(--dmhub-ink, #111); font-weight: 600; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 5em; }
  .dmhub-friend-status-word { font-size: 11px; color: var(--dmhub-ink-soft, #555); flex-shrink: 0; }
  .dmhub-friend-username { font-size: 11px; color: var(--dmhub-ink-soft, #555); overflow: hidden;
    white-space: nowrap; text-overflow: ellipsis; }
  .dmhub-friend-status { font-size: 11px; color: var(--dmhub-ink-soft, #555); }
  .dmhub-friend-actions { display: flex; gap: 6px; opacity: 0; transition: opacity .12s ease; flex-shrink: 0; }
  .dmhub-friend-row:hover .dmhub-friend-actions,
  .dmhub-friend-row.dmhub-pending .dmhub-friend-actions { opacity: 1; }

  .dmhub-icon-btn { border: 1px solid #3a3a42; background: #2a2a30; color: #ddd; font-size: 10px; font-weight: 600;
    padding: 5px 8px; border-radius: 5px; cursor: pointer; white-space: nowrap; }
  .dmhub-icon-btn:hover { background: #34343c; color: #fff; }
  .dmhub-icon-btn.dmhub-danger { color: #f38; }
  .dmhub-icon-btn.dmhub-danger:hover { background: #3a2228; color: #f88; }
  .dmhub-icon-btn.dmhub-btn-primary { background: #5865f2; border-color: #5865f2; color: #fff; }

  .dmhub-btn { border: 1px solid #3a3a42; background: #2a2a30; color: #ddd; font-size: 12px; font-weight: 600;
    padding: 7px 12px; border-radius: 6px; cursor: pointer; transition: background .12s ease; }
  .dmhub-btn:hover { background: #34343c; }
  .dmhub-btn-primary { background: #5865f2; border-color: #5865f2; color: #fff; }
  .dmhub-btn-primary:hover { background: #4752c4; }
  .dmhub-btn:disabled { opacity: .55; cursor: default; }

  .dmhub-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: #777;
    font-size: 12px; padding: 20px; text-align: center; }
  .dmhub-empty.err { color: #e88; }
  .dmhub-muted { color: var(--dmhub-ink-soft, #888); }

  .dmhub-chat { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; }
  .dmhub-msg-row { display: flex; gap: 10px; margin-top: 12px; animation: dmhubMsgIn .16s ease; }
  .dmhub-msg-row.grouped { margin-top: 2px; }
  .dmhub-msg-row.grouped .dmhub-avatar { visibility: hidden; width: 32px; }
  .dmhub-msg-row.pending { opacity: .6; }
  @keyframes dmhubMsgIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
  .dmhub-msg-col { flex: 1; min-width: 0; }
  .dmhub-msg-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
  /* Already bold; color was hardcoded white -- same bug as the buddy-row
     names, invisible against the chat pane's themed (often light) surface. */
  .dmhub-msg-name { font-size: 12px; font-weight: 700; color: #000; }
  .dmhub-msg-time { font-size: 10px; color: #787880; }
  /* Plain text, no bubble box -- follows the theme's ink color like the name
     above it, same reasoning as the other hardcoded-dark-on-themed-light
     fixes elsewhere in this file. Own ("mine") messages get their own fixed
     look below: right-justified with a gray box, deliberately not themed --
     it's meant to read as a chat-bubble accent regardless of OS skin. */
  .dmhub-msg-bubble { display: block; max-width: 100%; color: var(--dmhub-ink, #111);
    font-size: 12.5px; line-height: 1.4; white-space: pre-wrap; word-break: break-word;
    position: relative; padding-right: 18px; }

  /* Per-message delete: hidden until the row is hovered, so the transcript
     stays clean by default. Soft-deletes for both sides of the conversation
     (dmhubDeleteMessage) -- the row stays in place afterward, showing
     .dmhub-msg-deleted instead of the real body, rather than disappearing. */
  .dmhub-msg-del { position: absolute; top: 0; right: 0; border: 0; background: transparent;
    color: inherit; opacity: 0; cursor: pointer; font-size: 13px; line-height: 1; padding: 0 2px;
    transition: opacity .12s ease; }
  .dmhub-msg-row:hover .dmhub-msg-del { opacity: .55; }
  .dmhub-msg-del:hover { opacity: 1 !important; color: #f38; }
  .dmhub-msg-deleted { font-style: italic; color: var(--dmhub-ink-soft, #777); }
  .dmhub-msg-row.mine .dmhub-msg-deleted { color: #555; }

  .dmhub-msg-row.mine { flex-direction: row-reverse; }
  .dmhub-msg-row.mine .dmhub-msg-meta { justify-content: flex-end; }
  .dmhub-msg-row.mine .dmhub-msg-col { text-align: right; }
  .dmhub-msg-row.mine .dmhub-msg-bubble { display: inline-block; max-width: 80%; text-align: left;
    background: #e2e2e6; color: #000; border-radius: 8px; padding: 7px 10px; }

  /* Read/unread marker under our own last message -- see dmhubRenderMessages. */
  .dmhub-read-receipt { display: flex; justify-content: flex-end; padding: 2px 8px 0; }
  .dmhub-read-receipt img { height: 14px; width: auto; display: block; }

  /* Rich card a pasted game-invite link (buildGameInviteLink, games-ui.js)
     renders as instead of a plain link -- see DM_GAME_INVITE_RE. Fixed dark
     look regardless of "mine"/theirs, same reasoning as .mine's bubble box:
     it's a distinct object in the transcript, not themed message text. */
  .dmhub-invite-card { display: block; width: 220px; max-width: 100%; background: #1c2530;
    border: 1px solid #33465a; border-radius: 8px; padding: 10px 12px; color: #eee; }
  .dmhub-invite-card-title { font-weight: 700; font-size: 12.5px; color: #8dd; margin-bottom: 4px; }
  .dmhub-invite-card-meta { font-size: 11px; color: #89a; margin-bottom: 8px; }
  .dmhub-invite-card-btn { width: 100%; text-align: center; }

  .dmhub-system-chat { padding: 10px 14px; gap: 8px; }
  .dmhub-system-item { background: #2a2a30; border-radius: 6px; padding: 8px 10px; margin-bottom: 8px;
    cursor: pointer; transition: background .12s ease; }
  .dmhub-system-item:hover { background: #31313a; }
  .dmhub-system-item.unread { box-shadow: inset 3px 0 0 #5865f2; }
  .dmhub-system-item-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: #eee; }
  .dmhub-system-item-body { margin-top: 4px; font-size: 11px; white-space: pre-wrap; }

  .dmhub-composer { display: flex; gap: 8px; align-items: flex-end; padding: 10px 14px; border-top: 1px solid rgba(0,0,0,.3);
    background: var(--dmhub-surface-2, #2a2a30); }
  .dmhub-composer textarea { flex: 1; min-width: 0; resize: none; background: #202026; border: 1px solid #45454e;
    color: #eee; border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 12.5px; max-height: 120px; }
  .dmhub-composer textarea:focus { outline: 1px solid #5865f2; }
  /* Abuse Reports (dmhubOpenSystemThread): no textarea/send button, since
     there's no one to reply to -- just a muted note filling the same
     composer bar so the thread's overall shape still matches a real DM. */
  .dmhub-composer.dmhub-composer-readonly { color: var(--dmhub-ink-soft, #888); font-size: 12px;
    justify-content: center; text-align: center; }

  /* ---- Account section (settings + profile editing) ---- */
  .dmhub-account { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
  .dmhub-acct-identity { font-size: 13px; color: var(--dmhub-ink-soft, #ccc); margin-bottom: 8px; }
  .dmhub-acct-identity strong { color: var(--dmhub-ink, #fff); }
  .dmhub-section { border-top: 1px solid rgba(0,0,0,.25); padding-top: 14px; margin-top: 14px; }
  .dmhub-section:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
  .dmhub-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: var(--dmhub-ink-soft, #888); margin-bottom: 8px; }
  .dmhub-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
  .dmhub-field label { font-size: 11px; color: var(--dmhub-ink-soft, #9a9aa2); }
  .dmhub-field input:not([type="checkbox"]):not([type="radio"]), .dmhub-field textarea, .dmhub-field select {
    background: #202026; border: 1px solid #45454e;
    color: #eee; border-radius: 5px; padding: 7px 9px; font: inherit; font-size: 12.5px; }
  .dmhub-field textarea { resize: vertical; min-height: 64px; }
  .dmhub-field-row { flex-direction: row; align-items: center; }
  .dmhub-field-row input { flex: 1; min-width: 0; }
  .dmhub-field-msg { font-size: 11px; color: #e88; font-weight: bold; min-height: 14px; margin-top: 2px; }
  .dmhub-field-msg.err { color: #e88; }
  .dmhub-profile-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
  .dmhub-profile-head .social-avatar { width: 64px; height: 64px; }
  .dmhub-profile-head-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
  .dmhub-space-summary { font-size: 11px; margin-bottom: 6px; }
  .dmhub-space-summary.err { color: #e88; }
  .dmhub-space-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; font-size: 11px;
    color: #666; }
  .dmhub-space-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: #2a2a30;
    border-radius: 6px; }
  .dmhub-space-row a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: #8cf; text-decoration: none; font-size: 12px; }
  .dmhub-space-row a:hover { text-decoration: underline; }

  /* Delete confirmation must stack above Server Settings when opened
     from those embedded surfaces. */
  #deleteTenantModal.modal-backdrop { z-index: 1100; }
  #serverSettingsMediaDeleteConfirmModal.modal-backdrop { z-index: 1100; }

  /* The Image Browser (openImageBrowserModal) is opened from several other modals
     (Room Editor, Spot Editor's per-state Picture fields, ...) at various DOM
     positions -- explicit z-indexes (rather than relying on DOM order matching
     whichever modal happens to open it) guarantee it always stacks above its
     opener, and its own delete-confirm dialog above it in turn. */
  #imageBrowserModal.modal-backdrop { z-index: 1100; }
  #imageBrowserDeleteConfirmModal.modal-backdrop { z-index: 1150; }

  /* Server Settings: non-blocking so props stay reachable for drag-to-set-picture.
     Transparent backdrop + pointer-events pass-through; only the window captures input. */
  #serverSettingsModal.modal-backdrop {
    background: transparent;
    pointer-events: none;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 18px 18px;
    z-index: 85;
  }
  #serverSettingsModal .retro-window {
    pointer-events: auto;
    width: min(92vw, 860px);
    max-height: min(90vh, 820px);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 4px 4px 0 rgba(0,0,0,.35);
  }
  #serverSettingsModal .retro-window.retro-wide,
  #serverSettingsModal .retro-window.retro-xwide {
    width: min(96vw, 960px);
  }
  #serverSettingsModal .retro-titlebar { cursor: move; }
  #serverSettingsModal .retro-body { overflow-y: auto; max-height: min(78vh, 680px); color: #000; }
  #serverSettingsModal .retro-tabbar {
    flex-wrap: wrap;
    gap: 3px;
    padding: 8px 8px 0;
  }
  #serverSettingsModal .retro-tab-btn {
    padding: 6px 14px 5px;
    font: 12px Tahoma,"MS Sans Serif",sans-serif;
  }
  #serverSettingsModal .retro-btn {
    padding: 4px 14px;
    font: 12px Tahoma,"MS Sans Serif",sans-serif;
    min-height: 24px;
  }
  #serverSettingsModal input[type="text"],
  #serverSettingsModal input[type="number"],
  #serverSettingsModal input[type="password"],
  #serverSettingsModal select,
  #serverSettingsModal textarea {
    font: 12px Tahoma,"MS Sans Serif",sans-serif;
    padding: 3px 6px;
    min-height: 24px;
  }
  #serverSettingsModal .retro-check {
    font-size: 12px;
  }
  #serverSettingsModal .sim-menu-section-label {
    font-size: 12px;
  }
  #serverSettingsModal .server-settings-security-grid {
    display: grid;
    gap: 6px;
    margin: 0 0 6px;
  }
  #serverSettingsModal .server-settings-security-row {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 88px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
  }
  #serverSettingsModal .server-settings-security-row-sub {
    grid-template-columns: minmax(240px, 1fr) 88px minmax(0, 1fr);
  }
  #serverSettingsModal .server-settings-security-check {
    min-width: 0;
    align-items: flex-start;
  }
  #serverSettingsModal .server-settings-security-check > span {
    min-width: 0;
    line-height: 1.25;
  }
  #serverSettingsModal .server-settings-security-check input[type="checkbox"] {
    margin-top: 2px;
  }
  #serverSettingsModal .server-settings-security-label {
    text-align: right;
    justify-self: end;
    min-width: 0;
    line-height: 1.25;
  }
  #serverSettingsModal .server-settings-security-suffix {
    min-width: 0;
    line-height: 1.25;
  }
  #serverSettingsModal .server-settings-security-row input[type="number"] {
    width: 88px;
    box-sizing: border-box;
  }
  #serverSettingsModal .plugall-limits-table {
    display: grid;
    gap: 3px;
    margin: 6px 0 10px;
    padding: 6px;
    background: #fff;
    border: 1px solid;
    border-color: #000 #fff #fff #000;
    box-shadow: inset 1px 1px 0 #808080;
  }
  #serverSettingsModal .plugall-limits-head,
  #serverSettingsModal .plugall-limits-row {
    display: grid;
    grid-template-columns: minmax(110px, 1.4fr) 72px 88px 56px;
    gap: 8px;
    align-items: center;
  }
  #serverSettingsModal .plugall-limits-head {
    font-weight: bold;
    font-size: 11px;
    color: #333;
    padding-bottom: 3px;
    border-bottom: 1px solid #808080;
  }
  #serverSettingsModal .plugall-limits-row input[type="number"] {
    width: 100%;
    box-sizing: border-box;
  }
  #serverSettingsModal .server-avatar {
    background: #fff; border: 1px solid; border-color: #000 #fff #fff #000;
    box-shadow: inset 1px 1px 0 #808080; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    flex-shrink: 0;
  }
  #serverSettingsModal .server-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
  #serverSettingsModal .server-avatar-placeholder { color: #808080; font-size: 28px; }
  #serverSettingsModal .server-avatar-drop { cursor: copy; }
  #serverSettingsModal .server-avatar-drop.drag-over {
    outline: 2px solid #000080; outline-offset: 1px; background: #e8f0ff;
  }
  #serverSettingsModal .server-avatar-row {
    display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px;
  }
  #serverSettingsModal .server-avatar-hint { flex: 1; margin: 0; font-size: 11px; color: #444; line-height: 1.35; }
  .server-item-with-avatar { display: flex; align-items: flex-start; gap: 10px; text-align: left; }
  .server-item-avatar {
    width: 64px; height: 64px; flex: 0 0 64px; border-radius: 0;
    object-fit: contain; background: #fff; border: none;
    image-rendering: pixelated;
  }
  .server-item-avatar-fallback {
    width: 64px; height: 64px; flex: 0 0 64px; border-radius: 0;
    background: #fff; border: none;
  }
  .social-avatar-drop.drag-over {
    outline:2px solid #000080; outline-offset:1px; background:#e8f0ff;
  }
  /* Let drag events hit the drop container, not the nested <img>. */
  .social-avatar-drop img,
  .server-avatar-drop img { pointer-events: none; }
  .room-info-debug { font-size:11px; color:#ccc; }
  .rid-status { color:#888; font-style:italic; padding:4px 0; }
  .rid-section-label { color:#788; font-size:10px; text-transform:uppercase; letter-spacing:.04em;
                        margin:8px 0 3px; border-bottom:1px solid #3a3a3a; padding-bottom:2px; }
  .rid-field { display:flex; gap:6px; padding:1px 0; }
  .rid-field .rid-k { color:#789; min-width:78px; flex-shrink:0; }
  .rid-field .rid-v { color:#dde; word-break:break-word; }
  .rid-yt-toggle { display:flex; align-items:center; gap:6px; padding:4px 0 6px;
    color:#cde; font-size:11px; cursor:pointer; user-select:none; }
  .rid-yt-toggle input { margin:0; }
  .rid-flag { display:inline-block; background:#243; color:#bdf; border:1px solid #375;
               border-radius:3px; padding:0 5px; margin:1px 3px 1px 0; font-size:10px; }
  .rid-flag.rid-unknown { background:#432; color:#fda; border-color:#753; }

  .rid-layout { display:flex; flex-direction:column; gap:10px; height:100%; }
  .rid-room-grid { display:flex; flex-direction:column; }
  .rid-room-extra { margin-top:4px; }

  .rid-main {
    display:grid;
    grid-template-columns: minmax(260px, 340px) 1fr;
    gap:10px;
    flex:1;
    min-height:0;
  }
  @media (max-width: 720px) {
    .rid-main { grid-template-columns: 1fr; }
  }

  .rid-pane {
    background:#1f1f22;
    border:1px solid #333;
    border-radius:6px;
    display:flex;
    flex-direction:column;
    min-height:0;
  }
  .rid-pane-head {
    display:flex;
    justify-content:space-between;
    align-items:baseline;
    padding:6px 8px;
    border-bottom:1px solid #333;
  }
  .rid-pane-title { color:#dde; font-size:11px; font-weight:650; }
  .rid-pane-sub { color:#8aa; font-size:10px; font-variant-numeric:tabular-nums; }

  .rid-list-toolbar {
    padding:6px 8px;
    border-bottom:1px solid #333;
    display:flex;
    flex-direction:column;
    gap:6px;
  }
  .rid-search {
    width:100%;
    box-sizing:border-box;
    font-size:12px;
    padding:5px 7px;
    border-radius:6px;
    border:1px solid #444;
    background:#141416;
    color:#eee;
    outline:none;
  }
  .rid-search:focus { border-color:#5a7bd6; box-shadow:0 0 0 2px rgba(90,123,214,.25); }
  .rid-filters { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
  .rid-select {
    font-size:11px;
    padding:4px 6px;
    border-radius:6px;
    border:1px solid #444;
    background:#141416;
    color:#ddd;
  }
  .rid-check { display:inline-flex; align-items:center; gap:6px; font-size:11px; color:#cde; user-select:none; }
  .rid-check input { margin:0; }

  .rid-spotlist {
    padding:6px;
    overflow:auto;
    flex:1;
    min-height:0;
    display:flex;
    flex-direction:column;
    gap:4px;
  }
  .rid-spot {
    appearance:none;
    border:none;
    background:transparent;
    color:#dde;
    text-align:left;
    cursor:pointer;
    width:100%;
    border-radius:8px;
    padding:6px 7px;
    user-select:none;
    display:grid;
    grid-template-columns:44px 1fr auto;
    gap:8px;
    align-items:center;
  }
  .rid-spot:hover { background:#2a2a30; }
  .rid-spot.selected { background:#2b3755; }
  .rid-spot .rid-sid { color:#9ab; font-size:10px; font-variant-numeric:tabular-nums; }
  .rid-spot-body { display:flex; flex-direction:column; min-width:0; }
  .rid-sname { color:#eef; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .rid-stype { color:#8a9; font-size:10px; }
  .rid-spot-badges { display:flex; gap:4px; justify-content:flex-end; flex-wrap:wrap; }
  .rid-badge { display:inline-block; font-size:10px; padding:0 7px; border-radius:999px;
               border:1px solid #355; background:#223; color:#bdf; }

  .rid-clear {
    font-size:11px;
    padding:3px 8px;
    border-radius:6px;
    border:1px solid #444;
    background:#141416;
    color:#ddd;
    cursor:pointer;
  }
  .rid-clear:hover { border-color:#666; color:#fff; }

  .rid-detail { padding:8px; overflow:auto; flex:1; min-height:0; }
  .rid-detail-empty { color:#888; font-style:italic; padding:4px 0; }
  .rid-detail-head { margin-bottom:6px; }
  .rid-detail-title { color:#eef; font-size:12px; font-weight:650; }
  .rid-detail-sub { color:#9ab; font-size:10px; margin-top:2px; }
  .rid-script { margin-top:6px; }
  .rid-script summary { cursor:pointer; color:#cde; font-size:11px; user-select:none; }
  .rid-script pre { margin:6px 0 0; padding:7px; background:#141416; border:1px solid #333;
                    border-radius:6px; max-height:240px; overflow:auto; font-size:10px;
                    color:#cdb; white-space:pre; }

  .rid-looseprops { margin:6px 8px 8px; }
  .rid-looseprops.hidden { display:none; }
  .rid-looseprops summary { cursor:pointer; color:#cde; font-size:11px; user-select:none; }
  .rid-looseprops-body { padding:6px 0 0; }

  /* ===== Dedicated toolbar column ===== */
  .pal-toolbar {
    display:flex; flex-direction:column; align-items:center;
    gap:10px; padding:10px 6px;
    /* #222222 matches the baked-in background of the imported client asset buttons
       (avatar/prop/trash PNGs sample to exactly rgb(34,34,34)), so the gaps between
       buttons read seamlessly with the icons. */
    background:#222222; border-right:1px solid #333;
    flex-shrink:0; width:50px; box-sizing:border-box;
    /* Sticky like the sidebar so the icons stay in view when a tall prop
       grid scrolls beneath them in a short window. Horizontal mode
       (body.toolbar-horiz) and row-layout override position/height below. */
    height:100vh; position:sticky; top:0;
    /* Sticky establishes a stacking context; raise it so flyout menus that
       overflow the 50px column (e.g. #modMenu at left:52px) paint above the
       sidebar/main content instead of being hidden behind them. */
    z-index:100;
  }
  .pal-toolbar .tb-primary,
  .pal-toolbar .tb-secondary { display:contents; }
  /* Horizontal mode: full-width bar across the TOP */
  body.toolbar-horiz .layout {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto 1fr;
    height: 100vh;
    overflow: hidden;
  }
  /* Three tracks so the icon group sits at the true centre of the window: the
     outer 1fr tracks are equal, and the trailing group lives inside the right
     one instead of beside the centre group, so the two can never overlap. */
  body.toolbar-horiz .pal-toolbar {
    grid-column: 1 / -1; grid-row: 1;
    display:grid; grid-template-columns:1fr auto 1fr; align-items:center;
    width: 100%; height: auto;
    border-right: none; border-bottom: 1px solid #333;
    padding: 6px 12px; gap: 10px;
    position: relative; z-index: 100;
  }
  body.toolbar-horiz .pal-toolbar .tb-primary,
  body.toolbar-horiz .pal-toolbar .tb-secondary {
    display:flex; flex-direction:row; align-items:center; gap:10px;
  }
  body.toolbar-horiz .pal-toolbar .tb-primary { grid-column:2; }
  body.toolbar-horiz .pal-toolbar .tb-secondary { grid-column:3; justify-content:flex-end; }
  body.toolbar-horiz .pal-toolbar .tb-spacer { display:none; }
  body.toolbar-horiz .sidebar {
    grid-column: 1; grid-row: 2;
    position: relative; top: auto;
    /* Grid stretches the sidebar to fill the 1fr row (definite height), so the
       flex column's .sidebar-content scrolls and .footer stays pinned. Keep
       overflow hidden here so scrolling happens on the inner region, not the
       whole sidebar (which would let the footer scroll away). */
    height: auto; max-height: 100%; overflow: hidden;
  }
  body.toolbar-horiz .main {
    grid-column: 2; grid-row: 2;
    min-height: 0; overflow: hidden;
  }
  /* In horizontal-toolbar mode .main is a fixed-height grid cell (overflow:hidden) laid out as a
     flex column. min-height:0 lets #propViewerArea shrink so its inner Legacy/Modern grids
     (overflow-y:auto) scroll while the Naked toolbar stays pinned. Mirrors row-layout. */
  body.toolbar-horiz #propViewerArea { flex: 1 1 0; min-height: 0; overflow: hidden; }
  .pal-toolbar .tb-spacer { flex:1; min-width:0; min-height:0; }
  .pal-toolbar .tb-sep {
    width:30px; height:1px; background:#3c3c3c; flex-shrink:0;
  }
  body.toolbar-horiz .pal-toolbar .tb-sep { width:1px; height:30px; }
  /* toolbar icon buttons */
  /* palLogoBtn (toolbar-orientation toggle) now uses the little mansion icon that the Show/Hide
     Simulator button used to have. */
  #palLogoBtn   { background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADCElEQVR4AbxVCXarMAyc/IuhmzG+mXMy/ozAxAbaZnmtn2Xt0lg16T98tpbP0oFPAXza/yMAC5n9P5rCuxPI5vMMkDuIt4C8CsBNtuYL7veKiAoSIN8D8gqAbFxrxTwv6nYTAdMUiLgEkv6fjmcBZHM3csNSCqD+U8TOUwYQUUFKAIwyhe+OZwBk83neyqhxROCuSfRUSEC7RiCigoTXjyCeAaCRA/57t1u68jRNsN4oIhAC1XA65hn6CUDe/qrQ/X4fzAbSDK9MIQGQXJRsEhv3PvrRjEkTKOTB+lAnPc6HNkp9vwQwup/XZnIP9nvYlRcEA1hCf7+tVD+FL8ff6rupCcua1v8ZWgyZ0hqQIoZ+BoBpCoBc3f0pk7+4opdfa+Bq5Nn0dkNyAPpAgS0PXpLNeur7JQCoAcg+ZpVlmvWsZ+GfzWdegliDgWyeCuH4iAqoBo6r65cAUj8GWVdyUdWigLJxV8zbdrd2qNxmdosIx9eI1XY4VQ4qDa8E4J9X0upOujNgE3nmLnAkhX0Zj3VlTYt9vwQwTZPtA2VBEg5e9MjeIedSNThUBvp+CeDwo7IjjYhMtf8dcnKrYVmUtV1Lcu4E0COyldQpqjVwRRGBuKCrWNugWtpoq++XAHpEJFW8Yp6XE0VUkADJrPXgAAmQQMQXubWCZOb1/RJAj8hBRl3KTS95JNtdwTEPSouPJMeUMuaVcoPtznFQ3y8B9IgcdHUL20inA45ptFnEKDtAAhHnKdhGUnHQf9Z7ch8JoEfkIKMtZbyFbU6wfyQg1BBYi0PLsaWc850n9/dfgYNc8PgGbHOy/TvJQAIRIarS1h3xBxPIVmoOEwDfWiy35VJ+cQLuQurcKJkO31xWxG9PwE2ghgMB8M3FkpfyyxPABQDfHFrmV2+IpLw4fwUNub0OqhGn3wBsy/4UXasnGWsNnesu5TCBCJCEVx+Xn6GNWH3IZdlkZeM1whpaEdjeEx6rxcJ+aJmbJO570xMACWijLXLVyZE3vzl59pH2jHbyoa9e6ZvN+n8AAAD//wMDTjwAAAAGSURBVAMA3nN0P9tr4gIAAAAASUVORK5CYII=); border-radius:3px; image-rendering:pixelated; }
  /* Retained-for-later, currently UNUSED: the original toolbar-toggle icon -- the red Palace
     circle logo. Reference it via the `redpalacecirclelogo` class when needed. */
  .redpalacecirclelogo { background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAGFBMVEUAAAD/AACAAACAgIDAwMAAAID///8AAAAyqNIvAAAAAXRSTlMAQObYZgAAAQtJREFUKM9NkUtuwzAMROXkAqESxFuLCaq189u7NbrvERwLPIAQ5PwdkvnNSuQ8SEMxBBNBq/BSQ5Sg1buOpifTw2cIjNXL9Wg6MEdDzhdxFXbk+GvlOKJjCG20MxBtZDaE4tpqoi/hqG+mnYgFIbmmLjQIIJMH2c64BBbLoEET3wou0ZTybQDvJcYPgvkmINSSqwF5X55EUZ/rvdCDwCXMOetrTkgPv96lT9GJQ4Z2CrRO/NRaT8iLsxE+ryAS5dCgi8Y8DjZPDQsnJrKPbTuMb8Rk06SKhhOWNbZZl/BB1Kq/HvnyINrcaeMv6SuJ4Ffby9ljaNjONnU82Vbgd6/lpqQ+v9e/0N26/w/MF1LJz16UuwAAAABJRU5ErkJggg==); }
  /* override */ #palLogoBtn_PLACEHOLDER { background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAGFBMVEUAAAD/AACAAACAgIDAwMAAAID///8AAAAyqNIvAAAAAXRSTlMAQObYZgAAAQtJREFUKM9NkUtuwzAMROXkAqESxFuLCaq189u7NbrvERwLPIAQ5PwdkvnNSuQ8SEMxBBNBq/BSQ5Sg1buOpifTw2cIjNXL9Wg6MEdDzhdxFXbk+GvlOKJjCG20MxBtZDaE4tpqoi/hqG+mnYgFIbmmLjQIIJMH2c64BBbLoEET3wou0ZTybQDvJcYPgvkmINSSqwF5X55EUZ/rvdCDwCXMOetrTkgPv96lT9GJQ4Z2CrRO/NRaT8iLsxE+ryAS5dCgi8Y8DjZPDQsnJrKPbTuMb8Rk06SKhhOWNbZZl/BB1Kq/HvnyINrcaeMv6SuJ4Ffby9ljaNjONnU82Vbgd6/lpqQ+v9e/0N26/w/MF1LJz16UuwAAAABJRU5ErkJggg==); border-radius:3px; image-rendering:pixelated; }
  /* Show/Hide Simulator button: yellow-face icon, with a pressed (:active) state like the prop
     picker / avatar buttons. */
  #palSimBtn    { background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABkElEQVR4nL1XUa4DIQjETW9kz2TP1J5Jz8T72GVVBMGNeSTERq0zDIgtICKseM6I5IgwjKvnBUQEy0qBe1OMfDUAAF4jN5QmO3t5gOegGjgAQECTyEzq3mAyelxecICD8HkVXCfhAr90NsHrPj8JEzylyA7WSdC+lKJKIOeehCF7PXRFAUuFlsQhVC6rcG1tk43RywqcssqRk4/p0qKvKjACo8yj/HP3poAIsBTw5oJAJL2yn/v19VJYY9OKzyq4J97Lf6bsqJFp7XVfwcVYFSjlnDtqpXt6+zMjsBac0qAosNd45IYC+0yLfKLAXtMiFxT438hbBV4cPIT5PfaYBEbncgWuTth3stlrtnLP2/sO0M9frb0S4Jt3keDntfMdgXYRHO/6SuSX0M069gQ8JDSQdfAa/UBAI0FEPOAtsBS5SsBDYtU5OQ4+ENhJwopcJaCR4NJqLtWMBq4SQETw5nw+6pGbBIjE01tAwDNwROef08/nfW9KqYD0043G3+99f+/7zfYj4+o0Qmqk0YpW8j/tLjhELoDCnwAAAABJRU5ErkJggg==); border-radius:3px; }
  #palSimBtn:active { background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABfklEQVR4nL1XUQ7DIAilzW7kzuTOtJ1Jz8Q+OqoiCDauJISlaN/jidoBIsKMp4RIjghdnH3fhohgWc5wDgqBZzcAwF/khtLDxh4e4DGoBg4AsKFJZCR1azCIHpcTDnAQfs+C6yRc4D+dTfAyzk/CBI8xsBfrJGhcjEElkFJLwpC9vHRGAUuFmsQudC7rcC23yPrqZQUOWeXKyfvl0qovKjACvcy9/GP3LgERYEvADxcEIumV/Riv53NmB5vWfFbDXfFW/mPJ9lKZdryua7gQigI5H8/20umes/2aEVgNTsugKLDWeOWGAutMq3ygwFrTKhcUuLfyZivSlljtfMtJMcZAF9F9oDU4lqO4JO8i0RGok/+s/IjYEpghMQ+my98RsEjUeYDWpflS5SoBjYQUOThUV/BoHgfvCHhJaARmKlcJeEjMKqCBqwQQEWIMUyRmKzcJEAn6xL7a7SNwROef09breQ6KMYP06Ubx83me897vZF8yw00/WBopWtVK/gUkNMluMT97TgAAAABJRU5ErkJggg==); border-radius:3px; }
  /* Room Paint button (placeholder for the future paint tool): pressed (:active) state like the
     prop picker / avatar buttons. Icons re-encoded without the gAMA chunk so the background blends. */
  #palPaintBtn  { background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABxElEQVR4nLVXbbGDMBDcdmogSDgLVMKz0CcBC7FAJBQLWMBCLEQCkfDejzbhKPkEujPMQCGze3d7l/RCRH84gMfjEX03jmN2/WWPgBRprYgqATXEpSJu3yTOkRcJiJF3Svn7Qcpd5ECiBKmoO6Ug5hm2aQAAdyHQdV01OQBca8kBrMiPYlOCknrzyI9iVYIjZqsBL4/PQIxc/Sxmk1PYbLUgIhhjAEQ84AmlxNzO/nkYhlMEtG0LIgLwzkAs+kafY7QUigZRLbTWPsU5X6VLMEmIX+Gvz17PkQMFkzCnsIQ0RP58Pv3v0zRF1yQzsBecPASttb/feECpJWIp61zPU1/67SoDSnWY52W61baday2OVPqtted2Qdu2AAD13indMwdPf1BA09hTRKRgjIExBkS0LoGruRB3CHGv6oASuOi5VzYZeIk4l5jDkTu/fKUNQ3Az4rNTrqUnl6PkHLxbsl3Q98t23DRl4zgEbjyOZAn6XsHaOfVJFjz1oTlxBdIbhth57NJar/aGELkX4BaEcdlFDpSN5tWZkIg2g2QcR1j7Gk65+vMgSveFzf8Cl6qSiXaEOCrAkbuoS1FL7BDsgrgfzsc/Q2HcXpCi/WwAAAAASUVORK5CYII=); border-radius:3px; }
  #palPaintBtn:active { background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAACSUlEQVR4nKVWW7GsMBBsto6BWQlYwAJHQmJhLSABC1gIFiJhsYCFkcD5uHeyA+QF21VUBUKmO5lXmrZtN3yBcRyTc8MwFNc3dwTkSK+KuCQgR0xEYObLIn5KpMwM51zUuCZNzb9er6z9ooAUubE2jGfnomuttSCirP2kC3LHbawFtg1oGgDAkwjTNO3+qQlAAHhcJQewIxeUdprCyQVVEa52LkgFYNGUdkGMPBfdqfnjt+O7dk9DRBsRJcl/+9/w7mZ3mr+zc+89vPcAgIf4LubDvu+x4ROjOqXukovdrusA/I+BcRyjx9igOa/+klzbCAJiSBHUkHvvsSwLmBnTNGX/j6ahwM0O9KTwpIrSkVz8S0TZesDMaJxzVb2gdufeexAR3u93+D7Pc/Lf7AnQjTw/kqeEir1TDFhrwti5s/KS4dqKuCwLgEMMWGuwKYeUOtkRfd9HRcXAzGDmcje8I0C6YEoQM4OIsK7rWUATT/0odGDKOEaqwcxY1xXruqJt248LiCj4nOgJoidcos8fycVwCRIj4n9ABaEY+CdiKqZdbaE63pqEvG1bAJlCVOqAtevk3Xsfjl7jUXtzqRUXg8574LN7INEL9LEZ87n7PQvlOOU2CbxlWXbkUQFn8g1QXfFqXEhjkqg/4gHsbyjftllNPM9zKEQx8iBAFsSRLwyxgBSf63RLIdwJmRnGmFMhGYZBpWi+Hesql95QQoCg67pdGZWYyNWFO8RJAQBgjNkVj2PJ1d9lXHPcMUQLkVwgNDkRRcm1qDv4A1K5l2Bq9cBjAAAAAElFTkSuQmCC); border-radius:3px; }
  #palBagBtn    { background-image:url(data:image/gif;base64,R0lGODlhIAAgALMAAFVVVd3d3YiIiP///3d3d6qqqkRERBEREQAAACIiIgAAAAAAAAAAAAAAAAAAAAAAACH5BAAAAAAALAAAAAAgACAAAATwMMlJZZko58r7vFqoeaSViOh0lJWxdSNyzCt7IlQsETxtowieMFEoGI4+j0hIKBqPUEkSk2ESi4lBIsqZ3oTOy9Zgm4qwEnIn0JlJDyFiKQAAUGi17Wwk9tDtCXhJNHxzdYEre3l7hSQBbkeBGXkGcI1tBwSRIgdqlZY4fSo0PBIonWmMoRd4BQICBKZAqHqgFgUHYbJAk56MblcgvKc1SBqqw8PFlcfIyZzLoJ2gz5yeLiHM1SE01yLa290UR9/UvN2R49ga4LMzXC3rGcbu8Bzk5cT2HvLz0u/pbOxCgATPPoGyPnUKiFDJPDUNJ0QAADs=); }
  #palAvatarBtn { background-image:url(data:image/gif;base64,R0lGODdhIAAgAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAAIAAgAAAI/wBFCBxIsKDBgwgTKlyIcEYVRLuYueu2C1GVGQwPzkDE7J/HfxMnUrxDJOPAO+4+enTHsls3Zrt2ZTKTccYulR9bvoypquedhTM6/nOpsqWqO3cy9cyEiGZCoarMqCrqjhkijGaUMr1TBeHUf8yIzPia0ypGIogybTVTsqCZj6ocdsNZ9WoEIkkRNTXTteBckIiIZMI5lFmmiw/X8sV4MqcqRH/Lwmx6Ry+iO3zFEiQLMiXOnbtUMdWLtMpFxiKIpGTp+TMzmD1Fk86MWkQV1rhzgo6t9jLmKpoHmtHZjfjupVt/E2k7ELLL5y5fwwyN3LeZxbVFcGT2XPp06qKT84QFnl2799cx0yMXT7t8lfTweVa33l4j+NjrLWO+Tr68wBlK4RfeaPSZJpZ/J6mlIIG+7WfgDAgOhNZlZiBlIVL8AXegQBFEkFCFpxFh2ogaQjhQhwB42BBfInSYUIcoApCiQiKKBaOMOOaYo4o0LtcWjBHoKKOLJkFopElIJqnkkkwuGRAAOw==); }
  #palExportMacrosBtn { background-image:url("icons/mask.png"); border-radius:3px; image-rendering:pixelated; }
  #palBagBtn:active    { background-image:url(data:image/gif;base64,R0lGODlhIAAgAKIAAMzMzERERKqqqlVVVXd3d////yIiIjMzMyH5BAAAAAAALAAAAAAgACAAAAP2aLqsRfBI2apdxcw9r3cEJy7D1wiU1R1DW5rawaxQYbuweNg8YQtA3IXDKwKPAohwMSn6bD7CEUJVtma7IlSarHqtr1jzAel+yd6robWJfqkFAKDqCgvYEvfbJwfXFS4Tem9xcy0EbGF4eWiEh0CIEmEBA22NaQMFkBwDAgqUlYxfdVsinZ+LT4guTiE6pwaggk+ZPa46kp6xeIdPD7ivLwGUE4vAwMLEksbHnMmhLHfNuLDDHNLTGy661hvY2dsM3RPfyC1HDeMS5abnQBbqB0HUne8X8fLQxfW6HwEi37bZg6HA25066AhWWCewn8Ih6xw+NJAAADs=); }
  #palAvatarBtn:active { background-image:url(data:image/gif;base64,R0lGODdhIAAgAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAAIAAgAAAI/wBFCBxIsKDBgwgTKlyIkMidXf8iRtx1pwrDg1WYSdy4UZXFiwJVcRwpsVumGQyJkFz5z103VSgTqmQZ0Z2qTN1adtt1sqFEd4jckdxVZQaibi53qUKEUGhEMzNH7iIyw8yubsx4ZjITcyCikg5XThVR5WrWTIjudBUxYyOzjCu73XG4K+vNtEQIZtroDiJLZplUMbOb6Y6Zj2yd0uSLdZdStBWpCjSzeKQ7l3bTHu56pzLjxncNU52Bcq9nnaAhHx6N0m9ll6BDV2GNUjHNy7FVFyVNWoTrlbhza57Nu/dX4MHthl5dvHcVksEbP9ZNu2sVpJezd8OaVend4dW7znPAyZ17d1U3IRsm3rz35Lo30ctHr94M84HFCY5XNZeImTsABmhfFcQNFEEEvBlURWF5IdhebwceCEAEbLmnnxmIQCVChBxGCMCHHzq4VkH2rZaXQBGAqCKFFS5ExIswWmhQggw9aCONIFV4o4w5CmTjRQEBADs=); }
  #palThanksBtn { background-image:url(data:image/gif;base64,R0lGODlhIAAgALP/AAAAqgA//2af/2a//8DAwP//AMy/AJl/AP8AAJkAAP///7u7u4iIiAAAAAAAAAAAACH5BAEAAAQALAAAAAAgACAAQAT/kMhJa6s441bMCIGgLAAIGMaVNctxNXAsz/TbwjezKPwIM42E67brLYA3zQR26KBcKiUroWo0O5/QqBQANA0uyRTn0vV4iwYQeBieR0horoiOHYTUNB3OCispVlF/g1YGBSCIAQdgghhAgAVYIANbJk1+Eo8NCFRiVwUHAiCiAKUJhqBVnGQxCQuvsLGysFSsfWp7aWpqbQxuRnGsZkZ2eCwsZ0e3VrV3zrXMd4F4zkydg0vY2oBfMNtSiwUC44uM30tNogEDryVe5ttWHeomXO+YFY9LkQbqIiSWUlHQVEBfEGf+KpUqd40DEBliqAkpRRGARD8zFIQJMuyNRzidRhpohDHSSpuTbWigPFmrZMmVKXcd8GVyJUkoL22uIeMC5s2fNU/uYmYyaEyXUHwCoRbIp8ikUIScTLO02hCUzaDU2Mq1RgQAOw==); border-radius:3px; image-rendering:pixelated; }
  #palTrashBtn  { background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAACHklEQVR4nJ1W0dmDIAyM/boAK6QjsIIrsIKu4AiuoCswQlkhK7CCK/wP16YpoL/2Xiqgd7kQQjtmphaGYdi2rblUwzm3rmtzqasFLLVzDg8ioi8Uwt57O4wx7goMw1B/75zz3osI5vu+J6KUUi1sxVTmI1CwgwgUxeQ4jsxcBG7FvPcqcMPPsiw1e0oppaST8zyDnYhyzlTBew9VEdG4O2ZelqUOU5NgvU/TREQhhJq9doMg7gU7ULOLCFyfYbd4pcg5pwVDZgOAEALyc5Id4SPoW71chE9E0zQ9Ho9L7Drsns8nSOEAsihN+i6hM9R4gEDOmZlvmHXOKTVkUELe+77vNYE2jcfsHwdILqpKRKyPq4FbgW3bQNUxcwgBDrz3Vv9YxvKizJoCd+XCAlKP54OEIBo7g5cLN1RUUd/3qPe9FttEzhkB1ewvgaL/MTM0jmXyGxiCHZ/M86zu73vfO+dSSs2eUwDUdhvGcVyWBX2lcdAKDMNQWxGREIK6rM/gNE2oz48AM+/dSvT2bkkLYEmH8zy3HRRd6BJwoxCR5ocO9uAqYowhBGgoO6mDopB+gIggw5adzmzyMRC4Dgv2/wWw8/XG2KKk7wZXNJhfHBRRFygazJeArdRm4D/gIxBjzDnjArjUixTNY99IkT1uBw31JL4E6nZ48uZp9tGGABGt63o1P8dnqHGST/7/wWt6c+2h8e/awsrEGLWFnccftx9yjLvVS8UAAAAASUVORK5CYII=); border-radius:3px; }
  #palTrashBtn.selected { background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAACBklEQVR4nJ1WbdnDIAxke2aASSgSsFALzEItIKEWaqFIWC0ggUpYJez9cXszGlLGdn9WPnp3pEnYqes6JWGapm3bxKUSWuthGMSlUymQU2ut8bAsC21Y1zXf75zLh977Q4FpmpRSzLjWuu/7ZVkwD7oQAlbpgYmRzFuAsdNWoqZJY4y1lhnPxZxzXCClVBKJ7owxGI7jqCTQWzHGl8C37EfUTAYCZ8bOXBB7CKGdPccZP1prShhVJAbNNLLDPkyfxeVyxhjzFTsNT8/nE7M4AWSRmmqfQi3UeIDAuq5d151RQVprooZMCCGE0Pe9c44CmIexzv4+wf1+V0rBLzvHt8ZzgW3bQHXqum4cR5zAOZe3hLpMzos0EwUuxIUFZAvF7YgdbvIZFGyZILssghHvPSLWiBgjzJXsLwHW/6y10KjLxH9gCHZrrVIqpUSnv1QoWEZXtqn9Z7her4/HA5UvFBrDOI7wxUgxj6WyBo0xKaWdACJzJENERFr3kVKST1B2oXbM84wHio8g8DNw+nmeyftOoBKcRoQQbrebym6kncDP8N7nX5ixfxbAlxevh7ys8mxmDeaXEzDXDKzB7ATyTBWN/4C3gPc+xogLQMz0jxDLXghRnlGVhtqInUDZDhtvHrGPCgJKqWEYvo1PvYaEbooXPv6HwDa6uY4g/LvOkct471kbaMEfUTxnKd4uS64AAAAASUVORK5CYII=); border-radius:3px; }
  /* Authoring button: wooden shield icon (inherited from the old Moderator button,
     which has since been removed -- moderator tools now live in the Authoring menu). */
  #palAuthorBtn {
    background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABF1BMVEVHcExoX1k2IRQ2JBk6KiE1IBMxHA87IxQ7LCJZUk02IhZDNS09JBVCMSc6JRhAJxc7KiA+LiWAW0A1IRY+MyxLLxs/LCA7JhgzHhA4JBg0IxkxHQ9QNSRROCdKLhx5VT1kQyxdQS5oRzFJKxZYOSO2f0hfPSY9JBNEKRaud0GaZjaJWC2gazm4gkusdUCjbTtdOyJtSTBiQClLLhuncDyzfUhXNh1BJhSpcz6weUK0fEU5IRFSNB+NXDB6TSZ5VDmdaDeTYTIzHQ5pRi1TMReQXjF/USi/hkxzTjVpQR9OMR6GXkOGVy1wRiJlQiuxekSDVCt1SiWUa0vFkFmWZDV9VzyLZUjnwpTcp2zMmmake1WedFbYtY6AtaIVAAAAI3RSTlMABMJKHrPkazgCfxHSKa32QBn+iwn5L57beFj2tZTs9P2P73yyxyMAAASHSURBVFjD7ZfXdtpaEIYxxgTHgA1O3OJUta221bVVUENddBtsp7z/c5xt51yDcG7OWif/BXf/t0Yzs2eGRuOv/us6GAwGJ38CuGh2ry7f/YH/djjcfLt8dQxnt8H9r/vV6WXrdf6Tr8Umf/zuA9S86bWO903fRefj5wnJ53pZkcRpu3+wj/v45KTXfT98iEngy0hWChI1Ly569bN50u92Jw9BPKcJd4zm81gp4na7fVbD2rp+i/Xx8yYIglilRwgQSJMxIZ7HX27Pn7UV0/qqxFjKZDKc0zRZISLLEpcY0epcURTSJElydHu2JZ9v6J8/ft49TOK5SssVGoOM0rNkPAYmraqqUgQPk6I62pLPN+Tdr8c1Ocf+ETMmTN7IF/rSlIkxwoQ5uXn8PgPbAQ/3T5E5V0eMC0w/M2C+EKSZlCXIBaRKRk95ibYDNnxYAoAYLcl0fSpKGAB9Q1iuiLELNDniE2Y7IBgliAGE5nswt6eUINqUnYkSJ62SxHUZjSC2R2AOcerRbLmyHMpweCpcWM+AMMw5npORS2rajggmqkoQHuuJji5QvAhZ3caBcOtcEnLeRIVa7QTQBJFiqyNQ+De3McBzQiEXONGTQaDIqAbAY32bEnJ2Ki5Ca8GmFMuKIcaUYLMLYP7+BDsTnBeAFYkOBoiUHfIsBgSKyewAKEqleXDpOILI4irAnMIACurc9DegcrcBeh+/TGKC4CEvLgQRTo3IoJ4jcCyd4yGHATLqd7bNlsP3d7FG+FYq2oIYZsYa99EipaBFcby+lGmlGr/d+pwxQDEJU/Jw0KK+omzIhRggCSLnWbNqomo1ALIGIs8QRAoucTH1JUwpPWQxoAQFXQ+A/gVMRShZkZ0alKWHvF4CpQZgEmOAxxsSpVtTKoSsgAEiK3GZUAvwaYMBwPcNiY0gb7wAPMOxpNTnZa2QtQ/X28fp4adCkSswM0I2tKYGhwGsZ1iClforLaYr5nqwY6peFQpZuaXOQc7iDQFCYYETwkHPnxEFCT4c7hrL7fnmbkiYXggjCz8pmEqLqRGuIV/GD3cyGO8EXMk/Hp9KZiaxFq6Cw/k29BdcZGVMgAci2hnBu04zy/OZW6Y6xeI+4PBMWNkSJ/govc/L9s3OVX3cxLsAaMksdKwlZUmRYa0W+CUkVcJnqL17UR+ctxECMiB41lriKnC67i/0dIYUDTAfjgY19vLbMZ7gGlNGEgZQFif5drhK8DsA4+ZJnS1/7Va0SmrubI0BDhsJK8nTqiFuMLdZZ0Eft86Z0TMhwf0o6DASZlOTDBTcRP1OrSvhuHd5+kwgkhJKEgaU5kgJ5BHqn9W9DwbNFwLS1gIGpAlTYP9pt1P/QhkcoZGqkiBZCxYvjzeFOkLd3j5XzsUlGtE0nk08bzLFs7/Z2etKanT6OJP4xEiIal7QFTo6bOypzkseVLUiA7Jiunv7cTWbAFfv8btCjlC709hfB70mU+lP9yuArjqvu5cP+4yvr2W3eXPQeJ3O8FckTPfm9ef62VW7fXX4en/jXWvQav3B/4W/+t/oH/w8A66Jwfn7AAAAAElFTkSuQmCC);
    border-radius:3px;
  }
  #palAuthorBtn.privileged {
    /* drop-shadow so the halo follows the shield's alpha silhouette.
       Brighter / wider than the voice glow: amber on wood needs more punch
       to read as the Authoring Mode ON toggle. */
    filter:
      drop-shadow(0 0 1px rgba(255,230,120,1))
      drop-shadow(0 0 4px rgba(255,200,60,1))
      drop-shadow(0 0 9px rgba(255,170,40,.85));
  }
  .pal-mod-wrap { position:relative; flex-shrink:0; }
  .pal-mod-wrap .mod-menu {
    position:absolute; left:52px; top:0; z-index:120; min-width:180px;
  }
  body.toolbar-horiz .pal-mod-wrap .mod-menu { left:0; top:36px; }

  /* Voice Chat toolbar button. Green glow while voice is enabled (.selected,
     shared toggle-state class with palPaintBtn/palTrashBtn), a brighter pulsing
     glow while actively transmitting (.voice-sending) -- same green used for the
     throbbing avatar ring, so "you are being heard" reads as one consistent cue.
     drop-shadow (not box-shadow) so the halo follows the mic's alpha silhouette. */
  #palVoiceBtn {
    background-image:url(img/microphone.webp);
    background-size:26px;
    image-rendering:auto;
    border-radius:3px;
  }
  #palVoiceBtn.selected {
    filter:
      drop-shadow(0 0 1.5px rgba(40,220,90,.95))
      drop-shadow(0 0 4px rgba(40,220,90,.75));
  }
  #palVoiceBtn.voice-sending {
    filter:
      drop-shadow(0 0 2px rgba(60,255,110,1))
      drop-shadow(0 0 6px rgba(60,255,110,.85));
    animation: voiceSendingPulse 1s ease-in-out infinite;
  }
  @keyframes voiceSendingPulse {
    0%, 100% {
      filter:
        drop-shadow(0 0 1.5px rgba(60,255,110,.8))
        drop-shadow(0 0 4px rgba(60,255,110,.6));
    }
    50% {
      filter:
        drop-shadow(0 0 3px rgba(60,255,110,1))
        drop-shadow(0 0 8px rgba(60,255,110,.95));
    }
  }
  #voiceMenu { min-width:190px; }

  /* Webcam ("Avatar Cam") toolbar button. Same green selected/glow treatment
     as #palVoiceBtn so the two read as one family of WebRTC toggles. */
  #palWebcamBtn {
    background-image:url(img/camera.png);
    background-size:26px;
    image-rendering:auto;
    border-radius:3px;
  }
  #palWebcamBtn.selected {
    color:#4dff7a;
    filter:
      drop-shadow(0 0 1.5px rgba(40,220,90,.95))
      drop-shadow(0 0 4px rgba(40,220,90,.75));
  }
  #webcamMenu { min-width:190px; }
  .voice-menu-row {
    display:flex; align-items:center; justify-content:space-between;
    padding:4px 8px; font-size:12px; color:#cdd;
  }

  /* Games toolbar button + lobby flyout. Reuses .sim-menu/.mod-menu (same
     positioning/skin as #voiceMenu/#authorMenu) rather than a new panel system. */
  #palGamesBtn {
    background-image:url("icons/games.png");
    border-radius:3px; image-rendering:pixelated;
  }
  /* Abuse report toolbar button + flyout. */
  #palAbuseBtn {
    background-image:url("icons/abuse-re.png");
    border-radius:3px; image-rendering:pixelated;
  }
  #abuseMenu { min-width:280px; max-width:380px; padding-bottom:6px; }
  .abuse-menu-header {
    display:flex; align-items:center; justify-content:space-between;
    padding:6px 8px; border-bottom:1px solid #263340;
    font-size:12px; font-weight:700; color:#cdd;
  }
  .abuse-menu-body { padding:8px; font-size:12px; color:#cdd; }
  .abuse-menu-hint { color:#89a; }
  .abuse-menu-target { display:flex; align-items:baseline; gap:6px; flex-wrap:wrap; }
  .abuse-menu-target-name { color:#89a; font-weight:400; }
  .abuse-menu-change {
    margin-left:auto;
    background:#1a2530; color:#cdd; border:1px solid #384450; border-radius:3px;
    font-size:11px; padding:2px 8px; cursor:pointer;
  }
  .abuse-menu-change:hover { background:#2b3a48; color:#fff; }
  .abuse-menu-reasons { display:flex; flex-direction:column; gap:6px; margin-top:10px; }
  .abuse-reason-btn {
    width:100%;
    text-align:left;
    background:#1a2530; color:#cdd; border:1px solid #384450; border-radius:4px;
    font-size:12px; padding:6px 8px; cursor:pointer;
  }
  .abuse-reason-btn:hover { background:#2b3a48; color:#fff; }
  .abuse-reason-btn.selected {
    background:#2b3a48;
    border-color:#89b4fa;
    box-shadow:0 0 0 1px rgba(137,180,250,.35) inset;
  }
  .abuse-menu-details { margin-top:10px; }
  .abuse-menu-detail-label { display:block; margin:8px 0 4px; color:#89a; font-size:11px; }
  .abuse-menu-required { color:#f9e2af; }
  .abuse-menu-detail {
    width:100%; box-sizing:border-box;
    background:#0f1620; color:#cdd; border:1px solid #384450; border-radius:4px;
    font-size:12px; padding:6px 8px; resize:vertical;
  }
  .abuse-menu-err { margin-top:8px; color:#f38ba8; font-size:12px; }
  .abuse-menu-ok { margin-top:8px; color:#a6e3a1; font-size:12px; }
  .abuse-menu-selecting { margin-top:8px; color:#f9e2af; font-size:11px; }
  .abuse-menu-footer {
    display:flex; gap:6px; justify-content:flex-end;
    padding:6px 8px 2px; border-top:1px solid #263340;
  }
  .abuse-menu-btn {
    background:#2b3a48; color:#cdd; border:1px solid #384450; border-radius:3px;
    font-size:12px; padding:4px 10px; cursor:pointer;
  }
  .abuse-menu-btn:hover { background:#384450; color:#fff; }
  .abuse-menu-btn:disabled { opacity:.5; cursor:default; }
  .abuse-menu-btn.primary {
    background:#89b4fa; color:#11111b; border-color:#89b4fa;
    font-weight:700;
  }
  .abuse-menu-btn.primary:hover { filter:brightness(1.05); }
  /* Subtle theme shifts when reasons are selected. */
  #abuseMenu.abuse-has-avatar { border-color:#f9e2af; }
  #abuseMenu.abuse-has-chat { border-color:#89b4fa; }
  #abuseMenu.abuse-has-other { border-color:#f38ba8; }
  #gamesMenu { min-width:280px; max-width:380px; padding-bottom:4px; }
  /* Pick-a-Game / Pick-a-Puzzle: pin the snapout to the viewport so the
     lists can use the full window height. The browse (lobby) screen stays
     as the normal toolbar-anchored flyout. */
  #gamesMenu.games-menu-pinned {
    position:fixed;
    top:0; bottom:0;
    left:50px;
    height:auto; max-height:none;
    width:min(380px, calc(100vw - 50px));
    max-width:380px;
    display:flex; flex-direction:column;
    padding-bottom:0;
    border-radius:0 6px 6px 0;
    box-sizing:border-box;
    overflow:hidden;
    z-index:120;
  }
  #gamesMenu.games-menu-pinned.hidden { display:none; }
  body.toolbar-horiz #gamesMenu.games-menu-pinned {
    left:0;
    width:min(380px, 100vw);
    border-radius:0 0 6px 0;
  }
  #gamesMenu.games-menu-pinned .games-menu-banner { flex:0 0 auto; }
  #gamesMenu.games-menu-pinned .games-menu-banner img {
    max-height:140px; width:100%; object-fit:cover; object-position:center top;
  }
  #gamesMenu.games-menu-pinned #gamesMenuPick,
  #gamesMenu.games-menu-pinned #gamesMenuAcross {
    display:flex; flex-direction:column;
    flex:1 1 auto; min-height:0;
  }
  #gamesMenu.games-menu-pinned .games-menu-pick-list,
  #gamesMenu.games-menu-pinned #gamesMenuAcrossList {
    flex:1 1 auto; min-height:0; max-height:none; overflow-y:auto;
    align-content:flex-start;
  }
  .games-menu-banner {
    border-radius:5px 5px 0 0; overflow:hidden;
    border-bottom:1px solid #263340;
  }
  .games-menu-banner img {
    display:block; width:100%; height:auto;
    image-rendering:pixelated; image-rendering:crisp-edges;
  }
  .games-menu-banner img.games-menu-banner-photo {
    image-rendering:auto;
  }
  .games-menu-header {
    display:flex; align-items:center; justify-content:space-between;
    padding:4px 8px; gap:8px;
  }
  .games-menu-filter {
    background:#1a2530; color:#cdd; border:1px solid #384450; border-radius:3px;
    font-size:11px; padding:2px 4px; max-width:140px;
  }
  .games-menu-across-filters {
    display:flex; align-items:center; gap:6px;
    padding:6px 8px; border-bottom:1px solid #263340;
  }
  .games-menu-across-filters .games-menu-filter { max-width:88px; flex:0 0 auto; }
  .games-menu-across-hint {
    padding:4px 8px 0; font-size:10px; color:#89a;
  }
  .games-menu-search {
    background:#1a2530; color:#cdd; border:1px solid #384450; border-radius:3px;
    font-size:11px; padding:3px 6px; flex:1; min-width:0;
  }
  .games-row-already-completed { color:#6a9; font-size:10px; white-space:nowrap; }
  .games-menu-list { max-height:320px; overflow-y:auto; }
  .games-menu-empty { padding:10px 8px; font-size:12px; color:#89a; text-align:center; }
  .games-row {
    display:flex; align-items:center; justify-content:space-between; gap:8px;
    padding:6px 8px; border-top:1px solid #263340; font-size:12px;
    transition: background .6s ease;
  }
  /* One-shot cue for a row reached via an invite link -- see
     gamesMenuPendingHighlightId. Fades out via the transition above once the
     class is removed on the next poll re-render. */
  .games-row-highlight { background:#2b3a1e; box-shadow: inset 3px 0 0 #6a9; }
  .games-row-info { display:flex; flex-direction:column; min-width:0; }
  .games-row-type { font-weight:700; color:#8dd; text-transform:capitalize; }
  .games-row-host { color:#eee; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .games-row-meta { color:#89a; font-size:11px; }
  .games-row-actions { display:flex; gap:4px; flex-shrink:0; }
  .games-row-btn {
    background:#2b3a48; color:#cdd; border:1px solid #384450; border-radius:3px;
    font-size:11px; padding:3px 8px; cursor:pointer;
  }
  .games-row-btn:hover { background:#384450; color:#fff; }
  .games-row-invite { background:transparent; border-color:#465563; color:#8ac; }
  .games-row-invite:hover { background:#233040; color:#adf; }
  .games-menu-footer { padding:6px 8px 2px; border-top:1px solid #263340; }
  .games-menu-host-btn {
    width:100%; background:#2b3a48; color:#cdd; border:1px solid #384450; border-radius:3px;
    font-size:12px; padding:5px 8px; cursor:pointer;
  }
  .games-menu-host-btn:hover { background:#384450; color:#fff; }
  .games-menu-pick-header {
    display:flex; align-items:center; gap:8px;
    padding:4px 8px; border-bottom:1px solid #263340;
  }
  .games-menu-pick-back {
    background:#2b3a48; color:#cdd; border:1px solid #384450; border-radius:3px;
    font-size:12px; padding:2px 8px; cursor:pointer;
  }
  .games-menu-pick-back:hover { background:#384450; color:#fff; }
  .games-menu-pick-running-label {
    padding:6px 8px 0; font-size:11px; font-weight:700; color:#89a; text-transform:uppercase;
  }
  .games-menu-pick-running { max-height:140px; flex:0 0 auto; }
  .games-menu-pick-list { display:flex; flex-wrap:wrap; gap:8px; padding:10px 8px; }
  .games-pick-tile {
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px;
    width:96px; height:72px; background:#1a2530; color:#cdd; border:1px solid #384450;
    border-radius:4px; font-size:12px; cursor:pointer;
  }
  .games-pick-tile:hover { background:#2b3a48; border-color:#8dd; color:#fff; }
  .games-pick-tile-soon { opacity:.45; cursor:default; border-style:dashed; }
  .games-pick-tile-soon:hover { background:#1a2530; border-color:#384450; color:#cdd; }
  .games-pick-sub { font-size:10px; color:#89a; }
  .voice-menu-label { font-weight:700; color:#eee; }
  /* Pill toggle — System 6-ish B&W: black/white only, no muted greys. */
  .voice-menu-toggle {
    position:relative; display:flex; align-items:center; gap:7px; cursor:pointer;
  }
  .voice-menu-toggle input {
    position:absolute; opacity:0; width:0; height:0; pointer-events:none;
  }
  .voice-menu-toggle i {
    position:relative; flex:0 0 30px; width:30px; height:16px;
    border-radius:999px; background:#000; border:1px solid #fff;
    transition:background .15s ease, border-color .15s ease;
  }
  .voice-menu-toggle i::after {
    content:""; position:absolute; top:1px; left:1px;
    width:12px; height:12px; border-radius:50%;
    background:#fff; box-shadow:1px 1px 0 #000;
    transition:transform .15s ease, background .15s ease;
  }
  .voice-menu-toggle input:checked + i {
    background:#fff; border-color:#fff;
  }
  .voice-menu-toggle input:checked + i::after {
    transform:translateX(14px); background:#000;
  }
  .voice-menu-toggle-text {
    min-width:1.6em; font-size:11px; font-weight:600; color:#fff;
  }
  .voice-menu-toggle-text::after { content:"Off"; }
  .voice-menu-toggle input:checked ~ .voice-menu-toggle-text::after { content:"On"; }
  .voice-menu-toggle:focus-within i {
    outline:1px dotted #fff; outline-offset:2px;
  }
  .voice-menu-status { color:#3dff6a; font-size:11px; }
  /* Connecting: per-letter bounce (Sabzlearn-style jump), contained so it
     doesn't spill out of the status row. Static bright green — no multi-layer
     text-shadow / color cycling. */
  .voice-menu-status-connecting {
    overflow:hidden;
    line-height:1.4;
    min-height:1.4em;
  }
  .voice-menu-status-connecting span {
    display:inline-block;
    color:#3dff6a;
    transform:translateY(0.35em) rotate(3deg);
    animation:voiceConnectingJump 2s ease-in-out infinite;
  }
  @keyframes voiceConnectingJump {
    50% {
      transform:translateY(0) rotate(-3deg);
    }
  }
  /* Mode radios as compact selectable rows (custom dots, not OS chrome). */
  .voice-menu-modes {
    display:flex; flex-direction:column; gap:2px;
    padding:2px 4px 4px;
  }
  .voice-menu-radio {
    position:relative; display:flex; align-items:center;
    padding:5px 8px; border-radius:5px; cursor:pointer;
    font-size:12px; color:#fff;
  }
  .voice-menu-radio:hover { background:#000; color:#fff; }
  .voice-menu-radio input {
    position:absolute; opacity:0; width:0; height:0; pointer-events:none;
  }
  .voice-menu-radio span {
    position:relative; padding-left:20px; line-height:1.2;
  }
  .voice-menu-radio span::before {
    content:""; position:absolute; left:0; top:50%;
    width:12px; height:12px; margin-top:-6px;
    border-radius:50%; border:1px solid #fff;
    background:#000; box-sizing:border-box;
  }
  .voice-menu-radio span::after {
    content:""; position:absolute; left:3px; top:50%;
    width:6px; height:6px; margin-top:-3px;
    border-radius:50%; background:#fff;
    opacity:0; transform:scale(.5);
    transition:opacity .12s ease, transform .12s ease;
  }
  .voice-menu-radio input:checked + span { color:#fff; font-weight:700; }
  .voice-menu-radio input:checked + span::before {
    border-color:#fff; background:#000;
  }
  .voice-menu-radio input:checked + span::after {
    opacity:1; transform:scale(1);
  }
  .voice-menu-radio:has(input:checked) {
    background:#000;
  }
  .voice-menu-radio:focus-within {
    outline:1px dotted #fff; outline-offset:-1px;
  }
  .voice-menu-meter {
    margin:2px 8px 6px; height:6px; border-radius:3px; background:#1a1a1a;
    border:1px solid #444; overflow:hidden;
  }
  .voice-menu-meter-fill {
    height:100%; width:0%; background:linear-gradient(90deg,#2ecc55,#7dff9c);
    transition:width .06s linear;
  }
  .voice-menu-talk-label { color:#cdd; }
  .voice-menu-key-btn {
    min-width:36px; height:22px; padding:0 8px;
    border:1px solid #567; border-radius:4px; background:#1e2a33; color:#dff;
    font:700 11px/20px Monaco,Menlo,monospace; cursor:pointer;
  }
  .voice-menu-key-btn:hover { border-color:#7ab; background:#243440; }
  .voice-menu-key-btn.capturing { border-color:#8ad; color:#8ad; }
  .mod-action-popover {
    position:fixed; z-index:200; min-width:160px;
    background:#2a2a2a; border:1px solid #567; border-radius:6px; padding:4px;
    box-shadow:0 4px 14px rgba(0,0,0,.5);
  }
  .mod-action-popover.hidden { display:none; }
  .mod-action-title {
    font-size:11px; color:#8ad; font-weight:700; padding:4px 8px 2px;
    border-bottom:1px solid #444; margin-bottom:2px;
  }
  .mod-action-item {
    display:block; width:100%; text-align:left; box-sizing:border-box;
    padding:5px 8px; border:none; border-radius:4px; background:transparent;
    color:#cdd; font-size:12px; cursor:pointer;
  }
  .mod-action-item:hover { background:#384450; color:#fff; }

  /* ===== Authoring dialogs (Room Editor / Spot Editor / Room Scripts) =====
     Styled after the classic Palace Windows client's ROOMINFO/DOORINFO/
     SCRIPTEDIT dialogs (resources/palace32.rc): light 3D-bevel "Windows 95"
     chrome, right-aligned field labels, a groupbox rule above the button
     row, and a Reset/Delete/Cancel/OK button order. */
  .retro-window { position:relative; background:#c0c0c0; color:#000; width:290px;
                   max-width:92vw; max-height:85vh; overflow-y:auto; padding:0;
                   border:2px solid; border-color:#fff #000 #000 #fff;
                   box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #dfdfdf,
                               0 8px 30px rgba(0,0,0,.6);
                   font:11px Tahoma,"MS Sans Serif",Geneva,sans-serif; }
  .retro-window.retro-wide { width:420px; }
  .retro-window.retro-xwide { width:760px; }
  .retro-titlebar { display:flex; align-items:center; gap:6px; height:20px; flex-shrink:0;
                     padding:0 3px 0 6px; background:linear-gradient(90deg,#000080,#1084d0);
                     color:#fff; font-weight:bold; font-size:12px; user-select:none; }
  .retro-titlebar > span { flex:1 1 auto; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .retro-close { width:16px; height:14px; flex-shrink:0; background:#c0c0c0; color:#000;
                  border:1px solid; border-color:#fff #000 #000 #fff;
                  box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #dfdfdf;
                  font:9px/12px Tahoma,"MS Sans Serif",sans-serif; font-weight:bold; text-align:center;
                  cursor:pointer; padding:0; }
  .retro-close:active { border-color:#000 #fff #fff #000;
                          box-shadow: inset -1px -1px 0 #dfdfdf, inset 1px 1px 0 #808080; }
  /* .retro-titlebar is always paired with the real .title-bar class (see
     every "retro-titlebar title-bar" div in index.html), so every
     classic-stylesheets OS skin's own button[data-close] icon (winxp's
     ::after mask, win9x/cde's background-image) already paints on top of
     these buttons too -- same double-X cause and fix as .fw-close above. */
  body[data-dialog-os] .retro-close { font-size: 0; }
  .retro-body { padding:10px 12px 12px; }
  .retro-window h4 { margin:8px 0 3px; font-size:11px; font-weight:bold; color:#000; }
  .retro-section-label {
    font-size:11px; font-weight:bold; color:#000080; margin:8px 0 4px;
    border-bottom:1px solid #808080; padding-bottom:2px;
  }
  .spot-btn-preset-chips {
    display:flex; flex-wrap:wrap; gap:4px; margin:0 0 8px;
  }
  .spot-btn-chip {
    font-size:11px; padding:3px 8px; border:1px solid #808080; background:#c0c0c0;
    color:#000; cursor:pointer; border-radius:3px;
  }
  .spot-btn-chip:hover { background:#d4d0c8; }
  .spot-btn-chip.sel { background:#000080; color:#fff; border-color:#000060; }
  .retro-row { display:flex; align-items:center; gap:6px; margin-bottom:6px; }
  .retro-row input[type="color"] {
    flex:0 0 28px; width:28px; height:20px; padding:0; border:1px solid #808080; background:#c0c0c0;
  }
  .retro-row.retro-row-tight { margin-bottom:4px; }
  .retro-row.retro-row-top { align-items:flex-start; }
  .retro-row.retro-row-top > label { padding-top:3px; }
  .retro-row > label { flex:0 0 auto; width:76px; text-align:right; font-size:11px; color:#000; }
  .retro-row.retro-row-wide > label { width:auto; }

  /* Spot Editor can be very tall; keep titlebar fixed and scroll content. Also
     wider than the default .retro-wide so all 7 tabs (General/Name Style/Frame
     Style/Pictures/Iptscrae/Reflection/Special Effect) fit on one row instead of
     the last one or two getting clipped past the window edge. */
  #spotEditorModal .retro-window { overflow: hidden; display: flex; flex-direction: column; }
  #spotEditorModal .retro-window.retro-wide { width: 680px; }
  #spotEditorModal .retro-body { overflow-y: auto; }

  /* Non-blocking like Server Settings / Cyborg -- the room (and any other window)
     stays clickable underneath while Spot Info is open, and the titlebar drags the
     window instead of the whole page dimming out. */
  #spotEditorModal.modal-backdrop {
    background: transparent;
    pointer-events: none;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 18px 18px;
    z-index: 86;
  }
  #spotEditorModal .retro-window {
    pointer-events: auto;
    box-shadow: 4px 4px 0 rgba(0,0,0,.35);
  }
  #spotEditorModal .retro-titlebar { cursor: move; }
  .retro-btn.retro-btn-left { margin-right: auto; }
  .retro-row input[type="text"], .retro-row input[type="number"], .retro-row input[type="url"],
  .retro-row input[type="password"], .retro-row input[type="email"],
  .retro-row select, .retro-row input[type="file"] {
    flex:1 1 auto; min-width:0; background:#fff; color:#000;
    border:1px solid; border-color:#000 #fff #fff #000;
    box-shadow: inset 1px 1px 0 #808080; font:11px Tahoma,"MS Sans Serif",sans-serif;
    padding:2px 4px; box-sizing:border-box;
  }
  .retro-row input[readonly] { background:#c0c0c0; }
  .retro-row input.retro-narrow { flex:0 0 52px; }
  .retro-row .retro-btn.retro-inline { flex:0 0 auto; }
  .retro-lock-btn {
    min-width:28px; width:28px; height:26px; padding:0;
    display:inline-flex; align-items:center; justify-content:center;
  }
  .retro-lock-icon {
    width:20px; height:20px; display:block; cursor:pointer;
  }
  .retro-lock-icon .lock-top{
    fill: none;
    stroke: #02ac1e;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-miterlimit: 10;
    stroke-dasharray: 300;
    stroke-dashoffset: -30;
    transition: all 300ms ease-out;
  }
  .retro-lock-icon .lock-top.loaded {
    stroke-dashoffset: 0;
    stroke: #fa113d;
  }
  .retro-lock-icon .lock-top.loaded ~ .lock-body {
    fill: #fa113d;
  }
  .retro-lock-icon .lock-top.loading {
    stroke: #000;
    opacity: 0.3;
  }
  .retro-lock-icon .lock-outline{
    fill: #fff;
  }
  .retro-lock-icon .lock-body {
    fill: #02ac1e;
    opacity: 1;
    transition: all 300ms ease-out;
  }
  .retro-lock-icon .lock-body.loading{
    fill: #000 !important;
    opacity: 0.3;
  }
  .retro-lock-icon .lock-spinner {
    fill: none;
    stroke: #000;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-miterlimit: 10;
    opacity: 0;
    transition: opacity 200ms ease;
  }
  .retro-lock-icon .lock-spinner.loading{
    opacity: 1;
  }
  .retro-hint.retro-error { color:#800; }
  .script-error-detail {
    margin: 0;
    padding: 6px 8px;
    background: #1c1c1c;
    border: 1px solid #333;
    border-radius: 3px;
    max-height: 320px;
    overflow: auto;
    font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    color: #e8e8e8;
    white-space: pre;
  }
  .retro-row input:disabled, .retro-check input:disabled { opacity:0.7; cursor:default; }
  .retro-checkgrid { display:grid; grid-template-columns:1fr 1fr 1fr; gap:2px 6px; margin:6px 0; }
  .retro-checkgrid.retro-checkgrid-2 { grid-template-columns:1fr 1fr; }
  .retro-check { display:flex; align-items:center; gap:4px; font-size:11px; color:#000; }
  .retro-check input[type="checkbox"] { width:12px; height:12px; margin:0; accent-color:#000080; }
  .retro-check input[type="radio"] { width:12px; height:12px; margin:0; accent-color:#000080; }
  .retro-radio-list { display:flex; flex-direction:column; gap:6px; margin:8px 0; }
  .retro-sep { height:0; border:none; border-top:1px solid #808080; border-bottom:1px solid #fff;
               margin:8px 0; }
  .retro-btnrow { display:flex; gap:6px; padding-top:2px; }
  .retro-btnrow.retro-btnrow-end { justify-content:flex-end; }
  .retro-btn { min-width:56px; padding:3px 10px; background:#c0c0c0; color:#000;
               border:1px solid; border-color:#fff #000 #000 #fff;
               box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #dfdfdf;
               font:11px Tahoma,"MS Sans Serif",sans-serif; cursor:pointer; }
  .retro-btn:active { border-color:#000 #fff #fff #000;
                        box-shadow: inset -1px -1px 0 #dfdfdf, inset 1px 1px 0 #808080; }
  .retro-btn:disabled { color:#808080; cursor:default; text-shadow:1px 1px 0 #fff; }
  .retro-btn.retro-btn-default { font-weight:bold; }
  .retro-btn.retro-btn-danger { color:#800; }
  .retro-hint { font-size:10px; color:#333; margin:4px 0 8px; line-height:1.4; }
  #globalMessageModal .retro-textarea { height:72px; resize:vertical; font-family:Tahoma,"MS Sans Serif",Geneva,sans-serif; }
  .retro-textarea { width:100%; height:120px; box-sizing:border-box; resize:vertical;
                      background:#fff; color:#000; font:11px/1.4 "Courier New",monospace;
                      border:1px solid; border-color:#000 #fff #fff #000;
                      box-shadow: inset 1px 1px 0 #808080; padding:4px; white-space:pre; overflow:auto; }

  /* Iptscrae editor: black code pane inside retro chrome (PalaceV9 highlight overlay). */
  .ipt-editor { position:relative; width:100%; height:320px; box-sizing:border-box;
                border:1px solid; border-color:#000 #fff #fff #000;
                box-shadow: inset 1px 1px 0 #808080; background:#000; overflow:hidden; }
  .ipt-highlight, .ipt-textarea {
    box-sizing:border-box; position:absolute; inset:0; width:100%; height:100%;
    margin:0; padding:8px; border:none; outline:none;
    font:12px/1.45 Menlo,Consolas,"Courier New",monospace; tab-size:4;
    white-space:pre; overflow:auto; }
  .ipt-highlight { color:transparent; background:transparent; pointer-events:none; z-index:1;
                   margin:0; }
  .ipt-textarea { z-index:2; color:transparent; caret-color:#0ff; background:transparent;
                  resize:none; -webkit-text-fill-color:transparent; }
  .ipt-comment  { color:#556; font-style:italic; }
  .ipt-string   { color:#6dbf7b; }
  .ipt-number   { color:#c480c4; }
  .ipt-command  { color:#6bbfc8; }
  /* Extended iptscrae (PalaceV9 "pawn" reference set) opcodes: violet, distinct from classic
     command teal, so a script author can see at a glance which words need Preferences >
     Room Experience > "Enable extended iptscrae (by pawn)" turned on to actually run. */
  .ipt-command-ext { color:#a888e0; }
  .ipt-control  { color:#c87070; font-weight:bold; }
  .ipt-event    { color:#c8a84e; font-weight:bold; }
  .ipt-variable { color:#c0c0c0; }
  .ipt-extvar   { color:#c0c0c0; text-shadow:0 0 4px rgba(107,191,200,0.7), 0 0 10px rgba(107,191,200,0.5); }
  .ipt-operator { color:#c88a4e; }
  .ipt-bracket  { color:#7a7ebc; }

  /* Non-blocking like Server Settings / Account — room UI stays interactive underneath. */
  #cyborgModal.modal-backdrop {
    background: transparent;
    pointer-events: none;
    align-items: flex-start;
    justify-content: center;
    padding: 56px 18px 18px;
    z-index: 82;
  }
  #cyborgModal .retro-window {
    pointer-events: auto;
    width:520px; min-width:360px; min-height:300px; max-width:96vw; max-height:92vh;
    display:flex; flex-direction:column; overflow:hidden;
    box-shadow: 4px 4px 0 rgba(0,0,0,.35);
  }
  #cyborgModal .retro-titlebar { cursor:move; flex-shrink:0; }
  #cyborgModal .retro-body {
    flex:1 1 auto; min-height:0; display:flex; flex-direction:column; overflow:hidden;
  }
  #cyborgModal .ipt-editor { flex:1 1 auto; height:auto; min-height:140px; }
  #cyborgModal .retro-hint, #cyborgModal .retro-sep, #cyborgModal .retro-btnrow,
  #cyborgModal .cyborg-librow, #cyborgModal .cyborg-editor-label { flex-shrink:0; }
  #cyborgModal .cyborg-librow {
    display:flex; align-items:flex-end; gap:8px; margin-bottom:6px; flex-wrap:wrap;
  }
  #cyborgModal .cyborg-field {
    flex:1 1 120px; min-width:0; display:flex; flex-direction:column; gap:2px;
  }
  #cyborgModal .cyborg-field > label,
  #cyborgModal .cyborg-editor-label {
    font-size:11px; color:#000; font-weight:bold;
  }
  #cyborgModal .cyborg-editor-label { display:block; margin:2px 0 2px; }
  #cyborgModal .cyborg-librow select,
  #cyborgModal .cyborg-librow input[type="text"] {
    width:100%; min-width:0; background:#fff; color:#000;
    border:1px solid; border-color:#000 #fff #fff #000;
    box-shadow: inset 1px 1px 0 #808080; font:11px Tahoma,"MS Sans Serif",sans-serif;
    padding:2px 4px; box-sizing:border-box;
  }
  #cyborgModal .retro-resize-ear {
    position:absolute; right:0; bottom:0; width:14px; height:14px;
    cursor:nwse-resize; z-index:5;
    background: linear-gradient(135deg, transparent 0 55%, #808080 55% 70%, transparent 70% 75%, #808080 75% 88%, transparent 88%);
  }
  .retro-scroll { max-height:120px; overflow-y:auto; border:1px solid; border-color:#000 #fff #fff #000;
                   box-shadow: inset 1px 1px 0 #808080; background:#fff; padding:4px; margin-bottom:6px; }

  /* Icon-view grid for the Image Browser (win9x "Open" dialog look): fixed-size
     tiles with a thumbnail on top and the filename below, dotted selection
     rect that inverts to Windows' classic selection blue on click. */
  .retro-icongrid { max-height:280px; display:flex; flex-wrap:wrap; align-content:flex-start;
                      gap:2px; padding:6px; }
  .retro-icongrid-msg { padding:8px; font-size:11px; color:#333; width:100%; }
  .retro-icon-item { width:72px; padding:4px 2px; display:flex; flex-direction:column;
                       align-items:center; gap:3px; cursor:pointer; border:1px dotted transparent; }
  .retro-icon-item:hover { border-color:#808080; }
  .retro-icon-item.selected { background:#000080; border-color:#000080; }
  .retro-icon-item.selected .retro-icon-label { color:#fff; }
  .retro-icon-thumb { width:48px; height:48px; display:flex; align-items:center; justify-content:center;
                        background:#fff; border:1px solid; border-color:#808080 #fff #fff #808080; }
  .retro-icon-thumb img { max-width:44px; max-height:44px; image-rendering:pixelated; }
  .retro-icon-label { font-size:10px; color:#000; text-align:center; width:100%;
                        overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

  /* Server Settings > Media tab gallery -- same tile pattern as the Image
     Browser above, but bigger tiles/thumbs so uploaded backgrounds and
     sounds are easy to recognize at a glance, plus a play/pause button on
     audio tiles in place of an image thumbnail. */
  .retro-mediagrid { max-height:360px; display:flex; flex-wrap:wrap; align-content:flex-start;
                       gap:4px; padding:8px; }
  .retro-media-item { width:120px; padding:6px 4px; display:flex; flex-direction:column;
                         align-items:center; gap:4px; cursor:pointer; border:1px dotted transparent; 
                         position:relative; }
  .retro-media-item:hover { border-color:#808080; }
  .retro-media-item.selected { background:#000080; border-color:#000080; }
  .retro-media-item.selected .retro-icon-label { color:#fff; }
  .retro-media-thumb { width:104px; height:104px; display:flex; align-items:center; justify-content:center;
                          background:#fff; border:1px solid; border-color:#808080 #fff #fff #808080; 
                          position:relative; overflow:hidden; }
  .retro-media-thumb img { max-width:98px; max-height:98px; image-rendering:pixelated; }
  .retro-media-thumb video { max-width:98px; max-height:98px; }
  .retro-media-thumb .retro-media-file-glyph { font-size:36px; line-height:1; color:#808080; }
  .retro-media-thumb .retro-media-video-badge { position:absolute; top:2px; right:2px; 
                                                  background:rgba(0,0,0,0.7); color:#fff; 
                                                  padding:2px 4px; font-size:9px; border-radius:2px; }
  .retro-media-playbtn { width:56px; height:56px; border-radius:50%; font-size:18px;
                            display:flex; align-items:center; justify-content:center; padding:0; }

  /* Server Settings > Emojis tab tiles -- smaller than the Media gallery
     (emoji are tiny by design), with per-tile action buttons instead of a
     select-then-toolbar flow since Approve/Reject/Delete are one-shot. */
  .retro-emoji-item { width:88px; padding:6px 4px; display:flex; flex-direction:column;
                       align-items:center; gap:4px; }
  .retro-emoji-thumb { width:48px; height:48px; display:flex; align-items:center; justify-content:center;
                        background:#fff; border:1px solid; border-color:#808080 #fff #fff #808080; }
  .retro-emoji-thumb img { max-width:40px; max-height:40px; }
  .retro-emoji-name { font-size:10px; color:#000; text-align:center; width:100%;
                       overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .retro-emoji-uploader { font-size:9px; color:#555; text-align:center; width:100%;
                           overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .retro-emoji-actions { display:flex; flex-wrap:wrap; gap:2px; }
  .retro-emoji-actions .retro-btn { font-size:10px; padding:1px 4px; }
  /* Beat the OS theme skins' generic ".window button" rules (win9x forces
     min-width:75px, macos9 58px, etc.) which otherwise blow out this 88px
     tile and clip the button labels -- see dialog-classic-themes.generated.css. */
  #serverSettingsModal .retro-emoji-actions .retro-btn {
    min-width: 0; min-height: 0; font-size: 10px; padding: 1px 4px; line-height: 1.3;
  }
  .retro-media-playbtn.playing { color:#800; }
  
  /* Drag & Drop Zone */
  .retro-media-dropzone { min-height:120px; margin:8px 0; padding:20px; 
                          background:#f0f0f0; border:2px dashed #808080; 
                          border-radius:4px; cursor:pointer; transition:all 0.2s ease; }
  .retro-media-dropzone:hover { border-color:#000080; background:#e8e8e8; }
  .retro-media-dropzone.drag-over { border-color:#000080; background:#d0d0ff; 
                                     border-style:solid; }
  .retro-media-dropzone-content { display:flex; flex-direction:column; align-items:center; 
                                   gap:8px; pointer-events:none; }
  .retro-media-dropzone-icon { font-size:48px; line-height:1; opacity:0.6; }
  .retro-media-dropzone-text { font-size:14px; font-weight:bold; color:#000; }
  .retro-media-dropzone-hint { font-size:11px; color:#666; }
  
  /* Upload Queue */
  .retro-media-upload-queue { margin:8px 0; }
  .retro-media-upload-list { max-height:200px; overflow-y:auto; background:#fff; 
                              border:1px solid; border-color:#808080 #fff #fff #808080; 
                              padding:4px; }
  .retro-media-upload-item { display:flex; align-items:center; gap:8px; padding:6px; 
                              margin:2px 0; background:#f0f0f0; border-radius:2px; }
  .retro-media-upload-item.uploading { background:#ffffcc; }
  .retro-media-upload-item.success { background:#ccffcc; }
  .retro-media-upload-item.error { background:#ffcccc; }
  .retro-media-upload-icon { font-size:20px; line-height:1; flex:0 0 auto; }
  .retro-media-upload-info { flex:1 1 auto; min-width:0; }
  .retro-media-upload-filename { font-size:11px; font-weight:bold; color:#000; 
                                  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .retro-media-upload-status { font-size:10px; color:#666; }
  .retro-media-upload-progress { height:4px; background:#808080; border-radius:2px; 
                                  margin-top:2px; overflow:hidden; }
  .retro-media-upload-progress-bar { height:100%; background:#000080; 
                                      transition:width 0.3s ease; }
  .retro-media-upload-cancel { flex:0 0 auto; }
  
  /* Enhanced Media Player */
  .retro-media-player { display:flex; flex-direction:column; gap:8px; margin:4px 0 6px;
                          padding:8px; background:#fff;
                          border:1px solid; border-color:#808080 #fff #fff #808080; }
  .retro-media-player.hidden { display:none; }
  .retro-media-player-header { display:flex; align-items:center; gap:8px; }
  .retro-media-player-label { font-size:11px; color:#808080; flex:0 0 auto; }
  .retro-media-player-name { font-size:11px; color:#000; flex:1 1 auto; min-width:0;
                               overflow:hidden; text-overflow:ellipsis; white-space:nowrap; 
                               font-weight:bold; }
  .retro-media-player-content { display:flex; justify-content:center; align-items:center;
                                 background:#000; border:1px solid #808080; }
  .retro-media-player-content audio { width:100%; max-width:400px; }
  .retro-media-player-content video { max-width:100%; max-height:300px; }
  #serverSettingsMediaStopBtn { color:#800; }

  /* Property-sheet-style tab strip (used by Server Settings). Active tab
     sits flush with the body below it; inactive tabs sit one pixel lower
     and slightly darker, matching the classic Win95 tab control. */
  .retro-tabbar { display:flex; flex-wrap:wrap; gap:2px; padding:6px 6px 0; }
  .retro-tab-btn { position:relative; top:1px; padding:4px 12px 3px; background:#b4b4b4; color:#000;
                    border:1px solid; border-color:#fff #808080 #808080 #fff; border-bottom:none;
                    font:11px Tahoma,"MS Sans Serif",sans-serif; cursor:pointer; }
  .retro-tab-btn.active { top:0; background:#c0c0c0; font-weight:bold; z-index:1; }
  .retro-tabbar + .retro-body { border-top:1px solid #808080; padding-top:8px; }
  .retro-tabpanel.hidden { display:none; }

  /* Iptscrae | Lua mode switcher for room / spot script editors */
  .script-lang-mode {
    display:inline-flex; gap:0; margin:0 0 8px; border:1px solid #808080;
    box-shadow: inset 1px 1px 0 #fff;
  }
  .script-lang-mode-btn {
    padding:3px 12px; background:#b4b4b4; color:#000; border:none;
    border-right:1px solid #808080; font:11px Tahoma,"MS Sans Serif",sans-serif;
    cursor:pointer;
  }
  .script-lang-mode-btn:last-child { border-right:none; }
  .script-lang-mode-btn.active {
    background:#c0c0c0; font-weight:bold;
    box-shadow: inset 1px 1px 2px #808080;
  }
  .script-lang-mode-btn.has-script:not(.active)::after {
    content:'';
    display:inline-block; width:5px; height:5px; margin-left:4px;
    border-radius:50%; background:#080; vertical-align:middle;
  }
  .script-lang-pane.hidden { display:none; }
  .script-lang-pane .retro-textarea,
  .script-lang-pane textarea.retro-textarea {
    min-height:180px; width:100%; box-sizing:border-box;
    font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  }

  .spot-script-slotbar {
    display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:0 0 8px;
  }
  .spot-script-slotbar .script-lang-mode { margin:0; }
  .spot-script-slot-meta { font-size:10px; color:#333; }
  #spotEditorModal .spot-script-editor { height:220px; }

  .retro-manager-list { display:flex; flex-direction:column; gap:2px; }
  .retro-manager-row { display:flex; align-items:center; justify-content:space-between; gap:6px; }
  .retro-manager-row .retro-btn { min-width:0; padding:1px 8px; flex:0 0 auto; }
  .retro-manager-row.selectable { cursor:pointer; padding:1px 4px; }
  .retro-manager-row.selectable:hover { background:#d8d8d8; }
  .retro-manager-row.selected { background:#000080; color:#fff; }
  .retro-icon-btn { min-width:0; padding:3px 8px; font-size:13px; line-height:1; }

  /* Server Settings > Blessed Operators sortable table */
  .bless-table { width:100%; border-collapse:collapse; font-size:11px; }
  .bless-table th, .bless-table td { text-align:left; padding:2px 6px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:160px; }
  .bless-table th { background:#c0c0c0; border:1px solid; border-color:#fff #808080 #808080 #fff; cursor:pointer; user-select:none; }
  .bless-table th:hover { background:#d4d0c8; }
  .bless-table th[aria-sort="ascending"]::after  { content:' \25B4'; }
  .bless-table th[aria-sort="descending"]::after { content:' \25BE'; }
  .bless-table td { border-bottom:1px solid #e8e8e8; }
  .bless-table tr:hover td { background:#d8e4f0; }
  .bless-table .bless-col-action { width:60px; text-align:right; }
  .bless-table .bless-col-action .retro-btn { padding:1px 6px; font-size:11px; }

  /* Server Settings > Analytics tab */
  .analytics-summary { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-bottom:8px; }
  .analytics-summary-grid { display:grid; grid-template-columns:1fr 1fr; gap:4px 8px; flex:1 1 auto; min-width:0; }
  .analytics-summary-item { display:flex; flex-direction:column; padding:4px 6px; background:#fff;
                              border:1px solid; border-color:#000 #fff #fff #000;
                              box-shadow: inset 1px 1px 0 #808080; }
  .analytics-summary-label { font-size:9px; color:#333; text-transform:uppercase; letter-spacing:.02em; }
  .analytics-summary-value { font-size:12px; font-weight:bold; color:#000; }

  /* Occupancy gauge: 3x3 grid + conic arc + needle (CSS-only, retro chrome). */
  .analytics-gauge {
    --gauge-start: 220deg;
    --gauge-range: 280deg;
    --gauge-fill: 0deg;
    --gauge-needle-rot: 220deg;
    --gauge-peak-rot: 220deg;
    --gauge-bdw: 14cqi;
    --gauge-segments: 10;
    container-type: inline-size;
    flex: 0 0 118px;
    width: 118px;
    aspect-ratio: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 4px;
    background: #fff;
    border: 1px solid;
    border-color: #000 #fff #fff #000;
    box-shadow: inset 1px 1px 0 #808080;
  }
  .analytics-gauge-arc {
    grid-area: 1 / 1 / 4 / 4;
    border-radius: 50%;
    background: conic-gradient(
      from var(--gauge-start),
      #2a8a4a,
      #7ab83a,
      #c9b82a,
      #c87820,
      #b83228 var(--gauge-fill),
      #c0c0c0 0 var(--gauge-range),
      transparent 0
    );
    -webkit-mask-image:
      radial-gradient(circle at 50% 50%,
        transparent calc(50cqi - var(--gauge-bdw)),
        #000 0),
      repeating-conic-gradient(
        from var(--gauge-start) at 50% 50%,
        #000 0 1.2deg,
        transparent 0 calc(var(--gauge-range) / var(--gauge-segments)));
    mask-image:
      radial-gradient(circle at 50% 50%,
        transparent calc(50cqi - var(--gauge-bdw)),
        #000 0),
      repeating-conic-gradient(
        from var(--gauge-start) at 50% 50%,
        #000 0 1.2deg,
        transparent 0 calc(var(--gauge-range) / var(--gauge-segments)));
    -webkit-mask-composite: source-out;
    mask-composite: subtract;
  }
  .analytics-gauge-needle,
  .analytics-gauge-peak {
    grid-area: 1 / 1 / 4 / 4;
    width: 3px;
    height: 36%;
    place-self: center;
    transform-origin: 50% 100%;
    pointer-events: none;
  }
  .analytics-gauge-needle {
    z-index: 3;
    background: #222;
    clip-path: polygon(50% 0, 100% 78%, 50% 100%, 0 78%);
    transform: rotate(var(--gauge-needle-rot));
    transition: transform 0.45s ease-out;
  }
  .analytics-gauge-peak {
    z-index: 2;
    width: 2px;
    height: 40%;
    background: #666;
    opacity: 0.85;
    clip-path: polygon(50% 0, 100% 12%, 50% 18%, 0 12%);
    transform: rotate(var(--gauge-peak-rot));
    transition: transform 0.45s ease-out;
  }
  .analytics-gauge-peak.is-hidden { visibility: hidden; }
  .analytics-gauge-readout {
    grid-area: 2 / 2 / 3 / 3;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.1;
    pointer-events: none;
  }
  .analytics-gauge-value { font-size: 16px; font-weight: bold; color: #000; }
  .analytics-gauge-caption { font-size: 8px; color: #333; text-transform: uppercase; letter-spacing: .02em; }
  .analytics-gauge-min,
  .analytics-gauge-max {
    z-index: 4;
    font-size: 9px;
    color: #333;
    align-self: end;
    padding-bottom: 2px;
  }
  .analytics-gauge-min { grid-area: 3 / 1 / 4 / 2; justify-self: start; padding-left: 2px; }
  .analytics-gauge-max { grid-area: 3 / 3 / 4 / 4; justify-self: end; padding-right: 2px; }

  .analytics-room-row { flex-direction: column; align-items: stretch; gap: 2px; }
  .analytics-room-main { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
  .analytics-room-bar {
    height: 5px;
    background: #dfdfdf;
    border: 1px solid;
    border-color: #808080 #fff #fff #808080;
    box-shadow: inset 1px 1px 0 #c0c0c0;
  }
  .analytics-room-bar > span {
    display: block;
    height: 100%;
    width: var(--room-bar-pct, 0%);
    max-width: 100%;
    background: linear-gradient(90deg, #2a8a4a, #7ab83a 55%, #c9b82a);
    transition: width 0.35s ease-out;
  }
  .analytics-row-stats { font-size:10px; color:#333; flex:0 0 auto; text-align:right; }
  .analytics-user-list { max-height:180px; }
  .analytics-user-row { flex-direction:column; align-items:stretch; gap:2px; }
  .analytics-user-main { display:flex; align-items:center; justify-content:space-between; gap:6px; }
  .analytics-details-toggle { min-width:0; padding:1px 8px; flex:0 0 auto; }
  .analytics-user-details { display:flex; flex-direction:column; gap:2px; margin:2px 0 4px 4px;
                              padding:4px 6px; background:#eee; border:1px solid #ccc; font-size:10px; }
  .analytics-user-details.hidden { display:none; }
  .analytics-detail-row strong { color:#333; }
  .discovery-cat-count { font-weight:normal; color:#333; margin-left:4px; }
  .discovery-platinum { display:grid; gap:10px; }
  .discovery-platinum.hidden { display:none; }
  .discovery-settings-card, .discovery-invites-card {
    padding:8px; border:1px solid; border-color:#fff #808080 #808080 #fff; background:#c0c0c0;
  }
  .discovery-card-header { display:flex; flex-direction:column; gap:1px; margin:-2px 0 8px;
    padding-bottom:6px; border-bottom:1px solid #808080; box-shadow:0 1px 0 #fff; }
  .discovery-card-header strong { font-size:12px; }
  .discovery-card-header span { color:#333; font-size:10px; }
  .discovery-lower-grid { display:grid; grid-template-columns:minmax(180px, .7fr) minmax(0, 2fr); gap:12px; }
  .discovery-audience { margin-top:10px; }
  .discovery-card-actions { justify-content:flex-end; padding-top:4px; }
  .discovery-close-row { justify-content:flex-end; }
  .discovery-category-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:3px 8px;
    max-height:160px; overflow-y:auto; margin:6px 0 10px; padding:6px; background:#fff;
    border:1px solid; border-color:#000 #fff #fff #000; box-shadow:inset 1px 1px 0 #808080; }
  .discovery-cat-chip { font-size:11px; }
  .discovery-invite-list { max-height:160px; }
  .discovery-invite-row { align-items:center; gap:6px; padding:4px; }
  .discovery-invite-row.revoked { opacity:.55; }
  .discovery-invite-main { flex:1 1 auto; min-width:0; }
  .discovery-invite-url { display:block; overflow:hidden; color:#000080; font:10px/1.4 "Courier New",monospace;
    text-decoration:underline; text-overflow:ellipsis; white-space:nowrap; }
  .discovery-invite-meta { font-size:10px; color:#333; margin-top:2px; }
  .discovery-invite-create { flex-wrap:wrap; }
  @media (max-width:680px) {
    .discovery-lower-grid { grid-template-columns:1fr; }
    .discovery-category-grid { grid-template-columns:repeat(2, 1fr); }
  }
  .retro-checkgrid-3 { grid-template-columns:1fr 1fr 1fr; }
  .invite-space-name { font-size:15px; font-weight:700; color:#dff0ff; text-align:center; margin:0 0 8px; }
  .invite-space-meta { font-size:11px; color:#9ab; text-align:center; margin:0 0 10px; }
  #inviteAcceptModal .modal-bigbtn-naked + .modal-bigbtn-naked { margin-top:8px; }
  .spot-state-list { display:flex; flex-direction:column; gap:8px; margin-bottom:6px; }
  .spot-state-row {
    border:1px solid; border-color:#808080 #fff #fff #808080; background:#c0c0c0;
    box-shadow: inset 1px 1px 0 #dfdfdf; padding:4px 6px;
  }
  .spot-state-row-head { display:flex; align-items:center; gap:3px; margin-bottom:4px; }
  .spot-state-index { font-size:11px; font-weight:bold; color:#000080; }
  .spot-state-row-spacer { flex:1 1 auto; }
  .spot-state-row-head .retro-btn { min-width:0; padding:1px 7px; font-size:11px; line-height:1.3; }
  .spot-state-row-body { display:flex; gap:8px; align-items:flex-start; }
  .spot-state-thumb {
    flex:0 0 44px; width:44px; height:44px; display:flex; align-items:center; justify-content:center;
    background:#fff; border:1px solid; border-color:#000 #fff #fff #000;
    box-shadow: inset 1px 1px 0 #808080; overflow:hidden;
  }
  .spot-state-thumb img { width:100%; height:100%; object-fit:contain; image-rendering:pixelated; }
  .spot-state-thumb-empty { font-size:9px; color:#888; text-align:center; padding:2px; line-height:1.2; }
  .spot-state-row-fields { flex:1 1 auto; min-width:0; }
  .spot-state-row-fields .retro-row:last-child { margin-bottom:0; }
  .spot-state-row input.retro-narrow { flex:0 0 52px; }
  .spot-state-row.spot-state-row-active { outline:2px solid #000080; outline-offset:-1px; }

  /* Menu Items tab (HS_Menu spots) -- rows reuse .spot-state-row's retro box styling. */
  .spot-menu-item-list { display:flex; flex-direction:column; gap:8px; margin-bottom:6px; }
  .spot-menu-item-script { margin-top:4px; }
  .spot-menu-item-script .retro-textarea { height:70px; font-family:"Courier New",monospace; font-size:11px; }

  /* Drag-to-scrub strip: preview each state's picture by dragging across the strip,
     rather than scrolling the full editable row list to see what each state looks like. */
  .spot-scrub {
    margin:4px 0 10px; border:1px solid; border-color:#808080 #fff #fff #808080;
    background:#c0c0c0; box-shadow: inset 1px 1px 0 #dfdfdf; padding:8px;
  }
  .spot-scrub.hidden { display:none; }
  .spot-scrub-preview {
    width:100%; height:120px; display:flex; align-items:center; justify-content:center;
    background:#fff; border:1px solid; border-color:#000 #fff #fff #000;
    box-shadow: inset 1px 1px 0 #808080; overflow:hidden; margin-bottom:6px;
  }
  .spot-scrub-preview img { width:100%; height:100%; object-fit:contain; image-rendering:pixelated; }
  .spot-scrub-preview-empty { font-size:11px; color:#888; }
  .spot-scrub-caption { font-size:11px; font-weight:bold; color:#000080; text-align:center; margin-bottom:6px; }
  .spot-scrub-strip { position:relative; height:20px; cursor:grab; user-select:none; touch-action:none; }
  .spot-scrub-strip:active { cursor:grabbing; }
  .spot-scrub-track {
    position:absolute; left:7px; right:7px; top:8px; height:4px; background:#808080;
    border:1px solid; border-color:#000 #fff #fff #000;
  }
  .spot-scrub-fill { position:absolute; left:7px; top:8px; height:4px; width:0; background:#000080; }
  .spot-scrub-handle {
    position:absolute; top:2px; left:0; width:14px; height:14px; margin-left:-7px;
    background:#c0c0c0; border:1px solid; border-color:#fff #000 #000 #fff;
    box-shadow: inset 1px 1px 0 #dfdfdf;
  }
  .spot-scrub-hint { font-size:10px; color:#555; text-align:center; margin:4px 0 0; }

  .spot-points-section { margin-top: 8px; }
  #spotEditPointDecBtn, #spotEditPointIncBtn { padding: 2px 8px; min-width: 30px; }

  #spotEditNameTagSection .retro-row input.retro-narrow { flex: 0 0 48px; }
  #spotEditNameTagSection h4:not(:first-child),
  #spotEditFrameStyleSection h4:not(:first-child) { margin-top:12px; padding-top:8px; border-top:1px solid #d4d0c8; }
  #spotEditFrameStyleSection .retro-row input.retro-narrow { flex: 0 0 48px; }
  .spot-style-preview-frame { width:70%; height:64px; box-sizing:border-box; }
  .spot-style-preview-wrap {
    display:flex; align-items:center; justify-content:center; min-height:46px;
    margin:6px 0 10px; padding:8px; border:1px solid; border-color:#808080 #fff #fff #808080;
    background-color:#242832;
    background-image:
      linear-gradient(45deg, #333750 25%, transparent 25%), linear-gradient(-45deg, #333750 25%, transparent 25%),
      linear-gradient(45deg, transparent 75%, #333750 75%), linear-gradient(-45deg, transparent 75%, #333750 75%);
    background-size: 14px 14px; background-position: 0 0, 0 7px, 7px -7px, -7px 0;
  }
  .spot-style-preview-text { line-height:1.2; }
  .spot-btn-chip-row { display:flex; flex-wrap:wrap; gap:5px; }
  .spot-btn-chip {
    min-width: 0; padding: 3px 10px; background: #c0c0c0; color: #000;
    border: 1px solid; border-color: #fff #000 #000 #fff;
    box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #dfdfdf;
    font: 11px Tahoma,"MS Sans Serif",Geneva,sans-serif; cursor: pointer;
  }
  .spot-btn-chip:active { border-color: #000 #fff #fff #000; }
  .spot-btn-chip.sel { background: #000080; color: #fff; font-weight: bold; }

  /* Authoring dropdown menu + canvas context menu: classic "Operator" popup
     menu chrome (scoped to #authorMenu / #authorCanvasPopover only, so the
     Moderator menu -- which reuses .sim-menu/.mod-action-popover -- keeps
     its normal dark styling). */
  #authorMenu {
    background:#c0c0c0; color:#000; border:1px solid; border-color:#fff #000 #000 #fff;
    box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #dfdfdf, 0 4px 14px rgba(0,0,0,.5);
    border-radius:0; padding:2px; font:11px Tahoma,"MS Sans Serif",sans-serif;
  }
  #authorMenu .sim-menu-section-label {
    color:#000; font-weight:bold; text-transform:none; letter-spacing:0;
    border-bottom:1px solid #808080; margin-bottom:2px; padding:3px 6px 2px;
  }
  #authorMenu .sim-menu-item {
    color:#000; border-radius:0; font:11px Tahoma,"MS Sans Serif",sans-serif; padding:4px 8px;
  }
  #authorMenu .sim-menu-item:hover:not(:disabled) { background:#000080; color:#fff; }
  #authorMenu .sim-menu-check { color:#000; }
  #authorCanvasPopover {
    background:#c0c0c0; color:#000; border:1px solid; border-color:#fff #000 #000 #fff;
    box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #dfdfdf, 0 4px 14px rgba(0,0,0,.5);
    border-radius:0; padding:2px; font:11px Tahoma,"MS Sans Serif",sans-serif;
  }
  #authorCanvasPopover .mod-action-title {
    color:#000; font-weight:bold; border-bottom:1px solid #808080; padding:3px 6px 2px;
  }
  #authorCanvasPopover .mod-action-item {
    color:#000; border-radius:0; font:11px Tahoma,"MS Sans Serif",sans-serif; padding:4px 8px;
  }
  #authorCanvasPopover .mod-action-item:hover { background:#000080; color:#fff; }
  #propEditorTools button.sel { background:#384450; color:#fff; border-color:#8ad; }
  #palHelpBtn   { background-image:url(data:image/gif;base64,R0lGODdhIAAgAPcAAP/////f/8z///+/////qszf//+f/5n///9////fqsy//2b///9f/5nf////Vcz/qv8//zP//8yf//8f//+/qv8A/wD/////AGbf/5m//8x////fVczfqv+fqjPf/5n/qsxf///fAADf/8z/VZmf/2a//8w///9/qv+/Vcwf/8y/qswA/8z/AJl//2b/qjO///9fqpnfqv+/AAC//2af/8zfVf8/qv+fVZlf/zP/qsyfqpn/Vf8fqgD/qv8AqjOf/5k//2Z//8zfAP+fAACf/5kf/2bfqpm/qpkA/5n/AP9/Vcx/qsy/VWZf/zN//2b/Vf9fVTPfqv9/AAB//5nfVcxfqmY//wDfqsy/AJmfqjNf/2Yf//8/VWa/qmYA/2b/ADP/Vcw/qsyfVf9fAABf//8fVZnfAAD/Vf8AVTM//8wfqswAqv8/AAA//zMf/5l/qjO/qjMA/zP/AGbfVZm/VcyfAP8fAAAf/wC/qv8AAAD/AAAA/8x/VWafqplfqmbfAJm/ADPfVcxfVcx/AADfVTOfqpk/qpmfVWZ/qgCfqma/VZkfqsw/VTPfAJkAqsxfAMwfVQDfAMwAVZmfAGZfqjN/qma/AJl/VTO/Vcw/AAB/qgC/VWY/qmafVcwfAMwAADNfqmYfqplfVZl/AGYAqjO/AABfqgC/AGafADM/qjOfVZk/VWZ/VQA/qgCfVTMfqplfAJkfVTMAqpkAVQAfqgAAqjOfAJk/AGZfVWZ/ADN/VQCfAJkfAJkAAAB/VWY/VWZfADNfVTN/AGYfVWYAVQBfVQB/AGY/ADM/VTNfAGYfAAA/VTMfVWYAADMAVQBfAAAfVQAAVTM/AAA/ADMfADMAAAAfAP///+7u7t3d3czMzLu7u6qqqpmZmYiIiHd3d2ZmZlVVVURERDMzMyIiIhEREQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAIAAgAAAIzACxZeNAsKDBgwgTcug2UKHDhxxUsGoIsaJBiRQtWsSosSPHjhsnggyZUSE3XONSsoL40eGhfzBjjnvYUiGrf7hQxlypsGbCcTw5jIM5s6fIh0UJ4iLq0CfEof+CInTqEiY5FU2PVlRB7h+5QzS1QhT3bxzWsCUVvhRH0iKucmdZinXIKqnctDY1UkV4EuzWuQlVxPSLtuJLmLj+4kXY9R83xRoPxS088m5ly5ezLs4cUSrngxI5cBtNurTp06hHJ2bFurXr17BjsxYXEAA7); }

  /* ===== Sim column header ===== */
  .sim-col-header {
    display:flex; align-items:center; gap:4px;
    width:var(--room-w); max-width:100%; margin:0 auto;
    padding:0 0 6px; box-sizing:border-box;
    background:#222222; position:relative;
  }
  .sim-menu-btn {
    padding:1px 7px; border-radius:3px; border:1px solid #444;
    background:#2a2a2a; color:#bbb; cursor:pointer; font-size:14px;
    line-height:1.3; flex-shrink:0;
  }
  .sim-menu-btn:hover { background:#384450; color:#fff; }
  .sim-menu {
    position:absolute; top:24px; left:0; z-index:20; min-width:170px;
    background:#2a2a2a; border:1px solid #555; border-radius:6px; padding:4px;
    box-shadow:0 4px 14px rgba(0,0,0,.5);
  }
  .sim-menu.hidden { display:none; }
  .sim-menu-section-label {
    font-size:11px; color:#888; text-transform:uppercase; letter-spacing:.04em;
    padding:4px 8px 2px;
  }
  .sim-menu-item {
    display:block; width:100%; text-align:left; box-sizing:border-box;
    padding:5px 8px; border:none; border-radius:4px; background:transparent;
    color:#cdd; font-size:12px; cursor:pointer;
  }
  .sim-menu-item:hover:not(:disabled) { background:#384450; color:#fff; }
  .sim-menu-item:disabled { opacity:.4; cursor:default; }
  /* toggle items reserve space for a leading check; shown only when .on */
  .sim-menu-check { display:inline-block; width:14px; margin-right:2px; color:#8dd; visibility:hidden; }
  .sim-menu-toggle.on .sim-menu-check { visibility:visible; }
  .sim-nav-btn {
    padding:1px 7px; border-radius:3px; border:1px solid #444;
    background:#2a2a2a; color:#bbb; cursor:pointer; font-size:14px;
    line-height:1.3; flex-shrink:0;
  }
  .sim-nav-btn:disabled { opacity:.28; cursor:default; }
  .sim-nav-btn:not(:disabled):hover { background:#384450; color:#fff; }
  .sim-disconnect-icon {
    /* Keeps margin-left:auto so Connect stays right-aligned even when hidden */
    width:0; height:0; margin-left:auto; flex-shrink:0; overflow:hidden;
    opacity:0; pointer-events:none; vertical-align:middle;
  }
  .sim-disconnect-icon.stalled {
    width:14px; height:14px; cursor:pointer; pointer-events:auto;
    animation:sim-disconnect-blink 4s steps(1,end) infinite;
  }
  @keyframes sim-disconnect-blink {
    /* 3s off, then 1s on */
    0%, 74.999% { opacity:0; }
    75%, 100% { opacity:1; }
  }
  .sim-connect-btn, .sim-favorite-btn {
    padding:2px 9px; border-radius:3px; font-size:11px; font-weight:600; line-height:13px;
    cursor:pointer; white-space:nowrap; flex-shrink:0; box-sizing:content-box;
  }
  .sim-connect-btn.connect    { border:1px solid #4a7; background:#263526; color:#8dd; }
  .sim-connect-btn.connect:hover { background:#326032; }
  .sim-connect-btn.disconnect { border:1px solid #744; background:#2e2020; color:#d88; }
  .sim-connect-btn.disconnect:hover { background:#3e2828; }
  .sim-favorite-btn {
    border:1px solid #665522; background:#332c18; color:#dc8;
    display:none;
  }
  body.mp-live .sim-favorite-btn { display:inline-block; }
  .sim-favorite-btn:hover { background:#443a1f; }
  .sim-favorite-btn.is-favorite { border-color:#a83; background:#443a1f; color:#fd8; }

  /* ===== Avatar mode folder tabs (Modern / Legacy) ===== */
  /* Flex column so header/tabs/toolbar stay put and only .props-viewport grids scroll. */
  #propViewerArea {
    display:flex; flex-direction:column; min-height:0; overflow:hidden; background:#222;
  }
  #galleryContent {
    position:relative; display:flex; flex:1; min-height:0; flex-direction:column; overflow:hidden;
    background:#222;
  }
  .avatar-mode-tabs {
    display:flex; flex-shrink:0; justify-content:flex-start; align-items:flex-end;
    gap:4px; padding:6px 10px 0; background:#2d2d2d;
    border-top:1px solid #3f3f3f; border-bottom:1px solid #555;
  }
  .avatar-mode-tabs.hidden { display:none; }
  .avatar-mode-tab {
    flex:0 0 auto; padding:7px 14px 6px; margin-bottom:-1px;
    background:#262626; border:1px solid #555; border-bottom-color:transparent;
    border-radius:8px 8px 0 0; color:#999; font-size:13px; cursor:pointer;
    font-family:inherit; line-height:1.2;
  }
  .avatar-mode-tab:hover { color:#ddd; background:#2f2f2f; }
  .avatar-mode-tab.active {
    color:#eee; background:#3a3a3a; border-color:#666; border-bottom-color:#222;
    font-weight:600;
  }
  .avatar-mode-tab.dragging { opacity:.55; }
  .modern-avatar-panel.hidden, #legacyPropPanel.hidden { display:none; }
  .props-toolbar {
    position:relative; flex-shrink:0; z-index:2; height:48px; box-sizing:border-box; flex-wrap:nowrap;
    border-bottom:1px solid #252525; box-shadow:0 2px 6px rgba(0,0,0,.25);
  }
  #propsNakedBtn { flex-shrink:0; }
  .props-toolbar-info-btn {
    width:16px; height:16px; z-index:3; flex-shrink:0;
  }
  .props-info-tour {
    position:absolute; inset:0; z-index:40; margin:0; padding:0;
    pointer-events:none; overflow:hidden;
  }
  .props-info-tour.hidden { display:none; }
  .props-info-balloon {
    appearance:none; -webkit-appearance:none;
    position:absolute; left:0; top:0; width:210px; height:150px;
    margin:0; padding:0; border:none; background:transparent;
    cursor:pointer; pointer-events:auto; overflow:visible; user-select:none;
    opacity:0; transform:scale(0.5); transform-origin:14px 2px;
  }
  .props-info-balloon:focus { outline:none; }
  .props-info-balloon:focus-visible { outline:2px solid #fff9c4; outline-offset:-4px; }
  .props-info-balloon.flip { transform-origin:calc(100% - 14px) 2px; }
  .props-info-balloon.visible {
    opacity:1; transform:scale(1);
    transition:transform 220ms cubic-bezier(.2,1.2,.3,1), opacity 180ms ease-out;
  }
  .props-info-balloon.dismissing {
    opacity:0; transform:scale(0.4); pointer-events:none;
    transition:transform 180ms ease-in, opacity 160ms ease-in;
  }
  .props-info-balloon canvas { display:block; width:210px; height:150px; pointer-events:none; }
  .props-info-balloon-text { pointer-events:none; }
  .props-info-balloon.flip .props-info-balloon-text { left:auto; right:34px; }
  .props-toolbar-section {
    display:flex; flex:1; align-items:center; flex-wrap:nowrap; gap:8px; min-width:0;
    overflow-x:auto; scrollbar-width:thin;
  }
  .props-toolbar .layout-toggle-btn { flex-shrink:0; }
  .props-action-btn {
    min-width:44px; height:24px; flex:0 0 auto; padding:0 8px; border-radius:0; border:1px solid;
    border-color:#888 #333 #333 #888; background:#555; color:#fff;
    cursor:pointer; font-size:12px; line-height:22px; font-weight:600;
  }
  .props-action-btn:hover { background:#666; }
  .props-action-btn:active { border-color:#333 #888 #888 #333; background:#444; }
  .modern-category-control {
    position:relative; display:flex; align-items:center; gap:8px; flex:1 1 auto; min-width:0;
  }
  .modern-category-label {
    color:#fff; font-size:12px; font-weight:600; white-space:nowrap; flex:0 0 auto;
  }
  .modern-category-chips {
    display:flex; align-items:center; gap:4px; min-width:0; flex:1 1 auto;
    overflow-x:auto; scrollbar-width:thin; padding:1px 0;
  }
  .modern-category-chip {
    flex:0 0 auto; height:24px; padding:0 8px; border:1px solid;
    border-color:#888 #333 #333 #888; border-radius:0; background:#555; color:#fff;
    cursor:pointer; font-family:inherit; font-size:11px; font-weight:600; line-height:22px;
    white-space:nowrap;
  }
  .modern-category-chip:hover { background:#666; }
  .modern-category-chip.active {
    background:#333; border-color:#333 #888 #888 #333;
  }
  .modern-category-chip.modern-category-chip-new { color:#cde; }
  .modern-category-chips.drop-ready .modern-category-chip[data-drop-category] {
    border-style:dashed; border-color:#6a9;
  }
  .modern-category-chip.drag-over {
    background:#2a4034; border-style:solid; border-color:#6a9; color:#e8fff2;
  }
  .modern-new-category-box {
    display:flex; align-items:center; gap:6px; flex-shrink:0;
    padding:7px 10px; background:#161616; border-bottom:1px solid #2e2e2e;
  }
  .modern-new-category-input {
    flex:1; min-width:0; max-width:320px; height:30px; padding:0 11px; border:1px solid #444;
    border-radius:5px; background:#222; color:#eee; font:inherit; font-size:12px;
    outline:none; box-shadow:inset 0 1px 2px rgba(0,0,0,.35);
  }
  .modern-new-category-input::placeholder { color:#777; }
  .modern-new-category-input:focus { border-color:#5a7a68; background:#1c1c1c; }
  .modern-new-category-submit {
    height:30px; padding:0 12px; border:1px solid #444; border-radius:5px;
    background:#2a2a2a; color:#ddd; font:inherit; font-size:12px; font-weight:600;
    cursor:pointer; white-space:nowrap;
  }
  .modern-new-category-submit:hover { background:#333; color:#fff; }
  .modern-new-category-cancel {
    width:30px; height:30px; padding:0; border:1px solid transparent; border-radius:5px;
    background:transparent; color:#888; font:inherit; font-size:16px; line-height:1;
    cursor:pointer;
  }
  .modern-new-category-cancel:hover { color:#eee; background:#2a2a2a; }
  .props-viewport {
    position:relative; display:flex; flex:1; min-height:0; overflow:hidden;
    background:#222;
  }
  .modern-avatar-panel, #legacyPropPanel {
    flex:1; min-width:0; min-height:0; overflow:hidden; background:#222;
    animation:props-panel-enter .1s ease-out;
  }
  .modern-avatar-panel, #legacyPropPanel { display:flex; flex-direction:column; }
  #legacyPropPanel .grid { flex:1; min-height:0; overflow-y:auto; background:#222; }
  @keyframes props-panel-enter {
    from { opacity:.65; }
    to { opacity:1; }
  }

  /* ===== Modern prop catalog: square click-to-wear tiles ===== */
  .modern-avatar-grid {
    flex:1; min-height:0; overflow-y:auto; padding:10px; background:#222;
    display:grid; grid-template-columns:repeat(auto-fill,minmax(92px,1fr));
    align-content:start; gap:8px;
  }
  .modern-avatar-grid--empty {
    display:flex; align-items:center; justify-content:center;
    grid-template-columns:none; align-content:center; padding:30px;
  }
  .modern-empty-state {
    max-width:280px; margin:0; padding:0; text-align:center;
    font-size:15px; line-height:1.5; color:#999;
  }
  .modern-gate {
    flex:1; min-height:0; display:flex; flex-direction:column;
    align-items:center; justify-content:center; gap:14px;
    padding:30px; text-align:center; background:#222;
  }
  .modern-gate-title {
    margin:0; font-size:22px; font-weight:700; color:#eee;
  }
  .modern-gate-cta { margin:0; }
  .modern-gate-link {
    color:#6cb2ff; font-size:16px; text-decoration:underline; cursor:pointer;
  }
  .modern-gate-link:hover { color:#9ecbff; }
  .modern-avatar-card {
    position:relative; aspect-ratio:1; min-width:0; overflow:hidden; cursor:pointer;
    display:flex; align-items:center; justify-content:center;
    background:#2c2c2c; border-radius:6px; padding:4px;
    outline:1px solid transparent;
  }
  .modern-avatar-card:hover { background:#343434; }
  .modern-avatar-card.worn,
  .modern-avatar-card.selected {
    outline:1px solid #fff;
    background:#3a3a3a;
  }
  .modern-avatar-thumb {
    width:100%; height:100%; object-fit:contain; border-radius:3px;
    image-rendering:pixelated;
    background:transparent;
  }
  .modern-avatar-name {
    display:none; position:absolute; left:2px; right:2px; bottom:2px; z-index:1;
    margin:0; padding:1px 3px; border-radius:3px; background:#000a;
    font-size:11px; text-align:center; color:#eee;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  body.alt-labels-visible .modern-avatar-name { display:block; }
  .modern-avatar-card.thumb-loading .modern-avatar-thumb { animation:modernThumbPulse 1.1s ease-in-out infinite; }
  @keyframes modernThumbPulse { 0%,100% { opacity:.35; } 50% { opacity:.7; } }
  /* Manual-retry affordance: only shown once auto-retries are exhausted. */
  .modern-thumb-retry {
    display:none; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
    z-index:3; width:32px; height:32px; padding:0; border-radius:50%;
    border:1px solid #855; background:#3a2626; color:#f4b8b8;
    cursor:pointer; font-size:18px; line-height:30px;
  }
  .modern-thumb-retry:hover { background:#4a2c2c; }
  .modern-avatar-card.thumb-failed .modern-thumb-retry { display:block; }
  .modern-avatar-card.thumb-failed .modern-avatar-thumb { opacity:.2; }
  .modern-avatar-meta { display:none; }
  .modern-card-menu-btn {
    position:absolute; top:3px; right:3px; z-index:2; width:20px; height:20px;
    padding:0; border:1px solid #555; border-radius:3px; background:#222c; color:#ddd;
    cursor:pointer; font-size:16px; line-height:16px;
  }
  /* Appended to body so picker overflow never clips it. */
  .modern-context-menu {
    position:fixed; z-index:100000; min-width:176px; max-height:calc(100vh - 16px);
    overflow-y:auto; padding:4px; background:#222; border:1px solid #777;
    border-radius:5px; box-shadow:0 6px 24px #000b; color:#ddd; font-size:12px;
  }
  .modern-context-menu.hidden { display:none; }
  .modern-context-menu button,
  .modern-context-menu label {
    display:flex; align-items:center; gap:7px; box-sizing:border-box; width:100%;
    padding:6px 8px; border:0; background:transparent; color:#ddd;
    text-align:left; cursor:pointer; font:inherit; white-space:nowrap;
  }
  .modern-context-menu button:hover,
  .modern-context-menu label:not(.modern-context-move-label):hover { background:#444; }
  .modern-context-menu button:disabled { color:#666; cursor:default; background:transparent; }
  .modern-context-menu button.danger { color:#f99; }
  .modern-context-menu input { margin:0; accent-color:#6a9; }
  .modern-context-menu select {
    box-sizing:border-box; width:calc(100% - 16px); margin:0 8px 5px; padding:4px;
    border:1px solid #555; border-radius:3px; background:#191919; color:#ddd;
  }
  .modern-context-heading,
  .modern-context-move-label {
    padding:4px 8px 2px; color:#899; font-size:10px; font-weight:700;
    text-transform:uppercase; letter-spacing:.05em;
  }
  .modern-context-divider { height:1px; margin:4px; background:#444; }

  /* Runtime popup for HS_Menu door spots (menu-spot.js openSpotMenuPopup).
     Reuses .modern-context-menu's box/positioning; item rows add an icon. */
  .spot-menu-popup { min-width:140px; }
  .spot-menu-popup-item { font-size:13px; }
  .spot-menu-popup-icon { width:20px; height:20px; object-fit:contain; flex-shrink:0; }

  /* ===== Prop Picker header row (title + count on same line) ===== */
  .prop-col-header {
    display:flex; align-items:baseline; gap:6px; flex-shrink:0;
    padding:4px 14px 2px;
  }
  .prop-col-title {
    font-size:11px; font-weight:700; text-transform:uppercase;
    color:#888; letter-spacing:.06em;
    font-family:-apple-system,Segoe UI,Helvetica,Arial,sans-serif;
    white-space:nowrap;
  }
  .prop-col-title::after { content:''; }  /* no dash - count text follows inline */
  .prop-col-header #propsCount {
    font-size:11px; color:#888;
    font-family:-apple-system,Segoe UI,Helvetica,Arial,sans-serif;
    white-space:nowrap; }
  .prop-detach-btn {
    margin-left:auto; flex-shrink:0; width:20px; height:16px; padding:0;
    border:1px solid #555; border-radius:3px; background:#333; color:#bbb;
    cursor:pointer; font-size:11px; line-height:1;
    display:flex; align-items:center; justify-content:center;
  }
  .prop-detach-btn:hover { background:#444; color:#fff; }

  /* Mac-style close box on the LEFT of the floating title bar (mirrors the paint palette's
     .pp-close). Only shown while floating; docked, the header has no close box. */
  .prop-close-box { display:none; }

  /* ===== Detached / floating Prop Picker window (like the paint palette) ===== */
  .prop-resize-ear { display:none; }
  /* Base z-index before JS assigns one from the shared floating-window stack (panel-detach.js) --
     joins the same click-to-front pool as every other window. */
  #propViewerArea.floating {
    position:fixed; z-index:65;
    left:24px; top:72px; width:360px; height:70vh;
    min-width:220px; min-height:180px; max-width:100vw; max-height:100vh;
    background:#222; border:1px solid #000; border-radius:5px;
    box-shadow:0 8px 30px rgba(0,0,0,.6);
    display:flex; flex-direction:column; overflow:hidden;
  }
  #propViewerArea.floating #galleryContent {
    flex:1; min-height:0; display:flex; flex-direction:column; overflow:hidden;
  }
  /* Floating title bar styled like the paint palette: a classic Mac striped drag bar
     with a square close box on the left. */
  #propViewerArea.floating .prop-col-header {
    cursor:move; user-select:none; flex-shrink:0;
    align-items:center; gap:6px; padding:3px 6px; height:15px;
    background:repeating-linear-gradient(#cfcfcf,#cfcfcf 1px,#8f8f8f 1px,#8f8f8f 2px);
    border-bottom:1px solid #000;
  }
  #propViewerArea.floating .prop-close-box {
    display:inline-block; flex-shrink:0; width:11px; height:11px;
    background:#ddd; border:1px solid #000; box-shadow:inset 0 0 0 1px #fff;
    cursor:pointer;
  }
  #propViewerArea.floating .prop-close-box:hover { background:#fff; }
  /* Dark, readable label against the light striped bar. */
  #propViewerArea.floating .prop-col-title,
  #propViewerArea.floating .prop-col-header #propsCount { color:#222; }
  /* The detach arrow is redundant while floating -- the close box docks it back. */
  #propViewerArea.floating .prop-detach-btn { display:none; }
  #propViewerArea.floating .toolbar { flex-shrink:0; }
  #propViewerArea.floating .props-viewport,
  #propViewerArea.floating .grid,
  #propViewerArea.floating .modern-avatar-grid { flex:1; min-height:0; overflow-y:auto; }
  #propViewerArea.floating .prop-resize-ear {
    display:block; position:absolute; right:0; bottom:0; width:16px; height:16px;
    cursor:nwse-resize; z-index:3;
    background:
      linear-gradient(135deg,
        transparent 0, transparent 46%, #888 46%, #888 56%,
        transparent 56%, transparent 68%, #888 68%, #888 78%,
        transparent 78%);
  }

  /* ===== Detachable panels (room simulator, Log/tabs) =====
     Shared chrome for panels that pop out into a floating window: the detach arrow that
     lives in their docked header, the Mac-style close box that docks them back, and the
     bottom-right resize ear. Close box and ear only exist while floating. */
  .panel-detach-btn {
    flex-shrink:0; width:20px; height:16px; padding:0;
    border:1px solid #555; border-radius:3px; background:#333; color:#bbb;
    cursor:pointer; font-size:11px; line-height:1;
    display:flex; align-items:center; justify-content:center;
  }
  .panel-detach-btn:hover { background:#444; color:#fff; }
  .panel-close-box { display:none; }
  .panel-resize-ear { display:none; }
  .floating > .panel-resize-ear {
    display:block; position:absolute; right:0; bottom:0; width:16px; height:16px;
    cursor:nwse-resize; z-index:3;
    background:
      linear-gradient(135deg,
        transparent 0, transparent 46%, #888 46%, #888 56%,
        transparent 56%, transparent 68%, #888 68%, #888 78%,
        transparent 78%);
  }
  /* Classic Mac striped drag bar + square close box, matching the paint palette and the
     detached Prop Picker. */
  .floating .panel-close-box {
    display:inline-block; flex-shrink:0; width:11px; height:11px;
    background:#ddd; border:1px solid #000; box-shadow:inset 0 0 0 1px #fff;
    cursor:pointer;
  }
  .floating .panel-close-box:hover { background:#fff; }
  .panel-float-bar { display:none; }
  .floating > .panel-float-bar {
    display:flex; align-items:center; gap:6px; flex-shrink:0;
    cursor:move; user-select:none; padding:3px 6px; height:15px; box-sizing:content-box;
    background:repeating-linear-gradient(#cfcfcf,#cfcfcf 1px,#8f8f8f 1px,#8f8f8f 2px);
    border-bottom:1px solid #000;
  }
  .panel-float-title {
    font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.06em;
    color:#222; font-family:-apple-system,Segoe UI,Helvetica,Arial,sans-serif;
  }

  /* ---- Detached room simulator ---- */
  #roomSim.floating {
    position:fixed; z-index:65;
    left:24px; top:56px; width:560px; height:78vh;
    min-width:320px; min-height:240px; max-width:100vw; max-height:100vh;
    background:#222; border:1px solid #000; border-radius:5px;
    box-shadow:0 8px 30px rgba(0,0,0,.6);
    /* Same as #roomTabs.floating: clip so focus scroll can't shear chrome. */
    display:flex; flex-direction:column; overflow:hidden; overflow:clip;
    padding:0 16px 12px;
  }
  #roomSim.floating.hidden { display:none; }
  /* The sim header doubles as the window's drag bar; its buttons still work (see
     makeDetachablePanel, which ignores mousedowns landing on a control). */
  #roomSim.floating .sim-col-header {
    /* max-width:none so the negative margins can pull the bar out over the window's side
       padding -- the docked 100% cap would leave the stripes short of the right edge. */
    width:auto; max-width:none; margin:0 -16px; padding:2px 6px; min-height:15px; flex-shrink:0;
    cursor:move; user-select:none;
    background:repeating-linear-gradient(#cfcfcf,#cfcfcf 1px,#8f8f8f 1px,#8f8f8f 2px);
    border-bottom:1px solid #000;
  }
  #roomSim.floating .sim-menu { top:20px; left:6px; }
  #roomSim.floating .room-frame { margin-top:6px; }
  /* The detach arrow is redundant while floating -- the close box docks it back. Scoped to
     the header so tabs riding along inside the window keep their own detach button. */
  #roomSim.floating > .sim-col-header .panel-detach-btn { display:none; }
  /* Tabs riding along inside the floating window take the leftover height instead of the
     measured-against-the-viewport height updateTabPanelHeight applies when docked. */
  #roomSim.floating > .room-tabs {
    width:auto; margin:6px 0 0; flex:1; min-height:0; display:flex; flex-direction:column;
  }
  #roomSim.floating > .room-tabs .room-tab-content {
    flex:1; min-height:0; height:auto !important; overflow-y:auto;
  }

  /* ---- Detached Log / tabs ---- */
  #roomTabs.floating {
    position:fixed; z-index:64;
    left:24px; top:96px; width:520px; height:320px;
    min-width:240px; min-height:140px; max-width:100vw; max-height:100vh;
    margin:0; background:#222; border:1px solid #000; border-radius:5px;
    box-shadow:0 8px 30px rgba(0,0,0,.6);
    /* overflow:clip (not hidden): hidden still allows the browser to assign
       scrollTop when focusing an abspos control inside, which shears the
       title/tab chrome out of the window. clip forbids scrolling entirely. */
    display:flex; flex-direction:column; overflow:hidden; overflow:clip;
  }
  #roomTabs.floating .room-tabs-bar { flex-shrink:0; padding:4px 4px 0; }
  #roomTabs.floating .room-tab-content {
    flex:1; min-height:0; height:auto !important; overflow-y:auto; border-bottom:none;
  }
  #roomTabs.floating .tabs-detach-btn { display:none; }
  #roomTabs.floating .tabs-dock-toggle-btn { margin-left:auto; }

  /* Detach sits just left of the dock-right toggle, both pushed to the end of the tab bar. */
  .tabs-detach-btn { margin-left:auto; }
  .tabs-detach-btn + .tabs-dock-toggle-btn { margin-left:0; }


  /* Sidebar hidden (toggled by palAvatarBtn) */
  .sidebar.hidden { display:none !important; }
  /* Remove old collapse-to-icon behavior overrides */
  /* ===== Sidebar: hide old header (all controlled by palToolbar) ===== */
  .sidebar-header { display:none !important; }
  .collapsed-footer { display:none !important; }
  /* Sidebar should NEVER collapse into icon toolbar now */
  .sidebar.collapsed { width:auto; padding:12px 14px; overflow:visible; }
  .sidebar.collapsed .sidebar-content { display:block; }

  /* ===== Connect modal username row ===== */
  .conn-user-row { display:flex; align-items:center; gap:8px; margin-bottom:10px; }
  .conn-user-row label { font-size:12px; color:#9ab; white-space:nowrap; min-width:64px; }
  .conn-user-row input[type="text"] {
    flex:1; padding:5px 8px; border-radius:4px; border:1px solid #555;
    background:#1a1a1a; color:#eee; font-size:12px;
  }
  /* Local only: a real checkbox, not a stretched text-input box -- was
     matching the generic `.conn-user-row input` rule above (flex:1, padding,
     dark rounded background) meant for the nickname field, which blew it up
     into a giant empty box. Left small/native so each classic-stylesheets
     theme's own input[type=checkbox] rule (dialog-classic-themes.generated.css)
     draws its proper OS-native checkbox chrome on top of this. */
  .conn-user-row input[type="checkbox"] { flex:0 0 auto; width:13px; height:13px; margin:0; accent-color:#000080; }

  /* ===== Credits/Thank You modal: ensure it inherits proper sizing ===== */
  /* Classic Palace Credits window (AboutBox.c: 256×196 stage).
     Always Mac Platinum chrome — matches the original About box. */
  #creditsModal .credits-window {
    width: auto;
    max-width: none;
    padding: 0;
    overflow: hidden;
    background: #dddddd;
    color: #000;
    border: 1px solid #000;
    border-radius: 2px;
    box-shadow:
      -1px -1px 0 #fff,
      1px 1px 0 #808080,
      inset 1px 1px 0 #eee,
      inset -1px -1px 0 #808080,
      2px 2px 0 rgba(0, 0, 0, 0.35);
    font: 11px Geneva, Verdana, Arial, sans-serif;
  }
  #creditsModal .credits-window .retro-titlebar {
    height: 22px;
    padding: 0 6px 0 4px;
    gap: 6px;
    background: repeating-linear-gradient(
      to bottom,
      #cfcfcf 0px,
      #cfcfcf 1px,
      #8f8f8f 1px,
      #8f8f8f 2px
    );
    color: #111;
    font: bold 11px Geneva, Verdana, Arial, sans-serif;
    border-bottom: 1px solid #404040;
  }
  #creditsModal .credits-window .retro-close {
    order: -1;
    width: 13px;
    height: 13px;
    margin-right: 2px;
    background: linear-gradient(#d8d8d8, #a8a8a8);
    color: transparent;
    border: 1px solid #202020;
    border-radius: 1px;
    box-shadow:
      inset 1px 1px 0 #f0f0f0,
      inset -1px -1px 0 #707070;
    font-size: 0;
    line-height: 0;
  }
  #creditsModal .credits-body {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    background: #000;
    border-top: 1px solid #808080;
    overscroll-behavior: contain;
    touch-action: none;
  }
  #creditsModal .credits-stage {
    width: 480px;
    height: 392px;
    flex: 0 0 auto;
    max-width: min(480px, 62vw);
    max-height: min(392px, 70vh);
    background: #000;
    line-height: 0;
  }
  #creditsModal #creditsCanvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: auto;
  }
  #creditsModal .credits-mascot {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 392px;
    padding: 16px 18px;
    background: #000;
    box-sizing: border-box;
  }
  #creditsModal .credits-mascot img {
    display: block;
    height: auto;
    width: auto;
    max-height: 86%;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
    image-rendering: pixelated;
    user-select: none;
    pointer-events: none;
  }

  /* ===== First-load account prompt (classic WELCOME_STATIC) ===== */
  .acct-prompt-text { font-size:12px; color:#aac; line-height:1.5; margin:0 0 16px; }
  .acct-prompt-btns { display:flex; flex-direction:column; gap:6px; }
  .acct-prompt-btns-row { display:flex; gap:6px; }
  .acct-prompt-btns .retro-btn { width:100%; }
  .acct-prompt-btns-row .retro-btn,
  .acct-prompt-btns-row .modal-bigbtn-naked { flex:1; width:auto; }
  #accountPromptModal .palace-welcome-window {
    width: 520px;
    max-width: min(92vw, 520px);
  }
  #accountPromptModal .retro-titlebar { cursor: move; }
  #accountPromptModal .palace-welcome-banner {
    margin: 0 0 10px;
    padding: 3px 6px;
    text-align: center;
    font-size: 11px;
    font-weight: bold;
    color: #000;
    border: 1px solid #000;
    background: #c0c0c0;
  }
  #accountPromptModal .palace-welcome-copy {
    margin: 0 0 12px;
  }
  #accountPromptModal .palace-welcome-copy p {
    margin: 0 0 9px;
    font-size: 11px;
    line-height: 1.35;
    color: #000;
  }
  #accountPromptModal .palace-welcome-copy p:last-child { margin-bottom: 0; }
  #accountPromptModal .palace-welcome-btns {
    display: flex;
    gap: 10px;
    align-items: stretch;
    justify-content: space-between;
  }
  #accountPromptModal .palace-welcome-btn {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    min-height: 44px;
    padding: 4px 6px;
    white-space: normal;
    line-height: 1.2;
    text-align: center;
  }
  #accountPromptModal .acct-msg,
  #tenantGateModal .acct-msg,
  #tenantClaimModal .acct-msg,
  #createTenantModal .acct-msg,
  #deleteTenantModal .acct-msg { color:#000; }
  #accountPromptModal .acct-msg.err,
  #tenantGateModal .acct-msg.err,
  #tenantClaimModal .acct-msg.err,
  #createTenantModal .acct-msg.err,
  #deleteTenantModal .acct-msg.err { color:#800; }
  #accountPromptModal .acct-msg.ok,
  #tenantGateModal .acct-msg.ok,
  #tenantClaimModal .acct-msg.ok,
  #createTenantModal .acct-msg.ok,
  #deleteTenantModal .acct-msg.ok { color:#060; }

  /* ===== Account / Create Space — win9x base; Mac overrides in dialog-themes.css ===== */
  #createTenantModal .retro-window {
    max-height: min(86vh, 640px);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 4px 0 rgba(0,0,0,.35);
  }
  #createTenantModal .retro-body {
    overflow-y: auto;
    max-height: min(78vh, 580px);
    color: #000;
  }
  #createTenantModal .retro-row > label { width: 84px; }
  #createTenantModal .acct-space-summary { color: #444; font-size: 11px; margin-bottom: 7px; }
  #createTenantModal .acct-space-summary.err { color: #800; }
  #createTenantModal .acct-space-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
  #createTenantModal .acct-space-list-empty { color: #444; font-size: 11px; }
  #createTenantModal .acct-space-row {
    display: flex; align-items: center; gap: 6px; min-height: 26px; padding: 3px 4px;
    border: 1px solid; border-color: #fff #000 #000 #fff; background: #fff;
    box-shadow: inset 1px 1px 0 #808080;
  }
  #createTenantModal .acct-space-row a {
    min-width: 0; flex: 1; overflow: hidden; color: #0000cc; text-overflow: ellipsis;
    white-space: nowrap; text-decoration: none; font-size: 11px;
  }
  #createTenantModal .acct-space-row a:hover { text-decoration: underline; }
  #createTenantModal .acct-space-delete { flex: none; min-width: 0; width: auto; padding: 1px 8px; }
  #createTenantModal .sim-menu-section-label {
    color: #000; font: bold 11px Tahoma, "MS Sans Serif", sans-serif;
    border-bottom: 1px solid #808080; margin: 0 0 8px; padding-bottom: 2px;
  }
  #createTenantModal .retro-hint code { font-size: 11px; }
  .acct-section { margin-bottom: 16px; }
  .acct-section:last-child { margin-bottom: 0; }
  .acct-hint { font-size: 11px; color: #444; margin: 2px 0 10px; line-height: 1.4; }
  .acct-msg { font-size: 11px; margin: -4px 0 10px; min-height: 14px; }
  .acct-msg.err { color: #e77; }
  .acct-msg.ok { color: #8d8; }

  /* Profile toolbar icon. */
  #palProfileBtn, #palProfileBtn.has-account {
    background-image:url(img/profile-icon.webp);
    background-size:26px; image-rendering:auto;
  }
  /* Buddy List toolbar icon: mailcenter-off by default, mailcenter-on (badge
     art) once dmhubUpdateBuddyIcon() detects an unread DM or system-mail
     item -- see dm-ui.js. */
  #palBuddyListBtn {
    background-image:url(icons/mailcenter-off.png);
    background-size:26px; image-rendering:auto;
  }
  #palBuddyListBtn.has-unread {
    background-image:url(icons/mailcenter-on.png);
  }
  /* Abuse Reports notification: a red badge dot on top of the normal on/off
     icon swap (dmhubUpdateBuddyIcon toggles this independently of
     has-unread) -- a moderation notice should read as more urgent than an
     ordinary unread DM. A plain overlay dot rather than recoloring the icon
     itself, since it doesn't depend on the icon's actual pixel colors. */
  #palBuddyListBtnWrap { position: relative; }
  #palBuddyListBtn.has-abuse-unread::after {
    content: ''; position: absolute; top: 2px; right: 2px; width: 9px; height: 9px;
    border-radius: 50%; background: #ff2d2d; box-shadow: 0 0 4px rgba(255,45,45,.85), 0 0 0 1px rgba(0,0,0,.4);
  }
  .social-modal-box { max-width: 420px; max-height: min(85vh, 640px); overflow-y: auto; }
  #palPresentsBtn {
    background-image:url(img/palace-presents-icon.png);
    background-size:26px; image-rendering:auto;
  }

  /* Guest corner ribbon (bottom-right) — register CTA while not signed in */
  #guestRibbon {
    --ribbon-text: #e9dac5;
    --ribbon-text2: #d2b48c;
    --ribbon-g: #333;
    --ribbon-c1: #ff6347;
    --ribbon-c2: #ffa500;
    --ribbon-c3: #555;
    --ribbon-c5: #1a1a1a;
    --ribbon-dotted: 2px dotted rgba(0, 0, 0, .3);
    position: fixed;
    z-index: 2000;
    bottom: 0;
    right: 0;
    line-height: 2em;
    display: block;
    width: 10em;
    height: 2.5em;
    text-align: center;
    text-decoration: none;
    color: var(--ribbon-text2);
    user-select: none;
    transform: translate(2.35em, -1.4em) rotate(135deg);
    filter: drop-shadow(0 -.5rem .5rem rgba(0, 0, 0, .1));
    transition: color .2s ease-in-out;
  }
  #guestRibbon::before,
  #guestRibbon::after {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(2em 0, 8em 0, 10em 2em, 10em 2.5em, 9.5em 2em, .5em 2em, 0 2.5em, 0 2em);
  }
  #guestRibbon::before {
    top: .1em;
    height: 1.8em;
    border: var(--ribbon-dotted);
    border-left: none;
    border-right: none;
  }
  #guestRibbon::after {
    z-index: -1;
    background-color: var(--ribbon-c1);
    border-bottom: .5em solid var(--ribbon-c3);
    background-image: linear-gradient(to top, rgba(0, 0, 0, .2), rgba(0, 0, 0, .3) 1.25em);
    transition: background-color .2s ease-in-out;
  }
  #guestRibbon span {
    display: block;
    transform: rotate(180deg);
  }
  #guestRibbon:focus,
  #guestRibbon:hover,
  #guestRibbon:active {
    color: var(--ribbon-c5);
  }
  #guestRibbon:focus::after,
  #guestRibbon:hover::after,
  #guestRibbon:active::after {
    background-color: var(--ribbon-c2);
  }
