:root,
html[data-theme="dark"] {
  --ink: #1a1610;
  --ink-soft: #4a4336;
  --paper: #f3ead4;
  --paper-2: #e7dcc4;
  --paper-edge: rgba(26, 22, 16, 0.08);
  --copper: #d46a28;
  --copper-2: #e8a15a;
  --copper-soft: rgba(212, 106, 40, 0.16);
  --sage: #6e8b5c;
  --sage-soft: rgba(110, 139, 92, 0.18);
  --forest: #1b4d2e;
  --forest-ink: #f4f7f2;
  --tick-miss: #9a2a12;
  --tick-miss-ink: #fff6f1;
  --rust: #8d3b28;
  --rule: rgba(212, 106, 40, 0.32);
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.38);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.22);
  --page: #0c100e;
  --glow-a: #1c2a1e;
  --glow-b: #3a2214;
  --fg: #f3ead4;
  --muted: #cfc6b0;
  --muted-2: #b3aa94;
  --footer: #9a927e;
  --error: #f0b4a4;
  --placeholder: #8f836d;
  --chip-hover: #ddd1b6;
  --origin-muted: #7a6f5c;
  --hairline: rgba(26, 22, 16, 0.16);
  --map-border: rgba(26, 22, 16, 0.12);
  --grid-line: rgba(243, 234, 212, 0.07);
  --grain-opacity: 0.09;
  --rail: rgba(243, 234, 212, 0.06);
  --rail-line: rgba(232, 161, 90, 0.35);
  --display: "Cormorant Garamond", "Iowan Old Style", Palatino, serif;
  --sans: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", ui-monospace, Menlo, monospace;
  --radius: 18px;
  --radius-sm: 10px;
}

html[data-theme="light"] {
  --ink: #1a1610;
  --ink-soft: #5a5144;
  --paper: #fffaf0;
  --paper-2: #f3e8d4;
  --paper-edge: rgba(26, 22, 16, 0.08);
  --copper: #c45a1a;
  --copper-2: #a34712;
  --copper-soft: rgba(196, 90, 26, 0.12);
  --sage: #5d754c;
  --sage-soft: rgba(93, 117, 76, 0.14);
  --forest: #14532d;
  --forest-ink: #f4f7f2;
  --tick-miss: #9f2d12;
  --tick-miss-ink: #fff6f1;
  --rust: #8d3b28;
  --rule: rgba(196, 90, 26, 0.24);
  --shadow: 0 16px 40px rgba(40, 30, 16, 0.10);
  --shadow-soft: 0 8px 22px rgba(40, 30, 16, 0.07);
  --page: #f4ecda;
  --glow-a: #efe4cc;
  --glow-b: #ead6c0;
  --fg: #1a1610;
  --muted: #5c5346;
  --muted-2: #6a6154;
  --footer: #6a6154;
  --error: #8d3b28;
  --placeholder: #8a7d68;
  --chip-hover: #e4d4b6;
  --origin-muted: #7a6f5c;
  --hairline: rgba(26, 22, 16, 0.14);
  --map-border: rgba(26, 22, 16, 0.12);
  --grid-line: rgba(26, 22, 16, 0.035);
  --grain-opacity: 0.045;
  --rail: #fffaf0;
  --rail-line: rgba(196, 90, 26, 0.28);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--page); color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

body {
  min-height: 100dvh;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  padding:
    env(safe-area-inset-top)
    env(safe-area-inset-right)
    env(safe-area-inset-bottom)
    env(safe-area-inset-left);
  background:
    radial-gradient(1100px 560px at 8% -12%, var(--glow-a) 0%, transparent 58%),
    radial-gradient(720px 480px at 108% 6%, var(--glow-b) 0%, transparent 52%),
    var(--page);
}

.grain, .wash {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
}
.grain {
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.wash {
  opacity: 0.28;
  background:
    linear-gradient(180deg, transparent 0%, var(--page) 88%),
    repeating-linear-gradient(
      -12deg,
      transparent 0 46px,
      var(--grid-line) 46px 47px
    );
  mask-image: linear-gradient(180deg, transparent 0 7rem, #000 14rem, transparent 72%);
}

.mast, main, .caveats {
  position: relative;
  z-index: 1;
  width: min(780px, calc(100% - 32px));
  margin: 0 auto;
}

.mast { padding: 28px 0 16px; }
.mast-top {
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.theme-switch {
  display: inline-flex;
  flex-shrink: 0;
  padding: 3px;
  border: 1px solid var(--rail-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--page) 70%, transparent);
  backdrop-filter: blur(10px);
}
.theme-switch button {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  min-height: 32px;
  cursor: pointer;
}
.theme-switch button.on,
.theme-switch button[aria-pressed="true"] {
  background: var(--copper);
  color: var(--paper);
}

.mast h1 {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(22px, 1.2rem + 0.9vw, 26px);
  letter-spacing: -0.028em;
  line-height: 1.15;
}
.mast-break { display: none; }
@media (min-width: 720px) {
  .mast h1 { white-space: nowrap; }
}
.mast-lede {
  clear: both;
  max-width: 36rem;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.sheet {
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 26px 24px 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--paper-edge);
  background-image:
    linear-gradient(180deg, var(--copper-soft), transparent 28px),
    linear-gradient(180deg, transparent 0 13px, var(--rule) 13px 14px, transparent 14px);
}

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.search-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
.stop-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.card.primary-stop::before { background: var(--sage); }
.ticks {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.ticks li {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
}
.ticks li.miss { color: var(--ink-soft); }
.ticks li.unknown { font-style: italic; }
.ticks .tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 5px;
  flex: 0 0 auto;
  color: var(--forest-ink);
  background: var(--forest);
}
.ticks li.has .tick,
.ticks .tick-has {
  color: var(--forest-ink);
  background: var(--forest);
}
.ticks li.miss .tick,
.ticks .tick-miss {
  color: var(--tick-miss-ink);
  background: var(--tick-miss);
}
.ticks li.unknown .tick,
.ticks .tick-unknown {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink-soft) 38%, var(--paper-2));
}
.addr-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
#q {
  width: 100%;
  min-height: 9.5rem;
  resize: vertical;
  border: 1.5px solid var(--hairline);
  border-radius: 12px;
  background: color-mix(in srgb, var(--paper-2) 62%, var(--paper));
  color: var(--ink);
  font: 500 22px/1.4 var(--display);
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
#q:focus {
  outline: none;
  border-color: var(--copper);
  box-shadow: 0 0 0 3px var(--copper-soft);
}
#q::placeholder { color: var(--placeholder); font-style: italic; }
#addr {
  flex: 1;
  min-width: 0;
  border: none;
  border-bottom: 1px solid var(--hairline);
  background: transparent;
  color: var(--ink);
  font: 400 14px/1.4 var(--sans);
  padding: 6px 0 7px;
  border-radius: 0;
}
#addr:focus { outline: none; border-bottom-color: var(--copper); }
#addr::placeholder { color: var(--placeholder); font-style: italic; }

.btn-ink, .btn-ghost, .origin-actions button, .card-links a, .chips button, .think-toggle {
  font-family: var(--sans);
  cursor: pointer;
}
.btn-ink {
  background: var(--ink);
  color: var(--paper);
  border: 0;
  padding: 0 20px;
  border-radius: 999px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 600;
  min-height: 50px;
  width: 100%;
}
.btn-ink:hover { background: var(--copper); }
.btn-ink:disabled { opacity: 0.72; cursor: wait; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
}
.chips button {
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--ink-soft);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.chips button:hover { background: var(--chip-hover); color: var(--ink); }
.chips button:disabled { opacity: 0.55; cursor: wait; }

.didyoumean {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.didyoumean button {
  background: transparent;
  border: 0;
  color: var(--copper-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.origin {
  margin-top: 18px;
  padding: 12px 0 0;
  border-top: 1px solid var(--hairline);
}
.origin-top {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}
.origin-kicker {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--origin-muted);
}
#origin-label {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.2;
}
.origin-addr {
  margin: 1px 0 0;
  color: var(--ink-soft);
  font-size: 12.5px;
}
.origin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 6px;
}
.origin-actions button {
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--ink-soft);
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 999px;
}
.origin-actions button.on,
.origin-actions button:hover {
  border-color: var(--copper);
  color: var(--copper);
  background: var(--copper-soft);
}
.addr-row { margin-top: 4px; }
.map-wrap {
  margin-top: 14px;
  height: 240px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--map-border);
}
#map { height: 100%; width: 100%; }

.status {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.01em;
}
.status.error { color: var(--error); }
#status:has(+ #think:not([hidden]):not(.done)) {
  display: none;
}

.think {
  margin: 16px 0 0;
  padding: 14px 16px 12px;
  border-radius: 14px;
  background: var(--rail);
  border: 1px solid var(--rail-line);
  box-shadow: var(--shadow-soft);
}
.think-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.think-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--copper);
  box-shadow: 0 0 0 0 var(--copper);
  animation: think-pulse 1.6s ease-out infinite;
}
.think.done .think-pulse {
  animation: none;
  background: var(--sage);
  box-shadow: none;
}
.think-kicker {
  margin: 0;
  flex: 1;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--copper-2);
}
.think.done .think-kicker { color: var(--muted); }
.think-track {
  margin: 12px 0 2px;
  height: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--rail-line) 70%, transparent);
  overflow: hidden;
}
.think-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--copper), var(--copper-2));
  box-shadow: 0 0 10px var(--copper-soft);
  transition: width 0.32s ease;
}
.think.done .think-fill {
  background: var(--sage);
  box-shadow: none;
}
.think-skel {
  display: grid;
  gap: 8px;
  margin: 12px 0 2px;
}
.think.done .think-skel,
.think-skel[hidden] { display: none; }
.skel-card {
  height: 52px;
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    var(--rail) 0%,
    var(--copper-soft) 46%,
    var(--rail) 100%
  );
  background-size: 200% 100%;
  animation: skel-shimmer 1.4s ease-in-out infinite;
}
@keyframes skel-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.think-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--rail-line);
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.think.done .think-toggle { display: inline-flex; }
.think.done.open .think-toggle { color: var(--copper-2); border-color: var(--copper); }
.think-log {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}
.think-log li {
  padding: 3px 0 3px 14px;
  position: relative;
}
.think-log li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rail-line);
}
.think-log li.now { color: var(--fg); }
.think-log li.now::before { background: var(--copper); }
.think-log li.now::after {
  content: "▍";
  margin-left: 5px;
  color: var(--copper);
  animation: think-caret 1s step-end infinite;
}
.think.done .think-log li.now::after { content: none; animation: none; }
.think.done:not(.open) .think-log {
  display: none;
}

@keyframes think-caret { 50% { opacity: 0; } }
@keyframes think-pulse {
  0% { box-shadow: 0 0 0 0 rgba(212, 106, 40, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(212, 106, 40, 0); }
  100% { box-shadow: 0 0 0 0 rgba(212, 106, 40, 0); }
}

.sku {
  margin: 22px 0 0;
  color: var(--fg);
}
.sku-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}
.sku-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(26px, 5vw, 34px);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.sku-chip {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
}
html[data-theme="dark"] .sku-chip {
  background: var(--paper);
  color: var(--ink);
}
.sku-note {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--muted);
  max-width: 40rem;
}
.sku-dump {
  margin: 10px 0 0;
  color: var(--muted-2);
  font-size: 12.5px;
}
.sku-dump summary {
  cursor: pointer;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--muted);
  list-style: none;
}
.sku-dump summary::-webkit-details-marker { display: none; }
.sku-dump summary::after {
  content: " +";
  color: var(--copper-2);
}
.sku-dump[open] summary::after { content: " –"; }
.sku-dump p {
  margin: 6px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  opacity: 0.85;
}

.toolbar {
  margin: 12px 0 0;
}
.toolbar-sheet {
  background: var(--paper);
  color: var(--ink);
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--paper-edge);
}
.toolbar-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.toolbar-toggle {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: var(--paper-2);
  border: 1px solid var(--hairline);
  color: var(--ink);
  padding: 4px 11px;
  border-radius: 999px;
  min-height: 28px;
  cursor: pointer;
}
.toolbar-toggle::after {
  content: " ▾";
  font-weight: 500;
}
.toolbar-toggle[aria-expanded="true"]::after { content: " ▴"; }
.toolbar-toggle:hover,
.toolbar-toggle[aria-expanded="true"] {
  border-color: var(--copper);
  color: var(--copper);
  background: var(--copper-soft);
}
.toolbar-active {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex: 1 1 auto;
  min-width: 0;
}
.toolbar-chip {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  background: var(--copper-soft);
  border: 1px solid var(--copper);
  color: var(--copper);
  padding: 2px 8px;
  border-radius: 999px;
  min-height: 22px;
  cursor: pointer;
}
.toolbar-chip::after { content: " ×"; }
.toolbar-count {
  margin: 0 0 0 auto;
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.toolbar-panel {
  margin-top: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--hairline);
}
.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 4px 0;
}
.toolbar-row + .toolbar-row {
  border-top: 1px solid var(--hairline);
}
.toolbar-label {
  flex: 0 0 4.4rem;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--origin-muted);
}
.toolbar-pills {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 2px;
  border: 1px solid var(--rail-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper-2) 55%, var(--paper));
  gap: 1px;
}
.toolbar-pills button {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: transparent;
  color: var(--ink-soft);
  border: 0;
  border-radius: 999px;
  padding: 4px 9px;
  min-height: 26px;
  cursor: pointer;
}
.toolbar-pills button:hover { color: var(--ink); }
.toolbar-pills button.on,
.toolbar-pills button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}
.toolbar-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.toolbar-chips button {
  font-family: var(--sans);
  background: var(--paper-2);
  border: 1px solid var(--hairline);
  color: var(--ink);
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 999px;
  min-height: 26px;
  cursor: pointer;
}
.toolbar-chips button:hover,
.toolbar-chips button.on,
.toolbar-chips button[aria-pressed="true"] {
  border-color: var(--copper);
  color: var(--copper);
  background: var(--copper-soft);
}

.results {
  display: grid;
  gap: 10px;
  margin: 12px 0 40px;
}
.results.settled .card { animation: none; }
.card {
  background: var(--paper);
  color: var(--ink);
  padding: 12px 14px 10px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--paper-edge);
  position: relative;
  overflow: hidden;
  animation: card-in 0.45s ease both;
  animation-delay: calc(var(--i, 0) * 70ms);
}
.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
}
.card.cheap::before { background: var(--copper); }
.card.cheap {
  box-shadow: 0 0 0 1.5px var(--copper), var(--shadow);
}
.card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.pharm {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.02em;
  flex: 1 1 auto;
  min-width: 0;
}
.badges {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  justify-content: flex-end;
  flex: 0 1 auto;
  max-width: 58%;
  overflow: hidden;
}
.badge {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  white-space: nowrap;
}
.badge.cheap { background: var(--copper); }
.badge.sage { background: var(--sage); }
.badge.rust { background: var(--rust); }

.addr {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  margin-top: 8px;
  align-items: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--hairline);
}
.price {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 500;
  color: var(--copper);
  letter-spacing: -0.04em;
  line-height: 1;
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  justify-content: flex-end;
}
.km, .phone, .fresh, .hours {
  font-size: 12.5px;
  color: var(--ink-soft);
}
.hours {
  color: var(--sage);
  background: var(--sage-soft);
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 500;
}
.fresh {
  font-family: var(--mono);
  font-size: 12px;
}
.phone a { color: inherit; text-underline-offset: 2px; }

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.card-links a {
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--hairline);
  background: var(--paper-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  border-radius: 999px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 8px;
}
.card-links a svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
.card-links a:hover {
  color: var(--copper);
  border-color: var(--copper);
  background: var(--copper-soft);
}
.note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--rust);
}
.llm-note {
  margin: 8px 0 0;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--copper);
  border-left-width: 3px;
  border-radius: 10px;
  max-width: 40rem;
}
.llm-note[hidden] { display: none; }
.llm-note.writing {
  color: var(--muted);
  font-style: italic;
}
.more-pharm {
  display: block;
  width: 100%;
  margin-top: 4px;
  min-height: 36px;
  border: 1px dashed var(--copper);
  border-radius: var(--radius-sm);
  background: var(--copper-soft);
  color: var(--copper-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.more-pharm:hover {
  background: var(--paper-2);
  border-style: solid;
}

.caveats {
  padding: 4px 0 56px;
  color: var(--footer);
  font-size: 13.5px;
}
.caveats p { margin: 0; max-width: 40rem; }

.leaflet-container { background: #d8d0bc; font-family: var(--sans); }
.origin-pin span {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--copper);
  border: 2px solid var(--ink);
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 560px) {
  .mast, main, .caveats { width: min(780px, calc(100% - 24px)); }
  #q { min-height: 8rem; font-size: 20px; }
  .btn-ink { height: 48px; width: 100%; }
  .mast { padding-top: 16px; padding-bottom: 12px; }
  .mast-top {
    display: block;
    overflow: hidden;
  }
  .theme-switch {
    float: right;
    margin: 1px 0 6px 12px;
  }
  .theme-switch button {
    padding: 5px 8px;
    font-size: 11px;
    min-height: 28px;
  }
  .mast h1 {
    font-size: clamp(18px, 4.8vw, 22px);
    line-height: 1.2;
  }
  .mast-break { display: revert; }
  .sheet { padding: 22px 16px 18px; }
  .pharm { font-size: 18px; }
  .card { padding: 12px 12px 10px; }
  .badges { max-width: 62%; }
  .meta { align-items: flex-start; }
  .facts { justify-content: flex-start; }
  .origin-actions button { min-height: 36px; }
  .toolbar-sheet { padding: 7px 8px; }
  .toolbar-count { margin-left: 0; }
  .toolbar-pills { flex: 1 1 auto; }
  .toolbar-pills button { flex: 1 1 auto; }
}

@media (max-width: 420px) {
  .badges { flex-wrap: wrap; max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
  .think-pulse { animation: none; }
  .think-log li.now::after { content: none; animation: none; }
  .think-fill { transition: none; }
  .skel-card { animation: none; background: var(--rail); }
  * {
    scroll-behavior: auto !important;
  }
}
