/* ==========================================================================
   FairToolBoard — Modern Desktop-Grid Stylesheet
   Light & Dark themes, zero external font dependencies, instant load.
   ========================================================================== */

:root {
  --bg: #f6f7f9;
  --bg-subtle: #eef0f4;
  --surface: #ffffff;
  --surface-hover: #ffffff;
  --border: #e2e6ee;
  --border-strong: #cbd2df;
  --text: #0f172a;
  --text-muted: #526075;
  --text-faint: #7c8aa0;

  --accent: #0f172a;
  --accent-text: #ffffff;

  --free-bg: #e7f8ef;
  --free-text: #0c7a43;
  --onetime-bg: #e8f1ff;
  --onetime-text: #1d5fd6;
  --sub-bg: #fef3e2;
  --sub-text: #b45309;

  --tested-bg: #059669;
  --tested-soft: #ecfdf5;
  --tested-text: #047857;
  --tested-border: #a7f3d0;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-tile: 0 2px 6px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-tile-hover: 0 10px 24px rgba(15, 23, 42, 0.09), 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-pop: 0 16px 40px rgba(15, 23, 42, 0.16), 0 2px 8px rgba(15, 23, 42, 0.08);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #0b0f17;
  --bg-subtle: #121826;
  --surface: #151c2c;
  --surface-hover: #1b2438;
  --border: #243047;
  --border-strong: #364766;
  --text: #f1f5f9;
  --text-muted: #9aa9c0;
  --text-faint: #6c7c96;

  --accent: #f8fafc;
  --accent-text: #0b0f17;

  --free-bg: rgba(16, 185, 129, 0.14);
  --free-text: #34d399;
  --onetime-bg: rgba(59, 130, 246, 0.16);
  --onetime-text: #60a5fa;
  --sub-bg: rgba(245, 158, 11, 0.16);
  --sub-text: #fbbf24;

  --tested-bg: #10b981;
  --tested-soft: rgba(16, 185, 129, 0.12);
  --tested-text: #34d399;
  --tested-border: rgba(16, 185, 129, 0.35);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-tile: 0 2px 8px rgba(0, 0, 0, 0.28);
  --shadow-tile-hover: 0 12px 28px rgba(0, 0, 0, 0.45);
  --shadow-pop: 0 18px 44px rgba(0, 0, 0, 0.55);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Topbar ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--text);
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex-shrink: 0;
  display: block;
}

[data-theme="dark"] .brand-logo {
  box-shadow: 0 0 0 1px var(--border-strong);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.rnd-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: help;
}

.rnd-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.rnd-label {
  font-weight: 600;
  color: var(--text);
}

.rnd-timer {
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}

.beta-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  background: #10b981;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.btn-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-icon:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

[data-theme="dark"] .icon-moon { display: none; }
:root:not([data-theme="dark"]) .icon-sun { display: none; }

/* ---------- Controls Bar ---------- */
.controls-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.controls-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-divider {
  width: 1px;
  height: 22px;
  background: var(--border-strong);
  margin: 0 2px;
}

.pill {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}

.pill-sm {
  padding: 5px 10px;
  font-size: 0.78rem;
}

.pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.pill.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

.controls-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Tested Switch */
.tested-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.tested-toggle:has(input:checked) {
  border-color: var(--tested-border);
  background: var(--tested-soft);
}

.tested-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  width: 30px;
  height: 17px;
  border-radius: var(--radius-pill);
  background: var(--border-strong);
  position: relative;
  transition: background 0.16s ease;
}

.toggle-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ffffff;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.16s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.tested-toggle input:checked + .toggle-track {
  background: var(--tested-bg);
}

.tested-toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(13px);
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.shield-mini {
  width: 14px;
  height: 14px;
  color: var(--tested-bg);
}

/* Search Input */
.search-wrap {
  position: relative;
  width: 190px;
}

.search-wrap-wide {
  width: 260px;
}

.search-wrap-wide input {
  padding-left: 14px;
}

.catalog-topbar-cats {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.catalog-filters-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-faint);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  padding: 6px 10px 6px 32px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.search-wrap input:focus {
  border-color: var(--border-strong);
}

.cat-select {
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.cat-select:focus {
  border-color: var(--border-strong);
}

/* ---------- Main Desktop Grid Board ---------- */
.board-section {
  flex: 1;
  padding: 16px 0 28px;
}

.board-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: var(--text-faint);
}

.inline-link {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.inline-link:hover {
  text-decoration: underline;
}

.desktop-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

@keyframes rowGlideUp {
  from {
    opacity: 0.35;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.desktop-grid.row-shifted .tool-tile {
  animation: rowGlideUp 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Tactile Desktop Icon Tile */
.tool-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 12px 13px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-tile);
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
  color: inherit;
  font-family: inherit;
  width: 100%;
}

.app-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.tool-tile:hover,
.tool-tile:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-tile-hover);
  border-color: var(--border-strong);
  background: var(--surface-hover);
  outline: none;
}

.tool-tile.is-tested {
  border-color: color-mix(in srgb, var(--tested-bg) 35%, var(--border));
}

.tool-tile.is-open-slot {
  border: 1.5px dashed var(--border-strong);
  background: color-mix(in srgb, var(--surface) 58%, var(--bg));
  box-shadow: none;
}

.tool-tile.is-open-slot .tool-name {
  color: var(--text-muted);
  font-weight: 600;
}

.open-slot-icon {
  background: var(--bg-subtle);
  border: 1.5px dashed var(--border-strong);
  box-shadow: none;
  color: var(--text-faint);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.price-open-slot {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.tool-tile.is-open-slot:hover,
.tool-tile.is-open-slot:focus-visible {
  border-color: var(--tested-bg);
  background: var(--surface);
  box-shadow: var(--shadow-tile-hover);
}

.tool-tile.is-open-slot:hover .tool-name,
.tool-tile.is-open-slot:focus-visible .tool-name {
  color: var(--text);
}

.tool-tile.is-open-slot:hover .open-slot-icon,
.tool-tile.is-open-slot:focus-visible .open-slot-icon {
  background: var(--tested-soft);
  border-color: var(--tested-border);
  color: var(--tested-text);
}

.tool-tile.is-open-slot:hover .price-open-slot,
.tool-tile.is-open-slot:focus-visible .price-open-slot {
  background: var(--tested-soft);
  border-color: var(--tested-border);
  color: var(--tested-text);
}

.tested-badge {
  position: absolute;
  top: 9px;
  right: 9px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  background: var(--tested-soft);
  border: 1px solid var(--tested-border);
  color: var(--tested-text);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.tested-badge svg {
  width: 11px;
  height: 11px;
}

.app-icon {
  width: 58px;
  height: 58px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 4px 10px rgba(15, 23, 42, 0.12);
  color: #ffffff;
  flex-shrink: 0;
}

.app-icon svg {
  width: 28px;
  height: 28px;
}

.tool-name {
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 6px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-tag {
  display: inline-block;
  font-size: 0.69rem;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.price-free {
  background: var(--free-bg);
  color: var(--free-text);
}

.price-freemium,
.price-beta {
  background: var(--onetime-bg);
  color: var(--onetime-text);
}

.price-trial {
  background: var(--sub-bg);
  color: var(--sub-text);
}

.price-paid {
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.ads-flag {
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--sub-text);
  margin-left: 4px;
}

.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--text-muted);
}

/* ---------- Floating Hover Preview Card ---------- */
.hover-card {
  position: fixed;
  z-index: 50;
  width: 290px;
  padding: 13px 15px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-pop);
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.hover-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.hover-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text);
}

.hover-price {
  font-size: 0.74rem;
  font-weight: 650;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.hover-desc {
  margin: 0 0 8px;
  font-size: 0.83rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.hover-verdict {
  margin: 0 0 9px;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  background: var(--tested-soft);
  border: 1px solid var(--tested-border);
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--tested-text);
}

.hover-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
}

.hover-status.is-tested {
  color: var(--tested-text);
  font-weight: 650;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 16px 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.link-btn:hover {
  text-decoration: underline;
}

/* ---------- Modals ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  box-shadow: var(--shadow-pop);
}

.modal-wide {
  max-width: 820px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.modal-panel h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.modal-lead {
  margin: 0 0 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Tool Detail Modal */
.detail-head {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 16px;
  padding-right: 32px;
}

.detail-head .app-icon {
  margin-bottom: 0;
  width: 54px;
  height: 54px;
}

.detail-title {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.detail-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.detail-summary {
  margin: 0 0 18px;
  font-size: 0.95rem;
  line-height: 1.55;
}

.detail-box {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  margin-bottom: 18px;
  font-size: 0.86rem;
}

.detail-box.tested-box {
  background: var(--tested-soft);
  border-color: var(--tested-border);
}

.tested-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.tested-title {
  font-weight: 700;
  color: var(--tested-text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tested-date {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.tested-scenario {
  margin: 0 0 12px;
  font-size: 0.83rem;
  color: var(--text-muted);
}

.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.pros-cons h4 {
  margin: 0 0 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pros-cons ul {
  margin: 0;
  padding-left: 16px;
  font-size: 0.83rem;
}

.pros-cons li {
  margin-bottom: 4px;
}

.verdict-line {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--tested-border);
  font-size: 0.85rem;
}

.detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.rnd-footnote {
  font-size: 0.75rem;
  color: var(--text-faint);
}

/* Rules Modal */
.rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.rules-col {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.rules-col h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.rules-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.rules-list li {
  margin-bottom: 10px;
}

.rules-list strong {
  color: var(--text);
}

/* Submit Form */
.beta-banner {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--tested-soft);
  border: 1px solid var(--tested-border);
  color: var(--tested-text);
  font-size: 0.75rem;
  font-weight: 700;
}

.submit-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.submit-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 600;
}

.submit-form input,
.submit-form select {
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.form-note {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--text-faint);
}

.form-note.is-success {
  color: var(--tested-text);
  font-weight: 600;
}

.form-note.is-error {
  color: #dc2626;
  font-weight: 600;
}

.category-helper {
  margin: -6px 0 2px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.logo-upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-upload-label {
  flex: 1;
}

.logo-preview-box {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 1px dashed var(--border-strong);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-faint);
  overflow: hidden;
  flex-shrink: 0;
}

.logo-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Permanent Catalog & Record Pages ---------- */
.catalog-narrow {
  max-width: 780px;
}

.breadcrumb {
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-bottom: 14px;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.catalog-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.catalog-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

.catalog-row-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 5px;
}

.record-id {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.catalog-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.catalog-name:hover {
  text-decoration: underline;
}

.catalog-ads {
  font-size: 0.74rem;
  color: var(--text-faint);
}

.catalog-desc {
  margin: 0 0 6px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.catalog-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-faint);
}

.catalog-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.tested-pill-sm,
.tested-pill-lg {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: var(--radius-pill);
  background: var(--tested-soft);
  border: 1px solid var(--tested-border);
  color: var(--tested-text);
  font-weight: 700;
}

.tested-pill-sm {
  font-size: 0.7rem;
  padding: 2px 7px;
}

.tested-pill-lg {
  font-size: 0.8rem;
  padding: 5px 12px;
}

.verified-pill-sm,
.verified-pill-lg {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
}

.verified-pill-sm {
  font-size: 0.7rem;
  padding: 2px 7px;
}

.verified-pill-lg {
  font-size: 0.8rem;
  padding: 5px 12px;
}

.record-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
}

.record-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.record-title {
  margin: 6px 0 0;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.record-summary {
  margin: 0 0 20px;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.maker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.maker-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 0.84rem;
}

.maker-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}

.maker-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.editorial-note {
  margin: 10px 0 0;
  font-size: 0.75rem;
  color: var(--text-faint);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .desktop-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar-center {
    display: none;
  }
  .desktop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .catalog-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .maker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .controls-right {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }
  .search-wrap {
    flex: 1;
    max-width: 240px;
  }
  .filter-divider {
    display: none;
  }
  .rules-grid,
  .pros-cons,
  .form-row {
    grid-template-columns: 1fr;
  }
  .hover-card {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .desktop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .brand-sub {
    display: none;
  }
  .beta-tag {
    display: none;
  }
}
