/* ============================================================
   KSN Reddy Sir — Memorial Portal
   Quiet ivory by day, deep black by night. Sandalwood accent.
   ============================================================ */

:root {
  --bg: #f5f4f0;
  --bg-2: #eceae4;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --text: #25231f;
  --text-2: #5d5951;
  --muted: #8a857b;
  --line: #e2dfd7;
  --line-2: #d3cfc5;
  --accent: #9c7a45;
  --accent-ink: #7d5f31;
  --accent-soft: rgba(156, 122, 69, 0.1);
  --ok: #3f7a55;
  --danger: #a4493d;
  --shadow: 0 1px 2px rgba(30, 25, 15, 0.04), 0 8px 28px rgba(30, 25, 15, 0.06);
  --radius: 14px;
  --radius-sm: 9px;
  --serif-display: 'Cormorant Garamond', 'Noto Serif Telugu', Georgia, serif;
  --serif: 'Noto Serif', 'Noto Serif Telugu', 'Noto Serif Devanagari', Georgia, serif;
  --sans: 'Inter', 'Noto Sans Telugu', 'Noto Sans Devanagari', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --maxw: 1180px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090a; --bg-2: #111112; --surface: #141415; --surface-2: #19191a;
    --text: #ebe7df; --text-2: #b8b2a7; --muted: #857f75; --line: #262527; --line-2: #333235;
    --accent: #c9a86a; --accent-ink: #d9bb82; --accent-soft: rgba(201, 168, 106, 0.1);
    --ok: #7fb893; --danger: #df8a7e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #09090a; --bg-2: #111112; --surface: #141415; --surface-2: #19191a;
  --text: #ebe7df; --text-2: #b8b2a7; --muted: #857f75; --line: #262527; --line-2: #333235;
  --accent: #c9a86a; --accent-ink: #d9bb82; --accent-soft: rgba(201, 168, 106, 0.1);
  --ok: #7fb893; --danger: #df8a7e;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--serif); font-size: 17px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  transition: background-color .4s ease, color .4s ease;
}
img, video, iframe { max-width: 100%; display: block; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 1em; height: 1em; flex: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 12px; height: 58px; }
.brand { font-family: var(--serif-display); font-size: 19px; font-weight: 600; letter-spacing: .01em; color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { font-family: var(--sans); font-size: 10.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); display: block; line-height: 1; margin-bottom: 3px; }
.nav { display: none; gap: 4px; margin-left: auto; }
.nav a { font-family: var(--sans); font-size: 13.5px; color: var(--text-2); text-decoration: none; padding: 8px 11px; border-radius: 8px; }
.nav a:hover { color: var(--text); background: var(--bg-2); }
@media (min-width: 900px) { .nav { display: flex; } }
.top-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
@media (min-width: 900px) { .top-actions { margin-left: 8px; } }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: 18px;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }

/* ---------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-size: 14.5px; font-weight: 500; line-height: 1;
  padding: 12px 18px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text); text-decoration: none; min-height: 44px;
  transition: background .2s, border-color .2s, transform .15s, color .2s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.btn.small { font-size: 13px; padding: 8px 13px; min-height: 36px; }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn svg { font-size: 18px; }

/* ---------------- announcement */
.notice {
  background: var(--accent-soft); border-bottom: 1px solid var(--line);
  font-family: var(--sans); font-size: 14px; color: var(--text-2); text-align: center; padding: 10px 16px;
}
.notice[hidden] { display: none; }

/* ---------------- hero */
.hero { text-align: center; padding: 44px 0 36px; position: relative; }
@media (min-width: 720px) { .hero { padding: 72px 0 56px; } }
.portrait {
  width: 180px; height: 224px; margin: 0 auto 26px; position: relative;
  border-radius: 999px 999px 18px 18px; padding: 6px;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 35%, transparent));
}
@media (min-width: 720px) { .portrait { width: 220px; height: 276px; } }
.portrait-inner {
  width: 100%; height: 100%; border-radius: 999px 999px 13px 13px; overflow: hidden;
  background: var(--bg-2); display: grid; place-items: center;
  border: 3px solid var(--bg);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.15) contrast(1.02); }
.monogram { font-family: var(--serif-display); font-size: 56px; color: var(--accent); letter-spacing: .04em; }
.garland { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); width: 120%; pointer-events: none; }
.eyebrow { font-family: var(--sans); font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.hero h1 {
  font-family: var(--serif-display); font-weight: 500; font-size: clamp(34px, 8vw, 62px);
  line-height: 1.06; margin: 0 0 8px; letter-spacing: -.005em; text-wrap: balance;
}
.native { font-family: 'Noto Serif Telugu', var(--serif); font-size: 20px; color: var(--text-2); margin: 0 0 6px; }
.known { font-family: var(--serif-display); font-style: italic; font-size: 22px; color: var(--accent-ink); margin: 0 0 14px; }
.dates { font-family: var(--sans); font-size: 14px; letter-spacing: .08em; color: var(--text-2); display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 6px; }
.dates .sep { width: 28px; height: 1px; background: var(--line-2); }
.tagline { font-size: 15.5px; color: var(--muted); margin: 0 0 22px; }
.quote { font-family: var(--serif-display); font-style: italic; font-size: clamp(20px, 3.6vw, 26px); color: var(--text-2); max-width: 640px; margin: 0 auto 30px; line-height: 1.4; text-wrap: balance; }
.quote::before, .quote::after { color: var(--accent); }
.quote::before { content: '“'; } .quote::after { content: '”'; }

/* tributes */
.tributes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 560px; margin: 0 auto; }
.tribute {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px 12px;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  font-family: var(--sans); color: var(--text-2); position: relative; overflow: visible;
  transition: border-color .25s, transform .2s, background .25s;
}
.tribute:hover { border-color: var(--accent); color: var(--text); }
.tribute svg { font-size: 30px; color: var(--accent); }
.tribute .t-label { font-size: 12.5px; font-weight: 500; line-height: 1.25; }
.tribute .t-count { font-family: var(--serif-display); font-size: 22px; color: var(--text); line-height: 1; font-variant-numeric: lining-nums; }
.tribute.done { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.tribute.pop { animation: pop .5s ease; }
@keyframes pop { 40% { transform: scale(1.05); } }
.tribute.lamp.done .flame { fill: var(--accent); animation: flicker 2.4s infinite ease-in-out; transform-origin: 12px 8px; }
@keyframes flicker { 0%,100% { transform: scale(1); opacity: 1; } 45% { transform: scale(.94, 1.05); opacity: .85; } }
.hero-links { display: flex; justify-content: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.petal { position: fixed; pointer-events: none; z-index: 60; width: 14px; height: 14px; border-radius: 70% 0 70% 0; background: #e3a23b; opacity: .95; }

/* ---------------- sections */
section { padding: 44px 0; }
@media (min-width: 720px) { section { padding: 64px 0; } }
.sec-head { text-align: center; margin-bottom: 26px; }
.sec-head h2 { font-family: var(--serif-display); font-weight: 500; font-size: clamp(28px, 5vw, 40px); margin: 0 0 6px; line-height: 1.15; }
.sec-head p { color: var(--muted); margin: 0; font-size: 15.5px; }
.ornament { display: block; margin: 0 auto 12px; width: 84px; height: 12px; color: var(--accent); }

/* ---------------- slider */
.gallery-sec { background: #0c0c0d; color: #e9e5dc; padding: 0; }
.slider { position: relative; max-width: 1400px; margin: 0 auto; }
.slides {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; position: relative; aspect-ratio: 4 / 3; max-height: 78vh; background: #0c0c0d; display: grid; place-items: center; }
@media (min-width: 720px) { .slide { aspect-ratio: 16 / 9; } }
.slide img { width: 100%; height: 100%; object-fit: contain; }
.slide .bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: blur(28px) brightness(.35); transform: scale(1.1); }
.slide > *:not(.bg) { position: relative; }
.slide iframe, .slide video { width: 100%; height: 100%; border: 0; background: #000; }
.slide .play {
  position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.5); background: rgba(0,0,0,.45); color: #fff; font-size: 28px;
  display: grid; place-items: center; backdrop-filter: blur(4px);
}
.slide .play svg { margin-left: 4px; }
.caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 16px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,.72)); color: #eee9df; font-size: 15px; text-align: center;
  font-family: var(--serif);
}
.caption:empty { display: none; }
.s-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.4); color: #fff; font-size: 20px; display: none; place-items: center; }
.s-nav.prev { left: 14px; } .s-nav.next { right: 14px; }
@media (hover: hover) and (min-width: 720px) { .s-nav { display: grid; } }
.dots { display: flex; justify-content: center; gap: 7px; padding: 14px 0 18px; flex-wrap: wrap; }
.dots button { width: 7px; height: 7px; border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,.28); transition: background .3s, width .3s; }
.dots button[aria-current="true"] { background: #c9a86a; width: 20px; border-radius: 4px; }
.gallery-empty { text-align: center; color: #8d877d; padding: 60px 16px; font-size: 15px; }
.thumbs { display: flex; gap: 6px; overflow-x: auto; padding: 0 16px 18px; scrollbar-width: none; justify-content: flex-start; }
.thumbs::-webkit-scrollbar { display: none; }
@media (min-width: 720px) { .thumbs { justify-content: center; } }
.thumbs button { flex: none; width: 64px; height: 44px; border-radius: 6px; overflow: hidden; border: 1px solid transparent; padding: 0; background: #1b1b1c center/cover; opacity: .55; transition: opacity .3s, border-color .3s; }
.thumbs button[aria-current="true"] { opacity: 1; border-color: #c9a86a; }

/* ---------------- share + activity layout */
.share-grid { display: grid; gap: 22px; }
@media (min-width: 980px) { .share-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 32px; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.form-card { padding: 22px 18px; }
@media (min-width: 720px) { .form-card { padding: 32px 34px; } }
.form-card h2 { font-family: var(--serif-display); font-weight: 500; font-size: clamp(26px, 4.4vw, 34px); margin: 0 0 4px; line-height: 1.15; }
.form-card .lede { color: var(--muted); margin: 0 0 22px; font-size: 15px; }

.field { margin-bottom: 18px; }
.field > label, .field > .label { display: block; font-family: var(--sans); font-size: 13.5px; font-weight: 500; color: var(--text-2); margin-bottom: 7px; }
.field .req { color: var(--accent); }
.hint { font-family: var(--sans); font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line-2); background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 12px 13px; font-family: var(--sans); font-size: 16px; line-height: 1.4; min-height: 46px;
  transition: border-color .2s, background .2s;
}
textarea.input { font-family: var(--serif); font-size: 17px; line-height: 1.7; min-height: 150px; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
select.input { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.row2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .row2 { grid-template-columns: 1fr 1fr; } }
.row2 .field { margin-bottom: 0; }
.row2 + .field, .row2 + .row2 { margin-top: 18px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--sans); font-size: 14px; padding: 9px 14px; border-radius: 999px; min-height: 40px;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2);
  display: inline-flex; align-items: center; gap: 7px; transition: all .2s;
}
.chip svg { font-size: 17px; }
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

.group-title { font-family: var(--sans); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 26px 0 14px; display: flex; align-items: center; gap: 12px; }
.group-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.drop {
  border: 1px dashed var(--line-2); border-radius: var(--radius-sm); padding: 14px; display: flex; align-items: center; gap: 12px;
  background: var(--surface-2); font-family: var(--sans); font-size: 14px; color: var(--text-2); width: 100%; text-align: left;
}
.drop:hover { border-color: var(--accent); }
.drop svg { font-size: 26px; color: var(--accent); }
.previews { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.previews .pv { position: relative; width: 76px; height: 76px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.previews img { width: 100%; height: 100%; object-fit: cover; }
.previews .rm { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; display: grid; place-items: center; padding: 0; }

.check { display: flex; gap: 11px; align-items: flex-start; font-family: var(--sans); font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { width: 19px; height: 19px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }

.privacy {
  display: flex; gap: 12px; padding: 13px 14px; border-radius: var(--radius-sm); background: var(--accent-soft);
  font-family: var(--sans); font-size: 13px; line-height: 1.55; color: var(--text-2); margin: 18px 0 20px;
}
.privacy svg { font-size: 19px; color: var(--accent-ink); margin-top: 1px; }
.form-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.form-foot .btn { flex: 1 1 auto; }
@media (min-width: 560px) { .form-foot .btn { flex: 0 0 auto; } }
.err { color: var(--danger); font-family: var(--sans); font-size: 13.5px; margin: 0 0 12px; }
.err:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.thanks { text-align: center; padding: 30px 8px; }
.thanks svg { font-size: 44px; color: var(--accent); margin: 0 auto 10px; display: block; }
.thanks h3 { font-family: var(--serif-display); font-weight: 500; font-size: 30px; margin: 0 0 8px; }
.thanks p { color: var(--text-2); margin: 0 0 20px; }

/* activity */
.activity { padding: 20px 18px; }
@media (min-width: 980px) { .activity { position: sticky; top: 76px; } }
.activity h3 { font-family: var(--serif-display); font-weight: 500; font-size: 24px; margin: 0 0 14px; }
.totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 16px; }
.totals div { text-align: center; padding: 10px 2px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.totals b { display: block; font-family: var(--serif-display); font-size: 22px; font-weight: 600; line-height: 1.1; font-variant-numeric: lining-nums; }
.totals span { font-family: var(--sans); font-size: 10.5px; color: var(--muted); letter-spacing: .04em; }
.feed { list-style: none; margin: 0; padding: 0; max-height: 440px; overflow: auto; scrollbar-width: thin; }
.feed li { display: flex; gap: 11px; padding: 11px 0; border-top: 1px solid var(--line); font-family: var(--sans); font-size: 13.5px; line-height: 1.45; color: var(--text-2); }
.feed li:first-child { border-top: 0; }
.feed .fi { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-size: 17px; flex: none; }
.feed b { color: var(--text); font-weight: 600; }
.feed small { display: block; color: var(--muted); font-size: 12px; }
.feed a { color: inherit; text-decoration: none; }
.empty { color: var(--muted); font-family: var(--sans); font-size: 14px; text-align: center; padding: 18px 0; }

/* ---------------- memories wall */
.filters { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 24px; }
.filters .input { width: auto; min-width: 0; flex: 1 1 160px; max-width: 260px; min-height: 42px; padding: 9px 12px; font-size: 14.5px; }
.filters select.input { padding-right: 34px; }
.wall { columns: 1; column-gap: 18px; }
@media (min-width: 680px) { .wall { columns: 2; } }
@media (min-width: 1040px) { .wall { columns: 3; } }
.post { break-inside: avoid; margin-bottom: 18px; padding: 22px 20px 18px; display: block; }
.post.featured { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.post .tag { display: inline-flex; align-items: center; gap: 6px; font-family: var(--sans); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 10px; }
.post .tag svg { font-size: 15px; }
.post .msg { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 14px; font-size: 16.5px; color: var(--text); }
.post.poem .msg { font-family: var(--serif-display); font-style: italic; font-size: 20px; line-height: 1.55; text-align: center; }
.post .msg.clamp { display: -webkit-box; -webkit-line-clamp: 9; -webkit-box-orient: vertical; overflow: hidden; }
.more { background: none; border: 0; padding: 0; font-family: var(--sans); font-size: 13px; color: var(--accent-ink); margin: -8px 0 14px; }
.post .pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px; margin-bottom: 14px; }
.post .pics button { padding: 0; border: 0; border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: var(--bg-2); }
.post .pics img { width: 100%; height: 100%; object-fit: cover; }
.post .who { border-top: 1px solid var(--line); padding-top: 12px; font-family: var(--sans); }
.post .who b { font-size: 14.5px; font-weight: 600; display: block; }
.post .who span { font-size: 12.5px; color: var(--muted); display: block; line-height: 1.5; }
.wall-more { text-align: center; margin-top: 10px; }

/* ---------------- life */
.life-grid { display: grid; gap: 26px; }
@media (min-width: 900px) { .life-grid { grid-template-columns: 1.1fr .9fr; gap: 48px; } }
.story p { margin: 0 0 16px; font-size: 17.5px; color: var(--text); }
.story p:first-child::first-letter { font-family: var(--serif-display); font-size: 3.4em; float: left; line-height: .9; padding: 6px 10px 0 0; color: var(--accent); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 1px solid var(--line-2); }
.timeline li { position: relative; padding: 0 0 22px 6px; }
.timeline li::before { content: ''; position: absolute; left: -28.5px; top: 8px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.timeline .yr { font-family: var(--sans); font-size: 12px; letter-spacing: .1em; color: var(--accent-ink); font-weight: 600; }
.timeline h4 { font-family: var(--serif-display); font-weight: 600; font-size: 21px; margin: 0 0 2px; line-height: 1.25; }
.timeline p { margin: 0; color: var(--text-2); font-size: 15.5px; }

.insts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 30px; }
.inst { padding: 16px 16px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.inst b { font-family: var(--serif-display); font-size: 19px; font-weight: 600; display: block; line-height: 1.25; }
.inst span { font-family: var(--sans); font-size: 12.5px; color: var(--muted); letter-spacing: .03em; }
.society { text-align: center; font-family: var(--sans); font-size: 13px; color: var(--muted); margin-top: 16px; }

/* ---------------- footer */
footer { border-top: 1px solid var(--line); padding: 36px 0 44px; text-align: center; color: var(--muted); font-family: var(--sans); font-size: 13.5px; }
footer .sig { font-family: var(--serif-display); font-style: italic; font-size: 21px; color: var(--text-2); margin-bottom: 10px; }
footer a { color: var(--muted); }

/* ---------------- lightbox */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(5,5,6,.94); display: none; align-items: center; justify-content: center; padding: 16px; }
.lightbox.open { display: flex; }
.lightbox img { max-height: 88vh; max-width: 100%; object-fit: contain; border-radius: 4px; }
.lightbox .icon-btn { position: absolute; top: 14px; right: 14px; background: rgba(0,0,0,.4); border-color: rgba(255,255,255,.25); color: #fff; }

/* ---------------- toast */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 30px); opacity: 0; z-index: 90;
  background: var(--text); color: var(--bg); font-family: var(--sans); font-size: 14px; padding: 12px 18px; border-radius: 12px;
  box-shadow: var(--shadow); transition: all .3s; max-width: calc(100vw - 32px); pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); color: #fff; }

/* skeleton */
.loading { color: var(--muted); font-family: var(--sans); font-size: 14px; text-align: center; padding: 40px 0; }

/* fade-in */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   ADMIN
   ============================================================ */
.admin body, body.admin { font-family: var(--sans); font-size: 15px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: 100%; max-width: 380px; padding: 30px 26px; }
.login h1 { font-family: var(--serif-display); font-weight: 500; font-size: 30px; margin: 0 0 4px; }
.login p { color: var(--muted); margin: 0 0 22px; font-size: 14px; }

.a-top { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.a-top .wrap { display: flex; align-items: center; gap: 10px; height: 58px; }
.a-top .brand { font-size: 18px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 58px; z-index: 29; }
.tabs::-webkit-scrollbar { display: none; }
.tabs .wrap { display: flex; gap: 2px; }
.tabs button { flex: none; border: 0; background: none; padding: 13px 14px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; font-family: var(--sans); display: inline-flex; gap: 7px; align-items: center; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 500; }
.badge { font-size: 11.5px; font-weight: 600; background: var(--danger); color: #fff; border-radius: 999px; padding: 1px 7px; line-height: 1.5; }
.badge:empty, .badge[data-n="0"] { display: none; }
.panel { padding: 24px 0 60px; }
.panel[hidden] { display: none; }
.panel h2 { font-family: var(--serif-display); font-weight: 500; font-size: 28px; margin: 0 0 4px; }
.panel .sub { color: var(--muted); margin: 0 0 20px; font-size: 14px; }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
.kpi { padding: 16px; }
.kpi .k { font-size: 12.5px; color: var(--muted); }
.kpi .v { font-family: var(--serif-display); font-size: 36px; font-weight: 600; line-height: 1.1; margin: 4px 0 2px; font-variant-numeric: lining-nums tabular-nums; }
.kpi .d { font-size: 12.5px; color: var(--text-2); }
.kpi.alert .v { color: var(--danger); }
.dash-grid { display: grid; gap: 14px; }
@media (min-width: 900px) { .dash-grid { grid-template-columns: 1.4fr 1fr; } }
.dash-card { padding: 18px; }
.dash-card h3 { font-size: 14.5px; font-weight: 600; margin: 0 0 14px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 8px; }
.bars .b { flex: 1; display: flex; flex-direction: column-reverse; gap: 2px; height: 100%; position: relative; }
.bars .seg { border-radius: 3px 3px 0 0; min-height: 0; }
.bars .seg.p { background: var(--accent); }
.bars .seg.t { background: color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 3px 3px 0 0; }
.bars .b:hover::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--text); color: var(--bg); font-size: 11.5px; padding: 4px 7px; border-radius: 6px; margin-bottom: 4px; z-index: 2; }
.bar-labels { display: flex; gap: 4px; font-size: 10.5px; color: var(--muted); margin-top: 6px; }
.bar-labels span { flex: 1; text-align: center; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) 36px; gap: 10px; align-items: center; font-size: 13px; margin-bottom: 9px; }
.hbar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hbar .track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--bg-2); margin-top: -4px; }
.hbar .fill { height: 100%; border-radius: 3px; background: var(--accent); }
.hbar .num { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.toolbar .input { width: auto; flex: 1 1 180px; min-height: 40px; padding: 8px 12px; font-size: 14px; }
.seg-ctl { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px; background: var(--surface); flex-wrap: wrap; }
.seg-ctl button { border: 0; background: none; padding: 7px 12px; border-radius: 999px; font-size: 13px; color: var(--text-2); }
.seg-ctl button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

.mod-list { display: grid; gap: 12px; }
.mod { padding: 18px; }
.mod-head { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 10px; }
.mod-head b { font-size: 15.5px; }
.mod-meta { font-size: 13px; color: var(--muted); }
.status { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; letter-spacing: .03em; }
.status.Pending { background: color-mix(in srgb, #d8a13a 20%, transparent); color: #9a6a12; }
.status.Approved { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.status.Rejected, .status.Hidden { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
:root[data-theme="dark"] .status.Pending { color: #e2b765; }
.mod .msg { white-space: pre-wrap; font-family: var(--serif); font-size: 16px; line-height: 1.65; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0 0 12px; overflow-wrap: anywhere; }
.mod textarea.input { min-height: 120px; margin-bottom: 12px; }
.contact { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 16px; font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
.contact span b { color: var(--muted); font-weight: 500; display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.mod .pics { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.mod .pics img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.danger { color: var(--danger); }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.mcard { overflow: hidden; }
.mcard .thumb { aspect-ratio: 16/10; background: var(--bg-2) center/cover; position: relative; display: grid; place-items: center; color: var(--muted); font-size: 26px; }
.mcard .thumb .vid { position: absolute; top: 8px; left: 8px; font-size: 11px; background: rgba(0,0,0,.6); color: #fff; padding: 2px 7px; border-radius: 5px; }
.mcard .body { padding: 10px; display: grid; gap: 8px; }
.mcard .input { min-height: 36px; padding: 7px 10px; font-size: 13.5px; }
.mcard .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; }
.mcard .row label { display: inline-flex; gap: 5px; align-items: center; }
.upload-box { padding: 18px; margin-bottom: 18px; display: grid; gap: 14px; }
.upload-box h3 { margin: 0; font-size: 15px; }
.progress { height: 5px; background: var(--bg-2); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s; }

.content-form .field textarea.input { min-height: 90px; font-family: var(--sans); font-size: 15px; }
.content-form .field textarea.big { min-height: 220px; font-family: var(--serif); font-size: 16px; }
.tl-row { display: grid; grid-template-columns: 80px 1fr auto; gap: 8px; margin-bottom: 8px; align-items: start; }
.tl-row .input { min-height: 40px; padding: 8px 10px; font-size: 14px; }
.tl-row textarea.input { grid-column: 1 / -1; min-height: 60px; }
.tl-item { padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: var(--surface-2); }
.portrait-edit { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.portrait-edit .pv { width: 90px; height: 112px; border-radius: 45px 45px 8px 8px; background: var(--bg-2) center/cover; border: 1px solid var(--line); }
.preview-banner { background: #d8a13a; color: #1d1609; text-align: center; font-size: 13px; padding: 7px 12px; font-weight: 500; }

/* fixes */
.slide > .caption, .slide > .play { position: absolute; }
.a-top .top-actions { margin-left: auto; }
.btn { white-space: nowrap; }
