/* Ketto Bro — Petto Bro family look: navy + yellow.
   Layout: sticky navy header → navy hero band (headline + featured coupon ticket) →
   colored category tiles → filter bar → card grid. Cards: brand badge, discount stamp, ticket stub. */
:root {
  color-scheme: light;
  --navy: #233D84;
  --navy-2: #1d2c63;
  --yellow: #FFC93C;
  --yellow-2: #ffd84d;
  --paper: #f7f8fb;
  --card: #ffffff;
  --ink: #111834;
  --muted: #5b6382;
  --line: #e1e4ef;
  --soft: #eceffa;
  --yellow-soft: #fff6dc;
  --yellow-edge: #d9a21b;
  --green: #2A9D8F;
  --green-soft: #e1f3f1;
  --hot: #E63946;
  --hot-soft: #fde6e8;
  --leaf: var(--navy);
  --leaf-ink: #f4f6fc;
  --leaf-soft: var(--soft);
  --gold: var(--yellow);
  --gold-soft: var(--yellow-soft);
  --shadow-sm: 0 1px 2px rgb(35 61 132 / .06);
  --shadow: 0 1px 2px rgb(35 61 132 / .05), 0 8px 24px -8px rgb(35 61 132 / .14);
  --shadow-lg: 0 2px 4px rgb(35 61 132 / .06), 0 18px 40px -12px rgb(35 61 132 / .28);
  --f-display: "Manjari", "Noto Sans Malayalam", system-ui, sans-serif;
  --f-body: "Manjari", "Noto Sans Malayalam", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 18px;
}


* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 120px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--f-body); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 10; background: var(--navy);
}
.wrap {
  max-width: 1200px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }

/* ---------- Header ---------- */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 6;
  background: rgb(35 61 132 / .96); color: var(--leaf-ink);
  backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid rgb(255 255 255 / .08);
}
.top .wrap { display: flex; align-items: center; gap: 12px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.bubble {
  position: relative; background: var(--yellow); color: var(--navy);
  font-family: var(--f-display); font-weight: 700; font-size: 1.08rem; line-height: 1;
  padding: 9px 13px 6px; border-radius: 14px 14px 14px 4px; white-space: nowrap;
  box-shadow: 0 3px 0 var(--yellow-edge);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text b { font-size: 1rem; letter-spacing: .01em; }
.brand-text small { opacity: .7; font-size: .72rem; }
.search {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .16);
  border-radius: 999px; padding: 7px 16px; transition: background .2s, border-color .2s;
}
.search svg { flex: none; opacity: .8; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--leaf-ink); }
.search input::placeholder { color: var(--leaf-ink); opacity: .6; }
.search:focus-within { border-color: var(--yellow); background: rgb(255 255 255 / .13); }
.lang { flex: none; display: flex; border: 1px solid rgb(255 255 255 / .25); border-radius: 999px; overflow: hidden; }
.lang button { background: none; border: 0; color: var(--leaf-ink); padding: 5px 11px; cursor: pointer; font-size: .82rem; }
.lang button[aria-pressed="true"] { background: var(--yellow); color: var(--navy); font-weight: 700; }

/* ---------- Buttons ---------- */
.btn {
  flex: none; border: 0; border-radius: 999px; padding: 8px 16px; cursor: pointer; font-weight: 700; font-size: .88rem;
  background: var(--navy); color: #fff; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -6px rgb(35 61 132 / .5); }
.btn:active { transform: translateY(0); }

.btn.yellow { background: var(--yellow) !important; color: var(--navy) !important; box-shadow: 0 3px 0 var(--yellow-edge); }
.btn.yellow:hover { box-shadow: 0 5px 0 var(--yellow-edge); }
.btn.outline { background: none !important; color: #fff !important; border: 1.5px solid rgb(255 255 255 / .35); }
.btn.ghost { background: none !important; color: var(--ink) !important; border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--ink); box-shadow: none; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Save-as-app banner ---------- */
.appbar { background: var(--yellow); color: var(--navy); }
.appbar .wrap { display: flex; align-items: center; gap: 12px; padding-block: 8px; }
.appbar img { border-radius: 9px; flex: none; box-shadow: 0 0 0 2px rgb(35 61 132 / .15); }
.appbar p { margin: 0; flex: 1; min-width: 0; font-size: .86rem; line-height: 1.45; }
.appbar .btn { background: var(--navy) !important; color: #fff !important; padding: 6px 14px; }

/* ---------- Hero ---------- */
.hero-band {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(600px 300px at 85% 20%, rgb(255 201 60 / .18), transparent 70%),
    radial-gradient(500px 260px at 5% 100%, rgb(42 157 143 / .22), transparent 70%),
    var(--navy);
}
.hero-band::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgb(255 255 255 / .12) 1px, transparent 1.4px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, #000, transparent 85%);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%);
}
.hero-band::after { content: ""; position: absolute; inset: auto 0 0; height: 5px; background: var(--yellow); }
.hero-grid {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr);
  gap: 32px; align-items: center; padding-block: 40px 48px;
}
.hero-copy { display: grid; gap: 14px; justify-items: start; min-width: 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; letter-spacing: .06em;
  background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .14);
  padding: 4px 12px; border-radius: 999px; color: rgb(255 255 255 / .85);
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 4px rgb(255 201 60 / .25); }
.hero-copy h1 {
  margin: 0; font-family: var(--f-display); font-weight: 700;
  font-size: clamp(1.9rem, 4.6vw, 3.2rem); line-height: 1.2; text-wrap: balance;
}
.hero-copy h1 em {
  font-style: normal; color: var(--navy); background: var(--yellow); padding: .08em .3em 0;
  border-radius: 12px 12px 12px 4px; display: inline-block; transform: rotate(-1.5deg); margin-right: .15em;
  box-shadow: 0 4px 0 var(--yellow-edge);
}
.hero-copy p { margin: 0; color: rgb(255 255 255 / .78); max-width: 56ch; font-size: 1rem; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; }
.stats div {
  display: flex; flex-direction: column; min-width: 92px; padding: 8px 14px 6px;
  background: rgb(255 255 255 / .07); border: 1px solid rgb(255 255 255 / .12); border-radius: 14px;
}
.stats b { font-size: 1.6rem; line-height: 1.1; color: var(--yellow); font-variant-numeric: tabular-nums; }
.stats span { font-size: .78rem; color: rgb(255 255 255 / .75); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.hero-cta .btn { padding: 10px 20px; font-size: .95rem; }

/* Featured ticket */
.feature { min-width: 0; }
.ticket {
  position: relative; background: var(--card); color: var(--ink); border-radius: 22px; padding: 18px 20px 20px;
  box-shadow: var(--shadow-lg); transform: rotate(1.2deg); display: grid; gap: 8px;
  animation: floatIn .6s cubic-bezier(.2,.8,.2,1) both;
}
.ticket::before, .ticket::after {
  content: ""; position: absolute; top: 58%; width: 26px; height: 26px; border-radius: 50%; background: var(--navy);
}
.ticket::before { left: -13px; } .ticket::after { right: -13px; }
.ticket-head { font-size: .8rem; font-weight: 700; letter-spacing: .06em; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.spark { color: var(--yellow-edge); font-size: 1rem; }
.ticket-main { display: flex; align-items: center; gap: 12px; }
.ticket-disc { font-family: var(--f-display); font-weight: 700; font-size: 2.6rem; line-height: 1; color: var(--navy); }

.ticket h3 { margin: 0; font-size: 1.08rem; line-height: 1.4; text-wrap: balance; }
.ticket-sub { color: var(--muted); font-size: .86rem; }
.ticket-sub b { color: var(--hot); }
.ticket-code {
  margin-top: 6px; padding-top: 14px; border-top: 2px dashed var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.ticket-code small { flex-basis: 100%; font-size: .72rem; color: var(--muted); letter-spacing: .05em; }
.ticket-code .code { flex: 1 1 140px; font-size: .95rem; padding: 8px 12px; }
@keyframes floatIn { from { transform: translateY(14px) rotate(3deg); } to { transform: translateY(0) rotate(1.2deg); } }

/* ---------- Category tiles ---------- */
.cats { display: flex; gap: 10px; overflow-x: auto; padding-block: 22px 8px; scrollbar-width: none; scroll-snap-type: x proximity; }
.cats::-webkit-scrollbar { display: none; }
.chip {
  --c: var(--navy);
  flex: none; scroll-snap-align: start; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
  column-gap: 10px; align-items: center; min-width: 150px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px 9px 10px;
  text-decoration: none; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.chip .ic {
  grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent);
}
.chip .lbl { font-weight: 700; font-size: .9rem; line-height: 1.25; white-space: nowrap; }
.chip .n { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--c) 45%, var(--line)); }
.chip[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 4px 0 var(--yellow); }
.chip[aria-current="page"] .ic { background: var(--yellow); color: var(--navy); }
.chip[aria-current="page"] .n { color: rgb(255 255 255 / .7); }

/* ---------- Section + filters ---------- */
.sect { font-family: var(--f-display); font-size: 1.4rem; margin: 18px 0 2px; display: flex; align-items: center; gap: 14px; }
.sect::before { content: ""; width: 10px; height: 22px; border-radius: 4px; background: var(--yellow); box-shadow: 4px 0 0 var(--navy); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-block: 10px 16px; }
.seg { display: flex; background: var(--soft); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 14px; cursor: pointer; font-size: .86rem; border-radius: 999px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: var(--shadow-sm); }
.filters select {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 12px; font-size: .86rem; max-width: 100%;
}
.filters .count { margin-left: auto; color: var(--muted); font-size: .86rem; }

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--yellow-soft); border-radius: 14px; border-left: 4px solid var(--yellow);
  padding: 10px 14px; font-size: .86rem; margin-bottom: 18px;
}
.notice b { white-space: nowrap; }

/* ---------- Deal cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; padding-bottom: 48px; }
.card {
  --c: var(--navy);
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  animation: rise .45s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 40ms);
}
.card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--c); }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
@keyframes rise { from { transform: translateY(10px); opacity: .35; } to { transform: none; opacity: 1; } }
.card .body { padding: 18px 18px 12px; display: grid; gap: 10px; flex: 1; align-content: start; }
.card-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.logo {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none;
  background: var(--b); color: var(--f); font-weight: 700; font-size: .95rem; letter-spacing: -.01em;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12), 0 2px 6px -2px rgb(0 0 0 / .3);
}
.who { display: grid; min-width: 0; line-height: 1.3; }
.who b { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { color: var(--muted); font-size: .76rem; display: inline-flex; align-items: center; gap: 3px; overflow: hidden; white-space: nowrap; }
.stamp {
  font-family: var(--f-display); font-weight: 700; font-size: 1.35rem; line-height: 1; white-space: nowrap;
  background: var(--yellow); color: var(--navy); padding: 9px 11px 6px; border-radius: 12px 12px 4px 12px;
  transform: rotate(3deg); box-shadow: 0 3px 0 var(--yellow-edge); font-variant-numeric: tabular-nums;
}
.stamp.long { font-size: 1rem; }
.card h3 { margin: 0; font-size: 1.05rem; line-height: 1.45; font-weight: 700; text-wrap: balance; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .74rem; }
.tag { padding: 3px 9px 2px; border-radius: 999px; background: var(--soft); color: var(--ink); }
.tag.type-coupon { background: color-mix(in srgb, var(--yellow) 30%, transparent); }
.tag.type-deal { background: var(--soft); }
.tag.type-offer { background: var(--green-soft); color: var(--green); }
.tag.sample { background: var(--yellow-soft); border: 1px solid var(--yellow); font-weight: 700; }
.tag.hot { background: var(--hot-soft); color: var(--hot); font-weight: 700; }
.tag.hot::before { content: "● "; animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
.note {
  margin: 0; font-size: .84rem; color: var(--muted); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.src { font-size: .74rem; color: var(--muted); }
.src a { color: var(--ink); }

/* Ticket stub */
.stub {
  position: relative; border-top: 2px dashed var(--line); background: color-mix(in srgb, var(--soft) 50%, var(--card));
  padding: 12px 18px 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between;
}
.stub::before, .stub::after {
  content: ""; position: absolute; top: -10px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--line);
}
.stub::before { left: -10px; clip-path: inset(0 0 0 50%); }
.stub::after { right: -10px; clip-path: inset(0 50% 0 0); }
.stub .code { flex: 1 1 130px; }
.code {
  font-family: var(--f-mono); font-size: .82rem; letter-spacing: .05em; font-weight: 500;
  border: 1.5px dashed var(--yellow-edge); background: var(--yellow-soft); border-radius: 10px;
  padding: 6px 10px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: all;
}
.stub .btn.ghost { padding: 7px 10px; }
.nolink { font-size: .8rem; color: var(--muted); }

.empty { text-align: center; padding: 50px 10px; color: var(--muted); grid-column: 1 / -1; }
.empty b { display: block; font-family: var(--f-display); font-size: 1.3rem; color: var(--ink); }

/* ---------- Add-a-deal page ---------- */
#addView .hero { padding-block: 20px 6px; }
#addView .hero p { margin: 0; }
.add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; padding-block: 10px 40px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-width: 0; box-shadow: var(--shadow); }
.panel h2 { font-family: var(--f-display); margin: 0 0 6px; font-size: 1.3rem; }
.panel p { margin: 0 0 12px; color: var(--muted); font-size: .9rem; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.form label { display: grid; gap: 3px; font-size: .8rem; color: var(--muted); min-width: 0; }
.form label.full { grid-column: 1 / -1; }
.form input, .form select { border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 8px 10px; font-size: .9rem; width: 100%; }
pre.json {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  font-family: var(--f-mono); font-size: .78rem; overflow-x: auto; margin: 0 0 12px; white-space: pre;
}
ol.steps { margin: 0 0 12px; padding-left: 1.2em; font-size: .9rem; display: grid; gap: 4px; }
code { font-family: var(--f-mono); font-size: .85em; background: var(--soft); padding: 1px 5px; border-radius: 4px; }

/* ---------- Footer ---------- */
footer { background: var(--navy); color: rgb(255 255 255 / .75); font-size: .84rem; border-top: 5px solid var(--yellow); }
footer .wrap { padding-block: 22px 28px; display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between; }
footer a { color: var(--yellow); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px);
  background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 14px; font-size: .88rem;
  border-bottom: 3px solid var(--yellow); box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center; z-index: 40;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- BROwnie points ---------- */
.pts {
  flex: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: #6b3f22; color: #fbefe1; border: 1px solid #8a5531; border-radius: 999px; padding: 4px 11px 4px 6px; font-size: .82rem;
}
.pts .brownie { width: 22px; height: 22px; flex: none; }
.pts b { font-variant-numeric: tabular-nums; font-size: .95rem; }
.pts.bump { animation: bump .5s ease; }
@keyframes bump { 40% { transform: scale(1.15); } }
.pts-panel {
  position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); top: calc(100% + 10px);
  width: min(340px, calc(100vw - 32px)); background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 16px; z-index: 8;
}
.pts-panel h2 { margin: 0; font-family: var(--f-display); font-size: 1.2rem; }
.pts-panel p { margin: 4px 0 12px; color: var(--muted); font-size: .84rem; }
.lvl { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.lvl b { font-family: var(--f-display); font-size: 1.05rem; }
.lvl span { font-family: var(--f-display); font-size: 1.6rem; font-weight: 700; color: #8a5531; font-variant-numeric: tabular-nums; }

.bar { height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; margin: 6px 0 4px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #8a5531, var(--yellow)); border-radius: 99px; transition: width .4s; }
.next { font-size: .78rem; color: var(--muted); margin-bottom: 10px; }
.pts-panel ul { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; font-size: .86rem; }
.pts-panel li { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--line); padding-bottom: 5px; }
.pts-panel li small { color: var(--muted); }
.pts-panel li b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- Install popup ---------- */
.modal-bg {
  position: fixed; inset: 0; z-index: 30; background: rgb(8 12 30 / .6);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.modal {
  position: relative; width: min(420px, 100%); max-height: 100%; overflow-y: auto;
  background: var(--card); color: var(--ink); border-radius: 22px; padding: 22px 20px 18px;
  border-top: 6px solid var(--yellow); box-shadow: var(--shadow-lg);
  display: grid; gap: 10px; justify-items: start; animation: pop .3s cubic-bezier(.2,.8,.2,1);
}
@keyframes pop { from { transform: translateY(16px) scale(.97); } to { transform: none; } }
.modal img { border-radius: 16px; box-shadow: var(--shadow); }
.modal h2 { margin: 0; font-family: var(--f-display); font-size: 1.3rem; line-height: 1.3; text-wrap: balance; }
.modal p { margin: 0; color: var(--muted); font-size: .9rem; }
.modal .soon { background: var(--soft); border-radius: 12px; padding: 8px 12px; font-size: .86rem; width: 100%; }
.modal .tabs { width: 100%; }
.modal .tabs button { flex: 1; }
.modal .steps { margin: 0; width: 100%; }
.modal .btn.big { width: 100%; padding: 12px; font-size: .95rem; }
.modal .x {
  position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); font-size: 1.2rem; line-height: 1; cursor: pointer; color: var(--ink);
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; padding-block: 28px 40px; }
  .ticket { transform: none; animation: none; }
}
@media (max-width: 720px) {
  .top .wrap { flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; }
  .brand { flex: 1; }
  .add { grid-template-columns: minmax(0, 1fr); }
  .filters .count { margin-left: 0; flex-basis: 100%; }
  .notice { flex-direction: column; gap: 2px; }
  .chip { min-width: 0; }
  .grid { gap: 14px; }
}
@media (max-width: 520px) {
  .brand-text { display: none; }
  .appbar .wrap { flex-wrap: wrap; }
  .appbar p { flex-basis: calc(100% - 50px); }
  .appbar .btn { margin-left: 48px; }
  .stats div { min-width: 0; flex: 1; }
  .stats b { font-size: 1.35rem; }
  .hero-cta .btn { flex: 1 1 auto; white-space: nowrap; }
  .hero-cta [data-share] { flex-basis: 100%; }
  .pts-label { display: none; }
}
@media (max-width: 420px) { .form { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.hero-copy h1 em { margin-bottom: .14em; }
@media (max-width: 720px) {
  .filters select { flex: 1 1 140px; }
  .chip { padding: 8px 12px 7px 8px; }
  .chip .ic { width: 34px; height: 34px; border-radius: 10px; }
  .hero-copy p { font-size: .94rem; }
}

/* Paging, store filter, Kerala-only */
.more { display: grid; justify-items: center; gap: 6px; padding-block: 0 48px; margin-top: -24px; }
.more .btn { padding: 11px 26px; font-size: .95rem; }
.more small { color: var(--muted); font-size: .8rem; }
.kl { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--muted); cursor: pointer; }
.kl input { accent-color: var(--navy); width: 16px; height: 16px; }
.tag.nk { background: var(--hot-soft); color: var(--hot); }
#storeSel { max-width: 220px; }
@media (max-width: 720px) { #storeSel { max-width: none; } }
.stamp.long { white-space: normal; max-width: 112px; text-align: center; line-height: 1.15; }
@media (max-width: 720px) { .filters select { flex: 1 1 40%; min-width: 0; } #sort { flex-basis: 100%; } }

/* Accent roles: red = urgency / big discounts, green = savings / verified */
.stamp.big { background: var(--hot); color: #fff; box-shadow: 0 3px 0 #a9232f; }
.stamp.save { background: var(--green); color: #fff; box-shadow: 0 3px 0 #1d6f65; }
.src .ok { color: var(--green); font-weight: 700; }
.notice { background: var(--green-soft); border-left-color: var(--green); }
.notice b { color: var(--green); }
.pts-panel li b { color: var(--green); }
.toast { border-bottom-color: var(--green); }
.ticket-disc.big { color: var(--hot) !important; }
.stats div:nth-child(3) b { color: #ff8a93; }

/* Card top strip by deal type: coupon = yellow, deal = navy, offer = green */
.card.k-coupon::before { background: var(--yellow); }
.card.k-deal::before { background: var(--navy); }
.card.k-offer::before { background: var(--green); }


/* ---------- Search suggestions ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.search { position: relative; }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 20;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 6px; max-height: min(70vh, 460px); overflow-y: auto;
}
.sg-h { font-size: .7rem; letter-spacing: .06em; color: var(--muted); padding: 8px 10px 4px; font-weight: 700; }
.sg { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; cursor: pointer; }
.sg:hover, .sg.on { background: var(--soft); }
.sg-t { display: grid; min-width: 0; line-height: 1.3; }
.sg-t b { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-t small { color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-ic { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--c, var(--navy)); background: color-mix(in srgb, var(--c, var(--navy)) 14%, transparent); }
.sg-ic.ml { background: var(--yellow); color: var(--navy); font-weight: 700; }
.logo.sm { width: 30px; height: 30px; border-radius: 9px; font-size: .72rem; }

/* ---------- English translation lines (Malayalam mode) ---------- */
.tr { display: block; font-size: .8em; font-weight: 400; color: var(--muted); line-height: 1.4; margin-top: 2px; letter-spacing: 0; }
.hero-copy .tr, footer .tr, .appbar .tr { color: inherit; opacity: .72; }
.hero-copy h1 .tr { font-size: .42em; font-weight: 700; margin-top: 6px; }
.card h3 .tr { font-size: .8rem; font-weight: 400; margin-top: 3px; }
.note .tr { font-size: .78rem; opacity: .85; }
.appbar p .tr { display: inline; margin-left: 4px; }
.appbar p b .tr { display: none; }
.notice .tr { font-size: .8rem; }
.sect .tr { display: inline; font-size: .6em; margin-left: 8px; }

/* ---------- Sharing ---------- */
.btn.wa { background: #25D366 !important; color: #fff !important; padding: 7px 9px; box-shadow: none; }
.btn.wa:hover { box-shadow: 0 6px 14px -6px rgb(37 211 102 / .6); }
.hero-cta .btn svg, footer .btn svg { vertical-align: -3px; margin-right: 6px; }
footer .btn.yellow { padding: 6px 14px; font-size: .84rem; }
.shared-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--yellow-soft); border: 1px solid #f3dc9c; border-radius: 14px; padding: 10px 14px; margin-bottom: 14px;
}
.shared-bar b { font-family: var(--f-display); }
.modal.share { width: min(520px, 100%); justify-items: stretch; }
.modal.share h2 { padding-right: 36px; }
.share-what { background: var(--soft); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; font-size: .9rem; }
.share-what small { color: var(--muted); }
.nets { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px 6px; }
.net {
  display: grid; justify-items: center; gap: 5px; padding: 6px 2px; border: 0; background: none; cursor: pointer;
  color: var(--ink); text-decoration: none; font: inherit; font-size: .76rem; border-radius: 12px; text-align: center;
}
.net:hover { background: var(--soft); }
.net:focus-visible { outline: 2px solid var(--navy); outline-offset: 1px; }
.net-ic { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; box-shadow: var(--shadow-sm); transition: transform .15s; }
.net:hover .net-ic { transform: translateY(-2px); }
.net[data-net="snapchat"] .net-ic { box-shadow: inset 0 0 0 1px #e6e200; }
.share-msg {
  margin: 0; white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: .82rem; line-height: 1.5;
  background: var(--paper); border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; max-height: 9.5em; overflow: auto; cursor: copy;
}
.share-img { display: flex; gap: 14px; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; }
.share-img-wrap { flex: 0 0 120px; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; background: var(--navy); box-shadow: var(--shadow); }
.share-img-wrap img { width: 100%; height: 100%; display: block; object-fit: cover; }
.share-img-wrap.loading { background: linear-gradient(100deg, var(--navy) 30%, #3a5ab0 50%, var(--navy) 70%) 0 0 / 300% 100%; animation: shimmer 1.2s linear infinite; }
.share-img-wrap.loading img { visibility: hidden; }
@keyframes shimmer { to { background-position: -150% 0; } }
.share-img-txt { display: grid; gap: 6px; justify-items: start; font-size: .9rem; }
.share-img-txt small { color: var(--muted); }
@media (max-width: 420px) { .nets { grid-template-columns: repeat(4, minmax(0, 1fr)); } .share-img-wrap { flex-basis: 96px; } }
@media (prefers-reduced-motion: reduce) { .share-img-wrap.loading { animation: none; } }
.stub .btn.wa { margin-left: auto; }

/* ---------- Deal alerts ---------- */
.bell {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%;
  border: 1px solid rgb(255 255 255 / .25); background: rgb(255 255 255 / .1); color: #fff; cursor: pointer;
}
.bell:hover { background: rgb(255 255 255 / .18); }
.bell b {
  position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px;
  background: var(--hot); color: #fff; font-size: .68rem; line-height: 19px; text-align: center; box-shadow: 0 0 0 2px var(--navy);
}
.modal.alerts { width: min(520px, 100%); justify-items: stretch; }
.modal.alerts h2 { padding-right: 36px; }
.modal.alerts h3 { margin: 6px 0 0; font-family: var(--f-display); font-size: 1rem; }
.modal .muted, .muted { color: var(--muted); font-size: .84rem; margin: 0; }
.hits { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; max-height: 260px; overflow: auto; }
.hits a { display: grid; gap: 1px; padding: 8px 10px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .88rem; }
.hits a:hover { border-color: var(--navy); }
.hits small { color: var(--muted); }
.hits .new { font-style: normal; justify-self: start; font-size: .68rem; font-weight: 700; background: var(--hot); color: #fff; border-radius: 99px; padding: 1px 8px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 99px; padding: 6px 12px; font: inherit; font-size: .84rem; cursor: pointer; }
.pill[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.alert-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px; }
.alert-add select, .alert-add input { min-width: 0; font: inherit; font-size: .88rem; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tagx { border: 0; background: var(--yellow-soft); color: var(--ink); border-radius: 99px; padding: 5px 10px; font: inherit; font-size: .8rem; cursor: pointer; }
@media (max-width: 420px) { .alert-add { grid-template-columns: minmax(0, 1fr) auto; } .alert-add select { grid-column: 1 / -1; } }

/* ---------- Shop accounts ---------- */
#shopView { padding-bottom: 40px; }
.shop-h { font-family: var(--f-display); font-size: clamp(1.4rem, 4vw, 2rem); line-height: 1.3; margin: 6px 0 4px; text-wrap: balance; }
.shop-p { color: var(--muted); margin: 0 0 16px; max-width: 60ch; }
#shopView .panel { margin-bottom: 16px; }
.ticks { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; }
.ticks li::before { content: "✓ "; color: var(--green); font-weight: 700; }
.gsi { min-height: 44px; margin-bottom: 8px; }
#devLogin { display: flex; gap: 6px; margin-bottom: 8px; }
#devLogin[hidden] { display: none !important; }
#devLogin input { flex: 1; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.form .full { grid-column: 1 / -1; }
.mine { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mine li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: var(--card); }
.mine li > div { flex: 1 1 220px; display: grid; gap: 2px; min-width: 0; }
.mine small { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.mine .rnote { flex: 1 1 180px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: .84rem; }
.st { font-size: .74rem; font-weight: 700; border-radius: 99px; padding: 3px 10px; background: var(--soft); color: var(--muted); }
.st-approved { background: var(--green-soft); color: #1f7a6f; }
.st-pending { background: var(--yellow-soft); color: #8a6400; }
.st-rejected, .st-removed { background: var(--hot-soft); color: #b42332; }
.shop-foot { display: flex; gap: 8px; flex-wrap: wrap; }
.src.shopline a { color: var(--navy); font-weight: 700; }
footer a[data-shopnav] { font-weight: 700; }

/* ---------- Paper theme (default): Kindle-style warm e-ink paper, deep ink text; navy and yellow accents unchanged ---------- */
:root[data-theme="paper"] {
  --paper: #ebe7dc;          /* page: e-ink paper, warm grey-white */
  --card: #f4f1e8;           /* sheets sit a touch lighter */
  --ink: #121212;            /* always deep */
  --muted: #3f3d38;
  --line: #d3ccbd;
  --soft: #e1dccf;
  --yellow-soft: #f6ecc9;
  --green-soft: #dbe8df;
  --hot-soft: #f3dcd9;
  --shadow-sm: 0 1px 1px rgb(60 50 30 / .08);
  --shadow: 0 1px 2px rgb(60 50 30 / .08), 0 6px 16px -10px rgb(60 50 30 / .25);
  --shadow-lg: 0 2px 4px rgb(60 50 30 / .1), 0 16px 36px -14px rgb(60 50 30 / .35);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .31 0 0 0 0 .24 0 0 0 .11 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="paper"] body { background-color: var(--paper); background-image: var(--grain); }
:root[data-theme="paper"] .card, :root[data-theme="paper"] .panel, :root[data-theme="paper"] .modal,
:root[data-theme="paper"] .pts-panel, :root[data-theme="paper"] .chip, :root[data-theme="paper"] .ticket,
:root[data-theme="paper"] .suggest { background-image: var(--grain); }
:root[data-theme="paper"] .note, :root[data-theme="paper"] .tr, :root[data-theme="paper"] .src,
:root[data-theme="paper"] .count, :root[data-theme="paper"] small { color: var(--muted); }
:root[data-theme="paper"] .card h3, :root[data-theme="paper"] .panel h2 { color: var(--ink); }
:root[data-theme="paper"] .hero-copy .tr, :root[data-theme="paper"] footer .tr, :root[data-theme="paper"] .appbar .tr, :root[data-theme="paper"] footer small { color: inherit; }
.theme-btn .ic-color { display: none; }
:root[data-theme="classic"] .theme-btn .ic-paper { display: none; }
:root[data-theme="classic"] .theme-btn .ic-color { display: block; }
@media (max-width: 400px) { .top .wrap { gap: 6px; } .bell { width: 36px; height: 36px; } }
@media (max-width: 420px) {
  .brand .bubble { font-size: .98rem; padding: 8px 10px 5px; }
  .pts { padding: 4px 8px 4px 5px; gap: 4px; }
  .lang button { padding: 5px 8px; }
}
@media (max-width: 370px) {
  .brand .bubble { font-size: .9rem; padding: 7px 8px 5px; }
  .bell { width: 34px; height: 34px; }
  .pts .brownie { width: 18px; height: 18px; }
}
footer .btn.outline.foot-theme { padding: 6px 14px; font-size: .84rem; }
@media (max-width: 345px) { #themeBtn { display: none !important; } }
