:root{
  --ink:#0f172a;
  --ink-2:#1e293b;
  --muted:#64748b;
  --faint:#94a3b8;
  --bg:#f7f6f3;
  --card:#ffffff;
  --line:#e8e5df;
  --line-2:#f0eeea;
  --accent:#e4572e;
  --accent-2:#c2410c;
  --accent-soft:#fdeee8;
  --green:#0f7a53;
  --green-soft:#e6f5ef;
  --amber:#a45a09;
  --amber-soft:#fdf2e3;
  --red:#b3261e;
  --red-soft:#fdeceb;
  --shadow:0 1px 2px rgba(15,23,42,.04), 0 8px 24px -12px rgba(15,23,42,.12);
  --radius:18px;
}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:"Cairo",system-ui,-apple-system,"Segoe UI",Tahoma,sans-serif;
  font-size:15px;
  line-height:1.6;
  padding-bottom:calc(76px + env(safe-area-inset-bottom));
}
@media(min-width:860px){ body{padding-bottom:32px} }
a{color:inherit;text-decoration:none}
button{font-family:inherit;cursor:pointer}
.wrap{width:100%;max-width:1100px;margin:0 auto;padding:0 16px}

/* ---------- top bar ---------- */
.topbar{
  position:sticky;top:0;z-index:40;
  background:rgba(247,246,243,.92);
  backdrop-filter:saturate(140%) blur(12px);
  -webkit-backdrop-filter:saturate(140%) blur(12px);
  border-bottom:1px solid var(--line);
  padding:10px 0 0;
}
.topbar-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-bottom:10px}
.brand{display:flex;align-items:center;gap:9px}
.logo{
  width:34px;height:34px;border-radius:11px;display:grid;place-items:center;
  background:linear-gradient(150deg,#f97316,#e4572e 60%,#c2410c);
  color:#fff;font-weight:800;font-size:19px;line-height:1;
  box-shadow:0 6px 14px -6px rgba(228,87,46,.7);
}
.brand-name{font-weight:800;font-size:19px;letter-spacing:-.2px}
.brand-dot{color:var(--accent)}
.updated{
  display:flex;align-items:center;gap:6px;font-size:11.5px;color:var(--muted);
  background:#fff;border:1px solid var(--line);border-radius:999px;padding:5px 10px;white-space:nowrap;
}
.pulse{width:6px;height:6px;border-radius:50%;background:var(--green);box-shadow:0 0 0 0 rgba(15,122,83,.45);animation:pulse 2.4s infinite}
@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(15,122,83,.45)}70%{box-shadow:0 0 0 7px rgba(15,122,83,0)}100%{box-shadow:0 0 0 0 rgba(15,122,83,0)}}

.searchbox{
  position:relative;display:flex;align-items:center;gap:8px;
  background:#fff;border:1px solid var(--line);border-radius:14px;
  padding:0 12px;height:46px;box-shadow:var(--shadow);
}
.searchbox svg{width:18px;height:18px;fill:none;stroke:var(--faint);stroke-width:2;stroke-linecap:round;flex:none}
.searchbox input{
  border:0;outline:0;background:transparent;flex:1;font-family:inherit;
  font-size:15px;color:var(--ink);min-width:0;padding:0;
}
.searchbox input::placeholder{color:var(--faint)}
.q-clear[hidden]{display:none}
.q-clear{
  border:0;background:var(--line-2);color:var(--muted);width:22px;height:22px;border-radius:50%;
  font-size:16px;line-height:1;display:grid;place-items:center;flex:none;
}

.tabs{display:none;gap:6px;overflow-x:auto;scrollbar-width:none;padding-top:10px;padding-bottom:9px}
@media(min-width:860px){.tabs{display:flex}}
.tabs::-webkit-scrollbar{display:none}
.tab{
  border:1px solid var(--line);background:#fff;color:var(--ink-2);
  border-radius:999px;padding:7px 14px;font-size:13.5px;font-weight:600;white-space:nowrap;
  transition:.16s ease;
}
.tab.is-active{background:var(--ink);border-color:var(--ink);color:#fff}

/* ---------- panels ---------- */
main{padding-top:18px;min-height:50vh}
.panel{display:none;animation:fade .18s ease}
.panel.is-active{display:block}
@keyframes fade{from{opacity:.5;transform:translateY(3px)}to{opacity:1;transform:none}}
.panel-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-bottom:14px;flex-wrap:wrap}
.panel-head>div{min-width:0;flex:1 1 190px}
.panel-head .btn-ghost{flex:0 0 auto}
h1{font-size:20px;margin:0 0 3px;letter-spacing:-.3px}
.sub{margin:0;color:var(--muted);font-size:12.5px;max-width:46ch}
.count-pill{
  font-size:12px;color:var(--muted);background:#fff;border:1px solid var(--line);
  border-radius:999px;padding:5px 11px;white-space:nowrap;
}

/* ---------- chips ---------- */
.chips{display:flex;gap:7px;overflow-x:auto;scrollbar-width:none;padding-bottom:12px;margin-bottom:2px}
.chips::-webkit-scrollbar{display:none}
.chip{
  border:1px solid var(--line);background:#fff;color:var(--ink-2);
  border-radius:999px;padding:6px 12px;font-size:12.5px;font-weight:600;white-space:nowrap;transition:.14s;
}
.chip.is-on{background:var(--accent-soft);border-color:#f7c9b9;color:var(--accent-2)}
.chip .n{color:var(--faint);font-weight:500;margin-inline-start:4px}

/* ---------- offers grid ---------- */
.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
@media(min-width:620px){.grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}}
@media(min-width:940px){.grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
.offer{
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
  overflow:hidden;box-shadow:var(--shadow);display:flex;flex-direction:column;
  transition:transform .16s ease, box-shadow .16s ease;
}
.offer:hover{transform:translateY(-2px);box-shadow:0 2px 4px rgba(15,23,42,.05),0 16px 32px -18px rgba(15,23,42,.25)}
.offer-img{position:relative;aspect-ratio:1/1;background:var(--line-2);overflow:hidden}
.offer-img img{width:100%;height:100%;object-fit:cover;display:block}
.img-fallback{
  width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;
  background:linear-gradient(150deg,#fdeee8,#f7f6f3 60%,#eef2f7);
}
.img-fallback .if-mark{
  width:44px;height:44px;border-radius:14px;display:grid;place-items:center;
  background:#fff;border:1px solid var(--line);color:var(--accent-2);font-weight:800;font-size:19px;
}
.img-fallback small{font-size:11px;color:var(--muted);font-weight:700}
.offer-body{padding:9px 11px 11px;display:flex;flex-direction:column;gap:5px;flex:1}
.offer-store{font-size:11.5px;font-weight:700;color:var(--accent-2)}
.offer-title{
  font-size:13px;font-weight:600;line-height:1.45;margin:0;color:var(--ink);
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.pill{
  align-self:flex-start;margin-top:auto;font-size:11px;font-weight:700;border-radius:999px;
  padding:3px 9px;display:inline-flex;align-items:center;gap:4px;
}
.pill.ok{background:var(--green-soft);color:var(--green)}
.pill.soon{background:var(--amber-soft);color:var(--amber)}
.pill.today{background:var(--red-soft);color:var(--red)}
.pill.open{background:var(--line-2);color:var(--muted)}

/* ---------- prices ---------- */
.btn-ghost{
  display:inline-flex;align-items:center;gap:6px;background:#fff;border:1px solid var(--line);
  border-radius:11px;padding:8px 12px;font-size:12.5px;font-weight:700;color:var(--ink-2);
}
.btn-ghost{white-space:nowrap}
.btn-ghost svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.btn-ghost:hover{border-color:#d8d4cc}
.price-head{display:none}
.pricelist{background:#fff;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow)}
.prow{
  display:grid;grid-template-columns:1fr auto;gap:2px 10px;
  padding:11px 13px;border-bottom:1px solid var(--line-2);align-items:center;
}
.prow:last-child{border-bottom:0}
.prow .p-name{font-size:13.5px;font-weight:600;line-height:1.4}
.prow .p-market{font-size:11.5px;color:var(--muted);font-weight:600}
.prow .p-nums{display:flex;align-items:center;gap:8px;justify-content:flex-end;grid-row:1;grid-column:2}
.prow .was{font-size:12px;color:var(--faint);text-decoration:line-through}
.prow .now{font-size:15px;font-weight:800;color:var(--ink);white-space:nowrap}
.prow .off{
  font-size:11.5px;font-weight:800;color:#fff;background:var(--accent);
  border-radius:8px;padding:2px 6px;white-space:nowrap;
}
.prow .p-meta{grid-column:1 / -1;display:flex;gap:8px;align-items:center;font-size:11px;color:var(--faint)}
.prow a.src{color:var(--faint);text-decoration:underline;text-underline-offset:2px}
@media(min-width:760px){
  .price-head{
    display:grid;grid-template-columns:1fr 130px 90px 100px 72px;gap:10px;
    padding:0 14px 8px;font-size:11.5px;color:var(--faint);font-weight:700;
  }
  .price-head span:nth-child(n+3){justify-self:end}
  .prow{grid-template-columns:1fr 130px 90px 100px 72px;gap:10px;padding:11px 14px}
  .prow .p-name{grid-column:1}
  .prow .p-market{grid-column:2;grid-row:1}
  .prow .p-nums{display:contents}
  .prow .was{grid-column:3;grid-row:1;justify-self:end}
  .prow .now{grid-column:4;grid-row:1;justify-self:end}
  .prow .off{grid-column:5;grid-row:1;justify-self:end}
  .prow .p-meta{grid-column:1 / -1;grid-row:2}
}

/* ---------- cards (codes / hotels) ---------- */
.cards{display:grid;gap:12px;grid-template-columns:1fr}
@media(min-width:720px){.cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
.code{
  background:#fff;border:1px solid var(--line);border-radius:var(--radius);
  padding:14px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:9px;
}
.code-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.code-app{font-weight:800;font-size:15px}
.badge{font-size:10.5px;font-weight:700;border-radius:999px;padding:3px 8px}
.badge.ok{background:var(--green-soft);color:var(--green)}
.badge.warn{background:var(--amber-soft);color:var(--amber)}
.code-discount{font-size:13.5px;font-weight:700;color:var(--accent-2)}
.code-box{
  display:flex;align-items:center;gap:8px;background:var(--bg);border:1px dashed #d9d5cd;
  border-radius:12px;padding:9px 11px;
}
.code-val{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:17px;font-weight:700;letter-spacing:1.5px;flex:1}
.copy{
  border:0;background:var(--ink);color:#fff;border-radius:9px;padding:6px 11px;font-size:12px;font-weight:700;
}
.copy.done{background:var(--green)}
.code-terms{font-size:12px;color:var(--muted);line-height:1.55}
.code-foot{display:flex;align-items:center;justify-content:space-between;font-size:11.5px;color:var(--faint);gap:8px}
.code-foot a{text-decoration:underline;text-underline-offset:2px}
.nocode{font-size:12px;color:var(--muted);background:var(--bg);border-radius:10px;padding:8px 10px}

.hotel{
  background:#fff;border:1px solid var(--line);border-radius:var(--radius);
  padding:15px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:8px;
}
.hotel-city{font-size:17px;font-weight:800}
.hotel-dates{font-size:12px;color:var(--muted)}
.hotel-price{display:flex;align-items:baseline;gap:6px;margin-top:2px}
.hotel-price b{font-size:22px;letter-spacing:-.5px}
.hotel-price span{font-size:12px;color:var(--muted)}
.hotel-meta{font-size:11.5px;color:var(--faint)}
.hotel-cta{
  margin-top:6px;text-align:center;background:var(--accent-soft);color:var(--accent-2);
  border-radius:11px;padding:9px;font-size:13px;font-weight:700;
}

.empty{padding:40px 16px;text-align:center;color:var(--muted);font-size:13.5px}
.fineprint{font-size:11.5px;color:var(--faint);line-height:1.7;margin:12px 0 0}

/* ---------- footer ---------- */
.foot{padding:26px 16px 30px;border-top:1px solid var(--line);margin-top:26px}
.foot-sources{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:6px}
.src-chip{font-size:11.5px;color:var(--muted);background:#fff;border:1px solid var(--line);border-radius:999px;padding:4px 10px}

/* ---------- bottom nav ---------- */
.bottomnav{
  position:fixed;bottom:0;left:0;right:0;z-index:50;display:flex;
  background:rgba(255,255,255,.96);backdrop-filter:blur(12px);
  border-top:1px solid var(--line);padding:6px 4px calc(6px + env(safe-area-inset-bottom));
}
@media(min-width:860px){.bottomnav{display:none}}
.bn{
  flex:1;border:0;background:transparent;display:flex;flex-direction:column;align-items:center;gap:3px;
  padding:6px 0;color:var(--faint);font-size:10.5px;font-weight:700;border-radius:12px;
}
.bn svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.bn.is-active{color:var(--accent-2)}
.bn.is-active svg{stroke:var(--accent-2)}

/* skeleton */
.sk{background:linear-gradient(90deg,#efedea 25%,#f7f5f2 37%,#efedea 63%);background-size:400% 100%;animation:sh 1.4s infinite}
@keyframes sh{0%{background-position:100% 50%}100%{background-position:0 50%}}
.sk-card{height:230px;border-radius:var(--radius);border:1px solid var(--line)}

/* price source line: keep rows compact */
.prow .p-meta{gap:6px;min-width:0}
.prow .p-srctitle{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}
.prow .p-srctitle::before{content:"· ";color:var(--faint)}
