:root {
  color-scheme: light;
  --bg: #f3f6f5;
  --panel: #ffffff;
  --panel-soft: #fbfaf7;
  --text: #15191d;
  --muted: #66717b;
  --line: #d9dedf;
  --accent: #0e766f;
  --accent-strong: #075f5a;
  --accent-soft: #e1f4ef;
  --ink: #24313a;
  --danger: #b42318;
  --warn: #9a6700;
  --shadow: 0 18px 55px rgba(25, 35, 40, 0.11);
}

* {
  box-sizing: border-box;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0;
  display: grid;
  gap: 20px;
}

.panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 26px;
  backdrop-filter: blur(14px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 440px);
  gap: 22px;
  align-items: stretch;
  min-height: 360px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 14px 4px;
}

.activation-card {
  align-self: center;
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 12px;
  border: 1px solid rgba(14, 118, 111, 0.22);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 800;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 680px;
  font-size: 58px;
  line-height: 1.02;
}

h2 {
  font-size: 26px;
}

.muted {
  color: var(--muted);
  line-height: 1.7;
  max-width: 580px;
  font-size: 16px;
}

.notice {
  display: grid;
  gap: 6px;
  max-width: 690px;
  margin-top: 22px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  padding: 14px 16px;
  color: var(--ink);
}

.notice strong {
  font-size: 14px;
}

.notice span {
  color: var(--muted);
  line-height: 1.65;
}

.form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 123, 108, 0.12);
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  min-height: 48px;
  padding: 13px 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

button:hover {
  background: var(--accent-strong);
  box-shadow: 0 10px 24px rgba(14, 118, 111, 0.22);
  transform: translateY(-1px);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(14, 118, 111, 0.22);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  box-shadow: none;
  transform: none;
}

.status-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.pill {
  min-width: 78px;
  border-radius: 999px;
  background: #e8eef1;
  color: #40515b;
  padding: 7px 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 14px;
  margin-bottom: 14px;
}

.result-primary {
  display: grid;
  gap: 14px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 18px;
}

.result-primary strong {
  min-height: 42px;
  color: var(--text);
  font-size: 40px;
  line-height: 1.05;
  overflow-wrap: anywhere;
  letter-spacing: 0;
}

.result-primary small {
  color: var(--muted);
  line-height: 1.5;
}

.code-card {
  background: #f7fbff;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.ghost-button {
  min-height: 36px;
  border: 1px solid rgba(14, 118, 111, 0.32);
  background: #fff;
  color: var(--accent);
  padding: 8px 11px;
  font-size: 13px;
  white-space: nowrap;
}

.ghost-button:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: none;
}

.pill.active {
  background: #fff4d6;
  color: var(--warn);
}

.pill.completed {
  background: #dff8ef;
  color: var(--accent-strong);
}

.pill.failed,
.pill.canceled {
  background: #fee4e2;
  color: var(--danger);
}

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

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

.result-grid div,
.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 16px;
  min-width: 0;
}

.result-grid span,
.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.result-grid strong,
.metric strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 22px;
}

.message {
  color: var(--muted);
  margin: 18px 0 0;
  min-height: 24px;
}

.copy-toast {
  margin: 4px 0 0;
  min-height: 22px;
  color: var(--accent-strong);
  font-weight: 800;
}

.message.danger,
.danger {
  color: var(--danger);
}

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

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

.tabs {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}

.tabs button {
  background: #e7ecef;
  color: var(--text);
}

.tabs button.active {
  background: var(--accent);
  color: #fff;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.toolbar {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 10px;
  margin-bottom: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

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

.hidden {
  display: none !important;
}

.stack {
  display: grid;
  gap: 14px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #101820;
  color: #e9f3f0;
  border-radius: 8px;
  padding: 16px;
  min-height: 120px;
}

.mini-button {
  min-height: 32px;
  margin: 2px;
  padding: 7px 10px;
  font-size: 12px;
}

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

.danger-button:hover {
  background: #8f1d14;
}

@media (max-width: 820px) {
  .hero,
  .result-layout,
  .field-row,
  .split,
  .toolbar {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 520px) {
  .shell,
  .admin-shell {
    width: min(100% - 20px, 100%);
    padding: 20px 0;
  }

  .panel {
    padding: 20px;
  }

  .hero {
    min-height: auto;
  }

  h1 {
    font-size: 38px;
  }

  .result-primary strong {
    font-size: 30px;
  }

  .status-top,
  .result-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .result-grid,
  .result-grid.compact,
  .metrics {
    grid-template-columns: 1fr;
  }
}
