:root {
  color-scheme: light;
  --paper: #e8edf0;
  --paper-raised: #f7f9fa;
  --ink: #17212c;
  --ink-soft: #52606c;
  --rule: #bcc6cc;
  --rule-strong: #6f7d86;
  --blue: #21547a;
  --blue-dark: #153b58;
  --red: #a8382e;
  --amber: #895a08;
  --green: #2e674d;
  --focus: #0068a3;
  --serif: "Iowan Old Style", "Noto Serif SC", "Songti SC", STSong, serif;
  --sans: "Segoe UI", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; text-underline-offset: 0.22em; }
::selection { background: #f0c95d; color: #111820; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: white;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(180px, 1fr);
  align-items: stretch;
  border-bottom: 1px solid var(--ink);
  background: var(--paper-raised);
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px clamp(18px, 3vw, 44px);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.wordmark-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: white;
  font-family: var(--serif);
  font-size: 15px;
  border-radius: 50%;
}
.wordmark small { display: block; color: var(--ink-soft); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; }
.primary-nav { display: flex; align-items: stretch; }
.primary-nav a {
  display: grid;
  place-items: center;
  min-width: 104px;
  padding: 0 18px;
  border-left: 1px solid var(--rule);
  text-decoration: none;
  font-size: 14px;
}
.primary-nav a:last-child { border-right: 1px solid var(--rule); }
.primary-nav a[aria-current="page"] { background: var(--ink); color: white; }
.service-indicator {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 clamp(18px, 3vw, 44px);
  color: var(--ink-soft);
  font-size: 13px;
}
.indicator-light { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.service-indicator[data-state="online"] .indicator-light { background: var(--green); }
.service-indicator[data-state="offline"] .indicator-light { background: var(--red); }

main { min-height: calc(100vh - 160px); }
.view { padding: clamp(48px, 7vw, 104px) clamp(20px, 6vw, 96px); }
.release-stage {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(580px, 1.18fr);
  gap: clamp(48px, 7vw, 120px);
  align-items: center;
}
h1, h2, h3, p { text-wrap: pretty; }
h1, h2 { font-family: var(--serif); }
h1 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(42px, 5.7vw, 82px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.035em;
}
.lead { max-width: 62ch; margin: 28px 0 0; color: var(--ink-soft); font-size: clamp(17px, 1.5vw, 20px); }
.hero-actions { display: flex; align-items: center; gap: 22px; margin-top: 34px; flex-wrap: wrap; }
.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}
.button-primary { background: var(--ink); color: white; }
.button-primary:hover { background: var(--blue-dark); }
.button-secondary { background: transparent; color: var(--ink); }
.button[aria-disabled="true"], .button:disabled { cursor: not-allowed; opacity: 0.55; }
.text-link { color: var(--blue-dark); font-weight: 700; }
.action-note { margin: 10px 0 0; color: var(--ink-soft); font-size: 13px; }

.release-sheet {
  min-height: 530px;
  display: grid;
  grid-template-columns: 54px 1fr;
  background: var(--paper-raised);
  border: 1px solid var(--ink);
  box-shadow: 0 22px 50px rgba(44, 39, 28, 0.14);
  transform: rotate(-0.6deg);
}
.sheet-edge {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 20px 10px;
  border-right: 1px solid var(--ink);
  background: var(--blue-dark);
  color: white;
  writing-mode: vertical-rl;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
}
.sheet-body { padding: clamp(28px, 4vw, 54px); }
.sheet-heading { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 28px; border-bottom: 2px solid var(--ink); }
.sheet-heading p { margin: 0 0 6px; font: 11px/1.3 var(--mono); letter-spacing: 0.14em; }
.sheet-heading h2 { margin: 0; font-size: clamp(30px, 3vw, 46px); line-height: 1.1; }
.release-seal {
  width: 92px;
  height: 92px;
  flex: 0 0 auto;
  display: grid;
  place-content: center;
  text-align: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  color: var(--amber);
  transform: rotate(7deg);
}
.release-seal span { font-size: 11px; letter-spacing: 0.1em; }
.release-seal strong { font-size: 15px; }
.release-seal[data-state="local_ready"], .release-seal[data-state="published"] { color: var(--green); }
.release-seal[data-state="blocked"] { color: var(--red); }
.release-facts { display: grid; grid-template-columns: repeat(2, 1fr); margin: 0; border-bottom: 1px solid var(--ink); }
.release-facts div { min-height: 84px; padding: 18px 16px 16px; border-bottom: 1px solid var(--rule); }
.release-facts div:nth-child(odd) { border-right: 1px solid var(--rule); }
.release-facts div:nth-child(even) { padding-left: 22px; }
.release-facts dt { color: var(--ink-soft); font-size: 12px; }
.release-facts dd { margin: 5px 0 0; font: 700 16px/1.3 var(--mono); }
.checksum-block { display: flex; justify-content: space-between; gap: 20px; align-items: end; padding: 22px 0 18px; border-bottom: 1px solid var(--rule); }
.checksum-block span { display: block; margin-bottom: 7px; color: var(--ink-soft); font-size: 11px; }
.checksum-block code { display: block; max-width: 44ch; overflow-wrap: anywhere; font: 12px/1.45 var(--mono); }
.icon-button, .reveal-button { border: 0; border-bottom: 1px solid currentColor; background: transparent; color: var(--blue); cursor: pointer; white-space: nowrap; }
.icon-button:disabled { color: var(--ink-soft); cursor: not-allowed; }
.sheet-note { margin: 18px 0 0; color: var(--ink-soft); font-size: 12px; }

.install-section, .artifact-note { max-width: 1240px; margin: clamp(100px, 12vw, 180px) auto 0; }
.section-heading { display: grid; grid-template-columns: 1fr minmax(280px, 0.6fr); gap: 60px; align-items: end; padding-bottom: 28px; border-bottom: 1px solid var(--ink); }
.section-heading h2, .artifact-note h2 { max-width: 16ch; margin: 0; font-size: clamp(32px, 4vw, 56px); line-height: 1.08; letter-spacing: -0.025em; }
.section-heading p { max-width: 54ch; margin: 0; color: var(--ink-soft); }
.procedure-list { list-style: none; margin: 0; padding: 0; }
.procedure-list li { display: grid; grid-template-columns: 90px 1fr; gap: 28px; padding: 30px 0; border-bottom: 1px solid var(--rule); }
.procedure-number { font: 500 clamp(34px, 4vw, 52px)/1 var(--serif); color: var(--blue); }
.procedure-list h3 { margin: 0 0 6px; font-size: 20px; }
.procedure-list p { max-width: 66ch; margin: 0; color: var(--ink-soft); }
.artifact-note { display: grid; grid-template-columns: minmax(280px, 0.7fr) 1fr; gap: 70px; padding: 50px 0 20px; border-top: 4px solid var(--ink); }
.artifact-comparison { display: grid; grid-template-columns: 1fr 1fr; }
.artifact-comparison div { padding: 16px 26px 24px; border-left: 1px solid var(--rule); }
.artifact-comparison strong { font-size: 18px; }
.artifact-comparison p { color: var(--ink-soft); }
.artifact-comparison code { display: block; max-width: 100%; color: var(--ink-soft); font: 11px/1.5 var(--mono); overflow-wrap: anywhere; }
.artifact-comparison .icon-button { margin-top: 14px; }
.artifact-update-note { grid-column: 2; margin: 0 26px; color: var(--ink-soft); font-size: 13px; }
.ops-diagnostics { margin-top: clamp(72px, 9vw, 120px); padding-top: clamp(44px, 6vw, 72px); border-top: 1px solid var(--ink); }

.license-layout { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: minmax(420px, 1.2fr) minmax(340px, 0.8fr); gap: clamp(60px, 9vw, 140px); }
.license-form-column h1 { max-width: 12ch; }
.license-form { max-width: 680px; display: grid; gap: 10px; margin-top: 42px; }
.license-form label { margin-top: 14px; font-weight: 700; }
.license-form input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  background: var(--paper-raised);
  color: var(--ink);
}
.license-form input::placeholder { color: #64717b; opacity: 1; }
.credential-field { position: relative; }
.credential-field input { padding-right: 70px; }
.reveal-button { position: absolute; right: 14px; top: 16px; }
.license-form p { margin: 0 0 8px; color: var(--ink-soft); font-size: 13px; }
.license-form .button { justify-self: start; margin-top: 18px; }
.license-result { max-width: 680px; margin-top: 24px; padding: 18px 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); }
.license-result[data-kind="error"] { color: var(--red); }
.license-result[data-kind="info"] { color: var(--blue-dark); }
.state-ledger { align-self: start; background: var(--ink); color: white; padding: 34px; }
.ledger-heading, .board-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid currentColor; }
.ledger-heading h2, .board-heading h2 { margin: 0; font-size: 28px; }
.ledger-heading span, .board-heading span { font: 11px/1.3 var(--mono); letter-spacing: 0.08em; }
.state-ledger dl { margin: 16px 0 0; }
.state-ledger dl div { padding: 19px 0; border-bottom: 1px solid #52606c; }
.state-ledger dt { display: flex; align-items: center; gap: 9px; font-weight: 700; }
.state-ledger dd { margin: 5px 0 0 21px; color: #c5ced6; font-size: 14px; }
.state-ledger > p { margin: 28px 0 0; color: #c5ced6; font-size: 13px; }
.state-mark { width: 11px; height: 11px; display: inline-block; border: 2px solid white; }
.state-mark.active { background: #72ad8e; }
.state-mark.suspended { background: #e2bd55; }
.state-mark.expired, .state-mark.mismatch { background: #d9685e; }

.admin-view { max-width: 1480px; margin: 0 auto; }
.admin-heading { display: flex; justify-content: space-between; gap: 40px; align-items: end; padding-bottom: 36px; border-bottom: 3px solid var(--ink); }
.admin-heading h1 { max-width: 14ch; font-size: clamp(40px, 5vw, 70px); }
.admin-context { margin: 18px 0 0; color: var(--blue-dark); font-weight: 700; }
.operations-board { display: grid; grid-template-columns: 1.2fr 0.8fr; border-bottom: 1px solid var(--ink); }
.priority-queue, .release-track { padding: 40px 0; }
.priority-queue { padding: 40px 42px 40px 16px; border-right: 1px solid var(--ink); }
.release-track { padding-left: 42px; }
.priority-queue ul, .release-track ol { list-style: none; margin: 0; padding: 0; }
.priority-queue li { display: grid; grid-template-columns: 64px 1fr auto; gap: 18px; padding: 22px 0; border-bottom: 1px solid var(--rule); }
.queue-code { font: 12px/1.5 var(--mono); color: var(--ink-soft); }
.priority-queue strong, .release-track strong { font-size: 16px; }
.priority-queue p, .release-track p { margin: 4px 0 0; color: var(--ink-soft); font-size: 14px; }
.severity { align-self: start; padding: 3px 7px; border: 1px solid currentColor; border-radius: 999px; font-size: 11px; }
.severity.block { color: var(--red); }
.severity.decision { color: var(--amber); }
.severity.planned { color: var(--blue); }
.release-track li { position: relative; display: grid; grid-template-columns: 20px 1fr; gap: 15px; padding: 18px 0; }
.release-track li > span { width: 12px; height: 12px; margin-top: 5px; border: 2px solid var(--rule-strong); border-radius: 50%; background: var(--paper); }
.release-track li:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 35px; bottom: -12px; width: 1px; background: var(--rule); }
.release-track li.done > span { background: var(--green); border-color: var(--green); }
.release-track li.current > span { background: var(--amber); border-color: var(--amber); }
.audit-strip { padding-top: 48px; }
.audit-table { margin-top: 16px; }
.audit-table [role="row"] { display: grid; grid-template-columns: 120px 1fr 2fr 100px; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.audit-header { color: var(--ink-soft); font-size: 12px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.admin-login { max-width: 920px; display: grid; grid-template-columns: minmax(260px, 0.8fr) minmax(340px, 1.2fr); gap: clamp(42px, 7vw, 92px); margin: 52px auto 0; padding: 46px 0; border-bottom: 1px solid var(--ink); }
.admin-login h2 { margin: 0; font-size: clamp(32px, 4vw, 48px); }
.admin-login p { max-width: 48ch; color: var(--ink-soft); }
.compact-form { display: grid; gap: 9px; min-width: 0; }
.compact-form label { margin-top: 8px; font-size: 13px; font-weight: 700; }
.compact-form input, .compact-form select, .compact-form textarea, .license-toolbar input, .license-toolbar select {
  width: 100%; min-width: 0; min-height: 44px; padding: 9px 11px; border: 1px solid var(--rule-strong); border-radius: 3px; background: var(--paper-raised); color: var(--ink);
}
.compact-form textarea { resize: vertical; line-height: 1.45; overflow-wrap: anywhere; }
.compact-form .button { justify-self: start; margin-top: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: end; }
.form-row > div { min-width: 0; }
.form-message { min-height: 1.5em; margin: 12px 0 0; color: var(--blue-dark); overflow-wrap: anywhere; }
.form-message[data-kind="error"] { color: var(--red); }
.form-message[data-kind="success"] { color: var(--green); }
.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--ink); }
.summary-strip div { min-width: 0; padding: 28px 24px; border-right: 1px solid var(--rule); }
.summary-strip div:not(:first-child) { padding-left: 24px; }
.summary-strip div:last-child { border-right: 0; }
.summary-strip span { display: block; color: var(--ink-soft); font-size: 12px; }
.summary-strip strong { display: block; margin-top: 5px; font: 600 clamp(28px, 3vw, 42px)/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.admin-workspace { grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr); }
.license-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) 140px auto; gap: 10px; margin: 20px 0 14px; }
.license-toolbar .button { min-height: 44px; }
.license-table-wrap { max-width: 100%; overflow-x: auto; padding-top: 12px; border-top: 1px solid var(--rule); }
.license-table { width: 100%; min-width: 780px; border-collapse: collapse; font-size: 13px; }
.license-table th { padding: 12px 10px; color: var(--ink-soft); text-align: left; font-weight: 600; border-bottom: 1px solid var(--ink); }
.license-table td { max-width: 230px; padding: 14px 10px; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.license-table tr[data-status="suspended"] td:nth-child(3), .license-table tr[data-status="expired"] td:nth-child(3) { color: var(--amber); font-weight: 700; }
.license-table tr[data-status="revoked"] td:nth-child(3) { color: var(--red); font-weight: 700; }
.license-table tr[data-status="active"] td:nth-child(3) { color: var(--green); font-weight: 700; }
.table-action, .danger-actions button { border: 0; border-bottom: 1px solid currentColor; padding: 3px 0; background: transparent; color: var(--blue); cursor: pointer; }
.action-panel details { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.action-panel summary { cursor: pointer; font-weight: 800; }
.action-panel details .compact-form { margin-top: 17px; }
.selected-license-id { overflow-wrap: anywhere; font: 12px/1.5 var(--mono); color: var(--ink-soft); }
.danger-actions { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 15px; }
.danger-actions button { color: var(--red); }
.danger-actions button:nth-child(2) { color: var(--green); }
.credential-once { margin-top: 22px; padding: 18px; border: 1px solid var(--amber); background: #fff7dd; }
.credential-once strong { display: block; margin-bottom: 9px; color: #654000; }
.credential-once textarea { width: 100%; min-height: 112px; padding: 10px; border: 1px solid var(--rule-strong); background: white; font: 11px/1.45 var(--mono); overflow-wrap: anywhere; }
.credential-once .button { margin-top: 10px; min-height: 42px; }
.audit-table [role="row"] { min-width: 0; }
.audit-table [role="cell"] { min-width: 0; overflow-wrap: anywhere; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 26px clamp(20px, 6vw, 96px); border-top: 1px solid var(--ink); color: var(--ink-soft); font-size: 12px; }
footer p { margin: 0; }

@media (max-width: 1000px) {
  .site-header { grid-template-columns: 1fr auto; }
  .primary-nav { grid-column: 1 / -1; order: 3; border-top: 1px solid var(--rule); }
  .primary-nav a { flex: 1; min-height: 48px; }
  .service-indicator { padding-right: 18px; }
  .release-stage, .license-layout { grid-template-columns: 1fr; }
  .release-copy h1 { max-width: 15ch; }
  .release-sheet { max-width: 760px; }
  .artifact-note, .section-heading { grid-template-columns: 1fr; gap: 30px; }
  .artifact-update-note { grid-column: 1; margin: 0; }
  .operations-board { grid-template-columns: 1fr; }
  .priority-queue { padding-right: 0; border-right: 0; }
  .release-track { padding-left: 0; border-top: 1px solid var(--ink); }
  .admin-workspace { grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .summary-strip div:nth-child(2) { border-right: 0; }
  .summary-strip div:nth-child(n+3) { border-top: 1px solid var(--rule); }
}

@media (max-width: 640px) {
  .site-header { display: flex; flex-wrap: wrap; }
  .wordmark { flex: 1; padding: 12px 16px; }
  .service-indicator { padding: 0 16px; }
  .primary-nav { width: 100%; overflow-x: auto; }
  .primary-nav a { min-width: 112px; padding: 0 12px; }
  .view { padding: 44px 18px 72px; }
  h1 { font-size: clamp(38px, 12vw, 56px); }
  .release-sheet { grid-template-columns: 38px 1fr; transform: none; }
  .sheet-body { padding: 22px 18px; }
  .release-seal { width: 72px; height: 72px; }
  .release-facts { grid-template-columns: 1fr; }
  .release-facts div:nth-child(odd) { border-right: 0; }
  .release-facts div:nth-child(even) { padding-left: 0; }
  .checksum-block { align-items: start; flex-direction: column; }
  .install-section, .artifact-note { margin-top: 92px; }
  .procedure-list li { grid-template-columns: 54px 1fr; gap: 14px; }
  .artifact-comparison { grid-template-columns: 1fr; }
  .artifact-comparison div { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); padding-top: 20px; }
  .admin-heading { align-items: start; flex-direction: column; }
  .priority-queue li { grid-template-columns: 52px 1fr; }
  .severity { grid-column: 2; justify-self: start; }
  .audit-header { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .audit-table [role="row"]:not(.audit-header) { grid-template-columns: 1fr 1fr; gap: 12px 18px; padding: 18px 0; }
  .admin-view:not([hidden]) .audit-table [role="cell"]::before { content: attr(data-label); display: block; color: var(--ink-soft); font-size: 11px; }
  footer { flex-direction: column; }
  .admin-login { grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: 1fr; }
  .summary-strip div, .summary-strip div:not(:first-child) { padding: 18px 0; border-right: 0; border-top: 1px solid var(--rule); }
  .summary-strip div:first-child { border-top: 0; }
  .license-toolbar { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

@media (forced-colors: active) {
  .indicator-light, .state-mark { forced-color-adjust: none; }
  .button, input, select, textarea, .credential-once { border-color: CanvasText; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
