:root {
  --bg: #0d1421;
  --bg-2: #131c2e;
  --panel: #1a2540;
  --panel-2: #223052;
  --border: #2c3a5c;
  --red: #b91c1c;
  --red-2: #dc2626;
  --gold: #f0b429;
  --gold-2: #fbbf24;
  --text: #e8edf7;
  --muted: #8fa0be;
  --shadow: 0 8px 24px rgba(0,0,0,.35);
  --radius: 14px;

  --edge-size: 0.4cm;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --topbar-height: 58px;
  --tabbar-height: 62px;

  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- СВЕТЛАЯ ТЕМА — монохромная ---------- */
[data-theme="light"] {
  --bg: #e8ebf0;
  --bg-2: #dfe3ea;
  --panel: #f4f6f9;
  --panel-2: #ebeef4;
  --border: #c8cfd8;
  --text: #1f2937;
  --muted: #6b7280;
  --shadow: 0 6px 18px rgba(31,41,55,.08);
  --gold: #4b5563;
  --gold-2: #374151;
  --red: #4b5563;
  --red-2: #6b7280;
}
[data-theme="light"] body {
  background: #e8ebf0;
  color: var(--text);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 50% -200px, #1a2540 0%, var(--bg) 60%) fixed;
  color: var(--text);
  min-height: 100vh; min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
[data-theme="light"] body {
  background: #e8ebf0;
}
a { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: underline; }

body.has-edges {
  padding-top: calc(var(--edge-size) + var(--safe-top));
  padding-bottom: calc(var(--edge-size) + var(--safe-bottom));
  min-height: 100vh; min-height: 100dvh;
}

/* ---------- Полосы-градиенты ---------- */
.edge-top {
  position: fixed; top: 0; left: 0; right: 0;
  height: calc(var(--edge-size) + var(--safe-top));
  background: linear-gradient(180deg, #4f7dd1 0%, #2b4e91 50%, #15294d 100%);
  z-index: 5000; pointer-events: none;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.06);
}
.edge-bottom {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(var(--edge-size) + var(--safe-bottom));
  background: linear-gradient(0deg, #4f7dd1 0%, #2b4e91 50%, #15294d 100%);
  z-index: 5000; pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
[data-theme="light"] .edge-top {
  background: linear-gradient(180deg, #d1d5db 0%, #9ca3af 50%, #6b7280 100%);
}
[data-theme="light"] .edge-bottom {
  background: linear-gradient(0deg, #d1d5db 0%, #9ca3af 50%, #6b7280 100%);
}

/* ---------- Шапка ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px;
  height: var(--topbar-height);
  background: linear-gradient(180deg, #17203a 0%, #131c2e 100%);
  border-bottom: 2px solid var(--red);
  position: fixed;
  top: calc(var(--edge-size) + var(--safe-top));
  left: 0; right: 0;
  z-index: 1000;
}
[data-theme="light"] .topbar {
  background: #f4f6f9;
  border-bottom: 2px solid #6b7280;
  box-shadow: 0 2px 6px rgba(31,41,55,.06);
}
.topbar .brand {
  display: flex; align-items: center; gap: 10px;
  min-width: 0; flex: 1;
}
.topbar .brand .logo-wrap {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: #0a1421;
  border: 2px solid var(--gold);
  padding: 3px;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
}
[data-theme="light"] .topbar .brand .logo-wrap {
  background: #e8ebf0;
  border-color: #6b7280;
}
.topbar .brand .logo-wrap .logo-img {
  width: 100%; height: 100%;
  object-fit: contain; display: block;
}
.topbar .brand .logo-wrap .logo {
  width: 100%; height: 100%; border-radius: 8px;
  display: grid; place-items: center;
  background: radial-gradient(circle at 30% 30%, #f0b429, #b91c1c);
  color: #fff; font-weight: 900; font-size: 12px;
}
[data-theme="light"] .topbar .brand .logo-wrap .logo {
  background: linear-gradient(135deg, #9ca3af, #4b5563);
}
.topbar .brand .title {
  color: var(--gold-2);
  font-size: 14px; font-weight: 700; letter-spacing: .3px;
  min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
  line-height: 1.15;
}
[data-theme="light"] .topbar .brand .title { color: #374151; }
.topbar .brand .title small {
  display: block; color: var(--muted);
  font-weight: 400; font-size: 10.5px;
  letter-spacing: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar .icon-actions {
  display: flex; gap: 6px; align-items: center;
  flex: 0 0 auto;
}
.topbar .icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--panel); border: 1px solid var(--border);
  color: var(--text); cursor: pointer; font-size: 16px;
  padding: 0; font-family: inherit;
}
.topbar .icon-btn svg {
  width: 18px; height: 18px;
  stroke: currentColor; stroke-width: 1.7;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}
.topbar .icon-btn:hover { border-color: var(--gold); color: var(--gold-2); }
[data-theme="light"] .topbar .icon-btn {
  background: #e8ebf0;
  border-color: #c8cfd8;
  color: #4b5563;
}
[data-theme="light"] .topbar .icon-btn:hover {
  background: #dfe3ea;
  border-color: #6b7280;
  color: #1f2937;
}

.topbar .group-title { cursor: pointer; display: flex; flex-direction: column; min-width: 0; }
.topbar .group-title .gname {
  color: var(--gold-2); font-size: 15px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
[data-theme="light"] .topbar .group-title .gname { color: #374151; }
.topbar .group-title .gmembers { color: var(--muted); font-size: 10.5px; }

/* Индикатор сети */
.net-status {
  width: 10px; height: 10px; border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74,222,128,.65);
  flex: 0 0 auto;
  transition: background .2s, box-shadow .2s;
}
.net-status.offline { background: #f87171; box-shadow: 0 0 6px rgba(248,113,113,.65); }
.net-status.reconnecting { background: #fbbf24; box-shadow: 0 0 6px rgba(251,191,36,.65); animation: pulseDot 1.2s infinite; }
@keyframes pulseDot { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* Контент под шапкой */
body.has-edges > main {
  padding-top: calc(var(--topbar-height) + 10px);
  padding-bottom: calc(var(--tabbar-height) + var(--safe-bottom) + 14px);
}

/* ---------- Таб-бар ---------- */
.tabbar {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--edge-size) + var(--safe-bottom));
  height: var(--tabbar-height);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #0b1322;
  border-top: 1px solid var(--border);
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: content-box;
}
[data-theme="light"] .tabbar {
  background: #f4f6f9;
  border-top: 1px solid #c8cfd8;
  box-shadow: 0 -2px 6px rgba(31,41,55,.05);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  color: var(--muted);
  text-decoration: none;
  font-size: 10.5px; font-weight: 500;
  letter-spacing: .2px;
  transition: color .15s;
  position: relative;
}
[data-theme="light"] .tabbar a { color: #6b7280; }
.tabbar a svg {
  width: 22px; height: 22px;
  stroke: currentColor; stroke-width: 1.6;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}
.tabbar a.active { color: var(--gold-2); }
.tabbar a.active svg { stroke: var(--gold-2); }
[data-theme="light"] .tabbar a.active { color: #374151; }
[data-theme="light"] .tabbar a.active svg { stroke: #374151; }
.tabbar a:hover { color: var(--text); }
.tabbar a .badge-dot {
  position: absolute; top: 8px; right: calc(50% - 14px);
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red-2);
  box-shadow: 0 0 0 2px #0b1322;
}
[data-theme="light"] .tabbar a .badge-dot {
  background: #4b5563;
  box-shadow: 0 0 0 2px #f4f6f9;
}

/* ---------- Логин ---------- */
.login-wrap {
  min-height: calc(100vh - var(--topbar-height));
  display: grid; place-items: center; padding: 20px;
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 28px 24px;
}
.crest-wrap {
  width: 110px; height: 110px;
  margin: 0 auto 14px;
  border-radius: 24px;
  background: #0a1421;
  border: 3px solid var(--gold);
  padding: 8px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.crest-wrap .crest-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.crest-wrap .crest {
  width: 100%; height: 100%; border-radius: 16px;
  background: radial-gradient(circle at 30% 30%, #f0b429, #b91c1c);
  display: grid; place-items: center;
  color: #fff; font-weight: 900; font-size: 26px;
}
.login-card h1 { text-align: center; font-size: 18px; margin: 0 0 6px; color: var(--gold-2); letter-spacing: .5px; }
.login-card p.sub { text-align: center; color: var(--muted); font-size: 12px; margin: 0 0 22px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 11px 12px; border-radius: 8px;
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border); outline: none; font-size: 14px;
  font-family: inherit;
}
.field input:focus, .field select:focus { border-color: var(--gold); }
.btn {
  padding: 12px; border-radius: 8px; cursor: pointer;
  border: none; font-weight: 700; letter-spacing: .5px; font-size: 14px;
  font-family: inherit;
}
.btn-primary { background: linear-gradient(180deg, var(--red-2), var(--red)); color: #fff; }
[data-theme="light"] .btn-primary {
  background: #4b5563;
  color: #fff;
}
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-2); }
.btn-block { width: 100%; display: block; }
.error {
  margin-top: 12px; padding: 10px; border-radius: 8px;
  background: rgba(185,28,28,.15); border: 1px solid var(--red);
  color: #ffb4b4; font-size: 13px; display: none;
}

/* ---------- Плитки ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 22px 16px 60px; }
.section-title {
  color: var(--gold-2); font-size: 13px; letter-spacing: 1px;
  text-transform: uppercase; margin: 4px 0 14px;
  display: flex; align-items: center; gap: 10px;
}
[data-theme="light"] .section-title { color: #4b5563; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.tile {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 150px; padding: 18px;
  border-radius: var(--radius);
  background: linear-gradient(160deg,
    var(--tile-color, var(--panel-2)),
    #131c2e);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease;
  overflow: hidden;
}
[data-theme="light"] .tile {
  background: var(--panel) !important;
  color: #1f2937;
  border-color: #c8cfd8;
  box-shadow: 0 2px 8px rgba(31,41,55,.06);
}
[data-theme="light"] .tile:hover {
  border-color: #9ca3af;
  box-shadow: 0 4px 16px rgba(31,41,55,.10);
}
.tile:hover { transform: translateY(-3px); border-color: var(--gold); }
.tile .icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(240,180,41,.12); border: 1px solid rgba(240,180,41,.35);
  color: var(--gold-2); font-size: 22px;
}
[data-theme="light"] .tile .icon {
  background: #e8ebf0;
  border-color: #c8cfd8;
  color: #4b5563;
}
.tile .name { font-size: 16px; font-weight: 700; margin-top: 14px; color: var(--text); }
[data-theme="light"] .tile .name { color: #1f2937; }
.tile .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.tile .badge {
  position: absolute; top: 12px; right: 12px;
  min-width: 24px; height: 24px; padding: 0 7px;
  border-radius: 12px; display: grid; place-items: center;
  background: var(--red-2); color: #fff; font-size: 12px; font-weight: 700;
  box-shadow: 0 0 0 2px var(--panel);
  z-index: 2;
}
[data-theme="light"] .tile .badge {
  background: #4b5563;
  box-shadow: 0 0 0 2px #f4f6f9;
}
.tile .badge.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--panel), 0 0 0 0 rgba(220,38,38,.7); }
  50% { box-shadow: 0 0 0 2px var(--panel), 0 0 0 10px rgba(220,38,38,0); }
}
[data-theme="light"] .tile .badge.pulse { animation: none; }

/* Tile-news в тёмной теме — красный */
.tile.tile-news { background: linear-gradient(160deg, #3a1212, #1a0b0b) !important; border-color: #7a1d1d; }
.tile.tile-news .icon { background: rgba(240,180,41,.18); border-color: rgba(240,180,41,.5); }
/* В светлой — тоже серый */
[data-theme="light"] .tile.tile-news {
  background: var(--panel) !important;
  border-color: #c8cfd8;
}
[data-theme="light"] .tile.tile-news .icon {
  background: #e8ebf0;
  border-color: #c8cfd8;
  color: #4b5563;
}

/* ---------- Чат ---------- */
.chat-layout {
  position: fixed;
  top: calc(var(--edge-size) + var(--safe-top) + var(--topbar-height));
  left: 0; right: 0;
  bottom: calc(var(--edge-size) + var(--safe-bottom));
  max-width: 900px; margin: 0 auto;
  display: grid; grid-template-rows: 1fr auto auto;
  overflow: hidden;
}
.chat-messages {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px;
}
.msg {
  max-width: 78%; padding: 10px 12px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--border);
  align-self: flex-start;
  position: relative;
}
[data-theme="light"] .msg {
  background: #f4f6f9;
  border-color: #c8cfd8;
  color: #1f2937;
}
.msg.mine {
  background: linear-gradient(180deg, #2a1a3a, #1f1430);
  border-color: #4b2c73; align-self: flex-end;
}
[data-theme="light"] .msg.mine {
  background: #dfe3ea;
  border-color: #9ca3af;
  color: #1f2937;
}
.msg .meta {
  font-size: 11px; color: var(--muted); margin-bottom: 4px;
  display: flex; gap: 8px; align-items: baseline;
}
.msg .meta .author { color: var(--gold-2); font-weight: 700; cursor: pointer; }
[data-theme="light"] .msg .meta .author { color: #374151; }
.msg .meta .author:hover { text-decoration: underline; }
.msg .meta .author-org { color: var(--muted); font-size: 10.5px; margin-left: 4px; font-weight: 400; }
.msg .body { font-size: 14px; line-height: 1.35; white-space: pre-wrap; word-break: break-word; }
.msg .attach { margin-top: 8px; }
.msg .attach img, .msg .attach video { max-width: 100%; border-radius: 8px; display: block; }
.msg .attach audio { width: 100%; }
.msg .attach a.file-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px;
  background: rgba(240,180,41,.1); border: 1px solid rgba(240,180,41,.35);
  color: var(--gold-2); font-size: 13px; word-break: break-all;
}
[data-theme="light"] .msg .attach a.file-link {
  background: #e8ebf0;
  border-color: #c8cfd8;
  color: #4b5563;
}
.chat-input {
  position: relative;
  display: flex; gap: 8px; align-items: flex-end;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}
[data-theme="light"] .chat-input { background: #f4f6f9; border-top-color: #c8cfd8; }
.chat-input textarea {
  flex: 1; resize: none; min-height: 44px; max-height: 120px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border); outline: none;
  font-family: inherit; font-size: 14px; line-height: 1.3;
}
[data-theme="light"] .chat-input textarea {
  background: #e8ebf0; color: #1f2937; border-color: #c8cfd8;
}
.chat-input textarea:focus { border-color: var(--gold); }
.chat-input .icon-btn {
  width: 44px; height: 44px; border-radius: 10px; cursor: pointer;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  display: grid; place-items: center; font-size: 18px; flex: 0 0 auto;
}
[data-theme="light"] .chat-input .icon-btn {
  background: #e8ebf0; color: #4b5563; border-color: #c8cfd8;
}
.chat-input .send-btn {
  width: 44px; height: 44px; border-radius: 10px; cursor: pointer;
  background: linear-gradient(180deg, var(--red-2), var(--red));
  color: #fff; border: none; display: grid; place-items: center; font-size: 18px;
  flex: 0 0 auto;
}
[data-theme="light"] .chat-input .send-btn { background: #4b5563; }
#uploadBar {
  position: absolute; top: -4px; left: 10px; right: 10px;
  height: 3px; background: var(--bg-2); border-radius: 2px; overflow: hidden;
  display: none;
}
#uploadBarFill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--gold), var(--red-2));
  transition: width .15s;
}
[data-theme="light"] #uploadBarFill { background: #4b5563; }
.file-chip {
  position: absolute; top: -34px; left: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 8px;
  background: rgba(240,180,41,.15); border: 1px solid rgba(240,180,41,.5);
  color: var(--gold-2); font-size: 12px;
  max-width: calc(100% - 20px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
[data-theme="light"] .file-chip {
  background: #e8ebf0; border-color: #c8cfd8; color: #4b5563;
}
.file-chip .x { cursor: pointer; font-weight: 700; padding-left: 4px; }
.day-divider {
  align-self: center; margin: 8px 0;
  padding: 3px 12px;
  background: rgba(143,160,190,.14);
  border: 1px solid rgba(143,160,190,.22);
  color: var(--muted); font-size: 11px; border-radius: 10px;
  letter-spacing: .3px;
}
[data-theme="light"] .day-divider {
  background: #dfe3ea; border-color: #c8cfd8; color: #6b7280;
}

/* ---------- Reply / actions ---------- */
.reply-quote {
  display: flex; gap: 6px;
  margin: -2px -4px 8px;
  padding: 6px 10px;
  background: rgba(240,180,41,.08);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  font-size: 12px; color: var(--muted);
  cursor: pointer;
}
[data-theme="light"] .reply-quote {
  background: #e8ebf0;
  border-left-color: #6b7280;
}
.reply-quote .r-author { color: var(--gold-2); font-weight: 700; }
[data-theme="light"] .reply-quote .r-author { color: #374151; }
.reply-quote .r-text { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.msg.highlight { animation: msgHighlight 1.6s ease; }
@keyframes msgHighlight {
  0% { background: rgba(240,180,41,.35); }
  100% { background: var(--panel); }
}
.msg.mine.highlight { animation: msgHighlightMine 1.6s ease; }
@keyframes msgHighlightMine {
  0% { background: rgba(240,180,41,.35); }
  100% { background: linear-gradient(180deg, #2a1a3a, #1f1430); }
}

.msg.deleted .body, .msg.deleted .attach { display: none; }
.msg.deleted .meta { opacity: .5; }
.msg.deleted .deleted-note { font-style: italic; color: var(--muted); font-size: 13px; }

.msg-actions-bar {
  display: none;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed rgba(143,160,190,.25);
  gap: 6px; flex-wrap: wrap;
}
.msg.show-actions .msg-actions-bar { display: flex; }
.msg-actions-bar button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 8px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: var(--text); font-size: 12px; font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
[data-theme="light"] .msg-actions-bar button { background: #e8ebf0; color: #4b5563; }
.msg-actions-bar button svg {
  width: 14px; height: 14px;
  stroke: currentColor; stroke-width: 1.8;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}
.msg-actions-bar button:hover { border-color: var(--gold); color: var(--gold-2); background: rgba(240,180,41,.08); }
.msg-actions-bar button.danger:hover { border-color: var(--red-2); color: #ff9f9f; background: rgba(220,38,38,.10); }

/* Реакции */
.reactions-bar { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.reaction-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 12px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: var(--text); font-size: 13px; line-height: 1;
  cursor: pointer; user-select: none;
  transition: background .12s, border-color .12s;
}
[data-theme="light"] .reaction-chip { background: #e8ebf0; color: #4b5563; border-color: #c8cfd8; }
.reaction-chip:hover { background: rgba(240,180,41,.10); border-color: var(--gold); }
.reaction-chip .count { font-size: 11.5px; color: var(--muted); }
.reaction-chip.me { background: rgba(240,180,41,.15); border-color: rgba(240,180,41,.55); }
.reaction-chip.me .count { color: var(--gold-2); }
[data-theme="light"] .reaction-chip.me { background: #dfe3ea; border-color: #9ca3af; }
.reaction-add {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 24px; border-radius: 12px;
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); cursor: pointer; font-size: 13px; line-height: 1;
  padding: 0;
  transition: border-color .12s, color .12s;
}
.reaction-add:hover { border-color: var(--gold); color: var(--gold-2); }
[data-theme="light"] .reaction-add:hover { border-color: #6b7280; color: #1f2937; }

/* Пикер эмодзи */
.emoji-picker {
  position: fixed; z-index: 3001;
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  padding: 10px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,.55);
  width: 300px; max-width: calc(100vw - 24px);
}
[data-theme="light"] .emoji-picker {
  background: #f4f6f9; border-color: #c8cfd8;
  box-shadow: 0 12px 32px rgba(31,41,55,.15);
}
.emoji-picker button {
  width: 36px; height: 36px; border-radius: 9px;
  background: transparent; border: none;
  cursor: pointer; font-size: 22px; line-height: 1;
  padding: 0; display: flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.emoji-picker button:hover { background: rgba(240,180,41,.15); }
[data-theme="light"] .emoji-picker button:hover { background: #dfe3ea; }

/* Typing indicator */
.typing-indicator {
  padding: 2px 16px 8px;
  color: var(--muted); font-size: 12px;
  min-height: 18px; font-style: italic;
}
.typing-indicator .dots::after {
  content: '...'; display: inline-block; width: 0; overflow: hidden;
  animation: typingDots 1.4s steps(4,end) infinite;
}
@keyframes typingDots { to { width: 1.4em; } }

/* ---------- Файлы ---------- */
.docs-wrap { max-width: 1000px; margin: 0 auto; padding: 20px 16px 60px; }
.crumbs { display: flex; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--gold-2); }
[data-theme="light"] .crumbs a { color: #4b5563; }
.docs-actions { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.docs-actions .btn { width: auto; padding: 8px 14px; font-size: 13px; display: inline-block; }
.docs-list { display: grid; gap: 8px; }
.docs-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--border);
  cursor: pointer;
}
[data-theme="light"] .docs-item { background: #f4f6f9; border-color: #c8cfd8; }
.docs-item:hover { border-color: var(--gold); }
[data-theme="light"] .docs-item:hover { border-color: #6b7280; }
.docs-item .ic {
  width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center;
  background: rgba(240,180,41,.12); border: 1px solid rgba(240,180,41,.35);
  color: var(--gold-2); font-size: 18px; flex: 0 0 auto;
}
[data-theme="light"] .docs-item .ic {
  background: #e8ebf0; border-color: #c8cfd8; color: #4b5563;
}
.docs-item .ic.folder { background: rgba(59,130,246,.14); border-color: rgba(59,130,246,.4); color: #93c5fd; }
[data-theme="light"] .docs-item .ic.folder { background: #e8ebf0; border-color: #c8cfd8; color: #4b5563; }
.docs-item .info { flex: 1; min-width: 0; }
.docs-item .info .name { font-size: 14px; font-weight: 600; color: var(--text); word-break: break-word; }
[data-theme="light"] .docs-item .info .name { color: #1f2937; }
.docs-item .info .meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.docs-item .dl {
  background: transparent; border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 12px;
  flex: 0 0 auto;
}
[data-theme="light"] .docs-item .dl { color: #4b5563; }
.docs-item .btn-danger {
  background: transparent; border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 12px;
}
[data-theme="light"] .docs-item .btn-danger { color: #4b5563; }
.docs-item .btn-danger:hover { border-color: var(--red-2); color: #ff9f9f; }
.empty { color: var(--muted); text-align: center; padding: 30px; font-size: 14px; }

/* ---------- Участники ---------- */
.members-wrap { max-width: 720px; margin: 0 auto; padding: 20px 16px 60px; }
.member-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--border);
  margin-bottom: 8px; cursor: pointer;
  transition: border-color .15s;
}
[data-theme="light"] .member-item { background: #f4f6f9; border-color: #c8cfd8; }
.member-item:hover { border-color: var(--gold); }
.member-item .avatar {
  position: relative;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 30% 30%, #f0b429, #b91c1c);
  color: #fff; font-weight: 900; font-size: 16px;
  flex: 0 0 auto;
}
[data-theme="light"] .member-item .avatar {
  background: linear-gradient(135deg, #9ca3af, #4b5563);
}
.member-item .avatar .online-dot {
  position: absolute; bottom: 0; right: 0;
  width: 12px; height: 12px; border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 2px var(--panel);
}
[data-theme="light"] .member-item .avatar .online-dot { box-shadow: 0 0 0 2px #f4f6f9; }
.member-item .info { flex: 1; min-width: 0; }
.member-item .info .name { font-size: 14px; font-weight: 600; color: var(--text); }
[data-theme="light"] .member-item .info .name { color: #1f2937; }
.member-item .info .org { font-size: 12px; color: var(--gold-2); margin-top: 2px; }
[data-theme="light"] .member-item .info .org { color: #4b5563; }
.member-item .info .meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.member-item .role {
  font-size: 11px; padding: 3px 8px; border-radius: 6px;
  background: rgba(240,180,41,.15); color: var(--gold-2);
  border: 1px solid rgba(240,180,41,.35); flex: 0 0 auto;
}
[data-theme="light"] .member-item .role {
  background: #e8ebf0; border-color: #c8cfd8; color: #4b5563;
}
.seen-online { color: #4ade80; }
.seen-day { color: #fbbf24; }
.seen-old { color: var(--muted); }
[data-theme="light"] .seen-online { color: #4b5563; }
[data-theme="light"] .seen-day { color: #6b7280; }

/* ---------- Модалки профиля ---------- */
.profile-backdrop {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.7);
  display: none; place-items: center; padding: 16px;
}
.profile-backdrop.open { display: grid; }
.profile-card {
  width: 100%; max-width: 420px;
  max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px);
  overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px 20px;
}
[data-theme="light"] .profile-card { background: #f4f6f9; border-color: #c8cfd8; }
.profile-card .avatar-big {
  width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 30% 30%, #f0b429, #b91c1c);
  color: #fff; font-weight: 900; font-size: 28px;
  margin: 0 auto 12px;
}
[data-theme="light"] .profile-card .avatar-big {
  background: linear-gradient(135deg, #9ca3af, #4b5563);
}
.profile-card h2 { text-align: center; margin: 0 0 4px; font-size: 18px; color: var(--text); }
[data-theme="light"] .profile-card h2 { color: #1f2937; }
.profile-card .role-line { text-align: center; color: var(--gold-2); font-size: 13px; margin-bottom: 18px; }
[data-theme="light"] .profile-card .role-line { color: #4b5563; }
.profile-card .role-line .badge {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  background: rgba(240,180,41,.15);
  border: 1px solid rgba(240,180,41,.35);
  font-size: 11px; margin-left: 6px;
}
[data-theme="light"] .profile-card .role-line .badge {
  background: #e8ebf0; border-color: #c8cfd8; color: #4b5563;
}
.profile-row {
  display: flex; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 14px; gap: 12px;
}
.profile-row:last-child { border-bottom: none; }
.profile-row .lbl { color: var(--muted); flex: 0 0 auto; }
.profile-row .val { color: var(--text); text-align: right; word-break: break-word; flex: 1; }
[data-theme="light"] .profile-row .val { color: #1f2937; }
.profile-row .val a { color: var(--gold-2); text-decoration: none; }
[data-theme="light"] .profile-row .val a { color: #4b5563; }
.profile-actions { display: flex; justify-content: center; margin-top: 16px; }
.profile-actions .btn { width: auto; padding: 10px 20px; }

/* ---------- Мобильная адаптация ---------- */
@media (max-width: 520px) {
  :root { --topbar-height: 54px; --tabbar-height: 60px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .tile { min-height: 130px; padding: 14px; }
  .tile .name { font-size: 14px; }
  .topbar { padding: 6px 10px; gap: 8px; }
  .topbar .brand .title { font-size: 13px; }
  .topbar .brand .title small { font-size: 10px; }
  .msg { max-width: 88%; }
  .container { padding: 16px 12px 40px; }
  .topbar .brand .logo-wrap { width: 36px; height: 36px; padding: 3px; }
  .crest-wrap { width: 96px; height: 96px; padding: 7px; }
}

/* ---------- Разделитель дня в чате ---------- */
.day-divider {
  align-self: center; margin: 8px 0;
  padding: 3px 12px;
  background: rgba(143,160,190,.14);
  border: 1px solid rgba(143,160,190,.22);
  color: var(--muted); font-size: 11px; border-radius: 10px;
  letter-spacing: .3px;
}
[data-theme="light"] .day-divider {
  background: #dfe3ea; border-color: #c8cfd8; color: #6b7280;
}

/* ---------- Индикатор новых в документах ---------- */
.docs-item.has-new {
  border-color: rgba(220,38,38,.55);
  box-shadow: 0 0 0 1px rgba(220,38,38,.25) inset;
}
[data-theme="light"] .docs-item.has-new {
  border-color: #6b7280;
  box-shadow: 0 0 0 1px rgba(75,85,99,.20) inset;
}
.docs-item .ic.folder { position: relative; }
.docs-item .ic .new-dot {
  position: absolute; top: -3px; right: -3px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--red-2);
  box-shadow: 0 0 0 2px var(--panel);
}
[data-theme="light"] .docs-item .ic .new-dot { background: #4b5563; box-shadow: 0 0 0 2px #f4f6f9; }

/* ---------- Триггер поиска ---------- */
.search-trigger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--border);
  color: var(--text); cursor: pointer; padding: 0;
  flex: 0 0 auto;
}
.search-trigger:hover { border-color: var(--gold); color: var(--gold-2); }
.search-trigger svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="light"] .search-trigger {
  background: #e8ebf0; border-color: #c8cfd8; color: #4b5563;
}
[data-theme="light"] .search-trigger:hover { border-color: #6b7280; color: #1f2937; }

/* ---------- Поиск: модалка ---------- */
.search-backdrop {
  position: fixed; inset: 0; z-index: 2500;
  background: rgba(0,0,0,.75);
  display: none; place-items: flex-start center;
  padding: 20px 16px; overflow-y: auto;
}
.search-backdrop.open { display: grid; }
.search-modal {
  width: 100%; max-width: 720px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
  display: flex; flex-direction: column;
  max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px);
  overflow: hidden;
}
[data-theme="light"] .search-modal { background: #f4f6f9; border-color: #c8cfd8; }
.search-head {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  display: flex; gap: 10px; align-items: center;
}
.search-head input {
  flex: 1; padding: 11px 14px;
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 15px; font-family: inherit; outline: none;
}
[data-theme="light"] .search-head input { background: #e8ebf0; color: #1f2937; border-color: #c8cfd8; }
.search-head input:focus { border-color: var(--gold); }
.search-head .close-btn {
  width: 40px; height: 40px; border-radius: 10px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text); cursor: pointer; font-size: 18px; flex: 0 0 auto;
}
[data-theme="light"] .search-head .close-btn { color: #4b5563; }
.search-head .close-btn:hover { border-color: var(--red-2); color: #ff9f9f; }
.search-filters {
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  background: var(--panel-2);
}
[data-theme="light"] .search-filters { background: #ebeef4; border-bottom-color: #c8cfd8; }
.search-filters select, .search-filters input[type="date"] {
  padding: 6px 10px; font-size: 13px;
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  font-family: inherit;
}
[data-theme="light"] .search-filters select, [data-theme="light"] .search-filters input[type="date"] {
  background: #e8ebf0; color: #1f2937; border-color: #c8cfd8;
}
.search-filters label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted); cursor: pointer; user-select: none;
}
.search-filters input[type="checkbox"] { accent-color: var(--red-2); }
[data-theme="light"] .search-filters input[type="checkbox"] { accent-color: #4b5563; }
.search-filters .chip-clear {
  margin-left: auto; padding: 6px 12px; font-size: 12px;
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
}
.search-filters .chip-clear:hover { border-color: var(--gold); color: var(--gold-2); }
[data-theme="light"] .search-filters .chip-clear:hover { border-color: #6b7280; color: #1f2937; }
.search-results { overflow-y: auto; padding: 12px 16px 20px; flex: 1; min-height: 0; }
.search-result {
  padding: 12px 14px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--border);
  margin-bottom: 10px; cursor: pointer;
  transition: border-color .15s;
}
[data-theme="light"] .search-result { background: #ebeef4; border-color: #c8cfd8; }
.search-result:hover { border-color: var(--gold); }
.search-result .sr-head {
  display: flex; gap: 8px; align-items: center;
  font-size: 12px; color: var(--muted); margin-bottom: 6px;
}
.search-result .sr-group {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px; border-radius: 6px;
  background: rgba(240,180,41,.10);
  border: 1px solid rgba(240,180,41,.35);
  color: var(--gold-2); font-size: 11px;
}
[data-theme="light"] .search-result .sr-group {
  background: #e8ebf0; border-color: #c8cfd8; color: #4b5563;
}
.search-result .sr-author { color: var(--gold-2); font-weight: 600; }
[data-theme="light"] .search-result .sr-author { color: #4b5563; }
.search-result .sr-date { margin-left: auto; }
.search-result .sr-text {
  font-size: 14px; line-height: 1.4; color: var(--text); word-break: break-word;
}
[data-theme="light"] .search-result .sr-text { color: #1f2937; }
.search-result .sr-text mark {
  background: rgba(240,180,41,.35);
  color: #fff;
  padding: 1px 3px; border-radius: 3px;
}
[data-theme="light"] .search-result .sr-text mark {
  background: #c8cfd8;
  color: #1f2937;
}
.search-empty { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 14px; }
.search-totals {
  padding: 8px 16px; border-bottom: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--muted); font-size: 12px;
}
[data-theme="light"] .search-totals { background: #ebeef4; border-bottom-color: #c8cfd8; }

/* ---------- Тосты и модалки ---------- */
.cmp-toast-stack {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  z-index: 4000; display: flex; flex-direction: column; gap: 8px;
  align-items: center; pointer-events: none;
  width: calc(100vw - 24px); max-width: 420px;
}
.cmp-toast {
  pointer-events: auto;
  display: flex; gap: 10px; align-items: center;
  padding: 12px 16px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--border);
  color: var(--text); font-size: 14px; font-family: inherit;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  width: 100%;
  transform: translateY(20px); opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
  overflow: hidden; position: relative;
}
[data-theme="light"] .cmp-toast {
  background: #f4f6f9; color: #1f2937; border-color: #c8cfd8;
  box-shadow: 0 8px 24px rgba(31,41,55,.15);
}
.cmp-toast.show { transform: translateY(0); opacity: 1; }
.cmp-toast-icon {
  width: 22px; height: 22px; flex: 0 0 auto;
  display: grid; place-items: center; border-radius: 50%;
  font-size: 13px; font-weight: 700; color: #fff;
}
.cmp-toast-icon.success { background: #16a34a; }
.cmp-toast-icon.error   { background: #dc2626; }
.cmp-toast-icon.warn    { background: #f59e0b; }
.cmp-toast-icon.info    { background: #2563eb; }
[data-theme="light"] .cmp-toast-icon.success { background: #4b5563; }
[data-theme="light"] .cmp-toast-icon.error   { background: #6b7280; }
[data-theme="light"] .cmp-toast-icon.warn    { background: #9ca3af; }
[data-theme="light"] .cmp-toast-icon.info    { background: #4b5563; }
.cmp-toast-body { flex: 1; word-break: break-word; line-height: 1.35; }
.cmp-toast-close {
  background: transparent; border: none;
  color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1;
  padding: 4px; flex: 0 0 auto;
}
.cmp-toast-close:hover { color: var(--text); }
.cmp-toast-progress {
  position: absolute; bottom: 0; left: 0; height: 2px;
  background: currentColor; opacity: .35;
  animation: cmp-toast-progress linear forwards;
}
@keyframes cmp-toast-progress { from { width: 100%; } to { width: 0%; } }

.cmp-modal-backdrop {
  position: fixed; inset: 0; z-index: 5000;
  background: rgba(0,0,0,.65);
  display: none; place-items: center; padding: 20px;
}
.cmp-modal-backdrop.open { display: grid; }
.cmp-modal {
  width: 100%; max-width: 420px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px 20px 18px;
  color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.6);
  font-family: inherit; animation: cmp-modal-in .2s cubic-bezier(.2,.9,.3,1.1);
}
[data-theme="light"] .cmp-modal {
  background: #f4f6f9; border-color: #c8cfd8; color: #1f2937;
  box-shadow: 0 20px 60px rgba(31,41,55,.20);
}
@keyframes cmp-modal-in { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.cmp-modal h3 { margin: 0 0 10px; font-size: 17px; color: var(--gold-2); letter-spacing: .3px; }
[data-theme="light"] .cmp-modal h3 { color: #374151; }
.cmp-modal .cmp-modal-text { color: var(--text); font-size: 14px; line-height: 1.5; margin-bottom: 18px; white-space: pre-wrap; word-break: break-word; }
[data-theme="light"] .cmp-modal .cmp-modal-text { color: #1f2937; }
.cmp-modal .cmp-modal-input {
  width: 100%; padding: 10px 12px;
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; outline: none;
  margin-bottom: 18px;
}
[data-theme="light"] .cmp-modal .cmp-modal-input { background: #e8ebf0; color: #1f2937; border-color: #c8cfd8; }
.cmp-modal .cmp-modal-input:focus { border-color: var(--gold); }
.cmp-modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.cmp-modal-actions .cmp-btn {
  padding: 10px 18px; border-radius: 8px; cursor: pointer;
  font-weight: 600; font-size: 14px; font-family: inherit;
  border: none; transition: filter .15s;
}
.cmp-modal-actions .cmp-btn-primary { background: linear-gradient(180deg, var(--red-2), var(--red)); color: #fff; }
[data-theme="light"] .cmp-modal-actions .cmp-btn-primary { background: #4b5563; color: #fff; }
.cmp-modal-actions .cmp-btn-primary:hover { filter: brightness(1.1); }
.cmp-modal-actions .cmp-btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
[data-theme="light"] .cmp-modal-actions .cmp-btn-ghost { color: #1f2937; border-color: #c8cfd8; }
.cmp-modal-actions .cmp-btn-ghost:hover { border-color: var(--gold); color: var(--gold-2); }
.cmp-modal-actions .cmp-btn-danger { background: linear-gradient(180deg, var(--red-2), var(--red)); color: #fff; }
[data-theme="light"] .cmp-modal-actions .cmp-btn-danger { background: #4b5563; color: #fff; }

/* ---------- Скелетоны ---------- */
.cmp-skel {
  background: linear-gradient(90deg, var(--panel-2) 0%, var(--panel) 40%, var(--panel-2) 80%);
  background-size: 200% 100%;
  animation: cmp-skel-shimmer 1.4s ease-in-out infinite;
  border-radius: 8px;
}
[data-theme="light"] .cmp-skel {
  background: linear-gradient(90deg, #dfe3ea 0%, #ebeef4 40%, #dfe3ea 80%);
  background-size: 200% 100%;
}
@keyframes cmp-skel-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.cmp-skel-tile { height: 150px; border-radius: 14px; position: relative; overflow: hidden; }
.cmp-skel-line { height: 12px; border-radius: 6px; }
.cmp-skel-line.short { width: 40%; }
.cmp-skel-line.medium { width: 70%; }
.cmp-skel-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--border);
  margin-bottom: 8px;
}
[data-theme="light"] .cmp-skel-row { background: #f4f6f9; border-color: #c8cfd8; }
.cmp-skel-circle { width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto; }
.cmp-skel-msg {
  align-self: flex-start; width: 60%;
  padding: 12px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--border);
}
[data-theme="light"] .cmp-skel-msg { background: #f4f6f9; border-color: #c8cfd8; }
.cmp-skel-msg.right { align-self: flex-end; width: 45%; }

/* ---------- Бейдж непрочитанного в заголовке секции ---------- */
.section-title .section-badge {
  display: none;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  background: var(--red-2);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  letter-spacing: 0;
  text-transform: none;
  margin-left: 6px;
}
[data-theme="light"] .section-title .section-badge {
  background: #4b5563;
}
.section-title .section-badge.show { display: inline-block; }
.section-title .section-badge.pulse {
  animation: sectionBadgePulse 1.6s infinite;
}
@keyframes sectionBadgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.55); }
  50% { box-shadow: 0 0 0 6px rgba(220,38,38,0); }
}
[data-theme="light"] .section-title .section-badge.pulse {
  animation: none;
}
