:root {
    --ink: #242723;
    --muted: #6c716a;
    --paper: #f6f3ed;
    --surface: #fffdf9;
    --line: #dedbd2;
    --green: #536d57;
    --green-dark: #344c3a;
    --green-soft: #e5ece3;
    --copper: #b7653d;
    --copper-dark: #8e4427;
    --warning: #8b5e15;
    --warning-bg: #fff4d9;
    --danger: #a33b36;
    --danger-bg: #fbe8e6;
    --success: #3c6847;
    --success-bg: #e6f2e8;
    --shadow: 0 18px 55px rgba(36, 39, 35, .09);
    --radius: 22px;
    --input: #fff;
    --subtle: #f8f7f3;
    --topbar: rgba(255, 253, 249, .94);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --ink: #f2f0e9;
    --muted: #b2b7ae;
    --paper: #151815;
    --surface: #202420;
    --line: #3b413a;
    --green: #86a28a;
    --green-dark: #5e7d65;
    --green-soft: #2b392e;
    --copper: #d8865d;
    --copper-dark: #efa073;
    --warning: #f1c16b;
    --warning-bg: #3a301d;
    --danger: #f09891;
    --danger-bg: #3d2524;
    --success: #83ba8d;
    --success-bg: #24382a;
    --shadow: 0 18px 55px rgba(0, 0, 0, .35);
    --input: #292e29;
    --subtle: #282c28;
    --topbar: rgba(28, 32, 28, .94);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

body.mode-admin { background: var(--paper); }

a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.narrow { width: min(760px, calc(100% - 40px)); }
.page-space { padding-block: 62px 90px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

h1, h2, h3 { margin: 0; letter-spacing: -.035em; line-height: 1.08; font-family: Georgia, "Times New Roman", serif; }
h1 { font-size: clamp(2.25rem, 5vw, 4.7rem); }
h2 { font-size: clamp(1.45rem, 3vw, 2.15rem); }
p { margin: 0; }

.eyebrow {
    display: block;
    margin-bottom: 14px;
    color: var(--copper-dark);
    font-size: .73rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.topbar {
    position: relative;
    z-index: 10;
    min-height: 82px;
    padding: 15px max(20px, calc((100vw - 1180px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: var(--topbar);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; color: white; background: var(--green-dark); border-radius: 50% 50% 48% 52% / 42% 45% 55% 58%; font-family: Georgia, serif; font-weight: 700; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: .88rem; letter-spacing: .09em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: .72rem; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.small-link { color: var(--green-dark); font-size: .86rem; font-weight: 700; text-decoration: none; }
.small-link:hover { text-decoration: underline; }
.mode-pill { padding: 8px 13px; border-radius: 999px; color: var(--green-dark); background: var(--green-soft); font-size: .76rem; font-weight: 800; text-decoration: none; }
.mode-pill.admin { color: #714123; background: #f3e5d8; }
html[data-theme="dark"] .mode-pill.admin { color: #f2c4a9; background: #493326; }

.hero {
    min-height: 620px;
    display: grid;
    grid-template-columns: 1.04fr .96fr;
    align-items: center;
    gap: clamp(38px, 7vw, 90px);
    padding-block: 70px;
}
.hero h1 { max-width: 780px; }
.hero__lead { max-width: 680px; margin-top: 24px; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.25rem); }
.hero__actions, .button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.small-note, .privacy-note, .autosave-note { margin-top: 16px; color: var(--muted); font-size: .82rem; }
.site-footer { margin-top: 40px; padding: 18px 24px; text-align: center; color: var(--muted); font-size: .78rem; border-top: 1px solid var(--line); }
.hero__visual { position: relative; }
.hero__visual::before { content: ""; position: absolute; inset: -28px 18px 28px -22px; z-index: -1; background: #dfe6da; border-radius: 48% 52% 42% 58% / 55% 38% 62% 45%; }
.hero__visual img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 46% 54% 48% 52% / 42% 46% 54% 58%; box-shadow: var(--shadow); }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding-bottom: 90px; }
.feature-card { padding: 30px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.feature-card__number { display: block; margin-bottom: 36px; color: var(--copper); font-size: .75rem; font-weight: 900; letter-spacing: .14em; }
.feature-card h2 { font-size: 1.55rem; }
.feature-card p { margin-top: 11px; color: var(--muted); }

.panel { padding: clamp(28px, 5vw, 48px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 35px rgba(36, 39, 35, .04); }
.panel > p { margin-top: 15px; color: var(--muted); }
.panel h1 { font-size: clamp(2rem, 6vw, 3.65rem); }
.client-intro .tick-list { margin-block: 30px; }
.tick-list { display: grid; gap: 12px; padding: 0; list-style: none; }
.tick-list li { position: relative; padding-left: 30px; }
.tick-list li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; display: grid; place-items: center; color: white; background: var(--green); border-radius: 50%; font-size: .7rem; font-weight: 900; }
.resume-card { margin-block: 28px 14px; padding: 22px; background: var(--green-soft); border-radius: 16px; }
.resume-card p { margin-block: 6px 16px; color: var(--muted); font-size: .9rem; }

.button {
    min-height: 48px;
    padding: 12px 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .72; transform: none; }
.button--primary { color: #fff; background: var(--green-dark); border-color: var(--green-dark); }
.button--primary:hover { background: #263c2d; }
.button--secondary { color: var(--green-dark); background: transparent; border-color: #aeb8ad; }
.button--secondary:hover { background: var(--green-soft); }
.button--catalog { color: #fff; background: var(--copper-dark); border-color: var(--copper-dark); }
.button--catalog:hover { background: #74361f; border-color: #74361f; }
.button--ghost { color: var(--muted); background: transparent; border-color: transparent; }
.button--ghost:hover { color: var(--ink); background: var(--subtle); }
.button--danger { color: var(--danger); background: var(--danger-bg); border-color: #efc6c2; }
.button--wide { width: 100%; }

.hp-field { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.notice { margin-block: 20px; padding: 14px 16px; border: 1px solid; border-radius: 12px; font-size: .9rem; }
.notice--warning { color: #69430f; background: var(--warning-bg); border-color: #efd99d; }
.notice--error { color: #812f2a; background: var(--danger-bg); border-color: #efc0bc; }
.notice--success { color: #2d5937; background: var(--success-bg); border-color: #bcd9c2; }
.notice--info { color: #35515f; background: #eaf2f5; border-color: #c9dce4; }
.flash { position: fixed; top: 92px; left: 50%; z-index: 100; width: min(680px, calc(100% - 32px)); padding: 14px 18px; transform: translateX(-50%); border-radius: 12px; box-shadow: var(--shadow); text-align: center; font-weight: 700; }
.flash-success { color: #2d5937; background: var(--success-bg); border: 1px solid #bcd9c2; }
.flash-error { color: #812f2a; background: var(--danger-bg); border: 1px solid #efc0bc; }

.stack-form { display: grid; gap: 18px; margin-top: 28px; }
.stack-form label { display: grid; gap: 7px; font-size: .88rem; font-weight: 800; }
.stack-form label small { color: var(--muted); font-size: .76rem; font-weight: 500; }
input[type="text"], input[type="password"], input[type="email"], input[type="tel"], input[type="number"], input[type="search"], textarea, select {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    color: var(--ink);
    background: var(--input);
    border: 1px solid #c9c9c2;
    border-radius: 10px;
    outline: none;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(83, 109, 87, .15); }
.check-line { grid-template-columns: auto 1fr; align-items: center; }
.check-line input { width: 20px; height: 20px; accent-color: var(--green); }
.device-scope-fieldset { min-width: 0; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.device-scope-fieldset legend { padding: 0 7px; color: var(--ink); font-size: .88rem; font-weight: 850; }
.device-scope-fieldset > small { display: block; margin-top: 10px; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.device-scope-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }

.question-page { min-height: calc(100vh - 82px); }
.question-progress { height: 5px; background: #deddd7; overflow: hidden; }
.question-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--copper), var(--green)); transition: width .3s ease; }
.question-shell { width: min(880px, calc(100% - 36px)); margin-inline: auto; padding: 38px 0 70px; }
.question-category-track { margin-bottom: 18px; display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.question-category-track span { flex: 0 0 auto; padding: 7px 11px; color: var(--muted); background: var(--subtle); border: 1px solid var(--line); border-radius: 999px; font-size: .69rem; font-weight: 850; white-space: nowrap; }
.question-category-track span.is-complete { color: #b9d1be; border-color: #49634e; }
.question-category-track span.is-complete::before { content: "✓ "; }
.question-category-track span.is-active { color: #18130d; background: #d6b88f; border-color: #d6b88f; }
.question-meta { display: flex; justify-content: space-between; margin-bottom: 12px; color: var(--muted); font-size: .8rem; font-weight: 800; }
.question-card { min-height: 560px; padding: clamp(30px, 6vw, 64px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); }
.question-card-topline { margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.question-section-title { margin: 0; color: #d6b88f; font-size: clamp(1.15rem, 3vw, 1.5rem); font-weight: 950; letter-spacing: .035em; text-transform: uppercase; }
.project-choice-link { flex: 0 0 auto; color: #f1ddc0; font-size: .76rem; font-weight: 850; }
.project-choice-link:hover { color: #fff; }
.question-card h1 { max-width: 760px; font-size: clamp(2rem, 5.8vw, 3.75rem); }
.question-help { max-width: 680px; margin-top: 14px; color: var(--muted); }
.answer-zone { flex: 1; margin-block: 34px; }
.option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.option-grid--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.option-card { position: relative; cursor: pointer; }
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.option-card > span { min-height: 63px; padding: 15px 16px; display: flex; align-items: center; gap: 12px; background: var(--input); border: 1px solid var(--line); border-radius: 13px; font-weight: 700; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.option-card > span i { width: 20px; height: 20px; flex: 0 0 20px; border: 2px solid #a4a7a0; border-radius: 50%; }
.option-card input[type="checkbox"] + span i { border-radius: 5px; }
.option-card:hover > span { transform: translateY(-1px); border-color: #9eaa9f; }
.option-card input:checked + span { color: var(--green-dark); background: var(--green-soft); border-color: var(--green); }
.option-card input:checked + span i { border: 6px solid var(--green); background: white; }
.option-card input[type="checkbox"]:checked + span i { position: relative; border: 0; background: var(--green); }
.option-card input[type="checkbox"]:checked + span i::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: white; font-size: .75rem; font-style: normal; }
.option-card input:focus-visible + span { outline: 3px solid rgba(83, 109, 87, .26); outline-offset: 2px; }
.large-input, .large-textarea { font-size: 1.18rem !important; }
.large-input { min-height: 62px !important; }
.large-textarea { width: 100%; }
.contact-details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.contact-field { display: grid; gap: 7px; color: var(--ink); font-size: .8rem; font-weight: 850; }
.contact-field input { min-height: 56px; font-size: 1rem; }
.contact-field--wide { grid-column: 1 / -1; }
.input-with-suffix { display: flex; align-items: stretch; }
.input-with-suffix input { border-radius: 13px 0 0 13px; }
.input-with-suffix > span { min-width: 64px; display: grid; place-items: center; color: var(--muted); background: var(--subtle); border: 1px solid var(--line); border-left: 0; border-radius: 0 13px 13px 0; font-weight: 800; }
.file-drop { min-height: 185px; padding: 30px; display: grid; place-items: center; align-content: center; gap: 6px; border: 2px dashed #abb4aa; border-radius: 16px; background: var(--subtle); cursor: pointer; text-align: center; }
.file-drop:hover { background: var(--green-soft); border-color: var(--green); }
.file-drop input { max-width: 100%; margin-bottom: 10px; }
.file-drop span { color: var(--muted); font-size: .82rem; }
.file-count { margin-top: 12px; color: var(--success); font-weight: 800; }
.question-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 22px; border-top: 1px solid var(--line); }
.question-actions .button--primary { min-width: 160px; }
.autosave-note { text-align: center; }
.summary-list { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; }
.summary-list > div { padding: 14px 17px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; border-bottom: 1px solid var(--line); }
.summary-list > div:last-child { border-bottom: 0; }
.summary-list span { color: var(--muted); font-size: .82rem; }
.summary-list strong { text-align: right; font-size: .9rem; }

.confirmation-card { text-align: center; }
.confirmation-card p { max-width: 600px; margin-inline: auto; }
.confirmation-card .button-row { justify-content: center; }
.confirmation-icon { width: 72px; height: 72px; margin: 0 auto 25px; display: grid; place-items: center; color: white; background: var(--green); border-radius: 50%; font-size: 2rem; font-weight: 800; }
.confirmation-icon--warning { background: #a76528; }
.low-budget-message { max-width: 760px; margin: 24px auto 0; padding: 24px; color: var(--ink); background: var(--warning-bg); border: 1px solid #b98045; border-radius: 15px; text-align: left; }
.low-budget-message p { max-width: none; margin: 0 0 18px; line-height: 1.7; }
.low-budget-message p:last-child { margin-bottom: 0; }
.tariff-information-message { max-width: 760px; margin: 24px auto 0; padding: 24px; color: var(--ink); background: var(--green-soft); border: 1px solid var(--green); border-radius: 15px; text-align: left; }
.tariff-information-message p { max-width: none; margin: 0 0 18px; line-height: 1.7; }
.tariff-information-message p:last-child { margin-bottom: 0; }
.reference-box { margin: 28px auto 0; padding: 17px; max-width: 520px; background: var(--green-soft); border-radius: 13px; }
.reference-box span, .reference-box strong { display: block; }
.reference-box span { margin-bottom: 4px; color: var(--muted); font-size: .75rem; }
.reference-box strong { overflow-wrap: anywhere; }

.admin-nav { min-height: 52px; padding: 0 max(20px, calc((100vw - 1180px) / 2)); display: flex; align-items: stretch; gap: 24px; overflow-x: auto; color: #fff; background: #050505; border-bottom: 1px solid #292929; }
.admin-nav a { padding-inline: 4px; display: flex; align-items: center; color: #f4f4f4; border-bottom: 3px solid transparent; font-size: .8rem; font-weight: 850; letter-spacing: .01em; text-decoration: none; white-space: nowrap; }
.admin-nav a:hover, .admin-nav a.active { color: #fff; background: rgba(255, 255, 255, .06); border-color: #e08a5e; }
.admin-nav a:focus-visible { color: #fff; outline: 2px solid #fff; outline-offset: -5px; border-radius: 5px; }
.admin-nav-logout { margin-left: auto; display: flex; align-items: stretch; }
.admin-nav-logout input { display: none; }
.admin-nav-logout button { padding: 0 4px; color: #f4f4f4; background: transparent; border: 0; border-bottom: 3px solid transparent; cursor: pointer; font-size: .8rem; font-weight: 850; white-space: nowrap; }
.admin-nav-logout button:hover { color: #fff; background: rgba(255, 255, 255, .06); border-color: #e08a5e; }
.admin-nav-logout button:focus-visible { outline: 2px solid #fff; outline-offset: -5px; border-radius: 5px; }
.admin-main { padding-block: 34px 80px; }
.admin-warning { margin-top: 0; }
.admin-heading, .record-heading { margin-block: 34px; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.admin-heading h1, .record-heading h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
.admin-heading p, .record-heading p { margin-top: 9px; color: var(--muted); }
.stat-grid { margin-bottom: 22px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.stat-card { padding: 22px; display: flex; flex-direction: column; gap: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.stat-card--accent { color: white; background: var(--green-dark); border-color: var(--green-dark); }
.stat-card span { font-size: .75rem; font-weight: 800; }
.stat-card strong { font-family: Georgia, serif; font-size: 2.35rem; line-height: 1; }
.admin-panel { padding: 0; overflow: hidden; }
.panel-heading { min-height: 92px; padding: 24px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.panel-heading .eyebrow { margin-bottom: 7px; }
.panel-heading h2 { font-size: 1.65rem; }
.export-links { display: flex; gap: 16px; }
.export-links a { color: var(--green-dark); font-size: .78rem; font-weight: 800; }
.filter-bar { padding: 18px 28px; display: grid; grid-template-columns: minmax(220px, 1fr) 230px auto auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.filter-bar input, .filter-bar select { min-height: 43px; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.data-table th, .data-table td { padding: 16px 18px; text-align: left; vertical-align: middle; border-bottom: 1px solid #e7e5df; }
.data-table th { color: var(--muted); background: var(--subtle); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.data-table td strong, .data-table td small { display: block; }
.data-table td small { margin-top: 3px; color: var(--muted); }
.data-table tbody tr:hover { background: var(--subtle); }
.selection-column { width: 48px; text-align: center !important; }
.selection-column input { width: 18px; height: 18px; accent-color: var(--copper); cursor: pointer; }
.bulk-project-actions { padding: 14px 18px; display: flex; align-items: center; gap: 16px; background: #171917; border-bottom: 1px solid var(--line); }
.bulk-project-actions label { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 850; cursor: pointer; }
.bulk-project-actions input { width: 18px; height: 18px; accent-color: var(--copper); }
.bulk-project-actions > span { margin-right: auto; color: var(--muted); font-size: .76rem; }
.bulk-project-actions .button { min-height: 38px; padding: 8px 13px; font-size: .72rem; }
.table-link { color: var(--green-dark); font-weight: 800; text-decoration: none; white-space: nowrap; }
.status { display: inline-flex; padding: 6px 9px; align-items: center; color: #5e4b25; background: #f4ead2; border-radius: 999px; font-size: .68rem; font-weight: 900; white-space: nowrap; }
.status--submitted { color: #834325; background: #f8e1d4; }
.status--callback, .status--visit_to_plan { color: #73520d; background: #f9efc9; }
.status--visit_planned, .status--quote_to_prepare { color: #355266; background: #dfeef4; }
.status--quote_sent { color: #4b4773; background: #e8e5f5; }
.status--accepted { color: #2d5937; background: var(--success-bg); }
.status--closed, .status--draft { color: #666b65; background: #e9ebe8; }
.status--large { padding: 9px 13px; font-size: .75rem; }
.empty-state { padding: 65px 30px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; color: var(--ink); }
.empty-state p { margin-top: 6px; }

.record-heading { align-items: center; }
.record-heading .small-link { display: inline-block; margin-bottom: 18px; }
.record-heading .eyebrow { margin-bottom: 8px; }
.record-grid { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 20px; align-items: start; }
.record-sidebar, .record-content { display: grid; gap: 20px; }
.compact-panel { padding: 25px; }
.compact-panel h2 { font-size: 1.45rem; }
.contact-list { margin: 20px 0 0; }
.contact-list > div { padding-block: 12px; border-top: 1px solid var(--line); }
.contact-list dt { color: var(--muted); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.contact-list dd { margin: 4px 0 0; overflow-wrap: anywhere; font-weight: 700; }
.contact-list a { color: var(--green-dark); }
.danger-zone { border-color: #eccac7; }
.danger-zone p { font-size: .85rem; }
.answer-list__item { padding: 17px 0; display: grid; grid-template-columns: minmax(180px, .85fr) 1.15fr; gap: 26px; border-bottom: 1px solid var(--line); }
.answer-list__item:last-child { border-bottom: 0; }
.answer-list__item span { color: var(--muted); font-size: .82rem; }
.answer-list__item strong { font-size: .91rem; overflow-wrap: anywhere; }
.file-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.file-tile { min-width: 0; padding: 9px; color: inherit; background: var(--subtle); border: 1px solid var(--line); border-radius: 13px; text-decoration: none; }
.file-tile img, .pdf-icon { width: 100%; aspect-ratio: 4 / 3; margin-bottom: 9px; object-fit: cover; border-radius: 8px; }
.pdf-icon { display: grid; place-items: center; color: white; background: var(--copper); font-weight: 900; }
.file-tile strong, .file-tile small { display: block; padding-inline: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-tile strong { font-size: .75rem; }
.file-tile small { margin-top: 2px; color: var(--muted); font-size: .68rem; }

.update-grid { margin-bottom: 20px; display: grid; grid-template-columns: 1.12fr .88fr; gap: 20px; align-items: stretch; }
.update-grid .panel { height: 100%; }
.update-grid h2 { margin-bottom: 12px; }
.code-tree { margin-block: 22px; padding: 20px; overflow-x: auto; color: #e8eee8; background: var(--ink); border-radius: 13px; line-height: 1.7; }
.check-list { margin-block: 28px; border-top: 1px solid var(--line); }
.check-list__row { padding: 15px 0; display: flex; align-items: center; gap: 13px; border-bottom: 1px solid var(--line); }
.check-list__row strong, .check-list__row small { display: block; }
.check-list__row small { margin-top: 2px; color: var(--muted); }
.check-icon { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 50%; font-weight: 900; }
.check-icon--ok { color: white; background: var(--success); }
.check-icon--error { color: white; background: var(--danger); }

.settings-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 20px; align-items: start; }
.settings-side { display: grid; gap: 20px; }
.form-separator { margin-top: 8px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--copper-dark); font-size: .73rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.form-columns { display: grid; grid-template-columns: .7fr 1.3fr; gap: 12px; }
.smtp-fields { display: grid; gap: 18px; }
.smtp-fields[hidden] { display: none; }
.mail-log-list { margin-top: 17px; border-top: 1px solid var(--line); }
.mail-log-list > div { padding-block: 12px; display: flex; align-items: flex-start; gap: 10px; border-bottom: 1px solid var(--line); }
.mail-log-list strong, .mail-log-list small { display: block; }
.mail-log-list small { margin-top: 2px; color: var(--muted); font-size: .7rem; overflow-wrap: anywhere; }
.mail-state { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; border-radius: 50%; color: white; font-size: .7rem; font-weight: 900; }
.mail-state--sent { background: var(--success); }
.mail-state--error { background: var(--danger); }
.settings-link { display: block; margin-top: 14px; text-align: center; }
.home-settings-preview { align-items: stretch; }
.home-settings-preview .button { pointer-events: none; }
.client-intro-preview { margin-block: 24px; }
.preview-button { pointer-events: none; }
#deuxieme-page { scroll-margin-top: 20px; }

.login-card { max-width: 620px; margin-inline: auto; }
.login-card > p { margin-top: 15px; }
.question-editor-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr); gap: 20px; align-items: start; }
.question-editor-list { padding: 0; overflow: hidden; }
.question-editor-list:only-child { grid-column: 1 / -1; }
.question-admin-list { display: grid; }
.question-category-heading { padding: 12px 18px; color: #17130e; background: linear-gradient(90deg, #d6b88f, #b98b58); border-top: 1px solid #e5cba8; border-bottom: 1px solid #8f6b43; font-size: .76rem; font-weight: 950; letter-spacing: .06em; text-transform: uppercase; }
.question-category-heading:first-child { border-top: 0; }
.question-admin-row { min-height: 82px; padding: 13px 18px; display: grid; grid-template-columns: 38px minmax(220px, 1fr) auto auto; align-items: center; gap: 13px; border-bottom: 1px solid var(--line); }
.question-admin-row:last-child { border-bottom: 0; }
.question-admin-row.is-disabled { opacity: .58; background: var(--subtle); }
.question-admin-position { width: 32px; height: 32px; display: grid; place-items: center; color: #fff; background: var(--green-dark); border-radius: 50%; font-size: .72rem; font-weight: 900; }
.question-admin-copy { min-width: 0; }
.question-admin-copy strong, .question-admin-copy span, .question-admin-copy small { display: block; }
.question-admin-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; }
.question-admin-copy span { margin-top: 4px; color: var(--muted); font-size: .7rem; }
.question-admin-copy .question-admin-condition { margin-top: 5px; color: #d6b88f; font-size: .68rem; line-height: 1.35; }
.question-admin-copy .question-admin-device { margin-top: 5px; color: #a9c8df; font-size: .68rem; line-height: 1.35; }
.question-admin-state { padding: 5px 8px; color: #b8ddbf; background: var(--success-bg); border-radius: 999px; font-size: .66rem; font-weight: 900; }
.question-admin-row.is-disabled .question-admin-state { color: #c5c9c3; background: #353a35; }
.question-admin-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.question-admin-actions form { display: flex; }
.mini-button { min-height: 34px; padding: 6px 9px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); background: var(--subtle); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: .68rem; font-weight: 850; line-height: 1; text-decoration: none; }
.mini-button:hover { color: #fff; background: var(--green-dark); border-color: var(--green-dark); }
.mini-button--danger { color: var(--danger); }
.mini-button--danger:hover { background: var(--danger); border-color: var(--danger); }
.question-editor-form { position: sticky; top: 18px; }
.question-editor-form h2 { margin-bottom: 8px; }
.editor-buttons { margin-top: 6px; }

html[data-theme="dark"] .hero__visual::before { background: #2c3a2f; }
html[data-theme="dark"] .notice--info { color: #b8d6e3; background: #24343b; border-color: #355260; }
html[data-theme="dark"] .notice--warning { color: #f2ce89; background: var(--warning-bg); border-color: #594a2b; }
html[data-theme="dark"] .notice--error { color: #f1b4af; background: var(--danger-bg); border-color: #643936; }
html[data-theme="dark"] .notice--success { color: #b8ddbf; background: var(--success-bg); border-color: #36553e; }
html[data-theme="dark"] .status--submitted { color: #f3bea0; background: #503326; }
html[data-theme="dark"] .status--callback,
html[data-theme="dark"] .status--visit_to_plan { color: #efcf83; background: #4a3e20; }
html[data-theme="dark"] .status--visit_planned,
html[data-theme="dark"] .status--quote_to_prepare { color: #acd0e2; background: #263d48; }
html[data-theme="dark"] .status--accepted { color: #b8ddbf; background: var(--success-bg); }
html[data-theme="dark"] .status--closed,
html[data-theme="dark"] .status--draft { color: #c5c9c3; background: #353a35; }

@media (max-width: 980px) {
    .hero { min-height: auto; grid-template-columns: 1fr 390px; gap: 36px; }
    .stat-grid { grid-template-columns: repeat(3, 1fr); }
    .record-grid { grid-template-columns: 280px minmax(0, 1fr); }
    .file-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .shell, .narrow { width: min(100% - 24px, 1180px); }
    .page-space { padding-block: 28px 58px; }
    .topbar { min-height: 70px; padding: 11px 14px; }
    .brand-mark { width: 40px; height: 40px; }
    .brand strong { font-size: .76rem; }
    .brand small { font-size: .64rem; }
    .topbar .small-link { display: none; }
    .mode-pill { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .67rem; }
    .hero { grid-template-columns: 1fr; padding-block: 45px; }
    .hero__visual { order: -1; width: min(100%, 380px); margin-inline: auto; }
    .hero__visual img { aspect-ratio: 16 / 11; }
    .hero__visual::before { inset: -12px 8px 14px -10px; }
    .feature-grid { grid-template-columns: 1fr; padding-bottom: 55px; }
    .feature-card__number { margin-bottom: 20px; }
    .panel { padding: 26px 20px; border-radius: 18px; }
    .question-shell { width: min(100% - 20px, 880px); padding-top: 22px; }
    .question-card { min-height: calc(100vh - 160px); padding: 27px 20px; border-radius: 19px; }
    .question-card-topline { align-items: flex-start; flex-direction: column; }
    .contact-details-grid { grid-template-columns: 1fr; }
    .contact-field--wide { grid-column: auto; }
    .option-grid, .option-grid--compact { grid-template-columns: 1fr; }
    .option-card > span { min-height: 57px; }
    .question-actions { align-items: stretch; }
    .question-actions .button { flex: 1; min-width: 0; padding-inline: 12px; }
    .summary-list > div { grid-template-columns: 1fr; gap: 4px; }
    .summary-list strong { text-align: left; }
    .admin-nav { padding-inline: 14px; gap: 20px; }
    .admin-heading, .record-heading { align-items: flex-start; flex-direction: column; }
    .admin-heading .button { width: 100%; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .filter-bar { grid-template-columns: 1fr; }
    .filter-bar .small-link { text-align: center; }
    .bulk-project-actions { align-items: stretch; flex-direction: column; }
    .bulk-project-actions > span { margin-right: 0; }
    .bulk-project-actions .button { width: 100%; }
    .panel-heading { align-items: flex-start; flex-direction: column; }
    .record-grid, .update-grid, .settings-grid, .question-editor-layout { grid-template-columns: 1fr; }
    .question-editor-form { position: static; }
    .question-admin-row { grid-template-columns: 34px minmax(0, 1fr); }
    .question-admin-state, .question-admin-actions { grid-column: 2; justify-self: start; }
    .question-admin-actions { flex-wrap: wrap; justify-content: flex-start; }
    .record-sidebar { order: 2; }
    .answer-list__item { grid-template-columns: 1fr; gap: 5px; }
    .file-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .data-table th, .data-table td { padding: 13px; }
}

@media (max-width: 440px) {
    .stat-grid, .file-gallery { grid-template-columns: 1fr; }
    .hero__actions, .button-row { flex-direction: column; }
    .hero__actions .button, .button-row .button { width: 100%; }
    .export-links { flex-direction: column; gap: 5px; }
}

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