/* ==========================================================================
   A Quiet Eye (עין שקטה) — main stylesheet
   The house as a calm control panel: navy walls, quiet status chips, one red light.
   RTL-first, logical properties throughout. Prefix: qe-
   ========================================================================== */

/* ---------- Fonts (self-hosted, subset by unicode-range) ---------- */
@font-face { font-family: "Noto Sans Hebrew"; src: url(../fonts/noto-hebrew.woff2) format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Noto Sans Hebrew"; src: url(../fonts/noto-latin.woff2) format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Heebo"; src: url(../fonts/heebo-hebrew.woff2) format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Heebo"; src: url(../fonts/heebo-latin.woff2) format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Suez One"; src: url(../fonts/suez-hebrew.woff2) format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Suez One"; src: url(../fonts/suez-latin.woff2) format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Tokens ---------- */
:root {
    --navy: #1D3557;
    --navy-deep: #12233D;
    --red: #E63946;

    --bg: #F2F5F9;
    --surface: #FFFFFF;
    --surface-2: #EAF0F7;
    --line: #D3DCE7;
    --line-strong: #A9B7C9;
    --ink: #14223A;
    --muted: #4B596E;
    --link: #1E4D8A;
    --focus: #1F62C4;
    --chip-bg: #E3EBF5;
    --chip-ink: #1D3557;
    --dot: #3B71B3;
    --wall: #1D3557;
    --paving: rgba(29, 53, 87, .13);
    --btn-bg: #1D3557;
    --btn-ink: #FFFFFF;
    --shadow: 0 1px 2px rgba(18, 35, 61, .06), 0 8px 24px -12px rgba(18, 35, 61, .18);

    --mk-house: #1D3557; --mk-eye: #F4F6F9; --mk-iris: #1D3557; --mk-lens: #F4F6F9;

    --font-body: "Noto Sans Hebrew", "Arial Hebrew", Arial, sans-serif;
    --font-head: "Heebo", "Noto Sans Hebrew", Arial, sans-serif;
    --font-logo: "Suez One", "Heebo", serif;

    --wrap: 1240px;
    --wrap-mid: 1080px;
    --radius: 14px;
    --gutter: clamp(16px, 4vw, 32px);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-mode="light"]) {
        --bg: #0B1422; --surface: #111E31; --surface-2: #17273F; --line: #24364F; --line-strong: #3A5070;
        --ink: #E4EAF2; --muted: #A5B2C5; --link: #8EB9EF; --focus: #8EB9EF;
        --chip-bg: #1B2D48; --chip-ink: #D3E0F1; --dot: #74A6E2; --wall: #6F8DB5; --paving: rgba(165, 190, 225, .12);
        --btn-bg: #DCE5F0; --btn-ink: #0B1422;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
        --mk-house: #DCE5F0; --mk-eye: #0B1422; --mk-iris: #DCE5F0; --mk-lens: #0B1422;
        color-scheme: dark;
    }
}
:root[data-mode="dark"] {
    --bg: #0B1422; --surface: #111E31; --surface-2: #17273F; --line: #24364F; --line-strong: #3A5070;
    --ink: #E4EAF2; --muted: #A5B2C5; --link: #8EB9EF; --focus: #8EB9EF;
    --chip-bg: #1B2D48; --chip-ink: #D3E0F1; --dot: #74A6E2; --wall: #6F8DB5; --paving: rgba(165, 190, 225, .12);
    --btn-bg: #DCE5F0; --btn-ink: #0B1422;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
    --mk-house: #DCE5F0; --mk-eye: #0B1422; --mk-iris: #DCE5F0; --mk-lens: #0B1422;
    color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.75;
    text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
img { height: auto; display: block; }
a { color: var(--link); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.25; color: var(--ink); margin: 0; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: #C9DAF0; color: #0E1B2E; }

.qe-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.qe-skip { position: absolute; inset-inline-start: 12px; inset-block-start: -60px; z-index: 100; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; font-family: var(--font-head); font-weight: 700; }
.qe-skip:focus { inset-block-start: 12px; }
.qe-main:focus { outline: none; }

.qe-wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.qe-wrap--mid { max-width: var(--wrap-mid); }

/* ---------- Logo mark ---------- */
.qe-mark { flex: none; display: block; }
.qe-mark__house { fill: var(--mk-house); stroke: var(--mk-house); }
.qe-mark__eye { fill: var(--mk-eye); }
.qe-mark__iris { fill: var(--mk-iris); }
.qe-mark__lens { stroke: var(--mk-lens); }
.qe-mark__lid { stroke: var(--mk-eye); }
.qe-mark__dot { fill: var(--red); }

/* ---------- Header ---------- */
.qe-header {
    position: sticky; inset-block-start: 0; z-index: 50;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    border-block-end: 1px solid var(--line);
}
.qe-header__bar { display: flex; align-items: center; gap: 20px; min-height: 72px; }
.qe-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); flex: none; }
.qe-brand__name { font-family: var(--font-logo); font-size: 1.7rem; line-height: 1; color: var(--navy); letter-spacing: .01em; }
[data-mode="dark"] .qe-brand__name { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-mode="light"]) .qe-brand__name { color: var(--ink); } }

.qe-nav { margin-inline-start: auto; }
.qe-nav__list { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.qe-nav__list a {
    display: block; padding: 8px 11px; border-radius: 9px;
    font-family: var(--font-head); font-weight: 500; font-size: .95rem; line-height: 1.4;
    color: var(--ink); text-decoration: none; white-space: nowrap;
}
.qe-nav__list a:hover { background: var(--surface-2); }
.qe-nav__list .current-menu-item > a, .qe-nav__list .current-menu-ancestor > a, .qe-nav__list .current-post-ancestor > a { background: var(--chip-bg); color: var(--chip-ink); font-weight: 700; }

.qe-tools { display: flex; gap: 6px; flex: none; }
.qe-tool {
    display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0;
    border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); cursor: pointer;
}
.qe-tool:hover { background: var(--surface-2); border-color: var(--line-strong); }
.qe-tool[aria-expanded="true"] { background: var(--chip-bg); border-color: var(--dot); }
.qe-tool--mode .qe-icon:nth-of-type(2) { display: none; }
[data-mode="dark"] .qe-tool--mode .qe-icon:nth-of-type(1) { display: none; }
[data-mode="dark"] .qe-tool--mode .qe-icon:nth-of-type(2) { display: block; }
@media (prefers-color-scheme: dark) {
    :root:not([data-mode="light"]) .qe-tool--mode .qe-icon:nth-of-type(1) { display: none; }
    :root:not([data-mode="light"]) .qe-tool--mode .qe-icon:nth-of-type(2) { display: block; }
}
.qe-tool--menu .qe-icon:nth-of-type(2) { display: none; }
.qe-tool--menu[aria-expanded="true"] .qe-icon:nth-of-type(1) { display: none; }
.qe-tool--menu[aria-expanded="true"] .qe-icon:nth-of-type(2) { display: block; }

.qe-searchpanel { border-block-start: 1px solid var(--line); background: var(--surface); padding-block: 16px; }
.qe-searchpanel .qe-search { max-width: 720px; }

@media (min-width: 1200px) {
    .qe-tool--menu { display: none; }
}
@media (max-width: 1199.98px) {
    .qe-header__bar { justify-content: space-between; }
    .qe-nav {
        display: none; position: absolute; inset-inline: 0; inset-block-start: 100%;
        background: var(--surface); border-block-end: 1px solid var(--line); box-shadow: var(--shadow);
        padding: 10px var(--gutter) 18px; max-height: calc(100vh - 72px); overflow-y: auto;
    }
    .qe-nav.is-open { display: block; }
    .qe-nav__list { flex-direction: column; gap: 2px; max-width: var(--wrap); margin-inline: auto; }
    .qe-nav__list a { padding: 11px 12px; font-size: 1.05rem; }
}
@media (max-width: 420px) {
    .qe-brand__name { font-size: 1.4rem; }
    .qe-brand .qe-mark { width: 36px; height: 36px; }
    .qe-tool { width: 40px; height: 40px; }
}

/* ---------- Shared bits ---------- */
.qe-kicker {
    display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px;
    font-family: var(--font-head); font-weight: 600; font-size: .85rem; letter-spacing: .04em; color: var(--muted);
}
.qe-kicker__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 18%, transparent); }

.qe-chip {
    display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px 3px 12px; border-radius: 999px;
    background: var(--chip-bg); color: var(--chip-ink); text-decoration: none;
    font-family: var(--font-head); font-weight: 600; font-size: .8rem; line-height: 1.6; white-space: nowrap;
}
a.qe-chip:hover { background: color-mix(in srgb, var(--chip-bg) 70%, var(--dot)); }
.qe-chip__dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot) 22%, transparent); }

.qe-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 20px;
    border: 1.5px solid var(--ink); border-radius: 11px; background: transparent; color: var(--ink);
    font-family: var(--font-head); font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer;
}
.qe-btn:hover { background: var(--surface-2); }
.qe-btn--solid { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-ink); }
.qe-btn--solid:hover { background: color-mix(in srgb, var(--btn-bg) 86%, #000); }

.qe-link-more { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-head); font-weight: 700; text-decoration: none; }
.qe-link-more:hover { text-decoration: underline; }
.qe-more { margin: 28px 0 0; }

.qe-section { padding-block: clamp(48px, 7vw, 88px); }
.qe-section--tint { background: var(--surface-2); }
.qe-section--list { padding-block-start: 28px; }
.qe-section__head { margin-block-end: 28px; }
.qe-section__head--split { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; }
.qe-section__title { font-size: clamp(1.55rem, 2.6vw, 2.1rem); font-weight: 800; letter-spacing: -.01em; }

.qe-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }

.qe-count { font-family: var(--font-head); font-weight: 600; color: var(--muted); font-size: .95rem; margin-block-end: 18px; }
.qe-empty { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 28px; }

/* ---------- Cards (status-chip cards) ---------- */
.qe-card {
    position: relative; display: flex; flex-direction: column; overflow: hidden;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
    transition: border-color .2s ease, transform .2s ease;
}
.qe-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.qe-card:focus-within { border-color: var(--dot); }
.qe-card:hover .qe-chip__dot, .qe-card:focus-within .qe-chip__dot { background: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 22%, transparent); }
.qe-card__media { aspect-ratio: 16 / 10; background: var(--surface-2); overflow: hidden; }
.qe-card__media img { width: 100%; height: 100%; object-fit: cover; }
.qe-card__body { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px 20px; flex: 1; }
.qe-card__strip { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qe-card__time { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-head); font-size: .8rem; font-weight: 500; color: var(--muted); white-space: nowrap; }
.qe-card__title { font-size: 1.2rem; font-weight: 700; line-height: 1.35; }
.qe-card__title a { color: var(--ink); text-decoration: none; }
.qe-card__title a::after { content: ""; position: absolute; inset: 0; }
.qe-card__title a:hover { text-decoration: underline; }
.qe-card__title a:focus-visible { outline: none; }
.qe-card__title a:focus-visible::after { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: var(--radius); }
.qe-card__excerpt { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.65; }
.qe-card__meta { margin: auto 0 0; padding-block-start: 6px; display: flex; flex-wrap: wrap; gap: 6px; font-size: .82rem; color: var(--muted); }

.qe-card--wide { margin-block-end: 24px; }
@media (min-width: 860px) {
    .qe-card--wide { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
    .qe-card--wide .qe-card__media { aspect-ratio: auto; min-height: 340px; }
    .qe-card--wide .qe-card__body { padding: 32px 36px; justify-content: center; gap: 14px; }
    .qe-card--wide .qe-card__title { font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 800; }
    .qe-card--wide .qe-card__excerpt { font-size: 1.05rem; }
    .qe-card--wide .qe-card__meta { margin-block-start: 6px; }
}

/* ---------- Homepage hero ---------- */
.qe-hero { padding-block: clamp(36px, 6vw, 72px) 0; }
.qe-hero__grid { display: grid; gap: 28px 56px; align-items: end; margin-block-end: clamp(28px, 4vw, 44px); }
@media (min-width: 960px) { .qe-hero__grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); } }
.qe-hero__title { font-size: clamp(2rem, 4.3vw, 3.35rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.14; text-wrap: balance; }
.qe-hero__sub { display: block; margin-block-start: 14px; font-size: .5em; font-weight: 500; letter-spacing: 0; line-height: 1.45; color: var(--muted); }

.qe-readout { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px; box-shadow: var(--shadow); }
.qe-readout__lead { font-size: 1.02rem; color: var(--ink); margin-block-end: 16px; }
.qe-readout__stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 0 18px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.qe-readout__stats div { padding: 10px 14px; background: var(--surface-2); }
.qe-readout__stats div + div { border-inline-start: 1px solid var(--line); }
.qe-readout__stats dt { font-family: var(--font-head); font-size: .78rem; font-weight: 600; color: var(--muted); }
.qe-readout__stats dd { margin: 0; font-family: var(--font-head); font-weight: 800; font-size: 1.7rem; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--ink); }
.qe-readout__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Floor plan ---------- */
.qe-plan { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 0 clamp(14px, 2.4vw, 28px) clamp(16px, 2.4vw, 28px); box-shadow: var(--shadow); }
.qe-plan__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding-block: 16px; margin-block-end: 6px; border-block-end: 1px solid var(--line); }
.qe-plan__title { display: inline-flex; align-items: center; gap: 8px; font-size: 1.05rem; font-weight: 700; }
.qe-plan__legend { margin: 0; display: flex; flex-wrap: wrap; gap: 14px; font-family: var(--font-head); font-size: .82rem; font-weight: 500; color: var(--muted); }
.qe-lg { display: inline-flex; align-items: center; gap: 7px; }
.qe-lg::before { content: ""; width: 18px; height: 12px; border-radius: 3px; }
.qe-lg--out::before { background: radial-gradient(var(--paving) 1.2px, transparent 1.4px) 0 0 / 6px 6px, var(--surface); border: 1px solid var(--line-strong); }
.qe-lg--in::before { background: var(--surface); border: 3px solid var(--wall); }
.qe-lg--edge::before { border: 2px dashed var(--muted); }

.qe-plan__group { margin-block-start: 18px; }
.qe-plan__label { margin: 0 0 8px; font-family: var(--font-head); font-size: .78rem; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.qe-plan__rooms { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); }

/* Outdoors: paved yard with a dotted texture, thin dashed edges */
.qe-plan__out .qe-plan__rooms { gap: 12px; }
.qe-plan__out .qe-room { background: radial-gradient(var(--paving) 1.3px, transparent 1.5px) 0 0 / 14px 14px, var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 12px; }
.qe-room--yard { grid-column: span 5; }
.qe-room--front { grid-column: span 4; }
.qe-room--garden { grid-column: span 3; }

/* The house: thick outer wall, rooms divided by inner walls */
.qe-plan__house .qe-plan__rooms { gap: 3px; background: var(--wall); border: 7px solid var(--wall); border-radius: 8px; }
.qe-plan__house .qe-room { background: var(--surface); }
.qe-room--entry { grid-column: span 3; }
.qe-room--living { grid-column: span 5; }
.qe-room--kitchen { grid-column: span 4; }
.qe-room--hub { grid-column: span 3; }
.qe-room--flat { grid-column: span 4; }
.qe-room--shop { grid-column: span 5; }

/* The boundary: a dashed property line */
.qe-plan__edge .qe-room { grid-column: 1 / -1; border: 2px dashed var(--muted); border-radius: 12px; }
.qe-plan__edge .qe-room__link { grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 20px; min-height: 0; }
.qe-plan__edge .qe-room__top { grid-row: span 2; align-self: center; }
.qe-plan__edge .qe-room__status { grid-row: 1 / span 2; grid-column: 3; align-self: center; margin: 0; }

.qe-room { position: relative; }
.qe-room__link {
    position: relative; z-index: 1; display: grid; align-content: start; gap: 6px; height: 100%; min-height: 168px; padding: 16px 18px 18px;
    color: var(--ink); text-decoration: none; border-radius: inherit;
    transition: background-color .2s ease;
}
.qe-room__link:hover { background: color-mix(in srgb, var(--chip-bg) 55%, transparent); }
.qe-room__link:focus-visible { outline-offset: -4px; }
.qe-room__top { display: flex; align-items: center; gap: 8px; }
.qe-room__id {
    display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding-inline: 6px; border-radius: 6px;
    background: var(--ink); color: var(--surface); font-family: var(--font-head); font-size: .74rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.qe-room__name { font-family: var(--font-head); font-size: .82rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.qe-room__icon { margin-inline-start: auto; color: var(--dot); display: inline-flex; }
.qe-room__cat { font-family: var(--font-head); font-size: 1.22rem; font-weight: 800; line-height: 1.3; margin-block-start: 4px; }
.qe-room__line { font-size: .9rem; line-height: 1.55; color: var(--muted); }
.qe-room__status { display: inline-flex; align-items: center; gap: 8px; margin-block-start: auto; padding-block-start: 8px; font-family: var(--font-head); font-size: .82rem; font-weight: 600; color: var(--chip-ink); }
.qe-room__link:hover .qe-chip__dot, .qe-room__link:focus-visible .qe-chip__dot { background: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 22%, transparent); }
.qe-room__door { position: absolute; z-index: 2; inset-block-end: 0; inset-inline-end: 16px; width: 32px; height: 32px; fill: none; stroke: var(--wall); stroke-width: 2; opacity: .55; pointer-events: none; }
/* Door opening: cuts the wall under the door leaf */
.qe-room__gap { position: absolute; z-index: 2; inset-block-end: -7px; inset-inline-end: 16px; width: 30px; height: 7px; background: var(--surface); pointer-events: none; }

@media (max-width: 899.98px) {
    .qe-plan__rooms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .qe-room--yard, .qe-room--front, .qe-room--garden,
    .qe-room--entry, .qe-room--living, .qe-room--kitchen,
    .qe-room--hub, .qe-room--flat, .qe-room--shop { grid-column: span 1; }
    .qe-room--yard, .qe-room--entry, .qe-room--living { grid-column: 1 / -1; }
    .qe-room__link { min-height: 150px; }
}
@media (max-width: 520px) {
    .qe-room__link { padding: 14px 14px 16px; min-height: 0; }
    .qe-room__cat { font-size: 1.05rem; }
    .qe-room__line { display: none; }
    .qe-room__name { font-size: .76rem; }
    .qe-room__icon { display: none; }
    .qe-plan__edge .qe-room__link { grid-template-columns: 1fr auto; }
    .qe-plan__edge .qe-room__top { grid-row: auto; grid-column: 1 / -1; }
    .qe-plan__edge .qe-room__status { grid-row: auto; grid-column: auto; }
    .qe-plan__edge .qe-room__line { display: block; grid-column: 1 / -1; }
}

/* ---------- Homepage walkthrough + writers ---------- */
.qe-section--tour { background: var(--surface); border-block: 1px solid var(--line); }
.qe-tour { display: grid; gap: 32px; }
@media (min-width: 1000px) {
    .qe-tour.has-route { grid-template-columns: 290px minmax(0, 1fr); gap: 64px; align-items: start; }
    .qe-route { position: sticky; inset-block-start: 100px; }
}
.qe-route { background: var(--surface-2); border-radius: var(--radius); padding: 20px 22px; }
.qe-route__title { margin: 0 0 10px; font-family: var(--font-head); font-weight: 800; font-size: 1.05rem; }
.qe-route ol { list-style: none; margin: 0; padding: 0; counter-reset: route; }
.qe-route li { counter-increment: route; position: relative; padding-inline-start: 34px; }
.qe-route li + li { margin-block-start: 4px; }
.qe-route li::before {
    content: counter(route, decimal-leading-zero); position: absolute; inset-inline-start: 0; inset-block-start: 6px;
    font-family: var(--font-head); font-size: .72rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums;
}
.qe-route a { display: block; padding-block: 4px; font-family: var(--font-head); font-weight: 500; font-size: .95rem; line-height: 1.45; color: var(--ink); text-decoration: none; }
.qe-route a:hover { color: var(--link); text-decoration: underline; }

.qe-writers { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.qe-writer { display: flex; gap: 18px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.qe-writer__name { font-size: 1.2rem; font-weight: 800; }
.qe-writer__count { margin: 2px 0 8px; font-family: var(--font-head); font-size: .85rem; font-weight: 600; color: var(--muted); }
.qe-writer p:last-child { margin: 0; color: var(--muted); font-size: .95rem; }

.qe-avatar {
    flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
    background: var(--navy); color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 1rem;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25);
}
.qe-avatar--lg { width: 60px; height: 60px; font-size: 1.25rem; }

/* ---------- Page headers ---------- */
.qe-pagehead { background: var(--surface); border-block-end: 1px solid var(--line); padding-block: clamp(26px, 4vw, 44px) clamp(28px, 4vw, 44px); }
.qe-pagehead__title { font-size: clamp(1.9rem, 3.8vw, 2.9rem); font-weight: 800; letter-spacing: -.015em; text-wrap: balance; }
.qe-pagehead__lead { margin: 14px 0 0; max-width: 70ch; font-size: 1.08rem; color: var(--muted); }
.qe-pagehead__grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: start; }
.qe-pagehead__badge { display: grid; place-items: center; width: 88px; height: 88px; border-radius: 22px; background: var(--chip-bg); color: var(--chip-ink); border: 1px solid var(--line); }
@media (max-width: 600px) { .qe-pagehead__badge { display: none; } .qe-pagehead__grid { grid-template-columns: 1fr; } }
.qe-pagehead__more { margin-block-start: 18px; max-width: 78ch; padding-block-start: 18px; border-block-start: 1px dashed var(--line-strong); }
.qe-pagehead__more p { color: var(--ink); font-size: 1rem; }
.qe-pagehead__more p:last-child { margin-block-end: 0; }
.qe-pagehead__search { margin-block-start: 20px; max-width: 640px; }
.qe-pagehead__author { display: flex; gap: 20px; align-items: center; }
.qe-q { color: var(--link); }

.qe-crumbs { margin-block-end: 16px; font-family: var(--font-head); font-size: .86rem; color: var(--muted); }
.qe-crumbs a { color: var(--muted); text-decoration: none; }
.qe-crumbs a:hover { color: var(--link); text-decoration: underline; }
.qe-crumbs .breadcrumb_last { color: var(--ink); font-weight: 600; }

.qe-zonestrip { margin-block: 20px 0; }
.qe-zonestrip ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.qe-zonestrip a {
    display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px 6px 12px; border-radius: 10px;
    background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
    font-family: var(--font-head); font-size: .9rem; font-weight: 500;
}
.qe-zonestrip a:hover { border-color: var(--line-strong); background: var(--surface-2); }
.qe-zonestrip a[aria-current="page"] { background: var(--ink); color: var(--surface); border-color: var(--ink); font-weight: 700; }
.qe-zonestrip__n { font-size: .74rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.qe-zonestrip a[aria-current="page"] .qe-zonestrip__n { color: inherit; opacity: .8; }

/* ---------- Search form ---------- */
.qe-search { position: relative; display: flex; gap: 8px; }
.qe-search__icon { position: absolute; inset-inline-start: 14px; inset-block-start: 50%; transform: translateY(-50%); color: var(--muted); display: inline-flex; pointer-events: none; }
.qe-search__input {
    flex: 1; min-width: 0; min-height: 48px; padding: 10px 44px 10px 14px; padding-inline-start: 44px;
    border: 1.5px solid var(--line-strong); border-radius: 11px; background: var(--surface); color: var(--ink);
    font: inherit; font-size: 1rem;
}
.qe-search__input::placeholder { color: var(--muted); opacity: 1; }
.qe-search__input:focus { border-color: var(--dot); outline: 3px solid color-mix(in srgb, var(--focus) 35%, transparent); outline-offset: 0; }
.qe-search__btn {
    flex: none; min-height: 48px; padding: 0 20px; border: 0; border-radius: 11px; background: var(--btn-bg); color: var(--btn-ink);
    font-family: var(--font-head); font-weight: 700; font-size: 1rem; cursor: pointer;
}

/* ---------- Single article ---------- */
.qe-article__head { background: var(--surface); border-block-end: 1px solid var(--line); padding-block: clamp(24px, 4vw, 40px) clamp(26px, 4vw, 40px); }
.qe-article__zone { display: flex; align-items: center; gap: 12px; margin-block-end: 14px; }
.qe-article__zoneid { font-family: var(--font-head); font-size: .8rem; font-weight: 700; letter-spacing: .06em; color: var(--muted); font-variant-numeric: tabular-nums; }
.qe-article__title { font-size: clamp(1.85rem, 3.7vw, 2.8rem); font-weight: 800; letter-spacing: -.015em; line-height: 1.2; text-wrap: balance; max-width: 30ch; }
.qe-article__lead { margin: 14px 0 0; max-width: 68ch; font-size: 1.12rem; color: var(--muted); }

.qe-byline { display: flex; align-items: center; gap: 12px; margin-block-start: 22px; }
.qe-byline__text { display: flex; flex-direction: column; gap: 2px; }
.qe-byline__name { font-family: var(--font-head); font-weight: 700; color: var(--ink); }
.qe-byline__meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .86rem; color: var(--muted); }
.qe-byline__meta span { display: inline-flex; align-items: center; gap: 5px; }

/* Viewfinder: corner brackets around the lead image + one quiet red light */
.qe-viewfinder { position: relative; margin: clamp(22px, 3vw, 34px) 0 0; padding: 12px; }
.qe-viewfinder img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.qe-viewfinder__c {
    position: absolute; inset: 0; pointer-events: none;
    --c: var(--ink); --l: 30px; --t: 3px;
    background:
        linear-gradient(var(--c), var(--c)) top left / var(--l) var(--t) no-repeat,
        linear-gradient(var(--c), var(--c)) top left / var(--t) var(--l) no-repeat,
        linear-gradient(var(--c), var(--c)) top right / var(--l) var(--t) no-repeat,
        linear-gradient(var(--c), var(--c)) top right / var(--t) var(--l) no-repeat,
        linear-gradient(var(--c), var(--c)) bottom left / var(--l) var(--t) no-repeat,
        linear-gradient(var(--c), var(--c)) bottom left / var(--t) var(--l) no-repeat,
        linear-gradient(var(--c), var(--c)) bottom right / var(--l) var(--t) no-repeat,
        linear-gradient(var(--c), var(--c)) bottom right / var(--t) var(--l) no-repeat;
}
.qe-viewfinder__c::after { content: ""; position: absolute; inset-block-start: 26px; inset-inline-end: 26px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(255, 255, 255, .75); }

.qe-article__layout { display: grid; gap: 28px; padding-block: clamp(28px, 4vw, 48px) clamp(48px, 6vw, 72px); }
@media (min-width: 1000px) {
    .qe-article__layout { max-width: var(--wrap-mid); }
    .qe-article__layout.has-toc { max-width: var(--wrap); grid-template-columns: minmax(0, 1fr) 290px; grid-template-areas: "main toc"; gap: 56px; align-items: start; }
    .qe-article__layout.has-toc .qe-article__main { grid-area: main; }
    .qe-article__layout.has-toc .qe-toc { grid-area: toc; position: sticky; inset-block-start: 96px; max-height: calc(100vh - 116px); overflow-y: auto; }
}
.qe-article__main { min-width: 0; max-width: 76ch; }

.qe-toc__box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 18px 14px; }
.qe-toc__box summary { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; font-family: var(--font-head); font-weight: 800; font-size: 1rem; list-style: none; }
.qe-toc__box summary::-webkit-details-marker { display: none; }
.qe-toc__box summary::after { content: "+"; margin-inline-start: auto; font-weight: 500; color: var(--muted); }
.qe-toc__box[open] summary::after { content: "–"; }
.qe-toc ol { list-style: none; margin: 4px 0 0; padding: 0; counter-reset: toc; border-inline-start: 2px solid var(--line); }
.qe-toc li { counter-increment: toc; }
.qe-toc a { display: flex; gap: 10px; padding: 6px 12px; margin-inline-start: -2px; border-inline-start: 2px solid transparent; font-size: .9rem; line-height: 1.45; color: var(--ink); text-decoration: none; }
.qe-toc a::before { content: counter(toc, decimal-leading-zero); flex: none; font-family: var(--font-head); font-size: .72rem; font-weight: 700; color: var(--muted); padding-block-start: 2px; font-variant-numeric: tabular-nums; }
.qe-toc a:hover { border-color: var(--dot); color: var(--link); }

/* ---------- Prose ---------- */
.qe-prose { counter-reset: sec; }
.qe-prose > :first-child { margin-block-start: 0; }
.qe-prose p, .qe-prose li { overflow-wrap: break-word; }
.qe-prose h2 {
    counter-increment: sec; position: relative; scroll-margin-top: 96px;
    margin: 2.3em 0 .7em; font-size: clamp(1.45rem, 2.4vw, 1.75rem); font-weight: 800; letter-spacing: -.01em;
}
.qe-prose h2::before {
    content: counter(sec, decimal-leading-zero); display: inline-grid; place-items: center; vertical-align: .22em;
    min-width: 34px; height: 24px; padding-inline: 6px; margin-inline-end: 12px; border-radius: 7px;
    background: var(--chip-bg); color: var(--chip-ink); font-size: .78rem; font-weight: 700; letter-spacing: 0; font-variant-numeric: tabular-nums;
}
.qe-prose h3 { scroll-margin-top: 96px; margin: 1.8em 0 .5em; font-size: 1.22rem; font-weight: 700; }
.qe-prose h4 { margin: 1.5em 0 .4em; font-size: 1.05rem; font-weight: 700; }
.qe-prose ul { padding-inline-start: 1.3em; margin: 0 0 1.2em; }
.qe-prose ul li { padding-inline-start: .3em; margin-block-end: .4em; }
.qe-prose ul li::marker { content: "■  "; color: var(--dot); font-size: .7em; }
.qe-prose strong { font-weight: 700; color: var(--ink); }
.qe-prose blockquote { margin: 1.6em 0; padding: 4px 22px; border-inline-start: 4px solid var(--navy); color: var(--muted); }
.qe-prose hr { border: 0; border-block-start: 1px dashed var(--line-strong); margin: 2em 0; }
.qe-prose img { border-radius: 10px; }
.qe-prose--home { max-width: 74ch; }
.qe-prose--page { padding-block: clamp(28px, 4vw, 44px) clamp(48px, 6vw, 72px); max-width: 76ch; }
.qe-prose--page h2::before { display: none; }

/* Step lists */
.qe-prose ol { margin: 0 0 1.4em; padding-inline-start: 1.4em; }
.qe-prose ol.qe-steps { list-style: none; padding: 0; counter-reset: step; }
.qe-steps > li { counter-increment: step; position: relative; padding-inline-start: 50px; padding-block-end: 16px; min-height: 34px; }
.qe-steps > li::before {
    content: counter(step); position: absolute; inset-inline-start: 0; inset-block-start: 0; z-index: 1;
    display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
    background: var(--surface); border: 2px solid var(--ink); color: var(--ink);
    font-family: var(--font-head); font-weight: 800; font-size: .9rem; font-variant-numeric: tabular-nums;
}
.qe-steps > li:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 15px; inset-block: 34px 0; border-inline-start: 2px dotted var(--line-strong); }
.qe-steps > li:last-child { padding-block-end: 0; }

/* Tables */
.qe-table { margin: 1.6em 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.qe-table table { width: 100%; border-collapse: collapse; font-size: .94rem; line-height: 1.55; min-width: 520px; }
.qe-table th, .qe-table td { padding: 11px 14px; text-align: start; vertical-align: top; border-block-end: 1px solid var(--line); }
.qe-table thead th { background: var(--surface-2); font-family: var(--font-head); font-weight: 700; font-size: .88rem; color: var(--ink); border-block-end: 2px solid var(--line-strong); }
.qe-table tbody tr:last-child td { border-block-end: 0; }
.qe-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.qe-table td:first-child { font-weight: 600; }

/* General-information note */
.qe-note { display: flex; gap: 14px; align-items: flex-start; margin: 2.2em 0 0; padding: 18px 20px; border-radius: 12px; background: var(--chip-bg); border-inline-start: 4px solid var(--navy); color: var(--ink); }
[data-mode="dark"] .qe-note { border-inline-start-color: var(--dot); }
@media (prefers-color-scheme: dark) { :root:not([data-mode="light"]) .qe-note { border-inline-start-color: var(--dot); } }
.qe-note .qe-icon { flex: none; color: var(--chip-ink); margin-block-start: 2px; }
.qe-note__title { display: block; font-family: var(--font-head); font-weight: 800; font-size: .98rem; margin-block-end: 4px; }
.qe-note p { margin: 0; font-size: .93rem; line-height: 1.65; }

.qe-readalso { margin-block-start: 1.8em; padding: 14px 18px; border: 1px dashed var(--line-strong); border-radius: 12px; }

/* Author box */
.qe-authorbox { display: flex; gap: 18px; align-items: flex-start; margin-block-start: 40px; padding: 22px 24px; background: var(--surface-2); border-radius: var(--radius); }
.qe-authorbox__label { margin: 0; font-family: var(--font-head); font-size: .8rem; font-weight: 600; color: var(--muted); }
.qe-authorbox__name { font-size: 1.2rem; font-weight: 800; margin-block-end: 6px; }
.qe-authorbox p:last-child { margin: 0; font-size: .95rem; color: var(--muted); }

/* ---------- Contact form (ADX contact form plugin: its inline CSS reads these variables) ---------- */
body .adxc {
    --adxc-accent: var(--btn-bg); --adxc-btn-fg: var(--btn-ink); --adxc-fg: var(--ink); --adxc-input-fg: var(--ink);
    --adxc-input-bg: var(--surface); --adxc-border: var(--line-strong); --adxc-radius: var(--radius);
    max-width: 620px; margin-block: 8px 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
}
.adxc .adxc-form { border-color: var(--line); padding: clamp(18px, 3vw, 28px); }
.adxc .adxc-field label { font-family: var(--font-head); font-weight: 700; font-size: .95rem; }
.adxc .adxc-field input, .adxc .adxc-field textarea { min-height: 48px; border-width: 1.5px; border-radius: 11px; }
.adxc .adxc-field textarea { min-height: 140px; }
.adxc .adxc-field input:focus, .adxc .adxc-field textarea:focus { border-color: var(--dot); outline: 3px solid color-mix(in srgb, var(--focus) 45%, transparent); outline-offset: 0; box-shadow: none; }
.adxc .adxc-submit { min-height: 48px; padding: 0 28px; border-radius: 11px; font-family: var(--font-head); font-weight: 700; }
.adxc .adxc-submit:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.adxc.adxc-state-ok .adxc-msg, .adxc.adxc-state-err .adxc-msg { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); color: var(--ink); }
.adxc.adxc-state-ok .adxc-msg { border-inline-start: 4px solid var(--dot); }
.adxc.adxc-state-err .adxc-msg { border-inline-start: 4px solid var(--red); }

/* ---------- Pagination ---------- */
.qe-pagination { margin-block-start: 40px; }
.qe-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.qe-pagination .page-numbers {
    display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 14px; border-radius: 11px;
    background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-family: var(--font-head); font-weight: 600;
}
.qe-pagination .page-numbers:hover { border-color: var(--line-strong); background: var(--surface-2); }
.qe-pagination .page-numbers.current { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.qe-pagination .page-numbers.dots { border: 0; background: none; }

/* ---------- Footer ---------- */
.qe-footer {
    --mk-house: #DCE5F0; --mk-eye: #12233D; --mk-iris: #DCE5F0; --mk-lens: #12233D;
    background: var(--navy-deep); color: #D3DDEA; margin-block-start: 0; padding-block: 56px 0;
}
[data-mode="dark"] .qe-footer { background: #070E19; --mk-eye: #070E19; --mk-lens: #070E19; }
@media (prefers-color-scheme: dark) { :root:not([data-mode="light"]) .qe-footer { background: #070E19; --mk-eye: #070E19; --mk-lens: #070E19; } }
.qe-footer a { color: #FFFFFF; text-decoration: none; }
.qe-footer a:hover { text-decoration: underline; }
.qe-footer :focus-visible { outline-color: #9CC3F2; }
.qe-footer__grid { display: grid; gap: 36px; }
@media (min-width: 900px) { .qe-footer__grid { grid-template-columns: 1.2fr 1.5fr .9fr; gap: 56px; } }
.qe-brand--footer .qe-brand__name { color: #FFFFFF !important; }
.qe-footer__tag { margin: 14px 0 10px; font-family: var(--font-head); font-weight: 600; color: #FFFFFF; }
.qe-footer__about p:last-child { font-size: .92rem; color: #B5C3D6; }
.qe-footer__title { font-size: .85rem; font-weight: 700; letter-spacing: .08em; color: #B5C3D6; margin-block-end: 14px; }
.qe-footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.qe-footer__list--cols { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.qe-footer__list a { display: inline-block; padding-block: 6px; font-size: .95rem; }
.qe-footer__base { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; margin-block-start: 44px; padding-block: 20px 26px; border-block-start: 1px solid rgba(211, 221, 234, .18); font-size: .86rem; color: #B5C3D6; }
.qe-footer__base p { margin: 0; }
.qe-totop { font-family: var(--font-head); font-weight: 600; }
@media (max-width: 520px) { .qe-footer__list--cols { grid-template-columns: 1fr; } }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
    .qe-card:hover { transform: none; }
}

/* ---------- Print ---------- */
@media print {
    .qe-header, .qe-footer, .qe-toc, .qe-zonestrip, .qe-section--tint, .qe-viewfinder__c { display: none !important; }
    body { background: #fff; color: #000; }
}
