/* ============================================================
   Clearpath by Denovo Credit — design system
   Tokens, marketing site, workspace shell, portal, print.
   ============================================================ */

:root {
  --accent: #1f5eff;
  --accent-ink: #0b2fa8;
  --accent-soft: #eaf0ff;

  --ink: #0d1a2b;
  --ink-2: #33425c;
  --ink-3: #62718c;
  --ink-4: #8c99ad;

  --paper: #ffffff;
  --paper-2: #f6f8fc;
  --paper-3: #eef2f9;
  --line: #e2e8f2;
  --line-strong: #ccd6e6;

  --navy: #0b1424;
  --navy-2: #111e33;
  --navy-line: #22334d;

  --teal: #0f766e;
  --teal-soft: #e2f5f1;
  --amber: #a96110;
  --amber-soft: #fdf1de;
  --rose: #b42342;
  --rose-soft: #fde9ee;
  --violet: #5b3fd4;
  --violet-soft: #efeaff;
  --blue: #14509a;
  --blue-soft: #e7f0fb;
  --gray-soft: #eef1f6;

  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(13, 26, 43, 0.06);
  --shadow: 0 18px 45px -28px rgba(13, 26, 43, 0.35);
  --shadow-lg: 0 40px 80px -50px rgba(13, 26, 43, 0.5);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --side: 252px;
  --max: 1160px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper-2);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.18; letter-spacing: -0.02em; font-weight: 650; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
strong { font-weight: 620; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  transition: top 0.15s ease;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.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;
}

/* ---------------- type helpers ---------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 640;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.muted { color: var(--ink-3); }
.tiny { font-size: 12.5px; }
.small { font-size: 13.5px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: -0.01em; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.stack { display: grid; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wrap-actions { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  font-weight: 580;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
  text-align: center;
}
.btn:hover { border-color: var(--ink-4); background: var(--paper-2); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px -14px rgba(31, 94, 255, 0.9);
}
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--paper-3); border-color: transparent; }
.btn-sm { min-height: 32px; padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { min-height: 48px; padding: 13px 22px; font-size: 15.5px; border-radius: 12px; }
.btn-danger { color: var(--rose); border-color: #f0c6d1; background: var(--paper); }
.btn-danger:hover { background: var(--rose-soft); border-color: #e3a4b6; }
.btn-block { width: 100%; }
.btn svg { width: 16px; height: 16px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}
.icon-btn:hover { background: var(--paper-3); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------------- badges & chips ---------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--gray-soft);
  color: var(--ink-2);
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
}
.badge.teal { background: var(--teal-soft); color: var(--teal); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.rose { background: var(--rose-soft); color: var(--rose); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.gray { background: var(--gray-soft); color: var(--ink-3); }
.badge.plain::before { display: none; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  font-size: 12.5px;
  font-weight: 550;
  color: var(--ink-2);
}
.pill.is-active { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.pill .count { color: var(--ink-3); font-variant-numeric: tabular-nums; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--paper-3);
  font-size: 12px;
  font-weight: 560;
  color: var(--ink-2);
}

/* ---------------- cards ---------------- */

.card {
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.card-head h2, .card-head h3 { font-size: 15px; letter-spacing: -0.01em; }
.card-head p { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.card-body { padding: 20px; }
/* Label over value, as in a mailed package or a dispute: without this the
   labels and their values run together on one line. */
.kv {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px 20px;
}
.kv > div { display: grid; gap: 3px; min-width: 0; }
.kv .k {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.kv .v {
  font-size: 14px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.card-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ---------------- forms ---------------- */

.field { display: grid; gap: 6px; }
.field > label, .label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.01em;
}
.hint { font-size: 12px; color: var(--ink-3); }

.input, .select, .textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 94, 255, 0.14);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2362718c' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; color: var(--ink-2); }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }

.filters {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.filters .input, .filters .select { min-height: 36px; width: auto; min-width: 170px; padding-top: 6px; padding-bottom: 6px; font-size: 13.5px; }

/* ---------------- tables ---------------- */

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fbfcfe; }
.table td.actions { text-align: right; white-space: nowrap; }
.table .who { display: flex; align-items: center; gap: 10px; }
.table a.link { color: var(--accent-ink); font-weight: 580; }
.table a.link:hover { text-decoration: underline; }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 680;
  letter-spacing: 0.02em;
  flex: none;
}
.avatar.lg { width: 52px; height: 52px; border-radius: 14px; font-size: 16px; }
.avatar.dark { background: rgba(255, 255, 255, 0.14); color: #fff; }

/* ---------------- notices ---------------- */

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.notice-ok { border-color: #bfe6dc; background: var(--teal-soft); color: #0b5d56; }
.notice-error { border-color: #f3c6d2; background: var(--rose-soft); color: #8f1b35; }
.notice-info { border-color: #c7d8f2; background: var(--blue-soft); color: #17406f; }
.notice svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }

.empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--ink-3);
}
.empty h3 { font-size: 15px; color: var(--ink); margin-bottom: 6px; }
.empty p { font-size: 13.5px; max-width: 42ch; margin: 0 auto; }

/* ============================================================
   Marketing site
   ============================================================ */

.site { background: var(--paper); }

.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -0.02em; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--navy);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex: none;
}
.brand-mark.accent { background: var(--accent); }
.brand-name { font-size: 15.5px; }
.brand-sub { font-size: 11px; color: var(--ink-3); font-weight: 500; letter-spacing: 0.02em; }

.site-nav { display: flex; align-items: center; gap: 26px; font-size: 14px; color: var(--ink-2); }
.site-nav a:hover { color: var(--ink); }
.site-actions { display: flex; align-items: center; gap: 10px; }

.site-toggle { display: none; }

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(900px 420px at 78% -10%, rgba(31, 94, 255, 0.10), transparent 70%),
    linear-gradient(180deg, #fbfcff 0%, #ffffff 62%);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: 56px;
  align-items: center;
  padding: 76px 0 84px;
}
.hero h1 {
  font-size: clamp(34px, 4.2vw, 54px);
  letter-spacing: -0.035em;
  margin: 18px 0 0;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lede {
  margin-top: 18px;
  font-size: 17.5px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 54ch;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.hero-proof div { min-width: 120px; }
.hero-proof strong { display: block; font-size: 19px; letter-spacing: -0.02em; }
.hero-proof span { font-size: 12.5px; color: var(--ink-3); }

.hero-panel {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.hero-panel-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.hero-panel-body { padding: 18px; display: grid; gap: 12px; }
.hero-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.hero-metric .label { font-size: 12px; color: var(--ink-3); font-weight: 550; }
.hero-metric .value { font-size: 24px; font-weight: 660; letter-spacing: -0.03em; }
.hero-metric .value.up { color: var(--teal); }
.hero-timeline { display: grid; gap: 10px; padding: 4px 2px 0; }
.hero-step { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--ink-2); }
.hero-step i {
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-ink);
  font-style: normal; font-size: 10px; font-weight: 700; flex: none;
  margin-top: 1px;
}
.hero-step.done i { background: var(--teal-soft); color: var(--teal); }

.bureaus {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-3);
}
.bureaus .tag {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  font-weight: 580;
  color: var(--ink-2);
}

.section { padding: 84px 0; }
.section.tint { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 640px; }
.section-head h2 {
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.03em;
  margin: 14px 0 0;
}
.section-head p { margin-top: 14px; font-size: 16px; color: var(--ink-2); }

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 40px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 40px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 40px; }

.feature {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.feature .ico-box {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  margin-bottom: 16px;
}
.feature .ico-box svg { width: 19px; height: 19px; }
.feature h3 { font-size: 15.5px; margin-bottom: 8px; }
.feature p { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.feature ul { margin-top: 14px; display: grid; gap: 7px; }
.feature li { display: flex; gap: 8px; font-size: 13px; color: var(--ink-2); }
.feature li svg { width: 14px; height: 14px; flex: none; margin-top: 3px; color: var(--teal); }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 44px; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--paper); }
.step-cell { padding: 28px; border-right: 1px solid var(--line); }
.step-cell:last-child { border-right: 0; }
.step-num {
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--accent-ink); background: var(--accent-soft);
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px;
}
.step-cell h3 { font-size: 16px; margin: 16px 0 8px; }
.step-cell p { font-size: 13.5px; color: var(--ink-2); }

.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; align-items: center; }
.checklist { display: grid; gap: 14px; margin-top: 26px; }
.checklist li { display: flex; gap: 12px; font-size: 14px; color: var(--ink-2); }
.checklist .tick {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--teal-soft); color: var(--teal);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  margin-top: 1px;
}
.checklist .tick svg { width: 12px; height: 12px; }
.checklist strong { display: block; color: var(--ink); font-size: 14px; margin-bottom: 2px; }

.quote {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 26px;
}
.quote p { font-size: 15px; line-height: 1.65; color: var(--ink); }
.quote footer { display: flex; align-items: center; gap: 10px; margin-top: 20px; font-size: 13px; color: var(--ink-3); }

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 46px;
}
.metric-strip div { background: var(--paper); padding: 22px; }
.metric-strip strong { display: block; font-size: 26px; letter-spacing: -0.03em; }
.metric-strip span { font-size: 12.5px; color: var(--ink-3); }

.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 40px; align-items: start; }
.plan {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 26px;
  display: grid;
  gap: 16px;
}
.plan.featured { border-color: var(--accent); box-shadow: 0 24px 60px -40px rgba(31, 94, 255, 0.7); }
.plan .plan-tag { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); }
.plan .price { font-size: 34px; letter-spacing: -0.04em; font-weight: 660; line-height: 1; }
.plan .price span { font-size: 13px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.plan ul { display: grid; gap: 9px; }
.plan li { display: flex; gap: 9px; font-size: 13.5px; color: var(--ink-2); }
.plan li svg { width: 14px; height: 14px; flex: none; margin-top: 3px; color: var(--accent); }

.faq { margin-top: 34px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 4px;
  font-size: 15px;
  font-weight: 580;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 20px;
  font-weight: 400;
  color: var(--ink-3);
  line-height: 1;
}
.faq details[open] summary::after { content: "–"; }
.faq .answer { padding: 0 4px 22px; font-size: 14px; color: var(--ink-2); max-width: 78ch; }

.cta-band {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr);
  gap: 36px;
  align-items: center;
  margin: 0 0 84px;
}
.cta-band h2 { font-size: clamp(24px, 2.6vw, 32px); letter-spacing: -0.03em; }
.cta-band p { margin-top: 12px; color: #b9c6db; font-size: 15px; max-width: 56ch; }
.cta-band .btn-primary { box-shadow: none; }
.cta-band .row { justify-content: flex-end; }

.contact-form { margin-top: 22px; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.contact-form .input, .contact-form .select { background: rgba(255, 255, 255, 0.07); border-color: var(--navy-line); color: #fff; }
.contact-form .input::placeholder { color: #8395b0; }
.contact-form .span-2 { grid-column: 1 / -1; }

.site-foot { background: var(--paper-2); border-top: 1px solid var(--line); padding: 56px 0 34px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr)); gap: 36px; }
.foot-grid h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: 14px; }
.foot-grid li { margin-bottom: 9px; font-size: 13.5px; color: var(--ink-2); }
.foot-grid a:hover { color: var(--accent-ink); }
.foot-note {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-3);
}
.foot-note .disclaimer { max-width: 76ch; }

/* ============================================================
   Auth pages
   ============================================================ */

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  background: var(--paper);
}
.auth-aside {
  background:
    radial-gradient(700px 400px at 20% 10%, rgba(31, 94, 255, 0.28), transparent 65%),
    var(--navy);
  color: #fff;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
}
.auth-aside h2 { font-size: clamp(24px, 2.4vw, 32px); letter-spacing: -0.03em; max-width: 30ch; }
.auth-aside p { color: #b9c6db; margin-top: 14px; max-width: 42ch; font-size: 14.5px; }
.auth-aside ul { display: grid; gap: 12px; margin-top: 28px; }
.auth-aside li { display: flex; gap: 10px; font-size: 13.5px; color: #d5deec; }
.auth-aside li svg { width: 15px; height: 15px; flex: none; margin-top: 3px; color: #6f9dff; }
.auth-aside .foot { font-size: 12px; color: #8698b3; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 26px; letter-spacing: -0.03em; margin-top: 26px; }
.auth-card > p { margin-top: 8px; color: var(--ink-3); font-size: 14px; }
.auth-card form { margin-top: 26px; display: grid; gap: 14px; }
.auth-links { margin-top: 22px; display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-3); }
.auth-links a:hover { color: var(--accent-ink); }
.demo-creds {
  margin-top: 26px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 12.5px;
  color: var(--ink-2);
  background: var(--paper-2);
}
.demo-creds strong { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3); margin-bottom: 8px; }
.demo-creds code { font-family: var(--mono); font-size: 12px; }
.demo-creds .row { gap: 8px; justify-content: space-between; }

/* ============================================================
   Workspace shell
   ============================================================ */

.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  background: var(--navy);
  color: #cfd9e8;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar .brand { color: #fff; padding: 4px 8px 14px; }
.sidebar .brand-mark { background: rgba(255, 255, 255, 0.12); }
.sidebar .brand-sub { color: #8698b3; }

.side-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: #6b7d99; padding: 16px 10px 6px; font-weight: 640; }
.side-nav { display: grid; gap: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 520;
  color: #c2cee0;
  transition: background 0.14s ease, color 0.14s ease;
}
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: 0.8; }
.nav-item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav-item.is-active { background: rgba(255, 255, 255, 0.12); color: #fff; font-weight: 600; }
.nav-item.is-active svg { opacity: 1; }
.nav-item .count {
  margin-left: auto;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.12);
  padding: 1px 7px;
  border-radius: 999px;
  color: #e6edf7;
}
.nav-item.is-active .count { background: var(--accent); color: #fff; }

.side-foot { margin-top: auto; padding-top: 18px; display: grid; gap: 10px; }
.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}
.side-user .name { font-size: 13px; color: #fff; font-weight: 580; }
.side-user .role { font-size: 11.5px; color: #93a5c0; text-transform: capitalize; }
.side-logout button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #93a5c0;
  font-size: 12.5px;
  cursor: pointer;
  text-align: left;
}
.side-logout button:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.side-logout svg { width: 15px; height: 15px; }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 62px;
  padding: 0 26px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .crumb { font-size: 12.5px; color: var(--ink-3); }
.topbar .crumb strong { color: var(--ink); font-weight: 600; }
.topbar .spacer { flex: 1; }
.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 240px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper-2);
  color: var(--ink-3);
  font-size: 13px;
}
.topbar-search input {
  border: 0;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 13px;
  color: var(--ink);
}
.topbar-search svg { width: 15px; height: 15px; flex: none; }

.menu-toggle { display: none; }

.content { padding: 26px; display: grid; gap: 20px; align-content: start; flex: 1; }

/* Grid and flex children must be allowed to shrink below their content width. */
.content > *, .portal-main > *, .grid-portal > *, .dash-grid > *, .stack > *, .split > *, .grid-3 > *, .grid-2 > *, .kpis > * { min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 23px; letter-spacing: -0.03em; }
.page-head p { margin-top: 5px; font-size: 13.5px; color: var(--ink-3); }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { padding: 18px; }
.kpi .kpi-label { font-size: 12px; color: var(--ink-3); font-weight: 550; display: flex; align-items: center; gap: 6px; }
.kpi .kpi-value { font-size: 28px; font-weight: 650; letter-spacing: -0.035em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .kpi-meta { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.kpi .kpi-meta.up { color: var(--teal); }
.kpi .kpi-meta.warn { color: var(--amber); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }

.list-rows { display: grid; }
.list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: #fbfcfe; }
.list-row .grow { min-width: 0; display: grid; gap: 2px; }
.list-row .title { font-weight: 570; color: var(--ink); }
.list-row .meta { font-size: 12px; color: var(--ink-3); }

.feed { display: grid; }
.feed-row { display: flex; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--line); }
.feed-row:last-child { border-bottom: 0; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 7px; flex: none; }
.feed-row .body { font-size: 13px; color: var(--ink-2); }
.feed-row .body strong { color: var(--ink); font-weight: 570; }
.feed-row time { font-size: 11.5px; color: var(--ink-4); display: block; margin-top: 2px; }

.stage-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--paper-3); margin: 14px 0 12px; }
.stage-bar span { display: block; height: 100%; }
.stage-legend { display: grid; gap: 8px; }
.stage-legend div { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.stage-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.stage-legend .n { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink-3); }

/* client detail */
.detail-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: start; }
.detail-title { display: flex; gap: 14px; align-items: center; }
.detail-title h1 { font-size: 22px; }
.detail-title .meta { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.score-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.score-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: var(--paper-2);
}
.score-box .b { font-size: 11.5px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.score-box .v { font-size: 24px; font-weight: 660; letter-spacing: -0.03em; margin-top: 4px; }
.score-box .d { font-size: 11.5px; color: var(--teal); margin-top: 2px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 8px; overflow-x: auto; }
.tab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 12px 12px;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--ink-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.tab-panel { padding: 20px; }
.tab-panel[hidden] { display: none; }

.timeline { display: grid; gap: 0; }
.tl-item { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; padding-bottom: 18px; position: relative; }
.tl-item::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 20px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.tl-item:last-child::before { display: none; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--paper); border: 2px solid var(--accent); margin: 4px 0 0 5px; }
.tl-item p { font-size: 13.5px; }
.tl-item time { font-size: 11.5px; color: var(--ink-3); }

.def-list { display: grid; gap: 12px; }
.def-list div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; font-size: 13.5px; align-items: baseline; }
.def-list dt { color: var(--ink-3); font-size: 12.5px; }
.def-list dd { margin: 0; }

.message-thread { display: grid; gap: 14px; max-height: 380px; overflow-y: auto; padding-right: 4px; }
.msg { max-width: 78%; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; }
.msg.agency { background: var(--accent-soft); color: #12306e; justify-self: end; border-bottom-right-radius: 4px; }
.msg.client { background: var(--paper-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg .who { font-size: 11px; color: var(--ink-3); margin-bottom: 3px; }

/* letter preview */
.letter-paper {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 34px 38px;
  font-family: "Times New Roman", Georgia, serif;
  font-size: 13px;
  line-height: 1.65;
  color: #111;
  max-height: 560px;
  overflow: auto;
  white-space: pre-wrap;
  box-shadow: var(--shadow-sm);
}

/* modal + native dialog */
dialog.modal {
  border: 0;
  padding: 0;
  width: min(560px, calc(100vw - 32px));
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
dialog.modal::backdrop { background: rgba(11, 20, 36, 0.5); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 17px; letter-spacing: -0.02em; }
.modal-head p { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.modal-body { padding: 22px; display: grid; gap: 14px; max-height: 70vh; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); background: var(--paper-2); }

/* upload dropzone */
.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  padding: 22px;
  text-align: center;
  background: var(--paper-2);
  font-size: 13px;
  color: var(--ink-3);
}
.dropzone input[type="file"] { margin-top: 10px; font-size: 12.5px; }

/* ============================================================
   Client portal
   ============================================================ */

.portal { background: var(--paper-2); min-height: 100vh; }
.portal-head { background: var(--paper); border-bottom: 1px solid var(--line); }
.portal-head-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 66px; }
.portal-nav { display: flex; gap: 4px; align-items: center; font-size: 13.5px; }
.portal-nav a {
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--ink-3);
  font-weight: 540;
}
.portal-nav a:hover { background: var(--paper-3); color: var(--ink); }
.portal-nav a.is-active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.portal-user { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.portal-main { max-width: 1080px; width: 100%; margin: 0 auto; padding: 30px 24px 60px; display: grid; gap: 20px; }
.portal-hero {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
}
.portal-hero h1 { font-size: 26px; letter-spacing: -0.03em; }
.portal-hero p { color: #b9c6db; margin-top: 8px; font-size: 14px; max-width: 56ch; }
.portal-score { display: flex; gap: 22px; }
.portal-score div { text-align: center; }
.portal-score .b { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: #93a5c0; }
.portal-score .v { font-size: 28px; font-weight: 660; letter-spacing: -0.03em; }
.portal-score .d { font-size: 11px; color: #6fd6c6; }

.grid-portal { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }

.upload-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.upload-row:last-child { border-bottom: 0; }
.upload-row .label { font-size: 13.5px; font-weight: 560; color: var(--ink); }
.upload-row .hint { margin-top: 2px; }

/* ============================================================
   Legal / error pages
   ============================================================ */

.doc-page { background: var(--paper); }
.doc-body { max-width: 760px; margin: 0 auto; padding: 64px 24px 90px; }
.doc-body h1 { font-size: 34px; letter-spacing: -0.035em; margin-bottom: 14px; }
.doc-body h2 { font-size: 17px; margin: 32px 0 8px; }
.doc-body p { font-size: 14.5px; color: var(--ink-2); line-height: 1.7; margin-bottom: 10px; }

.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--paper);
}
.error-card { max-width: 460px; text-align: center; }
.error-card .code { font-size: 64px; font-weight: 700; letter-spacing: -0.05em; color: var(--accent); line-height: 1; }
.error-card h1 { font-size: 24px; margin: 12px 0 8px; }
.error-card p { color: var(--ink-3); font-size: 14px; }
.error-card .row { justify-content: center; margin-top: 22px; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; padding: 56px 0 64px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .grid-portal { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; gap: 32px; }
  .plans { grid-template-columns: 1fr; }
  .cta-band { grid-template-columns: 1fr; padding: 34px; }
  .cta-band .row { justify-content: flex-start; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .grid-3, .grid-2, .steps { grid-template-columns: 1fr; }
  .step-cell { border-right: 0; border-bottom: 1px solid var(--line); }
  .step-cell:last-child { border-bottom: 0; }
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section { padding: 60px 0; }
  .cta-band { margin-bottom: 60px; }
  .site-nav { display: none; }
  .site-nav.open {
    display: flex;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 18px 18px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .site-nav.open a { padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .site-toggle { display: inline-flex; }
  .site-actions .btn-ghost { display: none; }

  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 268px;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    height: 100vh;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .topbar-search { display: none; }
  .content { padding: 18px 16px 40px; }
  .portal-head-inner { flex-wrap: wrap; padding: 10px 0; }
  .portal-nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .portal-hero { grid-template-columns: 1fr; padding: 24px; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-head { grid-template-columns: 1fr; }
  .def-list div { grid-template-columns: 1fr; gap: 2px; }
  .score-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .letter-paper { padding: 22px; font-size: 12.5px; }
}

@media (max-width: 620px) {
  .kpis { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .score-row { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
  .hero p.lede { font-size: 16px; }
  .hero-proof { gap: 16px; }
  .contact-form { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
  .metric-strip { grid-template-columns: 1fr; }
  .table th, .table td { padding-left: 12px; padding-right: 12px; }
  .page-head { align-items: flex-start; }
  .filters .input, .filters .select { min-width: 0; width: 100%; }
  .filters { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

@media print {
  .sidebar, .topbar, .portal-head, .site-head, .site-foot, .no-print, .page-actions, .tabs { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .shell { grid-template-columns: 1fr; }
  .content { padding: 0; }
  .card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  a[href]::after { content: ""; }
}

/* ---------------- drafting studio & account flows ---------------- */
.studio-grid { display: grid; grid-template-columns: minmax(300px, 370px) minmax(0, 1fr); gap: 18px; align-items: start; }
.check-row { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-2); }
.check-row input { width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.confidence { display: flex; align-items: center; gap: 10px; }
.confidence .bar { flex: 1; height: 6px; border-radius: 999px; background: var(--paper-3); overflow: hidden; }
.confidence .bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.signal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.signal-list li { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.draft-body { font-family: var(--mono); font-size: 12.5px; line-height: 1.75; min-height: 380px; }
.draft-steps { margin: 16px 0 14px; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: var(--ink-3); line-height: 1.55; }
.draft-steps strong { color: var(--ink); }
.auth-forgot { margin-top: 14px; font-size: 13px; text-align: right; }
.auth-forgot a { color: var(--ink-3); text-decoration: underline; text-underline-offset: 2px; }
.auth-forgot a:hover { color: var(--accent-ink); }

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