/* ============================================================
   НЕумный дом — основной стиль (СКОМПИЛИРОВАН)
   Сгенерировано: 2026-12-05 17:47:22 (админка → 🎨 Assets)
   НЕ редактировать вручную! Правьте исходники в assets/css/
   ============================================================ */

/* ============================================================
   n01-tokens.css — Design tokens: colors, spacing, type, radius, shadow, z-index
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n01-variables.css, n07-mobile-shell.css (root), n08-sidebar.css (root)
   ============================================================ */

:root {
    --primary: #2f6fed;
    --primary-hover: #1e5ad6;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #0ea5e9;

    --bg: #f0f2f5;
    --card-bg: #fff;
    --card-bg-hover: #f6f8fa;
    --border: #d0d7de;
    --text: #1e2a3a;
    --muted: #656d76;
    --header-bg: #fff;
    --input-bg: #fff;
    --shadow: rgba(0, 0, 0, 0.08);
    --shadow-lg: rgba(0, 0, 0, 0.15);

    --chat-bg: #fff;
    --chat-header-bg: #f6f8fa;
    --chat-border: #d0d7de;
    --chat-text: #1e2a3a;
    --chat-muted: #656d76;
    --chat-mine-bg: #e7f6ec;
    --chat-mine-border: #22c55e;
    --chat-mine-text: #15803d;
    --chat-other-bg: #eef4ff;
    --chat-other-border: #2f6fed;
    --chat-other-text: #1d4ed8;
    --chat-accent: #b45309;
    --chat-overlay: rgba(30, 42, 58, 0.05);
    --chat-overlay-hover: rgba(30, 42, 58, 0.1);

    --push-on-color: #1e5ad6;
    --push-on-bg: rgba(47, 111, 237, 0.12);
    --push-on-bg-hover: rgba(47, 111, 237, 0.2);
    --push-off-color: #656d76;

    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --geek-mono: "JetBrains Mono", "Fira Code", "Courier New", monospace;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-full: 999px;

    --header-h: 60px;

    --primary-rgb: 47, 111, 237;
    --success-rgb: 34, 197, 94;
    --warning-rgb: 245, 158, 11;
    --danger-rgb: 239, 68, 68;
    --info-rgb: 14, 165, 233;

    --card-bg-rgb: 255, 255, 255;
    --card-bg-hover-rgb: 246, 248, 250;
    --border-rgb: 208, 215, 222;
    --text-rgb: 30, 42, 58;
    --muted-rgb: 101, 109, 118;
    --header-bg-rgb: 255, 255, 255;
    --input-bg-rgb: 255, 255, 255;
}

[data-theme="dark"] {
    --bg: #0d1117;
    --card-bg: #1a1f2e;
    --card-bg-hover: #222839;
    --border: #2d3548;
    --text: #e6edf3;
    --muted: #8b949e;
    --header-bg: #161b22;
    --input-bg: #161b22;
    --shadow: rgba(0, 0, 0, 0.4);
    --shadow-lg: rgba(0, 0, 0, 0.6);

    --chat-bg: #0a0e1a;
    --chat-header-bg: #141a2e;
    --chat-border: #1e2a4a;
    --chat-text: #e6edf3;
    --chat-muted: #8b949e;
    --chat-mine-bg: #1a3a2e;
    --chat-mine-border: #2ea95f;
    --chat-mine-text: #7ee2a8;
    --chat-other-bg: #141a2e;
    --chat-other-border: #2f6fed;
    --chat-other-text: #b8d4ff;
    --chat-accent: #ffd700;
    --chat-overlay: rgba(255, 255, 255, 0.05);
    --chat-overlay-hover: rgba(255, 255, 255, 0.1);

    --push-on-color: #7ab0ff;
    --push-on-bg: rgba(47, 111, 237, 0.3);
    --push-on-bg-hover: rgba(47, 111, 237, 0.42);
    --push-off-color: #8b949e;

    --card-bg-rgb: 26, 31, 46;
    --card-bg-hover-rgb: 34, 40, 57;
    --border-rgb: 45, 53, 72;
    --text-rgb: 230, 237, 243;
    --muted-rgb: 139, 148, 158;
    --header-bg-rgb: 22, 27, 34;
    --input-bg-rgb: 22, 27, 34;
}

:root {
    --z-base:            1;
    --z-sticky:          50;
    --z-header:          100;
    --z-backdrop:        200;
    --z-drawer:          210;
    --z-bottom-nav:      150;
    --z-dropdown:        300;
    --z-modal:           1000;
    --z-lightbox:        9999;
    --z-context-menu:    10001;
    --z-toast:           10002;

    
    --drawer-w:          min(360px, 88vw);
    --bottom-nav-h:      56px;
}

:root {
    --sidebar-w:             280px;
    --sidebar-w-collapsed:   64px;
    
    --sidebar-nav-padding:   8px 0;
    --sidebar-link-gap:      12px;
    --sidebar-link-padding:  8px 12px;
    --sidebar-link-radius:   6px;
    --sidebar-transition:    200ms cubic-bezier(.2, .8, .2, 1);
    --sidebar-backdrop:      rgba(0, 0, 0, .45);
    --sidebar-edge-w:        20px;
    --z-menu-toggle:         220;
}



:root {
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 32px;
    --space-8: 40px;

    --text-xs: 11px;
    --text-sm: 12px;
    --text-base: 14px;
    --text-md: 15px;
    --text-lg: 18px;
    --text-xl: 22px;
    --text-2xl: 28px;

    --leading-tight: 1.25;
    --leading-normal: 1.55;

    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-full: 999px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .18);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, .18);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, .28);
    --focus-ring: 0 0 0 3px rgba(var(--primary-rgb), .30);

    --transition-fast: .14s ease;
    --transition-base: .18s ease;

    --container-max: 1280px;
    --header-h: 60px;

    --z-base: 1;
    --z-sticky: 50;
    --z-header: 100;
    --z-bottom-nav: 150;
    --z-backdrop: 200;
    --z-drawer: 210;
    --z-menu-toggle: 220;
    --z-dropdown: 300;
    --z-modal: 1000;
    --z-lightbox: 9999;
    --z-context-menu: 10001;
    --z-toast: 10002;
}


/* ============================================================
   n02-reset.css — Reset, base typography, focus-visible, selection
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n02-reset.css
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.3s ease, color 0.3s ease;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text);
    margin-bottom: 0.6em;
    line-height: 1.3;
}

h1 { font-size: 1.8rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.9rem; }

p {
    margin-bottom: 1em;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

code, pre {
    font-family: var(--geek-mono);
    background: var(--card-bg-hover);
    border-radius: var(--radius-sm);
}

code {
    padding: 2px 6px;
    font-size: 0.9em;
}

pre {
    padding: 12px;
    overflow-x: auto;
    border: 1px solid var(--border);
}

/* ─── v2 base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
body { min-height: 100vh; line-height: 1.55; }
::selection { background: rgba(var(--primary-rgb), .24); color: var(--text); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}


/* ============================================================
   n03-layout.css — Layout, container, scrollbar
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n03-layout.css, n05-scrollbar.css
   ============================================================ */

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

.site-main {
    flex: 1;
    padding: 24px 0;
}

.site-footer {
    background: var(--header-bg);
    border-top: 1px solid var(--border);
    color: var(--muted);
    padding: 16px 0;
    font-size: 13px;
    margin-top: auto;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--bg);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--border);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* ─── v2 layout ───────────────────────────────────────────── */
.container {
    width: min(100% - (2 * var(--space-4)), var(--container-max));
    margin-inline: auto;
}
.site-main { padding-block: var(--space-6); }


/* ============================================================
   n04-header.css — Site header, user menu, top navigation
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n04-header.css
   ============================================================ */

.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    height: var(--header-h);
    display: flex;
    align-items: stretch;
    padding-top: env(safe-area-inset-top, 0);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    height: 100%;
}

.header-inner {
    position: relative;
}


.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
    text-decoration: none;
    line-height: 1;
    padding: 8px 4px;
    border-radius: 6px;
    transition: background .15s ease;
    white-space: nowrap;
}
.site-logo:hover { background: var(--card-bg-hover); text-decoration: none; }
.site-logo__glyph { font-size: 20px; line-height: 1; }
.site-logo__text { display: inline-block; }


.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.menu-toggle:hover {
    background: var(--card-bg-hover);
    border-color: var(--primary);
}
.menu-toggle__bar {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: transform .2s ease, opacity .2s ease;
}
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }


.site-nav-desktop {
    display: none;
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
}

.site-nav-desktop__list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav-desktop__item { display: flex; }

.site-nav-desktop__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    min-height: 40px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}
.site-nav-desktop__link:hover {
    background: var(--card-bg-hover);
    border-color: var(--border);
    text-decoration: none;
    color: var(--text);
}
.site-nav-desktop__link.is-active,
.site-nav-desktop__link[aria-current="page"] {
    background: rgba(47, 111, 237, .10);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}
.site-nav-desktop__icon { font-size: 18px; line-height: 1; flex-shrink: 0; }
.site-nav-desktop__label { line-height: 1; }

.site-nav-desktop__badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}


.header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.theme-toggle--icon-only,
.push-toggle--icon-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}
.theme-toggle--icon-only:hover,
.push-toggle--icon-only:hover {
    background: var(--card-bg-hover);
    border-color: var(--border);
}
.theme-toggle--icon-only .theme-toggle__glyph,
.push-toggle--icon-only .push-toggle__glyph {
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.push-toggle--icon-only { position: relative; }
.push-toggle--icon-only.is-subscribed {
    background: rgba(34, 197, 94, .12);
    border-color: var(--success);
    color: var(--success);
}
.push-toggle--icon-only.is-subscribed::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
}


.user-menu {
    position: relative;
    display: inline-block;
}

.user-menu__toggle {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px 5px 5px;
    min-height: 40px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    white-space: nowrap;
}
.user-menu__toggle::-webkit-details-marker { display: none; }
.user-menu__toggle::marker { display: none; content: ''; }

.user-menu:not(.user-menu--sidebar) .user-menu__toggle {
    transition: background .15s ease, border-color .15s ease;
}
.user-menu:not(.user-menu--sidebar) .user-menu__toggle:hover {
    background: var(--card-bg-hover);
    border-color: var(--border);
}
.user-menu:not(.user-menu--sidebar)[open] > .user-menu__toggle {
    background: var(--card-bg-hover);
    border-color: var(--border);
}

.user-menu__avatar {
    width: 32px;
    height: 32px;
    font-size: 14px;
    flex-shrink: 0;
}

.user-menu__name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu__caret {
    font-size: 10px;
    color: var(--muted);
    transition: transform .15s ease;
    line-height: 1;
}
.user-menu[open] .user-menu__caret { transform: rotate(180deg); }

.user-menu__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    padding: 6px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 32px var(--shadow-lg);
    z-index: var(--z-dropdown);
    animation: userMenuIn .16s ease-out;
}
@keyframes userMenuIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.user-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    min-height: 40px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
    -webkit-tap-highlight-color: transparent;
}
.user-menu__item:hover {
    background: var(--card-bg-hover);
    color: var(--primary);
    text-decoration: none;
}
.user-menu__item--danger { color: var(--danger); }
.user-menu__item--danger:hover { background: rgba(239, 68, 68, .10); color: var(--danger); }
.user-menu__icon { font-size: 16px; line-height: 1; width: 20px; text-align: center; flex-shrink: 0; }
.user-menu__label { flex: 1; min-width: 0; }

.user-menu__divider {
    margin: 6px 4px;
    border: none;
    border-top: 1px solid var(--border);
}

.user-menu__form { display: block; margin: 0; }


.nav-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    min-height: 40px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}
.nav-icon:hover {
    background: var(--card-bg-hover);
    border-color: var(--border);
    text-decoration: none;
    color: var(--text);
}
.nav-icon.is-active,
.nav-icon.active {
    background: rgba(47, 111, 237, .10);
    border-color: var(--primary);
    color: var(--primary);
}
.nav-icon__glyph {
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.nav-icon__label {
    display: inline-block;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

button.nav-icon { font-family: inherit; }

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.site-nav__divider,
.nav-divider {
    flex-shrink: 0;
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 4px;
    align-self: center;
}
.nav-form { display: inline-flex; margin: 0; }
.nav-form button { cursor: pointer; font-family: inherit; }
.nav-form button:hover { color: var(--primary); }


.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    min-height: 40px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}
.theme-toggle:hover { background: var(--card-bg-hover); border-color: var(--primary); }
.theme-toggle__glyph {
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.theme-toggle__label { display: inline-block; line-height: 1; min-width: 0; }

.push-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    min-height: 40px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}
.push-toggle__glyph,
.push-toggle .push-icon {
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.push-toggle__label { display: inline-block; line-height: 1; min-width: 0; }
.push-toggle:hover { background: var(--card-bg-hover); border-color: var(--primary); }
.push-toggle:hover .push-icon,
.push-toggle:hover .push-toggle__glyph { filter: brightness(1.1); }
.push-toggle.is-loading { opacity: .7; pointer-events: none; }
.push-toggle.is-subscribed {
    background: rgba(34, 197, 94, .12);
    border-color: var(--success);
    color: var(--success);
}
.push-toggle.is-subscribed:hover {
    background: rgba(34, 197, 94, .22);
    border-color: var(--success);
    color: var(--success);
}
.push-toggle.is-subscribed::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
}
[data-theme="dark"] .push-toggle.is-subscribed::after { background: var(--success); }
.push-toggle.is-unsubscribed {
    background: transparent;
    border-color: var(--border);
    color: var(--muted);
}
.push-toggle.is-unsubscribed:hover { color: var(--text); }


.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    justify-content: flex-end;
    min-width: 0;
}
.site-nav__header { display: none; }
.site-nav__list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-nav__item { display: flex; }
.site-nav__actions { display: flex; align-items: center; gap: 6px; }
.site-nav__user {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 4px;
}
.site-nav__user-name {
    font-size: 13px;
    color: var(--muted);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: var(--z-backdrop);
    animation: navBackdropIn .18s ease-out;
}
.site-nav-backdrop[hidden] { display: none; }
@keyframes navBackdropIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}


@media (max-width: 768px) {
    .menu-toggle { display: inline-flex; }
    .site-logo__text { display: none; }
    .site-nav-desktop { display: none !important; }

    .push-toggle--icon-only { display: none; }
    .user-menu__name { display: none; }
    .user-menu__toggle { padding: 4px; min-height: 40px; }
    .user-menu__caret { display: none; }

    .site-nav {
        position: fixed;
        top: calc(var(--header-h) + env(safe-area-inset-top, 0));
        left: 0; right: 0; bottom: 0;
        max-height: calc(100dvh - var(--header-h) - env(safe-area-inset-top, 0));
        padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0));
        background: var(--header-bg);
        border-top: 1px solid var(--border);
        box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        z-index: var(--z-drawer);
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        justify-content: flex-start;
        transform: translateY(-8px);
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
        transition: transform .2s ease, opacity .2s ease, visibility 0s .2s;
    }
    .site-nav.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
        transition: transform .2s ease, opacity .2s ease, visibility 0s 0s;
    }

    .site-nav__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 4px 4px 12px;
        border-bottom: 1px solid var(--border);
        margin-bottom: 8px;
    }
    .site-nav__title { font-size: 16px; font-weight: 700; color: var(--text); }
    .site-nav__close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px; height: 36px;
        padding: 0;
        background: transparent;
        border: 1px solid var(--border);
        border-radius: 6px;
        color: var(--text);
        font-size: 22px;
        line-height: 1;
        font-family: inherit;
        cursor: pointer;
        transition: background .15s ease, border-color .15s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .site-nav__close:hover {
        background: var(--card-bg-hover);
        border-color: var(--danger);
        color: var(--danger);
    }

    .site-nav__list {
        display: flex;
        flex-direction: column;
        gap: 4px;
        width: 100%;
    }
    .site-nav__item { width: 100%; }

    .nav-icon {
        display: flex;
        width: 100%;
        min-height: 48px;
        padding: 10px 12px;
        gap: 12px;
        font-size: 15px;
        justify-content: flex-start;
        text-align: left;
        border-radius: 8px;
    }
    .nav-icon__glyph { font-size: 22px; width: 28px; justify-content: flex-start; }
    .nav-icon__label { flex: 1; text-align: left; overflow: visible; text-overflow: clip; }
    .nav-badge { margin-left: auto; }

    .site-nav__divider,
    .nav-divider {
        width: 100%;
        height: 1px;
        margin: 8px 0;
        align-self: stretch;
    }

    .site-nav__actions { flex-direction: column; align-items: stretch; gap: 4px; width: 100%; }

    .theme-toggle,
    .push-toggle {
        display: flex;
        width: 100%;
        min-height: 48px;
        padding: 10px 12px;
        gap: 12px;
        justify-content: flex-start;
        text-align: left;
        border-radius: 8px;
        font-size: 15px;
    }
    .theme-toggle__glyph,
    .push-toggle__glyph { font-size: 22px; width: 28px; justify-content: flex-start; }
    .theme-toggle__label,
    .push-toggle__label { flex: 1; text-align: left; overflow: visible; text-overflow: clip; }

    .site-nav__user {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-top: auto;
        padding-top: 12px;
        border-top: 1px solid var(--border);
    }
    .site-nav__user-name { font-size: 14px; font-weight: 600; color: var(--text); max-width: none; }
}


@media (min-width: 769px) {
    .menu-toggle { display: none; }
    .site-nav-desktop { display: flex; }
    .site-nav { display: none; }
    .site-nav-backdrop { display: none; }
}


@media (max-width: 640px) {
    .site-logo { font-size: 15px; padding: 8px 2px; }
    .site-nav { padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0)); }
    .nav-icon, .theme-toggle, .push-toggle { padding: 10px 10px; }
}


@media (hover: none) and (pointer: coarse) {
    .nav-icon:hover, .theme-toggle:hover, .push-toggle:hover {
        background: transparent;
        border-color: var(--border);
    }
    .menu-toggle:hover { background: transparent; border-color: var(--border); }
    .site-nav__close:hover { background: transparent; border-color: var(--border); color: var(--text); }
    .site-nav-desktop__link:hover { background: transparent; border-color: transparent; }
    .user-menu__toggle:hover { background: transparent; border-color: transparent; }
}


@media (prefers-reduced-motion: reduce) {
    .user-menu__dropdown { animation: none; }
    .site-nav, .site-nav-backdrop { transition: none; }
}

/* ─── v2 header polish ────────────────────────────────────── */
.site-header {
    box-shadow: 0 1px 0 var(--border), var(--shadow-sm);
    backdrop-filter: saturate(140%) blur(10px);
}


/* ============================================================
   n05-mobile.css — Mobile shell, bottom nav, PWA baseline
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n06-mobile-pwa.css, n07-mobile-shell.css
   ============================================================ */

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    text-size-adjust: 100%;
}

body {
    min-height: 100dvh;
    overscroll-behavior-y: none;
}

@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    textarea,
    select,
    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px;
    }
}


@media (hover: none) and (pointer: coarse) {
    button,
    .btn,
    .nav-icon,
    .theme-toggle,
    .push-toggle,
    .menu-toggle,
    .site-nav__close {
        min-height: 40px;
    }

    .btn:hover {
        transform: none;
    }
}


.site-footer {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
}

.site-main {
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}


.pwa-install-btn {
    position: fixed;
    right: calc(16px + env(safe-area-inset-right, 0));
    bottom: calc(16px + env(safe-area-inset-bottom, 0));
    z-index: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(47, 111, 237, .35);
    transition: transform .15s ease, box-shadow .15s ease;
    -webkit-tap-highlight-color: transparent;
}

.pwa-install-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(47, 111, 237, .42);
}

.pwa-install-btn[hidden] {
    display: none;
}


@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .btn:hover,
    .pwa-install-btn:hover {
        transform: none;
    }
}


@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 4px;
        height: 4px;
    }

    ::-webkit-scrollbar-thumb {
        background: rgba(127, 127, 127, .35);
        border-radius: 2px;
    }
}




body.is-nav-open {
    overflow: hidden;
    touch-action: none;
}

body.is-nav-open .site-nav-backdrop {
    display: block;
}


@media (max-width: 768px) {

    .site-nav {
        -webkit-user-select: none;
        user-select: none;
    }

    .site-nav__list {
        scrollbar-width: thin;
    }

    .site-nav__list::-webkit-scrollbar {
        width: 4px;
    }

    .site-nav__list::-webkit-scrollbar-thumb {
        background: rgba(127, 127, 127, .3);
        border-radius: 2px;
    }

    .nav-icon:focus-visible,
    .theme-toggle:focus-visible,
    .push-toggle:focus-visible,
    .menu-toggle:focus-visible,
    .site-nav__close:focus-visible,
    .site-nav__user .btn:focus-visible {
        outline: 2px solid var(--primary);
        outline-offset: 2px;
    }

    .site-nav {
        will-change: transform, opacity;
        backface-visibility: hidden;
    }
}


@media (min-width: 769px) and (max-width: 1024px) {
    .site-nav {
        gap: 2px;
    }

    .nav-icon {
        padding: 8px 8px;
        font-size: 13px;
    }

    .nav-icon__label {
    }
}


.site-bottom-nav {
    display: none;               
}

@media (max-width: 768px) {
    .site-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: var(--z-bottom-nav);
        display: flex;
        align-items: stretch;
        height: var(--bottom-nav-h);
        padding-bottom: env(safe-area-inset-bottom, 0);
        background: var(--header-bg);
        border-top: 1px solid var(--border);
        box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
    }

    .site-bottom-nav__item {
        flex: 1 1 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-width: 0;
        padding: 6px 4px;
        color: var(--muted);
        text-decoration: none;
        font-size: 11px;
        font-weight: 500;
        transition: color .15s ease, background .15s ease;
        -webkit-tap-highlight-color: transparent;
        position: relative;
    }

    .site-bottom-nav__item:active {
        background: var(--card-bg-hover);
    }

    .site-bottom-nav__item.is-active {
        color: var(--primary);
    }

    .site-bottom-nav__item.is-active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 20%;
        right: 20%;
        height: 2px;
        background: var(--primary);
        border-radius: 0 0 2px 2px;
    }

    .site-bottom-nav__glyph {
        font-size: 20px;
        line-height: 1;
    }

    .site-bottom-nav__label {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .site-bottom-nav__badge {
        position: absolute;
        top: 4px;
        right: 50%;
        transform: translateX(calc(50% + 12px));
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        border-radius: 999px;
        background: var(--danger);
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        line-height: 16px;
        text-align: center;
    }
}


@media (max-width: 768px) {
    body.has-bottom-nav .site-main {
        padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0) + 16px);
    }
}


body.no-bottom-nav .site-bottom-nav {
    display: none !important;
}


body.no-nav-toggle .menu-toggle {
    display: none !important;
}

body.no-nav-toggle .site-nav {
    display: none !important;
}


@supports not (height: 100dvh) {
    @media (max-width: 768px) {
        .site-nav {
            max-height: calc(100vh - var(--header-h) - env(safe-area-inset-top, 0));
        }

        body {
            min-height: 100vh;
        }
    }
}

/* ─── v2 sidebar polish ──────────────────────────────────── */
.sidebar__link.is-active,
.sidebar__link[aria-current="page"] {
    background: rgba(var(--primary-rgb), .12);
    color: var(--primary);
    box-shadow: inset 3px 0 0 var(--primary);
}


/* ============================================================
   n06-sidebar.css — Sidebar, drawer, edge swipe, collapse
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n08-sidebar.css
   ============================================================ */

.sidebar-edge {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-edge-w);
    z-index: 5;
    background: transparent;
    pointer-events: auto;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}
@media (min-width: 769px) {
    .sidebar-edge { display: none; }
}
body:not(.has-sidebar) .sidebar-edge {
    display: none;
}
body.is-sidebar-open .sidebar-edge,
body.is-nav-open .sidebar-edge {
    pointer-events: none;
}


.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(var(--sidebar-w), 88vw);
    z-index: var(--z-drawer);
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    box-shadow: 0 0 32px rgba(0, 0, 0, .18);

    display: flex;
    flex-direction: column;
    overflow: hidden;

    transform: translateX(var(--sidebar-drawer-x, -100%));
    transition: transform var(--sidebar-transition);
    will-change: transform;
    backface-visibility: hidden;

    touch-action: pan-y;
}

.sidebar.is-sidebar-dragging {
    transition: none;
}

body.is-sidebar-open {
    --sidebar-drawer-x: 0px;
    touch-action: pan-y;
    overscroll-behavior-x: contain;
    overflow: hidden;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--z-backdrop);
    background: var(--sidebar-backdrop);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--sidebar-transition);
}

body.is-sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
}

body.has-sidebar .menu-toggle {
    display: inline-flex;
    position: fixed;
    top: calc(12px + env(safe-area-inset-top, 0));
    left: 12px;
    z-index: var(--z-menu-toggle);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--sidebar-link-radius);
    padding: 8px;
    cursor: pointer;
    transition: opacity .15s, border-color .15s;
}
body.has-sidebar .menu-toggle:hover { border-color: var(--primary); }
body.has-sidebar .menu-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
body.has-sidebar .menu-toggle__bar {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    margin: 3px 0;
}
body.is-sidebar-open .menu-toggle { opacity: 0; pointer-events: none; }

@media (max-width: 768px) {
    .sidebar__collapse { display: none; }
}


@media (min-width: 769px) {

    body.has-sidebar {
        display: grid;
        grid-template-columns: var(--sidebar-w) 1fr;
        transition: grid-template-columns var(--sidebar-transition);
    }
    body.has-sidebar.is-sidebar-collapsed {
        grid-template-columns: var(--sidebar-w-collapsed) 1fr;
    }

    .sidebar {
        position: sticky;
        top: 0;
        width: 100%;
        transform: none;
        box-shadow: none;
        transition: width var(--sidebar-transition);
        align-self: start;
        height: 100dvh;
        max-height: 100dvh;
        touch-action: auto;
    }

    .sidebar-backdrop { display: none; }
    body.has-sidebar .menu-toggle { display: none; }

    body.is-sidebar-open {
        --sidebar-drawer-x: initial;
        touch-action: auto;
        overscroll-behavior-x: auto;
        overflow: auto;
    }


    body.is-sidebar-collapsed .sidebar__label,
    body.is-sidebar-collapsed .sidebar__badge,
    body.is-sidebar-collapsed .sidebar__section-title,
    body.is-sidebar-collapsed .sidebar__user-name,
    body.is-sidebar-collapsed .sidebar__body,
    body.is-sidebar-collapsed .sidebar__meta {
        display: none;
    }

    body.is-sidebar-collapsed .sidebar__logo {
        display: none;
        visibility: hidden;
        width: 0;
        height: 0;
        overflow: hidden;
        padding: 0;
        margin: 0;
        flex: 0 0 0;
    }

    body.is-sidebar-collapsed .sidebar__header {
        padding-left: 10px;
        padding-right: 10px;
    }

    body.is-sidebar-collapsed .sidebar__collapse {
        right: auto;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    body.is-sidebar-collapsed .sidebar__footer {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 8px;
        padding: 10px 6px;
    }

    body.is-sidebar-collapsed .sidebar__section {
        padding: 4px 6px;
    }

    body.is-sidebar-collapsed .sidebar__link {
        justify-content: center;
        padding: 8px;
        gap: 0;
    }

    body.is-sidebar-collapsed .sidebar__icon,
    body.is-sidebar-collapsed .sidebar__avatar {
        font-size: 22px;
    }

    body.is-sidebar-collapsed .sidebar__user {
        flex: 0 0 auto;
        justify-content: center;
        padding: 2px;
        width: auto;
    }
    body.is-sidebar-collapsed .sidebar__actions {
        flex-direction: column;
        gap: 6px;
    }
    body.is-sidebar-collapsed .sidebar__logout-form {
        display: flex;
        width: 100%;
        justify-content: center;
    }
}


body.has-sidebar .site-wrap {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100dvh;
}

@media (min-width: 769px) {
    body.has-sidebar .site-main > .container { max-width: 100%; }
}

@media (max-width: 768px) {
    body.has-sidebar .site-main,
    body.has-sidebar .site-main--messenger {
        padding-top: calc(64px + env(safe-area-inset-top, 0));
    }
}

.site-main--messenger {
    display: flex;
    flex-direction: column;
    padding: 24px;
    touch-action: pan-y;
}
@media (max-width: 768px) {
    .site-main--messenger { padding: 16px; }
}


.sidebar__header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: var(--header-h);
    padding: 14px 56px 14px 16px;
    padding-top: calc(14px + env(safe-area-inset-top, 0));
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar__logo {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
}
.sidebar__logo:hover { color: var(--primary); text-decoration: none; }
.sidebar__logo:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.sidebar__logo-glyph {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}
.sidebar__logo-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar__collapse {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: var(--sidebar-link-radius);
    cursor: pointer;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
}
.sidebar__collapse:hover {
    background: var(--card-bg-hover);
    color: var(--text);
}
.sidebar__collapse:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.sidebar__collapse-icon {
    display: block;
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.sidebar__nav {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: var(--sidebar-nav-padding);
}
.sidebar__nav::-webkit-scrollbar { width: 4px; }
.sidebar__nav::-webkit-scrollbar-thumb {
    background: rgba(127, 127, 127, .3);
    border-radius: 2px;
}

.sidebar__section { padding: 8px 8px 4px; }
.sidebar__section + .sidebar__section { margin-top: 4px; }

body.has-sidebar--messenger .sidebar__section + .sidebar__section {
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 8px;
}

.sidebar__section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    color: var(--muted);
    text-transform: uppercase;
    padding: 4px 12px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
}
body.has-sidebar--messenger .sidebar__section-title {
    font-size: 10px;
    letter-spacing: .6px;
    padding: 4px 12px 6px;
}

.sidebar__list { list-style: none; margin: 0; padding: 0; }
.sidebar__item { display: block; }

.sidebar__link {
    display: flex;
    align-items: center;
    gap: var(--sidebar-link-gap);
    min-height: 40px;
    padding: var(--sidebar-link-padding);
    border-radius: var(--sidebar-link-radius);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.sidebar__link:hover {
    background: var(--card-bg-hover);
    text-decoration: none;
    color: var(--text);
}
.sidebar__link.is-active,
.sidebar__link[aria-current="page"] {
    background: rgba(47, 111, 237, .10);
    color: var(--primary);
    font-weight: 600;
}
.sidebar__link.is-active:hover { background: rgba(47, 111, 237, .15); }
.sidebar__link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.sidebar__icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
}
.sidebar__label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar__badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar__link--dialog {
    gap: 10px;
    min-height: 52px;
    padding: 6px 10px;
}
.sidebar__avatar-wrap { flex-shrink: 0; display: inline-flex; }
.sidebar__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg-hover);
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.sidebar__avatar--initial {
    font-weight: 700;
    font-size: 14px;
    color: var(--primary);
    text-transform: uppercase;
    user-select: none;
}
.sidebar__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar__row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.sidebar__name {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1 1 auto;
    min-width: 0;
}
.sidebar__type {
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 5px;
    background: rgba(47, 111, 237, .15);
    color: var(--primary);
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.sidebar__preview {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex-shrink: 0;
    min-width: 40px;
}
.sidebar__time {
    font-size: 10px;
    color: var(--muted);
    line-height: 1;
    white-space: nowrap;
}

.sidebar__footer {
    flex-shrink: 0;
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar__user {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: var(--sidebar-link-radius);
    text-decoration: none;
    color: var(--text);
    transition: background .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.sidebar__user:hover {
    background: var(--card-bg-hover);
    color: var(--text);
    text-decoration: none;
}
.sidebar__user:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.sidebar__user-avatar {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}
.sidebar__user-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar__actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    align-items: center;
}
.sidebar__action {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.sidebar__action--danger:hover {
    border-color: var(--danger);
    color: var(--danger);
}
.sidebar__logout-form { display: inline-flex; margin: 0; }

.sidebar__action.push-toggle.is-subscribed { position: relative; }
.sidebar__action.push-toggle.is-subscribed::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--success);
}

@media (hover: none) and (pointer: coarse) {
    .sidebar__link { min-height: 44px; }
    .sidebar__action,
    .sidebar__collapse {
        min-height: 44px;
        min-width: 44px;
    }
}

[data-theme="dark"] .sidebar {
    box-shadow: 0 0 32px rgba(0, 0, 0, .45);
}
[data-theme="dark"] .sidebar-backdrop {
    background: rgba(0, 0, 0, .65);
}

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .sidebar-backdrop,
    body.has-sidebar,
    body.has-sidebar .menu-toggle {
        transition: none;
    }
    .sidebar.is-sidebar-dragging { transition: none; }
}

@supports not (height: 100dvh) {
    @media (min-width: 769px) {
        .sidebar { height: 100vh; max-height: 100vh; }
    }
    body.has-sidebar .body-wrap { min-height: 100vh; }
}

/* ─── v2 mobile safe areas ───────────────────────────────── */
.site-header { padding-top: env(safe-area-inset-top); }
.bottom-nav, .site-bottom-nav { padding-bottom: env(safe-area-inset-bottom); }


/* ============================================================
   n10-buttons.css — Buttons and button states
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n10-buttons.css
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius);
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}

.btn:hover {
    background: var(--primary-hover);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.4);
}


.btn--small { padding: 6px 12px; font-size: 13px; }
.btn--large { padding: 14px 24px; font-size: 16px; }

.btn--xs {
    font-size: 0.75rem;
    padding: 4px 8px;
}


.btn.primary {
    background: var(--primary);
}
.btn.primary:hover {
    background: var(--primary-hover);
}

.btn.ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn.ghost:hover {
    background: var(--card-bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.btn.success {
    background: var(--success);
}
.btn.success:hover {
    background: #16a34a;
}

.btn.danger {
    background: var(--danger);
}
.btn.danger:hover {
    background: #dc2626;
}

.btn.warning {
    background: var(--warning);
    color: #1e2a3a;
}
.btn.warning:hover {
    background: #d97706;
    color: #1e2a3a;
}

.btn.small {
    padding: 6px 12px;
    font-size: 13px;
}

.btn.large {
    padding: 14px 24px;
    font-size: 16px;
}


.btn-xs {
    font-size: 0.75rem;
    padding: 4px 8px;
}


.btn--primary { background: var(--primary); }
.btn--primary:hover { background: var(--primary-hover); }

.btn--success { background: var(--success); }
.btn--success:hover { background: #16a34a; }

.btn--danger { background: var(--danger); }
.btn--danger:hover { background: #dc2626; }

.btn--warning { background: var(--warning); color: #1e2a3a; }
.btn--warning:hover { background: #d97706; color: #1e2a3a; }

.btn--ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn--ghost:hover {
    background: var(--card-bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}


@media (prefers-reduced-motion: reduce) {
    .btn,
    .btn:hover,
    .btn:active {
        transition: background 0.15s ease;
        transform: none;
    }
}

/* ─── v2 button polish ───────────────────────────────────── */
.btn {
    min-height: 38px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    letter-spacing: .01em;
    transition: background-color .18s ease, border-color .18s ease,
                box-shadow .18s ease, color .18s ease, transform .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn--sm { min-height: 32px; }
.btn--ghost:hover { background: var(--card-bg-hover); }


/* ============================================================
   n11-cards.css — Cards, empty states, flash messages
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n11-cards.css
   ============================================================ */

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px var(--shadow);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px var(--shadow);
}

.card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.card__title-block {
    flex: 1;
    min-width: 0;
}

.card__title {
    font-size: 1.1rem;
    margin: 0 0 4px;
    color: var(--text);
    line-height: 1.3;
}

.card__subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.4;
}

.card__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.card__action-icon {
    margin-right: 4px;
}


.card-title {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--text);
}


.flash-message {
    border-left: 4px solid var(--primary);
    margin-bottom: 16px;
    padding: 12px 16px;
}


.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}

.empty-state__icon {
    font-size: 48px;
    margin-bottom: 12px;
    line-height: 1;
}

.empty-state__title {
    margin: 0 0 8px;
    color: var(--text);
}

.empty-state__message {
    margin: 0 0 8px;
    line-height: 1.5;
}

.empty-state__action {
    margin-top: 12px;
}


.empty-state .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--text);
}


@media (max-width: 768px) {
    .card {
        padding: 16px;
    }

    .card__header {
        margin-bottom: 12px;
    }

    h1 { font-size: 1.5rem; }
}

/* ─── v2 card polish ─────────────────────────────────────── */
.card {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.card:hover { border-color: rgba(var(--primary-rgb), .28); box-shadow: var(--shadow-md); }


/* ============================================================
   n12-forms.css — Forms, inputs, labels, validation
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n12-forms.css
   ============================================================ */

.form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form--inline {
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
}


.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0 0 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.form-label__required {
    color: var(--danger);
    margin-left: 3px;
}


input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
textarea,
select,
.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 9px 12px;
    font: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-sizing: border-box;
    transition: border-color .15s ease, box-shadow .15s ease;
}


input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus,
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.15);
}

input[disabled],
input:disabled,
input[type="text"][disabled],
input[type="email"][disabled],
input[type="password"][disabled],
input[type="number"][disabled],
input[type="search"][disabled],
input[type="tel"][disabled],
input[type="url"][disabled],
textarea[disabled],
textarea:disabled,
select[disabled],
select:disabled,
.form-input[disabled],
.form-textarea[disabled],
.form-select[disabled] {
    opacity: .55;
    cursor: not-allowed;
}

textarea,
.form-textarea {
    resize: vertical;
    min-height: 100px;
}


.form-select,
select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 34px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23888' d='M6 8L0 0h12z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px auto;
}


input.is-invalid,
textarea.is-invalid,
.form-input--error,
.form-textarea--error,
.form-select--error {
    border-color: var(--danger);
}

input.is-valid,
textarea.is-valid {
    border-color: var(--success);
}


.form-hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.form-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 3px;
}


.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.form-actions--end {
    justify-content: flex-end;
}


@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    textarea,
    select,
    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px;
    }

    .form-actions .btn {
        min-height: 44px;
    }
}

/* ─── v2 form polish ─────────────────────────────────────── */
.form-input, .form-select, .form-textarea {
    min-height: 40px;
    border-radius: var(--radius-sm);
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--focus-ring);
}
.form-input[aria-invalid="true"] { border-color: var(--danger); }


/* ============================================================
   n13-badges.css — Badges, online dots, muted text
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n13-badges.css
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    vertical-align: middle;
    white-space: nowrap;
    background: var(--card-bg-hover);
    color: var(--muted);
}

.badge__icon {
    margin-right: 3px;
}


.badge--success { background: rgba(34, 197, 94, .15);   color: var(--success); }
.badge--danger  { background: rgba(239, 68, 68, .15);   color: var(--danger); }
.badge--warning { background: rgba(245, 158, 11, .15);  color: var(--warning); }
.badge--info    { background: rgba(14, 165, 233, .15);  color: var(--info); }
.badge--primary { background: rgba(47, 111, 237, .15);  color: var(--primary); }
.badge--muted   { background: rgba(127, 127, 127, .12); color: var(--muted); }


.badge--primary-solid { background: var(--primary); color: #fff; }
.badge--success-solid { background: var(--success); color: #fff; }
.badge--danger-solid  { background: var(--danger);  color: #fff; }
.badge--warning-solid { background: var(--warning); color: #fff; }


.badge--owner {
    background: #ffd700;
    color: #000;
}

.badge--admin {
    background: #4caf50;
    color: #fff;
}


.badge--small {
    font-size: 10px;
    padding: 1px 6px;
    line-height: 1.4;
    border-radius: 8px;
}


.badge.primary { background: var(--primary); color: #fff; }
.badge.success { background: var(--success); color: #fff; }
.badge.danger  { background: var(--danger);  color: #fff; }
.badge.warning { background: var(--warning); color: #fff; }


.online-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #9ca3af;
}

.online-dot.online {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
    animation: pulse-online 2s infinite;
}

@keyframes pulse-online {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50%      { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0); }
}

.conversation-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--muted);
}

/* ─── v2 badges ──────────────────────────────────────────── */
.badge { border-radius: var(--radius-full); font-weight: 600; letter-spacing: .01em; }
.badge--success { background: rgba(var(--success-rgb), .14); color: var(--success); }
.badge--danger  { background: rgba(var(--danger-rgb), .14);  color: var(--danger); }
.badge--warning { background: rgba(var(--warning-rgb), .16); color: var(--warning); }


/* ============================================================
   n14-tables.css — Tables
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n14-tables.css
   ============================================================ */

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

th, td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

th {
    background: var(--card-bg-hover);
    font-weight: 600;
    font-size: 13px;
}

tr:hover td {
    background: var(--card-bg-hover);
}

/* ─── v2 tables ──────────────────────────────────────────── */
table { border-collapse: separate; border-spacing: 0; }
th { font-weight: 600; letter-spacing: .02em; }
tbody tr { transition: background-color .14s ease; }


/* ============================================================
   n15-dialogs.css — Dialogs, modals, toasts
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n15-modal-toast.css
   ============================================================ */

.dialog[hidden],
.modal-overlay[hidden] {
    display: none !important;
}


.dialog {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.dialog[hidden] { display: none; }

.dialog__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(2px);
}

.dialog__box {
    position: relative;
    z-index: 1;
    width: 100%;
    background: var(--card-bg);
    color: var(--text);
    border-radius: 12px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, .3);
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dialog--sm .dialog__box { max-width: 380px; }
.dialog--md .dialog__box { max-width: 520px; }
.dialog--lg .dialog__box { max-width: 760px; }
.dialog--xl .dialog__box { max-width: 1000px; }

.dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.dialog__title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
}

.dialog__close {
    background: transparent;
    border: 0;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
    padding: 0 4px;
    border-radius: var(--radius-sm);
}

.dialog__close:hover {
    color: var(--danger);
    background: var(--card-bg-hover);
}

.dialog__body {
    padding: 18px 20px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.dialog__footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}


.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: 16px;
}

.modal-overlay.active { display: flex; }

.modal-overlay .modal {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    max-width: 420px;
    width: 100%;
    box-shadow: 0 10px 40px var(--shadow-lg);
    animation: modalIn 0.2s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    color: var(--danger);
    background: var(--card-bg-hover);
}

.modal-body {
    padding: 20px;
    color: var(--text);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}


.toast-container {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top));
    right: calc(12px + env(safe-area-inset-right));
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: calc(100vw - 24px);
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius);
    background: var(--card-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-left: 4px solid var(--muted);
    box-shadow: 0 4px 14px var(--shadow-lg);
    font-size: 14px;
    line-height: 1.4;
    min-width: 280px;
    max-width: 380px;
    pointer-events: auto;
    animation: toast-in .18s ease-out;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.toast__icon {
    flex: 0 0 auto;
    font-size: 16px;
    line-height: 1.2;
}

.toast__message {
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
}

.toast__close {
    flex: 0 0 auto;
    background: transparent;
    border: 0;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
    padding: 0 4px;
}

.toast__close:hover { color: var(--text); }

.toast--info    { border-left-color: var(--primary); }
.toast--success { border-left-color: var(--success); }
.toast--warning { border-left-color: var(--warning); }
.toast--error   { border-left-color: var(--danger); }


.toast.success { border-left-color: var(--success); }
.toast.danger  { border-left-color: var(--danger);  }
.toast.warning { border-left-color: var(--warning); }

/* ─── v2 dialog polish ───────────────────────────────────── */
.modal-overlay, .dialog-overlay {
    backdrop-filter: blur(3px);
    background: rgba(0, 0, 0, .55);
}
.dialog, .modal-dialog {
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
}


/* ============================================================
   n16-avatars.css — Avatars
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n16-avatars.css
   ============================================================ */

.avatar {
    display: inline-block;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--card-bg-hover);
    border: 1px solid var(--border);
    flex-shrink: 0;
    vertical-align: middle;
}


.avatar--sm {
    width: 32px;
    height: 32px;
}

.avatar--lg {
    width: 80px;
    height: 80px;
}


.avatar-sm {
    width: 32px;
    height: 32px;
}

.avatar-lg {
    width: 80px;
    height: 80px;
}


.avatar--initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg-hover);
    color: var(--primary);
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1;
    text-transform: uppercase;
    user-select: none;
    font-family: inherit;
    object-fit: initial;  
}


.avatar--initial.avatar-sm,
.avatar--initial.avatar--sm {
    font-size: 0.85rem;
}

.avatar--initial.avatar-lg,
.avatar--initial.avatar--lg {
    font-size: 2rem;
}


[data-theme="dark"] .avatar--initial {
    background: var(--card-bg-hover);
    color: var(--primary);
}


/* ============================================================
   n17-utilities.css — Utilities and helpers
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n17-utilities.css
   ============================================================ */

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.hidden { display: none !important; }

.muted {
    color: var(--muted) !important;
}


/* ============================================================
   n18-alerts.css — Alerts
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n18-alert.css
   ============================================================ */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    margin: 0 0 14px;
    border-radius: var(--radius);
    border-left: 4px solid var(--muted);
    background: var(--card-bg-hover);
    color: var(--text);
    font-size: 14px;
    line-height: 1.4;
}

.alert__message {
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
}

.alert__close {
    flex: 0 0 auto;
    background: transparent;
    border: 0;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
    padding: 0 4px;
}

.alert__close:hover { color: var(--text); }

.alert--error   { border-left-color: var(--danger);  color: var(--danger); }
.alert--success { border-left-color: var(--success); color: var(--success); }
.alert--warning { border-left-color: var(--warning); color: var(--warning); }
.alert--info    { border-left-color: var(--primary); color: var(--primary); }


/* ============================================================
   n19-pagination.css — Pagination
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n19-pagination.css
   ============================================================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex-wrap: wrap;
    margin: 22px 0 8px;
    font-size: 14px;
}

.pagination__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    background: transparent;
    border: 1px solid transparent;
    transition: background .12s ease, border-color .12s ease;
}

.pagination__item:hover {
    background: var(--card-bg-hover);
    border-color: var(--border);
}

.pagination__item--current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
}

.pagination__item--current:hover {
    background: var(--primary);
    color: #fff;
}

.pagination__item--disabled {
    opacity: .4;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination__item--dots {
    cursor: default;
    opacity: .6;
}

.pagination__item--prev,
.pagination__item--next,
.pagination__item--edge {
    font-weight: 600;
}


/* ============================================================
   n20-admin-nav.css — Admin navigation
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n20-admin-nav.css
   ============================================================ */

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin: 0 0 22px;
    padding: 8px 4px;
    background: var(--card-bg-hover);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow-x: auto;
}

.admin-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
    white-space: nowrap;
    transition: background .12s ease, color .12s ease;
}

.admin-nav__link:hover {
    background: var(--card-bg-hover);
}

.admin-nav__link.is-active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.admin-nav__back {
    margin-right: 12px;
}

.admin-nav__link--active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.admin-nav__icon  { font-size: 14px; line-height: 1; }
.admin-nav__label { font-size: 13px; }

@media (max-width: 640px) {
    .admin-nav__label { display: none; }
    .admin-nav__link  { padding: 8px 10px; }
    .admin-nav__icon  { font-size: 16px; }
}

/* ─── v2 admin nav ───────────────────────────────────────── */
.admin-nav__link { border-radius: var(--radius-sm); transition: background-color .15s ease, color .15s ease; }
.admin-nav__link.is-active { background: rgba(var(--primary-rgb), .12); color: var(--primary); }


/* ============================================================
   n21-user-card.css — User card
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n21-user-card.css
   ============================================================ */

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: border-color .15s ease, transform .1s ease;
    position: relative;
}

.user-card:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.user-card__avatar-wrap {
    position: relative;
    flex: 0 0 auto;
}

.user-card__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--card-bg-hover);
    display: block;
}

.user-card__avatar--initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    line-height: 1;
    color: var(--text);
    user-select: none;
    -webkit-user-select: none;
}

.user-card__online-dot {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--muted);
    border: 2px solid var(--card-bg);
}

.user-card__online-dot--online {
    background: var(--success);
}

.user-card__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-card__name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card__handle {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card__actions {
    flex: 0 0 auto;
    display: flex;
    gap: 4px;
}

.user-card__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: background .12s ease, color .12s ease;
    -webkit-tap-highlight-color: transparent;
}

.user-card__action:hover {
    background: var(--card-bg-hover);
    color: var(--text);
}

@media (hover: none) and (pointer: coarse) {
    .user-card__action {
        width: 40px;
        height: 40px;
    }
}


/* ============================================================
   n22-timezone.css — Timezone selector
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n22-timezone-selector.css
   ============================================================ */

.timezone-selector {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.timezone-selector__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.timezone-selector__hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
}

.timezone-selector__current {
    font-size: 12px;
    color: var(--muted);
}

.timezone-selector__offset {
    color: var(--muted);
    font-size: 11px;
    margin-left: 4px;
}


/* ============================================================
   n23-search.css — Group/user search
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n23-group-search.css
   ============================================================ */

.group-search {
    position: relative;
}

.group-search__input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    font-family: inherit;
}

.group-search__input:focus {
    border-color: var(--primary);
    outline: none;
}

.group-search__results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 120;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    max-height: 240px;
    overflow-y: auto;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    margin-top: 4px;
}

.group-search__results[hidden] {
    display: none;
}

.group-search__item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.12s ease;
}

.group-search__item.active,
.group-search__item:hover {
    background: var(--card-bg-hover);
}

.group-search__item img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.group-search__item-name {
    font-weight: 600;
    font-size: 14px;
}

.group-search__item-handle {
    font-size: 12px;
    color: var(--muted);
}

.group-search__status {
    padding: 10px 12px;
    font-size: 13px;
    color: var(--muted);
}

.group-search__status--err {
    color: var(--danger);
}

.group-search__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.group-search__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: #fff;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.4;
}

.group-search__chip img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.group-search__chip-handle {
    opacity: 0.75;
    font-size: 11px;
}

.group-search__chip-x {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

.group-search__chip-x:hover {
    opacity: 0.8;
}


/* ============================================================
   n24-user-menu.css — User menu overrides
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n24-user-menu.css
   ============================================================ */

.user-menu--sidebar {
    width: 100%;
    position: relative;
}

.user-menu--sidebar .user-menu__toggle {
    width: 100%;
    justify-content: flex-start;
    border-color: transparent;
    outline: 0;
    box-shadow: none;
    transition: none;
}

.user-menu--sidebar .user-menu__toggle:hover {
    background: var(--card-bg-hover);
}

.user-menu--sidebar .user-menu__toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}


.user-menu--sidebar .user-menu__dropdown {
    top: auto;
    bottom: calc(100% + 6px);
    left: 0;
    right: 0;
    min-width: 100%;
    max-width: none;
}


.sidebar__footer .user-menu--sidebar {
    flex: 1 1 auto;
    min-width: 0;
}

.sidebar__footer .user-menu--sidebar .user-menu__toggle {
    padding: 4px 6px;
}


body.is-sidebar-collapsed .user-menu--sidebar .user-menu__name,
body.is-sidebar-collapsed .user-menu--sidebar .user-menu__caret {
    display: none;
}

body.is-sidebar-collapsed .sidebar__footer .user-menu--sidebar {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    pointer-events: none;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body.is-sidebar-collapsed .user-menu--sidebar .user-menu__toggle {
    width: 100%;
    justify-content: center;
    align-items: center;
    padding: 4px;
    gap: 0;
}


body.is-sidebar-collapsed .sidebar__footer .user-menu--sidebar[open] > .user-menu__dropdown {
    display: none;
}


/* ============================================================
   n39-auth.css — Auth: login + register
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n39a-users-login.css, n39b-users-register.css
   ============================================================ */

.auth-error-box {
    margin: 0 0 16px;
}


.auth-caps-lock-hint {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    background: rgba(var(--warning-rgb), 0.10);
    border-left: 3px solid var(--warning);
    color: var(--warning);
    font-size: 12px;
    line-height: 1.4;
    font-weight: 600;
    will-change: opacity;
}


.auth-password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-password-wrap .form-input {
    padding-right: 40px; 
}

.auth-password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: var(--muted);
    transition: background 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    z-index: 2; 
}

.auth-password-toggle:hover {
    background: var(--card-bg-hover);
    color: var(--text);
}

.auth-password-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}


.captcha-group {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
}

.captcha-question {
    font-family: var(--geek-mono);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.08);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    user-select: none;
    letter-spacing: 0.5px;
    display: inline-block;
    border-left: 3px solid var(--primary);
}

.captcha-group .form-input {
    max-width: 220px;
}

.captcha-group .form-hint--error {
    max-width: 220px;
}


[data-login-submit].is-loading,
[data-login-submit]:disabled.is-loading,
.btn.is-loading {
    cursor: wait;
    opacity: 0.7;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

[data-login-submit].is-loading:hover,
[data-login-submit].is-loading:active,
[data-login-submit]:disabled.is-loading:hover,
[data-login-submit]:disabled.is-loading:active {
    transform: none;
    box-shadow: none;
}


[data-login-form] .form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}


[data-login-form] .form-input[aria-invalid="true"],
[data-login-form] .form-input.is-invalid {
    border-color: var(--danger);
}

[data-login-form] .form-input[aria-invalid="true"]:focus,
[data-login-form] .form-input.is-invalid:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(var(--danger-rgb), 0.20);
}


.form-hint--error {
    color: var(--danger);
    font-weight: 500;
}

.form-hint--warn {
    color: var(--warning);
    font-weight: 500;
}

.form-hint[hidden] {
    display: none !important;
}


@media (max-width: 640px) {
    .auth-error-box {
        font-size: 13px;
        padding: 10px 12px;
    }

    .auth-caps-lock-hint {
        font-size: 11.5px;
        padding: 5px 8px;
    }

    [data-login-submit] {
        min-height: 44px;
        width: 100%;
        justify-content: center;
    }

    .captcha-question {
        font-size: 1rem;
        padding: 6px 10px;
    }
    
    .captcha-group .form-input {
        max-width: 100%;
    }
}


@media (hover: none) and (pointer: coarse) {
    [data-login-submit],
    .auth-password-toggle {
        min-height: 44px;
        min-width: 44px;
    }
}


@media (prefers-reduced-motion: reduce) {
    [data-login-submit],
    .auth-caps-lock-hint,
    .auth-password-toggle {
        transition: none;
    }
}




.form-label__hint {
    font-size: 0.85em;
    font-weight: 400;
    margin-left: 4px;
}


























[data-register-submit].is-loading,
[data-register-submit]:disabled.is-loading,
.btn.is-loading {
    cursor: wait;
    opacity: 0.7;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

[data-register-submit].is-loading:hover,
[data-register-submit].is-loading:active,
[data-register-submit]:disabled.is-loading:hover,
[data-register-submit]:disabled.is-loading:active {
    transform: none;
    box-shadow: none;
}


[data-register-form] .form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

[data-register-form] .form-input[aria-invalid="true"],
[data-register-form] .form-input.is-invalid {
    border-color: var(--danger);
}

[data-register-form] .form-input[aria-invalid="true"]:focus,
[data-register-form] .form-input.is-invalid:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(var(--danger-rgb), 0.20);
}









@media (max-width: 640px) {
    .auth-error-box {
        font-size: 13px;
        padding: 10px 12px;
    }

    .auth-caps-lock-hint {
        font-size: 11.5px;
        padding: 5px 8px;
    }

    [data-register-submit] {
        min-height: 44px;
        width: 100%;
        justify-content: center;
    }

    .captcha-question {
        font-size: 1rem;
        padding: 6px 10px;
    }
    
    .captcha-group .form-input,
    .captcha-group .form-hint--error {
        max-width: 100%;
    }
}


@media (hover: none) and (pointer: coarse) {
    [data-register-submit],
    .auth-password-toggle {
        min-height: 44px;
        min-width: 44px;
    }
}


@media (prefers-reduced-motion: reduce) {
    [data-register-submit],
    .auth-caps-lock-hint,
    .auth-password-toggle {
        transition: none;
    }
}


/* ============================================================
   n40a-messages-inbox.css — Messages: inbox
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n40a-messages-inbox.css
   ============================================================ */

.inbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    transition: border-color 0.15s ease,
                box-shadow 0.15s ease,
                transform 0.15s ease,
                background 0.15s ease;
}

.inbox-item:hover,
.inbox-item:focus-visible {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(47, 111, 237, 0.1);
    transform: translateY(-1px);
    text-decoration: none;
    background: var(--card-bg-hover);
}

.inbox-item:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.inbox-item.unread {
    background: var(--card-bg);
    border-left: 3px solid var(--primary);
    border-color: var(--primary);
}

[data-theme="dark"] .inbox-item.unread {
    background: rgba(47, 111, 237, 0.08);
}

.inbox-avatar-wrap { flex-shrink: 0; }
.inbox-avatar-wrap .avatar { width: 48px; height: 48px; }

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

.inbox-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
    gap: 8px;
}

.inbox-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inbox-item.unread .inbox-name { font-weight: 700; }

.inbox-time {
    font-size: 12px;
    color: var(--muted);
    flex-shrink: 0;
}

.inbox-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.inbox-message {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.inbox-item.unread .inbox-message {
    color: var(--text);
    font-weight: 500;
}

.inbox-badge {
    flex-shrink: 0;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.inbox-handle {
    font-size: 12px;
    font-family: var(--geek-mono);
}


.inbox-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.inbox-h1 { margin: 0; }

.inbox-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.inbox-empty-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.inbox-row { position: relative; }

.inbox-row__actions {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
    z-index: 2;
}

.inbox-row__form { display: inline; margin: 0; }

.inbox-row__btn {
    min-width: 36px;
    min-height: 36px;
    padding: 6px 8px;
    border-color: transparent;
    background: transparent;
    opacity: 0.4;
    transition: opacity 0.15s ease,
                background 0.15s ease,
                border-color 0.15s ease;
}

.inbox-row:hover .inbox-row__btn,
.inbox-row__btn:focus-visible {
    opacity: 1;
}

.inbox-row__btn--clear { color: var(--warning); }
.inbox-row__btn--clear:hover {
    background: var(--card-bg-hover);
    border-color: var(--warning);
}

.inbox-row__btn--delete { color: var(--danger); }
.inbox-row__btn--delete:hover {
    background: var(--card-bg-hover);
    border-color: var(--danger);
}

.inbox-item--with-actions { padding-right: 96px; }

@keyframes inbox-flash {
    0%   { background: rgba(79, 172, 254, 0.14); }
    100% { background: transparent; }
}

.inbox-row--updated .inbox-item {
    animation: inbox-flash 1.5s ease-out;
}


@media (max-width: 640px) {
    .inbox-item { padding: 10px 12px; gap: 10px; }
    .inbox-avatar-wrap .avatar { width: 40px; height: 40px; }
    .inbox-name { font-size: 14px; }
    .inbox-message { font-size: 12px; }

    .inbox-row__btn {
        opacity: 1;
        min-width: 40px;
        min-height: 40px;
    }
    .inbox-item--with-actions { padding-right: 96px; }
    .inbox-header-row {
        flex-direction: column;
        align-items: stretch;
    }
    .inbox-header-actions { justify-content: flex-start; }
}


@media (hover: none) and (pointer: coarse) {
    .inbox-row__btn { opacity: 1; }
}


/* ============================================================
   n40b-messages-dialog.css — Messages: dialog
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n40b-messages-dialog.css
   ============================================================ */

.conversation-container {
    position: relative;
    background: var(--chat-bg);
    border: 1px solid var(--chat-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px var(--shadow-lg);
    overflow: hidden;
    font-family: var(--geek-mono);
    margin-bottom: 16px;
}

.conversation-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 8px;
}

.conversation__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.conversation__handle { font-size: 14px; }

.conversation__toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.conversation__clear-form { display: inline; margin: 0; }

.conversation__clear-btn {
    color: var(--warning);
    border-color: transparent;
    background: transparent;
}

.conversation__clear-btn:hover {
    background: var(--chat-overlay-hover);
    border-color: var(--warning);
}

.conversation-status .badge { margin-left: 8px; }

.conversation-status__description {
    margin-top: 4px;
    font-size: 12px;
}

.conversation__readonly { text-align: center; }

.reply-form__textarea { min-height: 80px; }

.messages-list {
    height: 60vh;
    max-height: 600px;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--chat-bg);
    position: relative;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 90%;
    font-size: 13px;
    line-height: 1.5;
}

.message-mine { align-self: flex-end; flex-direction: row-reverse; }
.message-other { align-self: flex-start; }

.message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--chat-border);
}

.message-bubble {
    padding: 8px 12px;
    border-radius: 4px;
    max-width: 100%;
    word-wrap: break-word;
    position: relative;
    border: 1px solid;
}

.message-other .message-bubble {
    background: var(--chat-other-bg);
    border-color: var(--chat-other-border);
    color: var(--chat-other-text);
}

.message-mine .message-bubble {
    background: var(--chat-mine-bg);
    border-color: var(--chat-mine-border);
    color: var(--chat-mine-text);
}

.message-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 4px;
    font-size: 11px;
}

.message-sender { font-weight: 600; color: var(--chat-accent); }
.message-other .message-sender::before { content: '> '; color: var(--chat-other-border); }
.message-mine .message-sender::before { content: '$ '; color: var(--chat-mine-border); }

.message-text {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: var(--geek-mono);
}

.message-deleted-text {
    font-style: italic;
    color: var(--chat-muted);
    font-size: 12px;
}

.message-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 4px;
    font-size: 10px;
    color: var(--chat-muted);
}

.message-time { font-size: 10px; opacity: 0.7; }

.message-edited {
    font-size: 10px;
    font-family: var(--geek-mono);
    color: var(--chat-muted);
    font-style: italic;
    letter-spacing: 0.3px;
    opacity: 0.7;
    user-select: none;
    cursor: help;
}
.message-footer .message-edited {
    line-height: 1;
    margin-right: auto;
}

.message-status {
    font-family: var(--geek-mono);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0;
}
.message-status.sent { color: var(--chat-muted); }
.message-status.read {
    color: var(--chat-accent);
    animation: readPulse 0.4s ease;
}

@keyframes readPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.message-actions {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.message:hover .message-actions { opacity: 1; }

.msg-action-btn {
    background: var(--chat-overlay);
    border: 1px solid var(--chat-border);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: var(--chat-muted);
    transition: background 0.15s ease,
                color 0.15s ease,
                border-color 0.15s ease;
}
.msg-action-btn:hover {
    background: var(--chat-overlay-hover);
    color: var(--chat-text);
    border-color: var(--chat-accent);
}

.message-quote {
    background: var(--chat-overlay);
    border-left: 3px solid var(--chat-accent);
    padding: 6px 10px;
    border-radius: 2px;
    margin-bottom: 6px;
    font-size: 11px;
}
.quote-author { font-weight: 600; margin-bottom: 2px; color: var(--chat-accent); }
.quote-body { opacity: 0.8; }


.messenger-lightbox {
    position: fixed;
    inset: 0;
    z-index: var(--z-lightbox);
    display: none;
    align-items: center;
    justify-content: center;
    font-family: var(--geek-mono);
    touch-action: none;
    overscroll-behavior: contain;
}
.messenger-lightbox.is-open { display: flex; }

.messenger-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    cursor: default;
    will-change: opacity;
}

.messenger-lightbox__img {
    position: relative;
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: auto;
    transition: none;
    transform-origin: 50% 50%;
    touch-action: none;
    will-change: transform, opacity;
    backface-visibility: hidden;
}
.messenger-lightbox__img.is-zoomed { cursor: grab; }
.messenger-lightbox__img.is-grabbing { cursor: grabbing; }

.messenger-lightbox__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    z-index: 3;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.messenger-lightbox__close:hover { background: rgba(255, 255, 255, 0.2); }

.messenger-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 64px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    z-index: 3;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.messenger-lightbox__nav:hover { background: rgba(255, 255, 255, 0.16); }
.messenger-lightbox__nav--prev { left: 16px; }
.messenger-lightbox__nav--next { right: 16px; }

.messenger-lightbox__toolbar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
    max-width: 90vw;
    z-index: 3;
    flex-wrap: nowrap;
}
.messenger-lightbox__counter {
    font-variant-numeric: tabular-nums;
    opacity: 0.85;
    padding-right: 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    margin-right: 4px;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
}
.messenger-lightbox__download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--chat-accent);
    color: #fff;
    border-radius: 3px;
    text-decoration: none;
    font-weight: 600;
    transition: filter 0.15s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.messenger-lightbox__download:hover {
    filter: brightness(1.1);
    text-decoration: none;
    color: #fff;
}
.messenger-lightbox__filename {
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 30vw;
    user-select: none;
    -webkit-user-select: none;
}

.messenger-lightbox__zoom {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    margin-left: 4px;
}
.messenger-lightbox__zoom button {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    transition: background 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.messenger-lightbox__zoom button:hover {
    background: rgba(255, 255, 255, 0.16);
}
.messenger-lightbox__zoom-pct {
    min-width: 44px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    opacity: 0.85;
    font-size: 12px;
    user-select: none;
    -webkit-user-select: none;
}
.messenger-lightbox__zoom-reset { margin-left: 2px; }

body.messenger-lightbox-open { overflow: hidden; }


.messenger-context-menu {
    position: fixed;
    z-index: var(--z-context-menu);
    min-width: 200px;
    max-width: 300px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: 6px;
    display: none;
    opacity: 0;
    transform: scale(0.96);
    transform-origin: top left;
    transition: opacity 0.12s ease, transform 0.12s ease;
    font-family: var(--geek-mono);
    color: var(--text);
    user-select: none;
    -webkit-user-select: none;
}
.messenger-context-menu.is-open {
    opacity: 1;
    transform: scale(1);
}
.messenger-context-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: inherit;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}
.messenger-context-menu__item:hover,
.messenger-context-menu__item:focus-visible {
    background: var(--card-bg-hover);
    outline: none;
}
.messenger-context-menu__item--danger { color: var(--danger); }
.messenger-context-menu__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex-shrink: 0;
    font-size: 15px;
    opacity: 0.85;
}
.messenger-context-menu__label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.messenger-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 13px;
    font-family: var(--geek-mono);
    z-index: var(--z-toast);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    max-width: calc(100vw - 32px);
    text-align: center;
}
.messenger-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.message-unread-highlight .message-bubble {
    animation: unreadPulse 1.5s ease 2;
}
@keyframes unreadPulse {
    0%   { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.6); }
    50%  { box-shadow: 0 0 0 8px rgba(255, 215, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}

.unread-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 4px;
    font-size: 10px;
    font-family: var(--geek-mono);
    color: var(--chat-accent);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
    user-select: none;
    pointer-events: none;
}
.unread-divider::before,
.unread-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--chat-accent);
    opacity: 0.45;
}
.unread-divider__label {
    flex-shrink: 0;
    padding: 0 6px;
}

.scroll-down-btn {
    position: absolute;
    bottom: 110px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: var(--chat-header-bg);
    color: var(--chat-accent);
    border: 1px solid var(--chat-border);
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease,
                border-color 0.2s ease;
    z-index: 10;
    font-family: var(--geek-mono);
}
.scroll-down-btn:hover { transform: translateY(-2px); border-color: var(--chat-accent); }

.scroll-down-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 2px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--chat-bg);
    font-family: var(--geek-mono);
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 12px;
    color: var(--chat-muted);
    background: var(--chat-bg);
    font-family: var(--geek-mono);
}
.typing-indicator::before {
    content: '>';
    color: var(--chat-accent);
    animation: blink-cursor 1s infinite;
}
@keyframes blink-cursor {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 1px;
    background: var(--chat-muted);
    animation: typingBounce 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-4px); opacity: 1; }
}
.typing-text { font-style: italic; margin-left: 6px; }

.quote-preview,
.edit-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--chat-header-bg);
    border-left: 3px solid var(--chat-accent);
    margin: 8px 16px;
    border-radius: 3px;
    font-family: var(--geek-mono);
    font-size: 12px;
}
.quote-preview-content,
.edit-preview-content { flex: 1; min-width: 0; }

.quote-preview-author,
.edit-preview-label {
    font-weight: 600;
    font-size: 12px;
    color: var(--chat-accent);
    margin-bottom: 2px;
}
.quote-preview-body,
.edit-preview-body {
    font-size: 12px;
    color: var(--chat-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.quote-cancel,
.edit-cancel {
    background: transparent;
    border: 1px solid var(--chat-border);
    color: var(--chat-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 3px;
    transition: color 0.15s ease,
                border-color 0.15s ease;
}
.quote-cancel:hover,
.edit-cancel:hover {
    color: var(--danger);
    border-color: var(--danger);
}

.reply-form {
    padding: 12px 16px;
    border-top: 1px solid var(--chat-border);
    background: var(--chat-header-bg);
}
.reply-form textarea {
    background: var(--chat-bg);
    color: var(--chat-text);
    border: 1px solid var(--chat-border);
    border-radius: 3px;
    font-family: var(--geek-mono);
    font-size: 13px;
    margin-bottom: 10px;
    min-height: 70px;
}
.reply-form textarea:focus {
    border-color: var(--chat-accent);
    box-shadow: 0 0 0 3px var(--chat-overlay-hover);
}
.reply-form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.reply-form-actions .btn { margin-left: auto; font-family: var(--geek-mono); }

.emoji-toggle {
    background: transparent;
    border: 1px solid var(--chat-border);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 3px;
    transition: background 0.15s ease,
                border-color 0.15s ease;
}
.emoji-toggle:hover { background: var(--chat-overlay-hover); border-color: var(--chat-accent); }

.emoji-picker {
    position: absolute;
    bottom: 110px;
    left: 16px;
    background: var(--chat-header-bg);
    border: 1px solid var(--chat-border);
    border-radius: 4px;
    padding: 12px;
    box-shadow: 0 8px 24px var(--shadow-lg);
    max-width: 320px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 20;
}
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
}
.emoji-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    line-height: 1;
    transition: background 0.15s ease,
                border-color 0.15s ease,
                transform 0.15s ease;
}
.emoji-btn:hover {
    background: var(--chat-overlay-hover);
    border-color: var(--chat-accent);
    transform: scale(1.15);
}

.attachment-input {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.attachment-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--chat-border);
    border-radius: 3px;
    color: var(--chat-text);
    font-size: 12px;
    cursor: pointer;
    transition: border-color 0.15s ease,
                color 0.15s ease;
    font-family: var(--geek-mono);
}
.attachment-label:hover { border-color: var(--chat-accent); color: var(--chat-accent); }


@media (max-width: 768px) {
    .message { max-width: 95%; }
    .messages-list { height: 55vh; }
    .reply-form-actions .btn { min-height: 44px; }
}


@media (max-width: 640px) {
    .reply-form { padding: 10px 12px; }
    .emoji-picker { max-width: calc(100vw - 40px); left: 12px; }
    .scroll-down-btn { bottom: 100px; right: 12px; }
    .message-bubble { padding: 6px 10px; font-size: 12px; }

    .conversation__title { font-size: 1.25rem; }
    .conversation__handle { font-size: 13px; }

    .messenger-lightbox__close {
        top: 10px;
        right: 10px;
        width: 44px;
        height: 44px;
        font-size: 22px;
    }
    .messenger-lightbox__nav {
        width: 44px;
        height: 52px;
        font-size: 26px;
    }
    .messenger-lightbox__nav--prev { left: 6px; }
    .messenger-lightbox__nav--next { right: 6px; }
    .messenger-lightbox__toolbar {
        bottom: 12px;
        padding: 6px 10px;
        font-size: 12px;
        gap: 8px;
        max-width: calc(100vw - 20px);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .messenger-lightbox__toolbar::-webkit-scrollbar { display: none; }
    .messenger-lightbox__filename { display: none; }
    .messenger-lightbox__zoom {
        padding-left: 6px;
        margin-left: 0;
    }
    .messenger-lightbox__zoom button {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }
    .messenger-lightbox__zoom-pct {
        min-width: 38px;
        font-size: 11px;
    }

    .messenger-context-menu {
        min-width: 220px;
        max-width: calc(100vw - 24px);
    }
    .messenger-context-menu__item {
        padding: 12px 14px;
        font-size: 14px;
    }
}


@media (hover: none) and (pointer: coarse) {
    .messenger-lightbox__close {
        background: rgba(255, 255, 255, 0.08);
        opacity: 0.9;
    }
    .messenger-lightbox__close:hover {
        background: rgba(255, 255, 255, 0.08);
    }
    .messenger-lightbox__nav {
        background: rgba(255, 255, 255, 0.05);
        opacity: 0.75;
    }
    .messenger-lightbox__nav:hover {
        background: rgba(255, 255, 255, 0.05);
    }
    .messenger-lightbox__zoom button:hover {
        background: rgba(255, 255, 255, 0.06);
    }
    .messenger-lightbox__download:hover {
        filter: none;
    }
}


/* ============================================================
   n40c-messages-groups.css — Messages: groups
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n40c-messages-groups.css
   ============================================================ */

.compose-page { display: block; }

.compose-header {
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 700;
}

.compose-search-card {
    padding: 16px;
    margin-bottom: 16px;
}

.compose-search-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.compose-search-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.compose-search-input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    font-size: 16px;
}

.compose-search-spinner {
    padding: 10px;
    color: var(--muted);
}

.compose-search-hint {
    margin-top: 8px;
    font-size: 13px;
}

.compose-result { display: block; }

.compose-form-wrap { display: block; }

.compose-form-card { padding: 16px; }

.compose-form-title {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
}

.compose-form-textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
}
.compose-form-textarea:focus {
    border-color: var(--primary);
    outline: none;
}

.compose-form-actions {
    margin-top: 10px;
    text-align: right;
}

.compose-user-card {
    padding: 16px;
    margin-bottom: 16px;
}
.compose-user-card__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.compose-user-card__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}
.compose-user-card__name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.compose-user-card__meta {
    font-size: 13px;
}
.compose-user-card__actions {
    text-align: right;
}

.compose-hint-card {
    padding: 16px;
    margin-bottom: 16px;
}


.groups-page { display: block; }

.groups-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.groups-header__title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.groups-header__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.groups-empty-action {
    margin-top: 12px;
}


.group-settings-page { display: block; }

.group-settings-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 700;
}

.group-settings-card {
    padding: 20px;
    max-width: 700px;
    margin: 0 auto;
}

.group-settings-section { display: block; }

.group-settings-section__title {
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 600;
}

.group-settings-avatar-row {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.group-settings-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}

.group-settings-avatar-info {
    flex: 1;
    min-width: 200px;
}

.group-settings-avatar-upload {
    margin-top: 8px;
}

.group-settings-hint {
    font-size: 12px;
    margin-top: 6px;
}

.group-settings-divider {
    margin: 20px 0;
    border: none;
    border-top: 1px solid var(--border);
}

.group-settings-field {
    margin-bottom: 12px;
}

.group-settings-label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
}

.group-settings-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
}

.group-settings-textarea {
    width: 100%;
    min-height: 70px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
}

.group-settings-types {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.group-settings-type {
    flex: 1;
    min-width: 140px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    background: var(--card-bg);
    transition: border-color 0.15s ease, background 0.15s ease;
}
.group-settings-type:hover {
    border-color: var(--primary);
    background: var(--card-bg-hover);
}
.group-settings-type input[type="radio"] {
    margin-right: 4px;
}

.group-settings-type__title {
    display: inline-block;
    font-weight: 600;
}

.group-settings-type__hint {
    display: block;
    font-size: 12px;
    margin-top: 4px;
}

.group-settings-actions {
    text-align: right;
    margin-top: 6px;
}

.group-settings-footer {
    font-size: 12px;
    margin: 0;
}


.group-create-page { display: block; }

.group-create-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 700;
    flex-wrap: wrap;
}

.group-create-card {
    padding: 20px;
    max-width: 640px;
    margin: 0 auto;
}

.group-create-fieldset {
    border: none;
    padding: 0;
    margin: 0 0 16px;
}

.group-create-legend {
    font-size: 13px;
    margin-bottom: 6px;
}

.group-create-types {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.group-type-card {
    flex: 1;
    min-width: 140px;
    display: block;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    text-align: center;
    background: var(--card-bg);
    transition: border-color 0.15s ease, background 0.15s ease;
}
.group-type-card:hover {
    border-color: var(--primary);
    background: var(--card-bg-hover);
}
.group-type-card input[type="radio"] {
    margin-right: 4px;
}
.group-type-card__title {
    display: inline-block;
}
.group-type-card__hint {
    display: block;
    color: var(--muted);
    margin-top: 4px;
    font-size: 12px;
}

.group-create-field {
    margin-bottom: 16px;
}

.group-create-label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
}

.group-create-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
}

.group-create-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 12px;
    gap: 8px;
}

.group-create-error {
    color: var(--danger);
}
.group-create-error[hidden] {
    display: none;
}

.group-create-hint {
    font-size: 12px;
    margin-top: 6px;
}

.group-create-actions {
    text-align: right;
}


.group-members-page { display: block; }

.group-members-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 700;
    flex-wrap: wrap;
}

.group-members-card {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.group-members-section { display: block; }

.group-members-section__title {
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 600;
}

.group-members-divider {
    margin: 20px 0;
    border: none;
    border-top: 1px solid var(--border);
}

.group-members-add-form {
    margin-bottom: 0;
}

.group-members-hint {
    font-size: 12px;
    margin-top: 6px;
}

.group-members-add-btn {
    margin-top: 10px;
}

.group-members-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.group-members-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
}

.group-members-item__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.group-members-item__info {
    flex: 1;
    min-width: 0;
}

.group-members-item__name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.group-members-item__meta {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.group-members-item__action {
    flex-shrink: 0;
}

.group-members-remove {
    color: var(--danger);
}



@media (max-width: 768px) {
    .compose-header { font-size: 20px; }

    .groups-header__title { font-size: 20px; }
    .group-settings-header,
    .group-create-header,
    .group-members-header { font-size: 20px; }
}


/* ============================================================
   n40d-messages-search.css — Messages: search
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n40d-messages-search.css
   ============================================================ */

.search-page { display: flex; flex-direction: column; gap: 0; }

.search-header {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.search-header__title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.search-card {
    padding: 16px;
    margin-bottom: 16px;
}

.search-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-form__input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    font-size: 15px;
}
.search-form__input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.15);
}

.search-live {
    margin-top: 8px;
    font-size: 13px;
    min-height: 20px;
}

.search-empty {
    text-align: center;
    padding: 40px;
}
.search-empty__icon {
    font-size: 48px;
    margin-bottom: 12px;
    line-height: 1;
}
.search-empty__title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
}
.search-empty__text {
    margin: 0;
    line-height: 1.5;
}
.search-empty__hint {
    margin-top: 8px;
    font-size: 13px;
}

.search-warning {
    border-left: 4px solid var(--warning);
    padding: 14px 16px;
}

.search-summary {
    padding: 16px;
    margin-bottom: 16px;
    background: var(--card-bg-hover);
}
.search-summary__count {
    font-size: 15px;
}
.search-summary__query {
    margin-left: 4px;
}
.search-summary__terms {
    margin-top: 6px;
    font-size: 12px;
}
.search-summary__time {
    margin-top: 4px;
    font-size: 11px;
}

.search-mode-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}
.search-mode-badge--success { background: var(--success); }
.search-mode-badge--primary { background: var(--primary); }
.search-mode-badge--warning { background: var(--warning); }
.search-mode-badge--muted   { background: var(--muted); color: var(--text); }

.search-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-result {
    display: block;
    padding: 14px;
    text-decoration: none;
    color: inherit;
    border-left: 3px solid var(--primary);
    transition: transform 0.15s ease,
                box-shadow 0.15s ease;
}
.search-result[data-kind="group"] { border-left-color: var(--primary); }
.search-result[data-kind="mine"]  { border-left-color: var(--primary); }
.search-result[data-kind="other"] { border-left-color: var(--success); }

.search-result:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: inherit;
}

.search-result__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.search-result__author-wrap {
    flex: 1;
    min-width: 0;
}

.search-result__author {
    font-size: 15px;
    font-weight: 600;
}

.search-result__handle {
    font-weight: 400;
    font-size: 13px;
    margin-left: 6px;
}

.search-result__badge {
    margin-left: 8px;
}

.search-result__time {
    font-size: 12px;
    white-space: nowrap;
}

.search-result__body {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    word-wrap: break-word;
}

.search-result__relevance {
    margin-top: 6px;
    font-size: 11px;
}

.search-result__footer {
    margin-top: 8px;
    font-size: 12px;
}

mark.search-highlight {
    background: linear-gradient(120deg, #fde68a 0%, #fbbf24 100%);
    color: #1e2a3a;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 600;
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.4);
}
[data-theme="dark"] mark.search-highlight {
    background: linear-gradient(120deg, #f59e0b 0%, #d97706 100%);
    color: #1e2a3a;
}


@media (max-width: 768px) {
    .search-header { margin-bottom: 16px; }
    .search-header__title { font-size: 18px; }
    .search-empty { padding: 32px 16px; }
    .search-empty__icon { font-size: 40px; }
}


@media (max-width: 640px) {
    .search-form {
        flex-wrap: wrap;
    }
    .search-form__input {
        min-width: 100%;
    }
}


/* ============================================================
   n41-contacts.css — Contacts: current .contacts-* + legacy .contact-*
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n41-contacts.css, n46-contacts.css
   ============================================================ */

.contact-item {
    margin-bottom: 12px;
    transition: opacity 0.2s ease;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px var(--shadow);
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.contact-card:hover {
    box-shadow: 0 4px 12px var(--shadow);
    border-color: var(--primary);
}

.contact-info {
    flex: 1;
    min-width: 0;
}

.contact-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
    color: var(--text);
}

.contact-handle,
.contact-code {
    font-size: 13px;
    color: var(--muted);
    font-family: var(--geek-mono);
}

.contact-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .contact-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .contact-actions {
        width: 100%;
    }

    .contact-actions .btn {
        flex: 1;
    }
}

.contacts-page {
    display: block;
}

.contacts-header {
    margin: 0 0 20px;
    font-size: 1.5rem;
    font-weight: 700;
}


.contacts-search-card {
    padding: 16px;
    margin-bottom: 16px;
}

.contacts-search-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.contacts-search-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.contacts-search-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
}

.contacts-search-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.15);
}

.contacts-search-spinner {
    padding: 0 8px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
}

.contacts-search-hint {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.5;
}


.contacts-section-title {
    margin: 20px 0 12px;
    font-size: 1.1rem;
    font-weight: 600;
}


.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}


.contacts-card {
    padding: 14px;
    margin-bottom: 0;
}

.contacts-card__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.contacts-card__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--card-bg-hover);
}

.contacts-card__info {
    flex: 1;
    min-width: 0;
}

.contacts-card__name {
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contacts-card__handle {
    font-size: 12px;
    font-family: var(--geek-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contacts-card__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.contacts-card__write {
    flex: 1;
    justify-content: center;
}


.contacts-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.contacts-pagination__current {
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
    font-weight: 600;
    cursor: default;
}

.contacts-pagination__current:hover {
    background: var(--primary);
    color: #fff;
    transform: none;
}


.contacts-empty {
    padding: 24px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}


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

    .contacts-search-row {
        flex-wrap: wrap;
    }

    .contacts-search-input {
        min-width: 100%;
    }
}


/* ============================================================
   n42-reactions.css — Reactions
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n42-reactions.css
   ============================================================ */

.message-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    align-items: center;
    position: relative;
    max-width: 100%;
    min-height: 28px;
}

.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border: 1px solid var(--chat-border);
    background: var(--chat-overlay);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 12px;
    line-height: 1.4;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    color: var(--chat-text);
    font-family: var(--geek-mono);
}

.reaction-btn:hover {
    background: var(--chat-overlay-hover);
    border-color: var(--chat-accent);
    transform: translateY(-1px);
}

.reaction-btn:active {
    transform: translateY(0);
}

.reaction-btn.mine {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.reaction-btn.mine:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    opacity: 0.95;
}

.reaction-emoji {
    font-size: 14px;
    line-height: 1;
}

.reaction-count {
    font-size: 11px;
    font-weight: 600;
    min-width: 10px;
    text-align: center;
    font-family: var(--geek-mono);
}

.reaction-add-btn {
    width: 24px;
    height: 24px;
    border: 1px dashed var(--chat-border);
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    color: var(--chat-muted);
    transition: opacity 0.15s ease, background 0.15s ease,
                color 0.15s ease, border-color 0.15s ease,
                transform 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    padding: 0;
    line-height: 1;
}

.message:hover .reaction-add-btn {
    opacity: 0.7;
}

.message .reaction-add-btn:hover {
    opacity: 1;
    background: var(--chat-overlay-hover);
    color: var(--chat-accent);
    border-style: solid;
    border-color: var(--chat-accent);
    transform: scale(1.1);
}

.reaction-picker {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 0;
    background: var(--chat-header-bg);
    border: 1px solid var(--chat-border);
    border-radius: var(--radius);
    padding: 6px 8px;
    display: flex;
    gap: 2px;
    box-shadow: 0 4px 16px var(--shadow-lg);
    z-index: 20;
    animation: reactionPickerIn 0.15s ease;
    backdrop-filter: blur(4px);
}

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

.reaction-pick {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: transform 0.1s ease, background 0.1s ease;
    padding: 0;
    line-height: 1;
}

.reaction-pick:hover {
    background: var(--chat-overlay-hover);
    transform: scale(1.25);
}

.reaction-pick:active {
    transform: scale(1.1);
}


.message-mine .message-reactions {
    justify-content: flex-end;
}

.message-mine .reaction-picker {
    left: auto;
    right: 0;
}

.message-mine .reaction-add-btn {
    order: -1;
    margin-right: 2px;
}

.message-other .reaction-add-btn {
    margin-left: 2px;
}


@media (max-width: 640px) {
    .reaction-picker {
        flex-wrap: wrap;
        max-width: 220px;
        padding: 4px 6px;
    }

    .reaction-pick {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .reaction-add-btn {
        opacity: 0.7;
    }

    .reaction-btn {
        padding: 2px 6px;
        font-size: 11px;
    }

    .reaction-emoji {
        font-size: 13px;
    }

    .reaction-count {
        font-size: 10px;
    }
}


@keyframes reactionPop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.reaction-btn {
    animation: reactionPop 0.2s ease;
}


/* ============================================================
   n43-attachments.css — Attachments
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n43-attachments.css
   ============================================================ */

.message-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    max-width: 100%;
}


.attachment-image-wrap {
    position: relative;
    display: inline-block;
    line-height: 0;
    border-radius: var(--radius);
    overflow: hidden;
    max-width: 100%;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.attachment-image,
.attachment-image-link {
    display: inline-block;
    line-height: 0;
    text-decoration: none;
    max-width: 240px;
    max-height: 240px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--chat-border);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    -webkit-touch-callout: none;
}

.attachment-image:hover,
.attachment-image-link:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px var(--shadow-lg);
}

.attachment-image img,
.attachment-image-link img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 240px;
    cursor: zoom-in;
    transition: filter 0.15s ease;
    -webkit-user-drag: none;
}

.attachment-image:hover img,
.attachment-image-link:hover img {
    filter: brightness(0.92);
    text-decoration: none;
}

.attachment-download-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 15px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
}

.attachment-image-wrap:hover .attachment-download-btn,
.attachment-download-btn:focus-visible {
    opacity: 1;
}

.attachment-download-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    text-decoration: none;
}


.attachment-file,
.attachment-file-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--chat-overlay);
    border: 1px solid var(--chat-border);
    border-radius: var(--radius);
    color: var(--chat-text);
    text-decoration: none;
    max-width: 280px;
    transition: background 0.15s ease, border-color 0.15s ease,
                color 0.15s ease, transform 0.15s ease;
    font-family: var(--geek-mono);
    font-size: 12px;
    -webkit-touch-callout: none;
}

.attachment-file:hover,
.attachment-file-link:hover {
    background: var(--chat-overlay-hover);
    border-color: var(--chat-accent);
    color: var(--chat-accent);
    text-decoration: none;
    transform: translateY(-1px);
}

.attachment-file .att-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.attachment-file .att-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.attachment-file .att-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
}

.attachment-file .att-size {
    font-size: 10px;
    color: var(--chat-muted);
    opacity: 0.8;
}

.attachment-file .att-dl-hint {
    margin-left: 6px;
    opacity: 0.4;
    font-size: 13px;
    flex-shrink: 0;
    transition: opacity 0.15s ease;
}

.attachment-file:hover .att-dl-hint {
    opacity: 1;
}


.attachment-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    width: 100%;
}

.att-preview-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 28px 6px 6px;
    background: var(--chat-header-bg);
    border: 1px solid var(--chat-border);
    border-radius: var(--radius-sm);
    max-width: 220px;
    font-size: 11px;
    animation: attachmentIn 0.2s ease;
}

@keyframes attachmentIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

.att-preview-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.att-preview-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--chat-overlay);
    border-radius: 4px;
    font-size: 20px;
    flex-shrink: 0;
}

.att-preview-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
    font-family: var(--geek-mono);
}

.att-preview-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
    color: var(--chat-text);
}

.att-preview-size {
    font-size: 10px;
    color: var(--chat-muted);
}

.att-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border: none;
    background: var(--danger);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

.att-preview-remove:hover {
    transform: scale(1.15);
}

.att-preview-warning {
    padding: 4px 8px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning);
    border-radius: var(--radius-sm);
    color: var(--warning);
    font-size: 11px;
    font-family: var(--geek-mono);
}


@media (max-width: 640px) {
    .attachment-image,
    .attachment-image-link { max-width: 180px; max-height: 180px; }
    .attachment-file,
    .attachment-file-link  { max-width: 220px; padding: 6px 10px; }
    .att-preview-card      { max-width: 180px; }

    .attachment-download-btn { opacity: 1; }
}


/* ============================================================
   n44-logs.css — Logs
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n44-logs.css
   ============================================================ */

.logs-page h1 {
    margin-bottom: 6px;
}

.logs-page__lead {
    margin-bottom: 16px;
}

.logs-empty {
    text-align: center;
    padding: 24px 0;
    font-style: italic;
}

.logs-inline-form {
    display: inline;
}

.logs-code--sm {
    font-size: 0.85rem;
}

.logs-date-range {
    font-size: 0.85rem;
}

.logs-table__th--time      { width: 150px; }
.logs-table__th--lvl       { width: 90px; }
.logs-table__th--chan      { width: 100px; }
.logs-table__th--evt       { width: 180px; }
.logs-table__th--evt-sm    { width: 200px; }
.logs-table__th--files     { width: 80px; }
.logs-table__th--size      { width: 120px; }
.logs-table__th--range     { width: 140px; }
.logs-table__th--retention { width: 90px; }
.logs-table__th--actions   { width: 120px; }
.logs-table__th--date      { width: 120px; }

.logs-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.logs-summary__item {
    text-align: center;
    padding: 12px 8px;
}
.logs-summary__value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}
.logs-summary__label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 4px;
}

.logs-errors {
    margin-bottom: 16px;
    border-left: 4px solid var(--warning);
}
.logs-errors--clean { border-left-color: var(--success); }
.logs-errors--alert { border-left-color: var(--danger); }

.logs-errors__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.logs-errors__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}
.logs-errors__period {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 400;
}
.logs-errors__badge {
    display: inline-block;
    min-width: 28px;
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--card-bg-hover);
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    color: var(--text);
}
.logs-errors--alert .logs-errors__badge { background: #fee2e2; color: #991b1b; }
.logs-errors--clean .logs-errors__badge { background: #dcfce7; color: #166534; }
.logs-errors__head-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.logs-errors__aggregates {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
}
.logs-errors__agg-block {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}
.logs-errors__agg-label {
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
}
.logs-errors__empty {
    padding: 14px 4px;
    color: var(--muted);
    font-size: 0.9rem;
}
.logs-errors__more {
    padding: 10px 0 0;
    font-size: 0.9rem;
    color: var(--muted);
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.logs-table--errors { font-size: 0.82rem; margin-top: 4px; }
.logs-table--errors tbody td { padding: 6px 10px; }

.logs-row--error     > td { background: rgba(220, 38, 38, 0.04); }
.logs-row--critical  > td { background: rgba(220, 38, 38, 0.08); }
.logs-row--alert     > td { background: rgba(220, 38, 38, 0.12); }
.logs-row--emergency > td { background: rgba(220, 38, 38, 0.16); font-weight: 500; }

.logs-cell-time {
    font-family: var(--geek-mono);
    color: var(--muted);
    white-space: nowrap;
}
.logs-cell-event code { color: var(--text); font-weight: 600; }
.logs-cell-context {
    font-family: var(--geek-mono);
    font-size: 0.76rem;
    word-break: break-word;
    line-height: 1.5;
}

.logs-badge--error     { background: #fee2e2; color: #991b1b; }
.logs-badge--critical  { background: #fecaca; color: #7f1d1d; font-weight: 600; }
.logs-badge--alert     { background: #fca5a5; color: #7f1d1d; font-weight: 600; }
.logs-badge--emergency { background: #dc2626; color: #fff;    font-weight: 700; }

.logs-filters__title { margin: 0 0 12px; font-size: 1.05rem; }
.logs-filters__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}
.logs-field { display: flex; flex-direction: column; gap: 4px; }
.logs-field--narrow { max-width: 110px; }
.logs-field--wide { grid-column: span 2; }
.logs-field--check {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    align-self: end;
    padding-bottom: 6px;
    font-size: 0.9rem;
}
.logs-field__label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
}
.logs-field__input {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg-hover);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
}
.logs-field__input:focus { outline: none; border-color: var(--primary); }
.logs-filters__actions { margin-top: 14px; display: flex; gap: 8px; }

.logs-stats__row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    text-align: center;
}
.logs-stats__value { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.logs-stats__value--error { color: var(--danger); }
.logs-stats__label {
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: 0.4px;
}

.logs-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.logs-live { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; font-weight: 600; }
.logs-live input[type="checkbox"] { accent-color: var(--primary); }
.logs-count { color: var(--muted); font-size: 0.85rem; margin-left: auto; }
.logs-toolbar__actions { display: flex; gap: 6px; }

.logs-results { padding: 0; }
.logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.logs-table thead th {
    background: var(--card-bg-hover);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 2;
}
.logs-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.logs-table tbody tr:hover td { background: var(--card-bg-hover); }
.logs-table__empty {
    text-align: center;
    padding: 32px 12px;
    color: var(--muted);
    font-style: italic;
}
.logs-td--ts { font-family: var(--geek-mono); color: var(--muted); white-space: nowrap; }
.logs-td--chan code { color: var(--muted); }
.logs-td--msg code { color: var(--text); font-weight: 600; }
.logs-td--ctx {
    font-family: var(--geek-mono);
    font-size: 0.78rem;
    word-break: break-word;
    line-height: 1.5;
}
.logs-ctx__k { color: var(--primary); }
.logs-ctx__v { color: var(--text); }

.logs-lvl {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    background: var(--card-bg-hover);
    color: var(--text);
}
.logs-lvl--debug     { background: #1e293b; color: #94a3b8; }
.logs-lvl--info      { background: #075985; color: #bae6fd; }
.logs-lvl--notice    { background: #1e40af; color: #bfdbfe; }
.logs-lvl--warning   { background: #78350f; color: #fed7aa; }
.logs-lvl--error     { background: #7f1d1d; color: #fecaca; }
.logs-lvl--critical  { background: #991b1b; color: #fff; }
.logs-lvl--alert     { background: #9a3412; color: #fff; }
.logs-lvl--emergency { background: #dc2626; color: #fff; }

.logs-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-top: 1px solid var(--border);
}
.logs-pagination__info { font-size: 0.85rem; color: var(--muted); }

.logs-channels h2,
.logs-files h2 {
    margin: 0 0 12px;
    font-size: 1.1rem;
}


@media (max-width: 640px) {
    .logs-filters__grid { grid-template-columns: 1fr 1fr; }
    .logs-field--wide { grid-column: span 2; }
    .logs-toolbar { gap: 8px; }
    .logs-count { margin-left: 0; width: 100%; }
    .logs-table thead { display: none; }
    .logs-table tbody td { display: block; padding: 4px 12px; }
    .logs-td--ts { font-size: 0.75rem; }
    .logs-errors__head { align-items: flex-start; }
}


/* ============================================================
   n45-profile.css — Profile
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n45-profile.css
   ============================================================ */

.profile-page {
    display: block;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 20px;
}

.profile-header__avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.profile-header__name {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    word-break: break-word;
}

.profile-header__handle {
    font-size: 0.9rem;
}


.profile-card {
    padding: 20px;
}

.profile-card__title {
    margin: 0 0 14px;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-card__title-hint {
    font-size: 13px;
    font-weight: 400;
}


.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.profile-grid--wide {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}


.profile-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-label--inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-input {
}

.profile-field-hint {
    display: block;
    font-size: 12px;
    margin-top: 3px;
}


.profile-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}


.profile-handle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px;
    background: var(--card-bg-hover);
    border-radius: var(--radius);
    margin-top: 8px;
    font-size: 13px;
}

.profile-handle-row__value {
    font-family: var(--geek-mono);
    font-size: 14px;
    padding: 3px 8px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.profile-handle-row__hint {
    font-size: 12px;
}


.profile-tz-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: var(--card-bg-hover);
    border-radius: var(--radius);
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1.5;
}

.profile-tz-info code {
    font-family: var(--geek-mono);
    font-size: 12px;
    padding: 1px 5px;
    background: var(--card-bg);
    border-radius: 3px;
    border: 1px solid var(--border);
}

.profile-tz-hint {
    font-size: 12px;
    line-height: 1.5;
    margin: 14px 0 0;
}


.profile-avatar-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.profile-avatar-row__img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.profile-avatar-upload {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.profile-avatar-upload__input {
    display: none;
}


.profile-devices-summary {
    margin: 0 0 8px;
    font-size: 14px;
}

.profile-devices-summary__value {
    font-size: 16px;
    color: var(--primary);
    font-weight: 700;
}

.profile-devices-descr {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.5;
}

.profile-sessions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.profile-session {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--card-bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.profile-session--current {
    border-color: var(--primary);
    background: rgba(47, 111, 237, 0.06);
}

.profile-session__icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1;
}

.profile-session__info {
    flex: 1;
    min-width: 0;
}

.profile-session__device {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.profile-session__badge {
    font-size: 12px;
    font-weight: 400;
}

.profile-session__meta {
    font-size: 12px;
    line-height: 1.4;
}

.profile-session__action {
    flex-shrink: 0;
    display: inline;
    margin: 0;
}

.profile-session__revoke {
    color: var(--danger);
}

.profile-session__revoke:hover {
    background: var(--card-bg);
    border-color: var(--danger);
    color: var(--danger);
}

.profile-session__revoke-all {
    color: var(--danger);
}

.profile-sessions-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}


@media (max-width: 640px) {
    .profile-header__name {
        font-size: 1.2rem;
    }

    .profile-handle-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-session {
        flex-wrap: wrap;
    }

    .profile-session__action {
        width: 100%;
    }

    .profile-session__action .btn {
        width: 100%;
    }
}


/* ============================================================
   n47-devices.css — Devices
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n47-devices.css
   ============================================================ */

.devices-page__title {
    margin: 0 0 4px;
}

.devices-page__lead {
    margin: 0 0 20px;
    font-size: 14px;
}

.devices-page__badge-ndp {
    opacity: 0.7;
    font-size: 10px;
}

.devices-empty {
    text-align: center;
    padding: 24px 0;
}


.devices-summary {
    padding: 16px;
    margin-bottom: 16px;
}

.devices-summary__row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.devices-summary__title {
    font-weight: 600;
}

.devices-summary__hint {
    font-size: 13px;
    margin-top: 2px;
}


.devices-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 24px;
}

.device-card {
    padding: 14px;
}

.device-card--current {
    border-left: 4px solid var(--primary);
}

.device-card__row {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.device-card__icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}

.device-card__body {
    flex: 1;
    min-width: 220px;
}

.device-card__title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.device-card__ip {
    font-size: 13px;
    margin-top: 4px;
}

.device-card__meta {
    font-size: 12px;
    margin-top: 2px;
}

.device-card__actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.device-card__badge--current {
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
}


.devices-ndp {
    padding: 16px;
    margin-bottom: 24px;
}

.devices-ndp__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.devices-ndp__title {
    margin: 0 0 4px;
}

.devices-ndp__desc {
    margin: 0;
    font-size: 13px;
}

.devices-ndp__empty {
    margin-top: 16px;
    text-align: center;
    padding: 20px 0;
}

.devices-ndp__warn {
    font-size: 12px;
    margin-top: 10px;
    padding: 8px 10px;
    background: var(--surface);
    border-left: 3px solid var(--warning);
    border-radius: 4px;
}

.devices-ndp__hint {
    font-size: 11px;
    margin-top: 10px;
}


.ndp-table-wrap {
    overflow-x: auto;
    margin-top: 12px;
}

.ndp-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
}

.ndp-table__head {
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.ndp-table__th {
    padding: 6px 8px;
    font-weight: 600;
}

.ndp-table__th--right {
    text-align: right;
}

.ndp-table__row {
    border-bottom: 1px solid var(--border);
}

.ndp-table__row--current {
    background: rgba(56, 189, 248, 0.05);
}

.ndp-table__cell {
    padding: 8px;
}

.ndp-table__cell--sm {
    font-size: 12px;
}

.ndp-table__cell--xs {
    font-size: 11px;
}

.ndp-table__cell--mono {
    font-family: var(--geek-mono);
}

.ndp-table__cell--nowrap {
    white-space: nowrap;
}

.ndp-table__cell--actions {
    text-align: right;
    white-space: nowrap;
}


.ndp-lag {
    font-size: 11px;
    margin-top: 2px;
}

.ndp-lag--ok       { color: var(--success); }
.ndp-lag--soft     { color: var(--warning); }
.ndp-lag--hard     { color: var(--danger); }
.ndp-lag--critical { color: var(--danger); font-weight: 600; }


.ndp-session-id {
    font-family: var(--geek-mono);
    font-size: 10px;
    margin-bottom: 4px;
}


.ndp-caps {
    font-family: var(--geek-mono);
    font-size: 11px;
    color: var(--muted);
    cursor: help;
}


.battery {
    font-family: var(--geek-mono);
    font-size: 11px;
    font-weight: 600;
}

.battery--high { color: var(--success); }
.battery--mid  { color: var(--warning); }
.battery--low  { color: var(--danger); }


.devices-history {
    padding: 16px;
}

.devices-history__title {
    margin-top: 0;
}

.history-table-wrap {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}

.history-table__head {
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.history-table__th {
    padding: 6px 8px;
    font-weight: 600;
}

.history-table__row {
    border-bottom: 1px solid var(--border);
}

.history-table__cell {
    padding: 6px 8px;
}

.history-table__cell--nowrap {
    white-space: nowrap;
}

.history-table__cell--mono {
    font-family: var(--geek-mono);
    font-size: 12px;
}

.history-table__cell--sm {
    font-size: 13px;
}


.devices-footer {
    margin-top: 16px;
}


/* ============================================================
   n50-auth.css — Auth pages: magic links, shared auth shell
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n50-auth.css
   ============================================================ */

.auth-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
}

.auth-page--left {
    align-items: flex-start;
}

.auth-page__title {
    margin: 0 0 16px;
    font-size: 1.5rem;
    font-weight: 700;
}

.auth-card {
    width: 100%;
    padding: 24px;
    margin-bottom: 0;
}

.auth-card--sm {
    max-width: 420px;
}

.auth-card--md {
    max-width: 450px;
}

.auth-card--left {
    margin-left: 0;
    text-align: left;
}

.auth-card__title {
    margin: 0 0 16px;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
}

.auth-card__subtitle {
    margin: -8px 0 16px;
    font-size: 13px;
    text-align: center;
}


.auth-error {
    padding: 10px 14px;
    margin-bottom: 14px;
    background: rgba(239, 68, 68, 0.08);
    border-left: 4px solid var(--danger);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 13px;
    line-height: 1.4;
}


.auth-error-message {
    margin: 0;
    padding: 12px 0;
    color: var(--danger);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}


.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.auth-actions .btn {
    width: 100%;
    justify-content: center;
}

.auth-actions--row {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.auth-actions--row .btn {
    width: auto;
}


.auth-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 13px;
}

.auth-footer--center {
    justify-content: center;
}


.magic-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
}

.magic-card {
    width: 100%;
    max-width: 680px;
    padding: 24px;
    margin-bottom: 0;
}

.magic-card__title {
    margin: 0 0 8px;
    font-size: 1.3rem;
    font-weight: 700;
}

.magic-descr {
    margin: 0 0 16px;
    font-size: 13px;
    line-height: 1.5;
}

.magic-info {
    padding: 10px 14px;
    margin-bottom: 16px;
    background: rgba(47, 111, 237, 0.08);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.4;
}


.magic-link-box {
    padding: 14px 16px;
    background: var(--card-bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 14px;
}

.magic-link-box--permanent {
    border-left: 4px solid var(--danger);
}

.magic-link-box--once {
    border-left: 4px solid var(--primary);
}

.magic-link-box__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.magic-link-box__label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 14px;
}

.magic-link-box__text {
    word-break: break-all;
}

.magic-link-box__link {
    font-family: var(--geek-mono);
    font-size: 12px;
    color: var(--primary);
    line-height: 1.4;
    word-break: break-all;
}


.magic-warning {
    margin-bottom: 14px;
    padding: 14px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    line-height: 1.6;
}

.magic-warning--permanent {
    background: rgba(239, 68, 68, 0.08);
    border-left: 4px solid var(--danger);
    color: var(--text);
}

.magic-warning--once {
    background: rgba(245, 158, 11, 0.08);
    border-left: 4px solid var(--warning);
    color: var(--text);
}


.magic-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 16px;
}

.magic-form__field {
    display: block;
}

.magic-form__label {
    display: block;
    font-size: 13px;
    margin-bottom: 8px;
}

.magic-modes {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.magic-mode {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
}

.magic-mode__hint {
    font-size: 12px;
}

.magic-divider {
    margin: 20px 0;
    border: none;
    border-top: 1px solid var(--border);
}

.magic-revoke-form {
    display: block;
    margin: 0;
}

.magic-revoke-btn {
    color: var(--danger);
    border-color: var(--danger);
}

.magic-revoke-btn:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: var(--danger);
    color: var(--danger);
}

.magic-footer {
    margin: 20px 0 0;
    font-size: 12px;
    line-height: 1.5;
}


.magic-confirm-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
}

.magic-confirm-card {
    width: 100%;
    max-width: 560px;
    padding: 24px;
    margin-bottom: 0;
}

.magic-confirm-card__title {
    margin: 0 0 12px;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.magic-confirm-card__badge {
    vertical-align: middle;
    margin-left: 6px;
}

.magic-confirm-hint {
    margin: 0 0 12px;
    font-size: 13px;
}

.magic-confirm-account {
    padding: 14px 16px;
    background: var(--card-bg-hover);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.magic-confirm-account__name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 2px;
    line-height: 1.3;
}

.magic-confirm-account__login {
    font-weight: 400;
    font-size: 13px;
    margin-left: 4px;
}

.magic-confirm-account__role {
    font-size: 13px;
    margin-top: 2px;
}

.magic-confirm-form {
    display: block;
    margin: 0 0 12px;
}

.magic-confirm-submit {
    width: 100%;
    justify-content: center;
}

.magic-confirm-footer {
    margin-top: 12px;
    text-align: center;
    font-size: 13px;
}

.magic-confirm-note {
    margin: 16px 0 0;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}


@media (max-width: 640px) {
    .auth-card,
    .magic-card,
    .magic-confirm-card {
        padding: 18px;
    }

    .auth-card__title,
    .magic-card__title,
    .magic-confirm-card__title {
        font-size: 1.15rem;
    }

    .magic-modes {
        flex-direction: column;
        gap: 8px;
    }

    .magic-link-box__header {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* ============================================================
   n51a-admin-users.css — Admin: users
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n51a-admin-users.css
   ============================================================ */

.users-page .users-head {
    margin-bottom: 16px;
}

.users-page .users-stats {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.users-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 12px;
    flex-wrap: wrap;
}

.users-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.users-tab:hover {
    background: var(--card-bg-hover);
    border-color: var(--primary);
}

.users-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.users-tab-count {
    background: rgba(255, 255, 255, 0.18);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.users-tab:not(.active) .users-tab-count {
    background: var(--card-bg-hover);
}

.users-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.users-toolbar .users-search {
    flex: 1;
    min-width: 200px;
}

.users-toolbar .users-select {
    width: auto;
}

.users-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.users-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}

.users-table td {
    vertical-align: middle;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-wrap {
    position: relative;
    flex: none;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 1px solid var(--border);
    background: var(--card-bg-hover);
}

.user-avatar-badge {
    position: absolute;
    right: -3px;
    bottom: -3px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border-radius: 50%;
    font-size: 11px;
    border: 2px solid var(--card-bg);
}

.user-meta {
    min-width: 0;
}

.user-name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.user-sub {
    font-size: 12.5px;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.user-sub a {
    color: inherit;
    text-decoration: none;
}

.user-sub a:hover {
    color: var(--primary);
}

.user-handle {
    color: var(--primary);
    font-weight: 500;
}

.copy-btn {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 13px;
    line-height: 1;
    padding: 1px 3px;
    border-radius: 4px;
}

.copy-btn:hover {
    color: var(--primary);
    background: var(--card-bg-hover);
}

.copy-btn.copied {
    color: var(--success);
}

.bot-persona {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bot-persona-emoji {
    font-size: 22px;
    line-height: 1;
}

.bot-persona-style {
    font-weight: 500;
    font-size: 13px;
}

.role-form {
    display: flex;
    gap: 6px;
    align-items: center;
}

.role-form .role-select {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    font-size: 13px;
}

.bot-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.inline-form {
    display: inline;
}

.activity-online {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--success);
    font-weight: 600;
    font-size: 13px;
}

.users-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.users-pagination {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.users-pagination a,
.users-pagination .page-current {
    display: inline-block;
    padding: 5px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    background: var(--card-bg);
}

.users-pagination a:hover {
    background: var(--card-bg-hover);
    border-color: var(--primary);
}

.users-pagination .page-current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}



.users-page__title {
    margin: 0;
}

.users-stat-link {
    color: inherit;
    text-decoration: none;
    padding: 1px 6px;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.users-stat-link:hover {
    background: var(--card-bg-hover);
}

.users-stat-link--blocked {
    color: var(--danger);
    font-weight: 700;
}

.users-table__row--blocked {
    background: rgba(239, 68, 68, 0.06);
}

.users-table__row--blocked:hover td {
    background: rgba(239, 68, 68, 0.10);
}

.user-avatar-badge--blocked {
    background: var(--danger);
    border-color: var(--card-bg);
}

.badge--blocked {
    background: #7f1d1d;
    color: #fecaca;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    cursor: help;
}

.user-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.activity-blocked {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--danger);
    font-weight: 600;
    font-size: 13px;
    cursor: help;
}

.bot-persona__hint {
    font-size: 11px;
}

.users-table__col--role    { width: 135px; }
.users-table__col--persona { width: 180px; }
.users-table__col--reg     { width: 110px; }
.users-table__col--act     { width: 145px; }
.users-table__col--actions { width: 220px; }

.users-table--bots .users-table__col--actions { width: 260px; }

@media (max-width: 640px) {
    .user-actions {
        flex-direction: column;
        align-items: stretch;
    }
}


/* ============================================================
   n51b-admin-devices.css — Admin: devices
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n51b-admin-devices.css
   ============================================================ */

.admin-devices__header {
    margin-bottom: 20px;
}

.admin-devices__title {
    margin: 0 0 6px;
    font-size: 1.5rem;
}

.admin-devices__lead {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.admin-devices__legend {
    font-size: 12px;
    display: inline-block;
    margin-top: 6px;
}

.admin-devices__stats {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-bottom: 20px;
}

.admin-devices__stat {
    padding: 12px;
    text-align: center;
}

.admin-devices__stat-num {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
}

.admin-devices__stat-num--primary { color: var(--primary); }
.admin-devices__stat-num--success { color: var(--success); }
.admin-devices__stat-num--danger  { color: var(--danger); }

.admin-devices__stat-lbl {
    font-size: 0.85rem;
    margin-top: 2px;
}

.admin-devices__stat-note {
    font-size: 11px;
    margin-top: 2px;
}

.admin-devices__notice {
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    border-radius: 6px;
    background: var(--card-bg-hover);
}

.admin-devices__notice--warn {
    border-left: 4px solid var(--warning);
    background: rgba(245, 158, 11, 0.06);
}

.admin-devices__filters {
    padding: 14px;
    margin-bottom: 20px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.admin-devices__filters-field {
    display: flex;
    flex-direction: column;
}

.admin-devices__filters-field--sm   { flex: 0 0 120px; }
.admin-devices__filters-field--md   { flex: 0 0 260px; }
.admin-devices__filters-field--grow { flex: 1; min-width: 200px; }

.admin-devices__filters-label {
    font-size: 12px;
    margin-bottom: 2px;
}

.admin-devices__filters-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.admin-devices__table-wrap {
    padding: 16px;
}

.admin-devices__scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-devices__table {
    width: 100%;
    min-width: 950px;
    table-layout: fixed;
}

.admin-devices__col--when    { width: 130px; }
.admin-devices__col--user    { width: 180px; }
.admin-devices__col--status  { width: 170px; }
.admin-devices__col--ip      { width: 130px; }
.admin-devices__col--actions { width: 230px; }

.admin-devices__th-actions {
    text-align: right;
}

.admin-devices__cell {
    vertical-align: top;
}

.admin-devices__cell--when {
    white-space: nowrap;
    font-size: 13px;
}

.admin-devices__cell--user {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-devices__cell--status {
    white-space: nowrap;
}

.admin-devices__cell--ip {
    font-family: var(--geek-mono);
    font-size: 12px;
    white-space: nowrap;
}

.admin-devices__cell--device {
    font-size: 13px;
    overflow: hidden;
}

.admin-devices__cell--actions {
    text-align: right;
    white-space: nowrap;
}

.admin-devices__user-link {
    color: inherit;
    text-decoration: none;
}

.admin-devices__user-link:hover {
    color: var(--primary);
}

.admin-devices__user-meta {
    font-size: 11px;
}

.admin-devices__badge-ndp {
    opacity: 0.7;
    font-size: 10px;
}

.admin-devices__badge-bot {
    font-size: 10px;
    margin-right: 4px;
}

.admin-devices__badge-state {
    font-size: 9px;
    margin-left: 4px;
    padding: 1px 5px;
}

.admin-devices__device-str {
    font-size: 13px;
}

.admin-devices__device-id {
    font-size: 11px;
    font-family: var(--geek-mono);
    margin-left: 6px;
}

.admin-devices__row--blocked {
    background: rgba(239, 68, 68, 0.04);
}

.admin-devices__row--revoked {
    background: rgba(148, 163, 184, 0.04);
}

.admin-devices__inline-form {
    display: inline;
    margin: 0;
}

.admin-devices__block-form {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    margin: 0;
    vertical-align: middle;
}

.admin-devices__reason {
    font-size: 11px;
    padding: 2px 4px;
    width: 110px;
    max-width: 110px;
}

.admin-devices__btn-block {
    color: var(--danger);
    white-space: nowrap;
}

.admin-devices__icon-btn {
    padding: 0.25rem 0.5rem;
}

.admin-devices__self {
    font-size: 12px;
}

.admin-devices__empty {
    text-align: center;
    padding: 24px 0 8px;
}

.admin-devices__empty-reset {
    text-align: center;
    margin: 0 0 16px;
}

.admin-devices__empty-note {
    font-size: 12px;
    margin-left: 12px;
}

@media (max-width: 640px) {
    .admin-devices__filters-field--sm,
    .admin-devices__filters-field--md {
        flex: 1 1 100%;
    }

    .admin-devices__table {
        min-width: 700px;
    }

    .admin-devices__stat {
        padding: 10px;
    }

    .admin-devices__stat-num {
        font-size: 1.4rem;
    }
}


/* ============================================================
   n51c-admin-cron.css — Admin: cron
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n51c-admin-cron.css
   ============================================================ */

.cron-summary {
    margin-bottom: 16px;
}

.cron-summary__stat {
    padding: 8px 14px;
    background: var(--card-bg-hover);
    border-radius: 8px;
    font-size: 13px;
}

.cron-summary__stat--error {
    color: var(--danger);
}

.cron-summary__note {
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(47, 111, 237, 0.06);
    border-left: 3px solid var(--primary);
    border-radius: 4px;
    font-size: 12px;
}

.cron-tasks {
    display: grid;
    gap: 8px;
}

.cron-task {
    padding: 10px 12px;
    background: var(--card-bg-hover);
    border-radius: 8px;
    border-left: 3px solid var(--muted);
}

.cron-task--success {
    border-left-color: var(--success);
}

.cron-task--error {
    border-left-color: var(--danger);
}

.cron-task--skipped,
.cron-task--disabled {
    border-left-color: var(--muted);
}

.cron-task__title {
    font-weight: 600;
}

.cron-task__desc {
    font-size: 12px;
    margin-top: 2px;
    color: var(--muted);
    font-family: var(--geek-mono);
    overflow-wrap: anywhere;
    word-break: normal;
}

.cron-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    font-size: 13px;
}

.cron-table th,
.cron-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.cron-table__group td {
    padding: 10px 8px 7px;
    background: var(--card-bg-hover);
    background: color-mix(in srgb, var(--card-bg-hover) 70%, transparent);
    border-bottom-color: var(--border);
    font-size: 12px;
    letter-spacing: 0.02em;
}

.cron-table [data-cron-task-row][hidden],
.cron-table [data-cron-group-row][hidden],
.cron-table [data-cron-no-results][hidden] {
    display: none !important;
}

.cron-table [data-cron-no-results] td {
    padding: 18px 8px;
    text-align: center;
    color: var(--muted);
}

.cron-table__key {
    font-family: var(--geek-mono);
    font-size: 11px;
    color: var(--muted);
}

.cron-command {
    margin-bottom: 14px;
}

.cron-command__label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.cron-command__row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.cron-command__input {
    flex: 1 1 260px;
    min-width: 0;
    padding: 8px;
    font-family: var(--geek-mono);
    font-size: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
}

.cron-command__input:focus {
    outline: none;
    border-color: var(--primary);
}

.cron-command__input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-color: var(--primary);
}

.cron-command__input:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.cron-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px;
    background: var(--card-bg-hover);
    border-radius: 8px;
}

.cron-toggle__info {
    min-width: 0;
    flex: 1 1 240px;
}

.cron-toggle__desc {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 2px;
}



.cron-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.cron-header__title {
    margin: 0;
}

.cron-header__action {
    display: inline;
}

.cron-status {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.cron-status__note {
    font-size: 13px;
}

.cron-toggles {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cron-table__hint {
    font-size: 12px;
}

.cron-command__copy {
    flex: none;
}

.cron-command__hint {
    font-size: 0.85rem;
    margin-top: 16px;
}

.cron-command__input.is-copied {
    border-color: var(--success);
}

.cron-key__title {
    margin-bottom: 16px;
}

.cron-key__row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.cron-key__hint {
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.cron-key__form {
    display: inline;
}




.cron-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 14px 0 10px;
}

.cron-toolbar__search {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: min(100%, 360px);
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--muted);
    cursor: text;
}

.cron-toolbar__search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.16);
}

.cron-toolbar__search input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    padding: 2px 0;
}

.cron-toolbar__search input::placeholder {
    color: var(--muted);
    opacity: 0.85;
}

.cron-toolbar__count {
    font-size: 12px;
    white-space: nowrap;
}

.cron-table [data-cron-task-row] > td {
    transition: background-color 0.12s ease;
}

.cron-table [data-cron-task-row]:hover > td {
    background: rgba(47, 111, 237, 0.05);
}

.cron-command--primary .cron-command__input {
    border-color: var(--primary);
    background: rgba(47, 111, 237, 0.04);
}

.cron-command--primary .cron-command__label {
    color: var(--text);
    font-weight: 600;
}

.cron-command__label .badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 500;
    padding: 1px 8px;
    border-radius: 8px;
    margin-left: 6px;
    vertical-align: middle;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.4;
}


@media (max-width: 640px) {
    .cron-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .cron-toolbar__search {
        min-width: 100%;
    }

    .cron-toolbar__search input {
        font-size: 16px; 
    }

    .cron-toolbar__count {
        align-self: flex-end;
    }

    .cron-command__row,
    .cron-key__row {
        align-items: stretch;
    }

    .cron-command__input {
        flex-basis: 100%;
    }

    .cron-command__copy {
        flex: none;
    }

    .cron-toggle {
        align-items: flex-start;
    }

    .cron-toggle__info {
        flex-basis: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cron-table [data-cron-task-row] > td {
        transition: none;
    }
}


/* ============================================================
   n51d-admin-backups.css — Admin: backups + WebDAV
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n51d-admin-backups.css, n51e-admin-webdav.css
   ============================================================ */

.backups-notice {
    padding: 12px 16px;
    margin-bottom: 16px;
}

.backups-section {
    margin-bottom: 20px;
}

.backups-section--muted {
    background: var(--card-bg-hover);
}

.backups-section--danger {
    margin-top: 16px;
}

.backups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    align-items: end;
    margin-bottom: 16px;
}


.backups-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 12px;
    flex-wrap: wrap;
}


.backups-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.backups-row {
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.backups-row--missing {
    opacity: 0.5;
}

.backups-row__main {
    flex: 1;
    min-width: 250px;
}

.backups-row__title {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.backups-row__meta {
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.backups-row__badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.backups-row__comment {
    margin-top: 8px;
    padding: 8px 12px;
    border-left: 3px solid var(--warning);
    background: rgba(245, 158, 11, 0.06);
    border-radius: 4px;
}


.backups-actions__form {
    display: inline;
}

.backups-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}


.backups-table__date,
.dumps-table__date {
    font-size: 0.85rem;
}

.backups-table__actions,
.dumps-table__actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}


.dumps-page__actions {
    margin-bottom: 20px;
}


.backups-inline-note {
    margin-left: 8px;
}

.backups-inline-form {
    display: inline;
}


.backups-warning {
    padding: 12px 16px;
    background: rgba(245, 158, 11, 0.08);
    border-left: 3px solid var(--warning);
    border-radius: 6px;
    font-size: 0.9rem;
}

.backups-warning-inline {
    color: var(--warning);
    font-size: 0.85rem;
    margin-bottom: 16px;
}


.backups-file-input {
    padding: 10px;
    border: 2px dashed var(--border);
    border-radius: 8px;
    width: 100%;
}

.backups-restore-options {
    margin: 16px 0;
}

.backups-restore-options label {
    padding: 8px;
}


.admin-table__key {
    font-weight: 600;
    width: 220px;
}


.backups-modals .modal-overlay {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.backups-modals .modal-overlay[hidden] {
    display: none;
}

.backups-modals .modal-dialog {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 8px 32px var(--shadow);
}

.backups-modals .modal-dialog h3 {
    margin-top: 0;
    margin-bottom: 16px;
}

.backups-modals .modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}



.exc-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    min-height: 32px;
    align-items: center;
}

.exc-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 16px;
    background: var(--card-bg-hover);
    border: 1px solid var(--border);
    font-family: var(--geek-mono);
    font-size: 13px;
    color: var(--text);
}

.exc-chip--locked {
    opacity: 0.7;
    cursor: not-allowed;
}

.exc-chip__remove {
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--muted);
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
    border-radius: 4px;
}

.exc-chip__remove:hover {
    color: var(--danger);
    background: rgba(220, 38, 38, 0.1);
}

.exc-add {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.exc-add .form-input {
    flex: 1;
    min-width: 200px;
    font-family: var(--geek-mono);
}

.exc-analysis__title {
    margin: 12px 0 6px;
    font-size: 1rem;
}

.exc-analysis__form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    max-width: 560px;
}

.exc-analysis__details {
    margin-top: 16px;
}

.exc-analysis__details summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 10px;
    user-select: none;
}


@media (max-width: 640px) {
    .backups-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .backups-actions {
        width: 100%;
        justify-content: flex-start;
        margin-top: 8px;
    }
    
    .exc-add {
        flex-direction: column;
        align-items: stretch;
    }
    
    .exc-add .form-input {
        min-width: 0;
        width: 100%;
    }
}

.webdav-back {
    margin-bottom: 12px;
}

.webdav-status {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    background: rgba(47, 111, 237, 0.08);
}

.webdav-status--on {
    border-left-color: var(--success);
    background: rgba(34, 197, 94, 0.08);
}

.webdav-status--off {
    border-left-color: var(--warning);
    background: rgba(245, 158, 11, 0.08);
}

.webdav-section {
    margin-bottom: 20px;
}

.webdav-form .form-group {
    margin-bottom: 14px;
}

.webdav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.webdav-grid--split-2-1 {
    grid-template-columns: 2fr 1fr;
}

.webdav-pass-wrap {
    position: relative;
}

.webdav-pass-wrap .form-input {
    padding-right: 40px;
}

.webdav-pass-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 16px;
    color: var(--muted);
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
}

.webdav-pass-toggle:hover {
    color: var(--text);
    background: var(--card-bg-hover);
}

.webdav-verdict {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.6;
}

.webdav-verdict--ok {
    background: rgba(34, 197, 94, 0.12);
    border-left: 3px solid var(--success);
}

.webdav-verdict--warn {
    background: rgba(245, 158, 11, 0.12);
    border-left: 3px solid var(--warning);
}

.webdav-verdict--err {
    background: rgba(220, 38, 38, 0.12);
    border-left: 3px solid var(--danger);
}

.webdav-upload-form .form-group {
    margin-bottom: 14px;
}

.webdav-upload-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-top: 12px;
    background: rgba(47, 111, 237, 0.08);
    border-left: 3px solid var(--primary);
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.webdav-upload-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: webdav-spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes webdav-spin {
    to { transform: rotate(360deg); }
}


@media (max-width: 768px) {
    .webdav-grid,
    .webdav-grid--split-2-1 {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .webdav-upload-spinner {
        animation: none;
        border-top-color: var(--primary);
    }
}


/* ============================================================
   n51e-admin-primitives.css — Admin: primitives and shared sections
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n51f-admin-misc.css
   ============================================================ */

.users-page,
.assets-page,
.dumps-page,
.backups-page,
.cron-page,
.webdav-page,
.admin-devices {
    display: block;
}

.backups-page__lead,
.backups-subtitle,
.backups-section__desc,
.dumps-page__lead,
.cron-page__lead,
.assets-page__lead {
    margin-bottom: 16px;
}

.system-table,
.backups-table,
.dumps-table,
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.system-table th,
.system-table td,
.backups-table th,
.backups-table td,
.dumps-table th,
.dumps-table td,
.admin-table th,
.admin-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.system-table thead th,
.backups-table thead th,
.dumps-table thead th,
.admin-table thead th {
    background: var(--card-bg-hover);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.system-table tr:hover td,
.backups-table tr:hover td,
.dumps-table tr:hover td,
.admin-table tr:hover td {
    background: var(--card-bg-hover);
}

.backups-actions,
.admin-actions,
.admin-form-actions,
.system-actions__row,
.cron-summary__row,
.webdav-actions,
.dashboard-sections,
.bots-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.backups-actions,
.admin-actions,
.admin-form-actions,
.webdav-actions {
    align-items: center;
}

.backups-actions,
.admin-actions,
.bots-actions {
    margin-bottom: 16px;
}

.admin-form-actions,
.webdav-actions {
    margin-top: 16px;
}


.cron-empty {
    text-align: center;
    padding: 48px 16px;
}

.cron-empty__icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 16px;
    opacity: 0.5;
}

.cron-empty__title {
    margin: 0 0 8px;
    font-weight: 600;
    font-size: 1.05rem;
}

.cron-empty__desc {
    margin: 0 0 16px;
    font-size: 0.9rem;
}

.admin-form-check,
.backups-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.backups-notice,
.backups-section--primary,
.modules-install,
.modules-help,
.assets-note,
.webdav-status {
    border-left: 4px solid var(--primary);
}

.backups-section--danger,
.assets-diff {
    border-left: 4px solid var(--danger);
}

.cron-key {
    border-left: 4px solid var(--warning);
}

.backups-status {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    border-left: 3px solid var(--primary);
    background: rgba(var(--primary-rgb), 0.08);
}

.backups-status--on {
    border-left-color: var(--success);
}

.backups-status--off {
    border-left-color: var(--primary);
}

.backups-status__on {
    color: var(--success);
    font-weight: 600;
}

.backups-status__off {
    color: var(--primary);
    font-weight: 600;
}

.backups-status__meta {
    font-size: 0.8rem;
    margin-top: 4px;
}



.breadcrumbs {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--muted);
}

.breadcrumbs__list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.breadcrumbs__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.breadcrumbs__link {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumbs__link:hover {
    text-decoration: underline;
}

.breadcrumbs__sep {
    color: var(--border);
}

.breadcrumbs__current {
    color: var(--text);
}



.admin-layout .site-main {
    padding-top: 16px;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.version-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 8px;
    background: var(--card-bg-hover);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--geek-mono);
}



.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard-stat {
    display: block;
    text-align: center;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, transform 0.15s;
}

.dashboard-stat:hover {
    text-decoration: none;
    color: inherit;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow);
}

.dashboard-stat:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px var(--shadow);
}

.dashboard-stat__icon {
    font-size: 2rem;
    line-height: 1;
}

.dashboard-stat__value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
    margin-top: 4px;
}



.dashboard-stat__label {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 4px;
}

.dashboard-stat__badge {
    margin-top: 6px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.dashboard-widget {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px var(--shadow);
}

.widget-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--card-bg-hover);
    font-size: 1.4rem;
    flex-shrink: 0;
}

.widget-icon.messages {
    background: rgba(47, 111, 237, 0.15);
    color: var(--primary);
}

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

.widget-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.widget-label {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 2px;
}

.dashboard-status {
    font-family: var(--geek-mono);
    font-size: 0.85rem;
}

.dashboard-status__title {
    margin-bottom: 8px;
}

.dashboard-status__ok {
    color: var(--success);
}



.system-table__th--right {
    text-align: right;
}

.system-table__cell--right {
    text-align: right;
}

.system-table__cell--mono {
    font-family: var(--geek-mono);
    font-size: 0.85rem;
}

.system-row__label {
    font-weight: 600;
    white-space: nowrap;
    vertical-align: top;
    width: 220px;
}

.system-row__note {
    margin-left: 8px;
    font-size: 0.9rem;
}

.system-row__code {
    margin-left: 8px;
    font-size: 0.85rem;
}

.system-row__link {
    margin-left: 8px;
}

.system-row__count {
    color: var(--primary);
}

.disk-progress {
    margin-top: 16px;
}

.disk-progress__label {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

.disk-progress__track {
    position: relative;
    background: var(--card-bg-hover);
    border-radius: 8px;
    height: 24px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.disk-progress__bar {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    background: var(--success);
    transition: width 0.3s ease;
}

.disk-progress__bar--warning {
    background: var(--warning);
}

.disk-progress__bar--danger {
    background: var(--danger);
}

.disk-progress__bar--pct-0   { width: 0%;   }
.disk-progress__bar--pct-10  { width: 10%;  }
.disk-progress__bar--pct-20  { width: 20%;  }
.disk-progress__bar--pct-30  { width: 30%;  }
.disk-progress__bar--pct-40  { width: 40%;  }
.disk-progress__bar--pct-50  { width: 50%;  }
.disk-progress__bar--pct-60  { width: 60%;  }
.disk-progress__bar--pct-70  { width: 70%;  }
.disk-progress__bar--pct-80  { width: 80%;  }
.disk-progress__bar--pct-90  { width: 90%;  }
.disk-progress__bar--pct-100 { width: 100%; }

.system-actions {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.system-actions__title {
    margin-bottom: 12px;
}

.system-actions__summary {
    margin-top: 12px;
}



.assets-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.assets-summary__info {
    min-width: 0;
    flex: 1;
}

.assets-summary__size {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 6px;
}

.assets-compile {
    margin-bottom: 24px;
}

.assets-compile__title {
    margin: 0 0 6px;
}

.assets-compile__meta {
    font-size: 0.85rem;
}

.assets-compile__meta--mt {
    margin-top: 12px;
}

.assets-compile__link {
    color: inherit;
    text-decoration: none;
}

.assets-compile__link:hover {
    color: var(--primary);
}

.assets-status--missing {
    color: var(--danger);
}

.assets-details {
    margin-top: 16px;
}

.assets-details__summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 10px;
}

.assets-sources {
    font-family: var(--geek-mono);
    font-size: 0.8rem;
    line-height: 1.9;
}

.assets-sources__row {
    padding: 2px 8px;
    border-bottom: 1px solid var(--border);
}

.assets-sources__num {
    color: var(--muted);
    display: inline-block;
    min-width: 22px;
}

.assets-diff {
    margin-bottom: 24px;
}

.assets-diff__title {
    color: var(--danger);
    margin-top: 0;
}

.assets-diff__count {
    margin: 8px 0;
}

.assets-diff__details {
    margin-top: 12px;
}

.assets-diff__summary {
    cursor: pointer;
    font-weight: 600;
}

.assets-diff__list {
    max-height: 300px;
    overflow: auto;
    padding: 10px;
    background: var(--card-bg-hover);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    line-height: 1.5;
    margin-top: 8px;
    font-family: var(--geek-mono);
    white-space: pre-wrap;
    word-break: break-all;
}

.assets-diff__hint {
    margin-top: 12px;
    font-size: 0.85rem;
}

.assets-diff__actions {
    margin-top: 12px;
}

.assets-diff__cmd {
    margin-top: 8px;
    font-size: 0.8rem;
}

.assets-js-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.assets-js-empty {
    text-align: center;
    padding: 24px 0;
    font-style: italic;
}

.assets-note__list {
    margin: 10px 0 0;
    padding-left: 20px;
    line-height: 1.8;
    font-size: 0.9rem;
}



.modules-install {
    margin-bottom: 28px;
}

.modules-install__hint {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 6px 0 12px;
}

.modules-install__form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.modules-install__file {
    flex: 1;
    min-width: 220px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.modules-grid .card {
    margin: 0;
    padding: 16px;
}

.module-card {
    border-left: 4px solid var(--border);
}

.module-card--enabled {
    border-left-color: var(--success);
}

.module-card--disabled {
    opacity: 0.75;
}

.module-card__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.module-card__title {
    font-weight: 700;
    font-size: 1.05rem;
}

.module-card__desc {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 10px 0 8px;
    min-height: 40px;
}

.module-card__routes {
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 10px;
}

.module-card__route {
    background: var(--card-bg-hover);
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 4px;
    font-family: var(--geek-mono);
}

.module-card__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.module-card__badge-version,
.module-card__badge-builtin {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--border);
    color: var(--text);
    margin-left: 4px;
}

.module-card__badge-manifest {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #2196f3;
    color: #fff;
    margin-left: 4px;
}

.system-modules-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.system-modules-list .badge {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.modules-help {
    margin-top: 20px;
}

.modules-help__list {
    margin: 10px 0 0;
    padding-left: 20px;
    line-height: 1.8;
    font-size: 0.9rem;
}



.mail-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px;
}

.mail-page h1 {
    margin: 0 0 6px;
}

.mail-page__intro {
    margin-bottom: 16px;
    color: var(--muted);
}

.mail-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.mail-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mail-field__label {
    font-size: 13px;
    color: var(--muted);
}

.mail-actions {
    margin-top: 16px;
}

.mail-divider {
    margin: 20px 0;
    border: none;
    border-top: 1px solid var(--border);
}

.mail-test-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: end;
}

.mail-test-row__field {
    flex: 1;
    min-width: 220px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.hint,
.form-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 4px;
}



.edit-post-page {
    max-width: 900px;
}



.sensor-value {
    font-family: var(--geek-mono);
    font-size: 1.1rem;
    font-weight: 600;
}

.sensor-value--voltage {
    color: var(--warning);
}

.sensor-value--temperature {
    color: var(--primary);
}

.inline-note {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 4px;
}



.admin-actions--end {
    justify-content: flex-end;
}

.admin-actions--top {
    margin-top: 16px;
    margin-bottom: 0;
}

.admin-page--narrow {
    max-width: 700px;
}



.admin-simple-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-simple-table td {
    padding: 6px 0;
    vertical-align: top;
}

.admin-simple-table__label {
    font-weight: 600;
    padding: 6px 10px 6px 0;
    vertical-align: top;
    width: 220px;
    white-space: nowrap;
}

.admin-inline-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.admin-inline-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--muted);
}

.admin-inline-form select,
.admin-inline-form input {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
}

.admin-inline-form select:focus,
.admin-inline-form input:focus {
    outline: none;
    border-color: var(--primary);
}



@media (max-width: 768px) {
    .users-tabs,
    .backups-tabs {
        gap: 4px;
    }

    .users-tab {
        font-size: 12px;
        padding: 5px 10px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cron-table {
        min-width: 0;
    }

    .system-row__label,
    .admin-simple-table__label {
        width: auto;
        white-space: normal;
    }

    .backups-section {
        margin-bottom: 14px;
    }
}

@media (max-width: 640px) {
    .users-toolbar .users-search {
        min-width: 100%;
    }

    .users-table {
        min-width: 600px;
    }

    .modules-grid {
        grid-template-columns: 1fr;
    }

    .admin-inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .system-table__th--right,
    .system-table__cell--right {
        text-align: right;
    }

    .backups-grid {
        grid-template-columns: 1fr;
    }

    .cron-key__row {
        flex-wrap: wrap;
    }

    .cron-command__copy {
        width: 100%;
    }

    .backups-row {
        flex-direction: column;
    }

    .backups-row__main {
        min-width: 0;
    }

    .admin-table__key {
        width: auto;
    }

    .backups-modals .modal-dialog {
        padding: 16px;
        max-width: 100%;
    }

    .backups-table,
    .dumps-table {
        font-size: 0.9rem;
    }

    .backups-table th,
    .backups-table td,
    .dumps-table th,
    .dumps-table td {
        padding: 8px 10px;
    }

    .admin-nav {
        padding: 10px;
        gap: 4px;
    }

    .admin-nav__back {
        margin-right: 8px;
    }

    .empty-state {
        padding: 32px 12px;
    }

    .empty-state__icon {
        font-size: 40px;
    }

    .pagination__list {
        gap: 6px;
    }

    .exc-add {
        flex-direction: column;
        align-items: stretch;
    }

    .exc-add .form-input {
        min-width: 0;
    }

    .exc-chip {
        font-size: 12px;
        padding: 3px 8px;
    }

    .webdav-grid {
        grid-template-columns: 1fr;
    }
}



@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .users-pagination a,
    .users-pagination .page-current {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 8px 12px;
    }

    .copy-btn,
    .role-form button {
        min-height: 44px;
        min-width: 44px;
    }

    .users-tab {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .backups-actions .btn,
    .backups-table__actions .btn,
    .dumps-table__actions .btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .pagination__list .btn {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .admin-nav__link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}




.pagination__list {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}

.pagination__current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
}

.pagination__sep {
    color: var(--muted);
    padding: 0 4px;
    user-select: none;
}


/* ============================================================
   n51f-admin-modules-assets.css — Admin: modules + assets
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n51g-admin-modules.css, n51j-admin-assets.css
   ============================================================ */

.modules-install__error {
    flex: 1 1 100%;
    align-self: stretch;
    margin: 4px 0 0;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(var(--danger-rgb), 0.08);
    border-left: 3px solid var(--danger);
    color: var(--danger);
    font-size: 0.85rem;
    line-height: 1.4;
    word-break: break-word;
}

.modules-install__error::before {
    content: '⚠ ';
    font-weight: 700;
}

.modules-install__error[hidden] {
    display: none;
}


.modules-install__file.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 2px rgba(var(--danger-rgb), 0.20);
}

.modules-install__file.is-invalid:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(var(--danger-rgb), 0.30);
}


.btn:disabled.is-loading,
.btn.is-loading {
    cursor: wait;
    opacity: 0.7;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

.btn.is-loading:hover,
.btn.is-loading:active,
.btn:disabled.is-loading:hover,
.btn:disabled.is-loading:active {
    transform: none;
    box-shadow: none;
}


.flash.is-hidden,
.flash-message.is-hidden,
.alert.is-hidden {
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.28s ease, transform 0.28s ease;
    pointer-events: none;
}


.modules-confirm-dialog {
    max-width: 420px;
    min-width: 280px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    color: var(--text);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.30);
}

.modules-confirm-dialog::backdrop {
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.modules-confirm-dialog__message {
    margin: 0 0 18px;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--text);
    word-break: break-word;
}

.modules-confirm-dialog__actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}


@keyframes modules-confirm-in {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

.modules-confirm-dialog[open] {
    animation: modules-confirm-in 0.15s ease-out;
}


@media (max-width: 640px) {
    .modules-install__error {
        font-size: 0.8rem;
        padding: 6px 10px;
    }

    .modules-confirm-dialog {
        max-width: calc(100vw - 24px);
        min-width: 0;
        padding: 16px;
    }

    .modules-confirm-dialog__message {
        font-size: 0.9rem;
        margin-bottom: 14px;
    }

    .modules-confirm-dialog__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .modules-confirm-dialog__actions .btn {
        width: 100%;
        justify-content: center;
    }
}


@media (hover: none) and (pointer: coarse) {
    .modules-confirm-dialog__actions .btn {
        min-height: 44px; 
    }
}


@media (prefers-reduced-motion: reduce) {
    .modules-confirm-dialog[open] {
        animation: none;
    }

    .flash.is-hidden,
    .flash-message.is-hidden,
    .alert.is-hidden {
        transition: none;
    }

    .module-card__routes-summary::before {
        transition: none;
    }
}


.module-card__routes-details {
    display: block;
    margin-top: 4px;
}

.module-card__routes-summary {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    font-size: 0.75rem;
    color: var(--muted);
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background 0.15s ease, color 0.15s ease;
}

.module-card__routes-summary::-webkit-details-marker {
    display: none;
}
.module-card__routes-summary::marker {
    content: '';
}

.module-card__routes-summary::before {
    content: '▸';
    font-size: 10px;
    line-height: 1;
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.module-card__routes-details[open] > .module-card__routes-summary::before {
    transform: rotate(90deg);
}

.module-card__routes-summary:hover {
    background: var(--card-bg-hover);
    color: var(--text);
}

.module-card__routes-summary:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.module-card__routes-hidden {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    padding-left: 12px;
    border-left: 2px solid var(--border);
}

.assets-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.assets-page__lead {
    margin-bottom: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.assets-page__lead code {
    background: var(--card-bg-hover);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--geek-mono);
    font-size: 0.85em;
}


.assets-diff {
    border-left: 4px solid var(--danger);
    background: var(--card-bg);
}

.assets-diff--warning {
    border-left-color: var(--warning);
}

.assets-diff__title {
    color: var(--danger);
    margin-top: 0;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.assets-diff--warning .assets-diff__title {
    color: var(--warning);
}

.assets-diff__count {
    font-size: 1rem;
    margin-bottom: 12px;
}

.assets-diff__details {
    margin-top: 12px;
    background: var(--card-bg-hover);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.assets-diff__summary {
    cursor: pointer;
    padding: 10px 14px;
    font-weight: 600;
    user-select: none;
    color: var(--text);
    list-style: none;
}

.assets-diff__summary::-webkit-details-marker { display: none; }
.assets-diff__summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 6px;
    transition: transform 0.15s ease;
}
.assets-diff__details[open] > .assets-diff__summary::before {
    transform: rotate(90deg);
}

.assets-diff__list {
    margin: 0;
    padding: 12px 14px;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    font-family: var(--geek-mono);
    font-size: 0.85rem;
    line-height: 1.5;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.assets-diff__hint {
    margin-top: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.assets-diff__actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.assets-diff__cmd {
    margin-top: 16px;
    font-size: 0.8rem;
    line-height: 1.6;
}

.assets-diff__cmd code {
    background: var(--card-bg-hover);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--geek-mono);
    color: var(--primary);
}


.assets-compile {
    margin-bottom: 0;
}

.assets-summary {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
}

.assets-summary__info {
    flex: 1 1 auto;
    min-width: 240px;
}

.assets-compile__title {
    margin: 0 0 6px;
    font-size: 1.2rem;
}

.assets-compile__meta {
    font-size: 0.9rem;
    line-height: 1.5;
}

.assets-compile__meta--mt {
    margin-top: 16px;
}

.assets-compile__link {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px dashed var(--muted);
    transition: border-color 0.15s;
}

.assets-compile__link:hover {
    border-bottom-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
}

.assets-status--missing {
    color: var(--danger);
    font-weight: 600;
}

.assets-summary .btn:disabled {
    opacity: 0.6;
    cursor: wait;
}


.assets-details {
    margin-top: 16px;
    background: var(--card-bg-hover);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.assets-details__summary {
    cursor: pointer;
    padding: 10px 14px;
    font-weight: 600;
    user-select: none;
    color: var(--text);
    list-style: none;
}

.assets-details__summary::-webkit-details-marker { display: none; }
.assets-details__summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 6px;
    transition: transform 0.15s ease;
}
.assets-details[open] > .assets-details__summary::before {
    transform: rotate(90deg);
}

.assets-sources {
    padding: 10px 14px;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    font-family: var(--geek-mono);
    font-size: 0.85rem;
    line-height: 1.8;
    max-height: 400px;
    overflow-y: auto;
}

.assets-sources__row {
    display: flex;
    gap: 8px;
    padding: 2px 0;
    border-bottom: 1px solid var(--border);
}

.assets-sources__row:last-child {
    border-bottom: none;
}

.assets-sources__row .muted {
    flex-shrink: 0;
    min-width: 24px;
}


.assets-js-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 16px;
}



.assets-note {
    background: var(--card-bg);
    border-left: 4px solid var(--primary);
}

.assets-note h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.assets-note__list {
    margin: 0;
    padding-left: 20px;
    line-height: 1.8;
    font-size: 0.9rem;
}

.assets-note__list code {
    background: var(--card-bg-hover);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--geek-mono);
    font-size: 0.85em;
    color: var(--primary);
}


@media (max-width: 640px) {
    .assets-summary {
        flex-direction: column;
        align-items: stretch;
    }

    .assets-summary__info {
        min-width: 0;
    }

    .assets-summary form {
        margin-top: 12px;
    }

    .assets-summary .btn {
        width: 100%;
        justify-content: center;
    }

    .assets-diff__list {
        font-size: 0.8rem;
    }

    .assets-sources {
        font-size: 0.75rem;
    }
}


/* ============================================================
   n51g-admin-updates.css — Admin: updates and progress
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n51h-admin-updates.css
   ============================================================ */

.backups-page h1 {
    margin-bottom: 6px;
}

.backups-subtitle {
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.backups-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.backups-notice {
    padding: 12px 16px;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
    background: var(--card-bg-hover);
    font-size: 0.9rem;
    margin-bottom: 16px;
    line-height: 1.5;
}


.backups-section {
    margin-bottom: 24px;
}

.backups-section:last-child {
    margin-bottom: 0;
}

.backups-section__desc {
    margin-top: 4px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.backups-section--primary {
    border-left: 3px solid var(--primary);
    padding-left: 16px;
}

.backups-section--muted {
    border-left: 3px solid var(--muted);
    padding-left: 16px;
}

.backups-section--danger {
    border-left: 3px solid var(--danger);
    padding-left: 16px;
}


.backups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    align-items: end;
    margin-bottom: 20px;
}

.backups-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    padding-bottom: 8px; 
}

.backups-checkbox input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary);
}


.backups-status {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    border-left: 4px solid var(--primary);
    background: var(--card-bg-hover);
    font-size: 0.95rem;
}

.backups-status--on {
    border-left-color: var(--success);
    background: rgba(var(--success-rgb), 0.08);
}

.backups-status--off {
    border-left-color: var(--warning);
    background: rgba(var(--warning-rgb), 0.08);
}

.backups-status__on {
    color: var(--success);
}

.backups-status__off {
    color: var(--warning);
}

.backups-status__meta {
    font-size: 0.85rem;
    margin-top: 6px;
}

.backups-warning {
    padding: 14px 16px;
    background: rgba(var(--warning-rgb), 0.08);
    border-left: 4px solid var(--warning);
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.backups-warning-inline {
    color: var(--warning);
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: block;
}

.backups-inline-note {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.85em;
    vertical-align: middle;
}


.backup-progress {
    margin-top: 15px;
    max-width: 500px;
}

.backup-progress__track {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    height: 20px;
    position: relative;
}

.backup-progress__bar {
    background: var(--success);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background-color 0.2s ease;
    will-change: width;
}

.backup-progress__bar--error {
    background: var(--danger);
}

.backup-progress__stage {
    margin-top: 6px;
    font-size: 0.9em;
    line-height: 1.4;
}




.exc-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: var(--card-bg-hover);
    border: 1px solid var(--border);
    font-family: var(--geek-mono);
    font-size: 13px;
    color: var(--text);
    transition: border-color 0.15s ease;
}

.exc-chip:hover {
    border-color: var(--primary);
}



.exc-chip__remove {
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--muted);
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
    border-radius: 4px;
    transition: color 0.15s ease, background 0.15s ease;
}

.exc-chip__remove:hover {
    color: var(--danger);
    background: rgba(var(--danger-rgb), 0.12);
}

.exc-chip__remove:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}



.exc-add .form-input {
    flex: 1;
    min-width: 240px;
    font-family: var(--geek-mono);
}

.exc-analysis__title {
    margin: 24px 0 8px;
    font-size: 1.1rem;
}

.exc-analysis__form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    max-width: 560px;
}

.exc-analysis__details {
    margin-top: 20px;
}

.exc-analysis__details > summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 12px;
    user-select: none;
    color: var(--primary);
}

.exc-analysis__details > summary:hover {
    text-decoration: underline;
}

.exc-analysis__details > summary:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 2px;
}

.backups-file-input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-color: var(--primary);
}


.backups-list {
    display: flex;
    flex-direction: column;
}

.backups-row {
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    transition: background 0.15s ease;
}

.backups-row:first-child {
    padding-top: 0;
}

.backups-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.backups-row--missing {
    opacity: 0.55;
    filter: grayscale(1);
}

.backups-row__main {
    flex: 1;
    min-width: 280px;
}

.backups-row__title {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.backups-row__meta {
    font-size: 0.85rem;
    margin-bottom: 4px;
    color: var(--muted);
    line-height: 1.4;
}

.backups-row__badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.backups-row__comment {
    margin-top: 10px;
    padding: 8px 12px;
    border-left: 3px solid var(--warning);
    background: rgba(var(--warning-rgb), 0.06);
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text);
}


.backups-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    flex-shrink: 0;
}

.backups-actions__form {
    display: inline-flex;
    margin: 0;
}


.admin-table__key {
    font-weight: 600;
    width: 240px;
    vertical-align: top;
}

.backups-inline-form {
    display: inline-block;
    margin-top: 16px;
}

.backups-file-input {
    padding: 12px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    width: 100%;
    background: var(--card-bg-hover);
    cursor: pointer;
    box-sizing: border-box;
}

.backups-file-input:hover {
    border-color: var(--primary);
}


.backups-modals .modal-overlay {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: modalFadeIn 0.2s ease;
}

.backups-modals .modal-overlay[hidden] {
    display: none !important;
}

.backups-modals .modal-dialog {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 12px 32px var(--shadow-lg);
    animation: modalSlideUp 0.2s ease;
}

.backups-modals .modal-dialog h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.25rem;
}

.backups-modals .modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}


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

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}


@media (max-width: 640px) {
    .backups-tabs {
        flex-direction: column;
        align-items: stretch;
    }

    .backups-tabs .btn {
        width: 100%;
    }

    .backups-grid {
        grid-template-columns: 1fr;
    }

    .backups-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .backups-actions {
        width: 100%;
        justify-content: flex-start;
        padding-top: 8px;
        border-top: 1px dashed var(--border);
    }

    .exc-add {
        flex-direction: column;
        align-items: stretch;
    }

    .exc-add .form-input {
        min-width: 0;
        width: 100%;
    }

    .backup-progress {
        max-width: 100%;
    }

    .backups-modals .modal-actions {
        flex-direction: column-reverse;
    }

    .backups-modals .modal-actions .btn {
        width: 100%;
        justify-content: center;
    }
}


@media (prefers-reduced-motion: reduce) {
    .backups-modals .modal-overlay,
    .backups-modals .modal-dialog {
        animation: none;
    }

    .backup-progress__bar,
    .exc-chip,
    .exc-chip__remove,
    .backups-row {
        transition: none;
    }

    .backup-progress__bar {
        will-change: auto;
    }
}


/* ============================================================
   n51h-admin-dashboard.css — Admin: dashboard + eWeLink widget
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n51i-admin-dashboard.css, n51k-admin-ewelink-widget.css
   ============================================================ */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.dashboard-header h1 {
    margin: 0;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--card-bg);
    padding: 8px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px var(--shadow);
}

.dashboard-clock {
    font-family: var(--geek-mono), monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.5px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.dashboard-clock__tz {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: normal;
    margin-left: 4px;
}


.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard-stat {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
}

.dashboard-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-color: var(--primary);
    text-decoration: none;
    color: var(--text);
}

.dashboard-stat:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.dashboard-stat.is-loading {
    opacity: 0.7;
    pointer-events: none;
    transform: none;
}

.dashboard-stat__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    min-height: 24px; 
}

.dashboard-stat__icon {
    font-size: 1.8rem;
    line-height: 1;
}

.dashboard-stat__trend:empty {
    display: none;
}

.dashboard-stat__trend {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(var(--success-rgb), 0.1);
    color: var(--success);
    line-height: 1;
}

.dashboard-stat__trend--down {
    background: rgba(var(--danger-rgb), 0.1);
    color: var(--danger);
}

.dashboard-stat__value {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 4px;
    color: var(--text);
    transition: color 0.3s ease;
}

.dashboard-stat__value--success {
    color: var(--success);
}

.dashboard-stat__value--empty {
    color: var(--muted);
    opacity: 1;
}



.dashboard-stat__value.is-updated {
    animation: dashPulse 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dashboard-stat__label {
    font-size: 0.9rem;
    color: var(--muted);
    font-weight: 500;
}

.dashboard-stat__badge-wrap {
    margin-top: 8px;
    transition: opacity 0.2s ease;
}

.dashboard-stat__badge-wrap.is-hidden {
    display: none !important;
}


.dashboard-main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 1024px) {
    .dashboard-main-grid {
        grid-template-columns: 2fr 1fr;
    }
}

.dashboard-widget {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow);
    display: flex;
    flex-direction: column;
}

.dashboard-widget h2 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.dashboard-widget:has(.dashboard-actions-group) {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px 20px;
    align-items: start;
}

@media (min-width: 1200px) {
    .dashboard-widget:has(.dashboard-actions-group) {
        grid-template-columns: repeat(3, 1fr);
    }
    .dashboard-widget:has(.dashboard-actions-group) > h2 {
        grid-column: 1 / -1;
        margin-bottom: 0;
    }
}


.dashboard-actions-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dashboard-actions-group__title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 1px;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 4px;
}

.dashboard-actions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dashboard-actions-list .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px; 
}


.dashboard-status-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dashboard-status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    background: var(--card-bg-hover);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
    transition: background 0.15s ease;
}

.dashboard-status-item--ok {
    border-left-color: var(--success);
    animation: statusPulse 3s infinite ease-in-out;
}

.dashboard-status-item--warn {
    border-left-color: var(--warning);
}

.dashboard-status-item--err {
    border-left-color: var(--danger);
}

.dashboard-status-item__label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
}

.dashboard-status-item__value {
    font-family: var(--geek-mono), monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
}

.dashboard-status-item--ok .dashboard-status-item__value {
    color: var(--success);
}


@keyframes dashPulse {
    0% { 
        transform: scale(1); 
        filter: brightness(1); 
        color: inherit;
    }
    30% { 
        transform: scale(1.1); 
        filter: brightness(1.3); 
        color: var(--primary);
    }
    100% { 
        transform: scale(1); 
        filter: brightness(1); 
        color: inherit;
    }
}

@keyframes statusPulse {
    0% { box-shadow: 0 0 0 0 rgba(var(--success-rgb), 0.1); }
    50% { box-shadow: 0 0 0 4px rgba(var(--success-rgb), 0); }
    100% { box-shadow: 0 0 0 0 rgba(var(--success-rgb), 0.1); }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-stat,
    .dashboard-stat__value.is-updated,
    .dashboard-stat__badge-wrap {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
    
    .dashboard-status-item--ok {
        animation: none !important;
    }
}


@media (max-width: 640px) {
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-controls {
        justify-content: space-between;
    }

    .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-actions-list {
        display: grid;
        grid-template-columns: 1fr 1fr; 
    }
    
    .dashboard-actions-list .btn {
        width: 100%;
        justify-content: center; 
        padding: 10px 4px; 
        font-size: 13px;
    }

    .dashboard-widget:has(.dashboard-actions-group) {
        grid-template-columns: 1fr;
    }
}

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


[data-ewelink-widget] {
    margin-top: 20px;
}

[data-ewelink-widget] h2 {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

[data-ewelink-widget] h2 .btn {
    margin-left: auto;
}

[data-ewelink-widget] .dashboard-status-list {
    gap: 10px;
}

[data-ewelink-widget] .dashboard-status-item {
    align-items: flex-start;
}

[data-ewelink-widget] .dashboard-status-item > div {
    min-width: 0;
}

[data-ewelink-widget] .dashboard-status-item > div:nth-of-type(2) {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

[data-ewelink-widget] .dashboard-status-item__value {
    color: var(--text);
    white-space: nowrap;
}

[data-ewelink-widget] .dashboard-status-item__value[data-ewelink-widget-state] {
    color: var(--muted);
    font-family: var(--geek-mono), monospace;
}

[data-ewelink-widget] [data-ewelink-widget-state].is-on {
    color: var(--success);
}

[data-ewelink-widget] [data-ewelink-widget-state].is-off {
    color: var(--warning);
}

[data-ewelink-widget] .badge {
    margin-left: 6px;
    vertical-align: middle;
}

[data-ewelink-widget] form {
    margin: 0;
}

[data-ewelink-widget] .btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

[data-ewelink-widget] .btn:focus-visible,
[data-ewelink-widget] a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius);
}

[data-ewelink-widget] [data-ewelink-widget-status] {
    flex-basis: 100%;
    min-height: 1.1em;
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}

@media (max-width: 640px) {
    [data-ewelink-widget] .dashboard-status-item > div:nth-of-type(2) {
        width: 100%;
        margin-left: 0;
        justify-content: flex-end;
    }
}

@media (prefers-reduced-motion: reduce) {
    [data-ewelink-widget] *,
    [data-ewelink-widget] *::before,
    [data-ewelink-widget] *::after {
        transition: none !important;
        animation: none !important;
    }
}

.ewelink-admin-widget {
    --ew-bg: var(--card-bg, #1e293b);
    --ew-bg-soft: var(--card-bg-hover, #1a2435);
    --ew-border: var(--border, #334155);
    --ew-text: var(--text, #e2e8f0);
    --ew-muted: var(--muted, #94a3b8);
    --ew-primary: var(--primary, #3b82f6);
    --ew-success: var(--success, #22c55e);
    --ew-warning: var(--warning, #f59e0b);
    --ew-danger: var(--danger, #ef4444);
    --ew-radius: var(--radius, 10px);
    --ew-switch-w: 56px;
    --ew-switch-h: 32px;
    --ew-knob: 24px;

    margin-top: 20px;
    padding: 18px;
    background: var(--ew-bg);
    border: 1px solid var(--ew-border);
    border-radius: var(--ew-radius);
    box-shadow: 0 2px 8px var(--shadow, rgba(0, 0, 0, 0.2));
}

.ewelink-admin-widget__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--ew-border);
}

.ewelink-admin-widget__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ewelink-admin-widget__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.14);
    font-size: 18px;
    flex: 0 0 auto;
}

.ewelink-admin-widget__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ew-text);
}

.ewelink-admin-widget__subtitle {
    margin: 2px 0 0;
    color: var(--ew-muted);
    font-size: 0.78rem;
    line-height: 1.25;
}

.ewelink-admin-widget__all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ew-primary);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.ewelink-admin-widget__all:hover {
    text-decoration: underline;
}

.ewelink-admin-widget__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.ewelink-admin-widget__device {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    background: var(--ew-bg-soft);
    border: 1px solid var(--ew-border);
    border-radius: var(--ew-radius);
    min-width: 0;
}

.ewelink-admin-widget__device-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.ewelink-admin-widget__name {
    color: var(--ew-text);
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.ewelink-admin-widget__name:hover {
    color: var(--ew-primary);
}

.ewelink-admin-widget__model {
    margin-top: 3px;
    color: var(--ew-muted);
    font-size: 0.74rem;
    overflow-wrap: anywhere;
}

.ewelink-admin-widget__dot {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
    color: var(--ew-muted);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.ewelink-admin-widget__dot::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ew-muted);
}

.ewelink-admin-widget__dot.is-online::before {
    background: var(--ew-success);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.ewelink-admin-widget__control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ewelink-admin-widget__state {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--ew-muted);
}

.ewelink-admin-widget__state::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    flex: 0 0 auto;
}

.ewelink-admin-widget__state.is-on {
    color: var(--ew-success);
}

.ewelink-admin-widget__state.is-on::before {
    background: var(--ew-success);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.ewelink-admin-widget__state.is-off {
    color: var(--ew-warning);
}

.ewelink-admin-widget__state.is-off::before {
    background: var(--ew-warning);
}

.ewelink-admin-widget__toggle {
    position: relative;
    width: var(--ew-switch-w);
    height: var(--ew-switch-h);
    padding: 0;
    border: 1px solid var(--ew-border);
    border-radius: 999px;
    background: #334155;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto;
    transition: background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
    flex: 0 0 auto;
}

.ewelink-admin-widget__toggle::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: var(--ew-knob);
    height: var(--ew-knob);
    border-radius: 50%;
    background: #f8fafc;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    transition: transform 0.18s ease;
}

.ewelink-admin-widget__toggle.is-on {
    background: var(--ew-success);
    border-color: var(--ew-success);
}

.ewelink-admin-widget__toggle.is-on::after {
    transform: translateX(calc(var(--ew-switch-w) - var(--ew-knob) - 6px));
}

.ewelink-admin-widget__toggle:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ewelink-admin-widget__toggle:focus-visible {
    outline: 2px solid var(--ew-primary);
    outline-offset: 3px;
}

.ewelink-admin-widget__metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ewelink-admin-widget__chip {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 3px 7px;
    border-radius: 6px;
    background: rgba(148, 163, 184, 0.12);
    color: var(--ew-muted);
    font-size: 0.72rem;
}

.ewelink-admin-widget__chip b {
    color: var(--ew-text);
    font-family: var(--geek-mono, monospace);
    font-size: 0.78rem;
}

.ewelink-admin-widget__feedback {
    min-height: 1.1em;
    color: var(--ew-muted);
    font-size: 0.76rem;
    overflow-wrap: anywhere;
}

.ewelink-admin-widget__feedback.is-error {
    color: var(--ew-danger);
}

.ewelink-admin-widget__empty {
    margin: 0;
    color: var(--ew-muted);
    font-size: 0.85rem;
}

.ewelink-admin-widget__empty a {
    color: var(--ew-primary);
}

@media (max-width: 640px) {
    .ewelink-admin-widget {
        padding: 14px;
    }

    .ewelink-admin-widget__grid {
        grid-template-columns: 1fr;
    }

    .ewelink-admin-widget__toggle {
        --ew-switch-w: 62px;
        --ew-switch-h: 38px;
        --ew-knob: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ewelink-admin-widget *,
    .ewelink-admin-widget *::before,
    .ewelink-admin-widget *::after {
        transition: none !important;
        animation: none !important;
    }
}

/* ─── v2 dashboard polish ────────────────────────────────── */
.dashboard-card, .dashboard-stat {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.ewelink-admin-widget__device {
    border-radius: var(--radius);
    transition: border-color .18s ease, box-shadow .18s ease;
}
.ewelink-admin-widget__device:hover { border-color: rgba(var(--primary-rgb), .32); box-shadow: var(--shadow-md); }


/* ============================================================
   n52-errors.css — Error pages
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n52-errors.css
   ============================================================ */

.error-page {
    margin: 24px auto;
    max-width: 520px;
    text-align: center;
    padding: 40px 32px;
}


.error-page__code {
    font-size: 120px;
    font-weight: 900;
    line-height: 1;
    opacity: 0.3;
    font-variant-numeric: tabular-nums;
    user-select: none;
}

.error-page__code--warning {
    color: var(--warning);
}

.error-page__code--danger {
    color: var(--danger);
}

.error-page__code--success {
    color: var(--success);
}

.error-page__code--primary {
    color: var(--primary);
}


.error-page__icon {
    font-size: 64px;
    line-height: 1;
    margin: 20px 0;
    user-select: none;
}


.error-page__title {
    margin: 0 0 12px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.error-page__message {
    color: var(--muted);
    line-height: 1.5;
    margin: 0 0 16px;
}


.error-page__uri {
    background: var(--card-bg-hover);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    margin: 16px auto;
    max-width: 400px;
    font-family: var(--geek-mono);
    font-size: 13px;
    color: var(--muted);
    word-break: break-all;
    text-align: left;
}


.error-page__hint {
    text-align: left;
    background: var(--card-bg-hover);
    border: 1px solid var(--primary);
    border-radius: 8px;
    padding: 16px;
    margin: 0 0 24px;
    color: var(--primary);
    font-size: 14px;
}

.error-page__hint-title {
    color: var(--text);
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

.error-page__hint-list {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
    line-height: 1.6;
}

.error-page__hint-list li + li {
    margin-top: 4px;
}


.error-page__actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}


.error-page__timer {
    background: rgba(245, 158, 11, .12);
    border: 1px solid var(--warning);
    color: var(--warning);
    border-radius: 10px;
    max-width: 360px;
    margin: 24px auto 0;
    padding: 20px;
    text-align: center;
}

.error-page__timer-label {
    font-size: 12px;
    color: var(--warning);
    margin-bottom: 4px;
    opacity: 0.85;
}

.error-page__timer-value {
    font-size: 48px;
    font-weight: 700;
    margin: 8px 0;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.error-page__timer-note {
    font-size: 13px;
    color: var(--warning);
    opacity: 0.85;
}


@media (max-width: 640px) {
    .error-page {
        padding: 32px 20px;
    }

    .error-page__code {
        font-size: 88px;
    }

    .error-page__icon {
        font-size: 52px;
        margin: 14px 0;
    }

    .error-page__title {
        font-size: 20px;
    }

    .error-page__timer-value {
        font-size: 40px;
    }
}


/* ============================================================
   n54-home.css — Home page
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n54-home.css
   ============================================================ */

.home-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}


.home-hero {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--card-bg-hover) 100%);
    border-left: 4px solid var(--primary);
}

.home-hero__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.home-hero__text {
    flex: 1 1 auto;
    min-width: 0;
}

.home-hero__title {
    margin: 0 0 8px;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(90deg, var(--primary), var(--success));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.home-hero__subtitle {
    margin: 0;
}


.time-widget {
    padding: 12px 20px;
    background: rgba(47, 111, 237, .05);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: right;
    flex-shrink: 0;
}

.time-widget__time {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--geek-mono, monospace);
    color: var(--primary);
    line-height: 1.1;
}

.time-widget__date {
    font-size: .85rem;
    margin-top: 4px;
}

.time-widget__tz {
    font-size: .75rem;
    margin-top: 4px;
}


.home-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.home-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: transform .2s ease, border-color .15s ease, box-shadow .15s ease;
}
.home-widget:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--shadow);
    text-decoration: none;
    color: inherit;
}

.home-widget__icon {
    font-size: 2.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.home-widget__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.home-widget__label {
    font-size: .85rem;
}

.home-widget__value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}
.home-widget__value--empty {
    color: var(--muted);
    font-weight: 400;
}


.home-posts__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.home-posts__title {
    margin: 0;
    font-size: 1.25rem;
}

.home-post {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.home-post:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.home-post__row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.home-post__title {
    margin: 0 0 4px;
    font-size: 1.05rem;
    font-weight: 600;
}

.home-post__edit {
    flex-shrink: 0;
}

.home-post__meta {
    font-size: .75rem;
    margin-bottom: 8px;
}

.home-post__excerpt {
    font-style: italic;
    color: var(--muted);
    margin: 0 0 8px;
}

.home-post__body {
    line-height: 1.7;
}


.home-actions__title {
    margin: 0 0 16px;
    font-size: 1.15rem;
}

.home-actions__buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}


.home-system-info {
    font-family: var(--geek-mono, monospace);
    font-size: .85rem;
}

.home-system-info__label {
    margin-bottom: 8px;
}

.home-system-info__lines > div {
    line-height: 1.7;
}

.home-system-info__ok {
    color: var(--success);
}


@media (max-width: 768px) {
    .home-hero__row {
        flex-direction: column;
        align-items: flex-start;
    }

    .time-widget {
        text-align: left;
        width: 100%;
    }

    .home-hero__title {
        font-size: 1.25rem;
    }

    .time-widget__time {
        font-size: 1.5rem;
    }
}


@media (prefers-reduced-motion: reduce) {
    .home-widget {
        transition: none;
    }
    .home-widget:hover {
        transform: none;
    }
}


/* ============================================================
   n55a-map.css — Map: page, toolbar, coordinates, markers
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n55-map.css (part 1)
   ============================================================ */

.map-page,
.map-brouser {
    --map-input-border-hover: #89929c;
    --map-badge-bg: #eceff2;
    --map-nspd-border: #a8bde2;
    --map-alpinequest-border: #a0b8e3;
}

[data-theme="dark"] .map-page,
[data-theme="dark"] .map-brouser {
    --map-input-border-hover: #777f8c;
    --map-badge-bg: #222838;
    --map-nspd-border: #2e4471;
    --map-alpinequest-border: #2e467a;
}


.map-page { max-width: 100%; }

.map-page__lead { margin: 0 0 16px; line-height: 1.55; }

.map-page__hint {
    margin: 16px 0 0;
    font-size: 0.85rem;
    line-height: 1.6;
}

.map-attribution-inline {
    color: var(--text);
    font-weight: 500;
    white-space: nowrap;
}


.map-toolbar {
    padding: 14px 16px;
    margin-bottom: 16px;
}

.map-toolbar__row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.map-toolbar__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}


.map-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.map-field__label {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.map-field__input {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    min-width: 220px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.map-field__input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.20);
}

.map-field__input:hover:not(:disabled):not(:focus) {
    border-color: var(--map-input-border-hover);
}

.map-field__input:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    background: var(--card-bg);
    background-image: linear-gradient(
        rgba(var(--border-rgb), 0.20),
        rgba(var(--border-rgb), 0.20)
    );
}


.map-field--provider {
    padding-left: 10px;
    border-left: 3px solid var(--primary);
    border-radius: 2px;
}

.map-field--provider .map-field__label {
    color: var(--text);
    text-transform: none;
    letter-spacing: 0;
    font-size: 12px;
    font-weight: 600;
}

.map-field__input--provider {
    min-width: 260px;
    font-weight: 500;
    font-size: 0.9rem;
    padding-right: 28px;
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.map-field__input--provider:disabled {
    border-left-color: var(--muted);
    opacity: 0.6;
}

.map-field__badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 8px;
    background: var(--map-badge-bg);
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-transform: none;
    vertical-align: middle;
}


.map-north {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.map-north__icon {
    display: inline-block;
    font-size: 1em;
    transition: transform 0.3s ease;
}

.map-north__label {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    min-width: 3.2em;
    text-align: left;
}

.map-north.is-active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.10);
}

.map-north.is-active:hover {
    background: rgba(var(--primary-rgb), 0.18);
}

.map-north.is-active .map-north__icon {
    animation: map-north-pulse 2s ease-in-out infinite;
}

@keyframes map-north-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.12); }
}


.map-crosshair-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.map-crosshair-toggle__icon {
    display: inline-block;
    font-size: 1.15em;
    line-height: 1;
}

.map-crosshair-toggle.is-active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.10);
}

.map-crosshair-toggle.is-active:hover {
    background: rgba(var(--primary-rgb), 0.18);
}


.map-toolbar__status {
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--card-bg-hover);
    border-left: 3px solid var(--primary);
    font-size: 0.85rem;
    line-height: 1.5;
    word-break: break-word;
}

.map-toolbar__status--ok {
    border-left-color: var(--success);
}

.map-toolbar__status--warn {
    border-left-color: var(--warning);
}

.map-toolbar__status--error {
    border-left-color: var(--danger);
}


.map-container {
    position: relative;
    padding: 0;
    overflow: hidden;
}

.map-canvas {
    width: 100%;
    height: 70vh;
    min-height: 480px;
    background: #0e1116;
}

.map-canvas[hidden] { display: none; }

.map-crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-left: -20px;
    margin-top: -20px;
    pointer-events: none;
    z-index: 5;
    color: rgba(255, 255, 255, 0.85);
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.75))
            drop-shadow(0 0 1px rgba(0, 0, 0, 0.5));
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.map-crosshair.is-visible { display: block; opacity: 1; }

.map-crosshair__svg { display: block; width: 100%; height: 100%; }

.map-crosshair__ring,
.map-crosshair__line { stroke: currentColor; stroke-linecap: round; }

.map-crosshair__dot { fill: currentColor; }

[data-theme="light"] .map-crosshair {
    color: rgba(20, 20, 20, 0.85);
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.9))
            drop-shadow(0 0 1px rgba(255, 255, 255, 0.6));
}


.map-coords {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 8px 0 0;
    padding: 8px 12px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--text);
    user-select: none;
}

.map-coords__item {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    white-space: nowrap;
}

.map-coords__item:hover {
    background: rgba(var(--primary-rgb), 0.10);
}
.map-coords__item:active {
    background: rgba(var(--primary-rgb), 0.18);
}
.map-coords__item.is-copied {
    background: rgba(var(--success-rgb), 0.20);
    animation: map-coords-flash 0.9s ease;
}

@keyframes map-coords-flash {
    0%   {
        background: rgba(var(--success-rgb), 0.35);
    }
    100% {
        background: rgba(var(--success-rgb), 0.20);
    }
}

.map-coords__label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.map-coords__value {
    font-family: ui-monospace, "SF Mono", "Consolas", monospace;
    font-size: 12.5px;
    color: var(--text);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.map-coords__sep { color: var(--muted); opacity: 0.5; user-select: none; }
.map-coords__hint {
    margin-left: auto;
    color: var(--muted);
    font-size: 10.5px;
    font-style: italic;
    opacity: 0.75;
}


/* ============================================================
   n55b-map-settings.css — Map: settings, tabs, probe, mobile
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n55-map.css (part 2)
   ============================================================ */

.map-nspd-settings {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--card-bg);
    background-image: linear-gradient(
        rgba(var(--primary-rgb), 0.05),
        rgba(var(--primary-rgb), 0.05)
    );
    border: 1px solid var(--map-nspd-border);
}

.map-nspd-settings > summary {
    cursor: pointer;
    user-select: none;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.map-nspd-settings > summary::-webkit-details-marker { display: none; }

.map-nspd-settings > summary::before {
    content: '▸';
    display: inline-block;
    transition: transform 0.15s ease;
    font-size: 10px;
}

.map-nspd-settings[open] > summary::before { content: '▾'; }

.map-nspd-settings[open] > summary { margin-bottom: 10px; }

.map-nspd-settings__row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.map-nspd-settings__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.map-nspd-settings__label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.map-nspd-settings__input {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    font-family: ui-monospace, "SF Mono", "Consolas", monospace;
    font-size: 0.9rem;
    min-width: 120px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.map-nspd-settings__input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.20);
}

.map-nspd-settings__input:hover:not(:focus):not(:disabled) {
    border-color: var(--map-input-border-hover);
}

.map-nspd-settings__input:invalid {
    border-color: var(--danger);
}

.map-nspd-settings__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}

.map-nspd-settings__hint {
    margin: 10px 0 0;
    font-size: 11.5px;
    line-height: 1.55;
}

.map-nspd-settings__hint code {
    font-family: ui-monospace, "SF Mono", "Consolas", monospace;
    font-size: 11.5px;
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--map-badge-bg);
    color: var(--text);
}


.maplibregl-ctrl-attrib,
.maplibregl-ctrl-attrib a {
    color: var(--muted) !important;
    background: rgba(0, 0, 0, 0.5) !important;
    font-size: 11px;
}

.maplibregl-ctrl-scale {
    background: rgba(14, 17, 22, 0.75) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
    font-size: 10px;
    font-family: ui-monospace, "SF Mono", "Consolas", monospace;
    padding: 1px 6px;
    border-radius: 3px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.maplibregl-ctrl-group {
    background: var(--card-bg) !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.maplibregl-ctrl-group button { color: var(--text) !important; }

.maplibregl-ctrl-group button:hover {
    background: var(--card-bg-hover) !important;
}

.maplibregl-popup-content {
    background: var(--card-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.maplibregl-popup-tip { border-top-color: var(--card-bg); }


.map-marker {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.map-marker:hover { transform: scale(1.1); }
.map-marker--offline { background: var(--muted); }


.map-brouser { max-width: 100%; }

.map-brouser .map-toolbar__row + .map-toolbar__row {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}


.map-brouser__tabs { gap: 8px; align-items: center; }

.map-brouser__tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.map-brouser__tab.is-active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.10);
}

.map-brouser__tab.is-active:hover {
    background: rgba(var(--primary-rgb), 0.18);
}

.map-brouser__mode-hint {
    margin-left: 4px;
    font-size: 11.5px;
    font-style: italic;
    align-self: center;
}


.map-field--brouser-url { flex: 1 1 480px; min-width: 0; }

.map-brouser__url-input {
    width: 100%;
    min-width: 0;
    font-family: ui-monospace, "SF Mono", "Consolas", monospace;
    font-size: 12.5px;
    letter-spacing: 0.2px;
}


.map-field--brouser-saved { flex: 1 1 420px; min-width: 0; }

.map-brouser__saved-select {
    width: 100%;
    min-width: 0;
    font-family: ui-monospace, "SF Mono", "Consolas", monospace;
    font-size: 12.5px;
}


.map-brouser__page-info {
    margin-top: 10px;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(var(--primary-rgb), 0.08);
    border-left: 3px solid var(--primary);
    font-size: 12.5px;
    display: flex;
    gap: 8px;
    align-items: baseline;
    flex-wrap: wrap;
}

.map-brouser__page-info-label {
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-size: 11px;
}

.map-brouser__page-info-value {
    font-family: ui-monospace, "SF Mono", "Consolas", monospace;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}


.map-brouser__iframe {
    width: 100%;
    height: 70vh;
    min-height: 480px;
    border: 0;
    background: #0e1116;
    display: none;
}

.map-brouser__iframe:not([hidden]) { display: block; }


.map-brouser__headers {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--card-bg);
    background-image: linear-gradient(
        rgba(var(--border-rgb), 0.08),
        rgba(var(--border-rgb), 0.08)
    );
    border: 1px solid var(--border);
}

.map-brouser__headers > summary {
    cursor: pointer;
    user-select: none;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.map-brouser__headers > summary::-webkit-details-marker { display: none; }

.map-brouser__headers > summary::before {
    content: '▸';
    display: inline-block;
    transition: transform 0.15s ease;
    font-size: 10px;
}

.map-brouser__headers[open] > summary::before { content: '▾'; }

.map-brouser__headers[open] > summary {
    margin-bottom: 10px;
    color: var(--text);
}

.map-brouser__headers-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-brouser__headers-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.map-brouser__headers-label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.map-brouser__headers-label code {
    text-transform: none;
    letter-spacing: 0;
    color: var(--muted);
    font-family: ui-monospace, "SF Mono", "Consolas", monospace;
    font-size: 11px;
    background: transparent;
    padding: 0;
}

.map-brouser__headers-input {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    font-family: ui-monospace, "SF Mono", "Consolas", monospace;
    font-size: 12px;
    letter-spacing: 0.2px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.map-brouser__headers-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.20);
}

.map-brouser__headers-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.map-brouser__headers-hint {
    margin-left: auto;
    font-size: 11px;
    font-style: italic;
    opacity: 0.8;
}


.map-brouser__appearance {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--card-bg);
    background-image: linear-gradient(
        rgba(var(--border-rgb), 0.08),
        rgba(var(--border-rgb), 0.08)
    );
    border: 1px solid var(--border);
}

.map-brouser__appearance > summary {
    cursor: pointer;
    user-select: none;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.map-brouser__appearance > summary::-webkit-details-marker { display: none; }

.map-brouser__appearance > summary::before {
    content: '▸';
    display: inline-block;
    transition: transform 0.15s ease;
    font-size: 10px;
}

.map-brouser__appearance[open] > summary::before { content: '▾'; }

.map-brouser__appearance[open] > summary {
    margin-bottom: 10px;
    color: var(--text);
}

.map-brouser__appearance-row {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.map-brouser__appearance-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex-shrink: 0;
}

.map-brouser__appearance-label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.map-brouser__appearance-color {
    width: 48px;
    height: 32px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.map-brouser__appearance-color:hover {
    border-color: var(--map-input-border-hover);
}

.map-brouser__appearance-color:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.20);
}

.map-brouser__appearance-color::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 4px;
    overflow: hidden;
}

.map-brouser__appearance-color::-webkit-color-swatch {
    border: 0;
    border-radius: 4px;
}

.map-brouser__appearance-color::-moz-color-swatch {
    border: 0;
    border-radius: 4px;
}

.map-brouser__appearance-presets {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.map-brouser__preset {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    min-width: 64px;
    text-align: center;
}

.map-brouser__preset:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.map-brouser__preset:active { transform: translateY(0); }

.map-brouser__preset:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.map-brouser__appearance-hint {
    margin-left: auto;
    font-size: 11px;
    font-style: italic;
    opacity: 0.8;
}


.map-brouser__probe-row {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    background: rgba(var(--success-rgb), 0.08);
    border-left: 3px solid var(--success);
}

.map-field--brouser-probe { flex: 1 1 480px; min-width: 0; }

.map-brouser__probe-select {
    width: 100%;
    min-width: 0;
    font-family: ui-monospace, "SF Mono", "Consolas", monospace;
    font-size: 12.5px;
}


.map-brouser__alpinequest {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--card-bg);
    background-image: linear-gradient(
        rgba(var(--primary-rgb), 0.06),
        rgba(var(--primary-rgb), 0.06)
    );
    border: 1px solid var(--map-alpinequest-border);
}

.map-brouser__alpinequest > summary {
    cursor: pointer;
    user-select: none;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.map-brouser__alpinequest > summary::-webkit-details-marker { display: none; }

.map-brouser__alpinequest > summary::before {
    content: '▸';
    display: inline-block;
    transition: transform 0.15s ease;
    font-size: 10px;
}

.map-brouser__alpinequest[open] > summary::before { content: '▾'; }

.map-brouser__alpinequest[open] > summary {
    margin-bottom: 10px;
}

.map-brouser__alpinequest-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.map-brouser__alpinequest-hint {
    font-size: 12px;
    line-height: 1.55;
    margin: 0;
}

.map-brouser__alpinequest-create {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.map-brouser__alpinequest-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 280px;
    min-width: 0;
}

.map-brouser__alpinequest-label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.map-brouser__alpinequest-input {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.map-brouser__alpinequest-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.20);
}

.map-brouser__alpinequest-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.map-brouser__alpinequest-token {
    padding: 12px;
    border-radius: 6px;
    background: var(--card-bg);
    background-image: linear-gradient(
        rgba(var(--warning-rgb), 0.10),
        rgba(var(--warning-rgb), 0.10)
    );
    border-left: 3px solid var(--warning);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.map-brouser__alpinequest-warning {
    margin: 0;
    color: var(--warning);
    font-size: 12px;
    font-weight: 600;
}

.map-brouser__alpinequest-token-value {
    display: block;
    padding: 8px 10px;
    border-radius: 4px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    font-family: ui-monospace, "SF Mono", "Consolas", monospace;
    font-size: 11.5px;
    word-break: break-all;
    user-select: all;
    cursor: text;
    color: var(--text);
}

.map-brouser__alpinequest-token-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.map-brouser__alpinequest-list {
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.map-brouser__alpinequest-empty {
    padding: 12px;
    text-align: center;
    font-size: 12.5px;
}

.map-brouser__alpinequest-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.map-brouser__alpinequest-table th,
.map-brouser__alpinequest-table td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.map-brouser__alpinequest-table th {
    background: var(--card-bg);
    background-image: linear-gradient(
        rgba(var(--border-rgb), 0.15),
        rgba(var(--border-rgb), 0.15)
    );
    font-weight: 600;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

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

.map-brouser__alpinequest-table code {
    font-family: ui-monospace, "SF Mono", "Consolas", monospace;
    font-size: 11.5px;
    color: var(--text);
    background: transparent;
    padding: 0;
}

.map-brouser__alpinequest-status--active  { color: var(--success); font-weight: 600; }
.map-brouser__alpinequest-status--revoked { color: var(--danger);  font-weight: 600; }
.map-brouser__alpinequest-status--expired { color: var(--warning); font-weight: 600; }


@media (max-width: 768px) {
    .map-toolbar__row {
        flex-direction: column;
        align-items: stretch;
    }

    .map-field--provider {
        order: -1;
        padding-left: 0;
        padding-top: 10px;
        border-left: none;
        border-top: 3px solid var(--primary);
    }

    .map-field__input,
    .map-field__input--provider {
        min-width: 0;
        width: 100%;
        font-size: 16px;
    }

    .map-field--brouser-url,
    .map-field--brouser-saved,
    .map-field--brouser-probe { flex: 1 1 100%; }

    .map-brouser__url-input,
    .map-brouser__saved-select,
    .map-brouser__probe-select { font-size: 14px; }

    .map-brouser__mode-hint { display: none; }

    .map-brouser__iframe {
        height: 60vh;
        min-height: 360px;
    }

    .map-brouser__headers-hint { display: none; }

    .map-brouser__headers-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .map-brouser__headers-actions .btn { width: 100%; }

    .map-brouser__appearance-row { gap: 10px; }
    .map-brouser__appearance-hint { display: none; }
    .map-brouser__appearance-presets { width: 100%; }
    .map-brouser__preset {
        flex: 1 1 0;
        min-width: 0;
        padding: 8px 6px;
        font-size: 11.5px;
    }

    .map-toolbar__actions {
        margin-left: 0;
        width: 100%;
    }

    .map-toolbar__actions .btn {
        flex: 1 1 auto;
        text-align: center;
        justify-content: center;
    }

    .map-canvas {
        height: 60vh;
        min-height: 360px;
    }

    .map-page__lead,
    .map-page__hint { font-size: 0.85rem; }

    .map-coords {
        padding: 6px 10px;
        font-size: 11.5px;
        gap: 8px;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .map-coords::-webkit-scrollbar { display: none; }
    .map-coords__hint { display: none; }
    .map-coords__value { font-size: 11.5px; }

    .map-north__label,
    .map-crosshair-toggle__label { display: none; }

    .map-north,
    .map-crosshair-toggle {
        padding-left: 12px;
        padding-right: 12px;
    }

    .map-nspd-settings__row {
        flex-direction: column;
        align-items: stretch;
    }
    .map-nspd-settings__input {
        min-width: 0;
        width: 100%;
        font-size: 16px;
    }
    .map-nspd-settings__actions {
        margin-left: 0;
        width: 100%;
    }
    .map-nspd-settings__actions .btn {
        width: 100%;
    }
    .map-nspd-settings__hint {
        font-size: 11px;
    }

    .map-brouser__alpinequest-create {
        flex-direction: column;
        align-items: stretch;
    }
    .map-brouser__alpinequest-actions { width: 100%; }
    .map-brouser__alpinequest-actions .btn { flex: 1 1 auto; }
    .map-brouser__alpinequest-token-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .map-brouser__alpinequest-token-actions .btn {
        width: 100%;
        text-align: center;
    }
    .map-brouser__alpinequest-table th,
    .map-brouser__alpinequest-table td {
        padding: 4px 6px;
        font-size: 11px;
    }
}


@media (max-width: 640px) {
    .map-toolbar { padding: 12px; }
    .map-toolbar__actions { flex-direction: column; }
    .map-toolbar__actions .btn { width: 100%; }

    .map-canvas { height: 55vh; min-height: 320px; }
    .map-coords__label { font-size: 10px; }
    .map-coords__value { font-size: 11px; }

    .map-crosshair {
        width: 32px;
        height: 32px;
        margin-left: -16px;
        margin-top: -16px;
    }

    .map-brouser__url-input,
    .map-brouser__saved-select,
    .map-brouser__probe-select {
        font-size: 13px;
        padding: 8px 10px;
    }

    .map-brouser__iframe {
        height: 55vh;
        min-height: 320px;
    }

    .map-brouser__headers-input { font-size: 12.5px; }

    .map-brouser__preset {
        flex: 1 1 calc(50% - 3px);
        padding: 8px 4px;
        font-size: 11px;
    }
}


@media (prefers-reduced-motion: reduce) {
    .map-field__input,
    .map-marker,
    .map-coords__item,
    .map-north,
    .map-crosshair-toggle,
    .map-crosshair,
    .map-nspd-settings > summary::before,
    .map-nspd-settings__input,
    .map-brouser__tab,
    .map-brouser__headers > summary::before,
    .map-brouser__appearance > summary::before,
    .map-brouser__alpinequest > summary::before,
    .map-brouser__preset,
    .map-brouser__appearance-color {
        transition: none;
    }

    .map-coords__item.is-copied { animation: none; }
    .map-north.is-active .map-north__icon { animation: none; }
}


/* ============================================================
   n60a-server-panel.css — ServerPanel: shell, cards, metrics, diagnostics
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n60-server-panel.css (part 1)
   ============================================================ */

.server-panel-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    padding: 6px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow-x: auto;
    flex-wrap: wrap;
}

.server-panel-tabs__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.server-panel-tabs__item:hover {
    background: var(--card-bg-hover);
}

.server-panel-tabs__item.is-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    box-shadow: 0 2px 10px color-mix(in srgb, var(--primary) 45%, transparent);
}

.server-panel-tabs__item:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.server-panel-tabs__icon  { font-size: 1rem; }
.server-panel-tabs__label { font-size: 0.9rem; }

.server-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.server-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.server-panel__title {
    margin: 0;
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.server-panel__meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.server-panel__generated {
    font-size: 0.8rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.server-panel__notice {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
    border-left: 4px solid var(--border);
    background: var(--card-bg-hover);
}

.server-panel__notice--info {
    background: var(--card-bg-hover);
    border-left-color: var(--primary);
}

.server-panel__notice--success {
    background: rgba(63, 185, 80, 0.08);
    border-left-color: var(--success);
}

.server-panel__notice--warning {
    background: rgba(240, 160, 32, 0.08);
    border-left-color: var(--warning);
}

.server-panel__notice--error {
    background: rgba(231, 76, 60, 0.08);
    border-left-color: var(--danger);
    color: var(--danger);
}

.server-panel__notice code {
    background: var(--card-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
}

.server-panel__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    align-items: stretch;
}

.server-panel__card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    transition: border-color 0.15s ease;
}

.server-panel__card:hover {
    border-color: var(--muted);
    border-color: color-mix(in srgb, var(--border) 60%, var(--muted));
}

.server-panel__card > :last-child {
    margin-bottom: 0;
}

.server-panel__card--wide {
    grid-column: 1 / -1;
}

.server-panel__card-title {
    margin: 0 0 12px 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.server-panel__kv {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.server-panel__kv td {
    padding: 4px 0;
    vertical-align: top;
}

.server-panel__kv td:first-child {
    color: var(--muted);
    width: 40%;
}

.server-panel__kv td:last-child {
    text-align: right;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.server-panel__kv--small {
    font-size: 0.8rem;
    margin-top: 8px;
}

.server-panel__kv code {
    background: var(--card-bg-hover);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
}

.server-panel__kv--settings td:first-child { width: 40%; text-align: left; }
.server-panel__kv--settings td:last-child  { text-align: left; }

.server-panel__metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.server-panel__metric {
    text-align: center;
    padding: 8px 4px;
    background: var(--card-bg-hover);
    border-radius: 6px;
    min-width: 0;
}

.server-panel__metric-label {
    font-size: 0.7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.server-panel__metric-value {
    font-size: clamp(0.85rem, 1.3vw, 1.1rem);
    font-weight: 700;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.server-panel__bar {
    position: relative;
    height: 10px;
    border-radius: 999px;
    background: var(--card-bg-hover);
    box-shadow: inset 0 0 0 1px var(--border);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border) 70%, transparent);
    overflow: hidden;
    margin: 8px 0 6px;
}

.server-panel__bar-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--pct, 0%);
    height: 100%;
    background: var(--primary);
    background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 65%, var(--success)));
    transition: width 0.3s ease;
}

.server-panel__bar--warn .server-panel__bar-fill {
    background: var(--warning);
    background: linear-gradient(90deg, var(--warning), color-mix(in srgb, var(--warning) 70%, var(--danger)));
}

.server-panel__bar--err  .server-panel__bar-fill {
    background: var(--danger);
    background: linear-gradient(90deg, var(--danger), color-mix(in srgb, var(--danger) 75%, #000));
}

.server-panel__bar-label {
    font-size: 0.8rem;
    color: var(--muted);
    text-align: right;
    font-variant-numeric: tabular-nums;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0 4px;
}

.server-panel__path {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.server-panel__badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.server-panel__badge--ok   { background: rgba(63, 185, 80, 0.15);   color: var(--success); }
.server-panel__badge--warn { background: rgba(240, 160, 32, 0.15);  color: var(--warning); }
.server-panel__badge--err  { background: rgba(231, 76, 60, 0.15);   color: var(--danger); }

.server-panel__badge--truncate {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-panel__extensions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.server-panel__services {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

.server-panel__services th,
.server-panel__services td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.server-panel__services thead th {
    background: var(--card-bg-hover);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.server-panel__services tbody tr {
    transition: background 0.12s ease;
}

.server-panel__services tbody tr:nth-child(even) {
    background: rgba(127, 127, 127, 0.035);
}

.server-panel__services tbody tr:hover {
    background: var(--card-bg-hover);
}

.server-panel__services td:last-child { white-space: nowrap; }

.server-panel__services td .server-panel__btn + .server-panel__btn,
.server-panel__row-actions .server-panel__btn + .server-panel__btn {
    margin-left: 4px;
}

.server-panel__services code {
    background: var(--card-bg-hover);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
}

.server-panel__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 10px;
    min-height: 28px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: inherit;
    font-size: 0.8rem;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
    text-decoration: none;
}

.server-panel__btn:hover:not([disabled]) {
    background: var(--card-bg-hover);
    border-color: color-mix(in srgb, var(--border) 50%, var(--muted));
}

.server-panel__btn:active:not([disabled]) {
    transform: translateY(1px);
}

.server-panel__btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.server-panel__btn--warn {
    border-color: var(--warning);
    color: var(--warning);
}

.server-panel__btn--primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.server-panel__btn--sm {
    padding: 2px 8px;
    font-size: 0.75rem;
}

.server-panel__btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

.server-panel__actions-row {
    display: flex;
    gap: 8px;
    row-gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.server-panel__charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.server-panel__chart {
    background: var(--card-bg-hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
}

.server-panel__chart-title {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.server-panel__chart-svg {
    width: 100%;
    height: 110px;
    display: block;
    background: rgba(127, 127, 127, 0.04);
    background:
        linear-gradient(to bottom,
            color-mix(in srgb, var(--primary) 5%, transparent),
            transparent 60%);
    border-radius: 6px;
}

.server-panel__chart-svg polyline {
    fill: none;
    stroke: var(--primary);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.server-panel__chart-svg polyline.sp-chart--warn { stroke: var(--warning); }
.server-panel__chart-svg polyline.sp-chart--err  { stroke: var(--danger); }

.server-panel__chart-svg line.sp-chart-axis {
    stroke: color-mix(in srgb, var(--text) 28%, transparent);
    stroke-dasharray: 3 3;
    opacity: 0.8;
    vector-effect: non-scaling-stroke;
}

.server-panel__chart-svg text.sp-chart-label {
    font-size: 9px;
    fill: var(--text);
    opacity: 0.65;
}

.server-panel__settings-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.server-panel__settings-textarea {
    width: 100%;
    min-height: 240px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    resize: vertical;
}

.server-panel__input {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--card-bg);
    color: inherit;
    font-size: 0.9rem;
    width: 120px;
}

.server-panel__checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

.server-panel-alert {
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid var(--border);
    background: var(--card-bg-hover);
}

.server-panel-alert--warning {
    border-left-color: var(--warning);
    background: rgba(240, 160, 32, 0.08);
}

.server-panel-alert--error {
    border-left-color: var(--danger);
    background: rgba(231, 76, 60, 0.08);
}

.server-panel-alert--critical {
    border-left-color: var(--danger);
    background: rgba(231, 76, 60, 0.15);
}

.server-panel-alert__title {
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.server-panel-alert__list {
    margin: 0;
    padding-left: 20px;
    font-size: 0.9rem;
}

.server-panel-alert__item { margin: 4px 0; }
.server-panel-alert__item--critical { font-weight: 600; }

.server-panel__form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
}

.server-panel__form-row label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--muted);
}

.server-panel__form-row .server-panel__input        { width: 180px; }
.server-panel__form-row .server-panel__input--wide  { width: 280px; }

.server-panel__range-toggle {
    display: inline-flex;
    gap: 2px;
    margin-left: 12px;
}

.server-panel__range-toggle .server-panel__btn.is-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.server-panel__error-msg {
    font-size: 0.8rem;
    max-width: 600px;
    word-break: break-word;
    white-space: normal;
}

.server-panel__cron-line {
    background: var(--card-bg-hover);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    cursor: text;
}

.server-panel__db-link {
    text-decoration: none;
    color: inherit;
}

.server-panel__db-link:hover code {
    background: var(--primary);
    color: #fff;
}

.server-panel select.server-panel__input {
    appearance: none;
    -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                      linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 14px) calc(1em + 2px),
                         calc(100% - 9px) calc(1em + 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 30px;
}

.server-panel__diag-table td {
    vertical-align: middle;
}

.server-panel__diag-table td:nth-child(2) {
    white-space: nowrap;
}

.server-panel__diag-table td:nth-child(4) code {
    word-break: break-all;
}

.server-panel__diag-fix {
    display: inline-block;
    background: rgba(240, 160, 32, 0.1);
    color: var(--warning);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.3;
    cursor: copy;
    transition: background 0.15s ease;
}

.server-panel__diag-fix:hover {
    background: rgba(240, 160, 32, 0.2);
}

.server-panel__diag-fix:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.sp-diag-row--warning {
    background: rgba(240, 160, 32, 0.06);
}

.sp-diag-row--error,
.sp-diag-row--critical {
    background: rgba(231, 76, 60, 0.06);
}

.server-panel__diag-table tr.sp-diag-row--highlight {
    background: rgba(240, 160, 32, 0.25);
    transition: background 0.3s ease;
}

.server-panel__col-status { width: 50px; }
.server-panel__col-check  { width: 22%; }
.server-panel__col-fix    { width: 28%; }
.server-panel__col-num    { width: 80px; text-align: right; }

.server-panel__hint {
    margin: 6px 0 0 0;
    font-size: 0.8rem;
}

.server-panel__hint-sm {
    font-size: 0.8rem;
    font-style: italic;
}

.server-panel__text-xs {
    font-size: 0.75rem;
    margin-top: 2px;
}

.server-panel__group-count {
    font-weight: 400;
    font-size: 0.8rem;
}

.server-panel__ml-auto {
    margin-left: auto;
}

.server-panel__mb-12 {
    margin-bottom: 12px;
}

.server-panel__mt-12 {
    margin-top: 12px;
}

.server-panel__chart-note {
    font-size: 0.75rem;
    font-weight: 400;
    margin-left: auto;
}

/* ─── v2 server panel polish ─────────────────────────────── */
.server-panel__card {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.server-panel__btn { transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease; }
.server-panel__btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }


/* ============================================================
   n60b-server-panel-backups.css — ServerPanel: backups, sites, DB, SSL, deploy
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n60-server-panel.css (part 2)
   ============================================================ */

.server-panel__section-head {
    margin-bottom: 12px;
}

.server-panel__section-title {
    margin: 0 0 4px 0;
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.server-panel__section-desc {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    line-height: 1.5;
}

.server-panel__section-desc code {
    background: var(--card-bg-hover);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
}

.server-panel__empty {
    padding: 16px 0;
    text-align: center;
    font-size: 0.9rem;
    font-style: italic;
}

.server-panel__form-hint {
    align-self: flex-end;
    padding-bottom: 6px;
    font-size: 0.8rem;
}

.server-panel__actions-row--top {
    margin-top: 12px;
}

.server-panel__col-cb {
    width: 32px;
    text-align: center;
}


.server-panel__row-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    justify-content: flex-start;
}

.server-panel__form-row .server-panel__label-checkbox {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    color: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    align-self: flex-end;
    padding-bottom: 6px;
}

.server-panel__form-row .server-panel__label-checkbox input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.server-panel__form-row .server-panel__label-checkbox code {
    background: var(--card-bg-hover);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    color: var(--text);
}


.server-panel__inline-form {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin: 0;
}

.server-panel__input--file {
    width: auto;
    max-width: 280px;
    padding: 4px 8px;
    font-size: 0.85rem;
}


.server-panel__cron-table td.server-panel__cron-tasks {
    vertical-align: top;
    white-space: normal;
}

.server-panel__cron-task-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.server-panel__cron-task {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 6px 10px;
    border-left: 3px solid var(--primary);
    background: var(--card-bg-hover);
    border-radius: 3px;
}

.server-panel__cron-task-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    line-height: 1.4;
}

.server-panel__cron-schedule {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.95em;
    letter-spacing: 0.02em;
    color: var(--primary);
    background: var(--card-bg);
    padding: 1px 6px;
    border-radius: 3px;
    cursor: text;
}

.server-panel__cron-human {
    font-size: 0.92em;
}

.server-panel__cron-user {
    font-size: 0.92em;
    margin-left: auto;
}

.server-panel__cron-user code {
    background: var(--card-bg);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
}

.server-panel__cron-command {
    display: block;
    font-size: 0.82em;
    line-height: 1.5;
    word-break: break-all;
    white-space: pre-wrap;
    cursor: pointer;
    background: var(--card-bg);
    padding: 4px 8px;
    border-radius: 3px;
}

.server-panel__cron-command:hover {
    background: var(--card-bg-hover);
}

.server-panel__toasts {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    right:  calc(20px + env(safe-area-inset-right,  0px));
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: var(--z-toast);
    pointer-events: none;
    max-width: 380px;
    max-height: 50vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.server-panel__toast {
    padding: 10px 14px;
    border-radius: 6px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left-width: 4px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.4;
    pointer-events: auto;
    flex-shrink: 0;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    word-break: break-word;
    white-space: pre-wrap;
}

.server-panel__toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.server-panel__toast--ok   { border-left-color: var(--success); }
.server-panel__toast--err  { border-left-color: var(--danger);  }
.server-panel__toast--warn { border-left-color: var(--warning); }
.server-panel__toast--info { border-left-color: var(--primary); }

.server-panel__group-title [aria-hidden="true"] {
    margin-right: 0.35rem;
}

@media (prefers-reduced-motion: reduce) {
    .server-panel-tabs__item,
    .server-panel__bar-fill,
    .server-panel__btn,
    .server-panel__diag-fix,
    .server-panel__toast,
    .server-panel__diag-table tr.sp-diag-row--highlight {
        transition: none;
    }
}


.server-panel__btn--ghost {
    background: transparent;
    border-color: transparent;
    color: var(--muted);
}

.server-panel__btn--ghost:hover:not([disabled]) {
    background: var(--card-bg-hover);
    border-color: var(--border);
    color: var(--text);
}

.server-panel__actions-row .server-panel__btn.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.server-panel__btn--sm {
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 5px;
}

.server-panel__badge--info {
    background: var(--card-bg-hover);
    background: color-mix(in srgb, var(--primary) 15%, transparent);
    color: var(--primary);
}

.server-panel__notice--warn {
    background: rgba(240, 160, 32, 0.08);
    border-left-color: var(--warning);
}

.server-panel__alert {
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid var(--border);
    background: var(--card-bg-hover);
    line-height: 1.5;
}

.server-panel__alert--warning {
    border-left-color: var(--warning);
    background: rgba(240, 160, 32, 0.08);
}

.server-panel__alert code {
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--card-bg);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
}

.server-panel__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.server-panel__field > label {
    font-size: 0.8rem;
    color: var(--muted);
}

.server-panel__field-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.server-panel__fieldset {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.server-panel__fieldset > legend {
    padding: 0 6px;
    font-size: 0.8rem;
    color: var(--muted);
}

.server-panel__input--sm {
    width: 90px;
}

.server-panel textarea.server-panel__input {
    width: 100%;
    min-height: 72px;
    resize: vertical;
}

.server-panel select.server-panel__input {
    min-width: 150px;
}

.server-panel__input:focus-visible,
.server-panel__settings-textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
    border-color: var(--primary);
}

.server-panel input[type="checkbox"] {
    accent-color: var(--primary);
}

.sp-cron-dashboard {
    min-width: 0;
}

.sp-cron-dashboard__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.sp-cron-dashboard__title {
    margin: 0;
}

.sp-cron-dashboard__title-count {
    font-size: 0.8rem;
    font-weight: 400;
}

.sp-cron-dashboard__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.8rem;
}

.sp-cron-dashboard__global-run {
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--card-bg-hover);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
}

.sp-cron-dashboard__empty {
    margin: 8px 0 0;
}

.sp-cron-dashboard__aggregates {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 10px;
}

.sp-cron-agg {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card-bg-hover);
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1;
}

.sp-cron-agg__icon {
    font-size: 0.9rem;
}

.sp-cron-agg__label {
    font-weight: 500;
}

.sp-cron-agg__count {
    display: inline-flex;
    justify-content: center;
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(127, 127, 127, 0.16);
    color: var(--text);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.sp-cron-agg--ok      { color: var(--success); border-color: var(--border); border-color: color-mix(in srgb, var(--success) 40%, var(--border)); }
.sp-cron-agg--error   { color: var(--danger);  border-color: var(--border); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.sp-cron-agg--skipped { color: var(--warning); border-color: var(--border); border-color: color-mix(in srgb, var(--warning) 40%, var(--border)); }
.sp-cron-agg--disabled,
.sp-cron-agg--unknown { color: var(--muted); }
.sp-cron-agg--stale   { color: var(--danger);  border-color: var(--border); border-color: color-mix(in srgb, var(--danger) 50%, var(--border)); }

.sp-cron-agg--active.sp-cron-agg--error   { background: rgba(231, 76, 60, 0.12); }
.sp-cron-agg--active.sp-cron-agg--skipped { background: rgba(240, 160, 32, 0.12); }
.sp-cron-agg--active.sp-cron-agg--stale   { background: rgba(231, 76, 60, 0.12); }

.sp-cron-dashboard__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 10px;
}

.sp-cron-filter {
    appearance: none;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card-bg);
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sp-cron-filter:hover {
    background: var(--card-bg-hover);
    color: var(--text);
}

.sp-cron-filter--active,
.sp-cron-filter[aria-selected="true"] {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.sp-cron-filter:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.sp-cron-filter-empty {
    padding: 16px;
    color: var(--muted);
    text-align: center;
}

.sp-cron-dashboard__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 10px;
}

.sp-cron-dashboard__search {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: min(100%, 360px);
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--muted);
    cursor: text;
}

.sp-cron-dashboard__search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.16);
}

.sp-cron-dashboard__search input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    padding: 2px 0;
}

.sp-cron-dashboard__search input::placeholder {
    color: var(--muted);
    opacity: 0.85;
}

.sp-cron-dashboard__shown {
    font-size: 0.78rem;
    white-space: nowrap;
}

.sp-cron-dashboard__table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 6px;
}

.sp-cron-dashboard__table-wrap .sp-cron-dashboard-table {
    min-width: 860px;
}

.sp-cron-dashboard-table [hidden] {
    display: none !important;
}

.sp-cron-dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.sp-cron-dashboard-table th,
.sp-cron-dashboard-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.sp-cron-dashboard-table thead th {
    background: var(--card-bg-hover);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.sp-cron-task__name code {
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--card-bg-hover);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
}

.sp-cron-task__heavy {
    margin-left: 4px;
    color: var(--warning);
}

.sp-cron-task__module,
.sp-cron-task__interval,
.sp-cron-task__last-run {
    color: var(--muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

.sp-cron-task__status {
    white-space: nowrap;
}

.sp-cron-task__result {
    min-width: 220px;
    max-width: 420px;
}

.sp-cron-task__details summary {
    color: var(--muted);
    font-size: 0.8rem;
    cursor: pointer;
    list-style: none;
}

.sp-cron-task__details summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 4px;
    transition: transform 0.15s ease;
}

.sp-cron-task__details[open] summary::before {
    content: '▾';
}

.sp-cron-task__details summary::-webkit-details-marker {
    display: none;
}

.sp-cron-task__full {
    margin: 6px 0 0;
    padding: 6px 8px;
    max-height: 180px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--card-bg);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.sp-cron-task__actions-head,
.sp-cron-task__actions {
    width: 44px;
    text-align: right;
    white-space: nowrap;
}

.sp-cron-task--status-error   { box-shadow: inset 3px 0 0 var(--danger); }
.sp-cron-task--status-skipped { box-shadow: inset 3px 0 0 var(--warning); }
.sp-cron-task--status-disabled,
.sp-cron-task--status-unknown { box-shadow: inset 3px 0 0 var(--muted); }
.sp-cron-task--stale          { background: rgba(231, 76, 60, 0.06); }

.sp-cron-dashboard-table tbody tr:hover {
    background: var(--card-bg-hover);
}

.sp-cron-dashboard__footer {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    line-height: 1.5;
}

.sp-cron-dashboard__footer-hint code {
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--card-bg-hover);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
}

@media (max-width: 640px) {
    .sp-cron-dashboard__toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .sp-cron-dashboard__search {
        min-width: 100%;
    }

    .sp-cron-dashboard__search input {
        font-size: 16px; 
    }

    .sp-cron-dashboard__shown {
        align-self: flex-end;
    }

    .sp-cron-dashboard__filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
    }

    .sp-cron-filter {
        flex: 0 0 auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sp-cron-filter,
    .sp-cron-task__details summary::before {
        transition: none;
    }
}

.sp-cron-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.sp-cron-badge--ok       { background: rgba(63, 185, 80, 0.15);  color: var(--success); }
.sp-cron-badge--error    { background: rgba(231, 76, 60, 0.15);  color: var(--danger); }
.sp-cron-badge--skipped  { background: rgba(240, 160, 32, 0.15); color: var(--warning); }
.sp-cron-badge--disabled,
.sp-cron-badge--unknown  { background: rgba(127, 127, 127, 0.15); color: var(--muted); }
.sp-cron-badge--stale    { background: rgba(231, 76, 60, 0.18);  color: var(--danger); border: 1px solid rgba(231, 76, 60, 0.35); }

.sp-cron-domain {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
}

.sp-cron-domain__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.sp-cron-domain__name {
    margin: 0;
    font-size: 0.95rem;
}

.sp-cron-domain__name code {
    padding: 1px 6px;
    border-radius: 3px;
    background: var(--card-bg-hover);
    font-family: 'JetBrains Mono', monospace;
}

.sp-cron-domain__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.sp-cron-tasks {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

.sp-cron-tasks th,
.sp-cron-tasks td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.sp-cron-tasks thead th {
    background: var(--card-bg-hover);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.sp-cron-tasks td:last-child {
    white-space: normal;
}

.sp-cron-tasks td.sp-cron-row-actions {
    white-space: nowrap;
}

.sp-cron-tasks tbody tr:hover {
    background: var(--card-bg-hover);
}

.sp-cron-schedule {
    padding: 1px 6px;
    border-radius: 3px;
    background: var(--card-bg-hover);
    color: var(--primary);
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
}

.sp-cron-cmd {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.sp-cron-row-actions {
    text-align: right;
    white-space: nowrap;
}

.sp-cron-add-row {
    margin-top: 8px;
}

.sp-cron-empty {
    padding: 8px 0;
}

.server-panel__modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal, 1000);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.server-panel__modal[hidden] {
    display: none;
}

.server-panel__modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
}

.server-panel__modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(920px, 100%);
    max-height: 86vh;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.server-panel__modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.server-panel__modal-title {
    margin: 0;
    font-size: 1.05rem;
}

.server-panel__modal-close {
    appearance: none;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.server-panel__modal-close:hover {
    background: var(--card-bg-hover);
    color: var(--text);
}

.server-panel__modal-close:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.server-panel__modal-body {
    padding: 12px 16px 16px;
    overflow: auto;
}

.sp-cron-history-modal-content {
    width: min(960px, 100%);
}

.sp-cron-history-meta {
    margin-bottom: 10px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg-hover);
    font-size: 0.8rem;
}

.sp-cron-history-meta__row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.sp-cron-history-meta__desc {
    margin-top: 4px;
    font-size: 0.78rem;
    line-height: 1.4;
}

.sp-cron-history-table-wrap {
    overflow-x: auto;
}

.sp-cron-history-table {
    min-width: 640px;
}

.sp-cron-history-table td {
    font-size: 0.8rem;
    vertical-align: top;
}

.sp-cron-history-cell-status,
.sp-cron-history-cell-time {
    white-space: nowrap;
}

.sp-cron-history-cell-time code {
    padding: 1px 4px;
    border-radius: 3px;
    background: var(--card-bg-hover);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
}

.sp-cron-history-cell-meta {
    margin-top: 2px;
    font-size: 0.72rem;
}

.sp-cron-history-cell-error {
    max-width: 180px;
}

.sp-cron-history-error-class {
    padding: 1px 4px;
    border-radius: 3px;
    background: rgba(231, 76, 60, 0.12);
    color: var(--danger);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
}

.sp-cron-history-cell-preview {
    max-width: 420px;
}

.sp-cron-history-preview {
    display: block;
    max-height: 90px;
    overflow: auto;
    padding: 2px 5px;
    border-radius: 3px;
    background: var(--card-bg-hover);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.sp-cron-history-row {
    transition: background 0.15s ease;
}

.sp-cron-history-row:hover {
    background: var(--card-bg-hover);
}

.sp-cron-history-row--error,
.sp-cron-history-row--stale {
    box-shadow: inset 3px 0 0 var(--danger);
}

.sp-cron-history-row--skipped {
    box-shadow: inset 3px 0 0 var(--warning);
}

.sp-cron-history-row--disabled,
.sp-cron-history-row--unknown {
    box-shadow: inset 3px 0 0 var(--muted);
}

.sp-cron-history-footer {
    margin-top: 8px;
    font-size: 0.75rem;
}

.sp-cron-history-more {
    margin-top: 8px;
    text-align: center;
}

.sp-cron-history-loading {
    padding: 24px;
    text-align: center;
}

.server-panel__table--backups th:first-child,
.server-panel__table--backups td:first-child {
    width: 34px;
    text-align: center;
}

.server-panel__table--backups td {
    white-space: nowrap;
}

.server-panel__table--backups td:nth-child(2) {
    white-space: normal;
    word-break: break-all;
}

.sp-backup-check {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
    cursor: pointer;
}

.server-panel__log-preview {
    max-height: 340px;
    margin: 0;
    padding: 10px 12px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg-hover);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    tab-size: 4;
}

.server-panel__log-preview:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.server-panel__cron-preview {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding: 8px 10px;
    border: 1px dashed var(--border);
    border-radius: 6px;
    font-size: 0.8rem;
}

.server-panel__cron-preview code {
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--card-bg-hover);
    font-family: 'JetBrains Mono', monospace;
}

.sp-diag-row {
    transition: background 0.15s ease;
}

.sp-diag-row:hover {
    background: var(--card-bg-hover);
}

.server-panel__diag-table td:last-child,
.server-panel__services td.server-panel__error-msg {
    white-space: normal;
    word-break: break-word;
}

.server-panel__services tbody tr.sp-diag-row--warning {
    background: rgba(240, 160, 32, 0.06);
}

.server-panel__services tbody tr.sp-diag-row--error,
.server-panel__services tbody tr.sp-diag-row--critical {
    background: rgba(231, 76, 60, 0.06);
}

.server-panel__services tbody tr.sp-diag-row--highlight {
    background: rgba(240, 160, 32, 0.25);
}

.server-panel__toast {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.server-panel__toast > span {
    flex: 1 1 auto;
    min-width: 0;
}

.server-panel__toast-dismiss {
    flex: 0 0 auto;
    appearance: none;
    padding: 2px 4px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    opacity: 0.6;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.server-panel__toast-dismiss:hover {
    opacity: 1;
    background: rgba(127, 127, 127, 0.15);
}

.server-panel__toast-dismiss:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

@media (max-width: 640px) {
    .server-panel__grid {
        grid-template-columns: 1fr;
    }

    .server-panel__metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .server-panel__services th,
    .server-panel__services td {
        padding: 6px 4px;
        font-size: 0.8rem;
    }

    .server-panel__services td:last-child {
        white-space: normal;
    }

    .server-panel__btn {
        padding: 3px 6px;
        font-size: 0.75rem;
    }

    .server-panel-tabs {
        padding: 4px;
        gap: 2px;
    }

    .server-panel-tabs__item {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .server-panel__charts {
        grid-template-columns: 1fr;
    }

    .server-panel__form-row .server-panel__input,
    .server-panel__form-row .server-panel__input--wide {
        width: 100%;
    }

    .server-panel__range-toggle {
        margin-left: 0;
    }

    .server-panel__col-status,
    .server-panel__col-check,
    .server-panel__col-fix,
    .server-panel__col-num {
        width: auto;
    }

    .server-panel__form-hint {
        align-self: flex-start;
        padding-bottom: 0;
    }

    .server-panel__section-title {
        font-size: 0.95rem;
    }

    .server-panel__form-row .server-panel__label-checkbox {
        align-self: flex-start;
        padding-bottom: 0;
        width: 100%;
    }

    .server-panel__row-actions {
        gap: 3px;
    }

    .server-panel__inline-form {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .server-panel__input--file {
        width: 100%;
        max-width: none;
    }

    .server-panel__toasts {
        left:   calc(12px + env(safe-area-inset-left,  0px));
        right:  calc(12px + env(safe-area-inset-right, 0px));
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        max-width: none;
    }

    .server-panel__cron-task {
        padding: 5px 8px;
    }
    .server-panel__cron-user {
        margin-left: 0;
    }
    .server-panel__cron-command {
        font-size: 0.78em;
    }
}

@media (max-width: 640px) {
    .server-panel__card {
        padding: 12px 12px;
        overflow-x: auto;
    }

    .server-panel__field-inline {
        align-items: stretch;
    }

    .server-panel__input--sm {
        width: 100%;
    }

    .server-panel select.server-panel__input {
        min-width: 0;
        width: 100%;
    }

    .server-panel__modal {
        padding: 8px;
    }

    .server-panel__modal-content {
        max-height: 92vh;
        border-radius: 10px;
    }

    .server-panel__modal-body {
        padding: 10px 12px 14px;
    }

    .sp-cron-dashboard__filters {
        gap: 4px;
    }

    .sp-cron-filter {
        padding: 4px 9px;
        font-size: 0.74rem;
    }

    .sp-cron-dashboard-table th:nth-child(2),
    .sp-cron-dashboard-table td:nth-child(2) {
        display: none;
    }

    .sp-cron-task__result {
        max-width: 220px;
    }

    .sp-cron-history-table {
        min-width: 560px;
    }

    .sp-cron-history-cell-preview {
        max-width: 240px;
    }

    .server-panel__log-preview {
        max-height: 240px;
        font-size: 0.72rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .server-panel__card,
    .server-panel__btn,
    .server-panel__services tbody tr,
    .sp-cron-filter,
    .sp-cron-dashboard-table tbody tr,
    .sp-cron-tasks tbody tr,
    .sp-diag-row,
    .server-panel__modal-close,
    .server-panel__toast-dismiss {
        transition: none;
    }
}


.sp-backup-check:focus-visible,
.server-panel__checkbox input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.server-panel__toasts {
    max-width: 380px;
    max-width: min(380px, calc(100vw - 40px));
}

.server-panel__toast {
    overflow-wrap: anywhere;
}

@media (max-width: 640px) {
    .server-panel__toasts {
        left: 12px;
        right: 12px;
        max-width: none;
    }
}


/* ============================================================
   n64a-deepseekai.css — DeepSeekAI: layout, header, budget, diagnostics
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n64-deepseekai.css (part 1)
   ============================================================ */

.deepseekai {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    color: var(--text, #1f2937);
    line-height: 1.5;
}

.deepseekai *,
.deepseekai *::before,
.deepseekai *::after {
    box-sizing: border-box;
}

.deepseekai [hidden] {
    display: none !important;
}


.deepseekai__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.deepseekai__header-main {
    flex: 1 1 auto;
    min-width: 240px;
}

.deepseekai__title {
    margin: 0 0 6px;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.deepseekai__lead {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.5;
    max-width: 640px;
}

.deepseekai__lead strong {
    color: var(--text);
}

.deepseekai__meta {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}


.deepseekai__budget {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.deepseekai__budget-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
}

.deepseekai__budget-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.deepseekai__budget-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.deepseekai__budget-count {
    font-size: 0.75rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.deepseekai__budget-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    margin-bottom: 8px;
}

.deepseekai__budget-value .muted {
    font-weight: 400;
    font-size: 0.85em;
}

.deepseekai__budget-bar {
    position: relative;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--card-bg-hover);
    overflow: hidden;
}

.deepseekai__budget-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    height: 100%;
    width: var(--ds-fill-w, 0%);
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.deepseekai__budget-fill--warn {
    background: var(--warning);
}

.deepseekai__budget-fill--err {
    background: var(--danger);
}


.deepseekai__section {
    margin-bottom: 0;
}

.deepseekai__section--disabled {
    opacity: 0.9;
}


.deepseekai__form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.deepseekai__row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.deepseekai__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
}

.deepseekai__field--grow {
    flex: 1 1 200px;
    min-width: 0;
}

.deepseekai__label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.deepseekai__label .muted {
    font-weight: 400;
    font-size: 0.85em;
}

.deepseekai__input,
.deepseekai__textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    line-height: 1.4;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.deepseekai__textarea {
    resize: vertical;
    min-height: 220px;
    font-family: var(--geek-mono);
    font-size: 0.82rem;
}

.deepseekai__input:focus,
.deepseekai__textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.20);
}

.deepseekai__input:disabled,
.deepseekai__textarea:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.deepseekai__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.deepseekai__actions .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.deepseekai__hint {
    font-size: 0.8rem;
    line-height: 1.4;
}

.deepseekai__hint code {
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--card-bg-hover);
    font-family: var(--geek-mono);
    font-size: 0.9em;
}

.deepseekai__hint kbd {
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--card-bg-hover);
    border: 1px solid var(--border);
    font-family: var(--geek-mono);
    font-size: 0.85em;
    font-weight: 600;
}


.deepseekai__loader {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.deepseekai__loader-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: ds-spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes ds-spin {
    to { transform: rotate(360deg); }
}


.deepseekai__summary {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--card-bg-hover);
    border-left: 4px solid var(--primary);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.92rem;
    line-height: 1.5;
}

.ds-summary__badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.ds-summary__text {
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
}

.deepseekai__results {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.deepseekai__usage {
    margin-top: 12px;
    font-size: 0.8rem;
    font-family: var(--geek-mono);
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}


.ds-finding {
    background: var(--card-bg-hover);
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.ds-finding.ds-sev-critical { border-left-color: var(--danger); }
.ds-finding.ds-sev-error    { border-left-color: var(--danger); }
.ds-finding.ds-sev-warning  { border-left-color: var(--warning); }
.ds-finding.ds-sev-info     { border-left-color: var(--info); }

.ds-finding__head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.ds-finding__head::-webkit-details-marker {
    display: none;
}

.ds-finding__head::before {
    content: '▸';
    display: inline-block;
    font-size: 10px;
    color: var(--muted);
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.ds-finding[open] > .ds-finding__head::before {
    transform: rotate(90deg);
}

.ds-finding__badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.ds-finding__badge.ds-sev-critical {
    background: rgba(var(--danger-rgb), 0.15);
    color: var(--danger);
}

.ds-finding__badge.ds-sev-error {
    background: rgba(var(--danger-rgb), 0.15);
    color: var(--danger);
}

.ds-finding__badge.ds-sev-warning {
    background: rgba(var(--warning-rgb), 0.15);
    color: var(--warning);
}

.ds-finding__badge.ds-sev-info {
    background: rgba(var(--info-rgb), 0.15);
    color: var(--info);
}

.ds-summary__badge.ds-sev-critical,
.ds-summary__badge.ds-sev-error {
    background: var(--danger);
    color: #fff;
}

.ds-summary__badge.ds-sev-warning {
    background: var(--warning);
    color: #1e2a3a;
}

.ds-summary__badge.ds-sev-info {
    background: var(--info);
    color: #fff;
}

.ds-finding__pattern {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    font-size: 0.92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ds-finding__count {
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.ds-finding__lesson {
    padding: 1px 8px;
    border-radius: 4px;
    background: rgba(var(--info-rgb), 0.12);
    color: var(--info);
    font-family: var(--geek-mono);
    font-size: 0.75rem;
    text-decoration: none;
    flex-shrink: 0;
}

.ds-finding__lesson:hover {
    background: rgba(var(--info-rgb), 0.22);
    text-decoration: none;
}

.ds-finding__lesson:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    background: rgba(var(--info-rgb), 0.22);
}

.ds-finding__body {
    padding: 4px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.88rem;
    line-height: 1.55;
    border-top: 1px solid var(--border);
}

.ds-finding__message {
    margin: 0;
    color: var(--text);
}

.ds-finding__hint {
    margin: 0;
    padding: 8px 12px;
    border-radius: 4px;
    background: rgba(var(--success-rgb), 0.08);
    border-left: 3px solid var(--success);
    color: var(--text);
    font-size: 0.85rem;
}

.ds-finding__hint strong {
    color: var(--success);
}

.ds-finding__lines {
    font-size: 0.8rem;
    color: var(--muted);
    font-family: var(--geek-mono);
}

.ds-finding__lines strong {
    color: var(--text);
}


.ds-empty {
    padding: 16px 20px;
    border-radius: 6px;
    background: rgba(var(--success-rgb), 0.08);
    border-left: 4px solid var(--success);
    color: var(--text);
    font-size: 0.9rem;
    text-align: center;
}

.ds-error {
    padding: 14px 18px;
    border-radius: 6px;
    background: rgba(var(--danger-rgb), 0.08);
    border-left: 4px solid var(--danger);
    color: var(--danger);
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-word;
}


.deepseekai__chat,
[data-ds-chat] {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

[data-ds-chat-messages] {
    flex: 1 1 auto;
    min-height: 300px;
    max-height: 60vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px;
    border-radius: 6px;
    background: var(--card-bg-hover);
}

[data-ds-chat-messages]::-webkit-scrollbar {
    width: 6px;
}

[data-ds-chat-messages]::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.ds-chat__empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.ds-chat__empty p {
    margin: 0 0 8px;
}

.ds-chat__empty ul {
    display: inline-block;
    text-align: left;
    margin: 8px 0;
    padding-left: 20px;
}

.ds-chat__empty li {
    margin: 4px 0;
}

.ds-msg {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    max-width: 92%;
    line-height: 1.5;
    font-size: 0.92rem;
    word-wrap: break-word;
}

.ds-msg--user {
    align-self: flex-end;
    background: rgba(var(--primary-rgb), 0.10);
    border: 1px solid rgba(var(--primary-rgb), 0.20);
    color: var(--text);
    flex-direction: row-reverse;
}

.ds-msg--assistant {
    align-self: flex-start;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text);
}

.ds-msg__role {
    flex-shrink: 0;
    font-size: 1.15rem;
    line-height: 1;
    width: 24px;
    text-align: center;
}

.ds-msg__content {
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
}

.ds-msg__code {
    display: block;
    margin: 8px 0;
    padding: 10px 12px;
    background: var(--card-bg-hover);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--geek-mono);
    font-size: 0.82rem;
    line-height: 1.5;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: pre;
    word-break: normal;
    color: var(--text);
}

.ds-msg__code code {
    background: transparent;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    border: 0;
}

.ds-msg--user .ds-msg__code {
    background: rgba(var(--primary-rgb), 0.08);
    border-color: rgba(var(--primary-rgb), 0.20);
}

.ds-chat__status {
    font-size: 0.8rem;
    color: var(--muted);
    min-height: 1em;
    font-family: var(--geek-mono);
    font-variant-numeric: tabular-nums;
}

.ds-chat__status--error {
    color: var(--danger);
}

[data-ds-chat-input] {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

[data-ds-chat-input]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.20);
}


.ds-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    background: var(--card-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    font-size: 0.9rem;
    line-height: 1.4;
    z-index: var(--z-toast, 10002);
    max-width: 380px;
    word-break: break-word;
    animation: ds-toast-in 0.18s ease-out;
}

.ds-toast--info    { border-left-color: var(--info); }
.ds-toast--success { border-left-color: var(--success); }
.ds-toast--warning { border-left-color: var(--warning); }
.ds-toast--error   { border-left-color: var(--danger); }

@keyframes ds-toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}


.deepseekai__table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
    padding: 0 4px;
}

.deepseekai__table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.deepseekai__th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--muted);
    background: var(--card-bg-hover);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.deepseekai__th--id  { width: 60px; }
.deepseekai__th--num { width: 90px; text-align: right; }

.deepseekai__table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text);
}

.deepseekai__table tbody tr:hover td {
    background: var(--card-bg-hover);
}

.deepseekai__table tbody tr:last-child td {
    border-bottom: none;
}

.deepseekai__table code {
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--card-bg-hover);
    font-family: var(--geek-mono);
    font-size: 0.85em;
    color: var(--primary);
    font-weight: 600;
}

.deepseekai__td--num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: var(--geek-mono);
    font-size: 0.85em;
}

.deepseekai__td--title {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deepseekai__td--title[title] {
    cursor: help;
}

.deepseekai__th--sortable {
    cursor: pointer;
    user-select: none;
}

.deepseekai__th--sortable:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.deepseekai__td--expandable {
    cursor: help;
}

.deepseekai__td--expandable:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
    border-radius: 4px;
}

.deepseekai-settings__actions [data-ds-dirty-indicator] {
    color: var(--warning, #b45309);
    font-weight: 600;
}

.deepseekai-settings__actions [data-ds-dirty-indicator]:not([hidden]) {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.deepseekai__td--title[title][tabindex]:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
    border-radius: 4px;
}

.deepseekai__td--date {
    white-space: nowrap;
    font-size: 0.82em;
}

.deepseekai__empty {
    padding: 32px 16px;
}


.deepseekai__footer {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 0;
    font-size: 0.82rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

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

.deepseekai__footer-item strong {
    color: var(--text);
}

.deepseekai__footer code {
    padding: 1px 6px;
    border-radius: 3px;
    background: var(--card-bg-hover);
    font-family: var(--geek-mono);
    font-size: 0.9em;
    color: var(--text);
}

.deepseekai__footer a {
    color: var(--primary);
    text-decoration: none;
}

.deepseekai__footer a:hover {
    text-decoration: underline;
}


.deepseekai-sessions__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.deepseekai-sessions__filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 4px;
}

.deepseekai-sessions__filter {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.deepseekai-sessions__filter-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.deepseekai-sessions__filter select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
    font-size: 0.85rem;
    min-width: 140px;
}

.deepseekai-sessions__filter select:focus {
    outline: none;
    border-color: var(--primary);
}

.deepseekai-sessions__filter--grow {
    flex: 1 1 200px;
    min-width: 0;
}

.deepseekai-sessions__filter-input {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
    font-size: 0.85rem;
    -webkit-appearance: none;
    appearance: none;
}

.deepseekai-sessions__filter-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.20);
}

.deepseekai-sessions__filter-input::placeholder {
    color: var(--muted);
    opacity: 0.75;
}

.deepseekai-sessions__count {
    margin: 12px 0 0;
    font-size: 0.8rem;
    color: var(--muted);
}

.deepseekai-sessions__actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-left: auto;
}

.deepseekai-sessions__pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.deepseekai-sessions__pagination a,
.deepseekai-sessions__pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    font-size: 0.85rem;
    text-decoration: none;
}

.deepseekai-sessions__pagination a:hover {
    background: var(--card-bg-hover);
    border-color: var(--primary);
    text-decoration: none;
}

.deepseekai-sessions__pagination .is-current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
    cursor: default;
}

.deepseekai-sessions__pagination [aria-current="page"] {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
    cursor: default;
}


@media (max-width: 768px) {
    .deepseekai__header {
        flex-direction: column;
        align-items: stretch;
    }

    .deepseekai__meta {
        justify-content: flex-start;
    }

    .deepseekai__title {
        font-size: 1.3rem;
    }

    .deepseekai__budget {
        grid-template-columns: 1fr;
    }

    .deepseekai__form .deepseekai__row {
        flex-direction: column;
    }

    .deepseekai__field--grow {
        flex-basis: auto;
        width: 100%;
    }

    .deepseekai__textarea {
        font-size: 16px; 
        min-height: 180px;
    }

    .deepseekai__input {
        font-size: 16px;
    }

    .deepseekai-sessions__header {
        flex-direction: column;
        align-items: stretch;
    }

    .deepseekai-sessions__filters {
        flex-direction: column;
        align-items: stretch;
    }

    .deepseekai-sessions__filter select {
        width: 100%;
    }

    .deepseekai-sessions__filter-input {
        width: 100%;
        font-size: 16px; 
    }

    .deepseekai-sessions__filter--grow {
        flex-basis: auto;
        width: 100%;
    }

    .deepseekai-sessions__actions {
        margin-left: 0;
    }
}


@media (max-width: 640px) {
    .deepseekai {
        gap: 12px;
    }

    .deepseekai__title {
        font-size: 1.15rem;
    }

    .deepseekai__lead {
        font-size: 0.85rem;
    }

    .deepseekai__budget-item {
        padding: 10px 12px;
    }

    .deepseekai__budget-value {
        font-size: 1rem;
    }

    .deepseekai__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .deepseekai__actions .btn {
        width: 100%;
        justify-content: center;
    }

    .deepseekai__actions .deepseekai__hint {
        text-align: center;
    }

    .deepseekai__summary {
        flex-direction: column;
        gap: 8px;
    }

    .ds-msg {
        max-width: 100%;
    }

    .ds-finding__head {
        padding: 8px 10px;
        gap: 6px;
    }

    .ds-finding__pattern {
        font-size: 0.85rem;
    }

    .ds-finding__body {
        padding: 4px 10px 12px;
        font-size: 0.85rem;
    }

    .ds-msg__code {
        padding: 8px 10px;
        font-size: 0.78rem;
    }

    .deepseekai__footer {
        gap: 8px;
        font-size: 0.78rem;
    }

    .deepseekai__footer-item {
        width: 100%;
    }

    .deepseekai__table {
        min-width: 640px;
        font-size: 0.82rem;
    }

    .deepseekai__th,
    .deepseekai__table tbody td {
        padding: 8px 10px;
    }

    .deepseekai-sessions__pagination a,
    .deepseekai-sessions__pagination span {
        min-width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .deepseekai-settings__check-group,
    .deepseekai-settings__check-group--agents {
        grid-template-columns: 1fr;
    }
}


@media (hover: none) and (pointer: coarse) {
    .deepseekai__actions .btn,
    .ds-finding__head {
        min-height: 44px;
    }

    .ds-finding__lesson {
        min-height: 28px;
        display: inline-flex;
        align-items: center;
    }
}


@media (prefers-reduced-motion: reduce) {
    .deepseekai__budget-fill,
    .ds-finding__head::before,
    .ds-toast,
    .deepseekai__input,
    .deepseekai__textarea,
    [data-ds-chat-input] {
        animation: none !important;
        transition: none !important;
    }

    .ds-finding[open] > .ds-finding__head::before {
        transform: none;
    }

    .deepseekai__loader-spinner {
        animation-duration: 1.5s !important;
    }
}


.deepseekai-settings__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.deepseekai-settings__mask {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--card-bg-hover);
    border: 1px dashed var(--border);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.deepseekai-settings__mask code {
    font-family: var(--geek-mono);
    font-size: 0.85rem;
    color: var(--primary);
    letter-spacing: 0.5px;
    user-select: all;
    cursor: text;
}

.deepseekai-settings__mask--empty {
    opacity: 0.7;
}

.deepseekai-settings__mask--empty code {
    color: var(--muted);
}

.btn[data-dirty="1"] {
    box-shadow: 0 0 0 2px var(--warning);
    outline: 2px solid var(--warning, #d97706);
    outline-offset: 1px;
}

.deepseekai__field--check {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--card-bg-hover);
    cursor: pointer;
    transition: background 0.15s ease;
}

.deepseekai__field--check:hover {
    background: var(--card-bg);
}

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

.deepseekai__field--check:has(input:disabled) {
    opacity: 0.6;
    cursor: not-allowed;
}

.deepseekai__field--check small {
    display: block;
    font-size: 0.8em;
    margin-top: 2px;
    line-height: 1.4;
}

.deepseekai__field--check small code {
    font-family: var(--geek-mono);
    font-size: 0.9em;
    color: var(--info);
}

.deepseekai-settings__check-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 8px;
}

.deepseekai-settings__check-group--agents {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.deepseekai-settings__fieldset {
    border: 0;
    padding: 0;
    margin: 0 0 12px;
    min-width: 0;
}

.deepseekai-settings__legend {
    padding: 0;
    margin: 0 0 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.deepseekai-settings__note {
    margin-top: 12px;
}

.deepseekai-settings__actions {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.deepseekai-settings__opcache-warn {
    margin-top: 12px;
    font-size: 0.85rem;
}

.deepseekai-settings__opcache-warn code {
    font-family: var(--geek-mono);
    padding: 1px 6px;
    background: var(--card-bg-hover);
    border-radius: 3px;
    font-size: 0.85em;
}


.deepseekai__examples {
    margin-bottom: 4px;
}

.deepseekai__examples-label {
    display: block;
    margin-bottom: 4px;
}

.deepseekai__examples-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.deepseekai__example-chip {
    font-size: 0.8rem;
    white-space: normal;
    text-align: left;
    line-height: 1.3;
    padding: 6px 10px;
    max-width: 100%;
}

.deepseekai__example-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.deepseekai__example-chip:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.deepseekai__chat-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.deepseekai__chat-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.deepseekai__chat-actions .btn {
    flex-shrink: 0;
}

.deepseekai-disclaimer__list {
    margin: 6px 0 0;
    padding-left: 20px;
    line-height: 1.6;
}

.deepseekai-disclaimer__list li {
    margin: 4px 0;
}

@media (max-width: 640px) {
    .deepseekai__chat-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .deepseekai__chat-actions .ds-chat__status {
        width: 100%;
        text-align: center;
    }
}


/* ============================================================
   n64b-deepseekai-chat.css — DeepSeekAI: chat, toast, v2 UI
   @version 2.0.0 (2026-11-27, CSS v2: n-prefix, tokens, dedupe, a11y)
   CSS v2: n-prefix, tokens, dedupe, a11y.
   Sources: n64-deepseekai.css (part 2)
   ============================================================ */

.ds-chat__feature-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.deepseekai .badge--soft {
    background: var(--card-bg-hover);
    border: 1px solid var(--border);
    color: var(--muted);
    font-weight: 500;
}

.ds-chat__toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 2px;
}

.ds-chat__toolbar-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.ds-chat__toolbar-spacer {
    flex: 1 1 auto;
}

.ds-chat__session {
    font-size: 0.8rem;
    color: var(--muted);
}

.ds-chat__session a {
    color: var(--primary);
    text-decoration: none;
}

.ds-chat__session a:hover {
    text-decoration: underline;
}

.ds-chat__pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.78rem;
    cursor: pointer;
}

.ds-chat__pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.ds-chat__pill[hidden] {
    display: none;
}

.ds-chat__pill-count {
    display: inline-block;
    min-width: 1.2em;
    padding: 0 4px;
    border-radius: 999px;
    background: rgba(var(--primary-rgb), 0.16);
    color: var(--primary);
    font-family: var(--geek-mono);
    text-align: center;
}

.ds-chat__typing {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: var(--card-bg-hover);
    color: var(--muted);
    font-size: 0.85rem;
}

.ds-chat__typing[hidden] {
    display: none;
}

.ds-chat__typing-dots {
    display: inline-flex;
    gap: 4px;
}

.ds-chat__typing-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.35;
    animation: ds-chat-typing 1s infinite ease-in-out;
}

.ds-chat__typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.ds-chat__typing-dots i:nth-child(3) { animation-delay: 0.30s; }

@keyframes ds-chat-typing {
    0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
    40%           { opacity: 1;    transform: translateY(-3px); }
}

.ds-chat__typing-label {
    color: var(--text);
}

.ds-chat__typing-timer {
    font-family: var(--geek-mono);
    font-variant-numeric: tabular-nums;
}

.ds-chat__typing-cancel {
    margin-left: auto;
}

.ds-chat__hint-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 6px;
}

.ds-chat__counter {
    font-family: var(--geek-mono);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ds-chat__counter--warn {
    color: var(--warning);
}

.ds-chat__counter--over {
    color: var(--danger);
    font-weight: 600;
}

.ds-chat__hint {
    opacity: 0.85;
}

.ds-chat__copy-buffer {
    position: fixed;
    left: -9999px;
    top: 0;
    opacity: 0;
}

.ds-msg--error {
    align-self: flex-start;
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.35);
    color: var(--text);
}

.ds-msg__error-title {
    font-weight: 600;
    color: var(--danger);
    margin-bottom: 4px;
}

.ds-msg__error-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.ds-msg__error-hint {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--muted);
}

.ds-msg__retry {
    margin-top: 8px;
}

.ds-msg__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
    font-size: 0.72rem;
    color: var(--muted);
}

.ds-msg__meta-item {
    white-space: nowrap;
}

.ds-msg__meta-model {
    font-family: var(--geek-mono);
}

.ds-msg__meta-duration {
    font-family: var(--geek-mono);
    font-variant-numeric: tabular-nums;
}

.ds-msg__meta-warn {
    color: var(--warning);
}

.ds-msg__meta-link {
    color: var(--primary);
    text-decoration: none;
}

.ds-msg__meta-link:hover {
    text-decoration: underline;
}

.ds-msg__action {
    margin-left: auto;
    background: none;
    border: 0;
    padding: 0;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.72rem;
}

.ds-msg__action:hover,
.ds-msg__action:focus-visible {
    color: var(--primary);
    text-decoration: underline;
}

.ds-md {
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.ds-md > :first-child { margin-top: 0; }
.ds-md > :last-child  { margin-bottom: 0; }

.ds-md__p {
    margin: 0 0 8px;
}

.ds-md__h {
    margin: 12px 0 6px;
    line-height: 1.3;
}

.ds-md__h--1 { font-size: 1.15rem; }
.ds-md__h--2 { font-size: 1.05rem; }
.ds-md__h--3 { font-size: 0.98rem; }
.ds-md__h--4 { font-size: 0.92rem; color: var(--muted); }

.ds-md__list {
    margin: 0 0 8px;
    padding-left: 20px;
}

.ds-md__list li {
    margin: 2px 0;
}

.ds-md__quote {
    margin: 8px 0;
    padding: 6px 10px;
    border-left: 3px solid var(--primary);
    background: var(--card-bg-hover);
    color: var(--muted);
}

.ds-md__hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 10px 0;
}

.ds-md__link {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ds-md__code-inline {
    background: var(--card-bg-hover);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    font-family: var(--geek-mono);
    font-size: 0.85em;
}

.ds-md__table-wrap {
    overflow-x: auto;
    margin: 8px 0;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.ds-md__table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.85rem;
}

.ds-md__table th,
.ds-md__table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.ds-md__table th {
    background: var(--card-bg-hover);
    font-weight: 600;
    white-space: nowrap;
}

.ds-md__table tr:last-child td {
    border-bottom: 0;
}

.ds-md--plain {
    white-space: pre-wrap;
    word-break: break-word;
}

.ds-md--streaming::after {
    content: '▌';
    color: var(--primary);
    animation: ds-chat-cursor 1s steps(1) infinite;
}

@keyframes ds-chat-cursor {
    50% { opacity: 0; }
}

.ds-msg__code {
    padding: 0;
    white-space: normal;
    overflow: hidden;
}

.ds-msg__code-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--card-bg-hover);
    border-bottom: 1px solid var(--border);
    font-size: 0.72rem;
    color: var(--muted);
}

.ds-msg__code-lang {
    font-family: var(--geek-mono);
    text-transform: lowercase;
}

.ds-msg__code-copy {
    margin-left: auto;
    background: none;
    border: 0;
    padding: 0;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.72rem;
}

.ds-msg__code-copy:hover,
.ds-msg__code-copy:focus-visible {
    text-decoration: underline;
}

.ds-msg__code pre {
    margin: 0;
    padding: 10px 12px;
    overflow-x: auto;
    font-family: var(--geek-mono);
    font-size: 0.82rem;
    line-height: 1.5;
    white-space: pre;
    color: var(--text);
}

@media (max-width: 640px) {
    .ds-chat__hint {
        display: none;
    }

    .ds-msg {
        max-width: 100%;
    }

    .ds-chat__typing {
        flex-wrap: wrap;
    }

    .ds-chat__typing-timer {
        margin-left: auto;
    }

    .ds-msg__action {
        margin-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ds-chat__typing-dots i {
        animation: none;
        opacity: 0.7;
    }

    .ds-md--streaming::after {
        animation: none;
    }
}

/* ─── v2 chat polish ─────────────────────────────────────── */
.ds-chat__bubble { border-radius: var(--radius); }
.ds-chat__composer { border-top: 1px solid var(--border); backdrop-filter: blur(8px); }


/* ============================================================
 * n65-market-service.css — MarketService (dashboard + T-Bank + readiness)
 *
 * @version 1.1.0 (2026-12-05, P1: table layout, readiness bars, cron status)
 *
 * Scope: `.market-service` only. Reuses `server-panel__*` layout from
 * n60a-server-panel.css; this file owns MarketService-specific bits:
 *   • alert--warn / alert--err (T-Bank config / Shared Infra)
 *   • dl.server-panel__kv (T-Bank Shared Infra card)
 *   • server-panel__code-block + [data-state] (resolve/ingest result pre)
 *   • form-row / inputs / focus-visible (dashboard + T-Bank)
 *   • readiness progress bars, cron table
 *   • table overflow, long task names, result wrapping
 *
 * Contract: ADR-0110 (CSS source layout, nNN-role, deterministic order),
 *           ADR-0043 (BEM conventions), ADR-0042 (templates SSOT).
 * Compile: assets/css/** → assets/style.css via Admin → Assets.
 * Important: do not edit assets/style.css manually.
 * ============================================================ */

/* ── Root ─────────────────────────────────────────────────── */
.market-service {
    min-width: 0;
}

.market-service [hidden] {
    display: none !important;
}

.market-service .server-panel__card,
.market-service .server-panel__grid {
    min-width: 0;
}

/* Wide cards are the scroll boundary for dense operational tables. */
.market-service .server-panel__card--wide {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-gutter: stable;
}

/* ── Alerts (moved from inline <style> in tinkoff.php 0.1.3) ─ */
.market-service .server-panel__alert {
    padding: .875rem 1rem;
    border-radius: var(--radius, 8px);
    margin-bottom: 1rem;
    font-size: .95rem;
    line-height: 1.45;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
}

.market-service .server-panel__alert--ok {
    background: rgba(34, 197, 94, .10);
    border-color: rgba(34, 197, 94, .35);
    color: var(--success, #22c55e);
}

.market-service .server-panel__alert--warn,
.market-service .server-panel__alert--warning {
    background: rgba(245, 158, 11, .12);
    border-color: rgba(245, 158, 11, .40);
    color: var(--warning, #f59e0b);
}

.market-service .server-panel__alert--err,
.market-service .server-panel__alert--error {
    background: rgba(239, 68, 68, .12);
    border-color: rgba(239, 68, 68, .40);
    color: var(--danger, #ef4444);
}

.market-service .server-panel__alert strong {
    font-weight: 700;
}

.market-service .server-panel__alert code {
    background: rgba(0, 0, 0, .28);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: .92em;
}

/* ── Status badges (readiness/cron) ───────────────────────── */
.market-service .server-panel__badge--ok {
    background: rgba(34, 197, 94, .14);
    border-color: rgba(34, 197, 94, .38);
    color: var(--success, #22c55e);
}

.market-service .server-panel__badge--warn {
    background: rgba(245, 158, 11, .14);
    border-color: rgba(245, 158, 11, .38);
    color: var(--warning, #f59e0b);
}

.market-service .server-panel__badge--err {
    background: rgba(239, 68, 68, .14);
    border-color: rgba(239, 68, 68, .38);
    color: var(--danger, #ef4444);
}

/* ── Definition lists (T-Bank Shared Infra) ───────────────── */
.market-service dl.server-panel__kv {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: .35rem 1.25rem;
    margin: 0;
    font-size: .9rem;
    line-height: 1.5;
}

.market-service dl.server-panel__kv dt {
    font-weight: 600;
    color: var(--muted, #9ca3af);
    white-space: nowrap;
}

.market-service dl.server-panel__kv dd {
    margin: 0;
    min-width: 0;
}

.market-service dl.server-panel__kv code {
    background: rgba(0, 0, 0, .28);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: .85em;
    overflow-wrap: anywhere;
}

/* ── Resolve / ingest result pre ─────────────────────────── */
.market-service .server-panel__code-block {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-height: 2.75rem;
    max-height: 24rem;
    margin: 0;
    padding: .85rem 1rem;
    overflow: auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    border-radius: var(--radius, 8px);
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .82rem;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    tab-size: 2;
}

.market-service .server-panel__code-block[data-state="ok"] {
    border-left-color: var(--success, #22c55e);
}

.market-service .server-panel__code-block[data-state="err"] {
    border-left-color: var(--danger, #ef4444);
}

.market-service .server-panel__code-block[data-state="pending"] {
    border-left-color: var(--warning, #f59e0b);
}

.market-service .server-panel__code-block[aria-busy="true"] {
    opacity: .75;
}

/* ── Forms (dashboard ingest + T-Bank) ───────────────────── */
.market-service .server-panel__form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: .5rem .75rem;
    margin-bottom: .75rem;
}

.market-service .server-panel__form-row label {
    flex: 0 1 auto;
    min-width: 0;
}

.market-service .server-panel__form-row input,
.market-service .server-panel__form-row select {
    min-width: 0;
    max-width: 100%;
}

.market-service .server-panel__btn:focus-visible,
.market-service .server-panel__form-row input:focus-visible,
.market-service .server-panel__form-row select:focus-visible,
.market-service #ms-refresh:focus-visible,
.market-service [data-toggle]:focus-visible {
    outline: 2px solid var(--primary, #3b82f6);
    outline-offset: 2px;
}

.market-service .server-panel__chart-note code {
    overflow-wrap: anywhere;
}

/* ── Tables: operational density without string-wrapping ─── */
.market-service .server-panel__services {
    width: 100%;
    min-width: 760px;
    table-layout: auto;
    border-collapse: collapse;
}

.market-service .server-panel__services th,
.market-service .server-panel__services td {
    vertical-align: middle;
    white-space: nowrap;
}

/* Task/ticker identifiers must never wrap 2-3 chars per line. */
.market-service .server-panel__services td code,
.market-service .server-panel__services th code {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
}

.market-service .server-panel__services td:first-child,
.market-service .server-panel__services th:first-child {
    width: 1%;
}

/* Long result text is the only cell allowed to wrap. */
.market-service .server-panel__services tr[data-cron-task] td:last-child {
    min-width: 280px;
    max-width: 460px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.market-service [data-cron-result],
.market-service [data-cron-effective-result] {
    display: inline-block;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.market-service .server-panel__services .muted {
    overflow-wrap: anywhere;
}

/* ── Readiness progress bars ─────────────────────────────── */
.market-service [data-ready-taker-bar],
.market-service [data-ready-depth-bar] {
    transition: width .25s ease;
}

.market-service [data-ready-taker-bar] {
    border-radius: 4px;
}

.market-service [data-ready-taker],
.market-service [data-ready-depth] {
    font-variant-numeric: tabular-nums;
}

/* ── Tablet ───────────────────────────────────────────────── */
@media (max-width: 768px) {
    .market-service .server-panel__meta {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .market-service .server-panel__code-block {
        max-height: 18rem;
    }
}

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 640px) {
    .market-service .server-panel__grid {
        grid-template-columns: 1fr;
    }

    .market-service .server-panel__form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .market-service .server-panel__form-row input,
    .market-service .server-panel__form-row select,
    .market-service .server-panel__form-row .server-panel__input,
    .market-service .server-panel__form-row .server-panel__input--wide {
        width: 100%;
    }

    /* Horizontal scroll without a wrapper element. */
    .market-service .server-panel__services {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .market-service dl.server-panel__kv {
        grid-template-columns: 1fr;
        gap: .15rem 0;
    }

    .market-service dl.server-panel__kv dt {
        white-space: normal;
        margin-top: .35rem;
    }
}

/* ── Touch targets ────────────────────────────────────────── */
@media (pointer: coarse) {
    .market-service .server-panel__btn,
    .market-service [data-toggle],
    .market-service #ms-refresh {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
    .market-service .server-panel__btn,
    .market-service #ms-refresh,
    .market-service .server-panel__meta {
        display: none !important;
    }

    .market-service .server-panel__card--wide {
        overflow: visible;
    }

    .market-service .server-panel__services {
        display: table;
        min-width: 0;
        width: 100%;
    }

    .market-service .server-panel__services th,
    .market-service .server-panel__services td {
        white-space: normal;
    }
}

/* ── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .market-service .server-panel__alert,
    .market-service .server-panel__code-block,
    .market-service .server-panel__btn,
    .market-service [data-ready-taker-bar],
    .market-service [data-ready-depth-bar] {
        transition: none;
    }
}

/* END OF FILE n65-market-service.css v1.1.0 */

