:root {
  --green-700: #27795f;
  --green-600: #3e9b7a;
  --green-500: #51b28d;
  --green-300: #9edbc1;
  --mint-100: #e4f3ec;
  --mint-50: #f2f8f5;
  --navy-900: #14284e;
  --navy-800: #243b6b;
  --coral-500: #f29a7a;
  --white: #ffffff;
  --ink: #17233c;
  --muted: #667085;
  --line: #dfe7e4;
  --shadow: 0 18px 50px rgba(20, 40, 78, .10);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; font-family: "Sora", system-ui, sans-serif; color: var(--ink); background: var(--white); line-height: 1.55; }
a { color: inherit; }
button, input, textarea { font: inherit; }
img { display: block; max-width: 100%; }
.skip-link { position: absolute; z-index: 100; left: 1rem; top: -4rem; padding: .75rem 1rem; background: var(--navy-900); color: white; border-radius: 8px; }
.skip-link:focus { top: 1rem; }
.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

.topbar { height: 78px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100vw - 1180px) / 2)); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px); }
.brand img { width: 205px; height: 54px; object-fit: contain; object-position: left center; }
.main-nav { display: flex; align-items: center; gap: 8px; }
.main-nav a { padding: 10px 14px; text-decoration: none; color: var(--navy-800); font-weight: 600; font-size: .9rem; border-radius: 10px; }
.main-nav a:hover, .main-nav a:focus-visible { background: var(--mint-50); color: var(--green-700); }
.menu-toggle { display: none; border: 1px solid var(--line); background: white; color: var(--navy-800); border-radius: 10px; padding: 9px 12px; }

.hero { min-height: 640px; display: grid; grid-template-columns: 1.08fr .92fr; gap: 72px; align-items: center; padding-block: 72px; position: relative; }
.hero::before { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; right: -100px; top: 40px; background: radial-gradient(circle, rgba(114,201,143,.30), rgba(242,248,245,0) 68%); z-index: -1; }
.eyebrow { display: inline-flex; color: var(--green-700); font-weight: 700; letter-spacing: .055em; text-transform: uppercase; font-size: .76rem; }
.hero h1 { margin: 18px 0 22px; color: var(--navy-900); font-size: clamp(3rem, 6vw, 5.8rem); line-height: .98; letter-spacing: -.055em; }
.hero h1 span { color: var(--green-600); }
.hero-copy > p { max-width: 650px; font-size: 1.14rem; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.button { appearance: none; display: inline-flex; justify-content: center; align-items: center; min-height: 46px; padding: 0 19px; border-radius: 12px; border: 1px solid transparent; font-weight: 700; font-size: .9rem; text-decoration: none; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button.primary { color: white; background: var(--green-600); box-shadow: 0 9px 24px rgba(62,155,122,.22); }
.button.primary:hover { background: var(--green-700); }
.button.secondary { color: var(--navy-800); background: white; border-color: #cfd9d6; }
.button.compact { min-height: 38px; padding-inline: 14px; color: var(--muted); background: var(--mint-50); border-color: var(--line); }
.button:disabled { cursor: not-allowed; opacity: .62; }
.button.full { width: 100%; }
.hero-card { min-height: 410px; padding: 30px; background: linear-gradient(145deg, var(--navy-900), var(--navy-800)); border-radius: 30px; color: white; box-shadow: 0 28px 70px rgba(20,40,78,.25); transform: rotate(1.5deg); }
.hero-card-head { display: flex; justify-content: space-between; align-items: center; color: #d8e3f7; }
.hero-card-head strong { color: var(--green-300); font-size: 1.35rem; }
.mini-chart { height: 220px; margin: 32px 0; display: flex; align-items: flex-end; gap: 12px; padding: 28px 18px 0; border-bottom: 1px solid rgba(255,255,255,.18); background: linear-gradient(to bottom, rgba(255,255,255,.03), transparent); border-radius: 18px; }
.mini-chart span { flex: 1; min-width: 16px; border-radius: 12px 12px 3px 3px; background: linear-gradient(to top, var(--green-600), var(--green-300)); }
.metric-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.metric-row div { display: flex; flex-direction: column; padding: 16px; background: rgba(255,255,255,.08); border-radius: 14px; }
.metric-row small { color: #c7d3e8; }
.metric-row b { font-size: 1.45rem; }

.principles { padding: 64px 0 100px; border-top: 1px solid var(--line); }
.principles > div:first-child { display: grid; grid-template-columns: 80px 1fr; align-items: start; }
.section-number { color: var(--green-700); font-weight: 700; font-size: .78rem; letter-spacing: .05em; }
.principles h2 { margin: 0; max-width: 680px; color: var(--navy-900); font-size: clamp(1.8rem, 3.2vw, 3rem); line-height: 1.14; }
.principle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 38px 0 0 80px; }
.principle-grid article { padding: 28px; border-radius: var(--radius); background: var(--mint-50); border: 1px solid var(--mint-100); }
.principle-grid h3 { margin-top: 0; color: var(--navy-800); }
.principle-grid p { margin-bottom: 0; color: var(--muted); }

.app-surface { background: #f5f8f7; }
.workspace { padding-block: 46px 80px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.page-heading h1 { margin: 8px 0 6px; color: var(--navy-900); font-size: clamp(2rem, 4vw, 3.25rem); letter-spacing: -.035em; }
.page-heading p { margin: 0; color: var(--muted); }
.environment-badge { padding: 9px 13px; border: 1px solid #b9decf; color: var(--green-700); background: var(--mint-100); border-radius: 999px; font-weight: 600; font-size: .78rem; white-space: nowrap; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metric-card { display: flex; flex-direction: column; min-height: 152px; padding: 22px; background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 26px rgba(20,40,78,.035); }
.metric-card small { color: var(--muted); }
.metric-card strong { margin: 7px 0; color: var(--navy-900); font-size: 2rem; letter-spacing: -.04em; }
.metric-card span { margin-top: auto; color: var(--green-700); font-size: .78rem; font-weight: 600; }
.metric-card.highlight { background: var(--navy-900); border-color: var(--navy-900); }
.metric-card.highlight small, .metric-card.highlight strong { color: white; }
.metric-card.highlight span { color: var(--green-300); }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; margin-top: 18px; }
.panel-card { background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 26px rgba(20,40,78,.035); }
.panel-card.wide { padding: 26px; }
.card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 22px; }
.card-heading h2, .panel-card h2 { margin: 0 0 4px; color: var(--navy-900); font-size: 1.2rem; }
.card-heading p { margin: 0; color: var(--muted); font-size: .88rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px; color: var(--muted); font-size: .76rem; text-align: left; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
td { padding: 15px 12px; border-bottom: 1px solid #eef2f0; font-size: .88rem; }
td strong, td small { display: block; }
td small { color: var(--muted); margin-top: 2px; }
.empty-cell { color: var(--muted); text-align: center; padding: 40px 16px; }
.status { display: inline-flex; padding: 5px 9px; border-radius: 999px; color: var(--navy-800); background: #edf1f7; font-size: .72rem; font-weight: 700; }
.status-open, .status-agreement { color: var(--green-700); background: var(--mint-100); }
.status-review { color: #9a4c2e; background: #fff0e8; }
.action-card { padding: 26px; background: linear-gradient(160deg, white 55%, var(--mint-50)); }
.action-card h2 { margin-top: 10px; font-size: 1.65rem; }
.action-card p { color: var(--muted); }
.action-card .button { margin-top: 18px; }
.text-link { display: inline-flex; margin-top: 20px; color: var(--green-700); font-weight: 700; font-size: .84rem; text-decoration: none; }

.template-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; align-items: start; }
.template-list { padding: 20px; }
.template-list h2 { margin: 4px 8px 16px; }
.template-item { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; padding: 13px; text-decoration: none; border-radius: 12px; border: 1px solid transparent; }
.template-item span { font-weight: 700; font-size: .88rem; }
.template-item small { color: var(--muted); font-size: .72rem; }
.template-item:hover, .template-item.active { background: var(--mint-50); border-color: var(--mint-100); color: var(--green-700); }
.template-editor { padding: 26px; min-width: 0; }
.editor-tabs { display: flex; gap: 7px; padding-bottom: 14px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { border: 0; background: transparent; color: var(--muted); padding: 9px 12px; font-weight: 700; font-size: .82rem; border-radius: 9px; cursor: pointer; white-space: nowrap; }
.tab.active { color: var(--green-700); background: var(--mint-100); }
.tab-panel { display: none; padding-top: 20px; }
.tab-panel.active { display: block; }
.subject-line { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; padding: 14px; background: #f8faf9; border: 1px solid var(--line); border-radius: 12px; }
.subject-line small { color: var(--muted); }
.email-preview { width: 100%; height: 620px; border: 1px solid var(--line); border-radius: 14px; background: #f1f3f5; }
.editor-form { display: grid; gap: 16px; }
.editor-form label, .access-form label { display: grid; gap: 7px; color: var(--navy-800); font-size: .82rem; font-weight: 700; }
input, textarea { width: 100%; border: 1px solid #cfd9d6; border-radius: 10px; padding: 11px 12px; color: var(--ink); background: white; }
textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .82rem; line-height: 1.55; }
input:focus, textarea:focus { outline: 3px solid rgba(62,155,122,.17); border-color: var(--green-600); }
.version-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.version-list li { display: flex; flex-direction: column; padding: 14px; background: #f8faf9; border: 1px solid var(--line); border-radius: 11px; }
.version-list span { color: var(--muted); font-size: .78rem; }
.notice { margin-bottom: 18px; padding: 13px 15px; border-radius: 11px; font-size: .86rem; font-weight: 600; }
.notice.success { color: var(--green-700); background: var(--mint-100); border: 1px solid #b9decf; }
.notice.error { color: #9a3f35; background: #fff0ed; border: 1px solid #f2c9c0; }

.portal-surface { background: radial-gradient(circle at 10% 0, var(--mint-100), transparent 34%), #f4f7f6; }
.portal-shell { min-height: calc(100vh - 150px); display: grid; place-items: center; padding: 48px 20px 70px; }
.portal-card { width: min(720px, 100%); padding: clamp(26px, 5vw, 48px); background: white; border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); }
.access-card { max-width: 520px; }
.security-mark { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 22px; border-radius: 16px; color: white; background: var(--green-600); font-size: 1.4rem; font-weight: 700; }
.portal-card h1 { margin: 8px 0 12px; color: var(--navy-900); font-size: clamp(2rem, 6vw, 3.25rem); line-height: 1.08; }
.portal-card > p { color: var(--muted); }
.access-form { display: grid; gap: 16px; margin-top: 24px; }
.demo-help { margin-top: 20px; color: var(--muted); font-size: .78rem; }
.demo-help summary { cursor: pointer; font-weight: 700; color: var(--navy-800); }
.proposal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.debt-summary { display: flex; flex-direction: column; margin: 26px 0; padding: 22px; color: white; background: var(--navy-900); border-radius: 18px; }
.debt-summary small, .debt-summary span { color: #c8d4e8; }
.debt-summary strong { margin: 5px 0; font-size: 2.15rem; }
.proposal-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.proposal-options article { padding: 20px; background: var(--mint-50); border: 1px solid var(--mint-100); border-radius: 16px; }
.proposal-options article:first-child { border: 2px solid var(--green-500); }
.proposal-options span { color: var(--green-700); font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.proposal-options h2 { margin: 6px 0; color: var(--navy-900); font-size: 1.1rem; }
.proposal-options p { min-height: 54px; color: var(--muted); font-size: .85rem; }
.privacy-note { margin-top: 20px; font-size: .76rem; }

.footer { min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px max(24px, calc((100vw - 1180px) / 2)); color: #6c778b; background: white; border-top: 1px solid var(--line); font-size: .75rem; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 42px; padding-block: 54px; }
  .hero-card { min-height: 360px; transform: none; }
  .principle-grid, .metric-grid { grid-template-columns: 1fr 1fr; }
  .content-grid { grid-template-columns: 1fr; }
  .template-layout { grid-template-columns: 1fr; }
  .template-list { display: flex; align-items: center; gap: 8px; overflow-x: auto; }
  .template-list h2 { display: none; }
  .template-item { min-width: 210px; }
}

@media (max-width: 640px) {
  .shell { width: min(100% - 28px, 1180px); }
  .topbar { height: 68px; padding-inline: 14px; }
  .brand img { width: 168px; height: 46px; }
  .menu-toggle { display: inline-flex; }
  .main-nav { display: none; position: absolute; top: 62px; right: 14px; flex-direction: column; align-items: stretch; width: min(280px, calc(100vw - 28px)); padding: 10px; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
  .main-nav.open { display: flex; }
  .hero { min-height: auto; padding-block: 42px 62px; }
  .hero h1 { font-size: clamp(2.8rem, 16vw, 4.4rem); }
  .hero-actions { display: grid; }
  .hero-card { padding: 22px; min-height: 330px; border-radius: 22px; }
  .mini-chart { height: 170px; padding-inline: 8px; gap: 8px; }
  .principles > div:first-child { grid-template-columns: 1fr; gap: 12px; }
  .principle-grid { grid-template-columns: 1fr; margin-left: 0; }
  .page-heading { flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 130px; padding: 17px; }
  .metric-card strong { font-size: 1.55rem; }
  .panel-card.wide, .template-editor { padding: 18px; }
  .proposal-head { flex-direction: column; }
  .proposal-options { grid-template-columns: 1fr; }
  .footer { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 430px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 118px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
