:root {
  --bg: #f7f4ef;
  --surface: #fffdf9;
  --ink: #1c1917;
  --muted: #78716c;
  --line: #e7e0d6;
  --accent: #0f3d3e;
  --accent-soft: #d7ecea;
  --danger: #991b1b;
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  margin: 0;
  min-height: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

.hidden {
  display: none !important;
}

.login-wrap {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 12px;
  max-width: 420px;
  padding: 28px;
  width: 100%;
}

.login-card h1 {
  font-size: 28px;
  font-weight: 600;
  margin: 0;
}

.login-card label,
.field,
.col,
.notes,
.suggestions {
  display: grid;
  font-size: 12px;
  font-weight: 600;
  gap: 6px;
}

.login-card input,
.field select,
.field input,
.col textarea,
.notes textarea,
.suggestions textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 400;
  padding: 10px 12px;
  width: 100%;
}

.login-card button,
.primary,
.secondary,
.ghost {
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  padding: 10px 12px;
}

.login-card button,
.primary {
  background: var(--accent);
  border: 0;
  color: #fff;
}

.primary:disabled,
.secondary:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.secondary {
  background: var(--accent-soft);
  border: 1px solid #b7d6d3;
  color: var(--accent);
}

.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.hint,
.meta,
.when {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.when {
  font-size: 12px;
  margin-top: 4px;
}

.error {
  color: var(--danger);
  font-size: 14px;
  margin: 0;
}

.error.banner {
  background: #fee2e2;
  border-radius: 8px;
  padding: 10px 12px;
}

.page {
  margin: 0 auto;
  max-width: 1200px;
  padding: 24px 20px 64px;
}

.topnav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}

.topnav-brand {
  background: transparent;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-right: 8px;
  padding: 0;
  text-transform: uppercase;
}

.topnav-link {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  padding: 8px 12px;
  pointer-events: auto;
  position: relative;
  z-index: 1;
}

.topnav-link.on {
  background: var(--accent-soft);
  border-color: #b7d6d3;
  color: var(--accent);
  font-weight: 600;
}

.topnav-spacer {
  flex: 1;
  min-width: 8px;
  pointer-events: none;
}

.note-banner,
.wedge,
.surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 16px;
  padding: 16px;
}

.note-banner {
  background: #fff7ed;
  border-color: #f0b27a;
}

.lede {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
  margin: 8px 0 0;
}

.serve-grid,
.jump,
.flow-grid,
.persona-grid,
.two-col {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.serve-grid {
  grid-template-columns: 1fr 1fr 1fr;
}

.jump {
  grid-template-columns: repeat(4, 1fr);
}

.persona-grid,
.two-col,
.flow-grid {
  grid-template-columns: 1fr 1fr;
}

.surface.not {
  background: #fafafa;
}

ul {
  margin: 0;
  padding-left: 18px;
}

.jump-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: inherit;
  display: grid;
  gap: 4px;
  padding: 14px;
  text-decoration: none;
}

.jump-card:hover,
.persona.focus {
  border-color: var(--accent);
}

.persona {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
  padding: 20px;
  scroll-margin-top: 16px;
}

.persona-head {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}

.persona h2,
.flow-card h3,
.surface h3,
.persona h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
}

.persona h2 {
  font-size: 28px;
}

blockquote {
  font-size: 18px;
  font-style: italic;
  margin: 0;
}

.kill {
  background: #fee2e2;
  border-radius: 8px;
  padding: 10px 12px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  background: var(--accent-soft);
  border-radius: 999px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
}

.chip.link {
  display: inline-block;
  margin: 4px 0 8px;
  text-decoration: none;
}

.label {
  font-size: 12px;
  font-weight: 600;
  margin: 12px 0 6px;
}

.kv {
  display: grid;
  gap: 4px 12px;
  grid-template-columns: 120px 1fr;
  margin: 0 0 12px;
}

.kv dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.kv dd {
  margin: 0;
}

.flow-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}

.flow-steps {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.flow-step {
  display: grid;
  gap: 10px;
  grid-template-columns: 28px 1fr;
}

.flow-n {
  align-items: center;
  background: var(--accent);
  border-radius: 999px;
  color: #fff;
  display: grid;
  font-size: 12px;
  font-weight: 600;
  height: 28px;
  justify-items: center;
  width: 28px;
}

.flow-screen {
  font-weight: 600;
  margin: 0;
}

.flow-does {
  color: var(--muted);
  font-size: 14px;
  margin: 4px 0 0;
}

.route {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  margin-top: 2px;
}

.jobs-table {
  border-collapse: collapse;
  width: 100%;
}

.jobs-table th,
.jobs-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  text-align: left;
  vertical-align: top;
}

.jobs-table th {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  width: 42%;
}

.mono-row code {
  background: var(--bg);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
  padding: 2px 6px;
}

.job {
  font-size: 14px;
  margin: 8px 0 0;
}

@media (max-width: 840px) {
  .serve-grid,
  .jump,
  .persona-grid,
  .two-col,
  .flow-grid {
    grid-template-columns: 1fr;
  }
}

.header {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 20px;
}

.header h1 {
  font-size: 30px;
  font-weight: 600;
  margin: 0;
}

.header .meta {
  margin-top: 8px;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar {
  align-items: flex-end;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
}

.field.grow {
  flex: 1;
  min-width: 220px;
}

.check {
  align-items: center;
  display: flex;
  font-size: 13px;
  gap: 8px;
  padding-bottom: 10px;
}

.count {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 10px auto;
}

.list {
  display: grid;
  gap: 12px;
}

.row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.row.dirty {
  border-color: #f0b27a;
  border-left: 4px solid #f0b27a;
}

.row-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.key {
  font-family: var(--mono);
  font-size: 13px;
}

.cols {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.meta-cols {
  align-items: stretch;
}

@media (max-width: 840px) {
  .cols {
    grid-template-columns: 1fr;
  }
}

.col textarea,
.notes textarea,
.suggestions textarea {
  line-height: 1.45;
  resize: vertical;
}

.suggestions textarea {
  background: #f4faf8;
  border-color: #b7d6d3;
}
