@font-face {
  font-family: "Geist";
  src: url(/assets/geist-sans.eho91h.woff2) format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url(/assets/geist-mono.z5whot.woff2) format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f6f3ed;
  --ink: #1b1815;
  --ink-2: #4a443d;
  --muted: #6e675f;
  --hair: rgba(27, 24, 21, 0.08);
  --hair-2: rgba(27, 24, 21, 0.15);
  --shell: rgba(27, 24, 21, 0.035);
  --core: #fffefb;
  --core-hi: rgba(255, 255, 255, 0.95);
  --lift: 0 1px 1px rgba(27, 24, 21, 0.03), 0 28px 56px -32px rgba(27, 24, 21, 0.24);
  --field: #f9f7f2;
  --public: #3f6a4b;
  --public-soft: rgba(63, 106, 75, 0.1);
  --protected: #8a5a12;
  --protected-soft: rgba(138, 90, 18, 0.1);
  --private: #4a443d;
  --private-soft: rgba(27, 24, 21, 0.06);
  --danger: #a2352a;
  --danger-soft: rgba(162, 53, 42, 0.08);
  --focus: #2f5f8a;
  --glow: rgba(196, 160, 106, 0.16);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #0e0c0b;
    --ink: #eee9e2;
    --ink-2: #c9c2b8;
    --muted: #9a938a;
    --hair: rgba(255, 255, 255, 0.07);
    --hair-2: rgba(255, 255, 255, 0.14);
    --shell: rgba(255, 255, 255, 0.03);
    --core: #161412;
    --core-hi: rgba(255, 255, 255, 0.05);
    --lift: 0 1px 1px rgba(0, 0, 0, 0.3), 0 28px 56px -32px rgba(0, 0, 0, 0.75);
    --field: #1c1a17;
    --public: #8fbf9a;
    --public-soft: rgba(143, 191, 154, 0.12);
    --protected: #e0b064;
    --protected-soft: rgba(224, 176, 100, 0.12);
    --private: #c9c2b8;
    --private-soft: rgba(255, 255, 255, 0.06);
    --danger: #ee8e7e;
    --danger-soft: rgba(238, 142, 126, 0.1);
    --focus: #8db8e0;
    --glow: rgba(196, 160, 106, 0.07);
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(60rem 36rem at 12% -12%, var(--glow), transparent 70%),
    var(--paper);
  color: var(--ink);
  font: 400 15.5px/1.55 var(--sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Film grain: fixed, behind everything, never scrolls, never takes a click. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; }

/* Author rules like .copy { display: inline-flex } would otherwise beat the
   browser's own [hidden] rule and show a button the script never revealed. */
[hidden] { display: none !important; }

.i {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mono { font-family: var(--mono); font-size: 0.86em; letter-spacing: -0.01em; }
/* The OAuth consent page: client ids and redirect URIs are long and unbroken. */
.consent-detail .mono { overflow-wrap: anywhere; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 10px;
}

/* ---------- frame ---------- */

.page {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 12px 16px 72px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 44px;
  padding: 5px;
  border-radius: 999px;
  background: var(--shell);
  box-shadow: 0 0 0 1px var(--hair);
}
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}
.nav a:hover { color: var(--ink); background: var(--hair); }
.nav .n {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: 500 11px/16px var(--mono);
  text-align: center;
}
.nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--core);
  box-shadow: inset 0 1px 0 var(--core-hi), 0 0 0 1px var(--hair);
}
.nav .brand { color: var(--ink); font-weight: 600; letter-spacing: -0.01em; }
/* On a phone the wordmark gives way to the mark, so the pill fits at 320px.
   The mark and Connect go to the same page, so Connect steps aside too and
   the mark shows when it is the current page. The admin's nav, with one more
   item and the open count, needs the tight 8px padding to fit at 320px; the
   breakpoints below give the room back. */
.nav .connect { display: none; }
.nav .brand.here { background: var(--core); box-shadow: inset 0 1px 0 var(--core-hi), 0 0 0 1px var(--hair); }
.nav .brand .word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mark { width: 18px; height: 18px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 18px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--shell);
  box-shadow: 0 0 0 1px var(--hair);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.025em; }
.display {
  font-size: clamp(2.6rem, 6.4vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
  max-width: 14ch;
}
.title {
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}
.lead {
  margin: 22px 0 0;
  max-width: 54ch;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-2);
}
.muted { color: var(--muted); }
.effects {
  margin: 18px 0 0;
  padding-left: 1.2em;
  max-width: 60ch;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.effects li + li { margin-top: 6px; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-bottom: 24px;
  font-size: 13.5px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.5s var(--ease);
}
.back .i { transition: transform 0.6s var(--ease); }
.back:hover { color: var(--ink); }
.back:hover .i { transform: translateX(-3px); }

/* ---------- double bezel ---------- */

.shell {
  padding: 6px;
  border-radius: 28px;
  background: var(--shell);
  box-shadow: 0 0 0 1px var(--hair);
}
.core {
  border-radius: 22px;
  background: var(--core);
  box-shadow: inset 0 1px 0 var(--core-hi), 0 0 0 1px var(--hair), var(--lift);
}
.card { padding: 22px 20px 22px; }
.card + .card-gap { margin-top: 18px; }
.stack > * + * { margin-top: 18px; }

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.card-head h2 { font-size: 17px; letter-spacing: -0.015em; }
.card-head .i { width: 18px; height: 18px; color: var(--muted); }
.card-note { margin: 0 0 20px; font-size: 14px; color: var(--muted); max-width: 58ch; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font: 500 14px/1 var(--sans);
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.5s var(--ease), background-color 0.5s var(--ease), box-shadow 0.5s var(--ease), color 0.5s var(--ease);
}
.btn:active { transform: scale(0.98); }

/* Padding stays symmetric on every variant, so a button reads right with
   or without a trailing .ico pill. The pill pulls itself into the right
   padding (18px - 13px = 5px to the edge); a leading bare icon tucks a
   little into the left padding for optical balance. Never set an
   asymmetric padding on a variant: the markup cannot promise a pill. */
.btn > .i:first-child { margin-left: -4px; }
.btn .ico { margin-right: -13px; }

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 10px 24px -14px rgba(27, 24, 21, 0.6);
}
.btn-primary .ico {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  transition: transform 0.6s var(--ease);
}
.btn-primary:hover .ico { transform: translate(2px, -1px) scale(1.05); }

.btn-quiet {
  background: var(--core);
  color: var(--ink);
  box-shadow: inset 0 1px 0 var(--core-hi), 0 0 0 1px var(--hair-2);
}
.btn-quiet:hover { box-shadow: inset 0 1px 0 var(--core-hi), 0 0 0 1px var(--ink-2); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger .ico {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transition: transform 0.6s var(--ease);
}
.btn-danger:hover .ico { transform: scale(1.06); }

.btn-ghost {
  min-height: 44px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
}
.btn-ghost:hover { color: var(--ink); background: var(--hair); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease), transform 0.5s var(--ease);
}
.icon-btn:hover { background: var(--hair); color: var(--ink); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }

/* ---------- forms ---------- */

label.lbl, .lbl {
  display: block;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}
.input {
  width: 100%;
  min-height: 46px;
  padding: 0 15px;
  border: 0;
  border-radius: 14px;
  background: var(--field);
  color: var(--ink);
  font: 400 16px/1.2 var(--sans);
  box-shadow: inset 0 0 0 1px var(--hair-2);
  transition: box-shadow 0.5s var(--ease), background-color 0.5s var(--ease);
}
.input::placeholder { color: var(--muted); opacity: 0.8; }
.input:hover { box-shadow: inset 0 0 0 1px var(--muted); }
.input:focus { outline: none; background: var(--core); box-shadow: inset 0 0 0 1.5px var(--focus), 0 0 0 4px rgba(47, 95, 138, 0.12); }
textarea.input { min-height: 88px; padding: 12px 15px; line-height: 1.45; resize: vertical; }

.prefixed {
  display: flex;
  align-items: stretch;
  border-radius: 14px;
  background: var(--field);
  box-shadow: inset 0 0 0 1px var(--hair-2);
  transition: box-shadow 0.5s var(--ease);
}
.prefixed:focus-within { box-shadow: inset 0 0 0 1.5px var(--focus), 0 0 0 4px rgba(47, 95, 138, 0.12); }
.prefixed .pre {
  display: flex;
  align-items: center;
  padding: 0 2px 0 15px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
/* On a phone the host prefix would crowd the field out, so it steps above it. */
.prefixed { flex-wrap: wrap; }
.prefixed .pre { flex-basis: 100%; padding: 10px 15px 0; }
.prefixed .input { flex: 1; min-width: 0; box-shadow: none; background: transparent; padding-left: 15px; font-family: var(--mono); font-size: 16px; }
.prefixed .input:focus { box-shadow: none; }

.hint { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }

/* Tier picker. The native radio stays visible: without :has() it is the only
   thing showing which tier is picked, and with it the card lights up too. */
.tiers {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}
.tiers legend { padding: 0; margin-bottom: 10px; }
.opt {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 14px 14px 15px;
  border-radius: 16px;
  background: var(--field);
  box-shadow: inset 0 0 0 1px var(--hair-2);
  cursor: pointer;
  transition: box-shadow 0.5s var(--ease), background-color 0.5s var(--ease), transform 0.5s var(--ease);
}
.opt:hover { box-shadow: inset 0 0 0 1px var(--muted); }
.opt:active { transform: scale(0.99); }
.opt input { position: absolute; top: 14px; right: 14px; margin: 0; accent-color: var(--ink); }
.opt .name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; }
.opt .what { font-size: 12.5px; line-height: 1.4; color: var(--muted); padding-right: 6px; }
.opt.public .name .i { color: var(--public); }
.opt.protected .name .i { color: var(--protected); }
.opt.private .name .i { color: var(--private); }
.opt:has(input:checked) { background: var(--core); box-shadow: inset 0 0 0 1.5px var(--ink), 0 12px 24px -18px rgba(27, 24, 21, 0.45); }
.opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }

.pass { margin-top: 18px; }
/* Hidden only while another tier is picked. A browser without :has() drops
   this rule and shows the field always, which is harmless: the server ignores
   a passphrase sent with any other tier. */
form:has(input[name="visibility"][value="protected"]:not(:checked)) .pass { display: none; }

/* ---------- drop area ---------- */
/* The input covers the whole box at opacity 0, so the browser's own click and
   drop handling does the work; the face underneath is decoration. */
.drop {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 168px;
  padding: 24px 20px;
  border: 1.5px dashed var(--hair-2);
  border-radius: 16px;
  background: var(--field);
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 160ms var(--ease), background 160ms var(--ease);
}
.drop-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop-face { display: grid; justify-items: center; gap: 6px; pointer-events: none; }
.drop-face .i { width: 26px; height: 26px; color: var(--ink-2); }
.drop-title { font-weight: 600; color: var(--ink); font-size: 15px; }
.drop-sub { font-size: 13.5px; }
.drop-chosen, .drop-file:empty { display: none; }
.drop-file { font-size: 13px; color: var(--ink); word-break: break-all; }
.drop:hover, .drop.over { border-color: var(--ink-2); background: var(--core); }
.drop.over { border-style: solid; }
.drop:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
/* A file is picked. Without :has() the box simply keeps its prompt. */
.drop:has(.drop-input:valid) { border-style: solid; border-color: var(--public); background: var(--public-soft); }
.drop:has(.drop-input:valid) .drop-title,
.drop:has(.drop-input:valid) .drop-sub { display: none; }
.drop:has(.drop-input:valid) .drop-chosen { display: block; font-weight: 600; color: var(--public); }
.drop + .notice { margin-top: 12px; }

/* The two upload forms (new artifact, new version) stack a label or the tier
   fieldset straight after the drop area, an input or the pass div, none of
   which carry a bottom margin. Give whichever one follows another control the
   same gap the other cards get from .pass, instead of sitting flush. */
.upload-form > * + .lbl,
.upload-form > * + .tiers { margin-top: 18px; }

/* ---------- badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.badge .i { width: 14px; height: 14px; }
.badge.public { background: var(--public-soft); color: var(--public); }
.badge.protected { background: var(--protected-soft); color: var(--protected); }
.badge.private { background: var(--private-soft); color: var(--private); }
.badge.comments { background: var(--shell); color: var(--ink-2); }
.badge.brand { background: var(--shell); color: var(--ink-2); }
.badge.shared { background: var(--shell); color: var(--ink-2); }
.badge.shared.writer { color: var(--ink); }

/* ---------- comment threads ---------- */

.thread q { font-style: italic; }
.thread form { display: inline; margin: 0; }
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--shell);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

/* ---------- notices ---------- */

.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
}
.notice .i { width: 17px; height: 17px; }
.notice.ok { background: var(--public-soft); color: var(--public); }
.notice.err { background: var(--danger-soft); color: var(--danger); }

/* ---------- index ---------- */

.hero { margin-bottom: 44px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 30px 0 0; padding: 0; list-style: none; }
.filters a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--ink-2);
  text-decoration: none;
  box-shadow: 0 0 0 1px var(--hair);
  transition: background-color 0.5s var(--ease), box-shadow 0.5s var(--ease), color 0.5s var(--ease);
}
.filters a:hover { box-shadow: 0 0 0 1px var(--hair-2); color: var(--ink); }
.filters a[aria-current="page"] { background: var(--ink); color: var(--paper); box-shadow: none; }
.filters .n { font-family: var(--mono); font-size: 12px; opacity: 0.7; }

/* The sort control sits under the tier filters and is quieter than them: the
   filter decides what is in the list, the sort only how it is ordered. */
.sorts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 14px 0 0; }
.sorts-label { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.sorts ul { display: flex; flex-wrap: wrap; gap: 2px; margin: 0; padding: 0; list-style: none; }
.sorts a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: background-color 0.5s var(--ease), box-shadow 0.5s var(--ease), color 0.5s var(--ease);
}
.sorts a:hover { color: var(--ink); background: var(--hair); }
.sorts a[aria-current="true"] { color: var(--ink); background: var(--core); box-shadow: inset 0 1px 0 var(--core-hi), 0 0 0 1px var(--hair-2); }

.rows { margin: 0; padding: 6px; list-style: none; }
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 14px 10px 14px 12px;
  border-radius: 16px;
  transition: background-color 0.5s var(--ease);
}
.row { position: relative; }
/* A straight hairline, inset from the rounded corners. A border or shadow on
   the row itself would curve with its radius and leave hooked seams. */
.row + .row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  height: 1px;
  background: var(--hair);
  transition: opacity 0.5s var(--ease);
}
.row:hover { background: var(--shell); }
.row:hover::before, .row:hover + .row::before { opacity: 0; }
.row .t {
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: -0.01em;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.row .t:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.row .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
.row .tools { display: flex; align-items: center; gap: 0; grid-column: 2; grid-row: 1 / span 2; }
.row .badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; grid-column: 1; grid-row: 2; justify-self: start; }
.empty { padding: 56px 24px; text-align: center; color: var(--muted); }
.more { display: flex; justify-content: center; margin-top: 22px; }
.more-note { margin: 22px 0 0; text-align: center; font-size: 13px; color: var(--muted); }

/* Pins and tags. The pin is a form so it works with no script; it sits in the
   row's tools like the links beside it. */
.pin-form { display: contents; }
.icon-btn.on { color: var(--ink); }
.icon-btn.on .i { fill: currentColor; }
.pinned + .shell, .group + .group { margin-top: 18px; }
.group-h {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 12px 12px 4px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
/* A tag heading shows the tag as typed in a chip: lower-case, monospace. */
.group-h.is-tag { font-family: var(--mono); font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--ink-2); }
.group-h .i { width: 15px; height: 15px; }
.group-h .n { font-family: var(--mono); font-size: 12px; letter-spacing: 0; opacity: 0.7; }
.tagbar a { gap: 6px; }
.tagbar .n { font-family: var(--mono); font-size: 11.5px; opacity: 0.7; }
.tagbar .i { width: 14px; height: 14px; }
.row .tag {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-2);
  text-decoration: none;
}
.row .tag:hover, .row .tag[aria-current="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.tag-edit summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 8px;
  margin-left: -8px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}
.tag-edit summary::-webkit-details-marker { display: none; }
.tag-edit summary:hover { color: var(--ink); background: var(--hair); }
.tag-edit summary .i { width: 13px; height: 13px; }
.tag-edit[open] { flex-basis: 100%; }
.tag-edit form { display: flex; gap: 8px; margin-top: 8px; }
.tag-edit .input { min-height: 40px; }

/* ---------- detail ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}
.tier-mark { margin: 0 0 16px; }
.facts { margin: 30px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 22px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.spark { display: block; width: 100%; height: 48px; margin: 0 0 16px; color: var(--ink); }
.spark rect { fill: currentColor; opacity: .75; }
.spark rect.zero { opacity: .15; }
.view-totals { display: flex; gap: 22px; margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.view-totals strong { color: var(--ink); font-size: 20px; margin-right: 4px; }
.view-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 22px; margin: 0 0 16px; font-size: 14px; }
.view-lists h3 { margin: 0 0 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.view-lists ol { margin: 0; padding: 0; list-style: none; }
.view-lists li { display: flex; justify-content: space-between; gap: 12px; }
/* A long referrer wraps; its count never does. */
.view-lists li .v { min-width: 0; overflow-wrap: anywhere; }
.view-lists li .n { flex-shrink: 0; white-space: nowrap; }
.links { margin-top: 30px; }
.link-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 8px 14px 16px;
}
.link-line + .link-line { box-shadow: 0 -1px 0 var(--hair); }
.link-line .k { display: block; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.link-line .v { display: block; overflow-wrap: anywhere; }

.readers { margin: 0 0 18px; padding: 0; list-style: none; }
.readers li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 6px 6px 14px;
  border-radius: 12px;
}
.readers li { position: relative; }
.readers li + li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 14px;
  right: 6px;
  height: 1px;
  background: var(--hair);
}
.readers .who { display: flex; align-items: center; gap: 10px; }
.readers .who .i { color: var(--muted); }
.readers form { margin: 0; }
form.inline { display: inline; }
/* /admin rows carry a .meta line; the manage page's reader list has none, so
   :has(.meta) keeps these to /admin. At phone width the login, its meta and
   the buttons would squeeze into three narrow columns: the meta drops under
   the login (indented past the 1.1em icon and its 10px gap) and the buttons
   wrap under the text. */
.readers li:has(.meta) { flex-wrap: wrap; }
.readers .who:has(.meta) { flex: 1 1 15rem; min-width: 0; flex-wrap: wrap; row-gap: 2px; }
.readers .meta { flex-basis: 100%; padding-left: calc(17px + 10px); font-size: 13px; color: var(--muted); }
.readers .tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.readers.pub-rows li { flex-wrap: wrap; column-gap: 12px; row-gap: 2px; min-width: 0; }
.readers.pub-rows .mono { overflow-wrap: anywhere; min-width: 0; }
.card form + form { margin-top: 20px; }
.status { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.status .i { width: 15px; height: 15px; color: var(--protected); }

.danger-zone { box-shadow: inset 0 1px 0 var(--core-hi), 0 0 0 1px var(--danger-soft), var(--lift); }
.danger-zone .card-head .i { color: var(--danger); }

/* ---------- landing ---------- */

.bento {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-top: 44px;
}
.bento .shell { height: 100%; }
.bento .core { height: 100%; }

.tools-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px 28px;
  margin: 18px 0 0;
}
.tools-grid div { padding: 10px 0; box-shadow: 0 -1px 0 var(--hair); }
.tools-grid dt { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.tools-grid dd { margin: 3px 0 0; font-size: 13.5px; color: var(--muted); }
.shots { display: grid; gap: 22px; margin-top: 4px; align-items: start; }
.shot { margin: 0; }
.shot img { display: block; width: 100%; height: auto; border-radius: 14px; }
.shot figcaption { margin-top: 10px; font-size: 13.5px; color: var(--muted); }
.endpoint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  max-width: 100%;
  padding: 4px 4px 4px 16px;
  border-radius: 999px;
  background: var(--shell);
  box-shadow: 0 0 0 1px var(--hair);
}
.endpoint .cmd { font-size: 13px; min-width: 0; }

/* ---------- commands and copy ---------- */

.cmd {
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.6;
  /* Wrapped, not scrolled: on a phone the whole command should be readable. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  /* One tap selects the whole command, with or without the script. */
  -webkit-user-select: all;
  user-select: all;
}
/* Generated content is never part of a selection, so the prompt is never copied. */
.cmd.prompt::before { content: "$ "; color: var(--muted); }

.term {
  margin-top: 10px;
  border-radius: 16px;
  background: var(--field);
  box-shadow: inset 0 0 0 1px var(--hair);
  overflow: hidden;
}
.term-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 0 4px 0 16px;
  box-shadow: inset 0 -1px 0 var(--hair);
}
.term-k { font-size: 10.5px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.term .cmd { display: block; padding: 14px 16px 16px; }

.copyfield {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 4px 4px 4px 16px;
  border-radius: 14px;
  background: var(--field);
  box-shadow: inset 0 0 0 1px var(--hair);
}
.copyfield .cmd { flex: 1; min-width: 0; padding: 8px 0; }

.copy {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: 500 12.5px/1 var(--sans);
  cursor: pointer;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease), transform 0.5s var(--ease);
}
.copy:hover { background: var(--hair); color: var(--ink); }
.copy:active { transform: scale(0.96); }
.copy .i { width: 15px; height: 15px; }
.copy .done { display: none; }
.copy[data-state="copied"] { color: var(--public); background: var(--public-soft); }
.copy[data-state="copied"] .done { display: inline; }
.copy[data-state="copied"] .i:not(.done) { display: none; }

.numbered { counter-reset: step; list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 22px; }
.numbered > li { counter-increment: step; position: relative; padding-left: 40px; }
.numbered > li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--shell);
  box-shadow: 0 0 0 1px var(--hair-2);
  font: 600 12px/1 var(--mono);
  color: var(--ink-2);
}
.step-t { margin: 2px 0 0; font-size: 14.5px; font-weight: 500; }
.tier-list { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.tier-list li { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; font-size: 14px; color: var(--ink-2); }
.foot { margin-top: 48px; font-size: 13px; color: var(--muted); text-align: center; }
/* The release version under a management page (src/version.ts). */
.ver { margin: -40px auto 0; padding: 0 16px 32px; font-size: 12px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- art home ---------- */

.solo {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px 16px;
}
.solo .shell { width: 100%; max-width: 580px; }
.solo .card { padding: 30px 22px 26px; }
.solo .display { font-size: clamp(2.2rem, 6vw, 3.1rem); }
.solo p { color: var(--ink-2); }
.solo .brandline { display: flex; align-items: center; gap: 10px; margin-bottom: 32px; font-weight: 600; letter-spacing: -0.01em; }

/* ---------- motion ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.rise { animation: rise 0.9s var(--ease) both; }
.d1 { animation-delay: 0.06s; }
.d2 { animation-delay: 0.12s; }
.d3 { animation-delay: 0.18s; }
.d4 { animation-delay: 0.24s; }
.d5 { animation-delay: 0.3s; }
.d6 { animation-delay: 0.36s; }
.d7 { animation-delay: 0.42s; }
.d8 { animation-delay: 0.48s; }
.d9 { animation-delay: 0.54s; }
.rows .row { animation: rise 0.8s var(--ease) both; }
.rows .row:nth-child(2) { animation-delay: 0.04s; }
.rows .row:nth-child(3) { animation-delay: 0.08s; }
.rows .row:nth-child(4) { animation-delay: 0.12s; }
.rows .row:nth-child(5) { animation-delay: 0.16s; }
.rows .row:nth-child(6) { animation-delay: 0.2s; }
.rows .row:nth-child(7) { animation-delay: 0.24s; }
.rows .row:nth-child(n + 8) { animation-delay: 0.28s; }

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

/* ---------- larger screens ---------- */

@media (min-width: 360px) {
  .nav a { padding: 0 10px; }
}

@media (min-width: 560px) {
  .nav { gap: 4px; }
  .nav a { padding: 0 12px; }
  .nav .connect { display: inline-flex; }
  .nav .brand.here { background: none; box-shadow: none; }
  .nav .brand.here:hover { background: var(--hair); }
  .nav .brand .word { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .tiers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .prefixed { flex-wrap: nowrap; }
  .prefixed .pre { flex-basis: auto; padding: 0 2px 0 15px; }
  .prefixed .input { padding-left: 2px; }
  .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 28px; }
}

@media (min-width: 768px) {
  .page { padding: 20px 28px 112px; }
  .nav { margin-bottom: 72px; }
  .nav a { padding: 0 14px; }
  .card { padding: 26px 28px 28px; }
  .icon-btn { width: 38px; height: 38px; }
  .row { grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; padding: 16px 18px; }
  .row .badges, .row .tools { grid-column: auto; grid-row: auto; }
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; }
  .bento { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; margin-top: 64px; }
  .span-7 { grid-column: span 7; }
  .span-5 { grid-column: span 5; }
  .span-6 { grid-column: span 6; }
  .span-12 { grid-column: span 12; }
  .shots { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .tools-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot { margin-top: 64px; }
  .solo .card { padding: 40px 40px 36px; }
}

/* Fine pointers only: a mouse can hit a smaller target than a thumb can. */
@media (min-width: 768px) and (pointer: fine) {
  .btn { min-height: 42px; }
  .btn-ghost { min-height: 36px; }
  .nav a { min-height: 36px; }
  .copy { min-height: 34px; }
}
