/* pages.css: the standalone pages and the GIF library manager
   Flattened from the Blazor scoped CSS at commit 7af3454 (parent of 2c1b6c0 "Step 1: remove Blazor").
   Selectors and declarations are copied as they were; only ::deep was removed and a root
   class was put in front of selectors whose class names collided between components.
   See README.md in this folder for the prefixes and the dropped rules. */

/* ==== GifLibraryManager (was Yap/Components/GifLibraryManager.razor.css) ==== */

.gif-library {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.gif-lib-file-input {
    display: none;
}

/* Toolbar: folder chips left, action buttons right; wraps on narrow screens */
.gif-lib-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.gif-lib-folders {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
    max-width: 100%;
    padding-bottom: 2px; /* keeps the scrollbar off the chips */
}

.folder-chip {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 4px 12px;
    font-size: 0.82rem;
    cursor: pointer;
    flex-shrink: 0;
}

.folder-chip:hover {
    color: var(--text-primary);
}

.folder-chip.active {
    background: var(--accent-primary);
    color: #fff;
}

.gif-lib-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.gif-lib-filter {
    flex: 0 1 170px;
    min-width: 110px;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.82rem;
}

.gif-lib-filter:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.gif-lib-action-btn {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    line-height: 1.3;
}

.gif-lib-action-btn:hover {
    background: var(--bg-hover);
}

.gif-lib-action-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: auto; /* keep the tooltip explaining why */
}

.gif-lib-ffmpeg-note {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-style: italic;
}

/* Quota */
.gif-lib-quota {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.gif-lib-quota-track {
    flex: 1;
    max-width: 260px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.gif-lib-quota-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 3px;
}

.gif-lib-quota-fill.hot {
    background: var(--color-warning);
}

.gif-lib-quota-label {
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* Status strips: upload progress, import progress, notices, errors */
.gif-lib-strip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.82rem;
}

.gif-lib-strip.error {
    color: var(--color-danger);
}

.gif-lib-strip.done {
    color: var(--color-success);
}

.gif-lib-strip-text {
    white-space: pre-line;
}

.gif-lib-strip-dismiss {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.82rem;
    padding: 2px 4px;
}

.gif-lib-strip-dismiss:hover {
    color: var(--text-primary);
}

.gif-lib-empty {
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 1rem 0;
}

/* Management grid: aligned cells with always-visible controls (deliberately not the
   picker's masonry — this is a workbench, not a browsing surface) */
.gif-lib-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.gif-lib-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 6px;
}

.gif-lib-thumb {
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gif-lib-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gif-lib-processing {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-style: italic;
}

/* Tag chips + inline editor (same interaction pattern as the Admin GIFs table) */
.gif-library .gif-tags-view {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    cursor: pointer;
    min-height: 20px;
    border-radius: 4px;
    padding: 2px;
}

.gif-library .gif-tags-view:hover {
    background: var(--bg-hover);
}

.gif-library .gif-tag-chip {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 1px 7px;
    font-size: 0.72rem;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gif-library .gif-tag-chip.more {
    color: var(--text-muted);
}

.gif-library .gif-tags-empty {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.75rem;
}

.gif-library .gif-tags-edit {
    display: flex;
    align-items: center;
    gap: 3px;
}

.gif-library .gif-tags-input {
    flex: 1;
    min-width: 0;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-dark);
    border-radius: 5px;
    padding: 3px 6px;
    font-size: 0.75rem;
}

.gif-library .gif-tags-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.gif-library .gif-tags-btn {
    background: var(--bg-secondary);
    color: var(--text-muted);
    border: none;
    border-radius: 5px;
    padding: 3px 6px;
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1;
}

.gif-library .gif-tags-btn:hover {
    color: var(--text-primary);
}

.gif-library .gif-tags-btn.save {
    color: var(--color-success);
}

/* Per-card folder select + remove/delete row */
.gif-lib-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.gif-lib-folder-select {
    flex: 1;
    min-width: 0;
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-dark);
    border-radius: 5px;
    padding: 3px 4px;
    font-size: 0.72rem;
}

.gif-lib-newfolder {
    flex: 1;
    min-width: 0;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--accent-primary);
    border-radius: 5px;
    padding: 3px 6px;
    font-size: 0.72rem;
}

.gif-lib-newfolder:focus {
    outline: none;
}

.gif-lib-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 3px 5px;
    border-radius: 5px;
    flex-shrink: 0;
}

.gif-lib-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.gif-lib-btn.danger:hover {
    color: var(--color-danger);
}

/* Phones: two columns is the sweet spot for thumbnails + controls.
   minmax(0, 1fr), not bare 1fr — 1fr's auto minimum lets a long nowrap tag chip or
   folder option inflate a track past the viewport, making the whole page wobble
   sideways on touch scroll. With the track clamped, chips ellipsize instead. */
@media (max-width: 600px) {
    .gif-lib-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ==== MainLayout (was Yap/Components/Layout/MainLayout.razor.css) ==== */
/* Every rule here styled #blazor-error-ui (Blazor only); all dropped. */

/* ==== Admin (was Yap/Components/Pages/Admin.razor.css) ==== */

.admin-page {
    display: flex;
    height: 100%;
    overflow: hidden;
}

/* Desktop sidebar */
.admin-sidebar {
    width: 180px;
    flex-shrink: 0;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-dark);
    display: flex;
    flex-direction: column;
    padding: 1rem 0.75rem;
    gap: 0.25rem;
}

.admin-sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.25rem;
    margin-bottom: 1rem;
}

.admin-sidebar-header h2 {
    color: var(--text-white);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.page-admin .back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.page-admin .back-button:hover {
    background: var(--bg-hover);
    color: var(--text-white);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    width: 100%;
    text-align: left;
}

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

.nav-item.active {
    background: var(--accent-tint);
    color: var(--text-white);
}

/* Mobile tab bar (hidden on desktop) */
.admin-tabs {
    display: none;
}

/* Main content */
.admin-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.page-admin .section-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.page-admin .section-header h3 {
    color: var(--text-white);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.section-count {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* Table */
.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-dark);
}

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

.users-table thead {
    background: var(--bg-sidebar);
}

.users-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-dark);
}

.users-table td {
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-dark);
    vertical-align: middle;
}

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

.users-table tbody tr:hover {
    background: var(--bg-hover);
}

/* User cell */
.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 180px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.page-admin .user-name {
    color: var(--text-white);
    font-weight: 500;
    white-space: nowrap;
}

.page-admin .admin-badge {
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

.user-username {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Status pill */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.page-admin .status-pill .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-pill.online {
    background: rgba(59, 165, 92, 0.15);
    color: var(--status-online);
}

.page-admin .status-pill.online .status-dot {
    background: var(--status-online);
}

.status-pill.away {
    background: rgba(250, 166, 26, 0.15);
    color: var(--status-away);
}

.page-admin .status-pill.away .status-dot {
    background: var(--status-away);
}

.status-pill.invisible {
    background: rgba(116, 127, 141, 0.15);
    color: var(--status-invisible);
}

.page-admin .status-pill.invisible .status-dot {
    background: var(--status-invisible);
}

.status-pill.offline {
    background: rgba(116, 127, 141, 0.1);
    color: var(--text-muted);
}

.page-admin .status-pill.offline .status-dot {
    background: var(--text-muted);
}

/* PWA cell */
.pwa-cell {
    white-space: nowrap;
}

.pwa-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(59, 165, 92, 0.12);
    color: var(--status-online);
}

/* Date & action cells */
.date-cell {
    white-space: nowrap;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.action-cell {
    white-space: nowrap;
}

.action-type {
    display: block;
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-weight: 500;
}

.action-date {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* IP tags */
.ip-cell {
    min-width: 120px;
}

.ip-tag {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: var(--bg-input);
    border-radius: 3px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-family: monospace;
    margin: 0.125rem 0.25rem 0.125rem 0;
}

/* Locale cell */
.locale-cell {
    white-space: nowrap;
}

.locale-tz {
    display: block;
    color: var(--text-primary);
    font-size: 0.8125rem;
}

.locale-lang {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.no-data {
    color: var(--text-muted);
}

/* Clickable rows */
.clickable-row {
    cursor: pointer;
}

.clickable-row.selected {
    background: var(--accent-tint);
}

.clickable-row.selected:hover {
    background: var(--accent-tint);
}

/* User detail panel */
.user-detail-panel {
    margin-top: 1.5rem;
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    background: var(--bg-sidebar);
    padding: 1.25rem;
}

/* Inline expand row: detail panel rendered directly beneath the selected user row */
.detail-row > td {
    padding: 0;
    border-bottom: 1px solid var(--border-dark);
}

.detail-row .user-detail-panel {
    margin: 0;
    border-radius: 0;
    border-left: 3px solid var(--accent-primary);
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-dark);
}

.detail-header-info {
    flex: 1;
}

.detail-header-info h4 {
    color: var(--text-white);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.detail-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.detail-close:hover {
    background: var(--bg-hover);
    color: var(--text-white);
}

.detail-loading {
    color: var(--text-muted);
    padding: 1rem 0;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.detail-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tag-green {
    background: rgba(59, 165, 92, 0.15);
    color: var(--status-online);
}

.tag-orange {
    background: rgba(250, 166, 26, 0.15);
    color: var(--status-away);
}

.tag-muted {
    background: rgba(116, 127, 141, 0.1);
    color: var(--text-muted);
}

/* Theme swatch inside the detail-panel theme tag */
.theme-swatch {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    margin-right: 0.375rem;
    flex-shrink: 0;
}

/* Theme usage stats (Users tab) */
.theme-stats-header {
    margin-top: 2rem;
}

.theme-stats {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.theme-stat-card {
    background: var(--bg-sidebar);
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 130px;
}

.theme-stat-card.unused {
    opacity: 0.45;
}

.theme-stat-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    flex-shrink: 0;
}

.theme-stat-accent {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    /* ring matches the card background so the dot reads as sitting on the swatch */
    border: 2px solid var(--bg-sidebar);
}

.theme-stat-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.theme-stat-pct {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 400;
}

@media (max-width: 600px) {
    .theme-stats {
        gap: 0.5rem;
    }

    .theme-stat-card {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 0;
    }
}

.detail-tables {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.detail-section h5 {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin: 0 0 0.5rem 0;
}

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

.detail-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--border-dark);
    white-space: nowrap;
}

.detail-table td {
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-dark);
}

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

.ip-mono {
    font-family: monospace;
    font-size: 0.8125rem;
}

.ua-cell {
    font-size: 0.75rem;
    color: var(--text-secondary);
    word-break: break-all;
    max-width: 600px;
}

/* Debug section */
.debug-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.25rem;
}

.page-admin .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.page-admin .form-group label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.page-admin .form-group select,
.page-admin .form-group input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 0.5rem 0.625rem;
    font-size: 0.875rem;
}

.page-admin .form-group select:focus,
.page-admin .form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.generate-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s;
}

.generate-btn:hover:not(:disabled) {
    opacity: 0.85;
}

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

.debug-result {
    color: var(--status-online);
    font-size: 0.8125rem;
    padding: 0.5rem 0.625rem;
    background: rgba(59, 165, 92, 0.1);
    border-radius: 4px;
}

/* Bot settings */
.bot-settings {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.25rem;
}

.page-admin .form-input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 0.5rem 0.625rem;
    font-size: 0.875rem;
}

.page-admin .form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.page-admin .form-input.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-admin .form-textarea {
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
    line-height: 1.4;
}

.page-admin .form-hint {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.bot-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.save-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s;
}

.save-btn:hover:not(:disabled) {
    opacity: 0.85;
}

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

.save-result {
    color: var(--status-online);
    font-size: 0.8125rem;
}

/* Registration settings */
.registration-settings {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 500px;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
}

.page-admin .toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: background-color 0.15s;
    border-bottom: 1px solid var(--border-dark);
}

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

.page-admin .toggle-row:hover {
    background: var(--bg-hover);
}

.page-admin .toggle-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.page-admin .toggle-label {
    color: var(--text-white);
    font-size: 0.9375rem;
    font-weight: 500;
}

.page-admin .toggle-hint {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Deployment how-to boxes — read-only setup instructions for appsettings-level options */
.howto-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 640px;
}

.howto-box {
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
}

.howto-box summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    list-style: none;
    transition: background-color 0.15s;
}

.howto-box summary::-webkit-details-marker {
    display: none;
}

.howto-box summary:hover {
    background: var(--bg-hover);
}

.howto-status {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: right;
    overflow-wrap: anywhere;
}

.howto-status.on {
    color: var(--status-online);
}

.howto-body {
    padding: 0 1.25rem 1rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.howto-body p {
    margin: 0.5rem 0;
}

.howto-body ol {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}

.howto-body li {
    margin: 0.25rem 0;
}

.howto-body code {
    background: var(--bg-primary);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.75rem;
    overflow-wrap: anywhere;
}

.page-admin .toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

.page-admin .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.page-admin .toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-tertiary);
    border-radius: 12px;
    transition: background-color 0.2s;
}

.page-admin .toggle-slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: transform 0.2s, background-color 0.2s;
}

.page-admin .toggle-switch input:checked + .toggle-slider {
    background: var(--accent-primary);
}

.page-admin .toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: white;
}

/* Pending users list */
.pending-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 500px;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
}

.pending-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-dark);
}

.pending-item:last-child {
    border-bottom: none;
}

.pending-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.pending-username {
    color: var(--text-white);
    font-weight: 500;
    font-size: 0.9375rem;
}

.pending-time {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.pending-actions {
    display: flex;
    gap: 0.5rem;
}

.approve-btn {
    background: var(--status-online);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s;
}

.approve-btn:hover {
    opacity: 0.85;
}

.reject-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.reject-btn:hover {
    color: var(--color-danger);
    border-color: var(--color-danger);
}

.refresh-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.refresh-btn:hover {
    background: var(--bg-hover);
    color: var(--text-white);
}

/* Mobile layout */
@media (max-width: 600px) {
    .admin-page {
        flex-direction: column;
    }

    .admin-sidebar {
        display: none;
    }

    .admin-tabs {
        display: flex;
        overflow-x: auto;
        background: var(--bg-sidebar);
        border-bottom: 1px solid var(--border-dark);
        padding: 0 0.5rem;
        gap: 0;
        flex-shrink: 0;
    }

    .tab-item {
        padding: 0.75rem 1rem;
        background: transparent;
        border: none;
        border-bottom: 2px solid transparent;
        color: var(--text-secondary);
        font-size: 0.875rem;
        font-weight: 500;
        cursor: pointer;
        white-space: nowrap;
        transition: color 0.15s, border-color 0.15s;
    }

    .tab-item:hover {
        color: var(--text-primary);
    }

    .tab-item.active {
        color: var(--text-white);
        border-bottom-color: var(--accent-primary);
    }

    .admin-content {
        padding: 1rem;
    }

    .page-admin .section-header {
        flex-direction: column;
        gap: 0.25rem;
    }

    .log-filters {
        flex-direction: column;
    }

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

/* Action Logs */

.log-filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.log-filter-select,
.log-filter-input {
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.8125rem;
}

.log-filter-select {
    min-width: 180px;
}

.log-filter-input {
    flex: 1;
    max-width: 250px;
}

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

.logs-table .date-cell {
    white-space: nowrap;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-family: monospace;
}

.logs-table .info-cell {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.action-pill {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.action-login {
    background: rgba(59, 165, 92, 0.15);
    color: var(--status-online);
}

.action-logout {
    background: rgba(116, 127, 141, 0.15);
    color: var(--text-muted);
}

.action-smart {
    background: rgba(88, 101, 242, 0.15);
    color: var(--accent-primary);
}

.action-video {
    background: rgba(250, 166, 26, 0.1);
    color: var(--status-away);
}

.action-default {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.log-load-more {
    display: flex;
    justify-content: center;
    padding: 1rem 0;
}

.log-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem 0;
    font-size: 0.875rem;
}

/* Preview thumbnails in the Media and GIFs tables */
.admin-thumb {
    height: 40px;
    max-width: 72px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--bg-secondary);
    display: block;
}

/* Inline tag editing in the GIFs table */
.page-admin .gif-tags-cell {
    min-width: 200px;
}

/* Flattening: the Admin tag editor rules are scoped to .gif-tags-cell, not only
   .page-admin. The Admin page also renders the GIF library manager, which uses the
   same .gif-tag* class names with different rules (see .gif-library in this file). */
.page-admin .gif-tags-cell .gif-tags-view {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    cursor: pointer;
    padding: 4px;
    margin: -4px;
    border-radius: 6px;
}

.page-admin .gif-tags-cell .gif-tags-view:hover {
    background: var(--bg-hover);
}

.page-admin .gif-tags-cell .gif-tag-chip {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 0.78rem;
    white-space: nowrap;
}

.page-admin .gif-tags-cell .gif-tags-empty {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.8rem;
}

.page-admin .gif-tags-cell .gif-tags-edit {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-admin .gif-tags-cell .gif-tags-input {
    flex: 1;
    min-width: 140px;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.82rem;
}

.page-admin .gif-tags-cell .gif-tags-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.page-admin .gif-tags-cell .gif-tags-btn {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: none;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.82rem;
    line-height: 1;
}

.page-admin .gif-tags-cell .gif-tags-btn:hover {
    color: var(--text-primary);
}

.page-admin .gif-tags-cell .gif-tags-btn.save {
    color: var(--color-success);
}

/* Media stats cards */
.media-stats {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.media-stat-card {
    background: var(--bg-sidebar);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 100px;
}

.media-stat-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.media-stat-value {
    color: var(--text-white);
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-admin .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.page-admin .status-dot.status-online {
    background: var(--color-success);
}

.page-admin .status-dot.status-offline {
    background: var(--color-danger);
}

@media (max-width: 600px) {
    .media-stats {
        gap: 0.5rem;
    }

    .media-stat-card {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 0;
    }
}

/* Diagnostics */
.diag-stats {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.diag-stat-card {
    background: var(--bg-sidebar);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 90px;
}

.diag-charts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.diag-chart-card {
    background: var(--bg-sidebar);
    border-radius: 8px;
    padding: 1rem;
}

.diag-chart-card h4 {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin: 0 0 0.75rem 0;
}

.diag-chart-wrapper {
    position: relative;
    height: 200px;
}

/* Server GIF library subsection in the GIFs tab */
.server-gif-library {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.server-gif-library h4 {
    margin: 0 0 0.35rem 0;
    font-size: 0.95rem;
}

.page-admin .section-hint {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin: 0 0 0.9rem 0;
}

.action-pill.server-pill {
    background: var(--accent-primary);
    color: #fff;
    margin-left: 4px;
}

/* Per-row actions in the GIFs table */
.gif-actions-cell {
    white-space: nowrap;
}

.gif-row-btn {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: none;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.78rem;
    cursor: pointer;
    margin-right: 4px;
}

.gif-row-btn:hover {
    color: var(--text-primary);
}

.gif-row-btn.active {
    background: var(--accent-primary);
    color: #fff;
}

.gif-row-btn.danger:hover {
    color: var(--color-danger);
}

@media (max-width: 600px) {
    .diag-stats {
        gap: 0.5rem;
    }

    .diag-stat-card {
        flex: 1 1 calc(33.333% - 0.375rem);
        min-width: 0;
    }

    .diag-chart-wrapper {
        height: 160px;
    }
}

/* Invites section */
.invite-create {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.invite-hint {
    display: block;
    max-width: 640px;
    line-height: 1.5;
}

.link-cell {
    white-space: nowrap;
}

.link-code {
    font-family: monospace;
    font-size: 0.8125rem;
    user-select: all;
    margin-right: 0.25rem;
}

/* .refresh-btn is display:flex (block-level), which would drop the copy icon under the URL */
.link-cell .refresh-btn {
    display: inline-flex;
    vertical-align: middle;
}

.link-hidden {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.link-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.link-expiry {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 0.25rem 0.375rem;
    font-size: 0.75rem;
}

/* ==== ChannelSettings (was Yap/Components/Pages/ChannelSettings.razor.css) ==== */

.page-channel .settings-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem;
    overflow-y: auto;
}

.page-channel .settings-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.page-channel .settings-header h2 {
    color: var(--text-white);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.page-channel .back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-sidebar);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.page-channel .back-button:hover {
    background: var(--bg-hover);
    color: var(--text-white);
}

.page-channel .settings-content {
    max-width: 600px;
    width: 100%;
}

.page-channel .settings-section {
    background: var(--bg-sidebar);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.page-channel .settings-section h3 {
    color: var(--text-white);
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
}

.page-channel .section-hint {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-bottom: 1rem;
}

.error-message {
    background: rgba(237, 66, 69, 0.15);
    border: 1px solid var(--color-danger);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: var(--color-danger);
    font-size: 0.875rem;
}

/* Form elements */
.page-channel .form-group {
    margin-bottom: 1.25rem;
}

.page-channel .form-group:last-child {
    margin-bottom: 0;
}

.page-channel .form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
}

.page-channel .form-input,
.page-channel .form-textarea {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.15s;
}

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

.page-channel .form-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-channel .form-input::placeholder,
.page-channel .form-textarea::placeholder {
    color: var(--text-placeholder);
}

.page-channel .form-textarea {
    min-height: 80px;
    resize: vertical;
}

.page-channel .form-hint {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.form-counter {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: right;
    margin-top: 0.25rem;
}

/* Permission cards */
.permission-cards {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.permission-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--bg-input);
    border: 2px solid var(--border-subtle);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}

.permission-card:hover {
    border-color: var(--text-placeholder);
}

.permission-card.selected {
    border-color: var(--accent-primary);
    background: rgba(88, 101, 242, 0.08);
}

.permission-card-radio {
    flex-shrink: 0;
}

.radio-outer {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--text-placeholder);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s;
}

.permission-card.selected .radio-outer {
    border-color: var(--accent-primary);
}

.radio-inner {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-primary);
}

.permission-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.permission-card-title {
    color: var(--text-white);
    font-size: 0.9375rem;
    font-weight: 500;
}

.permission-card-desc {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* Reorder list */
.reorder-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.reorder-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    background: var(--bg-input);
    transition: background-color 0.15s;
}

.reorder-item.current {
    background: rgba(88, 101, 242, 0.15);
    border: 1px solid rgba(88, 101, 242, 0.3);
}

.reorder-icon {
    color: var(--text-placeholder);
    font-size: 1.125rem;
    margin-right: 0.5rem;
    font-weight: 500;
}

.reorder-name {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.9375rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reorder-buttons {
    display: flex;
    gap: 2px;
    margin-left: 0.5rem;
}

.reorder-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.reorder-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-white);
    border-color: var(--text-placeholder);
}

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

/* Actions */
.page-channel .settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.cancel-button,
.save-button {
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s;
}

.cancel-button {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.cancel-button:hover {
    background: var(--bg-hover);
}

.save-button {
    background: var(--accent-primary);
    border: none;
    color: var(--text-white);
}

.save-button:hover:not(:disabled) {
    background: var(--accent-hover);
}

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

/* Danger zone */
.danger-section {
    border: 1px solid rgba(237, 66, 69, 0.3);
}

/* Flattening: prefixed although .danger-section does not collide. The markup is
   <div class="settings-section danger-section">; without the prefix the prefixed
   .settings-section h3 above would win and the danger heading would lose its red. */
.page-channel .danger-section h3 {
    color: var(--color-danger);
}

.danger-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.danger-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.danger-title {
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
}

.danger-desc {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.delete-button {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--color-danger);
    border-radius: 4px;
    color: var(--color-danger);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s;
    white-space: nowrap;
}

.delete-button:hover {
    background: rgba(237, 66, 69, 0.15);
}

.delete-button.confirm {
    background: var(--color-danger);
    color: var(--text-white);
    border-color: var(--color-danger);
}

.delete-button.confirm:hover {
    background: #c03537;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .page-channel .settings-container {
        padding: 1rem;
    }

    .page-channel .settings-section {
        padding: 1rem;
    }

    .page-channel .settings-actions {
        flex-direction: column-reverse;
    }

    .cancel-button,
    .save-button {
        width: 100%;
    }

    .danger-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .delete-button {
        width: 100%;
        text-align: center;
    }
}

/* ==== Invite (was Yap/Components/Pages/Invite.razor.css) ==== */

/* Same visual language as the login and verification pages. */
.invite-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--bg-header);
}

.invite-container h2 {
    color: var(--text-white);
    margin-bottom: 1.5rem;
    font-size: 2rem;
    text-align: center;
    padding: 0 1rem;
}

.invite-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    background: var(--bg-sidebar);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px 0 rgba(0,0,0,.2);
    margin: 0 1rem;
    max-width: 500px;
}

.invite-text {
    color: var(--text-primary);
    font-size: 0.9375rem;
    line-height: 1.5;
    margin: 0;
    text-align: center;
}

.invite-text strong {
    color: var(--text-white);
}

.invite-form-row {
    display: flex;
    gap: 1rem;
    align-items: start;
}

.invite-input {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    width: 300px;
    min-width: 0;
    flex-shrink: 1;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color 0.3s;
}

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

.invite-input.invalid,
.invite-input.invalid:focus {
    border-color: var(--color-danger);
}

.invite-button {
    padding: 0.75rem 2rem;
    background: var(--accent-primary);
    color: var(--text-white);
    border: none;
    border-radius: 3px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
}

.invite-button:hover:not(:disabled) {
    background: var(--accent-hover);
}

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

.invite-secondary {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
    text-decoration: underline;
}

.invite-secondary:hover {
    color: var(--text-primary);
}

.page-invite .validation-error {
    color: var(--color-danger);
    font-size: 0.9rem;
    text-align: center;
}

.page-invite .build-info {
    position: absolute;
    bottom: 1rem;
    color: var(--bg-muted);
    font-size: 0.7rem;
    font-family: monospace;
}

@media (max-width: 600px) {
    .invite-container h2 {
        font-size: 1.5rem;
    }

    .invite-card {
        width: 90%;
        max-width: 300px;
    }

    .invite-form-row {
        flex-direction: column;
    }

    .invite-input,
    .invite-button {
        width: 100%;
    }
}

/* ==== Login (was Yap/Components/Pages/Login.razor.css) ==== */

/* Discord-style dark theme */
.username-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--bg-header);
}

.username-container h2 {
    color: var(--text-white);
    margin-bottom: 2rem;
    font-size: 2.5rem;
    white-space: pre-line;
    text-align: center;
}

.username-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--bg-sidebar);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px 0 rgba(0,0,0,.2);
    margin: 0 1rem;
    max-width: 500px;
}

.username-form-row {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    align-items: start;
}

@media (max-width: 600px) {
    .username-form {
        width: 90%;
        max-width: 300px;
    }

    .username-form-row {
        flex-direction: column;
    }

    .username-container h2 {
        font-size: 1.75rem;
        text-align: center;
        padding: 0 1rem;
    }
}

.username-input {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    width: 300px;
    min-width: 0;
    flex-shrink: 1;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color 0.3s;
}

@media (max-width: 600px) {
    .username-input {
        width: 100%;
    }
}

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

.join-button {
    padding: 0.75rem 2rem;
    background: var(--accent-primary);
    color: var(--text-white);
    border: none;
    border-radius: 3px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .join-button {
        width: 100%;
    }
}

.join-button:hover:not(:disabled) {
    background: var(--accent-hover);
}

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

.username-input.invalid {
    border-color: var(--color-danger);
}

.username-input.invalid:focus {
    border-color: var(--color-danger);
}

.page-login .validation-error {
    color: var(--color-danger);
    font-size: 1rem;
    text-align: center;
}

.new-account-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

.new-account-hint strong {
    color: var(--text-secondary);
}

.retry-link {
    display: block;
    margin: 0.75rem auto 0;
    padding: 0.5rem 1.5rem;
    background: var(--accent-primary);
    border: none;
    border-radius: 3px;
    color: var(--text-white);
    text-decoration: none;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    transition: background 0.3s;
}

.retry-link:hover {
    background: var(--accent-hover);
}

/* Multi-device guide (neutral, instructional) */
.multidevice-guide {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
}

.multidevice-guide strong {
    color: var(--text-white);
}

.multidevice-guide ol {
    margin: 0.75rem 0;
    padding-left: 1.25rem;
}

.multidevice-guide ol li {
    margin-bottom: 0.375rem;
}

.multidevice-guide .retry-link {
    margin-top: 0.5rem;
}

/* Closed registration state */
.closed-message {
    background: var(--bg-sidebar);
    padding: 1.5rem 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px 0 rgba(0,0,0,.2);
    text-align: center;
    margin: 0 1rem;
    max-width: 400px;
}

.closed-message p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin: 0;
    line-height: 1.5;
}

/* Waiting for approval state */
.waiting-message {
    background: var(--bg-sidebar);
    padding: 1.5rem 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px 0 rgba(0,0,0,.2);
    text-align: center;
    margin: 0 1rem;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.waiting-message p {
    color: var(--text-primary);
    font-size: 0.9375rem;
    margin: 0;
    line-height: 1.5;
}

.waiting-hint {
    color: var(--text-muted) !important;
    font-size: 0.8125rem !important;
}

.waiting-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-dark);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 0.5rem;
}

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

.rejection-notice {
    color: var(--color-danger) !important;
    font-size: 0.875rem !important;
    margin-top: 0.5rem !important;
}

.page-login .build-info {
    position: absolute;
    bottom: 1rem;
    color: var(--bg-muted);
    font-size: 0.7rem;
    font-family: monospace;
}

/* ==== Settings (was Yap/Components/Pages/Settings.razor.css) ==== */

.page-settings .settings-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem;
    overflow-y: auto;
    /* overflow-y: auto makes overflow-x compute to auto too, so any accidentally wide
       section gives the whole page a sideways wobble on touch scroll — clip instead. */
    overflow-x: hidden;
}

.page-settings .settings-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.page-settings .settings-header h2 {
    color: var(--text-white);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.page-settings .back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-sidebar);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.page-settings .back-button:hover {
    background: var(--bg-hover);
    color: var(--text-white);
}

.page-settings .settings-content {
    max-width: 600px;
    width: 100%;
}

.page-settings .settings-section {
    background: var(--bg-sidebar);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.page-settings .settings-section h3 {
    color: var(--text-white);
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 1.5rem 0;
}

.profile-picture-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.profile-picture-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-input {
    display: none;
}

.upload-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background: var(--accent-primary);
    color: var(--text-white);
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.15s;
}

.upload-button:hover {
    background: var(--accent-hover);
}

.remove-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.remove-button:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--color-danger);
    color: var(--color-danger);
}

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

.page-settings .form-group {
    margin-bottom: 1.25rem;
}

.page-settings .form-group:last-child {
    margin-bottom: 0;
}

.page-settings .form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
}

.page-settings .form-input,
.page-settings .form-textarea {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.15s;
}

.page-settings .form-input:focus,
.page-settings .form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.page-settings .form-input::placeholder,
.page-settings .form-textarea::placeholder {
    color: var(--text-placeholder);
}

.page-settings .form-textarea {
    min-height: 80px;
    resize: vertical;
}

.page-settings .form-hint {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Same idiom as a.message-link: --accent-focus is the one link color every
   theme contrast-tunes, so a bare <a> never falls back to browser defaults. */
.page-settings .form-hint a {
    color: var(--accent-focus);
    text-decoration: none;
}

.page-settings .form-hint a:hover {
    text-decoration: underline;
}

.form-counter {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: right;
    margin-top: 0.25rem;
}

/* Auto-save status indicator */
.save-status {
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: auto;
    transition: opacity 0.3s;
}

.save-status.saving {
    color: var(--text-muted);
}

.save-status.saved {
    color: var(--color-success);
}

.save-status.error {
    color: var(--color-danger);
}

/* In the push column the status is a full sentence, not a row-end chip;
   the base margin-left:auto would right-align its wrapped lines. */
.notification-actions .save-status {
    margin-left: 0;
}

/* Notification settings */
.notification-status {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-bottom: 1.25rem;
}

.notification-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--bg-input);
    border-radius: 4px;
}

.notification-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.notification-value {
    font-size: 0.875rem;
    font-weight: 500;
}

.notification-value.status-enabled {
    color: var(--color-success);
}

.notification-value.status-disabled {
    color: var(--text-muted);
}

.notification-value.status-unavailable {
    color: var(--text-muted);
    font-style: italic;
}

.notification-value.status-denied {
    color: var(--color-danger);
}

.notification-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notification-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notification-actions .upload-button,
.notification-actions .remove-button {
    border: none;
}

.notification-actions .upload-button:disabled,
.notification-actions .remove-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* PWA install section */
.pwa-installed-info {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--color-success);
    font-size: 0.875rem;
    font-weight: 500;
}

.pwa-check-icon {
    flex-shrink: 0;
}

.pwa-description,
.section-intro {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0 0 1rem 0;
    line-height: 1.4;
}

/* Time widget */
.time-widget {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg-input);
    border-radius: 4px;
    padding: 0.25rem;
    width: fit-content;
}

.time-adjust-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    user-select: none;
}

.time-adjust-btn:hover {
    background: var(--bg-hover);
    color: var(--text-white);
}

.current-time {
    padding: 0 0.75rem;
    color: var(--text-white);
    font-size: 1.25rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 5rem;
    text-align: center;
}

/* Date format picker */
.format-options {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.format-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}

.format-option:hover {
    background: var(--bg-hover);
}

.format-option.selected {
    border-color: var(--accent-primary);
}

.format-option input[type="radio"] {
    display: none;
}

.format-example {
    color: var(--text-white);
    font-size: 0.9375rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    min-width: 10rem;
}

.format-label {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* Passphrase field */
.passphrase-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    margin-bottom: 8px;
}

.passphrase-value {
    flex: 1;
    min-width: 0; /* a long login URL must shrink and wrap instead of pushing the icons out of the box */
    overflow-wrap: anywhere;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    letter-spacing: 0.02em;
    user-select: all;
}

.passphrase-actions {
    display: flex;
    flex-wrap: wrap; /* phone width: link row holds two buttons and the expiry select */
    gap: 8px;
}

.passphrase-actions .remove-button {
    white-space: nowrap;
}

.passphrase-eye {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.passphrase-eye:hover {
    color: var(--text-primary);
}

.expiry-select {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 0.4rem 0.5rem;
    font-size: 0.8125rem;
    font-family: inherit;
}

/* Kicked notice banner */
.kicked-notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: rgba(250, 166, 26, 0.12);
    border: 1px solid rgba(250, 166, 26, 0.35);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.kicked-notice-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.kicked-notice-text {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.4;
}

.kicked-notice-text strong {
    color: var(--text-white);
}

.kicked-notice-dismiss {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
    flex-shrink: 0;
}

.kicked-notice-dismiss:hover {
    color: var(--text-white);
}

/* Active sessions */
.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.session-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: var(--bg-input);
    border-radius: 4px;
    border: 1px solid transparent;
}

.session-item.current {
    border-color: var(--accent-primary);
}

.session-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.session-details {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.session-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.session-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--accent-primary);
    background: rgba(88, 101, 242, 0.15);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    white-space: nowrap;
}

.session-ip {
    color: var(--text-primary);
    font-size: 0.875rem;
}

.session-activity {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .page-settings .settings-container {
        padding: 1rem;
    }

    .page-settings .settings-section {
        padding: 1rem;
    }

    .profile-picture-section {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Toggle switch (shared pattern with Admin) */

.page-settings .toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    cursor: pointer;
}

.page-settings .toggle-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.page-settings .toggle-label {
    color: var(--text-white);
    font-size: 0.9375rem;
    font-weight: 500;
}

.page-settings .toggle-hint {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.page-settings .toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

.page-settings .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.page-settings .toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-tertiary);
    border-radius: 12px;
    transition: background-color 0.2s;
}

.page-settings .toggle-slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: transform 0.2s, background-color 0.2s;
}

.page-settings .toggle-switch input:checked + .toggle-slider {
    background: var(--accent-primary);
}

.page-settings .toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: white;
}

/* Theme picker */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.theme-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s, transform 0.15s;
}

.theme-card:hover {
    transform: translateY(-1px);
    border-color: var(--bg-muted);
}

.theme-card.selected {
    border-color: var(--accent-primary);
}

.theme-card-preview {
    position: relative;
    height: 64px;
    border-radius: 6px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.theme-card-accent-dot {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
}

.theme-card-check {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.theme-card-name {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
}

/* Text size picker — same visual language as the theme cards. The Aa samples are
   sized in px on purpose: they must show each option's absolute size and NOT
   rescale when the root font-size changes. */
.font-size-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.font-size-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0.375rem;
    min-width: 64px;
    padding: 0.625rem 0.75rem 0.5rem;
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s, transform 0.15s;
}

.font-size-option:hover {
    transform: translateY(-1px);
    border-color: var(--bg-muted);
}

.font-size-option.selected {
    border-color: var(--accent-primary);
}

.font-size-sample {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1;
}

.font-size-value {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
}

/* Local Cache (PWA) debug section */
.cache-group {
    margin-bottom: 1rem;
}

.cache-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
}

.cache-group-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.cache-group-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cache-entry-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 220px;
    overflow-y: auto;
    background: var(--bg-input);
    border-radius: 4px;
    padding: 0.375rem 0.5rem;
}

.cache-entry {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.8125rem;
}

.cache-entry-name {
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cache-entry-size {
    color: var(--text-muted);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* Collapsible "DEBUG INFO" section (native <details>) */
.debug-info > summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    list-style: none;
    color: var(--text-white);
    font-size: 1.125rem;
    font-weight: 600;
}

.debug-info > summary::-webkit-details-marker {
    display: none;
}

.debug-info > summary::before {
    content: "▸";
    font-size: 0.875rem;
    color: var(--text-muted);
    transition: transform 0.15s ease;
}

.debug-info[open] > summary {
    margin-bottom: 1.5rem;
}

.debug-info[open] > summary::before {
    transform: rotate(90deg);
}

/* ============================================================
   Notification settings: segmented mode pickers + per-channel list
   ============================================================ */

.notif-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.notif-row-label {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
}

/* Segmented control: one row of buttons, exactly one selected. The container carries the
   border so the buttons can sit flush against each other without doubling it. */
.segmented {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-input);
}

.segmented-wrap {
    flex-wrap: wrap;
}

.seg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.4rem 0.75rem;
    min-height: 36px;   /* comfortable tap target on mobile */
    background: transparent;
    border: none;
    border-right: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.seg-btn:last-child {
    border-right: none;
}

.seg-btn:hover:not(.seg-selected) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.seg-btn.seg-selected {
    background: var(--accent-primary);
    color: var(--text-white);
}

.seg-icon {
    flex-shrink: 0;
}

.notif-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 1.25rem 0;
}

.notif-list {
    display: flex;
    flex-direction: column;
    margin: 0 0 1rem 0;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    overflow: hidden;
}

.notif-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
}

.notif-item:last-child {
    border-bottom: none;
}

/* "New DMs" is a rule, not a conversation — set it apart from the names above it. */
.notif-item-default {
    background: var(--bg-hover);
}

.notif-item-default .notif-item-name {
    font-style: italic;
    color: var(--text-secondary);
}

.notif-item-name {
    color: var(--text-primary);
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notif-item-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 32px;
    flex-shrink: 0;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

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

.notif-item-toggle.muted {
    border-color: var(--color-danger);
    color: var(--color-danger);
}

@media (max-width: 600px) {
    /* Stack label above the picker; a three-button control does not fit beside a label
       on a phone, and shrinking the buttons would cost the tap target. */
    .notif-row {
        flex-direction: column;
        align-items: stretch;
    }

    /* Wrap, so the third choice of a row is not clipped at the 20 px text size on a 320 px phone (U05 of the
       2026-10-15 user test). On one line the buttons still share the width: flex-basis 0 below. */
    .segmented {
        width: 100%;
        flex-wrap: wrap;
    }

    /* 44px is the thumb-target floor; the desktop 36px is a mouse size. */
    .seg-btn {
        flex: 1 1 0;
        min-height: 44px;
        padding: 0.4rem 0.5rem;
    }

    .segmented-wrap .seg-btn {
        flex: 1 1 auto;
    }

    .notif-item-toggle {
        width: 44px;
        height: 40px;
    }

    .notif-item {
        padding: 0.625rem 0.75rem;
    }
}

/* ==== VerifyDevice (was Yap/Components/Pages/VerifyDevice.razor.css) ==== */

.verify-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--bg-header);
}

.verify-container h2 {
    color: var(--text-white);
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.verify-hint {
    color: var(--text-muted);
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
}

.verify-form {
    display: flex;
    gap: 1rem;
    background: var(--bg-sidebar);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px 0 rgba(0,0,0,.2);
    margin: 0 1rem;
}

@media (max-width: 600px) {
    .verify-form {
        flex-direction: column;
        width: 90%;
        max-width: 300px;
    }

    .verify-container h2 {
        font-size: 1.5rem;
        text-align: center;
        padding: 0 1rem;
    }
}

.verify-input {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    width: 300px;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color 0.3s;
}

@media (max-width: 600px) {
    .verify-input {
        width: 100%;
    }
}

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

.verify-input.invalid {
    border-color: var(--color-danger);
}

.verify-button {
    padding: 0.75rem 2rem;
    background: var(--accent-primary);
    color: var(--text-white);
    border: none;
    border-radius: 3px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

@media (max-width: 600px) {
    .verify-button {
        width: 100%;
    }
}

.verify-button:hover:not(:disabled) {
    background: var(--accent-hover);
}

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

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.page-verify .validation-error {
    color: var(--color-danger);
    font-size: 0.75rem;
}

.back-link {
    margin-top: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: underline;
}

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

/* The admin's standing warning (ProxyWatch): red, above every tab, until the server is configured. */
.admin-warning {
    margin: 0 0 16px;
    padding: 12px 16px;
    border: 1px solid var(--color-danger);
    border-left-width: 6px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--color-danger) 12%, transparent);
}
.admin-warning p { margin: 6px 0 0; }
.admin-warning pre {
    margin: 6px 0 0;
    padding: 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.25);
    overflow-x: auto;
}
