:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --surface-alt: #f3f1ed;
  --text: #2c2a26;
  --text-muted: #6b6660;
  --text-light: #9a9590;
  --accent: #5b7a5e;
  --accent-light: #e8f0e8;
  --accent-dark: #3d5440;
  --border: #e0ddd8;
  --border-dark: #c8c4be;
  --danger: #c45b5b;
  --warning: #c4a35b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
  --max-width: 1100px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  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;
  text-decoration: none;
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 1.1rem;
}

.logo svg { color: var(--accent); }

.main-nav {
  display: flex;
  gap: 24px;
}

.main-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
}

.main-nav a:hover { color: var(--accent); }

/* Hero */
.hero {
  padding: 64px 0 48px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 16px;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 32px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s;
  font-family: var(--font);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn-secondary {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--accent);
}

.btn-secondary:hover {
  background: var(--accent-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--surface-alt);
  color: var(--text);
}

/* Sections */
section {
  padding: 48px 0;
}

.section-intro {
  margin-bottom: 32px;
}

.section-intro h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.section-intro p {
  color: var(--text-muted);
  max-width: 640px;
}

/* Presets */
.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.preset-btn {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
}

.preset-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.preset-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* Worksheet */
.worksheet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.person-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.person-col h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-light);
}

.person-col label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  margin-top: 16px;
}

.person-col input,
.person-col textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  transition: border-color 0.15s;
}

.person-col input:focus,
.person-col textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* Comparison */
.comparison-section {
  background: var(--surface-alt);
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.comp-col h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.comp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
}

.comp-card h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  margin-bottom: 6px;
}

.comp-card p {
  font-size: 0.95rem;
  color: var(--text);
}

.comp-empty {
  color: var(--text-light);
  font-style: italic;
}

.clash-panel,
.compromises-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.clash-panel h4,
.compromises-panel h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.clash-panel ul,
.compromises-panel ol {
  padding-left: 20px;
}

.clash-panel li,
.compromises-panel li {
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.clash-panel li { color: var(--danger); }
.compromises-panel li { color: var(--accent-dark); }

.empty-state {
  color: var(--text-light);
  font-style: italic;
  list-style: none;
  padding-left: 0;
}

/* Examples */
.examples-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.example-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.example-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.example-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Summary */
.summary-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.summary-output {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--accent-light);
}

.summary-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

.summary-header time {
  font-size: 0.85rem;
  color: var(--text-light);
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 24px;
}

.summary-grid h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.summary-grid p {
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.summary-compromises {
  margin-bottom: 24px;
  padding: 16px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
}

.summary-compromises h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.summary-signoff {
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.sig-line {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.sig-line span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 160px;
}

.sig-line input {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-bottom: 1px solid var(--border-dark);
  font-size: 0.95rem;
  font-family: var(--font);
  background: transparent;
}

.sig-line input:focus {
  outline: none;
  border-color: var(--accent);
}

/* FAQ */
.faq-section {
  background: var(--surface-alt);
}

details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
}

summary {
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  list-style: none;
}

summary::-webkit-details-marker { display: none; }

summary::after {
  content: '+';
  float: right;
  font-size: 1.2rem;
  color: var(--accent);
}

details[open] summary::after { content: '−'; }

details p {
  padding: 0 20px 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
}

.site-footer p {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 4px;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

.site-footer a:hover { text-decoration: underline; }

/* Print */
@media print {
  .site-header, .site-footer, .presets, .summary-actions, .faq-section, .examples-section, .comparison-section, .hero { display: none; }
  .summary-output { border: none; padding: 0; }
  body { background: #fff; }
}

/* Responsive */
@media (max-width: 768px) {
  .worksheet-grid, .comparison-grid, .summary-grid { grid-template-columns: 1fr; }
  .examples-grid { grid-template-columns: 1fr; }
  .main-nav { gap: 12px; }
  .main-nav a { font-size: 0.8rem; }
  .hero { padding: 40px 0 32px; }
  section { padding: 32px 0; }
  .summary-header { flex-direction: column; gap: 4px; }
  .sig-line { flex-direction: column; align-items: flex-start; gap: 4px; }
  .sig-line input { width: 100%; }
}

@media (max-width: 480px) {
  .main-nav { display: none; }
  .presets { gap: 6px; }
  .preset-btn { padding: 6px 12px; font-size: 0.8rem; }
  .summary-actions { flex-direction: column; }
  .summary-actions .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;
}
