:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #5e6a7d;
  --line: #d9e2ec;
  --panel: #ffffff;
  --bg: #f4f7fb;
  --blue: #0f5ccf;
  --green: #08765c;
  --amber: #9b5b00;
  --red: #b42318;
  --soft-blue: #eaf2ff;
  --soft-green: #e6f6ef;
  --soft-amber: #fff4dc;
  --soft-red: #fff0ee;
  --code: #111827;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 16px clamp(16px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

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

.brand strong,
.brand small {
  display: block;
}

.brand small,
.eyebrow,
.subcopy,
.panel p,
.status-line,
.footer,
.checklist {
  color: var(--muted);
}

.navlinks,
.button-row,
.metric-row,
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.navlinks a,
button,
.action-link {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 13px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.navlinks a {
  font-size: 14px;
}

.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-weight: 780;
}

.ghost {
  background: #fff;
}

.small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 500px);
  gap: 24px;
  align-items: stretch;
}

.intro-panel,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.intro-panel {
  padding: clamp(28px, 5vw, 54px);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 16px;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1;
  letter-spacing: 0;
}

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

.subcopy {
  max-width: 720px;
  font-size: 18px;
  line-height: 1.55;
}

.metric-row {
  margin-top: 24px;
}

.metric-row span,
.state-pill {
  min-height: 34px;
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--soft-blue);
  color: #12458e;
  font-size: 13px;
}

.state-pill.is-ready {
  background: var(--soft-green);
  color: var(--green);
}

.state-pill.is-warn {
  background: var(--soft-amber);
  color: var(--amber);
}

.state-pill.is-error {
  background: var(--soft-red);
  color: var(--red);
}

.panel {
  padding: 22px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

label {
  display: block;
  font-weight: 760;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--blue);
}

code {
  border-radius: 6px;
  padding: 2px 6px;
  background: var(--soft-blue);
  color: #12458e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

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

.stacked-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.verify-form {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.two-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 190px);
  gap: 12px;
}

.status-line {
  min-height: 22px;
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.status-line.is-error {
  color: var(--red);
}

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

.grid-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 16px;
  margin-top: 16px;
}

.segment {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.segment.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.code-box {
  min-height: 230px;
  overflow: auto;
  border-radius: 8px;
  padding: 16px;
  color: #d8f3ff;
  background: var(--code);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.55;
}

.checklist {
  margin: 0;
  padding-left: 20px;
  line-height: 1.65;
}

.apply-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr);
  gap: 24px;
  margin-top: 16px;
}

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

.apply-form button,
.apply-form .status-line {
  grid-column: 1 / -1;
}

.full-span {
  grid-column: 1 / -1;
}

.inline-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 650;
  color: var(--muted);
}

.registration-panel {
  align-self: start;
}

.service-list li,
.process-list li {
  margin-bottom: 10px;
}

.process-list {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.65;
}

.hidden-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  padding: 26px 16px 36px;
  font-size: 14px;
}

.admin-shell h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
}

.admin-auth {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1.1fr);
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

.token-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.admin-auth .status-line {
  grid-column: 1 / -1;
}

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

.record-list {
  display: grid;
  gap: 14px;
}

.record-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.record-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.record-card h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.record-card small,
.record-meta {
  color: var(--muted);
}

.record-meta {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.approve-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.approve-form .inline-check {
  align-items: center;
  min-height: 40px;
}

.compact-code {
  min-height: 120px;
  max-height: 320px;
  margin: 8px 0 0;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

@media (max-width: 860px) {
  .topbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .workbench,
  .split,
  .apply-panel,
  .grid-three,
  .two-fields,
  .apply-form,
  .admin-auth,
  .token-form,
  .admin-grid,
  .approve-form {
    grid-template-columns: 1fr;
  }

  .apply-form button,
  .apply-form .status-line,
  .admin-auth .status-line {
    grid-column: auto;
  }

  h1 {
    font-size: 42px;
  }
}
