:root {
  color-scheme: light;
  --ink: #191b1b;
  --muted: #666d6b;
  --soft: #f0f1ef;
  --paper: #f7f7f5;
  --surface: #ffffff;
  --panel: #ffffff;
  --panel-strong: #f0f1ef;
  --line: #dedfda;
  --teal: #206d68;
  --teal-soft: #e5f1ef;
  --clay: #206d68;
  --plum: #25272a;
  --blue: #475569;
  --amber: #a76513;
  --danger: #b43b33;
  --night: #121414;
  --shadow: 0 18px 48px rgba(18, 20, 20, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  background:
    linear-gradient(180deg, #fbfbfa 0, var(--paper) 420px),
    var(--paper);
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  letter-spacing: 0;
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.boot-screen,
.auth-screen {
  align-items: center;
  display: grid;
  gap: 16px;
  justify-items: center;
  min-height: 100vh;
  padding: 32px;
  text-align: center;
}

.boot-screen {
  background:
    linear-gradient(90deg, rgba(25, 27, 27, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(25, 27, 27, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #fbfbfa 0%, #f2f4f2 100%);
  background-size: 42px 42px, 42px 42px, auto;
  place-items: center;
}

.boot-panel {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(222, 223, 218, 0.92);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(18, 20, 20, 0.14);
  display: grid;
  gap: 16px;
  justify-items: center;
  padding: 24px;
  width: min(340px, 100%);
}

.brand-mark.boot-mark {
  box-shadow: none;
  height: 42px;
  width: 42px;
}

.boot-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.boot-copy strong {
  font-size: 20px;
  line-height: 1.1;
}

.boot-copy span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.boot-progress {
  background: var(--soft);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  width: 100%;
}

.boot-progress span {
  animation: boot-progress 1.25s ease-in-out infinite;
  background: linear-gradient(90deg, var(--teal), #88b9b4);
  border-radius: inherit;
  display: block;
  height: 100%;
  width: 46%;
}

@keyframes boot-progress {
  0% {
    transform: translateX(-110%);
  }

  50% {
    transform: translateX(45%);
  }

  100% {
    transform: translateX(220%);
  }
}

.brand-mark {
  background: url("/assets/arq-logo-6.svg") center / contain no-repeat;
  border: 0;
  display: inline-block;
  flex: 0 0 auto;
  height: 30px;
  width: 30px;
}

.brand-mark::before,
.brand-mark::after {
  content: none;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  max-width: 460px;
  min-width: 0;
  padding: 28px;
  text-align: left;
  width: min(460px, 100%);
}

.auth-card h1,
.page-title h1 {
  font-size: 30px;
  line-height: 1.05;
  margin: 0;
}

.auth-card p,
.page-title p,
.empty-state,
.muted {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.auth-actions,
.toolbar-actions,
.card-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-actions[hidden] {
  display: none;
}

.clerk-auth-mount {
  display: grid;
  justify-items: center;
  margin-top: 22px;
  min-width: 0;
  width: 100%;
}

.clerk-auth-mount:empty {
  display: none;
}

.clerk-auth-mount > *,
.clerk-auth-mount :is(.cl-rootBox, .cl-cardBox, .cl-card) {
  max-width: 100%;
  min-width: 0;
}

.clerk-auth-mount :is(.cl-rootBox, .cl-cardBox, .cl-card) {
  width: 100%;
}

.clerk-auth-mount :is(button, input) {
  font-family: inherit;
}

.primary-button,
.secondary-button,
.icon-button {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 42px;
  text-decoration: none;
}

.primary-button {
  background: var(--teal);
  border: 1px solid var(--teal);
  box-shadow: 0 10px 24px rgba(7, 134, 126, 0.14);
  color: #fff;
  padding: 0 16px;
}

.primary-button:hover {
  background: #174f4c;
}

.secondary-button {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0 14px;
}

.icon-button {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  width: 42px;
}

.error-banner {
  background: #fff1f1;
  border: 1px solid #f0b9bc;
  border-radius: 8px;
  color: #8f202a;
  font-weight: 750;
  margin: 0;
  padding: 12px 14px;
}

.text-dialog-backdrop {
  background: rgba(18, 20, 20, 0.34);
  display: grid;
  inset: 0;
  padding: 24px;
  place-items: center;
  position: fixed;
  z-index: 40;
}

.text-dialog {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(18, 20, 20, 0.22);
  display: grid;
  gap: 14px;
  padding: 18px;
  width: min(420px, 100%);
}

.text-dialog h3 {
  font-size: 20px;
  line-height: 1.15;
  margin: 0;
}

.text-dialog label {
  color: var(--ink);
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 7px;
}

.text-dialog input {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  height: 40px;
  min-width: 0;
  outline: none;
  padding: 0 10px;
  width: 100%;
}

.text-dialog input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(32, 109, 104, 0.14);
}

.text-dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.primary-button.compact,
.text-dialog-actions .primary-button,
.text-dialog-actions .secondary-button {
  font-size: 12px;
  min-height: 32px;
  padding: 0 10px;
}

.operator-workspace-switch {
  align-items: center;
  background: var(--teal-soft);
  border: 1px solid #bfd7d3;
  border-radius: 999px;
  display: flex;
  gap: 6px;
  padding: 4px 5px 4px 10px;
}

.operator-workspace-switch label {
  align-items: center;
  display: flex;
  gap: 7px;
}

.operator-workspace-switch span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.operator-workspace-switch input {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  height: 28px;
  padding: 0 9px;
  width: 152px;
}

.dashboard {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  max-width: 100%;
  min-height: 100vh;
  min-width: 0;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  color: var(--ink);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  max-width: 100%;
  min-width: 0;
  min-height: 100vh;
  overflow: hidden;
  padding: 24px;
}

.sidebar-brand,
.user-strip {
  align-items: center;
  display: flex;
  gap: 12px;
}

.sidebar-brand strong {
  font-size: 21px;
}

.sidebar-nav {
  align-content: start;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.sidebar-nav a {
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  padding: 11px 12px;
  text-decoration: none;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
  background: var(--panel-strong);
  color: var(--ink);
}

.user-strip {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.avatar {
  align-items: center;
  background: var(--teal);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  font-weight: 900;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.user-strip div,
.tenant-row div,
.render-main,
.person-main {
  min-width: 0;
}

.user-strip strong,
.user-strip span,
.tenant-row strong,
.tenant-row small,
.render-main strong,
.render-main span,
.person-main strong,
.person-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-strip span {
  color: var(--muted);
  font-size: 13px;
}

.main-panel {
  display: grid;
  gap: 24px;
  max-width: 100%;
  min-width: 0;
  padding: clamp(18px, 3vw, 36px);
}

.main-panel > * {
  min-width: 0;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.page-title {
  display: grid;
  gap: 6px;
}

.page-title h1 {
  max-width: 900px;
}

.workspace-brief {
  align-items: stretch;
  background: var(--night);
  border: 1px solid #2a2d2d;
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: #f3f6f5;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  overflow: hidden;
  padding: clamp(18px, 2vw, 26px);
}

.brief-copy {
  align-content: center;
  display: grid;
  gap: 10px;
}

.brief-copy span {
  color: #d8efec;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brief-copy h2 {
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.03;
  margin: 0;
}

.brief-copy p {
  color: #d9e2df;
  line-height: 1.45;
  margin: 0;
  max-width: 560px;
}

.brief-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.brief-grid article {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 16px;
}

.brief-grid span {
  color: #d8efec;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.brief-grid strong {
  color: #ffffff;
  font-size: clamp(21px, 2vw, 28px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.brief-grid p {
  color: #d9e2df;
  font-size: 13px;
  line-height: 1.35;
  margin: 0;
}

.status-pill,
.role-pill,
.qa-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  justify-content: center;
  min-width: 72px;
  padding: 5px 9px;
  text-transform: capitalize;
}

.status-pill {
  background: var(--teal-soft);
  color: var(--teal);
}

.status-pill.warning {
  background: #fff3d8;
  color: #8a5a09;
}

.status-pill.blocked {
  background: #ffe1e4;
  color: var(--danger);
}

.grid {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.content-grid {
  align-items: start;
  grid-template-columns: 1fr;
}

.workspace-admin-grid {
  align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(19, 33, 38, 0.06);
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.card-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 58px;
  padding: 14px 16px;
}

.card-header h2,
.card-header h3 {
  font-size: 15px;
  margin: 0;
}

.metric-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric-card strong {
  font-size: 32px;
  line-height: 1;
}

.metric-card small {
  color: var(--muted);
  font-weight: 700;
}

.meter {
  background: var(--soft);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.meter span {
  background: var(--teal);
  display: block;
  height: 100%;
}

.render-list,
.people-list,
.tenant-list {
  display: grid;
}

.render-row,
.person-row,
.tenant-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px 16px;
}

.render-row {
  grid-template-columns: 62px minmax(0, 1fr) auto auto minmax(120px, auto);
}

.person-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.managed-person-row {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.person-row .secondary-button.compact {
  min-height: 32px;
  padding: 0 10px;
}

.secondary-button.compact {
  font-size: 12px;
  min-height: 32px;
  padding: 0 10px;
}

.secondary-button.danger {
  color: var(--danger);
}

.usage-person-row {
  grid-template-columns: auto minmax(0, 1fr) repeat(2, minmax(74px, auto));
}

.tenant-row {
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  color: inherit;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  text-align: left;
  width: 100%;
}

.tenant-row small {
  line-height: 1.35;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.render-row:last-child,
.person-row:last-child,
.tenant-row:last-child {
  border-bottom: 0;
}

.render-thumb {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 48px;
  object-fit: cover;
  width: 62px;
}

.library-workbench-card {
  display: grid;
  overflow: hidden;
}

.workbench-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 60px;
  padding: 14px 16px;
}

.workbench-header h2 {
  font-size: 15px;
  margin: 0;
}

.workbench-toolbar {
  align-items: end;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 0.42fr) auto;
  padding: 12px 16px;
}

.workbench-toolbar label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.workbench-toolbar label span,
.workbench-toolbar-summary span,
.workbench-pane-header span,
.workbench-section-header span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.workbench-toolbar input,
.workbench-toolbar select {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 36px;
  min-width: 0;
  padding: 0 10px;
  width: 100%;
}

.workbench-toolbar-summary {
  align-content: center;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  min-height: 36px;
  min-width: 104px;
  padding: 0 12px;
}

.workbench-toolbar-summary strong {
  font-size: 16px;
  line-height: 1;
}

.workbench-summary-grid {
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.workbench-summary-grid > div {
  border-right: 1px solid var(--line);
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px 16px;
}

.workbench-summary-grid > div:last-child {
  border-right: 0;
}

.workbench-summary-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.workbench-summary-grid strong {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.workbench-shell {
  display: grid;
  grid-template-columns: minmax(190px, 0.56fr) minmax(260px, 0.78fr) minmax(520px, 1.7fr);
  max-height: min(780px, calc(100vh - 255px));
  min-height: 540px;
  min-width: 0;
}

.workbench-pane {
  min-width: 0;
  overflow: auto;
}

.workbench-client-pane,
.workbench-room-pane {
  border-right: 1px solid var(--line);
}

.workbench-pane-header,
.workbench-section-header {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-height: 42px;
  padding: 10px 14px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.workbench-client-list,
.workbench-room-list,
.workbench-render-list {
  display: grid;
}

.workbench-client-row {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
  padding: 10px 12px;
}

.workbench-client-filter,
.workbench-room-row {
  background: transparent;
  border: 0;
  color: inherit;
  min-width: 0;
  text-align: left;
  width: 100%;
}

.workbench-client-filter {
  border-radius: 8px;
  display: grid;
  gap: 3px;
  padding: 8px 10px;
}

.workbench-client-filter.active,
.workbench-room-row.active {
  background: var(--teal-soft);
}

.workbench-client-filter strong,
.workbench-room-main strong,
.workbench-detail-header h3,
.workbench-render-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-client-filter span,
.workbench-room-main small,
.workbench-detail-header span,
.workbench-render-row span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.workbench-client-meta,
.workbench-inline-actions,
.workbench-room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workbench-inline-actions button,
.workbench-room-actions button {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  min-height: 30px;
  padding: 0 9px;
}

.workbench-inline-actions button:last-child,
.workbench-room-actions button:last-child {
  color: var(--danger);
}

.workbench-room-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  padding: 12px 14px;
}

.workbench-room-state {
  align-items: flex-end;
  display: grid;
  gap: 6px;
  justify-items: end;
}

.workbench-detail {
  display: grid;
  min-width: 0;
}

.workbench-detail-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  min-width: 0;
  padding: 14px 16px;
}

.workbench-detail-header h3 {
  font-size: 16px;
  margin: 0;
}

.workbench-room-actions {
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
}

.workbench-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  min-width: 0;
}

.workbench-detail-section,
.workbench-review-summary {
  min-width: 0;
}

.workbench-review-summary {
  background: #fbfbfa;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  align-content: start;
  padding-bottom: 14px;
}

.workbench-review-summary .primary-button {
  margin: 0 14px;
}

.workbench-review-stats {
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
}

.workbench-review-stats > div {
  border-right: 1px solid var(--line);
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px 14px;
}

.workbench-review-stats > div:last-child {
  border-right: 0;
}

.workbench-render-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: 62px minmax(0, 1fr) minmax(116px, auto);
  min-width: 0;
  padding: 12px 16px;
}

.workbench-render-row:last-child {
  border-bottom: 0;
}

.workbench-row-stack {
  align-items: end;
  display: grid;
  gap: 6px;
  justify-items: end;
}

.workbench-detail-pane .review-detail-grid {
  grid-template-columns: 1fr;
}

.workbench-detail-pane .review-panel {
  border-left: 0;
  border-top: 1px solid var(--line);
}

.render-main strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-detail-header span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-top: 2px;
}

.review-detail {
  display: grid;
  min-width: 0;
}

.review-detail-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 12px 16px;
}

.review-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.44fr);
  min-width: 0;
}

.review-render-list,
.review-comments {
  display: grid;
  min-width: 0;
}

.review-panel {
  background: #fbfbfa;
  border-left: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding: 14px;
}

.review-action-form,
.review-comment-form,
.review-comment {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.review-action-form textarea,
.review-comment-form textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 76px;
  padding: 10px;
  resize: vertical;
}

.review-action-buttons,
.review-comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-comment > div:first-child,
.review-reply span {
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  gap: 8px;
  justify-content: space-between;
}

.review-comment p,
.review-reply p {
  margin: 0;
  overflow-wrap: anywhere;
}

.review-comment-actions button {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 8px;
}

.review-reply {
  border-left: 2px solid var(--line);
  display: grid;
  gap: 4px;
  padding-left: 10px;
}

.render-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.render-main span,
.person-main span,
.tenant-row small,
.meta-line {
  color: var(--muted);
  font-size: 13px;
}

.usage-mini {
  display: grid;
  gap: 2px;
  justify-items: end;
}

.usage-mini strong {
  font-size: 14px;
}

.usage-mini span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.usage-filter-bar {
  align-items: end;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(160px, 1fr) minmax(150px, 0.8fr) repeat(2, minmax(130px, 0.65fr));
  padding: 12px 16px;
}

.usage-filter-bar label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.usage-filter-bar label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.usage-filter-bar select,
.usage-filter-bar input {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 36px;
  min-width: 0;
  padding: 0 10px;
  width: 100%;
}

.usage-rollup {
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.usage-rollup div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px 16px;
}

.usage-rollup div + div {
  border-left: 1px solid var(--line);
}

.usage-rollup span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.usage-rollup strong {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.people-invite-form {
  align-items: end;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) minmax(118px, 0.45fr) auto;
  padding: 14px 16px;
}

.people-invite-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.people-invite-form label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.people-invite-form input,
.people-invite-form select,
.role-select {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 36px;
  padding: 0 10px;
}

.people-invite-form .primary-button {
  min-height: 36px;
  padding: 0 14px;
}

.pending-invitations {
  border-top: 1px solid var(--line);
  display: grid;
}

.invitation-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  padding: 12px 16px;
}

.invitation-row:last-child {
  border-bottom: 0;
}

.invitation-row div {
  min-width: 0;
}

.invitation-row strong,
.invitation-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invitation-row span {
  color: var(--muted);
  font-size: 12px;
}

.usage-event-list {
  display: grid;
}

.usage-event-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto minmax(92px, 0.7fr) auto;
  min-width: 0;
  padding: 12px 16px;
}

.usage-event-row:last-child {
  border-bottom: 0;
}

.usage-event-row div {
  min-width: 0;
}

.usage-event-row strong,
.usage-event-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-event-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.qa-pill.pass,
.role-pill.owner {
  background: var(--teal-soft);
  color: var(--teal);
}

.qa-pill.fail,
.role-pill.admin {
  background: #eceef0;
  color: var(--plum);
}

.qa-pill.neutral,
.role-pill.designer {
  background: var(--soft);
  color: var(--muted);
}

.split-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.billing-summary {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.billing-summary > div:not(.card-actions):not(.invoice-history) {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-width: 0;
}

.billing-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.billing-summary strong {
  font-size: 15px;
  max-width: 58%;
  overflow-wrap: anywhere;
  text-align: right;
}

.billing-summary .card-actions > * {
  flex: 1 1 132px;
}

.billing-alert {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #7c2d12;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  margin: 0;
  padding: 10px 12px;
}

.invoice-history {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  overflow: hidden;
}

.invoice-history a,
.invoice-history div {
  align-items: center;
  color: inherit;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-width: 0;
  padding: 9px 10px;
  text-decoration: none;
}

.invoice-history a + a,
.invoice-history a + div,
.invoice-history div + a,
.invoice-history div + div {
  border-top: 1px solid var(--line);
}

.invoice-history strong {
  font-size: 13px;
}

.desktop-handoff {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-columns: 96px minmax(0, 1fr);
}

.desktop-handoff img {
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 72px;
  object-fit: cover;
  width: 96px;
}

.empty-state {
  padding: 18px 16px;
}

.status-dot {
  border-radius: 999px;
  height: 10px;
  width: 10px;
}

.health-ok {
  background: var(--teal);
}

.health-warning {
  background: var(--amber);
}

.health-blocked {
  background: var(--danger);
}

.sr-only {
  clip: rect(0 0 0 0);
  border: 0;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.super-admin-main {
  align-content: start;
}

.super-admin-grid {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  min-width: 0;
}

.tenant-browser {
  max-height: calc(100vh - 36px);
  overflow: auto;
  position: sticky;
  top: 18px;
}

.tenant-browser-header {
  align-items: start;
  display: grid;
  grid-template-columns: minmax(0, 0.48fr) minmax(0, 1fr);
}

.tenant-search input,
.tenant-form-grid input,
.tenant-form-grid select {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 40px;
  padding: 0 11px;
  width: 100%;
}

.environment-readiness,
.tenant-readiness {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding: 14px 16px;
}

.environment-readiness header,
.tenant-readiness header {
  display: grid;
  gap: 4px;
}

.environment-readiness header span,
.tenant-readiness header span,
.readiness-check small,
.tenant-mini-list span,
.tenant-plan-summary span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.readiness-list {
  display: grid;
  gap: 8px;
}

.readiness-check {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 10px;
}

.readiness-check.ready {
  background: var(--teal-soft);
  border-color: #b6ded9;
}

.readiness-check.attention {
  background: #fff7df;
  border-color: #efd08a;
}

.readiness-check.blocked {
  background: #ffe9ec;
  border-color: #efbcc2;
}

.readiness-check span {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.tenant-detail-area,
.tenant-detail-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.tenant-page-nav {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  padding: 4px;
}

.tenant-page-nav a {
  border-radius: 6px;
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 900;
  min-height: 36px;
  padding: 9px 12px;
  text-decoration: none;
}

.tenant-page-nav a.active {
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(18, 20, 20, 0.05);
  color: var(--ink);
}

.tenant-page-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.super-admin-page-grid {
  align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
}

.overview-page-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
}

.tenant-insight-list {
  display: grid;
}

.tenant-insight-list > div {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px 16px;
}

.tenant-insight-list > div:last-child {
  border-bottom: 0;
}

.tenant-insight-list span,
.tenant-insight-list small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.tenant-insight-list span {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.tenant-insight-list strong {
  font-size: 15px;
  overflow-wrap: anywhere;
}

.tenant-detail-heading {
  align-items: center;
}

.status-pill.ok {
  background: var(--teal-soft);
  color: var(--teal);
}

.tenant-metrics {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 16px;
}

.tenant-metrics div,
.tenant-plan-summary {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
}

.tenant-metrics span,
.tenant-form-grid label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.tenant-metrics strong {
  font-size: 15px;
  overflow-wrap: anywhere;
}

.tenant-usage-meter {
  margin: 0 16px 16px;
}

.super-admin-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tenant-form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 16px;
}

.tenant-form-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.tenant-form-grid .wide {
  grid-column: 1 / -1;
}

.tenant-form-actions {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 16px;
}

.tenant-mini-list {
  display: grid;
}

.tenant-mini-list > div {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px 16px;
}

.tenant-mini-list > div:last-child {
  border-bottom: 0;
}

.tenant-mini-list strong,
.tenant-mini-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tenant-detail-stack .tenant-mini-list strong,
.tenant-detail-stack .tenant-mini-list span {
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.tenant-policy-row {
  align-items: stretch;
  gap: 10px;
  grid-template-columns: 1fr;
}

.tenant-policy-row.warning {
  border-left: 3px solid #c18427;
}

.tenant-policy-row.danger {
  border-left: 3px solid #b64646;
}

.tenant-policy-heading {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-width: 0;
}

.tenant-policy-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.tenant-policy-title span {
  white-space: normal;
}

.tenant-policy-toggle {
  align-items: center;
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.tenant-policy-toggle input {
  width: auto;
}

.tenant-policy-model-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tenant-policy-model-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.tenant-policy-model-grid label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.tenant-policy-model-grid select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 40px;
  min-width: 0;
  padding: 0 11px;
  width: 100%;
}

.model-picker {
  display: grid;
  gap: 6px;
  min-width: 0;
  position: relative;
}

.model-picker-control {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 40px;
  padding: 0 10px;
}

.model-picker.open .model-picker-control,
.model-picker-control:focus-within {
  border-color: rgba(31, 90, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(31, 90, 255, 0.12);
}

.model-picker-search {
  background: transparent;
  border: 0;
  color: var(--ink);
  min-height: 38px;
  min-width: 0;
  outline: 0;
  padding: 0;
  width: 100%;
}

.model-picker-control span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: none;
  white-space: nowrap;
}

.model-picker-selected {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px 10px;
}

.model-picker-selected strong,
.model-picker-option-main {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
  white-space: normal;
}

.model-picker-selected code,
.model-picker-option code {
  color: #1d4ed8;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.model-picker-selected span,
.model-picker-option-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
  text-transform: none;
  white-space: normal;
}

.model-picker-menu {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  display: grid;
  left: 0;
  max-height: 360px;
  overflow: auto;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
}

.model-picker-menu[hidden],
.model-picker-option[hidden],
.model-picker-empty[hidden] {
  display: none;
}

.model-picker-option {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  text-align: left;
}

.model-picker-option:hover,
.model-picker-option:focus,
.model-picker-option.selected {
  background: rgba(31, 90, 255, 0.08);
  outline: 0;
}

.model-picker-option small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  white-space: normal;
}

.model-picker-empty {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
  padding: 10px;
}

.tenant-policy-cost-summary {
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 9px 10px;
}

.tenant-policy-cost-summary span {
  color: var(--muted);
  font-size: 12px;
}

.tenant-policy-cost-summary strong {
  color: var(--ink);
  font-size: 13px;
}

.tenant-policy-forecast {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.tenant-policy-forecast span,
.tenant-policy-row small {
  white-space: normal;
}

.super-admin-forbidden {
  max-width: 640px;
}

@media (max-width: 1260px) {
  .workbench-shell {
    grid-template-columns: 1fr;
    max-height: none;
    min-height: 0;
  }

  .workbench-client-pane,
  .workbench-room-pane {
    border-bottom: 1px solid var(--line);
    border-right: 0;
  }

  .workbench-pane {
    overflow: visible;
  }

  .workbench-client-list,
  .workbench-room-list {
    max-height: 320px;
    overflow: auto;
  }

  .workbench-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto;
    align-items: center;
    min-height: auto;
  }

  .sidebar-nav {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    width: 100%;
  }

  .sidebar-nav a {
    flex: 0 0 auto;
  }

  .user-strip {
    border-top: 0;
    justify-self: end;
    max-width: 240px;
    padding-top: 0;
  }

  .metrics,
  .content-grid,
  .workspace-admin-grid,
  .workspace-brief,
  .super-admin-grid,
  .super-admin-detail-grid {
    grid-template-columns: 1fr;
  }

  .tenant-browser {
    max-height: none;
    position: static;
  }

  .tenant-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tenant-policy-model-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .boot-progress span {
    animation: none;
    transform: translateX(58%);
  }
}

@media (max-width: 680px) {
  .boot-screen,
  .auth-screen {
    padding: 24px 16px;
  }

  .auth-card {
    padding: 20px;
    width: min(100%, 390px);
  }

  .sidebar {
    align-items: stretch;
    gap: 14px;
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .sidebar-brand {
    justify-content: space-between;
  }

  .sidebar-nav {
    gap: 3px;
    justify-content: start;
    margin: 0 -2px;
  }

  .sidebar-nav a {
    font-size: 13px;
    padding: 8px 8px;
  }

  .user-strip {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    justify-self: stretch;
    max-width: none;
    padding-top: 14px;
  }

  .main-panel {
    overflow: hidden;
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions .secondary-button {
    flex: 1 1 auto;
  }

  .workspace-brief {
    padding: 16px;
  }

  .workbench-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .workbench-toolbar,
  .workbench-summary-grid,
  .workbench-room-row,
  .workbench-detail-header,
  .workbench-render-row,
  .workbench-review-stats {
    grid-template-columns: 1fr;
  }

  .workbench-summary-grid > div,
  .workbench-review-stats > div {
    border-right: 0;
    border-top: 1px solid var(--line);
  }

  .workbench-summary-grid > div:first-child,
  .workbench-review-stats > div:first-child {
    border-top: 0;
  }

  .workbench-room-state,
  .workbench-row-stack {
    align-items: start;
    justify-items: start;
  }

  .brief-grid {
    grid-template-columns: 1fr;
  }

  .render-row {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .render-thumb {
    height: 42px;
    width: 52px;
  }

  .usage-person-row,
  .usage-event-row,
  .usage-filter-bar,
  .usage-rollup {
    grid-template-columns: 1fr;
  }

  .usage-rollup div + div {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .tenant-browser-header,
  .tenant-form-grid,
  .tenant-metrics {
    grid-template-columns: 1fr;
  }

  .card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric-card,
  .card {
    max-width: 100%;
  }

  .meter {
    max-width: 100%;
  }

  .person-row,
  .managed-person-row,
  .people-invite-form,
  .invitation-row {
    grid-template-columns: 1fr;
  }

  .usage-person-row .avatar {
    display: none;
  }

  .person-row .avatar {
    display: none;
  }

  .usage-mini {
    justify-items: start;
  }

  .render-row .status-pill,
  .render-row .qa-pill {
    justify-self: start;
  }

  .render-actions {
    justify-content: flex-start;
  }

  .desktop-handoff {
    grid-template-columns: 1fr;
  }
}
