:root {
  --cream: #f5f0e6;
  --cream-deep: #eee7d8;
  --paper: #fffdf8;
  --ink: #191713;
  --ink-soft: #363127;
  --muted: #6b6355;
  --line: #dcd3c0;
  --line-dark: #c9bfa9;
  --oxblood: #7c3b2e;
  --oxblood-deep: #652f24;
  --gold: #9c7f45;
  --ok: #3c6448;
  --warn: #856018;
  --danger: #8f2f2a;
  --info: #465d68;
  --radius: 6px;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--oxblood); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--oxblood-deep); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; line-height: 1.12; color: var(--ink); margin: 0 0 0.6rem; letter-spacing: -0.012em; }
h1 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 0.8rem; }
code { font-family: var(--font-mono); font-size: 0.86em; background: #efe8d9; padding: 0.08em 0.35em; border-radius: 3px; }
pre { font-family: var(--font-mono); font-size: 0.8rem; white-space: pre-wrap; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 0.7rem 1rem; z-index: 100; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--oxblood); outline-offset: 2px; }

.eyebrow, .kicker {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--oxblood);
  margin-bottom: 0.55rem;
}
.kicker { color: var(--muted); }
.small { font-size: 0.84rem; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.empty { color: var(--muted); font-style: italic; padding: 1rem 0; }
.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; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }

/* Marketing */
.marketing-body { background: var(--cream); }
.masthead {
  display: flex; justify-content: space-between; align-items: center; gap: 1.5rem;
  padding: 1.1rem clamp(1.2rem, 5vw, 3.2rem); border-bottom: 1px solid var(--line-dark);
  background: var(--cream);
}
.masthead-brand { display: flex; gap: 0.7rem; align-items: center; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 38px; height: 38px; border: 1px solid var(--line-dark); border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-display); font-size: 0.95rem;
  letter-spacing: 0.02em; flex: none; background: var(--paper);
}
.brand-mark.dark { border-color: var(--ink); color: var(--ink); background: transparent; }
.masthead-brand span:last-child { font-family: var(--font-display); font-size: 1.02rem; line-height: 1.15; display: flex; flex-direction: column; }
.masthead-brand small { font-family: var(--font-body); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-top: 0.15rem; }
.masthead-nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.masthead-nav a { font-size: 0.82rem; color: var(--ink-soft); text-decoration: none; letter-spacing: 0.02em; }
.masthead-nav a:hover { color: var(--oxblood); text-decoration: underline; }

.hero {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: clamp(2rem, 5vw, 4.5rem); align-items: start;
  padding: clamp(2.8rem, 7vw, 5.5rem) clamp(1.2rem, 5vw, 3.2rem) clamp(2.2rem, 5vw, 4rem);
  max-width: 1220px; margin: 0 auto;
}
.hero h1 { font-size: clamp(2.4rem, 5.4vw, 4.05rem); letter-spacing: -0.025em; max-width: 14ch; margin-bottom: 1rem; }
.lede { font-size: clamp(1.02rem, 1.6vw, 1.18rem); color: var(--ink-soft); max-width: 56ch; line-height: 1.65; }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; margin: 1.5rem 0 1rem; }
.price-row { display: flex; gap: 0.8rem; align-items: baseline; flex-wrap: wrap; padding-top: 1rem; border-top: 1px solid var(--line); }
.price { font-family: var(--font-display); font-size: 2rem; }
.checkout { margin-top: 0.9rem; }
.checkout .small { max-width: 52ch; }
.checkout-unset { border-left: 2px solid var(--gold); padding: 0.7rem 0 0.7rem 0.9rem; background: #f9f4e5; }
.checkout-unset p { margin: 0.45rem 0; }
.text-link { font-size: 0.85rem; }
.hero-aside { padding-top: 0.6rem; }
.specimen { background: var(--paper); border: 1px solid var(--ink); padding: 1.4rem; position: relative; }
.specimen::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--line); pointer-events: none; }
.specimen-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line-dark); padding-bottom: 0.6rem; }
.specimen-list { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.specimen-list li { display: flex; gap: 0.9rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; align-items: baseline; }
.specimen-list li:last-child { border-bottom: 0; }
.specimen-list span { font-family: var(--font-display); color: var(--gold); font-size: 0.85rem; }
.specimen-foot { border-top: 1px solid var(--line-dark); padding-top: 0.6rem; color: var(--muted); }

.band { border-top: 1px solid var(--line-dark); padding: clamp(2.4rem, 5vw, 4rem) clamp(1.2rem, 5vw, 3.2rem); }
.band.alt { background: var(--cream-deep); }
.band-inner { max-width: 1180px; margin: 0 auto; }
.section-head { max-width: 62ch; margin-bottom: 1.8rem; }
.section-head h2 { margin-bottom: 0.5rem; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 1.2rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.editorial-card { background: var(--paper); border: 1px solid var(--line); padding: 1.2rem; }
.editorial-card h3 { margin-bottom: 0.35rem; }
.editorial-card p { margin: 0; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem; margin-bottom: 1.2rem;
}
.cream-card { background: var(--paper); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.2rem; align-items: start; }
.editorial-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.editorial-table th { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); text-align: left; padding: 0.4rem 0.45rem; border-bottom: 1px solid var(--ink); }
.editorial-table td { padding: 0.55rem 0.45rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.editorial-table .num { text-align: right; }
.editorial-list { list-style: none; margin: 0.8rem 0 0; padding: 0; }
.editorial-list li { padding: 0.45rem 0 0.45rem 1.4rem; border-bottom: 1px solid var(--line); position: relative; font-size: 0.9rem; }
.editorial-list li::before { content: ""; position: absolute; left: 0; top: 0.85rem; width: 7px; height: 7px; border: 1px solid var(--gold); }
.checklist { list-style: none; padding: 0; margin: 1rem 0 1.2rem; }
.checklist li { padding: 0.35rem 0 0.35rem 1.5rem; position: relative; font-size: 0.92rem; }
.checklist li::before { content: "—"; position: absolute; left: 0; color: var(--oxblood); }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 1rem; padding: 0.8rem 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.steps li:last-child { border-bottom: 0; }
.steps li > span { font-family: var(--font-display); color: var(--gold); }
.steps p { margin: 0; }
.close-list { list-style: none; margin: 0.8rem 0 0; padding: 0; }
.close-list li { display: flex; gap: 0.7rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.close-list li:last-child { border-bottom: 0; }
.tick { width: 13px; height: 13px; border: 1px solid var(--line-dark); margin-top: 0.25rem; flex: none; }
.close-list p { margin: 0; }
details { border-top: 1px solid var(--line); padding: 0.75rem 0; }
details summary { cursor: pointer; font-weight: 600; font-size: 0.93rem; }
details p { margin-top: 0.5rem; }
.closing-band {
  border-top: 1px solid var(--line-dark); padding: clamp(2rem, 5vw, 3.4rem) clamp(1.2rem, 5vw, 3.2rem);
  display: flex; justify-content: space-between; gap: 2rem; align-items: center; flex-wrap: wrap;
  max-width: 1180px; margin: 0 auto;
}
.site-footer {
  border-top: 1px solid var(--line-dark); padding: clamp(1.6rem, 4vw, 2.4rem) clamp(1.2rem, 5vw, 3.2rem);
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 2rem; font-size: 0.85rem;
  max-width: 1180px; margin: 0 auto;
}
.footer-brand { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 0.35rem; }

/* Buttons, forms, alerts */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border-radius: 3px; padding: 0.55rem 1rem; font-size: 0.86rem; font-weight: 600;
  font-family: var(--font-body); cursor: pointer; text-decoration: none; line-height: 1.2;
  border: 1px solid transparent; letter-spacing: 0.01em;
}
.btn-ink { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.btn-ink:hover { background: #2c2821; color: #fff; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--cream); }
.btn-danger { background: transparent; color: var(--danger); border-color: #d7bfb8; }
.btn-danger:hover { background: #f6e9e6; }
.btn-small { padding: 0.32rem 0.6rem; font-size: 0.76rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.toolbar { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-bottom: 0.8rem; }
.inline-form { display: inline-flex; gap: 0.3rem; align-items: center; flex-wrap: wrap; margin: 0; }

.field { margin-bottom: 0.85rem; }
.field label, .field .label { display: block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.3rem; color: var(--ink-soft); }
.field .hint { font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="number"],
input[type="password"], input[type="url"], input:not([type]), select, textarea {
  width: 100%; border: 1px solid var(--line-dark); border-radius: 3px; background: #fffefb;
  padding: 0.48rem 0.55rem; font: inherit; font-size: 0.88rem; color: var(--ink);
}
input:focus, select:focus, textarea:focus { border-color: var(--oxblood); }
textarea { min-height: 6rem; resize: vertical; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.8rem; }
input[readonly] { background: #f3eee3; }

.alert { border-radius: 3px; padding: 0.8rem 1rem; margin-bottom: 1rem; font-size: 0.88rem; border: 1px solid; }
.alert-error { background: #f9ebe8; border-color: #ddc0b9; color: #6f241f; }
.alert-ok { background: #ebf1e9; border-color: #c8d6c3; color: #2c5039; }
.alert ul { margin: 0.45rem 0 0; padding-left: 1.1rem; }
.notice { border: 1px solid var(--line-dark); background: #f8f2e3; padding: 0.8rem 1rem; font-size: 0.86rem; margin: 1rem 0; border-left: 3px solid var(--gold); }

/* Workspace shell */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--ink); color: #e9e2d3; padding: 1.4rem 1rem; display: flex; flex-direction: column; gap: 1.5rem;
}
.sidebar .brand-mark { border-color: #6e6657; color: #efe8d9; background: transparent; }
.brand { display: flex; gap: 0.7rem; align-items: center; }
.brand-name { font-family: var(--font-display); font-size: 1rem; color: #f4eee0; line-height: 1.15; }
.brand-sub { font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: #a79c87; }
.nav { display: flex; flex-direction: column; gap: 0.1rem; }
.nav a {
  color: #d8d0bf; text-decoration: none; padding: 0.5rem 0.6rem; border-radius: 3px;
  font-size: 0.88rem; border-left: 2px solid transparent;
}
.nav a:hover { background: rgba(245, 240, 230, 0.08); color: #fff; }
.nav a[aria-current="page"] { background: rgba(245, 240, 230, 0.1); color: #fff; border-left-color: var(--gold); }
.signout { margin-top: 0.6rem; }
.signout button {
  background: transparent; border: 1px solid rgba(167, 156, 135, 0.55); border-radius: 6px;
  color: #d8d0bf; font: inherit; font-size: 0.74rem; padding: 0.3rem 0.6rem; cursor: pointer;
}
.signout button:hover { background: rgba(255, 255, 255, 0.08); }
.sidebar-foot { margin-top: 1.1rem; font-size: 0.72rem; color: #a79c87; line-height: 1.55; }
.sidebar-foot strong { color: #e9e2d3; }
.sidebar-foot a { color: #d8d0bf; }
.main { padding: 1.6rem clamp(1rem, 3vw, 2.4rem) 3rem; min-width: 0; }
.page-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; margin-bottom: 1.2rem; }
.page-head h1 { margin-bottom: 0.2rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.8rem; margin-bottom: 1.3rem; }
.stat { background: var(--paper); border: 1px solid var(--line); padding: 0.9rem 1rem; }
.stat-label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-weight: 700; }
.stat-value { font-family: var(--font-display); font-size: 1.7rem; line-height: 1.15; margin-top: 0.2rem; }
.stat-value.small-value { font-size: 1.05rem; }
.stat-note { font-size: 0.76rem; color: var(--muted); }
.small-stats .stat-value { font-size: 1.35rem; }

.card-head { display: flex; justify-content: space-between; gap: 0.8rem; align-items: baseline; flex-wrap: wrap; margin-bottom: 0.8rem; }
.card-head h2, .card-head h3 { margin: 0; }
.card-sub { font-size: 0.78rem; color: var(--muted); }
.client-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; margin-bottom: 1rem; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th { text-align: left; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--ink-soft); white-space: nowrap; font-weight: 700; }
td { padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover { background: #faf6ec; }
tr.is-overdue td { background: #fbf0ed; }
tr.phase-row td { background: var(--cream-deep); font-family: var(--font-display); font-size: 0.95rem; letter-spacing: 0.01em; border-bottom: 1px solid var(--line-dark); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tfoot td { font-weight: 600; border-top: 1px solid var(--ink); }
.task-table input, .task-table select { font-size: 0.8rem; padding: 0.35rem 0.4rem; }
.task-table td:first-child { min-width: 240px; }

.badge {
  display: inline-flex; align-items: center; border-radius: 2px; padding: 0.1rem 0.4rem;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid; white-space: nowrap;
}
.badge-ok { color: var(--ok); border-color: #b7cbb8; background: #eef4ec; }
.badge-warn { color: var(--warn); border-color: #ddcaa0; background: #faf2dd; }
.badge-danger { color: var(--danger); border-color: #ddc0b9; background: #f9ece9; }
.badge-muted { color: var(--muted); border-color: var(--line-dark); background: transparent; }
.badge-info { color: var(--info); border-color: #c0cdd2; background: #eef3f4; }

.progress { height: 5px; background: #e7dfcf; border-radius: 99px; overflow: hidden; margin: 0.3rem 0 0.2rem; }
.progress span { display: block; height: 100%; background: var(--oxblood); }
.progress-label { font-size: 0.72rem; color: var(--muted); }

.compact-list { list-style: none; margin: 0; padding: 0; }
.compact-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--line); font-size: 0.88rem; }
.compact-list li:last-child { border-bottom: 0; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 0.5rem 0 0.6rem 1rem; border-left: 1px solid var(--line-dark); position: relative; font-size: 0.87rem; }
.timeline li::before { content: ""; position: absolute; left: -3px; top: 0.9rem; width: 5px; height: 5px; background: var(--oxblood); }
.timeline .when { font-size: 0.72rem; color: var(--muted); }
.timeline .empty { border-left: 0; padding-left: 0; }

.detail-list { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; font-size: 0.88rem; margin: 0; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; }

.pipeline { display: flex; gap: 0.8rem; overflow-x: auto; padding-bottom: 1rem; align-items: flex-start; }
.pipeline-col { flex: 0 0 190px; background: #f0e9db; border: 1px solid var(--line); padding: 0.7rem; min-height: 220px; }
.pipeline-col h2 { font-family: var(--font-body); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.6rem; color: var(--ink-soft); display: flex; justify-content: space-between; }
.pipeline-col .count { color: var(--muted); font-weight: 400; }
.pipeline-card { display: flex; flex-direction: column; gap: 0.15rem; background: var(--paper); border: 1px solid var(--line-dark); padding: 0.6rem; margin-bottom: 0.55rem; text-decoration: none; color: var(--ink); }
.pipeline-card:hover { border-color: var(--oxblood); }
.pipeline-name { font-family: var(--font-display); font-size: 0.98rem; }

.export-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.5rem; }
.export-link { display: flex; justify-content: space-between; gap: 0.6rem; padding: 0.6rem 0.7rem; border: 1px solid var(--line); background: #fbf7ee; text-decoration: none; font-size: 0.86rem; }
.export-link:hover { border-color: var(--oxblood); }
.export-link span { color: var(--muted); font-size: 0.75rem; }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding-top: 2.4rem; }
  .hero h1 { max-width: 18ch; }
  .site-footer { grid-template-columns: 1fr; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { padding: 1rem; }
  .nav { flex-direction: row; overflow-x: auto; padding-bottom: 0.2rem; }
  .nav a { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
  .nav a[aria-current="page"] { border-left: 0; border-bottom-color: var(--gold); }
  .sidebar-foot { display: none; }
  .masthead { flex-wrap: wrap; }
  .masthead-nav { gap: 1rem; }
}
@media (max-width: 640px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .closing-band { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media print {
  .marketing-body .masthead, .site-footer, .no-print, .skip-link, .sidebar { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .shell { display: block; }
  .main { padding: 0; }
  .card { border: 0; padding: 0; margin: 0 0 1rem; }
  a { color: #000; text-decoration: none; }
  .btn { display: none; }
  @page { margin: 16mm; }
}
