/* =========================================================
   GRAVOS — Stylesheet
   Sections:
     1.  Design tokens
     2.  Reset & base
     3.  Scrollbars
     4.  Typography utilities
     5.  Titlebar
     6.  Top navigation
     7.  Shell layout
     8.  Left panel
     9.  Right panel
     10. Main content + voice bar
     11. Auth screen
     12. Buttons
     13. Form controls
     14. Avatar
     15. Modal system
     16. Toast system
     17. Skeleton loaders
     18. Empty states
     19. Error states
     20. Notification dropdown + avatar menu
     21. Utility helpers
     22. Reduced motion + responsive
   ========================================================= */

/* ---------------------------------------------------------
   1. Design tokens — locked palette
   --------------------------------------------------------- */
:root {
    --bg-base:         #0e0e0e;
    --bg-sidebar:      #141414;
    --bg-surface:      #252525;
    --bg-elevated:     #2a2a2a;
    --bg-message:      #323232;
    --bg-hover:        #1e1e1e;
    --bg-active:       rgba(0, 229, 150, 0.08);

    --border:          #202020;
    --border-strong:   #2a2a2a;

    --text-primary:    #c8c8c8;
    --text-secondary:  #484848;
    --text-muted:      #2e2e2e;
    --text-bright:     #e8e8e8;

    --accent:          #00e596;
    --accent-dark:     #00c47e;
    --accent-subtle:   rgba(0, 229, 150, 0.08);

    --danger:          #e24b4a;
    --danger-subtle:   rgba(226, 75, 74, 0.10);
    --warning:         #e9a500;
    --warning-subtle:  rgba(233, 165, 0, 0.10);
    --info:            #4a8cc4;
    --info-subtle:     rgba(74, 140, 196, 0.10);
    --success:         #4caf50;

    --radius-sm:       4px;
    --radius-md:       6px;
    --radius-lg:       10px;
    --radius-xl:       14px;
    --radius-full:     9999px;

    --titlebar-h:      28px;
    --topnav-h:        38px;
    --left-panel-w:    200px;
    --right-panel-w:   160px;

    --font-base:       13px;
    --font-family:     system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    --duration-fast:   120ms;
    --duration-base:   180ms;
    --ease:            cubic-bezier(0.2, 0, 0.13, 1);
}

/* Compact mode tweaks (toggled via [data-compact="true"] on root) */
:root[data-compact="true"] {
    --topnav-h: 34px;
}

/* ---------------------------------------------------------
   2. Reset & base
   --------------------------------------------------------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: var(--font-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
    border: none;
    outline: none;
}

button {
    cursor: pointer;
}

a {
    color: var(--accent-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

ul,
ol {
    list-style: none;
}

/* Visible focus ring on all interactive elements when keyboard-navigated */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Hidden helper used by JS to toggle visibility */
.hidden {
    display: none !important;
}

/* Visually hidden but available to screen readers */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ---------------------------------------------------------
   3. Scrollbars — slim 4px, design-system colours
   --------------------------------------------------------- */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--text-muted) transparent;
}

*::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: var(--radius-full);
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ---------------------------------------------------------
   4. Typography utilities
   --------------------------------------------------------- */
.text-bright   { color: var(--text-bright); }
.text-primary  { color: var(--text-primary); }
.text-secondary{ color: var(--text-secondary); }
.text-muted    { color: var(--text-muted); }
.text-accent   { color: var(--accent-dark); }
.text-danger   { color: var(--danger); }
.text-warning  { color: var(--warning); }
.text-info     { color: var(--info); }

.section-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    font-weight: 600;
}

.heading {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-bright);
    line-height: 1.4;
}

.meta {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ---------------------------------------------------------
   5. Titlebar — frameless drag region + window controls
   --------------------------------------------------------- */
.titlebar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--titlebar-h);
    background: var(--bg-base);
    border-bottom: 0.5px solid var(--border);
    display: flex;
    align-items: center;
    z-index: 1000;
    user-select: none;
    -webkit-user-select: none;
}

.titlebar-brand {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 12px;
    height: 100%;
}

.titlebar-logo {
    height: 14px;
    width: auto;
    pointer-events: none;
    opacity: 0.85;
}

.titlebar-controls {
    display: flex;
    height: 100%;
}

.titlebar-btn {
    width: 44px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}

.titlebar-btn:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}

.titlebar-btn-close:hover {
    background: var(--danger);
    color: #fff;
}

/* ---------------------------------------------------------
   6. Top navigation — 38px tabs row
   --------------------------------------------------------- */
.top-nav {
    position: fixed;
    top: var(--titlebar-h);
    left: 0;
    right: 0;
    height: var(--topnav-h);
    background: var(--bg-sidebar);
    border-bottom: 0.5px solid var(--border);
    display: flex;
    align-items: stretch;
    z-index: 50;
    padding: 0 8px;
}

.top-nav-tabs {
    display: flex;
    align-items: stretch;
    gap: 2px;
    height: 100%;
}

.top-nav-tab {
    height: 100%;
    padding: 0 14px;
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease);
    position: relative;
}

.top-nav-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.top-nav-tab[aria-selected="true"] {
    color: var(--text-bright);
    background: var(--bg-active);
}

.top-nav-tab[aria-selected="true"]::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: -1px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px 2px 0 0;
}

.top-nav-spacer {
    flex: 1;
}

.top-nav-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: auto 4px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    position: relative;
    transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}

.top-nav-icon-btn:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}

.bell-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--accent);
    color: #000;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.top-nav-avatar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: auto 4px auto 4px;
    border-radius: var(--radius-full);
    transition: box-shadow var(--duration-fast) var(--ease);
}

.top-nav-avatar-btn:hover {
    box-shadow: 0 0 0 2px var(--accent-subtle);
}

/* ---------------------------------------------------------
   7. Shell layout — three-column body below the top nav
   --------------------------------------------------------- */
.app-shell {
    position: fixed;
    top: var(--titlebar-h);
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
}

.shell-body {
    margin-top: var(--topnav-h);
    flex: 1;
    display: flex;
    min-height: 0;
}

/* ---------------------------------------------------------
   8. Left panel — collapsible, contextual
   --------------------------------------------------------- */
.left-panel {
    position: relative;
    width: var(--left-panel-w);
    flex-shrink: 0;
    background: var(--bg-sidebar);
    border-right: 0.5px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: width var(--duration-base) var(--ease);
    overflow: hidden;
}

.left-panel[data-collapsed="true"] {
    width: 28px;
}

.left-panel[data-collapsed="true"] .panel-content,
.left-panel[data-collapsed="true"] .voice-bar {
    display: none;
}

.left-panel[data-hidden="true"] {
    display: none;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: var(--left-panel-w);
}

.panel-collapse-btn {
    position: absolute;
    top: 6px;
    right: 4px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    z-index: 5;
    transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}

.panel-collapse-btn:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}

.panel-collapse-btn-right {
    left: 4px;
    right: auto;
}

.left-panel[data-collapsed="true"] .panel-collapse-btn svg,
.right-panel[data-collapsed="true"] .panel-collapse-btn svg {
    transform: scaleX(-1);
}

/* ---------------------------------------------------------
   9. Right panel — collapsible, contextual
   --------------------------------------------------------- */
.right-panel {
    position: relative;
    width: var(--right-panel-w);
    flex-shrink: 0;
    background: var(--bg-sidebar);
    border-left: 0.5px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: width var(--duration-base) var(--ease);
    overflow: hidden;
}

.right-panel[data-collapsed="true"] {
    width: 28px;
}

.right-panel[data-collapsed="true"] .panel-content {
    display: none;
}

.right-panel[data-hidden="true"] {
    display: none;
}

.right-panel .panel-content {
    min-width: var(--right-panel-w);
}

/* ---------------------------------------------------------
   10. Main content + voice bar
   --------------------------------------------------------- */
.main-content {
    flex: 1;
    background: var(--bg-elevated);
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.main-content:focus {
    outline: none;
}

.content-header {
    flex-shrink: 0;
    background: var(--bg-surface);
    border-bottom: 0.5px solid var(--border);
    padding: 0 16px;
    height: 44px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.content-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.content-body-narrow {
    max-width: 680px;
    margin: 0 auto;
    width: 100%;
}

/* Floating voice bar — fixed bottom-left, persists across all tabs. */
.voice-bar-floating {
    position: fixed;
    bottom: 8px;
    left: 8px;
    width: 220px;
    background: var(--bg-message);
    border: 0.5px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 90;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

/* ---------------------------------------------------------
   11. Auth screen — centered card on bg-base
   --------------------------------------------------------- */
.auth-screen {
    position: fixed;
    top: var(--titlebar-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-base);
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.auth-shell {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-logo {
    height: 32px;
    width: auto;
}

.auth-host {
    width: 100%;
}

.auth-host:focus {
    outline: none;
}

.auth-card {
    width: 100%;
    background: var(--bg-sidebar);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-card-wide {
    max-width: 520px;
}

.auth-heading {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-bright);
}

.auth-subtext {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: -10px;
    margin-bottom: 4px;
}

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

.auth-row-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.auth-footer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 4px;
}

.auth-footer a {
    color: var(--accent-dark);
    font-weight: 500;
}

.auth-pill-toggle {
    display: flex;
    background: var(--bg-base);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 3px;
}

.auth-pill {
    flex: 1;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.auth-pill[aria-selected="true"] {
    background: var(--accent-subtle);
    color: var(--accent-dark);
}

/* Password strength bar */
.strength-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
    margin-top: 2px;
}

.strength-segment {
    height: 3px;
    background: var(--bg-message);
    border-radius: var(--radius-full);
}

.strength-segment.active.weak    { background: var(--danger); }
.strength-segment.active.fair    { background: var(--warning); }
.strength-segment.active.good    { background: var(--info); }
.strength-segment.active.strong  { background: var(--accent); }

.strength-label {
    font-size: 11px;
    color: var(--text-secondary);
}

.field-error {
    font-size: 11px;
    color: var(--danger);
    min-height: 14px;
}

.banner {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    line-height: 1.5;
}

.banner-error   { background: var(--danger-subtle);  color: var(--danger);  border: 0.5px solid var(--danger); }
.banner-warning { background: var(--warning-subtle); color: var(--warning); border: 0.5px solid var(--warning); }
.banner-info    { background: var(--info-subtle);    color: var(--info);    border: 0.5px solid var(--info); }
.banner-success { background: var(--accent-subtle);  color: var(--accent-dark); border: 0.5px solid var(--accent); }

/* ---------------------------------------------------------
   12. Buttons
   --------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    border: 0.5px solid var(--border-strong);
    background: var(--bg-message);
    transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease);
    white-space: nowrap;
}

.btn:hover:not(:disabled) {
    background: var(--bg-elevated);
    color: var(--text-bright);
}

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

.btn-primary {
    background: var(--accent);
    color: #002218;
    border-color: var(--accent);
    font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-dark);
    color: #001a13;
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-bright);
}

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

.btn-danger:hover:not(:disabled) {
    background: #d04341;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    height: 26px;
    padding: 0 10px;
    font-size: 11px;
}

.btn-icon {
    width: 28px;
    padding: 0;
    color: var(--text-secondary);
}

.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border: 1.5px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    color: var(--text-bright);
    animation: spin 700ms linear infinite;
}

.btn-primary.btn-loading::after {
    color: #002218;
}

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

/* ---------------------------------------------------------
   13. Form controls
   --------------------------------------------------------- */
.label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0;
}

.input,
.textarea,
.select {
    width: 100%;
    height: 34px;
    padding: 0 12px;
    background: var(--bg-base);
    border: 0.5px solid var(--border-strong);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    transition: border-color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease);
}

.input:focus,
.textarea:focus,
.select:focus {
    border-color: var(--accent);
    outline: none;
}

.input::placeholder,
.textarea::placeholder {
    color: var(--text-muted);
}

.textarea {
    height: auto;
    min-height: 80px;
    padding: 10px 12px;
    line-height: 1.5;
    resize: vertical;
}

.input-with-action {
    position: relative;
}

.input-with-action .input {
    padding-right: 40px;
}

.input-action-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.input-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-primary);
    cursor: pointer;
}

.checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border: 0.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-base);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease);
}

.checkbox:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox:checked::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 0px;
    width: 4px;
    height: 8px;
    border: solid #002218;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

/* Toggle switch */
.toggle {
    --toggle-w: 30px;
    appearance: none;
    -webkit-appearance: none;
    width: var(--toggle-w);
    height: 16px;
    background: var(--bg-message);
    border-radius: var(--radius-full);
    border: 0.5px solid var(--border-strong);
    cursor: pointer;
    position: relative;
    transition: background var(--duration-fast) var(--ease);
    flex-shrink: 0;
}

.toggle::before {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-secondary);
    top: 1px;
    left: 1px;
    transition: transform var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease);
}

.toggle:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.toggle:checked::before {
    transform: translateX(14px);
    background: #002218;
}

/* ---------------------------------------------------------
   14. Avatar
   --------------------------------------------------------- */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-message);
    color: var(--text-bright);
    border-radius: var(--radius-full);
    overflow: hidden;
    font-weight: 600;
    flex-shrink: 0;
    user-select: none;
    border: 0.5px solid var(--border);
}

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

.avatar-xs { width: 22px; height: 22px; font-size: 10px; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-md { width: 36px; height: 36px; font-size: 13px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar-xl { width: 80px; height: 80px; font-size: 26px; }

.avatar-presence {
    position: relative;
}

.avatar-presence::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    border: 1.5px solid var(--bg-sidebar);
}

.avatar-presence[data-online="true"]::after {
    background: var(--accent);
}

/* ---------------------------------------------------------
   15. Modal system
   --------------------------------------------------------- */
.modal-root {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    pointer-events: none;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    pointer-events: auto;
    opacity: 0;
    transition: opacity var(--duration-base) var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.modal-overlay[data-state="open"] {
    opacity: 1;
}

.modal-card {
    background: var(--bg-surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.97);
    transition: transform var(--duration-base) var(--ease);
    overflow: hidden;
}

.modal-overlay[data-state="open"] .modal-card {
    transform: scale(1);
}

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

.modal-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-bright);
}

.modal-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}

.modal-body {
    padding: 18px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 12px 18px;
    border-top: 0.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.modal-card-wide   { max-width: 760px; }
.modal-card-narrow { max-width: 380px; }

/* ---------------------------------------------------------
   16. Toast system — bottom-right stack
   --------------------------------------------------------- */
.toast-root {
    position: fixed;
    bottom: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 300;
    pointer-events: none;
    max-width: 360px;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--bg-surface);
    border: 0.5px solid var(--border-strong);
    border-left-width: 3px;
    border-radius: var(--radius-md);
    padding: 10px 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    transform: translateX(120%);
    transition: transform var(--duration-base) var(--ease), opacity var(--duration-base) var(--ease);
    opacity: 0;
    font-size: 12px;
    color: var(--text-primary);
}

.toast[data-state="open"] {
    transform: translateX(0);
    opacity: 1;
}

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

.toast-content {
    flex: 1;
    line-height: 1.5;
}

.toast-close {
    color: var(--text-secondary);
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--text-bright);
}

/* ---------------------------------------------------------
   17. Skeleton loaders
   --------------------------------------------------------- */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-surface) 0%,
        var(--bg-message) 50%,
        var(--bg-surface) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1300ms ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.skeleton-line {
    height: 12px;
    width: 100%;
}

.skeleton-line-sm { width: 60%; }
.skeleton-line-md { width: 80%; }

.skeleton-circle {
    border-radius: 50%;
}

.skeleton-card {
    padding: 12px;
    background: var(--bg-surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    gap: 10px;
}

.skeleton-row {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px 6px;
}

/* ---------------------------------------------------------
   18. Empty states
   --------------------------------------------------------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
    gap: 10px;
    min-height: 200px;
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-muted);
    margin-bottom: 4px;
}

.empty-state-icon svg {
    width: 22px;
    height: 22px;
}

.empty-state-title {
    color: var(--text-bright);
    font-weight: 500;
    font-size: 14px;
}

.empty-state-subtext {
    color: var(--text-secondary);
    font-size: 12px;
    max-width: 320px;
    line-height: 1.5;
}

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

/* Compact (panel) empty state — for left/right panels */
.empty-state-panel {
    padding: 24px 16px;
    min-height: 0;
}

/* ---------------------------------------------------------
   19. Error states (inline)
   --------------------------------------------------------- */
.error-card {
    background: var(--danger-subtle);
    border: 0.5px solid var(--danger);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.error-card-title {
    font-weight: 600;
    color: var(--danger);
    font-size: 12px;
}

.error-card-text {
    color: var(--text-primary);
    font-size: 12px;
    line-height: 1.5;
}

/* ---------------------------------------------------------
   20. Notification dropdown + avatar menu
   --------------------------------------------------------- */
.notif-dropdown,
.avatar-menu {
    position: fixed;
    background: var(--bg-surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
    z-index: 150;
    min-width: 200px;
    max-width: 360px;
    transform-origin: top right;
    animation: pop-in var(--duration-base) var(--ease);
}

.notif-dropdown {
    width: 360px;
    max-height: 460px;
    display: flex;
    flex-direction: column;
}

.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 0.5px solid var(--border);
}

.notif-dropdown-title {
    font-weight: 600;
    color: var(--text-bright);
    font-size: 13px;
}

.notif-dropdown-list {
    flex: 1;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 0.5px solid var(--border);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease);
}

.notif-item:hover {
    background: var(--bg-hover);
}

.notif-item[data-unread="true"] {
    background: var(--accent-subtle);
}

.notif-item-body {
    flex: 1;
    font-size: 12px;
    line-height: 1.5;
}

.notif-item-time {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 2px;
}

.notif-item-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.avatar-menu {
    padding: 6px;
    min-width: 220px;
}

.avatar-menu-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-bottom: 0.5px solid var(--border);
    margin-bottom: 6px;
}

.avatar-menu-name {
    font-weight: 600;
    color: var(--text-bright);
    font-size: 13px;
}

.avatar-menu-handle {
    font-size: 11px;
    color: var(--text-secondary);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    text-align: left;
    transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}

.menu-item:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}

.menu-item-danger {
    color: var(--danger);
}

.menu-item-danger:hover {
    background: var(--danger-subtle);
    color: var(--danger);
}

.menu-divider {
    height: 0.5px;
    background: var(--border);
    margin: 4px 0;
}

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

/* ---------------------------------------------------------
   21. Utility helpers
   --------------------------------------------------------- */
.row    { display: flex; gap: 8px; align-items: center; }
.row-tight { display: flex; gap: 4px; align-items: center; }
.col    { display: flex; flex-direction: column; gap: 8px; }
.col-tight { display: flex; flex-direction: column; gap: 4px; }

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

.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.divider {
    height: 0.5px;
    background: var(--border);
    width: 100%;
}

.pill {
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 8px;
    font-size: 10px;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pill-player  { background: var(--info-subtle);   color: var(--info); }
.pill-creator { background: var(--accent-subtle); color: var(--accent-dark); }
.pill-online  { background: var(--accent-subtle); color: var(--accent-dark); }
.pill-offline { background: var(--bg-message);    color: var(--text-secondary); }
.pill-pro     { background: rgba(233, 165, 0, 0.15); color: var(--warning); }

/* ---------------------------------------------------------
   22. Reduced motion + responsive
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0ms !important;
    }
}

@media (max-width: 1000px) {
    .right-panel { width: 28px; }
    .right-panel .panel-content { display: none; }
}

@media (max-width: 900px) {
    .left-panel { width: 28px; }
    .left-panel .panel-content,
    .left-panel .voice-bar { display: none; }
}

/* =========================================================
   Phase 3 — Home / Profile / Settings
   ========================================================= */

/* Section header used by home + profile + settings + people / hubs */
.section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.section-heading {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-bright);
    letter-spacing: 0.02em;
}

.section-action {
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    background: none;
    border: 0;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.section-action:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}

/* Greeting block at the top of Home */
.home-greeting {
    margin: 8px 0 24px;
}

.home-greeting-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-bright);
}

.home-greeting-subtext {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Quick stats row */
.stat-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.stat-chip {
    background: var(--bg-surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease);
    text-align: left;
}

.stat-chip:hover {
    background: var(--bg-message);
    border-color: var(--border-strong);
}

.stat-chip-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-bright);
    line-height: 1.2;
}

.stat-chip-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Friend chips (Active now row) */
.friend-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.friend-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 6px;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    border: 0.5px solid var(--border);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease);
}

.friend-chip:hover {
    background: var(--bg-message);
    border-color: var(--border-strong);
}

.friend-chip-name {
    font-size: 12px;
    color: var(--text-bright);
    font-weight: 500;
}

/* Hub card — used on Home + Discover + Hubs panel context */
.hub-card {
    background: var(--bg-surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: border-color var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease);
}

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

.hub-card-cover {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--bg-message), var(--bg-surface));
    background-size: cover;
    background-position: center;
}

.hub-card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.hub-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-bright);
    line-height: 1.3;
}

.hub-card-meta {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

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

/* Post card — shared by Profile, Feed (phase 6) */
.post-card {
    background: var(--bg-surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.post-card + .post-card { margin-top: 12px; }

.post-card-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.post-card-author {
    flex: 1;
    min-width: 0;
}

.post-card-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.post-card-name {
    font-weight: 600;
    color: var(--accent-dark);
    font-size: 13px;
}

.post-card-handle {
    color: var(--text-secondary);
    font-size: 11px;
}

.post-card-time {
    color: var(--text-muted);
    font-size: 11px;
    margin-left: auto;
}

.post-card-body {
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.post-card-tag {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--info);
    background: var(--info-subtle);
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

.post-card-actions {
    display: flex;
    gap: 4px;
    border-top: 0.5px solid var(--border);
    padding-top: 8px;
}

.post-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 11px;
    background: none;
    transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}

.post-action:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}

.post-action[data-active="true"] {
    color: var(--accent);
}

/* Activity row — used on Home for the recent activity list */
.activity-row {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: var(--bg-surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    align-items: flex-start;
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease);
}

.activity-row:hover {
    background: var(--bg-message);
    border-color: var(--border-strong);
}

.activity-row-text {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.5;
}

.activity-row-time {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 2px;
}

/* Continue chip — single-line continue-where-you-left-off */
.continue-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease);
}

.continue-chip:hover {
    background: var(--bg-message);
    border-color: var(--accent);
}

.continue-chip-label {
    font-size: 11px;
    color: var(--text-secondary);
}

.continue-chip-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-bright);
}

/* ---------------------------------------------------------
   Profile page
   --------------------------------------------------------- */
.profile-cover {
    position: relative;
    height: 180px;
    background: linear-gradient(135deg, var(--bg-message), var(--bg-surface));
    background-size: cover;
    background-position: center;
    border-bottom: 0.5px solid var(--border);
}

.profile-cover-pro-prompt {
    position: absolute;
    right: 16px;
    bottom: 16px;
    background: rgba(0, 0, 0, 0.5);
    color: var(--text-primary);
    border: 0.5px solid var(--border-strong);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-size: 11px;
    padding: 6px 10px;
    border-radius: var(--radius-md);
}

.profile-header {
    padding: 0 24px 16px;
    position: relative;
}

.profile-avatar-wrap {
    margin-top: -40px;
    display: flex;
    align-items: flex-end;
    gap: 14px;
}

.profile-avatar-wrap .avatar-xl {
    border: 3px solid var(--bg-elevated);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.profile-avatar-actions {
    margin-bottom: 4px;
    display: flex;
    gap: 6px;
}

.profile-identity {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-identity-name {
    font-size: 22px;
    font-weight: 500;
    color: var(--text-bright);
    line-height: 1.2;
}

.profile-identity-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-secondary);
}

.profile-bio {
    margin-top: 10px;
    font-size: 13px;
    font-style: italic;
    color: var(--text-secondary);
    max-width: 540px;
    line-height: 1.5;
}

.profile-stats {
    display: flex;
    gap: 24px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.profile-stat {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.profile-stat-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-bright);
}

.profile-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

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

.profile-tabs {
    border-bottom: 0.5px solid var(--border);
    padding: 0 24px;
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.profile-tab {
    padding: 10px 14px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    background: none;
    transition: color var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease);
}

.profile-tab:hover {
    color: var(--text-bright);
}

.profile-tab[aria-selected="true"] {
    color: var(--text-bright);
    border-bottom-color: var(--accent);
}

.profile-content {
    padding: 24px;
    max-width: 720px;
}

.about-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 0.5px solid var(--border);
}

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

.about-label {
    width: 160px;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
}

.about-value {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
}

/* ---------------------------------------------------------
   Settings layout
   --------------------------------------------------------- */
.settings-layout {
    display: flex;
    flex: 1;
    min-height: 0;
}

.settings-nav {
    width: 200px;
    flex-shrink: 0;
    border-right: 0.5px solid var(--border);
    padding: 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--bg-elevated);
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 12px;
    text-align: left;
    transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}

.settings-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}

.settings-nav-item[aria-selected="true"] {
    background: var(--accent-subtle);
    color: var(--accent-dark);
    font-weight: 500;
}

.settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
}

.settings-content-narrow {
    max-width: 620px;
}

.settings-card {
    background: var(--bg-surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.settings-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.settings-card-meta {
    font-size: 11px;
    color: var(--text-secondary);
}

.settings-card-heading {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-bright);
}

.settings-card-note {
    font-size: 11px;
    color: var(--warning);
}

.settings-section-heading {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-bright);
    margin-bottom: 4px;
}

.settings-section-subtext {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 18px;
}

.settings-danger-card {
    border-color: var(--danger);
    background: var(--danger-subtle);
}

.settings-danger-card .settings-card-heading {
    color: var(--danger);
}

.settings-inline-form {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-inline-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 0.5px solid var(--border);
}

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

.toggle-row-label {
    font-size: 13px;
    color: var(--text-primary);
}

.toggle-row-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.range-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 0;
    border-bottom: 0.5px solid var(--border);
}

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

.range-row input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
}

/* VU meter placeholder used by the mic test */
.vu-meter {
    height: 6px;
    background: var(--bg-base);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.vu-meter-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--warning));
    transition: width 80ms linear;
}

/* Avatar dropzone (Settings → Profile) */
.dropzone {
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: border-color var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}

.dropzone[data-active="true"],
.dropzone:hover {
    border-color: var(--accent);
    color: var(--text-bright);
}

/* About settings — link list */
.about-link-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.about-link-list a {
    color: var(--accent-dark);
    font-size: 12px;
}

/* =========================================================
   Phase 4 — People (DMs + friends)
   ========================================================= */

/* Left-panel section grouping (DMs / Friends) */
.panel-section {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.panel-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
}

.panel-section-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    font-weight: 600;
}

.panel-section-action {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1;
}

.panel-section-action:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}

/* List item — shared by DM list and friend list */
.list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-primary);
    transition: background var(--duration-fast) var(--ease);
}

.list-item:hover {
    background: var(--bg-hover);
}

.list-item[data-active="true"] {
    background: var(--bg-active);
}

.list-item[data-active="true"] .list-item-name {
    color: var(--text-bright);
}

.list-item[data-offline="true"] {
    opacity: 0.6;
}

.list-item-body {
    flex: 1;
    min-width: 0;
}

.list-item-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-bright);
    line-height: 1.3;
}

.list-item-sub {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.list-item-meta {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
}

.unread-badge {
    min-width: 16px;
    height: 16px;
    padding: 0 5px;
    background: var(--accent);
    color: #002218;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.collapsible-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    color: var(--text-secondary);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.collapsible-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}

.collapsible-toggle svg {
    transition: transform var(--duration-fast) var(--ease);
}

.collapsible-toggle[data-collapsed="true"] svg {
    transform: rotate(-90deg);
}

/* DM thread layout (main content) */
.dm-thread {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.dm-header {
    flex-shrink: 0;
    padding: 0 16px;
    height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 0.5px solid var(--border);
    background: var(--bg-surface);
}

.dm-header-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-bright);
}

.dm-header-handle {
    font-size: 11px;
    color: var(--text-secondary);
}

.dm-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-group {
    display: flex;
    gap: 10px;
    padding: 6px 0;
}

.message-group + .message-group {
    margin-top: 6px;
}

.message-group-avatar {
    flex-shrink: 0;
    align-self: flex-start;
}

.message-group-spacer {
    width: 28px;
    flex-shrink: 0;
}

.message-group-body {
    flex: 1;
    min-width: 0;
}

.message-group-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 2px;
}

.message-group-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-dark);
}

.message-group-name-other {
    color: var(--info);
}

.message-group-time {
    font-size: 11px;
    color: var(--text-muted);
}

.message-content {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.message-content-deleted {
    color: var(--text-muted);
    font-style: italic;
}

.message-receipt {
    font-size: 10px;
    color: var(--text-muted);
    text-align: right;
    padding: 0 16px 4px;
}

.typing-indicator {
    flex-shrink: 0;
    height: 18px;
    padding: 0 16px;
    font-size: 11px;
    color: var(--text-secondary);
    font-style: italic;
}

/* DM input */
.dm-input-bar {
    flex-shrink: 0;
    padding: 10px 16px;
    border-top: 0.5px solid var(--border);
    background: var(--bg-surface);
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.dm-input-textarea {
    flex: 1;
    min-height: 36px;
    max-height: 120px;
    resize: none;
    padding: 8px 12px;
    background: var(--bg-base);
    border: 0.5px solid var(--border-strong);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
    font-family: inherit;
}

.dm-input-textarea:focus {
    border-color: var(--accent);
    outline: none;
}

/* People landing — sub-tabs and content */
.subtabs {
    display: flex;
    gap: 4px;
    padding: 0 24px;
    border-bottom: 0.5px solid var(--border);
    background: var(--bg-surface);
    flex-shrink: 0;
}

.subtab {
    padding: 12px 14px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    background: none;
    transition: color var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease);
    cursor: pointer;
}

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

.subtab[aria-selected="true"] {
    color: var(--text-bright);
    border-bottom-color: var(--accent);
}

.subtab-badge {
    margin-left: 6px;
    background: var(--accent);
    color: #002218;
    font-size: 9px;
    font-weight: 700;
    border-radius: var(--radius-full);
    min-width: 14px;
    height: 14px;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

.user-card {
    background: var(--bg-surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    min-height: 130px;
}

.user-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-bright);
}

.user-card-handle {
    font-size: 11px;
    color: var(--text-secondary);
}

.user-card-actions {
    display: flex;
    gap: 6px;
    margin-top: auto;
    flex-wrap: wrap;
}

.request-row {
    background: var(--bg-surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.request-row-body {
    flex: 1;
    min-width: 0;
}

.request-row-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-bright);
}

.request-row-sub {
    font-size: 11px;
    color: var(--text-secondary);
}

.request-row-actions {
    display: flex;
    gap: 6px;
}

/* =========================================================
   Phase 5 — Hubs (channels + voice + members)
   ========================================================= */

/* Hub list item (left panel) */
.hub-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-primary);
    transition: background var(--duration-fast) var(--ease);
    position: relative;
}

.hub-list-item:hover { background: var(--bg-hover); }

.hub-list-item[data-active="true"] {
    background: var(--bg-active);
}

.hub-list-item[data-active="true"] .hub-list-item-name {
    color: var(--text-bright);
}

.hub-list-item-cover {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-message);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    border: 0.5px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-bright);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.hub-list-item-name {
    flex: 1;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hub-list-item-unread {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

/* Channel section header (TEXT / VOICE / WATCH ROOMS) */
.channel-section-header {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 8px 4px;
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
}

.channel-section-header:hover {
    color: var(--text-bright);
}

.channel-section-header svg {
    transition: transform var(--duration-fast) var(--ease);
}

.channel-section-header[data-collapsed="true"] svg {
    transform: rotate(-90deg);
}

.channel-section-action {
    margin-left: auto;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1;
}

.channel-section-action:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}

/* Channel list item */
.channel-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 12px;
    transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}

.channel-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.channel-item[data-active="true"] {
    background: var(--bg-active);
    color: var(--text-bright);
}

.channel-item-icon {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 13px;
    width: 14px;
    text-align: center;
}

.channel-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-item-meta {
    font-size: 10px;
    color: var(--text-muted);
}

.channel-item-live {
    background: var(--danger);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 0 4px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Hub gear (settings) icon next to hub name in left panel */
.hub-gear-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 8px 0;
}

.hub-gear-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-bright);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hub-gear-btn {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hub-gear-btn:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}

/* Discover link at bottom of left panel */
.discover-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
    font-size: 12px;
    margin: 8px 0 4px;
}

.discover-link:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}

/* Channel header (text/voice/watch main content) */
.channel-header {
    background: var(--bg-surface);
    border-bottom: 0.5px solid var(--border);
    padding: 0 16px;
    height: 44px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.channel-header-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-bright);
}

.channel-header-sep {
    color: var(--text-muted);
}

.channel-header-meta {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Hub channel chat thread (text channel) */
.hub-thread {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.hub-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.hub-load-more {
    display: flex;
    justify-content: center;
    padding: 8px;
}

.hub-message-group {
    display: flex;
    gap: 10px;
    padding: 4px 16px;
}

.hub-message-group:hover {
    background: var(--bg-hover);
}

.hub-message-group + .hub-message-group {
    margin-top: 2px;
}

.hub-message-group-spacer {
    width: 32px;
    flex-shrink: 0;
}

.hub-message-group-body {
    flex: 1;
    min-width: 0;
}

.hub-message-name {
    font-size: 13px;
    font-weight: 600;
}

.hub-message-name-own { color: var(--accent-dark); }
.hub-message-name-other { color: var(--info); }

.hub-message-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 8px;
}

.hub-message-content {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.55;
    word-break: break-word;
    white-space: pre-wrap;
}

.hub-message-content code {
    background: var(--bg-base);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1px 5px;
    font-family: ui-monospace, "SFMono-Regular", "Menlo", monospace;
    font-size: 12px;
}

.hub-message-content pre {
    background: var(--bg-base);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px;
    margin: 4px 0;
    font-family: ui-monospace, "SFMono-Regular", "Menlo", monospace;
    font-size: 12px;
    overflow-x: auto;
    white-space: pre;
}

.hub-message-deleted {
    font-style: italic;
    color: var(--text-muted);
}

/* Channel input bar (text channel) */
.channel-input-bar {
    flex-shrink: 0;
    padding: 10px 16px;
    border-top: 0.5px solid var(--border);
    background: var(--bg-surface);
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.channel-input-textarea {
    flex: 1;
    min-height: 36px;
    max-height: 120px;
    resize: none;
    padding: 8px 12px;
    background: var(--bg-base);
    border: 0.5px solid var(--border-strong);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
    font-family: inherit;
}

.channel-input-textarea:focus {
    border-color: var(--accent);
    outline: none;
}

/* Voice channel grid */
.voice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    padding: 24px;
    flex: 1;
    overflow-y: auto;
    background: var(--bg-elevated);
}

.voice-tile {
    background: var(--bg-surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.voice-tile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-message);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-bright);
    transition: box-shadow var(--duration-fast) var(--ease);
    border: 0.5px solid var(--border-strong);
}

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

.voice-tile[data-speaking="true"] .voice-tile-avatar {
    box-shadow: 0 0 0 3px var(--accent);
}

.voice-tile-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-bright);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.voice-tile-mute {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: var(--bg-base);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--danger);
}

.voice-tile[data-muted="true"] .voice-tile-mute {
    display: flex;
}

/* Voice channel main controls (in voice channel) */
.voice-controls {
    flex-shrink: 0;
    background: var(--bg-surface);
    border-top: 0.5px solid var(--border);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

/* Persistent voice bar (left panel bottom) */
.voice-bar-bar {
    flex-shrink: 0;
    background: var(--bg-message);
    border-top: 0.5px solid var(--border);
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.voice-bar-channel {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voice-bar-hub {
    font-size: 10px;
    color: var(--text-secondary);
    line-height: 1.2;
}

.voice-bar-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.voice-bar-btn:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}

.voice-bar-btn[data-active="true"] {
    color: var(--danger);
}

/* Members panel (right) */
.members-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease);
}

.member-item:hover { background: var(--bg-hover); }

.member-item-name {
    flex: 1;
    font-size: 11px;
    color: var(--text-primary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-item[data-offline="true"] {
    opacity: 0.55;
}

.member-item-role {
    font-size: 9px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.06em;
}

.role-admin   { color: var(--accent); }
.role-mod     { color: var(--info); }
.role-owner   { color: var(--warning); }

/* Hub settings modal layout */
.hub-settings-layout {
    display: flex;
    min-height: 460px;
}

.hub-settings-nav {
    width: 160px;
    flex-shrink: 0;
    border-right: 0.5px solid var(--border);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hub-settings-nav-item {
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    text-align: left;
    background: none;
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}

.hub-settings-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}

.hub-settings-nav-item[aria-selected="true"] {
    background: var(--accent-subtle);
    color: var(--accent-dark);
}

.hub-settings-content {
    flex: 1;
    padding: 14px 18px;
    overflow-y: auto;
    max-height: 60vh;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

/* Discover hubs page */
.discover-toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 24px;
    border-bottom: 0.5px solid var(--border);
    background: var(--bg-surface);
    flex-shrink: 0;
}

.discover-toolbar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.discover-tag {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: var(--bg-message);
    color: var(--text-primary);
    font-size: 11px;
    cursor: pointer;
    border: 0.5px solid transparent;
    transition: border-color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease);
}

.discover-tag[data-active="true"] {
    border-color: var(--accent);
    color: var(--accent-dark);
}

/* Connection banner — pinned to the top of the viewport when the SignalR
   connection is reconnecting or down. */
.conn-banner {
    position: fixed;
    top: var(--titlebar-h);
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    padding: 6px 14px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    font-size: 11px;
    font-weight: 500;
    background: var(--bg-surface);
    border: 0.5px solid var(--border);
    border-top: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.conn-banner-warning {
    background: var(--warning-subtle);
    color: var(--warning);
    border-color: var(--warning);
}

.conn-banner-danger {
    background: var(--danger-subtle);
    color: var(--danger);
    border-color: var(--danger);
}

/* Channels list inside hub settings */
.channel-edit-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: var(--bg-base);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
}

/* =========================================================
   Phase 6 — Feed + Notifications
   ========================================================= */

/* Feed toolbar (filter tabs + compose) */
.feed-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-bottom: 0.5px solid var(--border);
    background: var(--bg-surface);
    flex-shrink: 0;
    gap: 8px;
    flex-wrap: wrap;
}

.feed-filters {
    display: flex;
    gap: 4px;
}

.feed-filter {
    padding: 6px 12px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-md);
    background: none;
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}

.feed-filter:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}

.feed-filter[aria-selected="true"] {
    background: var(--accent-subtle);
    color: var(--accent-dark);
}

/* Compose textarea with char counter */
.compose-textarea {
    width: 100%;
    min-height: 110px;
    resize: vertical;
    padding: 10px 12px;
    background: var(--bg-base);
    border: 0.5px solid var(--border-strong);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.55;
    font-family: inherit;
}

.compose-textarea:focus {
    border-color: var(--accent);
    outline: none;
}

.char-counter {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: right;
    margin-top: 4px;
}

.char-counter[data-overflow="true"] { color: var(--danger); }

/* Comment section (collapsible under a post card) */
.comments-section {
    border-top: 0.5px solid var(--border);
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comment-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.comment-row-body {
    flex: 1;
    min-width: 0;
    background: var(--bg-base);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 10px;
}

.comment-author {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-dark);
}

.comment-author-other { color: var(--info); }

.comment-time {
    font-size: 10px;
    color: var(--text-muted);
    margin-left: 6px;
}

.comment-body {
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.5;
    margin-top: 2px;
    word-break: break-word;
}

.comment-input-row {
    display: flex;
    gap: 6px;
    align-items: flex-end;
}

.comment-input-row textarea {
    flex: 1;
    min-height: 32px;
    resize: none;
    padding: 6px 10px;
    background: var(--bg-base);
    border: 0.5px solid var(--border-strong);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 12px;
    line-height: 1.4;
    font-family: inherit;
}

.comment-input-row textarea:focus {
    border-color: var(--accent);
    outline: none;
}

/* Read-more toggle */
.read-more-btn {
    color: var(--accent-dark);
    background: none;
    font-size: 11px;
    padding: 0;
    margin-left: 4px;
}

.read-more-btn:hover { text-decoration: underline; }

/* ---------------------------------------------------------
   Watch Rooms
   --------------------------------------------------------- */

.channel-item-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(220, 38, 38, 0.15);
    color: var(--danger);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.channel-item-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--danger);
    animation: gravos-live-pulse 1.4s ease-in-out infinite;
}

.channel-item-offline {
    color: var(--text-muted);
    font-style: italic;
}

@keyframes gravos-live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.85); }
}

.watch-offline {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px;
}

.watch-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 48px 16px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: var(--bg-base);
}

.watch-empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--accent-soft, rgba(99, 102, 241, 0.12));
    color: var(--accent);
}

.watch-empty-icon svg { width: 24px; height: 24px; }

.watch-empty-title { font-size: 15px; color: var(--text); font-weight: 600; }

.watch-empty-go-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.watch-history-section { display: flex; flex-direction: column; gap: 8px; }
.watch-history-title { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.watch-history-list { display: flex; flex-direction: column; gap: 6px; }

.watch-history-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--bg-elevated, var(--bg-base));
    border: 1px solid var(--border);
}

.watch-history-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.watch-history-host { font-size: 13px; color: var(--text); font-weight: 600; }
.watch-history-title-text { font-size: 12px; color: var(--text); }
.watch-history-meta { font-size: 11px; }

/* Pre-stream modal */
.watch-prestream-preview-card {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--border);
}

.watch-prestream-preview { width: 100%; height: 100%; object-fit: contain; background: #000; }
.watch-prestream-row { gap: 8px; align-items: center; }
.watch-prestream-cap { font-size: 11px; }

/* Live layout */
.watch-live { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.watch-live-header { gap: 6px; }
.watch-live-viewer-count { margin-left: auto; }

.watch-live-main {
    display: flex;
    flex: 1;
    min-height: 0;
    background: var(--bg-base);
}

.watch-stage {
    position: relative;
    flex: 1;
    min-width: 0;
    background: #000;
    overflow: hidden;
}

.watch-stage-video,
.watch-stage-audio { width: 100%; height: 100%; }
.watch-stage-video { object-fit: contain; background: #000; }
.watch-stage-audio { display: none; }

.watch-stage-live,
.watch-stage-viewers {
    position: absolute;
    top: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
}

.watch-stage-live { left: 12px; color: #fff; }
.watch-stage-viewers { right: 12px; }

.watch-stage-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--danger);
    animation: gravos-live-pulse 1.4s ease-in-out infinite;
}

.watch-stage-live-title {
    font-weight: 500;
    margin-left: 2px;
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.watch-stage-reactions {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.watch-reaction-float {
    position: absolute;
    bottom: 12px;
    font-size: 28px;
    animation: gravos-watch-float 2.6s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
    will-change: transform, opacity;
    user-select: none;
}

@keyframes gravos-watch-float {
    0% { transform: translateY(0) scale(0.85); opacity: 0; }
    10% { opacity: 1; transform: translateY(-12px) scale(1); }
    100% { transform: translateY(-260px) scale(1.1); opacity: 0; }
}

/* Chat sidebar */
.watch-chat {
    width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border);
    background: var(--bg-elevated, var(--bg-base));
}

.watch-chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
}

.watch-chat-row {
    line-height: 1.35;
    word-break: break-word;
}

.watch-chat-name { color: var(--accent); font-weight: 600; }
.watch-chat-row[data-self="true"] .watch-chat-name { color: var(--text); }
.watch-chat-sep { color: var(--text-muted); }
.watch-chat-text { color: var(--text); }

.watch-reaction-bar {
    display: flex;
    gap: 4px;
    padding: 6px 8px;
    border-top: 1px solid var(--border);
    background: var(--bg-base);
}

.watch-reaction-btn {
    background: none;
    border: 1px solid transparent;
    padding: 4px 6px;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 80ms ease, border-color 80ms ease, transform 80ms ease;
}

.watch-reaction-btn:hover {
    background: var(--bg-base);
    border-color: var(--border);
    transform: scale(1.08);
}

.watch-chat-input-row {
    display: flex;
    gap: 6px;
    padding: 6px 8px;
    border-top: 1px solid var(--border);
    background: var(--bg-elevated, var(--bg-base));
}

.watch-chat-input {
    flex: 1;
    resize: none;
    min-height: 28px;
    max-height: 84px;
    font-size: 11px;
    padding: 4px 6px;
}

/* Controls bar */
.watch-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 12px;
    border-top: 1px solid var(--border);
    background: var(--bg-elevated, var(--bg-base));
}

.watch-controls-quality { width: auto; max-width: 160px; }

