/* Поискак. Tool first: filters on the left, a table on the right.
   Cream page, sage header, mint action, green «есть» and rose «нет»; the poop lives in the logo, the rating and the copy burst. */
:root {
  /* palette: #74D3AE mint, #678D58 sage, #A6C48A green, #F6E7CB cream, #DD9787 rose */
  --mint: #74d3ae;
  --sage: #678d58;
  --green: #a6c48a;
  --cream: #f6e7cb;
  --rose: #dd9787;

  --bg: var(--cream);
  --top-bg: #4a6a3d; /* sage a step darker: cream text on it stays readable */
  --card: #fbf3e3;
  --raised: #ecdcbc;
  --active: var(--green);
  --hover: rgba(31, 43, 28, 0.05);
  --line: rgba(31, 43, 28, 0.12);
  --line-strong: rgba(31, 43, 28, 0.24);
  --ink: #1f2b1c;
  --ink-2: #444c3f;
  --ink-3: #62665a;
  --accent: var(--mint);
  --accent-hover: #86dcba;
  --accent-shadow: #47a882;
  --on-accent: #1f2b1c;
  --link: #4a6a3d;
  --focus: rgba(116, 211, 174, 0.65);
  --shadow: 0 16px 40px rgba(60, 50, 20, 0.18), 0 1px 2px rgba(60, 50, 20, 0.08);

  --font: "Geologica", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Dela Gothic One", "Geologica", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --top-h: 60px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/20px var(--font);
  -webkit-font-smoothing: antialiased;
  caret-color: transparent; /* no blinking text cursor outside the inputs */
}
input, textarea, [contenteditable] { caret-color: auto; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-user-select: none; user-select: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- header */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: url("/static/pattern.svg") 0 0 / 72px 72px, var(--top-bg);
  border-bottom: 1px solid var(--line);
}
.top-in {
  max-width: 1520px;
  margin: 0 auto;
  padding: 0 32px;
  height: var(--top-h);
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; flex: none; }
.brand-name { font: 400 22px/1 var(--display); letter-spacing: 0.01em; }
.logo { width: 36px; height: 40px; overflow: visible; }
.logo use { transform-box: fill-box; transform-origin: 50% 100%; transition: transform 200ms var(--ease); }
.brand:hover .logo use { transform: scale(1.08, 0.92); }
.stink path { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; animation: waft 2.4s var(--ease) infinite; }
.stink .s2 { animation-delay: 0.8s; }
.stink .s3 { animation-delay: 1.6s; }
@keyframes waft {
  0% { opacity: 0; transform: translateY(4px); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-4px); }
}
.top .brand, .top .tagline, .top .meta { color: var(--cream); }
.top .meta { opacity: 0.9; }
#zone-inc .chip { background: var(--green); }
#zone-exc .chip { background: var(--rose); }
.zone-head h2::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 3px; vertical-align: 2px; }
#zone-inc h2::before { background: var(--green); }
#zone-exc h2::before { background: var(--rose); }
/* the author, always in sight */
.creator {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  height: 40px;
  padding: 0 14px 0 6px;
  border-radius: 12px;
  background: var(--cream);
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  box-shadow: 0 3px 0 rgba(20, 30, 15, 0.35);
  transition: background-color 150ms var(--ease), transform 100ms var(--ease), box-shadow 100ms var(--ease);
}
.creator:hover { background: #fff8ea; }
.creator:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(20, 30, 15, 0.35); }
.creator .tg { width: 28px; height: 28px; flex: none; }
.creator-t { line-height: 16px; }
.creator-t small { display: block; font-size: 11px; line-height: 12px; font-weight: 400; color: var(--ink-3); }
.creator-card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 48px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 150ms var(--ease);
}
.creator-card:hover { border-color: var(--line-strong); }
.creator-card .tg { width: 44px; height: 44px; flex: none; }
.creator-card-t { flex: 1; min-width: 0; }
.creator-card-t b { display: block; font: 400 18px/24px var(--display); }
.creator-card-t span { color: var(--ink-2); }
.cap { font: 400 12px/16px var(--font); color: var(--ink-3); margin-left: 6px; }
.tagline { margin: 0; flex: 1; min-width: 0; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { margin: 0; color: var(--ink-3); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- layout */
.layout {
  max-width: 1520px;
  margin: 0 auto;
  padding: 24px 32px 96px;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.side {
  position: sticky;
  top: calc(var(--top-h) + 24px);
  max-height: calc(100vh - var(--top-h) - 48px);
  max-height: calc(100dvh - var(--top-h) - 48px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: -8px; /* room for focus rings and the examples' hover, without a horizontal scroll */
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

/* ---------------------------------------------------------------- controls */
.label { font-size: 13px; line-height: 16px; color: var(--ink-3); }
.block { display: flex; flex-direction: column; gap: 8px; }

.seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--raised); }
.seg.full { display: flex; }
.seg.full button { flex: 1; }
.seg button {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  white-space: nowrap;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] { background: var(--active); color: var(--ink); box-shadow: 0 1px 2px rgba(31, 43, 28, 0.12); }
.seg.sm button { height: 24px; padding: 0 8px; font-size: 12px; }

.field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink-3);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.field:focus-within { border-color: var(--line-strong); box-shadow: 0 0 0 3px var(--focus); }
.field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.field input::placeholder { color: var(--ink-3); }
.field input::-webkit-search-cancel-button { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), transform 120ms var(--ease);
}
.btn:hover { background: var(--raised); }
.btn:active { transform: scale(0.98); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; border-radius: 6px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--raised); color: var(--ink); }
.btn.primary { border-color: transparent; background: var(--accent); color: var(--on-accent); font-weight: 500; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { border-color: transparent; background: var(--rose); color: var(--ink); font-weight: 500; }
.btn.danger:hover { background: #e6aa9d; }

/* ---------------------------------------------------------------- zones */
.zone {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.zone-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.zone-head h2 { margin: 0; font: 400 17px/20px var(--display); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .none { color: var(--ink-3); font-size: 13px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 2px 0 6px;
  border-radius: 6px;
  background: var(--raised);
  font-size: 13px;
  color: var(--ink);
  max-width: 100%;
}
.chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .n { color: var(--ink-3); margin-left: 4px; font-variant-numeric: tabular-nums; }
.chip.dead .nm { color: var(--ink-3); text-decoration: line-through; }
.chip button {
  width: 24px;
  height: 24px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-3);
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.chip button:hover { background: var(--line-strong); color: var(--ink); }
.chip .ico { width: 14px; height: 14px; }
.zone-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.quick { display: contents; }
.quick button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  transition: background-color 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease);
}
.quick button:hover { border-style: solid; background: var(--raised); color: var(--ink); }

.examples { display: flex; flex-direction: column; gap: 2px; margin: 0 -8px; } /* within the column's 8px padding */
.examples button {
  text-align: left;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.examples button:hover { background: var(--raised); color: var(--ink); }
.examples button[aria-pressed="true"] { color: var(--ink); font-weight: 500; }
/* the big «Найти» button: sticks to the bottom of the filters column (and of the screen on phones) */
.find-wrap {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: -8px -4px -4px;
  padding: 8px 4px 12px;
  background: var(--bg);
}
.find {
  width: 100%;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 6px 0 var(--accent-shadow);
  transition: background-color 150ms var(--ease), transform 100ms var(--ease), box-shadow 100ms var(--ease);
}
.find:hover { background: var(--accent-hover); }
.find:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--accent-shadow); }
.find-t { font: 400 26px/1 var(--display); }
.find-n { font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.find:not(.dirty) .find-n { opacity: 0.85; }
.find.nudge { animation: nudge 420ms var(--ease); }
@keyframes nudge {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-1.5deg) scale(1.02); }
  60% { transform: rotate(1deg); }
}
.stale-note { margin: 6px 0 0; color: var(--link); font-weight: 500; }
.tablewrap { transition: opacity 200ms var(--ease); }
.tablewrap.stale { opacity: 0.4; }

/* ---------------------------------------------------------------- exchange picker */
.picker {
  position: fixed;
  z-index: 40;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: pop 160ms var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.picker-top { padding: 8px; border-bottom: 1px solid var(--line); }
.picker-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px; overscroll-behavior: contain; }
.picker-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 12px; border-top: 1px solid var(--line); }
.picker-note { font-size: 12px; color: var(--ink-3); }
.pgroup { padding: 12px 8px 4px; font-size: 12px; color: var(--ink-3); }
.prow {
  width: 100%;
  height: 32px;
  display: grid;
  grid-template-columns: 16px 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  transition: background-color 120ms var(--ease);
}
.prow:hover, .prow.kb { background: var(--raised); }
.prow .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .cnt { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.prow:disabled { cursor: default; background: transparent; color: var(--ink-3); }
.box {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
  color: var(--on-accent);
}
.box .ico { width: 12px; height: 12px; stroke-width: 2.5; visibility: hidden; }
.prow[aria-checked="true"] .box { background: var(--accent); border-color: var(--accent); }
.prow[aria-checked="true"] .box .ico { visibility: visible; }

/* ---------------------------------------------------------------- results */
.results { min-width: 0; }
.rhead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; padding-bottom: 16px; }
.rtitle { min-width: 0; }
.rcount { margin: 0; font: 400 36px/40px var(--display); font-variant-numeric: tabular-nums; }
.rcount .unit { color: var(--sage); }
.rsum { margin: 4px 0 0; max-width: 52rem; color: var(--ink-2); }
.rsum b { font-weight: 500; color: var(--ink); }
.rtools { display: flex; align-items: center; gap: 8px; }
.rtools .field { width: 200px; }

.coins { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.coins th {
  position: sticky;
  top: var(--top-h);
  z-index: 2;
  height: 36px;
  padding: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line-strong);
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-3);
  text-align: left;
}
.coins th.num, .coins td.num { text-align: right; }
.coins th.vcol, .coins td.vcol { text-align: center; }
.th-btn, .th-txt {
  width: 100%;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.th-txt { justify-content: center; gap: 6px; }
.th-txt > span { overflow: hidden; text-overflow: ellipsis; }
.num .th-btn { justify-content: flex-end; }
.th-btn:hover { color: var(--ink); }
.th-btn[aria-sort="ascending"], .th-btn[aria-sort="descending"] { color: var(--ink); }
.th-btn .ico { width: 12px; height: 12px; visibility: hidden; }
.th-btn[aria-sort] .ico { visibility: visible; }
.th-btn[aria-sort="ascending"] .ico { transform: rotate(180deg); }

.coins td {
  height: 40px;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.coins tr.row { cursor: pointer; }
.coins tr.row:hover td { background: var(--hover); }
.coins tr.row.open td { background: var(--hover); border-bottom-color: transparent; }
.tick { font-weight: 500; font-size: 15px; }
.coins td.num { color: var(--ink-2); }
.coins td.dim { color: var(--ink-3); }
.mk { color: var(--link); text-decoration: none; }
a.mk[href]:hover { text-decoration: underline; text-underline-offset: 3px; }
.mk + .mk::before { content: "·"; color: var(--ink-3); margin: 0 6px; }
.chev { color: var(--ink-3); transition: transform 200ms var(--ease); vertical-align: middle; }
tr.open .chev { transform: rotate(180deg); }

.detail td { height: auto; padding: 4px 8px 24px; white-space: normal; background: var(--hover); }
.detail .wait { margin: 8px 0 0; color: var(--ink-3); }
.dgroups { display: grid; gap: 16px; }
.dgroup h3 { margin: 0 0 4px; font-size: 13px; line-height: 16px; font-weight: 400; color: var(--ink-3); }
.dlist {
  list-style: none;
  margin: 0 -8px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  gap: 0 8px;
}
.dlist li { padding: 6px 8px; min-width: 0; }
.dlist .vn { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; color: var(--ink); font-weight: 500; text-decoration: none; }
.dlist a.vn:hover { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.dlist .sel .vn::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.dlist .pairs { display: block; padding-left: 24px; font-size: 12px; line-height: 16px; color: var(--ink-3); overflow-wrap: anywhere; }
.dlist .subs a { color: var(--ink-2); }

.empty { margin: 0; padding: 32px 8px; color: var(--ink-2); }
#sentinel { height: 1px; }

/* ---------------------------------------------------------------- exchange icons, poop rating, burst */
.vi {
  width: 18px;
  height: 18px;
  flex: none;
  padding: 1px;
  border-radius: 5px;
  background: #fffdf8;
  box-shadow: 0 0 0 1px var(--line);
  object-fit: contain;
}
.vi.mono {
  display: inline-grid;
  place-items: center;
  padding: 0;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  color: var(--on-accent);
}
.quick .vi, .chip .vi { width: 16px; height: 16px; border-radius: 4px; }
.rate { display: inline-flex; gap: 1px; vertical-align: middle; }
.rate svg { width: 18px; height: 18px; }
.rate.clean { font-size: 12px; color: var(--ink-3); }
.burst { position: fixed; z-index: 60; width: 24px; height: 24px; pointer-events: none; }
.empty { display: flex; align-items: center; gap: 12px; }
.empty svg { width: 40px; height: 40px; flex: none; }
.notes { margin-top: 24px; max-width: 52rem; display: grid; gap: 8px; font-size: 13px; color: var(--ink-3); }
.notes p { margin: 0; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 500;
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- narrow screens */
@media (max-width: 1240px) {
  .tagline { display: none; }
  .top-in { justify-content: space-between; }
}
@media (max-width: 1023px) {
  :root { --top-h: 0px; }
  .top { position: static; }
  .top-in { height: auto; min-height: 52px; padding: 12px 16px; flex-wrap: wrap; gap: 2px 16px; }
  .creator { order: 2; margin-left: auto; height: 36px; }
  .meta { order: 3; flex-basis: 100%; }
  .creator-card { flex-wrap: wrap; }
  .creator-card .btn { width: 100%; }
  .meta { white-space: normal; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 16px 16px 64px; gap: 24px; }
  .side { position: static; max-height: none; overflow: visible; margin: 0; padding: 0; }
  .find-wrap { margin: 0 -16px; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
  .rtools { width: 100%; flex-wrap: wrap; }
  .rtools .field { flex: 1 1 140px; width: auto; min-width: 0; }
  .tablewrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
  .coins { table-layout: auto; min-width: 100%; }
  .coins th { position: static; }
  .col-split { display: none; }
}
@media (max-width: 480px) {
  .rtools #copy span { display: none; }
  .rcount { font-size: 28px; line-height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
  .stink path { animation: none; }
}
