html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5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bGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* ── Splash / WASM loading screen ── */
.rupor-splash {
    position: fixed; inset: 0;
    background: #1e1f22;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    z-index: 9999;
}

/* Logo */
.rupor-splash__logo {
    width: 88px; height: 88px;
    animation: splash-pulse 2s ease-in-out infinite;
    margin-bottom: 20px;
}
.rupor-splash__logo svg {
    width: 100%; height: 100%;
    filter: drop-shadow(0 0 24px rgba(88,101,242,.55));
}
@keyframes splash-pulse {
    0%, 100% { transform: scale(1);   opacity: 1; }
    50%       { transform: scale(1.08); opacity: .85; }
}

/* App name */
.rupor-splash__title {
    font-size: 26px; font-weight: 700;
    color: #fff; letter-spacing: .5px;
    margin-bottom: 32px;
}

/* Animated dots */
.rupor-splash__dots {
    display: flex; gap: 8px;
    margin-bottom: 48px;
}
.rupor-splash__dots span {
    width: 8px; height: 8px; border-radius: 50%;
    background: #5865f2;
    animation: splash-dot 1.2s ease-in-out infinite;
}
.rupor-splash__dots span:nth-child(1) { animation-delay: 0s; }
.rupor-splash__dots span:nth-child(2) { animation-delay: .2s; }
.rupor-splash__dots span:nth-child(3) { animation-delay: .4s; }
@keyframes splash-dot {
    0%, 80%, 100% { transform: scale(.7); opacity: .35; }
    40%           { transform: scale(1.2); opacity: 1; }
}

/* Progress bar */
.rupor-splash__bar-wrap {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 3px; background: rgba(255,255,255,.07);
}
.rupor-splash__bar {
    height: 100%;
    background: linear-gradient(90deg, #5865f2, #7289da);
    transition: width .08s ease-out;
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 8px rgba(88,101,242,.7);
}

/* Percentage text */
.rupor-splash__percent {
    position: fixed; bottom: 12px;
    font-size: 12px; color: rgba(255,255,255,.3);
    letter-spacing: .5px;
}
.rupor-splash__percent::after {
    content: var(--blazor-load-percentage-text, "Загрузка...");
}

/* Keep legacy class names harmless (Blazor may still write them) */
.loading-progress { display: none; }
.loading-progress-text { display: none; }

code {
    color: #c02d76;
}


/* ── Chat PWA additions ── */
html, body { height: 100%; margin: 0; background: #313338; }
#app { height: 100%; }

.chat-empty-state {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; height: 100%; color: #949ba4;
}
.chat-empty-icon { font-size: 48px; margin-bottom: 12px; }
.chat-empty-text { font-size: 16px; }

.chat-loading, .chat-no-msgs {
    text-align: center; padding: 40px 0; color: #949ba4; font-size: 14px;
}

.chat-panel-hdr-av { margin-right: 8px; flex-shrink: 0; }

/* ── App Shell ── */
.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: #313338;
}
.app-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* ── App Rail ── */
.app-rail {
    width: 72px;
    min-width: 72px;
    background: #1e1f22;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    gap: 0;
    overflow-y: auto;
    overflow-x: hidden;
}
.app-rail-top { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; }
.app-rail-bottom { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.app-rail-sep { width: 32px; height: 2px; background: rgba(255,255,255,.1); border-radius: 1px; margin: 4px 0; }

.app-rail-item {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #313338;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dbdee1;
    text-decoration: none;
    font-size: 18px;
    transition: border-radius .15s, background .15s;
    flex-shrink: 0;
    overflow: hidden;
    border: none;
    cursor: pointer;
}
.app-rail-item:hover,
.app-rail-item--active {
    border-radius: 16px;
    background: #5865f2;
    color: #fff;
}
.app-rail-item--add { color: #3ba55d; background: #313338; }
.app-rail-item--add:hover { background: #3ba55d; color: #fff; }

.app-rail-srv-img { width: 100%; height: 100%; object-fit: cover; }
.app-rail-srv-initials { font-size: 14px; font-weight: 600; }

.app-rail-profile {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #5865f2;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    transition: border-radius .15s;
}
.app-rail-profile:hover { border-radius: 16px; }
.app-rail-av { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }

/* ── Modals ── */
.app-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.app-modal {
    background: #2b2d31;
    border-radius: 8px;
    padding: 24px;
    width: 380px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    color: #dbdee1;
}
.app-modal-header {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #fff;
}
.app-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}
.app-modal-btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    background: #4e5058;
    color: #fff;
}
.app-modal-btn:hover { background: #5d6069; }
.app-modal-btn--primary { background: #5865f2; }
.app-modal-btn--primary:hover { background: #4752c4; }
.app-modal-btn--danger { background: #da373c; }
.app-modal-btn--danger:hover { background: #c03034; }
.app-modal-btn:disabled { opacity: .5; cursor: not-allowed; }
.app-modal-title { color: #f2f3f5; font-size: 20px; font-weight: 700; margin-bottom: 8px; text-align: center; }
.app-modal-hint  { color: #949ba4; font-size: 13px; text-align: center; margin-bottom: 20px; }
.app-modal-field { margin-bottom: 16px; }
.app-modal-label { display: block; color: #b5bac1; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; }
.app-modal-input { width: 100%; padding: 10px 14px; background: #1e1f22; border: 1px solid #3f4147; border-radius: 6px; color: #f2f3f5; font-size: 14px; outline: none; box-sizing: border-box; transition: border-color .15s; }
.app-modal-input:focus { border-color: #5865f2; }
.app-modal-input::placeholder { color: #72767d; }

/* ── Server choice modal ── */
.app-srv-choice-box {
    background: #313338; border-radius: 12px;
    padding: 28px; min-width: 340px; max-width: 460px; width: 90%;
    box-shadow: 0 16px 48px rgba(0,0,0,.5);
}
.app-srv-choice-btns { display: flex; gap: 14px; }
.app-srv-choice-btn {
    flex: 1; padding: 20px 16px; border-radius: 10px;
    background: #2b2d31; border: 2px solid transparent;
    cursor: pointer; display: flex; flex-direction: column;
    align-items: center; gap: 8px;
    transition: border-color .15s, background .15s;
}
.app-srv-choice-btn:hover { border-color: #5865f2; background: #232428; }
.app-srv-choice-label { color: #f2f3f5; font-weight: 600; font-size: 14px; }
.app-srv-choice-hint  { color: #949ba4; font-size: 12px; }

/* ── Create server modal ── */
.app-create-srv-modal {
    background: #313338; border-radius: 12px;
    padding: 28px; min-width: 320px; max-width: 440px; width: 90%;
    box-shadow: 0 16px 48px rgba(0,0,0,.5);
}
.app-create-srv-img {
    width: 80px; height: 80px; border-radius: 50%;
    border: 2px dashed #4e5058; background: #2b2d31;
    margin: 0 auto 20px; cursor: pointer;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    overflow: hidden; position: relative;
    transition: border-color .15s;
}
.app-create-srv-img:hover { border-color: #5865f2; }
.app-create-srv-img-preview { width: 100%; height: 100%; object-fit: cover; }
.app-create-srv-img-hover {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.6); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600; opacity: 0;
    transition: opacity .15s;
}
.app-create-srv-img:hover .app-create-srv-img-hover { opacity: 1; }

/* ── Profile modal ── */
.app-profile-modal {
    background: #2b2d31;
    border-radius: 12px;
    width: 420px; max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0,0,0,.6);
    display: flex; flex-direction: column;
}
.app-profile-banner {
    height: 72px;
    background: linear-gradient(135deg, #5865f2 0%, #3ba55d 100%);
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}
.app-profile-av-section {
    display: flex; align-items: flex-end; gap: 14px;
    padding: 0 24px 12px;
    margin-top: -36px;
}
.app-profile-av-wrap {
    position: relative;
    width: 80px; height: 80px;
    border-radius: 50%;
    border: 4px solid #2b2d31;
    overflow: hidden;
    flex-shrink: 0;
    background: #5865f2;
}
.app-profile-av-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.app-profile-av-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; font-weight: 700; color: #fff;
}
.app-profile-av-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.55);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .15s; cursor: pointer;
    border-radius: 50%;
}
.app-profile-av-wrap:hover .app-profile-av-overlay { opacity: 1; }
.app-profile-status-dot {
    position: absolute; bottom: 4px; right: 4px;
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid #2b2d31;
}
.app-profile-status-dot--online { background: #23a55a; }
.app-profile-status-dot--away   { background: #f0b232; }
.app-profile-status-dot--dnd    { background: #ed4245; }
.app-profile-username {
    font-size: 18px; font-weight: 700; color: #f2f3f5;
    padding-bottom: 6px;
}
.app-profile-body {
    padding: 8px 24px 24px;
}
.app-profile-about { resize: vertical; min-height: 72px; font-family: inherit; }
.app-profile-error { color: #ed4245; font-size: 13px; margin-bottom: 10px; }

/* Status picker */
.app-status-row { display: flex; gap: 8px; }
.app-status-btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 6px; border-radius: 8px;
    background: #1e1f22; border: 2px solid transparent;
    color: #b5bac1; font-size: 13px; font-weight: 500; cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
.app-status-btn:hover { background: #2e2f34; color: #f2f3f5; }
.app-status-btn--active { border-color: #5865f2; color: #f2f3f5; background: #2e2f34; }
.app-status-dot {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.app-status-dot--online { background: #23a55a; }
.app-status-dot--away   { background: #f0b232; }
.app-status-dot--dnd    {
    background: #ed4245;
    /* DND = красный круг с чёрточкой внутри */
    position: relative;
}
.app-status-dot--dnd::after {
    content: '';
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 5px; height: 2px;
    background: #fff; border-radius: 1px;
}

/* Rail profile with status dot */
.app-rail-profile-wrap {
    position: relative; cursor: pointer;
    width: 48px; height: 48px;
    flex-shrink: 0;
}
.app-rail-status-dot {
    position: absolute; bottom: 0; right: 0;
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid #1e1f22;
    pointer-events: none;
}
.app-rail-status-dot--online { background: #23a55a; }
.app-rail-status-dot--away   { background: #f0b232; }
.app-rail-status-dot--dnd    { background: #ed4245; }

/* Legacy - keep for existing markup */
.app-profile-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.app-profile-field label { font-size: 11px; font-weight: 600; color: #b5bac1; text-transform: uppercase; }
