/* Pet Food Stretch Optimizer - Styles */
:root {
  --color-primary: #F97316;
  --color-primary-dark: #EA580C;
  --color-primary-light: #FFF7ED;
  --color-secondary: #059669;
  --color-secondary-light: #ECFDF5;
  --color-danger: #DC2626;
  --color-danger-light: #FEF2F2;
  --color-warning: #D97706;
  --color-warning-light: #FFFBEB;
  --color-text: #1C1917;
  --color-text-secondary: #57534E;
  --color-text-muted: #78716C;
  --color-bg: #FFFBF5;
  --color-surface: #FFFFFF;
  --color-border: #E7E5E4;
  --color-border-light: #F5F5F4;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --max-width: 1120px;
  --header-height: 64px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

a {
  color: var(--color-primary-dark);
  text-decoration: none;
}
a:hover, a:focus {
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

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

/* Header */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
  font-weight: 700;
  font-size: 1.1rem;
}
.logo:hover, .logo:focus {
  text-decoration: none;
  color: var(--color-primary-dark);
}
.logo-icon {
  flex-shrink: 0;
}
.main-nav ul {
  display: flex;
  list-style: none;
  gap: 24px;
}
.main-nav a {
  color: var(--color-text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.main-nav a:hover, .main-nav a:focus {
  color: var(--color-primary-dark);
  border-bottom-color: var(--color-primary);
  text-decoration: none;
}

/* Hero */
.hero-section {
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-bg) 100%);
  padding: 60px 0 48px;
  border-bottom: 1px solid var(--color-border);
}
.hero-content {
  max-width: 680px;
}
.hero-content h1 {
  font-size: 2.4rem;
  line-height: 1.2;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 16px;
}
.hero-subtitle {
  font-size: 1.15rem;
  color: var(--color-text-secondary);
  margin-bottom: 32px;
  line-height: 1.7;
}
.hero-stats {
  display: flex;
  gap: 32px;
}
.stat {
  display: flex;
  flex-direction: column;
}
.stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  line-height: 1.2;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Optimizer Section */
.optimizer-section {
  padding: 48px 0;
}
.optimizer-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
  align-items: start;
}
.optimizer-controls h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.section-desc {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  margin-bottom: 24px;
  line-height: 1.6;
}
.pet-selector {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}
.pet-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 24px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  transition: all 0.15s;
  flex: 1;
}
.pet-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}
.pet-btn.active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  box-shadow: var(--shadow-sm);
}
.pet-btn svg {
  color: inherit;
}
.action-buttons {
  display: flex;
  gap: 10px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: 2px solid transparent;
}
.btn-outline {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text-secondary);
}
.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

/* Results Panel */
.optimizer-results {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-primary-light);
}
.results-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}
.results-date {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Category Cards */
.category-card {
  border-bottom: 1px solid var(--color-border-light);
}
.category-card:last-child {
  border-bottom: none;
}
.category-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px 24px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  text-align: left;
  transition: background 0.15s;
}
.category-toggle:hover {
  background: var(--color-border-light);
}
.category-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}
.category-title {
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
}
.category-count {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  background: var(--color-border-light);
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 500;
}
.chevron {
  transition: transform 0.2s;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.category-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}
.category-panel {
  padding: 0 24px 20px;
}
.category-panel[hidden] {
  display: none;
}
.category-note {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--color-secondary-light);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-secondary);
}
.warning-note {
  background: var(--color-danger-light);
  border-left-color: var(--color-danger);
}

/* Filler Table */
.filler-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.filler-table th {
  text-align: left;
  padding: 8px 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  border-bottom: 2px solid var(--color-border);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.filler-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text);
}
.filler-table tr:last-child td {
  border-bottom: none;
}
.filler-table tr:hover td {
  background: var(--color-border-light);
}

/* Tip List */
.tip-list {
  list-style: none;
  padding: 0;
}
.tip-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 0.93rem;
  line-height: 1.6;
  color: var(--color-text);
}
.tip-list li:last-child {
  border-bottom: none;
}
.tip-list li strong {
  color: var(--color-text);
}

/* Warning List */
.warning-list {
  list-style: none;
  padding: 0;
}
.warning-list li {
  padding: 8px 0;
  font-size: 0.93rem;
  padding-left: 24px;
  position: relative;
}
.warning-list li::before {
  content: "⚠";
  position: absolute;
  left: 0;
  color: var(--color-warning);
}

/* Toxic Grid */
.toxic-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.toxic-item {
  background: var(--color-danger-light);
  color: var(--color-danger);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid rgba(220, 38, 38, 0.15);
}

/* Guide Section */
.guide-section {
  padding: 48px 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}
.guide-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 32px;
  text-align: center;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.guide-card {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: 24px;
  border: 1px solid var(--color-border);
}
.guide-step {
  width: 36px;
  height: 36px;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 14px;
}
.guide-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.guide-card p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* Scenario Section */
.scenario-section {
  padding: 48px 0;
}
.scenario-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 32px;
  text-align: center;
}
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.scenario-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 24px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.scenario-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--color-primary-dark);
}
.scenario-card p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 10px;
}
.scenario-card p:last-child {
  margin-bottom: 0;
}

/* FAQ Section */
.faq-section {
  padding: 48px 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}
.faq-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 32px;
  text-align: center;
}
.faq-list {
  max-width: 720px;
  margin: 0 auto;
}
.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
}
.faq-item summary {
  padding: 14px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: "+";
  font-size: 1.3rem;
  color: var(--color-text-muted);
  font-weight: 400;
}
.faq-item[open] summary::after {
  content: "−";
}
.faq-item summary:hover {
  background: var(--color-border-light);
}
.faq-item p {
  padding: 0 20px 16px;
  font-size: 0.93rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* Assumptions Section */
.assumptions-section {
  padding: 48px 0;
}
.assumptions-box {
  background: var(--color-warning-light);
  border: 1px solid rgba(217, 119, 6, 0.2);
  border-radius: var(--radius-md);
  padding: 28px 32px;
}
.assumptions-box h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--color-warning);
}
.assumptions-box p {
  font-size: 0.93rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 10px;
}
.assumptions-box p:last-of-type {
  margin-bottom: 0;
}
.last-updated {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(217, 119, 6, 0.15);
}

/* Footer */
.site-footer {
  background: var(--color-text);
  color: #A8A29E;
  padding: 40px 0 24px;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.footer-logo {
  font-weight: 700;
  color: white;
  font-size: 1rem;
}
.footer-brand p {
  font-size: 0.88rem;
}
.footer-links {
  display: flex;
  gap: 20px;
}
.footer-links a {
  color: #D6D3D1;
  font-size: 0.88rem;
  font-weight: 500;
}
.footer-links a:hover {
  color: white;
  text-decoration: underline;
}
.footer-copy {
  font-size: 0.82rem;
  color: #78716C;
}

/* Print Styles */
@media print {
  .site-header, .site-footer, .hero-section, .guide-section, .assumptions-section, .action-buttons {
    display: none;
  }
  .optimizer-section {
    padding: 0;
  }
  .optimizer-layout {
    display: block;
  }
  .optimizer-controls {
    display: none;
  }
  .category-panel {
    display: block !important;
    padding: 12px 0 !important;
  }
  .category-toggle {
    padding: 8px 0;
  }
  .chevron {
    display: none;
  }
  .optimizer-results {
    border: none;
    box-shadow: none;
  }
  .results-header {
    background: none;
    border-bottom: 2px solid #333;
    padding: 0 0 8px;
  }
  body {
    background: white;
    color: black;
  }
}

/* Responsive */
@media (max-width: 900px) {
  .optimizer-layout {
    grid-template-columns: 1fr;
  }
  .optimizer-controls {
    order: 1;
  }
  .optimizer-results {
    order: 2;
  }
  .guide-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .scenario-grid {
    grid-template-columns: 1fr;
  }
  .hero-content h1 {
    font-size: 1.8rem;
  }
  .hero-stats {
    gap: 24px;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 16px;
  }
  .hero-section {
    padding: 40px 0 32px;
  }
  .hero-content h1 {
    font-size: 1.5rem;
  }
  .hero-subtitle {
    font-size: 1rem;
  }
  .hero-stats {
    flex-direction: column;
    gap: 12px;
  }
  .pet-selector {
    flex-direction: row;
  }
  .pet-btn {
    padding: 12px 16px;
  }
  .guide-grid {
    grid-template-columns: 1fr;
  }
  .filler-table {
    font-size: 0.82rem;
  }
  .filler-table th, .filler-table td {
    padding: 8px 6px;
  }
  .main-nav ul {
    gap: 16px;
  }
  .main-nav a {
    font-size: 0.88rem;
  }
  .footer-links {
    flex-direction: column;
    gap: 10px;
  }
}

/* Focus styles for accessibility */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

button:focus-visible, a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}



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