:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --line: #d8dee8;
  --text: #18202d;
  --muted: #667085;
  --accent: #176a5f;
  --accent-strong: #0f5149;
  --accent-soft: #e7f5f1;
  --warning: #9a5b00;
  --danger: #b42318;
  --ok: #0f7a48;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

h1,
h2 {
  margin: 0 0 16px;
  line-height: 1.2;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 28px;
  background: #0d1524;
  color: #f9fafb;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  font-weight: 700;
}

.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 8px 18px rgba(0, 0, 0, 0.24);
  overflow: hidden;
}

.brand__mark img {
  display: block;
  width: 28px;
  height: 28px;
}

.brand__word {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  letter-spacing: 0;
}

.brand__primary {
  color: #ffffff;
  font-size: 15px;
  font-weight: 760;
}

.brand__secondary {
  color: #9fd8cf;
  font-size: 14px;
  font-weight: 650;
}

.topbar__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #d1d5db;
  font-size: 13px;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.tabs a {
  padding: 10px 12px;
  color: var(--text);
  border-bottom: 2px solid transparent;
}

.tabs a:hover,
.tabs a.is-active {
  border-color: var(--accent);
}

.tabs a.is-active {
  color: var(--accent-strong);
  font-weight: 700;
}

.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 24px;
  align-items: center;
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid #cfe0dc;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #eef8f5 100%);
  box-shadow: var(--shadow);
}

.page-hero h1 {
  max-width: 760px;
  margin-bottom: 10px;
  font-size: 28px;
}

.page-hero p,
.workflow-band p,
.support-card p,
.step-card p {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.hero-meter {
  display: grid;
  place-items: center;
  min-height: 132px;
  border: 1px solid #b9d6c8;
  border-radius: 8px;
  background: #ffffff;
}

.hero-meter__value {
  color: var(--accent-strong);
  font-size: 34px;
  font-weight: 780;
}

.hero-meter__label {
  color: var(--muted);
  font-size: 12px;
}

.operation-steps,
.support-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.step-card,
.support-card {
  display: flex;
  gap: 14px;
  min-height: 170px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.step-card--ok {
  border-color: #b9d6c8;
}

.step-card--warning,
.step-card--danger {
  border-color: #efd8a7;
}

.step-card--danger {
  border-color: #f4b8b2;
}

.step-card__number {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 780;
}

.step-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.step-card__title {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
}

.step-card__title h2,
.support-card h2,
.workflow-band h2 {
  margin: 0;
}

.step-card .button {
  align-self: flex-start;
  margin-top: auto;
}

.workflow-band {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  margin-bottom: 18px;
  border: 1px solid #cfe0dc;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.workflow-band__content {
  min-width: 0;
}

.workflow-band__status {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.support-card {
  flex-direction: column;
}

.support-card--recommended {
  border-color: #b9d6c8;
  background: #fbfffd;
}

.support-card__tag {
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.support-card .button {
  align-self: flex-start;
  margin-top: auto;
}

.cutover-lane {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}

.cutover-lane__item {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #344054;
  font-weight: 700;
  text-align: center;
  box-shadow: var(--shadow);
}

.cutover-lane__item:hover,
.cutover-lane__item.is-active {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.panel--narrow {
  max-width: 440px;
  margin: 48px auto;
}

.auth-brand {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(15, 61, 94, 0.16);
  overflow: hidden;
}

.auth-brand img {
  display: block;
  width: 44px;
  height: 44px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.metrics--compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.metric__value {
  display: block;
  font-size: 28px;
  font-weight: 700;
}

.metric__label {
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

.split > * {
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-heading--compact {
  margin-top: 20px;
  margin-bottom: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

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

th {
  background: #f1f4f8;
  color: #344054;
  font-weight: 650;
}

tr:last-child td {
  border-bottom: 0;
}

.mono {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.secret {
  padding: 10px 12px;
  background: #f1f4f8;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow-wrap: anywhere;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: #344054;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.badge--ok {
  background: #e7f6ee;
  color: var(--ok);
}

.badge--muted {
  background: #f2f4f7;
  color: var(--muted);
}

.badge--warning {
  background: #fff7e6;
  color: #9a5b00;
}

.badge--danger {
  background: #fff1f0;
  color: var(--danger);
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.button:hover,
button:hover,
.button.is-active {
  border-color: var(--accent);
}

.button.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.button--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.button--primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.button--danger {
  color: var(--danger);
}

.link-button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffffff;
}

.inline-form,
.actions form {
  display: inline;
}

.actions,
.stacked-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stacked-actions {
  max-width: 420px;
}

.compact-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.compact-form input[type="password"] {
  width: 170px;
}

.compact-form input[name="host"] {
  width: 260px;
}

.compact-form input[name="name"] {
  width: 200px;
}

.compact-form select[name="mode"] {
  width: 150px;
}

.compact-form input[name="reportPath"] {
  width: 250px;
}

.acme-form {
  display: grid;
  grid-template-columns:
    minmax(180px, 1.4fr)
    minmax(150px, 1fr)
    minmax(130px, 0.7fr)
    auto
    auto
    minmax(190px, 1.2fr)
    auto
    auto;
  align-items: end;
}

.acme-form input,
.acme-form select {
  width: 100% !important;
}

.acme-form .check-line {
  align-self: center;
  white-space: nowrap;
}

.public-check-form input[name="httpPort"],
.public-check-form input[name="httpsPort"] {
  width: 96px;
}

.public-check-form input[name="path"],
.public-check-form input[name="timeoutMs"] {
  width: 170px;
}

.public-check-form input[name="site"],
.public-check-form input[name="blockedPorts"] {
  width: 260px;
}

.evidence-check-form input[name="acmePreflightReport"],
.evidence-check-form input[name="readinessReport"],
.evidence-check-form input[name="publicReport"],
.cutover-status-form input[name="acmePreflightReport"],
.cutover-status-form input[name="readinessReport"],
.cutover-status-form input[name="publicReport"],
.cutover-status-form input[name="rollbackReport"] {
  width: 320px;
}

.evidence-check-form input[name="expectedSiteCount"],
.cutover-status-form input[name="expectedSiteCount"] {
  width: 120px;
}

.evidence-check-form input[name="blockedPorts"],
.cutover-status-form input[name="blockedPorts"] {
  width: 260px;
}

.cutover-status-form select[name="phase"] {
  width: 160px;
}

.rollback-plan-form {
  align-items: center;
}

.step-list,
.command-list {
  margin: 0;
  padding-left: 20px;
}

.step-list li,
.command-list li {
  margin: 8px 0;
}

.command-list code {
  white-space: normal;
  word-break: break-word;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid--wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label span {
  display: block;
  margin-bottom: 5px;
  color: #344054;
  font-weight: 650;
}

input,
select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

input[type="checkbox"] {
  width: auto;
  min-height: 0;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.form-section {
  grid-column: 1 / -1;
  padding: 14px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.form-section legend {
  padding: 0 8px 0 0;
  color: #344054;
  font-weight: 700;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.notice {
  padding: 10px 12px;
  margin-bottom: 14px;
  border: 1px solid #b9d6c8;
  border-radius: 6px;
  background: #eef8f3;
  color: var(--accent-strong);
}

.notice--error {
  border-color: #f4b8b2;
  background: #fff1f0;
  color: var(--danger);
}

.qr-box {
  display: grid;
  place-items: center;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.qr-box img {
  width: 220px;
  height: 220px;
}

.status-code {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 40px;
  font-weight: 700;
}

@media (max-width: 820px) {
  .topbar,
  .section-heading,
  .workflow-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .shell {
    padding: 16px;
  }

  .page-hero,
  .metrics,
  .operation-steps,
  .support-grid,
  .cutover-lane,
  .split,
  .form-grid--wide {
    grid-template-columns: 1fr;
  }

  .workflow-band__status {
    justify-content: flex-start;
  }

  .compact-form {
    align-items: stretch;
  }

  .compact-form label,
  .compact-form input,
  .compact-form select,
  .compact-form button,
  .compact-form .button {
    width: 100% !important;
  }

  .compact-form .check-line {
    width: auto !important;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}
