/* Top bar on computers, from 1025 px (redesign 2026-11, as in the approved
   mockup "Main"). In the browser a File / Edit / … menu bar sits on top; in
   the desktop app that menu is the native one and this row is hidden. Then
   one 56 px row: Seedwave · ORIGINAL SEED pill (icon, name, play, waveform,
   time, mute, insert) · version pill (saved dot, name, ▾ versions, Save,
   Save As, Export) · where you are (Desk / Local / Stream / Away) · Room
   pill (people, status, room and how many are here, Invite, Leave).
   Same elements and handlers as before; topbarLook.js only adds the icon,
   the name, the waveform, the time, the people and Invite.
   Tablets and phones keep their own layout (seed-strip.css). */

/* The menu bar (appMenu.js) and the pieces added by topbarLook.js are for
   computers only. */
html body .topbar > .sw-menubar,
html body .topbar .sw-seed-icon,
html body .topbar .sw-seed-meta,
html body .topbar .sw-seed-wave,
html body .topbar .sw-seed-time,
html body .topbar .sw-room-people,
html body .topbar .sw-room-sub,
html body .topbar .sw-room-invite {
  display: none;
}

@media (min-width: 1025px) {
  html body .topbar {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 0 0.75rem !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 1rem !important;
    border-bottom: 1px solid #2a2822 !important;
    background: #0e0e0c !important;
    grid-template-columns: none !important;
    overflow: visible !important;
  }

  html body .topbar > :not(.sw-menubar) {
    margin-top: 0.375rem !important;
    margin-bottom: 0.375rem !important;
  }

  /* The Seed and version pills live inside .top-room-summary (display:
     contents), so they get the same spacing and height as the other pills
     here: every pill on one line, centred. */
  html body .topbar > .top-room-summary > .top-seed,
  html body .topbar > .top-room-summary > .top-version-card,
  html body .topbar > .top-room-summary > .top-publish-card {
    align-self: center !important;
    margin-top: 0.375rem !important;
    margin-bottom: 0.375rem !important;
  }

  /* On wide windows the Seed pill stops growing (the wave keeps readable
     bars); Room and Leave stay on the right edge. */
  html body .topbar > .top-room-summary > .top-seed.top-card {
    max-width: 40rem !important;
  }

  html body .topbar .sw-seed-wave {
    max-width: 26rem;
  }

  html body .topbar > .footer-status {
    margin-left: auto !important;
  }

  /* Save, Save As and Export: one box model, so they line up in every
     engine (WebKit in the desktop app included). */
  html body .topbar .top-version-card .version-actions {
    align-items: center !important;
  }

  html body .topbar .top-version-card .version-actions > button {
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: center !important;
    height: 1.9rem !important;
    min-height: 0 !important;
    margin: 0 !important;
    border-width: 1px !important;
    border-style: solid !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    transform: none !important;
    top: auto !important;
  }

  /* ---------- Menu bar (browser) ---------- */
  html body .topbar > .sw-menubar {
    display: flex;
    flex: 1 0 100%;
    align-items: center;
    gap: 0.1rem;
    height: 1.9rem;
    margin: 0 -1rem;
    padding: 0 0.6rem;
    border-bottom: 1px solid #22201b;
    background: #0b0b09;
    font-size: 0.8rem;
  }

  html body.sw-native-menu .topbar > .sw-menubar {
    display: none;
  }

  /* Where you are (Desk / Local / Stream / Away), always in sight at the
     right end of the menu bar (whereStatus.js): the right panel may be
     closed or on another tab. A click opens the Room tab, where it changes. */
  html body .topbar > .sw-menubar > .sw-menubar-where {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 1.45rem;
    margin-left: auto;
    padding: 0 0.55rem;
    border: 1px solid #3a362d;
    border-radius: 999px;
    background: #151512;
    color: #f4efe4;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
  }

  html body .topbar > .sw-menubar > .sw-menubar-where:hover {
    border-color: #6b6350;
  }

  html body .topbar > .sw-menubar > .sw-menubar-where::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #e8bf6a;
  }

  html body .topbar > .sw-menubar > .sw-menubar-where[data-sw-where="local"]::before {
    background: #5fd0b4;
  }

  html body .topbar > .sw-menubar > .sw-menubar-where[data-sw-where="stream"]::before {
    background: #6aa9e8;
  }

  html body .topbar > .sw-menubar > .sw-menubar-where[data-sw-where="away"]::before {
    background: #7d776a;
  }

  html body .topbar > .sw-menubar > .sw-menubar-where > span {
    color: #a39c8c;
    font-weight: 500;
  }

  html body .sw-menubar-item {
    position: relative;
  }

  html body .sw-menubar-title {
    height: 1.5rem;
    padding: 0 0.65rem;
    border: 0;
    border-radius: 0.4rem;
    background: transparent;
    color: #d9d3c6;
    font: inherit;
    font-weight: 500;
    cursor: default;
  }

  html body .sw-menubar-title:hover,
  html body .sw-menubar-item.open .sw-menubar-title {
    background: #23221d;
    color: #fff8e8;
  }

  html body .sw-menubar-title:focus-visible {
    outline: 2px solid rgba(241, 201, 121, 0.7);
    outline-offset: -2px;
  }

  html body .sw-menubar-panel {
    position: absolute;
    top: calc(100% + 0.2rem);
    left: 0;
    z-index: 600;
    display: grid;
    min-width: 15rem;
    padding: 0.35rem;
    border: 1px solid #3a372f;
    border-radius: 0.65rem;
    background: #151512;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  }

  html body .sw-menubar-panel[hidden] {
    display: none;
  }

  html body .sw-menubar-panel button {
    height: 1.75rem;
    padding: 0 0.65rem;
    border: 0;
    border-radius: 0.4rem;
    background: transparent;
    color: #e8e2d4;
    font: inherit;
    font-size: 0.8rem;
    text-align: left;
    white-space: nowrap;
    cursor: default;
  }

  html body .sw-menubar-panel button:hover:not(:disabled),
  html body .sw-menubar-panel button:focus-visible {
    background: #2a2316;
    color: #f6dca3;
    outline: none;
  }

  html body .sw-menubar-panel button:disabled {
    color: #6f6a60;
  }

  html body .sw-menubar-panel hr {
    width: auto;
    margin: 0.25rem 0.15rem;
    border: 0;
    border-top: 1px solid #2a2822;
  }

  /* Entries: tick, name, shortcut (from Settings > Shortcuts). */
  html body .sw-menubar-panel {
    max-height: calc(100vh - 3.5rem);
    overflow-y: auto;
  }

  html body .sw-menubar-panel button {
    display: grid;
    grid-template-columns: 1rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.6rem 0 0.4rem;
  }

  html body .sw-menubar-panel .sw-menu-check {
    color: #e8bf6a;
    font-size: 0.75rem;
    text-align: center;
  }

  html body .sw-menubar-panel .sw-menu-key {
    padding-left: 1.5rem;
    color: #8f897d;
    font: inherit;
    font-size: 0.74rem;
    letter-spacing: 0.02em;
  }

  html body .sw-menubar-panel button:disabled .sw-menu-key {
    color: #4f4b44;
  }

  html body .sw-menubar-app .sw-menubar-title {
    font-weight: 700;
  }

  /* With the menu bar, the ☰ is not needed on computers. */
  html body .topbar .sw-app-menu {
    display: none !important;
  }

  /* ---------- Brand ---------- */
  html body .topbar .brand {
    display: flex !important;
    flex: 0 0 auto;
    align-items: center !important;
    gap: 0.5rem !important;
    min-width: 0 !important;
    height: 2.75rem;
    padding: 0 !important;
  }

  html body .topbar .brand .brand-logo {
    font-size: 1.15rem !important;
    line-height: 1 !important;
    white-space: nowrap;
  }

  /* The room name moves into the Room pill; the product name stays in the
     page title. */
  html body .topbar .brand h1,
  html body .topbar .brand .brand-room-title {
    display: none !important;
  }

  /* The summary wrapper steps aside so its cards line up in the row. */
  html body .topbar .top-room-summary {
    display: contents !important;
  }

  html body .topbar .top-card {
    width: auto !important;
    max-width: none !important;
    min-height: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-shadow: none !important;
  }

  /* ---------- ORIGINAL SEED pill ---------- */
  html body .topbar .top-seed {
    display: flex !important;
    flex: 1 1 22rem !important;
    align-items: center !important;
    min-width: 22rem !important;
    height: 2.75rem !important;
    padding: 0 0.4rem !important;
    border: 1px solid #6b5426 !important;
    border-radius: 0.75rem !important;
    background: linear-gradient(90deg, #2a2112, #17140e) !important;
  }

  html body .topbar .top-seed:has(#seedDropPanel:not([hidden])) {
    height: auto !important;
  }

  html body .topbar .top-seed .seed-card-body {
    display: flex !important;
    flex: 1 1 auto !important;
    align-items: center !important;
    min-width: 0 !important;
    padding: 0 !important;
  }

  html body .topbar .top-seed .room-link-panel {
    display: none !important;
  }

  html body .topbar .top-seed .seed-wave-row {
    display: flex !important;
    flex: 1 1 auto !important;
    align-items: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    justify-self: stretch !important;
  }

  html body .topbar .top-seed .seed-wave-label {
    display: none !important;
  }

  html body .topbar .sw-seed-icon {
    display: block;
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
    background: #3a2e17;
    position: relative;
  }

  html body .topbar .sw-seed-icon::before {
    content: "";
    position: absolute;
    inset: 0.4rem;
    background: #e8bf6a;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21v-8'/%3E%3Cpath d='M12 13c0-4 3-6 7-6 0 4-3 6-7 6z'/%3E%3Cpath d='M12 15c0-3-2.5-5-6-5 0 3 2.5 5 6 5z'/%3E%3Cpath d='M8 21h8'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21v-8'/%3E%3Cpath d='M12 13c0-4 3-6 7-6 0 4-3 6-7 6z'/%3E%3Cpath d='M12 15c0-3-2.5-5-6-5 0 3 2.5 5 6 5z'/%3E%3Cpath d='M8 21h8'/%3E%3C/svg%3E") center / contain no-repeat;
  }

  html body .topbar .sw-seed-meta {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    width: 6.5rem;
    min-width: 0;
    line-height: 1.15;
  }

  html body .topbar .sw-seed-kicker {
    overflow: hidden;
    text-overflow: ellipsis;
    color: #d1b06c;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
  }

  html body .topbar .sw-seed-name {
    overflow: hidden;
    color: #f4efe4;
    font-size: 0.75rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html body .topbar .top-seed .seed-player {
    display: flex !important;
    flex: 1 1 auto !important;
    align-items: center !important;
    gap: 0.5rem !important;
    min-width: 0 !important;
    grid-template-columns: none !important;
  }

  /* The slider stays for the keyboard and screen readers; the waveform is
     what you see and click. */
  html body .topbar .top-seed .seed-seek {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-width: 0 !important;
    max-width: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    border: 0 !important;
  }

  html body .topbar .sw-seed-wave {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 1px;
    min-width: 6rem;
    height: 1.65rem;
  }

  html body .topbar .sw-seed-wave > span {
    flex: 1 1 0;
    height: var(--h, 12%);
    min-height: 2px;
    border-radius: 1px;
    background: #7a6236;
  }

  html body .topbar .sw-seed-wave > span.played {
    background: #e8bf6a;
  }

  /* Until the Seed reaches the player the bars breathe, so the pill reads
     as loading rather than empty. */
  html body .topbar .sw-seed-wave:not(.has-wave) > span {
    animation: sw-seed-wait 1.4s ease-in-out infinite;
    animation-delay: calc(var(--i, 0) * 60ms);
  }

  html body .topbar .sw-seed-time {
    display: inline-block;
    flex: 0 0 auto;
    min-width: 2.2rem;
    color: #c9c2b3;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
  }

  html body .topbar .top-seed .seed-player-button,
  html body .topbar .top-seed .seed-insert-button {
    flex: 0 0 auto !important;
    width: 2rem !important;
    min-width: 2rem !important;
    height: 2rem !important;
    padding: 0 !important;
    border: 1px solid #504b40 !important;
    border-radius: 0.55rem !important;
    background: #1b1a16 !important;
    color: #e8e2d4 !important;
  }

  html body .topbar .top-seed #seedPlayBtn {
    border-color: #8a6b2e !important;
    background: linear-gradient(180deg, #e8bf6a, #c99a45) !important;
    color: #17130a !important;
  }

  /* ---------- Version pill ---------- */
  html body .topbar .top-version-card {
    position: relative;
    display: flex !important;
    flex: 0 1 auto !important;
    align-items: center !important;
    gap: 0.55rem !important;
    min-width: 0 !important;
    height: 2.75rem !important;
    padding: 0 0.25rem 0 0.75rem !important;
    border: 1px solid #504b40 !important;
    border-radius: 0.65rem !important;
    background: #151512 !important;
  }

  /* Saved: green dot. Something to save: gold dot. */
  html body .topbar .top-version-card::before {
    content: "";
    flex: 0 0 auto;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #8bd17c;
  }

  html body .topbar .top-version-card:has(#updateVersionBtn:not(:disabled))::before {
    background: #e8bf6a;
    box-shadow: 0 0 0 3px rgba(232, 191, 106, 0.2);
  }

  html body .topbar .top-version-card .version-title-row {
    display: contents !important;
  }

  html body .topbar .top-version-card #currentVersionSummary {
    display: flex !important;
    flex-direction: column;
    order: 1;
    min-width: 0;
    max-width: 11rem !important;
    line-height: 1.2;
  }

  html body .topbar .top-version-card .version-current-name {
    overflow: hidden;
    color: #f4efe4;
    font-size: 0.8rem !important;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html body .topbar .top-version-card .version-current-meta {
    overflow: hidden;
    color: #a7a197 !important;
    font-size: 0.68rem !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html body .topbar .top-version-card .version-dropdown {
    order: 2;
    position: relative;
    flex: 0 0 auto;
    width: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }

  html body .topbar .top-version-card .version-dropdown > summary {
    display: grid !important;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    padding: 0 !important;
    border: 1px solid transparent !important;
    border-radius: 0.4rem;
    background: transparent !important;
    color: #c9c2b3;
    font-size: 0 !important;
    cursor: pointer;
  }

  html body .topbar .top-version-card .version-dropdown > summary:hover {
    border-color: #504b40 !important;
  }

  html body .topbar .top-version-card .version-dropdown > summary > span:first-child {
    display: none;
  }

  html body .topbar .top-version-card .version-dropdown > summary > span:last-child {
    font-size: 0.9rem;
    line-height: 1;
  }

  html body .topbar .top-version-card .version-dropdown[open] > .version-list {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: -10rem;
    z-index: 500;
    width: 20rem;
    max-height: 60vh;
    overflow: auto;
    padding: 0.4rem;
    border: 1px solid #3a372f;
    border-radius: 0.65rem;
    background: #151512;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  }

  html body .topbar .top-version-card .version-actions {
    display: flex !important;
    order: 3;
    flex: 0 0 auto;
    gap: 0.25rem !important;
  }

  html body .topbar .top-version-card .version-actions .small-button {
    min-width: 0 !important;
    height: 1.9rem !important;
    padding: 0 0.7rem !important;
    border-radius: 0.45rem !important;
    font-size: 0.75rem !important;
    white-space: nowrap;
  }

  html body .topbar .top-version-card #updateVersionBtn:disabled,
  html body .topbar .top-version-card #publishBtn:disabled {
    border-color: #3a372f !important;
    background: transparent !important;
    color: rgba(255, 248, 232, 0.42) !important;
    box-shadow: none !important;
  }

  html body .topbar .top-version-card #updateVersionBtn:not(:disabled) {
    border-color: #6b5426 !important;
    background: linear-gradient(180deg, #e8bf6a, #c99a45) !important;
    color: #17130a !important;
  }

  html body .topbar .top-version-card #publishBtn:not(:disabled),
  html body .topbar .top-version-card #sessionExportBtn {
    border: 1px solid #6b5426 !important;
    background: transparent !important;
    color: #e8bf6a !important;
  }

  /* ---------- Where you are (Desk / Local / Stream / Away) ---------- */
  html body .topbar .top-publish-card {
    display: flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    height: 2.5rem !important;
    padding: 0 0.75rem 0 0.25rem !important;
    border: 1px solid #504b40 !important;
    border-radius: 0.65rem !important;
    background: #151512 !important;
  }

  html body .topbar .top-local-room-state {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    min-width: 0 !important;
  }

  html body .topbar .top-local-room-state #topLocalRoomEyebrow,
  html body .topbar .top-local-room-state #topLocalModeHelp {
    display: none !important;
  }

  html body .topbar .top-local-room-state .local-room-mode-row {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
  }

  html body .topbar .top-local-room-state .local-mode-icon {
    width: 2rem !important;
    height: 2rem !important;
    min-width: 2rem !important;
    border-radius: 0.55rem !important;
  }

  html body .topbar .top-local-room-state strong {
    overflow: hidden;
    max-width: 9rem;
    color: #f4efe4 !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* ---------- Room pill, then Leave on its own ---------- */
  /* The pill is drawn behind the people, the status and Invite; Leave sits
     outside it, as in the mockup. */
  html body .topbar > .footer-status {
    position: relative;
    display: flex !important;
    flex: 0 1 auto !important;
    align-items: center !important;
    min-width: 17rem !important;
    max-width: 26rem !important;
    min-height: 0 !important;
    height: 2.75rem !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    --sw-leave-w: 4.6rem;
  }

  html body .topbar > .footer-status::before,
  html body .topbar > .footer-status::after {
    content: "";
    position: absolute;
    left: 0;
    right: calc(var(--sw-leave-w) + 0.75rem);
    pointer-events: none;
  }

  html body .topbar > .footer-status::before {
    top: 0;
    bottom: 0;
    border: 1px solid #504b40;
    border-radius: 0.65rem;
    background: #151512;
  }

  html body .topbar > .footer-status::after {
    bottom: 1px;
    left: 0.6rem;
    right: calc(var(--sw-leave-w) + 1.35rem);
    height: 2px;
    border-radius: 2px;
    background: #8bd17c;
    opacity: 0.75;
  }

  html body .topbar > .footer-status .status-copy {
    position: relative;
    z-index: 1;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto calc(var(--sw-leave-w) + 0.75rem) !important;
    grid-template-rows: auto auto !important;
    grid-template-areas: "people text invite leave" "people sub invite leave" !important;
    align-items: center !important;
    align-content: center !important;
    justify-items: stretch !important;
    column-gap: 0.55rem !important;
    row-gap: 0.05rem !important;
    width: 100% !important;
    height: 100%;
    min-width: 0;
    padding: 0 0 0 0.6rem !important;
  }

  html body .topbar > .footer-status .status-copy > p {
    display: none !important;
  }

  html body .topbar .sw-room-people {
    display: flex;
    grid-area: people !important;
    padding-left: 2px;
  }

  html body .topbar .sw-room-avatar {
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    margin-left: -0.4rem;
    border-radius: 50%;
    background: #2b3a4f;
    box-shadow: 0 0 0 2px #151512;
    color: #d6e6ff;
    font-size: 0.58rem;
    font-weight: 700;
  }

  html body .topbar .sw-room-avatar:first-child {
    margin-left: 0;
  }

  html body .topbar .sw-room-avatar.is-you {
    background: #d4a855;
    color: #17130a;
    font-size: 0.5rem;
  }

  html body .topbar > .footer-status #statusText {
    display: flex !important;
    grid-area: text !important;
    align-items: center;
    align-self: end !important;
    gap: 0.4rem;
    width: auto !important;
    min-width: 0;
    overflow: hidden;
    color: #f4efe4 !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 13rem !important;
  }

  html body .topbar > .footer-status #statusText::before {
    content: "";
    flex: 0 0 auto;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #8bd17c;
    box-shadow: 0 0 0 3px rgba(139, 209, 124, 0.18);
  }

  html body .topbar .sw-room-sub {
    display: block;
    grid-area: sub !important;
    align-self: start !important;
    min-width: 0;
    max-width: 13rem;
    overflow: hidden;
    color: #a7a197;
    font-size: 0.68rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html body .topbar .sw-room-invite {
    grid-area: invite !important;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 1.9rem;
    margin-right: 0.35rem;
    padding: 0 0.65rem;
    border: 1px solid #504b40;
    border-radius: 0.45rem;
    background: #23221d;
    color: #e8e2d4;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
  }

  html body .topbar .sw-room-invite::before {
    content: "";
    width: 0.85rem;
    height: 0.85rem;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7'/%3E%3C/svg%3E") center / contain no-repeat;
  }

  html body .topbar .sw-room-invite:disabled {
    color: #6f6a60;
    cursor: default;
  }

  html body .topbar > .footer-status .drift-out-button {
    grid-area: leave !important;
    position: static !important;
    align-self: center !important;
    justify-self: end !important;
    width: var(--sw-leave-w) !important;
    min-width: 0 !important;
    height: 2.75rem !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #6b4a2c !important;
    border-radius: 0.65rem !important;
    background: #151512 !important;
    color: #e9b27a !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
  }

  html body .topbar > .footer-status .drift-out-button:hover:not(:disabled) {
    border-color: #a8703f !important;
    background: #221a12 !important;
  }

  /* With the right panel open, "where you are" lives there (Desk / Local /
     Stream / Away); the top keeps it only when that panel is hidden. */
  html body:has(.workspace.inspector-docked:not(.room-panel-collapsed)) .topbar .top-publish-card {
    display: none !important;
  }
}

/* Narrower computers: the same row, tighter. */
@media (min-width: 1025px) and (max-width: 1359px) {
  /* Save As and Export stay in File (menu bar and ☰). */
  html body .topbar .top-version-card .version-current-meta,
  html body .topbar .top-version-card #publishBtn,
  html body .topbar .top-version-card #sessionExportBtn,
  html body .topbar .sw-seed-time {
    display: none !important;
  }

  html body .topbar .top-seed {
    flex-basis: 16rem !important;
    min-width: 17rem !important;
  }

  html body .topbar .sw-seed-meta {
    width: 5.6rem;
  }

  html body .topbar .sw-seed-kicker {
    font-size: 0.56rem;
    letter-spacing: 0.04em;
  }

  html body .topbar .top-version-card #currentVersionSummary {
    max-width: 10.5rem !important;
  }

  html body .topbar > .footer-status {
    min-width: 13.5rem !important;
  }

  html body .topbar > .footer-status #statusText,
  html body .topbar .sw-room-sub {
    max-width: 8.5rem !important;
  }

  html body .topbar .top-local-room-state strong {
    max-width: 6.5rem !important;
  }
}

@media (min-width: 1025px) and (max-width: 1239px) {
  html body .topbar .sw-room-people,
  html body .topbar .sw-room-invite,
  html body .topbar .top-local-room-state strong {
    display: none !important;
  }

  html body .topbar .top-publish-card {
    padding: 0 0.25rem !important;
  }

  html body .topbar .top-seed {
    min-width: 13rem !important;
  }

  html body .topbar > .footer-status {
    flex: 1 1 12rem !important;
    min-width: 12rem !important;
    max-width: 17rem !important;
  }

  html body .topbar .sw-seed-meta {
    width: 4.6rem;
  }

  html body .topbar .sw-seed-kicker {
    font-size: 0.55rem;
    letter-spacing: 0.04em;
  }

  html body .topbar .sw-seed-wave {
    gap: 0;
    min-width: 4rem;
  }

  html body .topbar .sw-seed-wave > span {
    border-right: 1px solid transparent;
    background-clip: padding-box;
  }

  /* Half the bars when the pill is short, so each one stays visible. */
  html body .topbar .sw-seed-wave > span:nth-child(2n) {
    display: none;
  }

  html body .topbar .top-version-card #currentVersionSummary {
    max-width: 6.5rem !important;
  }

  html body .topbar .top-seed .seed-wave-row,
  html body .topbar .top-seed .seed-player {
    gap: 0.35rem !important;
  }
}

/* Focus mode hides the top bar; nothing here changes that. */

/* Tablets: Leave keeps a little room from the edge of the Room status. */
@media (min-width: 761px) and (max-width: 1024px) {
  html body .topbar > .footer-status {
    padding-right: 0.55rem !important;
  }
}

/*
 * Tablets in portrait, 761–1024 px (redesign 2026-11). One clean grid, no
 * overlaps: the first row has the logo and room, the version (name, Save,
 * Save As, Export, other versions), where you are, and the room status with
 * Leave; the Original Seed takes the whole second row.
 */
@media (min-width: 761px) and (max-width: 1024px) {
  html body header.topbar {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto auto !important;
    grid-template-rows: auto auto !important;
    grid-template-areas:
      "brand version local status"
      "seed seed seed seed" !important;
    align-items: stretch !important;
    gap: 0.4rem 0.45rem !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0.45rem 0.6rem !important;
  }

  html body header.topbar > .top-room-summary {
    display: contents !important;
  }

  html body header.topbar > .brand {
    grid-area: brand !important;
    align-self: center !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  html body header.topbar .brand > .brand-room-title,
  html body header.topbar .brand > h1 {
    overflow: hidden !important;
    max-width: 7rem !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  html body header.topbar .top-room-summary > .top-card {
    position: relative !important;
    inset: auto !important;
    box-sizing: border-box !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    transform: none !important;
  }

  /* Version: name and meta on top, the buttons and other versions below. */
  html body header.topbar .top-room-summary > .top-version-card {
    grid-area: version !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, auto) !important;
    grid-template-rows: auto auto !important;
    grid-template-areas:
      "title title"
      "actions versions" !important;
    align-items: center !important;
    gap: 0.25rem 0.35rem !important;
    padding: 0.35rem 0.5rem !important;
  }

  html body header.topbar .top-version-card > .version-title-row {
    display: contents !important;
  }

  html body header.topbar .top-version-card #currentVersionSummary {
    grid-area: title !important;
    display: block !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
  }

  html body header.topbar .top-version-card #currentVersionSummary * {
    display: inline !important;
    max-width: none !important;
    white-space: nowrap !important;
  }

  html body header.topbar .top-version-card #currentVersionSummary .version-current-meta,
  html body header.topbar .top-version-card #currentVersionSummary .version-current-meta * {
    margin-left: 0.35rem !important;
    color: #a7a197 !important;
    font-size: 0.68rem !important;
    font-weight: 500 !important;
  }

  html body header.topbar .top-version-card .version-actions {
    grid-area: actions !important;
    display: flex !important;
    gap: 0.25rem !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  html body header.topbar .top-version-card .version-actions > button {
    flex: 0 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    height: 1.65rem !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 0.55rem !important;
    font-size: 0.72rem !important;
    white-space: nowrap !important;
  }

  html body header.topbar .top-version-card > .version-dropdown {
    grid-area: versions !important;
    position: relative !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 9.5rem !important;
    margin: 0 !important;
  }

  html body header.topbar .top-version-card > .version-dropdown > summary {
    width: auto !important;
    min-width: 0 !important;
    height: 1.65rem !important;
    min-height: 0 !important;
    padding: 0 0.5rem !important;
    font-size: 0.72rem !important;
    white-space: nowrap !important;
  }

  /* Where you are: icon, "YOU" and the mode. */
  html body header.topbar .top-room-summary > .top-publish-card {
    grid-area: local !important;
    display: flex !important;
    align-items: center !important;
    padding: 0.35rem 0.6rem !important;
  }

  html body header.topbar .top-publish-card > .local-room-state {
    position: static !important;
    inset: auto !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    transform: none !important;
  }

  /* Room status and Leave. */
  html body header.topbar > .footer-status {
    grid-area: status !important;
    position: relative !important;
    inset: auto !important;
    align-self: stretch !important;
    display: flex !important;
    align-items: center !important;
    width: 11rem !important;
    min-width: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0.35rem 0.55rem !important;
    border: 1px solid #2c2a24 !important;
    border-radius: 0.75rem !important;
    background: rgba(20, 19, 16, 0.92) !important;
    transform: none !important;
  }

  html body header.topbar > .footer-status > .status-copy {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  html body header.topbar > .footer-status #statusText {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  /* The Original Seed: the whole second row. */
  html body header.topbar .top-room-summary > .top-seed {
    grid-area: seed !important;
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
  }
}

@media (min-width: 761px) and (max-width: 860px) {
  html body header.topbar .top-publish-card .local-mode-icon {
    display: none !important;
  }

  html body header.topbar > .footer-status {
    width: 9.5rem !important;
  }

  html body header.topbar .top-version-card > .version-dropdown {
    max-width: 7.5rem !important;
  }

  html body header.topbar .top-version-card .version-actions > button {
    padding: 0 0.4rem !important;
  }

  html body header.topbar .top-room-summary > .top-publish-card {
    padding: 0.35rem 0.45rem !important;
  }
}

@keyframes sw-seed-wait {
  0%, 100% { height: 12%; opacity: 0.55; }
  50% { height: 38%; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html body .topbar .sw-seed-wave:not(.has-wave) > span {
    animation: none;
  }
}
