:root {
  --bg: #f9f7f4;
  --surface: #ffffff;
  --text: #2c2416;
  --text-secondary: #5e5544;
  --accent: #7c6a4d;
  --accent-hover: #5e4e35;
  --border: #d9d0c1;
  --border-light: #e8e2d5;
  --success: #4a7c59;
  --danger: #b85c4a;
  --shadow-sm: 0 1px 3px rgba(44, 36, 22, 0.06);
  --shadow-md: 0 4px 12px rgba(44, 36, 22, 0.08);
  --radius: 8px;
  --radius-sm: 4px;
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
  --max-width: 1100px;
  --gap: 1.5rem;
}

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

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--text);
  color: var(--bg);
  padding: 0.5rem 1rem;
  z-index: 100;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.skip-link:focus {
  top: 0.5rem;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.2rem;
}
.logo-icon {
  color: var(--accent);
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}
.nav-list a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s, color 0.15s;
}
.nav-list a:hover,
.nav-list a:focus {
  color: var(--text);
  border-bottom-color: var(--accent);
}

main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  width: 100%;
}

.intro-section {
  margin-bottom: 2.5rem;
}
.intro-text h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}
.subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 650px;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.add-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.field input,
.field select {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 106, 77, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover,
.btn-primary:focus {
  background: var(--accent-hover);
}
.btn-outline {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover,
.btn-outline:focus {
  background: var(--bg);
  border-color: var(--accent);
}
.btn-danger {
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover {
  background: #fdf2f0;
}
.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

.preset-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.preset-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 0.25rem;
}

.table-section {
  margin-bottom: 2.5rem;
}
.table-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.table-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 750px;
}
.comparison-table th {
  background: var(--bg);
  padding: 0.75rem 0.85rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.comparison-table td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.comparison-table tbody tr:hover {
  background: #fdfbf7;
}
.comparison-table .empty-row td {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem;
  font-style: italic;
}
.comparison-table .best-row td {
  background: #f2f7f0;
}
.comparison-table .best-row td:first-child::before {
  content: "★ ";
  color: var(--success);
  font-weight: 700;
}
.comparison-table .inline-input {
  width: 90px;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: var(--bg);
}
.comparison-table .btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: color 0.15s, background 0.15s;
}
.comparison-table .btn-icon:hover {
  color: var(--danger);
  background: #fdf2f0;
}

.chart-section {
  margin-bottom: 2.5rem;
}
.chart-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.chart-container canvas {
  width: 100%;
  height: auto;
  max-height: 400px;
}
.chart-note {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
}

.saved-section {
  margin-bottom: 2.5rem;
}
.saved-controls {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.saved-controls .field {
  min-width: 150px;
}

.support-section {
  margin-bottom: 2.5rem;
}
.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.support-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.support-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.support-card p,
.support-card li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
}
.support-card ul {
  padding-left: 1.2rem;
}
.support-card li {
  margin-bottom: 0.35rem;
}

.assumptions-section {
  margin-bottom: 2rem;
}
.assumptions-text {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.site-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.site-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 700px) {
  .intro-text h1 {
    font-size: 1.6rem;
  }
  .subtitle {
    font-size: 1rem;
  }
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .saved-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .table-actions {
    width: 100%;
  }
  .table-header-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 450px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .preset-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}



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