:root {
    /* Brand */
    --color-accent: #6c63ff;
    --color-accent-dark: #5a52d5;
    --color-accent-soft: #eef2ff;

    /* Surfaces */
    --color-bg: #f0f2f5;
    --color-surface: #ffffff;
    --color-surface-alt: #f8f9fa;
    --color-surface-hover: #f0f2f5;
    --color-nav: #ffffff;
    --color-nav-hover: #eef0f4;

    /* Text */
    --color-text: #1a1a2e;
    --color-text-secondary: #666666;
    --color-text-muted: #888888;
    --color-text-faint: #999999;
    --color-text-on-dark: #cccccc;
    --color-on-dark: #ffffff;

    /* Borders */
    --color-border: #e0e0e0;
    --color-border-light: #eeeeee;

    /* Semantic */
    --color-danger: #e74c3c;
    --color-danger-dark: #c0392b;
    --color-danger-soft: #fdf0f0;
    --color-success: #27ae60;
    --color-success-soft: #f0fdf0;
    --color-warning: #f39c12;
    --color-info: #4a90d9;

    /* Radii & elevation */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.06);

    /* Type scale */
    --font-xs: 0.75rem;
    --font-sm: 0.85rem;
    --font-base: 0.95rem;
    --font-md: 1.1rem;
    --font-lg: 1.4rem;
    --font-xl: 1.8rem;
    --font-display: 2.25rem;

    /* Spacing scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;

    /* Component metrics */
    --btn-radius: 6px;
    --btn-padding: 0.5rem 1.25rem;
    --btn-font: var(--font-sm);
    --card-radius: var(--radius-lg);
    --page-gutter: 1.5rem;
    --page-max-width: 960px;

    /* Dark mode surfaces (applied under [data-theme="dark"]) */
    --dark-accent: #8b84ff;
    --dark-accent-soft: #2c2a55;
    --dark-bg: #12121a;
    --dark-surface: #1e1e2a;
    --dark-surface-alt: #26263a;
    --dark-surface-hover: #2f2f45;
    --dark-text: #e6e6f0;
    --dark-text-secondary: #a8a8bc;
    --dark-text-muted: #80809a;
    --dark-border: #3a3a52;
    --dark-border-light: #2c2c40;
    --dark-nav: #0e0e14;
    --dark-nav-hover: #26263a;
    --dark-danger-soft: #3d1f24;
    --dark-success-soft: #16331f;
}

:root[data-theme="dark"] {
    --color-accent: var(--dark-accent);
    --color-accent-soft: var(--dark-accent-soft);
    --color-bg: var(--dark-bg);
    --color-surface: var(--dark-surface);
    --color-surface-alt: var(--dark-surface-alt);
    --color-surface-hover: var(--dark-surface-hover);
    --color-text: var(--dark-text);
    --color-text-secondary: var(--dark-text-secondary);
    --color-text-muted: var(--dark-text-muted);
    --color-border: var(--dark-border);
    --color-border-light: var(--dark-border-light);
    --color-danger-soft: var(--dark-danger-soft);
    --color-success-soft: var(--dark-success-soft);
    --color-nav: var(--dark-nav);
    --color-nav-hover: var(--dark-nav-hover);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.35);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.navbar {
    background: var(--color-nav);
    padding: 0.75rem 1.5rem;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.brand {
    color: var(--color-accent);
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item,
.nav-group {
    list-style: none;
    position: relative;
}

.nav-item-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
}

.user-greeting {
    color: var(--color-text-on-dark);
    font-size: var(--font-sm);
    white-space: nowrap;
}

.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.nav-hamburger:hover {
    background-color: var(--color-nav-hover);
}

.hamburger-bar {
    display: block;
    width: 100%;
    height: 2px;
    background: #ccc;
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

body.nav-open .hamburger-bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

body.nav-open .hamburger-bar:nth-child(2) {
    opacity: 0;
}

body.nav-open .hamburger-bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

body.nav-open {
    overflow: hidden;
}

.nav-group-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: transparent;
    border: none;
    color: #ccc;
    font-size: 0.9rem;
    font-family: inherit;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s, color 0.2s;
}

.nav-group-toggle:hover,
.nav-group.open .nav-group-toggle {
    background-color: var(--color-nav-hover);
    color: var(--color-text);
}

.nav-group-toggle .caret {
    font-size: 0.65rem;
    transition: transform 0.2s;
}

.nav-group.open .caret {
    transform: rotate(180deg);
}

.nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 180px;
    margin: 0;
    padding: 0.4rem 0;
    list-style: none;
    background: #232342;
    border: 1px solid #3a3a5e;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    z-index: 1000;
}

.nav-group.open .nav-dropdown {
    display: block;
}

.nav-dropdown li {
    list-style: none;
}

.nav-dropdown-link {
    display: block;
    padding: 0.5rem 1rem;
    color: #ccc;
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-dropdown-link:hover,
.nav-dropdown-link:focus {
    background-color: var(--color-nav-hover);
    color: var(--color-text);
    outline: none;
}

.nav-dropdown-link.active {
    color: #fff;
    background-color: #6c63ff;
}

.btn {
    display: inline-block;
    padding: var(--btn-padding);
    border-radius: var(--btn-radius);
    text-decoration: none;
    font-size: var(--btn-font);
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-on-dark);
}

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

.btn-secondary {
    background-color: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    font-weight: 500;
}

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

.btn-block {
    display: block;
    width: 100%;
}

.inline-form {
    display: inline;
}

.main-container {
    flex: 1;
    max-width: var(--page-max-width);
    margin: 0 auto;
    padding: var(--space-6) var(--page-gutter);
    width: 100%;
}

.auth-form {
    max-width: 420px;
    margin: 0 auto;
    background: var(--color-surface);
    padding: var(--space-6);
    border-radius: var(--card-radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--color-text);
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #6c63ff;
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.field-error {
    color: #e74c3c;
    font-size: 0.85rem;
    display: block;
    margin-top: 0.3rem;
}

.validation-summary ul {
    color: #e74c3c;
    padding-left: 1.2rem;
    margin-bottom: 1rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group label {
    margin-bottom: 0;
    font-weight: 400;
}

.auth-link {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--color-text-secondary);
}

.auth-link a {
    color: #6c63ff;
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

.home-page {
    text-align: center;
    padding: 4rem 1rem;
}

.home-page h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.home-page p {
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

footer {
    background: #1a1a2e;
    color: var(--color-text-muted);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.85rem;
}

.footer-container {
    max-width: 960px;
    margin: 0 auto;
}

.alert-error {
    background: #fdf0f0;
    border: 1px solid #e74c3c;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    color: #c0392b;
}

.alert-error ul {
    margin: 0;
    padding-left: 1.2rem;
}

.alert-success {
    background: #f0fdf0;
    border: 1px solid #27ae60;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    color: #1e8449;
}

.nav-link {
    color: #ccc;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap;
}

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

.nav-link.active {
    background-color: #6c63ff;
    color: #fff;
}

.compose-container {
    max-width: 600px;
    margin: 0 auto;
}

.compose-container h2 {
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

.compose-form {
    background: var(--color-surface);
    padding: 2rem;
    border-radius: var(--card-radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.compose-textarea {
    resize: vertical;
    font-family: inherit;
    min-height: 120px;
}

.char-counter {
    display: block;
    text-align: right;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 0.3rem;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.timeline-header h2 {
    color: var(--color-text);
}

.timeline-feed {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.note-card {
    background: var(--color-surface);
    border-radius: var(--card-radius);
    padding: 1.25rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 0.6rem;
}

.note-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
}

.note-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.note-avatar .avatar-placeholder {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    border: none;
}

.note-author {
    display: flex;
    align-items: baseline;
    min-width: 0;
}

.note-display-name {
    font-weight: 600;
    color: var(--color-text);
    margin-right: 0.4rem;
    text-decoration: none;
}

.note-display-name:hover {
    text-decoration: underline;
}

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

.note-timestamp {
    color: var(--color-text-faint);
    font-size: 0.85rem;
}

.note-content {
    line-height: 1.5;
    color: var(--color-text);
    margin-bottom: 0.75rem;
    word-wrap: break-word;
}

.note-actions {
    display: flex;
    gap: 0.5rem;
    border-top: 1px solid var(--color-border-light);
    padding-top: 0.75rem;
}

.btn-action {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background-color 0.2s;
}

.btn-action:hover {
    background-color: var(--color-surface-hover);
}

.btn-delete {
    color: var(--color-danger);
}

.btn-delete:hover {
    background-color: var(--color-danger-soft);
    color: var(--color-danger-dark);
}

.btn-edit {
    color: var(--color-info);
}

.btn-edit:hover {
    background-color: #f0f4ff;
    color: #357abd;
}

.empty-timeline {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
}

.empty-timeline-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 0.5rem;
}

.empty-timeline-hint {
    margin: 0 0 1.25rem;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.empty-timeline a {
    color: #6c63ff;
    text-decoration: none;
}

.empty-timeline a:hover {
    text-decoration: underline;
}

.follow-container {
    max-width: 600px;
    margin: 0 auto;
}

.follow-container h2 {
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

.follow-form {
    background: var(--color-surface);
    padding: 2rem;
    border-radius: var(--card-radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.handle-help {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.handle-help code {
    background: var(--color-surface-hover);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.8rem;
}

.follow-links {
    margin-top: 1.5rem;
    text-align: center;
}

.follow-links a {
    color: #6c63ff;
    text-decoration: none;
}

.follow-links a:hover {
    text-decoration: underline;
}

.separator {
    margin: 0 0.5rem;
    color: #ccc;
}

.following-container {
    max-width: 700px;
    margin: 0 auto;
}

.following-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.following-header h2 {
    color: var(--color-text);
}

.following-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.following-item {
    background: var(--color-surface);
    border-radius: var(--card-radius);
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.following-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.following-display-name {
    font-weight: 600;
    color: var(--color-text);
}

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

.following-domain {
    color: #6c63ff;
    font-size: 0.8rem;
    background: #f0f0ff;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

.btn-unfollow {
    background: none;
    border: 1px solid #e74c3c;
    color: #e74c3c;
    padding: 0.35rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.btn-unfollow:hover {
    background: #e74c3c;
    color: white;
}

.following-links {
    margin-top: 1.5rem;
    text-align: center;
}

.following-links a {
    color: #6c63ff;
    text-decoration: none;
}

.following-links a:hover {
    text-decoration: underline;
}

.btn-like {
    color: var(--color-text-muted);
}

.btn-like.active {
    color: var(--color-text);
    font-weight: 700;
}

.btn-like:hover {
    background-color: var(--color-surface-hover);
}

.btn-boost {
    color: var(--color-text-muted);
}

.btn-boost.active {
    color: var(--color-text);
    font-weight: 700;
}

.btn-boost:hover {
    background-color: var(--color-surface-hover);
}

.btn-reply {
    color: var(--color-text-muted);
}

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

.boost-banner {
    background: #f0fdf0;
    border: 1px solid #27ae60;
    color: #1e8449;
    padding: 0.4rem 0.75rem;
    border-radius: 6px 6px 0 0;
    font-size: 0.85rem;
    margin: -1.25rem -1.25rem 0.75rem -1.25rem;
}

.reply-indicator {
    color: var(--color-text-faint);
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
}

.note-reply {
    border-left: 3px solid #6c63ff;
    margin-left: 2rem;
}

.reply-form-container {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border-light);
}

.reply-textarea {
    resize: none;
    font-family: inherit;
    margin-bottom: 0.5rem;
}

.reply-actions {
    display: flex;
    justify-content: flex-end;
}

/* Profile */

.profile-page {
    max-width: 700px;
    margin: 0 auto;
}

.profile-banner {
    height: 180px;
    border-radius: var(--card-radius) var(--card-radius) 0 0;
    background-size: cover;
    background-position: center;
}

.profile-banner-default {
    background: linear-gradient(135deg, #6c63ff 0%, #3b82f6 100%);
}

.profile-info {
    background: var(--color-surface);
    border-radius: 0 0 12px 12px;
    padding: 1.5rem 2rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.profile-avatar {
    margin-top: -50px;
    margin-bottom: 1rem;
}

.profile-avatar img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 4px solid white;
    object-fit: cover;
}

.avatar-placeholder {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #6c63ff;
    color: white;
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid white;
}

.profile-details h1 {
    font-size: 1.5rem;
    color: var(--color-text);
    margin-bottom: 0.2rem;
}

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

.profile-bio {
    margin-top: 0.75rem;
    color: var(--color-text);
    line-height: 1.5;
}

.profile-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border-light);
}

.profile-stats .stat {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.profile-stats .stat strong {
    color: var(--color-text);
}

.profile-edit-container {
    max-width: 600px;
    margin: 0 auto;
}

.profile-edit-container h2 {
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

.profile-edit-form {
    background: var(--color-surface);
    padding: 2rem;
    border-radius: var(--card-radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.form-help {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* ===== Notifications ===== */

.notifications-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 1.5rem 0;
}

.notifications-header {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

.empty-notifications {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s;
}

.notification-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.notification-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f0eefc;
    color: #6c63ff;
}

.notification-item.like .notification-icon {
    background: #ffe0e6;
    color: #e0245e;
}

.notification-item.boost .notification-icon {
    background: #e0f7fa;
    color: #00897b;
}

.notification-item.follow .notification-icon {
    background: #e8f5e9;
    color: #2e7d32;
}

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

.notification-title {
    margin: 0 0 0.25rem;
    font-size: 0.95rem;
    color: var(--color-text);
}

.notification-title a {
    font-weight: 600;
    color: #6c63ff;
    text-decoration: none;
}

.notification-title a:hover {
    text-decoration: underline;
}

.notification-note {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.notification-time {
    flex-shrink: 0;
    font-size: 0.8rem;
    color: var(--color-text-faint);
    white-space: nowrap;
}

.notifications-pagination {
    text-align: center;
    margin-top: 1.5rem;
}

/* ===== Error Pages ===== */

.error-page {
    text-align: center;
    padding: 3rem 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.error-page h1 {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

.error-message {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
}

.error-status {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.error-details {
    background: var(--color-surface-alt);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.error-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Responsive / Mobile ===== */

@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 0.75rem;
    }

    .nav-container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .nav-hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(80vw, 320px);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: #1a1a2e;
        border-left: 1px solid #3a3a5e;
        padding: 4.5rem 1rem 2rem;
        transform: translateX(100%);
        transition: transform 0.25s ease;
        overflow-y: auto;
        z-index: 1100;
        box-shadow: -8px 0 24px rgba(0,0,0,0.35);
    }

    .nav-menu.open {
        transform: translateX(0);
    }

    .nav-scrim {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
        z-index: 1050;
    }

    .nav-scrim.visible {
        opacity: 1;
        visibility: visible;
    }

    .nav-menu .nav-item,
    .nav-menu .nav-group {
        width: 100%;
        border-bottom: 1px solid #2a2a4a;
    }

    .nav-menu .nav-link,
    .nav-menu .nav-group-toggle {
        display: flex;
        width: 100%;
        justify-content: space-between;
        padding: 0.85rem 0.5rem;
        border-radius: 0;
        font-size: 1rem;
    }

    .nav-dropdown {
        display: block;
        position: static;
        min-width: 0;
        margin: 0 0 0.5rem;
        padding: 0;
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    .nav-group:not(.open) .nav-dropdown {
        display: none;
    }

    .nav-dropdown-link {
        padding: 0.6rem 1.25rem;
        color: var(--color-text-muted);
        font-size: 0.95rem;
    }

    .nav-dropdown-link.active {
        background: transparent;
        color: #6c63ff;
        font-weight: 600;
    }

    .nav-item-user {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-left: 0;
        padding-top: 0.75rem;
        border-bottom: none;
    }

    .nav-item-user .btn {
        width: 100%;
        text-align: center;
    }

    .main-container {
        padding: 0.5rem;
    }

    .profile-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-top: -40px;
    }

    .profile-details {
        width: 100%;
    }

    .profile-stats {
        justify-content: center;
        flex-wrap: wrap;
    }

    .timeline-feed {
        gap: 0.75rem;
    }

    .note-card {
        padding: 0.75rem;
    }

    .note-header {
        flex-wrap: wrap;
    }

    .note-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0.5rem;
    }

    .compose-form {
        flex-direction: column;
    }

    .compose-textarea {
        width: 100%;
    }

    .char-counter {
        align-self: flex-end;
    }

    .auth-form {
        padding: 1.5rem 1rem;
    }

    .following-list {
        flex-direction: column;
    }

    .following-item {
        flex-direction: column;
    text-align: center;
}

.btn-report {
    background: #f39c12;
    color: white;
}

.note-attachment {
    margin: 0.5rem 0;
}

.note-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    object-fit: cover;
}

.note-attachments {
    margin: 0.5rem 0;
}

.doc-attachment {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #f4f4f8;
    border: 1px solid #e0e0e8;
    border-radius: 8px;
    color: var(--color-text);
    text-decoration: none;
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.doc-attachment:hover {
    background: #e8e8f0;
    border-color: #c0c0d0;
}

.doc-icon {
    font-size: 1.1rem;
}

.doc-name {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-form-container {
    margin: 1rem 0;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.upload-preview {
    max-width: 200px;
    max-height: 200px;
    margin-top: 0.5rem;
    border-radius: 4px;
}

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .error-page {
        padding: 2rem 1rem;
    }

    .error-icon {
        font-size: 3rem;
    }

    .error-page h1 {
        font-size: 1.4rem;
    }

    .error-actions {
        flex-direction: column;
    }

    .error-actions .btn {
        width: 100%;
    }

    .profile-banner {
        height: 100px;
    }

    .profile-avatar {
        margin-top: -30px;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 0.5rem;
    }

    .brand {
        font-size: 1.2rem;
    }

    .nav-item-user .user-greeting {
        font-size: 0.85rem;
    }

    .note-content {
        font-size: 0.9rem;
    }

    .compose-textarea {
        min-height: 80px;
    }

    .follow-container {
        padding: 1rem 0.5rem;
    }
}

/* ===== Search ===== */

.search-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 1.5rem 0;
}

.search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: var(--card-radius);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: #6c63ff;
}

.search-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
}

.search-tab {
    padding: 0.5rem 1rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.search-tab:hover {
    background: #f0eefc;
    color: #6c63ff;
}

.search-tab.active {
    background: #6c63ff;
    color: #fff;
    font-weight: 600;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.search-note-card {
    padding: 1rem;
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.search-note-author {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.search-note-author a {
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
}

.search-note-author a:hover {
    text-decoration: underline;
}

.search-note-username {
    color: var(--color-text-faint);
    margin-left: 0.25rem;
}

.search-note-content {
    margin: 0.25rem 0;
    font-size: 0.95rem;
    color: var(--color-text);
    line-height: 1.5;
}

.search-note-time {
    font-size: 0.8rem;
    color: var(--color-text-faint);
}

.search-user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.search-user-avatar {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
}

.search-user-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #6c63ff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
}

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

.search-user-info a {
    color: var(--color-text);
    text-decoration: none;
    display: block;
}

.search-user-info a:hover {
    text-decoration: underline;
}

.search-user-username {
    color: var(--color-text-faint);
    font-weight: 400;
    font-size: 0.9rem;
}

.search-user-bio {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.search-empty {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
}

.search-empty-prompt {
    padding: 3rem 1rem;
}

.search-empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 0.5rem;
}

.search-empty-hint {
    margin: 0;
    color: var(--color-text-muted);
}

.search-empty-hint a {
    color: #6c63ff;
    text-decoration: none;
}

.search-empty-hint a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .search-form {
        flex-direction: column;
    }

    .search-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .search-tab {
        white-space: nowrap;
    }

    .search-user-card {
        padding: 0.75rem;
    }

    .search-user-avatar {
        width: 40px;
        height: 40px;
    }

    .search-user-avatar img,
    .avatar-placeholder {
        width: 40px;
        height: 40px;
    }
}

/* ===== Hashtags ===== */

.hashtag-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 1.5rem 0;
}

.hashtag-header {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
}

.hashtag-link {
    color: #6c63ff;
    text-decoration: none;
    font-weight: 700;
}

.hashtag-link:hover {
    text-decoration: underline;
}

.hashtag-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
}

.hashtag-feed {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hashtag-pagination {
    text-align: center;
    margin-top: 1.5rem;
}

.hashtag-highlight {
    background: #e8e5ff;
    color: #6c63ff;
    padding: 0.1em 0.3em;
    border-radius: 4px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .hashtag-container {
        padding: 1rem 0.5rem;
    }

    .hashtag-feed {
        gap: 0.5rem;
    }
}

/* Admin Styles */
.admin-dashboard, .admin-users, .admin-moderation {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-card {
    background: var(--color-surface);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #4a90d9;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-top: 0.25rem;
}

.admin-nav {
    display: flex;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
}

.admin-table th {
    background: var(--color-surface-alt);
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    border-bottom: 2px solid #e9ecef;
}

.admin-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9rem;
}

.admin-table tr.blocked-row {
    background: #fff5f5;
}

.admin-table .action-cell {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
    border: 1px solid;
    cursor: pointer;
}

.btn-admin {
    background: #4a90d9;
    color: white;
    border-color: #4a90d9;
}

.btn-admin:hover {
    background: #357abd;
}

.btn-blockuser {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.btn-blockuser:hover {
    background: #c82333;
}

.btn-unblock {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.btn-unblock:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.badge-admin {
    background: #4a90d9;
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.badge-type {
    background: #e9ecef;
    color: #495057;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: monospace;
}

.badge-status {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-status.queued {
    background: #fff3cd;
    color: #856404;
}

.badge-status.failed {
    background: #f8d7da;
    color: #721c24;
}

.badge-status.processing {
    background: #d1ecf1;
    color: #0c5460;
}

.no-data {
    color: #868e96;
    font-style: italic;
    margin: 1rem 0;
}

.back-link {
    margin-bottom: 0.75rem;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid #f5c6cb;
}

.blocked-domains {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.blocked-domains li {
    background: #f8d7da;
    color: #721c24;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-table {
        font-size: 0.8rem;
    }

    .admin-table th, .admin-table td {
        padding: 0.5rem;
    }

    .admin-table .action-cell {
        flex-direction: column;
    }
}

/* Notification Badge */
.notification-badge {
    display: inline;
    background: #e74c3c;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    margin-left: 0.25rem;
    vertical-align: middle;
    min-width: 1.2rem;
    text-align: center;
}

.poll-widget {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px;
    margin: 8px 0;
    background: var(--color-surface-alt);
}

.poll-question {
    font-weight: 600;
    margin-bottom: 8px;
}

.poll-option {
    margin: 4px 0;
    position: relative;
}

.poll-bar {
    background: #e9ecef;
    border-radius: 4px;
    padding: 4px 8px;
    min-height: 20px;
    display: flex;
    align-items: center;
}

.poll-votes {
    font-size: 0.8rem;
    color: #6c757d;
    margin-left: 8px;
}

.poll-timer {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 8px;
}

/* ===== Communities ===== */

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

.page-header h1,
.page-header h2 {
    color: var(--color-text);
    margin: 0;
    font-size: var(--font-lg);
}

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

.card {
    background: var(--color-surface);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border-light);
}

.card-title {
    font-weight: 600;
    color: #6c63ff;
    text-decoration: none;
}

.card-title:hover {
    text-decoration: underline;
}

.card-body {
    padding: 1rem 1.25rem;
}

.card-summary {
    color: var(--color-text);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.card-meta {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-owner {
    background: #6c63ff;
    color: white;
}

.badge-member {
    background: #27ae60;
    color: white;
}

.search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
}

.action-buttons {
    margin: 1.5rem 0;
    display: flex;
    gap: 0.5rem;
}

.member-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.member-item {
    background: var(--color-surface);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.member-item a {
    color: #6c63ff;
    text-decoration: none;
    font-weight: 500;
}

.member-item a:hover {
    text-decoration: underline;
}

.char-counter {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.char-ok { color: var(--color-text-muted); }
.char-near { color: #e6a23c; }
.char-over { color: #e74c3c; font-weight: 600; }

.load-more-container {
    text-align: center;
    padding: 1rem 0 2rem;
}

.note-timestamp {
    cursor: default;
}

.nav-search-form {
    margin-left: 0.5rem;
}

.nav-search-input {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    padding: 0.35rem 0.6rem;
    color: #fff;
    font-size: 0.85rem;
    width: 160px;
    transition: width 0.2s, background 0.2s;
}

.nav-search-input::placeholder {
    color: rgba(255,255,255,0.5);
}

.nav-search-input:focus {
    outline: none;
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.4);
    width: 220px;
}

@media (max-width: 768px) {
    .nav-search-input {
        width: 100px;
    }
    .nav-search-input:focus {
        width: 140px;
    }
}

.notifications-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.notification-group {
    margin-bottom: 1.5rem;
}

.notification-group-header {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--color-border);
}

.notification-group-count {
    background: #e0e0e0;
    border-radius: 10px;
    padding: 0.1rem 0.5rem;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

.search-loading {
    padding: 0.5rem 0;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.search-section-header {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
    margin: 1rem 0 0.5rem;
}

.search-hashtag-card {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    margin: 0.25rem;
    text-decoration: none;
    color: var(--color-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-hashtag-card:hover {
    border-color: #6c63ff;
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.15);
}

.search-hashtag-tag {
    font-weight: 600;
    color: #6c63ff;
}

.search-hashtag-count {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
    max-width: 360px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #1a1a2e;
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: auto;
    cursor: pointer;
}

.toast-visible {
    opacity: 1;
    transform: translateY(0);
}

.toast-hidden {
    opacity: 0;
    transform: translateY(10px);
}

.toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.toast-success { border-left: 3px solid #22c55e; }
.toast-error { border-left: 3px solid #ef4444; }
.toast-warning { border-left: 3px solid #f59e0b; }
.toast-info { border-left: 3px solid #6c63ff; }

@media (max-width: 480px) {
    .toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        max-width: none;
    }
}

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

.btn-more {
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1rem;
    color: var(--color-text-muted);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    line-height: 1;
}

.btn-more:hover {
    background: rgba(0,0,0,0.05);
    color: var(--color-text);
}

.note-more-dropdown {
    display: none;
    position: absolute;
    right: 0;
    bottom: 100%;
    margin-bottom: 4px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    min-width: 160px;
    z-index: 100;
    overflow: hidden;
}

.note-more-dropdown.open {
    display: block;
}

.note-more-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: var(--color-text);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
}

.note-more-item:hover {
    background: var(--color-surface-alt);
}

.note-more-item.note-more-danger {
    color: #c0392b;
}

.note-more-item.note-more-danger:hover {
    background: #fdf0f0;
}

.note-more-item + .note-more-item {
    border-top: 1px solid #f0f0f0;
}

.compose-preview {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.5;
    max-height: 200px;
    overflow-y: auto;
    word-break: break-word;
}

.compose-preview a {
    color: #6c63ff;
    word-break: break-all;
}

.compose-preview .preview-hashtag {
    color: #6c63ff;
    font-weight: 500;
}

.compose-preview .preview-mention {
    color: #6c63ff;
    font-weight: 500;
}

.cw-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.cw-label {
    color: #856404;
    font-weight: 500;
}

.cw-toggle-btn {
    background: none;
    border: 1px solid #856404;
    color: #856404;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
}

.cw-toggle-btn:hover {
    background: #856404;
    color: #fff;
}

.note-content-blurred {
    filter: blur(8px);
    user-select: none;
    transition: filter 0.3s;
}

.note-attachment-blurred img {
    filter: blur(20px);
    transition: filter 0.3s;
}

.note-card.cw-hidden [data-cw-content] {
    filter: blur(10px);
    user-select: none;
}

.note-card:not(.cw-hidden) [data-cw-content] {
    filter: none;
    user-select: auto;
}

.image-preview-container {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.image-preview {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--color-border);
}

.image-remove-btn {
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
}

.image-remove-btn:hover {
    background: #dc2626;
}

.poll-preview {
    padding: 1rem;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.poll-preview-question {
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.poll-preview-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.poll-option-bar {
    flex: 1;
    height: 24px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.poll-option-fill {
    width: 0%;
    height: 100%;
    background: #6c63ff;
    border-radius: 4px;
    transition: width 0.3s;
}

.poll-option-label {
    min-width: 80px;
    font-size: 0.85rem;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.poll-preview-meta {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin-top: 0.5rem;
}

.preview-multiselect {
    font-style: italic;
}

.skeleton {
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 6px;
}

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

.skeleton-note-card {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border-light);
}

.skeleton-line {
    height: 14px;
    margin-bottom: 0.5rem;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.long { width: 100%; }

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-image {
    width: 100%;
    height: 180px;
    margin-top: 0.5rem;
}

.timeline-loading {
    display: none;
}

.timeline-loading.active {
    display: block;
}

.reply-context-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.reply-context-icon {
    color: #6c63ff;
    flex-shrink: 0;
    margin-top: 1px;
}

.reply-context-text {
    color: #3730a3;
    white-space: nowrap;
}

.reply-context-snippet {
    color: #6b7280;
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

@media (max-width: 480px) {
    .reply-context-snippet {
        display: none;
    }
}

/* ===== Dark mode overrides ===== */

:root[data-theme="dark"] {
    color-scheme: dark;
}

:root[data-theme="dark"] body {
    background-color: var(--color-bg);
    color: var(--color-text);
}

/* Navbar */
:root[data-theme="dark"] .navbar {
    background: var(--dark-nav);
}

:root[data-theme="dark"] .brand {
    color: var(--dark-accent);
}

:root[data-theme="dark"] .nav-link,
:root[data-theme="dark"] .nav-group-toggle,
:root[data-theme="dark"] .nav-dropdown-link {
    color: var(--dark-text-secondary);
}

:root[data-theme="dark"] .nav-link:hover,
:root[data-theme="dark"] .nav-group.open .nav-group-toggle,
:root[data-theme="dark"] .nav-dropdown-link:hover,
:root[data-theme="dark"] .nav-dropdown-link:focus {
    background-color: var(--dark-nav-hover);
    color: var(--color-on-dark);
}

:root[data-theme="dark"] .nav-link.active,
:root[data-theme="dark"] .nav-dropdown-link.active {
    background-color: var(--color-accent);
    color: var(--color-on-dark);
}

:root[data-theme="dark"] .nav-hamburger {
    background: transparent;
}

:root[data-theme="dark"] .nav-hamburger:hover {
    background-color: rgba(255, 255, 255, 0.12);
}

:root[data-theme="dark"] .hamburger-bar {
    background: var(--dark-text);
}

:root[data-theme="dark"] .nav-search-input {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--dark-text);
}

:root[data-theme="dark"] .nav-search-input::placeholder {
    color: var(--dark-text-muted);
}

:root[data-theme="dark"] .nav-dropdown {
    background: var(--dark-surface);
    border-color: var(--dark-border);
}

/* Buttons */
:root[data-theme="dark"] .btn {
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

:root[data-theme="dark"] .btn-secondary {
    border-color: var(--dark-border);
}

/* Forms */
:root[data-theme="dark"] .form-control {
    background-color: var(--dark-surface-alt);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

:root[data-theme="dark"] .form-control::placeholder {
    color: var(--dark-text-muted);
}

:root[data-theme="dark"] .form-control:focus {
    box-shadow: 0 0 0 3px rgba(139, 132, 255, 0.25);
}

:root[data-theme="dark"] input[type="checkbox"],
:root[data-theme="dark"] input[type="radio"] {
    accent-color: var(--color-accent);
}

/* Generic light surfaces used by cards, panels, lists, headers */
:root[data-theme="dark"] .note-card,
:root[data-theme="dark"] .note-body,
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .auth-form,
:root[data-theme="dark"] .profile-card,
:root[data-theme="dark"] .poll-card,
:root[data-theme="dark"] .community-card,
:root[data-theme="dark"] .suggestion-card,
:root[data-theme="dark"] .trend-card,
:root[data-theme="dark"] .report-card,
:root[data-theme="dark"] .notification-item,
:root[data-theme="dark"] .admin-card,
:root[data-theme="dark"] .settings-card,
:root[data-theme="dark"] .compose-box,
:root[data-theme="dark"] .compose-footer,
:root[data-theme="dark"] .timeline-header,
:root[data-theme="dark"] .list-group-item,
:root[data-theme="dark"] .table,
:root[data-theme="dark"] .table thead th,
:root[data-theme="dark"] .table tbody tr,
:root[data-theme="dark"] .page-header,
:root[data-theme="dark"] .filter-tabs,
:root[data-theme="dark"] .filter-tab,
:root[data-theme="dark"] .reply-context {
    background-color: var(--dark-surface);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

:root[data-theme="dark"] .note-card:hover,
:root[data-theme="dark"] .card:hover,
:root[data-theme="dark"] .list-group-item:hover,
:root[data-theme="dark"] .suggestion-card:hover {
    background-color: var(--dark-surface-hover);
}

:root[data-theme="dark"] .table {
    background-color: transparent;
}

:root[data-theme="dark"] .table thead th {
    background-color: var(--dark-surface-alt);
    border-color: var(--dark-border);
    color: var(--dark-text-secondary);
}

:root[data-theme="dark"] .table tbody tr {
    border-color: var(--dark-border-light);
}

/* Text hierarchy */
:root[data-theme="dark"] h1,
:root[data-theme="dark"] h2,
:root[data-theme="dark"] h3,
:root[data-theme="dark"] h4 {
    color: var(--dark-text);
}

:root[data-theme="dark"] .text-secondary,
:root[data-theme="dark"] .note-meta,
:root[data-theme="dark"] .note-time,
:root[data-theme="dark"] .profile-handle,
:root[data-theme="dark"] .muted {
    color: var(--dark-text-secondary);
}

:root[data-theme="dark"] .text-muted {
    color: var(--dark-text-muted);
}

/* Semantic soft backgrounds */
:root[data-theme="dark"] .alert-danger,
:root[data-theme="dark"] .badge-danger {
    background-color: var(--dark-danger-soft);
    color: #f3b8b8;
    border-color: #6e3440;
}

:root[data-theme="dark"] .alert-success,
:root[data-theme="dark"] .badge-success {
    background-color: var(--dark-success-soft);
    color: #b8f3c8;
    border-color: #2f6e42;
}

:root[data-theme="dark"] .alert-warning {
    background-color: #3a2f16;
    color: #f3dcb8;
    border-color: #6e5a2f;
}

:root[data-theme="dark"] .alert-info {
    background-color: #16283a;
    color: #b8d8f3;
    border-color: #2f4d6e;
}

/* Links & interactive text (buttons keep their own text color) */
:root[data-theme="dark"] a {
    color: var(--dark-accent);
}

:root[data-theme="dark"] .btn-primary {
    color: var(--color-on-dark);
}

:root[data-theme="dark"] .btn-secondary {
    color: var(--dark-text);
}

:root[data-theme="dark"] .btn-secondary:hover {
    color: var(--dark-bg);
}

:root[data-theme="dark"] .btn-danger {
    color: var(--color-on-dark);
}

:root[data-theme="dark"] .note-content a,
:root[data-theme="dark"] .hashtag a,
:root[data-theme="dark"] .mention a {
    color: var(--dark-accent);
}

/* Interaction buttons (like/boost/reply) */
:root[data-theme="dark"] .btn-action {
    color: var(--dark-text-secondary);
}

:root[data-theme="dark"] .btn-action:hover {
    color: var(--dark-text);
    background-color: var(--dark-surface-hover);
}

:root[data-theme="dark"] .btn-like.active,
:root[data-theme="dark"] .btn-boost.active {
    background-color: var(--dark-accent-soft);
    color: var(--dark-accent);
}

:root[data-theme="dark"] .btn-delete,
:root[data-theme="dark"] .btn-delete:hover {
    background-color: var(--dark-danger-soft);
    color: #f3b8b8;
}

/* Avatars keep their generated gradient; lift the ring */
:root[data-theme="dark"] .avatar,
:root[data-theme="dark"] .note-avatar,
:root[data-theme="dark"] .profile-avatar {
    border-color: var(--dark-border);
}

/* Toasts */
:root[data-theme="dark"] .toast {
    background: var(--dark-surface);
    color: var(--dark-text);
    border: 1px solid var(--dark-border);
}

/* Footer */
:root[data-theme="dark"] footer,
:root[data-theme="dark"] .footer-container {
    background-color: var(--dark-nav);
}

:root[data-theme="dark"] footer p,
:root[data-theme="dark"] .footer-container p {
    color: var(--dark-text-muted);
}

/* Code blocks */
:root[data-theme="dark"] code,
:root[data-theme="dark"] pre {
    background-color: var(--dark-surface-alt);
    color: var(--dark-text);
}

/* Theme toggle */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: var(--color-on-dark);
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
    background-color: var(--dark-nav-hover);
    border-color: var(--color-accent);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ===== Utility classes ===== */

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }

.text-muted { color: var(--color-text-muted); }
.text-danger { color: var(--color-danger); }
.text-error { color: var(--color-danger); font-size: var(--font-sm); }

.form-label {
    display: block;
    font-weight: 600;
    font-size: var(--font-sm);
    margin-bottom: 0.35rem;
    color: var(--color-text);
}

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

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.form-check-input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--color-accent);
    cursor: pointer;
}

.form-check-label {
    font-size: var(--font-sm);
    cursor: pointer;
    user-select: none;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.input-group .form-control {
    flex: 1;
}

.list-group {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.list-group-item {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.8rem;
    font-size: var(--font-sm);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--color-surface);
    border-radius: var(--card-radius);
    overflow: hidden;
    font-size: var(--font-sm);
}

.table th,
.table td {
    padding: 0.6rem 0.8rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
}

.table thead th {
    background-color: var(--color-surface-alt);
    color: var(--color-text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: var(--font-xs);
    letter-spacing: 0.03em;
}

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

/* ===== Responsive helpers ===== */

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0 -0.5rem;
}

.col {
    flex: 1 1 0;
    padding: 0 0.5rem;
}

@media (max-width: 640px) {
    .row {
        flex-direction: column;
        gap: 0.75rem;
        margin: 0;
    }

    .col {
        padding: 0;
    }
}

/* ===== Profile stat pills ===== */

.stat {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--font-sm);
    color: var(--color-text-secondary);
    background-color: var(--color-surface-alt);
    border: 1px solid var(--color-border-light);
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
}

.stat strong {
    color: var(--color-text);
    font-weight: 600;
}

/* ===== Suggestions list ===== */

.display-name {
    color: var(--color-text);
    font-weight: 600;
    text-decoration: none;
    font-size: var(--font-base);
}

.display-name:hover {
    color: var(--color-accent);
}

.username {
    color: var(--color-text-muted);
    font-size: var(--font-sm);
}

.bio {
    color: var(--color-text-secondary);
    font-size: var(--font-sm);
    margin-top: 0.2rem;
}

.avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

/* ===== Dark mode: utility + form/table classes ===== */

:root[data-theme="dark"] .form-label {
    color: var(--dark-text);
}

:root[data-theme="dark"] .form-hint {
    color: var(--dark-text-muted);
}

:root[data-theme="dark"] .form-check-label {
    color: var(--dark-text);
}

:root[data-theme="dark"] .list-group-item {
    background-color: var(--dark-surface);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

:root[data-theme="dark"] .stat {
    background-color: var(--dark-surface-alt);
    border-color: var(--dark-border-light);
    color: var(--dark-text-secondary);
}

:root[data-theme="dark"] .stat strong {
    color: var(--dark-text);
}

:root[data-theme="dark"] .display-name {
    color: var(--dark-text);
}

:root[data-theme="dark"] .display-name:hover {
    color: var(--dark-accent);
}

:root[data-theme="dark"] .username,
:root[data-theme="dark"] .bio {
    color: var(--dark-text-secondary);
}

:root[data-theme="dark"] .text-muted {
    color: var(--dark-text-muted);
}

:root[data-theme="dark"] .text-danger,
:root[data-theme="dark"] .text-error {
    color: #f38b8b;
}
