:root {
    --ink: #17212b;
    --muted: #65717c;
    --line: #dfe5df;
    --paper: #ffffff;
    --canvas: #f4f6f2;
    --green: #83a83f;
    --green-dark: #5f7f2b;
    --green-soft: #edf4df;
    --amber: #a66a00;
    --amber-soft: #fff4d8;
    --red: #a83838;
    --red-soft: #fff0ee;
    --blue-soft: #eaf3f8;
    --radius: 22px;
    --shadow: 0 18px 55px rgba(23, 33, 43, .10);
}
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

* { box-sizing: border-box; }

html { color-scheme: light; scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 0%, rgba(131,168,63,.12), transparent 29rem),
        var(--canvas);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}

a { color: var(--green-dark); text-underline-offset: 3px; }
a:hover { color: #40591c; }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .8rem; font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.05; letter-spacing: -.045em; }
h2 { margin-bottom: .8rem; font-size: clamp(1.25rem, 2vw, 1.65rem); line-height: 1.2; letter-spacing: -.025em; }
p { color: var(--muted); }

.site-header {
    position: sticky;
    z-index: 10;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 78px;
    padding: 14px clamp(20px, 5vw, 72px);
    border-bottom: 1px solid rgba(223,229,223,.9);
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(18px);
}

.brand img { display: block; width: min(240px, 46vw); height: 48px; object-fit: contain; object-position: left center; }
.main-nav { display: flex; align-items: center; gap: 22px; }
.main-nav a, .nav-button { color: var(--ink); font: inherit; font-weight: 700; text-decoration: none; }
.main-nav form { margin: 0; }
.nav-button { padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: white; cursor: pointer; }
.nav-button:hover { border-color: var(--green); background: var(--green-soft); }

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    max-width: 1280px;
    margin: 30px auto 0;
    padding: 28px clamp(20px, 5vw, 72px) 42px;
    color: var(--muted);
    font-size: .88rem;
}

.site-footer a { color: inherit; }
.flash-region { width: min(1120px, calc(100% - 40px)); margin: 24px auto 0; }

.page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 54px 0 40px; }
.narrow-page { width: min(900px, calc(100% - 40px)); }
.page-heading { max-width: 760px; margin-bottom: 30px; }
.page-heading > p { font-size: 1.1rem; }
.dashboard-page, .admin-page { padding-top: 34px; }

.auth-shell {
    display: grid;
    min-height: calc(100vh - 170px);
    place-items: center;
    padding: 50px 20px;
}

.auth-card {
    width: min(500px, 100%);
    padding: clamp(28px, 5vw, 52px);
    border: 1px solid rgba(223,229,223,.9);
    border-radius: 30px;
    background: rgba(255,255,255,.96);
    box-shadow: var(--shadow);
}

.setup-card { width: min(820px, 100%); }
.auth-logo { display: block; width: min(300px, 80%); height: 70px; margin-bottom: 30px; object-fit: contain; object-position: left center; }
.lead { font-size: 1.08rem; }
.eyebrow { margin-bottom: 9px; color: var(--green-dark); font-size: .76rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.fine-print { margin: 24px 0 0; font-size: .82rem; text-align: center; }

.panel {
    margin-bottom: 24px;
    padding: clamp(22px, 4vw, 34px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: 0 8px 28px rgba(23,33,43,.05);
}

.stack-form { display: grid; gap: 20px; }
.stack-form fieldset { display: grid; gap: 20px; margin: 0; padding: 0 0 28px; border: 0; border-bottom: 1px solid var(--line); }
.stack-form legend { width: 100%; margin-bottom: 20px; padding: 0; font-size: 1.12rem; font-weight: 850; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.span-2 { grid-column: span 2; }

label { display: grid; gap: 7px; color: var(--ink); font-size: .92rem; font-weight: 750; }
input, select, textarea {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid #cdd6cd;
    border-radius: 12px;
    outline: none;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-weight: 500;
}

input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(131,168,63,.16); }
input[type="file"] { padding: 10px; background: #f9faf7; }
small, .optional { color: var(--muted); font-size: .77rem; font-weight: 500; }
.check-row { grid-template-columns: 22px 1fr; align-items: start; font-weight: 500; }
.check-row input { width: 19px; min-height: 19px; margin-top: 3px; }

.role-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.role-choice { position: relative; display: block; cursor: pointer; }
.role-choice input { position: absolute; width: 1px; height: 1px; min-height: 1px; opacity: 0; }
.role-choice-content {
    display: grid;
    min-height: 150px;
    align-content: start;
    gap: 9px;
    padding: 22px;
    border: 2px solid var(--line);
    border-radius: 18px;
    background: #fff;
    color: var(--muted);
    font-weight: 500;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.role-choice-title { color: var(--ink); font-size: 1.08rem; font-weight: 850; }
.role-choice input:checked + .role-choice-content { border-color: var(--green); background: var(--green-soft); box-shadow: 0 0 0 4px rgba(131,168,63,.13); }
.role-choice input:focus-visible + .role-choice-content { outline: 3px solid rgba(95,127,43,.35); outline-offset: 3px; }

.button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border: 1px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-weight: 850;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button.button-primary { color: white; background: var(--green-dark); box-shadow: 0 8px 18px rgba(95,127,43,.22); }
.button.button-primary:hover { color: white; background: #4d681f; }
.button.button-secondary { color: var(--ink); border-color: var(--line); background: white; }
.button.button-secondary:hover { color: var(--ink); border-color: var(--green); background: var(--green-soft); }
.button.button-danger { color: var(--red); border-color: #e9b5ae; background: var(--red-soft); }
.button.button-disabled, .button:disabled { color: #59635b; border-color: var(--line); background: #ecefeb; cursor: not-allowed; box-shadow: none; }
.button.button-disabled:hover, .button:disabled:hover { color: #59635b; background: #ecefeb; transform: none; box-shadow: none; }
.button-disabled:hover { transform: none; }
.button-full { width: 100%; }
.download-action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 20px 0 24px; }
.download-action-grid .button { width: 100%; }
.json-import-form { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.source-evidence { margin: 0 0 22px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #f9faf7; }
.source-evidence summary { cursor: pointer; color: var(--ink); font-weight: 800; }
.source-evidence ul { margin-bottom: 0; color: var(--muted); }

.auth-divider { position: relative; margin: 30px 0 22px; text-align: center; }
.auth-divider::before { position: absolute; z-index: 0; top: 50%; right: 0; left: 0; height: 1px; background: var(--line); content: ""; }
.auth-divider span { position: relative; z-index: 1; padding: 0 12px; background: white; color: var(--muted); font-size: .84rem; }

.alert { margin-bottom: 22px; padding: 14px 17px; border: 1px solid; border-radius: 14px; }
.alert p:last-child, .alert ul:last-child { margin-bottom: 0; }
.alert-error { color: #7d2727; border-color: #efc1bc; background: var(--red-soft); }
.alert-success { color: #41631e; border-color: #bdd59a; background: var(--green-soft); }
.alert-warning { color: #76500b; border-color: #edcf87; background: var(--amber-soft); }
.alert-info { color: #2f5a70; border-color: #bbd7e5; background: var(--blue-soft); }

.notice-card { padding: 16px 18px; border-left: 4px solid var(--green); border-radius: 10px; background: var(--green-soft); color: #3b5020; }
.warning-notice { margin-bottom: 24px; border-left-color: #d29017; background: var(--amber-soft); color: #684707; }
.result-card { text-align: center; }
.result-icon { display: grid; width: 62px; height: 62px; margin: 0 auto 24px; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); font-size: 2rem; font-weight: 900; }
.message-mark { width: 70px; height: 70px; margin-bottom: 24px; }
.next-steps { display: grid; gap: 8px; margin: 26px 0; padding-left: 24px; color: var(--muted); text-align: left; }

.dashboard-hero { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 30px; padding: 20px 4px; }
.dashboard-hero h1 { margin-bottom: 8px; }
.dashboard-hero p { margin: 0; font-size: 1.05rem; }
.hero-action { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.module-card { display: grid; align-content: start; gap: 12px; min-height: 220px; }
.module-card h2, .module-card p { margin: 0; }
.module-card .status-pill { justify-self: start; }
.operator-welcome > p { max-width: 820px; }
.section-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; }
.section-heading .eyebrow { margin-bottom: 5px; }
.section-actions { display: flex; align-items: center; gap: 12px; }
.button-small { min-height: 38px; padding: 8px 14px; font-size: .8rem; }

.progress-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.progress-step { display: grid; min-height: 115px; align-content: center; justify-items: center; gap: 10px; padding: 16px; border: 1px dashed #cdd6cd; border-radius: 16px; background: #fafbf9; color: var(--muted); font-size: .86rem; font-weight: 750; text-align: center; }
.progress-step.complete { border-style: solid; border-color: #bdd59a; background: var(--green-soft); color: #3f5a1e; }
.step-number { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: #e5e9e3; color: #68716a; font-weight: 900; }
.progress-step.complete .step-number { background: var(--green); color: white; }
.panel-note { margin: 18px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: .88rem; }

.status-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border-radius: 999px; background: #e9ece8; color: #5b635d; font-size: .75rem; font-weight: 850; white-space: nowrap; }
.status-pill::before { width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: currentColor; content: ""; opacity: .75; }
.status-active, .status-approved, .status-success { background: var(--green-soft); color: #4d6d23; }
.status-ready, .status-paid, .status-confirmed, .status-completed { background: var(--green-soft); color: #4d6d23; }
.status-draft, .status-payment_pending, .status-submitted { background: var(--blue-soft); color: #2f5a70; }
.status-pending, .status-in_review { background: var(--amber-soft); color: var(--amber); }
.status-rejected, .status-revoked, .status-suspended { background: var(--red-soft); color: var(--red); }
.metric-number { color: var(--green-dark); font-size: 1.7rem; font-weight: 900; line-height: 1; }

.detail-list { display: grid; gap: 0; margin: 0; }
.detail-list > div { display: grid; grid-template-columns: minmax(130px, .7fr) 1.3fr; gap: 18px; padding: 11px 0; border-bottom: 1px solid #edf0ec; }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); font-size: .82rem; }
.detail-list dd { margin: 0; font-weight: 700; }

.scope-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.scope-list li { display: grid; gap: 3px; padding: 12px 14px; border-radius: 12px; background: #f6f8f3; }
.scope-list strong { font-size: .82rem; }
.scope-list span { color: var(--muted); font-size: .8rem; }
.empty-state { margin: 0; padding: 24px; border: 1px dashed #cfd7cf; border-radius: 14px; color: var(--muted); background: #fafbf9; text-align: center; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .75rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
td { font-size: .9rem; }
td span { color: var(--muted); }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.metric-card { display: grid; gap: 5px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.metric-card span { color: var(--green-dark); font-size: 2rem; font-weight: 900; line-height: 1; }
.metric-card small { font-size: .8rem; }
.review-list { display: grid; gap: 20px; }
.review-card { margin-bottom: 0; }
.review-header { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.review-header h2 { margin-bottom: 5px; }
.review-header p { margin: 0; }
.review-statuses { display: flex; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.review-details { display: grid; grid-template-columns: 1.2fr .8fr; gap: 26px; padding: 20px 0; }
.document-box { display: grid; align-content: start; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #f8faf7; font-size: .82rem; }
.document-box span { color: var(--muted); }
.text-link { margin-top: 5px; font-weight: 750; }
.review-actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 20px; border-top: 1px solid var(--line); }
.review-actions form { margin: 0; }
.reject-form { display: flex; flex: 1 1 390px; gap: 8px; }
.reject-form input { min-width: 180px; }
.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 22px 0; }
.certificate-review-page > .panel { margin: 22px 0; }
.assessment-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 14px 0; }
.compact-details { margin: 18px 0; }
.decision-grid { align-items: start; }
.decision-grid .panel { margin: 0; }
.reject-panel { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.danger-notice { border-left-color: var(--red); color: #7f2017; background: var(--red-soft); }
.stack-form textarea { min-height: 108px; resize: vertical; }
.stack-form button:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.card-list, .cart-list { display: grid; gap: 12px; }
.list-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fbfcfa;
    color: var(--ink);
    text-decoration: none;
}
.list-card:hover { border-color: var(--green); background: var(--green-soft); color: var(--ink); }
.list-card > span:first-child { display: grid; gap: 4px; }
.list-card small, .cart-row small { display: block; color: var(--muted); }
.offering-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.offering-card {
    display: grid;
    align-content: start;
    gap: 18px;
    min-height: 330px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fbfcfa;
}
.offering-card h3 { margin: 0 0 7px; }
.offering-card p { margin: 0; }
.offering-card .button { margin-top: auto; }
.price { color: var(--green-dark); font-size: 1.55rem; }
.cart-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 18px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}
.cart-row form { margin: 0; }
.inline-action { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 22px 0; }
.money-summary { display: grid; gap: 8px; margin: 26px 0; }
.money-summary > div { display: flex; justify-content: space-between; gap: 24px; }
.money-summary dt { color: var(--muted); }
.money-summary dd { margin: 0; font-weight: 750; }
.money-summary .money-total { margin-top: 8px; padding-top: 14px; border-top: 2px solid var(--line); font-size: 1.15rem; }
.money-summary .money-total dt, .money-summary .money-total dd { color: var(--ink); font-weight: 900; }
.center-action { margin: 20px 0 0; text-align: center; }

.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.account-grid .panel { margin-bottom: 0; }
.field-note { display: block; margin-top: 6px; color: var(--muted); font-size: .78rem; font-weight: 500; }
.payment-link-status { margin: 18px 0; }
.employee-list { display: grid; gap: 18px; }
.employee-card { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: #fbfcfa; }
.employee-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.employee-heading h3 { margin: 0 0 4px; }
.employee-heading p { margin: 0; }
.brand-upload-panel .section-heading { align-items: center; }
.company-logo-preview { width: min(240px, 42vw); max-height: 110px; object-fit: contain; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.company-logo-stage { display: grid; place-items: center; min-height: 150px; margin: 18px 0; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.company-logo-stage img { width: min(320px, 80%); max-height: 120px; object-fit: contain; }
.member-statuses { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.team-directory { display: grid; gap: 18px; }
.inline-scope-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.inline-scope-list li { padding: 7px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green-dark); font-size: .78rem; font-weight: 800; list-style: none; }
.qualification-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.book-state-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.book-state-card:last-child { border-bottom: 0; }
.book-state-main h3 { margin: 0 0 5px; }
.book-state-main p { margin: 0; color: var(--muted); }
.book-state-actions { display: flex; align-items: center; gap: 10px; }
.book-state-actions form { margin: 0; }

.book-template-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.book-template-option { position: relative; display: grid; grid-template-rows: auto 1fr auto; gap: 12px; min-width: 0; padding: 14px; border: 2px solid var(--line); border-radius: 18px; background: #fbfcfa; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.book-template-option:hover { transform: translateY(-2px); border-color: #b9cf91; box-shadow: 0 10px 24px rgba(38, 58, 29, .08); }
.book-template-option.is-selected { border-color: var(--green); background: var(--green-soft); box-shadow: 0 0 0 3px rgba(99, 137, 42, .11); }
.book-template-option > input { position: absolute; top: 12px; right: 12px; z-index: 2; width: 20px; height: 20px; accent-color: var(--green); }
.book-template-thumb { position: relative; display: grid; align-content: start; gap: 8px; aspect-ratio: 210 / 297; padding: 26px 17px 18px; overflow: hidden; border: 1px solid #ccd2c7; border-radius: 5px; background: white; box-shadow: 0 5px 14px rgba(34, 43, 31, .10); }
.template-thumb-title { color: var(--ink); font-size: clamp(.72rem, 1.1vw, 1rem); font-weight: 950; letter-spacing: .08em; }
.template-thumb-rule { display: block; height: 5px; width: 52%; border-radius: 4px; background: var(--green); }
.template-thumb-lines { display: block; height: 55%; margin-top: 10px; background: repeating-linear-gradient(to bottom, #dfe3dc 0, #dfe3dc 2px, transparent 2px, transparent 15px); }
.template-thumb-watermark { position: absolute; inset: 48% auto auto 50%; color: #668d2d; font-size: clamp(.8rem, 1.35vw, 1.2rem); font-weight: 950; letter-spacing: .08em; opacity: .3; transform: translate(-50%, -50%) rotate(-35deg); white-space: nowrap; }
.layout-a4_premium_brand .template-thumb-rule, .layout-company_custom .template-thumb-rule { width: 100%; height: 10px; }
.layout-installer_compact .template-thumb-lines { height: 38%; }
.layout-operator_chronicle .template-thumb-lines { background: repeating-linear-gradient(to bottom, #dfe3dc 0, #dfe3dc 2px, transparent 2px, transparent 20px); }
.book-template-copy { display: grid; gap: 5px; align-content: start; }
.book-template-copy strong { line-height: 1.25; }
.book-template-copy small { color: var(--muted); }
.book-template-copy .status-pill { justify-self: start; margin-top: 4px; }
.template-preview-link { position: relative; z-index: 3; justify-self: start; }
.selected-template-note { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px; border: 1px solid #cbd9b2; border-radius: 14px; background: var(--green-soft); }
.selected-template-note > div { display: grid; gap: 5px; }
.import-promise-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0 0 26px; }
.import-promise-grid article { display: flex; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 10px 28px rgba(37, 54, 30, .05); }
.import-promise-grid p { margin: 5px 0 0; color: var(--muted); font-size: .86rem; }
.import-promise-number { display: grid; flex: 0 0 34px; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 900; }
.integration-method { position: relative; overflow: hidden; }
.integration-method.is-recommended { border: 2px solid #b9d08c; background: linear-gradient(145deg, #fff 0%, #f7faef 100%); }
.integration-method.is-fallback { background: #fcfdfb; }
.method-badge { display: inline-flex; margin-bottom: 14px; padding: 7px 11px; border-radius: 999px; background: var(--green); color: #fff; font-size: .76rem; font-weight: 900; letter-spacing: .02em; }

.template-preview-page { max-width: 1500px; }
.preview-page-heading { align-items: flex-end; }
.preview-document-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; align-items: start; margin: 30px 0; }
.preview-paper { position: relative; isolation: isolate; display: flex; flex-direction: column; aspect-ratio: 210 / 297; min-width: 0; padding: 7%; overflow: hidden; border: 1px solid #cdd3c8; border-radius: 4px; background: #fff; color: #1a241f; box-shadow: 0 20px 45px rgba(29, 42, 24, .14); }
.preview-paper::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(135deg, rgba(124, 158, 69, .025), transparent 55%); }
.preview-watermark { position: absolute; top: 50%; left: 50%; z-index: 5; color: #537e20; font-size: clamp(2.4rem, 5vw, 5.4rem); font-weight: 950; letter-spacing: .04em; line-height: 1; opacity: .3; pointer-events: none; transform: translate(-50%, -50%) rotate(-34deg); white-space: nowrap; }
.preview-paper-header { display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding-bottom: 12px; border-bottom: 3px solid var(--green); font-size: .72rem; font-weight: 900; letter-spacing: .08em; }
.preview-paper-header img { width: 38%; max-height: 38px; object-fit: contain; }
.preview-cover-body { display: grid; align-content: center; flex: 1; }
.preview-kicker { color: var(--green-dark); font-size: .72rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.preview-cover h2 { margin: 16px 0; font-size: clamp(1.7rem, 3.5vw, 3.4rem); line-height: 1.02; }
.preview-cover footer { display: grid; gap: 3px; padding-top: 13px; border-top: 1px solid #ced4ca; font-size: .66rem; }
.preview-data-page h2, .preview-log-page h2 { margin: 8% 0 5%; font-size: clamp(1.1rem, 2vw, 2rem); }
.preview-data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3%; margin: 0; }
.preview-data-grid > div { padding: 5% 4%; border-radius: 6px; background: #f3f6ef; }
.preview-data-grid .wide { grid-column: 1 / -1; }
.preview-data-grid dt { color: #68736b; font-size: .58rem; font-weight: 800; text-transform: uppercase; }
.preview-data-grid dd { margin: 4px 0 0; font-size: .72rem; font-weight: 750; }
.preview-signature-line { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8%; margin-top: auto; padding-top: 8%; font-size: .58rem; }
.preview-signature-line span { padding-top: 8%; border-top: 1px solid #68736b; }
.preview-log-table { width: 100%; border-collapse: collapse; font-size: .58rem; }
.preview-log-table th, .preview-log-table td { padding: 4% 2%; border: 1px solid #cfd5cc; text-align: left; vertical-align: top; }
.preview-log-table th { background: #edf3e5; }
.preview-notes { flex: 1; min-height: 20%; margin-top: 6%; padding: 4%; border: 1px solid #cfd5cc; font-size: .62rem; }
.preview-section-tags { display: flex; flex-wrap: wrap; gap: 9px; margin: 18px 0; }
.preview-section-tags span { padding: 8px 11px; border-radius: 999px; background: var(--green-soft); color: var(--green-dark); font-size: .8rem; font-weight: 800; }
.layout-a4_premium_brand .preview-paper-header, .layout-company_custom .preview-paper-header { border-bottom-width: 8px; }
.layout-installer_compact .preview-paper { padding: 5.5%; }
.layout-operator_chronicle .preview-log-table tbody tr { height: 72px; }
.numbered-flow { counter-reset: flow; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; padding: 0; list-style: none; }
.numbered-flow li { counter-increment: flow; display: grid; align-content: start; gap: 8px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fbfcfa; }
.numbered-flow li::before { content: counter(flow); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 900; }
.numbered-flow span { color: var(--muted); font-size: .9rem; }
.secret-once { display: grid; gap: 10px; margin: 18px 0; padding: 18px; border: 2px solid var(--green); border-radius: 14px; background: var(--green-soft); }
.secret-once code { display: block; padding: 12px; overflow-wrap: anywhere; border-radius: 8px; background: #fff; user-select: all; }
.public-ai-page { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 72px 0 90px; }
.public-ai-hero { max-width: 980px; padding: 54px; border-radius: 30px; background: linear-gradient(135deg, #f4f8eb 0%, #fff 64%); box-shadow: 0 24px 70px rgba(40, 62, 30, .10); }
.public-ai-hero h1 { margin: 10px 0 18px; font-size: clamp(2.4rem, 5vw, 5rem); line-height: 1.02; letter-spacing: -.04em; }
.public-ai-hero p { max-width: 780px; color: var(--muted); font-size: 1.15rem; }
.public-ai-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.public-ai-section { margin: 72px 0; }
.public-ai-section h2 { max-width: 840px; }
.public-ai-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.public-trust-panel { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-top: 28px; padding: 32px; border: 1px solid var(--line); border-radius: 22px; background: #fff; }
.public-trust-panel p { max-width: 760px; }
.public-trust-panel img { width: 195px; height: 72px; }

.admin-operations-page { max-width: 1480px; }
.admin-operations-page .dashboard-hero { gap: 24px; }
.admin-operations-page .hero-action { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.admin-section-nav {
    position: sticky;
    top: 74px;
    z-index: 8;
    display: flex;
    gap: 8px;
    margin: 0 0 24px;
    padding: 10px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 10px 30px rgba(32, 48, 29, .06);
}
.admin-section-nav a { padding: 9px 12px; border-radius: 10px; color: var(--ink); font-size: .86rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.admin-section-nav a:hover { background: var(--green-soft); color: var(--green-dark); }
.admin-metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 24px; }
.admin-section { margin: 28px 0; scroll-margin-top: 145px; }
.admin-section.panel { padding: 26px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-heading h2 { margin: 4px 0 0; }
.section-count { display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 10px; border-radius: 999px; background: var(--green-soft); color: var(--green-dark); font-weight: 900; }
.compact-review-card { padding: 24px; }
.admin-inline-details { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin: 20px 0; }
.admin-inline-details > div { padding: 13px; border-radius: 12px; background: #f6f8f3; }
.admin-inline-details dt { color: var(--muted); font-size: .76rem; font-weight: 800; }
.admin-inline-details dd { margin: 4px 0 0; font-weight: 750; }
.admin-table-wrap { width: 100%; overflow-x: auto; }
.admin-data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-data-table th { padding: 10px 12px; border-bottom: 2px solid var(--line); color: var(--muted); font-size: .72rem; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.admin-data-table td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-data-table tbody tr:hover { background: #fafbf8; }
.admin-data-table strong, .admin-data-table small { display: block; }
.admin-data-table small { margin-top: 4px; color: var(--muted); }
.admin-data-table a:not(.button) { color: var(--green-dark); }
.admin-data-table .status-pill { white-space: nowrap; }
.issue-list { display: grid; gap: 12px; }
.issue-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfa; }
.issue-card p { margin: 3px 0 0; color: var(--muted); }
.admin-empty-row { padding: 28px !important; color: var(--muted); text-align: center; }

.pricing-rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.pricing-rule-card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fbfcfa; }
.pricing-rule-card h3 { margin-top: 0; }
.pricing-value-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 12px; align-items: end; }
.form-hint { margin: -4px 0 12px; color: var(--muted); font-size: .83rem; }
.price-saving { color: #5d8424; font-weight: 700; }
.import-review-list { display: grid; gap: 1.5rem; }
.import-review-card .section-heading { align-items: flex-start; }
.import-review-card fieldset { margin-top: 1rem; }
.template-preview-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; }
.template-preview-links a { color: var(--green-dark); font-size: .84rem; font-weight: 750; }
.data-import-kit { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: 18px; margin: 22px 0; }
.data-import-kit article { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fbfcfa; }
.data-import-kit h3 { margin: 5px 0 10px; }
.data-import-kit p { color: var(--muted); }
.data-import-download-card { align-content: start; }
.data-import-download-card .button { width: 100%; margin-top: 12px; }
.prompt-copy-field { min-height: 310px; resize: vertical; background: #fff; color: #283128; font-family: Consolas, "Courier New", monospace; font-size: .78rem; line-height: 1.55; }
.prompt-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.prompt-actions .button { flex: 1 1 190px; }
kbd { display: inline-block; padding: 1px 6px; border: 1px solid #bec7bb; border-bottom-width: 2px; border-radius: 5px; background: #fff; color: var(--ink); font-family: inherit; font-size: .74rem; font-weight: 800; }
.import-review-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 22px; }
.import-review-steps > div { display: flex; align-items: center; gap: 12px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 15px; background: #fff; color: var(--muted); }
.import-review-steps span { display: grid; flex: 0 0 32px; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #e7ebe3; color: #596357; font-weight: 900; }
.import-review-steps .is-current { border-color: #abc87a; background: var(--green-soft); color: var(--ink); }
.import-review-steps .is-current span { background: var(--green); color: #fff; }
.import-review-steps .is-complete { color: var(--green-dark); }
.import-review-steps .is-complete span { background: var(--green); color: #fff; }
.object-review-panel { scroll-margin-top: 90px; }
.installation-review-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 42px 0 20px; scroll-margin-top: 90px; }
.installation-review-heading h2 { margin: 4px 0 5px; }
.installation-review-heading p { margin: 0; color: var(--muted); }
.installation-review-form fieldset { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fcfdfb; }
.installation-review-form legend { padding: 0 7px; color: var(--ink); font-weight: 900; }
.option-group { display: flex; flex-wrap: wrap; gap: 10px 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.option-group > strong { flex-basis: 100%; }
.check-option { display: inline-flex !important; align-items: center; gap: 7px; color: var(--ink); font-size: .87rem; font-weight: 650 !important; }
.check-option input { width: 18px; height: 18px; accent-color: var(--green); }
.component-review-list { display: grid; gap: 14px; margin: 14px 0; }
.component-review-row { padding: 17px; border: 1px solid #d9dfd5; border-radius: 14px; background: #fff; }
.component-row-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.component-field-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.component-field-grid .span-2 { grid-column: span 2; }
.text-button { padding: 0; border: 0; background: transparent; font: inherit; font-size: .82rem; font-weight: 800; cursor: pointer; }
.danger-text { color: #9d342d; }
.review-detail-section { margin-top: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fcfdfb; }
.review-detail-section > summary { cursor: pointer; color: var(--ink); font-weight: 900; }
.review-detail-section[open] > summary { margin-bottom: 16px; }
.acceptance-check-list { display: grid; gap: 10px; margin-top: 16px; }
.acceptance-check-row { display: grid; grid-template-columns: minmax(230px, 1.3fr) minmax(150px, .6fr) minmax(180px, 1fr) minmax(180px, 1fr); gap: 12px; align-items: end; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.acceptance-check-title { display: flex; align-items: flex-start; gap: 10px; align-self: center; }
.acceptance-check-title span { flex: 0 0 auto; padding: 4px 7px; border-radius: 7px; background: var(--green-soft); color: var(--green-dark); font-size: .72rem; font-weight: 900; }
.acceptance-check-title strong { font-size: .86rem; line-height: 1.35; }
.acceptance-check-row label { min-width: 0; }
.imported-history-summary p { margin-bottom: 4px; }
.structured-import-data { overflow-wrap: anywhere; }
.structured-list { display: grid; gap: 12px; margin: 14px 0 0; padding-left: 22px; }
.structured-list > li { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.structured-record { display: grid; grid-template-columns: minmax(150px, .42fr) minmax(0, 1fr); gap: 0; margin: 0; }
.structured-record dt, .structured-record dd { margin: 0; padding: 8px 10px; border-bottom: 1px solid #edf0ea; }
.structured-record dt { color: var(--muted); font-size: .78rem; font-weight: 800; }
.structured-record dd { color: var(--ink); font-size: .86rem; }
.structured-record .structured-list { margin-top: 0; }

@media (max-width: 1100px) {
    .site-header { padding-inline: 24px; }
    .brand img { width: 180px; }
    .main-nav { gap: 14px; }
    .main-nav a, .nav-button { font-size: .92rem; }
    .admin-inline-details { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .numbered-flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .book-template-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .import-promise-grid { grid-template-columns: 1fr; }
    .acceptance-check-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .acceptance-check-title { grid-column: span 2; }
    .component-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .main-nav a { display: none; }
    .main-nav a.account-nav-link { display: inline-flex; }
    .site-header { min-height: 68px; }
    .brand img { height: 40px; }
    .dashboard-hero, .review-header { align-items: stretch; flex-direction: column; }
    .hero-action .button { width: 100%; }
    .dashboard-grid, .review-details, .review-grid, .offering-grid, .account-grid, .qualification-action-grid { grid-template-columns: 1fr; }
    .module-grid { grid-template-columns: 1fr; }
    .progress-grid, .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .review-statuses { justify-content: flex-start; }
    .admin-metric-grid, .pricing-rule-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-inline-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-section-nav { top: 66px; }
    .numbered-flow { grid-template-columns: 1fr; }
    .public-ai-hero { padding: 32px 24px; }
    .public-ai-split { grid-template-columns: 1fr; }
    .public-trust-panel { align-items: flex-start; flex-direction: column; }
    .book-template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .preview-document-grid { grid-template-columns: 1fr; max-width: 620px; margin-inline: auto; }
    .data-import-kit { grid-template-columns: 1fr; }
}

.document-qr { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; }
.document-qr svg { max-width: 100%; height: auto; }
.panel code { overflow-wrap: anywhere; }
details > summary { cursor: pointer; padding-block: 12px; font-weight: 650; }
details .stack-form { margin-block: 16px; }

@media (max-width: 580px) {
    .site-header { padding-inline: 16px; }
    .page-shell, .narrow-page { width: min(100% - 24px, 1180px); padding-top: 30px; }
    .auth-shell { padding: 28px 12px; }
    .auth-card { padding: 26px 20px; border-radius: 22px; }
    .form-grid, .role-choice-grid, .progress-grid, .metric-grid, .download-action-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .book-template-grid { grid-template-columns: 1fr; }
    .book-state-card, .selected-template-note { align-items: stretch; flex-direction: column; }
    .book-state-actions { flex-wrap: wrap; }
    .progress-step { min-height: 92px; }
    .dashboard-hero { padding-inline: 2px; }
    .site-footer { flex-direction: column; padding-inline: 20px; }
    .detail-list > div { grid-template-columns: 1fr; gap: 3px; }
    .reject-form { flex-direction: column; }
    .review-actions .button, .review-actions form { width: 100%; }
    .cart-row { grid-template-columns: 1fr auto; }
    .cart-row form { grid-column: span 2; }
    .cart-row form .button { width: 100%; }
    .inline-action { align-items: stretch; flex-direction: column; }
    .employee-heading { flex-direction: column; }
    .admin-metric-grid, .pricing-rule-grid, .admin-inline-details { grid-template-columns: 1fr; }
    .issue-card { grid-template-columns: 1fr; }
    .pricing-value-row { grid-template-columns: 1fr; }
    .import-review-steps, .acceptance-check-row, .component-field-grid { grid-template-columns: 1fr; }
    .acceptance-check-title, .component-field-grid .span-2 { grid-column: auto; }
    .installation-review-heading { align-items: flex-start; flex-direction: column; }
    .structured-record { grid-template-columns: 1fr; }
    .structured-record dt { padding-bottom: 2px; border-bottom: 0; }
    .structured-record dd { padding-top: 2px; }
}
