:root {
  --sab: calc(env(safe-area-inset-bottom, 0px) * .3); /* footer sits close to the screen edge, scaled to each phone */ 
  --bg: #F6F4EF;
  --card: #ffffff;
  --text: #1F2D3D;
  --muted: #4A5B6C;
  --accent: #1B3A5C;
  --accent2: #C77700;
  --line: #D9E2E8;
  --band: #1B3A5C;
  --band-text: #ffffff;
  --rule: #F2C078;
  --on-accent: #ffffff;
  --grad: #1B3A5C;
  --radius: 8px;
  --fs: 18px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0E1824;
  --card: #162536;
  --text: #E6EDF5;
  --muted: #A9B8C8;
  --accent: #7FB0E0;
  --accent2: #E39A2D;
  --line: #2A3B50;
  --band: #0B1D31;
  --rule: #C77700;
  --on-accent: #0B1D31;
  --grad: #7FB0E0;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Noto Sans Gujarati", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  font-size: var(--fs);
  line-height: 1.65;
  padding-bottom: env(safe-area-inset-bottom);
}

.inner {
  max-width: 640px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding-top: calc(12px + env(safe-area-inset-top));
  padding-bottom: 10px;
}

.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

h1 {
  margin: 0;
  font-size: 1.25em;
  font-weight: 650;
}

.chan {
  font-size: .85em;
  color: var(--accent);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.tools {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

#search {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming in on focus */
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  -webkit-appearance: none;
  appearance: none;
}

#search:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.fs {
  display: flex;
  gap: 4px;
}

.fs button {
  min-width: 44px;
  height: 44px;
  font: inherit;
  font-size: .85em;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.filters {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
}

.chip {
  padding: 4px 10px;
  font: inherit;
  font-size: .8em;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.chip.vishay {
  font-weight: 600;
  border-color: var(--accent);
}

.filters select,
.filters input,
.filters button {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 10px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.filters button {
  flex: 0 0 auto;
}

.meta-line {
  margin: 8px 0 0;
  font-size: .8em;
  color: var(--muted);
}

/* Feed */
main#feed {
  padding-top: 16px;
}

.post {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin: 0 0 14px;
  overflow: hidden;
  scroll-margin-top: 190px;
}

.post img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--line);
}

.body {
  padding: 16px 18px 4px;
  font-size: var(--fs);
  overflow-wrap: anywhere;
}

.body a {
  color: var(--accent);
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px 6px 18px;
  font-size: .8em;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 4px;
}

.actions button,
.actions a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  font: inherit;
  font-size: .95em;
  color: var(--accent);
  background: none;
  border: 0;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
}

.more-wrap {
  text-align: center;
  padding-bottom: 32px;
}

#more {
  min-height: 46px;
  padding: 0 24px;
  font: inherit;
  color: var(--bg);
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.pnav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 999px;
  box-shadow: 0 4px 14px rgb(0 0 0 / .25);
}

.pnav[hidden] { display: none; }

.pnav button {
  width: 46px;
  height: 46px;
  font-size: 26px;
  line-height: 1;
  color: var(--bg);
  background: transparent;
  border: 0;
  border-radius: 50%;
}

.pnav button:disabled { opacity: .35; }

.pnav button:active { background: rgb(255 255 255 / .2); }

#pos {
  min-width: 70px;
  text-align: center;
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
}

.more-wrap { padding-bottom: 96px !important; }

.up {
  position: fixed;
  right: 16px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  width: 46px;
  height: 46px;
  font-size: 20px;
  color: var(--bg);
  background: var(--accent);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgb(0 0 0 / .2);
  cursor: pointer;
}

/* Home: section cards */
.sections {
  display: grid;
  gap: 14px;
  padding-top: 20px;
  padding-bottom: 40px;
}

.section-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 88px;
  padding: 18px 20px;
  color: var(--text);
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent2);
  border-radius: 14px;
}

.section-card:active { background: var(--line); }

.section-title {
  font-size: 1.1em;
  font-weight: 600;
}

.section-go {
  font-size: 1.8em;
  color: var(--accent);
}

/* Home: hero + tiles */
.hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: calc(16px + env(safe-area-inset-top));
}
.hero img { width: 38%; max-width: 170px; height: auto; flex: none; }
.hero img[hidden] { display: none; }
.hero .eyebrow { margin: 0; font-size: .7em; letter-spacing: .06em; font-weight: 600; color: var(--accent); }
.hero .date { margin: 2px 0 6px; font-size: .8em; color: var(--muted); }
.hero h2 { margin: 0; font: 400 2.3em/1.1 Georgia, serif; }
.hero .tag { margin: 8px 0 0; font-size: .85em; color: var(--muted); }

.menu-btn {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 16px;
  width: 44px; height: 44px; font-size: 20px; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: 50%;
}
.menu {
  position: absolute; top: calc(62px + env(safe-area-inset-top)); right: 16px; z-index: 20;
  display: grid; min-width: 220px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 8px 24px rgb(0 0 0 / .4);
}
.menu a { padding: 12px 14px; color: var(--text); text-decoration: none; border-radius: 10px; }
.menu a:active { background: var(--line); }
.home-wrap { position: relative; min-height: 100vh; }

.continue {
  display: block; margin-top: 18px; padding: 12px 16px; text-align: center;
  color: var(--text); text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
}
.continue b { display: block; }
.continue small { color: var(--muted); }
.continue.off { opacity: .6; pointer-events: none; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; padding-bottom: 40px; }
.tile {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
  min-height: 270px; padding: 16px; position: relative;
  color: var(--text); text-decoration: none;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 22%, var(--card)), color-mix(in srgb, var(--accent2) 10%, var(--card)));
  border: 1px solid var(--line); border-radius: 24px;
}
.tile .ico { position: absolute; top: 24px; left: 0; right: 0; text-align: center; font-size: 78px; line-height: 1; color: var(--accent); opacity: .9; }
.tile .t { font: 400 1.35em/1.2 Georgia, serif; }
.tile .s { font-size: .8em; color: var(--muted); }
.tile .arr { position: absolute; right: 14px; bottom: 14px; color: var(--accent); }

/* Theme toggle */
.theme-btn {
  flex: none; width: 40px; height: 40px; font-size: 18px; line-height: 1;
  color: var(--text); background: var(--card);
  border: 1px solid var(--line); border-radius: 50%;
}
.home-wrap .theme-btn {
  position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 68px; z-index: 5;
}

/* Gradient accents (ihariprabodham style) */
h1, .hero h2 {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  font-weight: 800;
}
.hero h2 { font-family: inherit; }
:root[data-theme="dark"] h1, :root[data-theme="dark"] .hero h2 {
  background: linear-gradient(135deg, #f7b36a, #f0864a);
  -webkit-background-clip: text; background-clip: text;
}
.top { border-bottom: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 0 0 20px 20px; }
.pnav, .up, #more { background: var(--grad); }
.tile .t { font-family: inherit; font-weight: 700; }
.tile .ico, .section-go, .tile .arr, .hero .eyebrow { color: var(--accent); }

/* Sarvatit document list */
.docs { display: grid; gap: 12px; padding-top: 16px; padding-bottom: 40px; }
.doc {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; color: var(--text); text-decoration: none;
  background: var(--card); border: 1px solid var(--line);
  border-left: 5px solid var(--accent2); border-radius: 14px;
}
.doc:active { background: var(--line); }
.doc-text { display: grid; gap: 4px; min-width: 0; }
.doc-title { font-weight: 700; overflow-wrap: anywhere; }
.doc-meta { font-size: .8em; color: var(--muted); }

/* In-page reader */
.reader {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--bg) 88%, var(--accent2));
}
.reader[hidden] { display: none; }
.r-top, .r-bottom {
  display: flex; align-items: center; gap: 8px; flex: none;
  padding: 8px 12px; background: var(--card);
}
.r-top { padding-top: calc(8px + env(safe-area-inset-top)); border-bottom: 1px solid var(--line); }
.r-bottom { padding-bottom: calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.r-top button, .r-bottom button {
  flex: none; width: 44px; height: 44px; font-size: 20px; line-height: 1;
  color: var(--text); background: transparent; border: 1px solid var(--line); border-radius: 50%;
}
.r-bottom button { background: var(--grad); color: var(--on-accent); border: 0; font-size: 26px; }
.r-bottom button:disabled { opacity: .35; }
.r-title { flex: 1; min-width: 0; font-weight: 700; font-size: .9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#r-range { flex: 1; min-width: 0; accent-color: var(--accent); }
#r-pos { min-width: 64px; text-align: center; font-size: .8rem; font-variant-numeric: tabular-nums; }
.r-stage { flex: 1; overflow: auto; padding: 12px; perspective: 1400px; -webkit-overflow-scrolling: touch; }
.r-msg { text-align: center; color: var(--muted); padding: 40px 16px; }
.sheet {
  width: max-content; margin: 0 auto; background: #fff; border-radius: 6px;
  box-shadow: 0 10px 30px rgb(0 0 0 / .25), 0 0 0 1px rgb(0 0 0 / .06);
}
.sheet canvas { display: block; border-radius: 6px; }
:root[data-theme="dark"] .sheet:not(.has-image) canvas { filter: invert(.92) hue-rotate(180deg); }
.turn-next { transform-origin: left center; animation: turnNext .38s ease-out; }
.turn-prev { transform-origin: right center; animation: turnPrev .38s ease-out; }
@keyframes turnNext { from { transform: rotateY(-28deg) translateX(40px); opacity: .2; } to { transform: none; opacity: 1; } }
@keyframes turnPrev { from { transform: rotateY(28deg) translateX(-40px); opacity: .2; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .turn-next, .turn-prev { animation: none; } }

.hero .eyebrow { letter-spacing: 0; font-size: .95em; font-weight: 700; line-height: 1.4; }

/* Home tiles with photos */
.tile { min-height: 0; padding: 0; justify-content: flex-start; overflow: hidden; gap: 0; }
.tile .photo { display: block; width: 100%; height: 150px; object-fit: cover; object-position: 50% 25%; }
.tile .t, .tile .s { padding-left: 14px; padding-right: 34px; }
.tile .t { padding-top: 12px; }
.tile .s { padding-bottom: 14px; min-height: 3.2em; }

.hero h2.quote { font-size: 1.55em; line-height: 1.45; padding-bottom: .1em; }

.hero h2.quote { font-size: clamp(1.15em, 5.2vw, 1.55em); text-wrap: balance; }
.hero > div { min-width: 0; }

/* Portfolio theme (mihir0369.github.io): navy header band, amber rule, warm paper, white cards */
.top {
  background: var(--band);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  border-bottom: 3px solid var(--rule);
  border-radius: 0;
}
.top h1, .top .brand {
  background: none; -webkit-text-fill-color: currentColor; color: var(--band-text);
  font-weight: 700; font-size: 1.15em; letter-spacing: .01em;
}
.top .chan { color: var(--band-text); border-color: rgba(255,255,255,.45); background: transparent; }
.top .meta-line { color: rgba(255,255,255,.78); }
.top .theme-btn, .top .menu-btn {
  color: var(--band-text); background: transparent; border: 1px solid rgba(255,255,255,.45);
}
.bar-actions { display: flex; gap: 8px; align-items: center; }
.menu-btn { position: static; width: 40px; height: 40px; border-radius: 50%; font-size: 18px; }
.home-wrap .theme-btn { position: static; }
.menu { top: 8px; }

h1, .hero h2, :root[data-theme="dark"] h1, :root[data-theme="dark"] .hero h2 {
  background: none; -webkit-text-fill-color: currentColor; color: var(--accent); font-weight: 750;
}
.hero .eyebrow { color: var(--accent2); }
.tile, .doc, .section-card, .continue, .post, .menu, .sheet, input[type="search"], .filters select, .filters input, .filters button {
  border-radius: var(--radius);
}
.tile { background: var(--card); }
.doc, .section-card { border-left-color: var(--accent2); }
.chip.vishay { border-color: var(--accent2); }
.pnav, .up { color: var(--on-accent); }
.pnav button { color: var(--on-accent); }
.pnav, .up, #more { background: var(--grad); }

/* ---- Prasango list ---- */
.list { display: grid; gap: 8px; padding-top: 12px; padding-bottom: 40px; }
.item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; color: var(--text); text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  content-visibility: auto; contain-intrinsic-size: auto 72px;
}
.item:active { background: var(--line); }
.item .no {
  flex: none; min-width: 3.1em; padding: 4px 8px; text-align: center;
  font-weight: 700; font-size: .85em; font-variant-numeric: tabular-nums;
  color: var(--on-accent); background: var(--accent); border-radius: 999px;
}
.item-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.item .ttl {
  font-weight: 600; line-height: 1.4; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.item .sub { font-size: .78em; color: var(--muted); }
.item .heart { flex: none; color: #d6336c; }

#liked-filter, #clear { flex: 1; }
#liked-filter[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* ---- Reading view ---- */
.detail-head { margin: 8px 0 0; font-weight: 600; color: rgba(255,255,255,.9); }
.pad-bottom { padding-bottom: calc(110px + env(safe-area-inset-bottom)); padding-top: 14px; }

.pbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: var(--sab, 0px);
  box-shadow: 0 -4px 16px rgb(0 0 0 / .08);
}
.pbar[hidden] { display: none; }
.pbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  min-height: 62px; padding: 6px 4px; font: inherit; font-size: .72rem; font-weight: 600;
  color: var(--accent); background: transparent; border: 0; border-radius: 0;
}
.pbar button .ic { font-size: 1.7rem; line-height: 1.1; }
.pbar button:active { background: var(--line); }
.pbar button:disabled { opacity: .35; }
.pbar button.liked { color: #d6336c; }

body.reading .up { bottom: calc(80px + env(safe-area-inset-bottom)); }

/* ---- Go to dialog ---- */
.goto-dlg {
  width: min(88vw, 340px); padding: 20px; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
}
.goto-dlg::backdrop { background: rgb(0 0 0 / .5); }
.goto-dlg label { display: block; margin-bottom: 10px; font-weight: 700; }
.goto-dlg input {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 18px; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
}
.goto-err { margin: 8px 0 0; color: #c0392b; font-size: .85em; }
.goto-actions { display: flex; gap: 10px; margin-top: 16px; }
.goto-actions button {
  flex: 1; min-height: 44px; font: inherit; font-weight: 600; color: var(--text);
  background: transparent; border: 1px solid var(--line); border-radius: var(--radius);
}
.goto-actions button.primary { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }

/* ---- App feel ---- */
html { -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; background: var(--bg); }
button, .item, .tile, .doc, .section-card { -webkit-touch-callout: none; }

/* ---- Sarvatit: text reader ---- */
.doc-sub { font-size: .85em; color: var(--muted); }
.r-progress-track { flex: none; height: 3px; background: var(--line); }
.r-progress { height: 100%; width: 0; background: var(--accent2); transition: width .12s linear; }
.reader[data-mode="text"] .r-bottom, .reader[data-mode="text"] #r-zoom { display: none; }
.reader:not([data-mode="text"]) .r-fs, .reader:not([data-mode="text"]) .r-progress-track { display: none; }
.r-top .r-fs { font-size: .8rem; font-weight: 700; }
.r-stage.text { perspective: none; padding: 0; background: var(--bg); }
.article {
  max-width: 40rem; margin: 0 auto;
  padding: 22px 22px calc(60px + env(safe-area-inset-bottom));
  font-size: var(--fs, 18px); line-height: 1.95; text-align: left; hyphens: none;
}
.article h2 { margin: 4px 0 6px; font-size: 1.3em; line-height: 1.5; color: var(--accent); font-weight: 750; }
.article .byline { margin: 0 0 1.6em; padding-bottom: 1em; border-bottom: 1px solid var(--line); font-size: .8em; color: var(--muted); }
.article h3 { margin: 1.8em 0 .6em; font-size: 1.08em; color: var(--accent); }
.article p { margin: 0 0 1.15em; overflow-wrap: anywhere; }
.article a { color: var(--accent); word-break: break-all; }
.article .the-end { margin-top: 2.2em; text-align: center; color: var(--muted); font-size: .9em; }

/* ---- Reading header: date and Share / Telegram stay in the fixed header, so nothing jumps between prasangs ---- */
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; margin: 8px 0 0; }
.detail-head[hidden] { display: none; }
.dh-text { display: grid; min-width: 0; line-height: 1.35; }
.dh-title, .dh-date { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dh-title { font-weight: 700; color: var(--band-text); }
.dh-date { font-size: .8em; color: rgba(255,255,255,.78); }
.dh-actions { display: flex; gap: 8px; flex: none; }
.dh-actions button, .dh-actions a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px;
  font: inherit; font-size: .85em; font-weight: 600; text-decoration: none;
  color: var(--band-text); background: transparent;
  border: 1px solid rgba(255,255,255,.45); border-radius: var(--radius);
}

body.reading #channel { display: none; } /* the post's own Telegram link is in the reading header */

/* ---- Compact header (Prasango, Sarvatit): one slim row, tools open on demand ---- */
.top.compact { padding-top: calc(6px + env(safe-area-inset-top)); padding-bottom: 6px; border-bottom-width: 2px; }
.top.compact .bar { display: flex; align-items: center; gap: 8px; justify-content: flex-start; }
.ibtn {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0; font: inherit; font-size: 17px; line-height: 1; text-decoration: none;
  color: var(--band-text); background: transparent; border: 1px solid rgba(255,255,255,.4); border-radius: 50%;
}
.ibtn[hidden] { display: none; }
.ibtn:active { background: rgba(255,255,255,.15); }
.ibtn.on { background: var(--rule); border-color: var(--rule); color: #1B3A5C; }
.ibtn.aa { font-weight: 700; }
.ibtn.aa small { font-size: .72em; margin-left: 1px; }
.top.compact .theme-btn { width: 38px; height: 38px; font-size: 17px; color: var(--band-text); background: transparent; border: 1px solid rgba(255,255,255,.4); }
.bar-title { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.top.compact h1 { margin: 0; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-title .sub { font-size: .72rem; color: rgba(255,255,255,.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.top.compact .panel { display: grid; gap: 8px; padding-top: 8px; }
.top.compact .panel[hidden] { display: none; }
.top.compact .panel .filters { margin-top: 0; }
.top.compact .panel .meta-line { margin: 0; }
.top.compact .panel a { color: var(--rule); }
.top.compact .panel > input[type="search"] { width: 100%; }

/* slimmer bottom bar while reading */
.pbar button { min-height: 52px; padding: 4px 4px 5px; font-size: .66rem; }
.pbar button .ic { font-size: 1.45rem; }
.pad-bottom { padding-bottom: calc(86px + env(safe-area-inset-bottom)); padding-top: 10px; }
body.reading .up { bottom: calc(66px + env(safe-area-inset-bottom)); }

.top.compact .panel { grid-template-columns: minmax(0, 1fr); }
.top.compact .panel > * { min-width: 0; }
.top.compact .panel .filters { display: flex; }
:root[data-theme] .top h1, :root[data-theme="dark"] .top h1 { color: var(--band-text); background: none; -webkit-text-fill-color: currentColor; }
html, body { max-width: 100%; overflow-x: clip; }

/* ---- iPhone fixes ---- */
/* Headings: plain colour (gradient-text clipping made the title look blurry on iOS) */
h1, .hero h2, :root[data-theme] h1, :root[data-theme] .hero h2 {
  background: none !important; -webkit-background-clip: border-box !important; background-clip: border-box !important;
  -webkit-text-fill-color: currentColor !important;
}
/* Home: no extra page height, so no scroll bar */
.home-wrap { min-height: 0; }
.top.compact .brand { font-size: 1rem; }
.menu-btn { position: static; }

/* =====================================================================
   App shell: the page never scrolls. Header on top, one scrolling area in the middle,
   and a bar (tabs, or the reading buttons) as the last item, so nothing can move.
   ===================================================================== */
html { height: 100%; overflow: hidden; overscroll-behavior: none; background: var(--card); } /* colour behind the page = bar colour, so no strip shows under the footer */
body.app {
  position: fixed; inset: 0; margin: 0; padding: 0;
  display: flex; flex-direction: column; overflow: hidden;
  overscroll-behavior: none; touch-action: manipulation;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
body.app .top { flex: none; position: relative; z-index: 10; }
.scroll {
  flex: 1 1 auto; min-height: 0; width: 100%;
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.scroll[hidden] { display: none; }
/* text people may want to copy */
.post .body, .article, .doc-title, .item .ttl { -webkit-user-select: text; user-select: text; }

/* bottom tab bar */
.tabbar {
  flex: none; display: grid; grid-template-columns: repeat(var(--tabs, 4), 1fr);
  background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: var(--sab, 0px);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 54px; padding: 6px 4px; font-size: .68rem; font-weight: 600;
  color: var(--muted); text-decoration: none;
}
.tabbar a[aria-current="page"] { color: var(--accent); }
.tabbar a:active { background: var(--line); }
body.reading .tabbar { display: none; }

/* reading bar sits in the layout (not pinned to the screen edge) */
body.app .pbar { position: static; flex: none; z-index: auto; box-shadow: none; }
body.app .up { position: fixed; right: 16px; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 20; }

/* the pages keep their own spacing inside the scrolling area */
.scroll > .inner { padding-top: 12px; padding-bottom: 24px; }
.home-wrap { padding-top: 4px; }
body.app main#feed { padding-top: 12px; padding-bottom: 24px; }
body.app .list { padding-bottom: 24px; }
body.app .docs { padding-bottom: 24px; }
body.app .hero { padding-top: 8px; }

/* header: back arrow only where there is somewhere to go back to */
.top.compact .bar-title { padding-left: 2px; }
.top.compact .brand { display: block; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 2000;
  max-width: min(88vw, 420px); padding: 10px 16px; border-radius: 999px;
  font-size: .85rem; font-weight: 600; text-align: center;
  color: var(--on-accent); background: var(--accent);
  box-shadow: 0 6px 20px rgb(0 0 0 / .3);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* install card */
.install {
  display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 12px 12px 16px;
  background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--accent2); border-radius: var(--radius);
}
.install[hidden] { display: none; }
.install-text { flex: 1; display: grid; gap: 2px; min-width: 0; font-size: .85rem; }
.install-text b { font-size: 1rem; }
.install-text span { color: var(--muted); }
.install button {
  flex: none; min-height: 40px; padding: 0 14px; font: inherit; font-weight: 700; font-size: .9rem;
  color: var(--on-accent); background: var(--accent); border: 0; border-radius: var(--radius);
}
.install #install-x { min-width: 40px; padding: 0; color: var(--muted); background: transparent; font-size: 1rem; }

/* a prasang slides in from the side you are moving towards */
.post.enter-next { animation: enterNext .24s ease-out; }
.post.enter-prev { animation: enterPrev .24s ease-out; }
.post.enter-fade { animation: enterFade .2s ease-out; }
@keyframes enterNext { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes enterPrev { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes enterFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .post.enter-next, .post.enter-prev, .post.enter-fade { animation: none; } }

/* Go to: on-screen number pad (no phone keyboard) */
.goto-dlg { padding: 18px; }
.goto-label { margin: 0 0 10px; font-weight: 700; }
.goto-display {
  display: block; min-height: 3.4rem; margin-bottom: 8px; padding: 8px 12px; text-align: center;
  font-size: 2rem; font-weight: 700; letter-spacing: .08em; font-variant-numeric: tabular-nums;
  color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
}
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button {
  min-height: 52px; font: inherit; font-size: 1.3rem; font-weight: 600; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
}
.keypad button:active { background: var(--line); }
.keypad button.primary { font-size: 1.05rem; color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.goto-cancel {
  width: 100%; margin-top: 10px; min-height: 44px; font: inherit; font-weight: 600; color: var(--muted);
  background: transparent; border: 0;
}

/* smooth page-to-page transitions where the browser supports them */
@view-transition { navigation: auto; }

/* ---- Notifications ---- */
.ibtn.bell.on { background: var(--rule); border-color: var(--rule); color: #1B3A5C; }
.notify-dlg {
  width: min(92vw, 380px); padding: 20px; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
}
.notify-dlg::backdrop { background: rgb(0 0 0 / .5); }
.notify-dlg h2 { margin: 0 0 8px; font-size: 1.15rem; color: var(--accent); }
.n-status { margin: 0 0 12px; font-size: .9rem; color: var(--muted); line-height: 1.5; }
.n-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.n-row input { flex: none; width: 22px; height: 22px; margin-top: 2px; accent-color: var(--accent); }
.n-row span { display: grid; gap: 2px; }
.n-row small { color: var(--muted); font-size: .8rem; line-height: 1.4; }
.n-actions { display: grid; gap: 8px; margin-top: 14px; }
.n-actions button {
  min-height: 46px; font: inherit; font-weight: 600; color: var(--text);
  background: transparent; border: 1px solid var(--line); border-radius: var(--radius);
}
.n-actions button.primary { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.n-actions button.plain { border: 0; color: var(--muted); }
.n-actions button[hidden] { display: none; }
.continue[hidden] { display: none; }

/* Vachanamrut: reader shows its own previous / next bar; wide home tile */
.reader[data-nav] .r-bottom { display: flex; justify-content: space-between; }
.reader[data-nav] #r-pos { flex: 1; text-align: center; font-weight: 600; color: var(--muted); font-size: .85rem; }
.reader[data-nav] .r-bottom button { flex: none; width: 64px; }
.article .vname { margin: 0 0 .2em; font-size: .8em; color: var(--muted); }
.article strong { color: var(--accent); }
.tile.wide { grid-column: 1 / -1; padding: 16px 18px; }
.tile.wide .t { padding: 0; }
.tile.wide .s { padding: 4px 34px 0 0; min-height: 0; }
.doc .no { display: inline-block; min-width: 2.2em; font-weight: 800; color: var(--accent); }

.tile.wide { display: grid; grid-template-columns: 128px 1fr; grid-template-rows: auto auto; column-gap: 6px; align-items: center; min-height: 150px; padding: 12px 34px 12px 8px; }
.tile.wide .cutout { grid-row: 1 / 3; width: 128px; height: 128px; object-fit: contain; align-self: center; }
.tile.wide .t { align-self: end; padding: 0 0 2px; }
.tile.wide .s { align-self: start; padding: 0; }

/* shlok in the Vachanamrut text */
.article p.slok {
  margin: 1.3em 0; padding: .9em 1em; text-align: center; line-height: 1.85; font-weight: 700;
  color: var(--accent); background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--rule);
  border-radius: 14px;
}

/* account button, role pill */
.ibtn.acct { font-weight: 800; font-size: 1rem; }
.ibtn.acct.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.role-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .03em; background: var(--line); color: var(--accent); }
.tabbar a span { white-space: nowrap; font-size: .64rem; }
.tile.solo { grid-column: 1 / -1; }
.tile.solo .photo { height: 190px; object-position: 50% 22%; }

/* forms (sign in, admin, my edits) */
.form-wrap { max-width: 520px; padding-top: 22px; padding-bottom: 40px; }
.form-intro { color: var(--muted); margin: 0 0 18px; }
.fld { display: block; margin: 0 0 14px; font-weight: 600; font-size: .9rem; }
.fld input, .fld select, .fld textarea {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; -webkit-user-select: text; user-select: text;
}
.fld textarea { min-height: 150px; resize: vertical; line-height: 1.6; }
.btn-primary, .btn { font: inherit; font-weight: 700; padding: 12px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--accent); }
.btn-primary { width: 100%; background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-primary:disabled, .btn:disabled { opacity: .55; }
.btn.danger { color: #b42318; }
.btn.ok { background: #15803d; color: #fff; border-color: #15803d; }
.btn.sm { padding: 7px 12px; font-size: .85rem; border-radius: 10px; }
.form-err { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: #fdecea; color: #8a1c13; font-weight: 600; font-size: .9rem; }
.form-foot { text-align: center; margin-top: 22px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin: 0 0 12px; }
.card h3 { margin: 0 0 4px; font-size: 1rem; }
.card .meta { color: var(--muted); font-size: .82rem; }
.card .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .7rem; font-weight: 800; letter-spacing: .03em; background: var(--line); color: var(--accent); }
.pill.warn { background: #fff4d6; color: #8a5a00; } .pill.good { background: #dcfce7; color: #166534; } .pill.bad { background: #fde2e0; color: #9b1c12; }
.seg { display: flex; gap: 6px; margin: 0 0 14px; flex-wrap: wrap; }
.seg button { flex: 1; font: inherit; font-weight: 700; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.checks label { display: flex; gap: 10px; align-items: center; padding: 8px 0; font-weight: 600; }
.checks input { width: 20px; height: 20px; }
.note-box { padding: 10px 12px; border-radius: 12px; background: #fff4d6; color: #6b4a00; font-size: .88rem; margin-top: 10px; }
.preview { white-space: pre-wrap; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); max-height: 260px; overflow: auto; font-size: .92rem; line-height: 1.7; }

.ibtn.adm { position: relative; }
.ibtn.adm .dot { position: absolute; top: 5px; right: 5px; width: 10px; height: 10px; border-radius: 50%; background: #e5484d; border: 2px solid var(--card); }
.ibtn.adm .dot[hidden] { display: none; }

.hero .quote { white-space: pre-line; }
.quote-edit { margin-top: 10px; font: inherit; font-size: .8rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--accent); }
.notify-dlg textarea { display: block; width: 100%; min-height: 110px; margin-top: 6px; padding: 10px 12px; font: inherit; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.notify-dlg input[type="text"] { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }

/* ===== Admin controls ===== */
body.app > .subtabs { flex: none; display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; background: var(--bg); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs button { flex: none; position: relative; font: inherit; font-weight: 700; font-size: .85rem; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); }
.subtabs button[aria-current="page"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.subtabs .badge { display: inline-block; min-width: 18px; margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: #e5484d; color: #fff; font-size: .7rem; font-style: normal; line-height: 1.4; }
.admin-main { max-width: 640px; padding-top: 14px; padding-bottom: 32px; }
.asec { margin: 0 0 22px; }
.asec > h2 { margin: 0 4px 10px; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 22px; }
.stat { text-align: left; font: inherit; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
.stat b { display: block; font-size: 1.9rem; line-height: 1.1; color: var(--accent); }
.stat span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat.hot { border-color: #e5484d; } .stat.hot b { color: #e5484d; }
.actions { display: grid; gap: 8px; }
.act { display: flex; align-items: center; gap: 12px; text-align: left; font: inherit; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
.act .ic { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--line); font-size: 1.1rem; color: var(--accent); }
.act .tx { flex: 1; min-width: 0; } .act .tx b { display: block; } .act .tx small { color: var(--muted); }
.act .go { color: var(--accent); font-size: 1.4rem; }
.role-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.role-row:last-child { border-bottom: 0; }
.role-row .pill { flex: none; min-width: 74px; text-align: center; }
.card.roles { padding-top: 6px; padding-bottom: 6px; }
.person-head { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; color: var(--text); background: none; border: 0; padding: 0; }
.person-head .who { flex: 1; min-width: 0; }
.person-head .who b { display: block; overflow: hidden; text-overflow: ellipsis; }
.person-head .who small { display: block; color: var(--muted); font-size: .8rem; margin-top: 1px; }
.person-head.tap { cursor: pointer; }
.avatar { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 800; }
.card.person { padding: 12px 14px; }
.form-body { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.toolbar { display: flex; gap: 10px; margin: 0 0 10px; }
.toolbar .btn-primary { width: auto; flex: none; padding: 10px 16px; }
.search-in { flex: 1; min-width: 0; padding: 11px 14px; font: inherit; font-size: .95rem; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.chips { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 14px; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; font: inherit; font-size: .8rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); }
.chips button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.btn.grow { flex: 1; }
.danger-zone { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.empty-state { text-align: center; padding: 28px 16px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); }
.empty-state b { display: block; color: var(--text); margin-bottom: 4px; }
.role-help { margin: -6px 2px 12px; }
.note-in { display: block; width: 100%; margin-top: 12px; padding: 11px 14px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.note-in[hidden], .preview[hidden] { display: none; }
/* nicer dropdowns everywhere */
.fld select, .notify-dlg select { appearance: none; -webkit-appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%238a96a6' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.fld select { display: block; width: 100%; margin-top: 6px; padding-top: 12px; padding-bottom: 12px; padding-left: 14px; font: inherit; color: var(--text); background-color: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.btn { cursor: pointer; }
.btn.ok.grow, .btn.grow { text-align: center; }

.subtabs button { padding: 7px 11px; font-size: .8rem; }
.subtabs { gap: 5px; }
.subtabs { justify-content: space-between; padding-left: 8px; padding-right: 8px; }
.subtabs button { flex: 1 1 auto; padding: 7px 8px; font-size: .76rem; }
.subtabs .badge { margin-left: 4px; padding: 1px 5px; }
.chips { flex-wrap: nowrap; }

/* ===== header menu ===== */
.bar-actions #theme-btn, .bar-actions .bell { display: none; } /* these live in the menu now */
.ibtn.hm-btn { position: relative; }
.ibtn.hm-btn .dot { position: absolute; top: 5px; right: 5px; width: 10px; height: 10px; border-radius: 50%; background: #e5484d; border: 2px solid var(--card); }
.ibtn.hm-btn .dot[hidden] { display: none; }
dialog.menu-dlg {
  position: fixed; margin: calc(56px + env(safe-area-inset-top)) 12px auto auto; inset-inline-start: auto;
  width: min(330px, calc(100vw - 24px)); padding: 6px 0; border: 1px solid var(--line); border-radius: 18px;
  background: var(--card); color: var(--text); box-shadow: 0 18px 48px rgb(0 0 0 / .35);
}
dialog.menu-dlg::backdrop { background: rgb(0 0 0 / .35); }
.m-user { display: flex; align-items: center; gap: 12px; padding: 14px 18px 12px; border-bottom: 1px solid var(--line); }
.m-who b { display: block; }
.m-who small { color: var(--muted); }
.m-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 15px 18px; font: inherit; font-weight: 600; text-align: left; color: var(--text); background: none; border: 0; border-bottom: 1px solid var(--line); }
.m-row:last-child { border-bottom: 0; }
.m-row:active { background: var(--line); }
.m-row .m-v { color: var(--muted); font-weight: 500; }
.m-row .m-v.m-badge { min-width: 22px; padding: 1px 8px; border-radius: 999px; background: #e5484d; color: #fff; font-size: .8rem; text-align: center; }
.m-row.m-danger { color: #e5484d; }
.m-split { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.m-split a { padding: 16px 8px; text-align: center; text-decoration: none; font-weight: 700; color: var(--accent); }
.m-split a + a { border-left: 1px solid var(--line); }
.m-split a.strong { color: var(--text); }

/* Anirdeshi Amrut */
.article p.pre { white-space: pre-line; }
.article .tagline { margin: -.6em 0 1.4em; line-height: 2; }
.article .tagline .pill { font-size: .72rem; margin-right: 4px; }
.tile.wide.pic { display: block; padding: 0; overflow: hidden; }
.tile.wide.pic .photo { display: block; width: 100%; height: 190px; object-fit: cover; object-position: 50% 30%; }
.tile.wide.pic .t { display: block; padding: 12px 34px 0 14px; }
.tile.wide.pic .s { display: block; padding: 2px 34px 14px 14px; min-height: 0; }

.stats .stat:is(:last-child:nth-child(odd), .banner) { grid-column: 1 / -1; }
.m-login { display: block; padding: 16px 18px; text-align: center; text-decoration: none; font-weight: 700; color: var(--accent); }
.profiles { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.profiles h4 { margin: 0 0 6px; font-size: .9rem; }
.profile-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }

/* ===== Liked: swipe to the right ===== */
.likes-tabs { flex: none; display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border-bottom: 1px solid var(--line); }
.likes-tabs button { position: relative; font: inherit; font-weight: 700; font-size: .9rem; padding: 11px 8px; border: 0; background: none; color: var(--muted); }
.likes-tabs button + button { border-left: 1px solid var(--line); }
.likes-tabs button[aria-current="page"] { color: var(--accent); }
.likes-tabs button[aria-current="page"]::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: -1px; height: 3px; border-radius: 3px; background: var(--accent); }
.likes-tabs .n { font-style: normal; display: inline-block; min-width: 1.2em; padding: 0 6px; margin-left: 2px; border-radius: 999px; background: var(--line); font-size: .75rem; }
.pager { flex: 1 1 auto; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.pager::-webkit-scrollbar { display: none; }
.pane { flex: 0 0 100%; width: 100%; min-width: 0; min-height: 0; scroll-snap-align: start; scroll-snap-stop: always; display: flex; flex-direction: column; }
.pane > .scroll { flex: 1 1 auto; }
body.reading .likes-tabs, body.reading .pager { display: none; }
.r-like { font-size: 1.15rem; }
.r-like.liked { color: #d6336c; }
#liked-filter { display: none; }

/* ===== Home: equal tall cards, picture on top, title and subtitle below, arrow in the corner ===== */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; padding-bottom: 40px; }
.tiles .tile, .tiles .tile.wide, .tiles .tile.wide.pic, .tiles .tile.solo {
  position: relative; display: flex; flex-direction: column; grid-column: auto; padding: 0; gap: 0; min-height: 0;
  aspect-ratio: 0.74; overflow: hidden; border-radius: 22px; text-decoration: none; color: var(--text);
  background: linear-gradient(165deg, color-mix(in srgb, var(--card) 88%, #fff 12%), var(--card) 60%);
  border: 1px solid var(--line);
}
.tiles .tile .photo, .tiles .tile .cutout, .tiles .tile.wide .cutout, .tiles .tile.wide.pic .photo, .tiles .tile.solo .photo {
  display: block; flex: 1 1 auto; min-height: 0; width: 100%; height: auto; grid-row: auto;
  object-fit: cover; object-position: 50% 24%;
}
.tiles .tile .cutout, .tiles .tile.wide .cutout {
  object-fit: contain; object-position: 50% 60%; padding: 22px 18px 6px;
  background: radial-gradient(ellipse at 50% 55%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
}
.tiles .tile .t, .tiles .tile.wide .t, .tiles .tile.wide.pic .t { flex: none; display: block; padding: 12px 14px 0; font-size: 1.05rem; font-weight: 800; line-height: 1.25; }
.tiles .tile .s, .tiles .tile.wide .s, .tiles .tile.wide.pic .s { flex: none; display: block; padding: 3px 34px 14px 14px; min-height: 3.1em; font-size: .76rem; line-height: 1.4; color: var(--muted); }
.tiles .tile .arr { position: absolute; right: 14px; bottom: 14px; color: var(--accent); font-size: 1.1rem; }
/* when there is an odd card left over, it spreads across the last row */
.tiles .tile:is(:last-child:nth-child(odd), .banner) {
  grid-column: 1 / -1; aspect-ratio: auto; min-height: 170px;
  display: grid; grid-template-columns: 46% 1fr; grid-template-rows: 1fr auto auto;
}
.tiles .tile:is(:last-child:nth-child(odd), .banner) .photo, .tiles .tile:is(:last-child:nth-child(odd), .banner) .cutout { grid-row: 1 / 4; grid-column: 1; height: 100%; }
.tiles .tile:is(:last-child:nth-child(odd), .banner) .t { grid-column: 2; grid-row: 2; align-self: end; }
.tiles .tile:is(:last-child:nth-child(odd), .banner) .s { grid-column: 2; grid-row: 3; }

/* tile text always starts at the left edge of the card */
.tiles .tile .t, .tiles .tile .s, .tiles .tile.wide .t, .tiles .tile.wide .s, .tiles .tile.wide.pic .t, .tiles .tile.wide.pic .s { align-self: stretch; justify-self: stretch; text-align: left; margin: 0; }
.tiles .tile:is(:last-child:nth-child(odd), .banner) .t, .tiles .tile.wide:is(:last-child:nth-child(odd), .banner) .t { align-self: end; }
.tiles .tile:is(:last-child:nth-child(odd), .banner) .s, .tiles .tile.wide:is(:last-child:nth-child(odd), .banner) .s { align-self: start; }
.tiles .tile:is(:last-child:nth-child(odd), .banner) .photo { object-fit: cover; }

/* the same divider between picture and text on every card */
.tiles .tile:not(:is(:last-child:nth-child(odd), .banner, .banner)) .t { border-top: 1px solid var(--line); }
.tiles .tile .cutout { background-color: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.tiles .tile .photo, .tiles .tile .cutout { box-sizing: border-box; }

/* =====================================================================
   One design language for every page
   spacing 4 / 8 / 12 / 16 / 24 · cards radius 16 · text 16 / 14 / 13 · touch targets 44
   ===================================================================== */
:root { --r-card: 16px; --gap: 10px; --pad: 16px; }
.scroll { scrollbar-gutter: stable both-edges; scrollbar-width: thin; }
.scroll > .inner, .inner { max-width: 640px; margin-left: auto; margin-right: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* ---- list cards: Prasango rows, section cards, years, admin cards all look alike ---- */
.docs { gap: var(--gap); padding-top: 12px; padding-bottom: 32px; }
.list { gap: var(--gap); padding-top: 12px; padding-bottom: 32px; }
.doc, .item, .card, .stat, .act {
  border-radius: var(--r-card); border: 1px solid var(--line); background: var(--card);
}
.doc { border-left: 1px solid var(--line); padding: 14px var(--pad); min-height: 68px; font-size: 16px; }
.doc-text { gap: 3px; }
.doc-title { font-size: 1.04rem; font-weight: 700; line-height: 1.4; }
.doc-sub { font-size: .9rem; color: var(--muted); line-height: 1.35; }
.doc-meta { font-size: .82rem; color: var(--muted); line-height: 1.35; }
.item { padding: 12px var(--pad); min-height: 64px; font-size: 16px; }
.item .ttl { font-size: 1rem; }
.item .sub { font-size: .82rem; }
.doc:active, .item:active, .act:active { background: var(--line); }
.section-go { flex: none; font-size: 1.5rem; line-height: 1; color: var(--muted); }
.empty, .empty-state { text-align: center; color: var(--muted); padding: 32px 16px; }
.card { padding: 14px var(--pad); }

/* ---- bottom tabs: readable labels and a clear current tab ---- */
.tabbar a { position: relative; gap: 3px; min-height: 56px; font-size: .7rem; letter-spacing: .01em; }
.tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.tabbar a svg { width: 24px; height: 24px; }

/* ---- Liked strip: lighter ---- */
.likes-tabs button { padding: 9px 8px; font-size: .85rem; }
.likes-tabs button[aria-current="page"]::after { left: 22%; right: 22%; }

/* ---- buttons and fields ---- */
.btn, .btn-primary { min-height: 44px; border-radius: 14px; }
.btn.sm { min-height: 38px; }
.fld input, .fld select, .fld textarea, .search-in { border-radius: 14px; }

/* ---- Home ---- */
.hero { align-items: flex-start; gap: 16px; padding: 4px 0 20px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.hero > div { display: flex; flex-direction: column; gap: 0; }
.hero .eyebrow { order: 1; font-size: .82rem; font-weight: 700; letter-spacing: .02em; color: var(--accent2); }
.hero .date { order: 2; margin: 2px 0 14px; font-size: .8rem; color: var(--muted); }
.hero h2.quote { order: 3; margin: 0; font-size: clamp(1.3rem, 6vw, 1.7rem); line-height: 1.5; font-weight: 800; color: var(--accent); }
.hero .tag { order: 4; margin: 12px 0 0; font-size: .85rem; color: var(--muted); }
.quote-edit { order: 5; align-self: flex-start; }
.sec-h { margin: 20px 2px 10px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.install { border-radius: var(--r-card); }

.tiles { gap: 12px; margin-top: 0; padding-bottom: 32px; }
.tiles .tile, .tiles .tile.wide, .tiles .tile.wide.pic, .tiles .tile.solo { border-radius: 20px; }
/* a leftover last card becomes a full-width banner: picture on top, text below, same divider */
.tiles .tile:is(:last-child:nth-child(odd), .banner) { display: flex; flex-direction: column; grid-column: 1 / -1; aspect-ratio: auto; min-height: 0; }
.tiles .tile:is(:last-child:nth-child(odd), .banner) .photo, .tiles .tile:is(:last-child:nth-child(odd), .banner) .cutout {
  flex: none; width: 100%; height: auto; aspect-ratio: 16 / 8; grid-row: auto; grid-column: auto; object-fit: cover; object-position: 50% 28%;
}
.tiles .tile:is(:last-child:nth-child(odd), .banner) .t, .tiles .tile.wide:is(:last-child:nth-child(odd), .banner) .t { grid-column: auto; grid-row: auto; align-self: stretch; border-top: 1px solid var(--line); }
.tiles .tile:is(:last-child:nth-child(odd), .banner) .s, .tiles .tile.wide:is(:last-child:nth-child(odd), .banner) .s { grid-column: auto; grid-row: auto; align-self: stretch; }

.likes-tabs { grid-template-columns: repeat(var(--n, 2), 1fr); }
.tag-back { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 2px 12px; font: inherit; font-weight: 700; color: var(--accent); background: none; border: 0; text-align: left; }
.tag-head { margin: 0 2px 10px; font-size: 1.05rem; font-weight: 800; }
.tag-search { width: 100%; padding: 11px 14px; font: inherit; font-size: .95rem; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.tag-list { display: grid; gap: var(--gap, 10px); }

/* ===== Home cards: identical picture height and identical text height, so every divider lines up ===== */
.tiles .tile:not(:is(:last-child:nth-child(odd), .banner, .banner)),
.tiles .tile.wide:not(:is(:last-child:nth-child(odd), .banner, .banner)),
.tiles .tile.solo:not(:is(:last-child:nth-child(odd), .banner, .banner)) {
  display: grid; grid-template-columns: 100%; grid-template-rows: auto auto 1fr; aspect-ratio: auto; align-content: start;
}
.tiles .tile:not(:is(:last-child:nth-child(odd), .banner, .banner)) .photo,
.tiles .tile:not(:is(:last-child:nth-child(odd), .banner, .banner)) .cutout,
.tiles .tile.wide:not(:is(:last-child:nth-child(odd), .banner, .banner)) .cutout {
  flex: none; width: 100%; height: auto; aspect-ratio: 1 / .95; min-height: 0; object-fit: cover; object-position: 50% 24%;
}
.tiles .tile:not(:is(:last-child:nth-child(odd), .banner, .banner)) .cutout, .tiles .tile.wide:not(:is(:last-child:nth-child(odd), .banner, .banner)) .cutout { object-fit: contain; object-position: 50% 58%; }
.tiles .tile .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: clamp(.92rem, 4vw, 1.05rem); min-height: calc(12px + 1.25em); box-sizing: border-box; }
.tiles .tile .s { min-height: 4.4em; box-sizing: border-box; }

/* the Vachanamrut picture stands right on the divider line */
.tiles .tile .cutout, .tiles .tile.wide .cutout, .tiles .tile:not(:is(:last-child:nth-child(odd), .banner, .banner)) .cutout { padding: 12px 8px 0; object-position: 50% 100%; }

/* quote: lines fill the width (no forced balancing) and the spacing around it is even */
.hero h2.quote { text-wrap: wrap; text-align: left; hyphens: none; line-height: 1.45; padding: 0; margin: 0; }
.hero .date { margin: 2px 0 12px; }
.hero .tag { margin: 12px 0 0; line-height: 1.5; }
/* balanced two-line quote (a lone word on the second line looked worse), flush with the text around it */
.hero h2.quote { text-wrap: balance; line-height: 1.4; }
.sec-h { margin-left: 0; margin-right: 0; }
.hero .eyebrow, .hero .date, .hero .tag { margin-left: 0; padding-left: 0; }

/* no footer: content keeps clear of the phone's home indicator */
body.app .scroll > .inner, body.app .scroll > main { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.tabbar { display: none; }

/* ===== reading text: every section lines up the same way ===== */
.article p, .post .body { text-align: justify; text-justify: inter-word; hyphens: manual; overflow-wrap: break-word; word-break: normal; }
.article h2, .article h3, .article .byline, .article .the-end, .article .tagline { text-align: left; }
.article .the-end { text-align: center; }


/* ---- rich text: the editor, and how edited text looks on the reading pages ---- */
.rt h2, .rt h3 { margin: 1.1em 0 .4em; line-height: 1.3; }
.rt h2 { font-size: 1.25em; } .rt h3 { font-size: 1.08em; }
.rt p { margin: 0 0 .9em; }
.rt ul, .rt ol { margin: 0 0 .9em; padding-left: 1.4em; } .rt li { margin: .15em 0; }
.rt blockquote { margin: .9em 0; padding: .1em 0 .1em 1em; border-left: 3px solid var(--accent); color: var(--muted); }
.rt-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border: 1.5px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; background: var(--card); position: sticky; top: 0; z-index: 2; }
.rt-bar button { min-width: 36px; height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: inherit; font-family: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; }
.rt-bar button:active, .rt-bar button.on { background: color-mix(in srgb, var(--accent) 18%, var(--card)); border-color: var(--accent); }
.rt-bar .sep { width: 1px; background: var(--line); margin: 4px 2px; }
.rt-editor { min-height: 260px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 0 0 12px 12px; background: var(--card); line-height: 1.7; outline: none; overflow-wrap: anywhere; }
.rt-editor:focus { border-color: var(--accent); }
.rt-editor:empty:before { content: attr(data-ph); color: var(--muted); }

.fld > span { display: block; margin-bottom: 6px; }
.rt-body { margin-bottom: .6em; }

/* ---- fix text while reading (admins and editors): a pencil on every paragraph, and a full-screen sheet ---- */
.ie-has { position: relative; padding-right: 34px; }
.ie-pen { position: absolute; top: 0; right: 0; width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--accent); font-size: 15px; line-height: 1; cursor: pointer; opacity: .9; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.ie-pen:active { background: color-mix(in srgb, var(--accent) 18%, var(--card)); }
dialog.ie-sheet { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; background: var(--bg); color: var(--text); }
dialog.ie-sheet[open] { display: flex; flex-direction: column; top: var(--vvtop, 0px); bottom: auto; height: var(--vvh, 100%); }
/* the editor pages: while typing, leave room under the text so the last lines can be lifted above the keyboard */
body.rt-editing .scroll { padding-bottom: calc(var(--kb, 0px) + 40vh); }
dialog.ie-sheet::backdrop { background: rgba(0,0,0,.5); }
.ie-top { display: flex; justify-content: space-between; align-items: center; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; border-bottom: 1px solid var(--line); background: var(--card); font-size: 1.05rem; }
.ie-x { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: inherit; font-size: 16px; cursor: pointer; }
.ie-body { flex: 1; min-height: 0; overflow: auto; padding: 14px 16px 90px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.ie-foot { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--card); }
.ie-actions { display: flex; gap: 10px; }
.ie-sheet .rt-bar { position: static; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ie-sheet .rt-bar button { flex: none; }
.ie-sheet .rt-editor { min-height: 45vh; font-size: 16px; }
body.ie-open { overflow: hidden; }
.ie-toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #222; color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 60; }

.pub-switch { display: inline-block; margin-top: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: .75rem; font-weight: 700; color: var(--muted); }
.pub-switch.on { color: #15803d; border-color: #15803d; }

/* ---- sign-in PINs (admin) ---- */
.pins-card { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); }
.pins-card h4 { margin: 0 0 4px; font-size: 1.05rem; }
.pin-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.pin-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.pin-row.main { background: color-mix(in srgb, var(--accent) 7%, var(--card)); }
.pin-dot { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--line); font-size: 18px; }
.pin-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pin-info small { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.pin-add { width: 100%; padding: 14px; font-size: 1rem; }
.pin-form { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); display: flex; flex-direction: column; gap: 14px; }
.pin-label { font-weight: 700; font-size: .92rem; margin-bottom: 8px; }
.seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.seg button { padding: 12px 8px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: inherit; font: inherit; font-weight: 700; cursor: pointer; }
.seg button[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--card)); color: var(--accent); }
.chipset { display: flex; flex-wrap: wrap; gap: 8px; }
.chipx { padding: 10px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.chipx[aria-pressed="true"] { border-color: #15803d; background: #dcfce7; color: #166534; }
.pin-in { width: 100%; padding: 14px; font-size: 1.3rem; letter-spacing: .3em; text-align: center; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); color: inherit; }
.pin-save { width: 100%; padding: 14px; font-size: 1rem; }

.rt-colors { display: inline-flex; align-items: center; gap: 4px; }
.rt-bar .rt-sw { min-width: 26px; width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); }
.rt-bar .rt-auto { min-width: 32px; padding: 0 6px; border-bottom: 3px solid var(--text); }
.rt-pick { width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--card); cursor: pointer; }
/* ---- Paravani lists: month filter and month headings ---- */
.month-head { margin: 16px 2px 6px; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hide-bar { display: block; margin: 0 0 12px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.hide-bar.is-hidden { color: #b91c1c; border-color: #b91c1c; }

/* ---- sign-in page ---- */
.login-hero { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 0 4px; }
.login-hero img { border-radius: 20px; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.login-hero h2 { margin: 0; font-size: 1.4rem; }
.login-hero + .form-intro { text-align: center; }
.pin-wrap { position: relative; display: block; }
.pin-wrap input { width: 100%; padding-right: 70px; }
.show-pin { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 8px 12px; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; }
.form-foot { text-align: center; margin-top: 18px; }
.btn-ghost { display: inline-block; padding: 12px 18px; border-radius: 12px; border: 1.5px solid var(--line); color: inherit; text-decoration: none; font-weight: 600; }
/* ---- bigger tap targets for the editing controls (phones) ---- */
.ie-pen { width: 40px; height: 40px; font-size: 18px; }
.ie-has { padding-right: 46px; }
.pub-switch { padding: 9px 14px; font-size: .8rem; }
.hide-bar { padding: 10px 16px; }
.rt-bar button { min-width: 40px; height: 40px; }
.rt-bar .rt-sw { min-width: 30px; width: 30px; height: 30px; }
.rt-pick { width: 40px; height: 40px; }

/* ---- polish found while reviewing as admin ---- */
.pin-info b { font-size: 1rem; line-height: 1.3; }
.pins-card { margin-top: 0; }
.rt-bar .sep { display: none; }
.rt-pick { -webkit-appearance: none; appearance: none; padding: 3px; }
.rt-pick::-webkit-color-swatch-wrapper { padding: 0; }
.rt-pick::-webkit-color-swatch { border: 0; border-radius: 6px; }
.pub-switch { display: block; width: 100%; text-align: center; box-sizing: border-box; }
/* ---- reading text: left aligned (justified text left big gaps between words); edit sheet toolbar wraps so every tool is visible ---- */
.article p, .post .body, .article .rt-body, .article .rt-body p { text-align: left; text-justify: auto; }
.ie-sheet .rt-bar { flex-wrap: wrap; overflow-x: visible; }
.rt-pick { -webkit-appearance: auto; appearance: auto; }

/* ---------- Vachanamrut notes: word meanings, footnotes, tabs ---------- */
.vn-fn { color: #1d4ed8; border-bottom: 1.5px dotted currentColor; cursor: pointer; }
:root[data-theme="dark"] .vn-fn { color: #8ab4f8; }
.vn-fn sup { font-size: .65em; font-weight: 700; margin-left: 1px; }
.vn-gl { border-bottom: 1.5px dotted var(--accent2); cursor: pointer; }
.vn-pop { position: fixed; z-index: 3000; max-width: min(340px, calc(100vw - 20px)); padding: 10px 14px; border-radius: 12px; background: var(--card); color: var(--text); border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0,0,0,.25); font-size: .92rem; line-height: 1.55; }
.vn-pop b { display: block; color: var(--accent); margin-bottom: 2px; }
.vn-box { margin: 1.6em 0 1em; border: 1px solid var(--line); border-radius: 12px; background: var(--card); overflow: hidden; font-size: .92em; }
.vn-tabs { display: flex; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
.vn-tabs button { flex: 1; padding: 11px 6px; border: 0; background: none; font: inherit; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; }
.vn-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); background: var(--card); }
.vn-body { padding: 4px 16px; }
.vn-item { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--line); }
.vn-item:last-child { border-bottom: 0; }
.vn-no { font-weight: 700; color: var(--accent); }
.vn-admin { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.vn-admin button { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.vn-dlg { position: fixed; inset: 0; z-index: 3500; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; }
.vn-card { width: min(640px, 100%); max-height: 92dvh; overflow: auto; background: var(--bg); color: var(--text); padding: 16px; border-radius: 16px 16px 0 0; }
.vn-card h3 { margin: 0 0 6px; color: var(--accent); }
.vn-help { margin: 0 0 10px; font-size: .85rem; color: var(--muted); }
.vn-card label { display: block; margin: 10px 0 0; font-weight: 700; font-size: .85rem; }
.vn-card textarea { display: block; width: 100%; margin-top: 4px; padding: 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); font: inherit; font-size: 16px; }
.vn-row { display: flex; gap: 10px; justify-content: flex-end; margin: 14px 0 4px; }
.vn-row button { padding: 10px 20px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-weight: 700; }
.vn-row .primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.vn-rich p { margin: 0 0 .8em; text-align: justify; hyphens: auto; line-height: 1.75; overflow-wrap: anywhere; }
.vn-rich p:last-child { margin-bottom: 0; }
.vn-rich p.vn-right { text-align: right; font-size: .9em; color: var(--muted); }
.vn-rich hr { border: 0; border-top: 1px solid var(--line); margin: 1em 0; }
.vn-item h4 { margin: 0 0 .5em; font-size: 1.02em; color: var(--accent); text-align: left; }
.vn-pop .vn-rich p { text-align: left; line-height: 1.6; }
.vn-fn-title { cursor: pointer; margin-left: 2px; font-size: .6em; }
.vn-item { padding: 14px 0; }
.vn-names { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0; }
.vn-name { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--accent); font: inherit; font-size: .92em; font-weight: 700; cursor: pointer; }
.vn-name:active { background: var(--line); }
.vn-bio { align-items: center; padding: 16px; }
.vn-bio .vn-card { position: relative; border-radius: 16px; max-height: 80dvh; padding: 20px 18px 18px; }
.vn-bio h3 { text-align: center; margin: 0 24px 12px; }
.vn-x { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--card); color: var(--text); font-size: 16px; cursor: pointer; }
.vn-add { position: fixed; z-index: 3200; padding: 9px 14px; border-radius: 999px; border: 0; background: var(--accent); color: var(--on-accent); font: inherit; font-size: .85rem; font-weight: 700; box-shadow: 0 4px 16px rgba(0,0,0,.35); }
.vn-acts { display: flex; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.vn-acts button { flex: 1; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--accent); font: inherit; font-size: .82rem; font-weight: 700; }
.vn-acts .danger { color: #b91c1c; }
.vn-add { display: flex; gap: 6px; padding: 0; background: none; box-shadow: none; border-radius: 0; }
.vn-add button { padding: 9px 14px; border-radius: 999px; border: 0; background: var(--accent); color: var(--on-accent); font: inherit; font-size: .85rem; font-weight: 700; box-shadow: 0 4px 16px rgba(0,0,0,.35); }
.vn-add button { min-height: 44px; touch-action: manipulation; -webkit-user-select: none; user-select: none; }

/* One footer for every reader (same bar as Prasango): Previous, Like, Go to, Next */
.reader .pbar { position: static; flex: none; z-index: auto; box-shadow: none; }
.reader .pbar.r-nav button { color: var(--accent); }
.reader .pbar.r-nav button.liked { color: #d6336c; }
/* more tabs under a vachanamrut: they scroll sideways instead of squeezing */
.vn-tabs { overflow-x: auto; scrollbar-width: none; }
.vn-tabs::-webkit-scrollbar { display: none; }
.vn-tabs button { flex: 1 0 auto; padding-left: 14px; padding-right: 14px; white-space: nowrap; }
.vn-item h4 { margin: 0 0 .4em; }

/* the names under a vachanamrut (patro, mahima, nirupan, prasang, katha): a tidy list, the full title always readable */
.vn-names { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px 0; }
.vn-names.two { grid-template-columns: 1fr 1fr; }
.vn-name {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 52px; width: 100%; padding: 12px 14px; text-align: left;
  border: 1px solid var(--line); border-left: 4px solid var(--accent2); border-radius: 12px;
  background: var(--card); color: var(--text);
  font: inherit; font-size: .95rem; font-weight: 650; line-height: 1.45;
  overflow-wrap: anywhere; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.vn-name::after { content: "›"; flex: none; font-size: 1.5rem; line-height: 1; color: var(--accent); font-weight: 400; }
.vn-name:active { background: color-mix(in srgb, var(--accent) 10%, var(--card)); border-color: var(--accent); }
.vn-name:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.vn-names.two .vn-name { font-size: .9rem; padding: 10px 12px; min-height: 48px; }
.vn-body { padding: 4px 14px; }

/* Reader view: what a reader sees (the admin / editor tools are hidden) */
html.as-reader .ie-pen, html.as-reader .hide-bar, html.as-reader .vn-admin, html.as-reader .vn-add, html.as-reader .vn-acts { display: none !important; }
html.as-reader .ie-has { padding-right: 0 !important; }
.rv-btn.on { background: var(--rule) !important; border-color: var(--rule) !important; color: #1B3A5C !important; }

/* admin: a pending change shown as a reader sees it */
.rp { z-index: 80; }
.rp-badge { flex: none; margin-left: auto; padding: 4px 10px; border-radius: 999px; background: var(--rule); color: #1B3A5C; font-size: .7rem; font-weight: 800; letter-spacing: .06em; }
.rp .r-title { flex: 1; min-width: 0; }
.rp-foot { flex: none; display: flex; gap: 10px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
.rp-foot .btn { min-height: 46px; }

/* =====================================================================
   Paper / Night redesign layer (Nov 2026)
   Everything below only changes how things look. To undo the redesign,
   delete from here to the end of the file.
   ===================================================================== */
:root {
  --bg: #F6F1E7;
  --card: #FFFDF8;
  --text: #1C1A17;
  --muted: #6B6357;
  --accent: #B4532A;
  --accent2: #A9662A;
  --line: #E6DDCC;
  --band: #F6F1E7;
  --band-text: #1C1A17;
  --rule: #E9C48A;
  --on-rule: #3A2410;
  --on-accent: #FFFFFF;
  --grad: #B4532A;
  --soft: #F1E3D3;
  --cover: linear-gradient(170deg, #EBC08E 0%, #D68A62 38%, #9C4F52 72%, #5A2F43 100%);
  --cover-text: #FFFBF3;
  --radius: 14px;
  --font-ui: "Inter", "Noto Sans Gujarati", system-ui, -apple-system, Roboto, sans-serif;
  --font-head: "Fraunces", Georgia, serif;
  --font-gu-serif: "Noto Serif Gujarati", "Inter", "Noto Sans Gujarati", sans-serif;
}
:root[data-theme="dark"] {
  --bg: #15120F;
  --card: #201B17;
  --text: #EFE7DA;
  --muted: #A39886;
  --accent: #E8956A;
  --accent2: #E0A35A;
  --line: #322B25;
  --band: #15120F;
  --band-text: #EFE7DA;
  --rule: #6E4A2A;
  --on-rule: #FBE9D2;
  --on-accent: #1E120B;
  --grad: #E8956A;
  --soft: rgba(232, 149, 106, .14);
  --cover: linear-gradient(172deg, #4B2F42 0%, #6E3838 42%, #3A2224 74%, #241815 100%);
  --cover-text: #F6E9D8;
}

body { font-family: var(--font-ui); }

/* Header: ivory band (charcoal at night) instead of navy */
.top {
  background: color-mix(in srgb, var(--band) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.top h1, .top .brand, :root[data-theme] .top h1 { color: var(--band-text); -webkit-text-fill-color: currentColor; }
.top .brand { font-family: var(--font-gu-serif); font-weight: 700; }
.top .meta-line { color: var(--muted); }
.top .chan, .top .theme-btn, .top .menu-btn, .ibtn, .top.compact .theme-btn {
  color: var(--band-text); background: var(--card); border: 1px solid var(--line);
}
.ibtn:active { background: var(--soft); }
.ibtn.on, .ibtn.bell.on, .rv-btn.on { background: var(--accent) !important; border-color: var(--accent) !important; color: var(--on-accent) !important; }
.rp-badge { color: var(--on-rule); }

/* Headings: solid colour, no gradient text */
h1, .hero h2, :root[data-theme="dark"] h1, :root[data-theme="dark"] .hero h2 {
  background: none; -webkit-text-fill-color: currentColor;
}

/* Home: the day's thought as a sunrise cover */
.home-wrap .hero {
  position: relative; overflow: hidden; display: block; text-align: center;
  margin: 14px 0 6px; padding: 34px 22px 30px; border-radius: 24px;
  background: var(--cover); color: var(--cover-text);
  box-shadow: 0 18px 40px -22px rgba(90, 47, 67, .6);
}
.home-wrap .hero::before {
  content: ""; position: absolute; left: 50%; top: -40px; width: 260px; height: 260px; transform: translateX(-50%);
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 243, 220, .55) 0 22%, transparent 23%),
              repeating-radial-gradient(circle, rgba(255, 243, 220, .28) 0 1px, transparent 1px 22px);
  opacity: .55;
}
:root[data-theme="dark"] .home-wrap .hero::before { opacity: .2; }
.home-wrap .hero > div { position: relative; }
.home-wrap .hero .eyebrow { color: var(--cover-text); opacity: .92; font: 500 1em/1.6 var(--font-gu-serif); letter-spacing: 0; }
.home-wrap .hero .date { color: var(--cover-text); opacity: .8; font-size: .78em; letter-spacing: .12em; text-transform: uppercase; margin: 6px 0 14px; }
.home-wrap .hero h2.quote {
  color: var(--cover-text); font: 700 clamp(1.25em, 6vw, 1.6em)/1.6 var(--font-gu-serif);
  text-shadow: 0 2px 18px rgba(60, 20, 20, .25); text-wrap: balance;
}
.home-wrap .hero .tag { color: var(--cover-text); opacity: .85; font-size: .72em; letter-spacing: .1em; text-transform: uppercase; margin-top: 16px; }
.home-wrap .hero .quote-edit { margin-top: 12px; background: rgba(255, 255, 255, .18); color: #fff; border: 1px solid rgba(255, 255, 255, .35); }

.sec-h { font-family: var(--font-head); font-weight: 600; letter-spacing: 0; text-transform: none; font-size: 1.15em; color: var(--text); }

/* Cards and tiles */
.tile, .item, .card, .docs > *, .sec-card {
  border-radius: 18px;
}
.tile { background: var(--card); border: 1px solid var(--line); box-shadow: none; }
.tile .t { font-family: var(--font-head); font-weight: 600; }
.tile .arr { color: var(--accent); }

/* Install card */
.install { border-radius: 18px; border-color: var(--line); background: var(--card); }
.install button#install-btn { background: var(--accent); color: var(--on-accent); }

/* Reading: book-like Gujarati serif with tall lines */
:root { --font-read: var(--font-gu-serif); } /* set to var(--font-ui) to go back to sans for reading */
.post .body, .article { font-family: var(--font-read); line-height: 1.95; }
.r-title, .article h1, .article h2, .item .ttl, .doc-title { font-family: var(--font-gu-serif); }

/* Bottom bars use the card colour, with the accent for active items */
.pnav, .up, #more { background: var(--accent); color: var(--on-accent); }
.bar-title .sub { color: var(--muted); }
.top .panel, .top .filters { color: var(--text); }
.detail-head { color: var(--text); }
.dh-date { color: var(--muted); }
.dh-actions button, .dh-actions a { border-color: var(--line); background: var(--card); }
main.inner > p > a { color: var(--accent); }

/* ---------- Main tabs: Today, Library, Saved, You ---------- */
body.hub .scroll { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.hub-tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; justify-content: space-around; gap: 4px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.hub-tabs a {
  flex: 1; max-width: 110px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0 4px; border-radius: 14px; text-decoration: none; color: var(--muted);
  font: 600 11px/1.2 var(--font-ui);
}
.hub-tabs a[aria-current="page"] { color: var(--accent); background: var(--soft); }
.hub-title { font-family: var(--font-head) !important; font-weight: 600 !important; font-size: 1.3em !important; }

.cover-acts { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.cover-acts button {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 12px;
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3); color: #fff;
  font: 600 .72em var(--font-ui); cursor: pointer;
}

.sec-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 26px; }
.sec-row .sec-h { margin: 0; }
.see-all { font: 600 .78em var(--font-ui); color: var(--accent); text-decoration: none; }
.sec-row .count { font: 700 .75em var(--font-ui); color: var(--muted); }
.hub-page { padding-top: 6px; }
.hub-page > .sec-h { margin: 24px 0 8px; }
.hub-meta { color: var(--muted); font-size: .8em; margin: 14px 2px 6px; }
.hub-meta.center { text-align: center; margin-top: 28px; }

/* Today's path */
.path { margin-top: 22px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 16px 14px 8px; }
.path-head { display: flex; align-items: flex-end; justify-content: space-between; padding: 0 4px; }
.path-head small { display: block; color: var(--muted); font-size: .72em; }
.path-head h2 { margin: 0; font: 600 1.2em var(--font-head); }
.streak { padding: 5px 11px; border-radius: 999px; background: var(--soft); color: var(--accent); font: 700 .72em var(--font-ui); }
.streak::before { content: "🔥 "; }
.path-bar { height: 6px; margin: 12px 4px 12px; border-radius: 4px; background: var(--line); overflow: hidden; }
.path-bar i { display: block; height: 100%; width: 0; background: #1F6F5C; border-radius: 4px; transition: width .4s; }
:root[data-theme="dark"] .path-bar i { background: #6BC4A6; }
.step, .cont, .row, .jump {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; text-decoration: none; color: var(--text);
  font: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 11px 12px; margin-bottom: 8px; cursor: pointer;
}
.step .n {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--line); color: var(--muted); font: 700 .75em var(--font-ui);
}
.step.done .n { background: #1F6F5C; border-color: #1F6F5C; color: #fff; }
:root[data-theme="dark"] .step.done .n { background: #6BC4A6; border-color: #6BC4A6; color: #15120F; }
.step.cur { border: 1.5px solid var(--accent); background: var(--card); }
.step.cur .n { border-color: var(--accent); color: var(--accent); }
.st { flex: 1; min-width: 0; display: grid; }
.st small { color: var(--muted); font: 600 .62em var(--font-ui); letter-spacing: .08em; text-transform: uppercase; }
.st b { font: 600 .9em/1.45 "Noto Sans Gujarati", var(--font-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step.done .st b { color: var(--muted); }
.step .go { flex: none; padding: 7px 12px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font: 600 .7em var(--font-ui); }
.step .dur { flex: none; color: var(--muted); font: 600 .7em var(--font-ui); }

/* Continue reading, rows, search */
.cont { background: var(--card); }
.cont .ic { flex: none; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--soft); color: var(--accent); }
.cont .st small, .row .st small { text-transform: none; letter-spacing: 0; font-size: .7em; font-weight: 500; }
.cont .chev { color: var(--muted); font-size: 1.3em; }
.row { background: var(--card); }
.row .no { flex: none; min-width: 44px; height: 44px; padding: 0 6px; border-radius: 13px; display: grid; place-items: center; background: var(--soft); color: var(--accent); font: 700 .8em var(--font-ui); }
.hub-search {
  display: flex; align-items: center; gap: 10px; height: 52px; margin-top: 12px; padding: 0 14px;
  border-radius: 16px; background: var(--card); border: 1px solid var(--line); color: var(--muted);
}
.hub-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--soft); }
.hub-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: 500 16px var(--font-ui); }
.jump { background: var(--accent); color: var(--on-accent); border-color: var(--accent); margin-top: 14px; }
.jump .big { font: 600 1.7em var(--font-head); min-width: 56px; text-align: center; }
.jump .st small { color: inherit; opacity: .85; text-transform: none; letter-spacing: 0; font-size: .75em; }

/* Library */
.tiles.shelf { display: flex; overflow-x: auto; gap: 12px; padding-bottom: 8px; scroll-snap-type: x mandatory; margin-top: 10px; scrollbar-width: none; }
.tiles.shelf::-webkit-scrollbar { display: none; }
.tiles.shelf .tile { flex: 0 0 46%; scroll-snap-align: start; }
.tiles.shelf .tile.banner { flex-basis: 46%; grid-column: auto; }
.vsecs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.vsec { display: flex; flex-direction: column; justify-content: flex-end; min-height: 92px; padding: 12px; border-radius: 16px; color: #fff; text-decoration: none; }
.vsec b { font: 700 1em "Noto Sans Gujarati", var(--font-ui); }
.vsec small { font-size: .68em; opacity: .85; }
:root[data-theme="dark"] .vsec { filter: saturate(.8) brightness(.85); }

/* Saved and You */
.empty-state { text-align: center; color: var(--muted); padding: 50px 10px; font-size: .9em; display: grid; gap: 4px; justify-items: center; }
.empty-state .bi { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--accent); margin-bottom: 10px; }
.empty-state b { color: var(--text); font-size: 1.1em; }
.prof { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.prof .av { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font: 600 1.5em var(--font-head); }
.prof b { display: block; font-size: 1.1em; } .prof small { color: var(--muted); font-size: .75em; }
.signcard { margin-top: 16px; padding: 18px; border-radius: 20px; background: var(--cover); color: var(--cover-text); }
.signcard b { font: 600 1.2em var(--font-head); } .signcard p { font-size: .8em; line-height: 1.5; opacity: .92; margin: 6px 0 14px; }
.btn-light { display: block; text-align: center; padding: 12px; border-radius: 14px; background: #FFFBF3; color: #1C1A17; font: 600 .85em var(--font-ui); text-decoration: none; }
.stats { display: flex; gap: 10px; margin-top: 16px; }
.stat { flex: 1; padding: 12px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.stat b { display: block; font: 600 1.5em var(--font-head); } .stat small { color: var(--muted); font-size: .72em; }
.grp { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.set { width: 100%; display: flex; align-items: center; gap: 12px; padding: 13px 14px; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--text); font: 500 .88em var(--font-ui); text-align: left; cursor: pointer; }
.set:last-child { border-bottom: 0; }
.set > svg { color: var(--muted); flex: none; }
.set .l { flex: 1; } .set .v { color: var(--muted); font-size: .9em; display: flex; align-items: center; gap: 5px; }
.set.red, .set.red > svg { color: #C0392B; }
.chips { display: flex; gap: 5px; }
.chip { padding: 5px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font: 600 .85em var(--font-ui); cursor: pointer; }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.tog { width: 44px; height: 26px; border-radius: 14px; background: var(--line); position: relative; flex: none; }
.tog::after { content: ""; position: absolute; left: 2px; top: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: .2s; }
.tog.on { background: #1F6F5C; } .tog.on::after { left: 20px; }
.home-wrap .hero > div { display: flex; flex-direction: column; align-items: center; }
.home-wrap .hero .cover-acts { order: 50; }
.home-wrap .hero .quote-edit { order: 60; }
.empty-state { border: 0; }

/* ---------- Sign in / Create account ---------- */
.auth-page .scroll { padding-bottom: 40px; }
.auth-wrap { max-width: 440px; padding-top: calc(18px + env(safe-area-inset-top)); }
.auth-back { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--card); color: var(--text); }
.auth-brand { margin: 22px 0 0; font: 700 11px var(--font-ui); letter-spacing: .3em; text-transform: uppercase; color: var(--accent); }
.auth-h { margin: 8px 0 0; font: 600 2em/1.15 var(--font-head); letter-spacing: -.015em; color: var(--text); background: none; -webkit-text-fill-color: currentColor; }
.auth-h em { color: var(--accent); font-style: italic; font-weight: 500; }
.auth-sub { color: var(--muted); font-size: .85em; line-height: 1.55; margin: 10px 0 6px; }
.fld2 { display: block; margin-top: 16px; }
.fld2 > span:first-child { display: block; font: 600 .62em var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.fld2 input, .pin-row { width: 100%; height: 52px; border-radius: 15px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: 500 17px var(--font-ui); padding: 0 14px; outline: 0; }
.pin-row { display: flex; align-items: center; padding: 0 6px 0 0; }
.pin-row input { border: 0; height: 100%; background: transparent; }
.fld2 input:focus, .pin-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--soft); }
.pin-row:focus-within input { box-shadow: none; }
.pin-eye { flex: none; border: 0; background: none; color: var(--accent); font: 600 .75em var(--font-ui); padding: 8px 10px; cursor: pointer; }
.auth-row { display: flex; justify-content: flex-end; margin-top: 10px; }
.link { border: 0; background: none; padding: 0; color: var(--accent); font: 600 .8em var(--font-ui); cursor: pointer; }
.auth-btn { width: 100%; height: 54px; margin-top: 18px; border: 0; border-radius: 16px; background: var(--text); color: var(--bg); font: 600 1em var(--font-ui); cursor: pointer; }
.auth-btn.accent { background: var(--accent); color: var(--on-accent); }
.auth-btn:disabled { opacity: .6; }
.auth-or { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; color: var(--muted); font: italic 500 .8em var(--font-head); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.g-btn { display: flex; justify-content: center; min-height: 44px; }
.auth-note { margin: 16px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--soft); color: var(--text); font-size: .75em; line-height: 1.5; }
.auth-foot { text-align: center; color: var(--muted); font-size: .8em; margin: 22px 0 0; }
.auth-foot .link { font-size: 1em; }
.auth-done { margin-top: 18px; padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); font-size: .85em; line-height: 1.5; color: var(--muted); }
.auth-done b { display: block; color: var(--text); font-size: 1.1em; margin-bottom: 4px; }
.auth-skip { text-align: center; margin-top: 26px; font-size: .78em; } .auth-skip a { color: var(--muted); }

/* ---------- Admin portal ---------- */
body.portal { background: var(--bg); }
.pt-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.pt-side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 22px 14px; border-right: 1px solid var(--line); background: var(--card); }
.pt-logo { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font: 600 1.15em var(--font-head); padding: 0 8px; }
.pt-logo .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.pt-logo small { font: 700 .55em var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); background: var(--soft); padding: 3px 7px; border-radius: 6px; }
.pt-nav { display: grid; gap: 4px; }
.pt-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--muted); text-decoration: none; font: 600 .85em var(--font-ui); }
.pt-nav a svg { width: 20px; height: 20px; flex: none; }
.pt-nav a[aria-current="page"] { background: var(--soft); color: var(--accent); }
.pt-nav .badge { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 700 .75em var(--font-ui); font-style: normal; text-align: center; }
.pt-me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--bg); font-size: .8em; }
.pt-me b { display: block; } .pt-me small { color: var(--muted); }
.pt-main { min-width: 0; padding: 26px 30px 60px; max-width: 980px; }
.pt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.pt-head h1 { margin: 0; font: 600 1.8em var(--font-head); color: var(--text); background: none; -webkit-text-fill-color: currentColor; }
.pt-exit { color: var(--muted); font: 600 .8em var(--font-ui); }
.pt-view { display: grid; gap: 16px; }
.pt-view > div { display: grid; gap: 16px; }
.pt-muted { color: var(--muted); font-size: .8em; margin: 4px 0; line-height: 1.5; } .pt-muted.small { font-size: .72em; }
.pt-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pt-stat { display: grid; gap: 2px; padding: 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--text); }
.pt-stat b { font: 600 2em/1 var(--font-head); } .pt-stat span { color: var(--muted); font-size: .75em; }
.pt-stat.hot { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--card)); } .pt-stat.hot b { color: var(--accent); }
.pt-card { padding: 18px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); display: grid; gap: 8px; }
.pt-card h2 { margin: 0 0 4px; font: 600 1.1em var(--font-head); }
.pt-ch { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; } .pt-ch a { color: var(--accent); font: 600 .78em var(--font-ui); } .pt-ch small { color: var(--muted); font-size: .72em; }
.pt-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); color: var(--text); text-align: left; text-decoration: none; font: inherit; cursor: pointer; }
.pt-row:hover { border-color: var(--muted); }
.pt-av { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--accent); font: 700 .85em var(--font-ui); }
.pt-av.warn { background: var(--accent); color: var(--on-accent); }
.pt-rt { flex: 1; min-width: 0; display: grid; gap: 2px; } .pt-rt b { font-size: .9em; } .pt-rt small { color: var(--muted); font-size: .72em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-go { color: var(--accent); font: 600 .75em var(--font-ui); white-space: nowrap; }
.pt-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.pt-tag { padding: 2px 8px; border-radius: 999px; background: var(--text); color: var(--bg); font: 700 .6em var(--font-ui); letter-spacing: .03em; }
.pt-tag.soft { background: var(--soft); color: var(--accent); } .pt-tag.warn { background: #F4A62A; color: #2B1A00; } .pt-tag.bad { background: #C0392B; color: #fff; } .pt-tag.admin { background: var(--accent); color: var(--on-accent); }
.pt-kv { display: flex; justify-content: space-between; gap: 10px; font-size: .85em; padding: 6px 0; border-bottom: 1px solid var(--line); } .pt-kv span { color: var(--muted); }
.pt-links, .pt-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.pt-btn { display: inline-flex; align-items: center; justify-content: center; height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--text); background: var(--text); color: var(--bg); font: 600 .8em var(--font-ui); text-decoration: none; cursor: pointer; }
.pt-btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.pt-btn.danger { background: transparent; color: #C0392B; border-color: color-mix(in srgb, #C0392B 40%, transparent); }
.pt-btn.armed { background: #C0392B; color: #fff; border-color: #C0392B; }
.pt-btn.small { height: 34px; padding: 0 12px; font-size: .72em; }
.pt-btn:disabled { opacity: .55; }
.pt-tools { display: flex; gap: 10px; }
.pt-search, .pt-in { width: 100%; min-height: 44px; padding: 10px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: 500 15px var(--font-ui); outline: 0; }
textarea.pt-in { font-family: "Noto Sans Gujarati", var(--font-ui); line-height: 1.6; resize: vertical; }
.pt-search:focus, .pt-in:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--soft); }
.pt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-chip { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font: 600 .72em var(--font-ui); cursor: pointer; }
.pt-chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.pt-list { display: grid; gap: 8px; }
.pt-alert { padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, #F4A62A 18%, var(--card)); border: 1px solid color-mix(in srgb, #F4A62A 50%, transparent); font-size: .8em; line-height: 1.5; }
.pt-alert b { display: block; margin-bottom: 2px; }
.pt-sheet { width: min(560px, 100vw); max-height: 92vh; margin: auto; padding: 20px; border: 0; border-radius: 22px; background: var(--card); color: var(--text); display: grid; gap: 12px; }
.pt-sheet[open] { display: grid; }
.pt-sheet::backdrop { background: rgba(15, 12, 8, .45); }
.pt-sh { display: flex; align-items: center; justify-content: space-between; } .pt-sh h2 { margin: 0; font: 600 1.3em var(--font-head); }
.pt-x { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; }
.pt-fld { display: grid; gap: 6px; } .pt-fld > span { font: 600 .62em var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pt-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .pt-checks.off { opacity: .4; pointer-events: none; }
.pt-check { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); font-size: .78em; cursor: pointer; }
.pt-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.pt-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pt-line:last-child { border-bottom: 0; } .pt-line b { display: block; font-size: .85em; } .pt-line small { color: var(--muted); font-size: .72em; }
.pt-tog { flex: none; width: 46px; height: 27px; border-radius: 14px; border: 0; background: var(--line); position: relative; cursor: pointer; }
.pt-tog::after { content: ""; position: absolute; left: 2px; top: 2px; width: 23px; height: 23px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: .2s; }
.pt-tog.on { background: #1F6F5C; } .pt-tog.on::after { left: 21px; }
.pt-q { display: grid; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); } .pt-q:last-child { border-bottom: 0; } .pt-q small { color: var(--muted); font-size: .72em; } .pt-q .pt-btn { justify-self: start; }
.pt-sub { display: grid; gap: 8px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); }
.pt-prev { margin: 0; font: .82em/1.7 "Noto Sans Gujarati", var(--font-ui); color: var(--text); }
.pt-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; padding: 10px 16px; border-radius: 999px; background: var(--text); color: var(--bg); font: 600 .8em var(--font-ui); }
@media (max-width: 760px) {
  .pt-shell { grid-template-columns: 1fr; }
  .pt-side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 50; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(14px); }
  .pt-logo, .pt-me { display: none; }
  .pt-nav { grid-template-columns: repeat(4, 1fr); width: 100%; }
  .pt-nav a { flex-direction: column; gap: 2px; padding: 6px 0; font-size: .65em; position: relative; }
  .pt-nav .badge { position: absolute; top: 2px; right: 18%; margin: 0; font-size: .9em; }
  .pt-main { padding: calc(16px + env(safe-area-inset-top)) 16px 100px; }
  .pt-stats { grid-template-columns: 1fr 1fr; }
  .pt-checks { grid-template-columns: 1fr; }
  .pt-sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 22px 22px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); overflow: auto; }
}
:root[data-theme] .auth-h, :root .auth-h, :root[data-theme] .pt-head h1 { color: var(--text); }
.pt-btn { white-space: nowrap; }
.btn-ghost-light { display: block; text-align: center; margin-top: 8px; padding: 10px; color: #fff; font: 600 .8em var(--font-ui); text-decoration: none; opacity: .9; }
.auth-cover { margin-top: 18px; padding: 34px 20px 30px; border-radius: 24px; background: var(--cover); color: var(--cover-text); text-align: center; }
.auth-brand.light { color: var(--cover-text); opacity: .85; margin: 0; }
.auth-q { margin: 10px 0 0; font: 700 1.5em/1.5 var(--font-gu-serif); }
.auth-cover + .auth-h { margin-top: 22px; }
.g-area { margin-top: 18px; min-height: 44px; }
.auth-btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); margin-top: 10px; }
.auth-points { margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.auth-points li { position: relative; padding-left: 26px; color: var(--muted); font-size: .8em; line-height: 1.5; }
.auth-points li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--soft); color: var(--accent); font: 700 11px/18px var(--font-ui); text-align: center; }
.link-card { display: grid; gap: 4px; margin-top: 14px; padding: 14px 16px; border-radius: 16px; background: var(--soft); color: var(--text); text-decoration: none; border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.link-card b { font-size: .88em; } .link-card span { color: var(--muted); font-size: .78em; line-height: 1.5; }
.link-card.warn { background: color-mix(in srgb, #F4A62A 16%, var(--card)); border-color: color-mix(in srgb, #F4A62A 45%, transparent); }

/* ---------- Sections: shared tab bar, calmer readers, coloured part cards ---------- */
.hub-tabs { z-index: 45; }                       /* readers (z 50) cover it */
body.reading .hub-tabs { display: none; }        /* Prasango reading view keeps its own bar */
body.has-tabs .scroll { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
body.has-tabs .up { bottom: calc(88px + env(safe-area-inset-bottom)); }
body.has-tabs.reading .up { bottom: calc(78px + env(safe-area-inset-bottom)); }

/* readers use the page colour instead of the old beige tint */
.reader { background: var(--bg); }
.r-top { gap: 6px; }
.r-top button { flex: none; width: 36px; height: 36px; min-width: 0; padding: 0; font-size: 13px; }
.r-top .r-title { flex: 1; min-width: 0; font-family: var(--font-gu-serif); font-weight: 700; }

/* section and part cards (Vachanamrut sections, Anirdeshi parts) in the Library colours */
.docs .doc.year { color: #fff; border: 0; background: linear-gradient(140deg, #B4532A, #7A3B4F); }
.docs .doc.year:nth-of-type(6n+2) { background: linear-gradient(140deg, #C27A2C, #8A4F22); }
.docs .doc.year:nth-of-type(6n+3) { background: linear-gradient(140deg, #5C8A4E, #2E5240); }
.docs .doc.year:nth-of-type(6n+4) { background: linear-gradient(140deg, #A0574B, #5A2F43); }
.docs .doc.year:nth-of-type(6n+5) { background: linear-gradient(140deg, #2F7A87, #1F3A5C); }
.docs .doc.year:nth-of-type(6n+6) { background: linear-gradient(140deg, #7A4FB8, #3E2C77); }
.docs .doc.year * { color: inherit !important; }
.docs .doc.year .doc-meta, .docs .doc.year small { opacity: .85; }
:root[data-theme="dark"] .docs .doc.year { filter: saturate(.8) brightness(.85); }
#r-theme { font-size: 17px; }
.hub-tabs a { position: relative; }
.tab-dot { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 700 10px/17px var(--font-ui); font-style: normal; text-align: center; }
#liked-filter { display: none; } /* liked items are in the Saved tab */
.home-wrap .hero .quote-edit { align-self: center; }
.tile.locked { position: relative; text-align: left; font: inherit; color: var(--text); cursor: pointer; padding: 0; }
.tile.locked img { filter: grayscale(.85) brightness(.9); opacity: .7; }
.tile.locked .lock { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(28,26,23,.75); color: #fff; }
.tile.locked .s { color: var(--accent); font-weight: 600; }
.req-dlg { width: min(360px, 92vw); border: 0; border-radius: 22px; padding: 24px 20px 16px; background: var(--card); color: var(--text); text-align: center; }
.req-dlg::backdrop { background: rgba(15, 12, 8, .45); }
.req-dlg .req-ic { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--accent); }
.req-dlg h2 { margin: 0; font: 600 1.2em var(--font-head); color: var(--text); background: none; -webkit-text-fill-color: currentColor; }
.req-dlg p { color: var(--muted); font-size: .85em; line-height: 1.5; margin: 8px 0 16px; }
.req-dlg .req-go { width: 100%; height: 48px; border: 0; border-radius: 14px; background: var(--accent); color: var(--on-accent); font: 600 .95em var(--font-ui); cursor: pointer; }
.req-dlg .req-go:disabled { opacity: .7; }
.req-dlg .req-x { width: 100%; margin-top: 6px; padding: 10px; border: 0; background: none; color: var(--muted); font: 600 .85em var(--font-ui); cursor: pointer; }

/* ---------- One Aa control, photo viewer, hashtag captions ---------- */
.aa-hidden { display: none !important; }
#r-aa { flex: none; width: 40px; height: 36px; padding: 0; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 15px; cursor: pointer; }
.aa-sheet { position: fixed; inset: 0; z-index: 120; background: rgba(15, 12, 8, .35); display: flex; align-items: flex-end; justify-content: center; }
.aa-card { width: 100%; max-width: 520px; padding: 10px 20px calc(18px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; background: var(--card); color: var(--text); box-shadow: 0 -10px 30px -10px rgba(0,0,0,.3); animation: aa-up .2s ease; }
@keyframes aa-up { from { transform: translateY(30px); opacity: 0; } }
.aa-grab { display: block; width: 38px; height: 4px; margin: 0 auto 10px; border-radius: 3px; background: var(--line); }
.aa-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.aa-l { color: var(--muted); font: 500 14px var(--font-ui); }
.aa-g { display: flex; align-items: center; gap: 8px; }
.aa-b { width: 46px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 600 14px var(--font-ui); cursor: pointer; }
.aa-b.big { font-size: 18px; }
.aa-sz { min-width: 44px; text-align: center; color: var(--muted); font: 600 12px var(--font-ui); }
.aa-chip { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font: 600 13px var(--font-ui); cursor: pointer; }
.aa-chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.aa-done { width: 100%; height: 48px; margin-top: 14px; border: 0; border-radius: 14px; background: var(--text); color: var(--bg); font: 600 15px var(--font-ui); cursor: pointer; }
.post img, .r-stage img, .article img { cursor: zoom-in; }
.zoom { position: fixed; inset: 0; z-index: 130; background: rgba(0, 0, 0, .92); overflow: auto; display: flex; align-items: center; justify-content: center; -webkit-overflow-scrolling: touch; }
.zoom.zoomed { align-items: flex-start; justify-content: flex-start; }
.zoom img { width: 100%; max-width: none; height: auto; cursor: zoom-in; }
.zoom-x { position: fixed; top: calc(14px + env(safe-area-inset-top)); right: 14px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.18); color: #fff; font-size: 18px; cursor: pointer; }
.zoom-hint { position: fixed; bottom: calc(22px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.8); font: 500 13px var(--font-ui); }
.post .body.hash-only { display: none; }
.ask-push { margin-top: 14px; padding: 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); display: grid; gap: 6px; }
.ask-push b { font: 600 1.05em var(--font-head); } .ask-push span { color: var(--muted); font-size: .8em; line-height: 1.5; }
.ask-push div { display: flex; gap: 8px; margin-top: 6px; }
.ask-push button { flex: 1; height: 42px; border: 0; border-radius: 12px; background: var(--accent); color: var(--on-accent); font: 600 .85em var(--font-ui); cursor: pointer; }
.ask-push button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.more-search { border-style: dashed; }
.pt-check.fixed { opacity: .65; } .pt-check small { color: var(--muted); font-size: .9em; }

/* ---------- Highlights ---------- */
mark.hl { background: color-mix(in srgb, #F4C04E 45%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; box-decoration-break: clone; -webkit-box-decoration-break: clone; cursor: pointer; }
:root[data-theme="dark"] mark.hl { background: color-mix(in srgb, #F4C04E 30%, transparent); }
.hl-btn { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 140; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--text); color: var(--bg); font: 600 14px var(--font-ui); box-shadow: 0 10px 26px -8px rgba(0,0,0,.45); cursor: pointer; }
.hl-btn[hidden] { display: none; }
.hl-pop { position: fixed; z-index: 140; padding: 9px 14px; border: 0; border-radius: 12px; background: var(--text); color: var(--bg); font: 600 13px var(--font-ui); box-shadow: 0 8px 20px -6px rgba(0,0,0,.4); cursor: pointer; }
.hl-row { display: grid; gap: 6px; margin-bottom: 8px; padding: 12px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid #F4C04E; color: var(--text); text-decoration: none; }
.hl-row q { font: 400 .9em/1.8 var(--font-read, "Noto Sans Gujarati"); quotes: none; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; text-align: justify; }
.hl-row small { color: var(--muted); font-size: .72em; }

/* ---------- Reading text is justified everywhere (an editor's own alignment still wins) ---------- */
.post .body, .article, #r-stage, .doc-body, .vn-body { text-align: justify; text-justify: inter-word; hyphens: none; }

/* Justified reading text (overrides the older left-aligned rule above).
   The last line of each paragraph stays at the start, and verses, headings and the ending stay as they are. */
.article p, .article .rt-body, .article .rt-body p, .post .body, .post .body p, .post .body div, .r-stage .article p {
  text-align: justify; text-justify: inter-word; text-align-last: start; hyphens: none;
}
.article p.slok { text-align: center; text-align-last: center; }
.article p.the-end, .r-stage .article p.the-end, .article .the-end { text-align: center; text-align-last: center; }
.article h2, .article h3, .article .byline, .article .tagline { text-align: left; text-align-last: auto; }

/* ---------- Mark as read and My tags ---------- */
.end-acts { display: flex; gap: 8px; margin: 28px 0 8px; text-align: left; }
.end-acts button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; padding: 0 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: 600 14px var(--font-ui); cursor: pointer; }
.end-acts .ea-read.on { background: #1F6F5C; border-color: #1F6F5C; color: #fff; }
:root[data-theme="dark"] .end-acts .ea-read.on { background: #6BC4A6; border-color: #6BC4A6; color: #15120F; }
.end-acts .ea-tag.on { border-color: var(--accent); color: var(--accent); }
.post .end-acts { margin: 6px 14px 14px; }
.tg-h { margin: 0 0 10px; font: 600 1.1em var(--font-head); color: var(--text); }
.tg-list { display: flex; flex-wrap: wrap; gap: 8px; max-height: 40vh; overflow: auto; padding-bottom: 4px; }
.tg-chip { padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 600 14px var(--font-ui); cursor: pointer; }
.tg-chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tg-empty { color: var(--muted); font-size: 14px; margin: 0; }
.tg-new { display: flex; gap: 8px; margin-top: 14px; }
.tg-in { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 500 16px var(--font-ui); outline: 0; }
.tg-in:focus { border-color: var(--accent); }
.tg-add { width: auto; padding: 0 16px; }
/* read ticks in section lists */
[data-rk].is-read { position: relative; }
[data-rk].is-read::after { content: "✓ Read"; position: absolute; top: 8px; right: 34px; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, #1F6F5C 14%, transparent); color: #1F6F5C; font: 700 10px/1.6 var(--font-ui); }
:root[data-theme="dark"] [data-rk].is-read::after { color: #6BC4A6; background: rgba(107,196,166,.15); }
.item[data-rk].is-read::after { right: 10px; }
.tag-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.tag-card { display: grid; gap: 2px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); border-left: 4px solid var(--accent); background: var(--card); color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.tag-card b { font: 600 .95em var(--font-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .tag-card small { color: var(--muted); font-size: .72em; }
.tag-back2 { border: 0; background: none; color: var(--accent); font: 600 .85em var(--font-ui); padding: 12px 0 4px; cursor: pointer; }
.tag-head2 { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.tag-name { flex: 1; min-width: 0; border: 0; border-bottom: 1.5px solid var(--line); background: transparent; color: var(--text); font: 600 1.4em var(--font-head); padding: 6px 0; outline: 0; }
.tag-name:focus { border-color: var(--accent); }
.tag-del { flex: none; border: 1px solid var(--line); background: var(--card); color: #C0392B; border-radius: 10px; padding: 8px 10px; font: 600 .72em var(--font-ui); cursor: pointer; }
.stats { flex-wrap: nowrap; }
.prog-grp { padding: 4px 0; }
.prog-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.prog-row:last-child { border-bottom: 0; }
.prog-l { font: 600 .85em var(--font-ui); } .prog-n { color: var(--muted); font-size: .75em; }
.prog-bar { grid-column: 1 / -1; display: block; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.prog-bar b { display: block; height: 100%; width: 0; background: #1F6F5C; border-radius: 3px; transition: width .4s; }
:root[data-theme="dark"] .prog-bar b { background: #6BC4A6; }

/* ---------- Read items are easy to spot everywhere ---------- */
/* section lists: number badge turns green with a tick, and a "Read" label */
.item[data-rk].is-read .no { background: #1F6F5C; color: #fff; }
.item[data-rk].is-read .no::before { content: "✓ "; }
:root[data-theme="dark"] .item[data-rk].is-read .no { background: #6BC4A6; color: #15120F; }
[data-rk].is-read { border-left: 4px solid #1F6F5C; }
:root[data-theme="dark"] [data-rk].is-read { border-left-color: #6BC4A6; }
[data-rk].is-read::after { content: "✓ Read"; top: 10px; font-size: 11px; padding: 2px 8px; }
/* main tabs: rows for read items get the same green tick */
a.row.is-read .no, a.cont.is-read .ic { background: #1F6F5C; color: #fff; }
a.row.is-read .no::before { content: "✓"; } a.row.is-read .no { font-size: 0; } a.row.is-read .no::before { font-size: 14px; }
a.row.is-read .st small::after, a.cont.is-read .st small::after { content: " · ✓ Read"; color: #1F6F5C; font-weight: 700; }
:root[data-theme="dark"] a.row.is-read .no, :root[data-theme="dark"] a.cont.is-read .ic { background: #6BC4A6; color: #15120F; }
:root[data-theme="dark"] a.row.is-read .st small::after, :root[data-theme="dark"] a.cont.is-read .st small::after { color: #6BC4A6; }

/* ---------- Cover: justified quote, Like next to Share ---------- */
.home-wrap .hero h2.quote { text-align: justify; text-align-last: center; }
.cover-acts button.on { background: rgba(255,255,255,.92); color: #9C4F52; }
.cover-acts button.on svg { fill: currentColor; }
.quote-row { position: relative; display: grid; gap: 6px; margin-bottom: 8px; padding: 14px 16px; border-radius: 16px; background: var(--cover); color: var(--cover-text); }
.quote-row q { quotes: none; font: 700 1em/1.7 var(--font-gu-serif); text-align: justify; text-align-last: center; }
.quote-row small { text-align: center; opacity: .85; font-size: .72em; letter-spacing: .06em; }
.quote-x { justify-self: center; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.14); color: #fff; border-radius: 10px; padding: 5px 12px; font: 600 .7em var(--font-ui); cursor: pointer; }
.home-wrap .hero h2.quote { text-wrap: balance; text-justify: inter-word; }
/* read marks: no floating label (it covered long titles); green number or tick + green edge instead */
[data-rk].is-read::after { content: none; }
.doc[data-rk].is-read .doc-title::before { content: "✓ "; color: #1F6F5C; font-weight: 800; }
:root[data-theme="dark"] .doc[data-rk].is-read .doc-title::before { color: #6BC4A6; }
/* cover quote: justify by spacing letters a little rather than opening big gaps between two words */
.home-wrap .hero h2.quote { text-justify: inter-character; }
.home-wrap .hero h2.quote { text-wrap: wrap; text-justify: inter-word; }
.greet-name { font-family: var(--font-head) !important; font-weight: 600 !important; font-size: 1.12em !important; letter-spacing: -.005em; }
.prof { position: relative; }
.prof-edit { margin-left: auto; align-self: center; border: 1px solid var(--line); background: var(--card); color: var(--accent); border-radius: 10px; padding: 7px 12px; font: 600 .75em var(--font-ui); cursor: pointer; }
.prof-form { display: grid; gap: 8px; margin-top: 12px; padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.prof-form[hidden] { display: none; }
.prof-lab { font: 600 .62em var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.prof-prev { margin: 4px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--soft); font: 600 .95em var(--font-head); color: var(--text); }
.btn-save { height: 44px; border: 0; border-radius: 12px; background: var(--text); color: var(--bg); font: 600 .85em var(--font-ui); cursor: pointer; }

/* ---------- Reading bar: floating pill (option B, always shown) ---------- */
nav.pbar.pill-bar {
  position: fixed; left: 50%; right: auto; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: auto; max-width: calc(100vw - 24px); display: flex; align-items: center; gap: 2px; padding: 5px;
  border-radius: 999px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 12px 30px -12px rgba(0,0,0,.4);
  z-index: 55; overflow: visible;
}
nav.pbar.pill-bar[hidden] { display: none; }
.reader nav.pbar.pill-bar { position: absolute; }
nav.pill-bar > button:not(.pb-pos) { flex: none; width: 48px; min-height: 0; height: 44px; padding: 0; border-radius: 999px; display: grid; place-items: center; background: none; border: 0; color: var(--muted); font-size: 0; }
nav.pill-bar > button:not(.pb-pos) > span:not(.ic) { display: none; }
nav.pill-bar > button .ic { font-size: 26px; line-height: 1; color: var(--text); font-weight: 400; }
nav.pill-bar #like .ic, nav.pill-bar #r-like .ic { font-size: 22px; color: var(--accent); }
nav.pill-bar > button.liked, nav.pill-bar > button[aria-pressed="true"] { background: var(--soft); }
nav.pill-bar > button:active { background: var(--soft); }
nav.pill-bar > button:disabled { opacity: .3; }
nav.pill-bar .pb-read.on { background: #1F6F5C; color: #fff; }
:root[data-theme="dark"] nav.pill-bar .pb-read.on { background: #6BC4A6; color: #15120F; }
nav.pill-bar .pb-tag.on { color: var(--accent); background: var(--soft); }
nav.pill-bar .pb-sep { flex: none; width: 1px; height: 24px; background: var(--line); }
/* the position above the bar; tapping it opens Go to */
nav.pill-bar .pb-pos {
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 12px; border: 0; border-radius: 999px; white-space: nowrap;
  background: color-mix(in srgb, var(--text) 86%, transparent); color: var(--bg); font: 600 12px var(--font-ui); cursor: pointer;
  box-shadow: 0 6px 14px -6px rgba(0,0,0,.4);
}
nav.pill-bar .pb-hash { opacity: .7; font-weight: 700; }
/* room at the end of the text so the last lines are not under the bar */
body.reading .post, .reader .r-stage .article { padding-bottom: calc(130px + env(safe-area-inset-bottom)); }
body.reading .scroll { padding-bottom: 0; }
.end-acts { display: none; }

/* position label above the bar: one line, same look in every reader */
nav.pill-bar > button.pb-pos { flex-direction: row !important; width: auto !important; min-height: 0 !important; height: 28px !important; padding: 0 12px !important;
  background: color-mix(in srgb, var(--text) 86%, transparent) !important; color: var(--bg) !important; font: 600 12px var(--font-ui) !important; gap: 5px; border-radius: 999px; }
nav.pill-bar > button.pb-pos span { display: inline !important; color: inherit !important; font: inherit !important; }

/* ---------- Go to: bottom sheet ---------- */
dialog.goto-dlg.goto-sheet {
  width: 100%; max-width: 480px; margin: auto auto 0; padding: 10px 20px calc(18px + env(safe-area-inset-bottom));
  border: 0; border-radius: 26px 26px 0 0; background: var(--card); color: var(--text);
  box-shadow: 0 -12px 34px -12px rgba(0,0,0,.35);
}
dialog.goto-dlg.goto-sheet[open] { animation: gs-up .22s ease; }
@keyframes gs-up { from { transform: translateY(40px); opacity: 0; } }
dialog.goto-dlg.goto-sheet::backdrop { background: rgba(15, 12, 8, .4); }
.goto-sheet .gs-grab { display: block; width: 38px; height: 4px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.goto-sheet .goto-label { margin: 0; font: 600 1.15em var(--font-head); text-align: center; }
.goto-sheet .gs-ctx { margin: 4px 0 0; text-align: center; color: var(--muted); font: 500 .78em var(--font-ui); min-height: 1em; }
.goto-sheet .goto-display {
  display: flex; align-items: center; justify-content: center; gap: 2px; height: 72px; margin: 12px 0 0;
  border-radius: 18px; background: var(--bg); border: 1px solid var(--line);
  font: 600 2.6em/1 var(--font-head); letter-spacing: .02em; color: var(--text);
}
.goto-sheet .goto-display::after { content: ""; width: 2px; height: 36px; background: var(--accent); border-radius: 2px; animation: gs-blink 1s steps(1) infinite; }
@keyframes gs-blink { 50% { opacity: 0; } }
.goto-sheet .gs-preview { margin: 8px 4px 0; min-height: 1.6em; text-align: center; color: var(--accent); font: 600 .85em/1.6 "Noto Sans Gujarati", var(--font-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goto-sheet .goto-err { margin: 6px 0 0; text-align: center; color: #C0392B; font: 600 .8em var(--font-ui); }
.goto-sheet .gs-chips { display: flex; justify-content: center; gap: 8px; margin: 12px 0 12px; }
.goto-sheet .gs-chips:empty { display: none; }
.goto-sheet .gs-chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 600 .78em var(--font-ui); cursor: pointer; }
.goto-sheet .gs-chip:active { background: var(--soft); }
.goto-sheet .keypad { gap: 8px; }
.goto-sheet .keypad button { height: 56px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 600 1.4em var(--font-ui); cursor: pointer; }
.goto-sheet .keypad button:active { background: var(--soft); transform: scale(.97); }
.goto-sheet .keypad button[data-k="del"] { color: var(--muted); font-size: 1.2em; }
.goto-sheet .keypad button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-size: 1.05em; }
.goto-sheet .goto-cancel { display: block; width: 100%; margin-top: 10px; padding: 12px; border: 0; background: none; color: var(--muted); font: 600 .9em var(--font-ui); cursor: pointer; }
.goto-sheet .keypad button:focus { outline: none; }
.goto-sheet .keypad button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Section-shaped Go to ---------- */
.aa-sheet.gp .aa-card { max-height: 86vh; display: flex; flex-direction: column; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
.gp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.gp-head b { font: 600 1.15em var(--font-head); color: var(--text); }
.gp-x { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; }
.gp-body { overflow-y: auto; padding-bottom: 6px; }
.gp-step { margin: 14px 0 8px; font: 600 11px var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.gp-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.gp-chip { padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 600 14px "Noto Sans Gujarati", var(--font-ui); cursor: pointer; }
.gp-chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.gp-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.gp-n { height: 46px; border-radius: 13px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 600 15px var(--font-ui); cursor: pointer; }
.gp-n:active { background: var(--soft); }
.gp-n.read { background: color-mix(in srgb, #1F6F5C 14%, var(--bg)); border-color: color-mix(in srgb, #1F6F5C 40%, transparent); color: #1F6F5C; }
:root[data-theme="dark"] .gp-n.read { color: #6BC4A6; background: rgba(107,196,166,.12); border-color: rgba(107,196,166,.35); }
.gp-n.cur { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.gp-list { display: grid; gap: 7px; }
.gp-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); color: var(--text); text-align: left; cursor: pointer; }
.gp-row .gp-day { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--soft); color: var(--accent); font: 700 14px var(--font-ui); }
.gp-row .gp-rt { font: 600 14px/1.5 "Noto Sans Gujarati", var(--font-ui); }
.gp-row.cur { border-color: var(--accent); }
.gp-row.read .gp-day { background: #1F6F5C; color: #fff; }
.aa-sheet { z-index: 4000; } .zoom { z-index: 4100; }

/* ---------- Tag editor (rename / delete) ---------- */
.tg-hrow { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; } .tg-hrow .tg-h { margin: 0; }
.tg-editbtn { margin-left: auto; border: 1px solid var(--line); background: var(--card); color: var(--accent); border-radius: 999px; padding: 6px 13px; font: 600 13px var(--font-ui); cursor: pointer; }
.sec-row .tg-editbtn { margin-left: 8px; }
.tg-edit { display: grid; gap: 8px; max-height: 50vh; overflow: auto; margin-top: 4px; }
.sec-row + .tg-edit { max-height: none; margin-top: 10px; }
.tg-erow { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); }
.tg-epen { color: var(--muted); font-size: 14px; }
.tg-ename { flex: 1; min-width: 0; height: 38px; border: 0; border-bottom: 1.5px dashed var(--line); background: transparent; color: var(--text); font: 600 15px var(--font-ui); outline: 0; padding: 0 2px; }
.tg-ename:focus { border-bottom: 1.5px solid var(--accent); }
.tg-ecount { color: var(--muted); font: 600 12px var(--font-ui); min-width: 18px; text-align: right; }
.tg-edel { flex: none; height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: #C0392B; font: 600 12px var(--font-ui); cursor: pointer; white-space: nowrap; }
.tg-edel.armed { background: #C0392B; border-color: #C0392B; color: #fff; }
.tg-erow { overflow: hidden; } .tg-ename { width: auto !important; flex: 1 1 0; }
.tg-edel, .tg-editbtn { width: auto !important; flex: none !important; min-width: 0 !important; margin-top: 0 !important; }
.sec-row .count + .tg-editbtn { margin-left: auto; }

/* ---------- Go to form (dropdowns + number) ---------- */
.gf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; margin-top: 14px; }
.gf-field { display: grid; gap: 8px; align-content: start; min-width: 0; }
.gf-field.wide { grid-column: 1 / -1; }
.gf-lab { font: 500 14px var(--font-ui); color: var(--muted); }
.gf-selbox { position: relative; display: block; }
.gf-selbox::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.gf-sel, .gf-num { width: 100%; height: 54px; padding: 0 40px 0 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 600 16px "Noto Sans Gujarati", var(--font-ui); outline: 0; -webkit-appearance: none; appearance: none; text-overflow: ellipsis; }
.gf-num { padding-right: 16px; font: 600 18px var(--font-ui); }
.gf-sel:focus, .gf-num:focus { border-color: var(--accent); }
.gf-hint { color: var(--muted); font: 500 12px var(--font-ui); margin-top: -2px; }
.gf-prev { margin: 16px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--soft); color: var(--text); font: 600 14px/1.55 "Noto Sans Gujarati", var(--font-ui); min-height: 1.55em; }
.gf-prev:empty { display: none; }
.gf-prev.bad { background: transparent; border: 1px dashed var(--line); color: var(--muted); font-weight: 500; }
.gf-go { width: 100% !important; height: 52px; margin-top: 14px; border: 0; border-radius: 16px; background: var(--accent); color: var(--on-accent); font: 700 16px var(--font-ui); cursor: pointer; }
.gf-go:disabled { opacity: .45; cursor: default; }

/* ---------- Already read subsection ---------- */
.rv-split > [data-rk].is-read, .docs.rv-split > a.doc[data-rk].is-read, .list.rv-split > a.item[data-rk].is-read, .rv-gone { display: none !important; }
.rv-sec { margin-top: 18px; margin-bottom: 24px; }
.rv-sec[hidden] { display: none; }
.rv-done { margin: 0 0 14px; padding: 22px 16px; text-align: center; color: var(--muted); font: 500 14px var(--font-ui); }
.rv-done[hidden] { display: none; }
.rv-head { display: flex; align-items: center; gap: 10px; width: 100% !important; margin: 0 !important; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: 600 15px var(--font-ui); text-align: left; cursor: pointer; }
.rv-ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #1F6F5C; color: #fff; font-size: 13px; flex: none; }
.rv-t { flex: 1; }
.rv-n { color: var(--muted); font-size: 13px; }
.rv-chev { width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: 0 4px 4px 6px; transition: transform .2s; }
.rv-sec.open .rv-chev { transform: rotate(-135deg); margin-bottom: -2px; }
.rv-sec.open .rv-head { border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; }
.rv-body { display: grid; gap: var(--gap, 10px); margin-top: 10px; }
.rv-body:empty { display: none; }
.rv-copy { opacity: .78; }

/* ---------- calmer reading bar: position sits inside the pill; the bar hides while you read down ---------- */
nav.pill-bar > button.pb-pos { position: static !important; transform: none !important; box-shadow: none !important; height: 36px !important; min-width: 58px; padding: 0 10px !important;
  background: transparent !important; color: var(--muted) !important; font: 600 13px var(--font-ui) !important; font-variant-numeric: tabular-nums; border: 0 !important; }
nav.pill-bar > button.pb-pos:active { background: var(--soft) !important; }
nav.pill-bar > button:not(.pb-pos) { width: 44px; }
nav.pbar.pill-bar { transition: transform .25s ease, opacity .2s ease; }
nav.pbar.pill-bar.pb-away { transform: translate(-50%, calc(100% + 30px)); opacity: 0; pointer-events: none; }

/* ---------- One card style everywhere (as in Prasango) ---------- */
.docs > a.doc[data-rk], .rv-body > a.doc { display: flex !important; align-items: center; gap: 12px; padding: 12px 14px; min-height: 64px;
  background: var(--card); border: 1px solid var(--line) !important; border-radius: 18px; color: var(--text); text-decoration: none; }
a.doc[data-rk] .doc-text, .rv-body > a.doc .doc-text { flex: 1; min-width: 0; gap: 2px; }
a.doc[data-rk] .doc-title, .rv-body > a.doc .doc-title { font-weight: 600; font-size: 1rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
a.doc[data-rk] .doc-sub, a.doc[data-rk] .doc-meta, .rv-body > a.doc .doc-sub, .rv-body > a.doc .doc-meta { font-size: .8rem; }
a.doc .no, .rv-body > a .no { flex: none; display: inline-grid; place-items: center; min-width: 3.1em; height: 30px; padding: 0 8px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font: 700 .85em var(--font-ui); font-variant-numeric: tabular-nums; }
a.doc .no.day { height: auto; min-width: 3.1em; padding: 5px 6px; border-radius: 12px; line-height: 1.05; gap: 1px; }
a.doc .no.day b { font-size: 1.05em; } a.doc .no.day small { font-size: .68em; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; opacity: .9; }
a.doc .section-go { color: var(--muted); }
.doc[data-rk].is-read .doc-title::before { content: none; }
a.doc[data-rk].is-read .no, .rv-body > a.doc.rv-copy .no, .rv-body > a.item.rv-copy .no { background: #1F6F5C; color: #fff; }
:root[data-theme="dark"] a.doc[data-rk].is-read .no, :root[data-theme="dark"] .rv-body > a.rv-copy .no { background: #6BC4A6; color: #15120F; }
.rv-body > a.item.rv-copy .no::before { content: "✓ "; }
[data-rk].is-read, .rv-copy { border-left-width: 1px !important; border-left-color: var(--line) !important; }
.rv-copy { opacity: 1; }

/* the reader shows each item on a card, and the next one slides in from the side you moved to */
.reader .r-stage { padding: 14px 12px; }
.reader .r-stage > .article { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px 20px 30px;
  margin: 0 auto calc(96px + env(safe-area-inset-bottom)); max-width: 40rem; }
.reader .r-stage > .article.enter-next { animation: enterNext .24s ease-out; }
.reader .r-stage > .article.enter-prev { animation: enterPrev .24s ease-out; }
.reader .r-stage > .article.enter-fade { animation: enterFade .2s ease-out; }
@media (prefers-reduced-motion: reduce) { .reader .r-stage > .article { animation: none !important; } }

/* ---------- Section tiles: one size and shape everywhere (Today and Library) ---------- */
.hub-search[hidden] { display: none !important; }
.tiles, .tiles.shelf { display: grid !important; grid-template-columns: 1fr 1fr; gap: 12px; overflow: visible; padding-bottom: 0; margin-top: 10px; scroll-snap-type: none; }
.tiles .tile, .tiles .tile.wide, .tiles .tile.wide.pic, .tiles .tile.solo, .tiles .tile.banner,
.tiles .tile:is(:last-child:nth-child(odd), .banner), .tiles.shelf .tile, .tiles.shelf .tile.banner {
  grid-column: auto !important; flex: none !important; display: flex !important; flex-direction: column; align-items: stretch;
  min-height: 0; height: 100%; padding: 0 !important; overflow: hidden; position: relative; border-radius: 18px; }
.tiles .tile img, .tiles .tile .photo, .tiles .tile .cutout, .tiles .tile:is(:last-child:nth-child(odd), .banner) img {
  grid-row: auto !important; display: block; width: 100% !important; height: auto !important; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 25%; }
.tiles .tile .cutout { object-fit: contain; background: color-mix(in srgb, var(--accent) 7%, var(--card)); padding: 8px; }
.tiles .tile .t, .tiles .tile:is(:last-child:nth-child(odd), .banner) .t { grid-column: auto !important; grid-row: auto !important; align-self: stretch !important;
  padding: 11px 14px 0 !important; white-space: normal !important; font: 600 1rem/1.25 var(--font-head) !important;
  display: -webkit-box !important; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.tiles .tile .s, .tiles .tile:is(:last-child:nth-child(odd), .banner) .s { grid-column: auto !important; grid-row: auto !important;
  padding: 4px 30px 14px 14px !important; font-size: .76rem !important; line-height: 1.4; min-height: 0 !important;
  display: -webkit-box !important; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tiles .tile .arr { position: absolute; right: 12px; bottom: 12px; }

/* no empty band between the last thing on a tab page and the tab bar */
body.has-tabs .scroll { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
body.has-tabs .home-wrap, body.has-tabs .hub-page { padding-bottom: 12px !important; }
body.has-tabs .home-wrap > :last-child, body.has-tabs .hub-page > :last-child { margin-bottom: 0 !important; }

/* × inside search boxes */
.sx-wrap { position: relative; display: block; flex: 1 1 auto; min-width: 0; width: 100%; }
.sx-wrap > input[type="search"] { width: 100%; padding-right: 40px !important; }
.sx-wrap > input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.sx { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 28px !important; height: 28px !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important;
  border: 0; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--text) 14%, transparent); color: var(--text); font: 500 18px/1 var(--font-ui); cursor: pointer; }
.sx[hidden] { display: none !important; }

/* one-time highlight tip */
.hl-tip { position: fixed; left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 70; max-width: 460px; margin: 0 auto;
  display: grid; gap: 6px; padding: 16px 16px 14px; border-radius: 18px; background: var(--text); color: var(--bg); box-shadow: 0 18px 40px -14px rgba(0,0,0,.5);
  font: 500 14px/1.5 var(--font-ui); animation: aa-up .3s ease-out; transition: opacity .2s, transform .2s; }
.reader .hl-tip { position: absolute; }
.hl-tip.out { opacity: 0; transform: translateY(10px); }
.hl-tip b { font: 600 1.05em var(--font-head); }
.hl-tip p { margin: 0; } .hl-tip small { opacity: .75; font-size: 12.5px; }
.hl-tip .hl-m { background: #F4D58D; color: #2B2118; padding: 0 4px; border-radius: 4px; }
.hl-ok { justify-self: end; margin-top: 4px; width: auto !important; height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 700 14px var(--font-ui); cursor: pointer; }
.tiles .tile img, .tiles .tile .photo, .tiles .tile .cutout, .tiles .tile:is(:last-child:nth-child(odd), .banner) img { height: 132px !important; max-height: none !important; min-height: 0 !important; aspect-ratio: auto; flex: none; }
.tiles .tile .s, .tiles .tile:is(:last-child:nth-child(odd), .banner) .s { padding: 0 !important; margin: 4px 30px 14px 14px; }
.tiles .tile .t, .tiles .tile:is(:last-child:nth-child(odd), .banner) .t { padding: 0 !important; margin: 11px 14px 0; }
.tiles .tile .t, .tiles .tile:is(:last-child:nth-child(odd), .banner) .t, .tiles .tile:not(:is(:last-child:nth-child(odd), .banner, .banner)) .t { border-top: 0 !important; min-height: 0 !important; margin-top: 12px; }
.tiles .tile .s { margin-top: 3px; }
.rv-sec { margin-top: 4px; }

/* Today: the library shelf scrolls sideways again (tiles keep the same size and shape) */
.tiles.shelf { display: flex !important; overflow-x: auto !important; gap: 12px; padding: 2px 2px 10px; margin: 10px -2px 0; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tiles.shelf .tile, .tiles.shelf .tile.banner, .tiles.shelf .tile:is(:last-child:nth-child(odd), .banner) { flex: 0 0 44% !important; max-width: 200px; height: auto; scroll-snap-align: start; }
/* Already read sits above the list */
.rv-sec { margin: 6px 0 12px; }
.rv-sec .rv-body { margin-bottom: 4px; }
/* (spacing for the read section is set below) */
a.stat.stat-link { color: inherit; text-decoration: none; cursor: pointer; }
a.stat.stat-link:active { background: var(--soft); }
a.stat.stat-link small { color: var(--accent); }
a.row.is-read.plain-read .st small::after { content: none !important; }

/* Already read: tight to the list, and no effect on pages where it's hidden */
.rv-sec { padding-top: 12px !important; padding-bottom: 0 !important; margin: 0 auto !important; }
.rv-sec:not([hidden]) + .docs, .rv-sec:not([hidden]) + .list { padding-top: 10px !important; margin-top: 0 !important; }
.rv-sec .rv-body { margin: 8px 0 0; }
/* number badges never break onto two lines (✓ 782) */
.item .no, a.doc .no, .rv-body > a .no { white-space: nowrap; }
.item[data-rk].is-read .no, .rv-body > a.item.rv-copy .no { min-width: 4.2em; }
.rv-body > a.item .no, .item[data-rk].is-read .no { display: inline-flex !important; align-items: center; justify-content: center; gap: 1px; }
/* inside a list, the read section uses the list's own spacing */
.docs > .rv-sec, .list > .rv-sec { padding: 0 !important; margin: 0 !important; max-width: none; }
.docs > .rv-sec.inner, .list > .rv-sec.inner { padding: 0 !important; }

/* ---------- Saved and Read: the same cards as the section lists ---------- */
a.row.srow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 64px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); color: var(--text); text-decoration: none; }
a.row.srow .st { flex: 1; min-width: 0; display: grid; gap: 2px; }
a.row.srow .st b { font: 600 1rem/1.4 var(--font-gu-serif); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
a.row.srow .st small { font-size: .8rem; color: var(--muted); }
a.row.srow .sgo { color: var(--muted); font-size: 1.2rem; }
a.row.srow .no, a.row.srow.is-read .no { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 2px; min-width: 3.1em; width: auto; height: 30px; padding: 0 9px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font: 700 13.5px var(--font-ui) !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
a.row.srow .no.day, a.row.srow.is-read .no.day { flex-direction: column; height: auto; padding: 5px 7px; border-radius: 12px; line-height: 1.05; gap: 1px; }
a.row.srow .no.day b { font-size: 1.05em; } a.row.srow .no.day small { font-size: .68em; text-transform: uppercase; letter-spacing: .04em; opacity: .9; }
a.row.srow.is-read .no { background: #1F6F5C; color: #fff; }
:root[data-theme="dark"] a.row.srow.is-read .no { background: #6BC4A6; color: #15120F; }
a.row.srow.is-read .no::before { content: "✓"; font-size: 13px !important; }
a.row.srow.is-read .no.day::before { content: none; }
a.row.srow.is-read .st small::after { content: " · Read"; }
a.row.srow.is-read.plain-read .st small::after { content: none !important; }

/* search panel: the × wrapper fits beside the Vishay menu; a softer focus ring */
.filters > .sx-wrap { flex: 1 1 0; width: auto; min-width: 0; }
.filters > select { flex: 1 1 0; min-width: 0; }
#search:focus, .filters input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }

/* Today cover: the handwritten line, coloured like the cover text (light and dark) */
.home-wrap .hero .eyebrow.hand { display: block; width: min(250px, 72%); aspect-ratio: 1762 / 290; height: auto; margin: 0 0 4px;
  background: currentColor; color: var(--cover-text); opacity: .95;
  -webkit-mask: url("img/cover-line.png") left center / contain no-repeat; mask: url("img/cover-line.png") left center / contain no-repeat; }

/* ---------- Today cover: "Paper & ink" ---------- */
:root { --pi-bg: linear-gradient(170deg, #FFFCF5 0%, #F6ECDB 100%); --pi-line: #E6DCCB; --pi-quote: #7A2E2E; --pi-hand: #B4532A; --pi-meta: #8A7A6A; --pi-btn: rgba(43,33,24,.05); --pi-btn-line: rgba(43,33,24,.13); }
:root[data-theme="dark"] { --pi-bg: linear-gradient(170deg, #241D17 0%, #1B1612 100%); --pi-line: #352D25; --pi-quote: #EDC3A9; --pi-hand: #E8956A; --pi-meta: #A89A88; --pi-btn: rgba(255,255,255,.05); --pi-btn-line: rgba(255,255,255,.14); }
.home-wrap .hero { background: var(--pi-bg) !important; color: var(--pi-quote) !important; border: 1px solid var(--pi-line); box-shadow: 0 18px 36px -26px rgba(43,33,24,.45); }
:root[data-theme="dark"] .home-wrap .hero { box-shadow: 0 18px 36px -26px rgba(0,0,0,.8); }
.home-wrap .hero::before { display: none; }
.home-wrap .hero .eyebrow.hand { color: var(--pi-hand) !important; opacity: 1; }
.home-wrap .hero .date, .home-wrap .hero .tag { color: var(--pi-meta) !important; opacity: 1; }
.home-wrap .hero h2.quote { color: var(--pi-quote) !important; text-shadow: none !important; }
.home-wrap .hero .cover-acts button { background: var(--pi-btn) !important; border: 1px solid var(--pi-btn-line) !important; color: var(--pi-quote) !important; }
.home-wrap .hero .cover-acts button.on { background: var(--pi-quote) !important; color: var(--card) !important; border-color: var(--pi-quote) !important; }
.home-wrap .hero .quote-edit { background: var(--pi-btn) !important; color: var(--pi-quote) !important; border: 1px solid var(--pi-btn-line) !important; }


/* tab pages: just enough room under the content to clear the bottom bar */
body:has(.hub-tabs) .scroll { padding-bottom: calc(70px + env(safe-area-inset-bottom)) !important; }
body:has(.hub-tabs) .home-wrap, body:has(.hub-tabs) .hub-page { padding-bottom: 10px !important; }
.tiles.shelf { padding-bottom: 4px !important; }



/* ---------- Dark: "Graphite" — neutral grey, bright saffron ---------- */
:root[data-theme="dark"] {
  --bg: #18191B; --card: #222326; --text: #EDEDED; --muted: #9D9FA4;
  --accent: #FF9F5A; --accent2: #FFB27A; --on-accent: #1A0E05;
  --line: #323337; --band: #18191B; --band-text: #EDEDED; --rule: #5A4636; --on-rule: #FFE3CF;
  --grad: #FF9F5A; --soft: rgba(255, 159, 90, .13);
  --cover: linear-gradient(172deg, #2A2B2E 0%, #222326 100%); --cover-text: #EDEDED;
  --pi-bg: linear-gradient(170deg, #26272A 0%, #202124 100%); --pi-line: #34353A; --pi-quote: #FFD2B0; --pi-hand: #FF9F5A; --pi-meta: #9D9FA4;
  --pi-btn: rgba(255,255,255,.05); --pi-btn-line: rgba(255,255,255,.14);
}
/* read marks: a mint green that sits well on grey */
:root[data-theme="dark"] .item[data-rk].is-read .no, :root[data-theme="dark"] a.doc[data-rk].is-read .no, :root[data-theme="dark"] .rv-body > a.rv-copy .no,
:root[data-theme="dark"] a.row.srow.is-read .no, :root[data-theme="dark"] a.row.is-read .no, :root[data-theme="dark"] nav.pill-bar .pb-read.on, :root[data-theme="dark"] .rv-ico { background: #5ED3A6; color: #0E1A15; }
:root[data-theme="dark"] .gp-n.read { color: #5ED3A6; }

/* ======================================================================
   Phones, tablets and computers
   - phones (any brand): the layout above
   - tablets (700px+): wider pages, 3 sections per row, two-column lists, sheets as centred cards
   - computers (1100px+): the tabs move to a side bar, 4 sections per row, hover states
   ====================================================================== */
@media (hover: hover) and (pointer: fine) {
  .tile, .item, a.doc, a.row, a.cont, .step, .tag-card, .hl-row { transition: border-color .15s, transform .15s, box-shadow .15s; }
  .tile:hover, .item:hover, a.doc:hover, a.row.srow:hover, .tag-card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)) !important; box-shadow: 0 10px 24px -18px rgba(0,0,0,.45); }
  .tile:hover { transform: translateY(-2px); }
  .hub-tabs a:hover:not([aria-current="page"]) { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
  nav.pill-bar > button:hover:not(:disabled) { background: var(--soft); }
  .gp-chip:hover, .gf-sel:hover, .gf-num:hover { border-color: var(--accent); }
}

@media (min-width: 700px) {
  .scroll > .inner, .inner, .top .inner { max-width: 780px; padding-left: 24px; padding-right: 24px; }
  .tiles:not(.shelf) { grid-template-columns: repeat(3, 1fr) !important; gap: 14px; }
  .tiles.shelf .tile, .tiles.shelf .tile.banner, .tiles.shelf .tile:is(:last-child:nth-child(odd), .banner) { flex-basis: 30% !important; max-width: 230px; }
  .tiles .tile img, .tiles .tile .photo, .tiles .tile .cutout { height: 150px !important; }
  /* section lists: two cards per row; headings, chips and "Already read" span the row */
  .docs, main.list { display: grid !important; grid-template-columns: 1fr 1fr; gap: 12px !important; align-items: stretch; }
  .docs > :not(a), main.list > :not(a) { grid-column: 1 / -1; }
  .docs > a.doc[data-rk], main.list > a.item { height: 100%; }
  .rv-body { grid-template-columns: 1fr 1fr; display: grid; gap: 12px; }
  .rv-body:empty { display: none; }
  /* bottom sheets become centred cards */
  .aa-sheet { align-items: center; padding: 24px; }
  .aa-card { border-radius: 24px; padding-bottom: 20px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.45); }
  .aa-grab { display: none; }
  .hub-tabs { left: 50%; right: auto; transform: translateX(-50%); bottom: 14px; width: min(520px, calc(100% - 48px)); border: 1px solid var(--line); border-radius: 22px; padding: 6px; box-shadow: 0 16px 30px -18px rgba(0,0,0,.4); }
  body:has(.hub-tabs) .scroll { padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important; }
  .reader .r-stage { padding: 24px 24px; }
  .reader .r-stage > .article { padding: 34px 40px 40px; }
  .hl-tip { bottom: 96px; }
}

@media (min-width: 1100px) {
  /* side bar in place of the bottom tabs */
  .hub-tabs { left: 0; top: 0; bottom: 0; right: auto; transform: none; width: 232px; flex-direction: column; justify-content: flex-start; gap: 4px;
    padding: 26px 14px; border: 0; border-right: 1px solid var(--line); border-radius: 0; box-shadow: none; background: var(--card); }
  .hub-tabs::before { content: "Towards Him"; display: block; padding: 0 12px 18px; font: 600 1.45rem var(--font-head); color: var(--text); }
  .hub-tabs a { flex: none; max-width: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 14px; font-size: 15px; border-radius: 12px; }
  .hub-tabs a svg { width: 21px; height: 21px; }
  .hub-tabs a .badge, .hub-tabs a b { position: static; margin-left: auto; }
  body.app:has(.hub-tabs) { padding-left: 232px; }
  body.app.reading:has(.hub-tabs) { padding-left: 0; }
  body:has(.hub-tabs) .scroll { padding-bottom: 40px !important; }
  .scroll > .inner, .inner, .top .inner { max-width: 1040px; padding-left: 36px; padding-right: 36px; }
  .scroll > .inner.home-wrap { max-width: 860px; }
  .tiles:not(.shelf) { grid-template-columns: repeat(4, 1fr) !important; }
  .tiles.shelf { display: grid !important; grid-template-columns: repeat(4, 1fr); overflow: visible !important; }
  .tiles.shelf .tile, .tiles.shelf .tile.banner, .tiles.shelf .tile:is(:last-child:nth-child(odd), .banner) { max-width: none; }
  .docs, main.list { grid-template-columns: repeat(2, 1fr); }
  .reader .r-stage > .article { max-width: 46rem; }
  .hl-tip { bottom: 30px; }
}
@media (min-width: 1500px) {
  .docs, main.list { grid-template-columns: repeat(3, 1fr); }
  .rv-body { grid-template-columns: repeat(3, 1fr); }
}
.push-note { margin: 8px 4px 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.push-steps { margin: 6px 0 14px; padding-left: 22px; display: grid; gap: 8px; font-size: 15px; line-height: 1.45; }

/* app logo: beside the greeting on Today, and beside the name in the computer side bar */
.top .bar .app-logo { flex: none; width: 34px; height: 34px; border-radius: 9px; margin-right: 2px; box-shadow: 0 3px 8px -3px rgba(43,33,24,.35); }
@media (min-width: 1100px) {
  .top .bar .app-logo { display: none; }
  .hub-tabs::before { content: "Towards Him"; display: flex; align-items: center; padding-left: 58px; min-height: 40px; white-space: nowrap; font-size: 1.3rem !important;
    background: url("img/icons/th-favicon-64.png") 12px center / 36px 36px no-repeat; }
}

/* The installed app (home-screen icon):
   - the phone's home-bar space is added once, by the tab bar, not by the page as well (it left a gap under the tabs)
   - on iPhone/iPad, iOS 26 blurs the strip under the status bar, so the header is solid and starts a little lower */
body.app { padding-bottom: 0 !important; }
.ios-app .top { background: var(--band) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.ios-app .top.compact { padding-top: calc(18px + env(safe-area-inset-top)) !important; }
.ios-app .top:not(.compact) { padding-top: calc(22px + env(safe-area-inset-top)) !important; }
.ios-app .r-top { padding-top: calc(18px + env(safe-area-inset-top)) !important; }

/* ======================================================================
   Admin portal (redesign): same look as the app; the main area scrolls
   ====================================================================== */
body.portal { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
body.portal .pt-shell { height: 100%; min-height: 0; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
body.portal .pt-main { height: 100%; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; max-width: none; padding: 0 0 60px; }
body.portal .pt-head, body.portal .pt-view { max-width: 1000px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
body.portal .pt-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; margin-bottom: 6px; padding-top: calc(22px + env(safe-area-inset-top)); padding-bottom: 14px;
  background: color-mix(in srgb, var(--bg) 94%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
body.portal .pt-back { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: var(--card); color: var(--text); text-decoration: none; }
body.portal .pt-ht small { display: block; color: var(--muted); font: 600 11px var(--font-ui); letter-spacing: .12em; text-transform: uppercase; }
body.portal .pt-head h1 { margin: 0; font: 600 1.75rem/1.15 var(--font-head); color: var(--text); }
body.portal .pt-view { display: grid; gap: 16px; } body.portal .pt-view > div { display: grid; gap: 16px; }

/* side bar (computer) */
body.portal .pt-side { position: static; height: 100%; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; padding: calc(24px + env(safe-area-inset-top)) 14px 18px; border-right: 1px solid var(--line); background: var(--card); }
body.portal .pt-logo { display: flex; align-items: center; gap: 11px; padding: 0 8px; color: var(--text); text-decoration: none; }
body.portal .pt-logo img { border-radius: 10px; box-shadow: 0 3px 8px -3px rgba(0,0,0,.3); }
body.portal .pt-logo b { display: block; font: 600 1.12rem/1.1 var(--font-head); } body.portal .pt-logo small { color: var(--muted); font: 600 11.5px var(--font-ui); }
body.portal .pt-nav { display: grid; gap: 4px; }
body.portal .pt-nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: var(--muted); text-decoration: none; font: 600 15px var(--font-ui); }
body.portal .pt-nav a svg { width: 21px; height: 21px; flex: none; }
body.portal .pt-nav a[aria-current="page"] { color: var(--accent); background: var(--soft); }
body.portal .pt-nav .badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font: 700 11px var(--font-ui); font-style: normal; }
body.portal .pt-me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--soft); }
body.portal .pt-me b { display: block; font-size: 14px; } body.portal .pt-me small { color: var(--muted); font-size: 12px; }

/* cards, rows, figures */
body.portal .pt-hello { margin: 4px 0 0; font: 600 1.2rem var(--font-head); color: var(--text); }
body.portal .pt-date { margin: -12px 0 4px; color: var(--muted); font-size: 13.5px; }
body.portal .pt-card { padding: 18px; border-radius: 20px; border: 1px solid var(--line); background: var(--card); display: grid; gap: 10px; box-shadow: none; }
body.portal .pt-card h2 { margin: 0; font: 600 1.15rem var(--font-head); color: var(--text); }
body.portal .pt-ch { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
body.portal .pt-ch a { color: var(--accent); font: 600 13.5px var(--font-ui); text-decoration: none; }
body.portal .pt-count { min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font: 700 13px var(--font-ui); }
body.portal .pt-needs.hot { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--card)), var(--card) 70%); }
body.portal .pt-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
body.portal .pt-stat { display: grid; gap: 2px; align-content: start; padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--card); color: var(--text); text-decoration: none; }
body.portal .pt-stat b { font: 600 1.9rem/1 var(--font-head); color: var(--text); margin-bottom: 6px; }
body.portal .pt-stat span { font: 600 13.5px var(--font-ui); } body.portal .pt-stat small { color: var(--muted); font-size: 12px; line-height: 1.35; }
body.portal .pt-two { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
body.portal .pt-col { display: grid; gap: 16px; }
body.portal .pt-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); color: var(--text); text-decoration: none; text-align: left; font: inherit; cursor: pointer; }
body.portal .pt-row + .pt-row { margin-top: 0; }
body.portal .pt-av { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--accent); font: 700 15px var(--font-ui); }
body.portal .pt-av svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body.portal .pt-av.warn { background: var(--accent); color: var(--on-accent); }
body.portal .pt-av.big { width: 46px; height: 46px; font-size: 18px; }
body.portal .pt-rt { flex: 1; min-width: 0; display: grid; gap: 2px; }
body.portal .pt-rt b { font: 600 15px/1.35 var(--font-ui); } body.portal .pt-rt small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.portal .pt-go { flex: none; color: var(--accent); font: 700 13px var(--font-ui); }
body.portal .pt-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
body.portal .pt-tag { padding: 2px 8px; border-radius: 999px; font: 700 10.5px var(--font-ui); background: var(--text); color: var(--bg); }
body.portal .pt-tag.soft { background: var(--soft); color: var(--accent); } body.portal .pt-tag.warn { background: #F2B544; color: #3A2604; } body.portal .pt-tag.bad { background: #C0392B; color: #fff; }
body.portal .pt-tag.admin { background: var(--accent); color: var(--on-accent); }
body.portal .pt-kv { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; } body.portal .pt-kv:last-of-type { border-bottom: 0; }
body.portal .pt-muted { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; } body.portal .pt-muted.small, body.portal .small { font-size: 12.5px; }
body.portal .pt-empty { margin: 0; padding: 26px 10px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; }
body.portal .pt-links { display: flex; flex-wrap: wrap; gap: 8px; }
body.portal .pt-btn { display: inline-flex; align-items: center; justify-content: center; height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); font: 700 14px var(--font-ui); text-decoration: none; cursor: pointer; width: auto; }
body.portal .pt-btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
body.portal .pt-btn.small { height: 34px; padding: 0 12px; font-size: 13px; }
body.portal .pt-btn.danger { background: transparent; color: #C0392B; border-color: color-mix(in srgb, #C0392B 40%, var(--line)); }
body.portal .pt-btn.armed { background: #C0392B; color: #fff; border-color: #C0392B; }
body.portal .pt-btn:disabled { opacity: .5; }
body.portal .pt-tools { display: flex; gap: 10px; align-items: center; } body.portal .pt-tools .sx-wrap { flex: 1; }
body.portal .pt-search, body.portal .pt-in { width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 13px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 500 15px var(--font-ui); outline: 0; box-sizing: border-box; }
body.portal textarea.pt-in { min-height: 84px; resize: vertical; font-family: "Noto Sans Gujarati", var(--font-ui); line-height: 1.5; }
body.portal .pt-search:focus, body.portal .pt-in:focus { border-color: var(--accent); }
body.portal .pt-chips { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; flex-wrap: nowrap; }
body.portal .pt-chips::-webkit-scrollbar { display: none; }
body.portal .pt-chip { flex: none; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: 600 13px var(--font-ui); cursor: pointer; width: auto; }
body.portal .pt-chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
body.portal .pt-list { display: grid; gap: 8px; }
body.portal .pt-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
body.portal .pt-line:last-child { border-bottom: 0; } body.portal .pt-line b { display: block; font-size: 14.5px; } body.portal .pt-line small { color: var(--muted); font-size: 12.5px; }
body.portal .pt-tog { flex: none; width: 50px; height: 30px; border-radius: 999px; border: 0; background: color-mix(in srgb, var(--text) 18%, transparent); position: relative; cursor: pointer; padding: 0; }
body.portal .pt-tog::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
body.portal .pt-tog.on { background: #1F6F5C; } body.portal .pt-tog.on::after { transform: translateX(20px); }
body.portal .pt-alert { padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, #F2B544 18%, var(--card)); border: 1px solid color-mix(in srgb, #F2B544 45%, var(--line)); font-size: 13.5px; line-height: 1.5; }
body.portal .pt-alert b { display: block; margin-bottom: 2px; } body.portal .pt-alert .link { background: none; border: 0; padding: 0; color: var(--accent); font: 700 13.5px var(--font-ui); cursor: pointer; text-decoration: underline; }
body.portal .pt-q { display: grid; gap: 8px; padding-top: 6px; } body.portal .pt-q + .pt-q { border-top: 1px solid var(--line); padding-top: 14px; }
body.portal .pt-q small { color: var(--muted); }
body.portal .pt-sub { display: grid; gap: 8px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); }
body.portal .pt-prev { margin: 0; font: 500 14px/1.6 "Noto Sans Gujarati", var(--font-ui); color: var(--text); }
body.portal .pt-acts { display: flex; flex-wrap: wrap; gap: 8px; }
body.portal .pt-fld { display: grid; gap: 7px; } body.portal .pt-fld > span { font: 700 11.5px var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
body.portal .pt-checks { display: grid; gap: 7px; } body.portal .pt-checks.off { opacity: .45; pointer-events: none; }
body.portal .pt-check { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-radius: 13px; border: 1px solid var(--line); background: var(--bg); font: 500 14.5px var(--font-ui); cursor: pointer; }
body.portal .pt-check input { width: 20px; height: 20px; accent-color: var(--accent); }
/* notification preview */
body.portal .pt-npv { display: flex; gap: 11px; align-items: flex-start; padding: 12px 14px; border-radius: 18px; background: color-mix(in srgb, var(--text) 7%, var(--card)); box-shadow: inset 0 0 0 1px var(--line); }
body.portal .pt-npv img { width: 38px; height: 38px; border-radius: 9px; flex: none; }
body.portal .pt-npv div { display: grid; gap: 1px; min-width: 0; } body.portal .pt-npv small { color: var(--muted); font: 600 10.5px var(--font-ui); letter-spacing: .06em; }
body.portal .pt-npv b { font: 700 14px var(--font-ui); } body.portal .pt-npv span { font-size: 13.5px; color: var(--text); overflow-wrap: anywhere; }
/* person sheet: name on top, details scroll, actions stay at the bottom */
body.portal dialog.pt-sheet { width: min(580px, calc(100vw - 32px)); max-height: min(88vh, 900px); padding: 0; border: 0; border-radius: 24px; background: var(--card); color: var(--text); display: none; overflow: hidden; box-shadow: 0 30px 70px -20px rgba(0,0,0,.5); }
body.portal dialog.pt-sheet[open] { display: flex; flex-direction: column; }
body.portal dialog.pt-sheet::backdrop { background: rgba(15,12,8,.45); }
body.portal .pt-sh { flex: none; display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
body.portal .pt-sh h2 { flex: 1; margin: 0; font: 600 1.25rem var(--font-head); }
body.portal .pt-x { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; }
body.portal .pt-sbody { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px; display: grid; gap: 14px; align-content: start; }
body.portal .pt-foot { flex: none; padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--card); }
body.portal .pt-foot .pt-btn:first-child { flex: 1 1 140px; }
body.portal .pt-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100; padding: 11px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font: 600 14px var(--font-ui); box-shadow: 0 10px 24px -10px rgba(0,0,0,.5); }

/* phones and small tablets: tab bar at the bottom like the app; the person sheet slides up from the bottom */
@media (max-width: 860px) {
  body.portal .pt-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  body.portal .pt-main { grid-row: 1; padding-bottom: 24px; }
  body.portal .pt-side { grid-row: 2; position: static; height: auto; overflow: visible; flex-direction: row; gap: 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 94%, transparent); }
  body.portal .pt-logo, body.portal .pt-me { display: none; }
  body.portal .pt-nav { flex: 1; display: flex; justify-content: space-around; gap: 2px; }
  body.portal .pt-nav a { flex: 1; max-width: 110px; flex-direction: column; justify-content: center; gap: 3px; padding: 7px 4px; font-size: 11.5px; border-radius: 14px; }
  body.portal .pt-nav .badge { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; min-width: 18px; height: 18px; font-size: 10.5px; }
  body.portal .pt-head, body.portal .pt-view { padding-left: 16px; padding-right: 16px; }
  body.portal .pt-head { padding-top: calc(14px + env(safe-area-inset-top)); padding-bottom: 10px; }
  body.portal .pt-head h1 { font-size: 1.5rem; }
  body.portal .pt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.portal .pt-stat { padding: 14px; } body.portal .pt-stat b { font-size: 1.6rem; }
  body.portal .pt-two { grid-template-columns: minmax(0, 1fr); }
  body.portal .pt-card { padding: 16px; border-radius: 18px; }
  body.portal dialog.pt-sheet { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 24px 24px 0 0; }
}
.ios-app body.portal .pt-head { padding-top: calc(26px + env(safe-area-inset-top)); }
body.portal .pt-head { justify-content: flex-start; }
body.portal .pt-ht { flex: 1; min-width: 0; text-align: left; }
body.portal .pt-logo small { display: block; padding: 0; margin: 0; background: none; border: 0; border-radius: 0; text-transform: none; letter-spacing: 0; color: var(--muted); font: 600 12px var(--font-ui); }
body.portal .pt-subh { display: grid; gap: 2px; }
body.portal .pt-subh b { font: 600 15.5px/1.4 "Noto Sans Gujarati", var(--font-ui); }
body.portal .pt-subh small { color: var(--muted); font-size: 12.5px; }

/* ---------- locked section tiles (not signed in, or not given yet) ---------- */
.tile.locked { cursor: pointer; }
.tile.locked img { filter: grayscale(1) contrast(.9); opacity: .55; }
.tile.locked .t { color: var(--muted); }
.tile.locked .s { opacity: .8; color: var(--muted) !important; min-height: 0; padding-bottom: 2px; }
.tile.locked .lk { display: block; padding: 0 34px 14px 14px; font: 600 12.5px var(--font-ui, inherit); color: var(--accent); }
.tile.wide.locked .lk { padding: 6px 0 0; }
.tile.locked .arr { color: var(--muted); }
.tile.locked:active { transform: scale(.985); }
dialog.lk-sheet { border: 0; border-radius: 22px; padding: 26px 22px 20px; width: min(380px, calc(100vw - 32px)); background: var(--card); color: inherit; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog.lk-sheet::backdrop { background: rgba(20,16,10,.38); }
.lk-sheet .lk-ic { width: 46px; height: 46px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.lk-sheet .lk-ic svg { width: 21px; height: 21px; }
.lk-sheet h2 { margin: 0 0 6px; font-size: 19px; }
.lk-sheet p { margin: 0 0 16px; color: var(--muted); line-height: 1.5; font-size: 14.5px; }
.lk-sheet .lk-acts { display: grid; gap: 8px; }

/* ================= Admin portal (body.adm) ================= */
body.adm { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; background: var(--bg); color: var(--text); font-family: var(--font-ui); }
.ad-shell { flex: 1; min-height: 0; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.ad-side { display: flex; flex-direction: column; gap: 18px; padding: calc(20px + env(safe-area-inset-top)) 12px 16px; border-right: 1px solid var(--line); background: var(--card); min-height: 0; overflow-y: auto; }
.ad-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: var(--text); text-decoration: none; }
.ad-brand img { border-radius: 9px; }
.ad-brand b { display: block; font: 600 16px var(--font-head); }
.ad-brand small { display: block; color: var(--muted); font: 600 12px var(--font-ui); }
.ad-nav { display: grid; gap: 2px; }
.ad-nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--muted); text-decoration: none; font: 600 14px var(--font-ui); }
.ad-nav a:hover { background: var(--bg); color: var(--text); }
.ad-nav a[aria-current="page"] { background: var(--soft); color: var(--accent); }
.ad-nav svg, .ad-out svg, .ad-back svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ad-nav .only-narrow { display: none; }
.ad-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 700 11.5px/20px var(--font-ui); font-style: normal; text-align: center; }
.ad-out { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: var(--muted); text-decoration: none; font: 600 13.5px var(--font-ui); }
.ad-out:hover { background: var(--bg); color: var(--text); }
.ad-main { min-width: 0; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.ad-head { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: calc(14px + env(safe-area-inset-top)) 32px 12px; background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.ios-app body.adm .ad-head { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
.ad-back { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: var(--card); color: var(--text); }
.ad-ht { flex: 1; min-width: 0; }
.ad-ht small { display: block; color: var(--muted); font: 600 12px var(--font-ui); }
.ad-ht h1 { margin: 0; font: 600 24px/1.2 var(--font-head); color: var(--text); -webkit-text-fill-color: currentColor; background: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-hx { flex: none; display: flex; gap: 8px; }
.ad-view { padding: 20px 32px 64px; max-width: 1040px; }
.ad-page { display: grid; gap: 16px; }
.ad-muted { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.ad-muted.lead { font-size: 14.5px; }
.ad-hello p { margin: 0; font: 600 22px/1.3 var(--font-head); }
.ad-hello small { color: var(--muted); font-size: 13.5px; }
.ad-card { display: grid; gap: 10px; padding: 18px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); min-width: 0; }
.ad-card.hot { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 8%, transparent); }
.ad-ch { display: flex; align-items: center; gap: 10px; }
.ad-ch h2 { margin: 0; flex: 1; font: 600 17px var(--font-head); color: var(--text); -webkit-text-fill-color: currentColor; background: none; }
.ad-ch a { color: var(--accent); font: 600 13px var(--font-ui); text-decoration: none; }
.ad-count { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); font: 700 12px/22px var(--font-ui); text-align: center; }
.ad-count.hot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ad-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ad-stat { display: grid; gap: 3px; padding: 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.ad-stat b { font: 600 30px/1 var(--font-head); }
.ad-stat span { font: 600 13.5px var(--font-ui); }
.ad-stat small { color: var(--muted); font-size: 12px; }
.ad-stat.hot { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--card)); }
.ad-stat.hot b { color: var(--accent); }
.ad-stat:hover, .ad-row:hover, .ad-sec:hover { border-color: color-mix(in srgb, var(--muted) 60%, var(--line)); }
.ad-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ad-col { display: grid; gap: 16px; min-width: 0; }
.ad-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); color: var(--text); text-decoration: none; min-width: 0; }
a.ad-rt { color: inherit; text-decoration: none; }
.ad-rt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ad-rt b { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-rt small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-chev { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ad-av { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--accent); font: 700 15px var(--font-ui); }
.ad-av svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ad-av.warn { background: color-mix(in srgb, #F4A62A 22%, var(--card)); color: #A15C00; }
.ad-av.big { width: 64px; height: 64px; font-size: 24px; }
.ad-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.ad-tag { padding: 2px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); font: 700 11px/16px var(--font-ui); white-space: nowrap; }
.ad-tag.soft { background: var(--soft); border-color: transparent; color: var(--accent); }
.ad-tag.dark { background: var(--text); border-color: var(--text); color: var(--bg); }
.ad-tag.warn { background: #F4A62A; border-color: #F4A62A; color: #2B1A00; }
.ad-tag.bad { background: #C0392B; border-color: #C0392B; color: #fff; }
.ad-tag.ok { background: color-mix(in srgb, #1F6F5C 16%, var(--card)); border-color: transparent; color: #1F6F5C; }
.ad-item { display: grid; gap: 10px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); }
.ad-ih { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; min-width: 0; }
.ad-ih .ad-rt b { white-space: normal; }
.ad-prev { margin: 0; font: 14px/1.75 "Noto Sans Gujarati", var(--font-ui); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.ad-prev.clip { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.ad-link { justify-self: start; padding: 0; border: 0; background: none; color: var(--accent); font: 600 13px var(--font-ui); cursor: pointer; }
.ad-more { justify-self: start; color: var(--accent); font: 600 13.5px var(--font-ui); text-decoration: none; }
.ad-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ad-acts.end { justify-content: flex-end; }
.ad-acts.tight { flex-wrap: nowrap; gap: 6px; }
.ad-acts .ad-in { flex: 1 1 180px; width: auto; }
.ad-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--text); background: var(--text); color: var(--bg); font: 600 14px var(--font-ui); text-decoration: none; cursor: pointer; white-space: nowrap; }
.ad-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.ad-btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.ad-btn.danger { background: transparent; color: #C0392B; border-color: color-mix(in srgb, #C0392B 40%, transparent); }
.ad-btn.armed { background: #C0392B; color: #fff; border-color: #C0392B; }
.ad-btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.ad-btn:disabled { opacity: .55; cursor: default; }
.ad-in, .ad-search { width: 100%; min-height: 44px; padding: 10px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: 500 15px var(--font-ui); outline: 0; box-sizing: border-box; }
.ad-search { background: var(--card); }
.ad-item .ad-in { background: var(--card); }
textarea.ad-in { resize: vertical; line-height: 1.6; }
.ad-in.gu, .gu { font-family: "Noto Sans Gujarati", var(--font-ui); }
.ad-in:focus, .ad-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--soft); }
.ad-fld { display: grid; gap: 6px; }
.ad-fld > span { font: 600 12.5px var(--font-ui); color: var(--muted); }
.ad-inrow { display: flex; gap: 8px; }
.ad-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.ad-chips::-webkit-scrollbar { display: none; }
.ad-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font: 600 13px var(--font-ui); cursor: pointer; }
.ad-chip i, .ad-seg i { font-style: normal; font-weight: 700; font-size: 11.5px; opacity: .75; }
.ad-chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.ad-segs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.ad-seg { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 12px; border-radius: 10px; color: var(--muted); font: 600 13.5px var(--font-ui); text-decoration: none; white-space: nowrap; }
.ad-seg.on { background: var(--soft); color: var(--accent); }
.ad-seg i { min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--on-accent); opacity: 1; line-height: 18px; text-align: center; }
.ad-list { display: grid; gap: 8px; }
.ad-line { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.ad-line:last-child { border-bottom: 0; }
.ad-line > div:first-child, .ad-line > img + div { flex: 1; min-width: 0; }
.ad-line b { display: block; font-size: 14.5px; font-weight: 600; }
.ad-line small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.ad-line.ask small { color: #A15C00; font-weight: 600; }
.ad-sim { flex: none; width: 40px; height: 40px; border-radius: 10px; object-fit: cover; object-position: 50% 25%; background: var(--soft); }
.ad-tog { flex: none; width: 48px; height: 28px; border-radius: 14px; border: 0; background: var(--line); position: relative; cursor: pointer; padding: 0; }
.ad-tog::after { content: ""; position: absolute; left: 2px; top: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: left .2s; }
.ad-tog.on { background: #1F6F5C; }
.ad-tog.on::after { left: 22px; }
.ad-tog:disabled { opacity: .45; cursor: default; }
.ad-kv { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 14px; }
.ad-kv:last-of-type { border-bottom: 0; }
.ad-kv span { flex: 1; color: var(--muted); }
.ad-kv b { font-weight: 600; }
.ad-kv b.ok { color: #1F6F5C; } .ad-kv b.bad { color: #C0392B; }
.ad-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.ad-alert { padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, #F4A62A 16%, var(--card)); border: 1px solid color-mix(in srgb, #F4A62A 45%, transparent); font-size: 13.5px; line-height: 1.55; }
.ad-alert.info { background: var(--soft); border-color: transparent; }
.ad-alert b { display: block; margin-bottom: 2px; }
.ad-empty { display: grid; justify-items: center; gap: 4px; padding: 22px 10px; text-align: center; }
.ad-empty svg { width: 34px; height: 34px; padding: 8px; border-radius: 50%; background: color-mix(in srgb, #1F6F5C 14%, var(--card)); fill: none; stroke: #1F6F5C; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; box-sizing: content-box; margin-bottom: 4px; }
.ad-empty b { font-size: 15px; } .ad-empty small { color: var(--muted); font-size: 13px; }
.ad-pcard { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 16px; }
.ad-pcard h2 { margin: 0 0 2px; font: 600 20px var(--font-head); color: var(--text); -webkit-text-fill-color: currentColor; background: none; }
.ad-sec { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); color: var(--text); text-decoration: none; }
.ad-sec img { flex: none; width: 56px; height: 56px; border-radius: 12px; object-fit: cover; object-position: 50% 25%; }
.ad-sec .ad-rt small { white-space: normal; }
.ad-shero { grid-template-columns: 88px minmax(0, 1fr); align-items: start; gap: 16px; }
.ad-shero img { width: 88px; height: 88px; border-radius: 16px; object-fit: cover; object-position: 50% 25%; }
.ad-npv { display: flex; gap: 12px; padding: 12px 14px; border-radius: 18px; background: color-mix(in srgb, var(--text) 6%, var(--bg)); }
.ad-npv img { width: 38px; height: 38px; border-radius: 9px; }
.ad-npv div { display: grid; gap: 2px; min-width: 0; font-size: 13.5px; }
.ad-npv small { color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.ad-npv b, .ad-npv span { overflow-wrap: anywhere; }
.ad-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 200; max-width: calc(100vw - 32px); padding: 11px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font: 600 14px var(--font-ui); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.adm .form-err { margin: 0; }
@media (max-width: 1100px) { .ad-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .ad-shell { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .ad-main { grid-row: 1; }
  .ad-side { grid-row: 2; flex-direction: row; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); overflow: visible; }
  .ad-brand, .ad-out { display: none; }
  .ad-nav { width: 100%; grid-auto-flow: column; grid-auto-columns: 1fr; }
  .ad-nav .only-wide { display: none; }
  .ad-nav .only-narrow { display: flex; }
  .ad-nav a { flex-direction: column; gap: 3px; padding: 7px 0 5px; font-size: 11.5px; }
  .ad-nav a:hover { background: none; }
  .ad-nav a[aria-current="page"] { background: none; }
  .ad-nav a[aria-current="page"] svg { background: var(--soft); border-radius: 12px; padding: 3px 14px; box-sizing: content-box; }
  .ad-badge { position: absolute; top: 2px; left: calc(50% + 8px); margin: 0; min-width: 18px; height: 18px; font-size: 10.5px; line-height: 18px; padding: 0 5px; }
  .ad-head { padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
  .ad-ht h1 { font-size: 21px; }
  .ad-view { padding: 14px 14px 40px; }
  .ad-two { grid-template-columns: 1fr; }
  .ad-card { padding: 15px; border-radius: 18px; }
  .ad-stat b { font-size: 26px; }
  .ad-hx .ad-btn span { display: none; }
  .ad-hx .ad-btn { width: 38px; padding: 0; border-radius: 50%; min-height: 38px; }
}
@media (max-width: 420px) { .ad-inrow { flex-wrap: wrap; } .ad-inrow .ad-btn { flex: 1; } .ad-shero { grid-template-columns: 64px minmax(0, 1fr); } .ad-shero img { width: 64px; height: 64px; } }
@media (max-width: 860px) { .ad-toast { bottom: calc(80px + env(safe-area-inset-bottom)); } }
body.adm .ad-ht h1, body.adm .ad-ch h2, body.adm .ad-pcard h2 { color: var(--text) !important; -webkit-text-fill-color: var(--text) !important; background: none !important; }
:root[data-theme="dark"] body.adm .ad-av.warn { background: color-mix(in srgb, #F4A62A 22%, var(--card)); color: #F6C46B; }
:root[data-theme="dark"] body.adm .ad-line.ask small { color: #F6C46B; }
:root[data-theme="dark"] body.adm .ad-tag.ok { color: #6FD3B0; }
:root[data-theme="dark"] body.adm .ad-kv b.ok { color: #6FD3B0; }

/* ---- portal polish: flat lists inside cards, solid header, thin scrollbars, centred column ---- */
body.adm .ad-main { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; scrollbar-gutter: stable; }
body.adm .ad-main::-webkit-scrollbar, body.adm .ad-side::-webkit-scrollbar { width: 10px; }
body.adm .ad-main::-webkit-scrollbar-thumb, body.adm .ad-side::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 40%, transparent); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
body.adm .ad-main::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--muted) 65%, transparent); }
body.adm .ad-main::-webkit-scrollbar-track { background: transparent; }
body.adm .ad-side { scrollbar-width: none; }
body.adm .ad-head { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 1px solid var(--line); }
body.adm .ad-head, body.adm .ad-view { padding-left: max(32px, calc((100% - 1000px) / 2)); padding-right: max(32px, calc((100% - 1000px) / 2)); }
body.adm .ad-view { max-width: none; }
/* rows inside a card are a plain list with dividers, not boxes inside boxes */
body.adm .ad-card :is(.ad-row, .ad-item, .ad-sec) { border: 0; border-radius: 12px; background: none; padding: 12px 10px; margin: 0 -10px; }
body.adm .ad-card :is(.ad-row, .ad-item, .ad-sec) + :is(.ad-row, .ad-item, .ad-sec) { border-top: 1px solid var(--line); border-radius: 0; }
body.adm .ad-card a:is(.ad-row, .ad-sec):hover { background: color-mix(in srgb, var(--text) 4%, transparent); border-radius: 12px; }
body.adm .ad-card a:is(.ad-row, .ad-sec):hover + :is(.ad-row, .ad-item, .ad-sec) { border-top-color: transparent; }
body.adm .ad-listcard { padding: 6px 18px; gap: 0; }
body.adm .ad-listcard .ad-list { gap: 0; }
body.adm .ad-listcard .ad-list > .ad-muted { padding: 10px 0 4px; }
body.adm .ad-list > .ad-row + .ad-row { border-top: 1px solid var(--line); }
body.adm .ad-item { gap: 10px; }
body.adm .ad-item .ad-acts .ad-btn { min-height: 38px; font-size: 13.5px; }
body.adm .ad-item .ad-prev { padding-left: 52px; }
body.adm .ad-item > .ad-in, body.adm .ad-item > .ad-link, body.adm .ad-item > .ad-acts, body.adm .ad-item > .ad-muted { margin-left: 52px; }
body.adm .ad-sec img { width: 52px; height: 52px; }
body.adm .ad-card > .ad-muted + :is(.ad-row, .ad-item, .ad-sec, .ad-line) { margin-top: 2px; }
body.adm .ad-stat { transition: border-color .15s; }
@media (min-width: 700px) {
  body.adm .ad-item.inline { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  body.adm .ad-item.inline > .ad-acts { margin-left: 0; flex-wrap: nowrap; }
}
@media (max-width: 860px) {
  body.adm .ad-head, body.adm .ad-view { padding-left: 16px; padding-right: 16px; }
  body.adm .ad-view { padding-left: 14px; padding-right: 14px; }
  body.adm .ad-listcard { padding: 4px 14px; }
  body.adm .ad-item .ad-prev, body.adm .ad-item > .ad-in, body.adm .ad-item > .ad-link, body.adm .ad-item > .ad-acts, body.adm .ad-item > .ad-muted { margin-left: 0; padding-left: 0; }
}
body.adm .ad-more.btn { padding: 10px 0 4px; border: 0; background: none; cursor: pointer; text-align: left; }
body.adm .ad-row[hidden], body.adm .ad-item[hidden] { display: none !important; }
body.adm .ad-pcard .ad-muted { overflow-wrap: anywhere; }
body.adm .ad-pcard > div { min-width: 0; }
body.adm .ad-item > .ad-in { width: calc(100% - 52px); }
@media (max-width: 860px) { body.adm .ad-item > .ad-in { width: 100%; } }
body.adm .ad-fld > .ad-btn { justify-self: start; }

/* ---- portal v3: simple Home, tiles, folded options ---- */
body.adm .ad-ht small[hidden] { display: none; }
body.adm .ad-back[hidden] { display: none; }
body.adm .ad-head.tab { padding-top: calc(16px + env(safe-area-inset-top)); padding-bottom: 14px; }
body.adm .ad-hello { margin: 0; color: var(--muted); font: 500 15px var(--font-ui); }
body.adm .ad-card.hot { border-color: color-mix(in srgb, #F4A62A 55%, var(--line)); box-shadow: none; }
body.adm .ad-go { flex: none; color: var(--accent); font: 600 14px var(--font-ui); white-space: nowrap; }
body.adm .ad-row .ad-acts.tight { flex: none; }
body.adm .ad-sum { color: var(--text) !important; opacity: .75; }
body.adm .ad-sum.warn { color: #A15C00 !important; opacity: 1; font-weight: 600; }
:root[data-theme="dark"] body.adm .ad-sum.warn { color: #F6C46B !important; }
body.adm .ad-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
body.adm .ad-tile { display: grid; gap: 4px; align-content: start; padding: 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
body.adm .ad-tile .ad-av { margin-bottom: 6px; }
body.adm .ad-tile b { font-size: 15px; font-weight: 600; }
body.adm .ad-tile small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
body.adm .ad-tile:hover { border-color: color-mix(in srgb, var(--muted) 60%, var(--line)); }
body.adm .ad-note { justify-self: center; color: var(--muted); font-size: 13.5px; text-decoration: none; padding: 4px 0; }
body.adm .ad-note:hover { color: var(--text); }
body.adm .ad-kind { margin: 0; color: var(--accent); font: 700 12px var(--font-ui); letter-spacing: .04em; text-transform: uppercase; }
body.adm .ad-card > h2.gu { margin: 0; font: 700 18px/1.5 "Noto Sans Gujarati", var(--font-ui); color: var(--text); -webkit-text-fill-color: var(--text); background: none; }
body.adm .ad-read { white-space: pre-wrap; font: 15.5px/1.85 "Noto Sans Gujarati", var(--font-ui); overflow-wrap: anywhere; }
body.adm .ad-fold { padding: 0; gap: 0; }
body.adm .ad-fold > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 16px 18px; cursor: pointer; }
body.adm .ad-fold > summary::-webkit-details-marker { display: none; }
body.adm .ad-fold > summary > span { flex: 1; display: grid; gap: 2px; font: 600 15px var(--font-ui); }
body.adm .ad-fold > summary small { color: var(--muted); font: 500 12.5px var(--font-ui); }
body.adm .ad-fold > summary .ad-chev { transition: transform .2s; }
body.adm .ad-fold[open] > summary .ad-chev { transform: rotate(90deg); }
body.adm .ad-foldin { display: grid; gap: 14px; padding: 0 18px 18px; border-top: 1px solid var(--line); padding-top: 14px; }
body.adm .ad-end { flex: none; display: inline-flex; align-items: center; gap: 8px; }
body.adm .ad-sim.big { width: 48px; height: 48px; border-radius: 12px; }
body.adm .ad-muted.center { text-align: center; }
body.adm .ad-shero { grid-template-columns: 72px minmax(0, 1fr); align-items: center; }
body.adm .ad-shero img { width: 72px; height: 72px; }
body.adm .ad-link { font-size: 13.5px; }
@media (max-width: 1100px) { body.adm .ad-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  body.adm .ad-tile { padding: 14px; }
  body.adm .ad-fold > summary { padding: 14px 15px; }
  body.adm .ad-foldin { padding: 14px 15px 15px; }
}
body.adm .ad-card.hot .ad-rt small, body.adm .ad-sum { white-space: normal; }
body.adm .ad-muted a { color: var(--accent); font-weight: 600; }
body.adm .ad-main { overflow-anchor: none; }
.ad-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.ad-btn.gu { height: auto; padding-block: 8px; text-align: left; white-space: normal; line-height: 1.4; }
.q-who { display: grid; gap: 8px; margin-top: 6px; }
.q-when { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.q-when input { flex: 1 1 150px; min-width: 0; }
.qchip { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 12px; padding: 10px 14px; font: inherit; font-size: .95rem; text-align: left; cursor: pointer; }
.qchip.small { padding: 8px 12px; text-align: center; }
.qchip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* Prasango, Purvashram, Sambandhyog: the heading line stays at the start; the pencil floats so the text keeps its full width */
.post .body > .lead { text-align: left; text-align-last: auto; margin: 0 0 1.1em; }
.post .body.ie-whole { padding-right: 18px; }
.post .body.ie-whole > .ie-pen { position: relative; float: right; top: auto; right: auto; margin: 0 0 6px 10px; }
/* back from an item: its row in the list flashes once */
.just-back { animation: just-back 1.6s ease-out; }
@keyframes just-back { 0%, 35% { background: color-mix(in srgb, var(--accent) 16%, var(--card)); } 100% { background: inherit; } }
html.as-reader .post .body.ie-whole { padding-right: 18px !important; }

/* read progress on a subsection row, and Library's "Inside the sections" */
.sub-prog { display: flex; align-items: center; gap: 8px; margin-top: 6px; font: 600 11.5px var(--font-ui); color: var(--muted); }
.sub-prog .sp-bar { flex: 1; max-width: 120px; height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--line) 80%, transparent); overflow: hidden; }
.sub-prog .sp-bar i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.sub-prog.done { color: var(--accent); }
.subs-blk { margin-top: 14px; }
.subs-h { display: flex; align-items: baseline; gap: 6px; color: var(--text); text-decoration: none; font: 600 1.02em var(--font-head); margin: 0 2px 8px; }
.subs-h .subs-go { color: var(--muted); }
.subs-row { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; scroll-snap-type: x proximity; min-height: 74px; }
.subs-row::-webkit-scrollbar { display: none; }
.sub-chip { flex: none; scroll-snap-align: start; display: grid; align-content: start; gap: 2px; width: 150px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--text); text-decoration: none; }
.sub-chip b { font: 700 14px var(--font-gu-serif, inherit); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-chip small { color: var(--muted); font: 500 11.5px var(--font-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-chip .sub-prog { margin-top: 8px; }
.sub-chip .sub-prog .sp-bar { max-width: none; }
.doc.year .sub-prog { color: rgba(255,255,255,.92); }
.doc.year .sub-prog .sp-bar { background: rgba(255,255,255,.3); }
.doc.year .sub-prog .sp-bar i { background: #fff; }
/* the admin viewing the app as someone else */
.va-bar { position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top) + 8px); z-index: 5000; display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 20px); padding: 7px 8px 7px 14px; border-radius: 999px; background: #1C1A17; color: #fff; font: 600 12.5px var(--font-ui); box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.va-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.va-bar button { flex: none; border: 0; border-radius: 999px; padding: 6px 12px; background: #E8956A; color: #1C1A17; font: 700 12.5px var(--font-ui); cursor: pointer; }

/* admin Home numbers */
body.adm .ad-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
body.adm .ad-kpi { display: grid; align-content: start; gap: 2px; padding: 14px 14px 12px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); color: var(--text); text-decoration: none; min-width: 0; }
body.adm .ad-kpi b { font: 700 26px/1.1 var(--font-head); letter-spacing: -.01em; }
body.adm .ad-kpi span { font: 600 13px var(--font-ui); }
body.adm .ad-kpi small { color: var(--muted); font: 500 11.5px/1.35 var(--font-ui); overflow-wrap: anywhere; }
body.adm .ad-kpi.hot { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 7%, var(--card)); }
body.adm .ad-kpi.hot b { color: var(--accent); }
body.adm .ad-bar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 9px 0; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
body.adm .ad-bar:last-child { border-bottom: 0; }
body.adm .ad-bt { display: grid; gap: 6px; min-width: 0; }
body.adm .ad-bt b { font: 600 14px var(--font-ui); }
body.adm .ad-bt i { display: block; height: 6px; border-radius: 6px; background: color-mix(in srgb, var(--line) 80%, transparent); overflow: hidden; }
body.adm .ad-bt em { display: block; height: 100%; border-radius: 6px; background: var(--accent); }
body.adm .ad-bar small { color: var(--muted); font: 600 12.5px var(--font-ui); white-space: nowrap; }
@media (max-width: 720px) { body.adm .ad-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* admin Sections, like the Library */
body.adm .ad-gh { margin: 18px 4px 10px; font: 600 15px var(--font-head); color: var(--text); }
body.adm .ad-gh:first-child { margin-top: 0; }
body.adm .ad-gh.in { margin: 16px 0 4px; font-size: 14px; color: var(--accent); }
body.adm .ad-stiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
body.adm .ad-stile { position: relative; display: grid; grid-template-rows: auto 1fr; border-radius: 18px; overflow: hidden; background: var(--card); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
body.adm .ad-sti { display: block; aspect-ratio: 16 / 10; background: color-mix(in srgb, var(--accent) 6%, var(--card)); overflow: hidden; }
body.adm .ad-sti img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
body.adm .ad-sti.cut img { object-fit: contain; object-position: center bottom; }
body.adm .ad-st { display: grid; gap: 3px; padding: 11px 13px 13px; }
body.adm .ad-st b { font: 600 15px var(--font-head); }
body.adm .ad-st small { color: var(--muted); font: 500 12px/1.4 var(--font-ui); }
body.adm .ad-stile > .ad-tag { position: absolute; top: 8px; right: 8px; }
/* shared-items list: the title opens the item */
body.adm .ad-pl { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
body.adm a.ad-pl:hover b { color: var(--accent); }
body.adm .ad-pl > span:last-child { display: grid; gap: 2px; min-width: 0; }
body.adm .ad-pl small { color: var(--muted); font-size: 12.5px; }
body.adm .ad-no { flex: none; min-width: 34px; height: 28px; padding: 0 7px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--accent) 10%, var(--card)); color: var(--accent); font: 700 12.5px var(--font-ui); }
body.adm .ad-addplace { display: grid; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
body.adm .ad-addplace .ad-inrow .ad-in { flex: 1 1 0; min-width: 0; }
body.adm .ad-addplace > .ad-btn { justify-self: start; }
html.va-on .ad-shell { padding-top: 0; }

/* Pragat Hari: PIN screen, watermark, no copying or printing */
.ph-lock { position: fixed; inset: 0; z-index: 9500; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.ph-card { width: min(380px, 100%); display: grid; gap: 12px; justify-items: center; text-align: center; padding: 28px 22px; border-radius: 24px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(0,0,0,.12); }
.ph-ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, var(--card)); color: var(--accent); }
.ph-card h2 { margin: 0; font: 600 1.4em var(--font-head); }
.ph-t { margin: 0; color: var(--muted); font-size: .92em; line-height: 1.55; }
.ph-f { display: grid; gap: 10px; width: 100%; }
.ph-in { width: 100%; box-sizing: border-box; min-height: 50px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); color: var(--text); text-align: center; font: 700 22px var(--font-ui); letter-spacing: .4em; }
.ph-a { width: 100%; display: grid; } .ph-a .auth-btn { width: 100%; }
.ph-back { color: var(--muted); font-size: .85em; }
.ph-wm { position: fixed; inset: 0; z-index: 9000; pointer-events: none; background-repeat: repeat; }
body.secure #docs, body.secure .r-stage, body.secure #r-stage, body.secure .article { -webkit-user-select: none !important; user-select: none !important; -webkit-touch-callout: none; }
body.secure #r-share { display: none !important; }
@media print { body.secure > * { display: none !important; } body.secure::after { content: "Pragat Hari can't be printed."; display: block; padding: 40px; font: 600 16px sans-serif; } }

/* admin: "What they can edit" */
body.adm .ad-ep { display: grid; gap: 10px; }
body.adm .ad-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
body.adm .ad-choices.tight { gap: 8px; }
body.adm .ad-choice { display: flex; align-items: flex-start; gap: 10px; text-align: left; padding: 12px 13px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; cursor: pointer; }
body.adm .ad-choice b { display: block; font: 600 14px var(--font-ui); }
body.adm .ad-choice small { display: block; margin-top: 2px; color: var(--muted); font: 500 12px/1.4 var(--font-ui); }
body.adm .ad-choice.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--card)); }
body.adm .ad-radio { flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--line); box-sizing: border-box; }
body.adm .ad-choice.on .ad-radio { border: 5px solid var(--accent); }
body.adm .ad-place { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
body.adm .ad-place > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
body.adm .ad-place b { font: 600 14px var(--font-ui); }
body.adm .ad-place small { color: var(--muted); font-size: 12.5px; }
body.adm .ad-pin { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 10%, var(--card)); color: var(--accent); }
body.adm .ad-pin svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
body.adm .ad-addplace > b { font: 600 15px var(--font-head); }
body.adm .ad-addplace .ad-inrow { align-items: center; }
body.adm .ad-preview { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 5%, var(--bg)); }
body.adm .ad-preview > small { color: var(--text); font: 600 12.5px var(--font-ui); }
body.adm .ad-pv { display: flex; align-items: center; gap: 10px; font-size: 13.5px; min-width: 0; }
body.adm .ad-pv .gu { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.adm .ad-pv.dots { padding-left: 12px; color: var(--muted); }
@media (max-width: 520px) { body.adm .ad-choices { grid-template-columns: 1fr; } }

/* admin: sharing single items */
body.adm .ad-who { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
body.adm .ad-wcol { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); }
body.adm .ad-wcol small { color: var(--muted); font: 600 11.5px/1.35 var(--font-ui); }
body.adm .ad-wcol b { font: 700 24px/1.15 var(--font-head); }
body.adm .ad-wcol span { color: var(--muted); font-size: 12.5px; }
body.adm .ad-wcol.hl { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
body.adm .ad-wcol.hl b { color: var(--accent); }
body.adm .ad-share { flex: none; display: inline-flex; padding: 3px; border-radius: 12px; background: color-mix(in srgb, var(--line) 55%, var(--card)); }
body.adm .ad-share button { border: 0; border-radius: 9px; padding: 7px 10px; background: transparent; color: var(--muted); font: 600 12px var(--font-ui); cursor: pointer; white-space: nowrap; }
body.adm .ad-share button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
body.adm .ad-shrow.pub .ad-share button.on { background: var(--accent); color: var(--on-accent); }
body.adm .ad-ul { margin: 0 0 10px; padding-left: 18px; display: grid; gap: 8px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
body.adm .ad-ul b { color: var(--text); }
.ph-in::placeholder { letter-spacing: normal; font: 500 15px var(--font-ui); }
body.adm .ad-shrow { flex-wrap: wrap; row-gap: 8px; }
body.adm .ad-shrow .ad-pl { flex: 1 1 220px; }
body.adm .ad-shrow .ad-share { margin-left: auto; }
@media (max-width: 560px) { body.adm .ad-shrow .ad-share { margin-left: 46px; } }
.ph-lock.ph-cover { background: var(--bg); }
.hub-title { touch-action: manipulation; }
.ph-link { justify-self: center; margin-top: 8px; border: 0; background: none; color: var(--accent); font: 600 .9em var(--font-ui); cursor: pointer; padding: 6px; }
.hide-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 12px; }
.hide-wrap .hide-bar { margin: 0; }
.hide-wrap > span { color: var(--muted); font: 600 .78rem var(--font-ui); margin-left: 4px; }
.share-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: color-mix(in srgb, var(--line) 60%, var(--card)); }
.share-seg button { border: 0; border-radius: 999px; padding: 6px 12px; background: transparent; color: var(--muted); font: 600 .78rem var(--font-ui); cursor: pointer; }
.share-seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.share-seg button.on[data-on="1"] { background: var(--accent); color: var(--on-accent); }
html.as-reader .hide-wrap { display: none !important; }
.share-row { display: inline-flex; align-items: center; gap: 8px; }
.hide-wrap .share-row > span { color: var(--muted); font: 600 .78rem var(--font-ui); }
/* admin share page: groups as tiles */
body.adm .ad-gtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 4px; }
body.adm .ad-gtile { position: relative; display: grid; gap: 3px; align-content: start; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); color: var(--text); text-decoration: none; min-width: 0; }
body.adm .ad-gtile b { font: 600 15px var(--font-head); overflow: hidden; text-overflow: ellipsis; }
body.adm .ad-gtile small { color: var(--muted); font: 500 12px var(--font-ui); }
body.adm .ad-gtile i { justify-self: start; margin-top: 4px; padding: 2px 8px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font: 700 11px var(--font-ui); font-style: normal; }
body.adm .ad-gtile.some { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
body.adm .ad-gtile.hl { margin: 4px 0 12px; background: color-mix(in srgb, var(--accent) 8%, var(--card)); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
body.adm .ad-gtile.hl b { color: var(--accent); }
body.adm .ad-gtile i.hid { background: color-mix(in srgb, #b91c1c 14%, var(--card)); color: #b91c1c; }
body.adm .ad-share.three button { padding: 7px 9px; }
body.adm .ad-share button.on.hid { background: #b91c1c; color: #fff; }
body.adm .ad-shrow.hid .ad-pl b { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, #b91c1c 50%, transparent); }
.share-seg button.on[data-v="hid"] { background: #b91c1c; color: #fff; }
.share-seg button.on[data-v="all"] { background: var(--accent); color: var(--on-accent); }
body.adm .ad-share button.on.all { background: var(--accent); color: var(--on-accent); }
