html:has(body .ws) {
  scrollbar-gutter: stable;
}
body:has(.ws) {
  --ws-rail-width: 208px;
}
/* Scoped to the signed-in workspace; public and room pages keep their layout. */
body:has(.ws) > header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--fg-paper);
  max-width: none;
  height: 76px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--fg-line);
}
body:has(.ws) > header .brand img {
  width: 36px;
  height: 36px;
}
body:has(.ws) > header .brand span {
  font-size: 23px;
}
main:has(.ws) {
  max-width: none;
  margin: 0;
  padding: 0;
}
body:has(.ws) > .site-footer {
  max-width: none;
  margin: 0 0 0 var(--ws-rail-width);
  padding: 16px 32px;
  border-top: 1px solid var(--fg-line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  font-size: 12px;
}
body:has(.ws) > .site-footer .beta-note {
  margin: 0;
}
body:has(.ws) > .site-footer nav {
  margin: 0;
}
.me.ws {
  max-width: none;
  grid-template-columns: var(--ws-rail-width) minmax(0, 1fr);
  grid-template-rows: 1fr;
  gap: 0;
  min-height: calc(100dvh - 140px);
}
.ws > #error:empty {
  display: none;
}
.ws [hidden] {
  display: none !important;
}
.ws-menu-button,
.ws-mobile-nav:not([open]),
.ws-cell-label {
  display: none;
}
.ws-rail {
  position: fixed;
  left: 0;
  top: 76px;
  width: var(--ws-rail-width);
  align-self: start;
  height: calc(100dvh - 76px);
  overflow-y: auto;
  grid-column: 1;
  grid-row: 1;
  min-height: 240px;
  padding: 28px 12px 20px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--fg-paper-2);
}
.ws-nav {
  display: grid;
  gap: 4px;
}
.ws-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 550;
}
.ws-nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--fg-cobalt-tint);
}
.ws-nav svg {
  width: 20px;
  height: 20px;
  flex: none;
}
.ws-rail-bottom {
  grid-column: 1;
  grid-row: 2;
  padding: 20px 0;
  background: var(--fg-paper-2);
  margin-top: auto;
  display: grid;
  gap: 24px;
}
.ws-account {
  padding: 0 12px;
}
.ws-account > span {
  min-width: 0;
}
.ws-account strong,
.ws-account small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-account small {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 400;
}
.ws-count {
  margin-left: auto;
  min-width: 22px;
  padding: 2px 6px;
  text-align: center;
  border-radius: 6px;
  background: var(--fg-line);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
.ws .me-foot {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.ws .me-foot button,
.ws .me-foot a {
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--muted);
}
.ws .me-foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}
.ws .me-foot a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}
.ws-content {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  width: 100%;
  max-width: 1280px;
  padding: 36px 40px 40px;
  justify-self: center;
}
.ws-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.ws-heading h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.ws-heading p {
  font-size: 14px;
  color: var(--muted);
}
.ws-request-link {
  flex: none;
  padding: 10px 14px;
  border: 1px solid #d8d3c5;
  border-radius: 10px;
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
  background: var(--fg-card);
}
.ws-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.ws .me-block,
.ws .me-head {
  border-radius: 12px;
}
.ws .me-block {
  padding: 20px 24px;
}
.ws .ws-room-settings {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--fg-line);
}
.ws .ws-room-settings .me-switch {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  margin: 0;
  font-weight: 400;
}
.ws .ws-room-settings .me-switch input {
  margin-top: 3px;
}
.ws .ws-room-settings .me-switch b {
  font-weight: 500;
}
.ws .ws-room-settings .me-switch small {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}
.ws #me-projects,
.ws #me-projects .me-block {
  min-width: 0;
}
.ws #me-projects .me-block {
  padding: 0;
  border: 0;
  background: transparent;
}
.ws #me-projects .me-block-head {
  display: none;
}
.ws-project-table-wrap {
  width: 100%;
  min-width: 0;
  overflow: auto;
  background: var(--fg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.ws-project-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
.ws-project-table th,
.ws-project-table td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}
.ws-project-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--well);
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}
.ws-project-table tbody th {
  width: 25%;
  font-weight: 550;
}
.ws-project-table td:nth-child(2) {
  width: 25%;
}
.ws-project-table td:nth-child(3) {
  width: 22%;
}
.ws-project-table td:nth-child(4) {
  width: 18%;
}
.ws-project-table a {
  color: var(--clay-blue);
  text-decoration: none;
}
.ws-project-table a:hover {
  text-decoration: underline;
}
.ws-members {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ws-member-chip {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--well);
  overflow-wrap: anywhere;
}
.ws-agent-access {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}
.ws-table-hint {
  margin-bottom: 10px !important;
  font-size: 12px;
}
.ws-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.ws #open-add-agent {
  margin-left: auto;
}
.ws-list-tools {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.ws-panel > .ws-list-tools {
  margin-bottom: 0;
}
.ws-list-tools input {
  max-width: 360px;
  min-height: 44px;
  padding: 10px 14px;
  background: var(--fg-card);
  font-size: 16px;
  border-radius: 10px;
}
.ws-list-tools input::placeholder {
  color: var(--muted);
  opacity: 1;
}
.ws-list-count {
  margin-left: auto;
  flex: none;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.ws-tier-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -4px 0 16px;
}
.ws .ws-tier-filters button {
  min-height: 44px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
}
.ws .ws-tier-filters button[aria-pressed="true"] {
  background: var(--fg-cobalt-tint);
  border-color: #d8bd7c;
  color: var(--ink);
}
.ws .ws-list-scroll {
  max-height: min(440px, 56dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scroll-padding: 12px;
}
.ws #me-projects .ws-list-scroll {
  max-height: max(260px, calc(100dvh - 360px));
}
.ws .me-row-main {
  min-width: 0;
  overflow-wrap: anywhere;
}
.ws .me-row {
  padding: 14px 0;
}
.ws .me-row-main p {
  font-size: 14px;
}
.ws .me-block-head {
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.ws .ws-disclosure {
  min-width: 0;
  border-top: 1px solid var(--line);
}
.ws .ws-disclosure > summary {
  min-height: 48px;
  padding: 14px 4px;
  font-size: 14px;
  font-weight: 550;
  color: var(--muted);
  cursor: pointer;
}
.ws .ws-disclosure[open] > summary {
  color: var(--ink);
}
.ws .ws-disclosure .me-block {
  margin-top: 8px;
}
.ws #blocked-title,
.ws #past-rooms > h3,
.ws #agent-rules ~ h3 {
  margin-top: 0;
}
.ws #me-agents {
  margin-top: 16px;
}
.ws .me-agent-row {
  padding: 16px 0;
  gap: 4px 20px;
  grid-template-columns: minmax(0, 1fr) auto;
}
.ws .me-agent-identity {
  grid-column: 1;
  grid-row: 1;
}
.ws .me-agent-identity .me-row-detail {
  line-height: 1.5;
  font-size: 13px;
}
.ws .me-agent-actions {
  grid-column: 2;
  grid-row: 1;
  align-content: start;
  justify-content: flex-end;
  max-width: 300px;
  gap: 6px;
}
.ws .me-agent-actions button.me-small {
  min-height: 32px;
  padding: 0 10px;
}
.ws .me-agent-row details {
  grid-row: 2;
}
.ws #wake-panel .me-row,
.ws #wake-dialog .me-note,
.ws #wake-panel .me-note {
  overflow-wrap: anywhere;
}
.ws #wake-panel .me-row-side {
  flex-wrap: wrap;
}
.ws #agent-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 12px;
}
.ws #agent-rules > p,
.ws #agent-rules > label {
  flex-basis: 100%;
}
.ws .me-rule {
  gap: 12px;
  padding: 16px 0;
  margin: 0;
}
.ws .me-rule select {
  flex: 1 1 180px;
  min-height: 44px;
  padding: 8px;
  font: inherit;
}
.ws .me-title h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.ws #agents-guide {
  max-width: 880px;
}
.ws .me-dialog {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(440px, 100vw);
  height: 100dvh;
  max-height: 100dvh;
  padding: 24px 28px max(24px, env(safe-area-inset-bottom));
  border-radius: 0;
  box-shadow: -12px 0 48px -20px #01161e45;
  translate: 0 0;
  transition: none;
  overscroll-behavior: contain;
}
.ws .me-dialog::backdrop {
  background: #01161e26;
  backdrop-filter: none;
}
.ws .me-dialog-head {
  margin-bottom: 24px;
  gap: 16px;
}
.ws button.me-close {
  min-width: 44px;
  min-height: 44px;
}
.ws button:focus-visible,
.ws a:focus-visible,
.ws summary:focus-visible,
.ws input:focus-visible,
.ws .ws-list-scroll:focus-visible {
  outline: 2px solid var(--clay-blue);
  outline-offset: 3px;
}
.ws .me-forced-focus {
  outline: 2px solid var(--clay-blue);
}
.ws #ws-title:focus,
.ws #req-title:focus {
  outline: none;
}
.ws ::selection {
  background: var(--fg-cobalt-tint);
  color: var(--ink);
}
@media (hover: hover) {
  .ws-nav a:hover,
  .ws-request-link:hover {
    color: var(--ink);
    background: var(--fg-paper-2);
  }
}
@media (max-width: 1100px) {
  .ws-content {
    padding: 28px 24px;
  }
  .ws .me-agent-actions {
    grid-column: 1 / -1;
    grid-row: 3;
    max-width: none;
    justify-content: flex-start;
  }
}
@media (max-width: 700px) {
  body:has(.ws) > header {
    position: sticky;
    height: auto;
    min-height: 64px;
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  body:has(.ws) > header .product {
    order: 3;
    flex-basis: 100%;
    font-size: 11px;
  }
  .me.ws {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 64px);
  }
  .ws-menu-button {
    position: static;
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    width: 44px;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--fg-ink);
    border-radius: 12px;
    background: var(--ink);
    color: var(--fg-card);
    font-size: 14px;
    box-shadow: none;
  }
  .ws-menu-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .ws-menu-button svg {
    width: 18px;
    height: 18px;
  }
  .ws-mobile-nav[open] {
    position: fixed;
    inset: 0 auto 0 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    width: min(320px, calc(100vw - 32px));
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    padding: max(12px, env(safe-area-inset-top)) 12px
      max(12px, env(safe-area-inset-bottom));
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    background: var(--fg-paper-2);
    color: var(--ink);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .ws-mobile-nav::backdrop {
    background: #01161e55;
  }
  .ws-mobile-nav-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-left: 12px;
  }
  .ws-mobile-nav-head button {
    min-height: 44px;
    padding: 0 12px;
    font-size: 13px;
  }
  .ws-mobile-nav .ws-rail {
    position: static;
    width: auto;
    height: auto;
    overflow-y: visible;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    gap: 16px;
    min-height: 0;
    padding: 16px 0;
    border: 0;
  }
  .ws-mobile-nav .ws-rail-bottom {
    display: grid;
    gap: 8px;
    flex-shrink: 0;
    margin-top: auto;
    padding: 16px 0 0;
    border: 0;
    border-top: 1px solid var(--line);
  }
  .ws-mobile-nav .ws-nav a {
    min-height: 46px;
  }
  .ws .me-agent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .ws .me-agent-actions button.me-small {
    flex: 0 1 auto;
    min-height: 44px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 12px;
    white-space: normal;
  }
  .ws #me-agents .me-pill {
    height: 20px;
    padding: 0 7px;
    font-size: 11px;
  }
  .ws-project-table {
    display: block;
    min-width: 0;
  }
  .ws-project-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .ws-project-table tbody {
    display: block;
  }
  .ws-project-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px 16px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
  }
  .ws-project-table tbody tr:last-child {
    border-bottom: 0;
  }
  .ws-project-table tbody th,
  .ws-project-table td:nth-child(n) {
    display: block;
    width: auto;
    min-width: 0;
    padding: 0;
    border: 0;
  }
  .ws-project-table tbody th,
  .ws-project-table td:nth-child(2),
  .ws-project-table td:nth-child(3) {
    grid-column: 1 / -1;
  }
  .ws-project-table tbody th {
    font-size: 15px;
  }
  .ws-cell-label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
  }
  .ws-table-hint {
    display: none;
  }
  .ws-content {
    order: 1;
    padding: 24px 16px;
  }
  .ws-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
  }
  .ws-heading h1 {
    font-size: 26px;
  }
  .ws .me-block {
    padding: 16px;
  }
  .ws .me-row {
    gap: 8px;
  }
  .ws .me-row-side {
    flex-wrap: wrap;
  }
  .ws .me-row-side button,
  .ws .me-agent-actions button.me-small {
    min-height: 44px;
  }
  .ws .ws-list-tools {
    gap: 8px;
  }
  .ws .ws-list-tools input {
    min-width: 0;
  }
  .ws .me-dialog {
    padding: 20px 20px max(20px, env(safe-area-inset-bottom));
  }
  body:has(.ws) > .site-footer {
    margin: 0;
    padding: 20px 16px max(20px, env(safe-area-inset-bottom));
  }
}
