/* Design B, in the Israeli flag's palette: flag blue (#0038b8) and white. Amber and red are kept only for
   emergency and error signals. Hero shows the four terraced courtyard levels of Genry's gardens. Rubik throughout. */
:root {
  --bg: #f4f6fb; --card: #ffffff; --text: #14213d; --muted: #586179; --line: #dfe4ef;
  --hero: #0038b8; --hero-ink: #ffffff; --hero-muted: #c9d6f7;
  --t1: #1d4fc4; --t2: #3565d2; --t3: #f4f6fb; --tree: #7d9be6;
  --accent: #0038b8; --accent-ink: #ffffff; --tint: #e5ecfb; --stone: #e8ecf4;
  --primary: #2d5fd6; --primary-ink: #ffffff;   /* the report tile: lighter flag blue, 5.3:1 with white */
  --warn-bg: #fbefd9; --warn-ink: #6a4810; --err: #ad3220; --ok: #0038b8;
  --shade: 15 30 70;
  --font: "Rubik", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1322; --card: #172036; --text: #e8ecf6; --muted: #a5afc6; --line: #2a3550;
    --hero: #0a2c86; --hero-ink: #f2f5fc; --hero-muted: #aabcf0;
    --t1: #12389a; --t2: #1a44ad; --t3: #0e1322; --tree: #3f63c6;
    --accent: #9db6ff; --accent-ink: #0b1430; --tint: #1c2a4f; --stone: #222b40;
    --primary: #8eaaff; --primary-ink: #0b1430;
    --warn-bg: #362c15; --warn-ink: #efd493; --err: #ff9b8a; --ok: #9db6ff;
    --shade: 0 0 0;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* our display rules (e.g. buttons) must never un-hide an element */
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.5 var(--font); }

.hero { position: relative; background: var(--hero); color: var(--hero-ink); padding: 34px 20px 72px; }
.hero > * { max-width: 560px; margin-inline: auto; position: relative; z-index: 1; }
.eyebrow { margin-top: 0; margin-bottom: 10px; font-size: .8rem; font-weight: 500; color: var(--hero-muted); letter-spacing: .02em; }
.hero h1 { margin-top: 0; margin-bottom: 0; font-size: 1.85rem; line-height: 1.2; font-weight: 600; }
.terraces .t1 { fill: var(--t1); } .terraces .t2 { fill: var(--t2); } .terraces .t3 { fill: var(--t3); } .terraces .tree { fill: var(--tree); }
#turnstile:not(:empty) { margin: 4px 0 12px; }
.terraces { position: absolute; inset: auto 0 -1px 0; width: 100%; height: 70px; z-index: 0; max-width: none; }

/* Inner pages: compact header with a clear way back to the menu */
.hero-back { display: none; }
body:not([data-view="home"]) .hero { padding: 16px 20px 52px; }
body:not([data-view="home"]) .hero h1, body:not([data-view="home"]) .eyebrow { display: none; }
body:not([data-view="home"]) .hero-back { display: inline-flex; align-items: center; gap: 6px; width: fit-content;
  margin-inline-start: 0; padding: 10px 16px 10px 14px; border-radius: 999px; background: rgb(255 255 255 / .14);
  color: var(--hero-ink); text-decoration: none; font-weight: 500; font-size: .95rem; min-height: 44px; }
.hero-back:active { background: rgb(255 255 255 / .24); }
.hero-back .backi { width: 18px; height: 18px; }
body:not([data-view="home"]) .terraces { height: 46px; }
@media (min-width: 600px) { body:not([data-view="home"]) .hero-back { margin-inline-start: max(0px, calc((100% - 560px) / 2)); } }

main { max-width: 560px; margin: 0 auto; padding: 0 16px 32px; }
h2 { margin: 6px 0 16px; font-size: 1.5rem; font-weight: 600; }

/* Choices: big tiles, the most important action first and full width */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; position: relative; z-index: 2; }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px 16px; min-height: 150px;
  background: var(--card); color: var(--text); text-decoration: none; border-radius: 22px;
  box-shadow: 0 1px 2px rgb(var(--shade) / .06), 0 6px 20px rgb(var(--shade) / .07); position: relative; transition: transform .12s; }
.choice:active { transform: scale(.98); }
.choice:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.choice .icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--tint); color: var(--accent); }
.ico { width: 28px; height: 28px; }
.choice strong { display: block; font-size: 1.16rem; font-weight: 700; line-height: 1.25; }
.choice small { display: block; color: var(--muted); font-size: .92rem; font-weight: 500; margin-top: 3px; }
.chev { position: absolute; top: 20px; left: 16px; width: 20px; height: 20px; color: var(--muted); }
.choice.primary { grid-column: 1 / -1; flex-direction: row; align-items: center; min-height: 104px; background: var(--card);
  color: var(--text); border: 2.5px solid var(--accent); box-shadow: 0 10px 26px rgb(0 31 107 / .28); }
.choice.primary strong { font-size: 1.3rem; color: var(--accent); }
.choice.primary .icon { width: 60px; height: 60px; background: var(--accent); color: #fff; }
.choice.primary small { color: var(--muted); opacity: 1; }
.choice.primary .chev { position: static; margin-inline-start: auto; color: var(--accent); }


.back { display: inline-flex; align-items: center; gap: 4px; margin-top: 16px; padding: 8px 14px 8px 12px; border-radius: 999px;
  background: var(--card); color: var(--accent); text-decoration: none; font-weight: 500; font-size: .92rem; box-shadow: 0 1px 3px rgb(0 0 0 / .08); }
.backi { width: 18px; height: 18px; }
#gym h2, #report h2 { margin-top: 0; padding-top: 4px; }
body:not([data-view="home"]) main { position: relative; z-index: 2; margin-top: -22px; }
#gym, #report, #done { background: var(--bg); border-radius: 24px 24px 0 0; padding-top: 18px; margin-inline: -16px; padding-inline: 16px; }
.button.secondary { background: var(--card); color: var(--accent); box-shadow: 0 1px 3px rgb(0 0 0 / .08); margin-top: 20px; }

.hours { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border-radius: 18px; overflow: hidden; box-shadow: 0 4px 16px rgb(var(--shade) / .06); }
.hours td { padding: 15px 18px; border-bottom: 1px solid var(--line); }
.hours tr:last-child td { border-bottom: 0; }
.hours td:last-child { text-align: left; direction: ltr; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--accent); }

.note { color: var(--muted); font-size: .88rem; }
.warn { background: var(--warn-bg); color: var(--warn-ink); padding: 8px 10px 10px; border-radius: 14px; font-size: .85rem; }
.warn p { margin: 0 2px 6px; }
.sos { display: flex; flex-wrap: wrap; gap: 6px; }
.sos-btn { flex: 1 1 0; min-width: 0; min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 4px 8px; border-radius: 12px; background: var(--card); color: var(--warn-ink); text-decoration: none;
  border: 1.5px solid color-mix(in srgb, var(--warn-ink) 30%, transparent); }
.sos-btn:active { transform: scale(.97); }
.sos-btn:focus-visible { outline: 3px solid var(--warn-ink); outline-offset: 2px; }
.sos-btn svg { width: 16px; height: 16px; flex: none; }
.sos-btn span { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.sos-btn strong { font-size: .85rem; font-weight: 500; }
.sos-btn strong::after { content: ":"; }
.sos-btn bdi { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; }
.sos-btn:not(.campus) svg { display: none; }
.sos-btn.campus { flex-basis: 100%; background: var(--err); color: #fff; border-color: transparent; }
@media (prefers-color-scheme: dark) { .sos-btn.campus { color: #1a0d0a; } }

form { background: var(--card); border-radius: 22px; padding: 18px 16px 14px; box-shadow: 0 4px 16px rgb(var(--shade) / .06); }
.field { margin-bottom: 14px; flex: 1; min-width: 0; }
.row { display: flex; gap: 10px; }
.row > .field { flex: 1 1 0; min-width: 0; }
.row > .field.narrow { flex: .75 1 0; }
label { display: block; font-weight: 500; font-size: .9rem; margin-bottom: 6px; }
.req { color: var(--err); }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1.5px solid transparent; border-radius: 14px; padding: 12px 14px; min-height: 50px; line-height: 1.5; }
/* Same height for every one-line field, on every browser (iOS draws native selects shorter) */
input, select { height: 52px; }
select { appearance: none; -webkit-appearance: none; padding-inline-end: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d877c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 18px; background-position: left 14px center; }
textarea { resize: vertical; min-height: 96px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: var(--card); }
[aria-invalid="true"] { border-color: var(--err); }
/* Phone: digits fill in over a shaded pattern (05X-XXXXXXX / 0X-XXXXXXX) */
.mask-wrap { position: relative; }
.mask-wrap input { position: relative; z-index: 1; background: transparent; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.mask-wrap { background: var(--bg); border-radius: 14px; }
.mask-wrap:focus-within { background: var(--card); }
.mask { position: absolute; inset: 0; z-index: 0; display: flex; align-items: center; padding: 12px 14px; border: 1.5px solid transparent;
  direction: ltr; white-space: pre; pointer-events: none; font: inherit; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.mask .typed { color: transparent; }
.mask .rest { color: var(--muted); opacity: .45; }
.label-note { font-weight: 400; color: var(--muted); font-size: .82rem; }
.hint { display: block; margin-top: 5px; color: var(--muted); font-size: .8rem; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; opacity: 0; }

button, .button { display: block; width: 100%; text-align: center; text-decoration: none; background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: 999px; padding: 15px; font: 600 1.05rem var(--font); cursor: pointer; margin-top: 8px; }
button:disabled { opacity: .6; cursor: wait; }
.error { color: var(--err); font-weight: 500; }

.result { background: var(--card); border-radius: 22px; padding: 22px 18px; margin: 18px 0 14px; box-shadow: 0 4px 16px rgb(var(--shade) / .06); }
.result.ok h2 { color: var(--ok); }
.result.bad h2 { color: var(--err); }

/* Credit line: small and quiet, below every screen */
.credit { max-width: 560px; margin: 0 auto; text-align: center; color: var(--muted); font-size: .75rem; letter-spacing: .01em;
  padding: 4px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
.credit a { color: var(--accent); font-weight: 600; text-decoration: none; }
.credit a:hover, .credit a:focus-visible { text-decoration: underline; }
/* Short screens: keep the credit at the bottom of the screen, not mid-page */
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; width: 100%; }

/* Free-text "brain" */
.free { background: var(--card); border-radius: 22px; padding: 18px 16px 16px; margin-bottom: 14px;
  box-shadow: 0 4px 16px rgb(var(--shade) / .06); border: 1.5px solid var(--tint); }
.free label { font-size: 1rem; }
.free .hint { margin: 0 0 10px; }
.free textarea { margin-bottom: 4px; }
button.secondary { background: var(--tint); color: var(--accent); margin-top: 8px; }
.free-msg { margin: 10px 0 0; font-size: .9rem; padding: 10px 12px; border-radius: 12px; }
.free-msg.ok { background: var(--tint); color: var(--accent); }
.free-msg.bad { background: var(--warn-bg); color: var(--warn-ink); }
.danger { background: var(--warn-bg); color: var(--warn-ink); border: 2px solid var(--err); border-radius: 16px; padding: 14px; margin: 12px 0 4px; font-size: .95rem; }
.or-manual { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin: 4px 0 14px; }
.or-manual::before, .or-manual::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.filled { border-color: var(--accent) !important; background-color: var(--tint) !important; }

/* Clarifying questions */
.qbox { background: var(--card); border: 1.5px solid var(--tint); border-radius: 18px; padding: 14px 14px 10px; margin: 4px 0 14px; }
.qbox .qtitle { margin: 0 0 10px; font-weight: 500; color: var(--accent); }
.qbox .field label { font-weight: 400; }
.qactions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.qactions button { width: auto; flex: 1 1 auto; margin-top: 4px; }
button.linkish { background: none; color: var(--muted); font-weight: 500; text-decoration: underline; flex: 0 1 auto; }
#aiMsg { margin: 0 0 14px; }

/* Gym guidelines */
.rules { margin-top: 18px; background: var(--card); border-radius: 18px; padding: 16px 18px 6px; box-shadow: 0 4px 16px rgb(var(--shade) / .06); }
.rules h3 { margin: 0 0 10px; font-size: 1.05rem; font-weight: 600; color: var(--accent); }
.rules ul { margin: 0; padding: 0; list-style: none; }
.rules li { position: relative; padding: 0 26px 10px 0; line-height: 1.45; }
.rules li::before { content: ""; position: absolute; right: 2px; top: .35em; width: 12px; height: 7px;
  border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg); }

/* Location: two radio cards (room | shared area), with a visible radio dot */
.label { display: block; font-weight: 500; font-size: .9rem; margin-bottom: 6px; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opts button { margin: 0; display: flex; align-items: center; gap: 10px; padding: 11px 12px; min-height: 60px; text-align: right;
  border-radius: 14px; background: var(--card); color: var(--text); border: 1.5px solid var(--line); font: inherit; font-size: 1rem; }
.opts button b { display: block; font-weight: 600; line-height: 1.25; }
.opts button small { display: block; font-size: .76rem; color: var(--muted); line-height: 1.3; }
.opts .dot { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 2px solid var(--muted); display: grid; place-items: center; }
.opts button[aria-checked="true"] { border-color: var(--accent); background: var(--tint); box-shadow: inset 0 0 0 1px var(--accent); }
.opts button[aria-checked="true"] .dot { border-color: var(--accent); }
.opts button[aria-checked="true"] .dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.opts button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* The confirmation box after "continue" */
.summary strong { display: block; margin-bottom: 6px; }
.summary dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0 0 8px; }
.summary dt { font-weight: 600; } .summary dt::after { content: ":"; }
.summary dd { margin: 0; color: var(--text); }
.summary p { margin: 0; font-size: .88rem; }

/* Report form: three short numbered steps */
.step { padding-bottom: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.step.last { border-bottom: 0; margin-bottom: 4px; }
.step-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-weight: 600; font-size: 1rem; color: var(--text); flex-wrap: wrap; }
.step-title .num { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--tint); color: var(--accent); font-size: .8rem; font-weight: 700; }
.step-title .label-note, .step-title .req { margin-inline-start: -4px; }
#emergencyNote { margin-bottom: 12px; }
#report h2 { margin-bottom: 10px; }
.step-note { margin: -6px 0 12px; padding-inline-start: 32px; font-size: .82rem; color: var(--muted); }

/* "AI Brain" tag: the name of the AI helper, wherever it speaks */
.brain-tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 7px; border-radius: 999px; vertical-align: middle;
  background: var(--tint); color: var(--accent); font-size: .76rem; font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
.brain-tag .brain { width: 15px; height: 15px; flex: none; }
.ai-hint { display: flex; align-items: flex-start; gap: 6px; }
.ai-hint .brain-tag { margin-top: 1px; }
.summary strong .brain-tag { margin-inline-end: 4px; }
.qtitle .brain-tag { margin-inline-end: 4px; }
.summary .brain-tag, .qbox .brain-tag { background: var(--card); }

/* Emergency box: call first, then a clear next step */
.danger p { margin: 0 0 8px; }
.danger .danger-title { color: var(--err); font-weight: 700; font-size: 1.05rem; }
.danger .sos { margin-bottom: 10px; }
.danger-next { font-size: .88rem; }
.danger-actions { display: flex; gap: 10px; align-items: center; }
.danger-actions .danger-btn { flex: 1; margin: 0; padding: 12px; font-size: .98rem; }
.danger-link { color: var(--warn-ink); font-weight: 500; text-decoration: underline; padding: 10px 4px; white-space: nowrap; }

/* A short pulse on the send button after "continue" in the emergency box */
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(0 56 184 / .5); } 100% { box-shadow: 0 0 0 14px rgb(0 56 184 / 0); } }
#submitBtn.pulse { animation: pulse .9s ease-out 2; }
@media (prefers-reduced-motion: reduce) { #submitBtn.pulse { animation: none; } }
.build-tag { opacity: .75; font-variant-numeric: tabular-nums; }

/* "The AI Brain is thinking" while it works */
.thinking { display: flex; align-items: center; gap: 12px; margin: 12px 0 0; padding: 12px 14px; border-radius: 14px;
  background: var(--tint); color: var(--accent); font-size: .92rem; }
.thinking b { font-weight: 600; margin-inline-end: 6px; }
.think-step { color: var(--text); }
.think-brain { width: 30px; height: 30px; flex: none; animation: think-pulse 1.4s ease-in-out infinite; }
@keyframes think-pulse { 0%, 100% { transform: scale(1); opacity: .65; } 50% { transform: scale(1.12); opacity: 1; } }
.dots { display: inline-flex; gap: 3px; margin-inline-start: 4px; vertical-align: middle; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: think-dot 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes think-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .think-brain, .dots i { animation: none; } }

/* A short note at the bottom of the screen (e.g. the demo's inactive booking tile) */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20; max-width: calc(100% - 32px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: .92rem; white-space: nowrap; box-shadow: 0 6px 20px rgb(0 0 0 / .2); }

/* Gym page: one section per facility */
.facility { margin: 0 0 18px; }
.facility h3 { margin: 0 0 2px; font-size: 1.1rem; }
.facility-loc { margin: 0 0 8px; color: var(--muted); font-size: .92rem; }
