/* ============================================================
   Kozak — public site styles.
   Six base colours drive everything (set by theme.js from the
   admin Theme Studio); the rest is derived with color-mix.
   ============================================================ */
:root {
  --bg: #f3f0e8; --card: #fffdf8; --text: #1d1a15;
  --accent: #a77a1f; --secondary: #2c3754; --bar: #15171c;
  --bar-text: #efe6cf; --on-accent: #111; --on-secondary: #f4ead2;
  --danger: #b3362e; --online: #4a9a3a;
  --radius: 14px; --header-h: 70px;
  --font-head: "Cinzel", Georgia, serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
  --font-body: "Inter", "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d0f14; --card: #15181f; --text: #ece4cf; --accent: #d8a84f; --secondary: #232c45; --bar: #0a0b0f; }
}
:root {
  --line: color-mix(in srgb, var(--text) 13%, var(--card));
  --hover: color-mix(in srgb, var(--text) 5%, var(--card));
  --input: color-mix(in srgb, var(--text) 7%, var(--card));
  --muted: color-mix(in srgb, var(--text) 62%, var(--card));
  --faint: color-mix(in srgb, var(--text) 40%, var(--card));
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 42%, transparent);
  --bar-2: color-mix(in srgb, var(--bar-text) 9%, var(--bar));
  --bar-line: color-mix(in srgb, var(--bar-text) 16%, var(--bar));
  --bar-muted: color-mix(in srgb, var(--bar-text) 55%, var(--bar));
  --secondary-deep: color-mix(in srgb, var(--secondary) 70%, #000);
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-body); font-size: 15px; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
img, video { max-width: 100%; }
svg { display: block; }
[hidden] { display: none !important; }
.ic { display: inline-block; flex-shrink: 0; vertical-align: middle; }
.muted { color: var(--muted); }
/* User-written text keeps its line breaks, blank lines and spacing exactly as typed. */
.prewrap, .post-text, .styled p, .c-body, .reel-caption, .seat p { white-space: pre-wrap; }
.small { font-size: 13px; }
body.no-scroll { overflow: hidden; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Background graphic + rune pattern ---------- */
.bg-graphic { position: fixed; left: 50%; top: 56%; width: min(92vw, 760px); transform: translate(-50%, -50%); color: var(--accent); opacity: .05; pointer-events: none; z-index: 0; }
.bg-graphic svg { width: 100%; height: auto; }
.bg-pattern { position: fixed; inset: 0; pointer-events: none; z-index: 0; background-image: var(--pattern, none); opacity: var(--pattern-opacity, .06); }

/* ---------- Avatars ---------- */
.av {
  width: var(--s, 40px); height: var(--s, 40px); border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; position: relative;
  color: #f4ead2; font-weight: 600; font-size: calc(var(--s, 40px) * .4); line-height: 1; letter-spacing: .02em;
  background: var(--g, var(--secondary)); object-fit: cover;
  box-shadow: 0 0 0 1.5px var(--card), 0 0 0 3px var(--accent-line);
}
img.av { background: var(--input); }
.av svg { width: 60%; height: 60%; color: color-mix(in srgb, var(--on-secondary) 75%, transparent); }
.av-guest { --g: var(--input); }
.av-guest svg { color: var(--faint); }

/* ---------- Rune tiles ---------- */
.ri { width: 36px; height: 36px; border-radius: calc(var(--radius) * .7); flex-shrink: 0; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.ri > svg:not(.ic) { width: 13px; height: 20px; }
.ri.plain { color: var(--muted); background: var(--input); border-color: var(--line); border-radius: 50%; }
.ri.dark { background: var(--secondary); color: var(--accent); border-color: transparent; }

/* ---------- Buttons & form controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px;
  font-weight: 600; font-size: 14px; border: 1px solid var(--line); background: var(--input); color: var(--text);
  white-space: nowrap; cursor: pointer; transition: border-color .12s, filter .12s, background .12s;
}
.btn:hover { border-color: var(--accent-line); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; gap: 6px; }
.btn:disabled { opacity: .6; cursor: default; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); flex-shrink: 0; }
.icon-btn:hover { background: var(--hover); color: var(--text); }

.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field textarea, .field select, .input {
  width: 100%; min-height: 40px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--input); color: var(--text); outline: 0; transition: border-color .15s;
}
.field input:focus, .field textarea:focus, .field select:focus, .input:focus { border-color: var(--accent); }
.field textarea { resize: vertical; }
.hint { color: var(--muted); font-size: 12.5px; }
.hint a, .muted a { color: var(--accent); }
.form-error { color: var(--danger); font-size: 13px; }

/* ---------- Header ---------- */
.header { position: sticky; top: 0; z-index: 20; }
.topbar { height: 56px; color: var(--bar-text); background: var(--bar); display: grid; grid-template-columns: 1fr minmax(0, 680px) 1fr; align-items: center; padding: 0 16px; border-bottom: 1px solid var(--accent-line); }
.runeband { height: 14px; background: var(--bar) var(--runeband-img, none) repeat-x center / auto 10px; border-bottom: 1px solid var(--accent-line); }
:root[data-runeband="off"] .runeband { display: none; }
.tb-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo { width: 38px; height: 38px; color: var(--accent); }
.wordmark { font-family: var(--font-head); font-weight: 700; font-size: 19px; letter-spacing: .06em; color: var(--accent); white-space: nowrap; }
.search { display: flex; align-items: center; gap: 8px; height: 38px; width: 220px; padding: 0 12px; background: var(--bar-2); border: 1px solid var(--bar-line); border-radius: 10px; color: var(--bar-muted); transition: border-color .15s; }
.search:focus-within { border-color: var(--accent); }
.search input { background: none; border: 0; outline: 0; color: var(--bar-text); width: 100%; min-width: 0; }
.search input::placeholder { color: var(--bar-muted); }
.tb-center { display: flex; justify-content: center; height: 100%; }
.tab { flex: 1; max-width: 112px; display: grid; place-items: center; position: relative; color: var(--bar-muted); margin: 6px 2px; border-radius: 8px; transition: background .15s, color .15s; }
.tab:hover { background: var(--bar-2); color: var(--bar-text); }
.tab.active { color: var(--accent); margin-bottom: 0; border-radius: 0; }
.tab.active:hover { background: none; }
.tab.active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; background: var(--accent); border-radius: 2px; }
.tb-right { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.circle-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; position: relative; background: var(--bar-2); color: var(--bar-text); border: 1px solid var(--bar-line); transition: border-color .15s, color .15s; }
.circle-btn:hover { border-color: var(--accent); color: var(--accent); }
.circle-btn.admin-on { color: var(--accent); border-color: var(--accent); }
.me-link .av { box-shadow: 0 0 0 2px var(--bar), 0 0 0 3.5px var(--accent-line); }

/* ---------- Layout ---------- */
.layout { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr minmax(0, 680px) 1fr; gap: 32px; padding: 0 16px; }
.side { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 18px 0; scrollbar-width: thin; }
.side.left { max-width: 340px; }
.side.right { max-width: 340px; justify-self: end; width: 100%; }
.side::-webkit-scrollbar { width: 8px; }
.side::-webkit-scrollbar-thumb { background: transparent; border-radius: 4px; }
.side:hover::-webkit-scrollbar-thumb { background: var(--line); }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 7px 8px; border-radius: calc(var(--radius) * .7); font-weight: 500; transition: background .12s; min-width: 0; }
.nav-item:hover { background: var(--hover); }
.nav-item.on { background: var(--accent-soft); color: var(--accent); }
.nav-item > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider { display: flex; align-items: center; gap: 10px; margin: 14px 8px; color: var(--accent); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.divider svg { width: 8px; height: 13px; }
:root[data-dividers="off"] .divider svg { display: none; }
:root[data-dividers="off"] .divider { gap: 0; }
.side h3 { padding: 6px 8px 8px; display: flex; justify-content: space-between; align-items: center; font-family: var(--font-head); font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.h3-link { font-family: var(--font-body); font-size: 13px; letter-spacing: 0; text-transform: none; font-weight: 500; color: var(--accent); }
.footer { color: var(--faint); font-size: 12.5px; padding: 14px 8px; }
.band { color: var(--accent); }
.band svg { height: 10px; width: auto; }
.footer .band { opacity: .7; margin-bottom: 8px; }

/* ---------- Cards ---------- */
.feed { padding: 22px 0 40px; display: flex; flex-direction: column; gap: 16px; max-width: 590px; width: 100%; justify-self: center; min-width: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; position: relative; }
:root[data-cards="carved"] .card { border-top: 3px solid var(--accent); }
:root[data-cards="carved"] .card::before, :root[data-cards="carved"] .card::after {
  content: ""; position: absolute; top: 6px; width: 6px; height: 6px; border-radius: 50%; z-index: 3; pointer-events: none;
  background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--accent) 60%, #fff), var(--accent) 60%, color-mix(in srgb, var(--accent) 50%, #000));
}
:root[data-cards="carved"] .card::before { left: 7px; }
:root[data-cards="carved"] .card::after { right: 7px; }

.page-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.page-head > div { flex: 1; min-width: 0; }
.page-head h1 { font-family: var(--font-head); font-size: 22px; font-weight: 600; }
.page-head p { color: var(--muted); font-size: 14px; }
.page-head .ri { width: 44px; height: 44px; }
.search-head { flex-direction: column; align-items: stretch; }
.big-search { display: flex; align-items: center; gap: 10px; background: var(--input); border: 1px solid var(--line); border-radius: 12px; padding: 4px 4px 4px 14px; color: var(--muted); }
.big-search input { flex: 1; border: 0; background: none; outline: 0; min-width: 0; height: 38px; color: var(--text); font-size: 16px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 14px; }
.back-link:hover { color: var(--accent); }

/* Banner */
.seat { display: flex; align-items: center; gap: 16px; padding: 16px 18px; color: var(--on-secondary); border: 0; background: radial-gradient(circle at 10% 50%, var(--accent-line), transparent 42%), linear-gradient(120deg, var(--secondary-deep), var(--secondary)); }
:root[data-banner="off"] .seat { display: none; }
.seat .eye { width: 50px; height: 50px; flex-shrink: 0; color: var(--accent); filter: drop-shadow(0 0 8px var(--accent-line)); }
.seat-text { flex: 1; min-width: 0; }
.seat .band { margin-bottom: 4px; }
.seat h2 { font-family: var(--font-head); font-weight: 600; font-size: 17px; letter-spacing: .02em; }
.seat p { font-size: 14px; opacity: .85; }
.seat p a { color: var(--accent); text-decoration: underline; }
.seat .ravens { display: flex; gap: 10px; flex-shrink: 0; opacity: .75; }
.seat .ravens svg { width: 26px; height: 26px; }

/* Stories (reels row) */
.stories { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.stories::-webkit-scrollbar { display: none; }
.story { flex: 0 0 112px; height: 196px; border-radius: var(--radius); position: relative; overflow: hidden; background: #000; border: 1px solid var(--line); }
.story .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: center / cover no-repeat var(--secondary-deep); transition: transform .35s; }
.story:hover .bg { transform: scale(1.04); }
.story::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(to bottom, rgba(8,9,12,.35), transparent 35%, transparent 55%, rgba(8,9,12,.75)); }
.story .ring { position: absolute; top: 10px; left: 10px; z-index: 2; border-radius: 50%; padding: 2px; background: var(--accent); }
.story .ring .av { box-shadow: 0 0 0 2px #111; }
.story .glyph { position: absolute; top: 14px; right: 12px; z-index: 2; color: var(--accent); }
.story .glyph svg { width: 9px; height: 14px; }
.story .name { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 2; color: #fff; font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.story .name small { display: block; font-weight: 400; font-size: 11px; opacity: .8; }
.story.create { background: var(--card); }
.story.create .bg { bottom: 56px; height: auto; background: linear-gradient(160deg, var(--secondary), var(--secondary-deep)); }
.story.create::before { display: none; }
.story.create .big-rune { position: absolute; inset: 0 0 56px; display: grid; place-items: center; color: var(--accent); opacity: .45; z-index: 1; }
.story.create .big-rune svg { width: 34px; height: 54px; }
.story.create .bottom { position: absolute; left: 0; right: 0; bottom: 0; height: 56px; background: var(--card); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 10px; font-size: 12.5px; font-weight: 600; }
.story.create .plus { position: absolute; left: 50%; bottom: 36px; transform: translateX(-50%); width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--on-accent); border: 3px solid var(--card); display: grid; place-items: center; z-index: 2; }

/* Composer */
.composer { padding: 14px 16px 10px; }
.composer .row { display: flex; gap: 12px; align-items: center; }
.composer .fake-input { flex: 1; background: var(--input); border: 1px solid transparent; border-radius: 12px; padding: 10px 14px; color: var(--muted); transition: border-color .15s; }
.composer .fake-input:hover { border-color: var(--accent-line); }
.composer .actions { display: flex; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 8px; }
.act-ic { display: grid; place-items: center; }
.c-photo { color: #4f9a5f; } .c-video { color: #d0544a; } .c-reel { color: var(--accent); } .c-poll { color: #8a6fd6; }

/* ---------- Posts ---------- */
.action { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14px; transition: background .12s, color .12s; }
.action:hover { background: var(--hover); color: var(--text); }
.action .on { display: none; }
.action.liked { color: var(--accent); }
.action.liked .on { display: inline-flex; }
.action.liked .off { display: none; }
.post-head { display: flex; gap: 12px; align-items: center; padding: 14px 12px 0 16px; }
.post-head .meta { flex: 1; min-width: 0; }
.who-line { line-height: 1.3; }
.who { font-weight: 600; }
.who:hover { text-decoration: underline; }
.act { color: var(--muted); }
.when { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 5px; margin-top: 1px; }
.when a:hover { text-decoration: underline; }
.pin-tag { display: inline-flex; align-items: center; gap: 3px; color: var(--accent); font-weight: 600; margin-left: 4px; }
.post-text { padding: 8px 16px 14px; overflow-wrap: anywhere; }
.post-text a, .c-body a { color: var(--accent); }
.post-text a:hover, .c-body a:hover { text-decoration: underline; }
.post-text.clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; padding-bottom: 0; }
.edited { color: var(--muted); }
.post-state { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 16px; font-size: 13px; font-weight: 600; background: var(--accent-soft); color: var(--accent); border-bottom: 1px solid var(--accent-line); }
.post-state a { margin-left: auto; text-decoration: underline; }
.state-badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }
.state-badge.s-draft { background: var(--input); color: var(--muted); border: 1px solid var(--line); }
.state-badge.s-scheduled { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); }

/* Link preview card */
.link-card { display: block; margin: 0 16px 14px; border: 1px solid var(--line); border-radius: calc(var(--radius) * .8); overflow: hidden; background: var(--input); transition: border-color .15s; }
.link-card:hover { border-color: var(--accent-line); }
.link-card img { width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; display: block; background: var(--hover); }
.link-card-body { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px 12px; }
.link-card-body small { text-transform: uppercase; letter-spacing: .04em; font-size: 12px; color: var(--muted); }
.link-card-body b { font-size: 15.5px; line-height: 1.3; overflow-wrap: anywhere; }
.link-card-desc { color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.see-more { padding: 2px 16px 12px; font-weight: 600; color: var(--muted); font-size: 14px; }
.see-more:hover { text-decoration: underline; }

.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 4px); min-width: 210px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 6px; display: none; z-index: 30; }
.menu-wrap.open .menu { display: block; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; font-weight: 500; font-size: 14px; text-align: left; color: var(--text); }
.menu a:hover, .menu button:hover { background: var(--hover); }
.menu .danger { color: var(--danger); }

/* Text backgrounds */
.styled { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 40px 32px; font-family: var(--font-head); font-size: 26px; font-weight: 600; line-height: 1.3; color: #fff; overflow-wrap: anywhere; }
.styled .band { color: currentColor; opacity: .7; }
.styled a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.s-runestone { background: radial-gradient(ellipse at center, var(--accent-soft), transparent 70%), var(--secondary-deep); color: var(--on-secondary); }
.s-runestone .band { color: var(--accent); opacity: 1; }
.s-gold { background: linear-gradient(135deg, #f1c86e, #a2771f); color: #1d1407; }
.s-ember { background: linear-gradient(135deg, #f0803c, #8a1f12); }
.s-frost { background: linear-gradient(135deg, #d8ecf8, #4f8fb8); color: #0f2232; }
.s-grove { background: linear-gradient(135deg, #8fb86a, #1f3d27); }
.s-night { background: radial-gradient(circle at 30% 20%, #3b4a7a, #0b0f1d 70%); }

/* Photos */
.gallery { display: grid; gap: 2px; background: var(--line); }
.gallery .gi { position: relative; display: block; overflow: hidden; background: var(--input); }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter .15s; }
.gallery .gi:hover img { filter: brightness(.94); }
.gallery.g1 .gi { max-height: 720px; }
.gallery.g2 { grid-template-columns: 1fr 1fr; }
.gallery.g2 .gi { aspect-ratio: 4 / 5; }
.gallery.g3 { grid-template-columns: 1fr 1fr; }
.gallery.g3 .gi { aspect-ratio: 1; }
.gallery.g3 .gi:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.gallery.g4 { grid-template-columns: 1fr 1fr; }
.gallery.g4 .gi { aspect-ratio: 1; }
.gallery .more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.5); color: #fff; font-size: 30px; font-weight: 700; }

/* Video */
.video-wrap { background: #000; aspect-ratio: 16 / 9; max-height: 680px; display: flex; justify-content: center; }
.video-wrap video { width: 100%; height: 100%; display: block; background: #000; }

/* Reels in the feed */
.reel-feed { display: flex; justify-content: center; background: radial-gradient(circle at 50% 30%, var(--secondary), var(--secondary-deep)); padding: 0; }
.rt-box { position: relative; width: min(100%, 340px); aspect-ratio: 9 / 16; background: #000; display: block; overflow: hidden; }
.rt-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.reel-badge { position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; font-weight: 600; }
.reel-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; filter: drop-shadow(0 2px 8px rgba(0,0,0,.6)); transition: opacity .2s; }
.reel-thumb:hover .reel-play { opacity: 0; }

/* Stats & actions */
.stats { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; color: var(--muted); font-size: 13.5px; }
.reacts { display: flex; align-items: center; gap: 6px; }
.reacts .stack { display: flex; }
.rx { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; margin-left: -5px; color: #fff; border: 2px solid var(--card); }
.rx:first-child { margin-left: 0; }
.rx svg { width: 6px; height: 10px; }
.rx.like { background: var(--accent); color: var(--on-accent); }
.rx.love { background: #a3302a; }
.rx.wise { background: var(--secondary); color: var(--on-secondary); }
.stat-right { display: flex; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.stat-right > :not([hidden]) ~ :not([hidden])::before { content: "·"; margin: 0 6px; }
.stat-right a:hover { text-decoration: underline; }
.post-actions { display: flex; margin: 0 16px; border-top: 1px solid var(--line); padding: 4px 0; }
.stats[hidden] + .post-actions { border-top: 1px solid var(--line); }

/* Comments */
.comments { border-top: 1px solid var(--line); margin: 0 16px; padding: 10px 0 14px; display: flex; flex-direction: column; gap: 10px; }
.more-comments { font-weight: 600; color: var(--muted); font-size: 14px; }
.more-comments:hover { text-decoration: underline; }
.comment-list { display: flex; flex-direction: column; gap: 10px; }
.comment-list:empty { display: none; }
.comment { display: flex; gap: 8px; align-items: flex-start; }
.c-main { min-width: 0; }
.bubble { background: var(--input); border-radius: 14px; padding: 8px 12px; font-size: 14.5px; overflow-wrap: anywhere; }
.bubble b { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.bubble b a:hover { text-decoration: underline; }
.author-tag { display: inline-block; padding: 1px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 600; }
.c-meta { font-size: 12px; color: var(--muted); padding: 3px 12px; display: flex; gap: 12px; align-items: center; }
.c-meta form.inline { display: inline; }
.c-meta button { font-weight: 600; color: var(--muted); font-size: 12px; }
.c-meta button:hover { color: var(--danger); text-decoration: underline; }
.comment-form { display: flex; gap: 8px; align-items: flex-start; }
.cf-fields { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cf-name { height: 34px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--input); color: var(--text); outline: 0; font-size: 14px; max-width: 240px; }
.cf-name:focus { border-color: var(--accent); }
.cf-row { display: flex; align-items: flex-end; gap: 4px; background: var(--input); border-radius: 16px; padding: 3px 3px 3px 12px; border: 1px solid transparent; }
.cf-row:focus-within { border-color: var(--accent-line); }
.cf-row textarea { flex: 1; border: 0; background: none; resize: none; outline: 0; padding: 6px 0; font-size: 14.5px; max-height: 160px; min-height: 32px; color: var(--text); line-height: 1.4; }
.cf-send { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--accent); flex-shrink: 0; }
.cf-send:hover { background: var(--hover); }
.cf-send:disabled { opacity: .5; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Right column */
.rune-day { padding: 14px; display: flex; gap: 14px; align-items: center; }
.rune-day .big { width: 58px; height: 70px; flex-shrink: 0; display: grid; place-items: center; border-radius: 29px 29px 10px 10px; color: var(--accent); background: linear-gradient(var(--secondary), var(--secondary-deep)); }
.rune-day .big svg { width: 20px; height: 32px; filter: drop-shadow(0 0 6px var(--accent-line)); }
.rune-day .t { font-family: var(--font-head); font-weight: 600; display: block; }
.rune-day .d { color: var(--muted); font-size: 13.5px; display: block; }
.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: calc(var(--radius) * .7); overflow: hidden; }
.mini-grid a { aspect-ratio: 1; background: var(--input); display: block; overflow: hidden; }
.mini-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.mini-grid a:hover img { transform: scale(1.05); }
.mini-reels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mini-reel { position: relative; aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; background: #000; display: block; }
.mini-reel img, .mini-reel video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini-reel span { position: absolute; left: 6px; bottom: 6px; display: flex; align-items: center; gap: 3px; color: #fff; font-size: 12px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.7); }

/* Pager & empty states */
.pager { display: flex; justify-content: space-between; gap: 12px; }
.empty { padding: 36px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.empty .valknut { width: 54px; height: 54px; color: var(--accent); opacity: .8; }
.empty h2 { font-family: var(--font-head); font-size: 20px; font-weight: 600; }
.empty p { color: var(--muted); max-width: 380px; }
.empty .btn { margin-top: 6px; }
.notfound { position: relative; z-index: 1; max-width: 520px; margin: 48px auto; padding: 0 16px; }

/* ---------- Profile page ---------- */
.profile { position: relative; z-index: 1; }
.profile-top { background: var(--card); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
.profile-top-inner { max-width: 1100px; margin: 0 auto; }
.cover { height: clamp(180px, 30vw, 380px); background: center / cover no-repeat var(--secondary-deep); border-radius: 0 0 var(--radius) var(--radius); position: relative; overflow: hidden; }
.cover.no-cover { background: radial-gradient(circle at 20% 30%, var(--accent-line), transparent 45%), linear-gradient(135deg, var(--secondary), var(--secondary-deep)); color: var(--accent); display: grid; place-items: center; }
.cover-band { opacity: .55; }
.cover-band svg { height: 16px; width: auto; max-width: 90vw; }
.cover-edit { position: absolute; right: 16px; bottom: 16px; background: rgba(0,0,0,.55); color: #fff; border-color: transparent; }
.cover-edit:hover { background: rgba(0,0,0,.7); border-color: transparent; }
.profile-id { display: flex; align-items: flex-end; gap: 20px; padding: 0 32px 16px; flex-wrap: wrap; }
.profile-av { margin-top: -84px; flex-shrink: 0; border-radius: 50%; padding: 4px; background: var(--card); position: relative; z-index: 2; }
.profile-av .av { box-shadow: 0 0 0 3px var(--accent); font-size: 60px; }
.profile-name { flex: 1; min-width: 220px; padding-bottom: 6px; }
.profile-name h1 { font-family: var(--font-head); font-size: 32px; font-weight: 700; line-height: 1.15; }
.headline { color: var(--text); opacity: .85; margin-top: 2px; }
.counts { color: var(--muted); font-weight: 600; margin-top: 4px; font-size: 14px; }
.profile-actions { display: flex; gap: 8px; padding-bottom: 8px; flex-wrap: wrap; }
.profile-tabs { display: flex; gap: 2px; padding: 0 24px; border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.profile-tabs a { padding: 14px 16px 11px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; border-radius: 8px 8px 0 0; }
.profile-tabs a:hover { background: var(--hover); }
.profile-tabs a.on { color: var(--accent); border-color: var(--accent); }
.profile-body { max-width: 1100px; margin: 16px auto 40px; padding: 0 16px; display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 16px; align-items: start; }
.profile-body:not(.tab-posts) { grid-template-columns: minmax(0, 1fr); }
.profile-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--header-h) + 16px); }
.profile-feed { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.side-card, .grid-card, .about-card { padding: 16px; }
.side-card h2, .grid-card h2, .about-card h2 { font-family: var(--font-head); font-size: 20px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.side-card h2 a { font-family: var(--font-body); font-size: 14px; font-weight: 500; color: var(--accent); }
.intro .bio { text-align: center; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.details { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.details li { display: flex; gap: 12px; align-items: flex-start; }
.details li > .ic { color: var(--muted); margin-top: 1px; }
.details a { color: var(--accent); font-weight: 600; }
.details small { display: block; color: var(--muted); font-size: 12.5px; }
.link-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.link-chips a { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: 999px; background: var(--input); font-size: 13px; font-weight: 500; border: 1px solid var(--line); }
.link-chips a:hover { border-color: var(--accent-line); color: var(--accent); }
.intro .btn.block { margin-top: 14px; }
.about-card { max-width: 760px; width: 100%; justify-self: center; display: flex; flex-direction: column; gap: 14px; }
.about-card h3 { font-family: var(--font-head); font-size: 16px; }
.about-card .btn { align-self: flex-start; }
.about-bio { font-size: 16px; }
.profile-side .footer { padding-top: 0; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.photo-grid a { aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--input); display: block; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.photo-grid a:hover img { transform: scale(1.04); }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.vthumb { display: flex; flex-direction: column; gap: 4px; }
.vt-media { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; display: block; }
.vt-media img, .vt-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vt-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; filter: drop-shadow(0 2px 8px rgba(0,0,0,.6)); }
.vt-title { font-weight: 600; font-size: 14px; }
.vthumb small { color: var(--muted); font-size: 12.5px; }
.reel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.rthumb { position: relative; aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; background: #000; display: block; }
.rthumb img, .rthumb video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.rthumb:hover img { transform: scale(1.04); }
.rthumb span { position: absolute; left: 8px; bottom: 8px; color: #fff; font-weight: 600; font-size: 13px; display: flex; gap: 4px; align-items: center; text-shadow: 0 1px 3px rgba(0,0,0,.7); }

/* ---------- Reels viewer ---------- */
.page-reels .bg-graphic { opacity: .03 !important; }
.reels-page { position: relative; z-index: 1; }
.reels-empty { max-width: 520px; margin: 40px auto; padding: 0 16px; }
.reels-viewer { height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h)); overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.reels-viewer::-webkit-scrollbar { display: none; }
.reel { height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: flex; align-items: center; justify-content: center; padding: 14px 0; }
.reel-stage { position: relative; height: 100%; aspect-ratio: 9 / 16; max-width: 100%; background: #000; border-radius: var(--radius); overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.reel-stage video { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }
.reel-mute { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; display: grid; place-items: center; z-index: 2; }
.reel .i-on { display: none; }
.reel:not(.is-muted) .i-on { display: block; }
.reel:not(.is-muted) .i-off { display: none; }
.reel-paused { position: absolute; inset: 0; display: none; place-items: center; color: #fff; pointer-events: none; filter: drop-shadow(0 2px 10px rgba(0,0,0,.6)); }
.reel.is-paused .reel-paused { display: grid; }
.reel-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 70px 76px 16px 16px; background: linear-gradient(transparent, rgba(0,0,0,.75)); color: #fff; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.reel-info a, .reel-info .reel-caption { pointer-events: auto; }
.reel-who { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; }
.reel-who .av { box-shadow: 0 0 0 2px #fff; }
.reel-caption { font-size: 14px; max-height: 7.2em; overflow-y: auto; overflow-wrap: anywhere; }
.reel-caption a { color: #f1d38a; }
.reel-info small { opacity: .8; font-size: 12.5px; }
.reel-actions { position: absolute; right: 10px; bottom: 86px; display: flex; flex-direction: column; gap: 14px; z-index: 2; }
.ra-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #fff; font-size: 12px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.ra-ic { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.16); backdrop-filter: blur(6px); display: grid; place-items: center; transition: background .15s; }
.ra-btn:hover .ra-ic { background: rgba(255,255,255,.28); }
.ra-btn .on { display: none; }
.ra-btn.liked .ra-ic { background: var(--accent); color: var(--on-accent); }
.ra-btn.liked .on { display: block; }
.ra-btn.liked .off { display: none; }
.reels-nav { position: fixed; right: 24px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 10px; z-index: 5; }
.reels-nav .circle-btn { width: 46px; height: 46px; background: var(--card); color: var(--text); border-color: var(--line); box-shadow: var(--shadow); }

/* ---------- Modal, share sheet, toast, flashes ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(5,6,10,.6); backdrop-filter: blur(3px); animation: fade .15s ease; }
.modal-card { width: 100%; max-width: 440px; background: var(--card); color: var(--text); border: 1px solid var(--accent-line); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.4); overflow: hidden; }
@keyframes fade { from { opacity: 0; } }
.sm-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--line); }
.sm-head h2 { font-family: var(--font-head); font-size: 18px; font-weight: 600; }
.sm-preview { padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; }
.sm-preview b { overflow-wrap: anywhere; }
.sm-preview span { color: var(--muted); font-size: 13px; word-break: break-all; }
.sm-targets { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; padding: 0 18px 14px; }
.sm-t { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: 12px; background: var(--input); border: 1px solid var(--line); font-weight: 600; font-size: 13px; transition: border-color .12s; }
.sm-t:hover { border-color: var(--accent-line); }
.sm-ic { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: var(--secondary); color: var(--on-secondary); }
.sm-t.snap .sm-ic { background: #fffc00; color: #000; }
.sm-url { display: flex; gap: 8px; padding: 0 18px 12px; }
.sm-url input { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--input); color: var(--muted); font-size: 13px; outline: 0; }
.sm-hint { padding: 0 18px 18px; color: var(--muted); font-size: 12.5px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 95; opacity: 0; pointer-events: none; background: var(--secondary-deep); color: var(--on-secondary); border: 1px solid var(--accent-line); padding: 10px 16px; border-radius: 12px; font-size: 14px; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.flashes { position: fixed; top: calc(var(--header-h) + 12px); left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; width: max-content; max-width: calc(100vw - 32px); transition: opacity .4s; }
.flashes.gone { opacity: 0; pointer-events: none; }
.flash { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--accent-line); box-shadow: 0 8px 24px rgba(0,0,0,.18); font-size: 14px; font-weight: 500; }
.flash .ic { color: var(--accent); }
.flash-error { border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.flash-error .ic { color: var(--danger); }

/* ---------- Hover card ---------- */
.hovercard { position: fixed; z-index: 70; width: 360px; max-width: calc(100vw - 16px); background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.25); overflow: hidden; opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity .15s, transform .15s; }
.hovercard.measure { display: block; visibility: hidden; }
.hovercard.show { opacity: 1; transform: none; pointer-events: auto; }
.hc-cover { height: 84px; background: center / cover no-repeat; background-color: var(--secondary-deep); background-image: radial-gradient(circle at 20% 30%, var(--accent-line), transparent 50%), linear-gradient(135deg, var(--secondary), var(--secondary-deep)); }
.hc-cover[style] { background-size: cover; }
.hc-body { display: flex; gap: 14px; padding: 0 16px; margin-top: -30px; align-items: flex-end; }
.hc-av .av { box-shadow: 0 0 0 4px var(--card), 0 0 0 6px var(--accent-line); font-size: 30px; }
.hc-main { padding-bottom: 4px; min-width: 0; }
.hc-name { font-weight: 700; font-size: 18px; font-family: var(--font-head); display: block; line-height: 1.2; }
.hc-name:hover { text-decoration: underline; }
.hc-head { color: var(--muted); font-size: 13.5px; }
.hc-details { list-style: none; margin: 12px 16px 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.hc-details li { display: flex; gap: 8px; align-items: center; }
.hc-details .ic { color: var(--muted); }
.hc-actions { display: flex; gap: 8px; padding: 14px 16px 16px; }
.hc-actions .btn { flex: 1; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(5,6,8,.94); display: grid; place-items: center; animation: fade .15s ease; }
.lightbox img { max-width: 92vw; max-height: 84vh; object-fit: contain; border-radius: 6px; }
.lb-btn { position: absolute; width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; }
.lb-btn:hover { background: rgba(255,255,255,.22); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-bar { position: absolute; bottom: 18px; left: 0; right: 0; display: flex; justify-content: center; gap: 18px; color: #ddd; font-size: 14px; }
.lb-bar a { color: #f1d38a; font-weight: 600; }

/* ---------- Background image & animated effects ---------- */
.bg-image { position: fixed; inset: -30px; z-index: 0; pointer-events: none; background: center / cover no-repeat; opacity: 0; }
.bg-fx { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; display: none; }

/* ---------- Logo ---------- */
.logo-slot { display: inline-flex; flex-shrink: 0; }
.logo-img { width: 38px; height: 38px; border-radius: 11px; object-fit: cover; display: block; }
.admin-brand .logo-img { width: 40px; height: 40px; }

/* ---------- Online now ---------- */
.online-now { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px 0 9px; border-radius: 999px; background: var(--bar-2); border: 1px solid var(--bar-line); color: var(--bar-text); font-size: 13px; }
.online-now b { font-weight: 700; font-variant-numeric: tabular-nums; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--online); box-shadow: 0 0 0 3px color-mix(in srgb, var(--online) 30%, transparent); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--online) 15%, transparent); } }

/* ---------- Dislike ---------- */
.flip { display: inline-flex; transform: scaleY(-1); }
.action .flip.on, .ra-btn .flip.on { display: none; }
.action.disliked { color: var(--danger); }
.action.disliked .flip.on, .ra-btn.disliked .flip.on { display: inline-flex; }
.action.disliked .flip.off, .ra-btn.disliked .flip.off { display: none; }
.ra-btn.disliked .ra-ic { background: var(--danger); color: #fff; }
.dislike-stat { color: var(--danger); }

/* ---------- Polls ---------- */
.poll-question { font-size: 17px; font-weight: 600; }
.poll { padding: 0 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.poll-opt { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--input); text-align: left; overflow: hidden; font-weight: 500; transition: border-color .12s; }
.poll-opt:not(:disabled):hover { border-color: var(--accent-line); }
.poll-opt:disabled { cursor: default; }
.po-bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent-soft); border-right: 2px solid var(--accent-line); transition: width .4s ease; }
.poll-opt.mine .po-bar { background: color-mix(in srgb, var(--accent) 24%, transparent); border-right-color: var(--accent); }
.po-radio { position: relative; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--faint); display: grid; place-items: center; flex-shrink: 0; color: var(--on-accent); }
.poll-opt.mine .po-radio { background: var(--accent); border-color: var(--accent); }
.po-label { position: relative; flex: 1; overflow-wrap: anywhere; }
.po-pct { position: relative; font-weight: 700; font-variant-numeric: tabular-nums; }
.poll-meta { color: var(--muted); font-size: 13px; }

/* ---------- Music & voice notes ---------- */
.post-audio { display: flex; align-items: center; gap: 12px; margin: 0 16px 12px; padding: 10px 14px 10px 10px; border-radius: 999px; background: var(--input); border: 1px solid var(--line); }
.post-audio + .stats, .gallery + .post-audio { margin-top: 10px; }
.pa-play { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); flex-shrink: 0; }
.post-audio .i-pause, .post-audio.playing .i-play { display: none; }
.post-audio.playing .i-pause { display: inline; }
.pa-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pa-info b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-track { height: 4px; border-radius: 2px; background: var(--line); cursor: pointer; overflow: hidden; }
.pa-track span { display: block; height: 100%; width: 0; background: var(--accent); }
.pa-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Captions ---------- */
.photo-caption { padding: 8px 16px 0; color: var(--muted); font-size: 14px; }
.gi-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; background: linear-gradient(transparent, rgba(0,0,0,.65)); color: #fff; font-size: 12.5px; }
.lb-cap { position: absolute; left: 50%; bottom: 52px; transform: translateX(-50%); max-width: min(720px, 90vw); padding: 8px 14px; border-radius: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: 14px; text-align: center; }
video::cue { background: rgba(0,0,0,.72); color: #fff; font-family: var(--font-body); }

/* ---------- Video filters (also used for the photo editor swatches) ---------- */
.fx-frost { filter: saturate(.85) hue-rotate(-8deg) brightness(1.06) contrast(1.05); }
.fx-ember { filter: sepia(.25) saturate(1.3) hue-rotate(-12deg) contrast(1.08); }
.fx-raven { filter: grayscale(1) contrast(1.2) brightness(.96); }
.fx-saga { filter: sepia(.65) contrast(1.06); }
.fx-fjord { filter: saturate(1.15) hue-rotate(8deg) brightness(1.02); }
.fx-gold { filter: sepia(.3) saturate(1.15) brightness(1.06); }
.fx-mist { filter: contrast(.84) brightness(1.12) saturate(.7); }

/* ---------- Comment replies & pinning ---------- */
.replies { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.replies:empty { display: none; }
.comment.is-reply .bubble { font-size: 14px; }
.c-reply { font-weight: 700; color: var(--muted); font-size: 12px; }
.c-reply:hover { text-decoration: underline; color: var(--text); }
.view-replies { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 13px; color: var(--muted); padding-left: 4px; }
.view-replies:hover { color: var(--accent); }
.pinned-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--accent); margin: 0 0 3px 10px; }
.comment.is-pinned > .c-main > .bubble { box-shadow: inset 0 0 0 1px var(--accent-line); }
.reply-form { margin-top: 4px; }
.cf-replying { font-size: 12.5px; color: var(--muted); }
.cf-replying button { font-weight: 600; color: var(--accent); font-size: 12.5px; margin-left: 6px; }
.flash-comment > .c-main > .bubble { animation: flashc 2.5s ease; }
@keyframes flashc { 0%, 40% { box-shadow: 0 0 0 2px var(--accent); } }

/* ---------- Runes: rune of the day & daily draw ---------- */
.rune-svg { width: 20px; height: 32px; }
.rune-day .t, .rune-draw .t { font-family: var(--font-head); font-weight: 600; display: block; }
.glyph-char { font-family: "Segoe UI Historic", "Noto Sans Runic", "Noto Sans Ogham", sans-serif; font-weight: 400; color: var(--accent); }
.rune-day .set, .rune-draw .set { display: block; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin: 1px 0 3px; }
.rune-draw { margin-top: 10px; padding: 14px; }
.rd-front { display: flex; flex-direction: column; gap: 10px; }
.rd-front p { font-size: 14px; }
.rd-stones { display: flex; gap: 8px; justify-content: center; padding: 4px 0; }
.rd-stones span { width: 34px; height: 44px; border-radius: 18px 18px 8px 8px; background: linear-gradient(var(--secondary), var(--secondary-deep)); box-shadow: inset 0 0 0 1px var(--accent-line); }
.rune-draw.drawing .rd-stones span { animation: shake .3s ease-in-out infinite alternate; }
.rune-draw.drawing .rd-stones span:nth-child(2) { animation-delay: .1s; }
.rune-draw.drawing .rd-stones span:nth-child(3) { animation-delay: .2s; }
@keyframes shake { from { transform: translateY(0) rotate(-6deg); } to { transform: translateY(-6px) rotate(6deg); } }
.rd-result { display: flex; gap: 14px; align-items: center; }
.rd-result .big { width: 58px; height: 70px; flex-shrink: 0; display: grid; place-items: center; border-radius: 29px 29px 10px 10px; color: var(--accent); background: linear-gradient(var(--secondary), var(--secondary-deep)); }
.rd-result .big svg { filter: drop-shadow(0 0 6px var(--accent-line)); }
.rd-result .d { color: var(--muted); font-size: 13.5px; display: block; }
.rd-result .hint { display: block; margin-top: 4px; }
.rune-draw.revealed .rd-result { animation: reveal .6s ease; }
@keyframes reveal { from { opacity: 0; transform: scale(.94); } }

/* ---------- Log in button & account menu ---------- */
.login-btn { height: 36px; padding: 0 16px; }
.me-btn { border-radius: 50%; display: grid; }
.me-btn .av, .me-link .av { box-shadow: 0 0 0 2px var(--bar), 0 0 0 3.5px var(--accent-line); }
.account-wrap.open .me-btn .av { box-shadow: 0 0 0 2px var(--bar), 0 0 0 3.5px var(--accent); }
.account-menu { width: 300px; top: calc(100% + 10px); }
.account-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.account-menu form { margin: 0; }
.acct-me { padding: 8px 10px !important; }
.acct-me b { display: block; }
.acct-me small { color: var(--muted); font-size: 13px; }

/* ---------- Pop-ups on the site ---------- */
.modal[hidden] { display: none !important; }
.compose-modal { align-items: start; overflow-y: auto; padding: 40px 16px; }
.compose-card { max-width: 620px; }
.compose-card .compose { padding: 14px 18px 16px; }
.login-modal .login-card { width: 100%; max-width: 400px; position: relative; }
.login-x { position: absolute; top: 10px; right: 10px; color: inherit; }
.login-x:hover { background: rgba(255,255,255,.12); color: inherit; }

/* ---------- Comment notice ---------- */
.cf-note { color: var(--faint); font-size: 11.5px; line-height: 1.35; }

/* ---------- Content protection (visitors) ---------- */
body.protected { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.protected input, body.protected textarea { -webkit-user-select: text; user-select: text; }
body.protected img, body.protected video { -webkit-user-drag: none; user-drag: none; }
body.protected .gallery .gi, body.protected .photo-grid a, body.protected .mini-grid a { -webkit-touch-callout: none; }
body.protected.shielded img, body.protected.shielded video, body.protected.shielded .styled, body.protected.shielded .post-text,
body.protected.shielded .link-card, body.protected.shielded .lightbox img { filter: blur(22px) !important; transition: filter .05s; }
@media print {
  body.protected > * { display: none !important; }
  body.protected::after { content: "Printing is turned off on this site."; display: block; padding: 40px; font: 18px sans-serif; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1360px) { .wordmark { display: none; } }
@media (max-width: 1260px) {
  .layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .side.left { display: none; }
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; }
  .tb-center, .tab { min-width: 0; }
  .search { width: 38px; padding: 0; justify-content: center; }
  .search input { display: none; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side.right { display: none; }
  .profile-body { grid-template-columns: minmax(0, 1fr); }
  .profile-side { position: static; }
  .profile-id { flex-direction: column; align-items: center; text-align: center; padding: 0 16px 16px; }
  .profile-av { margin-top: -90px; }
  .profile-name { min-width: 0; padding-bottom: 0; }
  .profile-actions { justify-content: center; }
  .reels-nav { display: none; }
}
@media (max-width: 600px) {
  .layout { padding: 0; }
  .feed { padding-top: 10px; gap: 10px; }
  .feed > .card, .profile-feed > .card { border-radius: 0; border-left: 0; border-right: 0; }
  .stories { padding: 2px 12px; }
  .back-link { padding: 0 16px; }
  .tb-right .circle-btn:not(.admin-on):first-child { display: none; }
  .online-now { padding: 0 8px; }
  .online-now .ic { display: none; }
  .tab { margin: 6px 0; }
  .composer .actions .action span:not(.act-ic) { display: none; }
  .post-actions .action { gap: 5px; font-size: 13px; }
  .styled { font-size: 21px; min-height: 240px; }
  .profile-name h1 { font-size: 26px; }
  .profile-av .av { --s: 140px !important; }
  .profile-body { padding: 0; gap: 10px; margin-top: 10px; }
  .profile-body .card { border-radius: 0; border-left: 0; border-right: 0; }
  .reel { padding: 0; }
  .reel-stage { border-radius: 0; width: 100%; aspect-ratio: auto; }
  .pager { padding: 0 12px; }
}

/* Formatted posts from the full editor (also used inside the editor itself) */
.rich p, .rich h1, .rich h2, .rich h3, .rich ul, .rich ol, .rich blockquote, .rich pre { margin: 0; }
.rich h1, .rich-box .ql-editor h1 { font-family: var(--font-head); font-size: 1.75em; line-height: 1.2; font-weight: 700; }
.rich h2, .rich-box .ql-editor h2 { font-family: var(--font-head); font-size: 1.4em; line-height: 1.25; font-weight: 600; }
.rich h3, .rich-box .ql-editor h3 { font-size: 1.15em; line-height: 1.3; font-weight: 700; }
.rich ul, .rich ol { padding-left: 1.6em; }
.rich li { white-space: pre-wrap; }
.rich blockquote, .rich-box .ql-editor blockquote { border-left: 3px solid var(--accent); padding: 2px 0 2px 12px; color: var(--muted); }
.rich pre, .rich-box .ql-snow .ql-editor .ql-code-block-container { font-family: ui-monospace, Consolas, monospace; font-size: .9em; background: var(--input); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; }
.rich a { color: var(--accent); }
.styled .rich a, .reel-caption.rich a { color: inherit; }
.ql-font-heading { font-family: var(--font-head); }
.ql-font-serif { font-family: Georgia, "Times New Roman", serif; }
.ql-font-mono { font-family: ui-monospace, Consolas, monospace; }
.ql-font-script { font-family: "Segoe Script", "Bradley Hand", "Brush Script MT", cursive; }
.rich .ql-indent-1 { padding-left: 2em; }
.rich .ql-indent-2 { padding-left: 4em; }
.rich .ql-indent-3 { padding-left: 6em; }
.rich .ql-indent-4 { padding-left: 8em; }
.rich .ql-indent-5 { padding-left: 10em; }
.rich .ql-indent-6 { padding-left: 12em; }
.rich .ql-indent-7 { padding-left: 14em; }
.rich .ql-indent-8 { padding-left: 16em; }
