@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=Manrope:wght@400;500;600;700&display=swap');

:root {
    --canvas: #f8f6f1;
    --paper: #ffffff;
    --ink: #171716;
    --muted: #777570;
    --soft: #a29f98;
    --line: #e9e4db;
    --line-strong: #dcd6cc;
    --tint: #f1ede6;
    --tint-deep: #e9e3da;
    --green: #00a878;
    --green-bg: #e8fbf4;
    --error: #ad4f47;
    --error-bg: #fff0ee;
    --blue-input: #e9f1ff;
    --shadow: 0 24px 56px rgba(54, 46, 35, .075);
    --sans: "DM Sans", "Helvetica Neue", Arial, sans-serif;
    --display: "Manrope", "Helvetica Neue", Arial, sans-serif;
    --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--canvas); font-family: var(--sans); font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }

.wordmark { display: inline-flex; align-items: center; line-height: 0; }
.wordmark__image { display: block; width: 92px; height: auto; }
.eyebrow { margin: 0; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .065em; line-height: 1.2; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 0 21px; border: 1px solid transparent; border-radius: 999px; font-size: 13px; font-weight: 600; transition: transform .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease; }
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid rgba(0, 168, 120, .3); outline-offset: 3px; }
.button--dark { color: #fff; background: var(--ink); box-shadow: 0 8px 22px rgba(23, 23, 22, .12); }
.button--dark:hover:not(:disabled) { background: #33322e; box-shadow: 0 10px 28px rgba(23, 23, 22, .2); }
.button--dark:disabled { color: #aaa8a3; background: #d7d4ce; box-shadow: none; }
.button--small { min-height: 36px; padding: 0 15px; font-size: 12px; }
.button--wide { width: 100%; }
.helper-text { color: var(--soft); font-size: 12px; }
.text-link { color: var(--muted); font-size: 13px; transition: color .18s ease; }
.text-link:hover { color: var(--ink); }
.service-mark--stripe, .mini-service--stripe { color: #635bff; background: #eeecff; }
.service-mark--moloni, .mini-service--moloni { color: #342578; background: #eeecff; }

/* Marketing */
.page--home { position: relative; overflow-x: hidden; background: #f6f5ef; }
.page--home::before { position: fixed; z-index: -1; inset: 0; background: radial-gradient(circle at 82% 11%, rgba(184, 244, 222, .52), transparent 23rem), radial-gradient(circle at 3% 54%, rgba(226, 221, 255, .42), transparent 25rem); content: ""; pointer-events: none; }
.marketing-shell { width: min(100% - 48px, 1120px); margin: auto; }
.marketing-nav { display: flex; align-items: center; justify-content: space-between; height: 88px; border-bottom: 1px solid rgba(220, 214, 204, .85); }
.nav-actions { display: flex; align-items: center; gap: 25px; }

.hero { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(390px, .98fr); align-items: center; gap: clamp(36px, 6vw, 92px); min-height: 620px; padding: clamp(76px, 10vw, 132px) 0 clamp(68px, 8vw, 108px); }
.hero__copy { position: relative; z-index: 1; }

.hero h1 { max-width: 650px; margin: 21px 0 24px; font-family: var(--display); font-size: clamp(47px, 5.8vw, 78px); font-weight: 500; letter-spacing: -.078em; line-height: .98; }
.hero__accent { color: #747a73; }
.hero__lead { max-width: 525px; margin: 0; color: #5f625c; font-size: 16px; letter-spacing: -.022em; line-height: 1.58; }
.hero__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 21px; margin-top: 32px; }
.hero__secondary-link { display: inline-flex; align-items: center; gap: 8px; color: #4f554e; font-size: 13px; font-weight: 700; }
.hero__secondary-link span { color: var(--green); font-size: 17px; transition: transform .18s ease; }
.hero__secondary-link:hover span { transform: translateY(3px); }
.hero__microproof { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 30px; color: var(--soft); font-size: 11px; }
.hero__microproof span { display: inline-flex; align-items: center; gap: 6px; }
.hero__microproof b { display: grid; place-items: center; width: 14px; height: 14px; color: #168463; border-radius: 50%; background: #e0f7ed; font-size: 9px; }
.hero__visual { position: relative; min-width: 0; padding: 18px 13px 36px 0; }
.hero__glow { position: absolute; z-index: 0; border-radius: 50%; filter: blur(1px); }
.hero__glow--one { top: 3px; right: -31px; width: 192px; height: 192px; background: #cdf3e3; opacity: .8; }
.hero__glow--two { bottom: 15px; left: -35px; width: 140px; height: 140px; background: #dcd8ff; opacity: .67; }
.automation-window { position: relative; z-index: 1; overflow: hidden; border: 1px solid #e3e8e5; border-radius: 25px; color: #1d2420; background: rgba(255,255,255,.96); box-shadow: 0 32px 65px rgba(42, 54, 47, .16), inset 0 1px 0 #fff; transform: rotate(2.2deg); }
.automation-window::before { position: absolute; inset: 0; background: linear-gradient(130deg, rgba(235, 255, 246, .72), transparent 38%); content: ""; pointer-events: none; }
.automation-window__header { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 18px 21px; border-bottom: 1px solid #e9eeeb; color: #8b9690; font-size: 10px; }
.automation-status { display: inline-flex; align-items: center; gap: 7px; color: #35453e; font-weight: 700; }
.automation-status i { width: 6px; height: 6px; border-radius: 50%; background: #57d9a8; box-shadow: 0 0 0 4px rgba(87,217,168,.12); }
.automation-window__body { position: relative; display: grid; gap: 13px; padding: 21px; }
.event-card, .document-card { border: 1px solid #e4e9e6; border-radius: 15px; background: #fbfcfb; }
.event-card { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 13px; }
.event-card__service { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; font-size: 14px; font-weight: 800; }
.event-card__service img, .process-step__mark img { display: block; width: 18px; height: 18px; object-fit: contain; }
.event-card__service--stripe, .process-step__mark--stripe { color: #8d87ff; background: rgba(132, 122, 255, .17); }
.event-card__service--moloni, .process-step__mark--moloni { color: #ff948c; background: rgba(255, 125, 112, .14); }
.event-card strong, .document-card strong { display: block; font-size: 11px; letter-spacing: -.02em; }
.event-card code { display: block; max-width: 160px; overflow: hidden; margin-top: 3px; color: #929a95; font-family: var(--mono); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.event-card > b { color: #27322d; font-size: 11px; }
.workflow-line { position: relative; display: flex; align-items: center; gap: 9px; height: 19px; padding-left: 30px; color: #87918b; font-family: var(--mono); font-size: 8px; }
.workflow-line::before { width: 1px; height: 18px; margin-left: 3px; background: #cbd5d0; content: ""; }
.workflow-line i { position: absolute; top: 6px; left: 31px; width: 7px; height: 7px; border-radius: 50%; background: #55d5a5; box-shadow: 0 0 0 3px rgba(85,213,165,.13); }
.document-card { padding: 14px; background: #fff; }
.document-card__top { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; }
.document-card small { display: block; margin-top: 3px; color: #929b96; font-size: 9px; }
.document-card em { padding: 4px 7px; border-radius: 999px; color: #168260; background: #e4f8ef; font-size: 8px; font-style: normal; font-weight: 700; }
.document-card__details { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; padding-top: 11px; border-top: 1px solid #edf0ee; }
.document-card__details span { color: #8a958f; font-size: 8px; }
.document-card__details span::before { margin-right: 4px; color: #29ad7e; content: "✓"; }
.automation-window__footer { position: relative; display: grid; grid-template-columns: auto auto 1fr; column-gap: 8px; align-items: baseline; padding: 15px 21px 18px; color: #78837d; border-top: 1px solid #e9eeeb; font-size: 9px; }
.automation-window__footer strong { color: #202923; font-family: var(--display); font-size: 22px; font-weight: 500; letter-spacing: -.07em; }
.automation-window__footer small { color: #939c97; font-size: 9px; }
.automation-window__footer div { grid-column: 1 / -1; height: 4px; margin-top: 11px; overflow: hidden; border-radius: 999px; background: #e3eae6; }
.automation-window__footer i { display: block; width: 68%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #59d9aa, #a1ead0); }
.hero__floating-note { position: absolute; z-index: 2; right: -20px; bottom: 1px; display: flex; align-items: center; gap: 9px; padding: 11px 13px; border: 1px solid rgba(216, 230, 224, .9); border-radius: 14px; background: rgba(255,255,255,.94); box-shadow: 0 15px 30px rgba(41,57,49,.12); transform: rotate(-2.8deg); }
.hero__floating-note > span { display: grid; place-items: center; width: 23px; height: 23px; color: #fff; border-radius: 50%; background: var(--green); font-size: 10px; font-weight: 800; }
.hero__floating-note p { margin: 0; }
.hero__floating-note strong, .hero__floating-note small { display: block; white-space: nowrap; }
.hero__floating-note strong { font-size: 10px; }
.hero__floating-note small { margin-top: 2px; color: var(--soft); font-size: 8px; }
.proof-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0 0 clamp(98px, 12vw, 148px); border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.proof-strip article { display: flex; align-items: center; gap: 13px; min-height: 107px; padding: 20px; }
.proof-strip article + article { border-left: 1px solid var(--line-strong); }
.proof-strip > article > span { color: #9ccfbf; font-family: var(--mono); font-size: 10px; }
.proof-strip p { margin: 0; }
.proof-strip strong, .proof-strip small { display: block; }
.proof-strip strong { font-size: 12px; letter-spacing: -.02em; }
.proof-strip small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.process-section { padding-bottom: 104px; }
.process-section__heading { display: flex; align-items: end; justify-content: space-between; gap: 35px; margin-bottom: 31px; }
.process-section h2 { max-width: 670px; margin: 10px 0 0; font-family: var(--display); font-size: clamp(30px, 4vw, 47px); font-weight: 500; letter-spacing: -.07em; line-height: 1.02; }
.process-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.process-step { position: relative; min-height: 241px; padding: 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.68); }
.process-step::after { position: absolute; right: -33px; bottom: -37px; width: 115px; height: 115px; border: 1px solid #dce8e2; border-radius: 50%; content: ""; }
.process-step__number { position: absolute; top: 23px; right: 23px; color: #d8d5ce; font-family: var(--mono); font-size: 10px; }
.process-step__mark { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 11px; font-size: 14px; font-weight: 800; }
.process-step__mark--kapta { color: #078961; background: #def8ec; }
.process-step h3 { margin: 48px 0 8px; font-family: var(--display); font-size: 18px; font-weight: 600; letter-spacing: -.05em; }
.process-step p { max-width: 210px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 0 0 94px; }
.feature-card { min-height: 274px; padding: 27px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.75); transition: transform .2s ease, box-shadow .2s ease; }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature-card h2 { margin: 62px 0 15px; font-family: var(--display); font-size: 24px; font-weight: 500; letter-spacing: -.06em; line-height: 1.04; }
.feature-card > p:last-child { max-width: 220px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.feature-card--dark { color: var(--ink); border-color: var(--line); background: #fff; }
.feature-card--dark .eyebrow, .feature-card--dark > p:last-child { color: var(--muted); }
.marketing-cta { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 85px; padding: clamp(29px, 5vw, 48px); overflow: hidden; border-radius: 25px; color: #fff; background: #0e7355; background-image: radial-gradient(circle at 84% 13%, rgba(185,255,224,.26), transparent 10rem); }
.marketing-cta h2 { max-width: 570px; margin: 10px 0 0; font-family: var(--display); font-size: clamp(27px, 3.5vw, 42px); font-weight: 500; letter-spacing: -.065em; line-height: 1.04; }
.marketing-cta .eyebrow { color: #b5e1d1; }
.button--light { flex: 0 0 auto; color: #145841; background: #fff; box-shadow: 0 10px 24px rgba(0,0,0,.12); }
.button--light:hover:not(:disabled) { color: #0d4431; background: #eafff5; }
.site-footer, .app-footer { display: flex; justify-content: center; gap: 16px; padding: 22px; border-top: 1px solid var(--line); color: var(--soft); font-size: 11px; }
.site-footer a:hover, .app-footer a:hover { color: var(--ink); }

/* Authentication */
.auth-layout { display: flex; flex-direction: column; min-height: 100vh; }
.auth-header { display: flex; justify-content: space-between; align-items: center; width: min(100% - 48px, 920px); height: 98px; margin: 0 auto; }
.language-select { position: relative; z-index: 4; }
.language-select summary { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 999px; color: #484d49; background: var(--paper); cursor: pointer; font-size: 11px; font-weight: 700; list-style: none; box-shadow: 0 2px 3px rgba(0,0,0,.03); transition: border-color .18s ease, box-shadow .18s ease; }
.language-select summary::-webkit-details-marker { display: none; }
.language-select summary span { color: var(--soft); font-size: 12px; transition: transform .18s ease; }
.language-select[open] summary { border-color: #9ad6bd; box-shadow: 0 0 0 3px rgba(0,168,120,.11); }
.language-select[open] summary span { transform: rotate(180deg); }
.language-select__options { position: absolute; top: calc(100% + 8px); right: 0; display: grid; width: 154px; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 16px 30px rgba(42,49,45,.12); }
.language-select__options a { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border-radius: 8px; color: var(--muted); font-family: var(--mono); font-size: 10px; }
.language-select__options a span { font-family: var(--sans); font-size: 11px; }
.language-select__options a:hover, .language-select__options a.is-active { color: #176b50; background: #eaf9f2; }
.language-select__options a.is-active::after { width: 5px; height: 5px; margin-left: auto; border-radius: 50%; background: var(--green); content: ""; }
.auth-card { width: min(100% - 40px, 466px); margin: auto; padding: 38px 36px 31px; border: 1px solid var(--line); border-radius: 25px; background: rgba(255,255,255,.94); box-shadow: 0 28px 55px rgba(61, 53, 42, .1); }
.auth-card h1 { margin: 12px 0 6px; font-family: var(--display); font-size: 38px; font-weight: 400; letter-spacing: -.075em; line-height: 1.05; }
.auth-card__intro { margin: 0 0 25px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.form { display: grid; gap: 17px; }
.form label, .integration-form label { display: grid; gap: 7px; color: #66635e; font-size: 10px; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
.form input, .integration-form input, .integration-form select { width: 100%; height: 45px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 13px; outline: none; color: var(--ink); background: #fff; font-size: 13px; font-weight: 500; letter-spacing: normal; text-transform: none; transition: border .18s ease, background .18s ease, box-shadow .18s ease; }
.form input::placeholder, .integration-form input::placeholder { color: #aeaba5; font-weight: 400; }
.form input:focus, .integration-form input:focus, .integration-form select:focus { border-color: #a2b7db; background: var(--blue-input); box-shadow: 0 0 0 3px rgba(162,183,219,.22); }
.form input:invalid:not(:placeholder-shown) { border-color: #d78980; }
.field-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.field-note { color: var(--soft); font-size: 10px; font-weight: 500; letter-spacing: 0; line-height: 1.35; text-transform: none; }
.field-note--warning { margin: -4px 0 0; padding: 9px 10px; border-left: 2px solid #d6a456; color: #78603b; background: #fff9ee; }
.field-note--warning code { font-family: var(--mono); font-size: 9px; }
.password-recovery { justify-self: end; margin-top: -9px; color: #4f6159; font-size: 11px; font-weight: 700; letter-spacing: 0; text-decoration: underline; text-decoration-color: #a8cabc; text-underline-offset: 3px; text-transform: none; }
.password-recovery:hover { color: #147558; }
.checkbox { grid-template-columns: 16px 1fr; align-items: start; gap: 9px !important; color: var(--muted) !important; font-size: 11px !important; font-weight: 400 !important; letter-spacing: 0 !important; line-height: 1.45; text-transform: none !important; }
.checkbox input { appearance: none; width: 16px !important; height: 16px !important; margin: 0; padding: 0 !important; border-radius: 5px !important; background: #fff; }
.checkbox input:checked { border-color: var(--ink); background: var(--ink); box-shadow: inset 0 0 0 4px #fff; }
.checkbox a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.auth-card__switch { margin: 24px 0 0; color: var(--muted); text-align: center; font-size: 12px; }
.auth-card__switch a { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.auth-footer { display: flex; justify-content: center; gap: 12px; padding: 32px 22px 21px; color: var(--soft); font-size: 11px; }
.auth-footer i { font-style: normal; }
.flash { margin-bottom: 20px; padding: 11px 13px; border-radius: 11px; font-size: 12px; line-height: 1.4; }
.flash--success { border: 1px solid #9ee6ca; color: #087b59; background: var(--green-bg); }
.flash--error { border: 1px solid #f0c3bf; color: var(--error); background: var(--error-bg); }

/* App shell */
.app-header { position: sticky; z-index: 10; top: 0; border-bottom: 1px solid var(--line); background: rgba(248,246,241,.91); backdrop-filter: blur(16px); }
.app-header__inner { display: flex; align-items: center; justify-content: space-between; width: min(100% - 48px, 1090px); height: 94px; margin: auto; }
.app-nav { display: flex; align-items: center; gap: 8px; }
.app-nav a { display: inline-flex; align-items: center; gap: 6px; min-height: 31px; padding: 0 12px; border-radius: 999px; color: var(--muted); font-size: 12px; transition: color .18s ease, background .18s ease; }
.app-nav a:hover { color: var(--ink); }
.app-nav a.is-active { color: #fff; background: var(--ink); }
.app-nav b { display: grid; place-items: center; width: 15px; height: 15px; color: var(--ink); border-radius: 50%; background: #fff; font-size: 9px; }
.account-menu { position: relative; display: flex; align-items: center; gap: 11px; }
.status-dot { display: flex; align-items: center; gap: 5px; color: #078660; font-size: 10px; font-weight: 700; }
.status-dot i, .connection-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.account-trigger { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 4px; border: 1px solid var(--line-strong); border-radius: 999px; color: #494743; background: #fff; font-size: 11px; font-weight: 600; }
.avatar { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; background: var(--ink); font-size: 10px; }
.account-popover { position: absolute; z-index: 3; top: 43px; right: 0; min-width: 188px; padding: 8px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow); }
.account-popover span { display: block; padding: 7px 9px; overflow: hidden; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.account-popover form { margin: 0; }
.account-popover button { width: 100%; margin-top: 3px; padding: 7px 9px; border: 0; border-radius: 8px; color: var(--error); background: transparent; text-align: left; font-size: 11px; }
.account-popover button:hover { background: var(--error-bg); }
.account-popover .account-popover__switch { color: var(--ink); }
.account-popover .account-popover__switch:hover { background: #f2f1ed; }
.app-main { width: min(100% - 48px, 876px); min-height: calc(100vh - 158px); margin: 0 auto; padding: 73px 0 80px; }
.flash--app { margin-bottom: 25px; }
.page-heading { margin-bottom: 44px; }
.page-heading h1 { margin: 18px 0 12px; font-family: var(--display); font-size: clamp(38px, 5vw, 59px); font-weight: 400; letter-spacing: -.07em; line-height: .98; }
.page-heading > p:last-child { max-width: 510px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.page-heading--onboarding { margin-bottom: 33px; }
.page-heading--onboarding h1 { max-width: 680px; }

/* Dashboard */
.setup-banner { display: flex; align-items: center; gap: 16px; margin: 0 0 46px; padding: 22px 23px; border: 1px solid #eae1d7; border-radius: 23px; background: #f1ece5; }
.setup-banner__icon { display: grid; flex: 0 0 auto; place-items: center; width: 32px; height: 32px; border: 1px solid #efc7c1; border-radius: 50%; color: #dc675d; background: #fff8f7; font-size: 18px; }
.setup-banner > div { flex: 1; }
.setup-banner h2 { margin: 5px 0 3px; font-size: 16px; letter-spacing: -.03em; }
.setup-banner p:last-child { margin: 0; color: var(--muted); font-size: 12px; }
.setup-banner--success { border-color: #ccebdd; background: #effaf5; }
.setup-banner--success .setup-banner__icon { color: #fff; border-color: var(--green); background: var(--green); font-size: 13px; }
.text-arrow { color: var(--ink); white-space: nowrap; font-size: 12px; font-weight: 700; }
.metrics-card { padding: 23px; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.section-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.period-picker { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: #faf9f7; }
.period-picker button { min-width: 44px; height: 22px; padding: 0 6px; border: 0; border-radius: 999px; color: var(--muted); background: transparent; font-size: 10px; }
.period-picker button.is-active { color: #fff; background: var(--ink); }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.metrics-grid article { min-height: 107px; padding: 16px 13px; border: 1px solid var(--line); border-radius: 14px; background: #fdfcfb; }
.metrics-grid p { margin: 0; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .045em; }
.metrics-grid strong { display: block; margin: 8px 0 5px; font-family: var(--display); font-size: 27px; font-weight: 500; letter-spacing: -.07em; line-height: 1; }
.metrics-grid small { color: var(--soft); font-size: 9px; }
.connection-card { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 46px 0 48px; padding: 17px 19px; border: 1px solid var(--line); border-radius: 23px; background: var(--tint); box-shadow: 0 20px 37px rgba(56,45,28,.045); }
.connection-card article { min-height: 90px; padding: 17px; border-radius: 15px; background: rgba(255,255,255,.88); }
.connection-card article > div { display: flex; align-items: center; gap: 8px; margin: 11px 0 7px; }
.connection-card strong { display: block; margin: 11px 0 7px; font-size: 16px; letter-spacing: -.04em; }
.connection-card article > div strong { margin: 0; }
.mini-service { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; font-size: 11px; font-weight: 700; }
.mini-service img { display: block; width: 17px; height: 17px; border-radius: 5px; }
.connection-status { display: flex; align-items: center; gap: 5px; color: var(--soft); font-size: 10px; }
.connection-status i { background: #bbb8b1; }
.connection-status.is-connected { color: #0b8d67; }
.connection-status.is-connected i { background: var(--green); }
.documents-section { margin: 0 0 48px; }
.section-heading--documents { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.section-heading--documents > span { padding-bottom: 5px; color: var(--soft); font-size: 11px; }
.document-list { overflow: hidden; border: 1px solid var(--line); border-radius: 21px; background: #fff; box-shadow: 0 16px 35px rgba(56,45,28,.04); }
.document-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto minmax(96px, auto) 16px; align-items: center; gap: 13px; min-height: 74px; padding: 12px 17px; transition: background .18s ease; }
.document-row + .document-row { border-top: 1px solid var(--line); }
.document-row:hover { background: #f8fcfa; }
.document-row__icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 10px; color: #2c8265; background: #e6f8f0; font-family: var(--mono); font-size: 10px; font-weight: 700; }
.document-row__icon.is-credit { color: #7052a5; background: #f0ebff; }
.document-row__main { min-width: 0; }
.document-row__main strong, .document-row__main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-row__main strong { font-size: 12px; letter-spacing: -.02em; }
.document-row__main small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.document-status { display: inline-flex; align-items: center; justify-content: center; min-height: 22px; padding: 0 8px; border-radius: 999px; color: #167b5d; background: #e5f8ef; font-size: 9px; font-weight: 700; white-space: nowrap; }
.document-status--processing { color: #8c6a19; background: #fff6dd; }
.document-status--failed { color: #a84e48; background: #fff0ee; }
.document-status--draft { color: #69736e; background: #eff1f0; }
.document-row__amount { color: #323a35; text-align: right; font-size: 12px; font-weight: 700; white-space: nowrap; }
.document-row__arrow { color: #a3aaa6; font-size: 15px; transition: transform .18s ease, color .18s ease; }
.document-row:hover .document-row__arrow { color: #137657; transform: translateX(3px); }
.documents-empty { padding: 28px; border: 1px dashed var(--line-strong); border-radius: 18px; color: var(--muted); text-align: center; }
.documents-empty strong { display: block; color: var(--ink); font-size: 13px; }
.documents-empty p { margin: 6px 0 0; font-size: 11px; }

/* Document detail */
.document-heading { margin-bottom: 34px; }
.back-link { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 24px; color: #4c6258; font-size: 12px; font-weight: 700; }
.back-link:hover { color: #147457; }
.document-heading__content { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.document-heading h1 { margin: 12px 0 8px; font-family: var(--display); font-size: clamp(38px, 5vw, 58px); font-weight: 500; letter-spacing: -.075em; line-height: .98; }
.document-heading__content > div:first-child > p:last-child { max-width: 510px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.document-heading__amount { display: grid; justify-items: end; gap: 10px; padding-bottom: 3px; }
.document-heading__amount strong { font-family: var(--display); font-size: 27px; font-weight: 500; letter-spacing: -.065em; white-space: nowrap; }
.document-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 16px; }
.detail-card { padding: 21px; border: 1px solid var(--line); border-radius: 21px; background: #fff; box-shadow: 0 14px 33px rgba(56,45,28,.04); }
.detail-card__header { display: flex; align-items: center; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.detail-card__header > div { flex: 1; }
.detail-card__header h2 { margin: 4px 0 0; font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -.055em; }
.detail-card__state { padding: 4px 7px; border-radius: 999px; color: #197b5d; background: #e5f8ef; font-size: 9px; font-weight: 700; }
.detail-card__state--moloni { color: #58448d; background: #eeeaff; }
.detail-list { display: grid; gap: 0; margin: 7px 0 0; }
.detail-list div { display: grid; grid-template-columns: minmax(104px, .8fr) minmax(0, 1.2fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid #f0efec; }
.detail-list div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--soft); font-size: 10px; }
.detail-list dd { min-width: 0; margin: 0; overflow: hidden; color: #414842; font-size: 10px; font-weight: 600; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.detail-list code { color: #496e5e; font-family: var(--mono); font-size: 9px; }
.document-permalink { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); align-items: center; gap: 25px; margin-bottom: 48px; padding: 23px; border: 1px solid #ccebdd; border-radius: 21px; background: #f1fbf6; }
.document-permalink h2 { margin: 8px 0 4px; font-family: var(--display); font-size: 23px; font-weight: 500; letter-spacing: -.06em; }
.document-permalink p:last-child { margin: 0; color: #61927f; font-size: 11px; line-height: 1.45; }
.document-permalink__url { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid #cfe4da; border-radius: 12px; background: #fff; }
.document-permalink__url a { display: block; min-width: 0; overflow: hidden; color: inherit; text-decoration: none; }
.document-permalink__url a:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 3px; }
.document-permalink__url code { display: block; min-width: 0; overflow: hidden; color: #36765e; font-family: var(--mono); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.document-permalink__url button { min-height: 26px; padding: 0 9px; border: 1px solid #cfe1d9; border-radius: 999px; color: #237157; background: #fff; font-size: 10px; font-weight: 700; }
.document-permalink__url button:hover { border-color: var(--green); background: var(--green-bg); }
.document-timeline { margin-bottom: 52px; }
.document-timeline .section-heading { margin-bottom: 18px; }
.document-timeline ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0; padding: 0; list-style: none; }
.document-timeline li { position: relative; display: flex; gap: 10px; min-height: 94px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.76); }
.document-timeline li > span { display: grid; place-items: center; flex: 0 0 auto; width: 22px; height: 22px; color: #fff; border-radius: 50%; background: var(--green); font-size: 9px; font-weight: 700; }
.document-timeline strong { display: block; font-size: 11px; line-height: 1.35; }
.document-timeline p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.next-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.next-grid--single .shortcut-card { grid-column: 1 / -1; min-height: 184px; }
.section-heading { grid-column: 1 / -1; margin-bottom: 2px; }
.section-heading h2 { margin: 9px 0 4px; font-family: var(--display); font-size: 28px; font-weight: 400; letter-spacing: -.065em; }
.shortcut-card { position: relative; min-height: 209px; padding: 24px; border: 1px solid var(--line); border-radius: 22px; background: #fff; transition: transform .18s ease, box-shadow .18s ease; }
.shortcut-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.shortcut-card__number { position: absolute; top: 21px; right: 22px; color: var(--line-strong); font-family: var(--display); font-size: 24px; }
.shortcut-card h3 { margin: 9px 0 8px; font-size: 16px; letter-spacing: -.035em; }
.shortcut-card > p:not(.eyebrow) { max-width: 260px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.shortcut-card > span:last-child { position: absolute; bottom: 22px; color: var(--soft); font-size: 11px; }
.app-footer { border-top: 1px solid var(--line); }

/* Onboarding */
.progress-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 580px; margin: 0 0 37px; padding: 0; list-style: none; }
.progress-steps li { position: relative; display: flex; align-items: center; gap: 8px; color: var(--soft); font-size: 11px; }
.progress-steps li:not(:last-child)::after { position: absolute; top: 13px; right: -12px; width: 20px; height: 1px; background: var(--line-strong); content: ""; }
.progress-steps span { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--canvas); font-size: 11px; }
.progress-steps .is-done, .progress-steps .is-current { color: var(--ink); }
.progress-steps .is-done span { color: #fff; border-color: var(--green); background: var(--green); }
.progress-steps .is-current span { color: #fff; border-color: var(--ink); background: var(--ink); }
.progress-steps .is-done:not(:last-child)::after { background: var(--green); }
.setup-grid { display: grid; gap: 19px; }
.setup-card { position: relative; padding: 29px 31px 30px; border: 1px solid var(--line); border-radius: 25px; background: rgba(255,255,255,.88); box-shadow: 0 17px 45px rgba(61,53,42,.045); }
.setup-card.is-complete { border-color: #b8e6d4; background: #fbfffd; }
.setup-card.is-locked::before { position: absolute; z-index: 1; top: 0; right: 0; bottom: 0; left: 0; border-radius: inherit; background: rgba(248,246,241,.26); content: ""; pointer-events: none; }
.setup-card__head { display: flex; align-items: center; gap: 13px; }
.service-mark { display: grid; place-items: center; flex: 0 0 auto; width: 39px; height: 39px; border-radius: 12px; font-size: 17px; font-weight: 700; }
.service-mark img { display: block; width: 24px; height: 24px; border-radius: 7px; }
.setup-card__head .eyebrow { margin-bottom: 3px; }
.setup-card h2 { margin: 0; font-family: var(--display); font-size: 21px; font-weight: 500; letter-spacing: -.055em; }
.complete-mark { margin-left: auto; padding: 6px 9px; border: 1px solid #a7ead0; border-radius: 999px; color: #087e5a; background: var(--green-bg); font-size: 10px; font-weight: 700; }
.setup-card__description { max-width: 640px; margin: 24px 0 17px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.setup-card__description strong { color: var(--ink); }
.instruction-list { margin: 0 0 20px; border: 1px solid var(--line); border-radius: 13px; background: #fcfbf9; }
.instruction-list--moloni { max-width: 640px; margin-right: auto; margin-left: auto; }
.instruction-list summary { display: flex; justify-content: space-between; padding: 13px 14px; color: #4e4c47; cursor: pointer; font-size: 12px; font-weight: 700; list-style: none; }
.instruction-list summary::-webkit-details-marker { display: none; }
.instruction-list[open] summary { border-bottom: 1px solid var(--line); }
.instruction-list ol { margin: 0; padding: 12px 18px 14px 32px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.instruction-list a { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.instruction-list code { padding: 1px 4px; border-radius: 3px; color: #55514a; background: #eeeae3; font-family: var(--mono); font-size: 10px; }
.instruction-list em { color: #55514a; font-style: normal; font-weight: 600; }
.integration-form { display: grid; gap: 16px; max-width: 640px; }
.integration-form--centered { margin-right: auto; margin-left: auto; }
.integration-form label > a { justify-self: start; margin-top: 1px; color: var(--ink); font-size: 10px; letter-spacing: 0; text-decoration: underline; text-underline-offset: 3px; text-transform: none; }
.integration-form select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #777 50%), linear-gradient(135deg, #777 50%, transparent 50%); background-position: calc(100% - 17px) 19px, calc(100% - 13px) 19px; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; }
.integration-form input:disabled, .integration-form select:disabled { color: #aaa7a1; background: #efede8; }
.documentation-callout { margin: 0 0 20px; padding: 11px 13px; border-left: 2px solid var(--green); color: var(--muted); background: #f4faf7; font-size: 11px; line-height: 1.5; }
.documentation-callout a { color: #147457; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.webhook-url { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; margin: 0 0 18px; padding: 10px 12px; border: 1px solid #dce9e3; border-radius: 12px; background: #f7fbf9; }
.webhook-url--connected { margin: 10px 0 0; }
.webhook-url span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
.webhook-url code { min-width: 0; overflow: hidden; color: #38745f; font-family: var(--mono); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.webhook-url button { min-height: 24px; padding: 0 8px; border: 1px solid #cfe1d9; border-radius: 999px; color: #237157; background: #fff; font-size: 10px; font-weight: 700; }
.webhook-url button:hover { border-color: var(--green); background: var(--green-bg); }
.connected-state { display: flex; align-items: center; gap: 13px; margin-top: 24px; padding: 17px; border: 1px solid #c9eddc; border-radius: 14px; background: #f0fbf5; }
.connected-state__icon { display: grid; place-items: center; flex: 0 0 auto; width: 25px; height: 25px; color: #fff; border-radius: 50%; background: var(--green); font-size: 11px; font-weight: 700; }
.connected-state div { flex: 1; }
.connected-state strong { font-size: 12px; }
.connected-state p { margin: 3px 0 0; color: #59977f; font-family: var(--mono); font-size: 10px; }
.connected-state a { color: #127356; font-size: 11px; font-weight: 700; white-space: nowrap; }
.connection-update { margin-top: 15px; border: 1px solid #dce9e2; border-radius: 14px; background: #fff; }
.connection-update summary { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; color: #28715a; cursor: pointer; font-size: 11px; font-weight: 700; list-style: none; }
.connection-update summary::-webkit-details-marker { display: none; }
.connection-update[open] summary { border-bottom: 1px solid #e4eee8; }
.connection-update__content { padding: 16px 15px 17px; }
.connection-update__content > p { max-width: 620px; margin: 0 0 16px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.connection-update__content .integration-form { max-width: 640px; }
.moloni-import-summary { display: grid; gap: 5px; max-width: 640px; margin: 24px auto 17px; padding: 16px 17px; border: 1px solid #cdeadc; border-radius: 14px; background: #f1fbf6; }
.moloni-import-summary .eyebrow { margin: 0; color: #387b62; }
.moloni-import-summary strong { color: #236049; font-size: 13px; }
.moloni-import-summary span { color: #5e8e7b; font-size: 11px; line-height: 1.45; }
.moloni-import-reset { max-width: 640px; margin: 12px auto 0; }
.moloni-import-reset button { padding: 0; border: 0; color: #5c7469; background: transparent; font-size: 10px; text-decoration: underline; text-underline-offset: 3px; }
.moloni-import-reset button:hover { color: #147457; }

@media (max-width: 760px) {
    .marketing-shell, .app-header__inner, .app-main { width: min(100% - 32px, 876px); }
    .marketing-nav { height: 76px; }
    .marketing-nav .text-link { display: none; }
    .hero { padding: 86px 0 55px; }
    .hero h1 { font-size: clamp(42px, 13vw, 65px); }
    .hero__lead { font-size: 15px; }
    .integration-strip { grid-template-columns: 1fr; gap: 6px; }
    .integration-strip article { min-height: 65px; }
    .connector { display: none; }
    .feature-grid { grid-template-columns: 1fr; padding: 55px 0; }
    .feature-card { min-height: 205px; }
    .feature-card h2 { margin-top: 39px; }
    .auth-header { width: min(100% - 32px, 920px); height: 80px; }
    .wordmark__image { width: 82px; }
    .auth-card { width: min(100% - 32px, 466px); padding: 29px 23px 25px; }
    .field-row { grid-template-columns: 1fr; }
    .app-header__inner { height: 72px; }
    .app-nav { position: absolute; top: 72px; right: 0; left: 0; justify-content: center; padding: 10px 12px; border-bottom: 1px solid var(--line); background: rgba(248,246,241,.97); }
    .app-nav a { padding: 0 8px; font-size: 11px; }
    .status-dot { display: none; }
    .account-trigger > span:nth-child(2), .account-trigger > span:last-child { display: none; }
    .account-trigger { padding: 3px; border: 0; background: transparent; }
    .app-main { padding-top: 104px; }
    .page-heading { margin-bottom: 34px; }
    .page-heading h1 { font-size: 42px; }
    .setup-banner { align-items: flex-start; flex-wrap: wrap; padding: 18px; }
    .setup-banner .button, .setup-banner .text-arrow { margin-left: 48px; }
    .metrics-grid { grid-template-columns: 1fr 1fr; }
    .connection-card { grid-template-columns: 1fr; }
    .next-grid { grid-template-columns: 1fr; }
    .progress-steps { gap: 7px; }
    .progress-steps strong { font-size: 10px; }
    .progress-steps li:not(:last-child)::after { right: -3px; width: 9px; }
    .setup-card { padding: 23px 19px; }
    .setup-card__description { margin-top: 20px; }
    .complete-mark { padding: 5px 7px; font-size: 9px; }
    .webhook-url { grid-template-columns: 1fr auto; }
    .webhook-url span { grid-column: 1 / -1; }
    .connected-state { align-items: flex-start; flex-wrap: wrap; }
    .connected-state a { width: 100%; padding-left: 38px; }


    .hero { grid-template-columns: 1fr; gap: 54px; min-height: 0; padding: 74px 0 58px; }
    .hero h1 { max-width: 620px; margin-top: 18px; font-size: clamp(44px, 12.5vw, 67px); }
    .hero__lead { max-width: 545px; font-size: 15px; }
    .hero__visual { width: min(100% - 8px, 470px); justify-self: center; padding-bottom: 31px; }
    .automation-window { transform: rotate(1.2deg); }
    .hero__floating-note { right: -8px; bottom: -4px; }
    .proof-strip { grid-template-columns: 1fr; margin-bottom: 72px; }
    .proof-strip article { min-height: 78px; padding: 16px 5px; }
    .proof-strip article + article { border-top: 1px solid var(--line-strong); border-left: 0; }
    .process-section { padding-bottom: 66px; }
    .process-section__heading { display: block; margin-bottom: 25px; }
    .process-section h2 { max-width: 590px; }
    .process-grid { grid-template-columns: 1fr; }
    .process-step { min-height: 190px; }
    .process-step h3 { margin-top: 37px; }
    .feature-grid { grid-template-columns: 1fr; padding-bottom: 66px; }
    .feature-card { min-height: 205px; }
    .feature-card h2 { margin-top: 38px; }
    .marketing-cta { align-items: flex-start; flex-direction: column; margin-bottom: 58px; }
    .document-heading__content { align-items: flex-start; flex-direction: column; gap: 18px; }
    .document-heading__amount { justify-items: start; }
    .document-detail-grid, .document-permalink { grid-template-columns: 1fr; }
    .document-permalink { gap: 17px; margin-bottom: 37px; }
    .document-timeline ol { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
    .nav-actions { gap: 0; }
    .hero h1 { letter-spacing: -.075em; }
    .hero__actions { align-items: flex-start; gap: 16px; flex-direction: column; }
    .hero__microproof { gap: 10px; font-size: 10px; }
    .hero__visual { width: 100%; padding-right: 7px; }
    .automation-window__body { padding: 15px; }
    .automation-window__header, .automation-window__footer { padding-right: 16px; padding-left: 16px; }
    .event-card { grid-template-columns: 31px minmax(0, 1fr); }
    .event-card > b { display: none; }
    .event-card__service { width: 31px; height: 31px; }
    .hero__floating-note { right: -5px; padding: 9px 10px; }
    .hero__floating-note small { display: none; }
    .process-section h2 { font-size: 30px; }
    .marketing-cta { padding: 26px; }
    .section-heading--documents { align-items: flex-start; flex-direction: column; gap: 1px; }
    .section-heading--documents > span { padding-bottom: 0; }
    .document-row { grid-template-columns: 32px minmax(0, 1fr) auto 14px; gap: 9px; padding: 11px 12px; }
    .document-row__status { display: none; }
    .document-row__amount { font-size: 11px; }
    .detail-card { padding: 17px; }
    .detail-list div { grid-template-columns: 1fr; gap: 4px; }
    .detail-list dd { text-align: left; }
    .document-permalink { padding: 18px; }
    .document-permalink__url { grid-template-columns: 1fr; }
    .document-permalink__url button { justify-self: start; }
    .site-footer { flex-wrap: wrap; }
    .metrics-card { padding: 16px; }
    .section-bar { align-items: flex-start; gap: 10px; flex-direction: column; }
    .metrics-grid article { padding: 12px; }
    .setup-card__head { gap: 9px; }
    .setup-card h2 { font-size: 19px; }
    .progress-steps { grid-template-columns: auto 1fr 1fr; }
    .progress-steps li:first-child strong { display: none; }
}
