:root {
  color-scheme: dark;
  --ink: #f2f0e8;
  --muted: #9d9b94;
  --paper: #10110f;
  --panel: #171815;
  --line: #34362f;
  --acid: #d9ff43;
  --cyan: #58d8e8;
  --coral: #ff745c;
  --violet: #b59cff;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px),
    var(--paper);
  background-size: 36px 36px;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
}

button, textarea { font: inherit; }
button { color: inherit; }

.shell { width: min(1160px, calc(100% - 48px)); margin: 0 auto; }

.masthead {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--acid); color: var(--acid); font: 700 12px var(--mono); transform: rotate(-3deg); }
.local-badge { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font: 600 11px var(--mono); letter-spacing: .12em; }
.local-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 12px var(--acid); }

.hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .5fr); gap: 48px; align-items: end; padding: 84px 0 64px; }
.eyebrow { margin: 0 0 18px; color: var(--acid); font: 600 12px var(--mono); letter-spacing: .15em; }
h1 { margin: 0; font-size: clamp(50px, 8vw, 100px); line-height: .93; letter-spacing: -.07em; font-weight: 790; }
h1 em { color: transparent; font-style: normal; -webkit-text-stroke: 1px var(--muted); }
.intro { max-width: 600px; margin: 28px 0 0; color: #c2c1ba; font-size: 18px; }
.notice { border-top: 3px solid var(--acid); padding: 20px 0 0; align-self: end; }
.notice strong { font-size: 14px; }
.notice p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

.workbench, .results { border-top: 1px solid var(--line); padding: 34px 0 72px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 24px; }
.section-head > div:first-child { display: flex; align-items: baseline; gap: 14px; }
.step { color: var(--acid); font: 600 12px var(--mono); }
h2 { margin: 0; font-size: 23px; letter-spacing: -.03em; }
.actions { display: flex; gap: 8px; }
.text-button, .copy-button { appearance: none; border: 1px solid var(--line); background: transparent; cursor: pointer; transition: .18s ease; }
.text-button { padding: 8px 12px; font-size: 12px; color: #cecdc6; }
.text-button:hover, .text-button:focus-visible, .copy-button:hover, .copy-button:focus-visible { border-color: var(--acid); color: var(--acid); outline: none; }
.text-button.danger:hover { border-color: var(--coral); color: var(--coral); }

.token-input-wrap { display: block; position: relative; border: 1px solid #45473f; background: rgba(23, 24, 21, .9); }
.token-input-wrap:focus-within { border-color: var(--acid); box-shadow: 0 0 0 1px var(--acid); }
textarea { display: block; width: 100%; min-height: 152px; resize: vertical; border: 0; outline: 0; padding: 23px 24px 46px; background: transparent; color: var(--ink); font: 14px/1.8 var(--mono); word-break: break-all; }
textarea::placeholder { color: #63655d; }
.input-meta { position: absolute; left: 24px; right: 24px; bottom: 14px; display: flex; justify-content: space-between; color: #74766e; font: 11px var(--mono); pointer-events: none; }
kbd { padding: 2px 5px; border: 1px solid var(--line); background: #20211e; font: inherit; }
.message { min-height: 30px; padding-top: 10px; color: var(--coral); font-size: 13px; }

.segments { display: grid; grid-template-columns: 1fr auto 1.45fr auto .8fr; align-items: stretch; margin-top: 10px; }
.segment { min-width: 0; padding: 15px 17px; border-top: 2px solid currentColor; background: #171815; }
.segment-label { display: block; margin-bottom: 8px; font: 700 10px var(--mono); letter-spacing: .12em; }
.segment code { display: block; overflow: hidden; color: #e8e6de; font: 12px var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.segment-header { color: var(--cyan); }
.segment-payload { color: var(--violet); }
.segment-signature { color: var(--coral); }
.dot { display: grid; place-items: center; width: 28px; color: #6b6d64; background: #171815; font: 22px var(--mono); }

.results[hidden] { display: none; }
.result-head { margin-bottom: 28px; }
.status-pill { padding: 7px 10px; border: 1px solid var(--acid); color: var(--acid); font: 700 11px var(--mono); letter-spacing: .06em; }
.status-pill.expired { border-color: var(--coral); color: var(--coral); }
.status-pill.pending { border-color: #ffc75a; color: #ffc75a; }
.time-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0 0 22px; background: var(--line); border: 1px solid var(--line); }
.time-item { position: relative; min-height: 132px; padding: 20px; background: var(--panel); }
.time-item.empty { color: #65675f; }
.time-name { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 17px; color: var(--muted); font: 700 11px var(--mono); letter-spacing: .1em; }
.time-state { color: var(--acid); letter-spacing: 0; }
.time-state.bad { color: var(--coral); }
.time-state.wait { color: #ffc75a; }
.time-date { display: block; font: 600 15px/1.45 var(--mono); }
.time-raw { display: block; margin-top: 6px; color: #72746b; font: 11px var(--mono); }

.json-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 18px; }
.json-card { min-width: 0; border: 1px solid var(--line); background: var(--panel); }
.json-card header { display: flex; justify-content: space-between; align-items: center; min-height: 56px; padding: 0 16px 0 19px; border-bottom: 1px solid var(--line); }
.json-card header > div { display: flex; align-items: center; gap: 10px; }
.card-dot { width: 8px; height: 8px; background: currentColor; }
.header-card .card-dot { color: var(--cyan); }
.payload-card .card-dot { color: var(--violet); }
h3 { margin: 0; font-size: 14px; }
.copy-button { padding: 6px 9px; color: var(--muted); font: 11px var(--mono); }
pre { min-height: 250px; max-height: 520px; margin: 0; overflow: auto; padding: 21px; }
pre code { color: #deddd5; font: 13px/1.7 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.json-key { color: var(--cyan); }
.json-string { color: #d6ff77; }
.json-number { color: #ffad82; }
.json-boolean, .json-null { color: var(--violet); }

.signature-note { display: grid; grid-template-columns: 38px 1fr; gap: 16px; margin-top: 18px; padding: 20px; border: 1px dashed #57594f; background: rgba(255, 116, 92, .045); }
.shield { display: grid; place-items: center; width: 36px; height: 40px; background: var(--coral); color: var(--paper); font: 900 20px var(--mono); clip-path: polygon(50% 0, 100% 17%, 88% 76%, 50% 100%, 12% 76%, 0 17%); }
.signature-note strong { color: var(--coral); }
.signature-note p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

footer { display: flex; justify-content: center; gap: 14px; padding: 28px 24px 42px; border-top: 1px solid var(--line); color: #73756c; font: 11px var(--mono); text-align: center; }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 10; padding: 11px 15px; background: var(--acid); color: #10110f; font: 700 12px var(--mono); transform: translate(-50%, 18px); opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 760px) {
  .shell { width: min(100% - 28px, 1160px); }
  .masthead { min-height: 68px; }
  .brand { font-size: 14px; }
  .brand-mark { width: 32px; height: 32px; }
  .local-badge { font-size: 9px; }
  .hero { grid-template-columns: 1fr; gap: 38px; padding: 60px 0 52px; }
  h1 { font-size: clamp(48px, 15vw, 72px); }
  .intro { font-size: 16px; }
  .section-head { align-items: flex-end; }
  .segments { grid-template-columns: 1fr; gap: 6px; }
  .dot { display: none; }
  .time-grid, .json-grid { grid-template-columns: 1fr; }
  .time-item { min-height: auto; }
  pre { min-height: 190px; }
}

@media (max-width: 430px) {
  .section-head { align-items: flex-start; }
  .section-head > div:first-child { gap: 9px; }
  .actions { flex-direction: column; }
  .text-button { padding: 6px 9px; }
  textarea { padding-inline: 16px; }
  .input-meta { left: 16px; right: 16px; }
  footer { flex-direction: column; gap: 3px; }
  footer span[aria-hidden] { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
