/* ===== CSS Variables & Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
:root {
    --bg: #0a0b10;
    --bg-glass: rgba(255, 255, 255, 0.03);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #eceff1;
    --text-secondary: #88929e;
    --text-muted: #4b525a;
    --accent: #ff7a00;
    --accent-glow: rgba(255, 122, 0, 0.6);
    --red: #e74c3c;
    --green: #2ecc71;
    --yellow: #f1c40f;
    --blue: #3498db;
    --radius: 14px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}
html {
    scroll-behavior: smooth;
}
body {
    background: var(--bg);
    min-height: 100dvh;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    padding-bottom: calc(62px + env(safe-area-inset-bottom, 0));
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255, 122, 0, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(255, 122, 0, 0.04) 0%, transparent 50%);
}
/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 10px; }

/* ===== Typography ===== */
a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover { color: #fff; }
.orange { color: var(--accent); }
.p { color: var(--text-secondary); font-size: 14px; }
.h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Glass Card ===== */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ===== Header ===== */
.hdr {
    position: sticky;
    top: 0;
    z-index: 300;
    height: 60px;
    background: rgba(10, 11, 16, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glass);
}
.hdr-in {
    max-width: 780px;
    margin: 0 auto;
    height: 100%;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-weight: 700;
}
.logo i {
    font-size: 22px;
    color: var(--accent);
    filter: drop-shadow(0 0 6px var(--accent-glow));
}
.logo-t { font-size: 15px; }
.logo-s {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.usr {
    display: flex;
    align-items: center;
    gap: 10px;
}
.usr .ava {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-glass);
    border: 2px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
}
.usr .ava.hdot-r1 { border-color: var(--blue); }
.usr .ava.hdot-r2 { border-color: var(--yellow); }
.usr .ava.hdot-r3 { border-color: #3ddc84; box-shadow: 0 0 8px rgba(46,204,113,0.35); }
.usr .ava.hdot-r4 { border-color: #ff79c0; box-shadow: 0 0 8px rgba(255,105,180,0.35); }
.usr .ava.hdot-r5 { border-color: #ff4d4d; box-shadow: 0 0 8px rgba(220,40,40,0.35); }
.usr .ava.hdot-r6 { border-color: #ff6b5a; box-shadow: 0 0 10px rgba(231,76,60,0.4); }
.usr .ava.hdot-r7 {
  border-color: #b30000;
  box-shadow: 0 0 0 1px rgba(180,0,0,0.5), 0 0 14px rgba(160,0,0,0.65), 0 0 28px rgba(120,0,0,0.35);
  animation: devAvaGlow 2.4s ease-in-out infinite;
}
.usr .usr-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    font-size: 12px;
}
.usr .un { font-weight: 700; font-size: 13px; }
.usr .ur {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-block;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
  position: relative;
  border-radius: 0 !important;
}
.usr .ur[class*="ur-r"] {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}
.usr .ur.ur-r0 {
  color: #9aa3b2;
  animation: rolePulse0 2.4s ease-in-out infinite;
  text-shadow: 0 0 8px rgba(160,170,190,0.25);
}
.usr .ur.ur-r1 {
  color: #4da3ff !important;
  animation: rolePulse1 1.8s ease-in-out infinite;
  text-shadow: 0 0 8px rgba(52,152,219,0.55), 0 0 18px rgba(52,152,219,0.3);
}
.usr .ur.ur-r2 {
  color: #ffd84d !important;
  animation: rolePulse2 1.8s ease-in-out infinite;
  text-shadow: 0 0 8px rgba(241,196,15,0.55), 0 0 18px rgba(241,196,15,0.3);
}
.usr .ur.ur-r3 {
  color: #3dff8a !important;
  animation: rolePulse3 1.8s ease-in-out infinite;
  text-shadow: 0 0 8px rgba(46,204,113,0.55), 0 0 18px rgba(46,204,113,0.3);
}
.usr .ur.ur-r4 {
  color: #ff79c0 !important;
  animation: rolePulse4 1.8s ease-in-out infinite;
  text-shadow: 0 0 10px rgba(255,105,180,0.6), 0 0 20px rgba(255,105,180,0.35);
}
.usr .ur.ur-r5 {
  color: #ff3b3b !important;
  animation: rolePulse5 1.6s ease-in-out infinite;
  text-shadow: 0 0 10px rgba(255,40,40,0.7), 0 0 22px rgba(200,0,0,0.4);
}
.usr .ur.ur-r6 {
  color: #ff6b5a !important;
  font-weight: 800;
  animation: rolePulse6 1.6s ease-in-out infinite;
  text-shadow: 0 0 10px rgba(231,76,60,0.75), 0 0 24px rgba(231,76,60,0.4);
}
.usr .ur.ur-r7 {
  color: #ff1010 !important;
  font-weight: 900 !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: none !important;
  background: none !important;
  padding: 0 !important;
  animation: rolePulse7 1.25s ease-in-out infinite;
  text-shadow:
    0 0 6px rgba(255,0,0,1),
    0 0 14px rgba(255,0,0,0.85),
    0 0 28px rgba(180,0,0,0.65),
    0 0 42px rgba(100,0,0,0.4);
}
.usr .ur.ur-r7::before,
.usr .ur.ur-r7::after { display: none !important; content: none !important; }

@keyframes rolePulse0 {
  0%,100% { opacity: 0.85; filter: brightness(1); }
  50% { opacity: 1; filter: brightness(1.15); }
}
@keyframes rolePulse1 {
  0%,100% { text-shadow: 0 0 6px rgba(52,152,219,0.4); transform: scale(1); }
  50% { text-shadow: 0 0 14px rgba(52,152,219,0.85), 0 0 28px rgba(52,152,219,0.4); transform: scale(1.05); }
}
@keyframes rolePulse2 {
  0%,100% { text-shadow: 0 0 6px rgba(241,196,15,0.4); transform: scale(1); }
  50% { text-shadow: 0 0 14px rgba(241,196,15,0.9), 0 0 28px rgba(241,196,15,0.4); transform: scale(1.05); }
}
@keyframes rolePulse3 {
  0%,100% { text-shadow: 0 0 6px rgba(46,204,113,0.4); transform: scale(1); }
  50% { text-shadow: 0 0 14px rgba(46,204,113,0.9), 0 0 28px rgba(46,204,113,0.4); transform: scale(1.05); }
}
@keyframes rolePulse4 {
  0%,100% { text-shadow: 0 0 6px rgba(255,105,180,0.45); transform: scale(1); }
  50% { text-shadow: 0 0 16px rgba(255,105,180,0.95), 0 0 30px rgba(255,105,180,0.45); transform: scale(1.06); }
}
@keyframes rolePulse5 {
  0%,100% { text-shadow: 0 0 6px rgba(255,40,40,0.5); transform: scale(1); }
  50% { text-shadow: 0 0 16px rgba(255,30,30,0.95), 0 0 32px rgba(180,0,0,0.5); transform: scale(1.07); }
}
@keyframes rolePulse6 {
  0%,100% { text-shadow: 0 0 8px rgba(231,76,60,0.55); transform: scale(1); }
  50% { text-shadow: 0 0 18px rgba(231,76,60,1), 0 0 36px rgba(231,76,60,0.5); transform: scale(1.07); }
}
@keyframes rolePulse7 {
  0%,100% {
    text-shadow: 0 0 6px rgba(255,0,0,0.9), 0 0 16px rgba(200,0,0,0.55);
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    text-shadow:
      0 0 10px rgba(255,0,0,1),
      0 0 24px rgba(255,0,0,0.95),
      0 0 40px rgba(180,0,0,0.7),
      0 0 56px rgba(100,0,0,0.4);
    transform: scale(1.1);
    filter: brightness(1.25);
  }
}

.usr a {
    color: var(--text-muted);
    font-size: 16px;
    transition: 0.2s;
}
.usr a:hover { color: var(--text-primary); }
.btn-login {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    background: rgba(255, 122, 0, 0.08);
    border: 1px solid rgba(255, 122, 0, 0.3);
    border-radius: 8px;
    padding: 6px 14px;
    transition: 0.2s;
}
.btn-login:hover {
    background: rgba(255, 122, 0, 0.15);
    box-shadow: 0 0 16px var(--accent-glow);
}

/* ===== Bottom Nav ===== */
.bnav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 300;
    height: calc(62px + env(safe-area-inset-bottom, 0));
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: rgba(10, 11, 16, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-glass);
    display: flex;
    align-items: stretch;
    justify-content: space-around;
}
.bnav-i {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    transition: 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: relative;
}
.bnav-i i {
    font-size: 20px;
    transition: 0.2s;
}
.bnav-i.active {
    color: var(--accent);
}
.bnav-i.active i {
    filter: drop-shadow(0 0 8px var(--accent-glow));
}
.bnav-i:hover { color: var(--text-secondary); }
.bnav-i span { line-height: 1.2; }

/* ===== Main Content ===== */
.main {
    flex: 1;
    max-width: 780px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 16px 24px;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0));
}
.page {
    animation: fadeUp 0.4s ease;
}
@keyframes fadeUp {
    0% { opacity: 0; transform: translateY(16px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: 0.25s ease;
    text-decoration: none;
    white-space: nowrap;
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}
.btn:active { transform: scale(0.97); }
.btn.primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 20px rgba(255, 122, 0, 0.3);
}
.btn.primary:hover {
    background: #e66e00;
    box-shadow: 0 4px 30px var(--accent-glow);
    transform: translateY(-2px);
}
.btn.outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid rgba(255, 122, 0, 0.4);
}
.btn.outline:hover {
    background: rgba(255, 122, 0, 0.08);
    box-shadow: 0 0 20px var(--accent-glow);
}
.btn.sm { padding: 6px 14px; font-size: 12px; }
.w-full { width: 100%; }

/* ===== Badges ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
}
.badge-dev {
  position: relative;
  background: linear-gradient(135deg, rgba(70,0,0,0.85), rgba(120,0,0,0.55), rgba(40,0,0,0.9));
  color: #ff1a1a !important;
  border-color: rgba(200, 0, 0, 0.9) !important;
  box-shadow:
    0 0 10px rgba(180, 0, 0, 0.55),
    0 0 22px rgba(120, 0, 0, 0.4),
    inset 0 0 12px rgba(255, 0, 0, 0.12);
  text-shadow: 0 0 8px rgba(255, 0, 0, 0.65), 0 0 16px rgba(180, 0, 0, 0.4);
  font-weight: 800;
  letter-spacing: 0.04em;
  animation: devBadgeGlow 2.4s ease-in-out infinite;
  overflow: visible;
}
@keyframes devPrefixPulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(180,0,0,0.35), inset 0 0 6px rgba(255,0,0,0.08);
    border-color: rgba(200, 0, 0, 0.55);
  }
  50% {
    box-shadow: 0 0 18px rgba(255,0,0,0.55), 0 0 28px rgba(120,0,0,0.35), inset 0 0 10px rgba(255,0,0,0.15);
    border-color: rgba(255, 40, 40, 0.85);
  }
}
@keyframes devBadgeGlow {
  0%, 100% { filter: brightness(1); box-shadow: 0 0 10px rgba(180,0,0,0.5), 0 0 22px rgba(120,0,0,0.35); }
  50% { filter: brightness(1.15); box-shadow: 0 0 18px rgba(255,20,20,0.65), 0 0 32px rgba(140,0,0,0.45); }
}
@keyframes devAvaGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(180,0,0,0.45), 0 0 12px rgba(160,0,0,0.5); }
  50% { box-shadow: 0 0 0 2px rgba(255,30,30,0.65), 0 0 22px rgba(200,0,0,0.7), 0 0 36px rgba(100,0,0,0.35); }
}
@keyframes devRing {
  0% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.06); opacity: 0.35; }
  100% { transform: scale(1.12); opacity: 0; }
}
.badge-founder { background: rgba(231, 76, 60, 0.18); color: #ff6b5a; border-color: rgba(231, 76, 60, 0.45); box-shadow: 0 0 12px rgba(231, 76, 60, 0.28); }
.badge-deputy  { background: rgba(220, 40, 40, 0.16); color: #ff4d4d; border-color: rgba(220, 40, 40, 0.45); box-shadow: 0 0 12px rgba(220, 40, 40, 0.22); }
.badge-angel   { background: rgba(255, 105, 180, 0.16); color: #ff79c0; border-color: rgba(255, 105, 180, 0.45); box-shadow: 0 0 12px rgba(255, 105, 180, 0.22); }
.badge-chief   { background: rgba(46, 204, 113, 0.16); color: #3ddc84; border-color: rgba(46, 204, 113, 0.4); box-shadow: 0 0 10px rgba(46, 204, 113, 0.2); }
.badge-leader  { background: rgba(241, 196, 15, 0.15); color: var(--yellow); border-color: rgba(241, 196, 15, 0.3); }
.badge-admin   { background: rgba(52, 152, 219, 0.15); color: var(--blue); border-color: rgba(52, 152, 219, 0.3); }
.badge-user    { background: var(--bg-glass); color: var(--text-muted); }
.badge.badge-admin, .badge.badge-leader, .badge.badge-chief,
.badge.badge-angel, .badge.badge-deputy, .badge.badge-founder, .badge.badge-dev {
  animation: roleBadgePulse 2.2s ease-in-out infinite;
  border: none !important;
  box-shadow: none !important;
}
.badge {
  border: none !important;
}
@keyframes roleBadgePulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}


/* ===== Flash ===== */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    background: rgba(46, 204, 113, 0.08);
    border: 1px solid rgba(46, 204, 113, 0.2);
    color: var(--green);
    font-weight: 500;
}

/* ===== Home Page ===== */
.hero {
    padding: 28px 24px;
    margin-bottom: 24px;
    text-align: center;
}
.hero .h1 {
    font-size: 32px;
    margin-bottom: 8px;
}
.hero p { margin-bottom: 18px; }
.cta {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.stats {
    display: flex;
    justify-content: space-around;
    padding: 18px 12px;
    margin-bottom: 24px;
}
.stat { text-align: center; }
.sn {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
    text-shadow: 0 0 20px var(--accent-glow);
}
.stat > div:last-child {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}
.cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}
.card {
    padding: 16px 14px;
    transition: 0.25s;
}
.card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(255, 122, 0, 0.08);
}
.card i {
    font-size: 28px;
    color: var(--accent);
    margin-bottom: 8px;
    display: block;
}
.card h3 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}
.card p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.about {
    padding: 18px 20px;
}
.about h2 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 12px;
}
.about p { color: var(--text-secondary); font-size: 13px; }

/* ===== Anon Page ===== */
.anon-hero {
    text-align: center;
    padding: 32px 20px;
    margin-bottom: 24px;
}
.anon-hero .h1 {
    font-size: 34px;
    font-weight: 900;
}
.anon-hero .orange { display: block; }
.anon-hero p { margin-top: 10px; }
.aform {
    padding: 20px;
    margin-bottom: 16px;
}
.aform textarea {
    width: 100%;
    min-height: 140px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    padding: 12px 14px;
    resize: vertical;
    transition: 0.2s;
}
.aform textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(255, 122, 0, 0.1);
}
.aform textarea::placeholder { color: var(--text-muted); }
.ameta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin: 8px 0 16px;
}
.aact { display: flex; gap: 10px; }
.aact .btn { flex: 1; }
.anote {
    padding: 12px 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===== History ===== */
.mlist {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mcard {
    padding: 14px 16px;
    transition: 0.2s;
}
.mcard:hover { border-color: var(--accent); }
.mcard.mcard-published {
    border: 1.5px solid rgba(61, 220, 132, 0.55);
    box-shadow: 0 0 18px rgba(61, 220, 132, 0.2), inset 0 0 0 1px rgba(61, 220, 132, 0.08);
    background: linear-gradient(135deg, rgba(61, 220, 132, 0.06), rgba(0, 0, 0, 0.12));
}
.mcard.mcard-published:hover {
    border-color: rgba(61, 220, 132, 0.8);
    box-shadow: 0 0 22px rgba(61, 220, 132, 0.28);
}
.mh {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.mid {
    background: rgba(255, 122, 0, 0.08);
    border: 1px solid rgba(255, 122, 0, 0.2);
    border-radius: 6px;
    padding: 2px 10px;
    font-weight: 700;
    font-size: 11px;
    color: var(--accent);
    font-family: monospace;
}
.mt {
    font-size: 11px;
    color: var(--text-muted);
    margin-right: auto;
}
.btn-del {
    background: none;
    border: 1px solid rgba(231, 76, 60, 0.2);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--red);
    padding: 2px 8px;
    transition: 0.2s;
}
.btn-del:hover {
    background: rgba(231, 76, 60, 0.1);
    box-shadow: 0 0 12px rgba(231, 76, 60, 0.2);
}
.mb {
    font-size: 14px;
    line-height: 1.7;
    word-break: break-word;
}
.empty {
    text-align: center;
    padding: 60px 16px;
    color: var(--text-muted);
}
.empty a { color: var(--accent); }

/* ===== Chat ===== */
.page.chat {
    display: flex;
    flex-direction: column;
    /* header 60 + bottom nav 62 + main padding */
    height: calc(100dvh - 60px - 62px - env(safe-area-inset-bottom, 0px) - 16px);
    max-height: calc(100dvh - 60px - 62px - env(safe-area-inset-bottom, 0px) - 16px);
    min-height: 280px;
    margin: 0;
    padding: 0;
    overflow: hidden;
}
.chat-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-radius: var(--radius) var(--radius) 0 0;
    flex-shrink: 0;
    font-weight: 700;
}
.chat-hdr i { margin-right: 6px; }
.online {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 12px var(--green);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}
.feed {
    flex: 1;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-left: 1px solid var(--border-glass);
    border-right: 1px solid var(--border-glass);
}
.feed-in {
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 100%;
}
.msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 82%;
    animation: msgIn 0.25s ease;
}
@keyframes msgIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}
.msg.left { align-self: flex-start; }
.msg.right { align-self: flex-end; flex-direction: row-reverse; }
.msg .ava {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}
.bubble {
    border-radius: 14px;
    padding: 8px 14px;
    max-width: 100%;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
}
.msg.left .bubble { border-bottom-left-radius: 4px; }
.msg.right .bubble {
    background: var(--accent);
    border-color: var(--accent);
}
.msg.right .bubble * { color: #fff; }
.meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    flex-wrap: wrap;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}
.meta .name { display: flex; align-items: center; gap: 4px; }
.meta .anon {
    background: rgba(255, 122, 0, 0.12);
    border-radius: 4px;
    padding: 0 5px;
    font-size: 9px;
    color: var(--accent);
}
.meta .role {
    border-radius: 4px;
    padding: 0 6px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}
.r1 { background: rgba(52, 152, 219, 0.15); color: var(--blue); }
.r2 { background: rgba(241, 196, 15, 0.15); color: var(--yellow); }
.r3 { background: rgba(46, 204, 113, 0.18); color: #3ddc84; box-shadow: 0 0 8px rgba(46,204,113,0.25); }
.r4 { background: rgba(255, 105, 180, 0.18); color: #ff79c0; box-shadow: 0 0 8px rgba(255,105,180,0.25); }
.r5 { background: rgba(220, 40, 40, 0.18); color: #ff4d4d; box-shadow: 0 0 8px rgba(220,40,40,0.25); }
.r6 { background: rgba(231, 76, 60, 0.2); color: #ff6b5a; box-shadow: 0 0 10px rgba(231,76,60,0.3); }
.time {
    font-size: 10px;
    color: var(--text-muted);
    margin-left: auto;
    white-space: nowrap;
}
.del {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-muted);
    padding: 0 4px;
    transition: 0.2s;
}
.del:hover { color: var(--red); }
.text {
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
}
.input-bar {
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 12px 14px;
    flex-shrink: 0;
}
.anon-n {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.inp-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}
#chat-in {
    flex: 1;
    min-width: 0;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-glass);
    border-radius: 22px;
    color: var(--text-primary);
    font-size: 16px; /* prevents iOS zoom */
    font-family: inherit;
    padding: 10px 16px;
    resize: none;
    max-height: 100px;
    line-height: 1.4;
    transition: 0.2s;
    -webkit-appearance: none;
}
#chat-in:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(255, 122, 0, 0.05);
}
.btn-send {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 17px;
    color: #fff;
    transition: 0.2s;
    box-shadow: 0 4px 16px rgba(255, 122, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-send:disabled {
    opacity: 0.55;
    pointer-events: none;
}
.btn-send:hover {
    background: #e66e00;
    box-shadow: 0 4px 28px var(--accent-glow);
    transform: scale(1.03);
}
.inp-meta {
    margin-top: 6px;
    text-align: right;
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== Users ===== */
.ulist {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ucard {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: 0.2s;
}
.ucard:hover { border-color: var(--accent); }
.ucard .ava {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-glass);
    border: 2px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}
.uinfo { flex: 1; min-width: 0; }
.um {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.ut {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== Auth ===== */
.abox {
    padding: 24px 20px;
    max-width: 400px;
    margin: 0 auto;
}
.abox .h1 {
    font-size: 26px;
    text-align: center;
    margin-bottom: 4px;
}
.abox .p { text-align: center; margin-bottom: 18px; }
.atabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-glass);
    gap: 0;
}
.atab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    padding: 10px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: 0.2s;
}
.atab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.aform {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.aform.hidden { display: none; }
.field {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    padding: 12px 14px;
    width: 100%;
    transition: 0.2s;
}
.field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(255, 122, 0, 0.05);
}
.field::placeholder { color: var(--text-muted); }
.eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-muted);
    transition: 0.2s;
}
.eye:hover { color: var(--text-primary); }

/* ===== Admin ===== */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}
.astat {
    padding: 16px;
    text-align: center;
}
.asn {
    font-size: 26px;
    font-weight: 800;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
    line-height: 1;
    margin-bottom: 4px;
}
.admin-section {
    margin-bottom: 18px;
    overflow: hidden;
}
.admin-section h2 {
    font-size: 14px;
    font-weight: 700;
    padding: 14px 18px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-glass);
}
.alist { display: flex; flex-direction: column; }
.auser {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.auser:last-child { border-bottom: none; }
.auser.auser-me { background: rgba(255, 122, 0, 0.04); }
.auser .ava {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-glass);
    border: 2px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}
.ainfo { flex: 1; min-width: 160px; }
.ainfo > div:nth-child(2) {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.acred {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 10px;
    color: var(--text-muted);
    flex: 1.5;
    min-width: 200px;
}
.acred div { margin-bottom: 2px; }
.acred code {
    font-family: monospace;
    font-size: 9px;
    color: var(--text-primary);
    word-break: break-all;
}
.me-badge {
    font-size: 9px;
    background: rgba(255, 122, 0, 0.12);
    color: var(--accent);
    border: 1px solid rgba(255, 122, 0, 0.2);
    border-radius: 20px;
    padding: 1px 8px;
    font-weight: 700;
}
.arole {
    display: flex;
    align-items: center;
    gap: 8px;
}
.role-select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}
.perms-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 8px;
}
.perms-table th {
    padding: 10px 14px;
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-glass);
}
.perms-table td {
    padding: 10px 14px;
    border-top: 1px solid var(--border-glass);
}
.col-red { color: var(--red); }
.col-green { color: var(--green); }
.col-yellow { color: var(--yellow); }
.col-blue { color: var(--blue); }
.col-gray { color: var(--text-muted); }

/* ===== Footer ===== */
.ftr {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 12px;
    border-top: 1px solid var(--border-glass);
}

/* ===== Responsive ===== */
@media (min-width: 700px) {
    .bnav {
        position: sticky;
        top: 60px;
        height: 50px;
        flex-direction: row;
        justify-content: center;
        background: rgba(10, 11, 16, 0.8);
        backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--border-glass);
        padding: 0 16px;
    }
    .bnav-i {
        flex: 0 0 auto;
        flex-direction: row;
        gap: 8px;
        padding: 0 20px;
        border-bottom: 2px solid transparent;
        font-size: 13px;
    }
    .bnav-i i { font-size: 16px; }
    .bnav-i.active { border-bottom-color: var(--accent); }
    .bnav-i span { font-size: 13px; }
    .page.chat {
        height: calc(100dvh - 60px - 50px - 24px);
        max-height: calc(100dvh - 60px - 50px - 24px);
    }
    .cards { grid-template-columns: repeat(4, 1fr); }
    .admin-stats { grid-template-columns: repeat(3, 1fr); }
    .auser { flex-direction: row; }
    .auser .ainfo { flex: 0 0 160px; }
    .auser .acred { flex: 2; }
}

@media (max-width: 480px) {
    .hero .h1 { font-size: 24px; }
    .anon-hero .h1 { font-size: 26px; }
    .stats .sn { font-size: 22px; }
    .card i { font-size: 22px; }
    .msg { max-width: 92%; }
    .usr .un { font-size: 12px; }
    .usr .ur { font-size: 9px; }
}
/* ===== АДМИН-ПАНЕЛЬ ===== */
.admin-header {
    margin-bottom: 30px;
}
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin: 24px 0;
}
.astat {
    background: var(--bg-card, #f8f9fa);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.astat .asn {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary, #2a7de1);
    line-height: 1.2;
}
.astat div:last-child {
    font-size: 0.9rem;
    color: var(--gray, #6c757d);
    margin-top: 4px;
}

.admin-section {
    background: var(--bg-card, #fff);
    border-radius: 16px;
    padding: 24px;
    margin-top: 30px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.admin-section h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text, #1a1a2e);
}

/* Список пользователей */
.alist {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.auser {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-light, #f8f9fa);
    border-radius: 10px;
    flex-wrap: wrap;
}
.auser-me {
    background: var(--primary-light, #e8f0fe);
    border-left: 4px solid var(--primary, #2a7de1);
}
.ainfo {
    flex: 1;
    min-width: 140px;
}
.ainfo .un {
    font-weight: 600;
}
.ainfo .um {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.85rem;
}
.me-badge {
    background: var(--primary, #2a7de1);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 12px;
}
.acred {
    font-size: 0.8rem;
    color: var(--gray, #6c757d);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.acred code {
    background: var(--bg-code, #e9ecef);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
}
.arole {
    display: flex;
    gap: 8px;
    align-items: center;
}
.role-select {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border, #ddd);
    background: #fff;
    font-size: 0.85rem;
}

/* Список сообщений */
.msg-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.msg-item {
    padding: 12px 16px;
    background: var(--bg-light, #f8f9fa);
    border-radius: 10px;
}
.msg-item.deleted {
    opacity: 0.5;
    background: var(--bg-deleted, #f1f1f1);
}
.msg-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--gray, #6c757d);
    margin-bottom: 4px;
}
.msg-id {
    font-weight: 600;
    color: var(--text, #1a1a2e);
}
.msg-author {
    font-weight: 500;
}
.msg-body {
    font-size: 0.95rem;
    word-break: break-word;
}
.btn-del {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0 4px;
    color: var(--red, #dc3545);
    transition: transform 0.2s;
}
.btn-del:hover {
    transform: scale(1.2);
}
.badge-deleted {
    background: var(--gray, #6c757d);
    color: #fff;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
}

/* Таблица ролей */
.perms-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.perms-table th,
.perms-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border, #e9ecef);
}
.perms-table th {
    background: var(--bg-light, #f8f9fa);
    font-weight: 600;
}
.col-red { color: #dc3545; }
.col-green { color: #28a745; }
.col-yellow { color: #ffc107; }
.col-blue { color: #007bff; }
.col-gray { color: #6c757d; }

/* Адаптив */
@media (max-width: 600px) {
    .auser {
        flex-direction: column;
        align-items: stretch;
    }
    .arole {
        flex-wrap: wrap;
    }
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Glass applied properly (was invalid composes) ===== */
.anon-hero,
.aform,
.anote,
.mcard,
.chat-hdr,
.input-bar,
.ucard {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.chat-hdr {
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: none;
}
.input-bar {
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: none;
}

/* ===== Anon media attach ===== */
.aact {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.aact-buttons {
    display: flex;
    gap: 10px;
}
.aact-buttons .btn {
    flex: 1;
}
.btn-attach {
    display: flex !important;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(255, 122, 0, 0.14), rgba(255, 122, 0, 0.06));
    border: 2px dashed #ff7a00 !important;
    border-radius: 14px;
    color: #ff7a00 !important;
    cursor: pointer;
    transition: 0.2s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
    text-align: left;
}
.btn-attach:hover,
.btn-attach:active,
.btn-attach.has-file {
    background: rgba(255, 122, 0, 0.22);
    border-style: solid !important;
    box-shadow: 0 0 24px rgba(255, 122, 0, 0.25);
}
.btn-attach-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #ff7a00;
    color: #fff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.btn-attach-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.btn-attach-text strong {
    font-size: 15px;
    font-weight: 700;
    color: #ffb36b !important;
    line-height: 1.3;
}
.btn-attach-text small {
    font-size: 11px;
    color: #88929e !important;
    font-weight: 400;
}

.media-preview {
    margin: 0 0 14px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--border-glass);
}
.media-preview-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    max-height: 280px;
}
.media-preview-inner img,
.media-preview-inner video {
    max-width: 100%;
    max-height: 280px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
.media-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    z-index: 2;
}
.media-remove:hover {
    background: var(--red);
}
.media-info {
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-glass);
    word-break: break-all;
}

/* History media */
.mmedia {
    margin-top: 10px;
}
.mmedia-img {
    max-width: 100%;
    max-height: 360px;
    border-radius: 10px;
    display: block;
    object-fit: contain;
    background: rgba(0,0,0,0.25);
}
.mmedia-video {
    max-width: 100%;
    max-height: 360px;
    border-radius: 10px;
    display: block;
    background: #000;
}
.mmedia-link {
    display: inline-block;
    max-width: 100%;
}

/* ===== Chat mobile polish ===== */
.chat-title {
    display: flex;
    align-items: center;
    gap: 6px;
}
.feed {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.anon-tag {
    background: rgba(255, 122, 0, 0.15);
    color: var(--accent);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 2px;
}
.inp-row {
    align-items: flex-end;
}
.input-bar {
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
}
.anon-n {
    font-size: 12px;
    margin-bottom: 8px;
    gap: 8px;
}
.anon-n .link {
    white-space: nowrap;
    font-size: 12px;
}
.chat-empty {
    margin: auto;
    padding: 40px 16px;
}

/* Fix main when on chat: less padding so chat fills height */
body:has(.page.chat) .main {
    padding-bottom: 0;
    padding-top: 8px;
}
body:has(.page.chat) {
    padding-bottom: calc(62px + env(safe-area-inset-bottom, 0));
}

@media (max-width: 480px) {
    .btn-attach span {
        font-size: 13px;
    }
    .aact .btn {
        flex: 1 1 45%;
    }
    .page.chat {
        height: calc(100dvh - 56px - 62px - env(safe-area-inset-bottom, 0px) - 8px);
        max-height: calc(100dvh - 56px - 62px - env(safe-area-inset-bottom, 0px) - 8px);
    }
    .msg {
        max-width: 88%;
    }
    .bubble {
        padding: 8px 12px;
    }
    .text {
        font-size: 15px;
    }
    #chat-in {
        font-size: 16px;
    }
}

@media (min-width: 700px) {
    .btn-attach {
        flex: 0 1 auto;
        min-width: 220px;
    }
    .aact .btn.primary {
        flex: 1;
    }
    .aact .btn.outline {
        flex: 0 1 auto;
    }
}

/* Flash message */
.flash {
    background: rgba(46, 204, 113, 0.12);
    border: 1px solid rgba(46, 204, 113, 0.35);
    color: var(--green);
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}


/* ===== CHAT v3 — mobile-first shell ===== */
.page.chat {
    --kb: 0px;
    display: block !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}
.chat-shell {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 60px - 62px - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 60px - 62px - env(safe-area-inset-bottom, 0px));
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    overflow: hidden;
}
.chat-shell .chat-hdr {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(10, 11, 16, 0.85);
    border-bottom: 1px solid var(--border-glass);
    font-weight: 700;
}
.chat-shell .feed {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: rgba(0,0,0,0.18);
    border: none;
}
.chat-shell .feed-in {
    padding: 12px 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 100%;
}
.composer {
    flex-shrink: 0;
    padding: 10px 12px 12px;
    background: rgba(10, 11, 16, 0.92);
    border-top: 1px solid var(--border-glass);
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}
body.kb-open .composer {
    padding-bottom: 10px;
}
body.kb-open .bnav {
    /* прячем нижнее меню, когда открыта клавиатура */
    transform: translateY(110%);
    pointer-events: none;
}
body.kb-open .chat-shell {
    height: calc(100dvh - 60px - var(--kb, 0px));
    max-height: calc(100dvh - 60px - var(--kb, 0px));
}
body.kb-open {
    padding-bottom: 0 !important;
}
.composer-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.composer #chat-in {
    flex: 1;
    min-width: 0;
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--border-glass);
    border-radius: 22px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    padding: 11px 16px;
    resize: none;
    max-height: 96px;
    line-height: 1.4;
    -webkit-appearance: none;
    margin: 0;
}
.composer #chat-in:focus {
    outline: none;
    border-color: var(--accent);
}
.composer .btn-send {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(255,122,0,0.3);
    cursor: pointer;
}
.composer .btn-send:disabled { opacity: 0.5; }
.composer .inp-meta {
    margin-top: 4px;
    text-align: right;
    font-size: 11px;
    color: var(--text-muted);
}
.composer .anon-n {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-muted);
    background: rgba(0,0,0,0.25);
    border-radius: 8px;
    padding: 6px 12px;
}

/* main padding when chat */
body:has(.page.chat) .main {
    padding: 8px 10px 0 !important;
}
body:has(.page.chat) {
    padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 700px) {
    .chat-shell {
        height: calc(100dvh - 60px - 50px - 24px);
        max-height: calc(100dvh - 60px - 50px - 24px);
    }
    body:has(.page.chat) .main {
        padding: 16px 16px 0 !important;
    }
}

@media (max-width: 480px) {
    .btn-attach-text strong { font-size: 14px; }
    .btn-attach-icon { width: 44px; height: 44px; font-size: 20px; }
    .msg { max-width: 90%; }
}


/* ===== Lightbox (история фото) ===== */
.mmedia-link {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    cursor: zoom-in;
    -webkit-tap-highlight-color: transparent;
    border-radius: 10px;
    overflow: hidden;
}
.mmedia-link .mmedia-img {
    transition: transform 0.2s ease, filter 0.2s ease;
}
.mmedia-link:hover .mmedia-img,
.mmedia-link:active .mmedia-img {
    transform: scale(1.01);
    filter: brightness(1.05);
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}
.lightbox.open {
    opacity: 1;
    visibility: visible;
}
.lightbox[hidden] {
    display: none !important;
}
.lightbox:not([hidden]) {
    display: flex;
}
.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
}
.lightbox-content {
    position: relative;
    z-index: 1;
    max-width: min(96vw, 920px);
    max-height: min(88dvh, 88vh);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.92);
    transition: transform 0.22s ease;
}
.lightbox.open .lightbox-content {
    transform: scale(1);
}
.lightbox-img {
    max-width: 100%;
    max-height: min(88dvh, 88vh);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
    user-select: none;
    -webkit-user-drag: none;
}
.lightbox-close {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: 14px;
    z-index: 2;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.lightbox-close:hover,
.lightbox-close:active {
    background: rgba(255, 122, 0, 0.85);
}


/* Upload progress */
.upload-progress {
    margin: 0 0 14px;
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    height: 36px;
}
.upload-progress-bar {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 0%;
    background: linear-gradient(90deg, #ff7a00, #ffb36b);
    transition: width 0.15s ease;
}
.upload-progress-text {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}


/* ===== IP badge ===== */
.mip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-family: ui-monospace, monospace;
    color: #7dd3fc;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 6px;
    padding: 2px 8px;
}

/* ===== Admin panel v2 ===== */
.page.admin {
    max-width: 820px;
    margin: 0 auto;
}
.adm-denied {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-secondary);
}
.adm-denied i {
    font-size: 42px;
    color: var(--red);
    margin-bottom: 12px;
}
.adm-top {
    padding: 18px 18px 14px;
    margin-bottom: 14px;
}
.adm-title {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.adm-title i { color: var(--accent); }
.adm-sub {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.adm-nav {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
}
.adm-nav-i {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    min-width: 72px;
    transition: 0.15s;
}
.adm-nav-i i { font-size: 16px; }
.adm-nav-i:hover { color: var(--text-secondary); border-color: rgba(255,122,0,0.3); }
.adm-nav-i.active {
    color: #fff;
    background: rgba(255, 122, 0, 0.18);
    border-color: rgba(255, 122, 0, 0.5);
    box-shadow: 0 0 16px rgba(255,122,0,0.15);
}

.adm-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}
@media (min-width: 560px) {
    .adm-stats { grid-template-columns: repeat(4, 1fr); }
}
.adm-stat {
    padding: 16px 12px;
    text-align: center;
}
.adm-stat-n {
    font-size: 26px;
    font-weight: 800;
    color: var(--accent);
    line-height: 1.1;
}
.adm-stat-l {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.adm-grid {
    display: grid;
    gap: 12px;
}
@media (min-width: 700px) {
    .adm-grid { grid-template-columns: 1fr 1fr; }
}

.adm-card {
    padding: 16px;
    margin-bottom: 12px;
}
.adm-card-h {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.adm-card-h h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.adm-card-h h3 i { color: var(--accent); }
.adm-link {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
}
.adm-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: rgba(255,122,0,0.15);
    color: var(--accent);
    font-size: 11px;
}
.adm-hint {
    font-size: 11px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 5px;
}
.adm-hint.muted { color: var(--text-muted); }
.adm-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 24px 8px;
    font-size: 13px;
}

.adm-feed {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.adm-feed-item {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border-glass);
}
.adm-feed-item.is-deleted,
.adm-msg.is-deleted {
    opacity: 0.45;
}
.adm-feed-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.adm-feed-body {
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}

.adm-perms {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.adm-perm {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 8px 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
}

/* Users list */
.adm-users {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.adm-user {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(0,0,0,0.28);
    border: 1px solid var(--border-glass);
}
.adm-user.is-me {
    border-color: rgba(255,122,0,0.35);
    background: rgba(255,122,0,0.06);
}
.adm-user-main {
    display: flex;
    align-items: center;
    gap: 12px;
}
.adm-user-info { min-width: 0; flex: 1; }
.adm-user-name {
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.me-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(255,122,0,0.2);
    color: var(--accent);
    padding: 1px 6px;
    border-radius: 4px;
}
.adm-user-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 3px;
}
.adm-date {
    font-size: 11px;
    color: var(--text-muted);
}
.adm-pass {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(241, 196, 15, 0.08);
    border: 1px solid rgba(241, 196, 15, 0.2);
    font-size: 12px;
    color: var(--yellow);
}
.adm-pass code {
    flex: 1;
    font-family: ui-monospace, monospace;
    color: #f9e79f;
    word-break: break-all;
}
.adm-copy {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.adm-role-form {
    display: flex;
    gap: 8px;
    align-items: center;
}
.adm-select {
    flex: 1;
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    padding: 8px 10px;
    font-family: inherit;
}
.adm-select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Messages list in admin */
.adm-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.adm-msg {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(0,0,0,0.28);
    border: 1px solid var(--border-glass);
}
.adm-msg-h {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-bottom: 6px;
    font-size: 12px;
}
.adm-msg-body {
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
}
.adm-del-form {
    margin-left: auto;
}
.badge-deleted {
    background: rgba(231, 76, 60, 0.15);
    color: var(--red);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Override old light admin styles if any */
.page.admin .admin-section,
.page.admin .astat {
    background: transparent;
    color: inherit;
    box-shadow: none;
}


/* Stories download button */
.btn-story {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
    border: none;
    border-radius: 8px;
    color: #fff !important;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.2;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}
.btn-story:hover,
.btn-story:active {
    transform: scale(1.03);
    box-shadow: 0 4px 16px rgba(221, 42, 123, 0.35);
}
.btn-story:disabled {
    opacity: 0.65;
    pointer-events: none;
}
.btn-story i { font-size: 13px; }
.mh .btn-story,
.adm-msg-h .btn-story {
    margin-left: auto;
}
.adm-msg-h .adm-del-form {
    margin-left: 0;
}


/* Story preview overlay */
.story-preview-ov {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}
.story-preview-box {
    max-width: 360px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}
.story-preview-tip {
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    text-align: center;
    margin: 0;
    line-height: 1.4;
}
.story-preview-img {
    width: 100%;
    max-height: 70dvh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    background: #111;
}
.story-preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}
.story-preview-actions .btn {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
    justify-content: center;
    font-size: 13px;
    padding: 10px 12px;
    white-space: nowrap;
}
@media (max-width: 420px) {
    .story-preview-ov {
        padding: 10px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        align-items: flex-end;
    }
    .story-preview-box {
        max-width: 100%;
        gap: 8px;
    }
    .story-preview-img,
    video.story-preview-img {
        max-height: 52dvh;
    }
    .story-preview-tip {
        font-size: 12px;
    }
    .story-preview-actions {
        flex-direction: column;
        gap: 8px;
    }
    .story-preview-actions .btn {
        width: 100%;
        flex: none;
        padding: 12px 14px;
        font-size: 14px;
        border-radius: 12px;
    }
}

video.story-preview-img {
    width: 100%;
    max-height: 70dvh;
    object-fit: contain;
    border-radius: 12px;
    background: #111;
}


/* Social links on home */
.social-links {
    margin: 28px 0 8px;
    text-align: center;
}
.social-title {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0 0 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.social-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 148px;
    padding: 14px 20px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 15px;
    color: #fff !important;
    text-decoration: none !important;
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.social-btn i { font-size: 22px; line-height: 1; }
.social-btn:hover,
.social-btn:active {
    transform: scale(1.03);
    opacity: 0.95;
}
.social-ig {
    background: linear-gradient(135deg, #f58529, #dd2a7b 55%, #8134af);
    box-shadow: 0 8px 24px rgba(221, 42, 123, 0.28);
}
.social-tg {
    background: linear-gradient(135deg, #2AABEE, #229ED9);
    box-shadow: 0 8px 24px rgba(42, 171, 238, 0.28);
}
@media (max-width: 420px) {
    .social-row {
        flex-direction: column;
        align-items: stretch;
        padding: 0 8px;
    }
    .social-btn {
        width: 100%;
        min-width: 0;
        padding: 16px 18px;
        border-radius: 14px;
        font-size: 16px;
    }
    .social-btn i { font-size: 24px; }
}


/* Lazy video — не грузим файл, пока не нажали */
.mmedia-video-lazy {
    position: relative;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 16 / 10;
    border-radius: 14px;
    background: linear-gradient(145deg, #1a1a22, #0e0e14);
    border: 1px solid rgba(255,255,255,0.08);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.mmedia-play-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(255,122,0,0.15);
    border: 1px solid rgba(255,122,0,0.45);
    color: #ffb16a;
    border-radius: 16px;
    padding: 16px 22px;
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.mmedia-play-btn i {
    font-size: 28px;
}
.mmedia-video-lazy .mmedia-video {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
    background: #000;
}

/* ===== Profiles & private messages ===== */
.usr-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
    min-width: 0;
}
.bnav-ico-wrap {
    position: relative;
    display: inline-flex;
}
.bnav-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 99px;
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.ava img,
.ava-img,
.prof-ava img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}
.prof-ava {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    color: #fff;
    background: linear-gradient(135deg, #3a3a48, #22222c);
    overflow: hidden;
    flex-shrink: 0;
}
.prof-ava.sm { width: 40px; height: 40px; border-radius: 12px; font-size: 16px; }
.prof-ava.large { width: 88px; height: 88px; border-radius: 24px; font-size: 32px; }

.profile-page { padding-bottom: 24px; }
.prof-card {
    padding: 18px;
    border-radius: 20px;
}
.prof-top {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.prof-nick {
    margin: 0 0 6px;
    font-size: 1.35rem;
    line-height: 1.2;
}
.prof-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.prof-since { color: var(--text-muted); font-size: 12px; }
.prof-status {
    margin-top: 10px;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 14px;
}
.prof-grid {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}
.prof-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-glass);
}
.prof-item i {
    color: #ff9a3c;
    width: 20px;
    text-align: center;
    margin-top: 2px;
}
.prof-item-l { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.prof-item-v { font-size: 14px; font-weight: 600; }
.prof-about {
    margin-top: 14px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-glass);
}
.prof-about-t {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.prof-about-b { font-size: 14px; line-height: 1.5; color: var(--text-secondary); }
.prof-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}
.prof-actions .btn { flex: 1 1 140px; justify-content: center; text-align: center; }

.prof-edit-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.prof-edit-head h1 { margin: 0; font-size: 1.2rem; }
.prof-back {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    text-decoration: none;
}
.prof-edit {
    padding: 16px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.prof-ava-edit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.prof-ava-btn { cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.field small { font-size: 11px; color: var(--text-muted); }
.field .inp, .inp {
    width: 100%;
    box-sizing: border-box;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    color: var(--text);
    padding: 12px 14px;
    font: inherit;
}
.field textarea.inp { resize: vertical; min-height: 96px; }
.prof-edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}
.prof-edit-actions .btn { flex: 1; justify-content: center; }

.ucard-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
.ucard-link:active { transform: scale(0.99); }
.ustatus {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ucard-msg {
    margin-left: auto;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255,122,0,0.12);
    color: #ff9a3c;
    flex-shrink: 0;
}

/* Messages */

/* ===== Private Messages — modern mobile UI ===== */
.pm-page {
  padding-bottom: 20px;
  max-width: 720px;
  margin: 0 auto;
}

.pm-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 0 2px;
}
.pm-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff5eb;
}
.pm-title i { color: #ff9a3c; }
.pm-new-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #2a1c14, #14100e);
  border: 1px solid rgba(255, 140, 40, 0.3);
  color: #ffc080;
  text-decoration: none;
  font-size: 0.95rem;
}
.pm-new-btn:active { transform: scale(0.96); }

/* Role badge near nick */
.pm-role {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.3;
  white-space: nowrap;
  flex-shrink: 0;
  vertical-align: middle;
}
.pm-role.r6 { background: rgba(255, 77, 77, 0.2); color: #ff8a8a; border: 1px solid rgba(255, 77, 77, 0.35); }
.pm-role.r5 { background: rgba(255, 121, 192, 0.18); color: #ff9ad0; border: 1px solid rgba(255, 121, 192, 0.35); }
.pm-role.r4 { background: rgba(61, 220, 132, 0.15); color: #6eeba8; border: 1px solid rgba(61, 220, 132, 0.3); }
.pm-role.r3 { background: rgba(255, 200, 60, 0.15); color: #ffd56a; border: 1px solid rgba(255, 200, 60, 0.3); }
.pm-role.r2 { background: rgba(100, 160, 255, 0.15); color: #8eb6ff; border: 1px solid rgba(100, 160, 255, 0.3); }
.pm-role.r1 { background: rgba(255, 140, 40, 0.15); color: #ffb060; border: 1px solid rgba(255, 140, 40, 0.3); }
.pm-role.r0 { display: none; }

/* Avatar */
.pm-ava {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(160deg, #2a1c14, #161210);
  border: 1.5px solid rgba(255, 140, 40, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-weight: 800;
  color: #ffc080;
  font-size: 1rem;
}
.pm-ava .ava-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pm-ava.hdot-r1 { border-color: rgba(255, 140, 40, 0.55); }
.pm-ava.hdot-r2 { border-color: rgba(100, 160, 255, 0.55); }
.pm-ava.hdot-r3 { border-color: rgba(255, 200, 60, 0.55); }
.pm-ava.hdot-r4 { border-color: rgba(61, 220, 132, 0.55); }
.pm-ava.hdot-r5 { border-color: rgba(255, 121, 192, 0.55); }
.pm-ava.hdot-r6 { border-color: rgba(255, 77, 77, 0.65); box-shadow: 0 0 12px rgba(255, 60, 60, 0.25); }
.pm-ava.hdot-r7 {
  border-color: rgba(180, 0, 0, 0.85);
  box-shadow: 0 0 14px rgba(160, 0, 0, 0.55);
  animation: devAvaGlow 2.4s ease-in-out infinite;
}
.pm-ava-dot {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #121016;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

/* Dialog list */
.pm-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pm-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  text-decoration: none;
  color: inherit;
  background: #161218;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.pm-item:active { transform: scale(0.99); background: #1c181f; }
.pm-item.unread {
  background: #1c1610;
  border-color: rgba(255, 140, 40, 0.28);
}
.pm-item-b { flex: 1; min-width: 0; }
.pm-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.pm-item-n-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}
.pm-item-n {
  font-weight: 750;
  font-size: 0.95rem;
  color: #fff5eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-item-t {
  font-size: 0.72rem;
  color: rgba(255, 200, 150, 0.45);
  flex-shrink: 0;
}
.pm-item-p {
  font-size: 0.82rem;
  color: rgba(255, 230, 210, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}
.pm-item.unread .pm-item-p {
  color: rgba(255, 240, 220, 0.88);
  font-weight: 500;
}
.pm-you { color: rgba(255, 180, 100, 0.65); }
.pm-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 99px;
  background: linear-gradient(135deg, #ff7a18, #e85a10);
  color: #1a0e08;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(255, 100, 20, 0.35);
}

.pm-empty-box {
  text-align: center;
  padding: 48px 20px;
  border-radius: 20px;
  background: #161218;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.pm-empty-ico {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 20px;
  background: #1c1610;
  border: 1px solid rgba(255, 140, 40, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffb060;
  font-size: 1.5rem;
}
.pm-empty-box p {
  margin: 0 0 6px;
  font-weight: 750;
  font-size: 1rem;
  color: #fff5eb;
}
.pm-empty-box span {
  display: block;
  font-size: 0.85rem;
  color: rgba(255, 210, 160, 0.45);
  margin-bottom: 16px;
  line-height: 1.4;
}
.pm-empty-box .btn { margin-top: 4px; }

/* ===== Chat view (fullscreen mobile) ===== */
body.pm-open {
  overflow: hidden !important;
}
body.pm-open .hdr,
body.pm-open .bnav,
body.pm-open .ftr {
  display: none !important;
}
body.pm-open .main {
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  min-height: 100dvh;
}
body.pm-open .page.pm-chat {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  background: #0c0a10;
  max-width: none;
  margin: 0;
  padding: 0;
}

.pm-chat-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  padding-top: max(10px, env(safe-area-inset-top, 0px));
  background: #141018;
  border-bottom: 1px solid rgba(255, 140, 40, 0.18);
  z-index: 5;
}
.pm-back {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffc080;
  text-decoration: none;
  background: rgba(255, 140, 40, 0.08);
  border: 1px solid rgba(255, 140, 40, 0.2);
  flex-shrink: 0;
}
.pm-back:active { background: rgba(255, 140, 40, 0.16); }
.pm-peer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.pm-peer .pm-ava { width: 42px; height: 42px; border-radius: 14px; font-size: 0.9rem; }
.pm-peer-meta { min-width: 0; flex: 1; }
.pm-peer-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.pm-peer-n {
  font-weight: 800;
  font-size: 0.98rem;
  color: #fff8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-peer-s {
  font-size: 0.72rem;
  color: rgba(255, 200, 150, 0.45);
  margin-top: 2px;
}
.pm-peer-s.online { color: #4ade80 !important; font-weight: 600; }

.pm-thread {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #0c0a10;
}
.pm-day {
  display: flex;
  justify-content: center;
  margin: 10px 0 6px;
}
.pm-day span {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 210, 160, 0.45);
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 12px;
  border-radius: 999px;
}

.pm-empty {
  margin: auto;
  text-align: center;
  padding: 32px 16px;
  color: rgba(255, 220, 180, 0.5);
}
.pm-empty .pm-empty-ico {
  margin-bottom: 12px;
}
.pm-empty p {
  margin: 0 0 4px;
  font-weight: 700;
  color: rgba(255, 240, 220, 0.85);
}
.pm-empty span { font-size: 0.8rem; }

.pm-bubble {
  max-width: min(82%, 420px);
  padding: 10px 12px 6px;
  border-radius: 18px;
  position: relative;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.pm-bubble.mine {
  align-self: flex-end;
  background: linear-gradient(160deg, #3a2410, #2a1a0c);
  border: 1px solid rgba(255, 140, 40, 0.28);
  border-bottom-right-radius: 6px;
  color: #fff5eb;
}
.pm-bubble.theirs {
  align-self: flex-start;
  background: #1a1620;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom-left-radius: 6px;
  color: #f0ebe6;
}
.pm-bubble-t {
  font-size: 0.94rem;
  line-height: 1.45;
  white-space: pre-wrap;
}
.pm-bubble-m {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 4px;
  font-size: 0.68rem;
  color: rgba(255, 200, 150, 0.4);
}
.pm-bubble.mine .pm-bubble-m { color: rgba(255, 200, 140, 0.5); }
.pm-bubble.mine .pm-bubble-m i { font-size: 0.65rem; }

.pm-media { margin: 0 0 6px; border-radius: 14px; overflow: hidden; }
.pm-media-i {
  display: block;
  max-width: 100%;
  max-height: 280px;
  width: 100%;
  object-fit: cover;
  border-radius: 14px;
}
.pm-media-v {
  display: block;
  width: 100%;
  max-height: 280px;
  border-radius: 14px;
  background: #000;
}

/* Composer */
.pm-composer {
  flex-shrink: 0;
  padding: 8px 10px;
  padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  background: #141018;
  border-top: 1px solid rgba(255, 140, 40, 0.16);
  z-index: 6;
}
.pm-composer-in {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 6px 6px 8px;
  border-radius: 22px;
  background: #1c1822;
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 48px;
}
.pm-attach-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 200, 150, 0.55);
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 50%;
  margin-bottom: 0;
  -webkit-tap-highlight-color: transparent;
}
.pm-attach-btn:active { color: #ffb060; background: rgba(255, 140, 40, 0.1); }
.pm-input {
  flex: 1;
  min-width: 0;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  color: #fff5eb !important;
  font-size: 16px !important; /* iOS zoom fix */
  line-height: 1.4;
  resize: none;
  max-height: 120px;
  min-height: 24px;
  padding: 10px 0;
  font-family: inherit;
  box-shadow: none !important;
}
.pm-input::placeholder { color: rgba(255, 210, 160, 0.35); }
.pm-send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #ff8a2a, #e85a10);
  color: #1a0e08;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 100, 20, 0.35);
  -webkit-tap-highlight-color: transparent;
}
.pm-send:active { transform: scale(0.94); }
.pm-send i { font-size: 0.95rem; margin-left: 2px; }

/* Attachment preview — ONLY when not [hidden] */
.pm-attach-preview[hidden],
#pm-attach-preview[hidden] {
  display: none !important;
}
.pm-attach-preview:not([hidden]) {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  margin: 0 0 8px;
  border-radius: 14px;
  background: rgba(255, 122, 24, 0.12);
  border: 1px solid rgba(255, 140, 40, 0.28);
  color: #ffc080;
  font-size: 0.8rem;
}
.pm-attach-preview-in {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}
.pm-attach-preview-in span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-attach-clear {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffb060;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.pm-attach-clear:active { background: rgba(255, 80, 80, 0.2); color: #ff8a8a; }

body.pm-open .flash,
body.pm-open .pm-flash {
  position: fixed;
  top: calc(56px + env(safe-area-inset-top, 0px));
  left: 12px;
  right: 12px;
  z-index: 25;
}

@media (min-width: 720px) {
  body.pm-open .page.pm-chat {
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 720px;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
  }
  body.pm-open .hdr { display: block !important; }
  body.pm-open .page.pm-chat {
    top: 60px;
  }
  body.pm-open .bnav,
  body.pm-open .ftr { display: none !important; }
}

@media (max-width: 380px) {
  .pm-role { font-size: 0.6rem; padding: 2px 6px; }
  .pm-bubble { max-width: 88%; }
  .pm-item { padding: 10px 12px; gap: 10px; }
  .pm-ava { width: 44px; height: 44px; }
}


/* News */
.news-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.news-head h1 { margin: 0; font-size: 1.3rem; }
.news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
@media (min-width: 600px) {
    .news-grid { grid-template-columns: 1fr 1fr; }
}
.news-card {
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s;
}
.news-card:active { transform: scale(0.99); }
.news-card-img {
    aspect-ratio: 16/10;
    background: #14151c;
    overflow: hidden;
}
.news-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.news-card-ph {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 32px;
    opacity: 0.4;
}
.news-card-b { padding: 12px 14px 14px; }
.news-card-t {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-card-m {
    font-size: 12px;
    color: var(--text-muted);
}
.news-full { padding: 0 0 18px; border-radius: 18px; overflow: hidden; }
.news-full-img {
    width: 100%;
    background: #0d0e12;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: none;
}
.news-full-img img {
    width: 100%;
    height: auto;
    max-height: min(80vh, 720px);
    object-fit: contain;
    display: block;
}
.news-full-title {
    margin: 14px 16px 8px;
    font-size: 1.35rem;
    line-height: 1.25;
}
.news-full-meta {
    margin: 0 16px 12px;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.news-full-body {
    margin: 0 16px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-secondary);
}
.news-form { padding: 16px; border-radius: 18px; display: flex; flex-direction: column; gap: 12px; }
.news-del { margin: 18px 16px 0; }


/* Sender meta for admins */
.sender-meta {
    margin: 8px 0 12px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(255,122,0,0.25);
    background: rgba(255,122,0,0.06);
}
.sender-meta-t {
    font-size: 12px;
    font-weight: 700;
    color: #ff9a3c;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sender-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.sender-meta-grid > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.sender-meta-grid span {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.sender-meta-grid b {
    font-size: 12px;
    font-weight: 600;
    word-break: break-word;
}
.sender-meta-wide { grid-column: 1 / -1; }
.sender-meta-grid b.ua {
    font-weight: 500;
    font-size: 11px;
    color: var(--text-secondary);
}
@media (max-width: 480px) {
    .sender-meta-grid { grid-template-columns: 1fr; }
}

.sender-selfie-img {
    display: block;
    margin-top: 6px;
    max-width: 180px;
    max-height: 180px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.12);
}

.sender-gal-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sender-gal-row .sender-selfie-img { max-width: 88px; max-height: 88px; }
.robot-check-ov {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.72);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.robot-check-box {
  background: #14151c;
  border: 1px solid rgba(255,122,0,0.35);
  border-radius: 18px;
  padding: 20px 18px;
  max-width: 360px;
  width: 100%;
  color: #eceff1;
  text-align: center;
}
.robot-check-box h3 { margin: 0 0 10px; font-size: 1.1rem; color: #ff9a3c; }
.robot-check-box p { margin: 0 0 16px; font-size: 14px; color: #88929e; line-height: 1.45; }
.robot-check-box .btn { width: 100%; margin-top: 8px; }

.sender-video-el {
  display: block;
  margin-top: 6px;
  width: 100%;
  max-width: 280px;
  max-height: 200px;
  border-radius: 12px;
  background: #000;
}

.news-card-sender {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.news-geo-tag, .news-geo, .news-sender {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.news-full-meta {
  flex-wrap: wrap;
  gap: 10px 14px;
}
.news-geo-tag i, .news-geo i {
  color: #ff9a3c;
  font-size: 11px;
}

.news-reacts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.news-react-form { margin: 0; }
.news-react-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  transition: 0.15s;
}
.news-react-btn:hover { border-color: rgba(255,122,0,0.4); }
.news-react-btn.active {
  background: rgba(255,122,0,0.15);
  border-color: rgba(255,122,0,0.5);
}
.news-react-emoji { font-size: 18px; line-height: 1; }
.news-react-cnt { font-weight: 600; font-size: 13px; color: var(--text-muted); }
.news-react-btn.active .news-react-cnt { color: #ff9a3c; }
.news-comments {
  margin: 8px 16px 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.news-comments-t {
  margin: 0 0 12px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.news-comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.news-comments-empty {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}
.news-comment-list { display: flex; flex-direction: column; gap: 10px; }
.news-comment-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.news-comment-h {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 13px;
}
.news-comment-h span { color: var(--text-muted); font-size: 12px; }
.news-comment-b {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.news-views { display: inline-flex; align-items: center; gap: 4px; }
.news-card-m {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

/* ===== Инструкции ===== */
.guides-page { display: flex; flex-direction: column; gap: 16px; max-width: 820px; margin: 0 auto; width: 100%; }
.guides-hero {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px;
  padding: 18px 18px; border-radius: 22px;
  background: linear-gradient(135deg, rgba(108,140,255,0.12), rgba(255,122,176,0.08));
  border: 1px solid rgba(108,140,255,0.22);
}
.guides-hero-badge {
  width: 48px; height: 48px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #6c8cff, #ff7ab0);
  color: #fff; font-size: 20px; flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(108,140,255,0.35);
}
.guides-hero-text { flex: 1; min-width: 180px; }
.guides-hero h1 { margin: 0 0 6px; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; }
.guides-hero p { margin: 0; color: var(--text-muted); font-size: 13.5px; line-height: 1.45; }
.guides-form { padding: 18px; border-radius: 20px; display: flex; flex-direction: column; gap: 12px; }
.guides-form h3 { margin: 0 0 4px; font-weight: 700; }
.guides-form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.guides-empty {
  text-align: center; padding: 36px 18px; border-radius: 20px; color: var(--text-muted);
}
.guides-empty i { font-size: 40px; opacity: 0.45; display: block; margin-bottom: 12px; }
.guides-list { display: flex; flex-direction: column; gap: 14px; }
.guide-card {
  padding: 0; border-radius: 20px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}
.guide-card-h {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start;
  gap: 10px; padding: 16px 16px 0;
}
.guide-card-title { display: flex; gap: 12px; align-items: flex-start; min-width: 0; flex: 1; }
.guide-num {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; letter-spacing: 0.02em;
  color: #fff; background: var(--g-accent, #6c8cff);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--g-accent, #6c8cff) 40%, transparent);
}
.guide-card-h h3 {
  margin: 0; font-size: 1.08rem; font-weight: 750; line-height: 1.35;
  letter-spacing: -0.015em; color: var(--text-primary);
}
.guide-date {
  font-size: 11px; color: var(--text-muted); white-space: nowrap;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.06);
}
.guide-yt {
  margin: 14px 16px 0; border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08); background: #000;
}
.guide-yt iframe { display: block; width: 100%; aspect-ratio: 16/9; border: 0; }
.guide-body {
  padding: 14px 16px 16px;
  font-size: 14.5px; line-height: 1.65;
  color: rgba(255,255,255,0.88);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.guide-body .gb-p { margin: 0 0 12px; }
.guide-body .gb-p:last-child { margin-bottom: 0; }
.guide-body .gb-sub {
  margin: 16px 0 8px; padding: 8px 12px;
  font-size: 13px; font-weight: 750; letter-spacing: 0.02em;
  color: var(--g-accent, #8eb0ff);
  background: color-mix(in srgb, var(--g-accent, #6c8cff) 12%, transparent);
  border-left: 3px solid var(--g-accent, #6c8cff);
  border-radius: 0 10px 10px 0;
}
.guide-body .gb-ul, .guide-body .gb-ol {
  margin: 0 0 14px; padding: 0 0 0 4px; list-style: none;
  display: flex; flex-direction: column; gap: 8px;
}
.guide-body .gb-ul li, .guide-body .gb-ol li {
  position: relative; padding: 10px 12px 10px 36px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
  line-height: 1.5;
}
.guide-body .gb-ul li::before {
  content: ""; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--g-accent, #6c8cff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--g-accent, #6c8cff) 22%, transparent);
}
.guide-body .gb-ol { counter-reset: gb; }
.guide-body .gb-ol li { counter-increment: gb; }
.guide-body .gb-ol li::before {
  content: counter(gb);
  position: absolute; left: 10px; top: 10px;
  width: 22px; height: 22px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  color: #fff; background: var(--g-accent, #6c8cff);
}
.guide-body .gb-code, .guide-body .gb-cmd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em; padding: 2px 7px; border-radius: 6px;
  background: rgba(108,140,255,0.16); color: #b8c9ff;
  border: 1px solid rgba(108,140,255,0.25);
  white-space: nowrap;
}
.guide-body .gb-cmd { color: #ffc48a; background: rgba(255,154,60,0.14); border-color: rgba(255,154,60,0.28); }
.guide-body strong { color: #fff; font-weight: 700; }
.guide-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 16px; margin-top: 0; }
@media (max-width: 560px) {
  .guides-hero { padding: 14px; border-radius: 18px; }
  .guides-hero h1 { font-size: 1.15rem; }
  .guide-card-h h3 { font-size: 1rem; }
  .guide-body { font-size: 14px; padding: 12px 14px 14px; }
  .guide-num { width: 32px; height: 32px; font-size: 12px; border-radius: 10px; }
  .guide-body .gb-ul li, .guide-body .gb-ol li { padding: 9px 10px 9px 34px; }
}
.btn.sm { padding: 6px 12px; font-size: 13px; }

/* Кнопка ответы */
.btn-answers {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 10px; border: 1px solid rgba(255,140,40,0.35);
  background: rgba(255,122,0,0.12); color: #ffb86b; font-size: 12px; cursor: pointer;
}
.btn-answers:active { transform: scale(0.98); }

/* Модалка ответов */
.ans-modal {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: flex-end; justify-content: center;
}
.ans-modal[hidden] { display: none !important; }
.ans-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.72); }
.ans-modal-box {
  position: relative; z-index: 1; width: 100%; max-width: 480px;
  max-height: 92vh; overflow: auto;
  border-radius: 20px 20px 0 0; padding: 16px;
}
@media (min-width: 600px) {
  .ans-modal { align-items: center; }
  .ans-modal-box { border-radius: 20px; max-height: 88vh; }
}
.ans-modal-h {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.ans-modal-h h3 { margin: 0; font-size: 1.05rem; }
.ans-modal-x {
  border: 0; background: transparent; color: var(--text-muted); font-size: 18px; cursor: pointer;
}
.ans-modal-hint { font-size: 13px; color: var(--text-muted); margin: 0 0 10px; line-height: 1.4; }
.ans-orig {
  font-size: 13px; padding: 10px 12px; border-radius: 12px;
  background: rgba(255,255,255,0.04); margin-bottom: 12px;
  max-height: 80px; overflow: auto; color: var(--text-secondary);
}
.ans-fields { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.ans-preview-wrap {
  width: 100%; max-width: 220px; margin: 0 auto 12px;
  border-radius: 12px; overflow: hidden; background: #111;
  border: 1px solid rgba(255,255,255,0.08);
}
.ans-preview-wrap canvas { display: block; width: 100%; height: auto; }
.ans-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Помощник */
.helper-page { display: flex; flex-direction: column; gap: 14px; }
.helper-hero {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 12px; padding: 16px; border-radius: 18px;
}
.helper-hero h1 { margin: 0 0 4px; font-size: 1.25rem; }
.helper-hero p { margin: 0; color: var(--text-muted); font-size: 13px; }
.helper-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
@media (min-width: 700px) { .helper-grid { grid-template-columns: repeat(4, 1fr); } }
.helper-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 12px; border-radius: 18px; border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03); color: inherit; cursor: pointer;
  text-align: center; transition: 0.15s;
}
.helper-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.helper-btn:not(:disabled):active { transform: scale(0.98); }
.helper-btn-ico {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--c) 18%, transparent);
  color: var(--c); font-size: 22px;
}
.helper-btn-t { font-weight: 700; font-size: 15px; }
.helper-btn-s { font-size: 11px; color: var(--text-muted); }
.helper-note { font-size: 13px; color: var(--text-muted); line-height: 1.45; margin: 0; }
.helper-edit-list { display: flex; flex-direction: column; gap: 12px; }
.helper-edit-card { padding: 14px; border-radius: 16px; display: flex; flex-direction: column; gap: 10px; }
.helper-edit-h { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.helper-thumb img { width: 100%; max-width: 180px; border-radius: 12px; display: block; }
.helper-miss { margin: 0; font-size: 13px; color: var(--text-muted); }
.helper-modal {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: flex-end; justify-content: center;
}
.helper-modal[hidden] { display: none !important; }
.helper-modal-bd { position: absolute; inset: 0; background: rgba(0,0,0,0.75); }
.helper-modal-box {
  position: relative; z-index: 1; width: 100%; max-width: 420px;
  max-height: 92vh; overflow: auto; padding: 14px;
  border-radius: 20px 20px 0 0;
}
@media (min-width: 600px) {
  .helper-modal { align-items: center; }
  .helper-modal-box { border-radius: 20px; }
}
.helper-modal-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.helper-modal-h h3 { margin: 0; }
.helper-modal-x { border: 0; background: none; color: var(--text-muted); font-size: 18px; cursor: pointer; }
.helper-preview {
  width: 100%; max-width: 220px; margin: 0 auto 12px;
  border-radius: 12px; overflow: hidden; background: #111;
}
.helper-preview canvas { display: block; width: 100%; height: auto; }
.helper-link-line {
  font-size: 12px; color: var(--text-muted); word-break: break-all;
  margin: 0 0 10px; padding: 8px 10px; border-radius: 10px;
  background: rgba(255,255,255,0.04);
}
.helper-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.social-wa { background: rgba(37, 211, 102, 0.12) !important; border-color: rgba(37, 211, 102, 0.35) !important; }
.social-wa i { color: #25D366; }

.social-tt { background: rgba(255, 0, 80, 0.12) !important; border-color: rgba(255, 0, 80, 0.35) !important; }
.social-tt i { color: #ff0050; }

.stats-page { display: flex; flex-direction: column; gap: 14px; }
.stats-hero { padding: 16px 18px; border-radius: 18px; }
.stats-hero h1 { margin: 0 0 4px; font-size: 1.25rem; }
.stats-hero p { margin: 0; color: var(--text-muted); font-size: 13px; }
.stats-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
@media (min-width: 700px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }
.stats-card {
  padding: 14px; border-radius: 16px; text-align: center;
}
.stats-card-ico { color: #ff9a3c; font-size: 18px; margin-bottom: 6px; }
.stats-card-n { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.stats-card-l { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.stats-block { padding: 14px 16px; border-radius: 18px; }
.stats-block h2 { margin: 0 0 12px; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.stats-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 14px;
}
.stats-row:last-child { border-bottom: 0; }
.stats-admin-badge {
  font-size: 13px; color: #ffb86b; display: flex; align-items: center; gap: 8px;
  padding: 4px 2px;
}
.stats-top { display: flex; flex-direction: column; gap: 8px; }
.stats-top-i {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,0.03);
}
.stats-top-n {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,154,60,0.15); color: #ffb86b; font-size: 12px; font-weight: 700;
}
.stats-top-name { flex: 1; font-weight: 600; font-size: 14px; }
.stats-top-name small { display: block; font-weight: 400; color: var(--text-muted); font-size: 11px; }
.stats-empty { margin: 0; color: var(--text-muted); font-size: 13px; }
.stats-seen { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.stats-online {
  width: 8px; height: 8px; border-radius: 50%; background: #555;
}
.stats-online.on { background: #3ddc84; box-shadow: 0 0 8px rgba(61,220,132,0.6); }

.pub-badge {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; padding: 8px 12px;
  border-radius: 12px;
  background: rgba(61, 220, 132, 0.1);
  border: 1px solid rgba(61, 220, 132, 0.28);
  color: #9aefc0;
  font-size: 12px; line-height: 1.35;
}
.pub-badge i { color: #3ddc84; flex-shrink: 0; }
.pub-badge-empty { display: none; }

.helper-sec-t { font-size: 16px; font-weight: 700; margin: 8px 0 12px; color: var(--text-primary); }
.pb-form { display: flex; flex-direction: column; gap: 10px; }
.pb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .pb-row { grid-template-columns: 1fr; } }
.pb-form .field span { display:block; font-size:12px; color:var(--text-muted); margin-bottom:4px; }
.pb-form input[type=text], .pb-form input[type=file] {
  width: 100%; border-radius: 12px; border: 1px solid var(--border-glass);
  background: rgba(0,0,0,0.25); color: var(--text-primary); padding: 10px 12px; font-size: 14px;
}

/* ===== Фотобатл вкладка ===== */
.pb-page { display:flex; flex-direction:column; gap:14px; max-width:720px; margin:0 auto; width:100%; }
.pb-hero { display:flex; gap:14px; align-items:center; padding:16px; border-radius:20px;
  background:linear-gradient(135deg,rgba(255,77,141,.12),rgba(108,140,255,.1)); }
.pb-hero-ico { width:48px;height:48px;border-radius:16px;display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,#ff4d8d,#c44dff);color:#fff;font-size:20px;flex-shrink:0; }
.pb-hero h1 { margin:0 0 4px; font-size:1.25rem; font-weight:800; }
.pb-hero p { margin:0; color:var(--text-muted); font-size:13px; line-height:1.4; }
.pb-submit { padding:16px; border-radius:20px; display:flex; flex-direction:column; gap:12px; }
.pb-upload { display:block; cursor:pointer; }
.pb-upload input { display:none; }
.pb-upload-ui {
  border:2px dashed rgba(255,77,141,.4); border-radius:16px; padding:22px 14px; text-align:center;
  background:rgba(255,77,141,.06); transition:.15s;
}
.pb-upload-ui i { font-size:28px; color:#ff7ab0; display:block; margin-bottom:8px; }
.pb-upload-ui span { font-weight:700; display:block; }
.pb-upload-ui small { color:var(--text-muted); font-size:12px; }
.pb-sec-t { font-size:16px; font-weight:750; margin:8px 0; }
.pb-hint { font-size:13px; color:var(--text-muted); margin:0 0 10px; }
.pb-bg-form { padding:12px; border-radius:16px; margin-bottom:12px; }
.pb-bg-row { display:flex; flex-wrap:wrap; gap:10px; align-items:flex-end; }
.pb-bg-thumb { width:56px; height:100px; object-fit:cover; border-radius:10px; border:1px solid rgba(255,255,255,.1); }
.pb-pick-bar { display:flex; justify-content:space-between; align-items:center; padding:10px 14px; border-radius:14px; margin-bottom:10px; }
.pb-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
@media (min-width:560px){ .pb-grid { grid-template-columns:repeat(3,1fr); } }
.pb-card { position:relative; border-radius:16px; overflow:hidden; padding:0; cursor:pointer; }
.pb-card input.pb-pick { position:absolute; top:8px; left:8px; z-index:2; width:20px; height:20px; }
.pb-card img { width:100%; aspect-ratio:3/4; object-fit:cover; display:block; }
.pb-card-meta { padding:8px 10px 10px; display:flex; flex-direction:column; gap:2px; }
.pb-card-meta b { font-size:13px; }
.pb-card-meta span { font-size:12px; color:var(--text-muted); }
.pb-card-meta small { font-size:10px; color:var(--text-muted); }
.pb-card:has(input:checked) { outline:2px solid #ff4d8d; box-shadow:0 0 0 4px rgba(255,77,141,.2); }
.pb-del { position:absolute; top:6px; right:6px; z-index:2; }
.pb-del button { border:0; background:rgba(0,0,0,.55); color:#fff; width:32px; height:32px; border-radius:10px; cursor:pointer; }

.hist-pager {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center;
  padding: 14px 8px 24px;
}
.hist-pager-info { font-size: 13px; color: var(--text-muted); }

/* ===== Живой фон + анимации 2026 ===== */
body {
  background-color: #07080d !important;
  background-image:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(108,140,255,0.18), transparent 50%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(255,122,176,0.14), transparent 45%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(255,122,0,0.10), transparent 50%),
    radial-gradient(circle at 20% 80%, rgba(61,220,132,0.06), transparent 40%) !important;
  background-attachment: fixed;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 30% 40%, rgba(108,140,255,0.08), transparent 25%),
    radial-gradient(circle at 70% 60%, rgba(255,77,141,0.07), transparent 28%);
  animation: bgFloat 18s ease-in-out infinite alternate;
}
@keyframes bgFloat {
  0% { transform: translate3d(0,0,0) scale(1); opacity: 0.85; }
  100% { transform: translate3d(-2%, 2%, 0) scale(1.05); opacity: 1; }
}
.main, .hdr, .bnav, .ftr { position: relative; z-index: 1; }
.card, .glass, .stats-card, .helper-btn, .guide-card {
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover, .stats-card:hover, .helper-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
}
.card i {
  display: inline-flex !important;
  width: 44px; height: 44px; align-items: center; justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(108,140,255,0.2), rgba(255,122,176,0.15));
  color: #ffb86b !important;
  font-size: 20px !important;
  margin-bottom: 10px;
}

/* ПК: меню не уезжает — перенос в 2 ряда */
@media (min-width: 900px) {
  body { padding-bottom: 0 !important; }
  .bnav {
    position: sticky !important;
    top: 60px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    height: auto !important;
    min-height: 52px !important;
    max-height: none !important;
    flex-wrap: wrap !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 6px 4px !important;
    padding: 8px 16px !important;
    overflow: visible !important;
    border-top: none !important;
    border-bottom: 1px solid var(--border-glass) !important;
    background: rgba(10, 11, 16, 0.92) !important;
    backdrop-filter: blur(12px);
  }
  .bnav-i {
    flex: 0 0 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    width: auto !important;
    height: 40px !important;
    flex-direction: row !important;
    gap: 7px !important;
    padding: 0 12px !important;
    font-size: 13px !important;
    border-radius: 10px;
  }
  .bnav-i i { font-size: 15px !important; }
  .bnav-i span {
    font-size: 12.5px !important;
    max-width: none !important;
    overflow: visible !important;
    white-space: nowrap !important;
    text-transform: none !important;
  }
  .bnav:has(.bnav-i:nth-child(6)) .bnav-i {
    flex: 0 0 auto !important;
    min-width: auto !important;
    max-width: none !important;
  }
  .bnav-i.active {
    background: rgba(255,122,0,0.12);
    color: var(--accent);
  }
}

/* средний экран: горизонтальный скролл аккуратный */
@media (min-width: 701px) and (max-width: 899px) {
  .bnav {
    justify-content: flex-start !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    padding: 0 8px !important;
  }
  .bnav-i { flex: 0 0 auto !important; }
}




/* Профиль: настройки админа */
.prof-settings { padding: 18px 16px 20px; }
.prof-set-block {
  margin-bottom: 18px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.prof-set-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff6ec;
  margin-bottom: 8px;
}
.prof-set-title i { color: #ff9a3c; }
.prof-set-desc {
  margin: 0 0 14px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: rgba(255,240,220,0.55);
}
.prof-set-desc b { color: rgba(255,200,140,0.9); font-weight: 600; }
.prof-set-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.prof-set-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
  color: rgba(255,255,255,0.7);
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.prof-set-opt input { position: absolute; opacity: 0; pointer-events: none; }
.prof-set-opt.on {
  border-color: rgba(255,140,40,0.55);
  background: rgba(255,122,24,0.16);
  color: #ffd9b0;
  box-shadow: 0 0 0 1px rgba(255,122,24,0.2);
}

.helper-hide-tag { color: #ffb070; font-weight: 600; font-size: 0.9em; }

/* ===== Notifications ===== */
.notify-wrap {
    position: relative;
    margin-right: 4px;
    z-index: 400;
}
.notify-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    font-size: 1rem;
}
.notify-btn:hover {
    color: var(--text-primary);
    border-color: rgba(255,140,40,0.35);
}
.notify-btn:active { transform: scale(0.96); }
.notify-btn[aria-expanded="true"] {
    color: #ffb060;
    border-color: rgba(255,140,40,0.45);
}
.notify-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 99px;
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.notify-dot.show { display: flex; }

.notify-panel,
#notify-panel {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;
    width: min(92vw, 340px) !important;
    max-height: min(70dvh, 420px) !important;
    border-radius: 16px !important;
    z-index: 5000 !important;
    display: none;
    flex-direction: column;
    overflow: hidden;
    background: #141218 !important;
    background-color: #141218 !important;
    background-image: none !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    opacity: 1 !important;
    color: #eceff1 !important;
}
.notify-panel.open:not([hidden]),
#notify-panel.open:not([hidden]) {
    display: flex !important;
}
#notify-panel[hidden],
.notify-panel[hidden] {
    display: none !important;
}
.notify-panel-h {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    font-weight: 700;
    font-size: 14px;
    background: #1a1820 !important;
    background-color: #1a1820 !important;
    color: #f0f2f5 !important;
    flex-shrink: 0;
}
.notify-panel-h a {
    color: #ff9a3c !important;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.notify-list {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    background: #141218 !important;
    background-color: #141218 !important;
    min-height: 60px;
}
.notify-empty {
    padding: 28px 16px;
    text-align: center;
    color: rgba(255, 255, 255, 0.45) !important;
    font-size: 13px;
    background: #141218 !important;
}
.notify-item {
    display: flex !important;
    gap: 10px;
    padding: 12px 14px !important;
    text-decoration: none !important;
    color: inherit !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    background: #141218 !important;
    background-color: #141218 !important;
}
.notify-item:last-child { border-bottom: none !important; }
.notify-item.unread {
    background: #1c1814 !important;
    background-color: #1c1814 !important;
}
.notify-item:hover,
.notify-item:active {
    background: #1a1820 !important;
}
.notify-item-b { flex: 1; min-width: 0; }
.notify-item-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 3px;
    font-size: 13px;
}
.notify-item-top strong {
    font-weight: 700;
    color: #f5f0ea !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notify-item-top span {
    color: rgba(255, 255, 255, 0.4) !important;
    font-size: 11px;
    flex-shrink: 0;
}
.notify-item-p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notify-item.unread .notify-item-p {
    color: rgba(255, 255, 255, 0.75) !important;
}
.notify-item .prof-ava.sm {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
    overflow: hidden;
    background: #1c1822;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #ffc080;
}
.notify-item .prof-ava.sm img,
.notify-item .prof-ava.sm .ava-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Notify v60 */
.notify-wrap { position: relative; margin-right: 4px; z-index: 600; }
.notify-btn {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: #88929e;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative; z-index: 601;
  pointer-events: auto !important;
  -webkit-tap-highlight-color: transparent;
}
.notify-btn:active { transform: scale(0.96); }
.notify-dot {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; background: #e74c3c; color: #fff;
  font-size: 10px; font-weight: 800;
  display: none; align-items: center; justify-content: center;
  pointer-events: none;
}
.notify-dot.show { display: flex !important; }


/* akkol-hdr-mobile-fix */
.hdr-in { overflow: visible; min-width: 0; }
.usr { flex-shrink: 1; min-width: 0; }
.usr > a[href*="logout"],
.hdr-logout {
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}
@media (max-width: 640px) {
  .hdr-in { padding: 0 10px; gap: 6px; }
  .usr-meta { display: none !important; }
  .logo-s { display: none; }
}


/* онлайн-статус в списке участников */
.u-online {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted, #9aa);
  line-height: 1.2;
}
.u-online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #666;
  flex-shrink: 0;
}
.u-online.is-on {
  color: #3ddc84;
  font-weight: 600;
}
.u-online.is-on .u-online-dot {
  background: #3ddc84;
  box-shadow: 0 0 8px rgba(61, 220, 132, 0.55);
}
.u-online-txt {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}


/* ===== Mobile: anon form + stories (tap-safe) ===== */
.anon-file-input {
  position: fixed !important;
  left: -9999px !important;
  top: 0 !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip: rect(0,0,0,0) !important;
}
.robot-check-ov {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483000 !important;
  background: rgba(0,0,0,0.78) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  pointer-events: auto !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.robot-check-box {
  background: #14151c !important;
  border: 1px solid rgba(255,122,0,0.4) !important;
  border-radius: 16px !important;
  padding: 20px 16px !important;
  max-width: 360px !important;
  width: 100% !important;
  text-align: center !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 2 !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.robot-check-box .btn,
#robot-ok {
  width: 100% !important;
  min-height: 48px !important;
  font-size: 16px !important;
  pointer-events: auto !important;
  touch-action: manipulation !important;
  cursor: pointer !important;
  -webkit-appearance: none !important;
}
@media (hover: none), (max-width: 900px) {
  .page.anon .glass,
  .page.anon .aform,
  .mcard.glass {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    transform: none !important;
  }
  .page.anon #atea,
  .page.anon textarea {
    font-size: 16px !important;
    pointer-events: auto !important;
    touch-action: manipulation;
    -webkit-user-select: text !important;
    user-select: text !important;
    position: relative;
    z-index: 5;
  }
  .page.anon #btn-send,
  .page.anon #btn-clear,
  .page.anon .btn-attach,
  .page.anon .aact-buttons .btn {
    min-height: 48px !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    position: relative;
    z-index: 5;
  }
  .page.anon .aform {
    position: relative;
    z-index: 4;
  }
  button.btn-story,
  [data-story] {
    min-height: 40px !important;
    padding: 8px 12px !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    position: relative !important;
    z-index: 8 !important;
  }
  .mh {
    overflow: visible !important;
    position: relative;
    z-index: 6;
  }
}


/* v72: interactive surfaces must receive taps on mobile */
.page.anon .aform,
.page.anon .aform.glass,
.page.history .mcard,
.page.history .mcard.glass {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  transform: none !important;
  filter: none !important;
}
.page.anon #atea,
.page.anon textarea[name="body"] {
  font-size: 16px !important;
  pointer-events: auto !important;
  touch-action: manipulation !important;
  -webkit-user-select: text !important;
  user-select: text !important;
  position: relative !important;
  z-index: 20 !important;
  background: rgba(0,0,0,0.45) !important;
}
.page.anon .aform {
  position: relative !important;
  z-index: 10 !important;
}
.page.anon #btn-send,
.page.anon #btn-clear,
.page.anon .btn-attach {
  position: relative !important;
  z-index: 20 !important;
  pointer-events: auto !important;
  touch-action: manipulation !important;
  min-height: 48px !important;
}
.page.history button.btn-story,
.page.history [data-story] {
  position: relative !important;
  z-index: 20 !important;
  pointer-events: auto !important;
  touch-action: manipulation !important;
  min-height: 40px !important;
  cursor: pointer !important;
}
/* stuck overlays must never block */
.aa-welcome:not(.is-on) {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}
#notify-backdrop-akkol:not(.is-on),
#notify-panel-akkol:not(.is-on) {
  display: none !important;
  pointer-events: none !important;
}
