:root {
  --bg: #edf0ea;
  --paper: #f8f9f5;
  --ink: #1c2a22;
  --muted: #56665b;
  --line: #c9d1c5;
  --cobalt: #2f4fd8;
  --brass: #a8792a;
  --sans: "Instrument Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1rem/1.55 var(--sans);
}
a { color: var(--cobalt); }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.bar {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  max-width: 68rem; margin: 0 auto; padding: 1.1rem 1.25rem;
}
.brand { font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.support {
  font-weight: 600; font-size: .9rem; color: var(--ink); text-decoration: none;
  border: 1.5px solid var(--ink); border-radius: 999px; padding: .35rem .9rem;
}
.support:hover { background: var(--ink); color: var(--paper); }

main { max-width: 68rem; margin: 0 auto; padding: 0 1.25rem 3rem; }

.hero { padding: 2.5rem 0 1.5rem; }
h1 {
  font-size: clamp(2rem, 5.2vw, 3.6rem); line-height: 1.04; letter-spacing: -0.035em;
  font-weight: 700; margin: 0 0 1.75rem; max-width: 16ch;
}
.field { display: flex; gap: .5rem; }
#nsid {
  flex: 1; min-width: 0; font: 500 clamp(1.05rem, 2.6vw, 1.6rem) var(--mono);
  padding: .8rem 1rem; background: var(--paper); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 10px;
}
#nsid::placeholder { color: #9aa79d; }
button { font: inherit; cursor: pointer; }
#go {
  font-weight: 600; padding: 0 1.4rem; border: 0; border-radius: 10px;
  background: var(--cobalt); color: #fff; white-space: nowrap;
}
#go:hover { background: #2440b8; }

/* The catalogue drawer: the NSID read back as a row of drawer labels */
.drawer { display: flex; flex-wrap: wrap; gap: .4rem; margin: .9rem 0 0; min-height: 2.6rem; }
.drawer span {
  display: inline-flex; flex-direction: column; justify-content: center;
  padding: .3rem .7rem .35rem; border-radius: 6px; background: var(--paper);
  border: 1px solid var(--line); border-bottom: 3px solid var(--brass);
  font: 500 .95rem var(--mono); max-width: 100%; overflow-wrap: anywhere;
}
.drawer span small { font: 400 .68rem var(--sans); color: var(--muted); }
.drawer span.leaf { border-bottom-color: var(--cobalt); }
.hint { color: var(--muted); max-width: 62ch; margin: .9rem 0 0; }
.eg {
  font: 500 .9em var(--mono); background: none; border: 0; padding: 0;
  color: var(--cobalt); text-decoration: underline; text-underline-offset: 3px;
}

h2 { font-size: 1.35rem; letter-spacing: -0.02em; margin: 0; overflow-wrap: anywhere; }
.sub { color: var(--muted); margin: .25rem 0 0; }

.ns, .run { border-top: 2px solid var(--ink); padding-top: 1.5rem; margin-top: 1rem; }
.nslist { list-style: none; padding: 0; margin: 1rem 0 0; }
.nslist li { border-bottom: 1px solid var(--line); }
.nslist button {
  width: 100%; display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; align-items: center;
  background: none; border: 0; padding: .75rem .25rem; text-align: left; color: var(--ink);
}
.nslist button:hover { background: var(--paper); }
.nslist .n { font: 500 1rem var(--mono); overflow-wrap: anywhere; }
.nslist .c { color: var(--muted); font-size: .9rem; text-align: right; }
.nslist .bar2 { grid-column: 1 / -1; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.nslist .bar2 i { display: block; height: 100%; background: var(--brass); }

.status { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.ghost {
  background: transparent; color: var(--ink); border: 1.5px solid var(--ink);
  border-radius: 8px; padding: .45rem .9rem; font-weight: 600;
}
.ghost:hover { background: var(--ink); color: var(--paper); }
.meter { height: 8px; background: var(--line); border-radius: 4px; margin: 1.1rem 0; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--cobalt); transition: width .3s; }
.tally { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 0 0 1.4rem; }
.tally dt { font-size: .82rem; color: var(--muted); }
.tally dd { margin: 0; font: 700 1.6rem/1.2 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

.tools { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
#filter {
  flex: 1 1 18rem; min-width: 0; font: inherit; padding: .6rem .8rem;
  border: 1.5px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink);
}
.export { display: flex; gap: .5rem; flex-wrap: wrap; }
.export button {
  font-weight: 600; font-size: .92rem; padding: .55rem .9rem; border-radius: 8px;
  border: 1.5px solid var(--brass); background: var(--paper); color: var(--ink);
}
.export button.locked::before { content: ""; display: inline-block; width: .55rem; height: .55rem; margin-right: .45rem;
  border: 2px solid var(--brass); border-radius: 2px; vertical-align: -1px; }
.export button:hover { background: #f1e7d4; }
.shown { color: var(--muted); font-size: .9rem; margin: .9rem 0 .4rem; }

.list { list-style: none; margin: 0; padding: 0; }
.rec { border-bottom: 1px solid var(--line); }
.rec summary {
  list-style: none; cursor: pointer; display: grid; gap: .1rem 1rem;
  grid-template-columns: minmax(0, 1fr) auto; padding: .8rem .25rem;
}
.rec summary::-webkit-details-marker { display: none; }
.rec summary:hover { background: var(--paper); }
.rec .title { font-weight: 600; overflow-wrap: anywhere; }
.rec .who { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.rec .when { color: var(--muted); font-size: .85rem; text-align: right; white-space: nowrap; grid-row: 1; grid-column: 2; }
.rec .rk { font: 400 .8rem var(--mono); color: var(--muted); grid-column: 2; text-align: right; }
.rec .body { padding: 0 .25rem 1rem; }
.rec .links { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .9rem; margin-bottom: .5rem; }
.rec pre {
  margin: 0; padding: .9rem; background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  font: 400 .8rem/1.5 var(--mono); overflow: auto; max-height: 26rem; white-space: pre-wrap; overflow-wrap: anywhere;
}
.more { margin: 1.2rem auto 0; display: block; }
.empty { color: var(--muted); padding: 1.5rem 0; }

.unlock {
  border: 2px solid var(--ink); border-radius: 14px; padding: 1.6rem; max-width: 26rem; width: calc(100% - 2rem);
  background: var(--paper); color: var(--ink);
}
.unlock::backdrop { background: rgba(28, 42, 34, .45); }
.unlock form { display: flex; flex-direction: column; gap: .8rem; }
.unlock h2 { font-size: 1.3rem; }
.unlock p { margin: 0; color: var(--muted); }
.pay {
  display: block; text-align: center; background: var(--cobalt); color: #fff; font-weight: 600;
  padding: .75rem; border-radius: 10px; text-decoration: none;
}
.close { background: none; border: 0; color: var(--muted); text-decoration: underline; align-self: center; }

.foot { max-width: 68rem; margin: 0 auto; padding: 1.5rem 1.25rem 2.5rem; color: var(--muted); font-size: .85rem; }
.foot p { max-width: 70ch; margin: 0; border-top: 1px solid var(--line); padding-top: 1rem; }

@media (max-width: 560px) {
  .hero { padding-top: 1.25rem; }
  .field { flex-direction: column; }
  #go { padding: .8rem; }
  .tally { grid-template-columns: repeat(2, 1fr); }
  .tally dd { font-size: 1.35rem; }
  .export { width: 100%; }
  .export button { flex: 1; }
  .nslist button { grid-template-columns: 1fr; }
  .nslist .c { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.foot p.made { border-top: 0; padding-top: .5rem; }
