/* עיצוב משותף לדפי ההשוואה */
  :root {
    --bg: #fffaf2;
    --ink: #1d1b16;
    --muted: #6b6457;
    --accent: #c2410c;
    --accent-soft: #fde7d6;
    --good: #166534;
    --good-soft: #dcfce7;
    --card: #ffffff;
    --line: #eadfcc;
    --warn-bg: #fff3c4;
    --warn-ink: #5b4a12;
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --bg: #17150f;
      --ink: #f5efe3;
      --muted: #b3a990;
      --accent: #ff8a4c;
      --accent-soft: #3a2416;
      --good: #6ee7a0;
      --good-soft: #14321f;
      --card: #211e16;
      --line: #3a3426;
      --warn-bg: #3a3214;
      --warn-ink: #f3e3a6;
    }
  }
  * { box-sizing: border-box; }
  body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Heebo", system-ui, sans-serif;
    line-height: 1.5;
  }
  .wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px; }
  header { border-bottom: 1px solid var(--line); }
  header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
  .logo { font-weight: 900; font-size: 24px; color: var(--ink); text-decoration: none; }
  .logo span { color: var(--accent); }
  header nav a { color: var(--muted); text-decoration: none; font-size: 15px; }

  .sample.ok { background: var(--good-soft); color: var(--good); }
  .sample {
    background: var(--warn-bg);
    color: var(--warn-ink);
    border-radius: 12px;
    padding: 12px 16px;
    margin: 20px 0 0;
    font-size: 15px;
    font-weight: 500;
  }

  h1 { font-size: clamp(30px, 6vw, 44px); font-weight: 900; line-height: 1.15; margin: 24px 0 8px; }
  h1 span { color: var(--accent); }
  .lead { color: var(--muted); font-size: 18px; margin: 0 0 24px; }

  .controls { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
  .label { font-size: 14px; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
  .chips { display: flex; flex-wrap: wrap; gap: 8px; }
  .chip {
    min-height: 44px; padding: 0 16px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--card); color: var(--ink);
    font: inherit; font-size: 15px; cursor: pointer;
  }
  .chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 700; }
  .chip small { font-weight: 400; opacity: .75; margin-inline-start: 4px; }

  .best {
    background: var(--card);
    border: 2px solid var(--accent);
    border-radius: 20px;
    padding: 20px;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
    margin-bottom: 20px;
  }
  .best .tag { display: inline-block; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; padding: 4px 12px; border-radius: 999px; margin-bottom: 8px; }
  .best h2 { margin: 0; font-size: 22px; }
  .best .where { color: var(--muted); font-size: 15px; }
  .best .per { font-size: 40px; font-weight: 900; color: var(--accent); line-height: 1; }
  .best .per small { font-size: 16px; font-weight: 500; color: var(--muted); }
  .best .pack { font-size: 15px; color: var(--muted); margin-top: 4px; }

  .list { display: flex; flex-direction: column; gap: 10px; }
  .row {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 28px 56px 1fr auto;
    gap: 4px 14px;
    align-items: center;
  }
  .thumb {
    width: 56px; height: 56px; border-radius: 12px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 22px; color: #fff;
  }
  .thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
  .best .thumb { width: 88px; height: 88px; font-size: 34px; border-radius: 16px; }
  .best-main { display: flex; align-items: center; gap: 16px; }
  .rank { font-weight: 900; font-size: 18px; color: var(--muted); text-align: center; }
  .row.hl { border: 2px solid var(--accent); box-shadow: 0 0 0 4px rgba(232, 89, 12, .15); }
  .row:first-child .rank { color: var(--accent); }
  .name { font-weight: 700; font-size: 16px; }
  .note { color: var(--accent); font-weight: 700; font-size: 13px; }
  .meta { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
  .price { text-align: left; }
  .price .p { font-weight: 900; font-size: 22px; line-height: 1.1; }
  .price .p small { font-size: 13px; font-weight: 500; color: var(--muted); }
  .price .t { font-size: 14px; color: var(--muted); }
  .diff { display: inline-block; font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
  .diff.cheap { background: var(--good-soft); color: var(--good); }
  .deal { display: inline-block; font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #fde68a; color: #78350f; }
  .deal-line { font-size: 14px; font-weight: 700; color: #92400e; margin-top: 2px; }
  .reg { font-size: 13px; color: var(--muted); }

  .buy {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 44px; padding: 0 16px; border-radius: 12px;
    background: var(--ink); color: var(--bg); text-decoration: none;
    font-weight: 700; font-size: 15px; white-space: nowrap;
  }
  .buy:hover { opacity: .88; }
  .buy svg { width: 16px; height: 16px; }
  .row .buy { min-height: 40px; padding: 0 12px; font-size: 14px; margin-top: 6px; }
  .buy-note { font-size: 13px; color: var(--muted); margin-top: 6px; }
  .empty { background: var(--card); border: 1px dashed var(--line); border-radius: 16px; padding: 24px; text-align: center; color: var(--muted); }

  .how { margin: 36px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
  .how div { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
  .how b { display: block; margin-bottom: 4px; }
  .how p { margin: 0; color: var(--muted); font-size: 15px; }

  footer { margin: 40px 0 0; border-top: 1px solid var(--line); }
  footer .wrap { padding-top: 20px; padding-bottom: 28px; font-size: 14px; color: var(--muted); }

  /* היסטוריית מחירים (assets/history.js) */
  .hbtn {
    font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
    padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line);
    background: transparent; color: var(--ink);
  }
  .hbtn::before { content: "📈 "; }
  .hbtn:hover, .hbtn[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
  .hist { grid-column: 1 / -1; border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 12px; color: var(--muted); font-size: 14px; }
  .hist-sum { margin: 0 0 8px; color: var(--ink); font-size: 15px; }
  .hist-chart svg { width: 100%; height: auto; max-height: 170px; display: block; direction: ltr; }
  .hg-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
  .hg-lo { stroke: var(--good); stroke-width: 1.5; stroke-dasharray: 5 5; }
  .hg-dot { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
  .hist-dates { display: flex; justify-content: space-between; direction: ltr; font-size: 13px; margin-top: 2px; }
  .hist-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; }
  .hist-meta b { color: var(--ink); }
  .hist-note { margin: 6px 0 0; font-size: 13px; }

  @media (max-width: 520px) {
    .row { grid-template-columns: 24px 48px 1fr; }
    .thumb { width: 48px; height: 48px; font-size: 19px; }
    .price { grid-column: 3; text-align: right; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
  }

  .low { display: inline-block; font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--good-soft); color: var(--good); }
