:root {
  color-scheme: light;
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-2: #eef4f1;
  --text: #16211d;
  --muted: #60716a;
  --line: #d8e2de;
  --accent: #0f766e;
  --accent-2: #1d4ed8;
  --warn: #b45309;
  --ok: #15803d;
  --shadow: 0 18px 50px rgba(24, 42, 34, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.topbar,
.section-head,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(34px, 4vw, 58px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
}

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

.ghost-link {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}

.panel,
.provider-section,
.instructions-section,
.history-section,
.mock-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
}

.panel-head {
  margin-bottom: 16px;
}

.panel-head span {
  color: var(--muted);
  font-weight: 700;
}

.plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.plan,
.provider {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.plan {
  min-height: 138px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.plan:hover,
.provider:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}

.plan.active,
.provider.active {
  border-color: var(--accent);
  background: var(--surface-2);
}

.plan strong,
.provider strong {
  display: block;
  font-size: 18px;
  letter-spacing: 0;
}

.plan small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.35;
}

.plan b {
  font-size: 24px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field span {
  color: var(--muted);
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: #fff;
  outline: none;
}

.field input:focus {
  border-color: var(--accent);
}

.primary-button,
.ghost-button {
  min-height: 46px;
  border-radius: 8px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  width: 100%;
  background: var(--accent);
  color: white;
}

.primary-button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.button-icon {
  font-size: 20px;
  line-height: 1;
}

.ghost-button {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.mini-button {
  width: fit-content;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.message {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.message[data-type="error"] {
  color: #b91c1c;
}

.message[data-type="success"] {
  color: var(--ok);
}

.provider-section,
.instructions-section,
.history-section {
  margin-top: 18px;
  padding: 20px;
}

.section-head {
  margin-bottom: 16px;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.providers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.provider {
  min-height: 230px;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.provider-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.provider-top em {
  border-radius: 999px;
  padding: 5px 8px;
  background: #e0f2fe;
  color: var(--accent-2);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.provider-fit {
  color: var(--accent);
  font-weight: 800;
}

.provider-kind {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  background: #fef3c7;
  color: var(--warn);
  font-size: 12px;
  font-weight: 900;
}

.provider-meta,
.provider-setup {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.provider-setup {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.instruction-note {
  margin-bottom: 16px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 14px 16px;
  background: #f0fdf4;
  color: #166534;
  line-height: 1.5;
}

.instruction-note strong {
  display: block;
  margin-bottom: 4px;
}

.instruction-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.instruction-card {
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  display: grid;
  gap: 12px;
}

.instruction-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.instruction-top span {
  font-size: 20px;
  font-weight: 900;
}

.instruction-top b {
  border-radius: 999px;
  padding: 5px 8px;
  background: #ecfeff;
  color: #0e7490;
  font-size: 12px;
  white-space: nowrap;
}

.instruction-card p,
.instruction-card li {
  color: var(--muted);
  line-height: 1.48;
}

.instruction-card p {
  margin-bottom: 0;
}

.instruction-card ol {
  margin: 0;
  padding-left: 20px;
}

.instruction-card li + li {
  margin-top: 6px;
}

.instruction-card code {
  border-radius: 6px;
  padding: 2px 6px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

.instruction-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.instruction-links a {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.instruction-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.orders {
  display: grid;
  gap: 10px;
}

.order {
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(120px, 0.4fr) minmax(210px, 0.6fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.order strong,
.order b,
.order span,
.admin-row strong,
.admin-row span {
  display: block;
}

.order span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

.order code {
  overflow-wrap: anywhere;
  border-radius: 8px;
  padding: 10px 12px;
  background: #111827;
  color: #e5f9f3;
  font-size: 14px;
}

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

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

.admin-row {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.admin-row code {
  width: fit-content;
  border-radius: 8px;
  padding: 8px 10px;
  background: #111827;
  color: #e5f9f3;
}

.admin-row span {
  color: var(--muted);
  font-size: 14px;
}

.admin-row .ok {
  color: var(--ok);
  font-weight: 800;
}

.admin-row .bad {
  color: #b91c1c;
  font-weight: 800;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 20px;
  color: var(--muted);
}

.mock-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.mock-panel {
  width: min(520px, 100%);
  padding: 28px;
}

.mock-panel h1 {
  margin-bottom: 14px;
}

.mock-panel p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.5;
}

.back-link {
  display: inline-flex;
  margin-top: 16px;
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 920px) {
  .checkout-grid,
  .providers,
  .plans,
  .instruction-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

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

  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .status-pill,
  .ghost-button {
    width: fit-content;
  }
}
