/* ---------- palette: warm-dark (default) ---------- */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14100e;
  --card: #1d1917;
  --card-hover: #231e1b;
  --line: #2c2825;
  --line-hi: #3d3733;
  --text: #ede8e1;
  --muted: #9c948b;
  --faint: #6b645c;
  --accent: #e0a45c;
  --accent-2: #d18a3f;
  --accent-soft: rgba(224,164,92,.12);
  --accent-ring: rgba(224,164,92,.20);
  --danger: #cf7362;
  --shadow: 0 20px 44px -22px rgba(0,0,0,.7);
  --ink-on-accent: #1a130a;
  --glow: rgba(224,164,92,.055);
  --grain-opacity: .05;
  --img-filter: saturate(.9) brightness(.9);
  --scrim: rgba(20,16,14,.82);
}

/* ---------- palette: warm-light (paper) ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3ebdc;
  --card: #fcf7ee;
  --card-hover: #fffdf6;
  --line: #e3d8c4;
  --line-hi: #d0c3aa;
  --text: #2c2620;
  --muted: #6d6455;
  --faint: #837a68;
  --accent: #a5641d;
  --accent-2: #8a531a;
  --accent-soft: rgba(173,111,39,.11);
  --accent-ring: rgba(173,111,39,.22);
  --danger: #b04f3c;
  --shadow: 0 22px 46px -26px rgba(74,54,24,.32);
  --ink-on-accent: #fdf7ec;
  --glow: rgba(173,111,39,.06);
  --grain-opacity: .045;
  --img-filter: saturate(.98) brightness(.99);
  --scrim: rgba(243,235,220,.84);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
::selection { background: var(--accent); color: var(--ink-on-accent); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-hi); border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

html { scrollbar-color: var(--line-hi) transparent; }
body {
  background: var(--bg);
  background-image: radial-gradient(115% 55% at 50% -12%, var(--glow), transparent 62%);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Newsreader", Georgia, serif;
  font-size: 15px; line-height: 1.55; font-weight: 400;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background-color .4s ease, color .4s ease;
}
/* paper grain — one faint fixed overlay that unifies the surface */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 9998; pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 140px 140px;
}
:root[data-theme="light"] body::before { mix-blend-mode: multiply; }

a { color: var(--muted); }
a:hover { color: var(--accent); }
button { font: inherit; color: inherit; }
main { max-width: 1240px; margin: 0 auto; padding: 0 28px 80px; position: relative; z-index: 1; }

/* type roles */
.u-display { font-family: "Fraunces", Georgia, "Times New Roman", serif; }
.u-mono { font-family: "Fragment Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }

/* one-time entrance */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- header / search ---------- */
header { padding: 60px 0 6px; }
.topline { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  animation: rise .55s cubic-bezier(.22,1,.36,1) both; }
.wordmark {
  font-family: "Fraunces", Georgia, serif; font-optical-sizing: auto;
  font-size: 27px; font-weight: 600; line-height: 1; letter-spacing: -.015em;
  color: var(--accent); user-select: none;
}
.wordmark::after {
  content: "the archive"; display: inline-block; margin-left: 12px;
  font-family: "Fragment Mono", ui-monospace, monospace; font-size: 9.5px;
  letter-spacing: .26em; text-transform: uppercase; color: var(--faint);
  vertical-align: middle;
}
.topright { display: flex; align-items: center; gap: 20px; }
.icon-btn {
  background: none; border: 1px solid var(--line); border-radius: 999px;
  width: 32px; height: 32px; display: grid; place-items: center;
  color: var(--muted); font-size: 14px; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s, transform .3s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent-ring); }
#theme-toggle:active { transform: rotate(-20deg); }
#help-toggle { font-family: "Fragment Mono", ui-monospace, monospace; font-size: 13px; }
@media (hover: none) { #help-toggle { display: none; } }

.search-wrap { position: relative; margin-top: 30px; }
header .search-wrap { animation: rise .55s cubic-bezier(.22,1,.36,1) both; animation-delay: .06s; }
#search, #ask-q {
  display: block; width: 100%;
  background: none; border: 0; outline: 0; color: var(--text);
  font-family: "Fraunces", Georgia, "Times New Roman", serif; font-optical-sizing: auto;
  font-size: clamp(26px, 4.6vw, 44px); font-weight: 340; letter-spacing: -.015em;
  padding: 8px 0 16px; caret-color: var(--accent);
}
#ask-q { font-size: clamp(23px, 3.6vw, 34px); }
#search::placeholder, #ask-q::placeholder { color: var(--faint); font-style: italic; transition: opacity .2s; }
#search:focus::placeholder, #ask-q:focus::placeholder { opacity: .55; }
#ask-q:focus-visible { outline: none; }
#search::-webkit-search-cancel-button { -webkit-appearance: none; }
.rail { height: 1px; background: var(--line); position: relative; overflow: visible; }
.rail::after {
  content: ""; position: absolute; inset: 0; height: 2px; top: -0.5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0); transform-origin: left;
  transition: transform .35s cubic-bezier(.22,1,.36,1);
}
.search-wrap:focus-within .rail::after { transform: scaleX(1); box-shadow: 0 0 14px var(--accent-ring); }

#meta {
  min-height: 24px; padding-top: 12px;
  font-family: "Fragment Mono", ui-monospace, monospace; font-size: 11.5px;
  color: var(--muted); letter-spacing: .02em;
  display: flex; align-items: center; gap: 14px;
  animation: rise .55s cubic-bezier(.22,1,.36,1) both; animation-delay: .12s;
}
#meta .hint { color: var(--faint); }
#meta .hint kbd, .keys kbd {
  font: 11px/1 "Fragment Mono", ui-monospace, Menlo, monospace;
  border: 1px solid var(--line-hi); border-radius: 4px; padding: 2px 5px;
  color: var(--muted); margin-right: 2px;
}
#meta .working { color: var(--faint); }
#meta .working::after {
  content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); margin-left: 8px; vertical-align: 1px;
  animation: pulse 1s ease-in-out infinite;
}

/* ---------- sticky mini bar ---------- */
#minibar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  transform: translateY(-100%); transition: transform .28s cubic-bezier(.22,1,.36,1);
}
body.scrolled #minibar { transform: none; }
body.ask-view #minibar, body.locked #minibar { transform: translateY(-100%); }
.minibar-inner {
  max-width: 1240px; margin: 0 auto; padding: 9px 28px;
  display: flex; align-items: center; gap: 16px;
}
.minibar-inner .wordmark { font-size: 17px; flex: none; }
.minibar-inner .wordmark::after { display: none; }
#mini-search {
  flex: 1; min-width: 0; background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px; outline: 0;
  font-family: "Fragment Mono", ui-monospace, monospace; font-size: 12.5px;
  padding: 8px 15px; transition: border-color .15s;
}
#mini-search:focus { border-color: var(--accent-ring); }
#mini-search::placeholder { color: var(--faint); }
#mini-search::-webkit-search-cancel-button { -webkit-appearance: none; }
#mini-top {
  flex: none; background: none; border: 0; cursor: pointer; color: var(--faint);
  font-family: "Fragment Mono", ui-monospace, monospace; font-size: 11.5px;
  padding: 4px 2px; transition: color .15s;
}
#mini-top:hover { color: var(--accent); }

/* ---------- tag bar ---------- */
#tagrow { display: flex; align-items: flex-start; gap: 10px; padding: 22px 0 0;
  animation: rise .55s cubic-bezier(.22,1,.36,1) both; animation-delay: .16s; }
#tagbar {
  display: flex; gap: 8px; flex: 1; min-width: 0;
  overflow-x: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
  mask-image: linear-gradient(90deg, #000 92%, transparent);
}
#tagbar::-webkit-scrollbar { display: none; }
#tagrow.expanded #tagbar { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; }
.chip {
  flex: none; background: none; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); font-family: "Fragment Mono", ui-monospace, monospace;
  font-size: 11.5px; padding: 5px 13px; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip.active { color: var(--ink-on-accent); background: var(--accent); border-color: var(--accent); }
.chip .n { opacity: .5; font-size: 10.5px; }
.chip.active .n { opacity: .7; }
.chip.active .x { font-size: 11px; line-height: 1; opacity: .75; }
/* the untagged filter reads as a state, not a topic — dashed, no fill */
.chip.chip-state { border-style: dashed; border-color: var(--line-hi); color: var(--faint); }
.chip.chip-state:hover { color: var(--text); border-color: var(--muted); }
.chip.chip-state.active {
  border-style: solid; color: var(--accent); background: var(--accent-soft);
  border-color: var(--accent-ring);
}
.chip.chip-state .n { opacity: .75; }
.chip.chip-trash { border-color: color-mix(in oklab, var(--danger) 45%, transparent); color: var(--faint); }
.chip.chip-trash.active { background: var(--danger); border-color: var(--danger); color: var(--ink-on-accent); }
.card.trashed { opacity: .72; }
.card.trashed:hover { opacity: 1; }
.actions button.restore { color: var(--accent); background: var(--accent-soft); }
.actions button.restore:hover { background: var(--accent-ring); }
#toast button {
  margin-left: 12px; background: var(--accent); color: var(--ink-on-accent); border: 0; border-radius: 6px;
  padding: 4px 10px; font: inherit; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
}
#tagmore {
  flex: none; background: none; border: 1px solid transparent; border-radius: 999px;
  color: var(--faint); font-family: "Fragment Mono", ui-monospace, monospace;
  font-size: 11.5px; padding: 5px 10px; cursor: pointer;
}
#tagmore:hover { color: var(--text); }

/* ---------- sort + layout tools (end of the tag row) ---------- */
#tools {
  flex: none; margin-left: auto; display: flex; align-items: center; gap: 8px;
  font-family: "Fragment Mono", ui-monospace, monospace; font-size: 11.5px; color: var(--faint);
}
.sort-wrap {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px; padding: 0 4px 0 12px; height: 28px;
  transition: border-color .15s, color .15s; cursor: pointer;
}
.sort-wrap:hover, .sort-wrap:focus-within { border-color: var(--muted); color: var(--muted); }
#sort {
  appearance: none; -webkit-appearance: none; background: none; border: 0; outline: 0;
  color: var(--muted); font: inherit; padding: 0 18px 0 0; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 11px) 50%, calc(100% - 7px) 50%;
  background-size: 4px 4px, 4px 4px; background-repeat: no-repeat;
}
#sort option { background: var(--card); color: var(--text); }
#layout { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; height: 28px; }
#layout button {
  border: 0; background: none; color: var(--faint); cursor: pointer;
  width: 30px; font-size: 12px; line-height: 1; transition: color .15s, background .15s;
}
#layout button + button { border-left: 1px solid var(--line); }
#layout button:hover { color: var(--text); }
#layout button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }

/* ---------- retag banner ---------- */
#retag-banner {
  display: none; margin: 16px 0 0; padding: 12px 16px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--card);
  align-items: center; gap: 14px;
  font-family: "Fragment Mono", ui-monospace, monospace; font-size: 11.5px;
  color: var(--muted);
}
#retag-banner.on { display: flex; }
#retag-banner .grow { flex: 1; min-width: 0; }
#retag-banner .label { display: block; }
#retag-banner .label b { color: var(--text); font-weight: 400; }
#retag-banner .track {
  display: none; height: 3px; margin-top: 9px; border-radius: 2px;
  background: var(--line); overflow: hidden;
}
#retag-banner.running .track { display: block; }
#retag-banner .bar {
  height: 100%; width: 0; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .3s cubic-bezier(.22,1,.36,1);
}
#retag-banner button {
  flex: none; border: 1px solid var(--line-hi); background: none; border-radius: 7px;
  color: var(--muted); font-family: inherit; font-size: 11.5px;
  padding: 5px 12px; cursor: pointer; transition: color .15s, background .15s, border-color .15s;
}
#retag-banner button.go { color: var(--accent); border-color: var(--accent-ring); }
#retag-banner button.go:hover { background: var(--accent-soft); }
#retag-banner button:hover { color: var(--text); }
#retag-banner .dismiss { border-color: transparent; padding: 5px 8px; }

/* ---------- grid / cards ---------- */
#grid {
  display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr));
  column-gap: 20px; align-items: start; padding-top: 40px;
}
#grid .col { min-width: 0; }
.card {
  margin-bottom: 20px; position: relative;
  background: var(--card); border: 1px solid var(--line); border-radius: 13px;
  overflow: hidden; cursor: pointer;
  transition: background .2s, border-color .2s, transform .25s cubic-bezier(.22,1,.36,1), box-shadow .25s;
  animation: card-in .45s cubic-bezier(.22,1,.36,1) both;
  animation-delay: calc(var(--i, 0) * 35ms);
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
/* accent hairline on hover */
.card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; z-index: 3;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0; transition: opacity .25s;
}
.card:hover::before, .card.cursor::before { opacity: .95; }
.card:hover, .card.cursor {
  background: var(--card-hover); border-color: var(--line-hi);
  transform: translateY(-3px); box-shadow: var(--shadow);
}
.card.cursor { border-color: var(--accent-ring); }
/* just-saved / just-updated pulse */
@keyframes flash-ring {
  0%   { box-shadow: 0 0 0 0 var(--accent-ring), var(--shadow); border-color: var(--accent); }
  100% { box-shadow: 0 0 0 14px transparent, var(--shadow); border-color: var(--line); }
}
.card.flash { animation: flash-ring 1.1s cubic-bezier(.22,1,.36,1) both; }

/* fixed-ratio shell so masonry columns don't reflow while images decode */
.thumb {
  position: relative; display: block; width: 100%; aspect-ratio: 1.91 / 1;
  background: var(--line); overflow: hidden;
}
/* until the picture arrives the shell shimmers, so it reads as loading rather
   than as a broken image (see THUMB_TIMEOUT in app.js for the give-up path) */
.thumb:not(:has(img.ready)) {
  background: linear-gradient(90deg, var(--line) 25%, var(--line-hi) 45%, var(--line) 65%);
  background-size: 220% 100%; animation: shimmer 1.6s linear infinite;
}
.card img {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  object-fit: cover; opacity: 0;
  filter: var(--img-filter); transition: filter .3s, opacity .35s ease;
}
.card img.ready { opacity: 1; }
.card:hover img { filter: none; }
.card-body { padding: 17px 18px 17px; }
.mono {
  width: 38px; height: 38px; border-radius: 10px; margin-bottom: 14px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: "Fraunces", Georgia, serif; font-optical-sizing: auto;
  font-size: 19px; font-weight: 600; text-transform: uppercase; user-select: none;
  box-shadow: inset 0 0 0 1px var(--accent-ring);
}
.card:has(.thumb) .mono { display: none; }
.card h2 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif; font-optical-sizing: auto;
  font-size: 16.5px; font-weight: 560; line-height: 1.28; letter-spacing: -.008em;
}
.card:not(:has(.thumb)) h2 { font-size: 18.5px; }
/* a post's own words as the headline: lighter, longer, clamped */
.card h2.post {
  font-size: 15.5px; font-weight: 470; line-height: 1.42; letter-spacing: 0;
  display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden;
  text-wrap: pretty;
}
.card:not(:has(.thumb)) h2.post { font-size: 16.5px; }
.card h2 a { color: inherit; text-decoration: none; }
.card h2 a:hover { color: var(--accent); }
.card mark {
  background: var(--accent-soft); color: inherit;
  border-radius: 3px; padding: 0 2px; box-shadow: inset 0 -1px 0 var(--accent-ring);
}
.domain {
  font-family: "Fragment Mono", ui-monospace, monospace;
  font-size: 10px; color: var(--faint); margin-top: 8px;
  letter-spacing: .1em; text-transform: uppercase;
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.domain .site { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
/* author byline on posts: name in text case, handle in mono */
.domain .by { text-transform: none; letter-spacing: .02em; font-size: 11px; }
.domain .by .who { font-family: "Newsreader", Georgia, serif; font-size: 13px; color: var(--muted); }
.card-date { flex: none; text-transform: none; letter-spacing: .04em; color: var(--faint); opacity: .8; }
/* untagged marker: reads as "not processed yet", not "summary missing" */
.pending-dot {
  flex: none; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); opacity: .55; align-self: center;
}
/* AI call in flight for this card */
.tagging {
  flex: none; text-transform: none; letter-spacing: .02em; color: var(--accent);
  opacity: .8; animation: tagging-pulse 1.4s ease-in-out infinite;
}
@keyframes tagging-pulse { 0%, 100% { opacity: .8; } 50% { opacity: .35; } }
.summary {
  font-family: "Newsreader", Georgia, serif;
  font-size: 14px; line-height: 1.5; color: var(--muted); margin-top: 11px;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
  text-wrap: pretty;
}
.card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 13px; }
.card-tags:empty { display: none; }
.card-tags button {
  font-family: "Fragment Mono", ui-monospace, monospace;
  font-size: 10.5px; color: var(--muted); background: var(--bg); border: 0;
  border-radius: 5px; padding: 3px 8px; cursor: pointer; transition: color .15s, background .15s;
}
.card-tags button::before { content: "#"; opacity: .4; }
.card-tags button:hover { color: var(--accent); background: var(--accent-soft); }

.actions {
  position: absolute; top: 9px; right: 9px; display: flex; gap: 4px;
  opacity: 0; transition: opacity .15s; z-index: 4;
}
.card:hover .actions, .card:focus-within .actions, .card.cursor .actions { opacity: 1; }
@media (hover: none) { .actions { opacity: 1; } }
.actions button {
  border: 0; border-radius: 8px; cursor: pointer;
  background: color-mix(in srgb, var(--bg) 82%, transparent); color: var(--muted);
  font-family: "Fragment Mono", ui-monospace, monospace; font-size: 12px; line-height: 1;
  padding: 7px 9px; backdrop-filter: blur(6px); transition: color .15s, background .15s;
}
.actions button:hover { color: var(--text); background: color-mix(in srgb, var(--bg) 94%, transparent); }
.actions button.retag { color: var(--accent); background: var(--accent-soft); }
.actions button.retag:hover { background: var(--accent-ring); color: var(--accent); }
.actions button.del:hover { color: var(--danger); }

/* inline delete confirm */
.confirm {
  position: absolute; inset: auto 0 0 0; padding: 12px 16px;
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(7px);
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text);
  animation: card-in .2s ease both; z-index: 5;
}
.confirm span { flex: 1; }
.confirm button {
  border: 1px solid var(--line-hi); background: none; border-radius: 7px;
  color: var(--muted); font-family: "Fragment Mono", ui-monospace, monospace;
  font-size: 11.5px; padding: 5px 12px; cursor: pointer;
}
.confirm button.yes { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.confirm button.yes:hover { background: color-mix(in srgb, var(--danger) 14%, transparent); }
.confirm button:hover { color: var(--text); }

/* ---------- inline tag editor (token input + suggestions) ---------- */
.tag-editor { margin-top: 13px; animation: card-in .2s ease both; position: relative; }
.tag-editor .field {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  background: var(--bg); border: 1px solid var(--line-hi); border-radius: 8px; padding: 6px 7px;
  transition: border-color .15s;
}
.tag-editor .field:focus-within { border-color: var(--accent); }
.tag-editor .pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--accent-soft); color: var(--accent); border: 0; border-radius: 5px;
  font-family: "Fragment Mono", ui-monospace, monospace; font-size: 10.5px;
  padding: 3px 6px 3px 8px; cursor: default;
}
.tag-editor .pill b { font-weight: 400; }
.tag-editor .pill button {
  border: 0; background: none; color: inherit; cursor: pointer; padding: 0 1px;
  font-size: 11px; line-height: 1; opacity: .65; transition: opacity .15s;
}
.tag-editor .pill button:hover { opacity: 1; }
.tag-editor input {
  flex: 1; min-width: 90px; background: none; border: 0; outline: 0; color: var(--text);
  font-family: "Fragment Mono", ui-monospace, monospace; font-size: 12px; padding: 3px 2px;
}
.tag-editor .row { display: flex; gap: 6px; margin-top: 7px; align-items: center; }
.tag-editor .row .spacer { flex: 1; }
.tag-editor .row .tip {
  font-family: "Fragment Mono", ui-monospace, monospace; font-size: 10px; color: var(--faint);
}
.tag-editor .row button {
  border: 1px solid var(--line-hi); background: none; border-radius: 7px;
  color: var(--muted); font-family: "Fragment Mono", ui-monospace, monospace;
  font-size: 11.5px; padding: 5px 10px; cursor: pointer;
}
.tag-editor .row button.save { color: var(--accent); border-color: var(--accent-ring); }
.tag-editor .row button.save:hover { background: var(--accent-soft); }
.tag-editor .row button:hover { color: var(--text); }
.suggest {
  margin-top: 6px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); overflow: hidden; max-height: 168px; overflow-y: auto;
}
.suggest:empty { display: none; }
.suggest button {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px;
  background: none; border: 0; cursor: pointer; text-align: left;
  font-family: "Fragment Mono", ui-monospace, monospace; font-size: 11.5px;
  color: var(--muted); padding: 7px 11px;
}
.suggest button .n { color: var(--faint); font-size: 10.5px; }
.suggest button.on, .suggest button:hover { background: var(--accent-soft); color: var(--accent); }
.suggest button.new { color: var(--faint); font-style: italic; }
.suggest button.new.on { color: var(--accent); }

/* skeleton (optimistic save) */
.card.skel { pointer-events: none; cursor: default; }
.card.skel .sk {
  background: linear-gradient(90deg, var(--line) 25%, var(--line-hi) 45%, var(--line) 65%);
  background-size: 220% 100%; animation: shimmer 1.3s linear infinite; border-radius: 6px;
}
@keyframes shimmer { from { background-position: 130% 0; } to { background-position: -90% 0; } }
.card.skel .sk-img { height: 120px; border-radius: 0; }
.card.skel .sk-t1 { height: 14px; width: 80%; margin-bottom: 9px; }
.card.skel .sk-t2 { height: 10px; width: 45%; }
.card.skel .sk-host {
  font-family: "Fragment Mono", ui-monospace, monospace; font-size: 10px;
  color: var(--faint); letter-spacing: .1em; text-transform: uppercase; margin-top: 12px;
  display: flex; justify-content: space-between; gap: 8px;
}
.card.skel .sk-host em { font-style: normal; opacity: .7; }

/* ---------- empty / error / states ---------- */
#empty, #error { display: none; padding: 72px 0; text-align: center; color: var(--faint); font-size: 14px; }
#empty .big, #error .big {
  font-family: "Fraunces", Georgia, serif; font-size: 22px; font-weight: 400;
  font-style: italic; color: var(--muted); margin-bottom: 10px; letter-spacing: -.01em;
}
#empty a { font-family: "Fragment Mono", ui-monospace, monospace; font-size: 12px;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
#error .big { color: var(--danger); font-style: normal; }
#error button {
  margin-top: 14px; border: 1px solid var(--line-hi); background: none; border-radius: 8px;
  color: var(--muted); font-family: "Fragment Mono", ui-monospace, monospace;
  font-size: 12px; padding: 7px 16px; cursor: pointer; transition: color .15s, border-color .15s;
}
#error button:hover { color: var(--accent); border-color: var(--accent-ring); }
#error .detail { font-family: "Fragment Mono", ui-monospace, monospace; font-size: 11px; opacity: .7; }
#sentinel { height: 1px; }
#loader { display: none; justify-content: center; gap: 7px; padding: 26px 0 8px; }
#loader.on { display: flex; }
#loader i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--faint);
  animation: pulse 1s ease-in-out infinite;
}
#loader i:nth-child(2) { animation-delay: .15s; }
#loader i:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 100% { opacity: .3; transform: none; } 50% { opacity: 1; transform: translateY(-3px); } }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px);
  background: var(--card); border: 1px solid var(--line-hi); border-radius: 999px;
  color: var(--text); font-family: "Fragment Mono", ui-monospace, monospace; font-size: 12.5px;
  padding: 10px 18px; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s cubic-bezier(.22,1,.36,1);
  max-width: min(90vw, 480px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  z-index: 30;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; } /* the undo button must be clickable */
#toast::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); margin-right: 9px; vertical-align: 1.5px;
}
#toast.error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
#toast.error::before { background: var(--danger); }

/* ---------- footer ---------- */
footer {
  margin-top: 76px; padding-top: 24px; border-top: 1px solid var(--line);
  font-family: "Fragment Mono", ui-monospace, monospace; font-size: 12px; color: var(--faint);
  letter-spacing: .01em;
}
footer a { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
#bml-box { display: none; margin-top: 14px; }
#bml-box p { margin-bottom: 8px; font-family: "Newsreader", Georgia, serif; font-size: 13px; color: var(--muted); }
#bml {
  width: 100%; font: 12px/1.5 "Fragment Mono", ui-monospace, Menlo, monospace;
  color: var(--muted); background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 12px; word-break: break-all; user-select: all;
}

/* ---------- views nav ---------- */
#views { display: flex; gap: 18px; }
#views button {
  background: none; border: 0; cursor: pointer; padding: 0;
  font-family: "Fragment Mono", ui-monospace, monospace;
  font-size: 11.5px; letter-spacing: .1em; text-transform: lowercase;
  color: var(--faint); transition: color .15s; position: relative;
}
#views button:hover { color: var(--text); }
#views button.active { color: var(--accent); }
#views button.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 1px;
  background: var(--accent);
}

/* ---------- ask view ---------- */
#ask { display: none; }
body.ask-view #ask { display: block; }
body.ask-view header .search-wrap, body.ask-view #meta, body.ask-view #tagrow,
body.ask-view #grid, body.ask-view #loader, body.ask-view #empty, body.ask-view #error,
body.ask-view #retag-banner, body.ask-view #sentinel { display: none !important; }

#ask .search-wrap { margin-top: 30px; }
#ask-status {
  min-height: 24px; padding-top: 12px;
  font-family: "Fragment Mono", ui-monospace, monospace; font-size: 11.5px;
  color: var(--muted); letter-spacing: .02em;
  display: flex; align-items: center; gap: 12px;
}
#ask-status .stage:not(:empty)::after {
  content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); margin-left: 8px; vertical-align: 2px;
  animation: pulse 1s ease-in-out infinite;
}
#ask-status button {
  border: 1px solid var(--line-hi); background: none; border-radius: 7px;
  color: var(--muted); font-family: inherit; font-size: 11px;
  padding: 4px 11px; cursor: pointer; transition: color .15s, border-color .15s;
}
#ask-status button:hover { color: var(--accent); border-color: var(--accent-ring); }
#ask-sources { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px 0 4px; }
#ask-sources:empty, #ask-answer:empty { padding: 0; }
a.chip { text-decoration: none; }
#ask-sources .chip .n { color: var(--accent); opacity: 1; }
#ask-answer {
  max-width: 720px; padding: 18px 0 40px;
  font-family: "Newsreader", Georgia, serif; font-size: 17px; line-height: 1.72;
}
#ask-answer h2 {
  font-family: "Fraunces", Georgia, serif; font-optical-sizing: auto;
  font-size: 22px; font-weight: 560; letter-spacing: -.012em; margin: 28px 0 10px;
}
#ask-answer h3 {
  font-family: "Fraunces", Georgia, serif; font-optical-sizing: auto;
  font-size: 17px; font-weight: 560; margin: 22px 0 8px;
}
#ask-answer p { margin: 0 0 15px; }
#ask-answer ul, #ask-answer ol { margin: 0 0 15px 22px; }
#ask-answer li { margin-bottom: 7px; }
#ask-answer code {
  font: 13px "Fragment Mono", ui-monospace, Menlo, monospace;
  background: var(--card); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px;
}
#ask-answer a.cite {
  font-family: "Fragment Mono", ui-monospace, monospace;
  font-size: 11px; line-height: 1; vertical-align: super;
  color: var(--accent); background: var(--accent-soft); border-radius: 4px;
  padding: 1px 5px; margin: 0 1px; text-decoration: none;
}
#ask-answer a.cite:hover { background: var(--accent-ring); }
#ask-answer.streaming::after { content: "▍"; color: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.ask-empty { color: var(--faint); font-style: italic; }

/* ---------- ask history ---------- */
#ask-history { max-width: 720px; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
#ask-history[hidden] { display: none; }
#ask-history .hd {
  display: flex; align-items: baseline; justify-content: space-between;
  font-family: "Fragment Mono", ui-monospace, monospace; font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 6px;
}
#ask-history .hd button {
  border: 0; background: none; color: var(--faint); font: inherit; letter-spacing: .06em; text-transform: none;
  cursor: pointer; padding: 2px 0;
}
#ask-history .hd button:hover { color: var(--danger); }
#ask-history ul { list-style: none; }
#ask-history li {
  display: flex; align-items: baseline; gap: 12px; padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}
#ask-history li:last-child { border-bottom: 0; }
#ask-history .q {
  flex: 1; min-width: 0; text-align: left; border: 0; background: none; cursor: pointer; padding: 2px 0;
  font-family: "Newsreader", Georgia, serif; font-size: 15.5px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .15s;
}
#ask-history .q:hover { color: var(--accent); }
#ask-history .when { flex: none; font-family: "Fragment Mono", ui-monospace, monospace; font-size: 10.5px; color: var(--faint); }
#ask-history .rm {
  flex: none; border: 0; background: none; color: var(--faint); cursor: pointer; font-size: 11px; padding: 2px 4px;
  opacity: 0; transition: opacity .15s, color .15s;
}
#ask-history li:hover .rm, #ask-history .rm:focus-visible { opacity: 1; }
#ask-history .rm:hover { color: var(--danger); }
@media (hover: none) { #ask-history .rm { opacity: 1; } }
#ask-sources .chip[data-id] { cursor: pointer; }

/* ---------- reader: side panel ---------- */
#reader-scrim {
  position: fixed; inset: 0; z-index: 30; background: var(--scrim); opacity: 0;
  pointer-events: none; transition: opacity .25s;
}
body.reading #reader-scrim { opacity: .6; pointer-events: auto; }
#reader {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 31;
  width: min(680px, 100%); background: var(--card); border-left: 1px solid var(--line-hi);
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  animation: reader-in .3s cubic-bezier(.22,1,.36,1) both;
}
#reader[hidden] { display: none; }
@keyframes reader-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.reader-bar {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px 12px 28px;
  border-bottom: 1px solid var(--line);
  font-family: "Fragment Mono", ui-monospace, monospace; font-size: 11px; color: var(--faint);
  letter-spacing: .08em; text-transform: uppercase;
}
.reader-bar .spacer { flex: 1; }
.reader-by { text-transform: none; letter-spacing: .02em; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-by .who { font-family: "Newsreader", Georgia, serif; font-size: 14px; color: var(--text); }
.reader-date { text-transform: none; letter-spacing: .04em; flex: none; }
.reader-open { flex: none; text-decoration: none; color: var(--accent); letter-spacing: .04em; text-transform: none; padding: 4px 2px; }
.reader-open:hover { text-decoration: underline; }
.reader-close { flex: none; width: 28px; height: 28px; font-size: 12px; }
.reader-scroll { flex: 1; overflow-y: auto; padding: 24px 32px 40px 28px; overscroll-behavior: contain; }
.reader-thumb:empty { display: none; }
.reader-thumb img { display: block; width: 100%; max-height: 260px; object-fit: cover; border-radius: 10px; margin-bottom: 20px; border: 1px solid var(--line); }
#reader h1 {
  font-family: "Fraunces", Georgia, serif; font-optical-sizing: auto;
  font-size: 26px; font-weight: 560; line-height: 1.22; letter-spacing: -.012em; text-wrap: pretty;
}
#reader h1.post { font-size: 20px; font-weight: 460; line-height: 1.45; letter-spacing: 0; }
.reader-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.reader-tags .chip::before { content: "#"; opacity: .45; margin-right: 1px; }
.reader-tags .chip-edit { border-style: dashed; color: var(--faint); }
.reader-tags .chip-edit::before { content: none; }
.reader-notes { display: block; margin-top: 22px; }
.reader-notes .lbl {
  display: flex; gap: 10px; align-items: baseline;
  font-family: "Fragment Mono", ui-monospace, monospace; font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 7px;
}
.reader-notes .state { font-style: normal; letter-spacing: .04em; text-transform: none; color: var(--accent); }
.reader-notes textarea {
  display: block; width: 100%; resize: none; min-height: 58px;
  background: var(--bg); color: var(--text); border: 1px solid var(--line-hi); border-radius: 9px;
  padding: 10px 12px; outline: 0; font-family: "Newsreader", Georgia, serif; font-size: 15.5px; line-height: 1.5;
  transition: border-color .15s;
}
.reader-notes textarea:focus { border-color: var(--accent); }
.reader-notes textarea::placeholder { color: var(--faint); font-style: italic; }
.reader-summary {
  margin-top: 22px; padding-left: 14px; border-left: 2px solid var(--accent-ring);
  color: var(--muted); font-style: italic; font-size: 15px; line-height: 1.55; text-wrap: pretty;
}
.reader-summary[hidden] { display: none; }
.reader-related { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.reader-related[hidden] { display: none; }
.reader-related .lbl {
  display: block; font-family: "Fragment Mono", ui-monospace, monospace; font-size: 10.5px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px;
}
.related-list { display: flex; flex-direction: column; gap: 2px; margin: 0 -10px; }
.related-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%;
  text-align: left; padding: 8px 10px; border: 1px solid transparent; border-radius: 9px;
  background: none; color: var(--text); cursor: pointer; font: inherit;
}
.related-item:hover { background: var(--accent-soft); border-color: var(--accent-ring); }
.related-item .rt { font-family: "Newsreader", Georgia, serif; font-size: 15px; line-height: 1.35; text-wrap: pretty; }
.related-item .rd { font-family: "Fragment Mono", ui-monospace, monospace; font-size: 10.5px; letter-spacing: .06em; color: var(--faint); }
.reader-body { margin-top: 22px; font-size: 16.5px; line-height: 1.68; max-width: 62ch; }
.reader-body p { margin: 0 0 14px; text-wrap: pretty; }
.reader-body .none { color: var(--faint); font-style: italic; }
.reader-hint {
  flex: none; padding: 9px 28px; border-top: 1px solid var(--line);
  font-family: "Fragment Mono", ui-monospace, monospace; font-size: 10.5px; color: var(--faint); letter-spacing: .02em;
}
.reader-hint kbd { font: 10px/1 "Fragment Mono", ui-monospace, monospace; border: 1px solid var(--line-hi); border-radius: 4px; padding: 2px 4px; margin-right: 2px; }
@media (hover: none) { .reader-hint { display: none; } }
@media (max-width: 640px) {
  #reader { width: 100%; border-left: 0; }
  .reader-scroll { padding: 18px 18px 32px; }
  .reader-bar { padding: 12px 12px 10px 18px; }
}

/* your own note on the card */
.card .note {
  margin-top: 10px; padding-left: 10px; border-left: 2px solid var(--accent-ring);
  font-family: "Newsreader", Georgia, serif; font-size: 13.5px; line-height: 1.45; color: var(--text);
  font-style: italic; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
body.list-layout .card .note { display: none; }

/* ---------- overlays: unlock + shortcuts ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 40; display: none;
  background: var(--scrim); backdrop-filter: blur(9px);
  align-items: center; justify-content: center; padding: 24px;
}
.overlay.on { display: flex; animation: card-in .25s ease both; }
.panel {
  width: 100%; max-width: 430px; background: var(--card);
  border: 1px solid var(--line-hi); border-radius: 16px; box-shadow: var(--shadow);
  padding: 32px 30px 26px;
}
.panel .wordmark { font-size: 22px; }
.panel .wordmark::after { display: none; }
.panel .lede {
  margin-top: 10px; color: var(--muted); font-size: 14px; text-wrap: pretty;
}
#unlock-form { margin-top: 22px; }
/* tag manager */
#tagman-list { margin-top: 18px; max-height: min(52vh, 460px); overflow-y: auto; margin-left: -8px; margin-right: -8px; }
.tm-row {
  display: flex; align-items: center; gap: 8px; padding: 3px 8px; border-radius: 8px;
}
.tm-row:hover { background: var(--accent-soft); }
.tm-name {
  flex: 1; min-width: 0; background: none; border: 1px solid transparent; border-radius: 6px;
  color: var(--text); font: inherit; font-size: 14px; padding: 5px 8px; outline: 0;
}
.tm-name:hover { border-color: var(--line-hi); }
.tm-name:focus { border-color: var(--accent); background: var(--bg); }
.tm-row .n { font-family: "Fragment Mono", ui-monospace, monospace; font-size: 11px; color: var(--faint); min-width: 2.5ch; text-align: right; }
.tm-del {
  background: none; border: 0; color: var(--faint); cursor: pointer; font: inherit; font-size: 12px;
  padding: 4px 8px; border-radius: 6px; min-width: 44px;
}
.tm-del:hover { color: var(--danger); background: var(--bg); }
.tm-row.confirm .tm-del { color: var(--danger); font-family: "Fragment Mono", ui-monospace, monospace; font-size: 11px; }
.tm-empty { color: var(--faint); font-style: italic; padding: 8px; font-family: "Newsreader", Georgia, serif; }
#tagman-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; font-family: "Fragment Mono", ui-monospace, monospace; font-size: 11.5px; }
#tagman-msg { flex: 1; min-width: 0; color: var(--accent); }
#tagman-close {
  background: var(--accent-soft); color: var(--accent); border: 0; border-radius: 8px; padding: 8px 14px;
  font: inherit; font-size: 12px; cursor: pointer;
}
#tagman-close:hover { background: var(--accent-ring); }
#unlock-input {
  display: block; width: 100%; background: none; border: 0; outline: 0; color: var(--text);
  font-family: "Fraunces", Georgia, serif; font-optical-sizing: auto;
  font-size: 24px; font-weight: 340; letter-spacing: -.01em;
  padding: 4px 0 12px; caret-color: var(--accent);
}
#unlock-input::placeholder { color: var(--faint); font-style: italic; }
#unlock-row {
  display: flex; align-items: center; gap: 12px; margin-top: 14px;
  font-family: "Fragment Mono", ui-monospace, monospace; font-size: 11.5px;
}
#unlock-msg { flex: 1; min-width: 0; color: var(--faint); }
#unlock-msg.bad { color: var(--danger); }
#unlock-form button {
  flex: none; border: 1px solid var(--accent-ring); background: var(--accent-soft);
  border-radius: 8px; color: var(--accent); font-family: inherit; font-size: 11.5px;
  padding: 7px 16px; cursor: pointer; transition: background .15s;
}
#unlock-form button:hover { background: var(--accent-ring); }
#unlock-form button[disabled] { opacity: .5; cursor: default; }

.panel h2 {
  font-family: "Fraunces", Georgia, serif; font-optical-sizing: auto;
  font-size: 19px; font-weight: 560; letter-spacing: -.01em;
}
.keys { margin-top: 18px; display: grid; gap: 9px; }
.keys div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.keys .what {
  font-family: "Fragment Mono", ui-monospace, monospace; font-size: 11.5px; color: var(--muted);
}
.keys .combo { flex: none; }
#help-close {
  margin-top: 24px; width: 100%; border: 1px solid var(--line-hi); background: none;
  border-radius: 8px; color: var(--muted); font-family: "Fragment Mono", ui-monospace, monospace;
  font-size: 11.5px; padding: 8px; cursor: pointer;
}
#help-close:hover { color: var(--text); }

/* ---------- a11y / responsive ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
#search:focus-visible, #ask-q:focus-visible, #unlock-input:focus-visible { outline: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
body.locked { overflow: hidden; }
/* ---------- list layout: one dense row per card ---------- */
body.list-layout #grid { padding-top: 26px; }
body.list-layout .card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 6px;
  border-radius: 9px; padding: 0 8px 0 0;
}
body.list-layout .card:hover, body.list-layout .card.cursor { transform: none; box-shadow: none; }
body.list-layout .card::before { display: none; }
body.list-layout .thumb { display: none; }
body.list-layout .card:has(.thumb) .mono { display: flex; }
body.list-layout .card-body {
  flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
  padding: 9px 0 9px 12px;
}
body.list-layout .mono {
  width: 26px; height: 26px; border-radius: 7px; margin: 0; font-size: 13px; flex: none;
}
body.list-layout .card h2, body.list-layout .card:not(:has(.thumb)) h2, body.list-layout .card h2.post {
  flex: 1 1 260px; min-width: 0; font-size: 14.5px; font-weight: 500; line-height: 1.35;
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.list-layout .domain { margin: 0; flex: none; gap: 10px; max-width: 34%; order: 3; }
body.list-layout .domain .by .who { font-size: 12.5px; }
body.list-layout .summary { display: none; }
body.list-layout .card-tags { margin: 0; flex: none; gap: 4px; order: 2; max-width: 40%; overflow: hidden; flex-wrap: nowrap; }
body.list-layout .card-tags button { padding: 2px 6px; font-size: 10px; white-space: nowrap; }
body.list-layout .actions { position: static; flex: none; opacity: 0; align-self: flex-start; margin-top: 10px; }
body.list-layout .card:hover .actions, body.list-layout .card:focus-within .actions,
body.list-layout .card.cursor .actions { opacity: 1; }
body.list-layout .tag-editor { flex-basis: 100%; order: 5; margin: 4px 0 2px; }
body.list-layout .confirm { position: static; flex-basis: 100%; order: 6; border-top: 0; padding: 4px 0 8px; background: none; backdrop-filter: none; }
@media (max-width: 640px) {
  body.list-layout .card-tags, body.list-layout .domain .by .who { display: none; }
  body.list-layout .domain { max-width: 30%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  #minibar { transition: none; }
}
@media (max-width: 640px) {
  main { padding: 0 16px 60px; }
  header { padding-top: 38px; }
  .wordmark::after { display: none; }
  #grid { padding-top: 30px; }
  .minibar-inner { padding: 8px 16px; gap: 12px; }
  .minibar-inner .wordmark { display: none; }
  #tagrow { flex-wrap: wrap; }
  #tools { flex-basis: 100%; justify-content: flex-end; margin-top: 2px; }
  #retag-banner { flex-wrap: wrap; }
  #retag-banner .grow { flex-basis: 100%; }
  .actions { gap: 6px; }
  .actions button { padding: 10px 11px; font-size: 13px; }
  .panel { padding: 26px 22px 22px; }
}
