/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #1a1a1f;
  --bg-card: #23232b;
  --bg-card-hover: #2a2a34;
  --bg-elevated: #2e2e38;
  --text: #e8e6e1;
  --text-muted: #9a9890;
  --text-dim: #6b6960;
  --accent: #c8a96e;
  --accent-light: #dfc58a;
  --accent-dark: #a68a4b;
  --danger: #c94a4a;
  --success: #5aaf65;
  --warning: #d4a843;
  --border: #3a3a44;
  --border-light: #2e2e36;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  --transition: 0.2s ease;
}

html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent-light); text-decoration: none; transition: color var(--transition); }
a:hover, a:focus { color: var(--accent); text-decoration: underline; }

img { max-width: 100%; height: auto; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: -100%; left: 16px;
  background: var(--accent); color: var(--bg);
  padding: 8px 16px; border-radius: var(--radius-sm);
  z-index: 100; font-weight: 600;
}
.skip-link:focus { top: 16px; }

/* ===== HEADER ===== */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; gap: 16px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  color: var(--text); text-decoration: none; flex-shrink: 0;
}
.logo:hover, .logo:focus { text-decoration: none; color: var(--accent-light); }
.logo-icon { color: var(--accent); flex-shrink: 0; }
.logo-text { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; }
.logo-accent { color: var(--accent); }

.main-nav ul { display: flex; list-style: none; gap: 4px; }
.main-nav a {
  color: var(--text-muted); padding: 6px 12px;
  border-radius: var(--radius-sm); font-size: 0.9rem;
  text-decoration: none; transition: all var(--transition);
}
.main-nav a:hover, .main-nav a:focus,
.main-nav a.active {
  color: var(--text); background: var(--bg-elevated);
  text-decoration: none;
}

.nav-toggle {
  display: none; flex-direction: column; gap: 4px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 1px;
}

/* ===== HERO ===== */
.hero {
  padding: 64px 0 48px;
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800; line-height: 1.15;
  letter-spacing: -0.03em; margin-bottom: 12px;
}
.hero-sub {
  font-size: 1.1rem; color: var(--text-muted);
  max-width: 560px; margin-bottom: 32px;
}
.hero-stats { display: flex; gap: 32px; }
.hero-stats .stat { text-align: center; }
.hero-stats strong {
  display: block; font-size: 1.6rem;
  color: var(--accent); font-weight: 800;
}
.hero-stats span {
  font-size: 0.8rem; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.06em;
}

/* ===== FILTERS ===== */
.filters-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  position: sticky; top: 60px; z-index: 40;
}
.filters-bar {
  display: flex; align-items: center; gap: 20px;
  flex-wrap: wrap;
}
.filter-group { display: flex; align-items: center; gap: 10px; }
.filter-label {
  font-size: 0.85rem; color: var(--text-muted);
  white-space: nowrap;
}
.filter-chips { display: flex; gap: 6px; }
.chip {
  padding: 5px 14px; border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent; color: var(--text-muted);
  font-size: 0.85rem; cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}
.chip:hover, .chip:focus {
  border-color: var(--accent); color: var(--text);
}
.chip.active {
  background: var(--accent); color: var(--bg);
  border-color: var(--accent); font-weight: 600;
}

.sort-select {
  padding: 5px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text);
  font-size: 0.85rem; font-family: var(--font);
  cursor: pointer;
}

/* ===== SECTION TITLES ===== */
.section-title {
  font-size: 1.5rem; font-weight: 700;
  letter-spacing: -0.02em; margin-bottom: 6px;
}
.section-sub {
  color: var(--text-muted); font-size: 0.95rem;
  margin-bottom: 28px;
}

/* ===== RANKINGS ===== */
.rankings-section { padding: 48px 0; }
.rankings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.spot-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.spot-card:hover, .spot-card:focus-within {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow);
}
.spot-card.expanded {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}

.spot-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 12px;
  margin-bottom: 12px;
}
.spot-rank {
  font-size: 1.8rem; font-weight: 800;
  color: var(--accent); line-height: 1;
  min-width: 36px;
}
.spot-title-area { flex: 1; }
.spot-title {
  font-size: 1.05rem; font-weight: 600;
  margin-bottom: 4px;
}
.spot-housing {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.housing-tag {
  font-size: 0.7rem; padding: 2px 8px;
  border-radius: 10px; background: var(--bg-elevated);
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.04em;
}

.spot-scores {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-bottom: 12px;
}
.score-item { text-align: center; }
.score-label {
  font-size: 0.7rem; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.04em;
  display: block; margin-bottom: 2px;
}
.score-bar {
  height: 4px; background: var(--bg-elevated);
  border-radius: 2px; overflow: hidden;
  margin-bottom: 2px;
}
.score-bar-fill {
  height: 100%; border-radius: 2px;
  transition: width 0.4s ease;
}
.score-bar-fill.high { background: var(--success); }
.score-bar-fill.medium { background: var(--warning); }
.score-bar-fill.low { background: var(--danger); }
.score-num {
  font-size: 0.75rem; color: var(--text-muted);
}

.spot-cost {
  font-size: 0.8rem; color: var(--text-dim);
  margin-bottom: 8px;
}
.spot-cost.free { color: var(--success); }

.spot-details {
  display: none;
  border-top: 1px solid var(--border-light);
  padding-top: 14px; margin-top: 14px;
}
.spot-card.expanded .spot-details { display: block; }

.spot-detail-row {
  margin-bottom: 10px;
}
.spot-detail-row h4 {
  font-size: 0.8rem; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 3px;
}
.spot-detail-row p {
  font-size: 0.9rem; color: var(--text-muted);
}

.spot-actions {
  display: flex; gap: 8px; margin-top: 14px;
}

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
  border: 1px solid transparent;
  font-family: var(--font);
  text-decoration: none;
}
.btn:hover, .btn:focus { text-decoration: none; }
.btn-primary {
  background: var(--accent); color: var(--bg);
  border-color: var(--accent);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--accent-light);
  border-color: var(--accent-light);
}
.btn-outline {
  background: transparent; color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover, .btn-outline:focus {
  border-color: var(--accent); color: var(--accent);
}
.btn-ghost {
  background: transparent; color: var(--text-dim);
  border-color: transparent;
}
.btn-ghost:hover, .btn-ghost:focus {
  color: var(--text-muted);
}

.empty-state {
  text-align: center; padding: 48px;
  color: var(--text-dim);
}

/* ===== COMPARE ===== */
.compare-section {
  padding: 48px 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.compare-panel {
  min-height: 120px;
  margin-bottom: 20px;
}
.compare-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px; color: var(--text-dim);
  text-align: center; gap: 12px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
}
.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.compare-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.compare-card h3 {
  font-size: 1rem; margin-bottom: 4px;
}
.compare-card .compare-rank {
  font-size: 0.8rem; color: var(--accent);
  margin-bottom: 12px;
}
.compare-attr {
  display: flex; justify-content: space-between;
  font-size: 0.85rem; padding: 4px 0;
  border-bottom: 1px solid var(--border-light);
}
.compare-attr:last-child { border-bottom: none; }
.compare-attr span:first-child { color: var(--text-dim); }
.compare-remove {
  margin-top: 10px; width: 100%;
  text-align: center;
}
.compare-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
}

/* ===== MISTAKES ===== */
.mistakes-section { padding: 48px 0; }
.mistakes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.mistake-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
}
.mistake-card::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--danger);
  border-radius: var(--radius) 0 0 var(--radius);
}
.mistake-icon {
  font-size: 1.6rem; margin-bottom: 8px;
}
.mistake-card h3 {
  font-size: 1rem; margin-bottom: 6px;
}
.mistake-card p {
  font-size: 0.88rem; color: var(--text-muted);
  margin-bottom: 10px;
}
.mistake-tag {
  font-size: 0.75rem; color: var(--danger);
  background: rgba(201,74,74,0.12);
  padding: 3px 10px; border-radius: 10px;
}

/* ===== GUIDE ===== */
.guide-section {
  padding: 48px 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.guide-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.guide-block h3 {
  font-size: 1rem; margin-bottom: 8px;
  color: var(--accent-light);
}
.guide-block p {
  font-size: 0.9rem; color: var(--text-muted);
  line-height: 1.65;
}

/* ===== NOTES ===== */
.notes-section { padding: 48px 0; }
.notes-area { max-width: 640px; }
.notes-textarea {
  width: 100%; padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text); font-family: var(--font);
  font-size: 0.95rem; line-height: 1.6;
  resize: vertical;
  transition: border-color var(--transition);
}
.notes-textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,169,110,0.15);
}
.notes-actions {
  display: flex; align-items: center;
  gap: 12px; margin-top: 10px;
}
.save-status {
  font-size: 0.85rem; color: var(--success);
  opacity: 0; transition: opacity 0.3s;
}
.save-status.visible { opacity: 1; }

/* ===== FOOTER ===== */
.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
.footer-inner {
  display: flex; flex-direction: column;
  gap: 16px;
}
.footer-brand p {
  font-size: 0.85rem; color: var(--text-dim);
  margin-top: 4px;
}
.footer-links {
  display: flex; gap: 16px; flex-wrap: wrap;
}
.footer-links a {
  font-size: 0.85rem; color: var(--text-muted);
}
.footer-links a:hover { color: var(--accent-light); }
.footer-meta {
  font-size: 0.78rem; color: var(--text-dim);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .main-nav.open { 
    display: block; 
    position: absolute; 
    top: 60px; left: 0; right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
  }
  .main-nav.open ul { flex-direction: column; gap: 2px; }
  .nav-toggle { display: flex; }
  .hero { padding: 40px 0 32px; }
  .hero-stats { gap: 20px; }
  .filters-bar { flex-direction: column; align-items: flex-start; }
  .rankings-grid { grid-template-columns: 1fr; }
  .compare-actions { flex-direction: column; }
  .compare-actions .btn { width: 100%; justify-content: center; }
}

@media print {
  .site-header, .filters-section, .notes-section,
  .compare-actions, .site-footer, .nav-toggle { display: none; }
  body { background: #fff; color: #000; }
  .spot-card { break-inside: avoid; border: 1px solid #ccc; }
  .spot-details { display: block !important; }
  .hero { padding: 20px 0; border: none; }
  .section-title { color: #000; }
}



/* 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;
}
