/* ==========================================================================
   app.css — стили основной страницы (SPA)
   Base: design-system.css
   ========================================================================== */

/* ==========================================================================
   HEADER
   ========================================================================== */

.app-header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

@supports not ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
    .app-header {
        background: rgba(10, 10, 10, 0.99);
    }
}

.app-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-5);
    height: 60px;
    display: flex;
    align-items: center;
    gap: var(--space-5);
}

.app-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
    color: var(--text-primary);
    flex-shrink: 0;
    transition: opacity var(--trans-fast);
    user-select: none;
}
.app-logo:hover { opacity: 0.85; color: var(--text-primary); }

.app-logo img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px;
    background: var(--bg-deep);
    -webkit-user-drag: none;
}

.app-logo-text {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--accent);
    text-transform: uppercase;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    flex: 1;
    overflow: visible;
    user-select: none;
}

.nav-group {
    position: relative;
}

.nav-trigger {
    background: transparent;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 8px 14px;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    transition: all var(--trans-fast);
}

.nav-trigger:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-trigger .nav-arrow {
    font-size: 16px;
    transition: transform var(--trans-fast);
}

.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-2);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all var(--trans-fast);
    z-index: var(--z-dropdown);
    margin-top: 4px;
}

@media (hover: hover) {
    .nav-group:hover .nav-trigger {
        color: var(--text-primary);
        background: var(--bg-hover);
    }
    .nav-group:hover .nav-trigger .nav-arrow {
        transform: rotate(180deg);
    }
    .nav-group:hover .nav-dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

.nav-dropdown a {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 8px 12px;
    color: var(--text-secondary);
    font-size: 14px;
    border-radius: var(--radius-sm);
    transition: all var(--trans-fast);
    text-decoration: none;
    white-space: nowrap;
}

.nav-dropdown a:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.nav-dropdown a .material-icons {
    font-size: 18px;
    color: var(--text-muted);
}

.nav-dropdown a:hover .material-icons {
    color: var(--accent);
}

.app-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-left: auto;
    flex-shrink: 0;
}

.app-header-right .btn-icon {
    color: var(--text-secondary);
    border: 1px solid var(--border);
    background: transparent;
}
.app-header-right .btn-icon:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-dim);
}

.app-mobile-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-base);
    overflow-y: auto;
    z-index: var(--z-modal);
    padding: var(--space-4);
    flex-direction: column;
}

.mobile-menu.open {
    display: flex;
}

.mobile-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: all var(--trans-fast);
    user-select: none;
}

.mobile-link:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.mobile-link .material-icons {
    color: var(--text-muted);
}

.mobile-link:hover .material-icons {
    color: var(--accent);
}

.mobile-group-title {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: var(--space-4) var(--space-4) var(--space-2);
    margin-top: var(--space-2);
    user-select: none;
}

.app-main {
    min-height: calc(100vh - 60px);
    padding: var(--space-6) 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-5);
}

@media (max-width: 1024px) {
    .app-nav { display: none; }
    .app-mobile-toggle { display: block; }

    .app-header-inner {
        padding: 0 var(--space-4);
        gap: var(--space-3);
    }

    .app-logo-text { display: none; }

    .app-logo img { width: 32px; height: 32px; }
}

@media (max-width: 600px) {
    .app-header-inner { height: 54px; }
    .mobile-menu { top: 54px; }
    .app-main { min-height: calc(100vh - 54px); }
}

/* ==========================================================================
   PAGE TRANSITIONS
   ========================================================================== */

.page { display: none; }

.page.active {
    display: block;
    animation: pageEnter 0.28s ease backwards;
}

.page.page-leaving {
    display: block;
    animation: pageLeave 0.14s ease forwards;
    pointer-events: none;
}

@keyframes pageEnter {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pageLeave {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-6px); }
}

/* ==========================================================================
   HERO (ИСПРАВЛЕНО ВЫДЕЛЕНИЕ И DRAG)
   ========================================================================== */

.hero {
    position: relative;
    min-height: 420px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-6);
    background:
        radial-gradient(circle at 20% 50%, rgba(255,102,0,0.12) 0%, transparent 60%),
        linear-gradient(135deg, #0a0a0a 0%, #1a0a00 50%, #0a0a0a 100%);
    display: flex;
    align-items: center;
    padding: var(--space-12) var(--space-10);
    border: 1px solid var(--border);
    isolation: isolate;
    user-select: none; /* Запрет выделения фона */
}

.hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.55;
    z-index: 0;
    filter: saturate(0.9) contrast(1.05);
    pointer-events: none; /* Картинка не перехватывает клики */
    -webkit-user-drag: none; /* Запрет перетаскивания картинки */
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg,
                        rgba(10,10,10,0.92) 0%,
                        rgba(10,10,10,0.72) 45%,
                        rgba(10,10,10,0.35) 100%),
        linear-gradient(180deg,
                        rgba(10,10,10,0.5) 0%,
                        transparent 30%,
                        transparent 70%,
                        rgba(10,10,10,0.7) 100%);
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 680px;
    animation: heroSlide 0.9s cubic-bezier(0.22, 1, 0.36, 1) backwards;
    user-select: text; /* Разрешаем выделение текста */
}

@keyframes heroSlide {
    from { opacity: 0; transform: translateY(24px); filter: blur(6px); }
    to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}

.hero-title {
    font-size: 64px;
    color: #fff;
    letter-spacing: 8px;
    margin: 0 0 var(--space-4);
    text-shadow:
        0 0 40px var(--accent-glow),
        0 4px 24px rgba(0,0,0,0.6);
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.05;
    animation: heroTitle 1.1s cubic-bezier(0.22, 1, 0.36, 1) backwards;
    animation-delay: 0.1s;
    cursor: default;
}

@keyframes heroTitle {
    from { opacity: 0; transform: translateX(-24px); letter-spacing: 16px; }
    to   { opacity: 1; transform: translateX(0);     letter-spacing: 8px; }
}

.hero-subtitle {
    font-size: 16px;
    color: var(--text-primary);
    margin: 0 0 var(--space-6);
    letter-spacing: 1px;
    opacity: 0.92;
    text-shadow: 0 2px 12px rgba(0,0,0,0.7);
    max-width: 560px;
    animation: heroSlide 0.9s cubic-bezier(0.22, 1, 0.36, 1) backwards;
    animation-delay: 0.25s;
    cursor: text;
}

.hero-actions {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    animation: heroSlide 0.9s cubic-bezier(0.22, 1, 0.36, 1) backwards;
    animation-delay: 0.4s;
    user-select: none; /* Кнопки не выделяются */
}

@media (max-width: 768px) {
    .hero {
        padding: var(--space-6) var(--space-4);
        min-height: 300px;
    }
    .hero-title    { font-size: 38px; letter-spacing: 4px; }
    .hero-subtitle { font-size: 13px; }
    .hero-img      { opacity: 0.45; }
}

/* ==========================================================================
   DASHBOARD / WIDGETS
   ========================================================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.widget {
    position: relative;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    height: 300px; /* Фиксированная высота */
    overflow: hidden;
}

.widget::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 30%, transparent 100%);
    opacity: 0.5;
    transition: opacity var(--trans-fast);
}
.widget:hover {
    border-color: var(--border-accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}
.widget:hover::before { opacity: 1; }

.widget-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-4) var(--space-2);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.widget-header .material-icons {
    color: var(--accent);
    font-size: 22px;
    filter: drop-shadow(0 0 6px var(--accent-glow));
}
.widget-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.widget-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    overflow-y: auto; /* ОБЯЗАТЕЛЬНО: включает скролл контента */
    padding: var(--space-3) var(--space-4);
}

/* Стилизация скроллбара */
.widget-body::-webkit-scrollbar { width: 4px; }
.widget-body::-webkit-scrollbar-track { background: transparent; }
.widget-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }
.widget-body:hover::-webkit-scrollbar-thumb { background: var(--accent); }

.widget-chat-footer {
    margin-top: auto;
    flex-shrink: 0;
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
    background: var(--bg-elevated); /* ОБЯЗАТЕЛЬНО: перекрывает контент, который проезжает под ним */
    z-index: 2; /* Чтобы быть поверх контента */
}

.widget-chat-footer .btn { width: 100%; }

.widget-event-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 3px;
    font-family: var(--font-heading);
    letter-spacing: 0.3px;
    line-height: 1.3;
}
.widget-event-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: var(--space-2);
    line-height: 1.35;
}
.widget-event-meta .material-icons {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.widget-event-rsvp {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: var(--space-1);
    margin-bottom: var(--space-2);
}
.widget-event-rsvp .badge {
    font-size: 9px;
    padding: 1px 6px;
    letter-spacing: 0.3px;
}

.about-block {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-6);
    overflow: hidden;
}

.about-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}
.about-title .material-icons {
    color: var(--accent);
    font-size: 20px;
    filter: drop-shadow(0 0 6px var(--accent-glow));
}

.about-content {
    padding: var(--space-5);
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
}
.about-content p:last-child { margin-bottom: 0; }

@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   ACTIVE NAV STATE
   ========================================================================== */

.nav-trigger.group-active {
    color: var(--accent);
    background: var(--accent-dim);
}

@media (hover: hover) {
    .nav-group:hover .nav-trigger.group-active,
    .nav-trigger.group-active:hover {
        color: var(--accent);
        background: var(--accent-dim);
    }
}

.nav-trigger.group-active .nav-arrow {
    color: var(--accent);
}

.nav-dropdown a.active {
    color: var(--accent);
    background: var(--accent-dim);
}
.nav-dropdown a.active .material-icons {
    color: var(--accent);
}

/* ==========================================================================
   OPS CARDS
   ========================================================================== */

.op-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-5);
}

.op-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--trans-normal);
    display: flex;
    flex-direction: column;
}

.op-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
}

.op-photo {
    position: relative;
    aspect-ratio: 1 / 1;
    background:
        radial-gradient(circle at 50% 60%, rgba(255,102,0,0.10) 0%, transparent 70%),
        var(--bg-deep);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.op-photo img,
.op-photo .img-wrap,
.op-photo .img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.op-photo .img-wrap { position: absolute; inset: 0; }

.op-photo .material-icons {
    font-size: 88px;
    color: var(--text-disabled);
}

.op-info {
    padding: var(--space-4) var(--space-5) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    flex: 1;
}

.op-name {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    letter-spacing: 1px;
    line-height: 1.2;
}

.op-role {
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-family: var(--font-heading);
}

.op-spec {
    display: inline-block;
    align-self: flex-start;
    padding: 2px 10px;
    background: var(--accent-dim);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
}

.op-desc {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.55;
    margin: var(--space-1) 0 0;
}

@media (max-width: 600px) {
    .op-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: var(--space-3);
    }
    .op-info { padding: var(--space-3); }
    .op-name { font-size: 16px; }
    .op-desc { font-size: 13px; }
    .op-photo .material-icons { font-size: 64px; }
}

/* ==========================================================================
   PAGE HEADER
   ========================================================================== */

.page-header {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border);
}

.page-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.page-title::before {
    content: '';
    width: 4px;
    height: 26px;
    background: var(--accent);
    display: inline-block;
    box-shadow: 0 0 12px var(--accent-glow);
}

/* ==========================================================================
   SC (сценарии)
   ========================================================================== */

.sc-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.sc-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--trans-fast);
}
.sc-card:hover,
.sc-card.open { border-color: var(--border-accent); }

.sc-head {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    width: 100%;
    padding: var(--space-5);
    background: transparent;
    border: none;
    color: inherit;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    transition: background var(--trans-fast);
    user-select: none;
}
.sc-head:hover { background: var(--bg-hover); }

.sc-head-left { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }

.sc-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    letter-spacing: 0.5px;
    line-height: 1.25;
}

.sc-preview {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sc-arrow {
    color: var(--text-muted);
    font-size: 24px;
    flex-shrink: 0;
    transition: transform var(--trans-fast);
}
.sc-card.open .sc-arrow { color: var(--accent); }

.sc-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--trans-slow);
    border-top: 1px solid transparent;
}
.sc-card.open .sc-body {
    max-height: 20000px;
    border-top-color: var(--border);
}

@supports (interpolate-size: allow-keywords) {
    .sc-body {
        max-height: none;
        height: 0;
        transition: height var(--trans-slow);
    }
    .sc-card.open .sc-body { height: auto; }
}

.sc-body-inner {
    padding: var(--space-4) var(--space-5) var(--space-5);
}

.sc-desc {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.65;
    margin: var(--space-4) 0;
}

.sc-video {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: var(--space-4) 0;
    border: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #000;
    box-shadow: 0 0 20px var(--accent-glow);
}
.sc-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.sc-section { margin-top: var(--space-5); }

.sc-section-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border);
}
.sc-section-title .material-icons { font-size: 18px; }

.sc-phases { display: flex; flex-direction: column; gap: var(--space-2); }

.sc-phase {
    background: var(--bg-deep);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: background var(--trans-fast);
}

.sc-phase-head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: transparent;
    border: none;
    color: inherit;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background var(--trans-fast);
    user-select: none;
}
.sc-phase-head:hover { background: var(--bg-hover); }

.sc-phase-num {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    min-width: 32px;
    opacity: 0.75;
    flex-shrink: 0;
}

.sc-phase-name {
    flex: 1;
    font-weight: 700;
    color: #fff;
    font-size: 15px;
    min-width: 0;
    line-height: 1.3;
}

.sc-phase-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 12px;
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.sc-phase-time .material-icons { font-size: 14px; }

.sc-phase-arrow {
    color: var(--text-muted);
    font-size: 22px;
    flex-shrink: 0;
    transition: color var(--trans-fast);
}
.sc-phase.open .sc-phase-arrow { color: var(--accent); }

.sc-phase-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--trans-slow);
}
.sc-phase.open .sc-phase-body { max-height: 3000px; }

@supports (interpolate-size: allow-keywords) {
    .sc-phase-body {
        max-height: none;
        height: 0;
        transition: height var(--trans-slow);
    }
    .sc-phase.open .sc-phase-body { height: auto; }
}

.sc-phase-body-inner {
    padding: 0 var(--space-4) var(--space-4);
}

.sc-phase-desc {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.55;
    padding-bottom: var(--space-3);
}

.sc-phase-map-wrap {
    margin: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-deep);
}

.sc-phase-map {
    width: 100%;
    height: auto;
    max-height: 480px;
    object-fit: contain;
    display: block;
    background: #000;
    -webkit-user-drag: none;
}

.sc-phase-map-caption {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-3);
    border-top: 1px solid var(--border);
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
}
.sc-phase-map-caption .material-icons {
    font-size: 14px;
    color: var(--accent);
}

.sc-inventory {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-2);
}
.sc-inventory li {
    position: relative;
    padding-left: var(--space-5);
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}
.sc-inventory li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    background: var(--accent);
    transform: rotate(45deg);
}

.sc-files {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

@media (max-width: 600px) {
    .sc-head { padding: var(--space-4); }
    .sc-body-inner { padding: var(--space-3) var(--space-4) var(--space-4); }
    .sc-phase-head { padding: var(--space-3); gap: var(--space-2); }
    .sc-phase-num { font-size: 18px; min-width: 26px; }
    .sc-phase-name { font-size: 14px; }
    .sc-phase-body-inner { padding: 0 var(--space-3) var(--space-3); }
    .sc-inventory { grid-template-columns: 1fr; }
    .sc-title { font-size: 16px; }
}

/* ==========================================================================
   DOCS
   ========================================================================== */

.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-4);
}

.doc-card {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-5);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--trans-normal);
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.doc-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.doc-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-dim);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-sm);
    color: var(--accent);
}
.doc-icon .material-icons { font-size: 26px; }

.doc-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.doc-title {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.3;
    letter-spacing: 0.5px;
}

.doc-desc {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.55;
    margin: 0;
}

.doc-meta {
    color: var(--accent);
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

@media (max-width: 600px) {
    .doc-grid { grid-template-columns: 1fr; }
    .doc-card { padding: var(--space-4); gap: var(--space-3); }
    .doc-icon { width: 40px; height: 40px; }
    .doc-icon .material-icons { font-size: 22px; }
    .doc-title { font-size: 15px; }
}

/* ==========================================================================
   DV (девайсы)
   ========================================================================== */

.dv-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.dv-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--trans-fast);
}
.dv-card:hover,
.dv-card.open { border-color: var(--border-accent); }

.dv-head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-4) var(--space-5);
    background: transparent;
    border: none;
    color: inherit;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background var(--trans-fast);
    user-select: none;
}
.dv-head:hover { background: var(--bg-hover); }

.dv-title {
    flex: 1;
    min-width: 0;
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    letter-spacing: 0.5px;
    line-height: 1.25;
}

.dv-arrow {
    color: var(--text-muted);
    font-size: 24px;
    flex-shrink: 0;
    transition: color var(--trans-fast);
}
.dv-card.open .dv-arrow { color: var(--accent); }

.dv-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--trans-slow);
    border-top: 1px solid transparent;
}
.dv-card.open .dv-body {
    max-height: 20000px;
    border-top-color: var(--border);
}

@supports (interpolate-size: allow-keywords) {
    .dv-body {
        max-height: none;
        height: 0;
        transition: height var(--trans-slow);
    }
    .dv-card.open .dv-body { height: auto; }
}

.dv-body-inner {
    padding: var(--space-5);
}

.dv-photo {
    margin: 0 auto var(--space-4);
    padding: 0;
    border: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #000;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 0 20px var(--accent-glow);
}
.dv-photo img,
.dv-photo .img-wrap,
.dv-photo .img-wrap img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    display: block;
    background: #000;
    -webkit-user-drag: none;
}
.dv-photo .img-wrap { position: relative; }

.dv-desc {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.65;
    margin: 0 0 var(--space-4);
}
.dv-desc:last-child { margin-bottom: 0; }

.dv-video {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: var(--space-4) 0;
    border: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #000;
    box-shadow: 0 0 20px var(--accent-glow);
}
.dv-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.dv-section { margin-top: var(--space-4); }

.dv-section-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border);
}
.dv-section-title .material-icons { font-size: 18px; }

.dv-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

@media (max-width: 600px) {
    .dv-head { padding: var(--space-3); gap: var(--space-2); }
    .dv-title { font-size: 15px; }
    .dv-body-inner { padding: var(--space-4); }
    .dv-photo { max-width: 100%; }
    .dv-desc { font-size: 14px; }
}

/* ==========================================================================
   REG (устав, atak)
   ========================================================================== */

.reg-tree {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.reg-node {
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-elevated);
    border-left: 3px solid var(--accent);
}

.reg-depth-1 { margin-left: 0; }
.reg-depth-2 { margin-left: var(--space-4); border-left-color: rgba(255, 102, 0, 0.6); }
.reg-depth-3 { margin-left: var(--space-8); border-left-color: rgba(255, 102, 0, 0.35); }
.reg-depth-4 { margin-left: var(--space-10); border-left-color: var(--border); }

.reg-head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: transparent;
    border: none;
    color: inherit;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background var(--trans-fast);
    user-select: none;
}
.reg-head:hover { background: var(--bg-hover); }

.reg-num {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
    min-width: 26px;
    flex-shrink: 0;
    opacity: 0.8;
    letter-spacing: 0.5px;
}

.reg-title {
    flex: 1;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    line-height: 1.3;
    min-width: 0;
}

.reg-arrow {
    color: var(--text-muted);
    font-size: 22px;
    flex-shrink: 0;
    transition: color var(--trans-fast);
}
.reg-node.open > .reg-head .reg-arrow { color: var(--accent); }

.reg-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--trans-slow);
}
.reg-node.open > .reg-body { max-height: 40000px; }

@supports (interpolate-size: allow-keywords) {
    .reg-body {
        max-height: none;
        height: 0;
        transition: height var(--trans-slow);
    }
    .reg-node.open > .reg-body { height: auto; }
}

.reg-body-inner {
    padding: 0 var(--space-4) var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.reg-content {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
    padding-left: var(--space-3);
    border-left: 1px dashed var(--border);
}
.reg-content p { margin: 0 0 var(--space-3); }
.reg-content p:last-child { margin-bottom: 0; }
.reg-content ul,
.reg-content ol { margin: 0 0 var(--space-3); padding-left: var(--space-5); }
.reg-content li { margin-bottom: var(--space-1); }
.reg-content strong { color: #fff; }
.reg-content a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dashed var(--border-accent);
    position: relative;
}
.reg-content a:hover { border-bottom-style: solid; }
.reg-content a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}
.reg-content a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}
.reg-content img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin: var(--space-3) 0;
    display: block;
    -webkit-user-drag: none;
}
.reg-content blockquote {
    margin: var(--space-3) 0;
    padding: var(--space-3) var(--space-4);
    border-left: 3px solid var(--accent);
    background: var(--bg-deep);
    color: var(--text-secondary);
    font-style: italic;
}
.reg-content code {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1px 6px;
    font-family: monospace;
    font-size: 0.9em;
    color: var(--accent);
}

.reg-children {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

@media (max-width: 600px) {
    .reg-head { padding: var(--space-3); gap: var(--space-2); }
    .reg-title { font-size: 14px; }
    .reg-num { font-size: 13px; min-width: 20px; }
    .reg-body-inner { padding: 0 var(--space-3) var(--space-3); }
    .reg-content { font-size: 14px; }
    .reg-depth-2 { margin-left: var(--space-2); }
    .reg-depth-3 { margin-left: var(--space-4); }
    .reg-depth-4 { margin-left: var(--space-5); }
}

/* ==========================================================================
   MAP
   ========================================================================== */

.map-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}

.map-toolbar label {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    flex-shrink: 0;
}

.map-toolbar .select { max-width: 340px; }

.map-container {
    width: 100%;
    height: 520px;
    border: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    background: var(--bg-deep);
    box-shadow: 0 0 24px var(--accent-glow);
    overflow: hidden;
}

.map-loading {
    padding: var(--space-6);
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

.map-layers {
    margin-top: var(--space-4);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-5);
}

.map-layers-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border);
}
.map-layers-title .material-icons { font-size: 18px; }

.map-layers-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-2);
}

.map-layer-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color var(--trans-fast);
    user-select: none;
}
.map-layer-item:hover { border-color: var(--border-accent); }

.map-layer-item input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
}

.map-layer-swatch {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid rgba(0,0,0,0.4);
    flex-shrink: 0;
}

.map-layer-name {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.3;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-empty {
    color: var(--text-muted);
    font-style: italic;
    font-size: 14px;
}

.map-container .leaflet-container {
    background: #0a0a0a;
    font-family: var(--font-body);
}

.map-container .leaflet-control-attribution {
    background: rgba(10,10,10,0.7) !important;
    color: var(--text-muted) !important;
    font-size: 10px !important;
}
.map-container .leaflet-control-attribution a { color: var(--accent) !important; }

.map-container .leaflet-bar a {
    background: var(--bg-elevated) !important;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border) !important;
}
.map-container .leaflet-bar a:hover {
    background: var(--bg-hover) !important;
    color: var(--accent) !important;
}
.map-container .leaflet-bar a.leaflet-disabled {
    background: var(--bg-deep) !important;
    color: var(--text-disabled) !important;
}

.map-container .leaflet-popup-content-wrapper,
.map-container .leaflet-popup-tip {
    background: var(--bg-elevated) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-accent);
    box-shadow: var(--shadow-md) !important;
}
.map-container .leaflet-popup-content {
    margin: 10px 14px !important;
    font-size: 13px !important;
    line-height: 1.5;
}
.map-container .leaflet-popup-content strong { color: var(--accent); }
.map-container .leaflet-popup-close-button { color: var(--text-muted) !important; }

@media (max-width: 768px) {
    .map-container { height: 380px; }
    .map-toolbar { gap: var(--space-2); }
    .map-toolbar .select { max-width: 100%; }
    .map-layers { padding: var(--space-3); }
    .map-layers-list { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .map-container { height: 300px; }
}

/* ==========================================================================
   GALLERY
   ========================================================================== */

.gallery-albums {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-4);
}

.album-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--trans-normal);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    color: inherit;
    user-select: none;
}
.album-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
}

.album-cover {
    position: relative;
    aspect-ratio: 16 / 10;
    background:
        radial-gradient(circle at 50% 60%, rgba(255,102,0,0.10) 0%, transparent 70%),
        var(--bg-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}
.album-cover img,
.album-cover .img-wrap,
.album-cover .img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--trans-normal);
    -webkit-user-drag: none;
}
.album-cover .img-wrap { position: absolute; inset: 0; }
.album-card:hover .album-cover img { transform: scale(1.04); }

.album-cover .material-icons {
    font-size: 56px;
    color: var(--text-disabled);
}

.album-count {
    position: absolute;
    bottom: var(--space-2);
    right: var(--space-2);
    padding: 3px 10px;
    background: rgba(10,10,10,0.85);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.album-body {
    padding: var(--space-4) var(--space-4) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.album-title {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    letter-spacing: 0.5px;
    line-height: 1.25;
}

.album-desc {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gallery-bar {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    user-select: none;
}
.gallery-bar-title {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.gallery-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-3);
}

.photo-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--trans-normal);
    user-select: none;
}
.photo-tile:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}
.photo-tile img,
.photo-tile .img-wrap,
.photo-tile .img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--trans-normal);
    -webkit-user-drag: none;
}
.photo-tile .img-wrap { position: absolute; inset: 0; }
.photo-tile:hover img { transform: scale(1.05); }

.photo-tile .material-icons {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 48px;
    height: 48px;
    font-size: 48px;
    color: var(--text-disabled);
}

.photo-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: var(--space-3);
    background: linear-gradient(to top, rgba(10,10,10,0.95) 0%, rgba(10,10,10,0) 100%);
    opacity: 0;
    transition: opacity var(--trans-normal);
    pointer-events: none;
}
.photo-tile:hover .photo-overlay { opacity: 1; }

.photo-overlay-title {
    color: #fff;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.25;
    margin-bottom: 2px;
}
.photo-overlay-date {
    color: var(--text-muted);
    font-size: 12px;
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.94);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: var(--space-8);
    cursor: zoom-out;
}
.lightbox.active { display: flex; animation: fadeIn 0.2s ease; }

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.lightbox-img {
    max-width: 92%;
    max-height: 88vh;
    object-fit: contain;
    border: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    box-shadow: 0 0 60px var(--accent-glow);
    cursor: default;
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox-caption {
    position: absolute;
    bottom: var(--space-5);
    left: 0;
    right: 0;
    text-align: center;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: 14px;
    letter-spacing: 0.5px;
    padding: 0 var(--space-5);
}

.lightbox-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-5);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17,17,17,0.8);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--trans-fast);
}
.lightbox-close:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-dim);
}
.lightbox-close .material-icons { font-size: 24px; }

@media (max-width: 900px) {
    .gallery-photos { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

@media (max-width: 600px) {
    .gallery-albums { grid-template-columns: 1fr; }
    .gallery-photos { grid-template-columns: repeat(2, 1fr); gap: var(--space-2); }
    .photo-overlay { padding: var(--space-2); opacity: 1; }
    .photo-overlay-title { font-size: 12px; }
    .photo-overlay-date { font-size: 11px; }
    .lightbox { padding: var(--space-4); }
    .lightbox-img { max-width: 100%; max-height: 80vh; }
    .lightbox-close { top: var(--space-3); right: var(--space-3); width: 38px; height: 38px; }
}

/* ==========================================================================
   CALCULATOR
   ========================================================================== */

.calc-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
    margin-bottom: var(--space-6);
}

.calc-params {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.calc-slider { display: flex; flex-direction: column; gap: var(--space-2); }

.calc-slider-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.calc-slider-label {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.calc-slider-value {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.5px;
    min-width: 90px;
    text-align: right;
}

.calc-slider input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    padding: 0;
}
.calc-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 12px var(--accent-glow);
    transition: transform var(--trans-fast);
}
.calc-slider input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
.calc-slider input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 12px var(--accent-glow);
}

.calc-slider-scale {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
}

.calc-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

.calc-result {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.calc-result-label {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.calc-result-value {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    line-height: 1.1;
}
.calc-result-value.accent { color: var(--accent); text-shadow: 0 0 20px var(--accent-glow); }

.calc-status {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-5);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.calc-status .material-icons { font-size: 22px; flex-shrink: 0; }
.calc-status-ok {
    border-color: var(--success);
    background: var(--success-dim);
    color: var(--success);
}
.calc-status-fail {
    border-color: var(--error);
    background: var(--error-dim);
    color: var(--error);
}

.calc-table-wrap {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-5);
}

.calc-table-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--accent);
}
.calc-table-title .material-icons { font-size: 18px; }

.calc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.calc-table th,
.calc-table td {
    padding: var(--space-3) var(--space-5);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.calc-table th {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-deep);
}

.calc-table tr:last-child td { border-bottom: none; }

.calc-table td:first-child {
    color: #fff;
    font-weight: 700;
}

.calc-table td:last-child {
    text-align: center;
    width: 80px;
}

.calc-table .material-icons { font-size: 22px; }
.calc-table .calc-ok   { color: var(--success); }
.calc-table .calc-fail { color: var(--error); }

.calc-row-active {
    background: var(--accent-dim);
}
.calc-row-active td:first-child { color: var(--accent); }

.calc-row-warning {
    background: var(--error-dim);
}
.calc-row-warning td:first-child { color: var(--error); }

@media (max-width: 900px) {
    .calc-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .calc-results { grid-template-columns: 1fr; }
    .calc-result-value { font-size: 26px; }
    .calc-table th,
    .calc-table td { padding: var(--space-3); font-size: 13px; }
    .calc-table th { font-size: 11px; }
    .calc-status { font-size: 13px; padding: var(--space-3) var(--space-4); }
}

/* ==========================================================================
   LOGS
   ========================================================================== */

.logs-feed {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.log-entry {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    transition: border-color var(--trans-fast), background var(--trans-fast);
}
.log-entry:hover {
    border-color: var(--border-accent);
    border-left-color: var(--accent-hover);
    background: var(--bg-hover);
}

.log-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
    margin-top: 10px;
}

.log-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.log-date {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0.9;
}

.log-text {
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media (max-width: 600px) {
    .log-entry {
        padding: var(--space-3) var(--space-4);
        gap: var(--space-3);
    }
    .log-dot { margin-top: 8px; }
    .log-text { font-size: 14px; }
    .log-date { font-size: 11px; }
}

/* ==========================================================================
   PROFILE
   ========================================================================== */

.profile-guest {
    text-align: center;
    padding: var(--space-10) var(--space-5);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
.profile-guest .material-icons {
    font-size: 56px;
    color: var(--text-muted);
    margin-bottom: var(--space-3);
}
.profile-guest h2 { margin-bottom: var(--space-2); }

.profile-header {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    padding: var(--space-6);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}

.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--accent);
    background: var(--bg-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 24px var(--accent-glow);
    flex-shrink: 0;
}
.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    -webkit-user-drag: none;
}
.profile-avatar .material-icons {
    font-size: 56px;
    color: var(--text-disabled);
}

.profile-info { flex: 1; min-width: 200px; }

.profile-name {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 var(--space-1);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.profile-role {
    color: var(--accent);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: var(--space-2);
}

.profile-meta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--text-muted);
    font-size: 13px;
}
.profile-meta .material-icons { font-size: 14px; }

.profile-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* ==========================================================================
   PROFILE WIDGETS
   ========================================================================== */

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
}

.profile-grid > .profile-widget-base {
    grid-column: 1 / -1; /* База на всю ширину */
    height: auto;
    min-height: 240px;
}

.profile-widget {
    position: relative;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 320px; /* Фиксированная высота */
}

.profile-widget::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 30%, transparent 100%);
    opacity: 0.5;
    transition: opacity var(--trans-fast);
}
.profile-widget:hover {
    border-color: var(--border-accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}
.profile-widget:hover::before { opacity: 1; }

.profile-widget-head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent);
    flex-shrink: 0;
}
.profile-widget-head .material-icons {
    font-size: 22px;
    filter: drop-shadow(0 0 6px var(--accent-glow));
}

.profile-widget-body {
    padding: var(--space-4) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    font-size: 15px;
    flex: 1;
    min-height: 0; 
    overflow-y: auto; /* Скроллится только контент */
}

.profile-widget-body::-webkit-scrollbar { width: 4px; }
.profile-widget-body::-webkit-scrollbar-track { background: transparent; }
.profile-widget-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }
.profile-widget-body:hover::-webkit-scrollbar-thumb { background: var(--accent); }

.profile-widget-footer {
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
    flex-shrink: 0;
    z-index: 2;
}
.profile-widget-footer .btn { width: 100%; justify-content: center; }

/* Центрируем пустые состояния */
.profile-widget-body > .text-muted {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-style: italic;
}

.profile-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--space-3);
    align-items: center;
    padding: var(--space-3) 0;
    border-bottom: 1px dashed var(--border);
}
.profile-row:first-child { padding-top: 0; }
.profile-row:last-child { border-bottom: none; padding-bottom: 0; }

.profile-row-date {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--accent);
    white-space: nowrap;
    line-height: 1.3;
    text-align: center;
}

.profile-row-title {
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.4;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.profile-row-sub {
    grid-column: 1 / -1;
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
    margin-top: var(--space-1);
}

.profile-about {
    flex-basis: 100%;
    width: 100%;
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}

.profile-about-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--space-2);
}
.profile-about-title .material-icons { font-size: 16px; }

.profile-about-text {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.65;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.profile-event-row {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: var(--space-4);
    align-items: center;
    padding: var(--space-4) 0;
    border-bottom: 1px dashed var(--border);
}
.profile-event-row:first-child { padding-top: 0; }
.profile-event-row:last-child { border-bottom: none; padding-bottom: 0; }
.profile-event-row.is-past { opacity: 0.5; }

.profile-event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-deep);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-sm);
    padding: 8px 4px;
    min-width: 56px;
    height: 56px;
}
.profile-event-date-num {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    text-shadow: 0 0 12px var(--accent-glow);
}
.profile-event-date-month {
    font-family: var(--font-heading);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 2px;
}

.profile-event-content { min-width: 0; }

.profile-event-title {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}
.profile-event-meta {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.profile-event-status { flex-shrink: 0; }

@media (max-width: 1100px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .profile-header { padding: var(--space-4); gap: var(--space-4); }
    .profile-avatar { width: 72px; height: 72px; }
    .profile-avatar .material-icons { font-size: 42px; }
    .profile-name { font-size: 20px; }

    .profile-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: var(--space-2);
    }
    .profile-actions .btn {
        flex: 1 1 auto;
        min-width: max-content;
        justify-content: center;
        padding: 8px 12px;
        font-size: 12px;
        letter-spacing: 0.3px;
    }
    .profile-actions .btn .material-icons {
        font-size: 16px;
    }

    .profile-grid { gap: var(--space-3); }
    .profile-widget-head { padding: var(--space-4); font-size: 14px; }
    .profile-widget-head .material-icons { font-size: 20px; }
    .profile-widget-body { padding: var(--space-4); }
    .profile-row-title { font-size: 14px; }
    .profile-row-date { font-size: 12px; }
    .profile-about-text { font-size: 13px; }

    .profile-event-row {
        grid-template-columns: 48px 1fr auto;
        gap: var(--space-3);
        padding: var(--space-3) 0;
    }
    .profile-event-date {
        min-width: 48px;
        height: 48px;
        padding: 6px 2px;
    }
    .profile-event-date-num { font-size: 20px; }
    .profile-event-date-month { font-size: 9px; }
    .profile-event-title { font-size: 14px; }
}

/* ==========================================================================
   SETTINGS
   ========================================================================== */

.settings-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    margin-bottom: var(--space-4);
}

.settings-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
}
.settings-title .material-icons { font-size: 20px; }

.settings-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: var(--space-4);
    align-items: start;
}

.settings-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--accent);
    background: var(--bg-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px var(--accent-glow);
}
.settings-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    -webkit-user-drag: none;
}
.settings-avatar .material-icons {
    font-size: 64px;
    color: var(--text-disabled);
}

.settings-fields { display: flex; flex-direction: column; gap: var(--space-3); }

@media (max-width: 600px) {
    .settings-grid { grid-template-columns: 1fr; justify-items: center; }
    .settings-fields { width: 100%; }
    .settings-card { padding: var(--space-4); }
}

/* ==========================================================================
   FILE INPUT
   ========================================================================== */

.file-input {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    padding: 0;
    background: transparent;
    border: none;
    margin: 0;
    font-weight: normal;
    text-transform: none;
    letter-spacing: normal;
    color: inherit;
}

.file-input input[type="file"] {
    display: none;
}

.file-input-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 8px 16px;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all var(--trans-fast);
    user-select: none;
    flex-shrink: 0;
}
.file-input-btn .material-icons { font-size: 16px; }
.file-input:hover .file-input-btn {
    background: var(--accent-dim);
}
.file-input-btn:active {
    transform: scale(0.98);
}

.file-input-name {
    margin-left: var(--space-6);
    color: var(--text-muted);
    font-size: 13px;
    font-family: var(--font-body);
    line-height: 1.3;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .file-input-name { font-size: 12px; margin-left: var(--space-4); }
    .file-input-btn { padding: 6px 12px; font-size: 12px; }
}

/* ==========================================================================
   CHAT
   ========================================================================== */

.chat-layout {
    display: grid;
    grid-template-columns: 240px 1fr 220px;
    height: 100%;
    margin: 0;
    background: var(--bg-base);
}

.chat-guest {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-10) var(--space-5);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin: var(--space-6);
    align-self: start;
}
.chat-guest .material-icons {
    font-size: 56px;
    color: var(--text-muted);
    margin-bottom: var(--space-3);
}
.chat-guest h2 { margin-bottom: var(--space-2); }

.chat-sidebar {
    background: var(--bg-deep);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-4) var(--space-3);
    border-bottom: 1px solid var(--border);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-primary);
}

.chat-new-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--trans-fast);
    padding: 0;
}
.chat-new-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-dim);
}
.chat-new-btn .material-icons { font-size: 16px; }

.chat-channels {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-3) var(--space-2);
}

.chat-cat { margin-bottom: var(--space-4); }

.chat-cat-label {
    padding: var(--space-2) var(--space-3);
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.chat-channel-row {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 1px;
}

.chat-channel-row .chat-channel {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.chat-channel {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: 7px var(--space-3);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: all var(--trans-fast);
    margin-bottom: 1px;
    user-select: none;
}
.chat-channel:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}
.chat-channel.active {
    color: var(--accent);
    background: var(--accent-dim);
}

.chat-channel-del {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--trans-fast), color var(--trans-fast), background var(--trans-fast);
    flex-shrink: 0;
}
.chat-channel-row:hover .chat-channel-del {
    opacity: 1;
}
.chat-channel-del:hover {
    color: var(--error);
    background: var(--error-dim);
}
.chat-channel-del .material-icons {
    font-size: 16px;
}

@media (hover: none) {
    .chat-channel-del { opacity: 1; }
}

.chat-channel-hash {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}
.chat-channel.active .chat-channel-hash { color: var(--accent); }

.chat-channel-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-channel-lock {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.chat-channel-unread {
    background: var(--error);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    flex-shrink: 0;
    min-width: 18px;
    text-align: center;
    animation: badgePulse 1.8s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 51, 51, 0.7);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(255, 51, 51, 0);
    }
}

.chat-main {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    background: var(--bg-base);
    height: 100%;
    min-height: 0;
}

.chat-main-head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
    flex-shrink: 0;
}

.chat-main-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}
.chat-main-title .material-icons {
    color: var(--text-muted);
    font-size: 20px;
}
.chat-main-title::before {
    content: '#';
    color: var(--text-muted);
    font-weight: 700;
    font-size: 18px;
}

.chat-main-desc {
    color: var(--text-muted);
    font-size: 13px;
    padding-left: var(--space-4);
    border-left: 1px solid var(--border);
    margin-left: var(--space-2);
    line-height: 1.3;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-messages {
    min-height: 0;
    overflow-y: auto;
    padding: var(--space-4) var(--space-4) var(--space-2);
    scroll-behavior: smooth;
}

.chat-empty,
.chat-error {
    text-align: center;
    padding: var(--space-10) var(--space-5);
    color: var(--text-muted);
    font-style: italic;
}
.chat-error { color: var(--error); font-style: normal; }

.chat-msg {
    position: relative;
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    transition: background var(--trans-fast);
}
.chat-msg:hover { background: rgba(255,255,255,0.02); }

.chat-msg.compact {
    padding-top: 1px;
    padding-bottom: 1px;
    grid-template-columns: 40px 1fr;
}
.chat-msg.compact .chat-msg-avatar { visibility: hidden; }

.chat-msg.highlight {
    animation: chatHighlight 1.5s ease;
}
@keyframes chatHighlight {
    0%, 100% { background: transparent; }
    30% { background: var(--accent-dim); }
}

.chat-msg-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
    grid-row: 1 / span 1;
}
.chat-msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    -webkit-user-drag: none;
}

.chat-msg-main {
    grid-column: 2;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.chat-msg-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.chat-msg-author {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.3px;
}

.chat-msg-time {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
}

.chat-msg-edited {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}

.chat-msg-text {
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    user-select: text;
}

.chat-msg-deleted {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
}
.chat-msg-deleted .material-icons { font-size: 14px; }

.chat-msg-reply {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding: 2px 8px;
    border-left: 2px solid var(--accent);
    background: rgba(255,102,0,0.05);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 12px;
    cursor: pointer;
    transition: background var(--trans-fast);
    margin-bottom: 2px;
    align-self: flex-start;
    max-width: 100%;
    user-select: none;
}
.chat-msg-reply:hover { background: rgba(255,102,0,0.12); }
.chat-msg-reply .material-icons {
    font-size: 12px;
    color: var(--accent);
    flex-shrink: 0;
}
.chat-msg-reply-user {
    color: var(--accent);
    font-weight: 700;
    flex-shrink: 0;
}
.chat-msg-reply-text {
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.chat-msg-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: var(--space-1);
}

.chat-reaction {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--trans-fast);
    font-family: inherit;
    font-size: 13px;
    user-select: none;
}
.chat-reaction:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}
.chat-reaction.mine {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.chat-reaction-emoji { font-size: 14px; line-height: 1; }
.chat-reaction-count {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}
.chat-reaction.mine .chat-reaction-count { color: var(--accent); }

.chat-msg-actions {
    position: absolute;
    top: -14px;
    right: var(--space-3);
    display: none;
    gap: 2px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px;
    box-shadow: var(--shadow-md);
    z-index: 5;
    user-select: none;
}
.chat-msg:hover .chat-msg-actions { display: flex; }

.chat-messages > .chat-msg:first-child .chat-msg-actions {
    top: 4px;
}

.chat-msg-act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    transition: all var(--trans-fast);
    font-family: inherit;
    padding: 0;
}
.chat-msg-act:hover {
    background: var(--bg-hover);
    color: var(--accent);
}
.chat-msg-act .material-icons { font-size: 16px; }

.chat-msg-act-danger:hover {
    background: var(--error-dim);
    color: var(--error);
}

.chat-msg-emoji {
    font-size: 15px;
    line-height: 1;
}

.chat-input-wrap {
    padding: var(--space-3) var(--space-5) var(--space-4);
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
}

.chat-reply-preview {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    margin-bottom: var(--space-2);
    background: var(--bg-deep);
    border-left: 2px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 13px;
}
.chat-reply-preview .material-icons {
    color: var(--accent);
    font-size: 16px;
    flex-shrink: 0;
}
.chat-reply-text {
    flex: 1;
    min-width: 0;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-reply-text strong { color: var(--accent); }

#chat-reply-cancel {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    display: inline-flex;
    align-items: center;
    transition: color var(--trans-fast);
}
#chat-reply-cancel:hover { color: var(--error); }
#chat-reply-cancel .material-icons { font-size: 16px; }

.chat-input-form {
    display: flex;
    gap: var(--space-2);
    align-items: flex-end;
}

.chat-input-form textarea {
    flex: 1;
    min-height: 40px;
    max-height: 160px;
    padding: 9px 14px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.4;
    resize: none;
    transition: border-color var(--trans-fast);
    overflow-y: auto;
    overscroll-behavior: contain;
}
.chat-input-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.chat-input-form button[type="submit"] {
    flex-shrink: 0;
    height: 40px;
    min-width: 44px;
}

.chat-statuses {
    background: var(--bg-deep);
    border-left: 1px solid var(--border);
    overflow-y: auto;
    padding: var(--space-4) var(--space-3);
}

.chat-status-cat {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: var(--space-2) var(--space-2) var(--space-1);
    margin-top: var(--space-3);
}
.chat-status-cat:first-child { margin-top: 0; }

.chat-status-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 5px var(--space-2);
    border-radius: var(--radius-sm);
    transition: background var(--trans-fast);
    font-size: 14px;
    color: var(--text-secondary);
    min-width: 0;
    user-select: none;
}
.chat-status-row:hover { background: var(--bg-hover); }

.chat-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.3);
}
.chat-status-dot.online  { background: var(--success); box-shadow: 0 0 8px rgba(51,204,51,0.6); animation: onlinePulse 2s ease-in-out infinite; }
.chat-status-dot.away    { background: var(--warning); }
.chat-status-dot.dnd     { background: var(--error); }
.chat-status-dot.offline { background: var(--text-disabled); }

@keyframes onlinePulse {
    0%, 100% {
        box-shadow: 0 0 6px rgba(51,204,51,0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 14px rgba(51,204,51,0.9);
        transform: scale(1.15);
    }
}

.chat-status-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.chat-status-custom {
    color: var(--text-muted);
    font-size: 11px;
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 90px;
}

.chat-mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    transition: color var(--trans-fast);
}
.chat-mobile-toggle:hover { color: var(--accent); }
.chat-mobile-toggle .material-icons { font-size: 22px; }

.chat-status-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    margin-left: auto;
    transition: color var(--trans-fast);
}
.chat-status-toggle:hover { color: var(--accent); }
.chat-status-toggle .material-icons { font-size: 22px; }

@media (max-width: 1100px) {
    .chat-layout {
        grid-template-columns: 220px 1fr;
    }

    .chat-status-toggle {
        display: inline-flex;
    }

    .chat-statuses {
        position: fixed;
        top: 54px;
        right: 0;
        bottom: 0;
        width: 260px;
        z-index: 50;
        transform: translateX(100%);
        transition: transform var(--trans-normal);
        border-left: 1px solid var(--border-accent);
        box-shadow: -4px 0 24px rgba(0,0,0,0.6);
        display: block;
    }
    .chat-statuses.open {
        transform: translateX(0);
    }
}

.chat-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 49;
    opacity: 0;
    transition: opacity var(--trans-normal);
    pointer-events: none;
}
.chat-backdrop.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 700px) {
    .app-main.no-padding {
        height: calc(100vh - 54px);
        height: calc(100dvh - 54px);
        min-height: -webkit-fill-available;
        max-height: -webkit-fill-available;
    }

    .chat-layout {
        grid-template-columns: 1fr;
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    .chat-mobile-toggle {
        display: inline-flex;
    }

    .chat-sidebar {
        position: fixed;
        top: 54px;
        left: 0;
        bottom: 0;
        width: 260px;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform var(--trans-normal);
        border-right: 1px solid var(--border-accent);
        box-shadow: 4px 0 24px rgba(0,0,0,0.6);
    }
    .chat-sidebar.open {
        transform: translateX(0);
    }

    .chat-main-head {
        padding: var(--space-3) var(--space-4);
        gap: var(--space-2);
    }
    .chat-main-title { font-size: 15px; }
    .chat-main-desc { display: none; }

    .chat-messages { padding: var(--space-3) var(--space-2); }

    .chat-msg {
        grid-template-columns: 32px 1fr;
        gap: var(--space-2);
        padding: var(--space-2);
    }
    .chat-msg-avatar { width: 32px; height: 32px; font-size: 15px; }

    .chat-msg-actions {
        top: -10px;
        right: var(--space-2);
    }

    .chat-input-wrap {
        padding: var(--space-2) var(--space-3) calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
    }

    .chat-input-form textarea {
        font-size: 16px;
        min-height: 44px;
        max-height: 120px;
        padding: 10px 14px;
    }
    .chat-input-form button[type="submit"] {
        height: 44px;
        min-width: 44px;
    }
}

.app-main.no-padding {
    padding: 0;
    overflow: hidden;
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px);
}
.app-main.no-padding .page.active {
    height: 100%;
    overflow: hidden;
}

body.chat-active {
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
}

/* ==========================================================================
   WIDGET: LOG
   ========================================================================== */

.widget-log-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.widget-log-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-1) 0;
    border-bottom: 1px dashed var(--border);
}
.widget-log-row:last-child { border-bottom: none; }

.widget-log-date {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0.9;
}

.widget-log-text {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.widget-log-footer {
    margin-top: auto;
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
}

/* ==========================================================================
   WIDGET: EVENT COUNTDOWN
   ========================================================================== */

.widget-event-countdown {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    margin-bottom: var(--space-1);
    background: transparent;
    border-left: 2px solid var(--accent);
    color: var(--accent);
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    line-height: 1.2;
}

/* ==========================================================================
   WIDGET: POLL
   ========================================================================== */

.widget-poll-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    margin-bottom: var(--space-2);
}

.widget-poll-row {
    padding: 6px var(--space-2);
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color var(--trans-fast);
}
.widget-poll-row:hover { border-color: var(--border-accent); }

.widget-poll-row.mine {
    border-color: var(--accent);
}

.widget-poll-row-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: 4px;
}

.widget-poll-option {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.widget-poll-row.mine .widget-poll-option { color: var(--accent); }

.widget-poll-percent {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    color: var(--accent);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}
.widget-poll-percent .widget-poll-count {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

.widget-poll-row-bar {
    height: 3px;
    background: rgba(255,255,255,0.05);
    border-radius: 2px;
    overflow: hidden;
}

.widget-poll-row-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-radius: 2px;
    transition: width 0.4s ease;
    min-width: 2px;
}
.widget-poll-row.mine .widget-poll-row-fill {
    box-shadow: 0 0 8px var(--accent-glow);
}

.widget-poll-more {
    margin-top: var(--space-2);
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
}

/* ==========================================================================
   WIDGET: EVENT ITEM
   ========================================================================== */

.widget-event-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-2) 0;
    border-bottom: 1px dashed var(--border);
}
.widget-event-item:first-child { padding-top: 0; }
.widget-event-item:last-child { border-bottom: none; padding-bottom: 0; }

.widget-event-item-head {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.widget-event-item .widget-event-countdown {
    margin-bottom: 0;
    flex-shrink: 0;
}

.widget-event-item .widget-event-title {
    margin-bottom: 0;
    font-size: 15px;
    min-width: 0;
}

.widget-event-item .widget-event-meta {
    font-size: 13px;
    margin-bottom: 0;
}

.widget-event-item .widget-event-rsvp {
    margin-top: 2px;
    margin-bottom: 0;
}

/* ==========================================================================
   WIDGET: WEATHER
   ========================================================================== */

.widget-weather-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    padding: var(--space-3) var(--space-2);
    margin: var(--space-2) 0;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    flex: 1;
    min-height: 0;
}

.widget-weather-icon .material-icons {
    font-size: 40px;
    color: var(--accent);
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.widget-weather-temp {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    letter-spacing: 1px;
}

.widget-weather-label {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.widget-weather-details {
    display: flex;
    justify-content: space-around;
    gap: var(--space-2);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
}

.widget-weather-detail {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 0.3px;
}
.widget-weather-detail .material-icons {
    font-size: 18px;
    color: var(--accent);
}

.widget-chat-footer .btn {
    width: auto;
    min-width: 150px;
    justify-content: center;
    padding: 8px var(--space-4);
    font-size: 13px;
    gap: 6px;
}
.widget-chat-footer .btn .material-icons {
    font-size: 14px;
}

/* ==========================================================================
   POLLS
   ========================================================================== */

.polls-bar {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    margin-bottom: var(--space-5);
    flex-wrap: wrap;
}

.polls-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.poll-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    transition: border-color var(--trans-fast);
}
.poll-card:hover { border-color: var(--border-accent); }

.poll-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
}

.poll-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.3;
    letter-spacing: 0.5px;
}

.poll-meta {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: var(--space-4);
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
}

.poll-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.poll-option {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--trans-fast);
    user-select: none;
}
.poll-option:hover { border-color: var(--border-accent); }
.poll-option.mine { border-color: var(--accent); }

.poll-option input[type="radio"],
.poll-option input[type="checkbox"] {
    accent-color: var(--accent);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}
.poll-option input:disabled { cursor: not-allowed; }

.poll-option-content { flex: 1; min-width: 0; }

.poll-option-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-2);
    margin-bottom: 6px;
}

.poll-option-name {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.poll-option.mine .poll-option-name { color: var(--accent); }

.poll-option-stats {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    flex-shrink: 0;
}

.poll-option-count {
    color: var(--text-muted);
    font-size: 12px;
}

.poll-option-percent {
    color: var(--accent);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.5px;
}

.poll-option-bar {
    height: 4px;
    background: rgba(255,255,255,0.05);
    border-radius: 2px;
    overflow: hidden;
}
.poll-option-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-radius: 2px;
    transition: width 0.4s ease;
    min-width: 2px;
}
.poll-option.mine .poll-option-fill {
    box-shadow: 0 0 8px var(--accent-glow);
}

.poll-footer {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.poll-total {
    color: var(--text-muted);
    font-size: 12px;
    margin-left: auto;
}

.poll-delete {
    color: var(--text-muted);
}
.poll-delete:hover { color: var(--error); }

@media (max-width: 600px) {
    .poll-card { padding: var(--space-4); }
    .poll-title { font-size: 16px; }
    .poll-footer { flex-wrap: wrap; }
    .poll-total { width: 100%; margin-left: 0; text-align: right; }
}

.profile-poll-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-3);
    align-items: center;
    padding: var(--space-3) 0;
    border-bottom: 1px dashed var(--border);
}
.profile-poll-row:first-child { padding-top: 0; }
.profile-poll-row:last-child { border-bottom: none; padding-bottom: 0; }

.profile-poll-content { min-width: 0; }

.profile-poll-title {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 3px;
}

.profile-poll-meta {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.3;
    font-family: var(--font-heading);
    letter-spacing: 0.3px;
}

/* ==========================================================================
   EVENTS
   ========================================================================== */

.events-bar {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    margin-bottom: var(--space-5);
    flex-wrap: wrap;
}

.events-layout {
    display: grid;
    grid-template-columns: minmax(320px, 420px) 1fr;
    gap: var(--space-5);
    align-items: start;
}

.events-calendar {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-5) var(--space-4);
    height: fit-content;
    position: sticky;
    top: 80px;
}

.calendar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
}

.calendar-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--trans-fast);
}
.calendar-nav:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}
.calendar-nav .material-icons { font-size: 22px; }

.calendar-title {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
}

.calendar-title-month {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
}

.calendar-title-year {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--accent);
}

.calendar-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px;
}

.calendar-table th {
    font-family: var(--font-heading);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: var(--space-2) 0;
    text-align: center;
    user-select: none;
}

.calendar-day {
    position: relative;
    padding: 8px 0 6px;
    text-align: center;
    cursor: pointer;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    transition: all var(--trans-fast);
    user-select: none;
    vertical-align: top;
    min-width: 34px;
    height: 42px;
}
.calendar-day:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.calendar-day-num {
    display: block;
    line-height: 1;
    font-weight: 500;
}

.calendar-day.today .calendar-day-num {
    color: var(--accent);
    font-weight: 700;
}

.calendar-day.selected {
    background: var(--accent);
}
.calendar-day.selected .calendar-day-num {
    color: var(--text-on-accent);
    font-weight: 700;
}

.calendar-day-dots {
    display: flex;
    gap: 2px;
    justify-content: center;
    margin-top: 3px;
    height: 4px;
}

.calendar-day-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
}
.calendar-day.selected .calendar-day-dot {
    background: var(--text-on-accent);
}

.calendar-legend {
    display: flex;
    gap: var(--space-4);
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.calendar-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.calendar-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.legend-today {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}
.legend-event {
    background: var(--accent);
    opacity: 0.5;
}

.events-list {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    min-height: 400px;
}

.events-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding-bottom: var(--space-4);
    margin-bottom: var(--space-4);
    border-bottom: 1px solid var(--border);
}

.events-list-date {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.events-list-day {
    font-family: var(--font-heading);
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
    color: var(--accent);
    letter-spacing: 1px;
    min-width: 60px;
    text-align: center;
    text-shadow: 0 0 20px var(--accent-glow);
}

.events-list-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.events-list-weekday {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
}

.events-list-month {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: capitalize;
}

.events-cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.event-card {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: var(--space-4);
    transition: all var(--trans-fast);
}
.event-card:hover {
    border-color: var(--border-accent);
    border-left-color: var(--accent-hover);
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.event-card-head {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.event-card-time {
    flex-shrink: 0;
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.5px;
    min-width: 54px;
    padding-top: 2px;
}

.event-card-title-wrap { flex: 1; min-width: 0; }

.event-card-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px;
    line-height: 1.3;
    letter-spacing: 0.3px;
}

.event-card-location {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 12px;
}
.event-card-location .material-icons { font-size: 14px; }

.event-card-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.event-card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--trans-fast);
}
.event-card-action:hover {
    background: var(--bg-hover);
    color: var(--accent);
}
.event-card-action-danger:hover {
    background: var(--error-dim);
    color: var(--error);
}
.event-card-action .material-icons { font-size: 18px; }

.event-card-desc {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.55;
    margin-bottom: var(--space-3);
    padding-left: calc(54px + var(--space-3));
}

.event-card-rsvp {
    padding-top: var(--space-3);
    border-top: 1px dashed var(--border);
    padding-left: calc(54px + var(--space-3));
}

.rsvp-buttons {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-bottom: var(--space-3);
}

.rsvp-btn {
    font-size: 12px;
    padding: 5px 14px;
    letter-spacing: 0.5px;
}
.rsvp-btn-going.active {
    background: var(--success);
    color: var(--text-on-accent);
    border-color: var(--success);
}
.rsvp-btn-maybe.active {
    background: var(--warning);
    color: var(--text-on-accent);
    border-color: var(--warning);
}
.rsvp-btn-not.active {
    background: var(--error);
    color: #fff;
    border-color: var(--error);
}

.rsvp-counters {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
    font-size: 12px;
    margin-bottom: var(--space-3);
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
}
.rsvp-counter-going { color: var(--success); }
.rsvp-counter-maybe { color: var(--warning); }
.rsvp-counter-not   { color: var(--error); }

.rsvp-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
}

.rsvp-item { color: var(--text-secondary); }
.rsvp-name { color: #fff; font-weight: 700; }
.rsvp-sep  { color: var(--text-muted); }
.rsvp-comment { color: var(--text-muted); font-style: italic; }

@media (max-width: 900px) {
    .events-layout {
        grid-template-columns: 1fr;
    }
    .events-calendar {
        position: static;
    }
}

@media (max-width: 600px) {
    .events-list { padding: var(--space-4); min-height: 200px; }
    .events-calendar { padding: var(--space-4) var(--space-3); }
    .calendar-day { height: 38px; font-size: 13px; min-width: 30px; }
    .events-list-day { font-size: 32px; min-width: 48px; }
    .events-list-weekday { font-size: 13px; }
    .event-card { padding: var(--space-3); }
    .event-card-time { font-size: 14px; min-width: 46px; }
    .event-card-title { font-size: 15px; }
    .event-card-desc,
    .event-card-rsvp {
        padding-left: 0;
    }
    .rsvp-btn { padding: 4px 10px; font-size: 11px; }
}

/* ==========================================================================
   EVENT LOGISTICS
   ========================================================================== */

.event-card-logistics {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px dashed var(--border);
    padding-left: calc(54px + var(--space-3));
}

.logistics-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
}

.logistics-title-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}
.logistics-title-label .material-icons { font-size: 18px; }

.logistics-title-badges {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.logistics-title-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.2;
    white-space: nowrap;
}
.logistics-title-badge .material-icons { font-size: 13px; }

.logistics-title-badge.is-free {
    background: var(--success-dim);
    border: 1px solid var(--success);
    color: var(--success);
}
.logistics-title-badge.is-free.is-zero {
    background: transparent;
    border-color: var(--border);
    color: var(--text-muted);
}

.logistics-title-badge.is-booked {
    background: var(--accent-dim);
    border: 1px solid var(--border-accent);
    color: var(--accent);
}
.logistics-title-badge.is-booked.is-zero {
    background: transparent;
    border-color: var(--border);
    color: var(--text-muted);
}

.logistics-title-badge.is-needs {
    background: var(--warning-dim);
    border: 1px solid var(--warning);
    color: var(--warning);
}
.logistics-title-badge.is-needs.is-zero {
    background: transparent;
    border-color: var(--border);
    color: var(--text-muted);
}

.logistics-loading {
    padding: var(--space-3);
    font-style: italic;
    font-size: 13px;
}

.logistics-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.logistics-summary-box {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.logistics-summary-drivers { border-left: 3px solid var(--success); }
.logistics-summary-riders  { border-left: 3px solid var(--warning); }

.logistics-summary-head {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-3) var(--space-2);
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}
.logistics-summary-drivers .logistics-summary-head { color: var(--success); }
.logistics-summary-riders  .logistics-summary-head { color: var(--warning); }

.logistics-summary-head .material-icons { font-size: 16px; }

.logistics-summary-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 var(--space-3) var(--space-3);
}

.logistics-driver-card {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-3);
}

.logistics-driver-name {
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 4px;
}

.logistics-driver-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.logistics-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 0.3px;
}
.logistics-chip .material-icons { font-size: 12px; }

.logistics-chip-seats {
    background: var(--success-dim);
    color: var(--success);
}
.logistics-chip-place {
    background: var(--accent-dim);
    color: var(--accent);
}

.logistics-rider-card {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-3);
}

.logistics-rider-name {
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 4px;
}

.logistics-rider-area {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--warning-dim);
    color: var(--warning);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 0.3px;
}
.logistics-rider-area .material-icons { font-size: 12px; }

.logistics-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-5) var(--space-3);
    background: var(--bg-elevated);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: var(--space-4);
}
.logistics-empty .material-icons {
    font-size: 32px;
    color: var(--text-disabled);
}

.logistics-form {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--space-4);
}

.logistics-form-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--space-3);
}
.logistics-form-title .material-icons { font-size: 14px; }

.logistics-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.logistics-mode {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: var(--space-3) var(--space-2);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--trans-fast);
    font-family: inherit;
    text-align: center;
    min-height: 84px;
    user-select: none;
}
.logistics-mode:hover {
    border-color: var(--border-accent);
    background: var(--bg-hover);
}

.logistics-mode-icon {
    font-size: 24px;
    color: var(--text-muted);
    transition: color var(--trans-fast);
}

.logistics-mode-label {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-primary);
}

.logistics-mode-sub {
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.3;
    padding: 0 4px;
}

.logistics-mode[data-mode="driver"].active {
    background: var(--success-dim);
    border-color: var(--success);
    color: var(--success);
    box-shadow: 0 0 12px rgba(51,204,51,0.25);
}
.logistics-mode[data-mode="driver"].active .logistics-mode-icon { color: var(--success); }
.logistics-mode[data-mode="driver"].active .logistics-mode-label { color: var(--success); }

.logistics-mode[data-mode="rider"].active {
    background: var(--warning-dim);
    border-color: var(--warning);
    color: var(--warning);
    box-shadow: 0 0 12px rgba(255,170,0,0.25);
}
.logistics-mode[data-mode="rider"].active .logistics-mode-icon { color: var(--warning); }
.logistics-mode[data-mode="rider"].active .logistics-mode-label { color: var(--warning); }

.logistics-fields {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.logistics-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.logistics-field label {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.logistics-field input {
    width: 100%;
    height: 36px;
    padding: 6px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    transition: border-color var(--trans-fast);
}
.logistics-field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.logistics-seats {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px;
    width: fit-content;
}

.logistics-seat-btn {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--trans-fast);
    font-family: var(--font-heading);
    line-height: 1;
}
.logistics-seat-btn:hover {
    background: var(--accent-dim);
    color: var(--accent);
}
.logistics-seat-btn:active {
    transform: scale(0.94);
}

.lg-seats-value {
    min-width: 28px;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}

.logistics-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
}

.logistics-save {
    flex: 1;
    justify-content: center;
}

.logistics-clear {
    color: var(--text-muted);
}
.logistics-clear:hover { color: var(--error); }

.logistics-seats-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.logistics-seats-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.2;
    white-space: nowrap;
}
.logistics-seats-badge .material-icons {
    font-size: 13px;
}

.logistics-seats-badge.is-free {
    background: var(--success-dim);
    border: 1px solid var(--success);
    color: var(--success);
}
.logistics-seats-badge.is-free.is-zero {
    background: var(--error-dim);
    border-color: var(--error);
    color: var(--error);
}

.logistics-seats-badge.is-booked {
    background: var(--accent-dim);
    border: 1px solid var(--border-accent);
    color: var(--accent);
}
.logistics-seats-badge.is-booked.is-zero {
    background: transparent;
    border-color: var(--border);
    color: var(--text-muted);
}

.logistics-seats-badge.is-empty {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.logistics-driver-passengers {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--border);
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.35;
    word-break: break-word;
}
.logistics-driver-passengers .material-icons {
    font-size: 14px;
    color: var(--success);
    flex-shrink: 0;
}

.logistics-driver-action {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}

.logistics-book-btn {
    width: 100%;
    justify-content: center;
    font-size: 11px;
    padding: 6px 10px;
}
.logistics-book-btn .material-icons {
    font-size: 14px;
}

.profile-logistics-event {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    line-height: 1.25;
    margin-bottom: 4px;
}

.profile-logistics-meta {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: var(--space-3);
    font-family: var(--font-heading);
    letter-spacing: 0.3px;
}

.profile-logistics-role {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-3);
}
.profile-logistics-role.is-driver {
    background: var(--success-dim);
    border: 1px solid var(--success);
    color: var(--success);
}
.profile-logistics-role.is-rider {
    background: var(--warning-dim);
    border: 1px solid var(--warning);
    color: var(--warning);
}
.profile-logistics-role .material-icons {
    font-size: 20px;
}
.profile-logistics-role-count {
    margin-left: auto;
    padding: 2px 8px;
    background: rgba(0,0,0,0.25);
    border-radius: var(--radius-sm);
    font-size: 12px;
    letter-spacing: 0.3px;
}

.profile-logistics-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    color: var(--text-secondary);
    font-size: 13px;
}
.profile-logistics-detail .material-icons {
    font-size: 15px;
    color: var(--accent);
    flex-shrink: 0;
}

.profile-logistics-subtitle {
    margin-top: var(--space-2);
    margin-bottom: 6px;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.profile-logistics-passenger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0 3px 6px;
    color: var(--text-primary);
    font-size: 14px;
    border-left: 2px solid var(--success);
    margin-bottom: 4px;
}
.profile-logistics-passenger .material-icons {
    font-size: 15px;
    color: var(--success);
}

.profile-logistics-booked {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: var(--space-2) var(--space-3);
    margin-top: var(--space-2);
    background: var(--success-dim);
    border: 1px solid var(--success);
    border-radius: var(--radius-sm);
    color: var(--success);
    font-size: 13px;
}
.profile-logistics-booked .material-icons {
    font-size: 16px;
}
.profile-logistics-booked strong {
    color: #fff;
}

.profile-logistics-empty {
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
    padding: var(--space-2) 0;
}

.profile-logistics-empty-big {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-5) var(--space-3);
    color: var(--text-muted);
    text-align: center;
    font-size: 14px;
}
.profile-logistics-empty-big .material-icons {
    font-size: 36px;
    color: var(--text-disabled);
    opacity: 0.6;
}

@media (max-width: 600px) {
    .event-card-logistics { padding-left: 0; }
    .logistics-summary-grid { grid-template-columns: 1fr; }
    .logistics-modes { grid-template-columns: 1fr; }
    .logistics-mode {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        padding: var(--space-3);
        gap: var(--space-3);
        min-height: 60px;
    }
    .logistics-mode-icon { font-size: 22px; }
    .logistics-mode-label { font-size: 13px; }
    .logistics-mode-sub { display: none; }
    .logistics-actions { flex-direction: column; }
    .logistics-save,
    .logistics-clear { width: 100%; }
}

/* ==========================================================================
   PROFILE WIDGET: BASE
   ========================================================================== */

.profile-widget-base {
    position: relative;
    overflow: hidden;
}

.base-body {
    padding: var(--space-4) var(--space-5) !important;
    gap: 0 !important;
}

.base-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.base-row {
    display: grid;
    grid-template-columns: 20px auto 1fr auto;
    align-items: baseline;
    gap: var(--space-2);
    padding: 6px 0;
    font-family: 'Consolas', 'Monaco', monospace;
    border-bottom: 1px solid rgba(42, 42, 42, 0.5);
}
.base-row:last-child { border-bottom: none; }

.base-icon {
    font-size: 14px;
    color: var(--accent);
    opacity: 0.7;
    line-height: 1;
    transform: translateY(2px);
}

.base-key {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.base-dots {
    display: block;
    border-bottom: 1px dotted rgba(255,102,0,0.3);
    height: 1px;
    min-width: 20px;
    align-self: end;
    margin-bottom: 4px;
}

.base-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.5px;
    text-align: right;
    text-shadow: 0 0 8px var(--accent-glow);
    min-width: 30px;
    font-variant-numeric: tabular-nums;
}

.base-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px dashed rgba(255,102,0,0.3);
    font-family: 'Consolas', 'Monaco', monospace;
}

.base-total-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.base-total-value {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
    text-shadow: 0 0 12px rgba(255,255,255,0.3);
    font-variant-numeric: tabular-nums;
}

.profile-widget-base::after {
    content: '///';
    position: absolute;
    right: var(--space-4);
    bottom: var(--space-3);
    font-family: 'Consolas', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    color: rgba(255,102,0,0.15);
    pointer-events: none;
    animation: baseSlashes 3s ease-in-out infinite;
}
@keyframes baseSlashes {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 1; }
}

@media (max-width: 600px) {
    .base-row {
        grid-template-columns: 18px auto 1fr auto;
        gap: var(--space-1);
        padding: 5px 0;
    }
    .base-key { font-size: 11px; letter-spacing: 0.5px; }
    .base-value { font-size: 13px; }
    .base-total-value { font-size: 18px; }
}

/* ==========================================================================
   RADIO
   ========================================================================== */

.radio-block {
    position: relative;
    background: #04100a;
    border: 1px solid var(--success);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-5) var(--space-5);
    margin-bottom: var(--space-6);
    overflow: hidden;
}

.radio-block-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px dashed rgba(51,204,51,0.25);
}
.radio-block-header .material-icons {
    color: var(--success);
    font-size: 20px;
    animation: radioPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 6px rgba(51,204,51,0.6));
}
@keyframes radioPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.55; }
}
.radio-block-title {
    font-family: var(--font-heading);
    font-size: 14px;
    margin: 0;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--success);
    text-shadow: 0 0 10px rgba(51,204,51,0.4);
}

.radio-console {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    background: #020a04;
    border: 1px solid rgba(51,204,51,0.35);
    border-radius: var(--radius-sm);
    padding: var(--space-4);
    position: relative;
}

.radio-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.radio-freq {
    position: relative;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 15px;
    font-weight: 700;
    color: #b8ffb8;
    border-bottom: 1px dashed rgba(51,204,51,0.3);
    padding: 0 0 6px 16px;
    letter-spacing: 1.2px;
    text-shadow: 0 0 6px rgba(51,204,51,0.5);
    line-height: 1.3;
}
.radio-freq::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success), 0 0 16px rgba(51,204,51,0.6);
    animation: ledBlink 1.6s ease-in-out infinite;
}
@keyframes ledBlink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.45; transform: scale(0.85); }
}

.radio-purpose {
    font-family: var(--font-heading);
    font-size: 10px;
    color: var(--success);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.85;
}

.radio-track {
    font-family: var(--font-heading);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-top: 2px;
    text-shadow: 0 0 8px rgba(51,204,51,0.3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.radio-desc {
    font-size: 11px;
    color: rgba(133,255,122,0.75);
    line-height: 1.4;
    letter-spacing: 0.3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.radio-progress { padding-top: var(--space-2); position: relative; z-index: 1; }
.radio-progress-bar {
    height: 3px;
    background: rgba(51,204,51,0.12);
    border-radius: 2px;
    cursor: pointer;
    overflow: hidden;
}
.radio-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success) 0%, #66ff66 100%);
    width: 0;
    transition: width 0.1s linear;
    box-shadow: 0 0 8px rgba(51,204,51,0.6);
}
.radio-times {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: rgba(90,138,90,0.9);
    margin-top: 4px;
    font-family: 'Consolas', monospace;
    letter-spacing: 0.5px;
}

.radio-controls {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-3);
    align-items: center;
    padding-top: var(--space-3);
    border-top: 1px dashed rgba(51,204,51,0.25);
    position: relative;
    z-index: 1;
}

.radio-dd {
    position: relative;
    min-width: 0;
}

.radio-dd-trigger {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: 8px 12px;
    background: rgba(2,10,4,0.7);
    border: 1px solid rgba(51,204,51,0.4);
    border-radius: var(--radius-sm);
    color: #b8ffb8;
    font-family: 'Consolas', monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--trans-fast);
    text-align: left;
}
.radio-dd-trigger:hover {
    border-color: var(--success);
    background: rgba(51,204,51,0.08);
}
.radio-dd-trigger.open {
    border-color: var(--success);
    box-shadow: 0 0 12px rgba(51,204,51,0.3);
}
.radio-dd-icon {
    font-size: 16px;
    color: var(--success);
    flex-shrink: 0;
}
.radio-dd-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.radio-dd-arrow {
    font-size: 18px;
    color: var(--success);
    opacity: 0.6;
    transition: transform var(--trans-fast);
    flex-shrink: 0;
}
.radio-dd-trigger.open .radio-dd-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

.radio-dd-menu {
    position: absolute;
    bottom: calc(100% + 6px);
    top: auto;
    left: 0;
    right: 0;
    background: #04100a;
    border: 1px solid rgba(51,204,51,0.4);
    border-radius: var(--radius-sm);
    padding: 4px;
    box-shadow: 0 0 30px rgba(51,204,51,0.25), 0 8px 24px rgba(0,0,0,0.8);
    max-height: 240px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    animation: ddFadeIn 0.15s ease;
}
.radio-dd-menu.open { display: block; }
@keyframes ddFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.radio-dd-item {
    display: grid;
    grid-template-columns: 20px 1fr;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: #b8ffb8;
    font-family: 'Consolas', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all var(--trans-fast);
    text-align: left;
}
.radio-dd-item:hover {
    background: rgba(51,204,51,0.12);
    color: #fff;
}
.radio-dd-item.active {
    background: rgba(51,204,51,0.2);
    color: #fff;
    box-shadow: inset 2px 0 0 var(--success);
}
.radio-dd-item .material-icons {
    font-size: 14px;
    color: var(--success);
    opacity: 0.7;
    line-height: 1;
}
.radio-dd-item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.radio-dd-item-freq {
    color: rgba(133,255,122,0.6);
    font-size: 10px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.radio-dd-item.active .radio-dd-item-freq,
.radio-dd-item:hover .radio-dd-item-freq {
    color: rgba(133,255,122,0.9);
}

.radio-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
}
.radio-buttons .btn-icon {
    min-width: 42px;
    min-height: 42px;
}
.radio-buttons .btn-secondary {
    background: rgba(51,204,51,0.05);
    color: var(--success);
    border-color: rgba(51,204,51,0.4);
}
.radio-buttons .btn-secondary:hover {
    background: rgba(51,204,51,0.15);
    border-color: var(--success);
    box-shadow: 0 0 12px rgba(51,204,51,0.3);
}
.radio-buttons .btn-primary {
    background: var(--success);
    color: #051005;
    border-color: var(--success);
    box-shadow: 0 0 16px rgba(51,204,51,0.4);
}
.radio-buttons .btn-primary:hover {
    background: #55dd55;
    border-color: #55dd55;
    box-shadow: 0 0 24px rgba(51,204,51,0.6);
}

@media (max-width: 600px) {
    .radio-controls {
        grid-template-columns: 1fr;
    }
    .radio-buttons {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* ==========================================================================
   NOTIFY TOAST
   ========================================================================== */

.notify-container {
    position: fixed;
    bottom: var(--space-5);
    right: var(--space-5);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column-reverse;
    gap: var(--space-2);
    pointer-events: none;
    max-width: 380px;
    width: calc(100% - var(--space-10));
}

.notify-toast {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(0,0,0,0.5);
    pointer-events: auto;
    cursor: default;
    opacity: 0;
    transform: translateY(20px) scale(0.96);
    transition: opacity 0.22s ease, transform 0.22s ease;
    max-width: 100%;
}

.notify-toast.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: toastBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes toastBounce {
    0%   { opacity: 0; transform: translateY(30px) scale(0.9); }
    60%  { opacity: 1; transform: translateY(-4px) scale(1.02); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.notify-toast.leaving {
    opacity: 0;
    transform: translateX(30px) scale(0.96);
}

.notify-toast.notify-clickable {
    cursor: pointer;
}
.notify-toast.notify-clickable:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-lg), 0 0 30px var(--accent-glow);
}

.notify-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-dim);
    border-radius: var(--radius-sm);
    color: var(--accent);
}
.notify-icon .material-icons { font-size: 18px; }

.notify-body {
    flex: 1;
    min-width: 0;
}

.notify-title {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notify-message {
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
}

.notify-close {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--trans-fast);
    padding: 0;
}
.notify-close:hover {
    color: var(--error);
    background: var(--error-dim);
}
.notify-close .material-icons { font-size: 14px; }

@media (max-width: 600px) {
    .notify-container {
        bottom: var(--space-3);
        right: var(--space-3);
        left: var(--space-3);
        max-width: none;
        width: auto;
    }
    .notify-toast {
        padding: var(--space-2) var(--space-3);
    }
    .notify-icon {
        width: 28px;
        height: 28px;
    }
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-12) var(--space-5);
    text-align: center;
    background: var(--bg-elevated);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    min-height: 240px;
    grid-column: 1 / -1;
}

.empty-state-icon {
    font-size: 56px;
    color: var(--text-disabled);
    opacity: 0.6;
    line-height: 1;
}

.empty-state-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin: 0;
}

.empty-state-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
    max-width: 400px;
}

.empty-state.empty-state-sm {
    min-height: 120px;
    padding: var(--space-6) var(--space-3);
    background: transparent;
    border: none;
}
.empty-state.empty-state-sm .empty-state-icon { font-size: 36px; }
.empty-state.empty-state-sm .empty-state-title { font-size: 13px; }
.empty-state.empty-state-sm .empty-state-subtitle { font-size: 12px; }

/* Уменьшаем пустые состояния внутри виджетов */
.widget-body .empty-state {
    min-height: auto;
    padding: var(--space-4) 0;
    border: none;
    background: transparent;
    flex: 1;
    justify-content: center;
}
.widget-body .empty-state .empty-state-icon { font-size: 36px; margin-bottom: var(--space-1); }
.widget-body .empty-state .empty-state-title { font-size: 13px; color: var(--text-muted); }
.widget-body .empty-state .empty-state-subtitle { display: none; }

@media (max-width: 600px) {
    .empty-state {
        min-height: 180px;
        padding: var(--space-8) var(--space-4);
    }
    .empty-state-icon { font-size: 44px; }
    .empty-state-title { font-size: 14px; }
    .empty-state-subtitle { font-size: 12px; }
}

/* ==========================================================================
   IMG FADE / SHIMMER
   ========================================================================== */

.img-fade {
    opacity: 0;
    transition: opacity 0.4s ease;
    will-change: opacity;
}

.img-fade.loaded {
    opacity: 1;
    will-change: auto;
}

.img-fade.failed {
    opacity: 0.2;
}

.img-wrap {
    position: relative;
    overflow: hidden;
    background: var(--bg-deep);
}

.img-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        var(--bg-hover) 0%,
        #1e1e1e 50%,
        var(--bg-hover) 100%
    );
    background-size: 200% 100%;
    animation: imgShimmer 1.6s ease-in-out infinite;
    z-index: 0;
    transition: opacity 0.3s ease;
}

.img-wrap.loaded::before {
    opacity: 0;
    animation: none;
}

.img-wrap img {
    position: relative;
    z-index: 1;
    -webkit-user-drag: none;
}

@keyframes imgShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.photo-tile .img-wrap,
.album-cover .img-wrap,
.op-photo .img-wrap {
    width: 100%;
    height: 100%;
    display: block;
}

/* ==========================================================================
   DECORATIVE ANIMATIONS
   ========================================================================== */

@keyframes iconGlow {
    0%, 100% { filter: drop-shadow(0 0 4px var(--accent-glow)); }
    50%      { filter: drop-shadow(0 0 10px var(--accent-glow)); }
}

.widget:hover .widget-header .material-icons,
.profile-widget:hover .profile-widget-head .material-icons,
.calc-table-wrap:hover .calc-table-title .material-icons,
.dv-card:hover .dv-section-title .material-icons,
.sc-card:hover .sc-section-title .material-icons {
    animation: iconGlow 1.6s ease-in-out infinite;
}

.app-logo:hover .app-logo-text {
    animation: logoGlow 1.2s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% { text-shadow: 0 0 8px var(--accent-glow); }
    50%      { text-shadow: 0 0 20px var(--accent), 0 0 40px var(--accent-glow); }
}

.widget-chat-footer .btn,
.profile-widget-footer .btn {
    transition: all var(--trans-normal);
}

.widget-chat-footer .btn:hover,
.profile-widget-footer .btn:hover {
    letter-spacing: 1.5px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    animation: fieldFocus 0.35s ease-out;
}

@keyframes fieldFocus {
    0%   { box-shadow: 0 0 0 0 var(--accent-dim); }
    50%  { box-shadow: 0 0 0 5px var(--accent-dim); }
    100% { box-shadow: 0 0 0 3px var(--accent-dim); }
}

.error-msg,
.chat-error {
    animation: errorShake 0.4s ease;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-4px); }
    75%      { transform: translateX(4px); }
}

/* ==========================================================================
   PROFILE LOADING SKELETON
   ========================================================================== */

.profile-loading {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    animation: profileLoadFade 0.25s ease backwards;
}

@keyframes profileLoadFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.profile-loading-header {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    padding: var(--space-6);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 0;
    flex-wrap: wrap;
}

.profile-loading-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--bg-deep);
    border: 2px solid var(--border);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.profile-loading-info {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-loading-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.profile-loading-btn {
    width: 120px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-deep);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.profile-loading-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-5);
    align-items: start;
}

.profile-loading-widget {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    min-height: 340px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.profile-loading-widget-head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border);
}

.profile-loading-icon {
    width: 22px;
    height: 22px;
    border-radius: var(--radius-sm);
    background: var(--bg-deep);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-loading-widget-body {
    padding: var(--space-4) var(--space-6) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    flex: 1;
}

.profile-loading-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px dashed var(--border);
}
.profile-loading-row:last-child { border-bottom: none; }

.profile-loading-line {
    height: 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-deep);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
.profile-loading-line.h-sm { height: 10px; }

.profile-loading-line.w-20 { width: 20%; }
.profile-loading-line.w-25 { width: 25%; }
.profile-loading-line.w-40 { width: 40%; }
.profile-loading-line.w-55 { width: 55%; }
.profile-loading-line.w-70 { width: 70%; }
.profile-loading-line.w-100 { width: 100%; }

.profile-loading-line::before,
.profile-loading-avatar::before,
.profile-loading-icon::before,
.profile-loading-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        100deg,
        transparent 30%,
        rgba(255,102,0,0.08) 50%,
        transparent 70%
    );
    background-size: 200% 100%;
    animation: profileShimmer 1.6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes profileShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.profile-loading-avatar,
.profile-loading-widget {
    animation: profileBreathe 2.4s ease-in-out infinite;
}

@keyframes profileBreathe {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.9; }
}

@media (max-width: 1100px) {
    .profile-loading-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .profile-loading-header {
        padding: var(--space-4);
        gap: var(--space-4);
    }
    .profile-loading-avatar {
        width: 72px;
        height: 72px;
    }
    .profile-loading-widget {
        min-height: 260px;
    }
    .profile-loading-widget-head {
        padding: var(--space-4);
    }
    .profile-loading-widget-body {
        padding: var(--space-3) var(--space-4) var(--space-4);
    }
    .profile-loading-btn {
        width: 100px;
        height: 32px;
    }
}

/* ==========================================================================
   SKELETON (виджеты)
   ========================================================================== */

.skeleton-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.skeleton-line {
    height: 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-deep);
    position: relative;
    overflow: hidden;
}

.skeleton-line::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        100deg,
        transparent 30%,
        rgba(255,102,0,0.08) 50%,
        transparent 70%
    );
    background-size: 200% 100%;
    animation: imgShimmer 1.6s ease-in-out infinite;
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .profile-loading,
    .profile-loading-avatar,
    .profile-loading-widget,
    .profile-loading-line::before,
    .profile-loading-avatar::before,
    .profile-loading-icon::before,
    .profile-loading-btn::before,
    .skeleton-line::before,
    .img-wrap::before {
        animation: none;
    }
}

/* ==========================================================================
 *  ADMIN (универсальные стили для админки и командования)
 *  ========================================================================== */

/* Контейнеры и списки */
.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
    flex-wrap: nowrap;
    transition: border-color var(--trans-fast);
}
.list-item:hover { border-color: var(--border-accent); }

.list-item .list-left {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex: 1;
    min-width: 0;
}
.list-item .list-left.column {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

/* Превью */
.list-item .preview-img {
    width: 64px !important;
    height: 64px !important;
    max-width: 64px !important;
    max-height: 64px !important;
    object-fit: cover;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.list-item .preview-placeholder {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-disabled);
    font-size: 32px;
    flex-shrink: 0;
}

/* Действия */
.list-item .actions {
    display: flex;
    gap: var(--space-2);
    flex-shrink: 0;
    margin-left: auto;
}

/* Кнопки-иконки */
.btn-icon-sm {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--trans-fast);
}
.btn-icon-sm:hover { border-color: var(--accent); color: var(--accent); }
.btn-icon-sm.danger:hover { border-color: var(--error); color: var(--error); }
.btn-icon-sm .material-icons { font-size: 16px; }

/* Селекты */
.admin-select {
    padding: 8px 12px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    min-width: 200px;
    cursor: pointer;
}
.admin-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

/* Редакторы JSON */
.admin-editor {
    width: 100%;
    min-height: 500px;
    background: #050505;
    color: #33ff33;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--space-4);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    tab-size: 4;
}
.admin-editor:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

/* Статусы */
.admin-status {
    margin-top: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    display: none;
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
}
.admin-status.success { display: block; border-color: var(--success); color: var(--success); background: var(--success-dim); }
.admin-status.error   { display: block; border-color: var(--error);   color: var(--error);   background: var(--error-dim); }

/* Бейджи */
.admin-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    line-height: 1.4;
}
.admin-badge-admin  { background: var(--accent); color: var(--text-on-accent); }
.admin-badge-banned { background: var(--error);  color: #fff; }

/* Ряды */
.admin-row-end { display: flex; gap: var(--space-3); margin-top: var(--space-4); flex-wrap: wrap; }
.admin-actions { display: flex; gap: var(--space-3); align-items: center; margin-bottom: var(--space-4); flex-wrap: wrap; }

/* Галерея */
.admin-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-3);
}
.admin-photo-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--space-2);
    transition: border-color var(--trans-fast);
}
.admin-photo-card:hover { border-color: var(--border-accent); }
.admin-photo-card img {
    width: 100% !important;
    height: 120px !important;
    object-fit: cover !important;
    border-radius: var(--radius-sm);
    display: block;
    margin-bottom: 8px;
    cursor: pointer;
}
.admin-photo-card .photo-title {
    font-size: 12px;
    color: var(--text-primary);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-photo-card .photo-actions { display: flex; gap: 3px; flex-wrap: wrap; }

/* Альбомы */
.admin-album {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
    overflow: hidden;
    transition: border-color var(--trans-fast);
}
.admin-album:hover { border-color: var(--border-accent); }

.admin-album-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-3); padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border); cursor: pointer; user-select: none;
    transition: background var(--trans-fast);
}
.admin-album-head:hover { background: var(--bg-hover); }

.admin-album-left { display: flex; align-items: center; gap: var(--space-3); min-width: 0; flex: 1; }
.admin-album-arrow { color: var(--accent); font-size: 12px; line-height: 1; transition: transform 0.22s ease; flex-shrink: 0; }
.admin-album-title { color: #fff; font-family: var(--font-heading); font-size: 15px; font-weight: 700; letter-spacing: 0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-album-count { color: var(--text-muted); font-size: 12px; flex-shrink: 0; }
.admin-album-actions { display: flex; gap: var(--space-1); flex-shrink: 0; flex-wrap: wrap; align-items: center; }
.admin-album-body { padding: var(--space-4); background: var(--bg-base); }

/* Админ-модалки */
.admin-modal-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.78); backdrop-filter: blur(5px);
    z-index: 9999; justify-content: center; align-items: center; padding: var(--space-4);
}
.admin-modal-backdrop.active { display: flex; }

.admin-modal {
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-top: 3px solid var(--accent); border-radius: var(--radius-lg);
    padding: var(--space-6); max-width: 520px; width: 100%;
    max-height: 90vh; overflow-y: auto;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(255,102,0,0.15);
}
.admin-modal h3 {
    font-family: var(--font-heading); font-size: 18px; font-weight: 700;
    color: var(--accent); letter-spacing: 1.5px; text-transform: uppercase;
    margin: 0 0 var(--space-5); display: flex; align-items: center; gap: var(--space-2);
}
.admin-modal h3 .material-icons { font-size: 22px; }
.admin-modal.danger { border-top-color: var(--error); box-shadow: var(--shadow-lg), 0 0 60px rgba(255,51,51,0.2); }
.admin-modal.danger h3 { color: var(--error); }
.admin-modal .modal-actions { display: flex; gap: var(--space-3); margin-top: var(--space-5); justify-content: flex-end; }

/* File input */
.file-input-wrapper { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; }
.file-input-wrapper input[type="file"] {
    flex: 1; min-width: 150px; padding: 8px 12px;
    background: var(--bg-deep); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-secondary);
    font-family: var(--font-body); font-size: 13px; cursor: pointer;
}
.file-input-wrapper input[type="file"]::file-selector-button {
    background: var(--accent-dim); border: 1px solid var(--border-accent);
    color: var(--accent); padding: 4px 12px; border-radius: var(--radius-sm);
    font-family: var(--font-heading); font-size: 11px; font-weight: 700;
    letter-spacing: 0.5px; text-transform: uppercase; cursor: pointer;
    margin-right: 10px; transition: all var(--trans-fast);
}
.file-input-wrapper input[type="file"]::file-selector-button:hover {
    background: var(--accent); color: var(--text-on-accent);
}

/* ==========================================================================
 A DMIN LAYOUT — дополнени*я
 ========================================================================== */

.admin-body {
    background: var(--bg-base);
    min-height: 100vh;
}

/* Сетка: сайдбар + контент */
.admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: var(--space-6);
    padding: var(--space-6) var(--space-5);
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 60px);
}

/* Сайдбар */
.admin-sidebar {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    height: fit-content;
    position: sticky;
    top: 80px;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 10px 14px;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--trans-fast);
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    margin-bottom: 2px;
    text-decoration: none;
    user-select: none;
}
.admin-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.admin-nav-item.active {
    background: var(--accent-dim);
    color: var(--accent);
    border-left: 3px solid var(--accent);
}
.admin-nav-item .material-icons {
    font-size: 20px;
}

/* Правая зона */
.admin-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    min-width: 0;
}

/* Секции */
.admin-section {
    display: none;
    flex-direction: column;
    gap: var(--space-4);
}
.admin-section.active {
    display: flex;
}

.admin-section-title {
    font-family: var(--font-heading);
    font-size: 24px;
    color: #fff;
    margin: 0 0 var(--space-4) 0;
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    letter-spacing: 2px;
    text-transform: uppercase;
}
.admin-section-title .material-icons {
    color: var(--accent);
    font-size: 26px;
    filter: drop-shadow(0 0 6px var(--accent-glow));
}

/* Редактор-блок (бывший inline style="display:none; background:#0d0d0d;...") */
.admin-editor-block {
    background: var(--bg-deep);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-5);
}
.admin-editor-block[hidden] { display: none; }

.admin-editor-title {
    color: var(--accent);
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0 0 var(--space-3) 0;
}

/* Превью текущего изображения в форме */
.admin-current-preview {
    margin-bottom: var(--space-2);
}
.admin-current-preview img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    display: block;
}

/* Inline-поля в форме (Номер + Дата, Широта + Долгота + Зум) */
.admin-inline-fields {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}
.admin-inline-fields > .form-group {
    flex: 1;
    min-width: 140px;
}
.admin-inline-fields > .admin-field-narrow {
    flex: 0 0 100px;
    min-width: 100px;
}

/* Inline-строка (input + кнопки) */
.admin-inline-row {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}
.admin-inline-row > .admin-mono-input {
    flex: 1;
    font-family: 'Consolas', 'Monaco', monospace;
}
.admin-inline-row .btn-icon {
    flex-shrink: 0;
}

/* Label-строка (span + кнопка справа) */
.admin-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
}

/* Фильтр-бар пользователей */
.admin-filter-bar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}
.admin-filter-label {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ==========================================================================
 *  ADMIN — заголовок секции и метрики (в стиле command.php)
 *  ========================================================================== */

.admin-main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.admin-main-title {
    font-family: var(--font-heading);
    font-size: 24px;
    color: #fff;
    margin: 0;
    letter-spacing: 2px;
    text-transform: uppercase;
    line-height: 1.2;
}

.admin-main-meta {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Карточки метрик (как в command.php) */
.admin-dash-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.admin-dash-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: border-color var(--trans-fast);
}
.admin-dash-card:hover {
    border-color: var(--border-accent);
}

.admin-dash-value {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-bottom: 6px;
}

.admin-dash-label {
    font-family: var(--font-heading);
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Мобильная адаптация заголовка и метрик */
@media (max-width: 900px) {
    .admin-dash-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .admin-main-title { font-size: 18px; letter-spacing: 1px; }
    .admin-main-meta { font-size: 11px; }
    .admin-dash-grid { gap: var(--space-3); }
    .admin-dash-value { font-size: 24px; }
    .admin-dash-label { font-size: 10px; }
}

/* Подсказка в модалке удаления */
.admin-modal-hint {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: var(--space-3);
}

/* Иконка-кнопка в inline-row (pwd-value) */
.admin-inline-row > .btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.admin-inline-row > .btn-icon .material-icons {
    font-size: 18px;
}

/* --- Вложения в чате --- */
/* --- Вложения в чате --- */
.chat-msg-attachment {
    margin-top: 6px;
    max-width: 100%;
    display: inline-block; /* Сжимает контейнер до размера картинки */
}
.chat-msg-attachment img {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    cursor: pointer;
    border-radius: 8px; /* Скругление теперь только на самой картинке */
}
.chat-msg-file-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    margin-top: 6px;
    transition: border-color 0.15s;
}
.chat-msg-file-link:hover {
    border-color: var(--accent);
}

/* --- Индикатор "Печатает..." --- */
.chat-typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 16px;
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    height: 20px;
}
.chat-typing-indicator .material-icons {
    font-size: 14px;
    color: var(--accent);
}

/* =========================================================
 *  ФИКСЫ БАГОВ МОБИЛЬНОЙ ВЕРСИИ (v2.6)
 *  ========================================================= */

/* Баг 3: Карта перекрывает мобильное меню */
.mobile-menu {
    z-index: 9999 !important; /* Поднимаем меню выше любых слоев карты */
}

/* Баг 4: Кнопки в профиле (2x2 сетка) */
@media (max-width: 600px) {
    .profile-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-2);
        width: 100%;
    }
    .profile-actions .btn {
        width: 100%;
        padding: 8px 4px;
        font-size: 11px;
        justify-content: center;
    }
}

/* Баг 5: Админка и Командование на мобилке */
@media (max-width: 900px) {
    /* Жестко переводим сетки в одну колонку */
    .admin-layout, .command-container {
        display: flex !important;
        flex-direction: column !important;
        padding: var(--space-3) !important;
        gap: var(--space-3) !important;
    }

    /* Контейнер меню (горизонтальный скролл) */
    .admin-sidebar, .cmd-sidebar {
        position: static !important;
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        width: 100% !important;
        padding: var(--space-2) !important;
        margin-bottom: var(--space-2) !important;
        gap: var(--space-2) !important;
        border-radius: var(--radius-sm) !important;
        scrollbar-width: none;
    }
    .admin-sidebar::-webkit-scrollbar, .cmd-sidebar::-webkit-scrollbar {
        display: none;
    }

    /* Сами кнопки меню */
    .admin-nav-item, .cmd-nav-item {
        flex: 0 0 auto !important;
        width: auto !important;
        margin-bottom: 0 !important;
        padding: 8px 16px !important;
        border-radius: var(--radius-sm) !important;
        font-size: 13px !important;
        background: var(--bg-deep) !important;
        border: 1px solid var(--border) !important;
    }

    /* Активная кнопка */
    .admin-nav-item.active, .cmd-nav-item.active {
        background: var(--accent-dim) !important;
        color: var(--accent) !important;
        border-color: var(--accent) !important;
        border-left: 1px solid var(--accent) !important;
    }

    .admin-nav-item .material-icons, .cmd-nav-item .material-icons {
        font-size: 16px !important;
    }

    /* Дашборды (цифры) в 2 колонки */
    .admin-dash-grid, .cmd-dash-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: var(--space-2) !important;
    }

    /* Правая часть админки */
    .admin-main-header, .cmd-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: var(--space-2) !important;
    }

    /* ========================================= */
    /* ФИКС ТАБЛИЦ: скролл ТОЛЬКО внутри таблицы */
    /* ========================================= */
    .card {
        overflow: visible !important; /* Отменяем скролл карточки, чтобы шапка стояла на месте */
    }

    .cmd-table {
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        width: 100% !important;
        margin-bottom: 0;
    }

    .cmd-table th, .cmd-table td {
        white-space: nowrap !important;
        padding: 10px !important;
    }
}
