:root {
  color-scheme: light;
  --ink: #17201d;
  --muted: #64706b;
  --line: #d8ddd9;
  --paper: #f7f8f4;
  --surface: #ffffff;
  --accent: #0f6b5f;
  --accent-dark: #0a3f39;
  --signal: #b84a2b;
  --gold: #b6862c;
  --blue: #2f5d82;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

button,
.button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 10px 16px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button.ghost,
button.ghost {
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid var(--line);
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.top-nav a,
.top-nav button {
  white-space: nowrap;
  padding: 8px 10px;
  min-height: 36px;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
}

.top-nav form {
  margin-left: auto;
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 30px 0 56px;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--signal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.05;
}

h2 {
  margin-bottom: 12px;
  font-size: 19px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.metric-grid article,
.settings-grid article,
.feature-row article,
.task-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.metric-grid strong {
  display: block;
  font-size: 32px;
}

.metric-grid span,
.task-card span,
.feature-row span {
  color: var(--muted);
}

.two-column,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.settings-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: #e8ece7;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.badge-live,
.badge-paid,
.badge-done,
.badge-active,
.badge-customer,
.ok {
  color: #0b5d35;
}

.badge-blocked,
.badge-needs_attention,
.badge-high,
.warn {
  color: #a13f25;
}

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

.quick-add,
.record-form,
.stack-form {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.quick-add {
  grid-template-columns: repeat(5, minmax(120px, 1fr)) auto;
  align-items: end;
}

.record-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.full {
  grid-column: 1 / -1;
}

.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 12px;
  overflow-x: auto;
}

.board-column {
  min-height: 340px;
  padding: 12px;
  background: #edf0eb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.task-card {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.login-panel {
  width: min(440px, calc(100vw - 32px));
  margin: 12vh auto;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.error,
.disclaimer {
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff4ed;
  color: #8f3a21;
  font-weight: 750;
}

.public-main {
  padding-bottom: 54px;
}

.funnel-hero {
  min-height: 78vh;
  display: flex;
  align-items: center;
  padding: 48px max(24px, calc((100vw - 1120px) / 2));
  background:
    linear-gradient(90deg, rgba(247, 248, 244, 0.96) 0%, rgba(247, 248, 244, 0.88) 52%, rgba(247, 248, 244, 0.5) 100%),
    url("/mission-grid.svg");
  background-size: cover;
  border-bottom: 1px solid var(--line);
}

.funnel-hero > div {
  width: min(680px, 100%);
}

.funnel-hero h1 {
  font-size: 58px;
}

.lede {
  max-width: 620px;
  color: #3d4944;
  font-size: 20px;
}

.hero-actions,
.feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.funnel-band,
.intake-section {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 42px 0;
}

.feature-row {
  margin-top: 18px;
}

.feature-row article {
  flex: 1 1 220px;
  display: grid;
  gap: 6px;
}

code {
  color: var(--blue);
  font-weight: 800;
}

@media (max-width: 820px) {
  .metric-grid,
  .two-column,
  .settings-grid,
  .record-form {
    grid-template-columns: 1fr;
  }

  .quick-add {
    grid-template-columns: 1fr;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .funnel-hero h1 {
    font-size: 40px;
  }

  .lede {
    font-size: 18px;
  }
}
