/* HeimishAI — "talk" theme: faint blue-white, floating speech bubbles, light cards. */
@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700;800&display=swap');

:root {
  --ink:     #17255f;
  --muted:   #59689a;
  --accent:  #2f6bff;
  --accent-2:#12b3e6;
  --bubble:  #8aa9ff;
  --glass:      rgba(255,255,255,.78);
  --glass-2:    rgba(255,255,255,.95);
  --glass-brd:  rgba(45,75,160,.14);
  --card-shadow: 0 12px 34px rgba(40,70,150,.12);
  --yes: #16ac6b;
  --no:  #e75a72;
  --radius: 22px;
  --tail: 6px;
  --font: 'Rubik', 'Heebo', 'Segoe UI', 'Arial Hebrew', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
  background:
    radial-gradient(1100px 650px at 12% -8%, #e9f0ff 0%, transparent 55%),
    radial-gradient(1000px 750px at 100% 112%, #e6edff 0%, transparent 50%),
    linear-gradient(160deg, #f7faff 0%, #eef3fe 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Floating decorative speech bubbles behind everything (faint blue) */
.bubbles { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bubbles span {
  position: absolute;
  background: var(--bubble);
  border-radius: 50% 50% 50% var(--tail);
  opacity: .12;
  filter: blur(.3px);
}
.bubbles span:nth-child(1){ width: 200px; height: 200px; top: -46px; left: -40px; border-radius: 50% 50% var(--tail) 50%; opacity:.18; }
.bubbles span:nth-child(2){ width: 340px; height: 340px; bottom: -90px; right: -70px; opacity:.16; }
.bubbles span:nth-child(3){ width: 120px; height: 120px; top: 32%; right: 12%; opacity:.10; }
.bubbles span:nth-child(4){ width: 90px;  height: 90px;  bottom: 22%; left: 8%; border-radius: 50% 50% 50% var(--tail); opacity:.10; }

.wrap { max-width: 1000px; margin: 0 auto; padding: 0 22px; position: relative; z-index: 1; }

/* ---------- Header ---------- */
header { padding: 22px 0; position: relative; z-index: 2; }
header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 1.5rem; font-weight: 800; letter-spacing: .3px; color: var(--ink);
  text-decoration: none; direction: ltr;
}
.logo .mark {
  width: 34px; height: 34px; flex: none;
  background: linear-gradient(150deg, var(--accent) 10%, var(--accent-2) 95%);
  border-radius: 50% 50% 50% 6px;
  box-shadow: 0 6px 18px rgba(47,131,255,.32);
}
.logo b { background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
header nav { display: flex; gap: 8px; flex-wrap: wrap; }
header nav a {
  color: var(--ink); text-decoration: none; font-size: .93rem; font-weight: 500;
  padding: 8px 15px; border-radius: 999px; background: var(--glass);
  border: 1px solid var(--glass-brd); transition: background .18s, transform .18s;
}
header nav a:hover { background: var(--glass-2); transform: translateY(-1px); }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 60px 0 40px; }
.hero .eyebrow {
  display: inline-block; font-size: .85rem; font-weight: 600; color: var(--accent);
  background: rgba(47,107,255,.08); border: 1px solid rgba(47,107,255,.22);
  padding: 6px 16px; border-radius: 999px; margin-bottom: 22px;
}
.hero h1 { font-size: clamp(2rem, 5.4vw, 3.6rem); font-weight: 800; line-height: 1.18; letter-spacing: -.5px; }
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .sub { font-size: clamp(1.05rem, 2.2vw, 1.28rem); color: var(--muted); margin: 20px auto 0; max-width: 620px; }
.phone-cta {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 32px;
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff; font-size: clamp(1.3rem, 3vw, 1.7rem); font-weight: 800; letter-spacing: .5px;
  padding: 16px 40px; border-radius: 999px; text-decoration: none; direction: ltr;
  box-shadow: 0 14px 36px rgba(47,131,255,.32); transition: transform .18s, box-shadow .18s;
}
.phone-cta:hover { transform: translateY(-2px); box-shadow: 0 20px 48px rgba(47,131,255,.42); }
.phone-cta .dot { width: 12px; height: 12px; background: #fff; border-radius: 50% 50% 50% 3px; }
.hero .small { margin-top: 16px; font-size: .85rem; color: var(--muted); }

/* ---------- Cards ---------- */
.section-title { text-align: center; font-size: clamp(1.5rem, 3.6vw, 2.2rem); font-weight: 800; margin-bottom: 8px; }
.section-lead { text-align: center; color: var(--muted); margin-bottom: 30px; }

.ways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 34px 0 60px; }
.way {
  background: var(--glass); border: 1px solid var(--glass-brd); border-radius: var(--radius);
  border-bottom-left-radius: var(--tail);
  padding: 30px 24px; text-align: center; box-shadow: var(--card-shadow);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.way:hover { transform: translateY(-4px); box-shadow: 0 18px 44px rgba(40,70,150,.16); border-color: rgba(47,107,255,.4); }
.way .icon {
  width: 58px; height: 58px; margin: 0 auto 16px; display: grid; place-items: center;
  font-size: 1.6rem;
  background: linear-gradient(150deg, rgba(47,107,255,.16), rgba(18,179,230,.16));
  border: 1px solid rgba(47,107,255,.22);
  border-radius: 50% 50% 50% 8px;
}
.way h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 6px; }
.way p { color: var(--muted); font-size: .98rem; }

.rules {
  background: var(--glass); border: 1px solid var(--glass-brd);
  border-radius: var(--radius); border-bottom-left-radius: var(--tail);
  padding: 34px; margin: 0 0 60px; box-shadow: var(--card-shadow);
}
.rules .section-title { text-align: start; }
.rules .section-lead { text-align: start; }
.rules ul { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 26px; margin-top: 6px; }
.rules li { padding-inline-start: 34px; position: relative; color: var(--ink); }
.rules li::before {
  position: absolute; inset-inline-start: 0; top: 3px;
  width: 22px; height: 22px; border-radius: 50% 50% 50% 4px;
  display: grid; place-items: center; font-size: .8rem; font-weight: 800;
}
.rules li.yes::before { content: "\2713"; color: #fff; background: var(--yes); }
.rules li.no::before  { content: "\2717"; color: #fff; background: var(--no); }
@media (max-width: 720px){ .rules ul { grid-template-columns: 1fr; } }

/* ---------- Suggestion chips (boxes above the search bar) ---------- */
.chips {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding: 12px 14px 4px;
}
.chip {
  display: flex; align-items: center; justify-content: center;
  font: inherit; font-size: .88rem; font-weight: 600; color: var(--ink); cursor: pointer;
  text-align: center; padding: 10px 8px;
  background: #fff; border: 1px solid var(--glass-brd);
  border-radius: 12px; transition: transform .16s, background .16s, border-color .16s;
}
.chip:hover { transform: translateY(-2px); background: #f4f8ff; border-color: rgba(47,107,255,.45); }
.chip.chip-more { color: var(--accent); border-color: rgba(47,107,255,.35); background: rgba(47,107,255,.07); }
@media (max-width: 640px){ .chips { grid-template-columns: repeat(2, 1fr); } }

.more-panel {
  margin: 8px 14px 0;
  background: #f4f7ff; border: 1px solid var(--glass-brd);
  border-radius: 14px; padding: 14px;
}
.more-head { font-weight: 700; margin-bottom: 12px; color: var(--ink); }
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.more-item {
  font: inherit; font-size: .9rem; color: var(--ink); cursor: pointer; text-align: start;
  padding: 10px 12px; background: #fff; border: 1px solid var(--glass-brd);
  border-radius: 999px; transition: background .15s, border-color .15s;
}
.more-item:hover { background: #eef4ff; border-color: rgba(47,107,255,.45); }
@media (max-width: 640px){ .more-grid { grid-template-columns: 1fr; } }

/* ---------- Chat ---------- */
.chat-section { margin: 0 auto 70px; }
.chat-box {
  max-width: 680px; margin: 0 auto;
  background: var(--glass-2); border: 1px solid var(--glass-brd);
  border-radius: 26px; overflow: hidden;
  box-shadow: 0 18px 48px rgba(40,70,150,.15);
}
.chat-log { min-height: 220px; max-height: 400px; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.chat-log:empty { min-height: 40px; }
.msg {
  max-width: 80%; padding: 12px 16px; border-radius: 18px; white-space: pre-wrap;
  word-wrap: break-word; font-size: .98rem; line-height: 1.55;
}
.msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--glass-brd);
  box-shadow: 0 2px 8px rgba(40,70,150,.05); border-bottom-inline-start-radius: 5px; }
.msg.user { align-self: flex-end; color: #fff; font-weight: 500;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  border-bottom-inline-end-radius: 5px; }
.msg.typing { color: var(--muted); font-style: italic; }
.chat-input { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--glass-brd); background: rgba(244,247,255,.6); }
.chat-input input {
  flex: 1; border: 1px solid var(--glass-brd); border-radius: 999px; padding: 13px 18px;
  font: inherit; color: var(--ink); background: #fff; outline: none;
}
.chat-input input::placeholder { color: var(--muted); }
.chat-input input:focus { border-color: rgba(47,107,255,.6); box-shadow: 0 0 0 3px rgba(47,107,255,.1); }
.chat-input button {
  border: 0; border-radius: 999px; padding: 0 26px; cursor: pointer; font: inherit; font-weight: 700;
  color: #fff; background: linear-gradient(120deg, var(--accent), var(--accent-2));
  transition: transform .15s;
}
.chat-input button[type="submit"]:hover { transform: translateY(-1px); }
.attach-btn {
  border: 1px solid var(--glass-brd) !important; background: #fff !important;
  color: var(--ink) !important; border-radius: 50% !important; width: 44px; padding: 0 !important;
  font-size: 1.15rem; flex: none; cursor: pointer;
}
.attach-btn:hover { background: #eef4ff !important; }
.chat-box.drag-over { outline: 2px dashed var(--accent); outline-offset: -6px; }
.attach-row { display: none; flex-wrap: wrap; gap: 8px; padding: 12px 14px 0; }
.attach-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 220px;
  background: #fff; border: 1px solid var(--glass-brd);
  border-radius: 12px; padding: 6px 8px 6px 10px;
}
.attach-chip img { width: 34px; height: 34px; object-fit: cover; border-radius: 8px; }
.attach-chip .attach-ic { font-size: 1.2rem; }
.attach-chip .attach-nm { font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach-chip .attach-x {
  border: 0; background: rgba(45,75,160,.1); color: var(--ink); border-radius: 50%;
  width: 20px; height: 20px; line-height: 1; cursor: pointer; flex: none; font-size: 1rem;
}
.attach-chip .attach-x:hover { background: var(--no); color: #fff; }
.msg-thumb { display: block; margin-top: 8px; max-width: 200px; border-radius: 10px; }
.artifact-video { display: block; max-width: 100%; border-radius: 12px; margin-bottom: 8px; }
/* HeimishInvites template picker */
.invite-picker { align-self: stretch; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0; }
.invite-card {
  display: flex; flex-direction: column; gap: 6px; padding: 8px; cursor: pointer;
  background: #fff; border: 1px solid var(--glass-brd); border-radius: 14px;
  box-shadow: 0 2px 8px rgba(40,70,150,.06); transition: transform .16s, border-color .16s;
  font: inherit;
}
.invite-card:hover { transform: translateY(-3px); border-color: rgba(47,107,255,.5); }
.invite-card img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 8px; background: #eef2fb; }
.invite-title { font-size: .8rem; font-weight: 600; color: var(--ink); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 520px){ .invite-picker { grid-template-columns: repeat(3, 1fr); } .invite-title { font-size: .72rem; } }

/* Invitation details form */
.invite-form {
  align-self: stretch; display: flex; flex-direction: column; gap: 10px;
  background: #fff; border: 1px solid var(--glass-brd); border-radius: 16px;
  box-shadow: 0 2px 8px rgba(40,70,150,.05); padding: 14px; margin: 4px 0;
}
.invite-field { display: flex; flex-direction: column; gap: 4px; }
.invite-flabel { font-size: .82rem; font-weight: 600; color: var(--muted); }
.invite-field input, .invite-field textarea {
  font: inherit; font-size: .95rem; color: var(--ink); background: #f7f9ff;
  border: 1px solid var(--glass-brd); border-radius: 10px; padding: 9px 12px; outline: none; resize: vertical;
}
.invite-field input:focus, .invite-field textarea:focus { border-color: rgba(47,107,255,.55); background: #fff; }
.invite-form .artifact-btn { align-self: stretch; text-align: center; margin-top: 4px; }
a.artifact-btn { text-decoration: none; display: inline-block; }
/* phone login (SMS code) */
.login-box {
  align-self: stretch; display: flex; flex-direction: column; gap: 10px;
  background: #fff; border: 1px solid var(--glass-brd); border-radius: 16px;
  box-shadow: 0 2px 8px rgba(40,70,150,.05); padding: 16px; margin: 4px 0; max-width: 360px;
}
.login-step { display: flex; flex-direction: column; gap: 10px; }
.login-input {
  font: inherit; font-size: 1rem; color: var(--ink); background: #f7f9ff;
  border: 1px solid var(--glass-brd); border-radius: 10px; padding: 12px 14px; outline: none;
}
.login-input:focus { border-color: rgba(47,107,255,.55); background: #fff; }
.login-code { letter-spacing: .35em; text-align: center; font-weight: 700; }
.login-box .artifact-btn { align-self: stretch; text-align: center; }
.login-err { color: #c0392b; font-size: .85rem; min-height: 1em; }
/* voice messages (TTS) */
.voice-box {
  align-self: stretch; display: flex; flex-direction: column; gap: 10px; max-width: 420px;
  background: #fff; border: 1px solid var(--glass-brd); border-radius: 16px;
  box-shadow: 0 2px 8px rgba(40,70,150,.05); padding: 14px 16px; margin: 4px 0;
}
.voice-text { font-size: 1rem; color: var(--ink); line-height: 1.5; }
.voice-flabel { font-size: .82rem; font-weight: 600; color: var(--muted); }
.voice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.voice-btn {
  border: 1px solid var(--glass-brd); background: #f7f9ff; color: var(--ink);
  border-radius: 999px; padding: 8px 14px; cursor: pointer; font: inherit; font-weight: 600; font-size: .9rem;
  transition: border-color .15s, background .15s;
}
.voice-btn:hover { border-color: rgba(47,107,255,.55); background: #eef3ff; }
.voice-btn:disabled { opacity: .5; cursor: default; }
.artifact-card audio { margin: 2px 0; }
/* "hold my files" storage panel */
.files-panel {
  align-self: stretch; display: flex; flex-direction: column; gap: 10px;
  background: #fff; border: 1px solid var(--glass-brd); border-radius: 16px;
  box-shadow: 0 2px 8px rgba(40,70,150,.05); padding: 16px; margin: 4px 0; max-width: 460px;
}
.files-head { font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.files-usage { font-size: .82rem; color: var(--muted); }
.files-bar { height: 7px; border-radius: 999px; background: #eef2fb; overflow: hidden; }
.files-bar-in { height: 100%; width: 0; background: linear-gradient(120deg, var(--accent), var(--accent-2)); transition: width .3s; }
.files-panel .artifact-btn { align-self: stretch; text-align: center; }
.files-list { display: flex; flex-direction: column; gap: 6px; }
.files-empty { color: var(--muted); font-size: .88rem; padding: 6px 2px; }
.file-row {
  display: flex; align-items: center; gap: 8px; padding: 9px 11px;
  background: #f7f9ff; border: 1px solid var(--glass-brd); border-radius: 10px;
}
.file-nm { flex: 1; font-size: .92rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-sz { font-size: .78rem; color: var(--muted); direction: ltr; }
.file-ic {
  border: 0; background: #eaf0ff; color: var(--accent); cursor: pointer; font-size: 1rem;
  width: 32px; height: 32px; border-radius: 8px; line-height: 1; transition: background .15s;
}
.file-ic:hover { background: #d9e5ff; }
.file-ic:disabled { opacity: .5; cursor: default; }
.file-del { background: #ffecec; color: #c0392b; }
.file-del:hover { background: #ffd9d9; }
.vid-loading { font-style: italic; color: var(--muted); animation: vidpulse 1.5s ease-in-out infinite; }
@keyframes vidpulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
.chat-note { text-align: center; font-size: .85rem; color: var(--muted); margin-top: 16px; }
.chat-note a { color: var(--accent); }

/* ---------- Chat artifacts (Excel / PDF / image) ---------- */
.artifact-card {
  align-self: flex-start; max-width: 82%;
  background: #fff; border: 1px solid var(--glass-brd);
  box-shadow: 0 2px 8px rgba(40,70,150,.05);
  border-radius: 18px; border-bottom-inline-start-radius: 5px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 10px;
}
.artifact-name { font-size: .9rem; font-weight: 600; color: var(--ink); direction: ltr; text-align: start; }
.artifact-img { max-width: 100%; border-radius: 12px; display: block; }
.artifact-btn {
  align-self: flex-start; border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-weight: 700; font-size: .9rem; color: #fff;
  padding: 9px 18px; background: linear-gradient(120deg, var(--accent), var(--accent-2));
  transition: transform .15s;
}
.artifact-btn:hover { transform: translateY(-1px); }
.artifact-btn:disabled { opacity: .6; cursor: default; transform: none; }

/* Off-screen node used only to render a PDF in the browser (perfect Yiddish RTL). */
.pdf-doc {
  position: absolute; left: -99999px; top: 0; width: 760px;
  background: #fff; color: #1c2340; font-family: var(--font);
  padding: 48px 52px; line-height: 1.7; box-sizing: border-box;
}
.pdf-doc h1 { color: #0c1fce; font-size: 26px; margin: 0 0 18px; font-weight: 800; }
.pdf-doc p { margin: 0 0 12px; font-size: 15px; }
.pdf-doc table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 14px; }
.pdf-doc th, .pdf-doc td { border: 1px solid #d5d9e8; padding: 8px 10px; text-align: start; }
.pdf-doc th { background: #eef1ff; color: #0c1fce; font-weight: 700; }
.pdf-doc tbody tr:nth-child(even) td { background: #f7f8ff; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--glass-brd); padding: 26px 0 40px; margin-top: 20px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: .88rem; color: var(--muted); }
footer a { color: var(--ink); text-decoration: none; }
footer a:hover { color: var(--accent); }

/* ---------- Legal pages (English, LTR white sheet) ---------- */
.legal {
  direction: ltr; text-align: left;
  background: #fff; color: #1c2340;
  border-radius: 20px; padding: 42px clamp(22px, 5vw, 52px); margin: 30px auto 60px; max-width: 820px;
  box-shadow: var(--card-shadow); border: 1px solid var(--glass-brd);
}
.legal h1 { color: var(--accent); margin-bottom: 16px; font-size: 1.9rem; }
.legal h2 { color: var(--accent); font-size: 1.15rem; margin: 24px 0 6px; }
.legal p, .legal li { margin-bottom: 10px; color: #3a4364; }
.legal a { color: #2148e0; }
.legal strong { color: #1c2340; }

@media (max-width: 640px){ .ways { grid-template-columns: 1fr; } header nav { justify-content: center; } }
