:root {
    --bg: #fff;
    --surface: #fff;
    --surface-2: #fff;
    --ink: #25211d;
    --muted: #746b63;
    --line: #d9d9d9;
    --accent: #d06a2b;
    --accent-dark: #183d2c;
    --accent-soft: #f0d8c8;
    --green: #277a53;
    --green-soft: #e0f1e8;
    --red: #a23f36;
    --red-soft: #fae6e3;
    --amber: #8b6417;
    --amber-soft: #fbf0cd;
    --shadow: none;
    --radius: 0;
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg); font-family: var(--font); }
button, input, textarea { font: inherit; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: 32px; line-height: 1.08; letter-spacing: -.035em; }
h2 { margin-bottom: 5px; font-size: 20px; letter-spacing: -.02em; }
p { color: var(--muted); line-height: 1.55; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
pre { overflow: auto; padding: 14px 16px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 0; }

.topbar {
    position: sticky; top: 0; z-index: 50; display: grid; grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
    align-items: center; gap: 24px; min-height: 76px; padding: 12px clamp(18px, 4vw, 52px);
    background: #fff; border-bottom: 1px solid rgba(222, 213, 202, .85); backdrop-filter: none;
}
.brand { display: inline-flex; align-items: center; gap: 12px; width: fit-content; text-decoration: none; }
.brand > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.brand strong { font-size: 14px; }
.brand small { color: var(--muted); font-size: 11px; }
.brand-mark {
    display: inline-grid; place-items: center; width: 42px; height: 42px; color: #fff; background: var(--accent-dark);
    border-radius: 0; font-size: 14px; font-weight: 800; letter-spacing: .04em; box-shadow: none;
}
.brand-mark-large { width: 54px; height: 54px; margin-bottom: 20px; border-radius: 0; font-size: 18px; }
.nav { display: flex; align-items: center; gap: 6px; padding: 5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 0; }
.nav a { padding: 9px 15px; color: var(--muted); border-radius: 0; font-size: 13px; font-weight: 650; text-decoration: none; }
.nav a:hover, .nav a.active { color: var(--ink); background: var(--surface); box-shadow: none; }
.user-menu { display: flex; justify-content: flex-end; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; }
.user-menu form { margin: 0; }
.link-button { padding: 0; color: var(--accent-dark); background: none; border: 0; cursor: pointer; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.page-shell { width: min(1480px, calc(100% - 32px)); margin: 0 auto; padding: 44px 0 70px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 28px; margin-bottom: 38px; }
.page-heading h1 { margin-bottom: 0; }
.page-heading p { margin-top: 12px; }
.page-heading p { margin: 12px 0 0; }
.heading-actions { display: flex; align-items: center; gap: 10px; }
.compact-heading { align-items: flex-start; }
.eyebrow { display: inline-block; margin-bottom: 10px; color: var(--accent); font-size: 11px; font-weight: 850; letter-spacing: .16em; }
.back-link { display: inline-block; margin-bottom: 18px; color: var(--accent-dark); font-size: 13px; font-weight: 750; text-decoration: none; }

.button {
    display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 42px; padding: 10px 17px;
    border: 1px solid transparent; border-radius: 0; cursor: pointer; font-weight: 750; font-size: 13px; text-decoration: none;
    transition: border-color .15s ease, background .15s ease;
}
.button:hover { transform: none; }
.button:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.button-primary { color: #fff; background: var(--accent-dark); box-shadow: none; }
.button-primary:hover { background: #102f21; box-shadow: none; }
.button-secondary { color: var(--ink); background: var(--surface); border-color: var(--line); }
.button-secondary:hover { border-color: #b9a999; }
.button-ghost { color: var(--accent-dark); background: transparent; border-color: var(--line); }
.button-large { min-height: 50px; padding: 13px 22px; font-size: 14px; border-radius: 0; }
.button-small { min-height: 34px; padding: 7px 11px; font-size: 11px; border-radius: 0; }
.button-full { width: 100%; }

.alert { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 14px 16px; border: 1px solid; border-radius: 0; font-size: 13px; line-height: 1.5; }
.alert button { color: inherit; background: transparent; border: 0; cursor: pointer; font-size: 20px; line-height: 1; }
.alert-success { color: var(--green); background: #fff; border-color: #b7dcc9; }
.alert-error { color: var(--red); background: #fff; border-color: #e7bbb6; }
.alert-warning { color: var(--amber); background: #fff; border-color: #e7d48f; }

.builder-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); align-items: start; gap: 22px; }
.filter-panel, .results-panel, .form-card, .table-card, .simple-card { background: var(--surface); border: 0; border-radius: 0; box-shadow: none; }
.filter-panel { position: sticky; top: 98px; padding: 22px; }
.results-panel { min-height: 620px; padding: 24px; }
.panel-title, .section-heading { display: flex; align-items: flex-start; gap: 12px; }
.panel-title h2, .section-heading h2 { margin: 1px 0 2px; }
.panel-title p, .section-heading p { margin: 0; font-size: 12px; }
.panel-title-spaced { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.step-number { display: inline-grid; flex: 0 0 29px; place-items: center; width: 29px; height: 29px; color: var(--accent-dark); background: #fff; border-radius: 0; font-size: 12px; font-weight: 850; }
.results-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 22px; }

label { display: grid; gap: 7px; margin-top: 14px; color: var(--ink); font-size: 12px; font-weight: 720; }
label > span { color: var(--muted); font-size: 11px; font-weight: 600; }
input, textarea {
    width: 100%; min-height: 42px; padding: 10px 12px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 0; outline: none;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: none; }
input[type="checkbox"] { width: 18px; min-height: 18px; height: 18px; margin: 0; accent-color: var(--accent-dark); }
fieldset { margin: 18px 0 0; padding: 0; border: 0; }
legend { margin-bottom: -5px; font-size: 12px; font-weight: 750; }
.field-grid { display: grid; gap: 12px; }
.field-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid.one-column { grid-template-columns: 1fr; gap: 0; }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 32px; cursor: pointer; }
.check-row span { color: var(--ink); font-size: 12px; font-weight: 680; }

.bath-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.bath-card { position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 330px; background: #fff; border: 1px solid var(--line); border-radius: 0; transition: border-color .15s ease; }
.bath-card:hover { transform: none; border-color: #c5b7a7; box-shadow: none; }
.bath-card.selected { border-color: var(--accent); box-shadow: none; }
.bath-image { position: relative; overflow: hidden; height: 145px; background: #fff; }
.bath-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bath-placeholder { display: grid; place-items: center; width: 100%; height: 100%; color: rgba(65, 43, 27, .62); font-size: 24px; font-weight: 850; letter-spacing: -.04em; }
.terrace-badge { position: absolute; top: 11px; left: 11px; padding: 6px 9px; color: var(--accent-dark); background: rgba(255, 251, 245, .91); border-radius: 0; font-size: 9px; font-weight: 850; letter-spacing: .05em; }
.source-badge { position: absolute; top: 11px; right: 11px; padding: 6px 8px; color: #fff; background: rgba(43, 35, 29, .74); border-radius: 0; font-size: 9px; font-weight: 800; }
.bath-body { display: flex; flex: 1; flex-direction: column; padding: 15px; }
.bath-body h3 { margin: 0 0 5px; font-size: 17px; letter-spacing: -.02em; }
.bath-size { color: var(--muted); font-size: 11px; }
.bath-price { margin: 13px 0 12px; color: var(--accent-dark); font-size: 15px; font-weight: 850; }
.bath-features { overflow: hidden; display: -webkit-box; min-height: 36px; margin: 0 0 14px; color: var(--muted); font-size: 11px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.bath-card .select-button { width: 100%; margin-top: auto; }
.empty-results { grid-column: 1 / -1; padding: 60px 20px; text-align: center; background: var(--surface-2); border: 1px dashed #c9bcad; border-radius: 0; }
.empty-results strong { display: block; margin-bottom: 7px; }

.selection-panel { margin-top: 24px; padding: 20px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 0; }
.selection-panel > div:first-child { display: flex; justify-content: space-between; gap: 15px; color: var(--muted); font-size: 12px; }
.selection-panel > div:first-child strong { color: var(--ink); font-size: 14px; }
.selected-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.selected-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 8px 7px 11px; color: var(--accent-dark); background: #fff; border: 1px solid var(--accent-soft); border-radius: 0; font-size: 11px; font-weight: 750; }
.chip-button { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; color: var(--muted); background: var(--surface-2); border: 0; border-radius: 0; cursor: pointer; }
.selection-panel > .button { width: 100%; }

.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 18px; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 10px; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
td { padding: 16px 18px; border-bottom: 1px solid var(--line); font-size: 12px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td strong { display: block; margin-bottom: 4px; font-size: 13px; }
td small { display: block; color: var(--muted); line-height: 1.5; }
.row-muted { opacity: .58; }
.row-highlight { background: #fff; }
.actions-cell { display: flex; align-items: center; justify-content: flex-end; gap: 12px; white-space: nowrap; }
.file-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.badge { display: inline-flex; padding: 5px 7px; color: #8a817a; background: #fff; border-radius: 0; font-size: 9px; font-weight: 800; }
.badge-ready { color: var(--green); background: #fff; }
.status { display: inline-flex; padding: 6px 9px; border-radius: 0; font-size: 10px; font-weight: 800; }
.status-active { color: var(--green); background: #fff; }
.status-hidden { color: var(--muted); background: #fff; }
.status-error { color: var(--red); background: #fff; }
.status-pending { color: var(--amber); background: #fff; }

.form-card { min-width: 0; width: 100%; max-width: none; }
.form-card > section { padding: 0; }
.form-card > section + section { margin-top: 40px; }
.form-grid { margin-top: 20px; }
.form-grid label { margin: 0; }
.full-width { grid-column: 1 / -1; }
.upload-section { background: #fff; }
.upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; }
.upload-grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.upload-box { display: flex; flex-direction: column; min-height: 132px; margin: 0; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 0; cursor: pointer; }
.upload-box:hover { border-color: var(--accent); background: #fff; }
.upload-box strong { font-size: 13px; }
.upload-box span { margin: 5px 0 auto; color: var(--muted); font-size: 10px; }
.upload-box input { min-height: auto; padding: 8px 0 0; border: 0; font-size: 10px; }
.current-files { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 15px; color: var(--muted); font-size: 11px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 32px; padding: 0; background: #fff; border: 0; }

.guest-body { padding: 0; background: #fff; }
.guest-shell {
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    width: 100%; min-height: 100vh; padding: 32px;
}
.guest-shell > .alert { width: min(380px, 100%); border-radius: 0; }
.auth-card {
    display: block; width: min(380px, 100%); min-height: 0; padding: 0;
    background: #fff; border: 0; border-radius: 0; box-shadow: none;
}
.auth-form { display: block; padding: 0; }
.auth-form h1 { margin: 0 0 32px; color: #111; font-size: 32px; line-height: 1.15; letter-spacing: -.02em; }
.auth-form label { gap: 8px; margin-top: 18px; color: #111; font-size: 13px; font-weight: 600; }
.auth-form input {
    min-height: 46px; padding: 10px 12px; color: #111; background: #fff;
    border: 1px solid #777; border-radius: 0; box-shadow: none;
}
.auth-form input:focus { border-color: #111; box-shadow: none; }
.auth-form .button {
    margin-top: 28px; border-color: #111; border-radius: 0;
    color: #fff; background: #111; box-shadow: none; transition: background .15s ease;
}
.auth-form .button:hover { transform: none; background: #333; box-shadow: none; }
.muted { color: var(--muted); }
.simple-card { width: 100%; max-width: none; margin: 0; padding: 0; }
.setup-card p { max-width: 580px; }
.empty-page { padding: 55px 24px; text-align: center; }
.import-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); align-items: start; gap: 40px; }
.import-card { max-width: none; }
.import-upload { min-height: 170px; margin-top: 22px; }
.import-help { max-width: none; margin: 0; }
.source-map { display: grid; gap: 10px; margin: 24px 0; padding: 0; list-style: none; }
.source-map li { display: grid; grid-template-columns: 88px 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.source-map li:last-child { border-bottom: 0; }
.source-map strong { color: var(--accent-dark); font-size: 12px; }
.source-map span { color: var(--muted); font-size: 12px; }

/* Единый интерфейс: белый лист без декоративных карточек. */
.app-body { background: #fff; }
.app-body .topbar {
    position: static; min-height: 64px; background: #fff;
    border-bottom: 0; backdrop-filter: none;
}
.app-body .brand-mark { border-radius: 0; box-shadow: none; }
.app-body .nav { padding: 0; background: #fff; border: 0; border-radius: 0; }
.app-body .nav a { border-radius: 0; }
.app-body .nav a:hover,
.app-body .nav a.active {
    background: #fff; box-shadow: none; text-decoration: underline;
    text-decoration-thickness: 2px; text-underline-offset: 6px;
}
.app-body .page-shell { padding-top: 32px; }
.app-body .builder-heading { align-items: center; margin-bottom: 38px; }
.app-body .builder-heading h1 { margin: 0; font-size: 32px; }
.app-body .button,
.app-body input,
.app-body textarea,
.app-body .alert,
.app-body .terrace-badge,
.app-body .selected-chip,
.app-body .chip-button,
.app-body .empty-results {
    border-radius: 0; box-shadow: none;
}
.app-body .button:hover { transform: none; box-shadow: none; }
.app-body input:focus,
.app-body textarea:focus { box-shadow: none; }
.app-body .builder-layout { display: block; }
.app-body .filter-panel,
.app-body .results-panel {
    position: static; min-height: 0; padding: 0;
    background: #fff; border: 0; border-radius: 0; box-shadow: none;
}
.app-body .filter-panel { margin-bottom: 52px; }
.app-body .panel-title { display: block; }
.app-body .panel-title h2 { margin: 0; font-size: 20px; }
.app-body .panel-title-spaced { margin-top: 34px; padding-top: 0; border-top: 0; }
.app-body .filter-panel > .field-grid.one-column {
    grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 18px;
}
.app-body .filter-panel > .field-grid.one-column label { margin-top: 0; }
.app-body .filter-fields {
    display: grid; grid-template-columns: 1.1fr repeat(3, minmax(210px, 1fr));
    align-items: end; gap: 18px; margin-top: 18px;
}
.app-body .filter-fields > label,
.app-body .filter-fields > fieldset { margin: 0; }
.app-body .filter-fields > .check-row { align-self: center; }
.app-body .filter-fields > .button { justify-self: start; }
.app-body .filter-fields fieldset label { margin-top: 14px; }
.app-body .results-header { align-items: center; margin-bottom: 20px; }
.app-body .bath-grid { gap: 24px 18px; }
.app-body .bath-card {
    min-height: 0; overflow: visible; background: #fff;
    border: 0; border-radius: 0; box-shadow: none; transition: none;
}
.app-body .bath-card:hover,
.app-body .bath-card.selected { transform: none; border: 0; box-shadow: none; }
.app-body .bath-card.selected .bath-image { outline: 2px solid #111; outline-offset: -2px; }
.app-body .bath-image { border-radius: 0; background: #fff; }
.app-body .source-badge,
.app-body .bath-features { display: none; }
.app-body .terrace-badge { color: #111; background: rgba(255, 255, 255, .94); }
.app-body .bath-body { padding: 12px 0 0; }
.app-body .bath-price { margin: 10px 0 14px; color: #111; }
.app-body .selection-panel {
    margin-top: 48px; padding: 0; background: #fff;
    border: 0; border-radius: 0;
}
.app-body .selection-panel > div:first-child { display: block; color: #111; }
.app-body .selected-list { gap: 8px 16px; margin: 16px 0 22px; }
.app-body .selected-chip { padding: 4px 0; color: #111; background: #fff; border: 0; }
.app-body .chip-button { color: #111; background: #fff; border: 1px solid #aaa; }
.app-body .selection-panel > .button { width: auto; min-width: 220px; }
.app-body .empty-results { padding: 40px 0; background: #fff; border: 0; text-align: left; }

@media (max-width: 1120px) {
    .topbar { grid-template-columns: 1fr auto; }
    .nav { order: 3; grid-column: 1 / -1; justify-self: center; }
    .builder-layout { grid-template-columns: 310px minmax(0, 1fr); }
    .bath-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .app-body .filter-panel > .field-grid.one-column,
    .app-body .filter-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .topbar { position: static; display: flex; flex-wrap: wrap; padding: 12px 16px; }
    .brand { flex: 1; }
    .brand small, .user-menu > span { display: none; }
    .nav { order: 3; overflow-x: auto; width: 100%; justify-content: stretch; }
    .nav a { flex: 1; text-align: center; white-space: nowrap; }
    .page-shell { width: min(100% - 22px, 1480px); padding-top: 26px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .heading-actions { width: 100%; }
    .heading-actions .button { flex: 1; }
    .builder-layout { grid-template-columns: 1fr; }
    .filter-panel { position: static; }
    .bath-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .upload-grid { grid-template-columns: 1fr; }
    .import-layout { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    h1 { font-size: 30px; }
    .results-panel, .filter-panel { padding: 17px; }
    .bath-grid { grid-template-columns: 1fr; }
    .bath-image { height: 170px; }
    .field-grid.two-columns { grid-template-columns: 1fr 1fr; }
    .form-grid.two-columns { grid-template-columns: 1fr; }
    .form-grid .full-width { grid-column: auto; }
    .selection-panel > div:first-child { flex-direction: column; }
    .results-header { align-items: stretch; flex-direction: column; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .button { width: 100%; }
    .guest-shell { padding: 24px; }
    .app-body .filter-panel > .field-grid.one-column,
    .app-body .filter-fields { grid-template-columns: 1fr; }
    .app-body .filter-fields fieldset .field-grid.two-columns { grid-template-columns: 1fr 1fr; }
    .app-body .selection-panel > .button { width: 100%; }
}

/* Опции содержания создаваемого КП. */
.proposal-options { margin: 0 0 24px; }
.proposal-options legend { margin-bottom: 6px; font-size: 14px; }
.proposal-options .check-row { width: fit-content; }
.proposal-options p { margin: 4px 0 12px 28px; max-width: 680px; font-size: 12px; }
.proposal-options input:disabled + span { color: var(--muted); }

/* Manual proposal, following the existing simple interface. */
.manual-form { display: grid; gap: 40px; width: 100%; max-width: none; margin: 0 0 40px; }
.manual-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.manual-form .simple-card { padding: 0; min-width: 0; }
.manual-form h2 { margin: 0 0 20px; font-size: 20px; }
.manual-form select { width: 100%; padding: 12px; border: 1px solid #d9dfdb; border-radius: 0; background: white; font: inherit; color: inherit; }
.manual-help, .manual-submit span { color: #647168; font-size: 14px; line-height: 1.5; }
.manual-form details { margin-top: 16px; }
.manual-form summary { cursor: pointer; font-weight: 600; }
.manual-form ol { padding-left: 24px; line-height: 1.6; }
.manual-preview { height: 250px; background: #fff; border: 1px solid var(--line); border-radius: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 18px; color: #647168; }
.manual-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.manual-preview [hidden], .manual-form [hidden] { display: none !important; }
.manual-file-label { display: grid; gap: 10px; font-weight: 600; }
.manual-file-label input { max-width: 100%; padding: 8px; }
.manual-file-error { color: #a72c24; font-size: 14px; }
.manual-file-error:empty { display: none; }
.manual-submit { display: flex; align-items: center; gap: 20px; }
@media (max-width: 760px) {
    .manual-columns, .manual-form .two-columns { grid-template-columns: 1fr; }
    .manual-submit { align-items: stretch; flex-direction: column; }
    .manual-form .simple-card { padding: 0; }
}

/* Общие элементы и фокус с клавиатуры на всех страницах. */
button, input, textarea, select { font: inherit; }
select { min-height: 42px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 0; }
input:focus, textarea:focus, select:focus { border-color: var(--accent-dark); outline: 1px solid var(--accent-dark); outline-offset: 0; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 3px; }
input::file-selector-button { padding: 8px 12px; margin-right: 12px; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 0; cursor: pointer; }
.step-number, .page-heading .eyebrow, .import-help > .eyebrow { display: none; }
.badge, .status { padding: 4px 0; background: #fff; }
.file-badges { gap: 12px; }
.row-highlight td:first-child { border-left: 2px solid var(--accent-dark); }
.guest-shell .setup-card { max-width: 680px; }
@media (max-width: 560px) {
    .app-body .builder-heading h1, h1 { font-size: 30px; }
    .manual-columns { gap: 32px; }
}

.account-form { width: 100%; max-width: 900px; }
.account-form select { width: 100%; padding: 10px 12px; }
.account-form .manual-help { margin-top: 20px; }
.account-link { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 28px; }
@media (max-width: 560px) { .account-form .two-columns { grid-template-columns: 1fr; } }

/* Individual floor-plan editor. */
.planner-form { display: grid; gap: 34px; margin-bottom: 48px; }
.planner-page-heading { align-items: center; }
.planner-meta { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.35fr); gap: 34px; }
.planner-meta-group { min-width: 0; }
.planner-meta-group h2,
.planner-tools h2,
.planner-properties h2,
.planner-projects h2 { margin: 0 0 16px; font-size: 18px; }
.field-grid.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.planner-manager-fields { margin-top: 14px; }
.planner-main { display: grid; grid-template-columns: 210px minmax(520px, 1fr) 250px; gap: 22px; align-items: stretch; min-height: 720px; }
.planner-tools,
.planner-properties { border-top: 1px solid var(--line); padding-top: 18px; min-width: 0; }
.planner-tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.planner-tool { min-height: 38px; padding: 7px 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; text-align: left; }
.planner-tool:hover { border-color: #8b958f; }
.planner-tool.active { border-color: var(--accent-dark); outline: 1px solid var(--accent-dark); font-weight: 700; }
.planner-tool-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 18px; }
.planner-tool-actions .button { min-width: 0; padding-left: 8px; padding-right: 8px; }
.planner-snap { margin-top: 18px; }
.planner-tools > label:not(.check-row) { display: grid; gap: 6px; margin-top: 14px; font-size: 13px; font-weight: 600; }
.planner-tools > label input { width: 100%; }
.planner-workspace { min-width: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.planner-canvas-wrap { min-height: 680px; width: 100%; border: 1px solid var(--line); background: #f7f8f7; overflow: hidden; touch-action: none; }
#planner-canvas { display: block; width: 100%; height: 100%; min-height: 680px; cursor: crosshair; user-select: none; }
.planner-svg-object { cursor: move; }
.planner-svg-object.is-selected { filter: drop-shadow(0 0 20px rgba(184,109,61,.72)); }
.planner-status { min-height: 36px; padding: 9px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.planner-properties { overflow: auto; max-height: 760px; }
.planner-property-title { display: block; margin-bottom: 14px; font-size: 15px; }
.planner-property-fields { display: grid; gap: 12px; }
.planner-property-fields label { display: grid; gap: 5px; font-size: 12px; font-weight: 600; }
.planner-property-fields input,
.planner-property-fields select { width: 100%; min-width: 0; }
.planner-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .55fr); gap: 38px; align-items: start; border-top: 1px solid var(--line); padding-top: 28px; }
.planner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.planner-actions .manual-help { flex-basis: 100%; margin: 0; }
.planner-project-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.planner-project-link { display: grid; gap: 3px; padding: 11px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.planner-project-link:hover strong,
.planner-project-link.active strong { text-decoration: underline; text-underline-offset: 4px; }
.planner-project-link span,
.planner-project-link small { color: var(--muted); font-size: 12px; }

.planner-focus-mode .topbar,
.planner-focus-mode .planner-meta,
.planner-focus-mode .planner-bottom,
.planner-focus-mode .planner-page-heading > div:first-child { display: none !important; }
.planner-focus-mode .page-shell { width: calc(100% - 24px); max-width: none; padding: 12px 0; }
.planner-focus-mode .planner-page-heading { margin: 0 0 10px; justify-content: flex-end; }
.planner-focus-mode .planner-form { gap: 10px; margin: 0; }
.planner-focus-mode .planner-main { grid-template-columns: 190px minmax(620px, 1fr) 240px; min-height: calc(100vh - 94px); }
.planner-focus-mode .planner-canvas-wrap,
.planner-focus-mode #planner-canvas { min-height: calc(100vh - 130px); }

@media (max-width: 1180px) {
    .planner-meta { grid-template-columns: 1fr; }
    .planner-main { grid-template-columns: 190px minmax(440px, 1fr); }
    .planner-properties { grid-column: 1 / -1; max-height: none; }
    .planner-property-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .planner-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
    .field-grid.three-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .planner-main { grid-template-columns: 1fr; min-height: 0; }
    .planner-tools { order: 2; }
    .planner-workspace { order: 1; }
    .planner-properties { order: 3; grid-column: auto; }
    .planner-tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .planner-tool-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .planner-canvas-wrap,
    #planner-canvas { min-height: 560px; }
    .planner-property-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .planner-focus-mode .planner-main { grid-template-columns: 1fr; }
    .planner-focus-mode .planner-canvas-wrap,
    .planner-focus-mode #planner-canvas { min-height: 70vh; }
}
@media (max-width: 560px) {
    .field-grid.three-columns,
    .planner-size-fields,
    .planner-manager-fields { grid-template-columns: 1fr; }
    .planner-tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .planner-property-fields { grid-template-columns: 1fr 1fr; }
    .planner-actions { align-items: stretch; flex-direction: column; }
    .planner-actions .button { width: 100%; }
    .planner-canvas-wrap,
    #planner-canvas { min-height: 470px; }
}

/* Stage 2 of the individual planner: templates, analysis, sharing and complexes. */
.planner-share-bar,
.planner-complex-bar,
.planner-quick-start { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 16px 0; }
.planner-share-bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.planner-share-bar > div { display: grid; gap: 6px; min-width: 0; flex: 1; }
.planner-share-bar small,
.planner-complex-bar small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.planner-share-link { display: flex; gap: 8px; align-items: center; }
.planner-share-link input { min-width: 0; width: min(620px, 100%); }
.planner-complex-fields { display: grid; grid-template-columns: minmax(240px, 1.1fr) minmax(220px, .8fr) minmax(220px, .8fr); gap: 22px; align-items: end; }
.planner-complex-fields > div { display: grid; gap: 5px; align-self: center; }
.planner-complex-fields label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.planner-complex-fields select,
.planner-complex-fields input { width: 100%; }
.planner-complex-objects { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 14px; }
.planner-complex-objects > strong { margin-right: 4px; }
.planner-complex-objects a { color: var(--ink); font-size: 12px; text-underline-offset: 3px; }
.planner-complex-objects a.active { font-weight: 700; color: var(--accent-dark); }
.planner-quick-start { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: end; }
.planner-quick-start > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.planner-quick-start strong { font-size: 13px; }
.planner-quick-start select { min-width: 180px; }
.planner-quick-start .inline-mini { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 600; }
.planner-quick-start .inline-mini input { width: 96px; min-height: 38px; }
.planner-analysis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.planner-analysis-card { min-width: 0; border-top: 1px solid var(--line); padding-top: 16px; }
.planner-analysis-card h2 { margin: 0 0 14px; font-size: 18px; }
.planner-metric { display: grid; gap: 2px; margin-bottom: 12px; }
.planner-metric strong { font-size: 24px; line-height: 1.1; }
.planner-metric span { color: var(--muted); font-size: 12px; }
.planner-summary-row { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px solid #edf0ee; font-size: 12px; }
.planner-summary-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.planner-summary-row strong { white-space: nowrap; }
.planner-warning-row { margin: 0 0 7px; padding-left: 14px; position: relative; color: #8a3b25; font-size: 12px; line-height: 1.4; }
.planner-warning-row::before { content: "!"; position: absolute; left: 0; top: 0; font-weight: 800; }
.planner-check-ok { color: #315d42; font-size: 12px; line-height: 1.5; }
.planner-property-area { margin: 2px 0 0; color: var(--accent-dark); font-size: 12px; font-weight: 700; }
.planner-version-list { display: grid; margin-bottom: 22px; border-top: 1px solid var(--line); }
.planner-version-link { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 12px; }
.planner-version-link span { color: var(--muted); }
.planner-version-link.active strong,
.planner-version-link:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.planner-svg-object.selected { filter: drop-shadow(0 0 20px rgba(184,109,61,.72)); }

.guest-body { background: #f4f4f1; color: var(--ink); }
.guest-shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 36px 0 56px; }
.shared-plan-page { display: grid; gap: 22px; }
.shared-plan-hero { padding: 26px 30px; background: #fff; border-top: 4px solid var(--accent-dark); }
.shared-plan-hero .eyebrow { color: var(--accent-dark); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.shared-plan-hero h1 { margin: 7px 0 5px; }
.shared-plan-hero p { margin: 0; color: var(--muted); }
.shared-plan-card { background: #fff; padding: 24px; border: 1px solid var(--line); }
.shared-plan-card h2 { margin-top: 0; }
.shared-plan-image { display: block; width: 100%; max-height: 72vh; object-fit: contain; background: #fff; }
.shared-plan-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.shared-plan-summary > div { display: grid; gap: 5px; padding: 18px; background: #fff; }
.shared-plan-summary strong { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.shared-plan-summary span { font-size: 20px; font-weight: 700; }
.shared-room-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 24px; }
.shared-room-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.shared-plan-note { margin: 0; color: var(--muted); font-size: 12px; }

@media (max-width: 980px) {
    .planner-complex-fields { grid-template-columns: 1fr 1fr; }
    .planner-complex-fields > div { grid-column: 1 / -1; }
    .planner-analysis { grid-template-columns: 1fr; }
    .shared-plan-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 680px) {
    .planner-share-bar { align-items: stretch; flex-direction: column; }
    .planner-share-link { align-items: stretch; flex-direction: column; }
    .planner-complex-fields { grid-template-columns: 1fr; }
    .planner-complex-fields > div { grid-column: auto; }
    .planner-quick-start { align-items: stretch; flex-direction: column; }
    .planner-quick-start > div { align-items: stretch; flex-direction: column; }
    .planner-quick-start select { width: 100%; }
    .shared-room-list { grid-template-columns: 1fr; }
}

/* In client-demo mode keep the editing tools visible, but remove nonessential panels. */
.planner-focus-mode .planner-share-bar,
.planner-focus-mode .planner-complex-bar,
.planner-focus-mode .planner-quick-start,
.planner-focus-mode .planner-analysis,
.planner-focus-mode .planner-bottom { display: none !important; }
.planner-main:fullscreen { background: var(--paper, #fff); padding: 14px; box-sizing: border-box; width: 100vw; height: 100vh; }
.planner-main:fullscreen .planner-canvas-wrap,
.planner-main:fullscreen #planner-canvas { min-height: calc(100vh - 28px); }

/* Stage 3: visual site planner for multi-object complexes. */
.complex-form { display: grid; gap: 22px; }
.complex-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 18px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.complex-meta label { margin: 0; }
.complex-editor { display: grid; grid-template-columns: 235px minmax(560px, 1fr) 285px; gap: 14px; min-height: 690px; }
.complex-tools, .complex-properties { min-width: 0; padding: 16px; border: 1px solid var(--line); background: #fff; }
.complex-tools h2, .complex-properties h2 { margin: 0 0 13px; font-size: 15px; }
.complex-tools > small { display: block; margin: 9px 0 18px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.complex-size-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.complex-size-grid label { margin: 0; font-size: 10px; }
.complex-size-grid select { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); background: #fff; }
.complex-object-library { display: grid; gap: 7px; margin-top: 18px; }
.complex-object-library h2 { margin-bottom: 4px; }
.complex-project-add { display: grid; gap: 3px; width: 100%; padding: 10px 11px; text-align: left; color: var(--ink); background: #fff; border: 1px solid var(--line); cursor: pointer; }
.complex-project-add:hover { border-color: var(--accent); }
.complex-project-add.placed { border-left: 3px solid var(--accent); background: #fbf7f2; }
.complex-project-add strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.complex-project-add span { color: var(--muted); font-size: 9px; line-height: 1.35; }
.complex-new-object { width: 100%; margin-top: 14px; }
.complex-workspace { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; border: 1px solid var(--line); background: #f7f8f6; }
.complex-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: #fff; }
.complex-toolbar > span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.complex-toolbar > div { display: flex; gap: 6px; }
.complex-canvas-wrap { overflow: hidden; display: grid; place-items: center; min-height: 640px; padding: 18px; background: #f4f6f4; }
#complex-canvas { width: 100%; height: 100%; min-height: 600px; touch-action: none; user-select: none; }
.complex-site-object { cursor: grab; }
.complex-site-object:active { cursor: grabbing; }
.complex-site-object.selected { filter: drop-shadow(0 0 24px rgba(184,109,61,.48)); }
.complex-properties { overflow: auto; }
.complex-properties > #complex-property-panel { display: grid; gap: 6px; }
.complex-properties > #complex-property-panel[hidden] { display: none; }
.complex-properties #complex-object-name { font-size: 14px; }
.complex-properties #complex-object-type { font-size: 10px; }
.complex-property-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 11px; }
.complex-property-grid label { margin: 0; font-size: 9px; }
.complex-property-grid label:last-child { grid-column: 1 / -1; }
.complex-property-grid select { width: 100%; min-height: 42px; padding: 8px; border: 1px solid var(--line); background: #fff; }
.complex-distance-list { display: grid; margin-top: 12px; border-top: 1px solid var(--line); }
.complex-distance-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid #edf0ee; font-size: 10px; }
.complex-distance-list span { color: var(--muted); }
.complex-property-actions { display: grid; gap: 7px; margin-top: 13px; }
.complex-property-actions .button { width: 100%; text-align: center; }
.complex-checks, .complex-totals { margin-top: 22px; padding-top: 15px; border-top: 1px solid var(--line); }
.complex-attach-row { display: grid; grid-template-columns: minmax(260px,1fr) minmax(260px,.8fr) auto; gap: 16px; align-items: end; padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.complex-attach-row > div { display: grid; gap: 4px; }
.complex-attach-row small { color: var(--muted); font-size: 10px; }
.complex-attach-row select { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); background: #fff; }
.complex-actions { display: flex; justify-content: flex-end; gap: 10px; }
.complex-share-bar { margin-bottom: 20px; }

.complex-focus-mode .topbar,
.complex-focus-mode .complex-meta,
.complex-focus-mode .complex-share-bar,
.complex-focus-mode .complex-attach-row,
.complex-focus-mode .complex-actions,
.complex-focus-mode .complex-page-heading > div:first-child { display: none !important; }
.complex-focus-mode .page-shell { width: calc(100% - 20px); max-width: none; padding: 10px 0; }
.complex-focus-mode .complex-page-heading { margin: 0 0 8px; justify-content: flex-end; }
.complex-focus-mode .complex-form { gap: 8px; }
.complex-focus-mode .complex-editor { grid-template-columns: 210px minmax(650px, 1fr) 260px; min-height: calc(100vh - 84px); }
.complex-focus-mode .complex-canvas-wrap, .complex-focus-mode #complex-canvas { min-height: calc(100vh - 136px); }

@media (max-width: 1180px) {
    .complex-meta { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .complex-editor { grid-template-columns: 210px minmax(480px,1fr); }
    .complex-properties { grid-column: 1 / -1; }
    .complex-focus-mode .complex-editor { grid-template-columns: 200px minmax(520px,1fr); }
    .complex-focus-mode .complex-properties { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
    .complex-meta { grid-template-columns: 1fr; }
    .complex-editor { grid-template-columns: 1fr; }
    .complex-tools { order: 2; }
    .complex-workspace { order: 1; }
    .complex-properties { order: 3; grid-column: auto; }
    .complex-canvas-wrap, #complex-canvas { min-height: 520px; }
    .complex-attach-row { grid-template-columns: 1fr; }
    .complex-focus-mode .complex-editor { grid-template-columns: 1fr; }
}
.complex-site-library { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.complex-site-library > small { display: block; margin-top: 9px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.complex-site-tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.complex-site-tool-grid button { min-height: 34px; padding: 7px 8px; color: var(--ink); background: #fff; border: 1px solid var(--line); font-size: 9px; cursor: pointer; }
.complex-site-tool-grid button:hover { border-color: var(--accent); }

/* v0.9.2: building choices are visible directly in the site element library. */
.complex-library-subtitle { display: block; margin: 12px 0 7px; font-size: 10px; font-weight: 700; color: var(--ink); }
.complex-site-library h2 + .complex-library-subtitle { margin-top: 4px; }
.complex-building-tool-grid button { font-weight: 600; }
.complex-full-preset { width: 100%; margin-top: 7px; white-space: normal; line-height: 1.25; }

/* Planner v0.10: dedicated object rail + 2D plan + dependency-free live 3D. */
.planner-viewbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.planner-view-tabs,
.planner-view-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.planner-view-tab {
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    background: #f2f4f2;
    color: var(--ink);
    cursor: pointer;
    font-weight: 600;
}
.planner-view-tab.active { background: #fff; border-color: var(--accent-dark); box-shadow: inset 0 -2px 0 var(--accent-dark); }
.planner-roof-toggle { margin: 0 6px 0 10px; white-space: nowrap; }

.planner-main {
    grid-template-columns: 250px minmax(380px, 1fr) minmax(380px, 1fr);
    gap: 12px;
    min-height: 640px;
    height: clamp(640px, 72vh, 820px);
    align-items: stretch;
}
.planner-sidebar {
    min-width: 0;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #fff;
}
.planner-sidebar-scroll {
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 16px 12px 24px;
}
.planner-tools,
.planner-properties { border-top: 0; padding-top: 0; min-width: 0; }
.planner-tools h2,
.planner-properties h2 { margin-bottom: 12px; font-size: 16px; }
.planner-tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.planner-tool { min-height: 42px; text-align: center; font-size: 12px; line-height: 1.2; }
.planner-tool-actions { margin-top: 14px; }
.planner-properties {
    overflow: visible;
    max-height: none;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}
.planner-property-fields { gap: 9px; }
.planner-property-fields input,
.planner-property-fields select { min-height: 38px; }

.planner-workspace {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    border: 1px solid var(--line);
    background: #fff;
}
.planner-pane-head {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: #f7f8f7;
}
.planner-pane-head span { font-weight: 700; font-size: 13px; }
.planner-pane-head small { color: var(--muted); font-size: 10px; text-align: right; }
.planner-canvas-wrap {
    min-height: 0;
    height: 100%;
    border: 0;
    background: #fafbfa;
}
#planner-canvas { min-height: 0; height: 100%; }
.planner-workspace > .planner-status { padding: 8px 12px 10px; border-top: 1px solid var(--line); min-height: 42px; }

.planner-3d-wrap {
    position: relative;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    background: linear-gradient(#f5f6f4,#e8ebe8);
    touch-action: none;
}
#planner-3d-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
    user-select: none;
}
#planner-3d-canvas:active { cursor: grabbing; }
.planner-3d-hint {
    position: absolute;
    left: 12px;
    bottom: 10px;
    padding: 6px 8px;
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(50,60,54,.12);
    color: #667168;
    font-size: 10px;
    pointer-events: none;
}

.planner-main[data-view="plan"] { grid-template-columns: 250px minmax(0, 1fr); }
.planner-main[data-view="plan"] .planner-3d-workspace { display: none; }
.planner-main[data-view="3d"] { grid-template-columns: 250px minmax(0, 1fr); }
.planner-main[data-view="3d"] .planner-plan-workspace { display: none; }

.planner-focus-mode .planner-share-bar,
.planner-focus-mode .planner-complex-bar,
.planner-focus-mode .planner-quick-start,
.planner-focus-mode .planner-analysis { display: none !important; }
.planner-focus-mode .planner-viewbar { padding: 6px 0; }
.planner-focus-mode .planner-main {
    grid-template-columns: 250px minmax(380px, 1fr) minmax(380px, 1fr);
    height: calc(100vh - 116px);
    min-height: 520px;
}
.planner-focus-mode .planner-main[data-view="plan"],
.planner-focus-mode .planner-main[data-view="3d"] { grid-template-columns: 250px minmax(0, 1fr); }
.planner-focus-mode .planner-canvas-wrap,
.planner-focus-mode #planner-canvas { min-height: 0; height: 100%; }

@media (max-width: 1180px) {
    .planner-main { grid-template-columns: 220px minmax(340px, 1fr) minmax(340px, 1fr); }
    .planner-main[data-view="plan"], .planner-main[data-view="3d"] { grid-template-columns: 220px minmax(0, 1fr); }
    .planner-property-fields { grid-template-columns: 1fr; }
    .planner-focus-mode .planner-main { grid-template-columns: 220px minmax(340px, 1fr) minmax(340px, 1fr); }
    .planner-focus-mode .planner-main[data-view="plan"], .planner-focus-mode .planner-main[data-view="3d"] { grid-template-columns: 220px minmax(0, 1fr); }
}
@media (max-width: 940px) {
    .planner-viewbar { align-items: flex-start; flex-direction: column; }
    .planner-main,
    .planner-main[data-view="plan"],
    .planner-main[data-view="3d"] {
        height: auto;
        grid-template-columns: 1fr;
    }
    .planner-sidebar { height: 420px; }
    .planner-plan-workspace,
    .planner-3d-workspace { min-height: 600px; }
    .planner-main[data-view="plan"] .planner-3d-workspace,
    .planner-main[data-view="3d"] .planner-plan-workspace { display: none; }
    .planner-focus-mode .planner-main,
    .planner-focus-mode .planner-main[data-view="plan"],
    .planner-focus-mode .planner-main[data-view="3d"] { grid-template-columns: 1fr; height: auto; }
}
@media (max-width: 560px) {
    .planner-view-actions .planner-roof-toggle { margin-left: 0; }
    .planner-sidebar { height: 390px; }
    .planner-plan-workspace,
    .planner-3d-workspace { min-height: 500px; }
}

/* v0.10.2: editable client share for individual plans. */
.guest-shell-wide { width: min(1580px, calc(100% - 24px)); max-width: none; padding-top: 20px; }
.planner-share-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.planner-share-actions form { margin: 0; }
.shared-plan-editor { display: grid; gap: 16px; }
.shared-client-heading { margin-bottom: 0; }
.shared-client-heading .eyebrow { display: block; margin-bottom: 5px; color: var(--accent-dark); font-size: 10px; font-weight: 800; letter-spacing: .09em; }
.shared-client-planner { gap: 16px; margin-bottom: 24px; }
.shared-client-dimensions {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(140px, 190px));
    gap: 12px;
    align-items: end;
    padding: 14px 16px;
    border: 1px solid var(--line);
    background: #fff;
}
.shared-client-dimensions > div { display: grid; gap: 3px; align-self: center; }
.shared-client-dimensions > div small { color: var(--muted); font-size: 11px; }
.shared-client-dimensions label { display: grid; gap: 5px; font-size: 11px; font-weight: 700; }
.shared-client-dimensions input { width: 100%; min-width: 0; }
.shared-client-savebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 20px;
    align-items: center;
    padding: 18px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--accent-dark);
    background: #fff;
    position: sticky;
    bottom: 8px;
    z-index: 20;
    box-shadow: 0 8px 30px rgba(34,44,39,.08);
}
.shared-client-savebar > div { display: grid; gap: 4px; }
.shared-client-savebar small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.shared-client-savebar #planner-save-status { grid-column: 1 / -1; margin: 0; }
.shared-plan-editor .planner-main { height: clamp(620px, 70vh, 820px); }
.shared-plan-editor .planner-sidebar-scroll { padding-bottom: 42px; }
.planner-focus-mode .shared-client-dimensions,
.planner-focus-mode .shared-client-savebar { display: none !important; }

@media (max-width: 900px) {
    .guest-shell-wide { width: min(100% - 16px, 1580px); }
    .shared-client-dimensions { grid-template-columns: 1fr 1fr; }
    .shared-client-dimensions > div { grid-column: 1 / -1; }
    .shared-client-savebar { grid-template-columns: 1fr; }
    .shared-client-savebar .button { width: 100%; }
}
@media (max-width: 560px) {
    .shared-client-dimensions { grid-template-columns: 1fr; }
    .shared-client-dimensions > div { grid-column: auto; }
}
