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

:root {
  --color-earth: #5C3317;
  --color-clay: #8B4513;
  --color-sand: #D2B48C;
  --color-sand-light: #F5F0EB;
  --color-sky: #4A90A4;
  --color-sky-light: #E8F4F8;
  --color-danger: #C0392B;
  --color-success: #27AE60;
  --color-warning: #E67E22;
  --color-text: #2C2420;
  --color-text-light: #6B5D54;
  --color-white: #FFFFFF;
  --color-border: #D9CFC4;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --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);
  color: var(--color-text);
  background: var(--color-sand-light);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--color-clay); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--color-earth); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.skip-link {
  position: absolute; top: -100%; left: 1rem; z-index: 100;
  background: var(--color-earth); color: var(--color-white);
  padding: 0.5rem 1rem; border-radius: 0 0 var(--radius) var(--radius);
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 0; }

/* === Header === */
.site-header {
  background: var(--color-white);
  border-bottom: 2px solid var(--color-sand);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 0.75rem; padding-bottom: 0.75rem;
}
.logo {
  display: flex; align-items: center; gap: 0.5rem;
  text-decoration: none; color: var(--color-earth);
  font-weight: 800; font-size: 1.25rem;
}
.logo:hover { color: var(--color-clay); }
.logo-icon { flex-shrink: 0; }
.logo-text .accent { color: var(--color-sky); }

.main-nav ul { display: flex; list-style: none; gap: 1.5rem; }
.main-nav a {
  text-decoration: none; color: var(--color-text-light);
  font-weight: 500; font-size: 0.95rem;
  padding: 0.25rem 0; border-bottom: 2px solid transparent;
  transition: all var(--transition);
}
.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--color-earth); border-bottom-color: var(--color-sky);
}

/* === Hero === */
.hero {
  background: linear-gradient(135deg, var(--color-earth) 0%, var(--color-clay) 60%, #6B3A1F 100%);
  color: var(--color-white);
  padding: 3.5rem 0 3rem;
}
.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800; line-height: 1.2; margin-bottom: 1rem;
}
.hero-sub {
  font-size: 1.1rem; opacity: 0.9; max-width: 600px; margin-bottom: 1.5rem;
}
.hero-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.badge {
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25);
  padding: 0.25rem 0.75rem; border-radius: 999px;
  font-size: 0.8rem; font-weight: 500;
}

/* === Planner Section === */
.planner-section { padding: 2.5rem 0; }
.planner-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start;
}

.planner-inputs h2 { font-size: 1.4rem; margin-bottom: 0.25rem; }
.input-intro { color: var(--color-text-light); margin-bottom: 1.5rem; font-size: 0.95rem; }

.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-weight: 600; margin-bottom: 0.35rem; font-size: 0.95rem; }
.form-select {
  width: 100%; padding: 0.65rem 0.75rem;
  border: 2px solid var(--color-border); border-radius: var(--radius);
  background: var(--color-white); font-size: 0.95rem; color: var(--color-text);
  font-family: var(--font); transition: border-color var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236B5D54' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.75rem center;
  padding-right: 2.25rem;
}
.form-select:focus { outline: none; border-color: var(--color-sky); box-shadow: 0 0 0 3px rgba(74,144,164,0.2); }
.form-hint { font-size: 0.82rem; color: var(--color-text-light); margin-top: 0.25rem; }

fieldset.form-group { border: none; padding: 0; }
legend.form-label { margin-bottom: 0.5rem; }
.checkbox-group { display: flex; flex-direction: column; gap: 0.5rem; }
.checkbox-label {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.92rem; cursor: pointer; padding: 0.35rem 0;
}
.checkbox-label input[type="checkbox"] {
  width: 1.1rem; height: 1.1rem; accent-color: var(--color-clay);
  cursor: pointer;
}

/* === Results Panel === */
.results-panel {
  background: var(--color-white);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.results-sticky { position: sticky; top: 5rem; padding: 1.5rem; }
.results-header { margin-bottom: 1rem; }
.results-header h2 { font-size: 1.2rem; }
.results-sub { font-size: 0.85rem; color: var(--color-text-light); }

.summary-bar {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.summary-item {
  background: var(--color-sand-light); border-radius: var(--radius);
  padding: 0.6rem 0.75rem; text-align: center;
}
.summary-number { display: block; font-weight: 800; font-size: 1.1rem; color: var(--color-earth); }
.summary-label { font-size: 0.75rem; color: var(--color-text-light); }

.priority-list { list-style: none; margin-bottom: 1rem; }
.empty-state {
  text-align: center; padding: 2rem 1rem; color: var(--color-text-light);
}
.empty-state svg { margin-bottom: 0.75rem; }

.priority-item {
  border: 1px solid var(--color-border); border-radius: var(--radius);
  margin-bottom: 0.5rem; overflow: hidden;
}
.priority-item-header {
  display: flex; align-items: flex-start; gap: 0.6rem;
  padding: 0.7rem 0.75rem; cursor: pointer;
  transition: background var(--transition);
}
.priority-item-header:hover { background: var(--color-sand-light); }
.priority-rank {
  background: var(--color-earth); color: var(--color-white);
  font-weight: 800; font-size: 0.75rem;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 0.1rem;
}
.priority-rank.rank-high { background: var(--color-danger); }
.priority-rank.rank-mid { background: var(--color-warning); }
.priority-rank.rank-low { background: var(--color-success); }

.priority-item-title { font-weight: 600; font-size: 0.92rem; flex: 1; }
.priority-item-meta { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.impact-shields { display: flex; gap: 1px; }
.shield { width: 10px; height: 14px; border-radius: 2px 2px 0 0; }
.shield.filled { background: var(--color-danger); }
.shield.empty { background: var(--color-border); }
.cost-badge {
  font-size: 0.72rem; font-weight: 600;
  background: var(--color-sky-light); color: var(--color-sky);
  padding: 0.15rem 0.4rem; border-radius: 4px;
  white-space: nowrap;
}
.difficulty-badge {
  font-size: 0.7rem; font-weight: 600;
  padding: 0.15rem 0.4rem; border-radius: 4px;
  white-space: nowrap;
}
.difficulty-diy { background: #E8F8F0; color: var(--color-success); }
.difficulty-pro { background: #FFF3E0; color: var(--color-warning); }

.item-check {
  width: 1.1rem; height: 1.1rem; accent-color: var(--color-success);
  cursor: pointer; flex-shrink: 0; margin-top: 0.1rem;
}

.priority-item-body {
  padding: 0 0.75rem 0.75rem 2.6rem;
  font-size: 0.85rem; color: var(--color-text-light);
  border-top: 1px solid var(--color-border);
}
.priority-item-body p { margin-bottom: 0.4rem; }
.priority-item-body .tip {
  background: var(--color-sky-light); border-radius: var(--radius);
  padding: 0.5rem 0.65rem; font-size: 0.82rem;
}

.results-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.5rem 0.85rem; border-radius: var(--radius);
  font-size: 0.85rem; font-weight: 600; font-family: var(--font);
  cursor: pointer; transition: all var(--transition); border: 2px solid transparent;
}
.btn-secondary {
  background: var(--color-sand-light); color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover { background: var(--color-sand); }

.save-status {
  font-size: 0.8rem; color: var(--color-text-light);
  margin-top: 0.5rem; min-height: 1.2em;
}

/* === Content Sections === */
.content-section { padding: 2.5rem 0; }
.content-alt { background: var(--color-white); }
.content-section h2 {
  font-size: 1.5rem; margin-bottom: 1.5rem;
  color: var(--color-earth);
}
.content-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
}
.content-block h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.content-block p { color: var(--color-text-light); font-size: 0.95rem; }

.mistakes-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem;
}
.mistake-card {
  background: var(--color-white); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 1.25rem;
  border-left: 4px solid var(--color-danger);
}
.mistake-card h3 { font-size: 1rem; margin-bottom: 0.4rem; }
.mistake-card p { color: var(--color-text-light); font-size: 0.92rem; }

.assumptions-box {
  background: var(--color-sky-light); border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}
.assumptions-box ul { padding-left: 1.25rem; }
.assumptions-box li { margin-bottom: 0.4rem; font-size: 0.93rem; color: var(--color-text-light); }

.faq-list { display: flex; flex-direction: column; gap: 0.5rem; }
.faq-item {
  background: var(--color-white); border: 1px solid var(--color-border);
  border-radius: var(--radius); overflow: hidden;
}
.faq-item summary {
  padding: 0.85rem 1rem; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; font-size: 1.2rem; color: var(--color-text-light);
  transition: transform var(--transition);
}
.faq-item[open] summary::after { content: '−'; }
.faq-item p {
  padding: 0 1rem 0.85rem; color: var(--color-text-light);
  font-size: 0.92rem;
}

/* === Footer === */
.site-footer {
  background: var(--color-earth); color: var(--color-sand);
  padding: 2rem 0 1.5rem; margin-top: 2rem;
}
.footer-inner { display: flex; flex-direction: column; gap: 1rem; }
.footer-brand p { font-size: 0.85rem; margin-top: 0.25rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-links a { color: var(--color-sand); text-decoration: none; font-size: 0.85rem; }
.footer-links a:hover { color: var(--color-white); }
.footer-note { font-size: 0.78rem; opacity: 0.7; }

/* === Print Styles === */
@media print {
  .site-header, .site-footer, .planner-inputs, .results-actions,
  .hero-meta, .save-status, .skip-link { display: none !important; }
  .planner-layout { display: block; }
  .results-panel { border: none; box-shadow: none; }
  .results-sticky { position: static; }
  .priority-item { break-inside: avoid; }
  body { background: white; color: black; }
  .priority-rank { border: 1px solid #333; }
}

/* === Responsive === */
@media (max-width: 900px) {
  .planner-layout { grid-template-columns: 1fr; }
  .results-sticky { position: static; }
  .content-grid, .mistakes-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .header-inner { flex-direction: column; gap: 0.5rem; }
  .main-nav ul { gap: 1rem; }
  .hero { padding: 2rem 0; }
  .hero h1 { font-size: 1.5rem; }
  .summary-bar { grid-template-columns: 1fr 1fr; }
  .results-actions { flex-direction: column; }
  .btn { justify-content: center; }
  .content-section { padding: 1.5rem 0; }
  .planner-section { padding: 1.5rem 0; }
}



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