:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --surface-alt: #f3f1ea;
  --ink: #1f241c;
  --ink-soft: #4a5044;
  --ink-muted: #7a8074;
  --line: #e2dfd4;
  --accent: #2f6b4a;
  --accent-soft: #e4efe6;
  --accent-dark: #1f4a33;
  --warn: #b35a2b;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(31,36,28,0.05), 0 6px 18px rgba(31,36,28,0.06);
  --max: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

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

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
}
.brand svg { color: var(--accent); }
.site-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 6px 2px;
}
.site-nav a:hover { color: var(--accent); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 56px 0 32px;
}
.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
  margin: 0 0 14px;
}
.hero h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
  line-height: 1.12;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
.lede { font-size: 1.1rem; color: var(--ink-soft); margin: 0 0 20px; max-width: 560px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.meta-note { font-size: 0.85rem; color: var(--ink-muted); margin: 0; }

.hero-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card-mock { display: flex; flex-direction: column; gap: 10px; }
.mock-line {
  height: 10px;
  background: var(--surface-alt);
  border-radius: 4px;
}
.mock-line.w70 { width: 70%; }
.mock-line.w90 { width: 90%; }
.mock-line.w50 { width: 50%; }
.mock-line.w80 { width: 80%; }
.mock-line.w60 { width: 60%; }
.mock-block { height: 80px; background: var(--accent-soft); border-radius: 6px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-alt); }
.btn-small { padding: 6px 12px; font-size: 0.85rem; }

/* Sections */
section { padding: 48px 0; }
.section-head { max-width: 720px; margin-bottom: 24px; }
.section-head h2 { font-size: 1.6rem; margin: 0 0 8px; }
.section-head p { color: var(--ink-soft); margin: 0; }

/* Worksheet */
.worksheet-section { padding-top: 24px; }
.worksheet-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  align-items: start;
}
.form-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.field-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin: 0 0 18px;
}
.field-group legend {
  font-weight: 700;
  padding: 0 6px;
  color: var(--ink);
}
.field-group .hint { font-size: 0.88rem; color: var(--ink-muted); margin: 0 0 12px; }
.row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.row label { font-size: 0.88rem; font-weight: 600; color: var(--ink-soft); }
.row input, .row select, .row textarea {
  font: inherit;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
}
.row input:focus, .row select:focus, .row textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.repeat-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.repeat-item {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.repeat-item .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.repeat-item .fields.full { grid-template-columns: 1fr; }
.repeat-item input {
  font: inherit;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
}
.repeat-item .remove-btn {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 8px;
}
.repeat-item .remove-btn:hover { color: var(--warn); }

.form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

/* Brief panel */
.brief-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 80px;
}
.brief-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.brief-head h2 { font-size: 1.15rem; margin: 0; }
.brief-actions { display: flex; gap: 6px; }
.brief-output {
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  background: var(--surface-alt);
  border-radius: 6px;
  padding: 14px;
  min-height: 200px;
  font-family: var(--mono);
  color: var(--ink);
}
.brief-output .empty-state { color: var(--ink-muted); font-family: var(--font); }

/* Example */
.example-section { background: var(--surface-alt); }
.example-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.example-card h3 { margin-top: 0; }
.example-card ul { padding-left: 20px; }

/* Tips */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.tip-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.tip-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.tip-card p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

/* FAQ */
.faq-list { margin: 0; }
.faq-list dt {
  font-weight: 700;
  margin-top: 18px;
  color: var(--ink);
}
.faq-list dd {
  margin: 4px 0 0;
  color: var(--ink-soft);
}

/* Mistakes */
.mistakes-section { background: var(--surface-alt); }
.mistakes-list { padding-left: 20px; }
.mistakes-list li { margin-bottom: 10px; color: var(--ink-soft); }
.mistakes-list li strong { color: var(--ink); }

/* Footer */
.site-footer {
  background: var(--ink);
  color: #e8ebe3;
  padding: 40px 0 24px;
  margin-top: 40px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.3fr 1fr auto;
  gap: 24px;
  align-items: start;
}
.footer-inner p { margin: 6px 0 0; color: #c5cbbf; font-size: 0.9rem; }
.footer-nav { display: flex; flex-direction: column; gap: 6px; }
.footer-nav a { color: #e8ebe3; text-decoration: none; font-size: 0.9rem; }
.footer-nav a:hover { color: #fff; }
.fine-print { font-size: 0.8rem; color: #9aa396; grid-column: 1 / -1; margin-top: 10px; }

/* Responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 36px 0 16px; }
  .worksheet-grid { grid-template-columns: 1fr; }
  .brief-panel { position: static; }
  .footer-inner { grid-template-columns: 1fr; }
  .site-nav { gap: 10px; }
  .site-nav a { font-size: 0.88rem; }
}
@media (max-width: 520px) {
  .container { padding: 0 16px; }
  .hero h1 { font-size: 1.7rem; }
  .form-panel { padding: 16px; }
  .repeat-item .fields { grid-template-columns: 1fr; }
}

/* Print */
@media print {
  .site-header, .site-footer, .form-panel, .hero-actions, .meta-note, .brief-actions, .form-actions { display: none !important; }
  .brief-panel { box-shadow: none; border: none; position: static; }
  .brief-output { background: #fff; border: 1px solid #ccc; }
  body { background: #fff; color: #000; }
}

/* Focus visible */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }



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