/* ============================================================
   CIVIC GUIDE — Components
   ============================================================ */

/* ============ PULSE (live state dot) ====================== */
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in oklab, var(--signal) 60%, transparent); }
  70%  { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ============ HEADER ====================================== */
.site-header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: color-mix(in oklab, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-block-end: 1px solid var(--rule);
}
.site-header__inner {
  height: var(--header-h);
  display: flex; align-items: center; gap: var(--sp-5);
  min-width: 0;
}
.header__tools { min-width: 0; }
/* The two CTAs are the first thing to go when the bar gets tight. */
@media (max-width: 1279px) {
  .site-header__inner .header__tools > .btn { display: none; }
}
@media (max-width: 419px) {
  .brand__sub { display: none; }
  .lang__btn { padding-inline: var(--sp-2); }
  .lang__btn span[data-lang-label] { display: none; }
  .site-header__inner { gap: var(--sp-3); }
}

.brand { display: flex; align-items: center; gap: var(--sp-3); text-decoration: none; flex: none; }
.brand__mark {
  width: 30px; height: 30px; flex: none;
  background: var(--brand); color: var(--brand-ink);
  border-radius: var(--r-xs);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700; font-size: 15px; line-height: 1;
  letter-spacing: -0.04em;
}
.brand__name {
  font-family: var(--font-display);
  font-size: 1.0625rem; font-weight: 700;
  letter-spacing: -0.03em; line-height: 1;
}
.brand__sub {
  display: block; font-family: var(--font-ui);
  font-size: 9px; font-weight: 600;
  letter-spacing: var(--ls-caps); text-transform: uppercase;
  color: var(--ink-3); margin-block-start: 2px;
}

.nav { display: flex; align-items: center; gap: var(--sp-1); margin-inline-start: var(--sp-2); }
.nav__link {
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--t-sm); font-weight: 500;
  color: var(--ink-2); text-decoration: none;
  border-radius: var(--r-sm);
  position: relative;
  transition: color var(--dur-1) var(--ease-out), background var(--dur-1) var(--ease-out);
  white-space: nowrap;
}
.nav__link:hover { color: var(--ink); background: var(--paper-3); }
.nav__link[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav__link[aria-current="page"]::after {
  content: ""; position: absolute;
  inset-inline: var(--sp-3); bottom: -2px; height: 2px;
  background: var(--signal);
}

.header__tools { margin-inline-start: auto; display: flex; align-items: center; gap: var(--sp-2); }

/* Compact header search — appears on inner pages */
.header-search {
  display: flex; align-items: center; gap: var(--sp-2);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-pill);
  padding: 5px 5px 5px var(--sp-4);
  min-width: 0; max-width: 380px; flex: 1 1 150px;
  transition: border-color var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
}
.header-search:focus-within { border-color: var(--ink-3); box-shadow: var(--shadow-1); }
.header-search input {
  border: 0; background: none; outline: none; flex: 1; min-width: 0;
  font-size: var(--t-sm);
}
.header-search input::placeholder { color: var(--ink-3); }
.header-search__go {
  width: 28px; height: 28px; flex: none;
  border-radius: 50%; background: var(--ink); color: var(--ink-inv);
  display: grid; place-items: center;
  transition: background var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.header-search__go:hover { background: var(--signal); transform: scale(1.06); }

/* Icon-only control */
.icon-btn {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  border: 1px solid transparent;
  transition: all var(--dur-1) var(--ease-out);
}
.icon-btn:hover { background: var(--paper-3); color: var(--ink); border-color: var(--rule); }
.icon-btn svg { width: 17px; height: 17px; }

/* Language switcher */
.lang { position: relative; }
.lang__btn {
  display: flex; align-items: center; gap: 6px;
  height: 34px; padding-inline: var(--sp-3);
  border: 1px solid var(--rule); border-radius: var(--r-sm);
  font-size: var(--t-xs); font-weight: 600;
  letter-spacing: var(--ls-caps-sm); text-transform: uppercase;
  color: var(--ink-2); background: var(--paper-2);
  transition: all var(--dur-1) var(--ease-out);
}
.lang__btn:hover { color: var(--ink); border-color: var(--rule-2); }
.lang__menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 6px);
  background: var(--paper-2); border: 1px solid var(--rule);
  border-radius: var(--r-md); box-shadow: var(--shadow-2);
  padding: var(--sp-1); min-width: 176px;
  z-index: var(--z-popover);
  display: none;
}
.lang[data-open="true"] .lang__menu { display: block; animation: pop var(--dur-2) var(--ease-out); }
@keyframes pop { from { opacity: 0; transform: translateY(-5px) scale(.98); } }
.lang__opt {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  width: 100%; padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm); font-size: var(--t-sm); text-align: start;
  color: var(--ink-2);
}
.lang__opt:hover { background: var(--paper-3); color: var(--ink); }
.lang__opt[aria-selected="true"] { color: var(--ink); font-weight: 600; }
.lang__opt[aria-selected="true"]::after { content: "✓"; color: var(--brand-2); }
.lang__opt small { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); text-transform: uppercase; }

/* Mobile menu */
.menu-toggle { display: none; }
@media (max-width: 1023px) {
  .nav { display: none; }
  .menu-toggle { display: grid; }
}
.mobile-nav {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background: var(--paper);
  padding: var(--sp-5) var(--gutter) var(--sp-8);
  overflow-y: auto;
  display: none;
}
.mobile-nav[data-open="true"] { display: block; animation: reveal var(--dur-3) var(--ease-out); }
.mobile-nav__list { list-style: none; padding: 0; margin-block-start: var(--sp-6); }
.mobile-nav__list a {
  display: block; padding: var(--sp-4) 0;
  border-block-end: 1px solid var(--rule);
  font-family: var(--font-display); font-size: 1.5rem;
  letter-spacing: var(--ls-tight); text-decoration: none;
}

/* ============ BUTTONS ===================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2);
  height: 42px; padding-inline: var(--sp-5);
  border-radius: var(--r-sm);
  font-size: var(--t-sm); font-weight: 600;
  letter-spacing: 0.005em;
  text-decoration: none; white-space: nowrap;
  border: 1px solid transparent;
  transition: background var(--dur-1) var(--ease-out),
              color var(--dur-1) var(--ease-out),
              border-color var(--dur-1) var(--ease-out),
              transform var(--dur-1) var(--ease-out),
              box-shadow var(--dur-2) var(--ease-out);
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--signal); color: var(--signal-ink); }
.btn--primary:hover { background: var(--signal-2); box-shadow: var(--shadow-2); }

.btn--brand { background: var(--brand); color: var(--brand-ink); }
.btn--brand:hover { background: var(--brand-2); box-shadow: var(--shadow-2); }

.btn--ink { background: var(--ink); color: var(--ink-inv); }
.btn--ink:hover { background: var(--ink-2); }

.btn--outline { border-color: var(--rule-2); color: var(--ink); background: var(--paper-2); }
.btn--outline:hover { border-color: var(--ink); background: var(--paper-3); }

.btn--ghost { color: var(--ink-2); }
.btn--ghost:hover { background: var(--paper-3); color: var(--ink); }

.btn--sm { height: 34px; padding-inline: var(--sp-3); font-size: var(--t-xs); }
.btn--lg { height: 52px; padding-inline: var(--sp-6); font-size: var(--t-body); }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* Link with an arrow that travels on hover */
.link-arrow {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: var(--t-sm); font-weight: 600;
  text-decoration: none; color: var(--ink);
  border-block-end: 1px solid var(--rule-2);
  padding-block-end: 2px;
  transition: border-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.link-arrow:hover { color: var(--signal); border-color: var(--signal); }
.link-arrow svg { width: 14px; height: 14px; transition: transform var(--dur-2) var(--ease-out); }
.link-arrow:hover svg { transform: translateX(3px); }

/* ============ CHIPS / BADGES ============================== */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding-inline: var(--sp-3);
  border: 1px solid var(--rule); border-radius: var(--r-pill);
  background: var(--paper-2);
  font-size: var(--t-xs); font-weight: 500; color: var(--ink-2);
  white-space: nowrap; text-decoration: none;
  transition: all var(--dur-1) var(--ease-out);
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip[aria-pressed="true"], .chip--active {
  background: var(--ink); border-color: var(--ink); color: var(--ink-inv); font-weight: 600;
}
.chip svg { width: 13px; height: 13px; }
.chip__x { opacity: .6; }
.chip__x:hover { opacity: 1; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: var(--r-xs);
  font-size: var(--t-2xs); font-weight: 700;
  letter-spacing: var(--ls-caps-sm); text-transform: uppercase;
  white-space: nowrap;
  max-width: 100%;
}
@media (max-width: 519px) { .badge { white-space: normal; text-align: start; } }
.badge svg { width: 11px; height: 11px; }
.badge--verified { background: var(--brand-tint); color: var(--brand); }
.badge--featured { background: var(--gold-tint); color: var(--gold); }
.badge--claimed  { background: var(--info-tint); color: var(--info); }
.badge--new      { background: var(--signal-tint); color: var(--signal-2); }
.badge--ok       { background: var(--ok-tint); color: var(--ok); }
.badge--warn     { background: var(--warn-tint); color: var(--warn); }
.badge--bad      { background: var(--bad-tint); color: var(--bad); }
.badge--neutral  { background: var(--paper-3); color: var(--ink-2); }
:root[data-theme="dark"] .badge--verified,
:root[data-theme="dark"] .badge--featured { color: var(--ink); }

/* Live open/closed state */
.live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--t-xs); font-weight: 600;
}
.live__dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.live--open  { color: var(--ok); }
.live--open .live__dot  { background: var(--ok); animation: pulse 2.4s var(--ease-out) infinite; }
.live--shut  { color: var(--ink-3); }
.live--shut .live__dot  { background: var(--ink-3); }
.live--soon  { color: var(--warn); }
.live--soon .live__dot  { background: var(--warn); }

/* ============ RATING ====================================== */
.rating { display: inline-flex; align-items: center; gap: var(--sp-2); }
.stars { display: inline-flex; gap: 1px; color: var(--gold); }
.stars svg { width: 14px; height: 14px; }
.stars--lg svg { width: 19px; height: 19px; }
.stars .star--empty { color: var(--rule-2); }
.rating__num { font-weight: 700; font-size: var(--t-sm); letter-spacing: -0.01em; }
.rating__count { font-size: var(--t-xs); color: var(--ink-3); }

/* Source attribution — Google vs native */
.src {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--t-2xs); color: var(--ink-3);
  letter-spacing: var(--ls-caps-sm); text-transform: uppercase; font-weight: 600;
}
.src svg { width: 11px; height: 11px; }

/* ============ SURFACES ==================================== */
.panel {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  min-width: 0;   /* a wide child (log, table, JSON) scrolls inside, never widens the page */
}
.panel--flush { border-radius: 0; border-inline: 0; }
.panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-block-end: 1px solid var(--rule);
  flex-wrap: wrap;
}
.panel__head h3 { font-size: var(--t-h4); }
.panel__body { padding: var(--sp-5); }
.panel__body--flush { padding: 0; }
.panel__foot {
  padding: var(--sp-4) var(--sp-5);
  border-block-start: 1px solid var(--rule);
  background: var(--paper-3);
  border-end-start-radius: var(--r-md); border-end-end-radius: var(--r-md);
}

.well {
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: var(--sp-4);
}

/* Note callout — used for "why this matters" annotations */
.note {
  display: flex; gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--rule);
  background: var(--paper-2);
  font-size: var(--t-sm);
  line-height: 1.55;
  border-inline-start: 3px solid var(--ink-3);
}
.note svg { width: 17px; height: 17px; flex: none; margin-block-start: 2px; }
.note strong { display: block; margin-block-end: 3px; }
.note--brand { border-inline-start-color: var(--brand); background: var(--brand-tint); }
.note--signal{ border-inline-start-color: var(--signal); background: var(--signal-tint); }
.note--warn  { border-inline-start-color: var(--warn); background: var(--warn-tint); }
.note--bad   { border-inline-start-color: var(--bad); background: var(--bad-tint); }
.note--info  { border-inline-start-color: var(--info); background: var(--info-tint); }
:root[data-theme="dark"] .note--brand,
:root[data-theme="dark"] .note--signal { color: var(--ink); }

/* ============ BUSINESS CARD (grid contexts) =============== */
.biz-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  overflow: hidden;
  text-decoration: none;
  transition: border-color var(--dur-2) var(--ease-out),
              transform var(--dur-2) var(--ease-out),
              box-shadow var(--dur-2) var(--ease-out);
}
.biz-card:hover { border-color: var(--rule-2); transform: translateY(-3px); box-shadow: var(--shadow-2); }
.biz-card__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper-3); }
.biz-card__media > img { width: 100%; height: 100%; object-fit: cover; }
.biz-card:hover .biz-card__media > img { transform: scale(1.04); }
.biz-card__media > img { transition: transform var(--dur-4) var(--ease-out); }
.biz-card__flags { position: absolute; inset-block-start: var(--sp-3); inset-inline-start: var(--sp-3); display: flex; gap: 5px; flex-wrap: wrap; }
.biz-card__save {
  position: absolute; inset-block-start: var(--sp-3); inset-inline-end: var(--sp-3);
  width: 30px; height: 30px; border-radius: 50%;
  background: color-mix(in oklab, var(--paper-2) 90%, transparent);
  backdrop-filter: blur(6px);
  display: grid; place-items: center; color: var(--ink-2);
  border: 1px solid var(--rule);
  transition: all var(--dur-1) var(--ease-out);
}
.biz-card__save:hover { color: var(--signal); transform: scale(1.1); }
.biz-card__save[aria-pressed="true"] { color: var(--signal); background: var(--signal-tint); }
.biz-card__save svg { width: 15px; height: 15px; }
.biz-card__body { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); flex: 1; }
.biz-card__cat {
  font-size: var(--t-2xs); font-weight: 700;
  letter-spacing: var(--ls-caps-sm); text-transform: uppercase;
  color: var(--brand-2);
}
.biz-card__name { font-family: var(--font-display); font-size: 1.125rem; letter-spacing: -0.02em; line-height: 1.2; }
.biz-card__meta { font-size: var(--t-xs); color: var(--ink-3); display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.biz-card__foot {
  margin-block-start: auto; padding-block-start: var(--sp-3);
  border-block-start: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
}

/* ============ INDEX ROW (search results) ================== */
.index-row {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) auto;
  gap: var(--sp-4);
  padding: var(--sp-4);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  text-decoration: none;
  transition: border-color var(--dur-1) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
  position: relative;
}
.index-row:hover, .index-row[data-hot="true"] {
  border-color: var(--ink-3);
  box-shadow: var(--shadow-1);
}
.index-row[data-hot="true"]::before {
  content: ""; position: absolute; inset-inline-start: -1px; inset-block: -1px;
  width: 3px; background: var(--signal);
  border-start-start-radius: var(--r-md); border-end-start-radius: var(--r-md);
}
.index-row__media { border-radius: var(--r-sm); overflow: hidden; aspect-ratio: 4/3; background: var(--paper-3); position: relative; }
.index-row__media > img { width: 100%; height: 100%; object-fit: cover; }
.index-row__rank {
  position: absolute; inset-block-start: 0; inset-inline-start: 0;
  background: var(--ink); color: var(--ink-inv);
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  padding: 3px 6px; border-end-end-radius: var(--r-sm);
}
.index-row__main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.index-row__name { font-family: var(--font-display); font-size: 1.1875rem; letter-spacing: -0.02em; line-height: 1.2; }
.index-row__line { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; font-size: var(--t-xs); color: var(--ink-3); }
.index-row__line .dotsep { color: var(--rule-2); }
.index-row__desc {
  font-size: var(--t-sm); color: var(--ink-2); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.index-row__side {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between;
  gap: var(--sp-3); text-align: end;
}
.index-row__dist { font-family: var(--font-mono); font-size: var(--t-2xs); color: var(--ink-3); }
.index-row__actions { display: flex; gap: var(--sp-2); }

@media (max-width: 719px) {
  .index-row { grid-template-columns: 96px minmax(0, 1fr); }
  .index-row__side { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; text-align: start; }
}

/* Attribute pills inside rows */
.attrs { display: flex; gap: 5px; flex-wrap: wrap; }
.attr {
  font-size: var(--t-2xs); color: var(--ink-2);
  background: var(--paper-3); border: 1px solid var(--rule);
  padding: 2px 7px; border-radius: var(--r-xs); white-space: nowrap;
}

/* ============ CATEGORY TILE =============================== */
.cat-tile {
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--rule); border-radius: var(--r-md);
  background: var(--paper-2); text-decoration: none;
  position: relative; overflow: hidden;
  transition: all var(--dur-2) var(--ease-out);
}
.cat-tile::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 55%, var(--brand-tint) 140%);
  opacity: 0; transition: opacity var(--dur-2) var(--ease-out);
}
.cat-tile:hover { border-color: var(--brand); transform: translateY(-2px); }
.cat-tile:hover::after { opacity: 1; }
.cat-tile__icon {
  width: 38px; height: 38px; border-radius: var(--r-sm);
  background: var(--brand-tint); color: var(--brand);
  display: grid; place-items: center; position: relative; z-index: 1;
}
:root[data-theme="dark"] .cat-tile__icon { color: var(--brand-2); }
.cat-tile__icon svg { width: 20px; height: 20px; }
.cat-tile__name { font-weight: 600; font-size: var(--t-sm); position: relative; z-index: 1; }
.cat-tile__count { font-family: var(--font-mono); font-size: var(--t-2xs); color: var(--ink-3); position: relative; z-index: 1; }

/* ============ FORMS ======================================= */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
  font-size: var(--t-2xs); font-weight: 700;
  letter-spacing: var(--ls-caps-sm); text-transform: uppercase;
  color: var(--ink-2);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
}
.field__label .opt { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--ink-3); }
.field__hint { font-size: var(--t-xs); color: var(--ink-3); line-height: 1.45; }
.field__err { font-size: var(--t-xs); color: var(--bad); font-weight: 500; }

.input, .select, .textarea {
  width: 100%;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  padding: 0 var(--sp-3);
  height: 42px;
  font-size: var(--t-sm);
  color: var(--ink);
  transition: border-color var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
  outline: none;
}
.textarea { height: auto; min-height: 108px; padding-block: var(--sp-3); resize: vertical; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ink) 10%, transparent);
}
.input[aria-invalid="true"] { border-color: var(--bad); }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237D7466' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-3) center;
  background-size: 15px;
  padding-inline-end: var(--sp-6);
}
:root[data-theme="dark"] .select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238C8375' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}
[dir="rtl"] .select { background-position: left var(--sp-3) center; }

.check {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  cursor: pointer; font-size: var(--t-sm); color: var(--ink-2);
  padding: var(--sp-2) 0;
  line-height: 1.4;
}
.check input { accent-color: var(--brand); width: 16px; height: 16px; flex: none; margin-block-start: 2px; cursor: pointer; }
.check:hover { color: var(--ink); }
.check__count { margin-inline-start: auto; font-family: var(--font-mono); font-size: var(--t-2xs); color: var(--ink-3); }

/* Segmented control */
.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; background: var(--paper-3); border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg__btn {
  padding: 6px var(--sp-4); border-radius: 2px;
  font-size: var(--t-xs); font-weight: 600; color: var(--ink-3);
  transition: all var(--dur-1) var(--ease-out);
}
.seg__btn:hover { color: var(--ink); }
.seg__btn[aria-pressed="true"] { background: var(--paper-2); color: var(--ink); box-shadow: var(--shadow-1); }

/* ============ TABS ======================================== */
.tabs { display: flex; gap: var(--sp-5); border-block-end: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: var(--sp-3) 0; position: relative; white-space: nowrap;
  font-size: var(--t-sm); font-weight: 600; color: var(--ink-3);
  text-decoration: none;
  transition: color var(--dur-1) var(--ease-out);
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after {
  content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 2px; background: var(--signal);
}
.tab__n { font-family: var(--font-mono); font-size: var(--t-2xs); color: var(--ink-3); margin-inline-start: 5px; }

/* ============ TABLE (admin/data) ========================== */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.table th {
  text-align: start; font-size: var(--t-2xs); font-weight: 700;
  letter-spacing: var(--ls-caps-sm); text-transform: uppercase;
  color: var(--ink-3); background: var(--paper-3);
  padding: var(--sp-3) var(--sp-4); white-space: nowrap;
  border-block-end: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 2;
}
.table td { padding: var(--sp-3) var(--sp-4); border-block-end: 1px solid var(--rule); vertical-align: top; }
.table tbody tr { transition: background var(--dur-1) var(--ease-out); }
.table tbody tr:hover { background: var(--paper-3); }
.table--dense td, .table--dense th { padding: var(--sp-2) var(--sp-3); }
.table .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ============ BREADCRUMB / PAGINATION ===================== */
.crumbs { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; font-size: var(--t-xs); color: var(--ink-3); }
.crumbs a { text-decoration: none; color: var(--ink-3); transition: color var(--dur-1) var(--ease-out); }
.crumbs a:hover { color: var(--signal); }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }
.crumbs__sep { opacity: .5; }

.pager { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); flex-wrap: wrap; min-width: 0; }
.pager__gap { color: var(--ink-3); font-family: var(--font-mono); font-size: var(--t-sm); padding-inline: 2px; }
.pager__btn[disabled] { opacity: .35; pointer-events: none; }
.pager__btn {
  min-width: 36px; height: 36px; padding-inline: var(--sp-2);
  display: grid; place-items: center;
  border: 1px solid var(--rule); border-radius: var(--r-sm);
  font-size: var(--t-sm); font-family: var(--font-mono); color: var(--ink-2);
  text-decoration: none; background: var(--paper-2);
  transition: all var(--dur-1) var(--ease-out);
}
.pager__btn:hover { border-color: var(--ink); color: var(--ink); }
.pager__btn[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--ink-inv); font-weight: 700; }

/* ============ EMPTY / SKELETON ============================ */
.empty { text-align: center; padding: var(--sp-8) var(--sp-4); color: var(--ink-3); }
.empty svg { width: 40px; height: 40px; margin-inline: auto; margin-block-end: var(--sp-4); opacity: .5; }
.empty h3 { color: var(--ink); margin-block-end: var(--sp-2); }
.empty p { font-size: var(--t-sm); max-width: 44ch; margin-inline: auto; }

/* ============ TOAST ======================================= */
.toast-host {
  position: fixed; inset-block-end: var(--sp-5); inset-inline: 0;
  z-index: var(--z-toast); display: flex; flex-direction: column;
  align-items: center; gap: var(--sp-2); pointer-events: none; padding-inline: var(--gutter);
}
.toast {
  display: flex; align-items: center; gap: var(--sp-3);
  background: var(--ink); color: var(--ink-inv);
  padding: var(--sp-3) var(--sp-5); border-radius: var(--r-pill);
  font-size: var(--t-sm); font-weight: 500;
  box-shadow: var(--shadow-3);
  animation: toastIn var(--dur-3) var(--ease-out);
  max-width: 100%;
}
.toast svg { width: 16px; height: 16px; flex: none; color: var(--brand-3); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }

/* ============ FOOTER ====================================== */
.site-footer {
  background: var(--ink);
  color: var(--ink-inv);
  margin-block-start: var(--sp-8);
  padding-block: var(--sp-8) var(--sp-6);
}
:root[data-theme="dark"] .site-footer { background: var(--paper-3); border-block-start: 1px solid var(--rule); }
.site-footer a { color: color-mix(in oklab, var(--ink-inv) 72%, transparent); text-decoration: none; font-size: var(--t-sm); transition: color var(--dur-1) var(--ease-out); }
.site-footer a:hover { color: var(--signal); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: var(--sp-6); }
@media (max-width: 1023px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 519px)  { .footer-grid { grid-template-columns: 1fr; } }
.footer-col h4 {
  font-size: var(--t-2xs); letter-spacing: var(--ls-caps); text-transform: uppercase;
  color: color-mix(in oklab, var(--ink-inv) 45%, transparent);
  margin-block-end: var(--sp-4); font-weight: 700;
}
.footer-col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.footer-bottom {
  margin-block-start: var(--sp-7); padding-block-start: var(--sp-5);
  border-block-start: 1px solid color-mix(in oklab, var(--ink-inv) 14%, transparent);
  display: flex; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap;
  font-size: var(--t-xs); color: color-mix(in oklab, var(--ink-inv) 50%, transparent);
}
.footer-brand__name { font-family: var(--font-display); font-size: 1.375rem; letter-spacing: -0.03em; }
.footer-brand p { font-size: var(--t-sm); color: color-mix(in oklab, var(--ink-inv) 62%, transparent); margin-block-start: var(--sp-3); max-width: 34ch; line-height: 1.55; }

/* ============ MAP ========================================= */
.map {
  position: relative;
  overflow: hidden;
  background: var(--map-land);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.map.is-panning { cursor: grabbing; }
.map__base { position: absolute; inset: 0; }
.map__pins { position: absolute; inset: 0; pointer-events: none; }
.map__pins > * { pointer-events: auto; }

.map__pin {
  position: absolute;
  transform: translate(-50%, -100%);
  width: 22px; height: 30px;
  display: grid; place-items: start center;
  filter: drop-shadow(0 2px 3px rgba(20,16,12,.32));
  transition: transform var(--dur-2) var(--ease-out);
  z-index: 2;
}
.map__pin-dot {
  width: 20px; height: 20px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--ink); border: 2px solid var(--paper-2);
  display: block;
}
.map__pin.is-verified .map__pin-dot { background: var(--brand); }
.map__pin.is-featured .map__pin-dot { background: var(--gold); }
.map__pin:hover, .map__pin.is-hot { transform: translate(-50%, -100%) scale(1.28); z-index: 5; }
.map__pin.is-hot .map__pin-dot { background: var(--signal); }
.map__pin.is-pinned { transform: translate(-50%, -100%) scale(1.2); z-index: 4; }
.map__pin.is-pinned .map__pin-dot { background: var(--signal); }

.map__tip {
  position: absolute; bottom: calc(100% + 7px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--ink); color: var(--ink-inv);
  padding: 6px 10px; border-radius: var(--r-sm);
  font-size: var(--t-2xs); line-height: 1.35;
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out);
  box-shadow: var(--shadow-2);
}
.map__tip b { display: block; font-size: var(--t-xs); font-weight: 600; }
.map__tip i { font-style: normal; opacity: .7; font-family: var(--font-mono); }
.map__pin:hover .map__tip, .map__pin.is-hot .map__tip { opacity: 1; transform: translateX(-50%) translateY(0); }

.map__cluster {
  position: absolute; transform: translate(-50%, -50%);
  min-width: 36px; height: 36px; padding-inline: 8px;
  border-radius: var(--r-pill);
  background: var(--brand); color: var(--brand-ink);
  border: 2px solid var(--paper-2);
  font-family: var(--font-mono); font-size: var(--t-xs); font-weight: 700;
  display: grid; place-items: center;
  box-shadow: 0 2px 6px rgba(20,16,12,.3);
  transition: transform var(--dur-2) var(--ease-out);
  z-index: 3;
}
.map__cluster:hover { transform: translate(-50%, -50%) scale(1.12); }

.map__ctl {
  position: absolute; inset-block-start: var(--sp-3); inset-inline-end: var(--sp-3);
  display: flex; flex-direction: column; gap: 1px;
  background: var(--rule); border: 1px solid var(--rule);
  border-radius: var(--r-sm); overflow: hidden; z-index: 6;
}
.map__btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--paper-2); color: var(--ink-2);
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.map__btn:hover { background: var(--paper-3); color: var(--ink); }
.map__btn svg { width: 16px; height: 16px; }

.map__attrib {
  position: absolute; inset-block-end: var(--sp-2); inset-inline-start: var(--sp-3);
  font-size: 10px; color: var(--ink-3);
  background: color-mix(in oklab, var(--paper) 78%, transparent);
  padding: 3px 7px; border-radius: var(--r-xs); z-index: 6;
  pointer-events: none;
}

/* ============ TILES & RANK ROWS (shared) ================== */
/* ---- sub / area tiles ---- */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: var(--sp-3); }
.tile {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-4); border: 1px solid var(--rule); border-radius: var(--r-sm);
  background: var(--paper-2); text-decoration: none;
  transition: all var(--dur-1) var(--ease-out);
}
.tile:hover { border-color: var(--ink); background: var(--paper-3); }
.tile__n { font-weight: 600; font-size: var(--t-sm); }
.tile__c { font-family: var(--font-mono); font-size: var(--t-2xs); color: var(--ink-3); }

/* ---- index list (compact rankings) ---- */
.rank-list { border: 1px solid var(--rule); border-radius: var(--r-md); overflow: hidden; background: var(--paper-2); }
.rank-row {
  display: grid; grid-template-columns: 30px 52px minmax(0, 1fr) auto; gap: var(--sp-3);
  align-items: center; padding: var(--sp-3) var(--sp-4);
  border-block-end: 1px solid var(--rule); text-decoration: none;
  transition: background var(--dur-1) var(--ease-out);
}
.rank-row:last-child { border: 0; }
.rank-row:hover { background: var(--paper-3); }
.rank-row__n { font-family: var(--font-mono); font-size: var(--t-2xs); color: var(--ink-3); }
.rank-row__img { width: 52px; height: 40px; border-radius: var(--r-xs); overflow: hidden; }
.rank-row__img img { width: 100%; height: 100%; object-fit: cover; }
.rank-row__nm { font-weight: 600; font-size: var(--t-sm); display: block; overflow: hidden; text-overflow: ellipsis; }
.rank-row__meta { font-size: var(--t-xs); color: var(--ink-3); }
.rank-row__side { text-align: end; display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
@media (max-width: 599px) { .rank-row { grid-template-columns: 24px minmax(0, 1fr) auto; } .rank-row__img { display: none; } }


/* ============ INLINE FIELD =============================== */
.inline-field {
  display: flex; align-items: center; gap: var(--sp-2);
  border: 1px solid var(--rule); border-radius: var(--r-sm);
  background: var(--paper); padding-inline: var(--sp-3);
  transition: border-color var(--dur-1) var(--ease-out);
  min-width: 0;
}
.inline-field:focus-within { border-color: var(--ink); }
.inline-field svg { width: 15px; height: 15px; color: var(--ink-3); flex: none; }
.inline-field input {
  flex: 1; min-width: 0; border: 0; background: none; outline: none;
  height: 38px; font-size: var(--t-sm);
}
