:root {
    color-scheme: light;
    --bg: #f5f3ee;
    --surface: #ffffff;
    --surface-soft: #fbfaf7;
    --surface-tint: #eef6f4;
    --footer-link-hover: #ffffff;
    --footer-link-hover-bg: #2b343d;
    --ink: #1c2024;
    --ink-soft: #3c434a;
    --muted: #687076;
    --line: #ddd8cf;
    --line-strong: #cbc3b6;
    --accent: #176b5d;
    --accent-dark: #0d433b;
    --accent-soft: #dcefeb;
    --blue: #275d8d;
    --blue-soft: #e6f0f8;
    --warn: #946100;
    --warn-soft: #fbf1dc;
    --danger: #a63a3a;
    --danger-soft: #f9e7e7;
    --shadow: 0 18px 48px rgba(28, 32, 36, .10);
    --shadow-soft: 0 8px 22px rgba(28, 32, 36, .07);
    --radius: 8px;
    --radius-sm: 6px;
    --page: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a {
    color: var(--accent-dark);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--accent);
}

code,
pre {
    font-family: Consolas, "Liberation Mono", monospace;
}

code {
    background: #f1eee8;
    border: 1px solid #e2ddd4;
    border-radius: 5px;
    color: #24313b;
    font-size: .92em;
    overflow-wrap: anywhere;
    padding: 1px 5px;
}

pre {
    background: #182027;
    border: 1px solid #101820;
    border-radius: var(--radius-sm);
    color: #f7fbff;
    line-height: 1.55;
    overflow-x: auto;
    padding: 16px;
}

pre code {
    background: transparent;
    border: 0;
    color: inherit;
    padding: 0;
}

h1,
h2,
h3 {
    color: var(--ink);
    line-height: 1.12;
    margin: 0;
}

h1 {
    font-size: 48px;
    letter-spacing: 0;
}

h2 {
    font-size: 27px;
    letter-spacing: 0;
}

h3 {
    font-size: 19px;
    letter-spacing: 0;
    margin-top: 20px;
}

p {
    margin: 0 0 12px;
}

p:last-child {
    margin-bottom: 0;
}

ul,
ol {
    padding-left: 22px;
}

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

.eyebrow {
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 750;
    letter-spacing: 0;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.site-header {
    align-items: center;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 24px;
    justify-content: space-between;
    padding: 16px clamp(18px, 4vw, 48px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand-block {
    display: grid;
    gap: 2px;
    min-width: 220px;
}

.brand {
    color: var(--ink);
    display: inline-flex;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.1;
    text-decoration: none;
}

.brand-block p {
    color: var(--muted);
    font-size: 14px;
    margin: 0;
}

nav,
.actions,
.badge-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.public-nav,
.app-nav {
    justify-content: flex-end;
}

nav a,
.button,
button {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    justify-content: center;
    min-height: 40px;
    padding: 8px 12px;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

nav a:hover,
.button:hover,
button:hover {
    background: #f1eee8;
    color: var(--ink);
}

nav a.active {
    background: var(--surface-tint);
    border-color: #c6ddd8;
    color: var(--accent-dark);
}

.button,
button {
    background: var(--surface);
    border-color: var(--line-strong);
    box-shadow: 0 1px 0 rgba(28, 32, 36, .04);
}

.button.primary,
button.primary,
.nav-cta {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.button.primary:hover,
button.primary:hover,
.nav-cta:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: #ffffff;
}

.public-nav .nav-cta.active {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: #ffffff;
}

.button.secondary {
    background: var(--surface);
    color: var(--ink);
}

.button.secondary:hover {
    background: #f1eee8;
}

.site-main {
    margin: 0 auto;
    max-width: var(--page);
    padding: 34px clamp(18px, 4vw, 48px) 74px;
}

.page-hero {
    align-items: center;
    display: grid;
    gap: 34px;
    grid-template-columns: minmax(0, 1fr) minmax(340px, .92fr);
    margin: 12px 0 38px;
    padding: 24px 0 12px;
}

.compact-hero {
    grid-template-columns: minmax(0, 760px);
}

.hero-copy {
    display: grid;
    gap: 16px;
}

.hero-copy h1 {
    max-width: 780px;
}

.hero-subtitle {
    color: var(--ink-soft);
    font-size: 20px;
    max-width: 720px;
}

.hero-visual {
    display: grid;
    gap: 14px;
}

.workflow-strip {
    align-items: stretch;
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr 26px 1fr 26px 1fr;
}

.workflow-node {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    display: grid;
    gap: 4px;
    min-height: 86px;
    padding: 14px;
}

.workflow-node span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    text-transform: uppercase;
}

.workflow-node strong {
    align-self: end;
    color: var(--ink);
    line-height: 1.2;
}

.accent-node {
    background: var(--surface-tint);
    border-color: #bfd8d2;
}

.workflow-arrow {
    align-self: center;
    background: var(--line-strong);
    height: 2px;
    position: relative;
}

.workflow-arrow::after {
    border-bottom: 5px solid transparent;
    border-left: 6px solid var(--line-strong);
    border-top: 5px solid transparent;
    content: "";
    position: absolute;
    right: -1px;
    top: -4px;
}

.receipt-preview {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: grid;
    gap: 16px;
    padding: 22px;
}

.receipt-preview h2 {
    font-size: 25px;
}

.receipt-preview-head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
}

.receipt-id {
    color: var(--muted);
    font-family: Consolas, "Liberation Mono", monospace;
    font-size: 13px;
}

.mini-timeline {
    border-left: 2px solid var(--line);
    color: var(--muted);
    margin: 0;
    padding-left: 22px;
}

.mini-timeline li {
    margin: 8px 0;
}

.section {
    margin: 0 0 30px;
}

.page-title,
.section-head {
    align-items: end;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.page-title p,
.section-head p {
    max-width: 720px;
}

.section-note {
    color: var(--muted);
    margin-bottom: 0;
}

.grid,
.card-grid {
    display: grid;
    gap: 16px;
}

.two-col {
    grid-template-columns: minmax(0, 1fr) minmax(300px, .72fr);
}

.docs-http-panels {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.docs-http-panels .panel {
    min-width: 0;
}

.wrap-code {
    overflow-x: visible;
    white-space: pre-wrap;
    word-break: break-word;
}

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

.four,
.story-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.story-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
}

.panel,
.stat,
.story-card,
.plan-card,
.auth-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 20px;
}

.panel,
.stat {
    margin-bottom: 18px;
}

.story-card,
.plan-card {
    display: grid;
    gap: 10px;
    margin-bottom: 0;
}

.story-card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
    text-transform: uppercase;
}

.story-card strong {
    color: var(--ink);
    display: block;
    font-size: 18px;
    line-height: 1.25;
}

.story-card p,
.plan-card p {
    color: var(--muted);
    margin: 0;
}

.plan-card h3 {
    margin-top: 0;
}

.faq-list {
    display: grid;
    gap: 14px;
}

.faq-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 20px;
}

.faq-item h2 {
    font-size: 22px;
    margin-bottom: 8px;
}

.faq-item p {
    color: var(--ink-soft);
}

.faq-item code {
    color: var(--accent-dark);
}

.price-placeholder {
    border-top: 1px solid var(--line);
    color: var(--ink) !important;
    font-weight: 800;
    padding-top: 12px;
}

.receipt-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.receipt-fields span {
    background: var(--surface-tint);
    border: 1px solid #c6ddd8;
    border-radius: 999px;
    color: var(--accent-dark);
    display: inline-flex;
    font-size: 14px;
    font-weight: 700;
    padding: 6px 10px;
}

.stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 24px;
}

.stat span {
    color: var(--muted);
    display: block;
    font-size: 14px;
}

.stat strong {
    display: block;
    font-size: 30px;
    margin-top: 8px;
}

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

table {
    background: var(--surface);
    border-collapse: collapse;
    width: 100%;
}

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

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

th {
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.badge {
    background: #eef2f2;
    border: 1px solid #d5dddd;
    border-radius: 999px;
    color: #36505c;
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    padding: 3px 9px;
}

.badge.neutral {
    background: var(--blue-soft);
    border-color: #c9dbe9;
    color: var(--blue);
}

.pending,
.needs-review,
.needs-changes,
.medium,
.unknown {
    background: var(--warn-soft);
    border-color: #ead8ad;
    color: var(--warn);
}

.failed,
.rejected,
.high {
    background: var(--danger-soft);
    border-color: #e6bcbc;
    color: var(--danger);
}

.approved,
.completed,
.low,
.not-required {
    background: var(--accent-soft);
    border-color: #c1ddd7;
    color: var(--accent-dark);
}

form {
    display: grid;
    gap: 14px;
}

.inline-form {
    display: inline-flex;
}

.inline-form button {
    min-height: 36px;
}

.form-grid,
.filters-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.filters-grid {
    grid-template-columns: repeat(4, minmax(160px, 1fr));
}

label {
    color: var(--ink-soft);
    display: grid;
    font-size: 14px;
    font-weight: 700;
    gap: 6px;
}

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

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(23, 107, 93, .14);
    outline: none;
}

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

.auth-wrap {
    display: grid;
    min-height: 62vh;
    place-items: center;
}

.auth-card {
    display: grid;
    gap: 18px;
    max-width: 460px;
    width: 100%;
}

.auth-card.wide {
    max-width: 720px;
}

.auth-intro {
    display: grid;
    gap: 8px;
}

.auth-intro p {
    color: var(--muted);
}

.auth-form {
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.auth-panel {
    max-width: 420px;
    width: 100%;
}

.docs-nav {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    display: flex;
    gap: 8px;
    margin: -4px 0 20px;
    overflow-x: auto;
    padding: 8px;
}

.docs-nav a {
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 750;
    padding: 8px 10px;
    text-decoration: none;
}

.docs-nav a.active,
.docs-nav a:hover {
    background: var(--surface-tint);
    color: var(--accent-dark);
}

.is-docs .site-main {
    max-width: 1040px;
}

.is-docs .panel {
    box-shadow: none;
}

.is-docs .page-title {
    border-bottom: 1px solid var(--line);
    padding-bottom: 18px;
}

.is-docs .page-title h1 {
    font-size: 38px;
}

.is-docs .panel h2 {
    margin-bottom: 10px;
}

.detail-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.detail-list div {
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
}

.detail-list div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.detail-list dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.detail-list dd {
    margin: 3px 0 0;
}

.timeline {
    border-left: 2px solid var(--line);
    list-style: none;
    margin: 16px 0 0;
    padding: 0 0 0 18px;
}

.timeline li {
    display: grid;
    gap: 12px;
    grid-template-columns: 54px minmax(0, 1fr);
    margin-bottom: 18px;
    position: relative;
}

.timeline li::before {
    background: var(--accent);
    border: 3px solid var(--surface);
    border-radius: 50%;
    content: "";
    height: 10px;
    left: -24px;
    position: absolute;
    top: 6px;
    width: 10px;
}

.timeline time {
    color: var(--muted);
    font-weight: 700;
}

.timeline p,
.note {
    margin: 4px 0 0;
}

.markdown-preview {
    min-height: 360px;
}

.flash,
.callout {
    border-radius: var(--radius);
}

.flash {
    border: 1px solid var(--line);
    margin-bottom: 18px;
    padding: 12px 14px;
}

.flash p {
    margin: 0 0 6px;
}

.flash p:last-child {
    margin-bottom: 0;
}

.flash.success {
    background: var(--accent-soft);
    border-color: #c1ddd7;
}

.flash.error {
    background: var(--danger-soft);
    border-color: #e6bcbc;
}

.callout {
    background: var(--surface-tint);
    border-color: #bfd8d2;
}

.site-footer {
    background: #20242a;
    color: #edf1f3;
    margin-top: 28px;
    padding: 36px clamp(18px, 4vw, 48px);
}

.footer-inner {
    display: grid;
    gap: 26px;
    grid-template-columns: minmax(240px, 1.3fr) repeat(3, minmax(150px, .6fr));
    margin: 0 auto;
    max-width: var(--page);
}

.site-footer .brand,
.site-footer a {
    color: #ffffff;
}

.footer-brand p {
    color: #b8c0c7;
    margin-top: 10px;
    max-width: 360px;
}

.footer-group {
    align-items: flex-start;
    display: grid;
    gap: 7px;
}

.footer-group h2 {
    color: #d8dee4;
    font-size: 13px;
    font-weight: 800;
    margin: 0 0 4px;
    text-transform: uppercase;
}

.footer-group a {
    align-items: center;
    justify-content: flex-start;
    background: transparent;
    border: 0;
    border-radius: 5px;
    color: #c7d0d8;
    display: inline-flex;
    font-size: 14px;
    font-weight: 500;
    min-height: 0;
    padding: 3px 6px;
    text-decoration: none;
    width: fit-content;
}

.footer-group a:hover,
.footer-group a:focus-visible {
    background: var(--footer-link-hover-bg);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .08);
    color: var(--footer-link-hover);
    outline: none;
}

@media (max-width: 980px) {
    .site-header,
    .page-title,
    .section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .public-nav,
    .app-nav {
        justify-content: flex-start;
    }

    .page-hero,
    .two-col,
    .docs-http-panels,
    .three,
    .four,
    .story-grid,
    .stats,
    .filters-grid,
    .footer-inner {
        grid-template-columns: 1fr;
    }

    .workflow-strip {
        grid-template-columns: 1fr;
    }

    .workflow-arrow {
        height: 22px;
        justify-self: center;
        width: 2px;
    }

    .workflow-arrow::after {
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-top: 6px solid var(--line-strong);
        bottom: -1px;
        left: -4px;
        right: auto;
        top: auto;
    }
}

@media (max-width: 640px) {
    h1 {
        font-size: 34px;
    }

    h2 {
        font-size: 24px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .site-main {
        padding-top: 24px;
    }

    .site-header {
        position: static;
    }

    nav a,
    .button,
    button {
        width: 100%;
    }

    .public-nav,
    .app-nav,
    .actions {
        align-items: stretch;
        width: 100%;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .timeline li {
        grid-template-columns: 1fr;
    }
}
