:root {
  --bg: #101410;
  --card: #1a221c;
  --ink: #e8f3ea;
  --muted: #a9bdb1;
  --line: #314238;
  --ping: #c6f54a;
  --on-ping: #152006;
  --amber: #ffc14d;
  --danger: #ffb4b4;
  --ticket: #f3f0e4;
  --ticket-ink: #1c1e16;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100%;
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(198, 245, 74, 0.09), transparent 55%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.5 ui-sans-serif, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
}

.wrap {
  width: min(880px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  transform: translateY(-150%);
  background: var(--ping);
  color: var(--on-ping);
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  z-index: 2;
}

.skip:focus { transform: none; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.brand { display: flex; align-items: center; gap: 0.7rem; }

.mark { width: 36px; height: 36px; color: var(--ping); display: block; }

.brand-name,
.brand-tag { margin: 0; }

.brand-name {
  font-family: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-tag { color: var(--muted); font-size: 0.82rem; }

.pill {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  color: var(--muted);
  font-size: 0.82rem;
}

h1 {
  font-family: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  font-weight: 500;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 0.45rem;
}

.lede {
  margin: 0 0 1.15rem;
  max-width: 38rem;
  color: var(--muted);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem 1.05rem 1.05rem;
}

label { display: block; font-size: 0.86rem; margin-bottom: 0.35rem; }

label span { color: var(--muted); }

.compose { display: flex; gap: 0.6rem; align-items: end; }
.compose > input,
.compose > textarea,
.compose > .code-field { flex: 1; min-width: 0; }
.compose.minor > .code-field { flex: 0 1 16rem; }

.compose.minor {
  margin-top: 0.75rem;
  align-items: end;
}

.code-field { flex: 1; }

input,
textarea {
  width: 100%;
  background: #0d120e;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem 0.85rem;
  font: inherit;
  min-height: 48px;
}

textarea { resize: none; min-height: 4.6rem; }

input::placeholder,
textarea::placeholder { color: #8fa899; }

.share {
  margin: 0;
  padding: 0.65rem 0.75rem;
  background: #0d120e;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: 0.8rem/1.45 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn.solid { background: var(--ping); color: var(--on-ping); }
.btn.solid:hover { filter: brightness(1.06); }

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn.ghost:hover { border-color: var(--ping); }

.file { position: relative; }

.error {
  min-height: 1.4rem;
  margin: 0.55rem 0 0;
  color: var(--danger);
}

.kicker {
  margin: 0.2rem 0;
  color: var(--ping);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.kicker.warn { color: var(--amber); }

.clean {
  margin: 0.15rem 0;
  font: 1rem/1.4 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

.meta, .hint, .fine, .foot, .status { color: var(--muted); }

.meta { margin: 0 0 0.8rem; }

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.pair article {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.8rem;
  background: #141c16;
}

.pair h2 { margin: 0; font-size: 1rem; }

.hint { margin: 0.2rem 0 0.45rem; font-size: 0.88rem; }

.bigcode {
  margin: 0 0 0.55rem;
  font: 1.8rem/1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
  color: var(--ping);
}

.pair .btn { margin-top: auto; align-self: flex-start; }

.shelf { margin-top: 1.4rem; }

.shelf-head, .shelf-tools, .actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.shelf-head { justify-content: space-between; }

.shelf h2 { margin: 0; font-size: 1.15rem; }

.shelf-tools .btn { min-height: 40px; padding: 0.35rem 0.8rem; }

.status { min-height: 1.4rem; margin: 0.4rem 0; }

.status button {
  margin-left: 0.4rem;
  background: none;
  border: 0;
  color: var(--ping);
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

#empty { margin: 0.4rem 0 0; color: var(--muted); }

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

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

.code {
  font: 0.95rem/1.2 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color: var(--ping);
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

.where { margin: 0; overflow-wrap: break-word; }

.where small { color: var(--muted); }

.row-actions { display: flex; gap: 0.35rem; }

.row-actions a, .row-actions button {
  min-height: 36px;
  padding: 0.25rem 0.7rem;
  font-size: 0.88rem;
}

.foot { margin: 1rem 0 0; font-size: 0.88rem; }

.back {
  display: inline-block;
  margin-bottom: 0.9rem;
  color: var(--muted);
  text-decoration: none;
}

.back:hover { color: var(--ink); }

#leave {
  min-height: calc(100dvh - 8rem);
  display: flex;
  flex-direction: column;
  justify-content: safe center;
}

.leave-card h1 {
  margin: 0.15rem 0 0.8rem;
  overflow-wrap: anywhere;
}

.ticket {
  margin: 0 0 1rem;
  background: var(--ticket);
  color: var(--ticket-ink);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  font: 0.95rem/1.45 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

.actions { flex-wrap: wrap; }

.fine { margin: 0.75rem 0 0; font-size: 0.88rem; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none !important; }

::selection { background: var(--ping); color: var(--on-ping); }

@media (max-width: 640px) {
  .top { align-items: flex-start; }
  .compose, .pair, #list li { display: flex; flex-direction: column; align-items: stretch; }
  .compose.minor > .code-field { flex: 1 1 auto; max-width: none; width: 100%; }
  .compose .btn, .pair .btn, .row-actions { width: 100%; }
  .pair .btn { align-self: stretch; }
  .row-actions { flex-direction: row; }
  .pill { white-space: nowrap; }
  h1 { font-size: 2rem; }
}

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