.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background 0.25s, border-color 0.25s;
}

.navbar__brand {
    font-weight: 600;
    color: var(--text);
    font-size: 0.94rem;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.navbar__links {
    display: flex;
    gap: 4px;
}

.navbar__link {
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 500;
    transition: color 0.15s, background 0.15s;
}

.navbar__link:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.navbar__link--active {
    color: var(--primary);
    background: var(--primary-tint);
}

.navbar__actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

@media (max-width: 600px) {
    .navbar__links {
        display: none;
    }
}

.has-navbar {
    padding-top: 52px;
}

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

.container--sm { max-width: 760px; }
.container--md { max-width: 1080px; }
.container--lg { max-width: 1320px; }
.container--wide { max-width: 1560px; }

.stack-sm > * + * { margin-top: 8px; }
.stack > * + * { margin-top: 16px; }
.stack-lg > * + * { margin-top: 32px; }
.stack-xl > * + * { margin-top: 56px; }

.row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.row--wrap { flex-wrap: wrap; }
.row--end { justify-content: flex-end; }

.page {
    padding: 32px 0 96px;
}

.page__header {
    margin-bottom: 32px;
}

.cols-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 800px) {
    .cols-2 { grid-template-columns: 1fr; }
}

.media {
    display: flex;
    align-items: center;
    gap: 14px;
}

.media__body {
    flex: 1;
    min-width: 0;
}

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

.detail-row:last-child {
    border-bottom: none;
}

.detail-row__label {
    color: var(--muted);
    font-size: 0.88rem;
    flex-shrink: 0;
}

.detail-row__value {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.profile-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 22px;
}

.profile-head__meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.profile-head__name {
    align-items: baseline;
    gap: 12px;
}

.profile-head__name h2 {
    margin: 0;
}

.profile-head__actions {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 620px) {
    .profile-head {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .profile-head__actions {
        position: static;
    }
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 22px 28px;
}

.info-grid__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    min-width: 0;
}

.info-grid__label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}

.info-grid__value {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.92rem;
    color: var(--text);
}

a.link-danger {
    color: var(--danger);
    text-decoration-color: color-mix(in srgb, var(--danger) 35%, transparent);
}

a.link-danger:hover {
    color: var(--danger-hover);
    text-decoration-color: var(--danger-hover);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.08s;
}

.button:active {
    transform: translateY(1px);
}

.button:disabled,
.button[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.button i {
    font-size: 1em;
}

.button--sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.button--lg {
    padding: 12px 24px;
    font-size: 0.95rem;
    border-radius: 10px;
}

.button--block {
    width: 100%;
}

.button--primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.button--primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
}

.button--secondary {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
}

.button--secondary:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    color: var(--text);
}

.button--ghost {
    background: transparent;
    color: var(--muted);
}

.button--ghost:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.button--danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.button--danger:hover {
    background: var(--danger-hover);
    border-color: var(--danger-hover);
}

.button--success {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.button--success:hover {
    background: var(--success-hover);
    border-color: var(--success-hover);
}

.button--outline-danger {
    background: var(--bg);
    border-color: var(--danger-border);
    color: var(--danger);
}

.button--outline-danger:hover {
    background: var(--danger-tint);
    border-color: var(--danger);
}

.button--icon {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
}

.button--icon:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    color: var(--text);
}

.button--icon.button--sm {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.button[aria-busy="true"] {
    cursor: progress;
    position: relative;
    color: transparent !important;
}

.button[aria-busy="true"]::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    color: #fff;
    animation: spin 0.7s linear infinite;
}

.button--secondary[aria-busy="true"]::after,
.button--ghost[aria-busy="true"]::after,
.button--icon[aria-busy="true"]::after {
    color: var(--primary);
}

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

.field__label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.field__label--required::after {
    content: '*';
    color: var(--danger);
}

.field__hint {
    font-size: 0.78rem;
    color: var(--muted);
}

.field__error {
    font-size: 0.78rem;
    color: var(--danger);
    display: flex;
    align-items: center;
    gap: 6px;
}

.input,
.textarea,
.select {
    width: 100%;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.4;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.input:hover,
.textarea:hover,
.select:hover {
    border-color: var(--border-strong);
}

.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus,
.textarea:-webkit-autofill,
.select:-webkit-autofill {
    -webkit-text-fill-color: var(--text);
    caret-color: var(--text);
    box-shadow: 0 0 0 1000px var(--bg) inset;
    -webkit-box-shadow: 0 0 0 1000px var(--bg) inset;
    transition: background-color 9999s ease-out 0s;
}

.input:focus,
.textarea:focus,
.select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-tint);
}

.textarea {
    min-height: 96px;
    resize: vertical;
    line-height: 1.55;
}

.select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 16px, calc(100% - 13px) 16px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 34px;
}

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

.field--error .input:focus,
.field--error .textarea:focus,
.field--error .select:focus {
    box-shadow: 0 0 0 3px var(--danger-tint);
}

.field--error .field__hint {
    display: none;
}

.file-input {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px dashed var(--border-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.file-input:hover {
    border-color: var(--primary);
    background: var(--primary-tint);
    color: var(--text);
}

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

.file-input i {
    font-size: 1.3rem;
    color: var(--muted);
    flex-shrink: 0;
    transition: color 0.15s;
}

.file-input:hover i {
    color: var(--primary);
}

.file-input__text {
    font-size: 0.88rem;
    word-break: break-all;
}

.field--error .file-input {
    border-color: var(--danger);
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 0.9rem;
}

.check input[type="checkbox"],
.check input[type="radio"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    background: var(--bg);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: border-color 0.15s, background 0.15s;
}

.check input[type="radio"] {
    border-radius: 50%;
}

.check input:hover {
    border-color: var(--primary);
}

.check input:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.check input[type="checkbox"]:checked::after {
    content: '';
    width: 9px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translate(1px, -1px);
}

.check input[type="radio"]:checked::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
}

.radio-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.radio-pill {
    flex: 1;
    min-width: 0;
}

.radio-pill input {
    display: none;
}

.radio-pill__box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.radio-pill__box:hover,
.radio-pill input:checked + .radio-pill__box {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-tint);
}

.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 999px;
    background: var(--border);
    outline: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg);
    box-shadow: 0 0 0 1px var(--primary);
    cursor: pointer;
    transition: transform 0.15s;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.18);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg);
    box-shadow: 0 0 0 1px var(--primary);
}

.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s, background 0.25s;
}

.card--interactive {
    cursor: pointer;
}

.card--interactive:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.card--interactive:active {
    transform: translateY(0);
}

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

.card__title {
    font-size: 0.95rem;
    font-weight: 600;
}

.card__body {
    font-size: 0.88rem;
    color: var(--text-soft);
    line-height: 1.65;
}

.card__footer {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
}

.action-row__meta {
    min-width: 0;
    flex: 1 1 320px;
}

.action-row__title {
    font-weight: 600;
}

.action-row__text {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.action-row > .button {
    flex-shrink: 0;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
    align-items: start;
    gap: 20px;
}

.tool-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 28px;
}

.tool-card__title {
    font-size: 1.15rem;
    font-weight: 650;
    line-height: 1.3;
    padding-right: 20px;
}

.tool-card .tool-card__flag {
    position: absolute;
    top: 18px;
    right: 18px;
    color: var(--warning);
    font-size: 1rem;
    cursor: help;
}

.tool-card__desc {
    margin: 5px 0 0;
    font-size: 0.92rem;
    color: var(--text-soft);
    line-height: 1.6;
}

.tool-card__meta {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.tool-card__meta-label {
    margin-right: 2px;
    font-size: 0.72rem;
    color: var(--muted);
}

.tools-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.tools-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.tools-search {
    position: relative;
    flex-shrink: 0;
    width: 440px;
    max-width: 100%;
}

.tools-search__icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 0.95rem;
    pointer-events: none;
}

.tools-search .input {
    padding-left: 38px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text);
    background: var(--bg);
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    cursor: default;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    user-select: none;
    -webkit-user-select: none;
    cursor: default;
}

.badge--neutral {
    background: var(--surface);
    color: var(--muted);
    border: 1px solid var(--border);
}

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

.clearance-tag {
    --tag-color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.4;
    border: 1px solid;
    color: var(--tag-color);
    background: color-mix(in srgb, var(--tag-color) 12%, transparent);
    border-color: color-mix(in srgb, var(--tag-color) 25%, transparent);
    user-select: none;
    -webkit-user-select: none;
    cursor: default;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.clearance-tag::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.clearance-tag:has(> i)::before {
    display: none;
}

[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    width: max-content;
    max-width: 240px;
    padding: 7px 10px;
    border-radius: 7px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.45;
    text-align: center;
    white-space: normal;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s, transform 0.15s;
    z-index: 300;
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
}

.status-dot--online { background: var(--success); }
.status-dot--away { background: var(--warning); }
.status-dot--offline { background: var(--muted); }

.avatar {
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--surface-hover);
    color: var(--text-soft);
    font-weight: 600;
    line-height: 1;
    user-select: none;
    -webkit-user-select: none;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar--xs { width: 18px; height: 18px; font-size: 0.6rem; }
.avatar--sm { width: 24px; height: 24px; font-size: 0.72rem; }
.avatar--md { width: 32px; height: 32px; font-size: 0.85rem; }
.avatar--lg { width: 48px; height: 48px; font-size: 1.05rem; }
.avatar--xl { width: 72px; height: 72px; font-size: 1.5rem; }
.avatar--2xl { width: 92px; height: 92px; font-size: 2rem; }

.user-mention {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
}

.user-mention__name {
    color: var(--text);
    font-weight: 500;
    font-size: 0.92rem;
}

.user-mention:hover .user-mention__name {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.user-link {
    color: var(--text);
    font-weight: 500;
    text-decoration: none;
}

.user-link:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.auth {
    max-width: 420px;
    margin: 80px auto;
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
}

.auth__title {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.auth__subtitle {
    color: var(--muted);
    margin-bottom: 24px;
}

.auth__footer {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.logout-form {
    display: inline-flex;
    margin: 0;
}

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

.navbar__restricted {
    color: var(--danger);
    font-size: 0.85rem;
}

.menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 9px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.menu-trigger:hover,
.menu-trigger[aria-expanded="true"] {
    background: var(--surface-hover);
    border-color: var(--border);
}

.menu-trigger__chevron {
    color: var(--muted);
    font-size: 0.78rem;
    transition: transform 0.18s;
}

.menu-trigger[aria-expanded="true"] .menu-trigger__chevron {
    transform: rotate(180deg);
}

.menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    padding: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    animation: menu-in 0.16s cubic-bezier(0.22, 0.68, 0, 1.1);
}

.menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 7px 10px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}

.menu__item:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.menu__item i {
    color: var(--muted);
    font-size: 1rem;
    flex-shrink: 0;
}

.menu__item--danger {
    color: var(--danger);
}

.menu__item--danger i {
    color: var(--danger);
}

.menu__item--danger:hover {
    background: var(--danger-tint);
    color: var(--danger);
}

.menu__separator {
    height: 1px;
    background: var(--border);
    margin: 5px 0;
}

.menu-trigger--bordered {
    padding: 9px 12px;
    border-color: var(--border);
}

.menu__count {
    margin-left: 2px;
}

.menu__item--active {
    background: var(--primary-tint);
}

.menu__check {
    width: 16px;
    flex-shrink: 0;
    color: var(--primary);
    font-size: 0.95rem;
}

.menu__check i {
    color: var(--primary);
}

.menu__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tag-color, var(--primary));
    flex-shrink: 0;
}

@keyframes menu-in {
    from { opacity: 0; transform: translateY(-4px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.callout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 0.88rem;
    line-height: 1.6;
    border: 1px solid var(--primary-border);
    background: var(--primary-tint);
    color: var(--text);
}

.callout i {
    font-size: 1.05rem;
    color: var(--primary);
    flex-shrink: 0;
}

.callout__title {
    font-weight: 600;
    margin-bottom: 2px;
}

.callout__body {
    color: var(--text-soft);
}

.callout--success {
    border-color: var(--success-border);
    background: var(--success-tint);
}

.callout--success i {
    color: var(--success);
}

.callout--warning {
    border-color: var(--warning-border);
    background: var(--warning-tint);
}

.callout--warning i {
    color: var(--warning);
}

.callout--danger {
    border-color: var(--danger-border);
    background: var(--danger-tint);
}

.callout--danger i {
    color: var(--danger);
}

.table-wrap {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.table th,
.table td {
    padding: 11px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

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

.table th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-weight: 600;
    background: var(--surface);
}

.table tbody tr {
    transition: background 0.12s;
}

.table tbody tr:hover {
    background: color-mix(in srgb, var(--text) 1%, transparent);
}

.table__actions {
    text-align: right;
}

.table--striped tbody tr:nth-child(odd) {
    background: var(--surface);
}

.table--striped tbody tr:nth-child(odd):hover {
    background: color-mix(in srgb, var(--text) 4%, var(--surface));
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal--open {
    display: flex;
    animation: modal-fade 0.18s ease-out;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: var(--overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal__dialog {
    position: relative;
    width: 100%;
    max-width: 520px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    animation: modal-pop 0.22s cubic-bezier(0.22, 0.68, 0, 1.2);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}

.modal__title {
    font-size: 1rem;
    font-weight: 600;
}

.modal__body {
    padding: 22px;
    font-size: 0.9rem;
    color: var(--text-soft);
    line-height: 1.65;
}

.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 22px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
}

.toast-stack {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    min-width: 280px;
    max-width: 380px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
    box-shadow: var(--shadow-lg);
    font-size: 0.88rem;
    animation: toast-in 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast i {
    font-size: 1.05rem;
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--primary);
}

.toast__body {
    flex: 1;
    color: var(--text-soft);
}

.toast__title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1px;
}

.toast__close {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.95rem;
}

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

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

.empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--muted);
    border: 1px dashed var(--border-strong);
    border-radius: 12px;
    background: var(--surface);
}

.empty > i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--muted);
    opacity: 0.7;
}

.empty__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.empty__body {
    font-size: 0.85rem;
}

.empty__action {
    margin-top: 14px;
}

.maintenance {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding: 72px 24px;
}

.maintenance__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--warning-tint);
    color: var(--warning);
    font-size: 1.8rem;
}

.maintenance__title {
    margin: 6px 0 0;
    font-size: 1.5rem;
}

.maintenance__text {
    max-width: 440px;
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.maintenance .button {
    margin-top: 10px;
}

.home-page main {
    display: flex;
    flex-direction: column;
}

.home {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 48px 24px;
    text-align: center;
}

.home__inner {
    width: 100%;
    max-width: 720px;
}

.home__mark {
    margin: 0;
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
    overflow-wrap: break-word;
    text-shadow: var(--home-mark-glow);
}

.home__tld {
    color: var(--muted);
    text-shadow: none;
}

.impersonation-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--warning-tint);
    border-bottom: 1px solid var(--warning-border);
    font-size: 0.9rem;
}

.impersonation-banner > i {
    color: var(--warning);
}

.home__bio {
    margin: 22px auto 0;
    max-width: 60ch;
    color: var(--text-soft);
    font-size: 1.05rem;
    line-height: 1.7;
    text-wrap: balance;
}

.home__links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    column-gap: 20px;
    row-gap: 14px;
    margin-top: 34px;
}

.home__sep {
    color: var(--muted);
    user-select: none;
}

.home-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--text-soft);
    font-size: 0.95rem;
    text-decoration: none;
    transition: color 0.15s;
}

.home-link i {
    font-size: 1.1rem;
    color: var(--muted);
    transition: color 0.15s;
}

.home-link:hover,
.home-link:hover i {
    color: var(--primary);
}

@media (max-width: 600px) {
    .home__links {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .home__sep {
        display: none;
    }
}

.fit-page main {
    display: flex;
    flex-direction: column;
}

.fit-page .page {
    flex: 1;
    padding-bottom: 32px;
}

.fit-page .site-footer {
    margin-top: 0;
}

.contact__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.88rem;
    text-decoration: none;
    transition: color 0.15s;
}

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

.back-link--spaced {
    margin-bottom: 18px;
}

.page:has(> .doc-page) {
    padding-bottom: 48px;
}

.doc-page {
    max-width: 74ch;
    margin-inline: auto;
}

.doc-layout {
    display: grid;
    grid-template-columns: minmax(0, 74ch) 200px;
    justify-content: center;
    align-items: start;
    gap: 64px;
}

.doc-layout--bare {
    grid-template-columns: minmax(0, 74ch);
}

.doc-layout .doc-page {
    max-width: none;
    margin-inline: 0;
}

.doc h2 {
    scroll-margin-top: 76px;
}

.doc-toc {
    position: sticky;
    top: 76px;
    align-self: start;
}

.doc-toc__title {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 12px;
}

.doc-toc__list {
    list-style: none;
    border-left: 1px solid var(--border);
}

.doc-toc__link {
    display: block;
    padding: 7px 0 7px 16px;
    margin-left: -1px;
    border-left: 2px solid transparent;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.4;
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s;
}

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

.doc-toc__link--active {
    color: var(--text);
    border-left-color: var(--primary);
}

@media (max-width: 900px) {
    .doc-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .doc-toc {
        display: none;
    }
}

.doc > * + * {
    margin-top: 16px;
}

.doc h2 {
    margin-top: 36px;
}

.doc p,
.doc li {
    color: var(--text-soft);
    line-height: 1.75;
}

.doc p .clearance-tag,
.doc li .clearance-tag {
    vertical-align: middle;
}

.doc .tag-list + p {
    margin-top: 28px;
}

.doc ul {
    padding-left: 20px;
}

.doc li + li {
    margin-top: 6px;
}

.doc__meta {
    color: var(--muted);
    font-size: 0.88rem;
}

.module-index {
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: var(--bg);
}

.module-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    border-left: 3px solid var(--module-color);
    transition: background 0.15s;
}

.module-row:last-child {
    border-bottom: none;
}

.module-row:hover {
    background: var(--surface);
}

.module-row__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 12px;
    font-size: 1.3rem;
    color: var(--module-color);
    background: color-mix(in srgb, var(--module-color) 13%, transparent);
}

.module-row__info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.module-row__name {
    font-size: 1.05rem;
    font-weight: 650;
    line-height: 1.3;
}

.module-row__desc {
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.45;
}

.module-row__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.module-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 550;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.module-action i {
    font-size: 0.95rem;
    color: var(--muted);
    transition: color 0.15s, transform 0.15s;
}

.module-action:hover {
    border-color: color-mix(in srgb, var(--module-color) 45%, var(--border));
    background: color-mix(in srgb, var(--module-color) 10%, transparent);
    color: var(--module-color);
}

.module-action:hover i {
    color: var(--module-color);
    transform: translateX(2px);
}

@media (max-width: 720px) {
    .module-row {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 12px 14px;
        padding: 16px 16px;
    }

    .module-row__actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .module-action {
        flex: 1;
        justify-content: center;
    }
}

.navbar__link--muted {
    font-size: 0.82rem;
    color: var(--muted);
}

.admin-shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

.admin-nav {
    position: sticky;
    top: 76px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.admin-nav__label {
    padding: 0 12px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.admin-nav__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 0.92rem;
    color: var(--text-soft);
    text-decoration: none;
}

.admin-nav__item:hover {
    background: var(--surface-hover);
    color: var(--text);
    text-decoration: none;
}

.admin-nav__item--active {
    background: var(--primary-tint);
    color: var(--primary);
    font-weight: 600;
}

.admin-nav__ext {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--muted);
}

.admin-nav__sep {
    margin: 10px 12px;
    border-top: 1px solid var(--border);
}

.admin-main {
    min-width: 0;
}

.user-list {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg);
}

.user-row {
    display: grid;
    grid-template-columns: minmax(200px, 1.2fr) minmax(0, 1.6fr) 120px 140px max-content;
    gap: 18px;
    align-items: center;
    padding: 14px 18px;
}

.user-row + .user-row {
    border-top: 1px solid var(--border);
}

.user-row__identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

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

.user-row__name {
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
}

.user-row__name:hover {
    color: var(--primary);
    text-decoration: none;
}

.user-row__email {
    font-size: 0.8rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-row__clearances {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.user-row__seen {
    font-size: 0.82rem;
    color: var(--muted);
}

.user-row__actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 1000px) {
    .user-row {
        grid-template-columns: minmax(0, 1fr) max-content;
        grid-template-areas:
            "identity actions"
            "clearances clearances"
            "status seen";
        gap: 10px 14px;
    }

    .user-row__identity { grid-area: identity; }
    .user-row__actions { grid-area: actions; }
    .user-row__clearances { grid-area: clearances; }
    .user-row__status { grid-area: status; }
    .user-row__seen { grid-area: seen; justify-self: end; }
}


@media (max-width: 900px) {
    .admin-shell {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .admin-nav {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .admin-nav__label {
        display: none;
    }

    .admin-nav__item {
        white-space: nowrap;
    }

    .admin-nav__sep {
        margin: 0 4px;
        border-top: 0;
        border-left: 1px solid var(--border);
    }
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-head h2 {
    font-size: 1.05rem;
    margin: 0;
}

.section-head__link {
    font-size: 0.82rem;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
}

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

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg);
}

.stat-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    font-size: 1.2rem;
    background: var(--primary-tint);
    color: var(--primary);
}

.stat-card__icon--success { background: var(--success-tint); color: var(--success); }
.stat-card__icon--warning { background: var(--warning-tint); color: var(--warning); }
.stat-card__icon--danger { background: var(--danger-tint); color: var(--danger); }

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

.stat-card__value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text);
}

.stat-card__label {
    font-size: 0.8rem;
    color: var(--muted);
}

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

.select--auto {
    width: auto;
}

.console {
    margin: 0;
    padding: 16px;
    background: var(--surface);
    color: var(--text);
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.8rem;
    line-height: 1.65;
    border: 1px solid var(--border);
    border-radius: 10px;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 420px;
    overflow-y: auto;
}

.deploy-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

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

.deploy-list__item:last-child {
    border-bottom: none;
}

.deploy-list__info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.deploy-list__name {
    font-weight: 600;
    font-size: 0.9rem;
}

.deploy-list__sub {
    font-size: 0.78rem;
    color: var(--muted);
}

.deploy-list__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.meter-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.meter-row__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.meter {
    height: 8px;
    border-radius: 999px;
    background: var(--surface-hover);
    overflow: hidden;
}

.meter__fill {
    height: 100%;
    border-radius: 999px;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 140px;
}

.bar-chart__col {
    flex: 1;
    display: flex;
    align-items: flex-end;
    height: 100%;
}

.bar-chart__bar {
    width: 100%;
    min-height: 2px;
    border-radius: 3px 3px 0 0;
    background: var(--primary);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 14px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.pagination__status {
    font-size: 0.82rem;
    color: var(--muted);
}

.user-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-cell__name {
    font-weight: 600;
}

.user-cell__email {
    font-size: 0.8rem;
    color: var(--muted);
}

.log-when {
    white-space: nowrap;
}

.error-body main {
    display: flex;
    flex-direction: column;
}

.error-body .page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 0;
}

.error-body .site-footer {
    margin-top: 0;
}

.error-page {
    max-width: 440px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.error-page__code {
    font-size: 5rem;
    font-weight: 300;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--muted);
}

.error-page__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--danger-tint);
    color: var(--danger);
    font-size: 1.7rem;
    margin-bottom: 6px;
}

.error-page__title {
    font-size: 1.5rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    color: var(--text);
}

.error-page__body {
    color: var(--muted);
    line-height: 1.65;
    text-wrap: balance;
}

.error-page__action {
    margin-top: 20px;
}

.skeleton {
    background: linear-gradient(90deg, var(--surface) 0%, var(--surface-hover) 50%, var(--surface) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 6px;
    height: 14px;
}

.skeleton--lg {
    height: 20px;
    border-radius: 8px;
}

.skeleton--circle {
    border-radius: 50%;
    aspect-ratio: 1;
    height: 40px;
    width: 40px;
}

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner--lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

.code-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 0.82rem;
    color: var(--text-soft);
    overflow-x: auto;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    line-height: 1.55;
}

kbd {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 5px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-soft);
    box-shadow: inset 0 -1px 0 var(--border);
}

.text-muted { color: var(--muted); }
.text-soft { color: var(--text-soft); }
.text-center { text-align: center; }
.text-sm { font-size: 0.82rem; }
.text-xs { font-size: 0.72rem; }
.text-mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.text-upper { text-transform: uppercase; letter-spacing: 0.06em; }

.tagline {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.7rem;
    color: var(--muted);
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.divider {
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

.divider-dot {
    border-top: 3px dotted var(--border-dot);
    margin: 24px 0;
}

.fade-in {
    animation: fade-up 0.45s cubic-bezier(0.22, 0.68, 0, 1.1) backwards;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-view main {
    display: flex;
    flex-direction: column;
}

.chat-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 22px 24px 28px;
}

.chat-page__head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.chat-page__title {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 650;
    font-size: 1.05rem;
}

.chat-page__flag {
    color: var(--warning);
    font-size: 0.9rem;
    cursor: help;
}

.chat-page__head .button {
    margin-left: auto;
}

.chat {
    flex: 0 1 auto;
    min-height: 360px;
    max-height: calc(100dvh - 200px);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    overflow: hidden;
}

.chat__scroll {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.chat__inner {
    flex: 1 0 auto;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
}

.chat__flow {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.chat__msg {
    display: flex;
    align-items: flex-start;
}

.chat__msg--user {
    justify-content: flex-end;
}

.chat__bubble {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.chat__msg--user .chat__bubble {
    max-width: 78%;
    padding: 10px 15px;
    border-radius: 14px 14px 4px 14px;
    background: var(--primary);
    color: #fff;
}

.chat__bubble--md {
    white-space: normal;
    min-width: 0;
}

.chat__bubble--md > :first-child { margin-top: 0; }
.chat__bubble--md > :last-child { margin-bottom: 0; }

.chat__bubble--md p { margin: 0 0 10px; }

.chat__bubble--md ul,
.chat__bubble--md ol {
    margin: 0 0 10px;
    padding-left: 22px;
}

.chat__bubble--md li { margin: 3px 0; }

.chat__bubble--md h1,
.chat__bubble--md h2,
.chat__bubble--md h3,
.chat__bubble--md h4 {
    margin: 14px 0 8px;
    line-height: 1.3;
}

.chat__bubble--md h1 { font-size: 1.25rem; }
.chat__bubble--md h2 { font-size: 1.12rem; }
.chat__bubble--md h3 { font-size: 1.02rem; }

.chat__bubble--md a { color: var(--primary); }

.chat__bubble--md code {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.85em;
    padding: 1px 5px;
    border-radius: 5px;
    background: var(--bg);
    border: 1px solid var(--border);
}

.chat__bubble--md pre {
    margin: 0 0 10px;
    padding: 13px 15px;
    border-radius: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    overflow-x: auto;
}

.chat__bubble--md pre code {
    padding: 0;
    border: 0;
    background: none;
    font-size: 0.82rem;
    line-height: 1.55;
}

.chat__bubble--md blockquote {
    margin: 0 0 10px;
    padding-left: 12px;
    border-left: 3px solid var(--border-strong);
    color: var(--muted);
}

.chat__bubble--md table {
    border-collapse: collapse;
    margin: 0 0 10px;
    display: block;
    overflow-x: auto;
}

.chat__bubble--md th,
.chat__bubble--md td {
    padding: 5px 10px;
    border: 1px solid var(--border);
    text-align: left;
}

.chat__typing {
    display: inline-flex;
    gap: 5px;
    padding: 7px 0;
}

.chat__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--muted);
    animation: chat-typing 1.3s infinite ease-in-out;
}

.chat__dot:nth-child(2) { animation-delay: 0.16s; }
.chat__dot:nth-child(3) { animation-delay: 0.32s; }

@keyframes chat-typing {
    0%, 70%, 100% { opacity: 0.3; transform: translateY(0); }
    35% { opacity: 1; transform: translateY(-3px); }
}

.chat__empty {
    margin: auto;
    padding: 32px 24px;
    text-align: center;
}

.chat__empty-text {
    margin: 0 auto;
    max-width: 620px;
    color: var(--text-soft);
    font-size: 1.05rem;
    line-height: 1.6;
}

.chat__composer {
    border-top: 1px solid var(--border);
    padding: 14px 0;
}

.chat__composer-row {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.chat__input {
    flex: 1;
    min-width: 0;
    resize: none;
    overflow-y: hidden;
    max-height: 200px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.chat__input::placeholder {
    color: var(--muted);
}

.chat__input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-tint);
}

.chat__send {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}

.chat__send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.chat__send:not(:disabled):hover {
    background: var(--primary-hover);
}

.chat__disclaimer {
    max-width: 960px;
    margin: 9px auto 0;
    padding: 0 24px;
    font-size: 0.72rem;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 640px) {
    .chat-page {
        padding: 12px 14px 20px;
    }

    .chat {
        min-height: 300px;
    }

    .chat__inner,
    .chat__composer-row,
    .chat__disclaimer {
        padding-left: 16px;
        padding-right: 16px;
    }
}

@keyframes modal-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modal-pop {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

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

@media (max-width: 700px) {
    .navbar {
        padding: 0 14px;
    }

    .navbar__links {
        display: none;
    }

    .container {
        padding: 0 16px;
    }

    .card-grid,
    .tools-grid {
        grid-template-columns: 1fr;
    }

    .radio-group {
        flex-direction: column;
    }
}

.site-footer {
    border-top: 1px solid var(--border);
    margin-top: 72px;
    padding: 30px 50px;
}

.site-footer__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 40px;
}

.site-footer__brand {
    justify-self: start;
}

.site-footer__cols {
    justify-self: center;
}

.site-footer__name {
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}

.site-footer__name:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.site-footer__tagline {
    color: var(--muted);
    font-size: 0.82rem;
    margin-top: 4px;
}

.site-footer__cols {
    display: flex;
    flex-wrap: wrap;
    gap: 24px 56px;
}

.site-footer__col {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.site-footer__link {
    color: var(--muted);
    font-size: 0.82rem;
    text-decoration: none;
    transition: color 0.15s;
}

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

.site-footer__copy {
    justify-self: end;
    text-align: right;
    color: var(--muted);
    font-size: 0.78rem;
}

@media (max-width: 800px) {
    .site-footer__inner {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .site-footer__brand,
    .site-footer__cols,
    .site-footer__copy {
        justify-self: center;
        text-align: center;
    }
}

.bw-page {
    height: 100dvh;
}

.bw-page .site-footer {
    margin-top: 0;
}

.bw-page main {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.bw {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 32px 0;
}

.bw__header {
    margin-bottom: 20px;
}

.bw-controls {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: end;
    margin-bottom: 18px;
}

.bw-add {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.bw-add__name {
    flex: 1;
    min-width: 0;
    margin: 0;
}

.bw-add__tags {
    margin: 0;
}

.bw-add__tags-trigger {
    height: 38px;
}

.bw-add__submit {
    flex-shrink: 0;
    height: 38px;
}

.bw-controls__search {
    margin: 0;
    border-left: 1px solid var(--border);
    padding-left: 24px;
}

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

.bw-table {
    table-layout: fixed;
}

.bw-table th:nth-child(1) { width: 24%; }
.bw-table th:nth-child(2) { width: 32%; }
.bw-table th:nth-child(3) { width: 22%; }
.bw-table th:nth-child(4) { width: 14%; }
.bw-table th:nth-child(5) { width: 8%; }

.bw-name {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.bw-face {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    object-fit: cover;
}

.bw-name__link {
    color: var(--text);
    text-decoration: none;
    font-weight: 550;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bw-name__link:hover {
    color: var(--primary);
}

.bw-uuid {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.78rem;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.bw-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.bw-tags__empty {
    color: var(--muted);
}

.bw-date {
    color: var(--muted);
    white-space: nowrap;
}

.bw-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
}

.bw-scroll .table {
    border-collapse: separate;
    border-spacing: 0;
}

.bw-scroll .table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.bw-scroll .empty {
    border: none;
}

.bw-sentinel {
    height: 8px;
}

.bw-loading {
    display: flex;
    justify-content: center;
    padding: 16px;
}

@media (max-height: 680px) {
    .bw-page {
        height: auto;
    }

    .bw-scroll {
        flex: none;
        min-height: 240px;
        max-height: 60dvh;
    }
}

@media (max-width: 760px) {
    .bw-page {
        height: auto;
    }

    .bw-scroll {
        flex: none;
        max-height: 65dvh;
    }

    .bw-controls {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .bw-controls__search {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--border);
        padding-top: 18px;
    }

    .bw-add {
        flex-wrap: wrap;
    }

    .bw-add__name {
        flex-basis: 100%;
    }

    .bw-table {
        table-layout: auto;
    }

    .bw-table th:nth-child(2),
    .bw-table td:nth-child(2) {
        display: none;
    }
}
