:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dbe3ee;
  --nav: #0f172a;
  --nav-hover: #1e293b;
  --blue: #1d4ed8;
  --green: #15803d;
  --amber: #b45309;
  --red: #b91c1c;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  --focus: rgba(37, 99, 235, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  letter-spacing: 0;
  -webkit-text-size-adjust: 100%;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 38px;
}

[hidden] {
  display: none !important;
}

.locked .app-shell {
  display: none;
}

.auth-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(380px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin: 0;
  font-size: 26px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--nav);
  font-weight: 800;
}

.brand-mark.small {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

label small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

input.missing-required {
  border-color: #f59e0b;
  background: #fffbeb;
}

.field-hint {
  font-size: 12px;
  font-weight: 700;
}

.field-hint.warn {
  color: #b45309;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  border: 1px solid transparent;
  font-weight: 700;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus);
}

.primary-btn {
  color: #fff;
  background: var(--blue);
}

.secondary-btn {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.danger-btn {
  color: var(--red);
}

.ghost-btn {
  color: #334155;
  background: transparent;
  border-color: transparent;
}

.auth-reset-btn {
  margin-top: 10px;
  width: 100%;
}

.primary-btn:disabled,
.secondary-btn:disabled,
.ghost-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.form-error,
.status-line {
  min-height: 20px;
  color: var(--red);
  font-size: 13px;
}

.form-error.ok {
  color: var(--green);
}

.status-line.ok {
  color: var(--green);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  padding: 16px;
  color: #e5e7eb;
  background: var(--nav);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  font-weight: 800;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-link {
  width: 100%;
  min-height: 40px;
  text-align: left;
  border: 0;
  border-radius: 6px;
  padding: 9px 10px;
  color: #d1d5db;
  background: transparent;
  cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: var(--nav-hover);
}

.content {
  min-width: 0;
  padding: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.topbar h1 {
  margin: 0 0 4px;
  font-size: 24px;
}

.operator-chip {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  max-width: min(360px, 34vw);
  padding: 5px 9px 5px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.operator-chip > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.operator-avatar {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  color: #fff;
  background: var(--nav);
  font-size: 12px;
}

.topbar-actions,
.row-actions,
.toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.portal-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.portal-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.portal-link:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.portal-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus);
}

.toolbar {
  align-items: end;
}

.toolbar label {
  min-width: 170px;
  flex: 1 1 170px;
}

.toolbar label.wide-field {
  flex: 2 1 360px;
}

.toolbar .field-note {
  flex: 1 1 100%;
  color: var(--muted);
  font-size: 12px;
}

.toolbar label.toggle-field {
  display: flex;
  min-height: 42px;
  flex: 0 1 auto;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.toggle-field input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  flex: 0 0 18px;
  padding: 0;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.metrics-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.metric-card,
.surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 14px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.surface {
  margin-top: 12px;
  padding: 14px;
}

.surface-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 12px;
}

.surface-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.surface h2 {
  margin: 0;
  font-size: 18px;
}

.surface h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.tab-row {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.view-tab {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  color: #475569;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.view-tab.active {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.monitoring-tab-panel {
  display: none;
  padding-top: 14px;
}

.monitoring-tab-panel.active {
  display: block;
}

.monitoring-toolbar {
  margin-bottom: 10px;
}

.monitoring-toolbar label {
  min-width: 190px;
}

.runtime-grid {
  margin-top: 12px;
}

.contract-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.contract-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.contract-card h3 {
  margin: 0;
}

.contract-card dl {
  display: grid;
  gap: 5px;
  margin: 0;
  font-size: 13px;
}

.contract-card div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.contract-card dt {
  color: var(--muted);
  font-weight: 800;
}

.contract-card dd {
  margin: 0;
  text-align: right;
  font-weight: 750;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 13px;
}

.backup-executions-table {
  min-width: 980px;
}

.backup-executions-table th:nth-child(1) { width: 190px; }
.backup-executions-table th:nth-child(2) { width: 100px; }
.backup-executions-table th:nth-child(3) { width: 180px; }
.backup-executions-table th:nth-child(5),
.backup-executions-table th:nth-child(6) { width: 130px; }

.environment-context {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  background: var(--surface-soft);
  font-size: 13px;
}

.environment-context:has(.production) { border-left-color: #b42318; }
.environment-context:has(.staging) { border-left-color: #027a48; }
.environment-context span:last-child { color: var(--muted); }

.environment-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.environment-badge.production { color: #b42318; background: #fff1f0; }
.environment-badge.staging { color: #027a48; background: #ecfdf3; }
.environment-badge.unknown { color: #93370d; background: #fffaeb; }

.archive-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  margin: 10px 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.archive-summary dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 0;
}

.archive-summary dl div { min-width: 0; }
.archive-summary dt { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.archive-summary dd { margin: 2px 0 0; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.archive-summary code { font-size: 11px; font-weight: 600; }

.archive-browser-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.archive-browser-toolbar label { flex: 1 1 420px; }

.archive-environment-filter {
  display: inline-flex;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.archive-environment-filter button {
  min-height: 38px;
  padding: 7px 11px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  color: var(--muted);
  background: var(--surface);
  font-weight: 750;
}

.archive-environment-filter button:last-child { border-right: 0; }
.archive-environment-filter button.active { color: #fff; background: #1d4ed8; }

.archive-table-wrap {
  max-height: 380px;
  overflow: auto;
}

.backup-manifest-table { min-width: 1120px; }
.backup-manifest-table th:first-child { width: 42px; }
.backup-manifest-table th:nth-child(2) { width: 180px; }
.backup-manifest-table th:nth-child(5) { width: 150px; }
.backup-manifest-table th:nth-child(6) { width: 150px; }
.backup-manifest-table th:nth-child(7) { width: 120px; }
.backup-manifest-table tbody tr { cursor: pointer; }
.backup-manifest-table tbody tr:hover { background: #f8fafc; }
.backup-manifest-table tbody tr.selected { background: #eff6ff; box-shadow: inset 4px 0 #2563eb; }
.backup-manifest-table tbody tr.unavailable { cursor: not-allowed; opacity: 0.72; }
.archive-warning { margin-top: 3px; color: #b42318; font-size: 11px; font-weight: 750; }

.job-status-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid #64748b;
  background: var(--surface-soft);
  font-size: 13px;
}

.job-status-panel.active {
  border-left-color: #d97706;
  background: #fffbeb;
}

.job-status-panel strong { white-space: nowrap; }
.job-status-panel span { color: var(--muted); }

th,
td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  color: #475569;
  background: var(--surface-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  background: #e2e8f0;
  color: #334155;
  white-space: nowrap;
}

.status-pill.ok {
  background: #dcfce7;
  color: var(--green);
}

.status-pill.warn {
  background: #fef3c7;
  color: var(--amber);
}

.status-pill.bad {
  background: #fee2e2;
  color: var(--red);
}

.bar-list {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-row-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 4px;
  background: #e2e8f0;
}

.bar-fill {
  height: 100%;
  width: 0;
  background: var(--blue);
}

.signal-list {
  display: grid;
  gap: 10px;
}

.signal-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.signal-row:last-child {
  border-bottom: 0;
}

.billing-intro,
.commercial-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.billing-intro p,
.commercial-intro p {
  max-width: 820px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.billing-flow,
.commercial-flow {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.billing-flow span,
.commercial-flow span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.compact-intro {
  align-items: center;
}

.compact-surface {
  padding-block: 12px;
}

.package-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.commercial-panel {
  min-width: 0;
}

.package-toolbar label {
  flex-basis: 190px;
}

.package-fields,
.package-module-panel {
  min-width: 0;
}

.component-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.component-chip {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: #334155;
}

.component-chip small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.billing-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.billing-summary-card {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.billing-summary-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.billing-summary-card strong {
  font-size: 20px;
}

.billing-summary-card small,
.module-help,
.module-foot {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}

.section-subhead {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.section-subhead h3 {
  margin: 0;
  font-size: 15px;
}

.section-subhead p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.warning-strip {
  padding: 10px 12px;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 750;
}

.module-grid,
.override-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.override-grid {
  max-height: 460px;
  overflow: auto;
  padding-right: 2px;
}

.module-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.module-checklist {
  max-height: 420px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.module-checkbox {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 800;
}

.module-checkbox input {
  width: 16px;
  min-height: 16px;
}

.module-checkbox.is-subscribed {
  border-color: rgba(29, 78, 216, 0.28);
  background: #f8fbff;
}

.module-access-list {
  display: grid;
  gap: 6px;
  max-height: 340px;
  overflow: auto;
  margin-top: 12px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.module-access-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 120px auto auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.module-access-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.module-access-row.is-effective {
  box-shadow: inset 3px 0 0 var(--green);
}

.module-item,
.override-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.module-item.compact {
  align-content: start;
  min-height: 92px;
}

.module-item.is-subscribed {
  border-color: rgba(29, 78, 216, 0.25);
  background: #f8fbff;
}

.module-item.is-effective {
  box-shadow: inset 3px 0 0 var(--green);
}

.module-item-top,
.module-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.module-foot {
  align-items: flex-start;
  flex-wrap: wrap;
}

.module-foot strong {
  color: var(--ink);
}

.override-note {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  padding: 3px 8px;
  color: #92400e;
  background: #fef3c7;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.override-item.has-override {
  border-color: #f59e0b;
  background: #fffbeb;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
}

.check-row input {
  width: 16px;
  min-height: 16px;
}

.override-control {
  display: grid;
  gap: 5px;
}

.override-control span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.inline-action {
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.link-button {
  min-height: 0;
  padding: 0;
  color: var(--blue);
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-align: left;
}

.selected-row td {
  background: #f8fbff;
}

.ops-integrations-hub {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.ops-integrations-list {
  display: grid;
  gap: 8px;
}

.ops-integration-item {
  width: 100%;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  text-align: left;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.ops-integration-item.active {
  border-color: rgba(29, 78, 216, 0.45);
  box-shadow: inset 3px 0 0 var(--blue);
}

.ops-integration-item span {
  display: grid;
  gap: 4px;
}

.ops-integration-item span span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.ops-integrations-detail {
  min-width: 0;
}

.ops-integration-detail {
  display: none;
}

.ops-integration-detail.active {
  display: grid;
  gap: 14px;
}

.ops-integration-title,
.ops-block-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.ops-integration-title h3,
.ops-block-head h4 {
  margin: 0 0 4px;
}

.ops-integration-title h3 {
  font-size: 20px;
}

.ops-block-head h4 {
  font-size: 15px;
}

.ops-key-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.ops-key-value {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.ops-key-value span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.ops-key-value strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ops-integration-block {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.ops-oauth-lines {
  display: grid;
  gap: 10px;
}

.code-line {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  overflow-wrap: anywhere;
  white-space: normal;
  color: #1e293b;
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
}

.integration-actions {
  justify-content: flex-start;
}

.oauth-account-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  width: auto;
  height: auto;
  margin: 0;
  padding: 16px;
  border: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: rgba(15, 23, 42, 0.48);
  box-sizing: border-box;
}

.oauth-account-dialog[hidden] {
  display: none;
}

.oauth-account-dialog-content {
  width: min(560px, 100%);
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.24);
}

.oauth-account-dialog-content h4,
.oauth-account-dialog-content p {
  margin: 0;
}

.oauth-account-dialog-content p {
  margin-top: 8px;
}

.oauth-account-dialog-actions {
  justify-content: flex-end;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
}

.integration-setup {
  border-left: 3px solid #f59e0b;
  padding-left: 14px;
}

.integration-setup-steps {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 22px;
  color: #334155;
}

.integration-secret-target {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.integration-secret-target span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.integration-secret-target code {
  padding: 5px 7px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #1e293b;
  font-size: 12px;
}

@media (max-width: 860px) {
  .archive-summary {
    grid-template-columns: 1fr;
  }

  .archive-summary dl {
    grid-template-columns: 1fr 1fr;
  }

  .environment-context {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .archive-browser-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .archive-browser-toolbar label { flex-basis: auto; }

  .archive-environment-filter {
    align-self: flex-start;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  }

  .nav-link {
    text-align: center;
    padding-inline: 6px;
  }

  .surface-grid {
    grid-template-columns: 1fr;
  }

  .billing-intro,
  .commercial-intro,
  .module-item-top,
  .module-foot {
    display: grid;
  }

  .billing-flow,
  .commercial-flow {
    flex-wrap: wrap;
  }

  .package-workspace {
    grid-template-columns: 1fr;
  }

  .module-access-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .ops-integrations-hub {
    grid-template-columns: 1fr;
  }

  .ops-integration-title,
  .ops-block-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
    min-height: 100dvh;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 0;
    padding:
      max(10px, env(safe-area-inset-top, 0px))
      10px
      8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .sidebar-brand {
    margin-bottom: 8px;
  }

  .nav-list {
    display: flex;
    grid-template-columns: none;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    min-height: 36px;
    padding: 7px 10px;
    text-align: center;
    white-space: nowrap;
  }

  .content {
    padding: 12px;
  }

  .topbar {
    gap: 10px;
  }

  .topbar-actions,
  .row-actions,
  .toolbar {
    width: 100%;
    align-items: stretch;
  }

  .oauth-account-dialog-actions > button {
    width: 100%;
  }

  .portal-links {
    width: 100%;
  }

  .portal-link {
    flex: 1 1 0;
    justify-content: center;
  }

  .operator-chip {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .surface,
  .metric-card {
    padding: 12px;
  }

  .surface-head,
  .billing-intro,
  .commercial-intro,
  .signal-row,
  .bar-row-top,
  .contract-card div {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar label,
  .monitoring-toolbar label {
    min-width: 0;
    flex: 1 1 100%;
  }

  table {
    min-width: 640px;
  }
}

@media (max-width: 560px) {
  .auth-view,
  .content {
    padding: 10px;
  }

  .login-panel {
    padding: 18px;
  }

  .topbar h1 {
    font-size: 21px;
  }

  .metrics-grid,
  .metrics-grid.compact,
  .billing-summary-grid,
  .module-grid,
  .override-grid,
  .module-checklist,
  .component-strip,
  .contract-list,
  .ops-key-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar-actions > button,
  .row-actions > button,
  .toolbar > button,
  .surface-head > button {
    flex: 1 1 100%;
    width: 100%;
  }

  .billing-flow,
  .commercial-flow {
    align-items: stretch;
    flex-direction: column;
  }

  .billing-flow span,
  .commercial-flow span {
    justify-content: center;
  }

  .table-wrap {
    margin-inline: -2px;
  }

  table {
    min-width: 560px;
  }
}

/* Tenant and commercial directories: one readable row per entity. */
#package-editor > .surface { padding: 0; border: 0; box-shadow: none; }
#package-editor { gap: 28px; }
#package-editor .package-toolbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
#package-editor .surface-head { align-items: flex-start; }
#merchant-detail, #merchant-directory { display: grid; gap: 18px; }
.inclusion-control { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.inclusion-control input { width: 18px; height: 18px; }
#override-modules select { min-width: 140px; }
#tenant-detail .table-wrap { margin-top: 18px; }
.tenant-danger-zone { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 20px; }
#tenant-provision-status { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  #package-editor .row-actions { flex-wrap: wrap; }
  #package-editor .package-toolbar { grid-template-columns: minmax(0, 1fr); }
}

#package-modules .inclusion-control input { min-height: 18px; margin: 0; padding: 0; flex: 0 0 18px; }

.runtime-config-table { min-width: 0; table-layout: fixed; }
.runtime-config-table th, .runtime-config-table td { overflow-wrap: anywhere; }

/* Official compact Google sign-in control, secondary to password/code login. */
.auth-google-option { display: grid; justify-items: center; gap: 12px; margin-top: 16px; }
.auth-method-divider { display: flex; align-items: center; gap: 12px; width: 100%; color: var(--muted); font-size: 12px; }
.auth-method-divider::before, .auth-method-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-panel #login-google { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: max-content; min-width: 180px; max-width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #747775; border-radius: 4px; background: #fff; color: #1f1f1f; font-family: "Google Sans", Roboto, Arial, sans-serif; font-size: 14px; font-weight: 500; line-height: 1.4286; box-shadow: none; }
.login-panel #login-google img { display: block; flex: none; width: 20px; height: auto; pointer-events: none; }
.login-panel #login-google:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.login-panel #login-google[hidden], .auth-google-option:has(> button[hidden]) { display: none; }
