:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #1c1b18;
  --muted: #6b6860;
  --line: #d9d4c7;
  --accent: #2f5d3a;
  --accent-ink: #ffffff;
  --warn: #b4622b;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.05);
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.brand-mark {
  color: var(--accent);
  display: inline-flex;
}
.brand-name { letter-spacing: -0.01em; }

.site-nav {
  display: flex;
  gap: 18px;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
.site-nav a:hover { color: var(--ink); }

.hero {
  padding: 48px 0 24px;
  max-width: 760px;
}
.hero h1 {
  font-size: 36px;
  line-height: 1.15;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.hero .lead {
  font-size: 18px;
  color: var(--muted);
  margin: 0 0 16px;
}
.hero-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.badge {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
}

.builder-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
  margin-top: 24px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.panel h2 {
  font-size: 18px;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.panel h3 {
  font-size: 15px;
  margin: 16px 0 8px;
}
.hint {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 12px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 500;
}
input[type="text"],
input[type="date"],
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 15px;
  background: var(--bg);
  color: var(--ink);
}
textarea { resize: vertical; }
input:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  background: var(--surface);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.source-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.source-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--bg);
  position: relative;
}
.source-item .source-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.source-item .source-head h4 {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}
.source-item .remove-btn {
  background: none;
  border: none;
  color: var(--warn);
  cursor: pointer;
  font-size: 13px;
}
.source-item .row {
  grid-template-columns: 1fr 1fr;
}

.preset-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  align-items: center;
}
.preset-label {
  font-size: 13px;
  color: var(--muted);
}
.chip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.trail-output, .missing-output {
  list-style: none;
  padding: 0;
  margin: 0;
}
.trail-output li {
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: var(--bg);
  border-radius: 0 8px 8px 0;
  margin-bottom: 8px;
  font-size: 14px;
}
.missing-output li {
  padding: 10px 12px;
  border-left: 3px solid var(--warn);
  background: #fdf6ef;
  border-radius: 0 8px 8px 0;
  margin-bottom: 8px;
  font-size: 14px;
}

.neutral-panel textarea {
  font-family: var(--mono);
  font-size: 14px;
  background: #f9f8f4;
}

.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.btn {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
}
.btn:hover { filter: brightness(0.95); }
.btn.ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.full { width: 100%; }

.history-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.history-list li {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  cursor: pointer;
  background: var(--bg);
}
.history-list li:hover { border-color: var(--accent); }
.history-list .history-claim {
  font-weight: 500;
  display: block;
  margin-bottom: 2px;
}
.history-list .history-date {
  color: var(--muted);
  font-size: 12px;
}

.notes-list {
  padding-left: 18px;
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}
.notes-list li { margin-bottom: 6px; }

.examples {
  margin-top: 48px;
}
.examples h2 {
  font-size: 24px;
  margin: 0 0 8px;
}
.example-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}
.example {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.example h3 {
  font-size: 16px;
  margin: 0 0 8px;
}
.example-claim {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 10px;
}
.example-chain {
  padding-left: 18px;
  margin: 0 0 10px;
  font-size: 14px;
}
.example-note {
  font-size: 13px;
  color: var(--accent);
  margin: 0;
  font-weight: 500;
}

.notes-panel {
  margin-top: 48px;
  max-width: 760px;
}
.notes-panel h2 {
  font-size: 24px;
  margin: 0 0 12px;
}
.notes-panel h3 {
  font-size: 17px;
  margin: 24px 0 8px;
}
.notes-panel p {
  font-size: 15px;
  color: var(--ink);
  margin: 0 0 12px;
}

.site-footer {
  margin-top: 64px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 32px 0 16px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 24px;
}
.footer-grid p, .footer-grid ul {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}
.footer-grid ul {
  list-style: none;
  padding: 0;
}
.footer-grid a {
  color: var(--muted);
  text-decoration: none;
}
.footer-grid a:hover { color: var(--ink); }
.footer-bottom {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .builder-grid { grid-template-columns: 1fr; }
  .example-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 28px; }
  .row, .result-grid { grid-template-columns: 1fr; }
  .site-nav { gap: 12px; }
}

@media print {
  .site-header, .site-footer, .preset-row, .action-row, .builder-side, .hero-meta { display: none; }
  .panel { box-shadow: none; border: 1px solid #ccc; }
  body { background: #fff; }
}



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