/* =========================================================
   Гилдията — Design System v2
   Palette: charcoal dark base (#0a0a0f), red + gold accents, gray
   Fonts:   Playfair Display (display/headings) + Inter (body)
   ========================================================= */

/* Animatable "active vertical" accent - lets the home feed tab bar and its
   sidebar cross-fade color on navigation instead of hard-cutting (see
   .feed-toolbar and body.gld-home-feed below). Registered globally since
   @property must be a top-level rule, but it only ever changes value on
   the home feed - everywhere else --vc stays transparent (a no-op).
   Deliberately NOT gold: the transition only plays when the value
   actually changes, and гold is one of the seven real tab colors
   (Всички's own) - starting there meant Всички's own gold→gold "change"
   was a no-op, so it never visibly animated in like every other tab did.
   transparent guarantees every tab, including Всички, is a genuine
   transition on load. */
@property --vc {
  syntax: '<color>';
  inherits: true;
  initial-value: transparent;
}

:root {
  --vc:            transparent;
  --bg:            #0a0a0f;
  --bg-card:       #13131a;
  --bg-card-2:     #1a1a24;
  --border:        #252530;
  --border-gold:   rgba(201, 162, 39, 0.18);
  --topbar-h:      64px;
  --sidebar-w:     228px;
  --border-red:    rgba(192, 57, 43, 0.30);
  --text:          #ffffff;
  --text-muted:    #d0d0df;
  --red:           #c0392b;
  --red-hover:     #e74c3c;
  --gold:          #c9a227;
  --gold-light:    #f0c040;
  --white:         #ffffff;

  --font-display:  'Playfair Display', Georgia, serif;
  --font-body:     'Inter', system-ui, -apple-system, sans-serif;

  --r:     6px;
  --r-lg:  12px;
  --shadow:    0 2px 12px rgba(0,0,0,.5);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.6);
  --t:     0.15s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 17px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
  transition: --vc .6s cubic-bezier(.22,.61,.36,1);
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img { max-width: 100%; }

/* Ambient wash tied to --vc - only on pages with a .feed-toolbar vertical
   tab bar (home feed, /instruments/, new-thread's category picker), where
   picking/switching a tab actually changes --vc. Every other page never
   touches --vc, so this radial gradient just renders at its transparent
   initial-value there - identical to var(--bg). */
body.gld-home-feed, body.gld-tools-page, body.gld-new-thread {
  background: radial-gradient(1500px 560px at 14% -14%, color-mix(in srgb, var(--vc) 20%, transparent), transparent 62%) var(--bg);
}

a { color: var(--gold); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--gold-light); }

/* ── Container ── */
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ══════════════════════════════════════════
   APP SHELL — fixed topbar + left sidebar
   ══════════════════════════════════════════ */

/* Top bar */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--topbar-h); z-index: 200;
  background: rgba(19,19,26,.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: transform .25s ease;
}
.topbar-inner {
  display: flex; align-items: center;
  height: 100%; padding: 0 20px 0 14px; gap: 14px;
}

/* Hamburger toggle */
.topbar-hamburger {
  width: 32px; height: 32px; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 5px;
  background: none; border: none; cursor: pointer;
  border-radius: var(--r); transition: background var(--t); padding: 0;
}
.topbar-hamburger:hover { background: rgba(255,255,255,.07); }
.topbar-hamburger span {
  display: block; width: 18px; height: 2px;
  background: var(--text-muted); border-radius: 2px; transition: all .2s;
}
.topbar-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.topbar-hamburger.is-open span:nth-child(2) { opacity: 0; }
.topbar-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Logo */
.site-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.logo-icon { width: 28px; height: 28px; object-fit: contain; }
.logo-labels { display: flex; flex-direction: column; gap: 1px; }
.logo-text {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 700; color: var(--white); letter-spacing: -.5px;
  line-height: 1.1;
}
.logo-magi {
  font-size: .6rem; color: var(--gold); font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase; line-height: 1;
}

/* Auth section */
.site-nav-auth { display: flex; gap: 14px; align-items: center; flex-shrink: 0; margin-left: auto; }
.site-nav-auth a { font-size: .875rem; color: var(--white); transition: color var(--t); }
.site-nav-auth a:not(.btn):hover { color: var(--gold); }

/* ── Left sidebar ── */
.left-sidebar {
  position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
  width: var(--sidebar-w); z-index: 100;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
  transition: transform .22s ease;
}
.left-sidebar.is-collapsed {
  transform: translateX(calc(-1 * var(--sidebar-w)));
}

/* Sidebar nav items */
.sidebar-nav { padding: 14px 10px 0; flex: 1; }
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r);
  color: var(--text-muted); font-size: .86rem; font-weight: 500;
  transition: background var(--t), color var(--t);
  text-decoration: none; font-family: var(--font-body);
  width: 100%; text-align: left; background: none; border: none;
  cursor: pointer; position: relative;
}
.sidebar-item:hover { background: rgba(255,255,255,.06); color: var(--white); }
.sidebar-item:hover .sidebar-item__icon { color: var(--gold); }
.sidebar-item--active { background: rgba(201,162,39,.1); color: var(--white); }
.sidebar-item--active .sidebar-item__icon { color: var(--gold); }
.sidebar-item--sm { font-size: .82rem; }
.sidebar-item__icon { width: 16px; text-align: center; font-size: .88rem; flex-shrink: 0; transition: color var(--t); }
.sidebar-divider { height: 1px; background: var(--border); margin: 12px 10px; }
.sidebar-section-label {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 22px 3px;
  opacity: .55;
}
.sidebar-badge {
  margin-left: auto;
  background: rgba(201,162,39,.15);
  color: var(--gold);
  font-size: .62rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
  flex-shrink: 0;
}
.sidebar-footer { padding: 0 10px 14px; }
.sidebar-footer__copy { font-size: .75rem; color: rgba(138,138,154,.5); padding: 12px 12px 0; border-top: 1px solid var(--border); line-height: 1.6; }

/* ── Pinned tools (Работно бюро launcher) — always expanded, no accordion ── */
.sidebar-hint {
  font-size: .72rem; color: var(--text-muted); opacity: .7;
  padding: 0 12px 8px; font-style: italic;
}
.sidebar-pinned-item {
  display: flex; align-items: flex-start; gap: 2px;
  margin: 2px 10px;
  border-radius: var(--r);
  cursor: grab;
  transition: background var(--t), box-shadow var(--t);
}
.sidebar-pinned-item:hover { background: rgba(255,255,255,.05); }
.sidebar-pinned-item.is-dragging { opacity: .35; }
.sidebar-pinned-item.is-drag-over { box-shadow: inset 0 2px 0 var(--gold); }
.sidebar-pinned-item__link {
  display: flex; align-items: center; gap: 10px;
  flex: 1; min-width: 0;
  padding: 9px 6px 9px 9px;
  border-radius: var(--r);
  text-decoration: none;
}
.sidebar-pinned-item__icon {
  width: 30px; height: 30px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 7px; font-size: .85rem;
}
.sidebar-pinned-item__icon--sm { width: 24px; height: 24px; font-size: .74rem; border-radius: 6px; }
.sidebar-pinned-item__img { width: 17px; height: 17px; object-fit: contain; }
.sidebar-pinned-item__label {
  font-size: .84rem; font-weight: 600; color: var(--text-muted);
  line-height: 1.3;
}
.sidebar-pinned-item:hover .sidebar-pinned-item__label { color: var(--text); }
.sidebar-pinned-item__remove {
  flex-shrink: 0; width: 26px; height: 26px; margin: 9px 6px 0 0;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 6px;
  color: var(--text-muted); font-size: .74rem; opacity: .3; cursor: pointer;
  transition: opacity var(--t), background var(--t), color var(--t);
}
.sidebar-pinned-item:hover .sidebar-pinned-item__remove { opacity: .7; }
.sidebar-pinned-item__remove:hover { opacity: 1 !important; background: rgba(192,57,43,.12); color: var(--red-hover); }

/* Brief highlight after a tool was just pinned (post-reload) - unmistakable
   "yes, that worked" confirmation without relying on a toast the user might
   not notice. */
@keyframes gldPinFlash {
  0%   { background: rgba(201,162,39,.35); }
  100% { background: transparent; }
}
.sidebar-pinned-item--flash .sidebar-pinned-item__link { animation: gldPinFlash 1.8s ease-out; border-radius: var(--r); }

/* Magi/SAF-T permanent row - distinct blue treatment, always last, not
   draggable (no .sidebar-pinned-item class - excluded from drag JS on
   purpose) and no remove button. */
.sidebar-magi-pin {
  display: flex; align-items: center;
  margin: 6px 10px 2px;
  border-radius: var(--r);
  border: 1.5px solid rgba(74,158,234,.45);
  background: rgba(74,158,234,.1);
  box-shadow: 0 0 0 1px rgba(74,158,234,.08);
}
.sidebar-magi-pin .sidebar-pinned-item__link { padding: 9px 10px; }
.sidebar-magi-pin:hover { border-color: rgba(74,158,234,.7); background: rgba(74,158,234,.16); }
.sidebar-magi-pin:hover .sidebar-pinned-item__label { color: var(--text); }

/* Single "there's more, add them here" link - replaces the old flyout
   with one plain-language destination (/instruments/). */
.sidebar-add-tool-link {
  display: grid; grid-template-columns: auto 1fr; align-items: center;
  column-gap: 10px; row-gap: 4px;
  width: calc(100% - 20px); box-sizing: border-box;
  padding: 10px 12px; margin: 6px 10px 4px;
  border-radius: var(--r);
  border: 1.5px dashed rgba(201,162,39,.4); background: rgba(201,162,39,.06);
  text-decoration: none;
  transition: background var(--t), border-color var(--t);
}
.sidebar-add-tool-link:hover { background: rgba(201,162,39,.12); border-color: rgba(201,162,39,.65); }
.sidebar-add-tool__icon {
  grid-column: 1; grid-row: 1;
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%;
  background: var(--gold); color: #0a0a0f;
  display: flex; align-items: center; justify-content: center; font-size: .76rem;
}
.sidebar-add-tool-link__title {
  grid-column: 2; grid-row: 1; min-width: 0;
  font-size: .82rem; font-weight: 700; color: var(--gold); line-height: 1.3;
}
.sidebar-add-tool-link__sub {
  grid-column: 1 / -1; grid-row: 2;
  font-size: .7rem; color: var(--text-muted); line-height: 1.3;
}

#pinnedToolsList.is-drop-target { background: rgba(201,162,39,.05); border-radius: var(--r); }

/* ── App shell ── */
.app-shell {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  flex: 1;
  display: flex;
  flex-direction: column;
  transition: margin-left .22s ease;
  min-height: 100vh;
}
.app-shell.sidebar-collapsed { margin-left: 0; }

.nav-user-link { display: flex; align-items: center; gap: 8px; color: var(--white); text-decoration: none; }
.nav-user-link:hover { color: var(--gold); }
.nav-user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(201,162,39,0.15); border: 1px solid rgba(201,162,39,0.35);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; color: var(--gold); flex-shrink: 0;
}
/* position:relative needed for the ! dot badge — set here, not inline */
.nav-user-avatar { position: relative; }
/* Unverified nav avatar: gray ring instead of gold + amber ! dot */
.nav-user-avatar--unverified {
  background: rgba(138,138,154,.08);
  border-color: rgba(138,138,154,.25);
  color: var(--text-muted);
}
.nav-user-avatar--unverified img,
.nav-user-avatar--unverified .user-avatar { border-color: rgba(138,138,154,.25) !important; }
.unverified-dot {
  position: absolute; bottom: -3px; right: -3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #e08a5b; color: #fff;
  font-size: .55rem; font-weight: 900; line-height: 14px;
  text-align: center; border: 1.5px solid var(--bg);
  pointer-events: none; z-index: 1;
}
/* Locked vote buttons (unverified users) */
.vote-btn--locked,
.comment-vote-btn--locked {
  opacity: .5;
  filter: grayscale(.5);
}

/* ── Nav dropdown (reused by sidebar instruments flyout) ── */
.nav-dropdown { position: relative; }
.nav-dropdown__trigger { display: flex; align-items: center; gap: 4px; cursor: default; }
.nav-dropdown__caret { font-size: .55rem; opacity: .55; transition: transform var(--t); }
.nav-dropdown:hover .nav-dropdown__caret { transform: rotate(180deg); opacity: 1; }

.nav-dropdown__menu {
  display: none;
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  width: 340px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.04);
  z-index: 200;
  padding-top: 10px; /* bridges cursor gap */
}
.nav-dropdown:hover .nav-dropdown__menu { display: block; }

/* Magi featured strip */
.nav-dropdown__magi {
  display: flex; align-items: center; gap: 12px;
  margin: 0 10px 0; padding: 12px 14px;
  background: linear-gradient(135deg, #a07d18 0%, #c9a227 50%, #a07d18 100%);
  border-radius: var(--r); text-decoration: none;
  transition: filter var(--t);
}
.nav-dropdown__magi::after { display: none; }
.nav-dropdown__magi:hover { filter: brightness(1.1); }
.nav-dropdown__magi-logo {
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(0,0,0,.18); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-dropdown__magi-text { flex: 1; min-width: 0; }
.nav-dropdown__magi-title { font-size: .84rem; font-weight: 700; color: #0f0f18; line-height: 1.2; margin-bottom: 2px; }
.nav-dropdown__magi-sub   { font-size: .71rem; color: rgba(0,0,0,.55); }
.nav-dropdown__magi-arrow { font-size: .75rem; color: rgba(0,0,0,.4); flex-shrink: 0; }

/* Divider with label */
.nav-dropdown__divider {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px 6px;
}
.nav-dropdown__divider span {
  font-size: .62rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-muted);
}
.nav-dropdown__divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Tools grid */
.nav-dropdown__grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 2px; padding: 0 10px;
}
.nav-dropdown__item {
  display: flex; flex-direction: column; gap: 1px;
  padding: 9px 10px; border-radius: var(--r);
  text-decoration: none; transition: background var(--t);
}
.nav-dropdown__item::after { display: none; }
.nav-dropdown__item:hover { background: var(--bg-card-2); }
.nav-dropdown__item-label {
  font-size: .6rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gold); opacity: .7;
}
.nav-dropdown__item-title { font-size: .8rem; font-weight: 500; color: var(--text-muted); line-height: 1.3; }
.nav-dropdown__item:hover .nav-dropdown__item-title { color: var(--text); }

/* Footer link */
.nav-dropdown__footer {
  display: block; padding: 10px 14px; margin-top: 4px;
  font-size: .75rem; font-weight: 600; color: var(--text-muted);
  text-align: center; border-top: 1px solid var(--border);
  text-decoration: none; transition: color var(--t), background var(--t);
}
.nav-dropdown__footer::after { display: none; }
.nav-dropdown__footer:hover { color: var(--gold); background: rgba(201,162,39,.04); }

/* ═══════════════════════════════════════
   BUTTONS
═══════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 22px; border-radius: var(--r);
  font-size: .875rem; font-weight: 600; cursor: pointer;
  border: none; transition: background var(--t), color var(--t), transform var(--t), border-color var(--t);
  text-decoration: none; letter-spacing: .01em; white-space: nowrap;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: transparent; color: var(--red); border: 1.5px solid var(--red); }
.btn-primary:hover { background: var(--red); color: #fff; border-color: var(--red); transform: translateY(-1px); }

.btn-gold { background: var(--gold); color: #0a0a0f; }
.btn-gold:hover { background: var(--gold-light); color: #0a0a0f; transform: translateY(-1px); }

.btn-outline { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-outline:hover { color: var(--text); border-color: rgba(240,240,240,.3); transform: translateY(-1px); }

.btn-lg { padding: 14px 36px; font-size: .975rem; }

/* ═══════════════════════════════════════
   MESSAGES
═══════════════════════════════════════ */
.messages-bar { background: var(--bg-card-2); border-bottom: 1px solid var(--border); }
.messages-bar .container { padding-top: 10px; padding-bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.message { padding: 10px 14px; border-radius: var(--r); font-size: .875rem; }
.message--success { background: #1e3d1e; color: #6fcf6f; border-left: 3px solid #3a9c3a; }
.message--error   { background: #3d1e1e; color: #cf6f6f; border-left: 3px solid #c42a2a; }
.message--info    { background: #1e2d3d; color: #6f9fcf; border-left: 3px solid #2a6ac4; }
.message--warning { background: #3d301e; color: #cfb06f; border-left: 3px solid #c48a2a; }

/* ═══════════════════════════════════════
   PAGE HERO
═══════════════════════════════════════ */
.page-hero {
  position: relative;
  padding: 80px 0 64px; text-align: center; overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(201, 162, 39, 0.09) 0%, transparent 65%),
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(201, 162, 39, 0.09) 0%, transparent 65%);
  pointer-events: none;
}
.page-hero > * { position: relative; z-index: 1; }

.hero-eyebrow {
  font-size: .78rem; font-weight: 600; letter-spacing: .2em;
  text-transform: uppercase; color: var(--gold);
  margin-bottom: 20px; display: block;
}
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 4.4rem);
  font-weight: 900; color: var(--white);
  line-height: 1.06; letter-spacing: -.02em;
  margin-bottom: 16px;
}
.page-hero h1 mark {
  background: none;
  background-image: linear-gradient(90deg, #b8891f 0%, #f0c040 35%, #e8c86a 60%, #c9a227 80%, #f0c040 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: goldShimmer 4s linear infinite;
}

@keyframes goldShimmer {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}
.hero-sub {
  color: var(--text-muted);
  font-size: clamp(.9rem, 1.8vw, 1.05rem);
  max-width: 500px; margin: 0 auto 36px;
  line-height: 1.75;
}
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ═══════════════════════════════════════
   SECTIONS
═══════════════════════════════════════ */
.section { padding: 56px 0; }
.section + .section { border-top: 1px solid var(--border); }

.section-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 28px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.45rem; font-weight: 700; color: var(--white);
}
.section-link { font-size: .82rem; color: var(--text-muted); transition: color var(--t); }
.section-link:hover { color: var(--gold); }

.section-empty {
  padding: 40px 0; text-align: center;
  color: var(--text-muted); font-size: .9rem;
}

/* ═══════════════════════════════════════
   GRID
═══════════════════════════════════════ */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

/* ═══════════════════════════════════════
   CARDS (base)
═══════════════════════════════════════ */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 24px;
  transition: border-color var(--t), transform var(--t), box-shadow var(--t);
}
.card:hover { border-color: var(--border-gold); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,.45); }
.card + .card { margin-top: 16px; }

/* Static content card — a reading surface or form, not a clickable link.
   The lift/shadow hover from .card is a "this is tappable" affordance that
   makes no sense here, so switch it off and use tighter, less airy padding. */
.card--static { padding: 20px 24px; }
.card--static:hover { border-color: var(--border); transform: none; box-shadow: none; }
@media (max-width: 680px) {
  .card--static { padding: 16px 18px; }
}

/* ── Tool cards ── */
.tool-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-top: 3px solid rgba(201, 162, 39, 0.2);
  border-radius: var(--r-lg); padding: 24px 22px;
  display: block; text-decoration: none; color: inherit;
  transition: border-color var(--t), border-top-color var(--t), transform var(--t), box-shadow var(--t);
}
.tool-card:hover {
  border-color: var(--border-gold); border-top-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0,0,0,.5);
  color: inherit; text-decoration: none;
}
.tool-card__label {
  font-size: .65rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gold);
  display: block; margin-bottom: 10px;
}
.tool-card__title {
  font-size: .975rem; font-weight: 700; color: var(--white);
  margin-bottom: 8px; line-height: 1.3;
}
.tool-card__desc { color: var(--text-muted); font-size: .855rem; line-height: 1.55; }

/* ── Magi special tool card ── */
@keyframes goldShine {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.tool-card--magi {
  background: linear-gradient(135deg, #a07d18 0%, #c9a227 50%, #a07d18 100%);
  border: none;
  border-top: none;
  position: relative;
  overflow: hidden;
}
.tool-card--magi::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.25) 50%, transparent 60%);
  background-size: 200% 100%;
  background-position: -200% center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
}
.tool-card--magi:hover::after {
  opacity: 1;
  animation: goldShine .6s ease forwards;
}
.tool-card--magi:hover {
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(201,162,39,.4);
}
.tool-card--magi .tool-card__label { color: rgba(0,0,0,0.55); }
.tool-card--magi .tool-card__title { color: #0f0f18; }
.tool-card--magi .tool-card__desc  { color: rgba(0,0,0,0.65); }

/* ── /instruments/ flat row list (not cards - color-coded rows) ── */
.tool-row-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding-bottom: 60px; }
.tool-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 6px;
  transition: border-color var(--t);
}
.tool-row:hover { border-color: var(--border-gold); }
.tool-row[draggable="true"] { cursor: grab; }
.tool-row[draggable="true"]:active { cursor: grabbing; }
.tool-row.is-dragging { opacity: .4; }
.tool-row__main {
  display: flex; align-items: center; gap: 14px;
  flex: 1; min-width: 0; padding: 10px 8px;
  text-decoration: none;
}
.tool-row__icon {
  position: relative;
  width: 42px; height: 42px; flex-shrink: 0; border-radius: var(--r);
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.tool-row__img { width: 20px; height: 20px; object-fit: contain; }
.tool-row__text { min-width: 0; }
.tool-row__title { display: block; font-size: .95rem; font-weight: 700; color: var(--white); }
.tool-row__desc  { display: block; font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.tool-row__pin {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; margin-right: 6px; border-radius: var(--r);
  border: 1.5px solid rgba(201,162,39,.4); background: rgba(201,162,39,.1);
  color: var(--gold); font-size: .82rem; font-weight: 700; cursor: pointer;
  transition: all var(--t); font-family: inherit; white-space: nowrap;
}
.tool-row__pin:hover { background: rgba(201,162,39,.18); }
.tool-row__pin--active { border-color: var(--border); background: transparent; color: var(--text-muted); }
.tool-row__pin--active:hover { border-color: rgba(192,57,43,.4); color: var(--red-hover); background: rgba(192,57,43,.08); }

/* Magi/SAF-T row - distinct blue treatment, matches the sidebar's fixed
   entry. Not pinnable - has its own open button instead of .tool-row__pin. */
.tool-row--magi {
  border: 1.5px solid rgba(74,158,234,.45);
  background: rgba(74,158,234,.06);
  box-shadow: 0 0 0 1px rgba(74,158,234,.08);
}
.tool-row--magi:hover { border-color: rgba(74,158,234,.7); }
.tool-row__pin-badge {
  position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .58rem; color: #fff; background: #4a9eea;
  border: 2px solid var(--bg-card);
}
.tool-row__open-btn {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; margin-right: 6px; border-radius: var(--r);
  border: 1.5px solid #4a9eea; background: #4a9eea;
  color: #fff; font-size: .82rem; font-weight: 700;
  text-decoration: none; white-space: nowrap;
  transition: all var(--t);
}
.tool-row__open-btn:hover { background: #3d8ed9; border-color: #3d8ed9; }
.tool-row__open-btn i { font-size: .72rem; }

/* Coming-soon preview cards (Финанси/Бизнес/Икономика mockups) - same shape
   as a real tool row, dimmed and non-interactive so they read as a preview
   rather than a dead link. */
.tool-row--soon { opacity: .7; }
.tool-row--soon:hover { border-color: inherit; }
.tool-row--soon .tool-row__main { cursor: default; }
@media (max-width: 900px) {
  .tool-row-list { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .tool-row { flex-wrap: wrap; }
  .tool-row__desc { display: none; }
}

/* ── Article cards ── */
.article-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 0;
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit; overflow: hidden;
  position: relative;
  transition: border-color var(--t), transform var(--t), box-shadow var(--t);
}
.article-card::after {
  content: ''; position: absolute; bottom: 0; left: 50%;
  width: 0; height: 2px; background: var(--gold);
  transform: translateX(-50%);
  transition: width .35s ease;
}
.article-card:hover { border-color: var(--border-gold); transform: translateY(-3px); color: inherit; text-decoration: none; box-shadow: 0 8px 28px rgba(0,0,0,.25); }
.article-card:hover::after { width: 80%; }

/* Thumbnail */
.article-card__thumb {
  width: 100%; overflow: hidden;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  line-height: 0; flex-shrink: 0;
}
.article-card__thumb img {
  width: 100%; height: 180px; object-fit: cover;
  transition: transform .35s ease;
}
.article-card:hover .article-card__thumb img { transform: scale(1.03); }

/* No-image placeholder */
.article-card__thumb--placeholder {
  height: 100px;
  background: linear-gradient(135deg, rgba(201,162,39,.08) 0%, rgba(201,162,39,.03) 100%);
  display: flex; align-items: center; justify-content: center;
}
.article-card__thumb--placeholder i { font-size: 1.4rem; color: rgba(201,162,39,.25); }

/* Body area */
.article-card__body-wrap { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }

/* Meta row: badge + read time */
.article-card__meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.article-card__badge {
  display: inline-block; padding: 2px 9px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px; font-size: .62rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em;
}
.article-card__badge--news      { background: rgba(59,130,246,.1);  border-color: rgba(59,130,246,.25);  color: #93c5fd; }
.article-card__badge--guide     { background: rgba(34,197,94,.1);   border-color: rgba(34,197,94,.25);   color: #4ade80; }
.article-card__badge--analysis  { background: rgba(168,85,247,.1);  border-color: rgba(168,85,247,.25);  color: #c4b5fd; }
.article-card__badge--opinion   { background: rgba(201,162,39,.12); border-color: rgba(201,162,39,.25);  color: var(--gold); }
.article-card__badge--commentary{ background: rgba(249,115,22,.1);  border-color: rgba(249,115,22,.25);  color: #fdba74; }
.article-card__badge--absurd    { background: rgba(239,68,68,.1);   border-color: rgba(239,68,68,.25);   color: #fca5a5; }
.article-card__badge--intl      { background: rgba(14,165,233,.1);  border-color: rgba(14,165,233,.25);  color: #7dd3fc; }

.article-card__read-time {
  font-size: .72rem; color: var(--text-muted); font-weight: 500;
  display: flex; align-items: center; gap: 4px;
}
.article-card__read-time i { font-size: .75rem; }

.article-card__title {
  font-size: .95rem; font-weight: 700; color: var(--white);
  margin-bottom: 8px; line-height: 1.38;
  transition: color var(--t);
}
.article-card:hover .article-card__title { color: #fff; }

.article-card__desc { color: var(--text-muted); font-size: .84rem; line-height: 1.6; flex: 1; }

.article-card__footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
}
.article-card__cta {
  font-size: .8rem; font-weight: 600; color: var(--gold);
  display: inline-flex; align-items: center; gap: 5px;
  transition: gap var(--t), color var(--t);
}
.article-card:hover .article-card__cta { gap: 8px; }
.article-card__cta i { font-size: .75rem; transition: transform var(--t); }
.article-card:hover .article-card__cta i { transform: translateX(2px); }

.article-card__source {
  font-size: .72rem; color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 4px;
}
.article-card__source i { font-size: .65rem; }

/* ── Featured hero card ── */
.article-hero {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; margin-bottom: 32px;
  text-decoration: none; color: inherit;
  transition: border-color var(--t), box-shadow var(--t);
}
.article-hero:hover { border-color: var(--border-gold); color: inherit; text-decoration: none; box-shadow: 0 10px 36px rgba(0,0,0,.28); }
.article-hero__thumb { overflow: hidden; }
.article-hero__thumb img { width: 100%; height: 100%; min-height: 280px; object-fit: cover; transition: transform .4s ease; }
.article-hero:hover .article-hero__thumb img { transform: scale(1.03); }
.article-hero__thumb--placeholder {
  min-height: 280px;
  background: linear-gradient(135deg, rgba(201,162,39,.1) 0%, rgba(201,162,39,.03) 100%);
  display: flex; align-items: center; justify-content: center;
}
.article-hero__thumb--placeholder i { font-size: 2.5rem; color: rgba(201,162,39,.2); }
.article-hero__body {
  padding: 36px 32px; display: flex; flex-direction: column; justify-content: center;
}
.article-hero__eyebrow {
  font-size: .65rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.article-hero__title {
  font-family: var(--font-display); font-size: 1.4rem; font-weight: 800;
  color: var(--white); line-height: 1.28; margin-bottom: 14px;
}
.article-hero__desc { color: var(--text-muted); font-size: .9rem; line-height: 1.7; margin-bottom: 20px; flex: 1; }
.article-hero__cta {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .85rem; font-weight: 600; color: var(--gold);
  transition: gap var(--t);
}
.article-hero:hover .article-hero__cta { gap: 10px; }
.article-hero__cta i { font-size: .7rem; transition: transform var(--t); }
.article-hero:hover .article-hero__cta i { transform: translateX(3px); }

/* ── Topic filter pills ── */
.topic-pills {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px;
}
.topic-pill {
  display: inline-block; padding: 5px 14px;
  border-radius: 100px; font-size: .75rem; font-weight: 600;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-muted); text-decoration: none;
  transition: all var(--t); cursor: pointer;
}
.topic-pill:hover { color: var(--white); border-color: rgba(255,255,255,.25); text-decoration: none; }
.topic-pill--active { background: rgba(201,162,39,.12); border-color: rgba(201,162,39,.35); color: var(--gold); }

/* ── Article detail ── */
.article-cover {
  width: 100%; border-radius: var(--r-lg); overflow: hidden;
  margin-bottom: 32px; line-height: 0;
}
.article-cover img { width: 100%; max-height: 420px; object-fit: cover; }

.article-body {
  font-size: 1.025rem; line-height: 1.9; color: var(--text);
}
.article-body p { margin-bottom: 1.35em; }
.article-body h2 {
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 800;
  color: var(--white); margin: 2.75em 0 .85em; line-height: 1.25;
  padding-bottom: .6em; border-bottom: 1px solid var(--border);
}
.article-body h3 {
  font-size: 1.05rem; font-weight: 700; color: var(--white);
  margin: 2em 0 .65em;
}
.article-body ul, .article-body ol {
  padding-left: 0; margin-bottom: 1.35em;
  list-style: none; display: flex; flex-direction: column;
}
.article-body ul li, .article-body ol li {
  padding: .55em 0 .55em 1.25em; position: relative;
  border-bottom: 1px solid rgba(255,255,255,.04);
  color: var(--text); font-size: 1rem; line-height: 1.75;
}
.article-body ul li:last-child, .article-body ol li:last-child { border-bottom: none; }
.article-body ul li::before {
  content: ''; position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(201,162,39,.5);
}
.article-body ol { counter-reset: ol-counter; }
.article-body ol li { counter-increment: ol-counter; }
.article-body ol li::before {
  content: counter(ol-counter) '.';
  position: absolute; left: 0;
  font-size: .8rem; font-weight: 700;
  color: var(--gold); top: .6em;
}
.article-body blockquote {
  border-left: 3px solid var(--gold); padding: 16px 22px;
  margin: 1.75em 0; background: rgba(201,162,39,.05);
  border-radius: 0 var(--r) var(--r) 0;
  color: var(--text); font-style: italic; font-size: 1.05rem; line-height: 1.8;
}
.article-body hr {
  border: none; border-top: 1px solid var(--border); margin: 2.5em 0;
}
.article-body strong { color: var(--white); font-weight: 700; }
.article-body a { color: var(--gold); }
.article-body a:hover { text-decoration: underline; }
.article-body code {
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: .85em; background: rgba(255,255,255,.07);
  color: var(--text); padding: .15em .45em;
  border-radius: 4px; border: 1px solid var(--border);
}

.article-source-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 100px;
  border: 1px solid var(--border); background: var(--bg-card);
  font-size: .78rem; color: var(--text-muted);
  text-decoration: none; margin-bottom: 24px;
  transition: border-color var(--t), color var(--t);
}
.article-source-chip:hover { border-color: rgba(255,255,255,.25); color: var(--text); }

/* ── Article sources block ── */
.article-sources {
  margin-top: 32px;
  padding: 22px 26px;
  background: rgba(255,255,255,.025);
  border: 1px solid var(--border);
  border-left: 3px solid rgba(201,162,39,.35);
  border-radius: var(--r);
}
.article-sources__label {
  font-size: .65rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 12px; display: flex; align-items: center; gap: 7px;
}
.article-sources__label i { color: rgba(201,162,39,.5); font-size: .7rem; }
.article-sources ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 7px;
}
.article-sources ul li { display: flex; align-items: baseline; gap: 8px; }
.article-sources ul li::before {
  content: '→'; color: rgba(201,162,39,.4);
  font-size: .7rem; flex-shrink: 0;
}
.article-sources ul li a {
  color: var(--text-muted); font-size: .83rem; text-decoration: none;
  transition: color var(--t);
}
.article-sources ul li a:hover { color: var(--gold); }

/* ── Related articles row ── */
.related-articles { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--border); }
.related-articles__title {
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-muted); margin-bottom: 16px;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .article-hero { grid-template-columns: 1fr; }
  .article-hero__thumb img { min-height: 220px; }
  .article-hero__body { padding: 24px; }
  .article-hero__title { font-size: 1.2rem; }
}
@media (max-width: 680px) {
  .article-card__thumb img { height: 150px; }
  .article-hero__title { font-size: 1.1rem; }
}

/* ═══════════════════════════════════════
   CAMPAIGN / PETITION BLOCK
═══════════════════════════════════════ */
.campaign-status-bar {
  background: var(--bg-card-2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 20px 24px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.sig-count {
  font-family: var(--font-display);
  font-size: 2.2rem; font-weight: 900; color: var(--gold);
  line-height: 1;
}
.sig-label { font-size: .875rem; color: var(--text-muted); margin-top: 2px; }

.progress-bar { flex: 1; min-width: 120px; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-light)); border-radius: 3px; transition: width .4s; }

.pinned-campaign {
  background: linear-gradient(135deg, rgba(30, 10, 10, 0.9), rgba(10, 10, 24, 0.9));
  border: 1px solid var(--border-red);
  border-top: 3px solid var(--red);
  border-radius: var(--r-lg); padding: 32px;
}
.pinned-campaign .badge {
  display: inline-block; background: var(--red); color: #fff;
  font-size: .68rem; font-weight: 700;
  padding: 3px 10px; border-radius: 20px; margin-bottom: 14px;
  text-transform: uppercase; letter-spacing: .05em;
}
.pinned-campaign h2 {
  font-family: var(--font-display);
  color: #fff; margin-bottom: 8px;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
}
.pinned-campaign > p { color: var(--text-muted); margin-bottom: 20px; }

/* ═══════════════════════════════════════
   MAGI HANDOFF BLOCK
═══════════════════════════════════════ */
.magi-handoff {
  background: linear-gradient(135deg, var(--bg-card), #0d0d1e);
  border: 1px solid rgba(201, 162, 39, 0.2);
  border-radius: var(--r-lg); padding: 32px 36px;
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
}
.magi-handoff-text h3 {
  font-family: var(--font-display);
  color: var(--gold); font-size: 1.15rem; margin-bottom: 6px;
}
.magi-handoff-text p { color: var(--text-muted); font-size: .9rem; line-height: 1.6; }
.magi-handoff .btn { flex-shrink: 0; margin-left: auto; }

/* ═══════════════════════════════════════
   COMMUNITY — FEED GRID
═══════════════════════════════════════ */
.feed-grid {
  display: block;
  padding-right: calc(270px + 24px);
}
.feed-sidebar {
  position: fixed;
  top: calc(var(--topbar-h) + 16px);
  right: 24px;
  width: 270px;
  max-height: calc(100vh - var(--topbar-h) - 32px);
  overflow-y: auto;
  z-index: 100;
}
@media (max-width: 900px) {
  .feed-grid { padding-right: 0; }
  .feed-sidebar { display: none !important; }
}

/* Home feed only: the toolbar/control-strip run full width above the
   sidebar gutter instead of sharing it - .feed-content (thread list +
   specialist note) carries the reserved space instead of .feed-grid
   itself. .feed-sidebar's actual starting `top` is set inline by JS (see
   home_feed.html) to align with .feed-content's top edge; this is just
   the pre-JS/no-JS fallback so nothing overlaps if that script fails. Only
   home_feed.html has a .feed-content - community/list.html and
   feedback/list.html keep the original .feed-grid-level padding. */
body.gld-home-feed .feed-grid { padding-right: 0; }
body.gld-home-feed .feed-content { padding-right: calc(270px + 24px); }
@media (max-width: 900px) {
  body.gld-home-feed .feed-content { padding-right: 0; }
}

/* ── Filter bar (unified sort + chips) ─── */
.feed-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.feed-filter-bar__row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.feed-filter-bar__count {
  margin-left: auto;
  font-size: .78rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ═══════════════════════════════════════
   COMMUNITY POSTS
═══════════════════════════════════════ */
.post-meta { font-size: .8rem; color: var(--text-muted); margin-top: 8px; }

/* Post card — column flex with left-border progress fill */
.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  transition: background .12s;
}
.post-card:last-child { border-bottom: none; }
.post-card:hover { background: rgba(255,255,255,0.018); }

/* Left border progress via pseudo-element */
.post-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 3px;
  height: var(--vote-fill, 0%);
  background: var(--vote-color, var(--gold));
  transition: height .6s ease;
  border-radius: 0 0 2px 0;
  z-index: 2;
}

/* Flash animation on vote cast */
@keyframes borderPulse {
  0%   { box-shadow: inset 3px 0 0 rgba(201,162,39,0); }
  40%  { box-shadow: inset 3px 0 0 rgba(201,162,39,.55); }
  100% { box-shadow: inset 3px 0 0 rgba(201,162,39,0); }
}
.post-card--voted-flash { animation: borderPulse .5s ease forwards; }

@keyframes gldDotPulse {
  0%, 80%, 100% { opacity: .15; transform: scale(.75); }
  40%           { opacity: 1;   transform: scale(1); }
}
.scroll-spinner-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold);
  animation: gldDotPulse 1.2s ease-in-out infinite;
}

/* Campaign achievement banner (top strip) */
.post-campaign-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 20px;
  background: rgba(192,57,43,.07);
  border-bottom: 1px solid rgba(192,57,43,.18);
  font-size: .76rem;
  font-weight: 700;
  color: var(--red);
  flex-shrink: 0;
}
.post-campaign-banner a {
  margin-left: auto;
  color: var(--red);
  font-size: .74rem;
  text-decoration: none;
  opacity: .75;
  transition: opacity var(--t);
  white-space: nowrap;
}
.post-campaign-banner a:hover { opacity: 1; }

/* Card body (main content area) */
.post-card__body {
  padding: 16px 20px 10px;
  min-width: 0;
}

/* Post title link */
.post-title-link {
  display: block;
  color: var(--white);
  font-weight: 600;
  font-size: .975rem;
  line-height: 1.35;
  text-decoration: none;
  margin-bottom: 0;
  transition: color .12s;
}
.post-title-link:hover { color: var(--gold); }

/* Footer action bar */
.post-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px 12px;
  flex-wrap: wrap;
}
.post-footer__spacer { flex: 1; min-width: 8px; }

/* ── Shared pill base — vote + comment footers ── */
.vote-btn-pill,
.comment-btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: all var(--t);
  white-space: nowrap;
  text-decoration: none;
}
.vote-btn-pill:hover,
.comment-btn-pill:hover { color: var(--gold); border-color: var(--border-gold); }
.vote-btn-pill i,
.comment-btn-pill i { font-size: .8rem; }

/* Voted state */
.vote-btn-pill--on {
  color: var(--gold);
  background: rgba(201,162,39,.1);
  border-color: var(--border-gold);
}
.vote-btn-pill--locked { opacity: .5; filter: grayscale(.5); cursor: default; }
.vote-btn-pill .vote-count,
.comment-btn-pill .cpill-count { font-weight: 800; }

@media (max-width: 420px) {
  .comment-btn-pill .cpill-label { display: none; }
}

/* ═══════════════════════════════════════
   COMMUNITY — SIDEBAR
═══════════════════════════════════════ */
.sidebar-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-bottom: 16px;
}
.sidebar-section__title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}
/* Sidebar poll widget (see community/models.py::Poll, home_feed.html) */
.poll-options { display: flex; flex-direction: column; gap: 8px; }
.poll-option__btn {
  position: relative; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-card-2); color: var(--text-muted);
  font-size: .8rem; font-weight: 600; font-family: var(--font-body); cursor: pointer; overflow: hidden;
  transition: border-color .15s, color .15s;
}
.poll-option__btn:hover:not(:disabled) { border-color: var(--gold); color: #fff; }
.poll-option__btn:disabled { cursor: default; }
.poll-option__fill {
  position: absolute; inset: 0; width: 0; background: rgba(201, 162, 39, .16);
  transition: width .5s ease; z-index: 0;
}
.poll-option__label, .poll-option__pct { position: relative; z-index: 1; }
.poll-option__pct { float: right; font-weight: 800; color: #fff; }
.poll-option--picked .poll-option__btn { border-color: var(--gold); }

.sidebar-campaign-item { margin-bottom: 14px; }
.sidebar-campaign-item:last-child { margin-bottom: 0; }
.sidebar-campaign-item__title {
  font-size: .84rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  display: block;
  margin-bottom: 6px;
  transition: color var(--t);
  line-height: 1.3;
}
.sidebar-campaign-item__title:hover { color: var(--gold); }
.sidebar-campaign-item__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}
.sidebar-campaign-item__votes {
  font-size: .72rem;
  color: var(--gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.sidebar-campaign-item__pct {
  font-size: .7rem;
  color: var(--text-muted);
}
.sidebar-about {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
}
.sidebar-about p {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 10px;
}
.sidebar-about a {
  font-size: .78rem;
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
}

/* ═══════════════════════════════════════
   FORMS
═══════════════════════════════════════ */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: .875rem; color: var(--text-muted); margin-bottom: 6px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 10px 14px;
  background: var(--bg-card-2); border: 1px solid var(--border);
  border-radius: var(--r); color: var(--text); font-size: .9rem;
  font-family: inherit; transition: border-color var(--t), box-shadow var(--t);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,162,39,.1);
}
.form-group textarea { min-height: 120px; resize: vertical; }
.form-group select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238a8a9a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #1a1a24 inset;
  -webkit-text-fill-color: #f0f0f0;
  caret-color: #f0f0f0;
  border-color: var(--border);
  transition: background-color 5000s ease-in-out 0s;
}

/* ═══════════════════════════════════════
   FOOTER
═══════════════════════════════════════ */
/* mission row */
.site-footer {
  background: var(--bg-card); border-top: 1px solid var(--border);
  margin-top: auto;
}
.footer-mission {
  padding: 16px 32px;
  font-size: .78rem; color: var(--text-muted);
  line-height: 1.7; border-bottom: 1px solid var(--border);
  text-align: center;
}
.footer-mission strong { color: var(--text); font-weight: 600; }

/* strip row */
.footer-strip {
  display: flex; align-items: center; gap: 16px;
  padding: 13px 32px; flex-wrap: wrap;
}
.footer-strip__brand {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; flex-shrink: 0;
}
.footer-strip__logo { width: 20px; height: 20px; object-fit: contain; }
.footer-strip__name {
  font-family: var(--font-display);
  font-size: .88rem; font-weight: 700; color: var(--white);
}
.footer-strip__sep {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--border); flex-shrink: 0;
}
.footer-strip__links {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.footer-strip__links a {
  font-size: .76rem; color: var(--text-muted);
  text-decoration: none; padding: 2px 5px; border-radius: var(--r);
  transition: color var(--t);
}
.footer-strip__links a:hover { color: var(--white); }
.footer-strip__dot { font-size: .62rem; color: var(--border); user-select: none; }
.footer-strip__right {
  margin-left: auto; display: flex; align-items: center; gap: 14px;
}
.footer-strip__social { display: flex; gap: 6px; }
.footer-strip__social-btn {
  width: 27px; height: 27px; border-radius: 50%;
  border: 1px solid var(--border); background: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: .66rem;
  text-decoration: none; transition: color var(--t), border-color var(--t);
}
.footer-strip__social-btn:hover { color: var(--gold); border-color: var(--border-gold); }
.footer-strip__copy {
  font-size: .71rem; color: var(--gold); font-weight: 600; white-space: nowrap;
}

/* ═══════════════════════════════════════
   AUTH — checkbox consent row
═══════════════════════════════════════ */
.auth-privacy-check { margin-top: 4px; margin-bottom: 20px; }

.auth-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.auth-checkbox-label input[type="checkbox"] {
  width: 16px; height: 16px;
  margin-top: 2px;
  accent-color: var(--gold);
  cursor: pointer;
  flex-shrink: 0;
}
.auth-checkbox-label a { color: var(--gold); }
.auth-checkbox-label a:hover { color: var(--gold-light); }

/* ═══════════════════════════════════════
   BACK LINK
═══════════════════════════════════════ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 40px 0 28px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--t), gap var(--t);
}
.back-link:hover {
  color: var(--text);
  gap: 10px;
}

/* ═══════════════════════════════════════
   GENERIC PAGE LAYOUT
═══════════════════════════════════════ */
.page-header {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900; color: var(--white);
  line-height: 1.1;
}
.page-header p { color: var(--text-muted); margin-top: 10px; font-size: .975rem; }

/* Badges */
.badge {
  display: inline-block; font-size: .68rem; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: .05em;
}
.badge--red    { background: var(--red); color: #fff; }
.badge--gold   { background: rgba(201,162,39,.12); color: var(--gold); border: 1px solid rgba(201,162,39,.2); }
.badge--muted  { background: rgba(138,138,154,.1); color: var(--text-muted); }

/* Calculator page header — category color accent (icon + top border), set
   inline per template via the calculator's category color (see
   tools/registry.py CATEGORY_COLORS - keep these in sync). */
.calc-header {
  display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap;
  margin-bottom: 28px; padding-top: 16px;
  border-top: 3px solid var(--gold);
}
.calc-header__icon {
  width: 42px; height: 42px; flex-shrink: 0; margin-top: 4px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r); font-size: 1.05rem;
}
.calc-header__text { flex: 1; min-width: 0; }
.calc-header__text h1 {
  font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 900; color: var(--white); line-height: 1.1; margin: 0;
}
.calc-header__text p { color: var(--text-muted); margin: 6px 0 0; }
.calc-header .badge--muted { margin-bottom: 6px; }

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .magi-handoff { flex-direction: column; }
  .magi-handoff .btn { margin-left: 0; }
}

@media (max-width: 900px) {
  /* Sidebar starts hidden on mobile, slides in on hamburger tap */
  .left-sidebar {
    width: min(290px, 88vw);
    transform: translateX(-100%);
    bottom: 0;
  }
  .left-sidebar.is-open { transform: translateX(0); }
  .app-shell { margin-left: 0; }
  .app-shell.sidebar-collapsed { margin-left: 0; }
}

/* Sidebar backdrop (mobile only) */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 189;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .22s ease;
}
.sidebar-backdrop.is-visible { opacity: 1; }

@media (max-width: 680px) {
  .container { padding: 0 16px; }
  .site-nav-auth { gap: 8px; }

  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .manifesto-steps { grid-template-columns: 1fr !important; }
  .comparison-table-wrap { position: relative; }
  .comparison-table-wrap::after { content:''; position:absolute; top:0; right:0; bottom:0; width:32px; background:linear-gradient(to right, transparent, var(--bg)); pointer-events:none; border-radius:0 var(--r) var(--r) 0; }
  .manifesto-cards { grid-template-columns: 1fr !important; }

  .section { padding: 40px 0; }

  .campaign-status-bar { flex-direction: column; align-items: flex-start; gap: 16px; }
  .progress-bar { width: 100%; }

  .hero-ctas { flex-direction: column; align-items: center; }
  .hero-ctas .btn { width: 100%; max-width: 300px; }

  .page-hero { padding: 56px 0 40px; }

  .section-header { flex-direction: column; gap: 6px; align-items: flex-start; }

  .footer-mission { padding: 14px 20px; }
  .footer-strip {
    display: grid;
    grid-template-areas: "brand social" "links links";
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px 0;
    padding: 14px 20px;
  }
  .footer-strip__brand  { grid-area: brand; }
  .footer-strip__sep    { display: none; }
  .footer-strip__links  { grid-area: links; }
  .footer-strip__right  { grid-area: social; margin-left: 0; justify-content: flex-end; }
  .footer-strip__copy   { display: none; }

}

/* ═══════════════════════════════════════
   AUTH PAGES
═══════════════════════════════════════ */
.auth-wrap {
  max-width: 480px; margin: 60px auto;
}
.auth-form { display: flex; flex-direction: column; gap: 4px; }

.auth-alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: .9rem;
}
.auth-alert--error { background: rgba(220,53,69,.15); color: #f87171; border: 1px solid rgba(220,53,69,.3); }
.auth-alert--success { background: rgba(34,197,94,.12); color: #4ade80; border: 1px solid rgba(34,197,94,.25); }
.auth-alert--info { background: rgba(59,130,246,.12); color: #93c5fd; border: 1px solid rgba(59,130,246,.25); }

.auth-optional { color: var(--text-muted); font-size: .8rem; }

.auth-password-wrap { position: relative; }
.auth-password-wrap input { padding-right: 44px; width: 100%; }
.auth-toggle-pw {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  padding: 4px; line-height: 1;
}
.auth-toggle-pw:hover { color: var(--text); }

.auth-strength { margin-top: 8px; }
.auth-strength-bar {
  height: 4px; background: rgba(255,255,255,.1); border-radius: 2px; overflow: hidden;
}
.auth-strength-fill {
  height: 100%; width: 0; border-radius: 2px;
  transition: width .3s ease, background .3s ease;
}
.auth-strength-fill.weak   { background: #ef4444; }
.auth-strength-fill.medium { background: #f59e0b; }
.auth-strength-fill.strong { background: #22c55e; }
.auth-strength-text { font-size: .78rem; color: var(--text-muted); margin-top: 4px; display: block; }
.auth-strength-text.weak   { color: #ef4444; }
.auth-strength-text.medium { color: #f59e0b; }
.auth-strength-text.strong { color: #22c55e; }

.auth-field-error { font-size: .8rem; color: #f87171; margin-top: 4px; min-height: 18px; }

.auth-secondary-field label { font-size: .8rem; opacity: .7; }
.auth-secondary-field input,
.auth-secondary-field select { opacity: .85; }

.auth-mission-line {
  text-align: center;
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 16px;
  margin-bottom: 0;
  font-style: italic;
  line-height: 1.5;
}

/* ═══════════════════════════════════════
   AUTH — split brand/form card (login + register)
   Layout borrowed from Magi's own login/register split-card, reskinned in
   Гилдията's own palette/type (gold+red glow, Playfair headings) instead
   of Magi's blue/light-panel scheme - the .form-group/.auth-* form
   internals above are untouched and reused as-is inside .auth-split-right.
═══════════════════════════════════════ */
.auth-split-page {
  position: relative;
  padding: 56px 0 72px;
  overflow: hidden;
}
.auth-split-page::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 12% 8%, rgba(201,162,39,.10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 55% at 92% 92%, rgba(192,57,43,.07) 0%, transparent 55%);
  pointer-events: none;
}
.auth-split-page > * { position: relative; z-index: 1; }

.auth-split-card {
  max-width: 920px; margin: 0 auto;
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  min-height: 560px;
}
.auth-split-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 50%, transparent 100%);
  box-shadow: 0 0 20px rgba(201,162,39,.55);
}

/* ── Left panel — brand ── */
.auth-split-left {
  flex: 0 0 40%;
  background: linear-gradient(160deg, #08080c 0%, #13131a 55%, #1a1a24 100%);
  border-right: 1px solid var(--border);
  padding: 48px 40px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-split-left::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 60% at 20% 12%, rgba(201,162,39,.15) 0%, transparent 55%),
    radial-gradient(ellipse 50% 50% at 88% 88%, rgba(192,57,43,.09) 0%, transparent 55%);
  pointer-events: none;
}
.auth-split-brand { position: relative; z-index: 1; }
.auth-split-brand img {
  width: 44px; height: 44px; margin-bottom: 20px; display: block;
  filter: drop-shadow(0 0 14px rgba(201,162,39,.35));
  transition: filter var(--t), transform var(--t);
}
.auth-split-brand img:hover { filter: drop-shadow(0 0 20px rgba(201,162,39,.6)); transform: scale(1.04); }
.auth-split-brand h1 {
  font-family: var(--font-display); font-size: 1.7rem; font-weight: 900;
  color: var(--white); margin: 0 0 4px; line-height: 1.1; letter-spacing: -.01em;
}
.auth-split-brand .auth-split-tag {
  font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 20px; display: block;
}
.auth-split-brand p {
  font-size: .89rem; color: var(--text-muted); line-height: 1.75; max-width: 260px; margin: 0;
}

.auth-split-points {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; gap: 12px;
  margin: 28px 0;
}
.auth-split-point {
  display: flex; align-items: center; gap: 10px;
  font-size: .82rem; color: var(--text-muted); line-height: 1.4;
}
.auth-split-point i {
  width: 26px; height: 26px; flex-shrink: 0;
  background: rgba(201,162,39,.12); border: 1px solid rgba(201,162,39,.25);
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  color: var(--gold); font-size: .72rem;
}

.auth-split-motto {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border); padding-top: 18px;
}
.auth-split-motto blockquote {
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 800;
  color: var(--white); margin: 0 0 6px; line-height: 1.3;
}
.auth-split-motto cite {
  font-style: normal; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600;
}

/* ── Right panel — form ── */
.auth-split-right {
  flex: 1; min-width: 0;
  background: var(--bg-card-2);
  padding: 48px 44px;
  display: flex; flex-direction: column; justify-content: center;
}
.auth-split-form-header { margin-bottom: 26px; }
.auth-split-form-header h2 {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; color: var(--white);
  margin: 0 0 6px; letter-spacing: -.01em;
}
.auth-split-form-header p { color: var(--text-muted); font-size: .875rem; margin: 0; }

.auth-split-crosslink {
  text-align: center; margin-top: 22px; padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: .875rem;
}
.auth-split-crosslink a { color: var(--gold); font-weight: 600; }
.auth-split-crosslink a:hover { color: var(--gold-light); }

.auth-split-back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-muted); font-size: .8rem; margin-top: 14px;
  transition: color var(--t);
}
.auth-split-back:hover { color: var(--gold); }

@media (max-width: 860px) {
  .auth-split-page { padding: 32px 0 48px; }
  .auth-split-card { flex-direction: column; max-width: 460px; min-height: auto; border-radius: var(--r-lg); }
  .auth-split-left {
    border-right: none; border-bottom: 1px solid var(--border);
    padding: 26px 26px 22px;
  }
  .auth-split-points, .auth-split-motto, .auth-split-brand p { display: none; }
  .auth-split-brand {
    display: grid; grid-template-columns: 40px 1fr; column-gap: 14px; align-items: center;
  }
  .auth-split-brand img { grid-column: 1; grid-row: 1 / 3; width: 40px; margin-bottom: 0; }
  .auth-split-brand h1 { grid-column: 2; grid-row: 1; align-self: end; }
  .auth-split-brand .auth-split-tag { grid-column: 2; grid-row: 2; margin: 0; align-self: start; }
  .auth-split-right { padding: 26px 26px 30px; }
}
@media (max-width: 480px) {
  .auth-split-card { margin: 0 10px; border-radius: var(--r); }
  .auth-split-left, .auth-split-right { padding-left: 20px; padding-right: 20px; }
}

/* ═══════════════════════════════════════
   ОБЩНОСТ — Community
═══════════════════════════════════════ */

/* Sort tabs */
.sort-tab {
  background: transparent; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-body); font-size: .86rem; font-weight: 600;
  color: var(--text-muted); padding: 8px 4px;
  display: inline-flex; align-items: center; gap: 7px;
  transition: color var(--t);
}
.sort-tab:hover { color: var(--text); }
.sort-tab--on { color: var(--white); border-bottom-color: var(--gold); }
.sort-tab--on i { color: var(--gold); }

/* Category chips */
.category-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .68rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase;
  border-width: 1px; border-style: solid;
  border-radius: 100px; padding: 3px 10px;
  transition: opacity var(--t);
}
.category-chip:hover { opacity: .85; }
.category-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; display: inline-block; }

/* Thread detail post layout — simple block, full-width content */
.thread-post-outer { display: block; }
.thread-post-badges {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.thread-post-body { display: block; }

/* The post card itself: no bottom padding — .thread-footer supplies the
   final bottom space so it isn't double-padded under .card--static. */
.thread-post-card { padding: 22px 26px 0; }
@media (max-width: 680px) {
  /* On phones the boxed card just eats reading width for no benefit - drop
     the background/border entirely so the post text runs edge-to-edge with
     the container, same as the comments below it. .thread-footer's
     border-top still marks where the post ends. */
  .thread-post-card {
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 16px 0 0;
  }
}

/* Thread detail footer action bar.
   Lives inside .thread-post-card, which already supplies the side padding -
   so this only adds vertical spacing, not another layer of horizontal inset. */
.thread-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0 18px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  margin-top: 4px;
}
.thread-footer__spacer { flex: 1; min-width: 8px; }
@media (max-width: 680px) {
  .thread-footer { padding: 10px 0 14px; }
}

/* Vote column wrapper in thread list cards */
.post-vote-col {
  align-self: stretch;
  display: flex;
  position: relative;
  z-index: 1;
}

/* Vote button */
.vote-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 4px; padding: 8px 10px; min-width: 48px; width: 100%;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--r); cursor: pointer; color: var(--text-muted);
  font-family: var(--font-body); font-variant-numeric: tabular-nums;
  transition: all var(--t);
}
.vote-btn:hover { color: var(--gold); border-color: var(--border-gold); }
.vote-btn--on { color: var(--gold); background: rgba(201,162,39,.12); border-color: var(--border-gold); }
.vote-btn i { font-size: 1rem; }
.vote-btn .vote-count { font-weight: 800; font-size: 1rem; }
.vote-btn .vote-label { font-size: .6rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; opacity: .75; }
.vote-btn--lg { padding: 10px 8px; min-width: 56px; }
.vote-btn:disabled { opacity: .5; cursor: default; pointer-events: none; }

/* Comment upvote — horizontal pill */
.comment-vote-btn {
  display: flex; flex-direction: row; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 6px;
  border: 1px solid #252530; background: transparent;
  color: #8a8a9a; cursor: pointer;
  font-family: var(--font-body); font-weight: 700; font-size: .8rem;
  font-variant-numeric: tabular-nums;
  transition: all .15s ease;
}
.comment-vote-btn:hover { color: #c9a227; }
.comment-vote-btn--voted { background: rgba(201,162,39,.12); border-color: rgba(201,162,39,.3); color: #c9a227; }
.comment-vote-btn i { font-size: 1rem; }

/* Comment sort buttons */
.comment-sort-btn {
  background: transparent; border: 1px solid transparent;
  border-radius: var(--r); padding: 5px 12px; cursor: pointer;
  font-family: var(--font-body); font-size: .8rem; font-weight: 600;
  color: var(--text-muted); text-decoration: none;
  transition: all var(--t); display: inline-block;
}
.comment-sort-btn:hover { color: var(--text); border-color: var(--border); }
.comment-sort-btn--on { color: var(--gold); background: rgba(201,162,39,.1); border-color: var(--border-gold); }

/* Comment action buttons (vote / reply / delete / report) */
.comment-action-btn {
  background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: .78rem; font-weight: 500;
  color: var(--text-muted); display: inline-flex; align-items: center; gap: 5px;
  padding: 0 8px 0 0; transition: color var(--t);
}
.comment-action-btn:hover { color: var(--text); }
.comment-action-btn--voted { color: var(--gold); }
.comment-action-btn--danger:hover { color: #ef4444; }

/* New-thread form: category selector chips */
.cat-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 100px; cursor: pointer;
  font-family: var(--font-body); font-size: .82rem; font-weight: 700;
  border-width: 1px; border-style: solid;
  transition: all var(--t);
}
.cat-chip:hover { opacity: .85; }

/* New-thread form: institution selector chips */
.inst-chip {
  display: inline-block;
  padding: 5px 12px; border-radius: 100px; cursor: pointer;
  font-family: var(--font-body); font-size: .76rem; font-weight: 600;
  border-width: 1px; border-style: solid;
  transition: all var(--t);
}

/* ── Role badge (trust line) ─────────────────────────────── */
.role-badge {
  display: inline-flex; align-items: center;
  background: rgba(201,162,39,.08);
  border: 1px solid rgba(201,162,39,.18);
  border-radius: 20px;
  padding: 1px 8px;
  font-size: .62rem;
  font-weight: 600;
  color: #c9a227;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Community Pulse strip ───────────────────────────────── */
.pulse-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 18px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.pulse-stats {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}
.pulse-stat {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 7px;
  align-items: center;
  padding: 0 16px;
}
.pulse-stat:first-child { padding-left: 0; }
.pulse-stat__icon {
  grid-column: 1;
  grid-row: 1 / 3;
  font-size: .8rem;
  color: var(--text-muted);
  align-self: center;
}
.pulse-stat__icon--gold { color: var(--gold); }
.pulse-stat__value {
  grid-column: 2;
  grid-row: 1;
  font-size: .95rem;
  font-weight: 700;
  color: var(--white);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.pulse-stat__value--gold {
  color: var(--gold);
  font-weight: 800;
}
.pulse-stat__label {
  grid-column: 2;
  grid-row: 2;
  font-size: .68rem;
  color: var(--text-muted);
  white-space: nowrap;
  line-height: 1.1;
}
.pulse-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0;
}
.pulse-spark {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.pulse-spark__label {
  font-size: .68rem;
  color: var(--text-muted);
}

/* ── Home feed toolbar: vertical tabs (Финанси/Бизнес/Икономика/
   Счетоводство+sub/SAF-T/Общо) + merged sort/pulse strip ─────────────── */
.feed-toolbar {
  position: relative;
  border-radius: var(--r-lg);
  padding: 14px 16px 0;
  background:
    radial-gradient(1000px 240px at 8% -60%, color-mix(in srgb, var(--vc) 34%, transparent), transparent 72%),
    var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 14px;
  overflow: visible;
}
.feed-toolbar::after {
  content: '';
  position: absolute; inset: 0; pointer-events: none; border-radius: inherit; z-index: 0;
  background: radial-gradient(650px 200px at 8% -40%, color-mix(in srgb, var(--vc) 65%, transparent), transparent 70%);
  opacity: 0;
}
.feed-toolbar.flash::after { animation: feedVcFlash .8s ease-out; }
@keyframes feedVcFlash { 0% { opacity: 1; } 100% { opacity: 0; } }

.feed-vtabs { position: relative; z-index: 1; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding-bottom: 12px; }
.feed-vtab {
  position: relative; display: flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px;
  font-size: .85rem; font-weight: 600; color: var(--text-muted); text-decoration: none;
  transition: color .2s, background-color .3s;
  /* Also used as a <button> in new_thread.html's category picker (a
     selectable field, not navigation) - resets native button chrome,
     which the <a> usage on the feed never needed since links have none
     by default. */
  border: none; background: transparent; cursor: pointer; font-family: inherit;
}
.feed-vtab:hover { color: var(--text); }
.feed-vtab--on { color: #fff; background: color-mix(in srgb, var(--vc) 18%, transparent); }
.feed-vicon { font-size: .78rem; color: var(--dotc, var(--text-muted)); }
.feed-vnew {
  font-size: .54rem; font-weight: 800; letter-spacing: .03em; padding: 1px 5px; border-radius: 4px;
  color: #0a0a0f;
}
.feed-vcaret { font-size: .6rem; opacity: .55; }
.feed-vtab--on .feed-vcaret { opacity: .9; }
.feed-vtabs-slider {
  position: absolute; bottom: 0; height: 2.5px; border-radius: 3px; background: var(--vc);
  box-shadow: 0 0 20px 3px color-mix(in srgb, var(--vc) 85%, transparent);
  transition: left .35s cubic-bezier(.4,0,.2,1), width .35s cubic-bezier(.4,0,.2,1), background-color .35s;
}

.feed-subdrop {
  /* `top` is set inline by JS (positionSubdrop() in home_feed.html) - it's
     a sibling of .feed-vtabs now, not a child, so a CSS percentage here
     can't target "right below the tab row" on its own. */
  position: absolute; margin-top: 6px; background: var(--bg-card-2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 6px; display: none; flex-direction: column; gap: 2px; min-width: 200px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5); z-index: 20;
}
.feed-subdrop--open { display: flex; }
.feed-subchip-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px; font-size: .78rem; font-weight: 600;
  color: var(--text-muted); text-decoration: none;
}
.feed-subchip-row:hover { background: rgba(255,255,255,.05); color: #fff; }
.feed-subchip-row--on { background: rgba(255,255,255,.06); color: #fff; }
.feed-subchip-row i { font-size: .78rem; }
.feed-cnt { margin-left: auto; font-size: .68rem; color: var(--text-dim, #6e6e7c); font-variant-numeric: tabular-nums; }

.feed-ctrlstrip {
  display: flex; align-items: center; gap: 0; flex-wrap: wrap; row-gap: 8px;
  background: var(--bg-card-2); border: 1px solid var(--border); border-radius: var(--r);
  padding: 6px 14px; margin: 0 0 12px;
}
.feed-sortgroup { display: flex; align-items: center; gap: 2px; padding-right: 14px; }
.feed-sortbtn {
  display: flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 999px; border: 1px solid transparent;
  color: var(--text-dim, #6e6e7c); font-size: .72rem; font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: all .15s;
}
.feed-sortbtn i { font-size: .68rem; }
.feed-sortbtn:hover { color: var(--text-muted); }
.feed-sortbtn--on { color: #fff; background: color-mix(in srgb, var(--vc) 22%, transparent); border-color: color-mix(in srgb, var(--vc) 55%, transparent); }

/* Mobile-only sort chip + sheet (see @media below for when it actually
   shows) - collapses the 4-button .feed-sortgroup into one control so
   "Близо до кампания" doesn't force an overflow at phone width. */
.feed-mobile-sort { display: none; position: relative; }
.feed-msort-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--vc) 16%, transparent); border: 1px solid color-mix(in srgb, var(--vc) 45%, transparent);
  color: #fff; font-size: .78rem; font-weight: 700; cursor: pointer;
}
.feed-msort-btn i { color: var(--vc); font-size: .72rem; }
.feed-msort-caret { font-size: .6rem; opacity: .7; margin-left: 1px; transition: transform .2s; }
.feed-mobile-sort--open .feed-msort-caret { transform: rotate(180deg); }
.feed-msort-sheet {
  /* min-width rather than relying on the parent's size - .feed-mobile-sort
     sits at the collapsed button's natural width (so it can share a row
     with .feed-pulsegroup, see @media below), which is narrower than a
     comfortable option list. position:absolute so expanding it doesn't
     reflow/push .feed-pulsegroup down mid-interaction. */
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px; max-height: 0; overflow: hidden;
  transition: max-height .22s ease; background: var(--bg-card); border-radius: var(--r); z-index: 5;
}
.feed-mobile-sort--open .feed-msort-sheet { max-height: 200px; border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.feed-msort-opt {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px; color: var(--text-muted); font-size: .8rem;
  font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--border);
}
.feed-msort-opt:last-child { border-bottom: none; }
.feed-msort-opt--on { color: var(--vc); }
.feed-msort-opt i { width: 14px; font-size: .75rem; }

.feed-ctrl-div { width: 1px; height: 22px; background: var(--border); flex-shrink: 0; }
.feed-pulsegroup { display: flex; align-items: center; flex-wrap: wrap; }
.feed-pstat { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 6px; align-items: center; padding: 5px 14px; }
.feed-pstat i { grid-column: 1; grid-row: 1 / 3; font-size: .76rem; color: var(--text-dim, #6e6e7c); align-self: center; }
.feed-pstat--vc i { color: var(--vc); }
.feed-pstat b { grid-column: 2; grid-row: 1; font-size: .86rem; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; line-height: 1.15; }
.feed-pstat span { grid-column: 2; grid-row: 2; font-size: .63rem; color: var(--text-muted); white-space: nowrap; line-height: 1.1; }
.feed-spark { display: flex; align-items: center; gap: 6px; margin-left: auto; padding-left: 10px; flex-shrink: 0; }
.feed-spark__label { font-size: .63rem; color: var(--text-dim, #6e6e7c); }

@media (max-width: 640px) {
  /* Vertical tabs: scroll instead of wrap - 7 tabs never fit a phone
     screen, and wrapping them wastes vertical space and buries whichever
     tab lands on row 2. A right-edge fade signals there's more to scroll;
     feed-toolbar.js scrolls the active tab into view on load so a deep
     state (e.g. Счетоводство → ТРЗ) isn't left off-screen. */
  .feed-vtabs {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-right: 28px;
    /* Fade the tabs themselves out near the edge instead of painting an
       overlay on top - .feed-toolbar's background is a colored radial
       wash, not a flat fill, so a solid gradient rectangle here would
       never match it and shows up as a mismatched patch (reported as a
       dark smudge over "Общо"). Masking reveals the real background
       underneath as content fades, so there's nothing that can mismatch. */
    -webkit-mask-image: linear-gradient(to right, black 0, black calc(100% - 32px), transparent 100%);
    mask-image: linear-gradient(to right, black 0, black calc(100% - 32px), transparent 100%);
  }
  .feed-vtabs::-webkit-scrollbar { display: none; }
  .feed-vtab { flex-shrink: 0; }

  /* Accounting dropdown: a full-width sheet under the whole tab row
     instead of a floating panel anchored to the tab's x-position - once
     tabs scroll horizontally, "anchored under this tab" stops meaning
     anything stable. feed-toolbar.js still sets an inline `left` for the
     desktop case, but that's inert here since `left` has no effect on a
     statically positioned element. */
  .feed-subdrop { position: static; width: 100%; margin-top: 8px; box-shadow: none; }

  /* Sort: the 4-button row is replaced by the single chip + sheet - see
     .feed-mobile-sort. Pulse stats drop their text labels (icon + number
     already reads fine) and the sparkline, which is decorative and the
     first thing to go at this width. Divider lines between now-tiny
     number chips read as clutter rather than structure, so they're
     dropped in favor of a plain gap - the goal is deliberate short rows,
     not lines wrapping wherever they happen to break. */
  /* Sits next to the sort chip when there's room (the base .feed-ctrlstrip
     rule is already display:flex + flex-wrap:wrap - not overridden here),
     and drops to its own line only as a wrap fallback - e.g. when
     "Близо до кампания" is the active sort and its longer label doesn't
     leave enough room. Both .feed-mobile-sort and .feed-pulsegroup keep
     their natural content width (no width:100%) specifically so that
     fallback is a real wrap, not a forced stack. */
  .feed-ctrlstrip { padding: 10px 14px; row-gap: 8px; column-gap: 14px; }
  .feed-sortgroup { display: none; }
  .feed-mobile-sort { display: block; }
  .feed-pstat span { display: none; }
  .feed-pstat { padding: 0; }
  .feed-pulsegroup { gap: 18px; }
  .feed-ctrl-div { display: none; }
  .feed-spark { display: none; }
}

/* ── Comment leaderboard ─────────────────────────────────── */
.comment-leaderboard {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 20px;
  margin-bottom: 16px;
}
.comment-leaderboard__title {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.comment-leaderboard__list { display: flex; flex-direction: column; gap: 10px; }
.comment-leaderboard__row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.comment-leaderboard__rank {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  font-size: .85rem;
}
.comment-leaderboard__bar-wrap { flex: 1; min-width: 0; }
.comment-leaderboard__name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.comment-leaderboard__bar {
  height: 4px;
  background: rgba(255,255,255,.06);
  border-radius: 2px;
  overflow: hidden;
}
.comment-leaderboard__bar-fill {
  height: 100%;
  background: rgba(201,162,39,.35);
  border-radius: 2px;
  transition: width .4s ease;
}
.comment-leaderboard__bar-fill--gold {
  background: linear-gradient(90deg, #c9a227, #f0c040);
}
.comment-leaderboard__votes {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 24px;
  text-align: right;
}

/* ── Top comment highlight ───────────────────────────────── */
.comment--top {
  border-left: 3px solid #c9a227 !important;
  background: rgba(201,162,39,.04);
  border-radius: 0 var(--r) var(--r) 0;
  padding-left: 14px !important;
  margin-left: 0 !important;
}
.top-comment-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(201,162,39,.1);
  border: 1px solid rgba(201,162,39,.25);
  border-radius: 20px;
  padding: 2px 9px;
  font-size: .62rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .06em;
}


/* ── Community page mobile fixes ────────────────────────── */
@media (max-width: 640px) {

  /* Pulse strip: column layout, 2×2 stat grid + sparkline below */
  .pulse-strip {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 14px;
    gap: 0;
  }
  .pulse-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 0;
    width: 100%;
  }
  /* Hide the vertical divider bars (they're in the grid but display:none removes them from flow) */
  .pulse-divider {
    display: none;
  }
  /* Left column stats: no left padding/border */
  .pulse-stats > :nth-child(1),
  .pulse-stats > :nth-child(5) {
    padding-left: 0;
    border-left: none;
  }
  /* Right column stats: subtle left separator */
  .pulse-stats > :nth-child(3),
  .pulse-stats > :nth-child(7) {
    border-left: 1px solid var(--border);
    padding-left: 14px;
  }
  .pulse-stat {
    padding: 4px 8px;
  }

  /* Sparkline: show below the 2×2 grid, full width */
  .pulse-spark {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .pulse-spark svg {
    flex-shrink: 0;
  }

  /* Thread list cards: compact padding, vote button not stretched */
  .post-card {
    padding: 14px 14px !important;
    gap: 10px;
  }
  .post-vote-col {
    align-self: flex-start; /* don't stretch to full card height */
  }
  /* Hide momentum bar on mobile — it overflows narrow screens */
  .post-momentum {
    display: none;
  }

  /* Community/home-feed thread cards (#thread-list, rendered by
     community/list.html + core/home_feed.html) have no .post-vote-col -
     their .post-card__body/.post-footer/.post-campaign-banner already
     carry their own ~20px horizontal padding, so the generic .post-card
     rule above (written for feedback/list.html's vote-column layout)
     stacks an extra 14px on top of that here - ~34px wasted per side on
     a phone. Zero the outer padding back out for this list specifically
     and give the inner elements phone-sized padding instead. Scoped to
     #thread-list so feedback/list.html (which still needs the rule
     above) is untouched. */
  #thread-list .post-card { padding: 0 !important; gap: 0; }
  #thread-list .post-card__body { padding: 14px 14px 8px; }
  #thread-list .post-footer { padding: 8px 14px 10px; }
  #thread-list .post-campaign-banner { padding: 7px 14px; }
}

/* ── Profile page ─────────────────────────────────────────── */

/* Hero card */
.profile-hero {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px 28px 28px;
  margin-bottom: 28px;
  margin-top: 24px;
}
.profile-hero__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 80% at 95% 10%, rgba(201,162,39,.09) 0%, transparent 65%),
    radial-gradient(ellipse 40% 60% at 5% 90%, rgba(192,57,43,.06) 0%, transparent 55%);
}
.profile-hero__inner {
  position: relative;
  display: flex;
  gap: 22px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.profile-hero__name {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--white);
  margin: 0;
  letter-spacing: -.01em;
}

/* Avatar */
.profile-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(201,162,39,.1);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--gold);
  flex-shrink: 0;
}

/* Verified badge */
.profile-verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(201,162,39,.1);
  border: 1px solid rgba(201,162,39,.25);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--gold);
}

/* Role chip (read-only display in hero) */
.profile-role-chip {
  background: rgba(201,162,39,.08);
  border: 1px solid rgba(201,162,39,.18);
  border-radius: 20px;
  padding: 1px 10px;
  color: var(--gold);
  font-weight: 700;
  font-size: .72rem;
}

/* Activity strip */
.profile-activity-strip {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  align-items: center;
}
.profile-activity-stat {
  display: flex;
  align-items: center;
  gap: 7px;
}
.profile-activity-stat__val {
  font-weight: 800;
  color: var(--white);
  font-size: .92rem;
  font-variant-numeric: tabular-nums;
}
.profile-activity-stat__label {
  color: var(--text-muted);
  font-size: .78rem;
}

/* Two-column grid */
.profile-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 24px;
  align-items: start;
  min-width: 0;
}
.profile-grid > * { min-width: 0; }
.profile-grid .card { min-width: 0; overflow: hidden; word-break: break-word; }

/* Role selector chips (edit form) */
.profile-role-btn {
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: .76rem;
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--t);
}
.profile-role-btn:hover {
  border-color: rgba(201,162,39,.3);
  color: var(--gold);
}
.profile-role-btn--on {
  background: rgba(201,162,39,.12);
  border-color: rgba(201,162,39,.3);
  color: var(--gold);
}

/* Profile inputs */
.profile-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--white);
  font-size: .9rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  box-sizing: border-box;
}
.profile-input::placeholder { color: var(--text-muted); }

/* Profile mobile */
@media (max-width: 860px) {
  .profile-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .profile-hero {
    padding: 20px 16px 18px;
    margin-top: 12px;
  }
  .profile-hero__inner { gap: 14px; }
  .profile-avatar {
    width: 52px;
    height: 52px;
    font-size: 1.1rem;
  }
  .profile-hero__name { font-size: 1.2rem; }

  /* Activity strip: 2-column grid on mobile */
  .profile-activity-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    margin-top: 14px;
    padding-top: 14px;
  }
  .profile-activity-strip .profile-activity-stat { gap: 5px; }
  .profile-activity-stat__label { font-size: .72rem; }

  /* "Член от" spans full width, no margin-left auto */
  .profile-activity-joined {
    grid-column: 1 / -1;
    margin-left: 0 !important;
  }

  /* Name block: allow shrinking */
  .profile-hero__meta { min-width: 0; }

  /* Verified badge + name row wraps cleanly */
  .profile-hero__meta > div { flex-wrap: wrap; }
}

/* ── Avatar upload & crop modal ─────────────────────────── */

/* Camera overlay on profile hero avatar */
.profile-avatar-wrap {
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-block;
}
.profile-avatar--img {
  display: block;
  object-fit: cover;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid var(--gold);
}
.profile-avatar__edit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .50);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s ease;
  color: #fff;
  font-size: .9rem;
  pointer-events: none;
}
.profile-avatar-wrap:hover .profile-avatar__edit { opacity: 1; }

/* Modal backdrop */
.avatar-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* Modal card */
.avatar-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  width: 100%;
  max-width: 310px;
  box-shadow: var(--shadow-lg);
}

/* Canvas circle ring */
.avatar-canvas-ring {
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-gold);
  display: inline-block;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.avatar-canvas-ring:active { cursor: grabbing; }

/* nav avatar img sizing */
.nav-user-avatar img {
  display: block;
}


/* ═══════════════════════════════════════════════════
   GLOBAL SEARCH
   ═══════════════════════════════════════════════════ */

/* ── Hero fake search bar ── */
.hero-search-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto 28px;
  padding: 14px 20px;
  background: rgba(19,19,26,.9);
  border: 1.5px solid rgba(201,162,39,.45);
  border-radius: var(--r-lg);
  box-shadow: 0 0 0 4px rgba(201,162,39,.06), 0 16px 48px rgba(0,0,0,.45);
  cursor: text;
  transition: border-color .2s, box-shadow .2s;
  user-select: none;
}
.hero-search-trigger:hover {
  border-color: rgba(201,162,39,.75);
  box-shadow: 0 0 0 5px rgba(201,162,39,.10), 0 16px 48px rgba(0,0,0,.5);
}
.hero-search-trigger__icon {
  color: var(--gold);
  font-size: 1rem;
  flex-shrink: 0;
}
.hero-search-trigger__placeholder {
  flex: 1;
  color: var(--text-muted);
  font-size: .95rem;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-search-trigger__kbd {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 4px;
  padding: 2px 8px;
  font-family: ui-monospace, monospace;
  font-size: .7rem;
  color: rgba(138,138,154,.6);
  flex-shrink: 0;
}

/* ── Overlay backdrop ── */
.gld-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(10,10,15,.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 4vh;
  overflow: hidden;
}
.gld-search-overlay[hidden] { display: none; }

/* ── Search box wrapper ── */
.gld-search-box {
  width: 100%;
  max-width: 680px;
  padding: 0 20px 12px;
  display: flex;
  flex-direction: column;
  max-height: calc(96vh - 8px);
}

/* ── Input row ── */
.gld-search-input-wrap {
  position: relative;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.gld-search-input-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  font-size: 1rem;
  pointer-events: none;
}
.gld-search-input {
  width: 100%;
  padding: 16px 48px 16px 50px;
  background: var(--bg-card);
  border: 1.5px solid var(--gold);
  border-radius: 24px;
  color: var(--white);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  box-shadow: 0 0 0 4px rgba(201,162,39,.08), 0 20px 50px rgba(0,0,0,.55);
  -webkit-appearance: none;
}
.gld-search-input::placeholder { color: var(--text-muted); }
.gld-search-input::-webkit-search-cancel-button { display: none; }

.gld-search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 6px;
  line-height: 1;
  border-radius: 50%;
  transition: color .15s, background .15s;
}
.gld-search-clear:hover { color: var(--white); background: rgba(255,255,255,.06); }

/* ── Scope tabs ── */
.gld-search-tabs {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-bottom: 12px;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px; /* keeps pill borders from clipping */
}
.gld-search-tabs::-webkit-scrollbar { display: none; }

.gld-search-tab {
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 600;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  color: var(--text-muted);
  transition: all .15s;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}
.gld-search-tab--active {
  background: rgba(201,162,39,.12);
  border-color: rgba(201,162,39,.3);
  color: var(--gold);
}
.gld-search-tabs-hint {
  margin-left: auto;
  font-size: .72rem;
  color: rgba(138,138,154,.5);
  white-space: nowrap;
  flex-shrink: 0;
  padding-left: 8px;
}

/* ── Results panel ── */
.gld-search-results {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(201,162,39,.25) transparent;
}
.gld-search-results::-webkit-scrollbar { width: 4px; }
.gld-search-results::-webkit-scrollbar-thumb { background: rgba(201,162,39,.25); border-radius: 4px; }
.gld-search-results::-webkit-scrollbar-track { background: transparent; }

/* "Популярно в момента" header row */
.gld-search-prefetch-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px 10px;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(201,162,39,.05);
  border-bottom: 1px solid var(--border);
}
.gld-search-prefetch-label i { color: var(--gold); font-size: .75rem; }

/* Generic state (write-to-search prompt) */
.gld-search-state {
  padding: 32px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: .88rem;
}

/* No-results empty state — NO flex on icon to avoid oval stretching */
.gld-search-empty {
  padding: 44px 24px 40px;
  text-align: center;
}
.gld-search-empty__icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(201,162,39,.1);
  border: 1px solid rgba(201,162,39,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  font-size: 1rem;
  color: var(--gold);
}
.gld-search-empty__title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}
.gld-search-empty__sub {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.gld-search-loading {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
}

/* ── Section header ── */
.gld-search-section-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 5px;
  font-size: .6rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.gld-search-section-hd--sep {
  border-top: 1px solid var(--border);
  margin-top: 2px;
}
.gld-search-count {
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1px 7px;
  letter-spacing: 0;
  text-transform: none;
  margin-left: 2px;
}

/* ── Result rows ── */
.gld-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  width: 100%;
  transition: background .12s;
  box-sizing: border-box;
  min-width: 0;
}
.gld-search-row:hover,
.gld-search-row:focus-visible { background: rgba(255,255,255,.035); outline: none; }

.gld-search-row-title {
  flex: 1;
  color: var(--white);
  font-weight: 600;
  font-size: .88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.gld-search-row-meta {
  color: var(--gold);
  font-size: .76rem;
  font-weight: 700;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* Thread category chip */
.gld-search-cat-chip {
  display: inline-flex;
  align-items: center;
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--cat-color, #8a8a9a);
  text-transform: uppercase;
  background: rgba(255,255,255,.03);
  border: 1px solid color-mix(in srgb, var(--cat-color, #8a8a9a) 40%, transparent);
  border-radius: 999px;
  padding: 2px 9px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Campaign & article badges */
.gld-search-badge-red {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(192,57,43,.1);
  border: 1px solid rgba(192,57,43,.3);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: .64rem;
  font-weight: 700;
  color: #e74c3c;
  flex-shrink: 0;
  white-space: nowrap;
}
.gld-search-badge-kind {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(111,159,207,.08);
  border: 1px solid rgba(111,159,207,.25);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: .64rem;
  font-weight: 700;
  color: #6f9fcf;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Member avatar in search results */
.gld-search-member-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Tool icon tile */
.gld-search-tool-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--r);
  background: rgba(201,162,39,.08);
  border: 1px solid rgba(201,162,39,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
  font-size: .8rem;
}
.gld-search-tool-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}
.gld-search-tool-desc {
  color: var(--text-muted);
  font-size: .73rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Keyboard hints ── */
.gld-search-hints {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 14px;
  font-size: .7rem;
  color: rgba(138,138,154,.4);
  flex-shrink: 0;
}
.gld-search-hints kbd {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: ui-monospace, monospace;
}

/* ── Mobile — full-screen layout ── */
@media (max-width: 640px) {
  /* Hero bar: shorter placeholder, hide kbd hint */
  .hero-search-trigger { padding: 12px 16px; margin-bottom: 20px; }
  .hero-search-trigger__placeholder { font-size: .85rem; }
  .hero-search-trigger__kbd { display: none; }

  /* Overlay: fill screen, flex column so results can scroll */
  .gld-search-overlay {
    padding-top: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden; /* outer doesn't scroll */
  }

  /* Box takes full screen as a flex column */
  .gld-search-box {
    padding: 12px 12px 0;
    height: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* Results panel scrolls, fills remaining height */
  .gld-search-results {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    border-bottom: none;
    box-shadow: none;
  }

  /* Tabs hint hidden, tabs compact */
  .gld-search-tabs-hint { display: none; }
  .gld-search-tab { padding: 5px 11px; font-size: .74rem; }

  /* Keyboard hints hidden on mobile */
  .gld-search-hints { display: none; }

  /* Input slightly smaller */
  .gld-search-input { font-size: .95rem; padding: 14px 44px 14px 46px; }
  .gld-search-input-icon { left: 15px; }
  .gld-search-clear { right: 12px; }
}

/* ── Comment editing ─────────────────────────────────────── */
.comment-edited-stamp {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .68rem;
  color: rgba(138,138,154,.5);
  margin-bottom: 4px;
  font-style: italic;
}
.comment-edited-stamp i {
  font-size: .6rem;
  font-style: normal;
}

/* ── Comment collapse bar ── */
.comment-item {
  position: relative;
}
.comment-collapse-bar {
  width: 12px;
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.comment-collapse-bar::before {
  content: '';
  display: block;
  width: 2px;
  background: var(--border);
  border-radius: 2px;
  flex: 1;
  transition: background var(--t);
  margin: 16px 0 4px;
}
.comment-collapse-bar:hover::before {
  background: var(--gold);
}
.comment-item--collapsed > .comment-item__body {
  display: block;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}
.comment-item--collapsed > .comment-item__body > *:not(.comment-item__collapsed-stub) {
  display: none !important;
}
.comment-item--collapsed > .comment-item__body > .comment-item__collapsed-stub {
  display: flex !important;
}
.comment-item--collapsed > .comment-collapse-bar::before {
  background: rgba(201,162,39,.35);
  margin: 6px 0;
}
.comment-item--collapsed > .comment-collapse-bar:hover::before {
  background: var(--gold);
}
.comment-item--hidden {
  display: none !important;
}
.comment-item__collapsed-stub {
  display: none;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}
.comment-expand-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
  transition: background var(--t), color var(--t);
}
.comment-item__collapsed-stub:hover .comment-expand-dot {
  background: var(--gold);
  color: #0a0a0f;
}

/* ══════════════════════════════════════════════════════════
   COMMENT NOMINATIONS
══════════════════════════════════════════════════════════ */

.nom-btn {
  color: var(--text-muted);
  background: none;
  border: 1px solid transparent;
  border-radius: var(--r);
  padding: 3px 8px;
  transition: color var(--t), background var(--t), border-color var(--t);
}
.nom-btn--on {
  color: var(--gold);
  background: rgba(201,162,39,.08);
  border-color: rgba(201,162,39,.2);
}
.nom-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(201,162,39,.07);
  border: 1px solid rgba(201,162,39,.28);
  border-radius: var(--r-pill, 999px);
  padding: 2px 9px;
  font-size: .7rem;
  font-weight: 700;
  color: var(--gold);
  cursor: pointer;
  font-family: var(--font-body);
  transition: background var(--t);
}
.nom-pill:hover {
  background: rgba(201,162,39,.15);
}

/* ══════════════════════════════════════════════════════════
   RICH TEXT EDITOR (new thread form)
══════════════════════════════════════════════════════════ */

/* Toolbar */
.rte-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--r) var(--r) 0 0;
  padding: 6px 10px;
  flex-wrap: wrap;
}
/* JS adds position:fixed + inline left/width; this class adds the visual change */
.rte-toolbar--stuck {
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
}
.rte-toolbar__group { display: flex; gap: 2px; }
.rte-toolbar__sep {
  width: 1px; height: 18px;
  background: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
}
.rte-toolbar__lock {
  margin-left: auto;
  font-size: .68rem;
  color: rgba(138,138,154,.45);
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.rte-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 26px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 600;
  transition: all var(--t);
}
.rte-btn:hover { color: var(--white); background: rgba(255,255,255,.06); }
.rte-btn--active {
  color: var(--gold);
  background: rgba(201,162,39,.12);
  border-color: rgba(201,162,39,.25);
}

/* Editor area */
.rte-editor {
  min-height: 180px;
  padding: 12px 14px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--r) var(--r);
  color: var(--text);
  font-family: var(--font-body);
  font-size: .9rem;
  line-height: 1.75;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  cursor: text;
}
.rte-editor:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,162,39,.1);
}
.rte-editor--error { border-color: #f87171; }

/* Placeholder via CSS */
.rte-editor--empty:before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  opacity: .55;
  pointer-events: none;
  float: left;
  height: 0;
}

/* ── Editor content styles — match .gld-prose so WYSIWYG ── */
.rte-editor p { margin: 0 0 1.1em; }
.rte-editor h2 { font-size: 1.2rem; font-weight: 700; color: var(--white); margin: 1.5em 0 .5em; }
.rte-editor h3 { font-size: 1rem; font-weight: 700; color: var(--white); margin: 1.25em 0 .4em; }
.rte-editor ul, .rte-editor ol { padding-left: 1.6em; margin: .6em 0 1em; }
.rte-editor ul ul, .rte-editor ol ol,
.rte-editor ul ol, .rte-editor ol ul { margin: .3em 0; }
.rte-editor li { margin-bottom: .4em; line-height: 1.75; }
.rte-editor ul > li { list-style-type: disc; }
.rte-editor ol > li { list-style-type: decimal; }
.rte-editor blockquote {
  border-left: 3px solid var(--gold);
  background: rgba(201,162,39,.05);
  padding: 10px 16px;
  margin: 1em 0;
  font-style: italic;
  color: var(--text);
}
/* Only our gold — *="color" is too broad (matches background-color, color:inherit, etc.) */
.rte-editor span[style*="#c9a227"],
.rte-editor span[style*="201, 162, 39"] { color: var(--gold) !important; }

/* ── RTE toolbar: mobile keyboard-attach mode ── */
@media (max-width: 767px) {
  /* Horizontal scroll strip — no wrapping */
  .rte-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 6px 8px;
  }
  .rte-toolbar::-webkit-scrollbar { display: none; }

  /* Hide lock hint — no room on small strip */
  .rte-toolbar__lock { display: none; }

  /* Editor full-radius when toolbar is hidden above keyboard */
  .rte-editor { border-radius: var(--r); }

  /* Fixed above keyboard: restore bottom border + top shadow */
  .rte-toolbar--mobile-kb {
    border-bottom: 1px solid var(--border);
    border-radius: var(--r) var(--r) 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,.55);
  }
}

/* ══════════════════════════════════════════════════════════
   PROSE STYLES (.gld-prose) — thread body rendering
══════════════════════════════════════════════════════════ */
.gld-prose {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.7;
}
.gld-prose > *:first-child { margin-top: 0; }
.gld-prose > *:last-child  { margin-bottom: 0; }

/* Paragraphs */
.gld-prose p { margin: 0 0 1.25em; }

/* All heading levels */
.gld-prose h1,
.gld-prose h2,
.gld-prose h3,
.gld-prose h4,
.gld-prose h5,
.gld-prose h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--white);
  line-height: 1.25;
  margin: 2em 0 .65em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.gld-prose h1 { font-size: 1.55rem; }
.gld-prose h2 { font-size: 1.25rem; }
.gld-prose h3 { font-size: 1.05rem; border-bottom: none; padding-bottom: 0; margin: 1.5em 0 .5em; }
.gld-prose h4,
.gld-prose h5,
.gld-prose h6 { font-size: .95rem; border-bottom: none; padding-bottom: 0; margin: 1.25em 0 .4em; color: var(--text); }

/* Inline formatting */
.gld-prose strong, .gld-prose b { color: var(--white); font-weight: 700; }
.gld-prose em, .gld-prose i     { font-style: italic; }
.gld-prose u                    { text-decoration: underline; text-underline-offset: 2px; }
.gld-prose s, .gld-prose del    { text-decoration: line-through; opacity: .65; }
.gld-prose sup                  { font-size: .72em; vertical-align: super; }
.gld-prose sub                  { font-size: .72em; vertical-align: sub; }
.gld-prose mark                 { background: rgba(201,162,39,.2); color: var(--white); border-radius: 2px; padding: 0 3px; }
.gld-prose code                 { background: rgba(255,255,255,.06); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-family: 'Courier New', monospace; font-size: .88em; }

/* Colored spans (remapped to gold by paste cleaner) */
.gld-prose span[style*="color"] { color: var(--gold) !important; }

/* Text alignment */
.gld-prose [style*="text-align:center"], .gld-prose [style*="text-align: center"] { text-align: center; }
.gld-prose [style*="text-align:right"],  .gld-prose [style*="text-align: right"]  { text-align: right; }

/* Lists — nested */
.gld-prose ul, .gld-prose ol {
  padding-left: 1.6em;
  margin: .75em 0 1.25em;
}
.gld-prose ul ul, .gld-prose ol ol,
.gld-prose ul ol, .gld-prose ol ul {
  margin: .3em 0 .3em;
}
.gld-prose li { margin-bottom: .55em; line-height: 1.75; }
.gld-prose ul > li { list-style-type: disc; }
.gld-prose ul > li > ul > li { list-style-type: circle; }
.gld-prose ol > li { list-style-type: decimal; }

/* Blockquote */
.gld-prose blockquote {
  border-left: 3px solid var(--gold);
  background: rgba(201,162,39,.05);
  padding: 14px 20px;
  margin: 1.25em 0;
  border-radius: 0 var(--r) var(--r) 0;
  font-style: italic;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.8;
}
.gld-prose blockquote p { margin-bottom: 0; }

/* Horizontal rule */
.gld-prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5em 0;
}

/* Tables */
.gld-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: .9rem;
  overflow-x: auto;
  display: block;
}
.gld-prose th,
.gld-prose td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.gld-prose th {
  background: var(--bg-card-2);
  color: var(--white);
  font-weight: 600;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.gld-prose tr:nth-child(even) td { background: rgba(255,255,255,.02); }

/* Links */
.gld-prose a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }
.gld-prose a:hover { color: var(--gold-light); }

/* ══════════════════════════════════════════════════════════
   FILE UPLOAD — drop zone + chips
══════════════════════════════════════════════════════════ */
.drop-zone {
  border: 1.5px dashed var(--border);
  border-radius: var(--r);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t), background var(--t);
}
.drop-zone:hover,
.drop-zone--over {
  border-color: var(--gold);
  background: rgba(201,162,39,.04);
}
.drop-zone__link {
  color: var(--gold);
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 6px 10px;
  font-size: .8rem;
  max-width: 280px;
}
.file-chip__name {
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.file-chip__size  { color: var(--text-muted); font-size: .72rem; flex-shrink: 0; }
.file-chip__thumb {
  width: 22px; height: 22px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
}
.file-chip__remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0 0 2px;
  flex-shrink: 0;
}
.file-chip__remove:hover { color: #ef4444; }

/* ── Notification bell (design-system spec — LeftSidebar Prototype.html) ────── */
.nav-bell { position: relative; }
.nav-bell-btn {
  background: none; border: none; cursor: pointer;
  color: var(--gold);
  font-size: 1.25rem;
  padding: 6px 7px;
  position: relative;
  border-radius: var(--r);
  transition: all var(--t);
  display: flex; align-items: center;
}
.nav-bell-btn:hover,
.nav-bell-btn.is-open { color: #f5d27a; }
.nav-bell-badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 16px; height: 16px;
  background: #e05a4b;
  border-radius: 10px;
  border: 2px solid var(--bg-card);
  font-size: .56rem; font-weight: 800; color: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}
.nav-bell-panel {
  position: fixed; top: calc(var(--topbar-h) + 8px); right: 16px;
  width: 340px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 16px 48px rgba(0,0,0,.6);
  z-index: 500; overflow: hidden;
}
.nbp-header {
  padding: 13px 16px 10px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.nbp-title { font-weight: 700; font-size: .88rem; color: var(--white); }
.nbp-mark-all {
  background: none; border: none; cursor: pointer;
  font-size: .74rem; color: var(--gold); font-weight: 600;
  font-family: var(--font-body); padding: 0;
}
.nbp-list { max-height: 340px; overflow-y: auto; }
.nbp-loading { padding: 20px; text-align: center; color: var(--text-muted); }
.nbp-notif-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  transition: background var(--t);
}
.nbp-notif-row + .nbp-notif-row { border-top: 1px solid var(--border); }
.nbp-notif-row--unread { background: rgba(201,162,39,.04); }
.nbp-notif-row:hover { background: rgba(255,255,255,.04); }
.nbp-footer {
  display: block; padding: 10px 16px;
  text-align: center; font-size: .78rem;
  color: var(--gold); font-weight: 600;
  border-top: 1px solid var(--border);
  text-decoration: none; transition: background var(--t);
}
.nbp-footer:hover { background: rgba(201,162,39,.04); color: var(--gold); }

/* ── Avatar dropdown (design-system spec — LeftSidebar Prototype.html) ───────── */
.nav-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(201,162,39,.15);
  border: 1.5px solid rgba(201,162,39,.4);
  display: flex; align-items: center; justify-content: center;
  font-size: .62rem; font-weight: 800; color: var(--gold);
  flex-shrink: 0;
  overflow: hidden;
}
.nav-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.user-dropdown { position: relative; }
.user-dropdown__trigger {
  display: flex; align-items: center; gap: 7px;
  background: none; border: none; cursor: pointer;
  color: var(--text); font-family: var(--font-body);
  font-size: .83rem; padding: 4px 6px; border-radius: var(--r);
  transition: background var(--t);
}
.user-dropdown__trigger:hover { background: rgba(255,255,255,.07); }
.user-dropdown__panel {
  display: none; position: absolute; top: calc(100% + 10px); right: 0;
  width: 220px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: 0 16px 48px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.04);
  z-index: 500; overflow: hidden;
}
.user-dropdown.open .user-dropdown__panel { display: block; }
.user-dropdown__header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.user-dropdown__name { font-size: .88rem; font-weight: 700; color: var(--white); line-height: 1.2; }
.user-dropdown__role { font-size: .72rem; color: var(--text-muted); margin-top: 1px; }
.user-dropdown__item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; color: var(--text-muted); font-size: .85rem;
  font-weight: 500; text-decoration: none; transition: background var(--t), color var(--t);
  cursor: pointer; background: none; border: none; width: 100%;
  font-family: var(--font-body); text-align: left;
}
.user-dropdown__item:hover { background: rgba(255,255,255,.05); color: var(--white); }
.user-dropdown__item i { width: 16px; text-align: center; font-size: .82rem; color: var(--text-muted); transition: color var(--t); }
.user-dropdown__item:hover i { color: var(--gold); }
.user-dropdown__divider { height: 1px; background: var(--border); margin: 4px 0; }
.user-dropdown__item--danger { color: #e05a4b; }
.user-dropdown__item--danger i { color: #e05a4b; }
.user-dropdown__item--danger:hover { background: rgba(192,57,43,.08); color: #ef4444; }

/* ── Full notifications page ────────────────────────────────────────────────── */
.notif-row {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  text-decoration: none; color: var(--text);
  transition: color var(--t);
}
.notif-row:last-child { border-bottom: none; }
.notif-row--unread {
  border-left-color: var(--gold);
  padding-left: 12px;
}
.notif-icon {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(201,162,39,.1);
  border: 1px solid rgba(201,162,39,.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--gold); font-size: .88rem;
  margin-top: 2px;
}
.notif-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.notif-tab {
  padding: 6px 14px; border-radius: 20px;
  font-size: .82rem; font-weight: 500;
  border: 1px solid var(--border);
  background: none; color: var(--text-muted);
  text-decoration: none;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.notif-tab:hover { color: var(--white); border-color: rgba(255,255,255,.2); }
.notif-tab--active {
  background: rgba(201,162,39,.12);
  border-color: rgba(201,162,39,.35);
  color: var(--gold);
}

/* ── Notification settings (nastroiki) ──────────────────────────────────────── */
.pref-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.pref-row:last-child { border-bottom: none; }
.pref-toggle {
  position: relative; width: 44px; height: 24px; flex-shrink: 0;
}
.pref-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.pref-slider {
  position: absolute; inset: 0;
  background: rgba(255,255,255,.12);
  border-radius: 24px; cursor: pointer;
  transition: background .2s;
}
.pref-toggle input:checked + .pref-slider { background: var(--gold); }
.pref-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff;
  left: 3px; top: 3px;
  transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.pref-toggle input:checked + .pref-slider::before { transform: translateX(20px); }

/* ══════════════════════════════════════════════════════════
   FILE LIST — thread detail
══════════════════════════════════════════════════════════ */
.thread-files {
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.thread-files__header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  background: var(--bg-card-2);
  border-bottom: 1px solid var(--border);
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.thread-file-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.thread-file-row:last-child { border-bottom: none; }
.thread-file-icon {
  width: 38px; height: 38px;
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.thread-file-icon--pdf  { background: rgba(231,76,60,.12);  color: #e74c3c; }
.thread-file-icon--doc,
.thread-file-icon--docx { background: rgba(41,128,185,.12); color: #2980b9; }
.thread-file-icon--xls,
.thread-file-icon--xlsx { background: rgba(39,174,96,.12);  color: #27ae60; }
.thread-file-icon--jpg,
.thread-file-icon--jpeg,
.thread-file-icon--png  { background: rgba(142,68,173,.12); color: #8e44ad; }

/* ── Thread image gallery ────────────────────────────────── */
.thread-image-gallery {
  display: grid;
  gap: 6px;
  margin-top: 20px;
  border-radius: var(--r);
  overflow: hidden;
}
.thread-image-gallery a {
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--bg-card-2);
}
.thread-image-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .18s ease;
}
.thread-image-gallery a:hover img { transform: scale(1.03); }

.thread-image-gallery--1 { grid-template-columns: 1fr; }
.thread-image-gallery--1 a { aspect-ratio: 16 / 10; max-height: 560px; }

.thread-image-gallery--2 { grid-template-columns: 1fr 1fr; }
.thread-image-gallery--2 a { aspect-ratio: 1; }

.thread-image-gallery--3 { grid-template-columns: repeat(3, 1fr); }
.thread-image-gallery--3 a { aspect-ratio: 1; }

.thread-image-gallery--many { grid-template-columns: 1fr 1fr; }
.thread-image-gallery--many a { aspect-ratio: 1; }

.thread-image-gallery__more {
  position: absolute;
  inset: 0;
  background: rgba(10,10,15,.68);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-display);
}

/* Compact variant used under comments/replies - smaller tiles, tighter cap */
.thread-image-gallery--comment.thread-image-gallery--1 a { aspect-ratio: 16 / 9; max-height: 280px; }
.thread-image-gallery--comment { max-width: 420px; }

/* Compact "attach" trigger for comment/reply forms (paperclip icon button) */
.attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 6px 12px;
  font-size: .78rem;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color var(--t), color var(--t);
}
.attach-btn:hover { border-color: var(--border-gold); color: var(--gold); }

/* Removable existing-file overlay used when editing a thread */
.thread-file-remove-toggle {
  position: absolute;
  top: 6px; right: 6px;
  z-index: 2;
  cursor: pointer;
}
.thread-file-remove-toggle input {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.thread-file-remove-toggle__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(10,10,15,.7);
  color: #fff;
  font-size: .75rem;
  border: 1px solid rgba(255,255,255,.25);
  transition: background var(--t), border-color var(--t);
}
.thread-file-remove-toggle input:checked + .thread-file-remove-toggle__mark {
  background: #c0392b;
  border-color: #c0392b;
}
.thread-existing-file:has(.thread-file-remove-toggle input:checked) {
  opacity: .35;
}

/* ── Share buttons ───────────────────────────────────────── */
.share-toast {
  position: fixed;
  bottom: max(28px, env(safe-area-inset-bottom, 28px));
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  color: var(--gold);
  font-size: .82rem;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: 20px;
  z-index: 600;
  box-shadow: 0 4px 24px rgba(0,0,0,.55);
  white-space: nowrap;
  transition: opacity .4s ease;
  pointer-events: none;
}

/* ── AJAX success/error toast (GLD.toast()) ─────────────────
   z-index above .gld-modal-bd (2000) - AJAX mutations happen from inside
   modals, the toast needs to stay visible as the modal closes. */
.gld-toast {
  position: fixed;
  bottom: max(28px, env(safe-area-inset-bottom, 28px));
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  font-size: .82rem;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: 20px;
  z-index: 2200;
  box-shadow: 0 4px 24px rgba(0,0,0,.55);
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity .4s ease;
  pointer-events: none;
}
.gld-toast--success { border: 1px solid var(--border-gold); color: var(--gold); }
.gld-toast--error { border: 1px solid var(--border-red); color: var(--red-hover); }

@media (max-width: 640px) {
  .gld-toast { white-space: normal; text-align: center; }
}

/* Social icon square buttons — 44px tap target on mobile */
.share-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text-muted);
  cursor: pointer;
  font-size: .8rem;
  transition: color var(--t), border-color var(--t);
  flex-shrink: 0;
}
.share-btn-icon:hover { color: var(--white); border-color: rgba(240,240,240,.3); }

@media (min-width: 480px) {
  .share-btn-icon { min-width: 30px; min-height: 30px; }
}

/* ═══════════════════════════════════════
   COMPARISON GRID (why-different page)
═══════════════════════════════════════ */
.comp-grid { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.comp-head,
.comp-row  { display: grid; grid-template-columns: 28% 1fr 1fr; border-bottom: 1px solid var(--border); }
.comp-row--last { border-bottom: none; }
.comp-head > div,
.comp-row  > div { padding: 13px 16px; font-size: .82rem; line-height: 1.6; vertical-align: top; }
/* header row */
.comp-head { background: var(--bg-card-2); }
.comp-head .comp-crit { /* empty spacer */ }
.comp-head .comp-them { font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); border-right: 1px solid var(--border); }
.comp-head .comp-us   { font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); border-bottom: 2px solid rgba(201,162,39,.35); }
/* data cells */
.comp-crit { font-size: .8rem; font-weight: 700; color: var(--white); }
.comp-them { color: var(--text-muted); border-right: 1px solid var(--border); }
.comp-us   { color: var(--text-muted); background: rgba(201,162,39,.03); }
.comp-us strong { color: var(--white); }
.comp-x { color: rgba(207,111,111,.65); font-size: .68rem; margin-right: 5px; flex-shrink: 0; }
.comp-v { color: rgba(111,207,111,.75); font-size: .68rem; margin-right: 5px; flex-shrink: 0; }

@media (max-width: 680px) {
  .comp-head { display: none; }
  .comp-row  { grid-template-columns: 1fr 1fr; grid-template-areas: "crit crit" "them us"; border-bottom: 2px solid var(--border); }
  .comp-row--last { border-bottom: none; }
  .comp-crit { grid-area: crit; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); padding-bottom: 8px; border-bottom: 1px solid var(--border); }
  .comp-them { grid-area: them; font-size: .78rem; border-right: 1px solid var(--border); }
  .comp-us   { grid-area: us;   font-size: .78rem; }
  .comp-row > div { padding: 10px 12px; }
}

/* Share row wrapper */
.share-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Nav search pill ─────────────────────────────── */
.nav-search-pill {
  flex: 1;
  position: relative;
}
.nav-search-pill__input {
  width: 100%;
  padding: 10px 20px 10px 42px;
  background: rgba(201,162,39,.04);
  border: 1px solid rgba(201,162,39,.25);
  border-radius: 999px;
  color: var(--text);
  font-size: .88rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
  cursor: pointer;
  box-sizing: border-box;
}
.nav-search-pill__input:hover {
  border-color: rgba(201,162,39,.5);
  background: rgba(201,162,39,.07);
}
.nav-search-pill__input:focus {
  border-color: var(--gold);
  background: rgba(201,162,39,.06);
  box-shadow: 0 0 0 3px rgba(201,162,39,.12);
}
.nav-search-pill__icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  font-size: .85rem;
  pointer-events: none;
}
@media (max-width: 768px) {
  .nav-search-pill { display: none; }
}

/* ── Feed 2-column layout ────────────────────────── */
@media (max-width: 900px) {
  .feed-grid { grid-template-columns: 1fr !important; }
  .feed-sidebar { display: none !important; }
}

/* ── Trust line: clamp on mobile ── */
.trust-line { min-width: 0; overflow: hidden; }
@media (max-width: 640px) {
  .trust-line__firm { display: none; }
  .trust-line__role { display: none; }
  .trust-line__date { font-size: .7rem; white-space: nowrap; }
}

/* ── Post/thread footer: keep vote pill right on narrow screens ── */
@media (max-width: 480px) {
  .post-footer, .thread-footer { gap: 10px; }
  .post-footer__spacer, .thread-footer__spacer { display: none; }
  .vote-btn-pill { margin-left: auto; }
}

/* ── Specialist note: hide on mobile, only show count ──
   The rule used to hide `.feed-specialist-note` itself, which removed
   the thread-count span living inside it too, contradicting this
   comment's own stated intent - home_feed.html now marks the two
   children with their own classes so only the descriptive text hides. */
@media (max-width: 640px) {
  .feed-specialist-note { justify-content: center !important; }
  .feed-specialist-note__text { display: none !important; }
  .feed-specialist-note__count { white-space: normal; }
}

/* ── Prevent horizontal overflow ── */
/* overflow:clip (both axes) does NOT create a scroll container, so position:sticky keeps working.
   overflow-x:hidden or overflow-x:clip alone forces overflow-y to compute to hidden/auto,
   which still creates a scroll container and breaks sticky. Both axes must be clip. */
.app-shell > main { overflow: clip; }
@media (max-width: 900px) {
  .app-shell > main { padding-bottom: 80px; }
  .container { max-width: 100%; overflow: clip; }
}

/* ═══════════════════════════════════════
   MOBILE NAVIGATION — bottom tab bar + slim topbar
   Hidden on desktop; active at ≤900px
═══════════════════════════════════════ */

/* Desktop: hide mobile-only elements */
.mob-nav                 { display: none; }
.mob-topbar-search       { display: none; }
.gld-search-mob-close    { display: none; }
.mob-profile-drawer      { display: none; }
.mob-profile-backdrop    { display: none; }

@media (max-width: 900px) {

  /* ── Topbar slim mode ── */
  .site-header.scroll-hidden { transform: translateY(-100%); }

  /* Hide desktop topbar elements */
  .site-logo       { display: none; }
  .nav-search-pill { display: none !important; }
  .site-nav-auth   { display: none; }

  /* Show mobile search bar */
  .mob-topbar-search {
    display: flex; align-items: center; flex: 1; gap: 10px;
    background: rgba(201,162,39,.07);
    border: 1px solid rgba(201,162,39,.22);
    border-radius: 22px;
    padding: 0 12px;
    height: 38px;
    cursor: pointer;
    user-select: none;
  }
  .mob-topbar-search:hover {
    background: rgba(201,162,39,.11);
    border-color: rgba(201,162,39,.4);
  }
  .mob-search-logo-ring {
    width: 26px; height: 26px; border-radius: 50%;
    border: 1.5px solid rgba(201,162,39,.5);
    background: rgba(201,162,39,.1);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .mob-search-placeholder {
    flex: 1;
    color: rgba(201,162,39,.65);
    font-size: .875rem;
    font-family: var(--font-body);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }

  /* Bell panel floats above bottom nav on mobile */
  .nav-bell-panel {
    top: auto;
    bottom: calc(56px + 8px);
    right: 10px;
    width: min(340px, calc(100vw - 20px));
  }

  /* Sidebar sits above everything when open */
  .left-sidebar.is-open { z-index: 190; }

  /* Content breathing room above bottom nav */
  .app-shell > main { padding-bottom: 72px; }

  /* ── Bottom navigation bar ── */
  .mob-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 56px; z-index: 150;
    background: rgba(10,10,15,.97);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    transition: transform .25s ease;
  }
  .mob-nav.scroll-hidden { transform: translateY(100%); }

  /* Floating corner buttons (tour FAB on Работно бюро, sitewide feedback
     chip) share the bottom-right corner with the nav strip above. Keep
     them off-screen while the strip is showing, and only let them in
     once it has scrolled away - toggled by the same scroll listener that
     drives .mob-nav.scroll-hidden, see gildiyata.js. */
  .tour-fab,
  .feedback-float-chip {
    transition: opacity .2s ease, transform .2s ease;
  }
  .tour-fab:not(.mob-fab-visible),
  .feedback-float-chip:not(.mob-fab-visible) {
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
  }

  .mob-nav__item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px; padding: 6px 4px;
    color: var(--text-muted); text-decoration: none;
    background: none; border: none; cursor: pointer;
    font-family: var(--font-body);
    transition: color var(--t);
    -webkit-tap-highlight-color: transparent;
  }
  .mob-nav__item:active { opacity: .7; }
  .mob-nav__item--active { color: var(--gold); }
  .mob-nav__item--create { color: var(--gold); }

  .mob-nav__icon { font-size: 1.15rem; line-height: 1; }
  .mob-nav__item--create .mob-nav__icon { font-size: 1.3rem; }

  .mob-nav__label {
    font-size: .58rem; font-weight: 600;
    letter-spacing: .03em; white-space: nowrap;
    line-height: 1;
  }
  .mob-nav__item--create .mob-nav__label { color: var(--gold); }

  /* Badge on bell icon */
  .mob-nav__bell-wrap { position: relative; display: flex; }
  .mob-nav__badge {
    position: absolute; top: -4px; right: -7px;
    min-width: 15px; height: 15px; border-radius: 8px;
    background: #c0392b; color: #fff;
    font-size: .52rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px; line-height: 1;
    border: 1.5px solid rgba(10,10,15,.97);
  }

  /* Avatar in bottom nav "Ти" item */
  .mob-nav__avatar {
    width: 24px; height: 24px; border-radius: 50%;
    background: rgba(201,162,39,.15);
    border: 1.5px solid rgba(201,162,39,.4);
    display: flex; align-items: center; justify-content: center;
    font-size: .62rem; font-weight: 800; color: var(--gold);
    overflow: hidden; flex-shrink: 0;
  }
  .mob-nav__avatar img { width: 100%; height: 100%; object-fit: cover; }

  .mob-nav__item--active .mob-nav__avatar {
    border-color: var(--gold);
    background: rgba(201,162,39,.25);
  }

  /* ── Mobile search close button ── */
  .gld-search-mob-close {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; margin-bottom: 10px; flex-shrink: 0;
    background: rgba(255,255,255,.04); border: 1px solid var(--border);
    border-radius: var(--r); padding: 9px 14px;
    color: var(--text-muted); font-size: .82rem; font-weight: 600;
    font-family: var(--font-body); cursor: pointer;
    transition: background var(--t), color var(--t);
  }
  .gld-search-mob-close:hover { background: rgba(255,255,255,.07); color: var(--text); }

  /* ── Mobile profile bottom drawer ── */
  .mob-profile-backdrop {
    display: none;
    position: fixed; inset: 0; z-index: 249;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(2px);
    opacity: 0; transition: opacity .25s ease;
  }
  .mob-profile-backdrop.is-open { display: block; opacity: 1; }

  .mob-profile-drawer {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 250;
    background: var(--bg-card);
    border-top: 1px solid rgba(201,162,39,.22);
    border-radius: 18px 18px 0 0;
    padding: 0 0 calc(56px + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
  }
  .mob-profile-drawer.is-open { transform: translateY(0); }

  .mob-profile-drawer__handle {
    width: 36px; height: 4px; border-radius: 2px;
    background: rgba(255,255,255,.15);
    margin: 12px auto 0;
  }

  .mob-profile-drawer__header {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px 14px;
    border-bottom: 1px solid var(--border);
  }
  .mob-profile-drawer__avatar {
    width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
    background: rgba(201,162,39,.15);
    border: 2px solid rgba(201,162,39,.4);
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem; font-weight: 800; color: var(--gold);
    overflow: hidden;
  }
  .mob-profile-drawer__avatar img { width: 100%; height: 100%; object-fit: cover; }
  .mob-profile-drawer__name { font-size: .95rem; font-weight: 700; color: var(--white); line-height: 1.2; }
  .mob-profile-drawer__role { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }

  .mob-profile-drawer__hint {
    text-align: center; font-size: .68rem; color: rgba(138,138,154,.45);
    padding: 10px 20px 0; letter-spacing: .02em;
  }
  .mob-profile-drawer__nav { padding: 6px 0; }
  .mob-profile-drawer__item {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 20px; color: var(--text);
    text-decoration: none; font-size: .9rem;
    transition: background var(--t), color var(--t);
  }
  .mob-profile-drawer__item i { width: 18px; text-align: center; color: var(--text-muted); font-size: .9rem; }
  .mob-profile-drawer__item:hover { background: rgba(255,255,255,.04); }
  .mob-profile-drawer__item:hover i { color: var(--gold); }
  .mob-profile-drawer__item--danger { color: #e74c3c; }
  .mob-profile-drawer__item--danger i { color: #e74c3c; }
  .mob-profile-drawer__item--danger:hover { background: rgba(192,57,43,.08); }
  .mob-profile-drawer__divider { height: 1px; background: var(--border); margin: 4px 0; }
}

/* ── Feedback feature ── */

/* Floating feedback chip */
.feedback-float-chip {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 150;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1.5px solid rgba(201,162,39,.35);
  border-radius: 24px;
  color: var(--gold);
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
  transition: border-color var(--t), background var(--t), transform var(--t), box-shadow var(--t);
  backdrop-filter: blur(8px);
}
.feedback-float-chip i { font-size: .88rem; }
.feedback-float-chip:hover {
  border-color: var(--gold);
  background: rgba(201,162,39,.1);
  color: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,.55);
}

@media (max-width: 680px) {
  .feedback-float-chip {
    bottom: 74px; /* above mobile bottom nav */
    right: 16px;
    padding: 9px 14px;
    font-size: .78rem;
  }
}

/* ══════════════════════════════════════════════════════════
   LINK PREVIEW CARDS (unfurl)
══════════════════════════════════════════════════════════ */
.composer-link-preview { margin-top: 2px; }
.composer-link-preview .link-preview { max-width: 100%; }

.gld-link {
  color: var(--gold);
  word-break: break-all;
  text-decoration: none;
}
.gld-link:hover { text-decoration: underline; }

.link-preview {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  max-width: 500px;
  transition: border-color var(--t);
}
.link-preview:hover { border-color: rgba(201,162,39,.4); }

.link-preview__inner {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--bg-card-2);
}
.link-preview__img {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg);
}
.link-preview__content {
  padding: 12px 14px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.link-preview__site {
  font-size: .68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.link-preview__title {
  font-size: .875rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.link-preview__desc {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
}


/* ── Calculator Action Bar ───────────────────────────────────── */
.calc-action-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.cab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--t), color var(--t), background var(--t);
  font-family: inherit;
  line-height: 1;
}

.cab-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201, 162, 39, .06);
}

/* ── Email modal form fields ─────────────────────────────────── */
.gld-em-row { margin-bottom: 16px; }
.gld-em-label { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: rgba(255,255,255,.75); margin-bottom: 6px; }
.gld-em-inp { width: 100%; padding: 9px 12px; background: var(--bg-card-2); border: 1px solid var(--border); border-radius: var(--r); color: var(--text); font-size: .9rem; font-family: inherit; box-sizing: border-box; }
.gld-em-inp:focus { outline: none; border-color: var(--gold); }
textarea.gld-em-inp { resize: none; min-height: 72px; overflow: hidden; }
.gld-em-check { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; color: var(--text); }
.gld-em-note { font-size: .73rem; color: rgba(255,255,255,.45); margin-top: 5px; margin-bottom: 0; }

/* ── Action success toast ────────────────────────────────────── */
.gld-action-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--gold);
  color: #0a0a0f;
  padding: 12px 20px;
  border-radius: var(--r);
  font-weight: 700;
  font-size: .9rem;
  z-index: 9999;
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
  transform: translateY(20px);
  opacity: 0;
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.gld-action-toast--show { opacity: 1; transform: translateY(0); }


/* =========================================================
   DatePicker component — gld_datepicker.js
   ========================================================= */
.gld-dp-wrap { display: block; position: relative; }

/* Text input that also accepts typing in дд.мм.гггг format */
.gld-dp-trigger {
  width: 100%; padding: 10px 38px 10px 14px; /* right padding leaves room for icon */
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: .9rem; font-family: var(--font-body); font-variant-numeric: tabular-nums;
  transition: border-color .15s ease, box-shadow .15s ease;
  outline: none; cursor: text;
  box-sizing: border-box;
  -webkit-appearance: none; appearance: none;
}
.gld-dp-trigger::placeholder { color: var(--text-muted); }
.gld-dp-trigger.is-focused,
.gld-dp-trigger.is-open {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,162,39,.25);
}

/* Calendar icon button inside the wrapper */
.gld-dp-icon-btn {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; padding: 0; cursor: pointer;
  display: flex; align-items: center; line-height: 0;
}

.gld-dp-pop {
  /* Fixed so it escapes overflow:auto/hidden containers and floats above the footer.
     top/left are set by JS via trigger.getBoundingClientRect() on each open. */
  display: none; position: fixed; z-index: 3000;
  width: 280px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: 14px; box-sizing: border-box;
}
.gld-dp-pop.is-open { display: block; }

.gld-dp-hdr {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}
.gld-dp-month-lbl {
  font-family: var(--font-display); font-weight: 700; font-size: .95rem;
  color: var(--white); letter-spacing: -0.01em;
}
.gld-dp-nav {
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border); border-radius: var(--r);
  color: var(--text-muted); font-size: 1rem; line-height: 1; cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.gld-dp-nav:hover { border-color: var(--gold); color: var(--gold); }

.gld-dp-wdays {
  display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 4px;
}
.gld-dp-wdays > div {
  text-align: center; font-size: .68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); padding: 4px 0;
}

.gld-dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.gld-dp-day {
  width: 100%; aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: .82rem; font-variant-numeric: tabular-nums;
  cursor: pointer; transition: background .12s ease, color .12s ease;
  padding: 0; line-height: 1;
}

.gld-dp-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border);
}
.gld-dp-today {
  background: none; border: none; color: var(--gold);
  font-size: .8rem; font-weight: 600; cursor: pointer; padding: 4px 2px;
}
.gld-dp-clear {
  background: none; border: none; color: var(--text-muted);
  font-size: .8rem; cursor: pointer; padding: 4px 2px;
}

/* Compact sizing inside stazh period table rows */
.periods-table .gld-dp-trigger { padding: 7px 32px 7px 8px; font-size: .84rem; }
.periods-table .gld-dp-icon-btn { right: 6px; }

/* =========================================================
   Shared: employee picker, templates bar, modals
   (Used by all calculators globally, previously per-template)
   ========================================================= */

/* Templates bar */
.templates-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.templates-bar > span { font-size: .78rem; color: var(--text-muted); flex: 1; }
.tpl-btn { padding: 6px 12px; font-size: .78rem; font-weight: 600; border-radius: var(--r); cursor: pointer; transition: all var(--t); }
.tpl-btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.tpl-btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.tpl-btn-save { background: rgba(201,162,39,.12); border: 1px solid rgba(201,162,39,.3); color: var(--gold); }
.tpl-btn-save:hover { background: rgba(201,162,39,.2); }

/* Employee picker row */
.employee-input-wrap { display: flex; gap: 8px; align-items: center; margin-bottom: 20px; }
.employee-input-wrap input[type="text"] { flex: 1; padding: 8px 10px; background: var(--bg-card-2); border: 1px solid var(--border); border-radius: var(--r); color: var(--text); font-size: .875rem; font-family: inherit; outline: none; }
.employee-input-wrap input[type="text"]:focus { border-color: var(--gold); }
.employee-pick-btn { padding: 8px 14px; background: transparent; border: 1px solid var(--border); border-radius: var(--r); color: var(--text-muted); font-size: .8rem; font-weight: 600; cursor: pointer; transition: all var(--t); white-space: nowrap; }
.employee-pick-btn:hover { border-color: var(--gold); color: var(--gold); }

/* Global modal shell */
.gld-modal-bd { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.78); z-index: 2000; overflow-y: auto; padding: 40px 16px; }
.gld-modal-bd.is-open { display: flex; align-items: flex-start; justify-content: center; }
.gld-modal { background: #13131a; border: 1px solid var(--border); border-top: 3px solid var(--gold); border-radius: 0 0 var(--r-lg) var(--r-lg); width: 100%; max-width: 560px; }
/* Employee modal is wider to fit 2-column field layout */
#gld-emp-modal .gld-modal { max-width: 780px; }
.gld-modal-hd { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.gld-modal-hd h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.gld-modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: var(--r); font-size: 1.2rem; line-height: 1; }
.gld-modal-close:hover { color: var(--text); }
.gld-modal-body { padding: 20px; }
.gld-modal-ft { padding: 14px 20px; border-top: 1px solid var(--border); }
.modal-search { width: 100%; padding: 9px 12px; background: var(--bg-card-2); border: 1px solid var(--border); border-radius: var(--r); color: var(--text); font-size: .875rem; font-family: inherit; margin-bottom: 12px; outline: none; box-sizing: border-box; }
.modal-search:focus { border-color: var(--gold); }

/* Employee list */
.emp-list { max-height: 220px; overflow-y: auto; }
.emp-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); border: 1px solid transparent; margin-bottom: 4px; }
.emp-item:hover { background: var(--bg-card-2); border-color: var(--border); }
.emp-name { font-size: .875rem; font-weight: 600; color: var(--text); }
.emp-egn { font-size: .78rem; color: var(--text-muted); }
.emp-actions { display: flex; gap: 4px; opacity: 0; transition: opacity var(--t); }
.emp-item:hover .emp-actions { opacity: 1; }
.emp-action-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; border-radius: 4px; font-size: .8rem; }
.emp-action-btn:hover { color: var(--text); }
.emp-action-btn.del:hover { color: #e74c3c; }
.emp-empty { text-align: center; padding: 24px; color: var(--text-muted); font-size: .85rem; }

/* Employee form (expanded with all fields) */
.emp-form { background: var(--bg-card-2); border: 1px solid var(--border); border-radius: var(--r); padding: 14px; margin-top: 12px; }
.emp-form-title { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }
.emp-form-row { margin-bottom: 8px; }
.emp-form-row label { display: block; font-size: .76rem; color: var(--text-muted); margin-bottom: 4px; }
.emp-form-inp { width: 100%; padding: 8px 10px; background: #0a0a0f; border: 1px solid var(--border); border-radius: var(--r); color: var(--text); font-size: .875rem; font-family: inherit; box-sizing: border-box; outline: none; }
.emp-form-inp:focus { border-color: var(--gold); }
textarea.emp-form-inp { resize: none; overflow: hidden; min-height: 52px; }
.emp-form-lbl { display: block; font-size: .76rem; color: var(--text-muted); margin-bottom: 4px; }
.emp-gender-name { display: grid; grid-template-columns: 80px 1fr; gap: 8px; margin-bottom: 8px; }
.emp-gender-select { width: 100%; padding: 8px 10px; background: #0a0a0f; border: 1px solid var(--border); border-radius: var(--r); color: var(--text); font-family: inherit; font-size: .875rem; outline: none; }
.emp-gender-select:focus { border-color: var(--gold); }
.emp-form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.emp-expand-btn { width: 100%; margin: 10px 0 0; padding: 7px; background: none; border: 1px dashed var(--border); border-radius: var(--r); color: var(--text-muted); font-size: .78rem; cursor: pointer; text-align: center; transition: border-color var(--t), color var(--t); }
.emp-expand-btn:hover { border-color: var(--gold); color: var(--gold); }
.emp-form-actions { display: flex; gap: 8px; margin-top: 12px; }
.emp-form-save { flex: 1; padding: 8px; background: var(--gold); color: #0a0a0f; border: none; border-radius: var(--r); font-size: .82rem; font-weight: 700; cursor: pointer; }
.emp-form-save:hover { background: var(--gold-light); }
.emp-form-cancel { padding: 8px 14px; background: none; border: 1px solid var(--border); border-radius: var(--r); color: var(--text-muted); font-size: .82rem; cursor: pointer; }
.emp-form-cancel:hover { border-color: var(--text-muted); color: var(--text); }

/* Template list modal */
.tpl-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.tpl-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--border); background: var(--bg-card-2); }
.tpl-item-name { flex: 1; font-size: .875rem; font-weight: 600; color: var(--text); }
.tpl-item-date { font-size: .72rem; color: var(--text-muted); white-space: nowrap; }
.tpl-load-btn { padding: 5px 12px; background: rgba(201,162,39,.12); border: 1px solid rgba(201,162,39,.3); border-radius: var(--r); color: var(--gold); font-size: .78rem; font-weight: 600; cursor: pointer; }
.tpl-load-btn:hover { background: rgba(201,162,39,.22); }
.tpl-del-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; font-size: .85rem; }
.tpl-del-btn:hover { color: #e74c3c; }
.tpl-empty { text-align: center; padding: 24px; color: var(--text-muted); font-size: .85rem; }
.save-tpl-input { width: 100%; padding: 10px 12px; background: var(--bg-card-2); border: 1px solid var(--border); border-radius: var(--r); color: var(--text); font-size: .875rem; font-family: inherit; margin-bottom: 14px; box-sizing: border-box; outline: none; }
.save-tpl-input:focus { border-color: var(--gold); }
.save-tpl-btn { width: 100%; padding: 10px; background: var(--gold); color: #0a0a0f; border: none; border-radius: var(--r); font-size: .875rem; font-weight: 700; cursor: pointer; }
.save-tpl-btn:hover { background: var(--gold-light); }

/* ══════════════════════════════════════════════════════════
   MODAL / FORM MOBILE RESPONSIVENESS
   .gld-modal + .emp-form-* are shared sitewide (employee modal,
   calendar event, client/obligation/message/document modals on the
   Работно бюро dashboard, etc.) - fixing them here fixes every modal
   on phones, not just the dashboard's.
══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .gld-modal-bd { padding: 0; align-items: flex-end !important; }
  .gld-modal, #gld-emp-modal .gld-modal {
    max-width: 100%; width: 100%;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    max-height: 92vh; display: flex; flex-direction: column;
  }
  .gld-modal-body { flex: 1; overflow-y: auto; padding: 16px; }
  .gld-modal-hd { padding: 14px 16px; }
  .gld-modal-ft { padding: 12px 16px; }
  /* Footers are inline-styled `display:flex;justify-content:flex-end` per
     modal (some also use a spacer div to push buttons right) - stacking
     the flex direction instead of forcing flex:1 on every child means an
     empty spacer div just collapses to ~0 height rather than eating a
     quarter of the row. */
  .gld-modal-ft { flex-direction: column !important; align-items: stretch !important; gap: 8px !important; }
  .gld-modal-ft .btn { width: 100%; box-sizing: border-box; text-align: center; justify-content: center; }

  .emp-form-cols { grid-template-columns: 1fr; }
  .emp-gender-name { grid-template-columns: 1fr; }
}

/* ── Anonymous preview gate ──────────────────────────────────────────────
   Sitewide, not dashboard-only: gates both Работно бюро (core/views.py) and
   individual calculator pages (tools/views.py::render_calculator) behind
   the same register/login card. The real page renders underneath, blurred
   and inert (see <main> in base.html), with this card + login modal
   floated on top - driven by is_gated/gate_title/gate_desc/gate_features/
   gate_next context vars, whichever view sets them. */
.gated-content {
  filter: blur(7px) saturate(85%);
  opacity: .6;
  user-select: none;
}

.dash-gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 64px 20px 40px;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(10,10,15,.12) 0%, rgba(10,10,15,.55) 42%, rgba(10,10,15,.74) 100%);
}

.dash-gate-card {
  width: 100%;
  max-width: 440px;
  background: #13131a;
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  padding: 32px 28px 28px;
  text-align: center;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,.6);
  animation: dashGateIn .45s cubic-bezier(.16,1,.3,1) both;
}

@keyframes dashGateIn {
  from { opacity: 0; transform: translateY(18px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .dash-gate-card { animation: none; }
}

.dash-gate-icon {
  width: 56px; height: 56px; margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(201,162,39,.12);
  color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}

.dash-gate-title { font-size: 1.15rem; font-weight: 700; margin: 0 0 8px; line-height: 1.35; }
.dash-gate-desc { color: var(--text-muted); font-size: .875rem; line-height: 1.55; margin: 0 0 18px; }

.dash-gate-features {
  list-style: none; margin: 0 0 22px; padding: 0;
  display: grid; gap: 9px; text-align: left;
}
.dash-gate-features li {
  display: flex; align-items: center; gap: 10px;
  font-size: .82rem; color: var(--text-muted);
  background: var(--bg-card-2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 9px 12px;
}
.dash-gate-features li i { color: var(--gold); width: 16px; text-align: center; flex-shrink: 0; }

.dash-gate-cta { width: 100%; display: flex; align-items: center; justify-content: center; }

.dash-gate-login-link {
  display: block; width: 100%; margin-top: 14px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: .84rem; font-family: inherit;
}
.dash-gate-login-link span { color: var(--gold); font-weight: 600; margin-left: 4px; }
.dash-gate-login-link:hover span { color: var(--gold-light); }

.sidebar-item__lock { margin-left: auto; font-size: .66rem; color: var(--text-muted); opacity: .55; }

@media (max-width: 720px) {
  .dash-gate { padding: 40px 14px 24px; align-items: flex-start; }
  .dash-gate-card { padding: 26px 20px 22px; }
}
