:root {
  --field: linear-gradient(180deg, #f7f3ec 0%, #efe8dd 100%);
  --ink: #1b1a17;
  --soft: #5a554c;
  --line: #ddd4c6;
  --card: rgba(255, 253, 249, .92);
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --r: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: #e4ddd1; color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Noto Sans Arabic", "PingFang SC", sans-serif;
  display: flex; justify-content: center; overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; }

/* One mobile layout everywhere; on PC the same column widens to A4 width. */
#app {
  position: relative; width: 100%; max-width: 480px; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; background: var(--field); overflow: hidden;
}
@media (min-width: 820px) { #app { max-width: 794px; box-shadow: 0 0 0 1px var(--line), 0 20px 60px rgba(0,0,0,.12); } }

.mono { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--ink); opacity: .055; pointer-events: none; z-index: 0; }
.top, .zones, .foot { position: relative; z-index: 1; }

.top {
  display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 4px) 6px 4px;
  border-bottom: 1px solid var(--line); background: rgba(247, 243, 236, .85); backdrop-filter: blur(8px);
}
.top h1 { flex: 1; margin: 0; text-align: center; font-size: 16px; font-weight: 800; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top h1 { cursor: pointer; user-select: none; }
.icon { width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; font-size: 18px; padding: 0; }
.icon:active { background: rgba(0,0,0,.06); }

.zones { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.feed { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 6px 6px 10px; -webkit-overflow-scrolling: touch; }
.comments { display: none; }
#app.has-panel .comments {
  display: flex; flex-direction: column; flex: 0 0 auto; max-height: 33.333%; min-height: 0;
  border-top: 2px solid var(--accent); background: rgba(255, 253, 249, .78); backdrop-filter: blur(6px);
}
#app.has-panel .firstbar { display: none; }
.firstbar {
  align-self: center; width: auto; margin: 0 auto 4px; padding: 5px 16px; border: 1.5px dashed var(--accent); border-radius: 999px; font-size: 14px;
  background: rgba(255,255,255,.7); color: var(--accent); font-weight: 700;
}

/* Feed cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 6px; overflow: hidden; }
.card .src { display: flex; justify-content: space-between; gap: 6px; padding: 6px 8px 0; font-size: 13px; }
.card .src b { color: var(--accent); }
.card .src span { color: var(--soft); font-size: 13px; }
.card h2 { margin: 2px 8px 6px; font-size: 16px; line-height: 1.3; }
.card .media { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #ddd4c6; border: 0; }
.card .sum { margin: 6px 8px 4px; color: #2d2a25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .acts { display: none; gap: 6px; padding: 4px 8px 8px; }
.card.open .sum { display: block; -webkit-line-clamp: unset; }
.card.open .acts { display: flex; }
.card .tap { margin: 0 8px 6px; font-size: 12px; color: var(--soft); }
.card.open .tap { display: none; }
.btn { flex: 1; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 600; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: .5; }
.own { border: 0; background: transparent; color: #a33; font-size: 12px; padding: 0 8px 6px; }
.empty { text-align: center; color: var(--soft); padding: 20px 6px; }

/* Promo card: visible, light */
.promo { display: flex; align-items: center; gap: 8px; padding: 6px 8px; margin-bottom: 6px; border-radius: var(--r); border: 1px solid var(--line); background: rgba(15, 118, 110, .07); text-decoration: none; color: inherit; }
.promo .pi { font-size: 20px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 12px; background: #fff; flex: none; }
.promo .pt { flex: 1; min-width: 0; }
.promo .pn { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.promo .pn small { font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--soft); }
.promo .pv { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13.5px; line-height: 1.3; color: #2d2a25; margin-top: 1px; }



.promo .go { font-weight: 700; color: var(--accent); }

/* Comments */
.chead { padding: 4px 8px 2px; font-size: 13px; }
.chead span { color: var(--soft); }
.clist { flex: 0 1 auto; min-height: 0; overflow-y: auto; padding: 0 8px; }
.cm { padding: 4px 0; border-bottom: 1px solid var(--line); }
.cm header { display: flex; gap: 8px; align-items: baseline; font-size: 14px; }
.cm header span { color: var(--soft); font-size: 12px; }
.cm p { margin: 3px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cm.open p { display: block; -webkit-line-clamp: unset; }
.cm .cacts { display: none; gap: 12px; margin-top: 3px; font-size: 13px; }
.cm.open .cacts { display: flex; }
.cm .cacts button { border: 0; background: none; padding: 0; color: var(--soft); }
.composer { padding: 4px 6px; border-top: 1px solid var(--line); }
.cform { display: flex; gap: 6px; align-items: flex-end; }
.cform textarea { flex: 1; min-height: 34px; max-height: 40vh; resize: none; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; }
.cform .btn { flex: none; }
.as { font-size: 11px; color: var(--soft); margin-bottom: 2px; }

/* Footer: always pinned */
.foot { display: flex; align-items: center; gap: 6px; padding: 4px 6px calc(env(safe-area-inset-bottom) + 4px); border-top: 1px solid var(--line); background: rgba(247, 243, 236, .92); }
.resp { flex: 1; text-align: start; border: 0; background: none; font-size: 11px; line-height: 1.25; color: var(--soft); padding: 0; }
.resp b { color: var(--ink); }
.install[hidden] { display: none; }
.contact { flex: none; padding: 4px 6px; font-size: 16px; color: var(--soft); text-decoration: none; }
.card h2 a { color: inherit; text-decoration: none; }
.install { flex: none; padding: 6px 12px; border: 0; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 700; }

/* Article reader: X top and X bottom */
.reader { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; background: #fff; }
.reader[hidden] { display: none; }
.rbar { display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 3px) 4px 3px 10px; background: var(--ink); color: #fff; }
.rbar.bottom { padding: 3px 4px calc(env(safe-area-inset-bottom) + 3px); justify-content: center; }
.rbar #rsrc { flex: 1; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rbar a { color: #fff; background: var(--accent); font-size: 13px; font-weight: 700; text-decoration: none; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.x { width: 38px; height: 38px; border: 0; border-radius: 10px; background: rgba(255,255,255,.14); color: #fff; font-size: 20px; font-weight: 700; }
.x.wide { width: auto; padding: 0 16px; font-size: 15px; }
.reader iframe { flex: 1; width: 100%; border: 0; background: #fff; }

/* Bottom sheet */
.sheet { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; justify-content: flex-end; }
.sheet[hidden] { display: none; }
.scrim { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.panel { position: relative; max-height: 88%; display: flex; flex-direction: column; background: #fffdf9; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); }
.phead { display: flex; align-items: center; padding: 6px 6px 2px 12px; }
.phead b { flex: 1; font-size: 17px; }
.phead .x { background: #eee7dc; color: var(--ink); }
.pbody { overflow-y: auto; padding: 2px 12px 12px; }
.pbody p { margin: 0 0 6px; line-height: 1.5; }
.pbody label.f { display: block; margin: 6px 0 2px; font-size: 14px; font-weight: 600; }
.pbody input[type=text], .pbody input[type=email], .pbody input[inputmode=numeric] { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; }
.pbody .tick { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-size: 14px; }
.pbody .tick input { width: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--accent); }
.pbody .row { display: flex; gap: 6px; margin-top: 8px; }
.pbody .err { color: #b42318; font-size: 13px; min-height: 1.2em; margin-top: 4px; }
.pbody .code { letter-spacing: .4em; font-size: 22px; text-align: center; }
.list { display: flex; flex-direction: column; gap: 4px; }
.list .btn { text-align: start; }
.list .btn.on { border-color: var(--accent); color: var(--accent); }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: s 1s linear infinite; vertical-align: -3px; margin-inline-end: 8px; }
@keyframes s { to { transform: rotate(360deg); } }

.toast { position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 50; max-width: 90%; padding: 6px 12px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 13px; }
.toast[hidden] { display: none; }
[dir=rtl] .top h1, [dir=rtl] .card h2 { letter-spacing: 0; }

/* Menu = small dropdown under ☰, no dark backdrop */
.sheet.drop { justify-content: flex-start; }
.sheet.drop .scrim { background: transparent; }
.sheet.drop .panel { margin: calc(env(safe-area-inset-top) + 42px) auto 0; width: max(33.333%, 220px); max-height: 70%; border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.18); padding-bottom: 0; }
.sheet.drop .phead { display: none; }
.sheet.drop .pbody { padding: 6px; }
.langs { display: flex; gap: 3px; margin-bottom: 4px; }
.chip { flex: 1; padding: 5px 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; }
.chip.on { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.mi { text-align: start; padding: 7px 8px; border: 0; border-radius: 8px; background: transparent; font-size: 14px; }
.mi:active, .mi:hover { background: #f1ebe1; }
.mi.strong { color: var(--accent); font-weight: 700; }
.lq { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 14px; background: #fff; margin-bottom: 3px; }
.lbox { display: flex; flex-direction: column; }
.mi.on { color: var(--accent); font-weight: 700; }
.mi small { color: var(--soft); }
.sheet.drop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.signbtn { flex: none; max-width: 30%; padding: 5px 12px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.signbtn.in { background: transparent; color: var(--ink); font-weight: 800; font-style: italic; font-size: 15px; padding: 5px 6px; }

/* All buttons: text only, no background, no border */
.signbtn, .install, .btn, .btn.primary, .x, .x.wide, .chip, .mi, .firstbar, .icon, .phead .x {
  background: transparent !important; border: 0 !important; box-shadow: none !important;
}
.signbtn { color: var(--accent); padding: 4px 6px; }
.signbtn.in { color: var(--ink); }
.install { color: var(--ink); font-weight: 800; padding: 4px 6px; }
.btn { color: var(--ink); font-weight: 600; padding: 6px 4px; }
.btn.primary { color: var(--accent); font-weight: 800; }
.btn:disabled { opacity: .4; }
.firstbar { color: var(--accent); font-weight: 700; padding: 4px 8px; }
.rbar .x { color: #fff; }
.phead .x { color: var(--ink); }
.chip.on, .mi.on { color: var(--accent); font-weight: 800; }
.rbar a { background: transparent !important; color: #9fe3da; padding: 4px 6px; }

.card .media.xpost { aspect-ratio: auto; height: 420px; background: #fff; }

/* Lively: LIVE strip, NEW tags, new-items pill */
.live { position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; padding: 3px 10px; font-size: 12px; color: var(--soft); border-bottom: 1px solid var(--line); background: rgba(247,243,236,.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live b { color: #d92d20; letter-spacing: .06em; font-size: 11px; }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: #d92d20; flex: none; animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(217,45,32,.55); } 70% { box-shadow: 0 0 0 7px rgba(217,45,32,0); } 100% { box-shadow: 0 0 0 0 rgba(217,45,32,0); } }
.newtag { font-style: normal; font-size: 10px; font-weight: 800; color: #fff; background: #d92d20; border-radius: 4px; padding: 1px 5px; margin-inline-start: 6px; vertical-align: 1px; }
.card.new { animation: glow 2.4s ease-out 1; }
@keyframes glow { 0% { box-shadow: 0 0 0 3px rgba(217,45,32,.45); } 100% { box-shadow: 0 0 0 0 rgba(217,45,32,0); } }
.newpill { position: absolute; top: 92px; left: 50%; transform: translateX(-50%); z-index: 20; border: 0; border-radius: 999px; padding: 6px 14px; background: #d92d20; color: #fff; font-weight: 800; font-size: 13px; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.newpill[hidden] { display: none; }

.cm .con { display: block; margin-top: 2px; font-size: 12.5px; color: var(--accent); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm .con::before { content: "↪ "; }
.on { font-size: 13px; color: var(--accent); margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rbar.bottom { gap: 4px; }
/* iFrame only: no way out to the publisher site */
#rext { display: none !important; }

/* Free / Pro label (text only) + centered Plans pop-up */
.planbtn { flex: none; border: 0; background: transparent; padding: 4px 4px; font-size: 13px; font-weight: 700; color: var(--soft); }
.planbtn.pro { color: var(--accent); font-weight: 800; }
.sheet.center { justify-content: center; align-items: center; }
.sheet.center .panel { width: min(92%, 380px); border-radius: 16px; max-height: 86%; }
.plans { display: flex; flex-direction: column; gap: 8px; }
.plan { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.plan.cur { border-color: var(--accent); }
.plan .ph { display: flex; justify-content: space-between; align-items: baseline; }
.plan .ph b { font-size: 16px; }
.plan .ph span { font-weight: 700; color: var(--accent); }
.plan p { margin: 4px 0; font-size: 14px; }
.plan small { color: var(--accent); font-weight: 700; }
.plan .soon { color: var(--soft); font-size: 13px; }
.ppslot { margin-top: 6px; min-height: 40px; }
.plans .fine { text-align: center; font-size: 13px; margin: 2px 0 0; }

/* Install pop-up: whole page blurred behind it */
.gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(27,26,23,.28); backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px); }
.gate[hidden] { display: none; }
.gbox { width: min(100%, 360px); background: #fffdf9; border-radius: 18px; padding: 18px 18px 12px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.gbox img { border-radius: 14px; }
.gbox b { display: block; font-size: 18px; margin: 8px 0 6px; }
.gbox ul { text-align: start; margin: 0 0 8px; padding-inline-start: 20px; font-size: 14.5px; line-height: 1.45; }
.gbox li { margin: 3px 0; }
.gbox li::marker { content: "✓  "; color: var(--accent); font-weight: 800; }
.gbox p { font-size: 14px; color: var(--soft); margin: 6px 0; }
.gbtn { border: 0; background: transparent; color: var(--accent); font-size: 18px; font-weight: 800; padding: 8px 12px; }
.glater { display: block; margin: 2px auto 0; border: 0; background: transparent; color: var(--soft); font-size: 13px; padding: 4px; }
.glater[hidden], .gbtn[hidden] { display: none; }
.gbox ul { padding-inline-start: 18px; }
.gbox li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: clamp(12.5px, 3.6vw, 14.5px); }
