:root {
  color-scheme: dark;
  --ink: #e8ebf0;
  --paper: #0d0f12;
  --panel: #101318;
  --edge: #39404d;
  --accent: #9cc3f0;
  --muted: #9aa3b2;
  --warn: #f0b26b;
  --warn-edge: #4d4739;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 ui-sans-serif, system-ui, sans-serif;
}

main {
  width: min(108rem, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 1.8rem 0 4rem;
}

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: clamp(0.8rem, 1.35vw, 1.45rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  max-width: 94rem;
  margin: 0 0 2rem;
  font-size: clamp(2.8rem, 4.7vw, 4.2rem);
  line-height: 1.14;
  letter-spacing: -0.03em;
}

h2 { margin: 0 0 0.9rem; font-size: 1.1rem; }
main > h2 { margin: 0 0 1.25rem; font-size: clamp(1.6rem, 2.4vw, 2.15rem); }

.lede {
  max-width: 88rem;
  margin: 0 0 3.8rem;
  font-size: clamp(1.15rem, 2.1vw, 2rem);
  line-height: 1.55;
}

main > aside {
  margin: 0 0 3.7rem;
  padding: 1.2rem 1.8rem;
  border: 1px solid var(--warn-edge);
  color: var(--ink);
  font-size: clamp(1rem, 1.65vw, 1.7rem);
}

.fine.admission-copy {
  max-width: 92rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.9vw, 1.7rem);
  line-height: 1.55;
  opacity: 1;
}

.state {
  margin: 2rem 0 3rem;
  color: var(--accent);
  font-size: clamp(1rem, 1.9vw, 1.7rem);
}

section {
  margin: 1.5rem 0;
  padding: clamp(1.1rem, 2vw, 1.6rem);
  border: 1px solid var(--edge);
  border-radius: 0.4rem;
  background: var(--panel);
}

.pricing { padding: clamp(1.4rem, 2.6vw, 2.2rem); }
.pricing h2 { font-size: clamp(1.35rem, 2.4vw, 2rem); }
.pricing-intro { max-width: 70rem; }
.price-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1.4rem 0;
}
.price-option {
  display: grid;
  gap: 0.25rem;
  padding: 1rem;
  border: 1px solid var(--edge);
  border-radius: 0.4rem;
  color: var(--ink);
  text-decoration: none;
}
.price-option[href]:hover { border-color: var(--accent); }
.price-option strong { color: var(--accent); font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; }
.price-option span { font-size: clamp(1.5rem, 3vw, 2.3rem); font-weight: 700; }
.price-option small { color: var(--muted); }
.price-option.current { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.price-option.retired { opacity: 0.38; filter: saturate(0.25); cursor: not-allowed; }
.price-option.retired strong { color: var(--muted); }
.price-option.retired s { text-decoration-thickness: 0.12em; }
.pricing a:not(.price-option) { color: var(--accent); }
.license-entry { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--edge); }

label, .field-label { display: block; margin-bottom: 0.4rem; font-size: 0.85rem; }

.row { display: flex; gap: 0.6rem; }

input, textarea {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--edge);
  border-radius: 0.3rem;
  background: transparent;
  color: inherit;
  font: inherit;
}

textarea { width: 100%; resize: vertical; font: 0.85rem/1.5 ui-monospace, monospace; }
label.stack { margin-top: 0.8rem; }

button {
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 0.3rem;
  background: var(--accent);
  color: var(--paper);
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

button:disabled { opacity: 0.45; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.source-picker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 4.5rem;
  padding: 0.75rem;
  border: 1px dashed var(--edge);
  border-radius: 0.3rem;
}

.source-picker.dragging { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.source-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.source-note { min-width: 0; overflow-wrap: anywhere; font-size: 0.85rem; }
.submit { margin-top: 1rem; }

.fine { margin: 0.6rem 0 0; font-size: 0.8rem; opacity: 0.75; }

pre {
  overflow-x: auto;
  padding: 0.9rem;
  border: 1px solid var(--edge);
  border-radius: 0.3rem;
  white-space: pre-wrap;
  font: 0.82rem/1.5 ui-monospace, monospace;
}

.contract pre { margin: 0; }
.container { border-left-width: 4px; }

.container header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.container header .name { font-weight: 600; }

.chip {
  padding: 0.1rem 0.7rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.container.dissolved { opacity: 0.85; }
.container.dissolved .chip { border-color: var(--edge); color: inherit; opacity: 0.7; }
.container.result-dissolved { opacity: 0.7; }
.container .error { color: var(--warn); }
.container .stream { min-height: 2.4rem; max-height: 18rem; overflow-y: auto; }

table { width: 100%; margin: 0.6rem 0 0; border-collapse: collapse; font-size: 0.82rem; }
th, td { padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--edge); text-align: left; font-family: ui-monospace, monospace; }
th { font-family: inherit; font-weight: 600; }

.download { display: inline-block; margin-top: 0.6rem; color: var(--accent); font-size: 0.85rem; }

.tabs { display: flex; gap: 0.35rem; overflow-x: auto; padding: 0 0 0.45rem; }
button.tab, button.secondary { border-color: var(--edge); background: transparent; color: inherit; }
button.tab { padding: 0.35rem 0.65rem; font: 0.8rem/1.3 ui-monospace, monospace; }
button.tab[aria-selected="true"] { border-color: var(--accent); color: var(--accent); }

.tab-panel {
  min-height: 7rem;
  padding: 0.75rem;
  border: 1px solid var(--edge);
  border-radius: 0.3rem;
}

.tab-panel[hidden] { display: none; }
.tab-panel pre { max-height: 32rem; overflow: auto; }
.artifact-image, .artifact-video { display: block; max-width: 100%; max-height: 32rem; margin-top: 0.65rem; }
.artifact-facts { overflow-wrap: anywhere; }
.result-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.9rem; }
.idle-note { color: var(--accent); }

@media (max-width: 64rem) {
  .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 40rem) {
  main { width: min(100% - 2rem, 108rem); padding-top: 1.4rem; }
  h1 { font-size: clamp(2.4rem, 13vw, 3.4rem); }
  .lede { margin-bottom: 2.4rem; }
  main > aside { margin-bottom: 2.5rem; padding: 1rem 1.2rem; }
  .source-picker { align-items: stretch; flex-direction: column; }
  .source-actions button { flex: 1; }
  .price-grid { grid-template-columns: 1fr; }
  .license-entry .row { align-items: stretch; flex-direction: column; }
}
