:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #1b1a17;
  --muted: #6b675f;
  --line: #e6e2d9;
  --accent: #c4400c;
  --accent-ink: #ffffff;
  --link: #1d4ed8;
  --gold-1: #8a6408;
  --gold-2: #f5d27a;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 24px rgba(0,0,0,.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141311;
    --surface: #1d1c19;
    --ink: #f2efe8;
    --muted: #a39e94;
    --line: #34312c;
    --accent: #ff6a33;
    --accent-ink: #1b1a17;
    --link: #8ab4ff;
    --gold-1: #d4a72c;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 24px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Rubik", system-ui, sans-serif;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
main { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 0 16px; }

.view { display: none; }
.view.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- לוגו ---------- */
.logo {
  font-weight: 900;
  font-size: clamp(56px, 14vw, 96px);
  letter-spacing: -2px;
  margin: 0;
  line-height: 1;
  color: var(--ink);
}
.logo .q { color: var(--accent); display: inline-block; transform: rotate(-12deg); }
.logo.small {
  font-size: 26px; letter-spacing: -.5px;
  background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit;
}

/* ---------- בית ---------- */
#home.active {
  min-height: 78dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.tagline { color: var(--muted); margin: 10px 0 28px; font-size: 17px; }

.search {
  width: 100%; max-width: 580px;
  display: flex; align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  padding: 4px 6px 4px 4px;
  transition: border-color .15s;
}
.search:focus-within { border-color: var(--accent); }
.search input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 18px; color: var(--ink);
  padding: 12px 16px;
}
.search button {
  width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; cursor: pointer;
}
.home-buttons { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; justify-content: center; }
.disclosure { margin-top: 36px; color: var(--muted); font-size: 14px; max-width: 420px; }

/* ---------- כפתורים ---------- */
.btn {
  font: inherit; font-weight: 500; font-size: 16px;
  border-radius: 12px; padding: 11px 20px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .08s, filter .15s;
}
.btn:active { transform: scale(.97); }
.btn:hover { filter: brightness(1.05); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.gold {
  background: linear-gradient(135deg, var(--gold-1), var(--gold-2) 55%, var(--gold-1));
  color: #2a1d00;
}
.btn.big { font-size: 19px; padding: 14px 28px; }

/* ---------- הצעות חיפוש ---------- */
.search { position: relative; }
.sugg {
  position: absolute; top: calc(100% + 6px); right: 0; left: 0; z-index: 20;
  list-style: none; margin: 0; padding: 6px 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.14);
  text-align: right;
}
.sugg li {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 18px; cursor: pointer; font-size: 16px; color: var(--ink);
}
.sugg li b { font-weight: 700; }
.sugg li.active, .sugg li:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.sugg-icon {
  width: 16px; height: 16px; flex: none; opacity: .5;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.8l-.3-.3A6.5 6.5 0 1 0 9.5 16a6.5 6.5 0 0 0 4.2-1.6l.3.3v.8l5 5 1.5-1.5-5-5Zm-6 0a4.5 4.5 0 1 1 0-9 4.5 4.5 0 0 1 0 9Z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.8l-.3-.3A6.5 6.5 0 1 0 9.5 16a6.5 6.5 0 0 0 4.2-1.6l.3.3v.8l5 5 1.5-1.5-5-5Zm-6 0a4.5 4.5 0 1 1 0-9 4.5 4.5 0 0 1 0 9Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- דף תוצאות ---------- */
#results.active { max-width: 680px; }
.rbar { display: flex; align-items: center; gap: 18px; padding: 20px 0 10px; }
.search.compact { max-width: none; flex: 1; box-shadow: none; }
.search.compact input { font-size: 16px; padding: 9px 14px; }
.search.compact button { width: 38px; height: 38px; }
@media (max-width: 520px) {
  .rbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .rbar .logo.small { align-self: center; }
}

.tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.tab {
  font: inherit; font-size: 14px; color: var(--muted);
  background: none; border: 0; border-bottom: 3px solid transparent;
  padding: 10px 12px; cursor: pointer; white-space: nowrap;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }
.tab-note { color: var(--muted); font-style: italic; margin: 0 0 12px; }

.stats { color: var(--muted); font-size: 14px; margin: 14px 0 22px; }

.result { margin-bottom: 30px; }
.site { display: flex; align-items: center; gap: 10px; }
.fav {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); font-size: 15px;
}
.site-name { font-size: 14px; color: var(--ink); }
.site-url { font-size: 12px; color: var(--muted); }
.r-title {
  margin: 8px 0 4px; font-size: 21px; font-weight: 400; color: var(--link);
  cursor: pointer; display: inline-block; overflow-wrap: anywhere;
}
.r-title:hover { text-decoration: underline; }
.r-title.wiggle { animation: wiggle .45s ease; }
@keyframes wiggle {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); } 40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); } 80% { transform: translateX(3px); }
}
.r-snippet { margin: 0; line-height: 1.6; font-size: 15px; }
.r-snippet .date { color: var(--muted); }
.blurred { filter: blur(5px); user-select: none; }
.nope { color: var(--accent); font-weight: 500; min-height: 1.4em; margin: 6px 0 0; }

.paywall {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 20px; box-shadow: var(--shadow);
}
.paywall-title { margin: 0 0 14px; font-weight: 500; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .plans { grid-template-columns: 1fr; } }
.plan {
  position: relative;
  border: 1px solid var(--line); border-radius: 14px; padding: 18px;
  display: flex; flex-direction: column; gap: 6px;
}
.plan h3 { margin: 0; font-size: 17px; }
.plan p { margin: 0 0 10px; color: var(--muted); font-size: 14px; flex: 1; }
.price { font-size: 36px; font-weight: 900; }
.plan.premium { border-color: var(--gold-1); }
.plan.premium .price { font-family: "Bellefair", serif; font-weight: 400; color: var(--gold-1); }
.badge {
  position: absolute; top: -11px; left: 14px;
  background: var(--gold-2); color: #2a1d00;
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}

.paid-box {
  margin-top: 18px; padding: 18px; border-radius: 14px; text-align: center;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}
.paid-box p { margin: 0 0 12px; }
.guarantee { color: var(--muted); font-size: 13px; margin: 18px 0 0; text-align: center; }

.pager { text-align: center; margin: 40px 0 20px; }
.pager-logo { font-weight: 900; font-size: 30px; letter-spacing: -1px; }
.pager-logo .q { color: var(--accent); }
.pager-nums { color: var(--accent); margin-top: 4px; }

/* ---------- טעינה ---------- */
#loading.active {
  min-height: 70dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.spinner {
  width: 54px; height: 54px; border-radius: 50%;
  border: 5px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 20px; font-weight: 500; min-height: 1.5em; margin: 22px 0 14px; text-align: center; }
.progress { width: min(320px, 80vw); height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .6s ease; }

/* ---------- תשובה ---------- */
#answer.active { padding: 48px 0; text-align: center; }
.your-q { color: var(--muted); overflow-wrap: anywhere; }
.your-q span { color: var(--ink); font-weight: 500; }
.answer-card {
  margin: 18px auto 26px; padding: 44px 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow);
  animation: pop .5s cubic-bezier(.2,1.6,.4,1);
}
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.a-text { margin: 0; font-size: clamp(28px, 7vw, 44px); font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.premium-label { display: none; }

/* פרימיום: אותה תשובה בדיוק, בפונט יפה יותר */
.answer-card.is-premium {
  border: 2px solid var(--gold-1);
  background:
    radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--gold-2) 25%, transparent), transparent 50%),
    radial-gradient(circle at 80% 90%, color-mix(in srgb, var(--gold-2) 20%, transparent), transparent 50%),
    var(--surface);
}
.answer-card.is-premium .premium-label {
  display: block; margin-bottom: 14px;
  color: var(--gold-1); font-weight: 700; letter-spacing: 1px; font-size: 14px;
}
.answer-card.is-premium .a-text {
  font-family: "Bellefair", serif; font-weight: 400;
  font-size: clamp(36px, 9vw, 60px);
  background: linear-gradient(135deg, var(--gold-1), var(--gold-2) 45%, var(--gold-1) 70%, var(--gold-2));
  background-size: 200% 200%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 3s ease-in-out infinite;
}
@keyframes shimmer { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.share-note { color: var(--accent); min-height: 1.4em; }
.refund { color: var(--muted); font-size: 14px; }

/* ---------- תחתית ---------- */
.footer {
  text-align: center; color: var(--muted); font-size: 13px;
  padding: 22px 16px; border-top: 1px solid var(--line);
}
.footer a { color: var(--muted); }

/* ---------- תקנון ---------- */
.terms { padding: 32px 0 48px; line-height: 1.7; }
.terms h1 { font-size: 30px; }
.terms h2 { font-size: 20px; margin-top: 30px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
