/* ── MAIN LAYOUT ── */
main { max-width: 1360px; margin: 0 auto; padding: 16px 24px 8px; }

  
  
/* ── TRENDING STRIP ── */
#trending-outer {
  max-width: 1360px;
  margin: 0 auto;
  min-width: 0;
  width: 100%;
}
.trending-section {
  padding: 22px 24px 0;
  min-width: 0; width: 100%;
  box-sizing: border-box;
}
.trending-scroll {
  display: flex; gap: 12px;
  overflow-x: auto; overflow-y: visible;
  padding: 4px 0 12px;
  scrollbar-width: none;
  min-width: 0; width: 100%;
}
.trending-scroll::-webkit-scrollbar { display: none; }


.trending-chip {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 10px;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  transition: border-color var(--trans), transform var(--trans);
  text-decoration: none; color: inherit;
  cursor: pointer;
  font-family: inherit; text-align: left;
  min-width: 0;
}
.trending-chip:hover { border-color: var(--accent); transform: translateY(-2px); }
.trending-chip img {
  width: 24px; height: 24px; border-radius: 5px;
  background: var(--canvas);
}
.tc-info {
  flex: 1 1 auto;
}
.tc-name {
  font-size: 0.85rem; font-weight: 600;
  white-space: nowrap;
}
.tc-cat {
  font-size: 0.7rem; color: var(--ink4); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tc-rank {
  font-family: var(--mono);
  font-size: 0.65rem; color: var(--ink4);
  margin-left: 8px; padding-left: 8px;
  border-left: 1px solid var(--rule2);
  line-height: 1;
  flex-shrink: 0;
  display: flex; align-items: center; gap: 3px;
  white-space: nowrap;
}
.tc-medal { font-size: 0.85rem; line-height: 1; }
  @media(max-width:768px){ .trending-section { padding: 16px 16px 0; } }

  @media(max-width:640px){
  .trending-section { padding: 14px 12px 0; }
  .trending-chip { padding: 6px 10px; }
  .tc-name { font-size: 0.8rem; }
  .tc-cat { font-size: 0.66rem; }
}

/* ── BROWSE TOOLBAR (view density + sort) ── */
.browse-toolbar {
  position: sticky; top: calc(var(--nav-h) + var(--cat-strip-h, 45px)); z-index: 185;
  background: var(--canvas);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  padding: 10px 0;
  margin-bottom: 16px;
}
.toolbar-group {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 2px;
  background: var(--canvas);
  border: 1px solid var(--rule);
  border-radius: 7px;
  padding: 3px;
}
.toolbar-btn {
  border: none; background: none;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 8px;
  font-size: 0.8rem; font-weight: 500;
  color: var(--ink3);
  border-radius: 5px;
  transition: background var(--trans), color var(--trans);
}
.toolbar-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.toolbar-btn-icon { font-size: 0.85em; line-height: 1; flex-shrink: 0; }
.toolbar-btn:hover { color: var(--ink); }
.toolbar-btn.active {
  background: var(--white);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
[data-theme="dark"] .toolbar-btn.active { background: var(--rule); }

/* Pricing/Sort collapse to <select> dropdowns whenever the toolbar can't fit one row.
   JS (updateToolbarLayout) measures real overflow and toggles .toolbar-compact, so this
   adapts to any container width/zoom/translated-label-length — not just a guessed breakpoint.
   The @media rule below is only a pre-JS / no-JS safety net for small screens. */
.toolbar-select { display: none; }
.browse-toolbar.toolbar-measuring { flex-wrap: nowrap; overflow: hidden; }
@media (max-width: 760px) {
  .toolbar-group-pricing, .toolbar-group-sort { display: none; }
  .toolbar-select {
    display: block;
    height: 32px;
    padding: 0 10px;
    background: var(--canvas);
    border: 1px solid var(--rule);
    border-radius: 7px;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 0.8rem; font-weight: 500;
  }
}
.browse-toolbar.toolbar-compact .toolbar-group-pricing,
.browse-toolbar.toolbar-compact .toolbar-group-sort { display: none; }
.browse-toolbar.toolbar-compact .toolbar-select {
  display: block;
  height: 32px;
  padding: 0 10px;
  background: var(--canvas);
  border: 1px solid var(--rule);
  border-radius: 7px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.8rem; font-weight: 500;
}
.browse-toolbar.toolbar-compact .toolbar-group:not(.toolbar-group-pricing):not(.toolbar-group-sort) .toolbar-btn {
  padding: 6px 9px;
}

/* ── SEARCH RESULTS ── */
#search-view { display: none; padding: 28px 0; }
#search-view .sr-header {
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
#search-view .sr-title {
  font-family: var(--serif);
  font-size: 1.5rem; font-weight: 400;
  margin-bottom: 4px;
}
#search-view .sr-sub {
  font-family: var(--mono);
  font-size: 0.72rem; color: var(--ink4);
  letter-spacing: 0.04em;
}
.no-results {
  padding: 60px 0; text-align: center;
  color: var(--ink3);
}
.no-results .nr-big {
  font-family: var(--serif); font-size: 1.6rem; font-weight: 400;
  margin-bottom: 8px; color: var(--ink);
}
.no-results p { font-size: 0.88rem; max-width: 340px; margin: 0 auto; }
#search-view .box-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media(max-width:980px){ #search-view .box-grid { grid-template-columns: repeat(2,1fr); } }
@media(max-width:640px){ #search-view .box-grid { grid-template-columns: 1fr; } }
#search-view .row-list { max-height: none; }

body.has-search .cat-strip { display: none; }
body.has-search #browse-view { display: none; }
body.has-search .toolbar-browse { display: none; }
#search-view .toolbar-search { top: var(--nav-h); margin-top: -6px; }
body.has-search #search-view { display: block; }
body.has-search .hero-collapsible { display: none; }

/* ── BOXED GRID (core layout, inspired by reference) ── */
.box-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
@media(max-width:980px){ .box-grid { grid-template-columns: repeat(2,1fr); } }
@media(max-width:640px){ .box-grid { grid-template-columns: 1fr; } }

.cat-box {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: box-shadow var(--trans), border-color var(--trans);
}
.cat-box:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.05); border-color: var(--rule2); }
.box-head {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 14px;
  border: none; border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
  width: 100%;
  background: none;
  text-align: left;
  font-family: inherit;
  position: relative;
  transition: background var(--trans);
}
.box-head:hover { background: var(--canvas); }
.box-head:hover .box-title { color: var(--accent); }
.box-head:active { background: var(--accent-bg); }
.box-head-visit {
  position: absolute; top: 50%; right: 14px;
  transform: translateY(-50%);
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: var(--white);
  border: 1px solid var(--rule2);
  border-radius: var(--radius);
  color: var(--accent);
  opacity: 0; pointer-events: none;
  transition: opacity var(--trans), background var(--trans), border-color var(--trans);
  flex-shrink: 0;
}
.box-head:hover .box-head-visit { opacity: 1; }
.box-head-visit:hover { background: var(--accent-bg); border-color: var(--accent); }
.box-icon {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--accent-bg); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.box-icon svg { width: 16px; height: 16px; flex-shrink: 0; }
.box-title {
  font-size: 0.92rem; font-weight: 600; color: var(--ink);
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color var(--trans);
}
.box-count {
  font-family: var(--mono); font-size: 0.68rem; font-weight: 600;
  color: var(--ink4); background: var(--canvas);
  border: 1px solid var(--rule);
  border-radius: 999px; min-width: 22px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 6px; flex-shrink: 0;
}

.row-list {
  flex: 1;
}
.box-viewall {
  flex-shrink: 0;
  width: 100%;
  padding: 9px 14px;
  border: none; border-top: 1px solid var(--rule);
  background: var(--canvas); color: var(--accent);
  font-size: 0.78rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background var(--trans);
}
.box-viewall:hover { background: var(--accent-bg); }
.box-viewall svg { flex-shrink: 0; }

.viewall-modal .modal-card { max-width: 560px; }
.viewall-modal .row-list { max-height: 60vh; overflow-y: auto; }
.s-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--rule);
  transition: background var(--trans);
  position: relative;
}
.s-row:last-child { border-bottom: none; }
.s-row:hover { background: var(--canvas); }
.s-row:hover .row-name { color: var(--ink); }

.viewall-more-row { cursor: pointer; }
.viewall-more-row .row-name { color: var(--accent); font-weight: 600; }
.viewall-more-row:hover { background: var(--accent-bg); }
.viewall-more-row:hover .row-name { color: var(--accent); }
.viewall-more-row svg { color: var(--accent); flex-shrink: 0; }

.row-fav-wrap { position: relative; flex-shrink: 0; text-decoration: none; color: inherit; }
.s-row:not(.ad-row) .row-fav-wrap { cursor: pointer; }
.row-fav {
  width: 22px; height: 22px; border-radius: 4px;
  flex-shrink: 0; background: var(--canvas);
  border: 1px solid var(--rule);
  object-fit: cover;
}
.row-fav-fb {
  width: 22px; height: 22px; border-radius: 4px;
  background: var(--ink); color: var(--white);
  display: none; align-items: center; justify-content: center;
  font-size: 0.62rem; font-weight: 700; flex-shrink: 0;
}

/* ── STATUS BADGE — small inline icon chip next to the name, distinct from .row-tag pills ── */
.status-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  font-size: 11px; line-height: 1; font-weight: 700;
  flex-shrink: 0; margin-right: 5px;
  box-sizing: border-box;
}
.status-badge.sb-featured { background: #F5B400; color: #5C4400; }
.status-badge.sb-trending { background: #F0653C; color: #fff; }
.status-badge.sb-editor   { background: #3B7CE0; color: #fff; }
.status-badge.sb-gem      { background: #8B5CF6; color: #fff; }
#browse-view.compact .status-badge { width: 16px; height: 16px; font-size: 10px; }
.sc-fav-wrap { position: relative; display: inline-flex; flex-shrink: 0; }

.row-text {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 1px;
}
.row-name {
  font-size: 0.95rem; font-weight: 500; color: var(--ink2); margin-right: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-decoration: none;
  display: inline;
}
.row-name:hover { color: var(--accent); }
.row-name-line {
  display: flex; align-items: center; gap: 0;
  min-width: 0;
  width: fit-content; max-width: 100%;
}
.row-name-line .row-name { flex: 0 1 auto; min-width: 0; }
.row-name-line .row-tag { flex-shrink: 0; margin-left: 0; }
.row-tag, .hero-recent-tag {
  font-family: var(--mono); font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.03em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 3px; flex-shrink: 0;
}
.row-tag.ad-tag { background: none; color: var(--ink4); font-size: 0.44rem; padding: 1px 2px; border: 1px solid var(--rule); border-radius: 4px; }
/* SHARED PRICING TAG STYLES — used by both .row-tag (list rows) and
   .hero-recent-tag (hero "recently added" cards) so the two never drift apart. */
.row-tag.pricing-free,     .hero-recent-tag.pricing-free        { background: #E3F5EA; color: #1A7A4A; }
.row-tag.pricing-freemium, .hero-recent-tag.pricing-freemium    { background: #EFE9FB; color: #6B3FA0; }
.row-tag.pricing-paid,     .hero-recent-tag.pricing-paid        { background: #E8EBF0; color: #3A4A66; }
.row-tag.pricing-trial,    .hero-recent-tag.pricing-trial       { background: #FDE9D7; color: #B8530A; }
[data-theme="dark"] .row-tag.pricing-free,       [data-theme="dark"] .hero-recent-tag.pricing-free       { background: #123326; color: #34D399; }
[data-theme="dark"] .row-tag.pricing-freemium,   [data-theme="dark"] .hero-recent-tag.pricing-freemium   { background: #2A2140; color: #C3A6F5; }
[data-theme="dark"] .row-tag.pricing-paid,       [data-theme="dark"] .hero-recent-tag.pricing-paid       { background: #232A36; color: #9FB3D9; }
[data-theme="dark"] .row-tag.pricing-trial,      [data-theme="dark"] .hero-recent-tag.pricing-trial      { background: #3A2410; color: #F2A35C; }

/* ── COMPACT VIEW MODE ── */
#browse-view.compact .box-head { padding: 8px 12px; gap: 7px; }
#browse-view.compact .box-icon { width: 20px; height: 20px; }
#browse-view.compact .box-icon svg { width: 16px; height: 16px; }
#browse-view.compact .box-title { font-size: 0.84rem; }
#browse-view.compact .box-count { height: 17px; font-size: 0.62rem; }
#browse-view.compact .s-row { padding: 5px 12px; gap: 7px; }
#browse-view.compact .row-fav, #browse-view.compact .row-fav-fb { width: 17px; height: 17px; font-size: 0.5rem; }
#browse-view.compact .row-name { font-size: 0.82rem; }
#browse-view.compact .row-like, #browse-view.compact .row-open, #browse-view.compact .row-info { height: 19px; }
#browse-view.compact .row-info { width: 19px; }
#browse-view.compact .row-tag { font-size: 0.54rem; padding: 1px 5px; }
#browse-view.compact .row-tag.ad-tag { font-size: 0.44rem; padding: 1px 2px; }
#browse-view.compact .box-viewall { padding: 6px 12px; font-size: 0.72rem; }

.row-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.row-like, .row-open, .row-info {
  height: 22px; padding: 0 7px;
  border: 1px solid var(--rule); background: none;
  color: var(--ink4); font-size: 0.78rem;
  display: flex; align-items: center; gap: 4px; justify-content: center;
  border-radius: 4px;
  transition: color var(--trans), background var(--trans), border-color var(--trans);
}
.row-info { width: 22px; padding: 0; flex-shrink: 0; }
.row-info:hover, .row-info:focus-visible { color: var(--accent); border-color: var(--accent); background: var(--accent-bg); }
.row-count {
  font-family: var(--mono); font-size: 0.66rem; font-weight: 600;
  line-height: 1;
}
.row-like:hover { color: #E0263B; border-color: #E0263B; background: rgba(224,38,59,0.08); }
.row-like.rated { color: #E0263B; border-color: #E0263B; background: rgba(224,38,59,0.06); }
.row-like.rated:hover { color: #B81C2E; border-color: #B81C2E; }
.row-open:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-bg); }
.row-open svg, .row-like svg { flex-shrink: 0; }
.row-like:disabled { cursor: default; }
.row-like:disabled:hover { color: var(--ink4); border-color: var(--rule); background: none; }
.row-info:disabled { cursor: default; }
.row-info:disabled:hover { color: var(--ink4); border-color: var(--rule); background: none; }

/* ── CATEGORY SECTION (full-width — homepage browse view) ── */
#browse-view { display: flex; flex-direction: column; gap: 34px; }
.cat-section { width: 100%; }
.cs-head {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: 14px 28px;
  padding-bottom: 14px; margin-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  position: relative; cursor: pointer;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 10px 12px 14px;
  margin: 0 -12px 16px;
  transition: background var(--trans);
}
.cs-head:hover { background: var(--canvas); }
.cs-head-visit {
  position: absolute; top: 50%; right: 12px;
  transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 50px; height: 50px;
  background: var(--white);
  border: 1px solid var(--rule2);
  border-radius: var(--radius);
  color: var(--accent);
  opacity: 0; pointer-events: none;
  transition: opacity var(--trans), background var(--trans);
}
.cs-head:hover .cs-head-visit { opacity: 1; pointer-events: auto; }
.cs-head-visit:hover { background: var(--accent-bg); border-color: var(--accent); }
.cs-head-left { display: flex; flex-direction: column; gap: 2px; }
.cs-title-link { display: inline-flex; }
.cs-title {
  font-family: var(--serif); font-weight: 400;
  font-size: 1.3rem; letter-spacing: -0.01em;
  color: var(--ink); transition: color var(--trans);
}
.cs-title-link:hover .cs-title { color: var(--accent); }
.cs-count {
  font-family: var(--mono); font-size: 0.7rem; color: var(--ink4); letter-spacing: 0.03em;
}
.cs-desc { font-size: 0.85rem; color: var(--ink3); font-weight: 300; max-width: 480px; line-height: 1.5; padding-right: 64px; }
.cs-viewall { display: flex; justify-content: center; margin-top: 16px; }
.cs-list {
  border: 1px solid var(--rule); border-radius: var(--radius-md);
  background: var(--white); overflow: hidden;
}
.cs-viewall-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border: 1px solid var(--rule); border-radius: 999px;
  background: var(--white); color: var(--accent);
  font-size: 0.78rem; font-weight: 600;
  transition: background var(--trans), border-color var(--trans);
}
.cs-viewall-btn:hover { background: var(--accent-bg); border-color: var(--accent); }

/* ── SITE CARD (detailed view) ── */
.cs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  overflow: hidden;
}


/* ── SITE CARD ── */
.s-card {
  background: var(--white);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 10px;
  transition: background var(--trans);
  position: relative;
}
.s-card::after {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--accent);
  opacity: 0; transition: opacity var(--trans);
}
.s-card:hover { background: var(--canvas); }
.s-card:hover::after { opacity: 1; }

.sc-top { display: flex; align-items: center; gap: 11px; }
.sc-fav {
  width: 36px; height: 36px; border-radius: 7px;
  border: 1px solid var(--rule);
  background: var(--canvas);
  object-fit: cover; flex-shrink: 0;
}
.sc-fav-fb {
  width: 36px; height: 36px; border-radius: 7px;
  background: var(--ink); color: var(--white);
  display: none; align-items: center; justify-content: center;
  font-family: var(--sans); font-size: 0.85rem; font-weight: 700;
  flex-shrink: 0;
}
.sc-name-wrap { min-width: 0; flex: 1; }
.sc-name-line { display: flex; align-items: center; gap: 0; min-width: 0; }
.sc-name {
  font-size: 0.9rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--ink);
  flex: 1; min-width: 0;
}
.sc-cat {
  font-family: var(--mono);
  font-size: 0.62rem; color: var(--ink4);
  letter-spacing: 0.05em; text-transform: uppercase;
  margin-top: 1px;
}
.sc-desc {
  font-size: 0.8rem; color: var(--ink3); font-weight: 300;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.5;
}
.sc-row {
  display: flex; align-items: center; gap: 0;
  border-top: 1px solid var(--rule);
  padding-top: 10px; margin-top: 2px;
}
.sc-stat {
  display: flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-size: 0.66rem;
  color: var(--ink4); padding-right: 10px;
  border-right: 1px solid var(--rule); margin-right: 10px;
}
.sc-stat:last-of-type { border-right: none; margin-right: auto; }
.sc-stat-icon { font-size: 0.75rem; }
.sc-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.sc-visit {
  height: 28px; width: 28px; padding: 0;
  border-radius: var(--radius);
  font-size: 0.73rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  text-decoration: none;
  border: 1px solid var(--rule);
  background: none; color: var(--ink4);
  transition: border-color var(--trans), color var(--trans), background var(--trans);
}
.sc-visit:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.sc-visit svg { flex-shrink: 0; }
.sc-like, .sc-share {
  height: 28px; width: 28px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: none; color: var(--ink4);
  font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--trans), color var(--trans), background var(--trans);
}
.sc-like:hover { border-color: #E0263B; color: #E0263B; background: rgba(224,38,59,0.08); }
.sc-like.liked { border-color: #E0263B; color: #E0263B; background: rgba(224,38,59,0.06); }
.sc-like.liked:hover { border-color: #B81C2E; color: #B81C2E; }
.sc-share:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }

mark.hl { background: #FFF176; border-radius: 2px; padding: 0 1px; color: inherit; }
[data-theme="dark"] mark.hl { background: rgba(255,241,118,0.25); }

/* ── INFO TOOLTIP (fixed position, JS-placed, clamped to viewport) ── */
.info-tip {
  position: fixed; z-index: 600;
  width: min(240px, calc(100vw - 20px));
  background: #FFFFFF;
  color: #111110;
  font-size: 0.8rem; font-weight: 400; line-height: 1.5;
  padding: 10px 13px;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.22);
  border: 1px solid #E2E0D8;
  display: none;
  pointer-events: none;
}
.info-tip.show { display: block; }
.info-tip-arrow {
  position: absolute;
  width: 11px; height: 11px;
  background: #FFFFFF;
  border: 1px solid #E2E0D8;
  transform: rotate(45deg);
}
.info-tip.arrow-bottom .info-tip-arrow { bottom: -6px; border-top: none; border-left: none; }
.info-tip.arrow-top .info-tip-arrow { top: -6px; border-bottom: none; border-right: none; }

/* ── RATING HOVER TIP (compact row like-button) ── */
.rating-tip {
  position: fixed; z-index: 600;
  background: #FFFFFF;
  color: #111110;
  font-family: var(--mono);
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.02em;
  padding: 5px 9px;
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.2);
  border: 1px solid #E2E0D8;
  display: none;
  pointer-events: none;
  white-space: nowrap;
  align-items: center; gap: 4px;
}
.rating-tip.show { display: flex; }
.rating-tip-arrow {
  position: absolute; bottom: -5px; left: 50%;
  width: 8px; height: 8px;
  background: #FFFFFF;
  border: 1px solid #E2E0D8;
  border-top: none; border-left: none;
  transform: translateX(-50%) rotate(45deg);
}

/* ── HEART RATING POPUP ── */
.heart-popup {
  position: fixed; z-index: 600;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0,0,0,0.22);
  padding: 10px 12px 8px;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.heart-popup.show { display: flex; }
.hr-row { display: flex; gap: 4px; }
.hr-heart {
  position: relative; width: 22px; height: 22px;
  cursor: pointer; flex-shrink: 0;
}
.hr-half {
  position: absolute; top: 0; bottom: 0; width: 50%; z-index: 2;
  background: none; border: none; padding: 0;
}
.hr-half-left { left: 0; }
.hr-half-right { right: 0; }
.hr-bg, .hr-fg {
  position: absolute; top: 0; left: 0; width: 22px; height: 22px;
  pointer-events: none;
}
.hr-bg path { fill: none; stroke: var(--rule2); stroke-width: 1.6; }
.hr-fg path { fill: #E0263B; stroke: #E0263B; stroke-width: 1.6; }
.hr-fg { clip-path: inset(0 100% 0 0); }
.hr-value {
  font-family: var(--mono); font-size: 0.7rem; font-weight: 600;
  color: var(--ink3); letter-spacing: 0.02em;
}
.hr-value.set { color: #E0263B; }

/* ── TOAST ── */
#toast {
  position: fixed; bottom: 20px; right: 20px;
  background: var(--ink); color: var(--canvas);
  padding: 9px 16px; border-radius: var(--radius-md);
  font-size: 0.8rem; font-weight: 500;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none; z-index: 9999;
  font-family: var(--sans);
}
#toast.show { opacity: 1; transform: translateY(0); }

/* ── SUBMIT MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(10,10,9,0.55);
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal-card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--rule);
  width: 100%; max-width: 440px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--rule);
}
.modal-title { font-family: var(--serif); font-size: 1.25rem; font-weight: 400; color: var(--ink); }
.modal-head-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.modal-head-btn {
  display: flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: 6px;
  border: 1px solid var(--rule); background: none;
  color: var(--ink3); font-size: 0.76rem; font-weight: 600;
  white-space: nowrap;
  transition: background var(--trans), color var(--trans), border-color var(--trans);
}
.modal-head-btn:hover { background: var(--canvas); color: var(--ink); border-color: var(--rule2); }
@media(max-width:480px){ .modal-head-btn span { display: none; } .modal-head-btn { padding: 0 7px; } }
.modal-close {
  width: 28px; height: 28px; border-radius: 6px;
  border: 1px solid var(--rule); background: none;
  color: var(--ink3);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--trans), color var(--trans), border-color var(--trans);
}
.modal-close:hover { background: var(--canvas); color: var(--ink); border-color: var(--rule2); }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-field { display: flex; flex-direction: column; gap: 6px; }
.modal-field label {
  font-size: 0.78rem; font-weight: 600; color: var(--ink2);
}
.modal-field input, .modal-field select, .modal-field textarea {
  height: 38px; padding: 0 12px;
  border: 1px solid var(--rule2); border-radius: var(--radius);
  background: var(--canvas); color: var(--ink);
  font-family: var(--sans); font-size: 0.85rem;
  transition: border-color var(--trans);
}
.modal-field textarea { height: 72px; padding: 8px 12px; resize: vertical; font-family: var(--sans); }
.modal-field input:focus, .modal-field select:focus, .modal-field textarea:focus {
  outline: none; border-color: var(--accent);
}
.modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 16px 20px; border-top: 1px solid var(--rule);
}
.modal-btn-cancel {
  height: 36px; padding: 0 16px;
  background: none; border: 1px solid var(--rule2);
  border-radius: var(--radius); color: var(--ink2);
  font-size: 0.82rem; font-weight: 600;
  transition: background var(--trans);
}
.modal-btn-cancel:hover { background: var(--canvas); }
.modal-btn-submit {
  height: 36px; padding: 0 18px;
  background: #0052CC; border: none;
  border-radius: var(--radius); color: #fff;
  font-size: 0.82rem; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  transition: background var(--trans);
}
.modal-btn-submit:hover { background: #003D99; }
.modal-upsell-link {
  display: block;
  text-align: center;
  padding: 12px 20px;
  border-top: 1px solid var(--rule);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-size: 0.78rem; font-weight: 600;
  color: var(--accent);
  background: var(--canvas);
  transition: background var(--trans), color var(--trans);
}
.modal-upsell-link:hover { background: var(--accent-bg); color: var(--accent-h); }

/* ── BOX GRID EXPAND / COLLAPSE TOGGLE ── */
.box-grid-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 6px auto 20px;
  padding: 8px 20px;
  border: 1px solid var(--rule2);
  background: var(--white);
  border-radius: 999px;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background var(--trans), border-color var(--trans), color var(--trans), box-shadow var(--trans);
}
.box-grid-toggle:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(0,82,204,0.1);
}
.box-grid-toggle svg {
  flex-shrink: 0;
  transition: transform var(--trans);
}

/* Reveal animation for newly expanded rows */
@keyframes boxGridReveal {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.box-grid-reveal {
  animation: boxGridReveal 0.22s ease both;
}

/* ── DETAILED VIEW — PER-SECTION AD STRIP ── */
.section-ad {
  background: var(--white);
  border: 1px dashed var(--rule2);
  border-radius: var(--radius-md);
  min-height: 56px;
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  position: relative;
  padding: 10px 16px;
}
.section-ad .ad-label { position: absolute; top: 8px; left: 12px; }
.section-ad .ad-placeholder { font-size: 0.78rem; color: var(--ink4); font-weight: 500; letter-spacing: 0.01em; }

/* ── DETAILED VIEW — COLLAPSIBLE EXTRA SECTIONS ── */
.browse-sections-extra {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}
.browse-sections-extra.is-open {
  max-height: 99999px;
  opacity: 1;
  pointer-events: auto;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

/* Toggle button for detail sections — inherits all of .box-grid-toggle;
   this single override adjusts the bottom margin to fit the section gap. */
.browse-sections-toggle { margin-bottom: 8px; }

/* ── FOOTER ── */
footer {
  background: var(--nav-bg);
  padding: 40px 24px;
  margin-top: 16px;
}
.footer-inner {
  max-width: 1360px; margin: 0 auto;
  display: grid;
  grid-template-columns: 1.8fr 0.8fr 0.8fr 0.8fr;
  grid-template-areas: "brand explore company legal";
  gap: 40px; align-items: start;
}
.footer-brand   { grid-area: brand; }
.footer-explore { grid-area: explore; }
.footer-company { grid-area: company; }
.footer-legal   { grid-area: legal; }

/* At tablet: brand takes full row, the three link columns share the row below */
@media(max-width:900px){
  .footer-inner {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-areas:
      "brand   brand   brand"
      "explore company legal";
    gap: 32px;
  }
}
/* At small tablet/large phone: 2-up link columns, legal spans full width */
@media(max-width:620px){
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "brand   brand"
      "explore company"
      "legal   legal";
    gap: 28px;
  }
}
/* At small phones: full single column */
@media(max-width:420px){
  .footer-inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "explore"
      "company"
      "legal";
    gap: 24px;
  }
}
.footer-col {}
.footer-brand {}
.footer-logo {
  font-family: var(--serif);
  font-size: 1.3rem; color: #fff;
  margin-bottom: 8px;
}
.footer-logo-img { height: 26px; display: block; }
.footer-tagline { font-size: 0.82rem; color: rgba(255,255,255,0.38); line-height: 1.6; max-width: 320px; }
.footer-col-title {
  font-family: var(--mono); font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 12px;
}
.footer-link {
  display: block;
  font-size: 0.82rem; color: rgba(255,255,255,0.55);
  text-decoration: none;
  padding: 5px 0;
  cursor: pointer;
  transition: color var(--trans);
}
.footer-link:hover { color: #fff; }
.footer-social {
  display: flex; gap: 10px;
  margin-top: 16px;
}
.footer-social-link {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  color: rgba(255,255,255,0.5);
  transition: color var(--trans), border-color var(--trans);
}
.footer-social-link:hover { color: #fff; border-color: rgba(255,255,255,0.35); }
.footer-nl {
  margin-top: 14px;
  max-width: 350px;
}
.footer-nl-label {
  font-size: 0.68rem; color: rgba(255,255,255,0.38);
  margin-bottom: 6px; display: block;
}
.footer-nl-row {
  display: flex; gap: 5px;
}
.footer-nl-input {
  flex: 1; min-width: 0;
  height: 28px; padding: 0 8px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: var(--radius);
  color: #fff; font-family: var(--sans); font-size: 0.72rem;
  outline: none; transition: border-color var(--trans);
}
.footer-nl-input::placeholder { color: rgba(255,255,255,0.28); }
.footer-nl-input:focus { border-color: rgba(255,255,255,0.35); }
.footer-nl-btn {
  height: 28px; padding: 0 9px;
  background: #0052CC; border: none;
  border-radius: var(--radius);
  color: #fff; font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.02em; white-space: nowrap;
  transition: background var(--trans);
}
.footer-nl-btn:hover { background: #003D99; }
.footer-copy {
  margin-top: 32px; padding-top: 18px;
  max-width: 1360px; margin-left: auto; margin-right: auto;
  font-size: 0.72rem; color: rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
}

.footer-exo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-exo-logo {
  height: 16px;
  width: auto;
  vertical-align: middle;
}
  

/* ════════════════════════════════
   AD SLOTS — match existing tokens, no class kill
════════════════════════════════ */
.ad-label {
  font-family: var(--mono); font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink4);
}

/* leaderboard band — sits between hero and grid, and above footer */
.ad-banner {
  max-width: 1360px; margin: 12px auto 12px;
  padding: 0 24px;
}
.ad-banner-inner {
  background: var(--white);
  border: 1px dashed var(--rule2);
  border-radius: var(--radius-md);
  min-height: 56px;
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  position: relative;
  padding: 10px 16px;
}
.ad-banner-inner .ad-label { position: absolute; top: 8px; left: 12px; }
.ad-banner-placeholder {
  font-size: 0.78rem; color: var(--ink4); font-weight: 500;
  letter-spacing: 0.01em;
}
@media(max-width:768px){ .ad-banner { padding: 0 16px; } }
@media(max-width:640px){ .ad-banner { padding: 0 12px; } }

/* between-row ad injected into .box-grid — always spans all columns */
.box-grid-ad {
  grid-column: 1 / -1;
  background: var(--white);
  border: 1px dashed var(--rule2);
  border-radius: var(--radius-md);
  min-height: 56px;
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  position: relative;
  padding: 10px 16px;
}
.box-grid-ad .ad-label { position: absolute; top: 8px; left: 12px; }
.box-grid-ad .ad-placeholder { font-size: 0.78rem; color: var(--ink4); font-weight: 500; letter-spacing: 0.01em; }

/* native ad row — reuses .s-row layout exactly, just a subtle tint + accent tag */

/* sidebar-style skyscraper, stacks under nav-count on wide screens — optional, off by default visually subtle */
.ad-rail {
  display: none;
}

/* ════════════════════════════════
   INTERSTITIAL / REWARDED AD MODAL
   reuses .modal-overlay + .modal-card shell, new inner bits only
════════════════════════════════ */
.ad-modal .modal-card { max-width: 420px; }
.ad-modal .modal-head { padding: 14px 16px; }
.ad-stage {
  position: relative;
  background: var(--canvas);
  margin: 16px 20px 0;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  min-height: 260px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  overflow: hidden;
}
.ad-stage .ad-label { position: absolute; top: 10px; left: 12px; }
.ad-stage-icon {
  width: 48px; height: 48px; border-radius: 10px;
  background: var(--accent-bg); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.ad-stage-title { font-family: var(--serif); font-size: 1.1rem; color: var(--ink); text-align: center; padding: 0 20px; }
.ad-stage-sub { font-size: 0.78rem; color: var(--ink3); text-align: center; padding: 0 24px; }
.ad-dest {
  font-family: var(--mono); font-size: 0.68rem; color: var(--ink4);
  background: var(--white); border: 1px solid var(--rule);
  border-radius: 999px; padding: 3px 10px; margin-top: 4px;
}
.ad-progress-track {
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: var(--rule);
}
.ad-progress-fill {
  height: 100%; width: 0%;
  background: var(--accent);
  transition: width 0.1s linear;
}
.ad-modal .modal-foot {
  justify-content: space-between;
}
.ad-skip-info {
  font-family: var(--mono); font-size: 0.7rem; color: var(--ink4);
}
.ad-reward-pill {
  display: none;
  align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 0.68rem; font-weight: 600;
  color: var(--green);
  background: rgba(26,122,74,0.08);
  border: 1px solid var(--green);
  border-radius: 999px; padding: 3px 10px;
}
.ad-reward-pill.show { display: flex; }
.ad-modal .modal-btn-submit:disabled {
  background: var(--rule2); color: var(--ink4); cursor: not-allowed;
}

/* ════════════════════════════════
   NEWSLETTER POPUP
   reuses .modal-overlay + .modal-card shell, new inner bits only
════════════════════════════════ */
.newsletter-modal .modal-card { max-width: 420px; }
.newsletter-modal .modal-head { border-bottom: none; padding-bottom: 0; }
.newsletter-body { padding: 4px 24px 24px; }
.newsletter-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent-bg); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin-top: 4px;
}
.newsletter-title { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); line-height: 1.25; }
.newsletter-sub { font-size: 0.85rem; color: var(--ink3); line-height: 1.5; max-width: 320px; }
.newsletter-form { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 4px; }
.newsletter-input-row { display: flex; gap: 8px; }
.newsletter-input-row input {
  flex: 1 1 auto; min-width: 0;
  height: 42px; padding: 0 14px;
  border: 1px solid var(--rule2); border-radius: var(--radius);
  background: var(--canvas); color: var(--ink);
  font-family: var(--sans); font-size: 0.85rem;
  transition: border-color var(--trans);
}
.newsletter-input-row input:focus { outline: none; border-color: var(--accent); }
.newsletter-input-row input.input-error { border-color: var(--red); }
.newsletter-submit-btn {
  flex-shrink: 0;
  height: 42px; padding: 0 18px;
  background: #0052CC; border: none;
  border-radius: var(--radius); color: #fff;
  font-size: 0.85rem; font-weight: 600;
  transition: background var(--trans);
}
.newsletter-submit-btn:hover { background: #003D99; }
.newsletter-fineprint { font-size: 0.68rem; color: var(--ink4); margin-top: 2px; }
.newsletter-dismiss {
  background: none; border: none;
  font-size: 0.76rem; font-weight: 600; color: var(--ink3);
  text-decoration: underline; text-decoration-color: var(--rule2);
  padding: 2px 0; margin-top: 2px;
  transition: color var(--trans);
}
.newsletter-dismiss:hover { color: var(--ink); }
/* success state swaps the prompt/form out for a confirmation, no layout jump */
.newsletter-prompt { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.newsletter-prompt.is-hidden { display: none; }
.newsletter-success { display: none; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0 4px; text-align: center; }
.newsletter-success.show { display: flex; }
.newsletter-success-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(26,122,74,0.1); color: var(--green);
  display: flex; align-items: center; justify-content: center;
}

/* ── SCROLL TO TOP ── */
#scroll-top-btn {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 300;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--nav-bg);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px) scale(0.88);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease, background 0.15s ease;
}
#scroll-top-btn.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
#scroll-top-btn:hover {
  background: rgba(255,255,255,0.12);
}
#scroll-top-btn svg {
  color: rgba(255,255,255,0.85);
  flex-shrink: 0;
}
#scroll-top-pct {
  font-family: var(--mono);
  font-size: 0.55rem;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.02em;
  line-height: 1;
}
/* progress ring */
#scroll-top-ring {
  position: absolute;
  top: 0; left: 0;
  width: 48px; height: 48px;
  transform: rotate(-90deg);
  pointer-events: none;
}
#scroll-top-ring circle {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 138.2; /* 2π × 22 */
  stroke-dashoffset: 138.2;
  transition: stroke-dashoffset 0.1s linear;
  opacity: 0.7;
}
/* ── COOKIE CONSENT POPUP ── */
#cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  z-index: 9998;
  width: min(680px, calc(100vw - 32px));
  background: #1e1e1c;
  border: none;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  padding: 18px 20px 18px 20px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}
#cookie-banner.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.cookie-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.cookie-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
}
.cookie-text {
  flex: 1;
  min-width: 0;
}
.cookie-title { display: none; }
.cookie-desc {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.80);
  line-height: 1.6;
}
.cookie-desc a {
  color: #5b9cf6;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cookie-desc a:hover { color: #82b4f8; }
.cookie-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.cookie-btn-accept {
  height: 30px;
  padding: 0 13px;
  background: #1a6ef5;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--trans);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.cookie-btn-accept:hover { background: var(--btn-blue); }
.cookie-btn-decline {
  position: absolute;
  top: 8px;
  right: 3px;
  width: 14px;
  height: 14px;
  padding: 0;
  background: none;
  border: none;
  color: rgb(255 255 255 / 13%);
  font-size: 0.55rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--trans);
  line-height: 1;
}
.cookie-btn-decline:hover {
  color: rgba(255,255,255,0.80);
  background: none;
}
@media(max-width:560px){
  #cookie-banner {
    align-items: stretch;
    gap: 12px;
    padding: 18px 16px 16px;
  }
  .cookie-actions { justify-content: flex-end; }
}
@media(max-width:480px){
  #cookie-banner { bottom: 12px; }
}