:root {
  --ink: #1b1914;
  --muted: #5e584e;
  --paper: #f3efe6;
  --card: #fffaf3;
  --line: #ddd4c6;
  --rail: #1a2420;
  --rail-text: #efe7da;
  --copper: #a24e22;
  --moss: #2d5c4e;
  --good: #1f6b45;
  --warn: #8a5a12;
  color-scheme: light;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--copper); }

.gate {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}
.gate-copy, .gate-form { padding: 64px 56px; }
.gate-copy { background: var(--rail); color: var(--rail-text); display: flex; flex-direction: column; justify-content: flex-end; }
.gate-copy h1 { font-family: "Iowan Old Style", Palatino, Georgia, serif; font-weight: 500; font-size: 64px; margin: 0 0 12px; letter-spacing: -0.03em; }
.gate-copy p { max-width: 460px; line-height: 1.5; color: #d9d0c3; }
.eyebrow { letter-spacing: 0.16em; text-transform: uppercase; font-size: 12px; color: #e0b08a; }
.gate-form { display: flex; align-items: center; }
.gate-form form { width: min(420px, 100%); display: grid; gap: 12px; }
.gate-form h2 { font-family: "Iowan Old Style", Palatino, Georgia, serif; font-weight: 500; font-size: 36px; margin: 0; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input, textarea, select {
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  padding: 10px 12px;
}
textarea { min-height: 88px; resize: vertical; }
.primary, .ghost, .tiny {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 10px 16px;
}
.primary { background: var(--copper); color: white; }
.ghost, .tiny { background: transparent; border-color: var(--line); }
.tiny { padding: 6px 10px; font-size: 13px; }
.tiny.on { background: var(--rail); color: white; border-color: var(--rail); }
.error { color: #8d2c1b; min-height: 1.2em; }

.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.rail { background: var(--rail); color: var(--rail-text); padding: 22px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.brand { font-family: "Iowan Old Style", Palatino, Georgia, serif; font-size: 32px; padding: 4px 10px 16px; }
.nav-btn { text-align: left; background: transparent; color: inherit; border: 0; border-radius: 10px; padding: 10px 12px; display: flex; justify-content: space-between; }
.nav-btn.active { background: #2a3832; }
.nav-btn span { color: #b7aa9a; font-variant-numeric: tabular-nums; }
.rail-foot { margin-top: auto; padding: 12px; color: #b7aa9a; font-size: 13px; }
.main { padding: 28px 32px 64px; }
.top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 18px; }
.top h2 { font-family: "Iowan Old Style", Palatino, Georgia, serif; font-weight: 500; font-size: 40px; margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat, .card, .role, .column { background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.stat { padding: 16px; }
.stat b { display: block; font-size: 28px; margin-top: 6px; }
.split { display: grid; grid-template-columns: 340px 1fr; gap: 14px; min-height: 60vh; }
.filters { display: flex; gap: 8px; margin-bottom: 10px; }
.filters input, .filters select { flex: 1; }
.list { display: grid; gap: 8px; align-content: start; max-height: 72vh; overflow: auto; }
.role, .card { padding: 14px; }
.role { text-align: left; width: 100%; }
.role.selected { outline: 2px solid var(--copper); }
.meta { color: var(--muted); font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; }
.score { color: var(--moss); font-weight: 600; }
.reasons { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.reasons span, .chip { background: #efe4d4; border-radius: 999px; padding: 4px 8px; font-size: 12px; }
.prose { white-space: pre-wrap; line-height: 1.5; }
.board { display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr)); gap: 10px; overflow: auto; }
.column { padding: 10px; min-height: 240px; }
.column h3 { margin: 0 0 8px; font-size: 14px; }
.ticket { background: var(--paper); border-radius: 12px; padding: 10px; margin-bottom: 8px; cursor: grab; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }
.answers { display: grid; gap: 8px; }
.answer { display: grid; grid-template-columns: 180px 1fr auto; gap: 8px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.bars { display: grid; gap: 8px; }
.bar { height: 8px; background: #e7dfd2; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--moss); }
.note { color: var(--muted); line-height: 1.45; }
.brief { margin-top: 8px; }
.brief h3 { margin: 0 0 6px; font-size: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

@media (max-width: 900px) {
  .gate, .app, .split, .grid, .form-grid, .answer { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; }
  .app { display: block; }
  .gate-copy, .gate-form { padding: 32px 20px; }
  .gate-copy h1 { font-size: 46px; }
}
