:root {
    --nevv-radius-sm: 6px;
    --nevv-radius-md: 10px;
    --nevv-radius-lg: 16px;
    --nevv-content-margin: 12px;
    --nevv-topbar-height: var(--nevv-topbar-min-height, 64px);
    --nevv-shadow-soft: 0 10px 30px rgba(15, 23, 42, .12);
    --nevv-border: 1px solid rgba(15, 23, 42, .10);
}

.nevv-app, .nevv-app * { box-sizing: border-box; }
.nevv-app { font-family: var(--nevv-font-family); font-size: var(--nevv-font-size-base); color: var(--nevv-color-text); background: var(--nevv-color-bg); }

.nevv-topbar {
    position: fixed;
    z-index: 9990;
    top: 0;
    left: 0;
    right: 0;
    min-height: var(--nevv-topbar-min-height);
    height: auto;
    display: grid;
    grid-template-columns: minmax(130px, 220px) 1fr minmax(70px, 140px);
    gap: 10px;
    align-items: center;
    padding: 8px 12px;
    background: var(--nevv-color-surface);
    border-bottom: var(--nevv-border);
    box-shadow: 0 4px 18px rgba(15, 23, 42, .06);
}

.nevv-topbar-left, .nevv-topbar-right { display: flex; align-items: center; min-width: 0; }
.nevv-topbar-right { justify-content: flex-end; }
.nevv-topbar-center { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; min-width: 0; }
.nevv-logo { font-weight: 800; letter-spacing: .04em; text-decoration: none; color: var(--nevv-color-primary); white-space: nowrap; }

.nevv-content {
    margin-top: calc(var(--nevv-topbar-height) + var(--nevv-content-margin));
    margin-bottom: calc(var(--nevv-bottombar-height) + var(--nevv-content-margin));
    padding: var(--nevv-content-margin);
}
.nevv-content-fixed { height: calc(100vh - var(--nevv-topbar-height) - var(--nevv-bottombar-height) - (var(--nevv-content-margin) * 2)); overflow: auto; }
.nevv-content-flow { min-height: calc(100vh - var(--nevv-topbar-height) - var(--nevv-bottombar-height)); }

.nevv-bottombar {
    position: fixed;
    z-index: 9990;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--nevv-bottombar-height);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: var(--nevv-color-surface);
    border-top: var(--nevv-border);
    box-shadow: 0 -4px 18px rgba(15, 23, 42, .06);
}
.nevv-bottom-item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--nevv-color-text); font-size: 12px; }
.nevv-bottom-item:hover { color: var(--nevv-color-primary); }
.nevv-bottom-icon { font-size: 18px; line-height: 1; }
.nevv-nav-badge { position: absolute; top: 8px; right: calc(50% - 22px); min-width: 16px; height: 16px; border-radius: 999px; background: var(--nevv-color-primary); color: #fff; font-size: 10px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; }
.nevv-nav-badge-dot { min-width: 9px; width: 9px; height: 9px; font-size: 0; padding: 0; }

.nevv-btn {
    appearance: none;
    border: 0;
    border-radius: var(--nevv-radius-md);
    padding: 9px 13px;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform .12s ease, background .12s ease, opacity .12s ease;
}
.nevv-btn:hover { transform: translateY(-1px); }
.nevv-btn-primary { background: var(--nevv-color-primary); color: #fff; }
.nevv-btn-primary:hover { background: var(--nevv-color-primary-hover); }
.nevv-btn-primary:active { background: var(--nevv-color-primary-active); }
.nevv-btn-secondary { background: rgba(15, 23, 42, .08); color: var(--nevv-color-text); }
.nevv-btn-danger { background: #dc2626; color: #fff; }
.nevv-btn-ghost { background: transparent; color: var(--nevv-color-primary); }
.nevv-btn-locked, .nevv-btn:disabled { background: rgba(15, 23, 42, .08); color: #6b7280; cursor: not-allowed; transform: none; }

.nevv-input, .nevv-select {
    min-height: 38px;
    border: var(--nevv-border);
    border-radius: var(--nevv-radius-md);
    padding: 8px 10px;
    background: #fff;
    color: var(--nevv-color-text);
    font: inherit;
}
.nevv-input:focus, .nevv-select:focus { outline: 2px solid color-mix(in srgb, var(--nevv-color-primary) 35%, transparent); border-color: var(--nevv-color-primary); }

.nevv-panel, .nevv-card {
    background: var(--nevv-color-surface);
    border: var(--nevv-border);
    border-radius: var(--nevv-radius-lg);
    padding: 18px;
    box-shadow: var(--nevv-shadow-soft);
    margin-bottom: 14px;
}
.nevv-card { box-shadow: none; }

.nevv-avatar-button { border: 0; background: transparent; padding: 0; cursor: pointer; }
.nevv-avatar { width: 42px; height: 42px; border-radius: 999px; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: rgba(15,23,42,.08); }
.nevv-login-state { font-size: 13px; color: #6b7280; }

.nevv-toast-stack { position: fixed; z-index: 10000; top: calc(var(--nevv-topbar-height) + 12px); right: 12px; display: grid; gap: 8px; max-width: min(360px, calc(100vw - 24px)); }
.nevv-toast { padding: 12px 14px; border-radius: var(--nevv-radius-md); background: var(--nevv-color-surface); border: var(--nevv-border); box-shadow: var(--nevv-shadow-soft); }
.nevv-toast-success { border-left: 4px solid #16a34a; }
.nevv-toast-info { border-left: 4px solid var(--nevv-color-primary); }
.nevv-toast-warning, .nevv-toast-locked { border-left: 4px solid #f59e0b; }
.nevv-toast-error { border-left: 4px solid #dc2626; }

.nevv-admin-wrap .nevv-panel { max-width: 1100px; }
.nevv-admin-user-card label { margin-right: 14px; display: inline-block; vertical-align: top; }

@media (max-width: 720px) {
    .nevv-topbar { grid-template-columns: 1fr auto; }
    .nevv-topbar-center { grid-column: 1 / -1; justify-content: flex-start; order: 3; }
    .nevv-bottom-label { font-size: 11px; }
    .nevv-topbar-control { max-width: 100%; }
}

.nevv-news-community-entry {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    border-radius: var(--nevv-radius-md);
    padding: 7px 10px;
    font-weight: 750;
    line-height: 1;
    color: var(--nevv-color-primary);
    background: rgba(29, 78, 216, .08);
}
.nevv-news-community-entry:hover { color: #fff; background: var(--nevv-color-primary); }
.nevv-news-community-entry-avatar { width: 22px; height: 22px; border-radius: 999px; object-fit: cover; }


/* NEWS topbar public entry compatibility */
.floating-community-link,
.nevv-news-community-entry {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    text-decoration: none;
    white-space: nowrap;
}
.nevv-news-community-entry-avatar {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    object-fit: cover;
}
