:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #1f1d1a;
  --muted: #6b6560;
  --line: #e6e0d6;
  --accent: #c25e3a;
  --accent-ink: #ffffff;
  --seed: #8a8a5c;
  --growing: #4f7a5a;
  --finished: #3f5e8a;
  --dormant: #a0835a;
  --abandoned: #9a4a4a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(31,29,26,0.06), 0 6px 24px rgba(31,29,26,0.06);
  --max: 1100px;
  --pad: clamp(16px, 3vw, 32px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
}

.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

a { color: inherit; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-row {
  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;
  text-decoration: none;
  font-weight: 600;
  color: var(--ink);
}
.brand-mark {
  display: inline-flex;
  color: var(--accent);
}
.brand-text { font-size: 1.05rem; }

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

.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  padding: 40px 0 24px;
  align-items: end;
}
.hero h1 {
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  line-height: 1.1;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.lead {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 18px;
  max-width: 56ch;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(0.95); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-danger { background: transparent; border-color: var(--abandoned); color: var(--abandoned); }
.btn-danger:hover { background: #f8ecec; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
}
.stat-num {
  display: block;
  font-size: 1.6rem;
  font-weight: 600;
}
.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 2px;
}

section { padding: 24px 0; }
section h2 { font-size: 1.4rem; margin: 0 0 12px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.workspace .grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 20px;
}

.entry-form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-label { font-size: 0.9rem; font-weight: 500; }
.field-hint { font-size: 0.8rem; color: var(--muted); }

input[type="text"], input[type="search"], select, textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.status-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.status-chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.status-chip[aria-checked="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.form-status { font-size: 0.9rem; color: var(--muted); min-height: 1em; margin: 0; }

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.filter { min-width: 140px; }
.list-meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 10px; }

.entry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}
.entry-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  gap: 6px;
  background: var(--surface);
}
.entry-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(194,94,58,0.15);
}
.entry-title {
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}
.entry-title .title-text { font-size: 1rem; }
.entry-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--muted);
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
.badge.seed { border-color: var(--seed); color: var(--seed); }
.badge.growing { border-color: var(--growing); color: var(--growing); }
.badge.finished { border-color: var(--finished); color: var(--finished); }
.badge.dormant { border-color: var(--dormant); color: var(--dormant); }
.badge.abandoned { border-color: var(--abandoned); color: var(--abandoned); }

.entry-notes {
  font-size: 0.95rem;
  color: var(--ink);
  white-space: pre-wrap;
}
.entry-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.entry-actions button {
  font-size: 0.85rem;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  color: var(--ink);
}
.entry-actions button:hover { border-color: var(--ink); }
.entry-actions .danger { color: var(--abandoned); border-color: var(--abandoned); }
.entry-actions .danger:hover { background: #f8ecec; }

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: var(--muted);
}
.empty-state p { margin: 0 0 6px; }
.empty-state .hint { font-size: 0.9rem; }

.list-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.status-list, .bullets {
  padding-left: 18px;
  display: grid;
  gap: 6px;
}
.steps {
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

.example-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.example-table th, .example-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.example-table th { color: var(--muted); font-weight: 500; }

.review-controls {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.review-output {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
}
.review-output h3 { margin-top: 0; }
.review-output .muted { color: var(--muted); }

.site-footer {
  margin-top: 40px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
  padding-bottom: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-row nav { display: flex; gap: 14px; }
.footer-row a { color: var(--muted); text-decoration: none; }
.footer-row a:hover { color: var(--ink); }

.muted { color: var(--muted); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; align-items: start; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); }
  .workspace .grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .hero-stats { grid-template-columns: 1fr; }
  .site-nav { gap: 12px; }
  .filters { flex-direction: column; }
  .filter { min-width: 100%; }
}

@media print {
  body { background: #fff; }
  .site-header, .site-footer, .entry-panel, .filters, .list-actions, .hero-actions, .review-controls { display: none; }
  .panel { box-shadow: none; border: none; padding: 0; }
  .entry-item { break-inside: avoid; }
}


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