:root {
  --green-900: #0d3b2e;
  --green-700: #1a6b4a;
  --green-500: #2a9d6a;
  --green-100: #e6f4ee;
  --yellow-500: #f0b429;
  --yellow-100: #fef7e0;
  --red-500: #c0392b;
  --red-100: #fdecea;
  --gray-900: #1a1a2e;
  --gray-700: #3d3d56;
  --gray-500: #6b6b80;
  --gray-300: #c4c4d0;
  --gray-100: #f4f4f8;
  --white: #ffffff;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width: 1200px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--gray-900);
  background: var(--white);
  line-height: 1.6;
  font-size: 16px;
}

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

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

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-300);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--green-900);
}
.logo:hover { text-decoration: none; }
.site-nav {
  display: flex;
  gap: 20px;
}
.site-nav a {
  font-size: 0.9rem;
  color: var(--gray-700);
  font-weight: 500;
}
.site-nav a:hover { color: var(--green-700); }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-700) 100%);
  color: var(--white);
  padding: 60px 0;
  text-align: center;
}
.hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.2;
}
.hero-sub {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 560px;
  margin: 0 auto 24px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s;
  text-align: center;
}
.btn-primary {
  background: var(--yellow-500);
  color: var(--gray-900);
  border-color: var(--yellow-500);
}
.btn-primary:hover { background: #d9a225; text-decoration: none; }
.btn-secondary {
  background: var(--white);
  color: var(--green-700);
  border-color: var(--green-700);
}
.btn-secondary:hover { background: var(--green-100); text-decoration: none; }
.btn-small {
  padding: 6px 14px;
  font-size: 0.85rem;
  background: var(--gray-100);
  color: var(--gray-700);
  border-color: var(--gray-300);
}
.btn-small:hover { background: var(--gray-300); text-decoration: none; }
.btn-preset {
  padding: 4px 10px;
  font-size: 0.8rem;
  background: var(--yellow-100);
  color: var(--gray-700);
  border-color: var(--yellow-500);
}
.btn-preset:hover { background: var(--yellow-500); text-decoration: none; }

/* Worksheet Section */
.worksheet-section {
  padding: 48px 0;
}
.worksheet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}
.worksheet-inputs h2,
.worksheet-preview h2 {
  font-size: 1.4rem;
  margin-bottom: 4px;
}
.section-note {
  color: var(--gray-500);
  font-size: 0.9rem;
  margin-bottom: 24px;
}
.worksheet-inputs h3 {
  font-size: 1.05rem;
  margin: 28px 0 4px;
  color: var(--green-900);
}
.field-hint {
  color: var(--gray-500);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

/* Form elements */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
}
.form-group input,
.form-group textarea,
.line-item-row input,
.line-item-row textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font);
  background: var(--white);
}
.form-group input:focus,
.form-group textarea:focus,
.line-item-row input:focus,
.line-item-row textarea:focus {
  outline: 2px solid var(--green-500);
  border-color: var(--green-500);
}

/* Line items */
.line-item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.line-item-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 8px;
  align-items: start;
}
.line-item-row .row-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}
.line-item-row .btn-remove {
  background: none;
  border: none;
  color: var(--red-500);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  line-height: 1;
}
.line-item-row .btn-remove:hover { color: #a03025; }

/* Wish list rows */
.wish-row {
  grid-template-columns: 1fr 100px 80px 1fr auto;
}
.wish-row .priority-slider {
  width: 100%;
  accent-color: var(--green-500);
}
.wish-row .priority-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-700);
  text-align: center;
}

.preset-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  align-items: center;
}
.preset-label {
  font-size: 0.8rem;
  color: var(--gray-500);
  font-weight: 600;
}

/* Action bar */
.action-bar {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  flex-wrap: wrap;
}

/* Preview */
.worksheet-preview {
  position: sticky;
  top: 72px;
}
.preview-inner {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.preview-header {
  border-bottom: 2px solid var(--green-700);
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.preview-header h2 {
  font-size: 1.2rem;
  color: var(--green-900);
}
.preview-meta {
  font-size: 0.85rem;
  color: var(--gray-500);
}
.preview-summary {
  margin-bottom: 16px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.9rem;
}
.summary-row strong { font-weight: 700; }
.summary-row.highlight {
  background: var(--green-100);
  margin: 0 -12px;
  padding: 8px 12px;
  border-radius: var(--radius);
  border-bottom: none;
  font-weight: 600;
}
.summary-row.highlight strong { color: var(--green-700); }
#shortfallRow.has-shortfall strong { color: var(--red-500); }
#shortfallRow.has-surplus strong { color: var(--green-700); }

.preview-section {
  margin-bottom: 16px;
}
.preview-section h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.priority-list, .cut-list {
  padding-left: 20px;
  font-size: 0.9rem;
}
.priority-list li, .cut-list li {
  margin-bottom: 4px;
}
.empty-state {
  color: var(--gray-500);
  font-style: italic;
  list-style: none;
}
.preview-notes {
  font-size: 0.9rem;
  color: var(--gray-700);
  white-space: pre-wrap;
}
.preview-footer {
  border-top: 1px solid var(--gray-300);
  padding-top: 12px;
  margin-top: 16px;
  font-size: 0.75rem;
  color: var(--gray-500);
}
.preview-footer a { color: var(--gray-500); }

/* Examples */
.examples-section {
  padding: 48px 0;
  background: var(--gray-100);
}
.examples-section h2 {
  font-size: 1.4rem;
  margin-bottom: 4px;
}
.example-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}
.example-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.example-card h3 {
  font-size: 1.05rem;
  color: var(--green-900);
  margin-bottom: 12px;
}
.example-card dl {
  font-size: 0.9rem;
}
.example-card dt {
  font-weight: 700;
  margin-top: 8px;
  color: var(--gray-700);
}
.example-card dd {
  color: var(--gray-500);
  margin-left: 0;
}

/* Tips */
.tips-section {
  padding: 48px 0;
}
.tips-section h2 {
  font-size: 1.4rem;
  margin-bottom: 4px;
}
.tips-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}
.tip-card {
  background: var(--green-100);
  border-radius: var(--radius);
  padding: 20px;
}
.tip-card h3 {
  font-size: 0.95rem;
  color: var(--green-900);
  margin-bottom: 6px;
}
.tip-card p {
  font-size: 0.88rem;
  color: var(--gray-700);
}

/* FAQ */
.faq-section {
  padding: 48px 0;
  background: var(--gray-100);
}
.faq-section h2 {
  font-size: 1.4rem;
  margin-bottom: 20px;
}
details {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}
details summary {
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
}
details p {
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--gray-700);
}

/* Mistakes */
.mistakes-section {
  padding: 48px 0;
}
.mistakes-section h2 {
  font-size: 1.4rem;
  margin-bottom: 20px;
}
.mistakes-list {
  list-style: none;
  padding: 0;
}
.mistakes-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.9rem;
  color: var(--gray-700);
}
.mistakes-list li:last-child { border-bottom: none; }
.mistakes-list strong { color: var(--red-500); }

/* Footer */
.site-footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: 40px 0 20px;
  font-size: 0.85rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 24px;
}
.footer-brand {
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}
.footer-desc { max-width: 320px; }
.footer-heading {
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}
.footer-links {
  list-style: none;
}
.footer-links li { margin-bottom: 4px; }
.footer-links a { color: var(--gray-300); }
.footer-legal {
  border-top: 1px solid var(--gray-700);
  padding-top: 16px;
  text-align: center;
  font-size: 0.8rem;
}
.footer-legal a { color: var(--gray-300); }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--green-900);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* Print */
@media print {
  .site-header, .site-footer, .worksheet-inputs, .action-bar, .preset-bar, .btn, .toast { display: none !important; }
  .worksheet-section { padding: 0; }
  .worksheet-grid { display: block; }
  .worksheet-preview { position: static; }
  .preview-inner { box-shadow: none; border: none; padding: 0; }
  body { font-size: 12px; }
  .hero { display: none; }
}

/* Responsive */
@media (max-width: 900px) {
  .worksheet-grid { grid-template-columns: 1fr; }
  .worksheet-preview { position: static; }
  .example-grid { grid-template-columns: 1fr; }
  .tips-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hero h1 { font-size: 1.6rem; }
  .tips-grid { grid-template-columns: 1fr; }
  .wish-row { grid-template-columns: 1fr 80px; }
  .site-nav { gap: 12px; }
  .site-nav a { font-size: 0.8rem; }
  .action-bar { flex-direction: column; }
  .action-bar .btn { width: 100%; }
}



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