
/* Theme tokens (public site) */
:root {
  --page-bg: #f7f9fc;
  --page-glow: rgba(226, 238, 252, .7);
  --surface: rgba(255, 255, 255, .9);
  --surface-soft: rgba(255, 255, 255, .86);
  --surface-border: #e5ebf3;
  --surface-border-soft: #e8edf4;
  --text: #172033;
  --text-heading: #121a2a;
  --text-muted: #7e8b9f;
  --text-dim: #99a6b7;
  --text-soft: #5e6d81;
  --link: #147fc5;
  --accent: #2499e8;
  --input-bg: #fff;
  --input-border: #e1e8f1;
  --toolbar-bg: rgba(255, 255, 255, .92);
  --toolbar-border: rgba(220, 230, 241, .95);
  --toolbar-shadow: rgba(48, 86, 135, .08);
  --pill-bg: rgba(255, 255, 255, .86);
  --shadow-soft: rgba(48, 86, 135, .055);
}

[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #0b0f14;
  --page-glow: rgba(36, 153, 232, .1);
  --surface: rgba(22, 28, 36, .94);
  --surface-soft: rgba(22, 28, 36, .9);
  --surface-border: #2a3441;
  --surface-border-soft: #253040;
  --text: #dce4ef;
  --text-heading: #f0f4f8;
  --text-muted: #8b99ae;
  --text-dim: #6e7c90;
  --text-soft: #9aa7b7;
  --link: #5eb8f7;
  --accent: #3da9ea;
  --input-bg: #151b24;
  --input-border: #2f3a48;
  --toolbar-bg: rgba(18, 24, 32, .94);
  --toolbar-border: rgba(47, 58, 72, .95);
  --toolbar-shadow: rgba(0, 0, 0, .35);
  --pill-bg: rgba(22, 28, 36, .92);
  --shadow-soft: rgba(0, 0, 0, .25);
}

/* Public search experience — specialized TON index */
.public-page {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(ellipse 70% 42% at 50% -8%, var(--page-glow), transparent 70%),
    var(--page-bg);
}
.public-page a { color: inherit; }
.home-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}
.search-hero {
  width: min(100% - 32px, 720px);
  padding: clamp(28px, 5.5vh, 64px) 0 40px;
  text-align: center;
  overflow: visible;
}
.hero-toolbar {
  display: flex;
  justify-content: flex-end;
  width: min(100%, 640px);
  margin: 0 auto 20px;
}
.ton-mark {
  display: inline-flex;
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  color: var(--text);
  text-decoration: none;
}
.ton-mark:hover { opacity: .9; }
.ton-mark svg { width: 56px; height: 56px; display: block; }
.mark-hood { fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linejoin: round; }
.mark-face { fill: currentColor; }
.mark-bone { fill: currentColor; }
.search-hero .eyebrow, .results-heading .eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.search-hero h1 {
  margin: 0;
  color: var(--text-heading);
  font-size: clamp(1.85rem, 3.4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.15;
}
.hero-copy {
  margin: 8px auto 0;
  max-width: min(100%, 640px);
  color: var(--text-muted);
  font-size: .8rem;
  line-height: 1.35;
  white-space: nowrap;
}
.hero-search {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: min(100%, 640px);
  margin: 2.5em auto 0;
  padding: 6px;
  border: 1px solid var(--input-border);
  border-radius: 14px;
  background: var(--input-bg);
  box-shadow: 0 1px 2px var(--shadow-soft), 0 8px 24px var(--toolbar-shadow);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.hero-search:hover {
  border-color: #c5d7ea;
}
.hero-search:focus-within {
  border-color: #8ebfe8;
  box-shadow:
    0 0 0 3px rgba(36, 153, 232, .14),
    0 8px 24px var(--toolbar-shadow);
}
[data-theme="dark"] .hero-search:hover {
  border-color: #3d4d60;
}
[data-theme="dark"] .hero-search:focus-within {
  border-color: #4a7fa8;
  box-shadow:
    0 0 0 3px rgba(61, 169, 234, .18),
    0 8px 24px var(--toolbar-shadow);
}
.hero-search input, .results-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
}
.hero-search input {
  height: 46px;
  padding: 0 16px;
  font-size: 1rem;
}
.hero-search input::placeholder, .results-search input::placeholder {
  color: var(--text-dim);
  opacity: 1;
}
.hero-search button, .results-search button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  color: #fff;
  background: var(--accent);
  box-shadow: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  transition: background .15s ease;
}
.hero-search button {
  min-width: 108px;
  height: 46px;
  padding: 0 18px;
  border-radius: 10px;
}
.hero-search button:hover, .results-search button:hover {
  background: #1a8ad6;
}
.hero-search button:focus-visible, .results-search button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.hero-search button svg, .results-search button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.category-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 12px 12px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.home-categories {
  width: min(100%, 640px);
  margin: 20px auto 0;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  text-align: left;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.home-categories-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 11px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.home-categories-toggle::-webkit-details-marker { display: none; }
.home-categories-toggle:hover {
  background: rgba(36, 153, 232, .05);
}
.home-categories-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.home-categories-title {
  flex: 0 0 auto;
  color: var(--text-soft);
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .01em;
}
.home-categories-meta {
  margin-left: auto;
  color: var(--text-dim);
  font-size: .76rem;
  font-weight: 400;
  text-align: right;
  white-space: nowrap;
}
.home-categories-meta strong { color: var(--link); font-weight: 600; }
.home-categories-chevron {
  flex: 0 0 auto;
  color: var(--text-dim);
  font-size: .78rem;
  line-height: 1;
  transition: transform .18s ease, color .15s ease;
}
.home-categories-toggle:hover .home-categories-chevron { color: var(--link); }
.home-categories[open] {
  background: var(--surface);
  box-shadow: 0 4px 16px var(--shadow-soft);
}
.home-categories[open] .home-categories-chevron { transform: rotate(180deg); color: var(--link); }
.home-categories[open] .home-categories-title { color: var(--text-soft); }
.home-categories[open] .home-categories-toggle {
  border-radius: 11px 11px 0 0;
  border-bottom: 1px solid var(--surface-border-soft);
}
.home-categories[open] .home-categories-toggle:hover {
  background: transparent;
}
.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--text-soft) !important;
  background: rgba(36, 153, 232, .04);
  text-decoration: none;
  font-size: .82rem;
  line-height: 1.2;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.category-pill:hover, .category-pill.is-active {
  color: var(--link) !important;
  background: rgba(36, 153, 232, .1);
  border-color: rgba(36, 153, 232, .18);
  text-decoration: none;
}
.category-pill-label { white-space: nowrap; }
.category-pill strong {
  margin-left: 0;
  color: var(--text-heading);
  font-size: .78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.category-pill:hover strong { color: var(--link); }
.category-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--text-dim);
}
.category-dot.ton-site { background: #3d9a6e; }
.category-dot.telegram { background: #4a8ec9; }
.category-dot.game { background: #6b7fd7; }
.category-dot.nft { background: #9a7bb8; }
.category-dot.wallet { background: #3d9a8a; }
.category-dot.social { background: #c48a4a; }
.category-dot.tool { background: #5f8fa8; }
.category-dot.external { background: #7e8b9f; }
.category-dot.offline { background: #9a6b6b; }
.category-dot.queue { background: var(--accent); }
.hero-footnote { margin: 31px 0 0; color: var(--text-dim); font-size: .78rem; }
.hero-footnote a { color: var(--link); }
.home-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  width: min(100%, 640px);
  margin: 32px auto 0;
  padding: 18px 8px;
  border-top: 1px solid var(--surface-border);
}
.home-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  position: relative;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  transition: background .18s ease, transform .18s ease;
}
a.home-stat:hover {
  background: rgba(36, 153, 232, .08);
  text-decoration: none;
}
a.home-stat:hover strong { color: var(--link); }
a.home-stat:hover span { color: var(--link); }
a.home-stat:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.home-stat:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 12%;
  bottom: 12%;
  width: 1px;
  background: var(--surface-border);
}
.home-stat strong {
  color: var(--text-heading);
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.home-stat span {
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .01em;
}
.home-footer {
  width: 100%;
  margin-top: auto;
  border-top: 1px solid var(--surface-border);
  background: transparent;
}
.home-footer-inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(100% - 32px, 720px);
  margin: 0 auto;
  padding: 12px 0 16px;
  color: var(--text-dim);
  font-size: .68rem;
  line-height: 1.3;
  white-space: nowrap;
}
.home-footer-brand {
  color: var(--text-dim);
  font-size: inherit;
  font-weight: 500;
}
.home-footer-brand::after,
.home-footer-nav::after {
  content: "·";
  margin-left: 10px;
  color: var(--text-dim);
}
.home-footer-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.home-footer-nav a {
  color: var(--text-dim) !important;
  text-decoration: none;
  font-size: inherit;
  font-weight: 500;
}
.home-footer-nav a:hover {
  color: var(--link) !important;
  text-decoration: none;
}
.home-footer-copy {
  color: var(--text-dim);
  font-size: inherit;
}
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.results-page { padding-bottom: 60px; }
.results-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(100% - 32px, 1080px);
  margin: 0 auto;
  padding: 20px 0 24px;
  overflow: visible;
}
.results-brand { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 9px; color: var(--text) !important; text-decoration: none; font-size: 1.05rem; font-weight: 800; white-space: nowrap; }
.results-topbar .results-search,
.results-topbar .ac-anchor {
  flex: 1 1 260px;
  min-width: 0;
  max-width: 620px;
  margin-left: 0;
}
.results-topbar .site-toolbar {
  flex: 0 0 auto;
  margin-left: auto;
}
.results-brand-mark { display: inline-grid; width: 28px; height: 28px; place-items: center; border-radius: 9px; color: #fff; background: var(--accent); font-size: .9rem; }
.results-search { display: flex; max-width: none; margin-left: 0; padding: 5px 6px 5px 15px; border: 1px solid var(--input-border); border-radius: 14px; background: var(--input-bg); box-shadow: 0 6px 18px var(--toolbar-shadow); }
.results-search input { height: 38px; font-size: .92rem; }
.results-search button { width: 38px; height: 38px; border-radius: 10px; box-shadow: none; }
.results-shell { width: min(100% - 32px, 1080px); margin: 20px auto 0; }
.results-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--surface-border); }
.results-heading h1 { max-width: 780px; margin: 0; overflow: hidden; color: var(--text-heading); font-size: clamp(1.45rem, 3vw, 2.15rem); font-weight: 800; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.results-heading-side { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.results-count { padding: 7px 12px; border: 1px solid rgba(36, 153, 232, .22); border-radius: 999px; color: var(--link); background: rgba(36, 153, 232, .1); font-size: .82rem; font-weight: 600; white-space: nowrap; }
.results-sort select {
  min-height: 36px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--input-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237e8b9f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  font: inherit;
  font-size: .82rem;
  appearance: none;
  cursor: pointer;
}
.results-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 4px;
}
.results-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  color: var(--text-soft) !important;
  background: var(--input-bg);
  text-decoration: none;
  font-size: .86rem;
  font-weight: 600;
}
.results-tab svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.results-tab.is-active,
.results-tab:hover {
  border-color: rgba(36, 153, 232, .45);
  color: var(--link) !important;
  background: rgba(36, 153, 232, .1);
}
.results-tab strong { color: var(--link); font-size: .78rem; }
.site-detail-heading { display: flex; align-items: center; gap: 14px; min-width: 0; }
.site-detail-favicon { width: 52px; height: 52px; font-size: 1.15rem; }
.result-meta a { color: var(--link) !important; text-decoration: none; }
.result-meta a:hover { text-decoration: underline; }
.result-list { display: grid; gap: 12px; margin: 18px 0 0; padding: 0; list-style: none; }
.result-card { padding: 16px 18px; border: 1px solid var(--surface-border); border-radius: 16px; background: var(--surface); box-shadow: 0 7px 20px var(--shadow-soft); }
.result-card-layout { display: flex; align-items: flex-start; gap: 14px; }
.result-favicon {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(36, 153, 232, .18), rgba(36, 153, 232, .05));
  border: 1px solid var(--surface-border);
  color: var(--link);
  font-size: 1rem;
  font-weight: 800;
}
.result-favicon::before {
  content: attr(data-letter);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.result-favicon img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--surface);
}
.result-card-body { min-width: 0; flex: 1; }
.result-card-top { display: flex; align-items: center; gap: 10px; color: var(--text-dim); font-size: .78rem; }
.result-domain { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-new {
  margin-left: auto;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #18a957;
  background: transparent;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.result-title { margin: 6px 0 4px; font-size: 1.12rem; line-height: 1.35; font-weight: 700; }
.result-title a { color: var(--link) !important; text-decoration: none; }
.result-title a:hover { text-decoration: underline; }
.result-url { margin: 0 0 8px; overflow: hidden; color: #2f9e5d; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.result-url a { color: inherit !important; text-decoration: none; }
.result-url a:hover { text-decoration: underline; }
.result-snippet-box {
  position: relative;
  max-width: 920px;
}
.result-snippet {
  max-width: 920px;
  margin: 0;
  color: var(--text-soft);
  font-size: .91rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.result-snippet-box.is-collapsed .result-snippet {
  display: block;
  max-height: 1.55em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  -webkit-line-clamp: unset;
  line-clamp: unset;
}
.result-snippet-toggle {
  display: inline-flex;
  align-items: center;
  margin-top: 2px;
  padding: 0;
  border: 0;
  color: var(--link);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: .91rem;
  font-weight: 600;
  letter-spacing: .08em;
  line-height: 1;
}
.result-snippet-toggle:hover { text-decoration: underline; }
.result-snippet-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.result-snippet-box.is-collapsed .result-snippet-toggle { margin-top: 4px; }
.result-snippet-box:not(.is-collapsed) .result-snippet-toggle {
  margin-top: 6px;
  letter-spacing: 0;
  font-size: .82rem;
  font-weight: 500;
}
.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  color: var(--text-dim);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.result-snippet mark, .result-title mark, .result-domain mark, mark.search-hit {
  padding: 0 2px;
  border-radius: 3px;
  color: #1a1a1a;
  font-weight: 600;
  background: linear-gradient(180deg, #fff8b3 0%, #ffe566 100%);
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.06);
}
.load-more-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  margin: 22px 0 0;
  padding: 0 18px;
  border: 1px solid rgba(36, 153, 232, .35);
  border-radius: 14px;
  color: var(--link);
  background: rgba(36, 153, 232, .08);
  font: inherit;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
}
.load-more-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.load-more-button:hover { background: rgba(36, 153, 232, .14); }
.load-more-button:disabled,
.load-more-button.is-loading { opacity: .65; cursor: wait; }
[data-theme="dark"] .result-url { color: #5dcf8a; }
[data-theme="dark"] .result-new { color: #4fd68a; }
[data-theme="dark"] .result-snippet mark,
[data-theme="dark"] .result-title mark,
[data-theme="dark"] .result-domain mark,
[data-theme="dark"] mark.search-hit {
  color: #1a1a1a;
}
.site-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 20px;
}
.site-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  color: var(--text-soft) !important;
  background: var(--input-bg);
  text-decoration: none;
  font-size: .84rem;
}
.site-filter strong { color: var(--link); }
.site-filter-active,
.site-filter:hover {
  border-color: var(--accent);
  background: rgba(36, 153, 232, .1);
}
.result-card-site { gap: 8px; }
.site-type-pill,
.site-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: .74rem;
}
.site-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 12px;
  color: #8190a2;
  font-size: .8rem;
}
.site-detail-shell { padding-bottom: 32px; }
.site-detail-card { margin-top: 20px; }
.site-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.site-detail-grid div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.site-detail-grid strong {
  color: var(--text-dim);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.site-detail-title { margin: 0 0 10px; font-size: 1.2rem; color: var(--text-heading); }
.site-detail-line { margin: 10px 0 0; color: var(--text-muted); }
.site-chain-list {
  margin: 0;
  padding-left: 18px;
}
.site-chain-list li {
  margin: 8px 0;
  color: var(--text-muted);
}
.detail-panel {
  margin: 16px 0 0;
  padding: 20px;
  border: 1px solid var(--surface-border);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 7px 20px var(--shadow-soft);
}
.detail-panel h2 {
  margin: 0 0 12px;
  color: var(--text-heading);
  font-size: 1.1rem;
  font-weight: 800;
}
.detail-panel p { margin: 0 0 14px; color: var(--text-muted); font-size: .9rem; }
.public-page .detail-panel table th {
  color: var(--text-dim);
  border-top-color: var(--surface-border);
}
.public-page .detail-panel table td {
  color: var(--text);
  border-top-color: var(--surface-border-soft);
}
.public-page .detail-panel .muted { color: var(--text-muted); }
.public-page .detail-panel a { color: var(--link); }
.public-page .detail-panel code {
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-soft);
  background: rgba(36, 153, 232, .1);
  font-size: .85em;
}
.pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: 30px 0 0; }
.page-button { display: inline-grid; min-width: 36px; height: 36px; padding: 0 10px; place-items: center; border: 1px solid var(--surface-border); border-radius: 10px; color: var(--text-muted) !important; background: var(--input-bg); text-decoration: none; font-size: .88rem; }
a.page-button:hover, .page-button.is-current { border-color: var(--accent); color: #fff !important; background: var(--accent); }
.page-arrow { font-size: 1.3rem; line-height: 1; }
.page-ellipsis { padding: 0 4px; color: var(--text-dim); }
.empty-state { margin: 45px auto; padding: 52px 20px; text-align: center; border: 1px dashed var(--surface-border); border-radius: 18px; background: var(--surface-soft); }
.empty-icon { color: var(--accent); font-size: 2.7rem; line-height: 1; }
.empty-state h2 { margin: 13px 0 7px; color: var(--text); font-size: 1.25rem; }
.empty-state p { margin: 0 0 18px; color: var(--text-muted); }
.secondary-button { display: inline-block; padding: 10px 15px; border: 1px solid var(--surface-border); border-radius: 10px; color: var(--link) !important; background: var(--input-bg); text-decoration: none; font-weight: 700; }
.secondary-button:hover { background: rgba(36, 153, 232, .1); }
@media (max-width: 680px) {
  .search-hero { width: min(100% - 24px, 720px); padding: 20px 0 28px; }
  .hero-toolbar { width: 100%; margin-bottom: 14px; }
  .hero-search { flex-direction: column; padding: 8px; border-radius: 12px; }
  .hero-search input { height: 44px; }
  .hero-search button { width: 100%; height: 44px; min-width: 0; }
  .home-categories-toggle { flex-wrap: wrap; padding: 10px 12px; }
  .home-categories-meta { margin-left: 0; width: 100%; text-align: left; white-space: normal; order: 3; }
  .home-categories-chevron { margin-left: auto; }
  .category-pills { gap: 5px; padding: 10px; }
  .category-pill { padding: 7px 9px; font-size: .78rem; }
  .home-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 0;
    padding: 16px 0;
  }
  .home-stat:nth-child(2n)::after { display: none; }
  .home-stat:not(:last-child)::after { top: 18%; bottom: 18%; }
  .hero-copy {
    white-space: normal;
    font-size: .74rem;
  }
  .home-footer-inner {
    flex-wrap: wrap;
    justify-content: center;
    white-space: normal;
    gap: 6px 10px;
    padding: 10px 0 14px;
    font-size: .64rem;
  }
  .results-topbar {
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
  }
  .results-brand { order: 1; }
  .results-topbar .site-toolbar { order: 2; margin-left: auto; }
  .results-topbar .results-search,
  .results-topbar .ac-anchor { order: 3; flex: 1 1 100%; max-width: none; }
  .results-heading { align-items: start; flex-direction: column; gap: 10px; }
  .results-heading h1 { max-width: calc(100vw - 32px); }
  .results-heading-side { width: 100%; justify-content: flex-start; }
  .results-tabs { gap: 6px; }
  .results-tab { padding: 7px 11px; font-size: .8rem; }
  .result-card { padding: 14px; }
  .result-card-layout { gap: 11px; }
  .result-favicon { width: 38px; height: 38px; font-size: .9rem; }
  .site-toolbar { gap: 5px; }
  .lang-dropdown-toggle { min-height: 32px; padding: 0 9px; font-size: .74rem; }
  .lang-dropdown-current { max-width: 84px; }
  .theme-toggle { width: 32px; height: 32px; }
  .login-card { padding: 27px 22px; }
}


/* Shared base and admin dashboard */
:root {
  --admin-text: #172033;
  --admin-muted: #6e7c90;
  --admin-border: #e1e8f1;
  --admin-blue: #2499e8;
  --admin-red: #c94b53;
  --admin-green: #198754;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--admin-text);
  background: #f7f9fc;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.45;
}
a { color: #147fc5; }
a:hover { text-decoration: underline; }
button, input { font: inherit; }

/* Login fallback used by the TON browser */
.home { width: min(100% - 32px, 620px); margin: 0 auto; padding: 15vh 0 48px; text-align: center; }
.brand { margin: 0 0 8px; font-size: 2.3rem; font-weight: 800; letter-spacing: -.04em; }
.brand a { color: var(--admin-text); text-decoration: none; }
.tagline { margin: 0 0 24px; color: var(--admin-muted); }
.search-form { display: flex; gap: 8px; justify-content: center; align-items: center; width: 100%; }
.search-form input { min-width: 0; flex: 1; height: 42px; padding: 0 13px; border: 1px solid var(--admin-border); border-radius: 10px; outline: 0; background: #fff; }
.search-form input:focus { border-color: #9ed3f5; box-shadow: 0 0 0 3px rgba(36,153,232,.12); }
.search-form button { height: 42px; padding: 0 18px; border: 0; border-radius: 10px; color: #fff; background: var(--admin-blue); cursor: pointer; font-weight: 700; }
.search-form button:hover { background: #1688d4; }

.admin-shell { min-height: 100vh; background: #f7f9fc; }
.admin-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 17px 28px; border-bottom: 1px solid var(--admin-border); background: #fff; }
.admin-header a { color: #147fc5; text-decoration: none; font-weight: 600; }
.admin-header a:hover { text-decoration: underline; }
.admin-label { margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--admin-border); color: var(--admin-muted); font-weight: 400; }
.brand-inline { color: var(--admin-text) !important; font-size: 1.15rem; font-weight: 800 !important; letter-spacing: -.02em; }
.admin-main { width: min(100% - 32px, 1180px); margin: 0 auto; padding: 32px 0 64px; }
.admin-main h1 { margin: 0 0 5px; color: #121a2a; font-size: clamp(1.65rem, 3vw, 2.15rem); font-weight: 800; letter-spacing: -.035em; }
.admin-intro { margin: 0 0 22px; color: var(--admin-muted); }
.flash { margin: 16px 0; padding: 12px 14px; border-radius: 10px; }
.flash-success { border: 1px solid #b9e4c9; color: #176b3a; background: #eaf8ef; }
.flash-error { border: 1px solid #f1c0c4; color: #9e2f39; background: #fff0f1; }
.stat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; }
.stat-card { display: flex; min-height: 92px; flex-direction: column; justify-content: center; gap: 4px; padding: 15px; border: 1px solid var(--admin-border); border-radius: 13px; background: #fff; box-shadow: 0 6px 18px rgba(48,86,135,.045); }
.stat-card-link { color: inherit; text-decoration: none; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.stat-card-link:hover { border-color: #9ed3f5; box-shadow: 0 10px 24px rgba(36,153,232,.12); transform: translateY(-1px); }
.stat-card-link:focus-visible { outline: 2px solid var(--admin-blue); outline-offset: 2px; }
.stat-hint { margin-top: 2px; color: #147fc5; font-size: .72rem; font-style: normal; font-weight: 700; }
.stat-card strong { color: #121a2a; font-size: 1.72rem; font-weight: 800; }
.stat-card span { color: var(--admin-muted); font-size: .8rem; }
.panel-link { margin-left: 8px; color: #147fc5; font-size: .82rem; font-weight: 600; text-decoration: none; }
.panel-link:hover { text-decoration: underline; }
.bar-row-link { color: inherit; text-decoration: none; transition: background .12s; border-radius: 8px; margin: 0 -6px; padding-left: 6px; padding-right: 6px; }
.bar-row-link:hover { background: #f3faff; }
.bar-row-link strong { color: #147fc5; }
.explore-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 16px; }
.explore-total { display: flex; min-width: 120px; flex-direction: column; align-items: flex-end; gap: 2px; padding: 12px 16px; border: 1px solid var(--admin-border); border-radius: 12px; background: #fff; }
.explore-total strong { color: #121a2a; font-size: 1.6rem; font-weight: 800; }
.explore-total span { color: var(--admin-muted); font-size: .78rem; }
.explore-filter-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.explore-search { flex: 1; min-width: 220px; }
.explore-filters label span { display: block; margin-bottom: 5px; color: #53657b; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.explore-filters input[type="search"], .explore-filters select { width: 100%; min-width: 160px; height: 40px; padding: 0 11px; border: 1px solid var(--admin-border); border-radius: 9px; background: #fff; }
.explore-filters input[type="search"]:focus, .explore-filters select:focus { border-color: #9ed3f5; box-shadow: 0 0 0 3px rgba(36,153,232,.12); outline: 0; }
.explore-submit { min-height: 40px !important; padding: 0 16px !important; border: 0 !important; color: #fff !important; background: var(--admin-blue) !important; font-weight: 700 !important; }
.explore-breakdown h2 { margin-bottom: 12px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; flex-direction: column; gap: 2px; max-width: 100%; padding: 8px 11px; border: 1px solid #dce6f0; border-radius: 10px; color: #42566d; background: #f8fbff; text-decoration: none; font-size: .82rem; }
.chip:hover { border-color: #9ed3f5; background: #eef8ff; }
.chip-active { border-color: var(--admin-blue); background: #e7f3fc; box-shadow: inset 0 0 0 1px rgba(36,153,232,.25); }
.chip-count { color: #121a2a; font-size: 1rem; font-weight: 800; }
.chip-label { line-height: 1.25; }
.chip-code { display: block; margin-top: 2px; color: #8a97a8; font-size: .68rem; word-break: break-all; }
.explore-table-meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--admin-muted); font-size: .82rem; }
.explore-table code { word-break: break-all; font-size: .78rem; }
.cell-url code { display: block; margin-top: 4px; color: #6e7c90; }
.cell-muted { color: var(--admin-muted); font-size: .82rem; }
.explore-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0; }
.admin-pagination { justify-content: flex-start; }
.pagination-meta { margin-left: auto; font-size: .82rem; }
.admin-seeds-search { margin: 12px 0 4px; }
.admin-seeds-list { margin-top: 16px; }
.admin-seeds-list > summary { cursor: pointer; font-weight: 700; }
.admin-panel { margin: 16px 0; padding: 20px; border: 1px solid var(--admin-border); border-radius: 13px; background: #fff; box-shadow: 0 6px 18px rgba(48,86,135,.04); }
.admin-panel h2 { margin: 0 0 8px; color: #172033; font-size: 1.15rem; font-weight: 800; }
.panel-heading p, .admin-panel p { margin: 0 0 14px; color: var(--admin-muted); font-size: .9rem; }
.seed-form label { display: block; margin: 12px 0 7px; color: #34445a; font-size: .9rem; font-weight: 700; }
.seed-form-row { display: flex; gap: 8px; }
.seed-form input[type="text"] { min-width: 0; flex: 1; height: 44px; padding: 0 13px; border: 1px solid var(--admin-border); border-radius: 9px; outline: 0; background: #fff; }
.seed-form input[type="file"] { margin: 4px 0 8px; font-size: .9rem; }
.seed-form textarea { width: 100%; min-height: 120px; padding: 10px 13px; border: 1px solid var(--admin-border); border-radius: 9px; outline: 0; background: #fff; font: inherit; resize: vertical; }
.seed-form textarea:focus { border-color: #9ed3f5; box-shadow: 0 0 0 3px rgba(36,153,232,.12); }
.seed-form input[type="text"]:focus { border-color: #9ed3f5; box-shadow: 0 0 0 3px rgba(36,153,232,.12); }
.seed-form button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 9px; color: #fff; background: var(--admin-blue); cursor: pointer; white-space: nowrap; font-weight: 700; }
.seed-form button:hover { background: #1688d4; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 10px 8px; border-top: 1px solid var(--admin-border); text-align: left; vertical-align: top; }
th { color: var(--admin-muted); font-size: .75rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
th.th-sort a { color: inherit; text-decoration: none; white-space: nowrap; }
th.th-sort a:hover { color: var(--admin-blue); }
th.th-sort-active a { color: var(--admin-blue); }
th.th-sort-active.th-sort-asc a::after { content: " ▲"; font-size: .65em; opacity: .85; }
th.th-sort-active.th-sort-desc a::after { content: " ▼"; font-size: .65em; opacity: .85; }
td small { display: block; margin-top: 3px; color: var(--admin-muted); word-break: break-all; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; white-space: nowrap; }
.actions form { margin: 0; }
.button-small { display: inline-flex; min-height: 31px; align-items: center; justify-content: center; padding: 4px 9px; border: 1px solid #d8e2ec; border-radius: 7px; color: #53657b !important; background: #fff; cursor: pointer; font-size: .82rem; text-decoration: none !important; }
.button-small:hover { border-color: var(--admin-blue); color: #147fc5 !important; background: #f3faff; }
.button-danger:hover { border-color: var(--admin-red); color: var(--admin-red) !important; background: #fff7f7; }
.delete-confirm { display: inline-flex; align-items: center; gap: 6px; }
.delete-confirm summary { list-style: none; }
.delete-confirm summary::-webkit-details-marker { display: none; }
.delete-question { color: var(--admin-red); font-size: .8rem; }
.status-pill { display: inline-block; padding: 3px 8px; border-radius: 999px; color: #607086; background: #eef2f6; font-size: .77rem; }
.status-ok, .status-done { color: #167443; background: #e7f7ed; }
.status-pending, .status-crawling { color: #1765a0; background: #e7f3fc; }
.status-error, .status-paused { color: #a0323a; background: #fff0f1; }
.recrawl-time { font-size: .84rem; font-weight: 600; color: #334155; }
.recrawl-time.status-due { color: #b45309; }
.recrawl-time.status-soon { color: #1765a0; }
.recrawl-time.muted { color: var(--admin-muted); font-weight: 500; }
td.nowrap { white-space: nowrap; font-size: .84rem; }
.bar-row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-top: 1px solid var(--admin-border); }
.admin-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
details > summary { cursor: pointer; font-weight: 700; }
.muted { color: var(--admin-muted); }
.hero-footnote strong { color: #718095; font-weight: 800; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .home { padding-top: 10vh; }
  .search-form { flex-direction: column; }
  .search-form input, .search-form button { width: 100%; }
  .admin-header { align-items: flex-start; flex-direction: column; padding: 15px 16px; gap: 10px; }
  .admin-main { width: min(100% - 24px, 1180px); padding-top: 22px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-columns { grid-template-columns: 1fr; }
  .seed-form-row { flex-direction: column; }
  .seed-form button { width: 100%; }
  .actions { flex-direction: column; align-items: flex-start; }
  .delete-confirm { flex-wrap: wrap; }
}


/* Site toolbar: language dropdown + theme toggle */
.site-toolbar {
  position: relative;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lang-dropdown { position: relative; }
.lang-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--toolbar-border);
  border-radius: 9px;
  color: var(--text-soft);
  background: var(--toolbar-bg);
  box-shadow: 0 1px 2px var(--shadow-soft);
  cursor: pointer;
  font: inherit;
  font-size: .78rem;
  font-weight: 600;
}
.lang-dropdown-toggle:hover,
.theme-toggle:hover {
  color: var(--link);
  border-color: rgba(36, 153, 232, .35);
}
.lang-dropdown-toggle:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.lang-dropdown-current { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-dropdown-chevron { color: var(--text-dim); font-size: .72rem; transition: transform .18s ease; }
.lang-dropdown.is-open .lang-dropdown-chevron { transform: rotate(180deg); }
.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 148px;
  padding: 5px;
  border: 1px solid var(--toolbar-border);
  border-radius: 10px;
  background: var(--input-bg);
  box-shadow: 0 10px 28px var(--toolbar-shadow);
}
.lang-dropdown-item {
  display: block;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--text) !important;
  text-decoration: none;
  font-size: .82rem;
  font-weight: 500;
}
.lang-dropdown-item:hover { background: rgba(36, 153, 232, .1); color: var(--link) !important; text-decoration: none; }
.lang-dropdown-item.is-active { background: rgba(36, 153, 232, .14); color: var(--link) !important; }
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--toolbar-border);
  border-radius: 9px;
  color: var(--text-soft);
  background: var(--toolbar-bg);
  box-shadow: 0 1px 2px var(--shadow-soft);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.theme-icon {
  width: 18px;
  height: 18px;
  grid-area: 1 / 1;
  transition: opacity .28s ease, transform .34s ease;
  transform-origin: center;
}
/* Light theme → show moon (switch to dark). Dark theme → show sun (switch to light). */
.theme-icon-sun {
  opacity: 0;
  transform: rotate(-70deg) scale(.65);
  pointer-events: none;
}
.theme-icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
[data-theme="dark"] .theme-icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
  pointer-events: auto;
}
[data-theme="dark"] .theme-icon-moon {
  opacity: 0;
  transform: rotate(70deg) scale(.65);
  pointer-events: none;
}
html.theme-animating,
html.theme-animating body {
  transition: background-color .32s ease, color .32s ease;
}
@media (prefers-reduced-motion: reduce) {
  .theme-icon { transition: none; }
  html.theme-animating,
  html.theme-animating body { transition: none; }
}

.login-page {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  color: var(--text);
  background: radial-gradient(circle at 50% 0%, var(--page-glow), transparent 38rem), var(--page-bg);
}
.login-card {
  width: min(100%, 420px);
  padding: 34px;
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 18px 50px var(--toolbar-shadow);
}
.login-brand { display: inline-block; margin-bottom: 28px; color: var(--text) !important; text-decoration: none; font-size: 1.15rem; font-weight: 800; }
.login-card .eyebrow { margin: 0 0 10px; color: var(--accent); font-size: .72rem; font-weight: 800; letter-spacing: .2em; }
.login-card h1 { margin: 0 0 22px; color: var(--text-heading); font-size: 1.55rem; line-height: 1.25; letter-spacing: -.03em; }
.login-form { display: grid; gap: 9px; }
.login-form label { color: var(--text-muted); font-size: .83rem; font-weight: 700; }
.login-form input { width: 100%; box-sizing: border-box; height: 45px; padding: 0 13px; border: 1px solid var(--input-border); border-radius: 10px; outline: 0; color: var(--text); background: var(--input-bg); font: inherit; }
.login-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(36, 153, 232, .13); }
.login-form button { min-height: 45px; margin-top: 9px; border: 0; border-radius: 10px; color: #fff; background: var(--accent); cursor: pointer; font: inherit; font-weight: 700; }
.login-form button:hover { background: #1688d4; }
.login-card .flash { margin: 0 0 18px; }

.search-log-list { display: grid; gap: 8px; margin-top: 12px; }
.search-log-ip { padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
.search-log-ip > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; }
.search-log-queries { margin: 10px 0 0; padding: 0 0 0 18px; list-style: disc; }
.search-log-queries li { margin: 4px 0; color: #172033; }
.search-log-queries code { font-size: .9rem; }

.ac-anchor {
  position: relative;
  width: min(100%, 670px);
  margin: 0 auto;
  z-index: 30;
}
.search-hero > .ac-anchor {
  width: min(100%, 640px);
  margin: 2.5em auto 0;
}
.ac-anchor .hero-search { width: 100%; margin: 0; }
.results-topbar .ac-anchor {
  flex: 1 1 260px;
  max-width: 620px;
  width: auto;
  margin: 0;
}
.results-topbar .ac-anchor .results-search { width: 100%; max-width: 100%; margin: 0; }

.ac-list {
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  right: 0;
  z-index: 35;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: #fff;
  border: 1px solid #dfe7f0;
  border-top: 0;
  border-radius: 0 0 14px 14px;
  box-shadow: 0 10px 28px rgba(48, 86, 135, .12);
  overflow: hidden;
}
.ac-item {
  padding: 10px 20px;
  font-size: 15px;
  color: #5f6368;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  list-style: none;
  text-align: left;
}
.ac-item:hover,
.ac-item.ac-active {
  background: #eef4fb;
  color: #172033;
}
html[data-theme="dark"] .ac-list {
  background: #151b24;
  border-color: #2f3a48;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .45);
}
html[data-theme="dark"] .ac-item {
  color: #c8d4e0;
}
html[data-theme="dark"] .ac-item:hover,
html[data-theme="dark"] .ac-item.ac-active {
  background: rgba(61, 169, 234, .18);
  color: #f0f4f8;
}
.hero-search.ac-form-open,
.results-search.ac-form-open {
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  position: relative;
  z-index: 36;
}
