:root {
  --bg: #efece4;
  --ink: #1a1814;
  --muted: #5c564c;
  --card: #f7f4ee;
  --line: #d9d3c6;
  --copper: #9a4b12;
  --copper-deep: #7c3b0c;
  --on-copper: #fff8f3;
  --teal: #0d5c56;
  --teal-bg: #e4f3f1;
  --danger: #8d1d1d;
  --danger-bg: #f8e8e4;
  --shadow: 0 1px 0 rgba(26, 24, 20, 0.04), 0 16px 40px rgba(26, 24, 20, 0.06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12110f;
    --ink: #f3efe6;
    --muted: #b7b0a3;
    --card: #1c1a17;
    --line: #3a342c;
    --copper: #e39a62;
    --copper-deep: #c47b45;
    --on-copper: #1a0e06;
    --teal: #8fd0c8;
    --teal-bg: #16302d;
    --danger: #ffb4a8;
    --danger-bg: #3a201c;
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(880px 380px at 8% -12%, rgba(196, 106, 47, 0.18), transparent 62%),
    var(--bg);
  font: 16.5px/1.5 var(--sans);
}

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

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--card);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 2;
}

.skip:focus { top: 12px; }

h1, h2, p { margin: 0; }

h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6vw, 3.25rem);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 0.95;
}

h2 {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 560;
  letter-spacing: -0.02em;
}

.kicker {
  margin: 0 0 8px;
  color: var(--copper);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lede {
  max-width: 46rem;
  margin-top: 8px;
  color: var(--muted);
}

.lede.tight { margin-top: 8px; }

.mast { margin-bottom: 16px; }

html[data-route="go"] #desk { display: none; }
html[data-route="make"] #gate-view { display: none; }

.desk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

form { display: grid; gap: 8px; }

label, legend {
  font-size: 0.86rem;
  font-weight: 650;
}

fieldset {
  border: 0;
  margin: 8px 0 0;
  padding: 0;
}

input[type="text"] {
  width: 100%;
  min-height: 46px;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.4 var(--sans);
}

.hint, .fine, .meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.hint { margin: 2px 0 4px; }

.texty {
  justify-self: start;
  min-height: 36px;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--copper-deep);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.chips label {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 600;
  background: var(--bg);
}

.chips input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
}

.chips label:has(input:checked) {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.chips label:has(input:focus-visible) {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 4px;
  font-weight: 600;
}

.check input { width: 18px; height: 18px; accent-color: var(--copper-deep); }

.err {
  color: var(--danger);
  background: var(--danger-bg);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.92rem;
}

.pri, .ghost, .file {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 12px;
  font: 600 1rem/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
}

.pri {
  border: 0;
  background: var(--copper);
  color: var(--on-copper);
}

.pri:hover { background: var(--copper-deep); }

.ghost, .file {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

button { font: inherit; color: inherit; }

button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

.ticket h2 { margin-bottom: 8px; }

.ticket .kicker { margin-top: 16px; }

.plate {
  margin: 10px 0;
  padding: 10px 12px;
  border-left: 3px solid var(--copper);
  border-radius: 10px;
  background: var(--bg);
  font-family: var(--mono);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.note-out { margin-bottom: 8px; }

.host-line, .dest-host {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.dest-host {
  margin-top: 12px;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.dest-path {
  margin: 4px 0 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.linkbox {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg);
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.qr {
  margin-top: 16px;
  padding: 12px;
  border-radius: 14px;
  background: #fff;
  color: #14120f;
}

.qr svg { display: block; width: min(100%, 220px); height: auto; margin: 0 auto; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 22px 0 6px;
}

.stats div {
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.stats strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1;
}

.stats span {
  color: var(--muted);
  font-size: 0.8rem;
}

.fine { margin: 8px 0 18px; }

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 10px;
}

.file input { display: none; }

.list-card { padding-top: 8px; padding-bottom: 8px; }

ul { list-style: none; margin: 0; padding: 0; }

li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

li:first-child { border-top: 0; }

.row-text { min-width: 0; }

.row-slug {
  font-family: var(--mono);
  font-weight: 650;
}

.row-host {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.pill {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--teal-bg);
  color: var(--teal);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: 2px;
}

.pill.dead {
  background: var(--danger-bg);
  color: var(--danger);
}

li button { min-height: 44px; padding: 0 12px; }

.gate { max-width: 36rem; }

.reading { color: var(--muted); }

.noscript {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto 32px;
}

@media (max-width: 800px) {
  .desk-grid { grid-template-columns: 1fr; }
  main { width: min(1040px, calc(100% - 24px)); padding-top: 20px; }
}

@media (max-width: 640px) {
  .split, .stats { grid-template-columns: 1fr 1fr; }
  .chips { display: grid; grid-template-columns: repeat(3, 1fr); }
  .chips label { justify-content: center; padding: 0 8px; }
  .list-head { align-items: start; flex-direction: column; }
  li { grid-template-columns: 1fr 1fr; }
  .row-text { grid-column: 1 / -1; }
  .pri, .ghost, .file { flex: 1; }
  form .pri { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
