:root {
  color-scheme: light;
  --surface: #FFFFFF;
  --surface-2: #F7F6F2;
  --muted-bg: #F0EEE9;
  --disabled: #E3E1DC;
  --tag-danger-bg: #F6E3E0;
  --bubble: #E7F6E0;
  --map-bg: #DCE3DD;
  --bg: #F5F2EC;
  --card: #FFFFFF;
  --ink: #1F2A24;
  --muted: #5C665F;
  --line: #E0DDD6;
  --border: #C9CEC6;
  --accent: #3F5E4A;
  --accent-dark: #2A3F31;
  --accent-soft: #E6EDE7;
  --warn-bg: #FBF3E4;
  --warn-ink: #7A4E14;
  --danger: #9A3F33;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: Heebo, Arial, sans-serif; font-size: 16px; -webkit-text-size-adjust: 100%; }
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
main { max-width: 560px; margin: 0 auto; padding: 24px 16px 24px; display: flex; flex-direction: column; gap: 14px; }
h1 { margin: 0; font-size: 26px; font-weight: 700; }
h2 { margin: 14px 0 0; font-size: 20px; font-weight: 700; }
p { margin: 0; line-height: 1.55; }
a { color: var(--accent); }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }
.hello { color: var(--muted); font-size: 14px; }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.card.soft { background: var(--accent-soft); }
.card.warn { background: var(--warn-bg); color: var(--ink); }
.card.warn b { color: var(--warn-ink); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.time { font-size: 20px; font-weight: 700; }
.day { color: var(--muted); font-size: 13px; font-weight: 500; margin-top: 6px; }
.spots { color: var(--accent); font-size: 13px; }
.full { color: var(--muted); font-size: 13px; }
.tag { display: inline-block; font-size: 12px; border-radius: 999px; padding: 2px 10px; background: var(--accent-soft); color: var(--accent-dark); }
.tag.warn { background: var(--warn-bg); color: var(--warn-ink); }
.tag.danger { background: var(--tag-danger-bg); color: var(--danger); }

.btn { font: inherit; font-size: 15px; font-weight: 500; border: none; border-radius: 12px; padding: 12px 18px; min-height: 44px; background: var(--accent); color: #fff; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { background: var(--accent-dark); }
.btn.block { width: 100%; font-size: 16px; font-weight: 700; padding: 15px; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.outline { background: var(--surface); color: var(--accent); border: 1px solid var(--accent); }
.btn.dark { background: var(--ink); color: var(--bg); }
.btn.danger { background: var(--surface); color: var(--danger); border: 1px solid #B8574A; }
.btn.small { min-height: 38px; padding: 8px 12px; font-size: 14px; }
.btn[disabled] { background: var(--disabled); color: var(--muted); cursor: default; border: none; }
.btn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.back { align-self: flex-start; background: none; border: none; color: var(--accent); font: inherit; font-size: 14px; padding: 8px 0; cursor: pointer; text-decoration: none; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 14px; padding: 9px 16px; min-height: 42px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

.option { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; }
.option:has(input:checked) { border: 2px solid var(--accent); padding: 13px 15px; }
.option.disabled { background: var(--muted-bg); color: var(--muted); }
.option input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.option .lbl { display: flex; gap: 10px; align-items: center; }

label.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=datetime-local], select, textarea {
  font: inherit; font-size: 16px; width: 100%; min-height: 46px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface); color: var(--ink);
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .chip:focus-visible { outline: 3px solid #9FB5A6; outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; }
.check input { width: 22px; height: 22px; margin: 0; flex-shrink: 0; accent-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.code { font-size: 28px; font-weight: 700; letter-spacing: 2px; text-align: center; background: var(--surface); border-radius: 12px; padding: 10px; direction: ltr; }
.phone { font-size: 22px; font-weight: 700; letter-spacing: 1px; direction: ltr; text-align: right; }

.punchcard { background: var(--accent); color: #fff; border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.punchcard .big { font-size: 34px; font-weight: 700; }
.punches { display: flex; gap: 6px; }
.punches span { flex: 1; height: 8px; border-radius: 4px; background: rgba(255,255,255,.9); }
.punches span.used { background: #9FB5A6; }
.punchcard .tag { background: rgba(255,255,255,.92); color: var(--accent); }

.list { background: var(--card); border-radius: var(--radius); padding: 0 16px; display: flex; flex-direction: column; }
.list > * { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.list > *:last-child { border-bottom: none; }
.list button.item { font: inherit; background: none; border-left: none; border-right: none; border-top: none; text-align: right; color: var(--ink); cursor: pointer; width: 100%; }
.list button.item:last-child { border-bottom: none; }

.bubble { background: var(--bubble); border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.5; }
.video-wrap { display: flex; flex-direction: column; gap: 6px; }
.video { width: 100%; max-width: 320px; max-height: 200px; border-radius: 12px; background: var(--map-bg); object-fit: cover; }
.sig { width: 100%; height: 150px; border: 1px dashed #A8AFA6; border-radius: 12px; background: #fff; touch-action: none; }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-around; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 0 calc(10px + env(safe-area-inset-bottom)); z-index: 10; }
.tabs a { text-decoration: none; color: var(--muted); font-size: 12px; padding: 6px 6px; min-height: 48px; display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; }
.tabs a[aria-current="page"] { color: var(--accent); font-weight: 700; }

.toast { box-shadow: 0 4px 16px rgba(0,0,0,.2); position: fixed; bottom: calc(86px + env(safe-area-inset-bottom)); left: 16px; right: 16px; max-width: 528px; margin: 0 auto; background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 12px; font-size: 14px; z-index: 20; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.spinner { text-align: center; color: var(--muted); padding: 40px 0; }
dialog { background: var(--card); color: var(--ink); border: none; border-radius: 18px; padding: 20px; max-width: 420px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(31, 42, 36, .45); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { background: var(--card); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 4px; min-height: 88px; }
.tile b { font-size: 15px; }
.tile span { font-size: 13px; color: var(--muted); }
.next { background: var(--accent); color: #fff; border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; }
.next .small { color: #DCE6DE; }
.search { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 4px 0 8px; }
.client { background: var(--card); border-radius: 14px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }

[hidden] { display: none !important; }

.logout-top { position: absolute; top: 14px; left: 14px; z-index: 5; font: inherit; font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; min-height: 34px; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
@media (min-width: 600px) { .logout-top { left: calc(50% - 270px); } }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  color-scheme: dark;
  --bg: #141A16;
  --card: #1E2621;
  --surface: #1E2621;
  --surface-2: #26302A;
  --muted-bg: #1A211C;
  --disabled: #2C3530;
  --ink: #E8ECE6;
  --muted: #A3ADA5;
  --line: #2E3832;
  --border: #3C4740;
  --accent: #8DB89A;
  --accent-dark: #A9CCB3;
  --accent-soft: #24332A;
  --warn-bg: #33291A;
  --warn-ink: #E9C27A;
  --danger: #EE9A8C;
  --tag-danger-bg: #3A2320;
  --bubble: #23362A;
  --map-bg: #26302A;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141A16;
  --card: #1E2621;
  --surface: #1E2621;
  --surface-2: #26302A;
  --muted-bg: #1A211C;
  --disabled: #2C3530;
  --ink: #E8ECE6;
  --muted: #A3ADA5;
  --line: #2E3832;
  --border: #3C4740;
  --accent: #8DB89A;
  --accent-dark: #A9CCB3;
  --accent-soft: #24332A;
  --warn-bg: #33291A;
  --warn-ink: #E9C27A;
  --danger: #EE9A8C;
  --tag-danger-bg: #3A2320;
  --bubble: #23362A;
  --map-bg: #26302A;
}
/* בכהה: כפתור ראשי עם טקסט כהה על ירוק בהיר */
:root[data-theme="dark"] .btn:not(.ghost):not(.outline):not(.danger):not([disabled]),
:root[data-theme="dark"] .chip[aria-pressed="true"] { color: #10160F; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn:not(.ghost):not(.outline):not(.danger):not([disabled]),
  :root:not([data-theme="light"]) .chip[aria-pressed="true"] { color: #10160F; }
}
:root[data-theme="dark"] .punchcard, :root[data-theme="dark"] .next { background: #2F4A39; color: #F2F5F0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .punchcard, :root:not([data-theme="light"]) .next { background: #2F4A39; color: #F2F5F0; } }
.map { width: 100%; height: 220px; border: 0; border-radius: 12px; background: var(--map-bg); }

body.logged main { padding-top: 56px; }

.must-bring { background: var(--warn-bg); border: 2px solid #E4B062; }
.must-bring b { font-size: 17px; color: var(--warn-ink); }

.hero { display:block; width:100%; height:auto; aspect-ratio:900/510; object-fit:cover; border-radius:18px; margin:4px 0 14px; box-shadow:0 4px 18px rgba(0,0,0,.10); }
