:root {
  --color-header: #1a1a1a;
  --color-cta: #4ade80;
  --color-cta-hover: #22c55e;
  --color-text: #1a1a1a;
  --color-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-row-alt: #f9fafb;
  --color-approval-bg: #f0fdf4;
  --color-error: #dc2626;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --radius: 6px;
  --max-width: 860px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--color-text);
  background: #fff;
  font-size: 16px;
  line-height: 1.6;
}

/* ── Header ── */

.site-header {
  background: var(--color-header);
  color: #fff;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 24px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.wordmark {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #fff !important;
  text-decoration: none !important;
  flex-shrink: 0;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.header-nav a {
  color: rgba(255,255,255,0.6) !important;
  text-decoration: none !important;
  font-size: 14px;
  padding: 5px 10px;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.header-nav a:hover { color: #fff !important; background: rgba(255,255,255,0.08); }
.header-nav a.active { color: #fff !important; }

/* ── Buttons ── */

.btn-pdf {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  cursor: pointer;
  font-family: var(--font);
  transition: border-color 0.15s;
}
.btn-pdf:hover { border-color: rgba(255,255,255,0.7); }

.btn-approve-jump {
  background: transparent;
  border: 1px solid var(--color-cta);
  color: var(--color-cta);
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: border-color 0.15s, color 0.15s;
}
.btn-approve-jump:hover { border-color: var(--color-cta-hover); color: var(--color-cta-hover); }

.btn-approve {
  background: var(--color-cta);
  color: var(--color-header);
  border: none;
  padding: 14px 32px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s;
  display: inline-block;
  margin-top: 16px;
}
.btn-approve:hover { background: var(--color-cta-hover); }
.btn-approve:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Proposal shell ── */

.proposal {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ── State messages ── */

.state-message {
  padding: 60px 0;
  text-align: center;
  color: var(--color-muted);
}
.state-error { color: var(--color-error); }

/* ── Proposal meta ── */

.proposal-meta {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 48px;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.meta-grid > div {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}

.meta-grid > div:nth-child(odd) {
  border-right: 1px solid var(--color-border);
}

.meta-grid > div:last-child {
  border-bottom: none;
  border-right: none;
}

.meta-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  margin-bottom: 4px;
}

.meta-value {
  display: block;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.4;
}

/* ── Sections ── */

.proposal-section {
  margin-bottom: 56px;
}

.section-heading {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-header);
}

/* ── Tables ── */

.table-scroll { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.data-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.data-table tbody tr:nth-child(even) td { background: var(--color-row-alt); }

.data-table tfoot .total-row td {
  font-weight: 700;
  font-size: 16px;
  border-top: 2px solid var(--color-header);
  border-bottom: none;
  padding: 14px 12px;
}

.col-price {
  text-align: right;
  white-space: nowrap;
}

.investment-table .col-price { font-weight: 600; }

/* ── Scope items ── */

.scope-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.scope-item-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}

.scope-item-desc {
  color: #374151;
  margin-bottom: 10px;
}

.scope-deliverables {
  padding-left: 20px;
  color: #374151;
  font-size: 14px;
}
.scope-deliverables li { margin-bottom: 4px; }

/* ── Prose (terms) ── */

.prose p { margin-bottom: 1em; }
.prose p:last-child { margin-bottom: 0; }

/* ── Assumptions ── */

#assumptions-list {
  padding-left: 20px;
}
#assumptions-list li { margin-bottom: 6px; }

/* ── Approval block ── */

.approval-block {
  background: var(--color-approval-bg);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 32px;
  margin-top: 64px;
}

.approval-intro {
  color: var(--color-muted);
  margin-bottom: 24px;
}

.approval-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
}

.approval-fields label {
  font-size: 14px;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.approval-fields input[type="text"] {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 15px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}
.approval-fields input[type="text"]:focus { border-color: var(--color-cta-hover); }

.checkbox-label {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400 !important;
  cursor: pointer;
  line-height: 1.5;
}
.checkbox-label input { margin-top: 3px; flex-shrink: 0; }

.approval-error {
  color: var(--color-error);
  font-size: 14px;
  margin-top: 8px;
}

/* ── Confirmation ── */

.confirmation-inner {
  text-align: center;
  padding: 16px 0;
}

.confirmation-icon {
  width: 56px;
  height: 56px;
  background: var(--color-cta);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: var(--color-header);
  margin: 0 auto 20px;
}

.confirmation-inner h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.confirmation-meta {
  font-size: 14px;
  color: var(--color-muted);
  margin-top: 12px;
}

/* ── Markdown body ── */

.proposal-body { margin-bottom: 56px; }

.proposal-body h1 { display: none; } /* skill outputs title we already show in meta */

.proposal-body h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin: 48px 0 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-header);
}

.proposal-body h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 28px 0 8px;
}

.proposal-body p { margin-bottom: 1em; }

.proposal-body ul, .proposal-body ol {
  padding-left: 20px;
  margin-bottom: 1em;
}

.proposal-body li { margin-bottom: 4px; }

.proposal-body strong { font-weight: 700; }
.proposal-body em { font-style: italic; color: var(--color-muted); }

.proposal-body .table-wrap {
  overflow-x: auto;
  margin-bottom: 1.5em;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.proposal-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.proposal-body th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  padding: 10px 16px;
  background: var(--color-row-alt);
  border-bottom: 1px solid var(--color-border);
}

.proposal-body td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.proposal-body tbody tr:last-child td {
  border-bottom: none;
  font-weight: 700;
  background: #f9fafb;
}

.proposal-body tbody tr:nth-child(even) td { background: var(--color-row-alt); }
.proposal-body tbody tr:last-child td { background: #f1f5f9; }

.proposal-body td:last-child,
.proposal-body th:last-child {
  text-align: right;
}

.proposal-body hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 40px 0;
}

.proposal-body blockquote {
  border-left: 3px solid var(--color-border);
  padding-left: 16px;
  color: var(--color-muted);
  margin: 0 0 1em;
}

/* ── Responsive ── */

@media (max-width: 600px) {
  .proposal { padding: 24px 16px 60px; }
  .site-header { padding: 0 16px; }
  .approval-block { padding: 20px 16px; }
  .section-heading { font-size: 19px; }
}
