/* Safe Haven — quiet, airy, big type. One blue for actions, one amber for the lit window. */

@font-face { font-family: "Heebo"; font-weight: 100 900; font-display: swap; src: url("fonts/heebo-hebrew-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Heebo"; font-weight: 100 900; font-display: swap; src: url("fonts/heebo-latin-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }

:root {
    --paper: #F8F5F1;
    --surface: #FFFFFF;
    --ink: #241A15;
    --stone: #6B625C;
    --line: #E6DFD7;
    --fill: #EFEAE4;
    --accent: #B8461B;
    --accent-deep: #933612;
    --accent-soft: #FBEADF;
    --amber: #FFB340;
    --amber-soft: #FFF1D9;
    --amber-ink: #8A5300;
    --night: #33241C;
    --danger: #C4281C;
    --danger-soft: #FDEBE8;

    /* System font first (it carries Apple's own optical sizing); Heebo is the fallback elsewhere. */
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Hebrew", "Heebo", "Arial Hebrew", Arial, sans-serif;

    --step--1: 0.875rem;
    --step-0: 1.0625rem;
    --step-1: 1.3rem;
    --step-2: 1.75rem;
    --step-3: clamp(2rem, 4.5vw, 2.75rem);
    --step-4: clamp(2.6rem, 8vw, 5rem);

    --r-s: 12px;
    --r-m: 20px;
    --r-l: 28px;
    --page: 1080px;
    --tabbar: 0px;
    --spring: cubic-bezier(0.2, 0.9, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font);
    font-size: var(--step-0);
    line-height: 1.55;
    direction: rtl;
    text-align: right;
    -webkit-font-smoothing: antialiased;
    padding-bottom: var(--tabbar);
}

img { max-width: 100%; height: auto; display: block; }

/* Tracking tightens as type grows; body stays at 0. */
h1, h2, h3 { font-weight: 700; margin: 0 0 0.45em; color: var(--ink); text-wrap: balance; }
h1 { font-size: var(--step-3); line-height: 1.08; letter-spacing: -0.025em; }
h2 { font-size: var(--step-2); line-height: 1.15; letter-spacing: -0.02em; }
h3 { font-size: var(--step-1); line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

.skip-link { position: absolute; inset-inline-start: 1rem; top: -4rem; background: var(--ink); color: #fff; padding: 0.5rem 1rem; border-radius: 999px; z-index: 50; }
.skip-link:focus { top: 1rem; }

.wrap { width: min(100% - 2.5rem, var(--page)); margin-inline: auto; }
.narrow { width: min(100% - 2.5rem, 620px); margin-inline: auto; }
.narrow-wide { width: min(100% - 2.5rem, 760px); }
.muted { color: var(--stone); }
.fine { font-size: var(--step--1); margin-top: 0.75rem; }

/* ---------- Header: translucent material, content scrolls underneath ---------- */

/* The blur sits on a pseudo-element so the header does not trap the fixed phone sheet inside it. */
.site-header { position: sticky; top: 0; z-index: 30; }
.site-header::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: rgba(255, 252, 248, 0.76);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.site-header .wrap { display: flex; align-items: center; gap: 1.25rem; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 0.5rem; color: var(--ink); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; margin-inline-end: auto; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand svg { width: 28px; height: 28px; flex: none; }

.nav { display: flex; align-items: center; gap: 0.15rem; flex-wrap: wrap; }
.nav a { color: var(--ink); font-size: 0.95rem; padding: 0.35rem 0.7rem; border-radius: 999px; }
.nav a:hover { background: rgba(0, 0, 0, 0.06); text-decoration: none; }
.nav a:active { background: rgba(0, 0, 0, 0.1); }
.nav a[aria-current="page"] { font-weight: 600; background: rgba(0, 0, 0, 0.07); }
.nav a.btn { color: #fff; }
.nav a.btn:hover { background: var(--accent-deep); }
.linklike { background: none; border: 0; font: inherit; cursor: pointer; color: var(--accent); padding: 0.3rem 0.4rem; }
.account { display: flex; align-items: center; gap: 0.4rem; font-size: var(--step--1); color: var(--stone); white-space: nowrap; }
.account form { margin: 0; }
.tabbar, .sheet-backdrop, .nav .sheet-account, .nav .grabber { display: none; }

/* ---------- Buttons: feedback on press, instantly ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
    font: inherit; font-weight: 600; line-height: 1.2; padding: 0.7rem 1.4rem; min-height: 44px;
    border-radius: 999px; border: 0; background: var(--accent); color: #fff; cursor: pointer;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:hover { background: var(--accent-deep); color: #fff; text-decoration: none; }
.btn:active { transform: scale(0.97); transition: transform 100ms ease-out; }
.btn-quiet { background: var(--fill); color: var(--ink); }
.btn-quiet:hover { background: #E4DDD5; color: var(--ink); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-light { background: #fff; color: var(--ink); box-shadow: 0 1px 0 rgba(36, 26, 21, 0.08); }
.btn-light:hover { background: var(--fill); color: var(--ink); }
.btn-small { padding: 0.4rem 0.95rem; font-size: var(--step--1); min-height: 36px; }
.actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }

/* ---------- Page scaffolding ---------- */

main { padding-block: 3rem 5rem; min-height: 60vh; }
main:has(> .hero) { padding-top: 0; }

.page-head { margin-bottom: 2rem; max-width: 60ch; }
.page-head p { color: var(--stone); font-size: var(--step-1); margin: 0; line-height: 1.4; }
.page-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.page-head-row .page-head { margin-bottom: 0; }

.panel { background: var(--surface); border-radius: var(--r-m); padding: clamp(1.25rem, 3vw, 2rem); }
.empty { background: var(--surface); border-radius: var(--r-m); padding: 2.5rem 1.5rem; text-align: center; color: var(--stone); }

.messages { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 0.5rem; }
.messages li { display: flex; gap: 0.6rem; align-items: center; background: var(--ink); color: #fff; font-weight: 500; padding: 0.8rem 1.1rem; border-radius: var(--r-s); animation: pop 0.35s var(--spring) both; }
.messages li::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--amber); flex: none; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.section { margin-top: 4.5rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.section-head h2 { margin: 0; }

/* ---------- Forms ---------- */

.form p, .form .field { margin: 0 0 1.1rem; display: grid; gap: 0.35rem; }
.form label, .form legend { font-weight: 600; font-size: 0.95rem; }
.form input:not([type=checkbox]):not([type=radio]):not([type=file]), .form select, .form textarea {
    font: inherit; width: 100%; padding: 0.75rem 0.9rem; min-height: 48px;
    border: 1px solid var(--line); border-radius: var(--r-s); background: var(--paper); color: var(--ink);
}
.form textarea { min-height: 7rem; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.form ::placeholder { color: #857B74; }
.form input[type=checkbox] { width: 1.3rem; height: 1.3rem; accent-color: var(--accent); }
.form p:has(> input[type=checkbox]) { display: flex; align-items: center; gap: 0.6rem; flex-direction: row-reverse; justify-content: flex-end; }
.form input[type=file] { font: inherit; font-size: var(--step--1); }
.form input[type=file]::file-selector-button { font: inherit; font-weight: 600; margin-inline-end: 0.75rem; padding: 0.5rem 1rem; border: 0; border-radius: 999px; background: var(--fill); color: var(--ink); cursor: pointer; }
.form .helptext, .form .hint { color: var(--stone); font-size: var(--step--1); }
.errorlist { list-style: none; margin: 0 0 0.5rem; padding: 0.55rem 0.8rem; background: var(--danger-soft); color: var(--danger); border-radius: var(--r-s); font-weight: 600; font-size: var(--step--1); }
.form .actions { margin-top: 1.5rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1rem; }
.form-grid > * { grid-column: 1 / -1; }
.form-grid > p:has(> input:not([type=checkbox]):not([type=file])) { grid-column: auto; }

.secure-note { background: var(--accent-soft); color: var(--accent-deep); border-radius: var(--r-s); padding: 0.8rem 1rem; font-size: var(--step--1); margin-bottom: 1.5rem; }

.auth { max-width: 440px; margin-inline: auto; }
.auth .page-head { text-align: center; margin-inline: auto; }
.auth .switch { margin-top: 1.25rem; color: var(--stone); text-align: center; }
.auth .btn { width: 100%; }
.alt-login { margin-bottom: 1rem; }
.alt-login .or { display: flex; align-items: center; gap: 0.75rem; color: var(--stone); font-size: var(--step--1); margin: 1rem 0 0; }
.alt-login .or::before, .alt-login .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.role-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.role-choice label { display: grid; gap: 0.15rem; border: 2px solid var(--line); border-radius: var(--r-s); padding: 0.85rem 1rem; cursor: pointer; font-weight: 600; background: var(--paper); }
.role-choice label:active { transform: scale(0.98); }
.role-choice label span { font-weight: 400; color: var(--stone); font-size: var(--step--1); }
.role-choice input { position: absolute; opacity: 0; }
.role-choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.role-choice label:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

.notice { text-align: center; padding-block: 4rem; }
.notice svg { width: 88px; height: 88px; margin: 0 auto 1.25rem; }
.notice p { color: var(--stone); font-size: var(--step-1); }
.notice .actions { justify-content: center; margin-top: 1.5rem; }

/* ---------- Home ---------- */

.hero { background: radial-gradient(90% 70% at 50% 108%, #FFC98A 0%, rgba(255, 201, 138, 0) 70%), linear-gradient(#FFF6E9, #FFE6C6); color: var(--ink); text-align: center; overflow: hidden; }
.hero .wrap { padding-block: clamp(3rem, 8vw, 5.5rem) 0; display: grid; justify-items: center; }
.hero h1 { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.035em; line-height: 1.02; max-width: 12ch; margin-bottom: 0.35em; }
.hero p { text-wrap: balance; font-size: clamp(1.15rem, 2.4vw, 1.45rem); color: #6A5547; max-width: 30ch; line-height: 1.35; margin-bottom: 1.75rem; }
.hero .actions { justify-content: center; }
.hero-house { width: min(78vw, 420px); margin-top: clamp(1.5rem, 4vw, 3rem); margin-bottom: -4px; overflow: visible; }

/* The house breathes: warmth swells and settles, like someone is home. */
.hero-house .halo { transform-box: fill-box; transform-origin: center; animation: breathe 4.6s ease-in-out infinite; }
.hero-house .pane { animation: ember 4.6s ease-in-out infinite; }
.hero-house .smoke { transform-box: fill-box; transform-origin: center bottom; animation: drift 6.9s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: 0.45; transform: scale(0.86); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes ember { 0%, 100% { fill: #FFA733; } 50% { fill: #FFD27A; } }
@keyframes drift { 0% { opacity: 0; transform: translateY(6px) scale(0.8); } 40% { opacity: 0.55; } 100% { opacity: 0; transform: translateY(-26px) scale(1.25); } }

.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; margin-top: 1rem; }
.cell { background: var(--surface); border-radius: var(--r-l); padding: clamp(1.4rem, 3vw, 2.25rem); display: grid; align-content: start; gap: 0.4rem; color: var(--ink); min-width: 0; }
a.cell { transition: transform 0.4s var(--spring); -webkit-tap-highlight-color: transparent; }
a.cell:hover { text-decoration: none; transform: scale(1.012); }
a.cell:active { transform: scale(0.98); transition-duration: 100ms; }
.cell h2, .cell h3 { margin: 0; }
.cell p { margin: 0; color: var(--stone); }
.cell .go { margin-top: 0.9rem; color: var(--accent); font-weight: 600; }
.c-3 { grid-column: span 3; } .c-2 { grid-column: span 2; } .c-4 { grid-column: span 4; } .c-6 { grid-column: span 6; }
.cell-amber { background: var(--amber-soft); }
.cell-amber .go, .cell-amber .big { color: var(--amber-ink); }
.cell-night { background: var(--night); color: #fff; }
.cell-night footer { color: #CDBFB5; font-size: var(--step--1); margin-top: 0.75rem; }
.cell-night blockquote { margin: 0; font-size: clamp(1.2rem, 2.2vw, 1.5rem); font-weight: 600; line-height: 1.38; letter-spacing: -0.01em; }
.cell-night a { color: var(--amber); }
.big { font-size: clamp(3.5rem, 9vw, 5.5rem); font-weight: 800; letter-spacing: -0.04em; line-height: 0.95; }
.kicker { font-weight: 600; color: var(--stone); font-size: 0.95rem; }
.cell-night .kicker { color: var(--amber); }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 0.75rem 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.steps li { counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; margin-bottom: 0.7rem; }
.steps h3 { margin-bottom: 0.2rem; font-size: 1.15rem; }
.steps p { color: var(--stone); margin: 0; }

.places { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.place { display: grid; grid-template-rows: auto 1fr; overflow: hidden; color: var(--ink); background: var(--surface); border-radius: var(--r-m); transition: transform 0.4s var(--spring); }
.place:hover { text-decoration: none; transform: scale(1.015); }
.place:active { transform: scale(0.98); transition-duration: 100ms; }
.place img, .place-ph { aspect-ratio: 16 / 10; width: 100%; max-height: 300px; object-fit: cover; background: var(--fill); }
.place-ph { display: grid; place-items: center; }
.place-ph svg { width: 60px; height: 60px; }
.place-body { display: grid; gap: 0.1rem; padding: 1rem 1.2rem 1.25rem; }
.place-body b { font-size: 1.15rem; letter-spacing: -0.01em; }
.place-body span { color: var(--stone); }

.partners { list-style: none; margin: 0.75rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.partners a { display: flex; align-items: center; gap: 0.55rem; padding: 0.45rem 0.5rem 0.45rem 1rem; background: var(--paper); border-radius: 999px; color: var(--ink); font-weight: 500; }
.partners a:hover { background: var(--fill); text-decoration: none; }
.partners img { width: 30px; height: 30px; object-fit: contain; border-radius: 50%; background: #fff; }
.mono { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none; background: var(--ink); color: var(--amber); font-weight: 700; line-height: 1; }
.mono-l { width: 64px; height: 64px; font-size: 1.8rem; border-radius: 18px; }
.org-detail .mono-l { width: 110px; height: 110px; font-size: 3rem; border-radius: 28px; }

.give { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; }

/* ---------- Listings (hosts) ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; margin-bottom: 1.5rem; background: var(--surface); border-radius: var(--r-m); padding: 1.1rem 1.25rem; }
.filters p { margin: 0; display: grid; gap: 0.25rem; flex: 1 1 130px; }
.filters label { font-size: var(--step--1); color: var(--stone); font-weight: 500; }
.filters .actions { flex: 0 0 auto; margin: 0; }

.listing { display: grid; grid-template-columns: 260px 1fr; gap: 1.5rem; padding: 1rem; margin-bottom: 1rem; background: var(--surface); border-radius: var(--r-l); }
.listing-photo { aspect-ratio: 4 / 3; border-radius: var(--r-m); object-fit: cover; width: 100%; background: var(--fill); }
.listing-photo.placeholder { display: grid; place-items: center; }
.listing-photo.placeholder svg { width: 56px; height: 56px; }
.listing > div:last-child { padding: 0.5rem 0.25rem 0.5rem 0.5rem; min-width: 0; }
.listing h3 { margin-bottom: 0.1rem; font-size: 1.45rem; letter-spacing: -0.015em; }
.listing .where { color: var(--stone); margin-bottom: 0.9rem; }
.facts { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 0.9rem; padding: 0; list-style: none; }
.facts li { background: var(--paper); border-radius: 999px; padding: 0.25rem 0.85rem; font-weight: 600; font-size: 0.95rem; }
.facts li b { font-weight: 400; color: var(--stone); margin-inline-end: 0.35em; }
.contact { display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; margin: 0.25rem 0 1rem; align-items: center; }
.contact span { font-weight: 600; }

.status { display: inline-flex; align-items: center; gap: 0.4em; font-size: var(--step--1); font-weight: 600; padding: 0.2rem 0.75rem; border-radius: 999px; margin-bottom: 0.6rem; }
.status::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; }
.status-free { background: #E3F7E8; color: #0B6B27; }
.status-taken { background: var(--fill); color: var(--stone); }
.status-pending { background: var(--amber-soft); color: var(--amber-ink); }
.status-accepted { background: #E3F7E8; color: #0B6B27; }

/* ---------- Stay requests and approvals ---------- */

.request-list { display: grid; gap: 1rem; max-width: 760px; margin-bottom: 2.5rem; }
.request-card { background: var(--surface); border-radius: var(--r-l); padding: clamp(1.1rem, 3vw, 1.6rem); }
.request-card h3 { margin: 0 0 0.25rem; font-size: 1.2rem; }
.request-card .meta { color: var(--stone); font-size: var(--step--1); margin-bottom: 0.75rem; }
.request-card .text { white-space: pre-line; margin-bottom: 0.9rem; }
.request-card .actions { margin-top: 0.75rem; }
.request-card .contact { margin-bottom: 0; }
.place-summary { background: var(--surface); border-radius: var(--r-m); padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.place-summary h2 { font-size: var(--step-1); margin: 0 0 0.2rem; }
.place-summary p { margin: 0; color: var(--stone); }
.review-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.75rem; }
.review-form input[type=text] { flex: 1 1 220px; min-height: 36px; border-radius: 999px; border: 1px solid var(--line); padding: 0.35rem 0.9rem; font: inherit; background: var(--paper); }
.nav .count { display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; padding: 0 0.35rem; margin-inline-start: 0.35rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.75rem; font-weight: 700; }
button.status { border: 0; font-family: inherit; cursor: pointer; margin: 0; }
button.status:hover { box-shadow: 0 0 0 2px currentColor; }
button.status:active { transform: scale(0.95); }

/* ---------- Organisations ---------- */

.orgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.org { display: grid; grid-template-rows: auto 1fr; gap: 1rem; background: var(--surface); border-radius: var(--r-l); padding: 1.25rem; color: var(--ink); transition: transform 0.4s var(--spring); }
.org:hover { text-decoration: none; transform: scale(1.015); }
.org:active { transform: scale(0.98); transition-duration: 100ms; }
.org-logo { height: 110px; display: grid; place-items: center; background: var(--paper); border-radius: var(--r-m); padding: 0.75rem; }
.org-logo img { max-height: 76px; width: auto; object-fit: contain; }
.org h3 { margin: 0 0 0.25rem; }
.org p { margin: 0; color: var(--stone); font-size: 0.95rem; }
.org-detail { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; align-items: start; background: var(--surface); border-radius: var(--r-l); padding: clamp(1.25rem, 3vw, 2rem); margin-top: 1rem; }
.org-detail .org-logo { height: 180px; }
.org-detail .org-logo img { max-height: 140px; }
.org-detail .body { max-width: 62ch; white-space: pre-line; }

/* ---------- Stories, requests, reports ---------- */

.stack { display: grid; gap: 1rem; max-width: 760px; }
.story { background: var(--surface); border-radius: var(--r-l); padding: clamp(1.4rem, 3vw, 2rem); }
.story blockquote { margin: 0 0 1rem; font-size: 1.2rem; line-height: 1.5; white-space: pre-line; }
.story blockquote::before { content: "”"; display: block; font-size: 3.5rem; line-height: 0.6; font-weight: 800; color: var(--amber); margin-bottom: 0.6rem; }
.story footer { color: var(--stone); font-size: var(--step--1); }
.story footer b { color: var(--ink); }

.request h3 { margin-bottom: 0.2rem; }
.request .meta { color: var(--stone); font-size: var(--step--1); margin-bottom: 0.75rem; }
.request .desc { white-space: pre-line; }
.replies { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.6rem; }
.replies li { background: var(--paper); border-radius: 18px 18px 6px 18px; padding: 0.7rem 1rem; max-width: 90%; }
.replies b { display: block; font-size: var(--step--1); color: var(--stone); font-weight: 600; }

.report-item { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: start; }
.report-item .text { white-space: pre-line; margin: 0; }
.exports { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.exports .panel h2 { font-size: var(--step-1); }
.exports .panel p { color: var(--stone); }

/* ---------- Dashboard ---------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 1rem; }
.tile { display: grid; gap: 0.15rem; padding: 1.2rem 1.3rem; color: var(--ink); background: var(--surface); border-radius: var(--r-m); transition: transform 0.4s var(--spring); }
.tile:hover { text-decoration: none; transform: scale(1.03); }
.tile:active { transform: scale(0.97); transition-duration: 100ms; }
.tile strong { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; white-space: nowrap; }
.tile span { color: var(--stone); font-size: var(--step--1); }
.tile-alert { background: var(--amber-soft); }
.tile-alert strong { color: var(--amber-ink); }
.dash-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.dash-cols section { background: var(--surface); border-radius: var(--r-m); padding: 1.25rem 1.4rem; }
.dash-cols h2 { font-size: 1.15rem; margin-bottom: 0.5rem; letter-spacing: -0.01em; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.65rem 0; border-top: 1px solid var(--line); }
.rows li div { display: grid; min-width: 0; }
.rows li div span { color: var(--stone); font-size: var(--step--1); overflow: hidden; text-overflow: ellipsis; }
.rows form { margin: 0; }
.rows .status { margin: 0; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding-block: 2.5rem; color: var(--stone); font-size: var(--step--1); }
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; align-items: start; }
.site-footer h2 { font-size: var(--step--1); margin-bottom: 0.5rem; letter-spacing: 0; }
.site-footer nav { display: grid; gap: 0.4rem; justify-items: start; }
.site-footer nav a { color: var(--stone); }
.site-footer nav a:hover { color: var(--ink); }
.site-footer p { margin: 0; }
.site-footer .brand { font-size: 1.05rem; margin-bottom: 0.5rem; }
.site-footer .brand svg { width: 24px; height: 24px; }
.foot-brand p { max-width: 34ch; }

/* ---------- Phone: tab bar and a draggable bottom sheet ---------- */

@media (max-width: 860px) {
    :root { --tabbar: calc(62px + env(safe-area-inset-bottom, 0px)); }
    .site-header .wrap { min-height: 50px; }
    /* While the sheet is up, the header's layer rises above the tab bar so the sheet and its scrim cover everything. */
    .site-header:has(.nav.open), .site-header:has(.nav.dragging) { z-index: 41; }
    .account { display: none; }

    .tabbar {
        display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
        position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
        background: rgba(255, 252, 248, 0.84);
        -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }
    .tabbar a, .tabbar button {
        display: grid; justify-items: center; gap: 2px; padding: 4px 2px; min-height: 50px;
        font: inherit; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.01em; color: var(--stone);
        background: none; border: 0; cursor: pointer; border-radius: 12px;
        -webkit-tap-highlight-color: transparent; touch-action: manipulation;
    }
    .tabbar a:hover { text-decoration: none; }
    .tabbar a:active, .tabbar button:active { transform: scale(0.92); transition: transform 100ms ease-out; }
    .tabbar svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .tabbar [aria-current="page"], .tabbar [aria-expanded="true"] { color: var(--accent); }

    /* The sheet leaves the way it came: up from the bottom, back down to the bottom. */
    .nav {
        display: grid; position: fixed; inset-inline: 0; bottom: 0; z-index: 45;
        background: var(--surface); border-radius: var(--r-l) var(--r-l) 0 0;
        padding: 0.5rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px)); gap: 0.15rem;
        box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.22);
        transform: translateY(105%); visibility: hidden;
        transition: transform 0.42s var(--spring), visibility 0.42s;
        max-height: 82vh; overflow: auto; overscroll-behavior: contain; will-change: transform;
    }
    .nav.open { transform: translateY(0); visibility: visible; }
    .nav.dragging { transition: none; }
    .nav .grabber { display: block; width: 100%; padding: 0.5rem 0 0.9rem; touch-action: none; cursor: grab; background: none; border: 0; }
    .nav .grabber::before { content: ""; display: block; width: 38px; height: 5px; border-radius: 3px; background: #C7C7CC; margin-inline: auto; }
    .nav a { font-size: 1.1rem; padding: 0.85rem 0.9rem; border-radius: var(--r-s); }
    .nav a.btn { justify-content: center; margin-top: 0.5rem; }
    .nav .sheet-account { display: flex; justify-content: space-between; align-items: center; padding: 0.9rem 0.9rem 0; margin-top: 0.4rem; border-top: 1px solid var(--line); color: var(--stone); }
    .nav .sheet-account form { margin: 0; }
    .sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(0, 0, 0, 0.4); opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
    .sheet-backdrop.open { opacity: 1; pointer-events: auto; }

    main { padding-block: 2rem 3rem; }
    .bento { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
    .c-3, .c-4, .c-6 { grid-column: 1 / -1; }
    .c-2 { grid-column: span 1; }
    .c-2.wide-m { grid-column: 1 / -1; }
    .steps { grid-template-columns: 1fr; gap: 1.1rem; }
    .places { grid-auto-flow: column; grid-auto-columns: 78%; grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: -1.25rem; padding-inline: 1.25rem; scroll-padding-inline: 1.25rem; scrollbar-width: none; }
    .places::-webkit-scrollbar { display: none; }
    .place { scroll-snap-align: start; }
    .form-grid { grid-template-columns: 1fr; }
    .listing { grid-template-columns: 1fr; gap: 0.75rem; padding: 0.75rem; }
    .listing > div:last-child { padding: 0.25rem 0.5rem 0.75rem; }
    .listing .actions > * { flex: 1 1 auto; }
    .listing .actions form .btn { width: 100%; }
    .org-detail { grid-template-columns: 1fr; }
    .role-choice { grid-template-columns: 1fr; }
    .report-item { grid-template-columns: 1fr; }
    .page-head-row { align-items: flex-start; flex-direction: column; }
    .site-footer .wrap { grid-template-columns: 1fr; }
    .form .actions .btn { flex: 1 1 auto; }
    .filters p { flex: 1 1 40%; }
    .filters .actions { flex: 1 1 100%; }
    .filters .actions .btn { flex: 1; }
    .give .actions { width: 100%; }
    .give .actions .btn { flex: 1; }
}

/* ---------- Desktop: finer frames, tighter type. The big soft cards belong to the phone. ---------- */

@media (min-width: 861px) {
    :root { --r-s: 8px; --r-m: 12px; --r-l: 16px; --step-0: 1rem; --step-2: 1.5rem; --step-3: 2.1rem; --step-4: clamp(2.6rem, 5vw, 3.6rem); --page: 1040px; }
    main { padding-block: 2.5rem 4rem; }
    .cell { padding: 1.5rem 1.6rem; border: 1px solid var(--line); }
    .cell-amber, .cell-night { border-color: transparent; }
    .bento { gap: 0.9rem; margin-top: 1.25rem; }
    .big { font-size: 3.6rem; }
    .cell-night blockquote { font-size: 1.2rem; font-weight: 500; }
    .panel, .listing, .org, .story, .tile, .place, .filters, .org-detail, .dash-cols section, .empty { border: 1px solid var(--line); }
    .listing { grid-template-columns: 200px 1fr; gap: 1.25rem; padding: 0.9rem; margin-bottom: 0.75rem; }
    .listing h3 { font-size: 1.2rem; }
    .listing .where { margin-bottom: 0.6rem; }
    .facts { margin-bottom: 0.6rem; }
    .facts li { font-size: 0.875rem; padding: 0.15rem 0.7rem; }
    .contact { margin-bottom: 0.7rem; }
    .btn { padding: 0.55rem 1.15rem; min-height: 40px; }
    .btn-small { padding: 0.3rem 0.8rem; min-height: 32px; }
    .form input:not([type=checkbox]):not([type=radio]):not([type=file]), .form select, .form textarea { min-height: 42px; padding: 0.55rem 0.75rem; }
    .filters { padding: 0.9rem 1rem; }
    .org { padding: 1rem; }
    .org-logo { height: 92px; }
    .story { padding: 1.4rem 1.6rem; }
    .story blockquote { font-size: 1.05rem; }
    .place-body { padding: 0.8rem 1rem 1rem; }
    .place-body b { font-size: 1.05rem; }
    .place img, .place-ph { max-height: 190px; }
    .tile strong { font-size: 1.7rem; }
    .page-head p { font-size: 1.15rem; }
    .steps h3 { font-size: 1.05rem; }
}

/* ---------- Respect people's settings ---------- */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .hero-house .halo, .hero-house .pane, .hero-house .smoke, .messages li { animation: none; }
    .hero-house .smoke { opacity: 0; }
    .nav { transition: opacity 0.2s ease, visibility 0.2s; }
    .nav:not(.open) { opacity: 0; }
    a.cell, .place, .org, .tile, .btn { transition: none; }
    a.cell:hover, .place:hover, .org:hover, .tile:hover { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
    .site-header::before, .tabbar { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
    :root { --stone: #48484A; --line: #8E8E93; }
    .site-header::before, .tabbar { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; border-color: #000; }
    .panel, .cell, .listing, .org, .story, .tile, .place { outline: 1px solid var(--line); }
}

/* ---------- Accessibility menu ---------- */

.a11y-toggle {
    position: fixed; inset-inline-end: 16px; bottom: calc(var(--tabbar) + 16px); z-index: 37;
    width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
    background: var(--ink); color: #fff; display: grid; place-items: center;
    box-shadow: 0 6px 18px rgba(36, 26, 21, 0.28);
}
.a11y-toggle:active { transform: scale(0.94); }
.a11y-toggle svg { width: 26px; height: 26px; fill: currentColor; }
.a11y-panel {
    position: fixed; inset-inline-end: 16px; bottom: calc(var(--tabbar) + 74px); z-index: 37;
    width: min(300px, calc(100vw - 32px)); background: var(--surface); color: var(--ink);
    border: 1px solid var(--line); border-radius: 16px; padding: 1rem; box-shadow: 0 18px 50px rgba(36, 26, 21, 0.25);
    transform-origin: bottom left; display: grid; gap: 0.5rem;
}
.a11y-panel[hidden] { display: none; }
.a11y-panel h2 { font-size: 1.05rem; margin: 0 0 0.25rem; letter-spacing: 0; }
.a11y-panel button[data-a11y] {
    display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; width: 100%;
    font: inherit; font-weight: 600; text-align: start; padding: 0.65rem 0.8rem; min-height: 44px;
    background: var(--paper); color: var(--ink); border: 2px solid transparent; border-radius: 10px; cursor: pointer;
}
.a11y-panel button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.a11y-panel button[aria-pressed="true"]::after { content: "פועל"; font-size: 0.8rem; color: var(--accent-deep); }
.a11y-panel .a11y-links { display: flex; justify-content: space-between; gap: 0.5rem; font-size: var(--step--1); margin-top: 0.25rem; }

html.a11y-text-1 { font-size: 115%; }
html.a11y-text-2 { font-size: 132%; }
html.a11y-links a:not(.btn):not(.brand):not(.cell):not(.place):not(.org):not(.tile) { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
html.a11y-links a.cell .go, html.a11y-links .nav a { text-decoration: underline; }
html.a11y-motion *, html.a11y-motion *::before, html.a11y-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html.a11y-motion .hero-house .smoke { opacity: 0; }
html.a11y-contrast { --paper: #FFFFFF; --surface: #FFFFFF; --ink: #000000; --stone: #2B2B2B; --line: #555555; --fill: #E6E6E6; --accent: #7A2500; --accent-deep: #5A1B00; --accent-soft: #FFE9DC; --amber-soft: #FFF3D6; --amber-ink: #5A3600; --night: #000000; }
html.a11y-contrast .site-header::before, html.a11y-contrast .tabbar { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; border-color: #000; }
html.a11y-contrast .hero { background: #FFF3DC; }
html.a11y-contrast .hero p { color: #000; }
html.a11y-contrast .panel, html.a11y-contrast .cell, html.a11y-contrast .listing, html.a11y-contrast .org, html.a11y-contrast .story, html.a11y-contrast .tile, html.a11y-contrast .place, html.a11y-contrast .filters { outline: 2px solid #000; }
html.a11y-contrast .form input, html.a11y-contrast .form select, html.a11y-contrast .form textarea { border: 2px solid #000 !important; background: #fff; }
html.a11y-contrast :focus-visible { outline: 4px solid #000; outline-offset: 3px; }
@media (max-width: 860px) { .site-header:has(.nav.open) ~ .a11y-toggle { display: none; } }
@media print { .a11y-toggle, .a11y-panel, .tabbar, .site-header { display: none !important; } }

/* Small helpers that replace inline styles (the content security policy forbids inline code). */
.mt { margin-top: .9rem; }
.section-head.flush { margin: 0; }
fieldset.plain { border: 0; padding: 0; margin: 0 0 1.1rem; }
fieldset.plain legend { font-weight: 600; margin-bottom: .35rem; }
.smoke[data-d="1"] { animation-delay: -2.3s; }
.smoke[data-d="2"] { animation-delay: -4.6s; }

/* Organisation logo over the letter tile: the letter shows until (and unless) the logo loads. */
.org-logo, .logo-slot { position: relative; }
.logo-slot { display: inline-grid; flex: none; width: 30px; height: 30px; }
.org-logo img[data-logo], .logo-slot img[data-logo] { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; object-fit: contain; padding: 10px; background: #fff; border-radius: inherit; opacity: 0; }
.logo-slot img[data-logo] { padding: 2px; border-radius: 50%; }
.has-logo > img[data-logo] { opacity: 1; }
.note-demo { color: var(--stone); font-size: .9rem; margin-top: .4rem; }
