.ah-my-root {
  --ah-panel: var(--surface, #1B201B);
  --ah-panel-soft: var(--bg, #090B09);
  --ah-border: var(--border, #ffffff24);
  --ah-text: var(--fg, #F0F0F0);
  --ah-muted: var(--muted, #A7ADA7);
  --ah-blue: var(--signal, #9EFF3D);
  --ah-cyan: var(--signal, #9EFF3D);
  font-family: Geist, system-ui, sans-serif;
  color: var(--ah-text);
  background: transparent;
  min-height: 72vh;
  padding: 8px 0 52px;
}

/* The workspace is rendered after the site header. Keep it in a lower stacking
   context so its signed-in banner can never paint over an open nav dropdown. */
.page > header {
  z-index: 10000;
  overflow: visible;
}

.page > main {
  z-index: 0;
  isolation: isolate;
}

.page > header .nav-dropdown-menu {
  z-index: 10001;
}

.ah-wc-shell {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 14px;
}

.ah-wc-header {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 0 0 2px;
}

.ah-wc-sub,
.ah-wc-muted,
.ah-wc-status {
  color: var(--ah-muted);
  line-height: 1.55;
}

.ah-wc-kicker {
  margin: 0 0 8px;
  color: var(--ah-blue);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ah-wc-tabs {
  grid-column: 1;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: var(--ah-panel);
  border: 1px solid var(--ah-border);
  border-radius: 4px;
  overflow: visible;
}

.ah-wc-tab,
.ah-wc-btn {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 8px 11px;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.1;
  background: transparent;
  color: var(--ah-text);
  cursor: pointer;
  font-family: inherit;
}

.ah-wc-tab.is-active,
.ah-wc-btn {
  background: var(--ah-panel-soft);
  border-color: var(--ah-border);
  box-shadow: none;
}

.ah-wc-tab {
  text-align: left;
}

.ah-wc-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ah-wc-btn--primary {
  background: var(--signal, #9EFF3D);
  color: var(--bg, #090B09);
  border-color: var(--signal, #9EFF3D);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ah-wc-signed-out {
  display: block;
  max-width: 440px;
  margin: 48px auto 0;
}

.ah-wc-signed-out__card {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 28px 24px;
  background: var(--ah-panel);
  border: 1px solid var(--ah-border);
  border-radius: 4px;
}

.ah-wc-signed-out__card h1 {
  margin: 0;
  font: 600 1.5rem/1.2 Geist, system-ui, sans-serif;
  color: var(--ah-text);
}

.ah-wc-signed-out__card .ah-wc-sub {
  margin: 0;
  max-width: 36ch;
}

.ah-wc-signed-out__action {
  margin-top: 8px;
}

.ah-wc-btn--danger {
  color: #a11b1b;
  border-color: rgba(161, 27, 27, 0.22);
}

.ah-wc-panel {
  grid-column: 2;
  margin-top: 0;
  min-width: 0;
}

.ah-wc-metric,
.ah-wc-project,
.ah-wc-empty {
  background: var(--ah-panel);
  border: 1px solid var(--ah-border);
  border-radius: 4px;
  box-shadow: none;
}

.ah-wc-metric {
  padding: 18px;
}

.ah-wc-metric span {
  display: block;
  color: var(--ah-muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.ah-wc-metric strong {
  display: block;
  margin-top: 6px;
  font-size: 2rem;
}

.ah-wc-project-list {
  display: grid;
  gap: 8px;
}

.ah-wc-project {
  padding: 10px 12px;
}

.ah-wc-project-head,
.ah-wc-section-head,
.ah-wc-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.ah-wc-section-head {
  margin-bottom: 10px;
}

.ah-wc-section-head .ah-wc-muted {
  margin: 4px 0 0;
}

.ah-wc-project h2,
.ah-wc-project h3,
.ah-wc-section-head h2,
.ah-wc-editor h4 {
  margin: 0;
  letter-spacing: 0;
}

.ah-wc-badge {
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(0, 169, 200, 0.12);
  color: #0f7184;
  font-size: 0.78rem;
  font-weight: 800;
}

.ah-wc-tenant-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.6fr) minmax(260px, 1.5fr) auto;
  align-items: center;
  gap: 12px;
}

.ah-wc-tenant-name {
  min-width: 0;
}

.ah-wc-tenant-name span {
  display: block;
  color: var(--ah-muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ah-wc-tenant-name strong {
  display: block;
  margin-top: 3px;
  font-size: 0.98rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ah-wc-app-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
  min-width: 0;
}

.ah-wc-tenant-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.ah-wc-app {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--ah-border);
  border-radius: 8px;
  color: var(--ah-text);
  background: var(--ah-panel-soft);
  text-decoration: none;
  font-size: 0.88rem;
}

.ah-wc-app span {
  color: var(--ah-blue);
  font-weight: 800;
}

.ah-wc-app.is-muted span {
  color: var(--ah-muted);
}

.ah-wc-two-col {
  display: grid;
  grid-template-columns: minmax(210px, 0.7fr) minmax(320px, 1.3fr);
  gap: 12px;
  align-items: start;
}

.ah-wc-two-col > section,
.ah-wc-two-col agenthouse-auth-profile {
  background: var(--ah-panel);
  border: 1px solid var(--ah-border);
  border-radius: 8px;
  padding: 14px;
}

.ah-wc-invite {
  display: grid;
  grid-template-columns: minmax(min(100%, 190px), 1fr) minmax(min(100%, 140px), 140px) minmax(min(100%, 150px), 0.8fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--ah-border);
}

.ah-wc-invite--staff {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}

.ah-wc-invite--api-key {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.ah-wc-section-head--nested {
  margin-top: 16px;
}

.ah-wc-section-head--nested h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.ah-wc-api-keys {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--ah-border);
}

.ah-wc-api-key-secret {
  display: grid;
  gap: 8px;
  margin: 10px 0;
  padding: 12px;
  border: 1px solid var(--ah-border);
  border-radius: 8px;
  background: var(--ah-panel);
}

.ah-wc-api-key-secret-value {
  display: block;
  overflow-wrap: anywhere;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--ah-border);
  background: var(--ah-bg, transparent);
}

.ah-wc-api-key-table {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}

.ah-wc-api-key-row {
  display: grid;
  grid-template-columns: minmax(8rem, 1.2fr) minmax(4rem, 0.6fr) minmax(10rem, 1.6fr) minmax(5rem, 0.7fr) minmax(4rem, 0.5fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--ah-border);
  font-size: 0.9rem;
}

.ah-wc-api-key-row--head {
  font-weight: 600;
  color: var(--ah-muted);
  border-bottom-width: 2px;
}

.ah-wc-api-key-perms {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.ah-wc-api-key-perms legend {
  padding: 0;
  margin-bottom: 4px;
  font-weight: 600;
}

@media (max-width: 720px) {
  .ah-wc-api-key-row,
  .ah-wc-api-key-row--head {
    grid-template-columns: 1fr;
  }
}

.ah-wc-invite-title,
.ah-wc-invite-apps,
.ah-wc-invite-actions,
.ah-wc-advanced {
  grid-column: 1 / -1;
  min-width: 0;
}

.ah-wc-invite-title {
  margin: 4px 0 0;
  font-size: 0.92rem;
}

.ah-wc-advanced {
  margin-top: 2px;
}

.ah-wc-advanced summary {
  cursor: pointer;
  color: var(--ah-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.ah-wc-advanced .ah-wc-muted {
  display: block;
  margin: 6px 0 8px;
}

.ah-wc-invite small.ah-wc-muted,
.ah-wc-user-edit small.ah-wc-muted {
  display: block;
  margin-top: 6px;
  line-height: 1.35;
}

.ah-wc-invite label {
  display: block;
  margin-bottom: 6px;
  color: var(--ah-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.ah-wc-invite input,
.ah-wc-invite select,
.ah-wc-invite textarea,
.ah-wc-editor textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--ah-border);
  border-radius: 7px;
  background: #fff;
  color: var(--ah-text);
  font: inherit;
}

.ah-wc-invite input,
.ah-wc-invite select {
  height: 40px;
  padding: 8px 10px;
}

.ah-wc-invite textarea {
  min-height: 72px;
  padding: 8px 10px;
  resize: vertical;
}

.ah-wc-app-checks {
  min-height: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid var(--ah-border);
  border-radius: 7px;
  background: #fff;
}

.ah-wc-app-checks label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: var(--ah-text);
  font-size: 0.82rem;
  font-weight: 700;
}

.ah-wc-app-checks input {
  width: auto;
  height: auto;
  padding: 0;
}

.ah-wc-user-list {
  margin-top: 12px;
}

.ah-wc-pending-invites {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--ah-border);
  border-radius: 8px;
  background: #f8fafc;
}

.ah-wc-pending-invites h4 {
  margin: 0 0 8px;
  font-size: 0.92rem;
}

.ah-wc-invite-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--ah-border);
}

.ah-wc-invite-row:first-of-type {
  border-top: none;
}

.ah-wc-invite-row div {
  display: grid;
  gap: 3px;
}

.ah-wc-invite-row span,
.ah-wc-invite-row small {
  color: var(--ah-muted);
  font-size: 0.8rem;
}

.ah-wc-invite-row code {
  color: var(--ah-muted);
  font-size: 0.72rem;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.ah-wc-permission-field {
  grid-column: 1 / -1;
}

.ah-wc-permission-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.ah-wc-permission-checks label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 7px;
  align-items: center;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--ah-border);
  border-radius: 7px;
  background: #fff;
  color: var(--ah-text);
  cursor: pointer;
}

.ah-wc-permission-checks input {
  width: auto;
  height: auto;
  grid-row: 1 / span 2;
  padding: 0;
}

.ah-wc-permission-checks span {
  font-size: 0.82rem;
  font-weight: 800;
}

.ah-wc-permission-checks code {
  color: var(--ah-muted);
  font-size: 0.72rem;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.ah-wc-user-edit {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--ah-border);
}

.ah-wc-user-edit:first-child {
  border-top: none;
}

.ah-wc-user-edit-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ah-wc-user-edit-head div {
  display: grid;
  gap: 3px;
}

.ah-wc-user-edit-head span {
  color: var(--ah-muted);
  font-size: 0.84rem;
}

.ah-wc-user-edit label {
  display: block;
  margin-bottom: 6px;
  color: var(--ah-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.ah-wc-user-edit select,
.ah-wc-user-edit textarea,
.ah-wc-user-edit input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--ah-border);
  border-radius: 7px;
  background: #fff;
  color: var(--ah-text);
  font: inherit;
}

.ah-wc-user-edit select,
.ah-wc-user-edit input {
  height: 40px;
  padding: 8px 10px;
}

.ah-wc-user-edit textarea {
  min-height: 54px;
  padding: 8px 10px;
  resize: vertical;
}

.ah-wc-form-msg {
  grid-column: 1 / -1;
  margin: 0;
  min-height: 20px;
  color: var(--ah-muted);
  font-size: 0.88rem;
}

.ah-wc-editors {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.ah-wc-editor {
  padding: 12px;
  border: 1px solid var(--ah-border);
  border-radius: 8px;
  background: var(--ah-panel-soft);
}

.ah-wc-editor textarea {
  min-height: 190px;
  margin-top: 10px;
  padding: 12px;
  font: 0.88rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
  resize: vertical;
}

.ah-wc-program {
  margin-top: 12px;
}

.ah-wc-tool-auth {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--ah-border);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.ah-wc-tool-auth .ah-wc-btn {
  margin: 0;
}

.ah-wc-auth-section {
  margin-top: 12px;
}

.ah-wc-auth-toolbar,
.ah-wc-auth-add {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ah-wc-auth-toolbar {
  justify-content: space-between;
  margin-bottom: 10px;
}

.ah-wc-auth-toolbar .ah-wc-muted {
  margin: 0;
  color: #334155;
  font-weight: 800;
}

.ah-wc-plus {
  width: 34px;
  height: 34px;
  border: 1px solid var(--ah-border);
  border-radius: 7px;
  background: var(--ah-blue);
  color: var(--bg, #090B09);
  font-weight: 900;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 18px -12px rgba(30, 101, 214, 0.8);
}

.ah-wc-plus:hover {
  background: #1858bd;
}

.ah-wc-auth-add {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(180px, 240px) minmax(112px, auto);
  align-items: end;
  gap: 12px;
  margin: 8px 0 10px;
  padding: 12px;
  border: 1px solid var(--ah-border);
  border-radius: 8px;
  background: #f8fafc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.ah-wc-auth-add[hidden] {
  display: none;
}

.ah-wc-auth-provider-field,
.ah-wc-auth-add label:not(.ah-wc-auth-provider) {
  display: grid;
  gap: 5px;
  color: var(--ah-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.ah-wc-auth-add input,
.ah-wc-auth-add select {
  height: 38px;
  box-sizing: border-box;
  border: 1px solid var(--ah-border);
  border-radius: 7px;
  background: #fff;
  color: var(--ah-text);
  font-size: 0.9rem;
  line-height: 1.2;
  padding: 7px 9px;
}

.ah-wc-auth-provider-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.ah-wc-auth-provider {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--ah-border);
  border-radius: 8px;
  background: #fff;
  color: var(--ah-text);
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.ah-wc-auth-provider:hover {
  border-color: rgba(30, 101, 214, 0.38);
  box-shadow: 0 8px 18px -16px rgba(15, 23, 42, 0.45);
}

.ah-wc-auth-provider input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ah-wc-auth-provider:has(input:checked) {
  border-color: var(--ah-blue);
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(30, 101, 214, 0.14);
}

.ah-wc-auth-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(112px, auto);
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--ah-border);
}

.ah-wc-auth-row:first-of-type {
  border-top: none;
}

.ah-wc-sp-sites {
  margin: 4px 0 12px 52px;
  padding: 12px;
  border: 1px solid var(--ah-border);
  border-radius: 8px;
  background: #f8fafc;
}

.ah-wc-sp-sites-head {
  margin-bottom: 10px;
}

.ah-wc-sp-sites-head strong {
  display: block;
  font-size: 0.92rem;
}

.ah-wc-sp-sites-head .ah-wc-muted {
  margin: 4px 0 0;
}

.ah-wc-sp-sites-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.ah-wc-sp-site-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--ah-border);
  border-radius: 7px;
  background: #fff;
}

.ah-wc-sp-site-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ah-wc-sp-site-label {
  font-weight: 800;
  color: var(--ah-text);
}

.ah-wc-sp-site-meta {
  color: var(--ah-muted);
  font-size: 0.82rem;
  word-break: break-word;
}

.ah-wc-sp-site-add {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(140px, 0.8fr) minmax(160px, 0.9fr) auto;
  gap: 10px;
  align-items: end;
}

.ah-wc-sp-site-add label {
  display: grid;
  gap: 5px;
  color: var(--ah-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.ah-wc-sp-site-add input {
  height: 38px;
  box-sizing: border-box;
  border: 1px solid var(--ah-border);
  border-radius: 7px;
  background: #fff;
  color: var(--ah-text);
  font-size: 0.9rem;
  padding: 7px 9px;
}

@media (max-width: 900px) {
  .ah-wc-sp-sites {
    margin-left: 0;
  }

  .ah-wc-sp-site-add {
    grid-template-columns: 1fr;
  }
}

.ah-wc-auth-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9ca3af;
}

.ah-wc-auth-icon.is-connected {
  background: #16a34a;
}

.ah-wc-auth-icon.is-missing {
  background: #d97706;
}

.ah-wc-auth-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--ah-auth-logo, #64748b);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 900;
  flex: 0 0 auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.ah-wc-auth-main {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ah-wc-auth-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ah-wc-auth-name {
  font-weight: 800;
  line-height: 1.2;
}

.ah-wc-auth-detail {
  min-width: 0;
  color: var(--ah-muted);
  font-size: 0.86rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ah-wc-auth-state {
  justify-self: end;
  min-width: 108px;
  border-radius: 999px;
  padding: 5px 9px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.ah-wc-auth-state.is-connected {
  background: rgba(22, 163, 74, 0.1);
  color: #15803d;
}

.ah-wc-auth-state.is-missing {
  background: rgba(217, 119, 6, 0.1);
  color: #b45309;
}

.ah-wc-auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.ah-wc-auth-actions .ah-wc-btn,
.ah-wc-auth-add .ah-wc-btn {
  min-width: 112px;
  min-height: 38px;
  height: 38px;
  justify-content: center;
}

.ah-wc-empty {
  padding: 24px;
}

.ah-wc-status--error {
  color: #a11b1b;
}

@media (max-width: 760px) {
  .ah-my-root {
    padding: 20px 12px 44px;
  }

  .ah-wc-shell {
    display: block;
  }

  .ah-wc-tabs {
    flex-direction: row;
    overflow-x: auto;
    margin-bottom: 12px;
  }

  .ah-wc-tab {
    text-align: center;
    white-space: nowrap;
  }

  .ah-wc-header,
  .ah-wc-project-head,
  .ah-wc-section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .ah-wc-summary-grid,
  .ah-wc-two-col,
  .ah-wc-invite,
  .ah-wc-invite--staff,
  .ah-wc-user-edit,
  .ah-wc-tenant-row,
  .ah-wc-auth-add,
  .ah-wc-auth-row {
    grid-template-columns: 1fr;
  }

  .ah-wc-auth-detail {
    white-space: normal;
  }

  .ah-wc-auth-state,
  .ah-wc-auth-actions {
    justify-self: stretch;
  }

  .ah-wc-auth-actions .ah-wc-btn,
  .ah-wc-auth-add .ah-wc-btn {
    width: 100%;
  }
}

.ah-wc-cost-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 20px;
}

.ah-wc-cost-filters label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.ah-wc-cost-filters select,
.ah-wc-cost-filters input[type="date"] {
  width: 100%;
  min-height: 38px;
}

.ah-wc-cost-filters-columns {
  grid-column: 1 / -1;
}

.ah-wc-cost-column-config {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ah-wc-cost-config-label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 4px;
  color: #334155;
}

.ah-wc-cost-metrics-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.ah-wc-cost-metric-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  margin: 0;
  cursor: pointer;
}

.ah-wc-cost-filters-groupby {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ah-wc-cost-groupby {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

.ah-wc-cost-groupby-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  font-size: 0.85rem;
  color: #0f172a;
}

.ah-wc-cost-groupby-remove {
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 2px;
}

.ah-wc-cost-groupby-remove:hover {
  color: #0f172a;
}

.ah-wc-cost-groupby-add {
  margin: 0;
  flex: 1 1 140px;
  min-width: 140px;
}

.ah-wc-cost-groupby-add select {
  width: 100%;
  min-height: 30px;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  font-size: 0.85rem;
}

.ah-wc-tenant-budgets {
  margin-top: 1.5rem;
}

.ah-wc-tenant-budget-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 1.25rem;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}

.ah-wc-tenant-budget-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.ah-wc-tenant-budget-fields--allocation {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}

.ah-wc-tenant-field label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 4px;
  color: #334155;
}

.ah-wc-tenant-field select,
.ah-wc-tenant-field input[type="text"],
.ah-wc-tenant-field input[type="number"] {
  width: 100%;
  min-height: 38px;
  box-sizing: border-box;
}

.ah-wc-tenant-threshold-row {
  display: grid;
  grid-template-columns: minmax(12rem, 1.4fr) minmax(7rem, 0.8fr) minmax(10rem, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.ah-wc-tenant-threshold-row select,
.ah-wc-tenant-threshold-row input[type="number"] {
  width: 100%;
  min-height: 38px;
  box-sizing: border-box;
}

.ah-wc-tenant-value-with-unit {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ah-wc-tenant-value-with-unit input {
  flex: 1 1 auto;
  min-width: 0;
}

.ah-wc-tenant-field-hint {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.35;
}

.ah-wc-tenant-enabled-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.35rem;
}

.ah-wc-tenant-enabled-field input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0.55rem 0 0;
}

.ah-wc-tenant-thresholds {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ah-wc-tenant-budget-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 900px) {
  .ah-wc-tenant-budget-fields,
  .ah-wc-tenant-budget-fields--allocation,
  .ah-wc-tenant-threshold-row {
    grid-template-columns: 1fr;
  }
}

.ah-wc-cost-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.ah-wc-cost-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
}

.ah-wc-cost-card p {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: #64748b;
}

.ah-wc-cost-card strong {
  font-size: 1.15rem;
}

.ah-wc-cost-card-sub {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
}

.ah-wc-cost-loading {
  margin-top: 12px;
  color: #475569;
}

.ah-wc-cost-slow-hint {
  margin-top: 6px;
  font-size: 0.85rem;
}

.ah-wc-cost-loading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.ah-wc-cost-stale-hint {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.ah-wc-cost-table-wrap {
  overflow-x: auto;
  margin-top: 8px;
}

.ah-wc-cost-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ah-wc-cost-data-table th,
.ah-wc-cost-data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
}

.ah-wc-cost-data-table th {
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
}

.ah-wc-cost-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  text-align: inherit;
}

.ah-wc-cost-sort:hover {
  color: #0f172a;
}

.ah-wc-cost-sort.is-active {
  color: #0f766e;
}

.ah-wc-cost-sort.ah-wc-cost-num {
  width: 100%;
  justify-content: flex-end;
}

.ah-wc-cost-row-count {
  margin: 0 0 8px;
  font-size: 0.85rem;
}

.ah-wc-cost-data-table .ah-wc-cost-num {
  text-align: right;
  white-space: nowrap;
}

.ah-wc-cost-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ah-wc-cost-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(120px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.ah-wc-cost-row--compact {
  display: block;
  font-size: 0.9rem;
  color: #334155;
  padding: 4px 0;
  border-bottom: 1px solid #f1f5f9;
}

.ah-wc-cost-bar-wrap {
  height: 10px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}

.ah-wc-cost-bar {
  height: 100%;
  background: #0f766e;
  border-radius: 999px;
}

.ah-wc-cost-row-meta {
  font-size: 0.85rem;
  color: #475569;
  white-space: nowrap;
}

.ah-wc-cost-drill {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.ah-lic-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 16px;
  align-items: end;
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.ah-lic-filters label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
}

.ah-lic-filters select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

.ah-lic-bundle-section {
  margin: 24px 0;
}

.ah-lic-bundle-active {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 10px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  margin-bottom: 16px;
}

.ah-lic-bundle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.ah-lic-bundle-card {
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ah-lic-bundle-card.is-active {
  border-color: #0f766e;
  box-shadow: 0 0 0 1px #0f766e;
}

.ah-lic-bundle-card h4 {
  margin: 0;
  font-size: 1rem;
}

.ah-lic-entitlements {
  margin-top: 28px;
}

.ah-lic-group {
  margin-bottom: 24px;
}

.ah-lic-group h4 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: #334155;
}

.ah-lic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.ah-lic-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ah-lic-card.is-inactive {
  opacity: 0.88;
}

.ah-lic-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.ah-lic-card-id {
  font-size: 0.78rem;
  word-break: break-all;
}

.ah-lic-status {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #0f766e;
}

.ah-lic-card.is-inactive .ah-lic-status {
  color: #94a3b8;
}

.ah-lic-switch,
.ah-lic-grant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ah-lic-grant-row input {
  width: 96px;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

.ah-lic-meter-label {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: #475569;
}

.ah-lic-meter-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 8px 0 0;
}

.ah-lic-meter-stats div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ah-lic-meter-stats dt {
  font-size: 0.72rem;
  color: #64748b;
  text-transform: uppercase;
}

.ah-lic-meter-stats dd {
  margin: 0;
  font-weight: 600;
}

.ah-lic-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
  font-size: 0.78rem;
}

.ah-wc-ops-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 16px;
}

.ah-wc-ops-filters select {
  min-width: 180px;
}

.ah-wc-ops-runner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--ah-border);
  border-radius: 8px;
  margin-bottom: 16px;
  background: var(--ah-panel);
}

.ah-wc-ops-runner--live {
  border-style: solid;
}

.ah-wc-ops-runner--stale {
  border-style: dashed;
}

.ah-wc-ops-live-dot,
.ah-wc-ops-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ah-cyan);
  flex-shrink: 0;
  animation: ah-wc-ops-pulse 1.4s ease-in-out infinite;
}

.ah-wc-ops-section {
  margin-bottom: 22px;
}

.ah-wc-ops-section h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.ah-wc-ops-now-grid {
  display: grid;
  gap: 14px;
}

.ah-wc-ops-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.ah-wc-ops-list-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--ah-border);
  border-radius: 8px;
  background: var(--ah-panel);
}

.ah-wc-ops-list-item--queued,
.ah-wc-ops-list-item--handling {
  border-style: dashed;
}

.ah-wc-ops-list-item--active {
  border-color: color-mix(in srgb, var(--ah-cyan) 45%, var(--ah-border));
}

.ah-wc-ops-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--ah-panel-soft);
  color: var(--ah-blue);
}

.ah-wc-ops-meta {
  color: var(--ah-muted);
  font-size: 0.86rem;
}

.ah-wc-ops-counts {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.ah-wc-ops-count-card {
  border: 1px solid var(--ah-border);
  border-radius: 8px;
  background: var(--ah-panel-soft);
}

.ah-wc-ops-count-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.ah-wc-ops-agent-items {
  list-style: none;
  margin: 0;
  padding: 0 12px 12px;
  display: grid;
  gap: 6px;
}

.ah-wc-ops-table-wrap {
  overflow-x: auto;
}

.ah-wc-ops-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.ah-wc-ops-table th,
.ah-wc-ops-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--ah-border);
  text-align: left;
}

.ah-wc-ops-table tr.is-active td {
  font-weight: 600;
}

.ah-wc-ops-token-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

@keyframes ah-wc-ops-pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .ah-wc-ops-live-dot,
  .ah-wc-ops-live {
    animation: none;
  }
}
