/* ===== CSS Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --c-bg: #faf8f5;
  --c-surface: #ffffff;
  --c-surface-alt: #f3efe8;
  --c-text: #2c2420;
  --c-text-muted: #6b5e54;
  --c-text-light: #9a8b7d;
  --c-accent: #c47a3a;
  --c-accent-hover: #a86528;
  --c-accent-light: #f5e6d3;
  --c-beneficial: #2d8a4e;
  --c-beneficial-bg: #e6f7ed;
  --c-safe: #5a8f3c;
  --c-safe-bg: #eef5e8;
  --c-caution: #c4881a;
  --c-caution-bg: #fdf5e0;
  --c-avoid: #c43a3a;
  --c-avoid-bg: #fce8e8;
  --c-border: #e0d8ce;
  --c-shadow: rgba(44,36,32,0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width: 800px;
  --header-height: 60px;
}
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 16px); }
body { font-family: var(--font); background: var(--c-bg); color: var(--c-text); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: var(--c-accent); text-decoration: none; }
a:hover { color: var(--c-accent-hover); text-decoration: underline; }
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ===== Header ===== */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--c-surface); border-bottom: 1px solid var(--c-border); height: var(--header-height); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.1rem; color: var(--c-text); }
.logo:hover { text-decoration: none; color: var(--c-text); }
.logo-icon { font-size: 1.4rem; }
.main-nav { display: flex; gap: 20px; }
.main-nav a { font-size: 0.9rem; color: var(--c-text-muted); font-weight: 500; }
.main-nav a:hover { color: var(--c-accent); }
.nav-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle-bar { width: 22px; height: 2px; background: var(--c-text); border-radius: 2px; transition: transform 0.2s; }
.nav-menu { display: none; flex-direction: column; background: var(--c-surface); border-bottom: 1px solid var(--c-border); padding: 8px 20px; }
.nav-menu:not([hidden]) { display: flex; }
.nav-menu a { padding: 10px 0; font-size: 0.95rem; color: var(--c-text-muted); border-bottom: 1px solid var(--c-border); }
.nav-menu a:last-child { border-bottom: none; }

/* ===== Hero ===== */
.hero { padding: 48px 0 40px; text-align: center; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; line-height: 1.25; margin-bottom: 12px; }
.hero-sub { font-size: 1.05rem; color: var(--c-text-muted); max-width: 560px; margin: 0 auto 28px; }
.search-wrap { position: relative; max-width: 540px; margin: 0 auto 16px; }
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--c-text-light); pointer-events: none; }
#search-input { width: 100%; padding: 14px 44px 14px 46px; font-size: 1rem; font-family: var(--font); border: 2px solid var(--c-border); border-radius: var(--radius); background: var(--c-surface); color: var(--c-text); outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
#search-input:focus { border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-light); }
#search-input::placeholder { color: var(--c-text-light); }
.search-clear { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: var(--c-surface-alt); border: 1px solid var(--c-border); border-radius: 50%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 0.8rem; color: var(--c-text-muted); }
.search-clear:hover { background: var(--c-border); }
.quick-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; align-items: center; }
.quick-tags-label { font-size: 0.85rem; color: var(--c-text-light); }
.tag { padding: 5px 14px; font-size: 0.85rem; font-family: var(--font); border: 1px solid var(--c-border); border-radius: 20px; background: var(--c-surface); color: var(--c-text-muted); cursor: pointer; transition: all 0.15s; }
.tag:hover { border-color: var(--c-accent); color: var(--c-accent); background: var(--c-accent-light); }

/* ===== Results ===== */
.results-area { padding-bottom: 40px; }
.results-empty { text-align: center; padding: 40px 0; }
.results-empty h2 { font-size: 1.2rem; margin: 12px 0 8px; }
.results-empty p { color: var(--c-text-muted); font-size: 0.95rem; max-width: 440px; margin: 0 auto; }
.suggestion-hint { margin-top: 12px; font-size: 0.9rem; }
.result-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 28px; box-shadow: 0 2px 8px var(--c-shadow); }
.result-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.result-header h2 { font-size: 1.4rem; font-weight: 700; text-transform: capitalize; }
.rating-badge { padding: 4px 14px; border-radius: 20px; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
.rating-badge.beneficial { background: var(--c-beneficial-bg); color: var(--c-beneficial); }
.rating-badge.safe { background: var(--c-safe-bg); color: var(--c-safe); }
.rating-badge.caution { background: var(--c-caution-bg); color: var(--c-caution); }
.rating-badge.avoid { background: var(--c-avoid-bg); color: var(--c-avoid); }
.result-explanation { font-size: 1.05rem; color: var(--c-text); margin-bottom: 16px; line-height: 1.7; }
.result-details { background: var(--c-surface-alt); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 16px; font-size: 0.95rem; color: var(--c-text-muted); }
.result-details p + p { margin-top: 8px; }
.result-breeds { margin-bottom: 16px; }
.result-breeds h3 { font-size: 0.9rem; font-weight: 600; color: var(--c-text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.04em; }
.breed-tag { display: inline-block; padding: 3px 10px; background: var(--c-accent-light); color: var(--c-accent-hover); border-radius: 12px; font-size: 0.8rem; margin: 2px 4px 2px 0; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { padding: 8px 18px; font-size: 0.9rem; font-family: var(--font); font-weight: 500; border: 1px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-surface); color: var(--c-text); cursor: pointer; transition: all 0.15s; }
.btn:hover { background: var(--c-surface-alt); }
.btn:active { transform: scale(0.97); }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-outline { background: transparent; border-color: var(--c-text-light); color: var(--c-text-muted); }
.btn-outline:hover { border-color: var(--c-accent); color: var(--c-accent); }

/* ===== Red Flags ===== */
.red-flags { padding: 48px 0; background: var(--c-surface); }
.red-flags h2, .marketing-tricks h2, .history-section h2, .reference-notes h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 8px; }
.section-intro { color: var(--c-text-muted); font-size: 0.95rem; margin-bottom: 28px; max-width: 560px; }
.flag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.flag-card { border-radius: var(--radius-sm); padding: 20px; border: 1px solid var(--c-border); position: relative; }
.flag-card.flag-avoid { background: var(--c-avoid-bg); border-color: #e8b0b0; }
.flag-card.flag-caution { background: var(--c-caution-bg); border-color: #e0c88a; }
.flag-card h3 { font-size: 1rem; margin-bottom: 6px; }
.flag-card p { font-size: 0.9rem; color: var(--c-text-muted); }
.flag-rating { position: absolute; top: 16px; right: 16px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; padding: 2px 10px; border-radius: 10px; letter-spacing: 0.04em; }
.flag-avoid .flag-rating { background: var(--c-avoid); color: #fff; }
.flag-caution .flag-rating { background: var(--c-caution); color: #fff; }

/* ===== Marketing Tricks ===== */
.marketing-tricks { padding: 48px 0; }
.tricks-list { display: flex; flex-direction: column; gap: 0; }
.trick-item { border: 1px solid var(--c-border); border-radius: var(--radius-sm); margin-bottom: 12px; overflow: hidden; }
.trick-item summary { padding: 16px 20px; cursor: pointer; font-size: 0.95rem; background: var(--c-surface); transition: background 0.15s; }
.trick-item summary:hover { background: var(--c-surface-alt); }
.trick-item[open] summary { border-bottom: 1px solid var(--c-border); }
.trick-item p { padding: 16px 20px; font-size: 0.95rem; color: var(--c-text-muted); line-height: 1.7; background: var(--c-bg); }

/* ===== History ===== */
.history-section { padding: 48px 0; background: var(--c-surface); }
.history-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.history-item { display: flex; align-items: center; gap: 6px; padding: 6px 14px; background: var(--c-bg); border: 1px solid var(--c-border); border-radius: 20px; font-size: 0.85rem; cursor: pointer; transition: all 0.15s; }
.history-item:hover { border-color: var(--c-accent); }
.history-item .hist-rating { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.hist-rating.beneficial, .hist-dot.beneficial { background: var(--c-beneficial); }
.hist-rating.safe, .hist-dot.safe { background: var(--c-safe); }
.hist-rating.caution, .hist-dot.caution { background: var(--c-caution); }
.hist-rating.avoid, .hist-dot.avoid { background: var(--c-avoid); }

/* ===== Reference Notes ===== */
.reference-notes { padding: 48px 0; }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.note-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: 20px; }
.note-card h3 { font-size: 1rem; margin-bottom: 8px; }
.note-card p { font-size: 0.9rem; color: var(--c-text-muted); line-height: 1.65; }

/* ===== Footer ===== */
.site-footer { background: var(--c-text); color: #c4b8a8; padding: 40px 0 24px; margin-top: 20px; }
.footer-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.footer-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1rem; }
.footer-nav { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-nav a { font-size: 0.85rem; color: #c4b8a8; }
.footer-nav a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding-top: 20px; font-size: 0.8rem; line-height: 1.7; }
.footer-bottom p + p { margin-top: 4px; }
.footer-bottom a { color: #e0d8ce; text-decoration: underline; }
.footer-bottom a:hover { color: #fff; }

/* ===== Toast ===== */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--c-text); color: #fff; padding: 12px 24px; border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 500; box-shadow: 0 4px 16px rgba(0,0,0,0.2); transition: transform 0.3s ease; z-index: 200; pointer-events: none; }
.toast.show { transform: translateX(-50%) translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .hero { padding: 32px 0 28px; }
  .flag-grid { grid-template-columns: 1fr; }
  .notes-grid { grid-template-columns: 1fr; }
  .result-card { padding: 20px; }
  .result-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .footer-top { flex-direction: column; align-items: flex-start; }
}
@media (min-width: 641px) {
  .nav-menu[hidden] { display: none !important; }
  .nav-menu:not([hidden]) { display: none !important; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
