.ui-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid transparent;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.ui-chip--info {
    background: var(--ui-chip-info-bg, rgba(77, 171, 247, 0.16));
    color: var(--ui-chip-info-color, #8fd3ff);
    border-color: var(--ui-chip-info-border, rgba(77, 171, 247, 0.35));
}
.ui-chip--info:hover {
    background: var(--ui-chip-info-bg-hover, rgba(77, 171, 247, 0.28));
    border-color: var(--ui-chip-info-border-hover, rgba(77, 171, 247, 0.5));
    transform: translateY(-1px);
    text-decoration: none;
}
.ui-chip--neutral {
    background: var(--ui-chip-neutral-bg, rgba(255, 255, 255, 0.12));
    color: var(--ui-chip-neutral-color, #f8f9fa);
    border-color: var(--ui-chip-neutral-border, rgba(255, 255, 255, 0.2));
}
.ui-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.ui-action:hover {
    transform: translateY(-1px);
    text-decoration: none;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
}
.ui-action:focus-visible,
.ui-chip:focus-visible {
    outline: 3px solid var(--ui-focus-outline, rgba(77, 171, 247, 0.25));
    outline-offset: 2px;
}
.ui-action--primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
}
.ui-action--primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}
.ui-action--secondary {
    background: #e2e8f0;
    color: #1e293b;
    border-color: rgba(148, 163, 184, 0.5);
}
.ui-action--secondary:hover {
    background: #cbd5e1;
}
.ui-action--danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
}
.ui-action--danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}
.ui-action--navy {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    color: #ffffff;
}
.ui-action--navy:hover {
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
}
.ui-action--compact {
    min-height: 36px;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12px;
    box-shadow: none;
}
.menu-server-badge,
.menu-user-badge {
    font-size: 12px;
}
.menu-server-badge {
    gap: 8px;
    align-items: center;
    padding-top: 7px;
    padding-bottom: 7px;
    min-width: 190px;
    max-width: min(320px, 28vw);
}
.menu-server-badge__icon {
    font-size: 13px;
    line-height: 1;
    flex: 0 0 auto;
}
.menu-server-badge__content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    max-width: 100%;
    line-height: 1.1;
}
.menu-server-badge__alias,
.menu-server-badge__hostname {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.menu-server-badge__alias {
    font-weight: 700;
}
.menu-server-badge__alias--host {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-weight: 700;
}
.menu-server-badge__hostname {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    opacity: 0.9;
}
.menu-server-badge__hostname-label {
    flex: 0 0 auto;
    opacity: 0.75;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.menu-server-badge__hostname-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.menu-server-badge__hostname--missing {
    display: block;
    opacity: 0.95;
    letter-spacing: 0.01em;
}
.menu-server-badge--unregistered .menu-server-badge__alias {
    color: #ffe08a;
}
.menu-server-badge--unregistered .menu-server-badge__hostname {
    opacity: 1;
}
.menu-server-badge--unregistered .menu-server-badge__alias--host {
    color: inherit;
}
.menu-server-badge--unregistered .menu-server-badge__hostname--missing {
    color: #ffe08a;
}
.menu-user-badge {
    gap: 8px;
    align-items: center;
    padding-top: 7px;
    padding-bottom: 7px;
    min-width: 120px;
}
.menu-user-badge__icon {
    font-size: 13px;
    line-height: 1;
    flex: 0 0 auto;
}
.menu-user-badge__content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    max-width: 100%;
    line-height: 1.1;
}
.menu-user-badge__label {
    font-size: 10px;
    opacity: 0.72;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.menu-user-badge__value {
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
@media (max-width: 1280px) {
    .menu-server-badge {
        min-width: 170px;
        max-width: 260px;
    }
    .menu-user-badge {
        min-width: 110px;
    }
}
@media (max-width: 900px) {
    .menu-server-badge {
        min-width: 0;
        max-width: 100%;
    }
    .menu-user-badge {
        min-width: 0;
        max-width: 100%;
    }
}
.menu-logout-link {
    border-color: rgba(255, 255, 255, 0.22);
}
.menu-logout-link:hover {
    border-color: rgba(255, 255, 255, 0.4);
}
.header-auth-layer {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 23, 0.66);
    backdrop-filter: blur(1.5px);
    z-index: 3100;
    padding: 16px;
}
.header-auth-layer.is-open {
    display: flex;
    animation: headerAuthLayerFadeIn 0.2s ease-out;
}
.header-auth-layer.is-closing {
    display: flex;
    animation: headerAuthLayerFadeOut 0.18s ease-in forwards;
}
.header-auth-layer__dialog {
    width: min(920px, 96vw);
    height: min(90vh, 820px);
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 14px;
    box-shadow: 0 24px 52px rgba(2, 6, 23, 0.42);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: headerAuthDialogPopIn 0.22s cubic-bezier(0.2, 0.75, 0.22, 1);
    transform-origin: center top;
}
.header-auth-layer.is-closing .header-auth-layer__dialog {
    animation: headerAuthDialogPopOut 0.18s ease-in forwards;
}
.header-auth-layer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #eff6ff 0%, #e0edff 100%);
    border-bottom: 1px solid rgba(37, 99, 235, 0.2);
}
.header-auth-layer__title-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.header-auth-layer__title {
    font-size: 14px;
    font-weight: 700;
    color: #1d4ed8;
    letter-spacing: 0.01em;
}
.header-auth-layer__status {
    font-size: 11px;
    color: #475569;
    opacity: 0.85;
}
.header-auth-layer__close {
    border: 1px solid rgba(37, 99, 235, 0.22);
    background: #ffffff;
    color: #334155;
    border-radius: 8px;
    width: 34px;
    height: 34px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}
.header-auth-layer__frame {
    flex: 1;
    width: 100%;
    border: 0;
    background: transparent;
    transition: opacity 0.18s ease;
}
.header-auth-layer__dialog.is-loading .header-auth-layer__frame {
    opacity: 0.35;
}
[data-theme='dark'] .header-auth-layer__dialog {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.24);
}
[data-theme='dark'] .header-auth-layer__header {
    background: linear-gradient(135deg, rgba(37,99,235,0.26) 0%, rgba(30,64,175,0.2) 100%);
    border-bottom-color: rgba(96, 165, 250, 0.34);
}
[data-theme='dark'] .header-auth-layer__title {
    color: #bfdbfe;
}
[data-theme='dark'] .header-auth-layer__status {
    color: #cbd5e1;
}
[data-theme='dark'] .header-auth-layer__close {
    background: rgba(15,23,42,0.9);
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.4);
}
[data-theme='dark'] .header-auth-layer__close:hover {
    background: rgba(37,99,235,0.2);
}
@keyframes headerAuthLayerFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes headerAuthLayerFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}
@keyframes headerAuthDialogPopIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.988);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
@keyframes headerAuthDialogPopOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(8px) scale(0.992);
    }
}
@media (max-width: 640px) {
    .header-auth-layer {
        padding: 12px;
    }
    .header-auth-layer__dialog {
        width: min(960px, 100vw);
        height: min(92vh, 840px);
        border-radius: 12px;
    }
    .header-auth-layer__header {
        padding: 10px 12px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .header-auth-layer.is-open,
    .header-auth-layer.is-closing,
    .header-auth-layer__dialog,
    .header-auth-layer.is-closing .header-auth-layer__dialog {
        animation: none;
    }
    .header-auth-layer__frame {
        transition: none;
    }
}
