:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --surface-alt: #f3f1ed;
  --border: #e0ddd6;
  --text: #2c2a26;
  --text-muted: #6b6560;
  --text-light: #9a9590;
  --accent: #6b8f71;
  --accent-hover: #5a7d60;
  --danger: #c45b4a;
  --danger-hover: #a84a3a;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 600;
  font-size: 1.1rem;
}
.brand:hover { text-decoration: none; }
.brand-icon { color: var(--accent); }

.site-nav {
  display: flex;
  gap: 1.5rem;
}
.site-nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}
.site-nav a:hover { color: var(--text); text-decoration: none; }

/* Layout */
.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  align-items: start;
}

/* Sidebar */
.sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.sidebar-sticky {
  position: sticky;
  top: 5rem;
}
.sidebar-title {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.season-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  background: var(--surface-alt);
  padding: 0.25rem;
  border-radius: var(--radius);
}
.season-tab {
  flex: 1;
  padding: 0.5rem;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}
.season-tab:hover { color: var(--text); }
.season-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.sidebar-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.item-list {
  max-height: 400px;
  overflow-y: auto;
}

.item-card {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}
.item-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}
.item-card-name { font-weight: 600; }
.item-card-category {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.item-card-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.item-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.item-card-actions button {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 4px;
  cursor: pointer;
}
.item-card-actions button:hover { background: var(--surface-alt); }

.condition-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.25rem;
}
.condition-5 { background: #6b8f71; }
.condition-4 { background: #8fad7a; }
.condition-3 { background: #c4a95b; }
.condition-2 { background: #c48b4a; }
.condition-1 { background: #c45b4a; }

/* Main Content */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.section-header {
  margin-bottom: 1.5rem;
}
.section-header h2 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}
.section-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Form */
.add-form { display: flex; flex-direction: column; gap: 1rem; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}
.form-group input,
.form-group select {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text);
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(107, 143, 113, 0.15);
}

.season-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.4rem;
}
.season-checkboxes label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost {
  background: var(--surface-alt);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { background: var(--border); }
.btn-danger-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--danger);
}
.btn-danger-ghost:hover { background: #fdf2f0; }

/* Gap Analysis */
.gap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.gap-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
}
.gap-card h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.gap-count {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.gap-count.ok { color: var(--accent); }
.gap-count.warn { color: #c4a95b; }
.gap-count.danger { color: var(--danger); }
.gap-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Shopping List */
.budget-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.budget-row label {
  font-size: 0.9rem;
  font-weight: 500;
}
.budget-row input {
  width: 100px;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
}

.shopping-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.shopping-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.shopping-item-priority {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
.priority-high { background: #fdf2f0; color: var(--danger); }
.priority-medium { background: #fdf8f0; color: #c48b4a; }
.priority-low { background: #f0f5f1; color: var(--accent); }
.shopping-item-name { flex: 1; font-weight: 500; }
.shopping-item-cost { color: var(--text-muted); font-size: 0.85rem; }

/* About Section */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.about-card {
  padding: 1.25rem;
  background: var(--surface-alt);
  border-radius: var(--radius);
}
.about-card h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}
.about-card p,
.about-card li {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.about-card ul {
  padding-left: 1.25rem;
}
.about-card li { margin-bottom: 0.35rem; }

.faq-section {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}
.faq-section h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}
details {
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  background: var(--surface-alt);
  border-radius: 6px;
}
details summary {
  font-weight: 500;
  cursor: pointer;
  font-size: 0.95rem;
}
details p {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.footer-meta { margin-top: 0.5rem; }

/* Responsive */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar { order: 2; }
  .main-content { order: 1; }
  .sidebar-sticky { position: static; }
  .header-inner { flex-direction: column; gap: 0.75rem; }
  .site-nav { gap: 1rem; }
}

@media print {
  .site-header, .sidebar, .site-footer, .btn, .budget-row { display: none; }
  .section { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
}



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