/* Ax Library demo. Tokens, notches, pills, segments, strips, pockets, drop-downs and tooltips are ported
   from nave (G:\cameravms\src\style.css); cards, posts and the catalogue pieces are built from the same parts. */
:root {
  --bg: #000;
  --surface: #1c1c1e;
  --surface-hover: #2c2c2e;
  /* Panel = the page-like background; group = the surfaces that sit on it. */
  --panel: #09090a;
  --group: #141416;
  --group-hover: #1c1c1f;
  --sep: #26262a;
  --field: #141416;
  /* Strip behind a field's label, and row strips in lists. */
  --label: #0c0c0c;
  --strip: #0c0c0c;
  --strip-hover: #141416;
  --text: #fff;
  --sec: #a1a1a8;
  --faint: #6e6e75;
  --on-bg: #fff;
  --on-fg: #000;
  /* One accent: yellow, for the main action, focus and selection. */
  --accent: #ffcc33;
  --fill: #ffcc33;
  --fill-hover: #ffd75c;
  --on-fill: #000;
  --orange: #ff9f0a;
  --red: #ff6961;
  --green: #30d158;
  --gap: 12px;
  /* Space between a cut-out control and the surface around it. */
  --inset: 5px;
  --r: 14px;
  color-scheme: dark;
}

html, body { height: 100%; margin: 0; background: var(--bg); }
body {
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', 'Helvetica Neue', system-ui, sans-serif;
  letter-spacing: -0.01em;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: rgba(255, 204, 51, 0.35); }

/* ---- Frame: one panel on a black page, with controls in cut-out notches ---- */
.screen { position: relative; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.panel { flex: 1; min-height: 0; margin: var(--gap); background: var(--panel); border-radius: var(--r); overflow-y: auto; scroll-padding-top: 68px; }
.panel > main { max-width: 720px; margin: 0 auto; padding: 24px 16px 112px; display: flex; flex-direction: column; gap: 20px; }
/* A page starts right at the top. Only its first line is kept clear of the top-right notch, and only when the two would meet. */
.panel > main > :first-child { margin-right: max(0px, calc(var(--tr, 300px) + 8px - (100vw - 100%) / 2)); min-height: 36px; }
.panel > main.wide { max-width: 1000px; }
.panel > main.xwide { max-width: 1400px; }
/* The catalogue uses the whole panel: its search bar sits in the top row, beside the notch (--tr is the notch's width, set by app.js). */
.panel > main.full { max-width: none; padding-top: 12px; }
/* Title and its one-line description share a baseline, to the left of the notch; stacked on narrow screens. */
main.full .intro { flex-direction: row; align-items: baseline; gap: 4px 14px; min-height: 36px; margin-right: calc(var(--tr, 300px) - 20px); }
main.full .intro h1 { flex: none; font-size: 26px; line-height: 36px; white-space: nowrap; }
main.full .intro .lead { margin: 0; max-width: none; min-width: 0; font-size: 15px; }
@media (max-width: 900px) {
  main.full .intro { flex-direction: column; margin-right: 0; gap: 6px; }
  main.full .intro h1 { max-width: calc(100% - var(--tr, 300px) + 20px); overflow: hidden; text-overflow: ellipsis; }
}
/* Search and the type chips share one row; the chips drop below when there is no room. */
.filters .bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.filters .bar .searchbar { flex: 1 1 280px; height: 44px; }
.filters .bar .chips { flex: 0 1 auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* The controls in the top-right notch are a size smaller than pills in the page. */
.notch.tr .pill { height: 36px; min-width: 36px; padding: 0 14px; border-radius: 18px; font-size: 13px; gap: 6px; }
.notch.tr .pill svg { width: 18px; height: 18px; }
.notch.tr .pill.who:has(.avatar) { padding: 0 12px 0 6px; }
.notch.tr .pill.demo { padding: 0 4px 0 12px; }
.notch.tr .pill.demo .sel { height: 28px; border-radius: 14px; font-size: 13px; }
@media (max-width: 560px) { .notch.tr .pill.who:has(.avatar) { padding: 0 6px; } .notch.tr .pill.demo .sel { width: 112px; } }

.notch { position: absolute; z-index: 5; display: flex; gap: 8px; padding: var(--gap); background: var(--bg); }
.notch::before, .notch::after { content: ''; position: absolute; width: 14px; height: 14px; pointer-events: none; }
.notch.tr { top: 0; right: 0; padding: var(--gap) var(--gap) var(--inset) var(--inset); border-bottom-left-radius: calc(18px + var(--inset)); }
.notch.tr::before { top: var(--gap); left: -14px; background: radial-gradient(circle at 0 100%, transparent 13.5px, var(--bg) 14px); }
.notch.tr::after { top: 100%; right: var(--gap); background: radial-gradient(circle at 0 100%, transparent 13.5px, var(--bg) 14px); }
.notch.tl { top: 0; left: 0; padding: var(--gap) var(--inset) var(--inset) var(--gap); border-bottom-right-radius: calc(22px + var(--inset)); }
.notch.tl::before { top: var(--gap); right: -14px; background: radial-gradient(circle at 100% 100%, transparent 13.5px, var(--bg) 14px); }
.notch.tl::after { top: 100%; left: var(--gap); background: radial-gradient(circle at 100% 100%, transparent 13.5px, var(--bg) 14px); }
.notch.br { bottom: 0; right: 0; padding: var(--inset) var(--gap) var(--gap) var(--inset); border-top-left-radius: calc(18px + var(--inset)); }
.notch.br::before { bottom: var(--gap); left: -14px; background: radial-gradient(circle at 0 0, transparent 13.5px, var(--bg) 14px); }
.notch.br::after { bottom: 100%; right: var(--gap); background: radial-gradient(circle at 0 0, transparent 13.5px, var(--bg) 14px); }
/* The legal links sit in the bottom-right notch on wide screens, and under the page on narrow ones. */
.legal { display: flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 18px; background: var(--surface); font-size: 12px; color: var(--faint); white-space: pre; }
.legal a { color: var(--sec); font-weight: 600; }
.legal a:hover, .footlinks a:hover { color: var(--text); }
.footlinks { display: none; }
.footlinks a { color: var(--sec); font-weight: 600; }
@media (max-width: 1000px) { .notch.br { display: none; } .footlinks { display: inline; } }
.notch.bc { bottom: 0; left: 0; right: 0; margin: 0 auto; width: fit-content; padding: var(--inset) var(--inset) var(--gap); border-radius: calc(22px + var(--inset)) calc(22px + var(--inset)) 0 0; }
.notch.bc::before { bottom: var(--gap); left: -14px; background: radial-gradient(circle at 0 0, transparent 13.5px, var(--bg) 14px); }
.notch.bc::after { bottom: var(--gap); right: -14px; background: radial-gradient(circle at 100% 0, transparent 13.5px, var(--bg) 14px); }

/* ---- Pills ---- */
.pill {
  height: 44px; min-width: 44px; box-sizing: border-box; padding: 0 20px; border-radius: 22px;
  background: var(--surface); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; white-space: nowrap; transition: background 0.15s, transform 0.15s;
}
.pill:hover { background: var(--surface-hover); }
.pill:active { transform: scale(0.96); }
.pill.primary { background: var(--fill); color: var(--on-fill); }
.pill.primary:hover { background: var(--fill-hover); }
.pill.small { height: 36px; min-width: 36px; padding: 0 16px; border-radius: 18px; font-size: 13px; background: var(--group); }
.pill.small:hover { background: var(--group-hover); }
.pill.small.primary { background: var(--fill); color: var(--on-fill); }
.pill.small.primary:hover { background: var(--fill-hover); }
.pill.small.back { align-self: flex-start; margin-bottom: -8px; padding: 0 16px 0 10px; gap: 6px; }
.count { margin-left: 8px; padding: 1px 7px; border-radius: 999px; background: var(--surface-hover); color: var(--sec); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.seg .count { background: var(--accent); color: #000; }

/* The demo's stand-in for an account menu. */
.pill.demo { padding: 0 5px 0 16px; gap: 10px; font-weight: 500; color: var(--sec); cursor: pointer; }
.pill.demo:hover { background: var(--surface); }
.pill.demo:active { transform: none; }
.pill.demo .sel { flex: none; width: 168px; height: 34px; border-radius: 17px; background: var(--bg); font-weight: 600; }

/* ---- Segmented control: links (the sections), or radio buttons and checkboxes in forms ---- */
.seg { display: flex; height: 44px; box-sizing: border-box; padding: 3px; border-radius: 22px; background: var(--surface); font-size: 14px; font-weight: 600; }
.seg > a, .seg > label, .seg > button {
  position: relative; display: flex; align-items: center; justify-content: center; min-width: 92px; box-sizing: border-box; padding: 0 20px; border-radius: 19px;
  color: var(--text); cursor: pointer; white-space: nowrap; transition: background 0.2s, color 0.2s;
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg > .on, .seg > label:has(input:checked) { background: var(--on-bg); color: var(--on-fg); }
.seg > label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg.mini { height: 38px; padding: 2px; border-radius: 19px; font-size: 13px; background: var(--field); }
.seg.mini > label { min-width: 0; padding: 0 14px; border-radius: 17px; }
.seg.mini.wrap { height: auto; flex-wrap: wrap; justify-content: flex-end; }
.seg.mini.wrap > label { height: 34px; }

/* ---- Text ---- */
h1 { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.015em; }
.lead { font-size: 17px; color: var(--sec); max-width: 62ch; }
.cap { margin: 0 0 -12px; padding: 0 2px; font-size: 13px; font-weight: 400; letter-spacing: -0.01em; color: var(--sec); }
.caprow { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: -12px; padding: 0 2px; }
.caprow .cap { margin: 0; padding: 0; }
.caprow .link { font-size: 13px; }
.link { color: var(--accent); }
.link:hover { text-decoration: underline; }
.dim { color: var(--sec); font-weight: 400; }
.warn { color: var(--orange); }
.del { color: var(--red); }
.tabular { font-variant-numeric: tabular-nums; }
.meta { font-size: 13px; color: var(--sec); }
.sub { display: block; font-size: 13px; color: var(--sec); }
.title { font-weight: 600; color: var(--text); }
.hint { margin: 6px 16px 0; font-size: 12px; color: var(--faint); }
.grow { flex: 1; min-width: 0; }
.empty { padding: 20px 16px; border-radius: var(--r); background: var(--label); color: var(--sec); }
.intro { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.foot { margin-top: 12px; text-align: center; font-size: 12px; line-height: 1.9; color: var(--faint); }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 11px; border-radius: 13px; background: var(--surface); color: var(--sec); font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag::first-letter { text-transform: uppercase; }
a.tag:hover { color: var(--text); }
.tag.hot { background: var(--accent); color: #000; }
.tag svg { width: 13px; height: 13px; }
.sq { flex: none; display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 2px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--r); background: var(--label); font-size: 14px; }
.banner form { display: contents; }
.slot:empty { display: none; }

.avatar {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: var(--s); height: var(--s); border-radius: 50%;
  background: hsl(var(--h) 42% 28%); color: hsl(var(--h) 85% 88%); font-size: calc(var(--s) * 0.38); font-weight: 700; letter-spacing: 0;
}

/* ---- Strips and pockets: list rows and form fields ---- */
.group { display: flex; flex-direction: column; gap: 4px; }
.row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; box-sizing: border-box; padding: 0 16px; border-radius: var(--r); background: var(--label); color: var(--sec); overflow: hidden; text-align: left; }
.row.two { padding-top: 8px; padding-bottom: 8px; }
.row .val { color: var(--text); text-align: right; }
.row .grow.val { text-align: left; }
.row .val.warn { color: var(--orange); }
.row .val.del { color: var(--red); }
.row.two .grow > * { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.two .grow > .wrap { white-space: normal; }
a.row { background: var(--strip); color: var(--text); transition: background 0.15s; }
a.row:hover { background: var(--strip-hover); }
.row:has(> .cut.end) { padding-right: 62px; }
.row:has(> .cut.start) { padding-left: 62px; }
.row:has(> .pocket) { padding-right: 0; }

/* Pockets at the ends of a strip. Right end: the open arrow. Left end: an icon saying what the row is.
   Both are the panel colour cut into the strip, with a round button-coloured disc inside. */
.cut { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding: 0 5px; background: var(--panel); }
.cut.end { right: 0; border-radius: 24px 0 0 24px; }
.cut.start { left: 0; border-radius: 0 24px 24px 0; }
.cut > .go { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 19px; background: var(--group); color: var(--sec); transition: background 0.15s, color 0.15s; }
.cut > .go.picked { background: var(--on-bg); color: var(--on-fg); }
a:hover > .cut.end > .go { background: var(--group-hover); color: var(--text); }

/* Fields: the strip carries the label, a dark pocket is cut into its right end,
   and the lighter rounded input sits in that pocket with an even gap. */
.pocket { position: relative; flex: none; align-self: stretch; display: flex; align-items: center; gap: 5px; padding: 0 5px; border-radius: 24px 0 0 24px; background: var(--panel); }
.pocket.fill { flex: 0 1 60%; min-width: 0; }
.pocket form { display: contents; }
.pocket input {
  flex: 1; min-width: 0; height: 38px; box-sizing: border-box; padding: 0 16px; border: 0; border-radius: 19px; outline: none;
  background-color: var(--field); color: var(--text);
}
.pocket input::placeholder, textarea::placeholder, .searchbar input::placeholder, .compose input::placeholder { color: var(--faint); }
.pocket input:focus-visible, textarea:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.row.tall { min-height: 48px; }
.row.tall .pocket { flex: 0 1 auto; min-width: 0; padding: 5px; }
/* Field errors: a red ring on the input and one plain sentence under the row. */
.field { display: flex; flex-direction: column; }
.field.bad input, .field.bad .sel, .field.bad textarea { box-shadow: inset 0 0 0 2px var(--red); }
.err { margin: 4px 16px 6px; font-size: 12px; line-height: 1.35; color: var(--red); }
.form { display: flex; flex-direction: column; gap: 20px; }
textarea { display: block; width: 100%; box-sizing: border-box; padding: 14px 16px; border: 0; border-radius: var(--r); outline: none; resize: vertical; background: var(--label); color: var(--text); line-height: 1.45; }
input[type='datetime-local'] { color-scheme: dark; }

.round { flex: none; display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 19px; background: var(--field); color: var(--sec); transition: background 0.15s, color 0.15s; }
.round:hover { background: var(--group-hover); color: var(--text); }
.round.ok:hover { background: var(--green); color: #000; }
.round.no:hover { background: #c4001a; color: #fff; }
.round.eye { background: none; cursor: pointer; }
.round.eye[aria-pressed="false"] svg:last-child, .round.eye[aria-pressed="true"] svg:first-child { display: none; }
.round.send { background: var(--fill); color: var(--on-fill); }
.round.send:hover { background: var(--fill-hover); color: var(--on-fill); }
.row.acts a.title:hover { text-decoration: underline; }

.switch { flex: none; display: flex; width: 51px; height: 31px; margin: 0 4px; padding: 2px; box-sizing: border-box; border-radius: 16px; background: var(--sep); transition: background 0.2s; }
.switch i { width: 27px; height: 27px; border-radius: 14px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.2s; }
.switch[aria-checked='true'] { background: var(--green); }
.switch[aria-checked='true'] i { transform: translateX(20px); }

/* Quiet text buttons for the actions under a post or beside a title. Delete asks twice: pressed once it turns red. */
.ghost { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 16px; color: var(--sec); font-size: 13px; font-weight: 600; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.ghost svg { width: 15px; height: 15px; }
.ghost:hover { background: var(--group); color: var(--text); }
.ghost.danger:hover { color: var(--red); }
.ghost.danger.armed, .ghost.danger.armed:hover { background: #c4001a; color: #fff; }

/* ---- Drop-down (app.js): the closed control is a field like any other; the list is a floating dark sheet ---- */
select[hidden] { display: none !important; }
.sel {
  flex: 1; min-width: 0; height: 38px; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 0 14px 0 16px; border-radius: 19px; background: var(--field); color: var(--text); text-align: left;
}
.sel > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sel > svg { color: var(--sec); transition: transform 0.15s; }
.sel[aria-expanded='true'] > svg { transform: rotate(180deg); }
.sel:focus-visible, .sel[aria-expanded='true'] { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.sel-pop {
  position: fixed; z-index: 90; box-sizing: border-box; padding: 5px; border-radius: 16px; overflow-y: auto;
  background: var(--surface); color: var(--text); box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--sep);
  font-size: 14px;
}
.opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 38px; padding: 0 12px; border-radius: 11px; cursor: pointer; }
.opt > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opt.active { background: var(--surface-hover); }

/* Tooltip: a small dark pill in the same family as the buttons. */
.tip {
  position: fixed; top: 0; left: 0; z-index: 100; max-width: min(340px, calc(100vw - 16px)); box-sizing: border-box; padding: 7px 12px; border-radius: 12px;
  background: var(--surface); color: var(--text); font-size: 12px; font-weight: 500; line-height: 1.35;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--sep);
  pointer-events: none; opacity: 0; transform: translateY(3px); transition: opacity 0.12s ease, transform 0.12s ease;
}
.tip.on { opacity: 1; transform: none; }

/* ---- Search, chips, filters ---- */
.searchbar { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 20px; border-radius: 26px; background: var(--group); color: var(--sec); }
.searchbar:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
.searchbar input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: none; color: var(--text); font-size: 16px; }
.searchbar input::-webkit-search-cancel-button { filter: invert(1) opacity(0.5); cursor: pointer; }
.filters { display: flex; flex-direction: column; gap: 12px; }
/* Regions htmx swaps keep the same spacing as the page itself. */
#results, #queue, #topics { display: flex; flex-direction: column; gap: 20px; }
#tokens { display: flex; flex-direction: column; gap: var(--gap); }
#results.htmx-request, #topics.htmx-request { opacity: 0.6; transition: opacity 0.2s; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; display: inline-flex; align-items: center; height: 36px; box-sizing: border-box; padding: 0 15px; border-radius: 18px; background: var(--group); color: var(--sec); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.chip:hover { background: var(--group-hover); color: var(--text); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked), .chip.on { background: var(--on-bg); color: var(--on-fg); }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip.on { height: 44px; gap: 8px; padding: 0 12px 0 18px; border-radius: 22px; }
.chip.on svg { width: 15px; height: 15px; }
.chip.person { gap: 8px; padding-left: 6px; }
.chip.more { align-self: center; height: 34px; gap: 7px; padding: 0 14px 0 11px; border-radius: 17px; }
.chips[role="radiogroup"] .chip { gap: 7px; padding-left: 12px; }
.chips[role="radiogroup"] .chip svg { width: 15px; height: 15px; }
.chip.more svg { width: 16px; height: 16px; }
.selects { display: flex; flex-wrap: wrap; gap: 6px; }
/* A filter is a small strip: its name on the strip, the choice in a field at its end. */
.fsel { display: inline-flex; align-items: center; gap: 10px; height: 44px; box-sizing: border-box; padding: 0 5px 0 16px; border-radius: 22px; background: var(--label); color: var(--sec); font-size: 13px; cursor: pointer; }
.fsel .sel { flex: none; min-width: 132px; height: 34px; padding: 0 10px 0 14px; border-radius: 17px; font-size: 13px; font-weight: 600; }
.filters:not(:has(input[name='adv']:checked)) .advanced { display: none; }

/* ---- Listing cards: the kind sits in a notch at the bottom-left, the like button in one at the bottom-right ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.card { position: relative; display: flex; flex-direction: column; border-radius: var(--r); background: var(--group); overflow: hidden; transition: background 0.15s; }
.card:hover { background: var(--group-hover); }
.cover { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 8; background: linear-gradient(135deg, hsl(var(--h) 55% 24%), hsl(calc(var(--h) + 50) 65% 11%)); }
/* A picture fills the whole top of the card. */
.cover.pic { position: relative; overflow: hidden; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.cover span { font-size: 40px; font-weight: 800; letter-spacing: -0.04em; color: hsl(var(--h) 80% 82% / 0.85); }
.cbody { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 48px; }
.cbody .title { font-size: 16px; }
.cbody .sub { flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cbody .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stretch::after { content: ''; position: absolute; inset: 0; }
.stretch:focus-visible { outline: none; }
.card:has(.stretch:focus-visible) { box-shadow: inset 0 0 0 2px var(--accent); }

.cnotch { position: absolute; z-index: 2; display: flex; background: var(--panel); }
.cnotch::before, .cnotch::after { content: ''; position: absolute; width: 14px; height: 14px; pointer-events: none; }
.cnotch.tl { top: 0; left: 0; padding: 0 var(--inset) var(--inset) 0; border-bottom-right-radius: calc(13px + var(--inset)); }
.cnotch.tl::before { top: 0; right: -14px; background: radial-gradient(circle at 100% 100%, transparent 13.5px, var(--panel) 14px); }
.cnotch.tl::after { top: 100%; left: 0; background: radial-gradient(circle at 100% 100%, transparent 13.5px, var(--panel) 14px); }
.cnotch.bl { bottom: 0; left: 0; padding: var(--inset) var(--inset) 0 0; border-top-right-radius: calc(13px + var(--inset)); }
.cnotch.bl::before { bottom: 0; right: -14px; background: radial-gradient(circle at 100% 0, transparent 13.5px, var(--panel) 14px); }
.cnotch.bl::after { bottom: 100%; left: 0; background: radial-gradient(circle at 100% 0, transparent 13.5px, var(--panel) 14px); }
.cnotch.br { bottom: 0; right: 0; padding: var(--inset) 0 0 var(--inset); border-top-left-radius: calc(17px + var(--inset)); }
.cnotch.br::before { bottom: 0; left: -14px; background: radial-gradient(circle at 0 0, transparent 13.5px, var(--panel) 14px); }
.cnotch.br::after { bottom: 100%; right: 0; background: radial-gradient(circle at 0 0, transparent 13.5px, var(--panel) 14px); }
.cnotch .tag { background: var(--group); }
.cnotch.bl .tag { gap: 6px; padding-left: 9px; }
.cnotch.bl .tag svg { width: 14px; height: 14px; color: var(--text); }

.like { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; min-width: 58px; box-sizing: border-box; padding: 0 12px; border-radius: 17px; background: var(--group); color: var(--sec); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; transition: background 0.15s, color 0.15s, transform 0.15s; }
.like:hover:not(:disabled) { background: var(--group-hover); color: var(--text); }
.like:active:not(:disabled) { transform: scale(0.94); }
.like.on, .like.on:hover:not(:disabled) { color: var(--accent); }
.like svg { width: 16px; height: 16px; }

/* ---- Start page ---- */

/* ---- Listing page ---- */
.lhead { display: flex; align-items: flex-start; gap: 20px; }
.lhead .cover { flex: none; width: 132px; aspect-ratio: 1; border-radius: var(--r); }
.lhead .grow { display: flex; flex-direction: column; gap: 8px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.actions form { display: contents; }
.actions .like { height: 44px; min-width: 76px; border-radius: 22px; font-size: 15px; }
.actions .like svg { width: 18px; height: 18px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.body > h2 { margin-top: 10px; }
.body > .md { font-size: 16px; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 4px; }
.steps li { counter-increment: step; position: relative; padding: 13px 16px 13px 62px; border-radius: var(--r); background: var(--label); }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; bottom: 0; width: 48px; border-radius: 0 24px 24px 0; background: var(--panel); color: var(--sec); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.faq { border-radius: var(--r); background: var(--label); }
.faq summary { padding: 13px 16px; font-weight: 600; cursor: pointer; border-radius: var(--r); }
.faq summary::marker { color: var(--sec); }
.faq p { padding: 0 16px 14px; color: var(--sec); }
.tags { margin-top: 6px; }
.facts .row { font-size: 14px; }
.facts .row .val { display: inline-block; max-width: 62%; }
.facts .row .val::first-letter { text-transform: uppercase; }

/* Text written by people, rendered from Markdown. */
.md { line-height: 1.55; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md pre, .md blockquote { margin: 0 0 0.75em; }
.md h3 { margin: 1.1em 0 0.4em; font-size: 16px; font-weight: 700; }
.md ul, .md ol { padding-left: 22px; }
.md li { margin: 0.2em 0; }
.md a { color: var(--accent); }
.md a:hover { text-decoration: underline; }
.md code { padding: 1px 6px; border-radius: 6px; background: var(--group); font: 13px/1.5 ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace; letter-spacing: 0; }
.md pre { padding: 12px 14px; border-radius: 10px; background: var(--bg); overflow-x: auto; }
.md pre code { padding: 0; background: none; }
.md blockquote { padding-left: 12px; border-left: 3px solid var(--sep); color: var(--sec); }

/* ---- Posts: forum replies, reviews and comments ---- */
.thread { display: flex; flex-direction: column; gap: 4px; }
.thread > h2 { margin-bottom: 6px; }
.thread > h2 .dim { margin-left: 6px; font-size: 14px; }
.thread > .dim, .thread > .compose { margin-top: 6px; }
.post { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; padding: 14px 16px; border-radius: var(--r); background: var(--label); }
.post.solution { box-shadow: inset 0 0 0 2px var(--accent); }
.pmain { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.phead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 26px; font-size: 14px; }
.phead .who { font-weight: 600; }
.phead .who:hover { text-decoration: underline; }
.phead .when { margin-left: auto; font-size: 12px; color: var(--sec); }
.phead .tag { height: 22px; padding: 0 9px; }
.starline { color: var(--accent); letter-spacing: 1px; }
.pacts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px; margin: 0 -8px -6px 0; }
.pacts:empty { display: none; }
.pacts form { display: contents; }
.post .form { gap: 8px; }
.post .form textarea, .post .form .row:not(.x) { background: var(--panel); }
.post .form .pocket { background: var(--label); }
.post .form .pacts { margin: 0; gap: 6px; align-items: center; }
.solved { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 18px; background: var(--group); color: var(--sec); font-size: 13px; transition: background 0.15s; }
.solved:hover { background: var(--group-hover); }
.solved svg { color: var(--accent); }
.solved b { color: var(--text); font-weight: 600; }
.report { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.report .row { background: var(--panel); }
.report .pocket { background: var(--label); }
.report .compose { background: var(--panel); }
#listing-report .report .row, #listing-report .report .compose { background: var(--label); }
#listing-report .report .pocket { background: var(--panel); }

/* One-line composer: an input and its button share a rounded strip. */
.compose { display: flex; gap: 5px; padding: 5px; border-radius: 24px; background: var(--label); }
.compose input { flex: 1; min-width: 0; height: 38px; box-sizing: border-box; padding: 0 16px; border: 0; border-radius: 19px; outline: none; background: var(--field); color: var(--text); }
.compose input:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.compose .sel { flex: none; width: 128px; color: var(--accent); letter-spacing: 1px; }
.compose .pill.small { height: 38px; border-radius: 19px; }

/* The reply box: its button sits in a notch cut into the text area's corner. */
.reply { position: relative; }
.reply textarea { min-height: 150px; padding-bottom: 62px; resize: none; }
.reply .cnotch.br { border-top-left-radius: calc(22px + var(--inset)); }

/* ---- Forum lists ---- */
.thead { display: flex; align-items: center; gap: 12px; min-height: 24px; padding: 0 62px; font-size: 12px; color: var(--sec); }
.topic .people { flex: none; display: flex; width: 104px; }
.thead .people { flex: none; width: 104px; }
.topic .people .avatar + .avatar { margin-left: -7px; box-shadow: 0 0 0 2px var(--strip); }
.num { flex: none; width: 56px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.thead .num { color: var(--sec); }
.num.when { width: 92px; font-size: 13px; color: var(--sec); }
.topic .sub { display: flex !important; align-items: center; }
.modbar .pocket { gap: 2px; padding: 0 8px; }
.phero { display: flex; align-items: center; gap: 20px; }

/* "Original author" is only asked for someone else's work. */
.form:not(:has(input[name='origin'][value='community']:checked)) :is(.only-community, .only-community-hint) { display: none; }
.only-community-hint { margin-top: -14px; }

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

@media (max-width: 860px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .pill.demo { padding-left: 5px; }
  .pill.demo .flabel { display: none; }
  .pill.demo .sel { width: 148px; }
  .topic .people, .thead .people { display: none; }
}
@media (max-width: 560px) {
  .panel > main { padding-left: 12px; padding-right: 12px; }
  .pill.act span { display: none; }
  .notch.tr .pill.act { width: 36px; padding: 0; }
  .pill.demo .sel { width: 132px; }
  .seg > a { min-width: 0; padding: 0 15px; }
  h1 { font-size: 25px; }
  .lead { font-size: 16px; }
  .lhead { gap: 14px; }
  .lhead .cover { width: 72px; }
  .lhead .cover span { font-size: 26px; }
  .actions .pill.primary { flex: 1; }
  .actions .grow { flex-basis: 100%; height: 0; }
  .pocket.fill { flex-basis: 56%; }
  .row { gap: 8px; }
  .fsel { flex: 1 1 100%; justify-content: space-between; }
  .fsel .sel { flex: 0 1 60%; }
  .chip.more { flex: 1 1 100%; justify-content: center; }
  .selects > .seg { flex: 1 1 100%; }
  .selects > .seg > label { flex: 1; min-width: 0; padding: 0 8px; }
  .thead { display: none; }
  .num.when { display: none; }
  .row.two.topic .title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .num { width: auto; min-width: 20px; }
  .post { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px 14px; }
  .post > .avatar { --s: 28px !important; position: absolute; top: 12px; left: 14px; }
  .post { position: relative; }
  .post .phead { padding-left: 38px; min-height: 28px; }
  .compose { flex-wrap: wrap; border-radius: var(--r); }
  .compose input { flex-basis: 100%; }
  .compose .pill.small { flex: 1; }
  .phero { align-items: flex-start; gap: 14px; }
  .phero > .avatar { --s: 52px !important; }
  .modbar { flex-wrap: wrap; padding: 8px 8px 8px 16px; }
  .modbar .pocket { flex: 1 1 100%; flex-wrap: wrap; background: none; padding: 0; margin-left: -8px; }
}

/* Screenshots on a listing page: one row you scroll sideways. */
.shots { display: flex; gap: var(--gap); overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 4px; scrollbar-width: thin; scrollbar-color: var(--group) transparent; border-radius: var(--r); }
.shots:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.shots a { flex: none; scroll-snap-align: start; border-radius: var(--r); overflow: hidden; background: var(--group); }
.shots img { display: block; height: 300px; width: auto; max-width: none; }
.shots.one a { flex: 1 1 auto; }
.shots.one img { width: 100%; height: auto; max-height: 460px; object-fit: cover; object-position: left top; }
@media (max-width: 560px) { .shots img { height: 200px; } }

/* API page and tokens: code you copy. */
.codebox { position: relative; border-radius: var(--r); background: var(--label); }
.code { margin: 0; padding: 16px 18px; padding-right: 96px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.6 ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace; letter-spacing: 0; color: var(--text); }
.codebox > .ghost { position: absolute; top: 8px; right: 8px; background: var(--group); }
.codebox > .ghost:hover { background: var(--group-hover); }
.secret { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r); background: var(--group); box-shadow: inset 0 0 0 1px var(--accent); }
.secret p { margin: 0 2px; font-size: 14px; color: var(--sec); }
.secret p b { color: var(--text); }
.secret .codebox { background: var(--bg); }
.go.num { font-size: 14px; font-weight: 700; color: var(--text); }
.title.mono { font: 600 14px/1.5 ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace; letter-spacing: 0; overflow-wrap: anywhere; }
.method { display: inline-block; min-width: 58px; margin-right: 6px; padding: 1px 8px; border-radius: 8px; background: var(--panel); color: var(--sec); font-size: 12px; text-align: center; }
.method.lock { color: var(--accent); }
.row > .ghost { flex: none; }
@media (max-width: 560px) {
  .code { padding-right: 18px; padding-bottom: 52px; }
  .codebox > .ghost { top: auto; bottom: 8px; }
}

/* The real site: account button top right, and the sign-in page. */
.pill.who { gap: 10px; padding: 0 18px; }
.pill.who:has(.avatar) { padding: 0 16px 0 8px; }
.pill.who span { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.row { width: 100%; text-align: left; cursor: pointer; }
#signin { display: flex; flex-direction: column; gap: 20px; }
#emailform .actions { margin-top: 8px; }
#emailform .err, #emailform .note { margin: 4px 16px; }
.note { font-size: 13px; color: var(--sec); }
.note.trust { display: flex; align-items: flex-start; gap: 8px; margin: 0 16px; }
.note.trust svg { flex: none; width: 15px; height: 15px; margin-top: 2px; color: var(--green); }
#signin button:disabled { opacity: 0.5; cursor: default; }
@media (max-width: 560px) {
  .pill.who:has(.avatar) { padding: 0 8px; }
  .pill.who:has(.avatar) span:not(.avatar) { display: none; }
}

/* Pictures in the listing form: thumbnails with a remove button, and a round button to add one. */
.row.tall { min-height: 76px; padding-top: 10px; padding-bottom: 10px; }
.pics { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; min-width: 0; }
.thumb { position: relative; flex: none; width: 84px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--group); }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 3px; right: 3px; display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 11px; background: rgba(0, 0, 0, 0.7); color: #fff; cursor: pointer; }
.thumb button:hover { background: #c4001a; }
.thumb button svg { width: 14px; height: 14px; }
.round.add { cursor: pointer; }
.pics.busy .round.add { opacity: 0.4; pointer-events: none; }
@media (max-width: 560px) { .row.tall { flex-wrap: wrap; } .pics { justify-content: flex-start; width: 100%; } }
