/* ==========================================================================
   Lurepedia — design tokens + base + components
   Shadcn-style: quiet neutral chrome, imagery carries the color.
   ========================================================================== */

:root {
  /* Neutrals */
  --ink: #18181b;
  --ink-2: #3f3f46;
  --ink-3: #52525b;
  --muted: #71717a;
  --muted-2: #a1a1aa;
  --line-strong: #d4d4d8;
  --line: #e4e4e7;
  --surface-2: #f4f4f5;
  --surface-1: #fafafa;
  --white: #fff;

  /* Accent (indigo) */
  --accent: #4f46e5;
  --accent-bg: #eef2ff;
  --accent-border: #c7d2fe;

  /* Success */
  --ok: #0d7a5f;
  --ok-bg: #ecfdf5;
  --ok-border: #a7f3d0;

  /* Promoted / amber */
  --amber: #b45309;
  --amber-bg: #fffbeb;
  --amber-border: #fde68a;

  /* Danger */
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;

  /* Medals */
  --gold-bg: #fef9c3; --gold-border: #fde68a; --gold-ink: #92710a;
  --silver-bg: #f1f5f9; --silver-border: #e2e8f0; --silver-ink: #64748b;
  --bronze-bg: #fff1e7; --bronze-border: #fed7aa; --bronze-ink: #c2410c;

  /* Radii */
  --r-xs: 5px; --r-sm: 6px; --r-7: 7px; --r-md: 9px; --r-10: 10px;
  --r-lg: 12px; --r-xl: 14px; --r-pill: 999px;

  /* Shadows */
  --shadow-card-hover: 0 6px 20px rgba(24,24,27,.08);
  --shadow-pop: 0 16px 40px rgba(24,24,27,.16);
  --shadow-modal: 0 24px 60px rgba(24,24,27,.25);
  --focus-ring: 0 0 0 4px rgba(79,70,229,.16);

  --maxw: 1200px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--ink); }

button { font-family: inherit; }

img { max-width: 100%; display: block; }

h1, h2, h3, h4 { margin: 0; line-height: 1.2; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Layout ------------------------------------------------------------------ */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
main { min-height: 60vh; }
.section { padding: 40px 0; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* Header ------------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 30;
  height: 60px; display: flex; align-items: center;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; gap: 18px; width: 100%; }
.wordmark { font-size: 20px; letter-spacing: -0.02em; white-space: nowrap; }
.wordmark .lure { font-weight: 300; }
.wordmark .pedia { font-weight: 800; }

.main-nav { display: none; gap: 4px; }
.main-nav a {
  padding: 7px 12px; border-radius: var(--r-7); font-size: 14px; font-weight: 500;
  color: var(--ink-2);
}
.main-nav a:hover, .main-nav a.active { background: var(--surface-2); color: var(--ink); }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* Search bar in the header (between the nav and the language switcher) */
.header-search { display: none; flex: 1; min-width: 0; max-width: 460px; margin-inline: auto; }
.header-search .site-search input { height: 38px; }
/* In the header the filter panel drops down (instead of up) and stays on screen */
.header-search .search-panel { top: 48px; bottom: auto; left: auto; right: 0; }

.site-search { position: relative; width: 100%; }
.site-search input {
  width: 100%; height: 44px; border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 0 14px 0 40px; font-size: 14px; background: var(--white); outline: none;
}
.site-search input:focus { border-color: var(--ink); box-shadow: var(--focus-ring); }
.site-search .search-icon { position: absolute; left: 14px; top: 22px; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.header-search .site-search .search-icon { top: 19px; }
.footer-search-row { margin-top: 32px; max-width: 720px; }
.search-panel {
  position: absolute; bottom: 52px; left: 0;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--shadow-modal); padding: 18px; z-index: 50;
  width: min(720px, calc(100vw - 48px));
}
.search-panel .filters-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px 16px; margin-top: 12px;
}
.filter-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.search-panel .panel-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--surface-2); }

/* Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 14px; border-radius: var(--r-md);
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: var(--white); color: var(--ink);
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--ink); color: var(--surface-1); border-color: var(--ink); }
.btn-primary:hover { background: #000; color: #fff; }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover { background: #4338ca; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.is-upvoted { background: var(--ink); color: var(--surface-1); border-color: var(--ink); }
.btn.is-upvoted:hover { background: #000; color: #fff; }
.btn-fav-icon { width: 38px; padding: 0; gap: 0; font-size: 18px; line-height: 1; }
.btn-fav-icon.is-fav { color: var(--accent); }

/* Cards ------------------------------------------------------------------- */
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden;
}
.card-pad { padding: 16px; }
/* Opt out of overflow clipping so flag tooltips can escape the card; keep the
   rounded corners clean by dropping the last row's bottom border. */
.card-tooltips { overflow: visible; }
.card-tooltips .lb-table tr:last-child td { border-bottom: none; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.grid-catches { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }

/* Lure & catch card */
.lure-card, .catch-card { display: flex; flex-direction: column; cursor: pointer; transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease; }
.lure-card:hover, .catch-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }

/* Add-a-catch CTA card (drops into a card grid) */
.add-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; min-height: 200px; padding: 24px; text-align: center; cursor: pointer;
  border: 1px dashed var(--line-strong); background: var(--surface-1); color: var(--muted);
  transition: border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.add-card:hover { border-color: var(--ink); color: var(--ink-2); box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.add-card-plus {
  display: flex; align-items: center; justify-content: center; width: 46px; height: 46px;
  border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2);
}
.add-card-label { font-weight: 600; font-size: 14px; }
.ph {
  display: flex; align-items: center; justify-content: center; position: relative;
  background: linear-gradient(135deg, #f1f2f4, #e2e5e9); overflow: hidden;
}
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph-lure { aspect-ratio: 16/10; }
.ph-catch { aspect-ratio: 4/3; }
.card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.card-brand { font-size: 12px; color: var(--muted); font-weight: 500; }
.card-title { font-size: 16.5px; font-weight: 600; line-height: 1.25; }

/* Chips / pills / badges -------------------------------------------------- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500; color: var(--ink-3);
  background: var(--surface-2); padding: 4px 10px; border-radius: var(--r-7);
  border: 1px solid transparent; cursor: pointer;
}
.chip:hover { border-color: var(--line-strong); }
.chip.active { background: var(--ink); color: var(--surface-1); }
.tag { font-size: 11.5px; font-weight: 500; color: var(--ink-3); background: var(--surface-2); padding: 3px 9px; border-radius: var(--r-sm); }
.pill { font-size: 11px; font-weight: 500; color: var(--ink-2); background: #eef0f2; padding: 3px 8px; border-radius: var(--r-pill); }
.filter-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; background: var(--surface-2); border: 1px solid var(--line); padding: 4px 10px; border-radius: var(--r-pill); }
.filter-pill a { color: var(--muted); }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: var(--r-pill); }
.badge-proof { background: var(--ink); color: var(--surface-1); }
.badge-noproof { background: var(--white); color: var(--muted); border: 1px dashed var(--line-strong); }
.badge-promoted { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); }
.badge-ok { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-border); }

.badge-kind { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: var(--r-xs); }
.kind-catch { background: var(--ok-bg); color: var(--ok); }
.kind-edit { background: var(--amber-bg); color: var(--amber); }
.kind-catalog { background: var(--accent-bg); color: var(--accent); }
.kind-claim { background: #faf5ff; color: #9333ea; }
.kind-report { background: var(--danger-bg); color: var(--danger); }

.role-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 1px 6px; border-radius: var(--r-xs); }
.role-admin { background: var(--accent-bg); color: var(--accent); border: 1px solid var(--accent-border); }
.role-moderator { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-border); }
.role-member { background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line); }

/* Avatar / dropdown ------------------------------------------------------- */
.avatar { width: 34px; height: 34px; border-radius: var(--r-pill); background: var(--ink); color: var(--surface-1); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; cursor: pointer; border: none; padding: 0; overflow: hidden; flex-shrink: 0; }
button.avatar:focus-visible, button.avatar[aria-expanded="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.avatar-lg { width: 44px; height: 44px; font-size: 15px; }
.avatar-xl { width: 72px; height: 72px; font-size: 24px; }
.avatar-2xl { width: 120px; height: 120px; font-size: 40px; }
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.profile-grid { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; }
.profile-photo { padding: 0; border: none; cursor: pointer; width: 100%; }
.profile-photo:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.profile-photo-initials { font-size: 48px; font-weight: 700; color: var(--ink-2); }
.profile-photo-edit { position: relative; cursor: pointer; }
.profile-photo-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 10px; border: none; cursor: pointer; text-align: center;
  color: #fff; background: rgba(0, 0, 0, .5); font-size: 13px; font-weight: 600;
  opacity: 0; transition: opacity .15s ease;
}
.profile-photo-edit:hover .profile-photo-overlay, .profile-photo-overlay:focus-visible { opacity: 1; }
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: 44px; min-width: 240px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--shadow-pop); padding: 6px; z-index: 60;
}
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 10px; border-radius: var(--r-md); font-size: 14px; color: var(--ink-2);
  background: none; border: none; cursor: pointer;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); }
.dropdown-divider { height: 1px; background: var(--surface-2); margin: 6px 0; }
.menu-head { padding: 10px; display: flex; align-items: center; gap: 10px; }
.lang-pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--white); cursor: pointer; }
.lang-pill[aria-expanded="true"] { border-color: var(--accent); }
.lang-item { display: flex; align-items: center; gap: 10px; }
.lang-item.active { background: var(--accent-bg); color: var(--accent); }

/* Combobox ---------------------------------------------------------------- */
.combobox { position: relative; }
.combobox-trigger {
  width: 100%; height: 42px; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 0 12px; font-size: 14px; background: var(--white); display: flex; align-items: center;
  justify-content: space-between; gap: 8px; cursor: pointer; text-align: left; color: var(--ink);
}
.combobox-trigger.placeholder { color: var(--muted-2); }
.combobox-trigger[aria-expanded="true"] { border-color: var(--ink); }
.combobox-panel {
  position: absolute; top: 46px; left: 0; right: 0; z-index: 50;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop); overflow: hidden;
}
.combobox-search { padding: 8px; border-bottom: 1px solid var(--surface-2); }
.combobox-search input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-7); font-size: 13.5px; outline: none; }
.combobox-options { max-height: 220px; overflow-y: auto; padding: 6px; }
.combobox-option { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; background: none; border: none; border-radius: var(--r-7); font-size: 13.5px; cursor: pointer; text-align: left; color: var(--ink); }
.combobox-option:hover, .combobox-option.active, .combobox-option.highlighted { background: var(--surface-2); }
.combobox-empty { padding: 12px; font-size: 13px; color: var(--muted-2); text-align: center; }

/* Multi-select (country picker): selected items show as removable flag tags
   inside the trigger, which grows to hold them and wraps alongside the
   placeholder; the chevron stays pinned to the right. The dropdown itself
   reuses the combobox styles above. */
.country-multiselect .combobox-trigger { height: auto; min-height: 42px; gap: 8px; padding: 6px 12px; cursor: pointer; }
.ms-trigger-content { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ms-placeholder { color: var(--muted-2); }
.ms-chips { display: contents; }
.ms-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); font-size: 13px; }
.ms-chip-x { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; padding: 0; border: none; border-radius: var(--r-pill); background: transparent; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; }
.ms-chip-x:hover { background: var(--line-strong); color: var(--ink); }
[hidden] { display: none !important; }

/* Inputs ------------------------------------------------------------------ */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.input, textarea.input, select.input {
  width: 100%; height: 42px; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 0 12px; font-size: 14px; background: var(--white); outline: none; color: var(--ink);
}
textarea.input { height: auto; padding: 10px 12px; min-height: 96px; resize: vertical; }
.input:focus { border-color: var(--ink); box-shadow: var(--focus-ring); }

/* Text field with an integrated copy button */
.copy-field { position: relative; }
.copy-field .input {
  padding-right: 44px; background: var(--surface-1); color: var(--ink-2);
  cursor: default; text-overflow: ellipsis;
}
.copy-field .input:focus { border-color: var(--line); box-shadow: none; }
/* Two classes so the absolute position wins over .tooltip's position: relative. */
.copy-field .copy-field__btn {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--muted); cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.copy-field .copy-field__btn:hover { background: var(--surface-2); color: var(--ink); }
.copy-field .copy-field__btn:focus-visible { box-shadow: var(--focus-ring); outline: none; }

/* Tooltip ----------------------------------------------------------------- */
.tooltip { position: relative; }
.tooltip::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  padding: 4px 8px; border-radius: var(--r-sm); background: var(--ink); color: var(--surface-1);
  font-size: 12px; line-height: 1.3; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .12s ease; z-index: 10;
}
.tooltip::before {
  content: ""; position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--ink);
  pointer-events: none; opacity: 0; transition: opacity .12s ease;
}
.tooltip:hover::after, .tooltip:focus-visible::after, .tooltip.is-copied::after,
.tooltip:hover::before, .tooltip:focus-visible::before, .tooltip.is-copied::before { opacity: 1; }

/* Tabs -------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab { padding: 10px 14px; font-size: 14px; font-weight: 600; color: var(--muted); border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; display: inline-block; }
.tab.active { color: var(--ink); border-bottom-color: var(--ink); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Toggle ------------------------------------------------------------------ */
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle .track { width: 40px; height: 22px; border-radius: var(--r-pill); background: var(--line-strong); position: relative; transition: background .15s ease; }
.toggle input { display: none; }
.toggle .knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: var(--r-pill); background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .15s ease; }
.toggle input:checked + .track { background: var(--ink); }
.toggle input:checked + .track .knob { left: 20px; }

/* Modal ------------------------------------------------------------------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(24,24,27,.45); backdrop-filter: blur(3px); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--white); border-radius: var(--r-xl); box-shadow: var(--shadow-modal); width: 100%; max-width: 440px; padding: 24px; max-height: 90vh; overflow-y: auto; }
/* Opt out of the modal's scroll-clipping so a combobox/popover inside it can
   overflow past the modal edge instead of being cut off (short forms only). */
.modal.modal-overflow { overflow: visible; }
.modal h3 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 6px; }

.lightbox { position: relative; max-width: min(90vw, 520px); }
.lightbox img { display: block; width: 100%; height: auto; max-height: 86vh; object-fit: contain; border-radius: var(--r-xl); box-shadow: var(--shadow-modal); }
.lightbox-close { position: absolute; top: -14px; right: -14px; width: 32px; height: 32px; border-radius: var(--r-pill); border: none; background: var(--white); color: var(--ink); box-shadow: var(--shadow-modal); font-size: 20px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* Pagination -------------------------------------------------------------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 28px; }
.pager a, .pager span { min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; border-radius: var(--r-md); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pager a:hover { background: var(--surface-2); }
.pager .current { background: var(--ink); color: var(--surface-1); border-color: var(--ink); }
.pager .disabled { opacity: .4; pointer-events: none; }

/* Diff (git-style before/after) ------------------------------------------- */
.diff { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.diff-field { border-bottom: 1px solid var(--line); }
.diff-field:last-child { border-bottom: 0; }
.diff-field-name { font-family: var(--font-sans, inherit); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); padding: 6px 12px; }
.diff-line { display: flex; gap: 8px; padding: 4px 12px; white-space: pre-wrap; word-break: break-word; }
.diff-gutter { flex-shrink: 0; width: 12px; text-align: center; font-weight: 700; user-select: none; }
.diff-del { background: var(--danger-bg); color: var(--danger); }
.diff-ins { background: var(--ok-bg); color: var(--ok); }

/* Detail-style diff preview (record rendered like its show page, changes inline) */
.diff-preview { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; background: var(--surface); }
.diff-legend { display: flex; gap: 8px; margin-bottom: 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.diff-old { background: var(--danger-bg); color: var(--danger); text-decoration: line-through; padding: 0 5px; border-radius: 4px; }
.diff-new { background: var(--ok-bg); color: var(--ok); padding: 0 5px; border-radius: 4px; }
.diff-old + .diff-new { margin-left: 6px; }
.diff-legend .diff-old, .diff-legend .diff-new { text-decoration: none; }

/* Tables ------------------------------------------------------------------ */
.lb-table { width: 100%; border-collapse: collapse; }
.lb-table th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.lb-table td { padding: 12px; border-bottom: 1px solid var(--surface-2); font-size: 14px; }
.lb-table td a:not(.btn) { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.lb-table td a:not(.btn):hover { color: var(--accent); text-decoration-thickness: 2px; }
.lb-table tr.you { background: var(--accent-bg); }
.rank-medal { width: 28px; height: 28px; border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.rank-1 { background: var(--gold-bg); color: var(--gold-ink); border: 1px solid var(--gold-border); }
.rank-2 { background: var(--silver-bg); color: var(--silver-ink); border: 1px solid var(--silver-border); }
.rank-3 { background: var(--bronze-bg); color: var(--bronze-ink); border: 1px solid var(--bronze-border); }
.metric-active { color: var(--ink); font-weight: 700; }

/* Hero -------------------------------------------------------------------- */
.hero { padding: 40px 0 28px; }
.hero h1 { font-size: 44px; font-weight: 700; letter-spacing: -.03em; }
.hero p { font-size: 17px; color: var(--muted); margin-top: 12px; max-width: 560px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 28px 0 20px; }
.page-head h1 { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.page-head .sub { color: var(--muted); margin-top: 4px; }

/* Detail layouts ---------------------------------------------------------- */
.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; }
.detail-hero { display: grid; grid-template-columns: 360px 1fr; gap: 28px; align-items: start; margin-bottom: 28px; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 0 0 12px; font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Empty / sparse ---------------------------------------------------------- */
.empty-state { text-align: center; padding: 48px 24px; border: 1px dashed var(--line-strong); border-radius: var(--r-xl); background: var(--surface-1); }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { color: var(--muted); margin: 0 auto 16px; max-width: 420px; }
.empty-state-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* Flash ------------------------------------------------------------------- */
.flash-wrap { position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.flash { padding: 10px 16px; border-radius: var(--r-md); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-pop); border: 1px solid var(--line); background: var(--white); }
.flash.notice { border-color: var(--ok-border); background: var(--ok-bg); color: var(--ok); }
.flash.alert { border-color: var(--danger-border); background: var(--danger-bg); color: var(--danger); }

/* Footer ------------------------------------------------------------------ */
.site-footer { margin-top: 64px; background: var(--surface-1); border-top: 1px solid var(--line); padding: 48px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 28px; }
.footer-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 12px; }
.footer-col a { display: block; font-size: 14px; color: var(--ink-2); padding: 4px 0; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Gallery ----------------------------------------------------------------- */
.gallery-main { aspect-ratio: 4/3; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gallery-thumb { width: 56px; height: 56px; border-radius: var(--r-md); overflow: hidden; border: 2px solid transparent; cursor: pointer; padding: 0; background: var(--surface-2); }
.gallery-thumb.active { border-color: var(--ink); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Upload ------------------------------------------------------------------ */
.file-picker { display: flex; align-items: center; gap: 10px; }
.file-picker-name { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.file-picker-clear { flex-shrink: 0; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; }
.file-picker-clear:hover { background: var(--line); color: var(--ink); }
.upload-drop { border: 2px dashed var(--line-strong); border-radius: var(--r-lg); padding: 28px; text-align: center; color: var(--muted); cursor: pointer; background: var(--surface-1); transition: border-color .15s, background .15s, color .15s; }
.upload-drop:hover { border-color: var(--muted-2); color: var(--ink); }
.upload-drop.is-dragover { border-color: var(--ink); background: var(--surface-2); color: var(--ink); }
.upload-previews { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.upload-thumb { position: relative; width: 88px; height: 88px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); }
.upload-thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-thumb .remove { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: var(--r-pill); background: rgba(24,24,27,.78); color: #fff; border: none; cursor: pointer; font-size: 12px; line-height: 1; }
.upload-thumb .cover-badge { position: absolute; bottom: 3px; left: 3px; font-size: 9px; font-weight: 700; text-transform: uppercase; background: var(--ink); color: #fff; padding: 1px 5px; border-radius: var(--r-xs); }

/* Stepper ----------------------------------------------------------------- */
.stepper { display: flex; gap: 8px; margin-bottom: 24px; }
.step { flex: 1; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line); font-size: 13px; }
.step.active { border-color: var(--ink); background: var(--surface-1); font-weight: 600; }
.step.done { border-color: var(--ok-border); background: var(--ok-bg); color: var(--ok); }
.txt-record { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--ink); color: #fff; padding: 12px 14px; border-radius: var(--r-md); word-break: break-all; }

/* Design system (styleguide) --------------------------------------------- */
.ds-section { margin-bottom: 40px; }
.ds-section > h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding-bottom: 8px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.ds-row { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.ds-item { display: flex; flex-direction: column; gap: 8px; }
.ds-label { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--muted); }
.ds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.ds-swatch { display: flex; flex-direction: column; gap: 6px; }
.ds-swatch-color { height: 56px; border-radius: var(--r-md); border: 1px solid var(--line); }
.ds-swatch-name { font-size: 13px; font-weight: 600; }
.ds-box { width: 88px; height: 56px; background: var(--surface-2); border: 1px solid var(--line-strong); }
.ds-shadow { width: 120px; height: 64px; background: var(--white); border-radius: var(--r-lg); }
.ds-type-row { padding: 4px 0; }
.ds-card-frame { width: 260px; }

/* Lure detail — Vision 110 hero ------------------------------------------- */
.overline { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted-2); }
.uv-badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; background: var(--ink); color: #3dffa0; border-radius: var(--r-pill); font-size: 10px; font-weight: 800; letter-spacing: .04em; }

.lure-hero { display: grid; grid-template-columns: minmax(0, 420px) 1fr; gap: 40px; align-items: start; margin-bottom: 8px; }
.lure-stage { position: relative; border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; background: linear-gradient(155deg, #f6f6f7, #ececee); aspect-ratio: 1 / .92; display: flex; align-items: center; justify-content: center; }
.lure-stage img { width: 100%; height: 100%; object-fit: cover; }
.lure-stage-glyph { width: 60%; opacity: .5; }
.lure-stage-chip { position: absolute; top: 14px; left: 14px; z-index: 2; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; background: rgba(255,255,255,.9); backdrop-filter: blur(6px); border-radius: var(--r-pill); font-size: 13px; font-weight: 700; }
/* Color selector (hero, right side): square image tiles */
.color-tiles { display: flex; flex-wrap: wrap; gap: 10px; }
/* Each swatch is wrapped so its name tooltip isn't clipped by the tile's
   overflow:hidden; surface the tooltip on keyboard focus as well as hover.
   Match :focus-visible (not :focus-within) so a mouse click doesn't pin the
   tooltip open after the pointer leaves. */
.color-tile-tip { display: inline-flex; }
.color-tile-tip:has(:focus-visible)::after, .color-tile-tip:has(:focus-visible)::before { opacity: 1; }
.color-tile { position: relative; width: 72px; height: 72px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.color-tile img { width: 100%; height: 100%; object-fit: cover; }
.color-tile-empty { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; opacity: .5; }
.color-tile:hover { border-color: var(--line-strong); }
.color-tile.selected { border-color: var(--ink); box-shadow: var(--shadow-card-hover); }
.color-tile-uv { position: absolute; top: 4px; right: 4px; font-size: 8.5px; padding: 1px 5px; box-shadow: 0 1px 3px rgba(0,0,0,.3); }

.variation-table { margin-bottom: 8px; }

/* Variation picker modal -------------------------------------------------- */
.vp-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(10,12,14,.55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.vp-dialog { width: 100%; max-width: 720px; max-height: 86vh; background: var(--white); border-radius: var(--r-xl); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-modal); }
.vp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 14px; }
.vp-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.vp-close { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 999px; border: none; background: var(--surface-2); cursor: pointer; font-size: 15px; color: var(--ink-3); }
.vp-body { flex: 1; overflow-y: auto; padding: 16px 22px 20px; border-top: 1px solid var(--surface-2); }
.vp-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-1); }
.vp-color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.vp-color { text-align: left; padding: 11px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--white); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.vp-color:hover, .vp-color.selected { border-color: var(--ink); box-shadow: var(--shadow-card-hover); }
.vp-color-thumb { display: flex; align-items: center; justify-content: center; height: 48px; margin-bottom: 8px; background: var(--surface-2); border-radius: var(--r-sm); overflow: hidden; }
.vp-color-thumb img { width: 100%; height: 100%; object-fit: cover; }
.vp-color-name { display: block; font-size: 14px; font-weight: 700; line-height: 1.2; margin-bottom: 3px; }
.vp-color-meta { font-size: 12.5px; color: var(--muted); }
.vp-build-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vp-build { text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--white); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.vp-build:hover, .vp-build.selected { border-color: var(--ink); box-shadow: var(--shadow-card-hover); }
.vp-build-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.vp-build-name { font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.vp-build-meta { font-size: 13px; color: var(--muted); }
.variation-summary { flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-10); font-size: 14px; font-weight: 600; }
.variation-summary.placeholder { color: var(--muted-2); font-weight: 400; }

/* Responsive -------------------------------------------------------------- */
@media (min-width: 880px) {
  .main-nav { display: flex; }
  .header-search { display: block; }
  .footer-only-search { display: none; }
}
@media (max-width: 880px) {
  .search-panel .filters-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 780px) {
  .detail-grid, .detail-hero, .lure-hero, .profile-grid { grid-template-columns: 1fr; }
  .vp-color-grid { grid-template-columns: 1fr 1fr; }
  .vp-build-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 34px; }
  .search-panel .filters-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
}
