/* בינינו – לילה, שני אורות וחוט ביניהם */
:root {
  color-scheme: dark;
  --bg: #1A1026;
  --card: rgba(247,236,228,.055);
  --line: rgba(247,236,228,.14);
  --ink: #F7ECE4;
  --soft: #EAD9DF;
  --muted: #C9B6CF;
  --amber: #FFB45A;
  --amber-g: rgba(255,180,90,.42);
  --rose: #FF8FA8;
  --rose-g: rgba(255,143,168,.42);
  --me: var(--amber); --me-g: var(--amber-g);
  --them: var(--rose); --them-g: var(--rose-g);
  --r: 22px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --serif: 'Frank Ruhl Libre', 'Times New Roman', serif;
}
body[data-me="chava"] { --me: var(--rose); --me-g: var(--rose-g); --them: var(--amber); --them-g: var(--amber-g); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: Assistant, -apple-system, system-ui, "Segoe UI", Arial, sans-serif;
  font-size: 17px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, ul, ol { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--me); outline-offset: 2px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 480px; margin: 0 auto; padding: calc(var(--safe-t) + 14px) 18px calc(var(--safe-b) + 104px); min-height: 100vh; }
.wrap.plain { padding-bottom: calc(var(--safe-b) + 24px); display: flex; flex-direction: column; justify-content: center; }

/* כותרת */
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 28px; }
.icon-btn { width: 48px; height: 48px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; }
.icon-btn svg { width: 24px; height: 24px; }

/* שני האורות */
.light { display: inline-block; width: 30px; height: 30px; border-radius: 50%; flex: none; }
.light.me { background: var(--me); box-shadow: 0 0 30px 12px var(--me-g); }
.light.them { background: var(--them); box-shadow: 0 0 30px 12px var(--them-g); }
.light.amber { background: var(--amber); box-shadow: 0 0 30px 12px var(--amber-g); }
.light.rose { background: var(--rose); box-shadow: 0 0 30px 12px var(--rose-g); }
.light.sm { width: 16px; height: 16px; box-shadow: 0 0 14px 5px var(--amber-g); vertical-align: -1px; margin-inline-end: 6px; }
.light.rose.sm { box-shadow: 0 0 14px 5px var(--rose-g); }
.light.xs { width: 10px; height: 10px; box-shadow: 0 0 10px 3px var(--amber-g); }
.light.rose.xs { box-shadow: 0 0 10px 3px var(--rose-g); }
.lights { display: flex; align-items: flex-start; gap: 14px; padding: 14px 6px 6px; margin-bottom: 22px; }
.who { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 56px; font-weight: 600; }
.thread { flex: 1; height: 2px; margin-top: 14px; background: rgba(247,236,228,.22); position: relative; display: block; }
.pulse { position: absolute; top: -4px; width: 10px; height: 10px; border-radius: 50%; }
.pulse.in { left: 0; background: var(--them); box-shadow: 0 0 14px 4px var(--them-g); animation: travel-in 3.6s ease-in-out infinite; }
.pulse.out { left: 100%; background: var(--me); box-shadow: 0 0 14px 4px var(--me-g); animation: travel-out 2s ease-in-out 2; }
@keyframes travel-in { 0% { left: 0; opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { left: calc(100% - 10px); opacity: 0; } }
@keyframes travel-out { 0% { left: calc(100% - 10px); opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { left: 0; opacity: 0; } }
.lights.big { justify-content: center; align-items: center; gap: 0; padding: 0; margin: 0 auto 26px; width: 180px; }
.lights.big .thread { margin-top: 0; }

/* כרטיסים */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 16px; margin-bottom: 14px; }
.card h2 { font-family: var(--serif); font-weight: 700; font-size: 24px; margin-bottom: 4px; }
.card h3 { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.card.in { border-color: var(--them); box-shadow: 0 0 34px -12px var(--them-g); }
.card.note { border-style: dashed; }
.card.empty { border-style: dashed; background: transparent; }
.sub { color: var(--muted); font-size: 16px; }
.card .sub + .btn, .card .gentle + .btn { margin-top: 14px; }
.sub.big { font-size: 18px; color: var(--soft); margin: 6px 0 14px; }
.meta, .lbl { color: var(--muted); font-size: 15px; display: flex; align-items: center; gap: 8px; }
.gentle { font-family: var(--serif); font-weight: 500; font-size: 26px; line-height: 1.38; margin: 8px 0 14px; }
.gentle.sm { font-size: 21px; margin: 6px 0 12px; }
.tips { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.tips li { padding: 10px 14px; border-radius: 14px; background: rgba(247,236,228,.07); font-size: 17px; color: var(--soft); }
.status { color: var(--muted); font-size: 15px; margin-top: 12px; display: flex; align-items: center; gap: 6px; }
.ok { color: #9BE3B0; display: inline-grid; }
.ok svg { width: 16px; height: 16px; }
.foot { color: var(--muted); font-size: 14px; text-align: center; margin-top: 12px; }
.q { font-size: 21px; font-weight: 700; margin-bottom: 10px; }

/* כפתורים ושדות */
.btn { display: block; width: 100%; min-height: 56px; border: 0; border-radius: 28px; background: var(--me); color: #1A1026; font-size: 19px; font-weight: 700; padding: 12px 18px; }
.btn + .btn { margin-top: 12px; }
.btn:disabled { opacity: .5; }
.btn.sm { min-height: 48px; font-size: 17px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid rgba(247,236,228,.4); font-weight: 600; }
.link { display: block; margin: 6px auto 0; background: none; border: 0; color: var(--soft); font-size: 16px; font-weight: 600; padding: 12px 10px; min-height: 48px; text-decoration: underline; text-underline-offset: 3px; }
.input { display: block; width: 100%; border: 1.5px solid var(--line); border-radius: 18px; background: rgba(0,0,0,.22); padding: 14px 16px; font-size: 18px; margin: 12px 0; resize: none; }
.input::placeholder { color: #A892AF; }
.input:focus { outline: none; border-color: var(--me); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1.5px solid var(--line); background: transparent; font-size: 16px; font-weight: 600; color: var(--soft); }

/* מה לשפר */
.sec { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 2px 12px; }
.sec h2 { font-family: var(--serif); font-weight: 700; font-size: 24px; }
.count { color: var(--muted); font-size: 15px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { text-align: right; display: flex; flex-direction: column; gap: 6px; min-height: 148px; padding: 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--card); }
.tile.natan { border-color: rgba(255,180,90,.45); }
.tile.chava { border-color: rgba(255,143,168,.45); }
.tile b { font-size: 19px; font-weight: 700; line-height: 1.25; }
.t-who { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.t-ask { font-size: 15px; color: var(--soft); line-height: 1.35; }
.t-foot { margin-top: auto; font-size: 13px; color: var(--muted); }

/* שיחה */
.thread-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.b { max-width: 88%; padding: 12px 14px 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--card); }
.b.mine { align-self: flex-start; border-color: var(--me); border-start-start-radius: 6px; }
.b.theirs { align-self: flex-end; border-color: var(--them); border-start-end-radius: 6px; }
.b .gentle { margin-bottom: 4px; }
.b .btn { margin-top: 10px; }
.raw { border: 1.5px dashed rgba(247,236,228,.32); border-radius: 18px; padding: 12px 14px; color: var(--muted); font-size: 17px; margin: 8px 0 18px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ניווט תחתון */
.nav { position: fixed; inset-inline: 0; bottom: 0; display: flex; justify-content: center; gap: 8px; padding: 10px 18px calc(var(--safe-b) + 10px); background: rgba(26,16,38,.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.nav button { position: relative; flex: 1; max-width: 220px; min-height: 56px; border: 0; border-radius: 18px; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 14px; font-weight: 600; }
.nav button.on { color: var(--ink); background: var(--card); }
.nav svg { width: 24px; height: 24px; }
.nav .dot { position: absolute; top: 9px; inset-inline-end: calc(50% - 22px); width: 9px; height: 9px; border-radius: 50%; background: var(--them); box-shadow: 0 0 10px 3px var(--them-g); }

/* חלונית תחתונה */
.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(8,4,14,.72); }
.sheet-card { position: relative; width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; background: #23152F; border: 1px solid var(--line); border-bottom: 0; border-radius: 28px 28px 0 0; padding: 22px 18px calc(var(--safe-b) + 18px); animation: up .22s ease-out; }
.sheet-card .btn { margin-top: 12px; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* כניסה והתקנה */
.hero { text-align: center; margin-bottom: 22px; }
.hero img { width: 84px; height: 84px; border-radius: 20px; margin-bottom: 12px; }
.hero .brand { font-size: 40px; }
.hero p { color: var(--muted); font-size: 18px; margin-top: 4px; }
.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pick-b { min-height: 120px; border-radius: 20px; border: 1.5px solid var(--line); background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; font-size: 20px; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; font-size: 18px; }
.steps li::before { content: counter(s); width: 32px; height: 32px; border-radius: 50%; background: var(--amber); color: #1A1026; font-weight: 800; display: grid; place-items: center; }
.steps svg { width: 20px; height: 20px; vertical-align: -4px; }

.toast { position: fixed; inset-inline: 18px; bottom: calc(var(--safe-b) + 96px); z-index: 30; margin: 0 auto; max-width: 440px; padding: 14px 16px; border-radius: 16px; background: #F7ECE4; color: #1A1026; font-weight: 600; text-align: center; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .pulse.in { left: 50%; }
  .pulse.out { display: none; }
}
