:root { --primary: #1a3d5c; --bg: #f8f9fa; --text: #333; --card-bg: #ffffff; --accent: #e67e22; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; margin: 0; padding: 0; background: var(--bg); color: var(--text); line-height: 1.6; }
.container { max-width: 1000px; margin: 0 auto; padding: 40px 20px; }

header { text-align: center; margin-bottom: 40px; }
h1 { color: var(--primary); margin-bottom: 10px; font-size: 2.5em; }
.subtitle { font-size: 1.2em; color: #666; max-width: 780px; margin: 0 auto; }
.subtitle a { color: var(--primary); font-weight: bold; }

/* Tool Cards */
.links { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 40px; }
.card { background: var(--card-bg); padding: 30px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); text-decoration: none; color: var(--text); transition: transform 0.2s, box-shadow 0.2s; border-top: 5px solid var(--primary); display: flex; flex-direction: column; }
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
.card h3 { margin-top: 0; color: var(--primary); font-size: 1.4em; }
.card p { font-size: 0.95em; color: #555; flex-grow: 1; }
.card .btn { display: inline-block; margin-top: 15px; color: var(--primary); font-weight: bold; text-decoration: underline; }

/* Interactive Section */
.interactive-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 40px; align-items: start; }
@media (max-width: 768px) { .interactive-grid { grid-template-columns: 1fr; } }
.panel { background: var(--card-bg); padding: 20px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.panel h2, .panel h3 { color: var(--primary); margin-top: 0; border-bottom: 2px solid #eee; padding-bottom: 10px; font-size: 1.2em; }

/* Snapshot */
.snapshot-item { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed #eee; }
.snapshot-item:last-child { border-bottom: none; }
.snapshot-label { color: #555; font-weight: 500; font-size: 0.95em; }
.snapshot-value { color: var(--primary); font-weight: bold; font-size: 0.95em; }
.snapshot-source { font-size: 0.8em; color: #999; margin-top: 15px; text-align: right; display: block; }

/* Content Sections */
.content-section { background: var(--card-bg); padding: 40px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); margin-bottom: 30px; }
.content-section h2 { color: var(--primary); margin-top: 0; border-bottom: 2px solid #eee; padding-bottom: 10px; }
.content-section h3 { color: var(--primary); margin-top: 25px; }
.content-section p { margin-bottom: 15px; font-size: 1.05em; line-height: 1.8; }
.content-section a { color: var(--primary); font-weight: 600; }

/* Dashboard Search & Compare */
.search-container-group { display: flex; align-items: center; gap: 15px; margin-bottom: 25px; flex-wrap: wrap; }
.search-container { position: relative; flex: 1; min-width: 250px; }
.vs-badge { font-weight: bold; color: var(--accent); font-size: 1.2em; padding: 0 10px; }
#countySearch1, #countySearch2 { width: 100%; padding: 12px; font-size: 1em; border: 1px solid #ddd; border-radius: 8px; box-sizing: border-box; }
#countySearch1:focus, #countySearch2:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(26, 61, 92, 0.2); }
.search-results { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid #ddd; border-top: none; border-radius: 0 0 8px 8px; max-height: 250px; overflow-y: auto; list-style: none; margin: 0; padding: 0; z-index: 1000; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.search-results li { padding: 10px 15px; cursor: pointer; border-bottom: 1px solid #eee; font-size: 0.95em; }
.search-results li:hover, .search-results li.active { background: #f0f8ff; color: var(--primary); }
.search-results li:last-child { border-bottom: none; }

/* Dashboard Layout */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 768px) { .dashboard-grid { grid-template-columns: 1fr; } }
.county-panel-wrapper { display: flex; flex-direction: column; gap: 15px; }

/* Livability Section (Compact Cards) */
.livability-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 20px; }
.livability-card-mini { background: #fff; border: 1px solid #eee; border-radius: 10px; padding: 20px; text-align: center; transition: transform 0.2s, box-shadow 0.2s; text-decoration: none; color: inherit; }
.livability-card-mini:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }
.livability-card-mini h4 { margin: 0 0 10px; color: var(--primary); font-size: 1.1em; }
.livability-card-mini .score { font-size: 2em; color: var(--accent); font-weight: bold; margin-bottom: 5px; }
.livability-card-mini .tier { font-size: 0.85em; color: #666; text-transform: uppercase; letter-spacing: 1px; }
.livability-cta { margin-top: 25px; text-align: center; }
.livability-cta a { color: var(--accent); font-weight: bold; text-decoration: none; font-size: 1.05em; }
.livability-cta a:hover { text-decoration: underline; }
.loading-text { color: #999; padding: 20px 0; font-style: italic; text-align: center; }

/* Guide cards */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-top: 20px; }
.guide-card { background: #fff; border: 1px solid #eee; border-radius: 10px; padding: 20px; text-decoration: none; color: var(--text); transition: box-shadow 0.2s, transform 0.2s; display: flex; flex-direction: column; }
.guide-card:hover { box-shadow: 0 8px 20px rgba(0,0,0,0.08); transform: translateY(-3px); }
.guide-card h4 { color: var(--primary); margin: 0 0 8px; font-size: 1.05em; }
.guide-card p { font-size: 0.9em; color: #555; flex-grow: 1; margin: 0 0 12px; }
.guide-card .read { color: var(--accent); font-weight: bold; font-size: 0.9em; }

/* FAQ */
.faq-item { border-bottom: 1px solid #eee; padding: 15px 0; }
.faq-item h4 { margin: 0 0 10px 0; color: var(--primary); font-size: 1.1em; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.faq-item h4::after { content: '+'; font-size: 1.5em; color: var(--accent); }
.faq-item p { margin: 0; color: #555; font-size: 0.95em; display: none; }
.faq-item.active p { display: block; }
.faq-item.active h4::after { content: '-'; }

/* Footer */
footer { text-align: center; margin-top: 60px; padding: 30px 20px; border-top: 1px solid #ddd; font-size: 0.9em; color: #888; }
footer a { color: var(--primary); text-decoration: none; margin: 0 10px; font-weight: bold; }
footer a:hover { text-decoration: underline; }