/* Layout: dark top nav that works as a tab bar, search/auth strip, one tab visible at a time in the main column (about, questions, ask, problem, collections, formulas, rules) beside a sidebar (chat tile, news). */
:root {
  --paper: #f5eeee;
  --surface: #ffffff;
  --ink: #240c11;
  --muted: #6b5358;
  --line: #e3d3d5;
  --nav: #230a10;
  --nav-ink: #f8eeef;
  --accent: #9b1c2e;
  --accent-ink: #ffffff;
  --pop: #f0b429;
  --pop-ink: #240c11;
  --warn-bg: #fbdcd6;
  --warn-ink: #8a2a1c;
  --ok-bg: #d3ecd9;
  --ok-ink: #1c5a30;
  --err: #b42318;
  --font-display: "Unbounded", "Noto Sans Georgian", "Arial Black", sans-serif;
  --font-body: "Golos Text", "Noto Sans Georgian", system-ui, sans-serif;
  --font-math: "STIX Two Text", "Cambria Math", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #160b0e; --surface: #21131a; --ink: #f6eaec; --muted: #bba2a7; --line: #3d252b;
    --nav: #0f0508; --nav-ink: #f6eaec; --accent: #ff8d9b; --accent-ink: #2b0509;
    --warn-bg: #4a2620; --warn-ink: #f4b8ad; --ok-bg: #1f4129; --ok-ink: #a9e0b8; --err: #ff9c8f; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #160b0e; --surface: #21131a; --ink: #f6eaec; --muted: #bba2a7; --line: #3d252b;
  --nav: #0f0508; --nav-ink: #f6eaec; --accent: #ff8d9b; --accent-ink: #2b0509;
  --warn-bg: #4a2620; --warn-ink: #f4b8ad; --ok-bg: #1f4129; --ok-ink: #a9e0b8; --err: #ff9c8f; color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.55; margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: 1180px; margin: 0 auto; }
.vh { position: absolute; left: -9999px; }
html[lang="ka"] { --font-display: "Noto Sans Georgian", "Unbounded", sans-serif; --font-body: "Noto Sans Georgian", "Golos Text", system-ui, sans-serif; }
html[lang="ka"] .ask h2, html[lang="ka"] .tag h3, html[lang="ka"] .chat b, html[lang="ka"] .nav li a, html[lang="ka"] .hero small, html[lang="ka"] .cover span { text-transform: none; letter-spacing: 0; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.lang button { background: var(--surface); border: 0; padding: 9px 12px; font-size: 14px; }
.lang button + button { border-left: 1px solid var(--line); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.nav { background: var(--nav); color: var(--nav-ink); }
.nav .wrap { display: flex; align-items: center; gap: 14px 36px; padding-block: 18px; flex-wrap: wrap; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 20px; text-decoration: none; display: flex; align-items: center; gap: 12px; }
.brand { gap: 0; }
.brand img { height: 38px; width: auto; display: block; flex: none; }
.brand-text { display: flex; justify-content: flex-end; max-width: 0; overflow: hidden; opacity: 0; margin-right: 0; transition: max-width .55s cubic-bezier(.2,.7,.2,1), opacity .4s ease, margin-right .55s ease; }
.brand:hover .brand-text, .brand:focus-visible .brand-text, .brand.open .brand-text { max-width: 150px; opacity: 1; margin-right: 8px; }
@media (prefers-reduced-motion: reduce) { .brand-text { transition: none; } }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 26px; }
.nav li a { display: block; padding-block: 6px; text-decoration: none; font-size: 13px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; opacity: .78; border-bottom: 2px solid transparent; }
.nav li a:hover { opacity: 1; }
.nav li a[aria-current="page"] { opacity: 1; border-bottom-color: var(--pop); }

.strip { background: var(--surface); border-bottom: 1px solid var(--line); }
.strip .wrap { display: flex; align-items: center; gap: 14px 24px; padding-block: 14px; flex-wrap: wrap; }
.search { flex: 1 1 280px; max-width: 420px; position: relative; }
.search input { width: 100%; padding: 10px 40px 10px 14px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); }
.search svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.auth { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.auth button { background: var(--surface); border: 0; padding: 9px 14px; font-size: 14px; }
.auth button + button, .auth span + button { border-left: 1px solid var(--line); }
.auth button:hover { background: var(--paper); }
.auth .who { padding: 9px 14px; font-size: 14px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note { font-size: 14px; color: var(--muted); }
.flash { font-size: 14px; color: var(--accent); min-height: 1.4em; margin: 0; flex-basis: 100%; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; padding-block: 32px 56px; align-items: start; }
.main { display: flex; flex-direction: column; gap: 40px; min-width: 0; }

.hero { position: relative; overflow: hidden; border-radius: 8px; background: linear-gradient(120deg, #3a0a14 0%, #6e1424 55%, #9b1c2e 100%); color: #fbf1f2; padding: 36px; display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 24px; align-items: center; }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero > :not(.hero-art) { position: relative; }
.hero small { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
.hero h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 4vw, 42px); line-height: 1.1; margin: 8px 0 14px; text-wrap: balance; }
.hero p { margin: 0 0 22px; max-width: 48ch; opacity: .92; }
.btn-pop { display: inline-block; background: var(--pop); color: var(--pop-ink); border: 0; border-radius: 999px; padding: 13px 28px; font-weight: 600; text-decoration: none; text-align: center; }
.btn-pop:hover { filter: brightness(1.06); }
.cover { aspect-ratio: 3 / 4; border-radius: 4px; background: #2a0710; border: 1px solid rgba(255,255,255,.25); padding: 14px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 8px 8px 0 rgba(0,0,0,.25); }
.cover b { font-family: var(--font-display); font-size: 15px; line-height: 1.2; }
.cover-alpha { width: 100%; max-width: 120px; height: auto; align-self: center; display: block; }
.cover span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .7; }

.ask { background: var(--nav); color: var(--nav-ink); border-radius: 8px; padding: 32px 36px; }
.ask h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(22px, 3vw, 30px); margin: 0 0 6px; text-transform: uppercase; }
.ask p { margin: 0 0 18px; opacity: .85; max-width: 62ch; }
.ask form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 160px; gap: 12px; }
.ask textarea { grid-column: 1 / -1; min-height: 88px; resize: vertical; padding: 12px 14px; border-radius: 4px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); }
.ask textarea::placeholder { color: rgba(241,244,250,.55); }
.ask select { padding: 11px 12px; border-radius: 4px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); min-width: 0; }
.ask select option { color: #111a2b; }
.locked { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.ghost { background: transparent; color: var(--nav-ink); border: 1px solid rgba(255,255,255,.4); border-radius: 999px; padding: 12px 24px; font-weight: 500; }
.ghost:hover { background: rgba(255,255,255,.1); }

h2.sec { font-family: var(--font-display); font-weight: 500; font-size: clamp(22px, 3vw, 28px); margin: 0 0 18px; }
.lead { margin: -8px 0 20px; color: var(--muted); max-width: 64ch; }
.tags { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.tag { border-radius: 8px; overflow: hidden; color: #fff; display: flex; flex-direction: column; min-height: 190px; text-align: left; border: 0; padding: 0; }
.tag .in { padding: 18px 18px 12px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.tag .fx { font-family: var(--font-math); font-style: italic; font-size: 26px; line-height: 1.1; color: var(--pop); overflow-wrap: anywhere; }
.tag h3 { font-family: var(--font-display); font-weight: 500; font-size: 13px; margin: 0; text-transform: uppercase; letter-spacing: .02em; }
.tag p { margin: 0; font-size: 14px; opacity: .92; }
.tag .go { background: rgba(0,0,0,.32); padding: 9px; text-align: center; font-size: 14px; }
.t1 { background: linear-gradient(150deg, #8f1a2c, #3a0d14); }
.t2 { background: linear-gradient(150deg, #a4352c, #4a1512); }
.t3 { background: linear-gradient(150deg, #6e1b3a, #2c0c18); }
.t4 { background: linear-gradient(150deg, #7c2a1c, #33120a); }
.t5 { background: linear-gradient(150deg, #b0283a, #52101b); }
.t6 { background: linear-gradient(150deg, #8c2a40, #3a1220); }
.t7 { background: linear-gradient(150deg, #5a1a22, #1f0a0e); }
.t8 { background: linear-gradient(150deg, #4a3a3e, #1a1214); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip { border: 1px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: 4px; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.qhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.qhead h2 { margin: 0; }
.qhead span { color: var(--muted); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.q { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.q .plate { height: 140px; background: var(--paper); border-bottom: 1px solid var(--line); display: flex; align-items: flex-end; padding: 12px; position: relative; }
.q .plate .fx { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-math); font-style: italic; font-size: 32px; color: var(--accent); opacity: .5; padding: 0 8px 18px; text-align: center; }
.badge { position: relative; font-size: 13px; padding: 4px 12px; border-radius: 999px; font-weight: 500; }
.badge.none { background: var(--warn-bg); color: var(--warn-ink); }
.badge.has { background: var(--ok-bg); color: var(--ok-ink); }
.q .txt { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.q h3 { margin: 0; font-size: 16px; line-height: 1.35; font-weight: 600; }
.q .meta { margin-top: auto; font-size: 13px; color: var(--muted); }
.q .open { margin-top: 6px; background: var(--ink); color: var(--paper); border: 0; border-radius: 4px; padding: 9px 14px; font-size: 14px; font-weight: 500; }
.q .open:hover { background: var(--accent); color: var(--accent-ink); }
.empty { grid-column: 1 / -1; color: var(--muted); padding: 24px 0; }
.more { display: block; margin: 20px auto 0; background: transparent; border: 1px solid var(--ink); border-radius: 4px; padding: 10px 22px; font-size: 14px; }
.more:hover { background: var(--ink); color: var(--paper); }

.owner-box { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 20px; margin-bottom: 24px; }
.owner-box h3 { margin: 0 0 14px; font-size: 18px; }
.row2 { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 0 14px; }
.feed { display: flex; flex-direction: column; gap: 14px; }
.post { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; min-width: 0; }
.post-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 8px; }
.kind { font-size: 13px; font-weight: 600; padding: 3px 12px; border-radius: 999px; }
.kind.innovation { background: #fde7b0; color: #5a3d00; }
.kind.trouble { background: var(--warn-bg); color: var(--warn-ink); }
.kind.win { background: var(--ok-bg); color: var(--ok-ink); }
.post time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.demo-tag { font-size: 12px; border: 1px dashed var(--muted); color: var(--muted); padding: 2px 8px; border-radius: 4px; }
.post h3 { margin: 0 0 6px; font-size: 18px; line-height: 1.3; text-wrap: balance; }
.post p { margin: 0; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; max-width: 68ch; }
.post .del { margin-top: 12px; background: transparent; border: 1px solid var(--line); border-radius: 4px; padding: 6px 12px; font-size: 13px; }
.post .del:hover { border-color: var(--err); color: var(--err); }
.about-note { margin: 0; color: var(--muted); max-width: 64ch; }
.rules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.rules li { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.rules h3 { margin: 0 0 6px; font-size: 16px; }
.rules p { margin: 0; color: var(--muted); font-size: 15px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-top: 20px; font-size: 14px; color: var(--muted); }

.rev { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.revs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 12px; }
.rev p { margin: 0 0 8px; font-size: 15px; }
.rev small { color: var(--muted); }

.side { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.chat { border-radius: 12px; padding: 24px; background: linear-gradient(160deg, #9b1c2e 0 55%, #230a10 55% 100%); color: #fff; min-height: 220px; display: flex; flex-direction: column; justify-content: flex-end; }
.chat b { font-family: var(--font-display); font-size: 20px; line-height: 1.2; text-transform: uppercase; background: #230a10; padding: 6px 10px; display: inline-block; width: fit-content; }
.chat span { margin-top: 10px; font-size: 14px; opacity: .92; }
.side h2 { font-family: var(--font-display); font-weight: 500; font-size: 22px; margin: 0 0 14px; }
.news { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.news li { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.news time { font-size: 13px; color: var(--muted); display: block; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.news a { font-weight: 600; text-decoration: none; }
.news a:hover { text-decoration: underline; }
.all { width: 100%; background: var(--nav); color: var(--nav-ink); border: 0; border-radius: 4px; padding: 11px; font-size: 14px; }

footer { background: var(--nav); color: var(--nav-ink); }
footer .wrap { padding-block: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 28px; font-size: 14px; opacity: .85; }

dialog { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); padding: 26px; width: min(460px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow-y: auto; }
dialog::backdrop { background: rgba(8,12,20,.6); }
.dhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.dhead h2 { font-family: var(--font-display); font-weight: 500; font-size: 20px; margin: 0; }
.x { background: transparent; border: 1px solid var(--line); border-radius: 4px; padding: 5px 11px; font-size: 14px; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tabs button { flex: 1; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 9px; font-size: 14px; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 14px; font-weight: 500; }
.field input, .field select, .field textarea { padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); width: 100%; }
.field textarea { resize: vertical; min-height: 78px; }
.field small { color: var(--muted); font-size: 13px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin-bottom: 14px; }
.check input { margin-top: 4px; }
.err { color: var(--err); font-size: 14px; min-height: 1.3em; margin: 0 0 10px; }
.submit { width: 100%; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 4px; padding: 12px; font-weight: 600; }
.demo { font-size: 13px; color: var(--muted); margin: 12px 0 0; }

@media (max-width: 960px) { .layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding: 26px 22px; }
  .cover { display: none; }
  .ask { padding: 26px 22px; }
  .ask form { grid-template-columns: minmax(0, 1fr); }
  .row2 { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: no-preference) {
  .q, .tag { transition: transform .15s ease; }
  .q:hover, .tag:hover { transform: translateY(-2px); }
}

/* ---- real-site additions: discussion page, profile, admin, uploads ---- */
[hidden] { display: none !important; }
img, video { max-width: 100%; }
.brand-alpha { height: 38px; width: auto; }
a.chat, a.all { text-decoration: none; display: flex; }
a.all { display: inline-block; font-weight: 600; margin-top: 4px; }
a.all:hover { text-decoration: underline; }
.news-empty, .empty, .locked-note { color: var(--muted); font-size: 15px; padding: 14px 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: 8px; margin: 0 0 12px; }
.err { color: var(--err); font-size: 14px; margin: 6px 0 0; min-height: 0; }
.err:empty { display: none; }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--line); color: var(--ink); white-space: nowrap; }
.pill.pending { background: var(--pop); color: var(--pop-ink); }
.pill.approved { background: var(--ok-bg); color: var(--ok-ink); }
.pill.rejected, .pill.blocked { background: var(--warn-bg); color: var(--warn-ink); }
.count-badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--pop); color: var(--pop-ink); font-size: 12px; font-weight: 700; text-align: center; line-height: 20px; }
.banner { margin: 0 0 18px; padding: 12px 16px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); font-size: 15px; }
.banner.ok { background: var(--ok-bg); color: var(--ok-ink); }
.clickable { cursor: pointer; }
.q.clickable:hover h3 { text-decoration: underline; }

.back { background: none; border: 0; color: var(--accent); font-weight: 600; padding: 0; margin-bottom: 14px; }
.qpage { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 24px; margin-bottom: 28px; }
.qpage h1 { font-size: 26px; line-height: 1.25; margin: 10px 0 6px; overflow-wrap: anywhere; }
.qmeta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip.static { padding: 3px 10px; font-size: 13px; }
.byline { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.qbody, .msg-body, .pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.qbody { margin: 0 0 14px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 12px 0; }
.media-grid img, .media-grid video { width: 100%; max-height: 320px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #000; display: block; }
.media-grid video { object-fit: contain; }
.actions, .row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }

.thread { margin-top: 8px; }
.thread-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.msg { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; max-width: 760px; }
.msg.mine { border-color: var(--accent); margin-left: auto; }
.msg-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.msg-head strong { color: var(--ink); font-size: 14px; }
.msg-body { margin: 0; }
.composer { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; max-width: 760px; }
.composer textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); resize: vertical; }
.composer > div:last-child { margin-top: 10px; }

.uploader { margin: 10px 0; }
.up-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.attach { background: var(--paper); border: 1px dashed var(--accent); color: var(--accent); border-radius: 999px; padding: 8px 16px; font-weight: 500; }
.attach:hover { background: var(--accent); color: var(--accent-ink); }
.up-hint { color: var(--muted); font-size: 13px; }
.files { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.files li { display: flex; align-items: center; gap: 10px; font-size: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; }
.fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsize { color: var(--muted); font-size: 13px; }
.mini, .del { background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 3px 10px; font-size: 13px; color: var(--ink); }
.mini:hover { border-color: var(--accent); color: var(--accent); }
.del { color: var(--err); border-color: var(--err); }
.del:hover { background: var(--err); color: var(--surface); }

.card-box { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 22px; max-width: 640px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0 0 16px; }
.kv dt { color: var(--muted); font-size: 14px; }
.kv dd { margin: 0; }
.note-line { background: var(--paper); border-left: 3px solid var(--pop); padding: 10px 14px; margin: 0 0 16px; font-size: 15px; }
.ghost.dark { color: var(--ink); border-color: var(--line); }
.ghost.dark:hover { background: var(--paper); border-color: var(--accent); }
.btn-pop.small { padding: 8px 18px; font-size: 14px; }

.adm-h { font-family: var(--font-display); font-size: 16px; margin: 24px 0 12px; }
.adm-item { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin-bottom: 10px; }
.adm-main { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.adm-mail { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.adm-main time { color: var(--muted); font-size: 13px; margin-left: auto; }
.adm-why { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }

.ask form { display: grid; gap: 4px 20px; }
.field.full { grid-column: 1 / -1; }
.ask .field input, .ask .field select, .ask .field textarea { background: var(--surface); color: var(--ink); }
.fx.plain { font-style: normal; }
.locked-note .ghost { color: var(--ink); border-color: var(--line); }
.locked-note .row-actions { margin-top: 10px; }

/* social tile, theme switch, formula page */
.socials { border-radius: 12px; padding: 24px; background: linear-gradient(160deg, #9b1c2e 0 55%, #230a10 55% 100%); color: #fff; min-height: 220px; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; }
.socials b { font-family: var(--font-display); font-size: 20px; line-height: 1.2; background: #230a10; padding: 6px 10px; display: inline-block; width: fit-content; }
html[lang="ka"] .socials b { text-transform: none; letter-spacing: 0; }
.socials .soon { font-size: 14px; opacity: .95; }
.socials ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.socials li { font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; border: 1px dashed rgba(255,255,255,.55); background: rgba(35,10,16,.55); cursor: default; }
.theme-btn { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; font-size: 14px; }
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }
.formula-big { font-family: var(--font-math); font-style: italic; font-size: clamp(30px, 6vw, 48px); color: var(--accent); margin: 8px 0 4px; overflow-wrap: anywhere; }
.q.clickable:focus-visible { outline: 2px solid var(--accent); }
.q .open { display: inline-block; width: fit-content; }
.fn-editor { max-width: none; margin-top: 8px; }
.fn-editor textarea { min-height: 220px; }

/* owner editor (CMS) */
.cms-list { display: flex; flex-direction: column; gap: 14px; margin: 16px 0; }
.cms-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.cms-item:not(:has(.cms-num)) { grid-template-columns: minmax(0, 1fr); }
.cms-num { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 14px; font-weight: 700; }
.cms-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; min-width: 0; }
.cms-fields .field { margin-bottom: 10px; }
.cms-h { grid-column: 1 / -1; margin: 0 0 8px; font-size: 15px; }
.cms-side { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.cms-side .del { text-align: center; }
@media (max-width: 760px) { .cms-fields { grid-template-columns: minmax(0, 1fr); } .cms-item { grid-template-columns: minmax(0, 1fr); } .cms-side { flex-direction: row; } }

/* YouTube embeds */
.yt-grid { display: flex; flex-direction: column; gap: 12px; margin: 12px 0; }
.yt { position: relative; width: 100%; max-width: 640px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 60; display: flex; align-items: center; gap: 12px; max-width: min(92vw, 460px); padding: 12px 18px 12px 12px; border-radius: 12px; background: var(--ok-bg); color: var(--ok-ink); border: 1px solid color-mix(in srgb, var(--ok-ink) 28%, transparent); box-shadow: 0 10px 30px rgba(0,0,0,.18); transform: translate(-50%, 24px); opacity: 0; transition: transform .35s cubic-bezier(.2,.9,.3,1.2), opacity .25s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.bad { background: var(--warn-bg); color: var(--warn-ink); border-color: color-mix(in srgb, var(--warn-ink) 28%, transparent); }
.toast-ic { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 16px; background: var(--ok-ink); color: var(--ok-bg); }
.toast.bad .toast-ic { background: var(--warn-ink); color: var(--warn-bg); }
.toast.show .toast-ic { animation: toast-pop .5s cubic-bezier(.2,1.4,.4,1) .08s both; }
.toast-txt { display: flex; flex-direction: column; font-size: 14px; line-height: 1.35; min-width: 0; }
.toast-txt b { font-size: 15px; }
@keyframes toast-pop { from { transform: scale(.3) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .toast, .toast.show .toast-ic { transition: none; animation: none; } }

/* members, books, likes, image fields */
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.member { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.member > div { display: flex; flex-direction: column; min-width: 0; }
.member strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member small { color: var(--muted); font-size: 13px; }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; }
.soon-card { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: 28px; max-width: 560px; }
.soon-card p { margin: 0; font-size: 18px; color: var(--muted); }
.soon-ic { font-size: 34px; }
.like { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; margin-right: 10px; background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; font-size: 15px; transition: transform .15s ease, border-color .15s; }
.like:hover { border-color: var(--accent); }
.like .heart { font-size: 18px; line-height: 1; color: var(--accent); }
.like.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.like.on .heart { animation: toast-pop .35s cubic-bezier(.2,1.4,.4,1); }
.like .n { font-variant-numeric: tabular-nums; }
.tag.has-img, .hero.has-img, .socials.has-img { background-repeat: no-repeat; }
.q .plate.has-img { background-repeat: no-repeat; border-bottom-color: transparent; }
.q .plate.has-img .fx { color: #fff; opacity: 1; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.imgfield .img-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.img-prev { width: 140px; height: 84px; border: 1px dashed var(--line); border-radius: 8px; overflow: hidden; display: grid; place-items: center; color: var(--muted); font-size: 13px; background: var(--paper); }
.img-prev img { width: 100%; height: 100%; object-fit: cover; }
.img-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cms-fields .full { grid-column: 1 / -1; }
.cms-fields .note-line { margin-bottom: 14px; }

/* socials badges, hero with custom picture */
.socials { gap: 12px; }
.socials b { font-family: var(--font-display); }
.socials ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.socials li { padding: 0; border: 0; background: none; }
.socials li.s-soon, .socials a.s-link { display: flex; align-items: center; gap: 9px; padding: 7px 12px 7px 8px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #fff; background: rgba(35,10,16,.62); border: 1px solid rgba(255,255,255,.28); text-decoration: none; }
.socials li.s-soon { opacity: .85; border-style: dashed; }
.socials a.s-link:hover { background: rgba(35,10,16,.85); border-color: var(--pop); }
.s-ic { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--pop); color: var(--pop-ink); overflow: hidden; }
.s-ic img { width: 100%; height: 100%; object-fit: cover; }
.hero.has-img .hero-art, .hero.has-img .cover { display: none; }

/* photo replaces the whole tile: no overlay, no formula text */
.tag.has-img .go { background: rgba(20,6,10,.78); }
.q .plate.has-img .fx { display: none; }
.tag.notext .in { visibility: hidden; }
.cms-check { display: flex; align-items: center; gap: 8px; }

/* sidebar (news + socials) only on the home tab */
.layout.no-side { grid-template-columns: minmax(0, 1fr); }
.layout.no-side .side { display: none; }
.socials b { background: none; padding: 0; text-shadow: 0 1px 8px rgba(0,0,0,.35); }

/* section tile: name only, on a dark band over the picture */
.tag { min-height: 0; aspect-ratio: 4 / 3; }
.tag .in { flex: none; padding: 0; gap: 0; }
.tag .in h3 { padding: 14px 16px; background: rgba(20,6,10,.82); text-align: center; font-size: 22px; font-weight: 600; text-transform: none; letter-spacing: 0; line-height: 1.2; }
.tag::after { content: ""; flex: 1; order: 1; }
.tag .go { order: 2; }
.tag.notext .in { visibility: hidden; }

/* banner carousel */
.hero { display: block; padding: 0; min-height: 300px; }
.hero-slide { display: none; position: relative; padding: 36px 36px 68px; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: center; min-height: 300px; }
.hero-slide.active { display: grid; animation: slidein .45s ease both; }
.hero-slide:has(.cover) { grid-template-columns: minmax(0, 1fr) 170px; }
.hero h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 4vw, 42px); line-height: 1.1; margin: 8px 0 14px; text-wrap: balance; }
.hero-nav { position: absolute; left: 36px; bottom: 18px; display: flex; align-items: center; gap: 10px; z-index: 2; }
.hero-nav[hidden] { display: none; }
.hero-arrow { width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(255,255,255,.45); background: rgba(35,10,16,.55); color: #fff; font-size: 20px; line-height: 1; display: grid; place-items: center; padding: 0 0 3px; }
.hero-arrow:hover { background: rgba(35,10,16,.85); }
.hero-dots { display: flex; gap: 8px; }
.hero-dot { width: 10px; height: 10px; border-radius: 50%; padding: 0; border: 1px solid #fff; background: transparent; }
.hero-dot[aria-current="true"] { background: var(--pop); border-color: var(--pop); }
@keyframes slidein { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hero-slide.active { animation: none; } }
@media (max-width: 640px) { .hero-slide { padding: 24px 20px 64px; } .hero-slide:has(.cover) { grid-template-columns: minmax(0, 1fr); } .hero-slide .cover { display: none; } .hero-nav { left: 20px; } }
/* socials as a wide strip */
.socials { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 20px 24px; gap: 16px; background: linear-gradient(120deg, #6e1424, #230a10); }
.socials ul { display: flex; flex-wrap: wrap; }
.socials .soon { margin-right: auto; }
.hero > .hero-nav { position: absolute; }

/* top row: carousel + socials tile, equal height; sliding slides */
.top { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: stretch; }
.hero { height: 340px; min-height: 0; }
.hero > .hero-slide, .hero > .hero-slide.active { position: absolute; inset: 0; min-height: 0; display: grid; align-content: center; padding: 36px 36px 68px; background-repeat: no-repeat; }
.hero > .hero-slide { visibility: hidden; transform: translateX(100%); animation: none; }
.hero > .hero-slide.active { visibility: visible; transform: none; animation: none; }
.hero-slide.has-img .cover { display: none; }
.hero.has-img .hero-art { display: block; }
.socials { min-height: 0; height: 100%; flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-end; padding: 24px; gap: 12px; background: linear-gradient(160deg, #9b1c2e 0 55%, #230a10 55% 100%); }
.socials .soon { margin-right: 0; }
.socials ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 960px) { .top { grid-template-columns: minmax(0, 1fr); } .socials { min-height: 220px; } }
@media (max-width: 640px) { .hero { height: 430px; } .hero > .hero-slide, .hero > .hero-slide.active { padding: 24px 20px 64px; } }

/* spacing fix: content never reaches the controls */
.hero { height: 390px; }
.hero > .hero-slide, .hero > .hero-slide.active { padding: 32px 36px 84px; align-content: start; }
.hero-slide h1, .hero-slide h2 { font-size: clamp(24px, 3.4vw, 36px); margin: 6px 0 12px; }
.hero-slide p { margin: 0 0 18px; }
.hero > .hero-nav { left: auto; right: 24px; bottom: 22px; }
@media (max-width: 640px) {
  .hero { height: 520px; }
  .hero > .hero-slide, .hero > .hero-slide.active { padding: 24px 20px 84px; }
  .hero > .hero-nav { right: 20px; bottom: 20px; }
}

/* compact top row for small screens */
.layout { padding-block: 20px 48px; }
.top { gap: 18px; }
.hero { height: clamp(280px, 36vh, 330px); }
.hero > .hero-slide, .hero > .hero-slide.active { padding: 24px 32px 24px; }
.hero-slide h1, .hero-slide h2 { font-size: clamp(22px, 3vw, 32px); margin: 4px 0 10px; }
.hero-slide p { margin: 0 0 14px; }
.hero > .hero-nav { right: 20px; bottom: 16px; }
.socials { padding: 18px 20px; gap: 10px; }
@media (max-width: 960px) { .socials { min-height: 0; } }
@media (max-width: 640px) {
  .hero { height: 470px; }
  .hero > .hero-slide, .hero > .hero-slide.active { padding: 20px 20px 72px; }
}
.hero-slide:has(.cover) { grid-template-columns: minmax(0, 1fr) 140px; }
.hero-slide .cover { width: 140px; align-self: start; padding: 10px; }
