:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-soft: #f1f5f9;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --primary: #059669;
    --primary-dark: #047857;
    --teal: #14b8a6;
    --amber: #d97706;
    --danger: #dc2626;
    --shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    --sidebar: #111827;
    --sidebar-soft: #1f2937;
    --sidebar-text: #e5e7eb;
    --sidebar-muted: #9ca3af;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Calibri Light", Calibri, "Segoe UI Light", "Segoe UI", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

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

a:hover {
    color: var(--primary-dark);
}

button,
input,
textarea,
select {
    font: inherit;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    outline: none;
    padding: 11px 12px;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.14);
}

.upload-help {
    color: #0f2a4a;
    display: block;
    font-size: 8px;
    line-height: 1.35;
    margin-top: 4px;
}

input.is-invalid-upload {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.layout {
    --sidebar-column: 248px;
    display: grid;
    grid-template-columns: var(--sidebar-column) minmax(0, 680px) 312px;
    gap: 20px;
    max-width: 1320px;
    margin: 0 auto;
    padding: 20px;
    transition: max-width 0.18s ease;
}

.left-sidebar,
.right-sidebar {
    position: sticky;
    top: 18px;
    align-self: start;
}

.left-sidebar,
.side-panel,
.composer-card,
.post-card,
.profile-hero,
.settings-subpanel,
.settings-panel,
.text-panel,
.auth-panel,
.admin-stats > div,
.report-row,
.empty-state,
.notification-row,
.user-row {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.left-sidebar {
    min-height: calc(100vh - 36px);
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--sidebar);
    border: 0;
    color: var(--sidebar-text);
    overflow: hidden;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 21px;
    font-weight: 800;
}

.left-sidebar .brand {
    color: #fff;
}

.sidebar-topbar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 66px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-topbar .brand {
    min-width: 0;
    flex: 1;
}

.language-switcher {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 12px 16px 8px;
}

.language-switcher a {
    min-height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--sidebar-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 7px;
}

.language-switcher a:hover,
.language-switcher a.is-active {
    background: #fff;
    color: var(--sidebar);
}

.language-switcher img {
    width: 24px;
    height: 16px;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.16);
    display: block;
    object-fit: cover;
}

.language-switcher small {
    font-size: 11px;
    font-weight: 800;
}

.auth-panel .language-switcher {
    max-width: 260px;
    margin: -6px auto 18px;
    padding: 0;
}

.auth-panel .language-switcher a {
    border-color: var(--line);
    background: #f8fafc;
    color: var(--text);
}

.auth-panel .language-switcher a:hover,
.auth-panel .language-switcher a.is-active {
    border-color: rgba(5, 150, 105, 0.28);
    background: #ecfdf5;
    color: var(--primary-dark);
}

.top-logout-form {
    margin: 0;
}

.brand-mark {
    display: inline-grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
}

.brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
}

.auth-logo {
    width: min(260px, 100%);
    max-height: 150px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.primary-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 8px;
}

.mobile-nav-toggle {
    display: none;
}

.sidebar-collapse-toggle {
    width: 34px;
    min-width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    display: inline-grid;
    font-size: 25px;
    line-height: 1;
    place-items: center;
}

.sidebar-collapse-toggle:hover {
    background: #fff;
    color: var(--sidebar);
}

.sidebar-collapse-toggle span {
    transform: translateY(-1px);
}

.nav-title {
    color: var(--sidebar-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 8px 10px;
    text-transform: uppercase;
}

.nav-item {
    display: block;
    min-width: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    border-radius: 8px;
    min-height: 38px;
    padding: 8px 10px;
    font-weight: 650;
    line-height: 1.18;
    min-width: 0;
}

.nav-logout-form {
    margin: 0;
    width: 100%;
}

.nav-action {
    appearance: none;
    justify-content: flex-start;
    width: 100%;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.left-sidebar .nav-link {
    color: var(--sidebar-text);
}

.nav-link:hover,
.nav-link.active {
    background: var(--surface-soft);
    color: var(--primary-dark);
}

.left-sidebar .nav-link:hover,
.left-sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--sidebar-muted);
    display: inline-grid;
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 900;
    place-items: center;
}

.nav-icon-image {
    width: 22px;
    height: 22px;
    display: block;
    object-fit: contain;
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
    background: rgba(255, 255, 255, 0.16);
    color: var(--primary-dark);
}

.nav-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-badge {
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    display: inline-grid;
    place-items: center;
    font-size: 12px;
}

.sidebar-account {
    display: block;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px;
}

.sidebar-account summary {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    border-radius: 8px;
    cursor: pointer;
    list-style: none;
    padding: 6px;
}

.sidebar-account summary::-webkit-details-marker {
    display: none;
}

.sidebar-account summary:hover,
.sidebar-account[open] summary {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-account summary span {
    display: grid;
    min-width: 0;
}

.sidebar-account summary small,
.sidebar-account summary strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-account summary i {
    color: var(--sidebar-muted);
    font-style: normal;
}

.sidebar-account-dropdown {
    display: grid;
    gap: 4px;
    padding: 6px;
}

.sidebar-account-dropdown a,
.sidebar-account-dropdown button {
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--sidebar-text);
    cursor: pointer;
    display: block;
    font: inherit;
    font-weight: 700;
    padding: 8px 10px;
    text-align: left;
}

.sidebar-account-dropdown a:hover,
.sidebar-account-dropdown button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-footer {
    margin-top: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--sidebar-muted);
    font-size: 12px;
    line-height: 1.35;
    padding: 12px 16px;
}

.sidebar-account strong {
    color: #fff;
}

.sidebar-account span,
.muted,
.post-header span,
.post-header time,
.profile-main > p,
.profile-meta,
.side-panel small,
.auth-copy,
.auth-switch,
.notification-row time,
.user-row small {
    color: var(--muted);
}

.left-sidebar .sidebar-account span {
    color: var(--sidebar-muted);
}

.button {
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 14px;
    font-weight: 700;
    white-space: nowrap;
}

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

.button-soft {
    background: #ecfdf5;
    color: var(--primary-dark);
}

.button-soft:hover {
    background: #d1fae5;
    color: var(--primary-dark);
}

.left-sidebar .button-soft {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.left-sidebar .button-soft:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

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

.button-small {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 14px;
}

.button-full {
    width: 100%;
}

.left-sidebar > .button-full {
    margin-top: auto;
}

@media (min-width: 1121px) {
    .layout.sidebar-collapsed {
        --sidebar-column: 76px;
        max-width: 1148px;
    }

    .layout.sidebar-collapsed .sidebar-topbar {
        flex-direction: column;
        justify-content: center;
        min-height: 96px;
        padding: 14px 8px;
    }

    .layout.sidebar-collapsed .sidebar-topbar .brand {
        flex: 0 0 auto;
        justify-content: center;
    }

    .layout.sidebar-collapsed .brand-logo {
        width: 40px;
        height: 40px;
    }

    .layout.sidebar-collapsed .d-sidebar-narrow-none,
    .layout.sidebar-collapsed .nav-title,
    .layout.sidebar-collapsed .nav-label,
    .layout.sidebar-collapsed .sidebar-account summary span,
    .layout.sidebar-collapsed .sidebar-account summary i,
    .layout.sidebar-collapsed .sidebar-account-dropdown,
    .layout.sidebar-collapsed .sidebar-footer,
    .layout.sidebar-collapsed .left-sidebar > .button-full {
        display: none;
    }

    .layout.sidebar-collapsed .primary-nav {
        align-items: center;
        padding: 12px 8px;
    }

    .layout.sidebar-collapsed .nav-item {
        width: 100%;
    }

    .layout.sidebar-collapsed .nav-link {
        justify-content: center;
        gap: 0;
        min-height: 44px;
        padding: 7px;
        position: relative;
    }

    .layout.sidebar-collapsed .nav-icon {
        width: 30px;
        height: 30px;
    }

    .layout.sidebar-collapsed .nav-icon-image {
        width: 24px;
        height: 24px;
    }

    .layout.sidebar-collapsed .nav-badge {
        position: absolute;
        top: 3px;
        right: 3px;
        min-width: 18px;
        height: 18px;
        margin-left: 0;
        padding: 0 4px;
        font-size: 10px;
    }

    .layout.sidebar-collapsed .sidebar-account {
        padding: 10px 8px;
    }

    .layout.sidebar-collapsed .sidebar-account summary {
        grid-template-columns: 40px;
        justify-content: center;
        padding: 6px 4px;
    }
}

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

.page-header > div {
    flex: 1 1 auto;
    min-width: 0;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 4px 0 14px;
}

.page-header h1,
.auth-panel h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
}

.page-header p,
.auth-copy {
    margin: 6px 0 0;
}

.feed-title-row,
.page-title-row,
.section-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.feed-title-row,
.page-title-row {
    justify-content: space-between;
    width: 100%;
}

.feed-title-row,
.page-title-row {
    display: grid;
    grid-template-columns: minmax(180px, auto) minmax(0, 1fr);
}

.feed-title-row,
.page-title-row {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    width: 100%;
}

.page-title-main {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
    text-align: right;
}

.feed-title-row .page-title-main,
.page-title-row .page-title-main {
    flex: 1 1 auto;
    justify-content: flex-start;
    text-align: left;
}

.feed-title-row .sort-form-title,
.page-title-row .sort-form-title {
    flex: 0 0 auto;
    justify-self: auto;
    margin-left: auto;
}

.section-title-row {
    justify-content: space-between;
    margin-bottom: 10px;
}

.section-title-row h2 {
    margin-bottom: 0;
}

.feed-toggle {
    display: inline-flex;
    gap: 6px;
}

.feed-toggle a {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f3f4f6;
    color: #111827;
    padding: 7px 14px;
    font-weight: 750;
}

.feed-toggle a.is-active {
    border-color: #9ca3af;
    background: #e5e7eb;
}

.sort-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.sort-form-title {
    justify-self: start;
    margin-left: 0;
}

.sort-form-title select {
    max-width: clamp(112px, 22vw, 220px);
}

@media (max-width: 640px) {
    .sort-form.sort-form-title,
    .sort-form.sort-form-title label {
        gap: 4px;
    }

    .page-title-main {
        justify-content: flex-start;
        text-align: left;
    }

    .feed-title-row .sort-form-title,
    .page-title-row .sort-form-title,
    .feed-title-row .sort-form-title label,
    .page-title-row .sort-form-title label {
        width: auto;
    }

    .sort-form.sort-form-title select {
        max-width: 116px;
        padding-right: 28px;
    }
}

.sort-form label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.sort-form label span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.sort-form select {
    width: auto;
    max-width: min(58vw, 310px);
    min-height: 38px;
    padding: 8px 36px 8px 10px;
}

.flash {
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    background: #fff;
}

.flash-success {
    border-color: rgba(15, 159, 143, 0.35);
    background: #ecfdf9;
    color: #0f766e;
}

.flash-error {
    border-color: rgba(220, 38, 38, 0.35);
    background: #fff1f2;
    color: #b91c1c;
}

.flash-warning {
    border-color: rgba(183, 121, 31, 0.35);
    background: #fff8e6;
    color: #92400e;
}

.flash-info {
    border-color: rgba(20, 184, 166, 0.35);
    background: #f0fdfa;
    color: #0f766e;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.36);
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-panel {
    width: min(520px, 100%);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 18px;
}

.modal-panel h2,
.modal-panel p {
    margin: 0;
}

.modal-panel p {
    color: var(--muted);
    margin-top: 8px;
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

.composer-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    margin-bottom: 14px;
}

.composer-edit {
    display: block;
}

.composer-card textarea {
    min-height: 116px;
    border: 0;
    background: #f8fafc;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.editor-top-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.editor-top-row .editor-toolbar {
    margin-bottom: 8px;
}

.editor-toolbar button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    display: inline-grid;
    place-items: center;
}

.editor-toolbar .editor-title-button {
    width: auto;
    min-width: 66px;
    padding: 0 10px;
    font-weight: 800;
}

.editor-toolbar button:hover {
    border-color: rgba(5, 150, 105, 0.35);
    background: #f0fdfa;
}

.marker-swatch {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(15, 23, 42, 0.14);
}

.marker-yellow,
.mark-yellow {
    background: #fef08a;
}

.marker-green,
.mark-green {
    background: #39ff14;
}

.post-text mark,
.message-bubble mark,
.repost-reference mark,
.approval-card mark {
    border-radius: 3px;
    padding: 0 2px;
}

.composer-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.composer-footer select {
    width: 150px;
}

.composer-file-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 12px;
    align-items: center;
    margin-top: 8px;
}

.composer-file-row .word-counter {
    justify-self: end;
    margin-right: 0;
}

.composer-file-row input {
    grid-column: 1 / -1;
}

.word-counter {
    margin-right: auto;
    color: var(--muted);
    font-size: 14px;
}

.word-counter.is-over {
    color: var(--danger);
    font-weight: 700;
}

.feed-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.post-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
}

.post-focus {
    border-color: rgba(5, 150, 105, 0.32);
    box-shadow: var(--shadow);
}

.post-card-community {
    border-color: rgba(14, 116, 144, 0.24);
    background: linear-gradient(180deg, #f8feff 0%, #fff 42%);
}

.post-avatar {
    color: inherit;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    background: #dff7f4;
    color: #0f766e;
    font-weight: 800;
}

.avatar-small {
    width: 40px;
    height: 40px;
}

.avatar-tiny {
    width: 32px;
    height: 32px;
    font-size: 13px;
}

.avatar-profile {
    width: 96px;
    height: 96px;
    font-size: 32px;
    border: 4px solid #fff;
}

.media-frame {
    overflow: hidden;
    position: relative;
}

.media-frame img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: var(--media-x, 50%) var(--media-y, 50%);
    transform: scale(var(--media-zoom, 1));
    transform-origin: var(--media-x, 50%) var(--media-y, 50%);
}

.cover-frame img {
    border-radius: 0;
}

.post-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.post-meta-line {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    text-align: right;
}

.post-meta-line span,
.post-meta-line time {
    color: inherit;
    font-size: inherit;
    white-space: nowrap;
}

.post-header a {
    min-width: 0;
    color: var(--text);
}

.post-header strong,
.post-header span {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.post-header .post-meta-line {
    display: inline-flex;
}

.post-header .post-meta-line span {
    display: inline;
}

.post-text {
    margin: 8px 0;
    overflow-wrap: anywhere;
    white-space: normal;
}

.post-text p,
.post-text-content,
.post-text-full p {
    margin: 0;
}

.post-title-heading {
    margin: 0 0 6px;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 850;
    color: var(--text);
}

.post-title-heading + br {
    display: none;
}

.post-text-full:not([hidden]) {
    display: block;
}

.post-text-preview-clamped {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.read-more-button {
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--primary-dark);
    cursor: pointer;
    display: inline-flex;
    margin-top: 6px;
    padding: 4px 0;
    font-weight: 750;
}

.read-more-button:hover {
    color: var(--primary);
    text-decoration: underline;
}

.read-more-button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.post-context {
    display: inline-flex;
    width: max-content;
    border-radius: 999px;
    background: #fffbeb;
    color: var(--amber);
    padding: 2px 8px;
    font-size: 13px;
    font-weight: 700;
}

.community-post-banner {
    display: inline-grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    max-width: 100%;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    background: #f0f9ff;
    color: var(--text);
    padding: 7px 9px;
    margin-bottom: 8px;
}

.community-post-banner span {
    display: grid;
    min-width: 0;
}

.community-post-banner small {
    color: #0369a1;
    font-weight: 750;
}

.community-post-banner strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-images {
    display: grid;
    gap: 8px;
    margin: 10px 0;
}

.post-images img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.post-image-pending {
    width: max-content;
    max-width: 100%;
    border-radius: 8px;
    background: #f3f4f6;
    color: #4b5563;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 700;
}

.repost-reference {
    border-left: 3px solid var(--teal);
    padding-left: 12px;
    margin: 10px 0;
}

.repost-reference span {
    color: var(--muted);
    font-size: 14px;
}

.repost-reference p {
    margin: 4px 0 0;
}

.post-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

.post-actions form {
    margin: 0;
}

.action-button {
    border: 0;
    background: transparent;
    color: var(--muted);
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 32px;
    padding: 5px 8px;
    font-weight: 650;
}

.action-icon {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    display: block;
    object-fit: contain;
}

.action-count {
    min-width: 1ch;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.action-button:hover,
.action-button.is-active {
    background: var(--surface-soft);
    color: var(--primary-dark);
}

.action-button.is-active .action-icon {
    opacity: 1;
}

.action-button:not(.is-active) .action-icon {
    opacity: 0.78;
}

.action-button.danger:hover {
    background: #fff1f2;
    color: var(--danger);
}

.right-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.right-sidebar .language-switcher {
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.right-sidebar .language-switcher a {
    min-height: 30px;
    border-color: var(--line);
    background: #f8fafc;
    color: var(--text);
    padding: 4px 7px;
}

.right-sidebar .language-switcher a:hover,
.right-sidebar .language-switcher a.is-active {
    border-color: rgba(5, 150, 105, 0.28);
    background: #ecfdf5;
    color: var(--primary-dark);
}

.search-box {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
}

.search-box button {
    border: 0;
    border-radius: 8px;
    background: #ecfdf5;
    color: var(--primary-dark);
    cursor: pointer;
    font-weight: 700;
    padding: 0 10px;
}

.side-panel {
    padding: 14px;
}

.side-panel h2,
.result-section h2,
.settings-panel h2,
.text-panel h2 {
    margin: 0 0 10px;
    font-size: 18px;
}

.adsense-panel {
    min-height: 294px;
    overflow: hidden;
}

.ad-label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.adsense-slot,
.words-adsense-unit {
    display: block;
    width: 100%;
    min-height: 250px;
}

.trend,
.suggestion-row,
.user-row,
.notification-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.trend {
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.trend:first-of-type {
    border-top: 0;
}

.trend span {
    color: var(--text);
    font-weight: 750;
}

.suggestion-row {
    padding: 10px 0;
}

.suggestion-row a,
.user-row-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    min-width: 0;
    color: var(--text);
}

.suggestion-row span,
.user-row-main span {
    display: grid;
    min-width: 0;
}

.suggestion-row strong,
.suggestion-row small,
.user-row strong,
.user-row small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-hero {
    overflow: hidden;
    margin-bottom: 12px;
}

.profile-cover {
    height: 180px;
    background-color: #d1fae5;
    width: 100%;
}

.profile-info {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 0 16px 16px;
    margin-top: -44px;
}

.profile-main {
    min-width: 0;
    padding-top: 48px;
    flex: 1;
}

.profile-main h1 {
    margin: 0;
    font-size: 26px;
}

.profile-bio {
    color: var(--text);
    max-width: 58ch;
}

.profile-meta,
.profile-stats,
.profile-actions,
.settings-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.social-links a {
    display: inline-grid;
    gap: 1px;
    min-width: 108px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    padding: 8px 10px;
}

.social-links a:hover {
    border-color: rgba(5, 150, 105, 0.35);
    background: #f0fdfa;
}

.social-links strong {
    font-size: 13px;
}

.social-links span {
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

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

.profile-actions {
    padding-top: 52px;
}

.profile-tabs {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    margin-bottom: 12px;
}

.profile-tabs a {
    color: var(--muted);
    padding: 12px 14px;
    font-weight: 750;
    white-space: nowrap;
}

.profile-tabs a.is-active {
    color: var(--primary-dark);
    border-bottom: 3px solid var(--primary);
}

.wide-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-bottom: 14px;
}

.result-section {
    margin-bottom: 18px;
}

.community-section {
    margin-bottom: 18px;
}

.community-section h2 {
    margin: 0 0 10px;
    font-size: 18px;
}

.community-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.community-card,
.community-hero,
.community-admin-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.community-card-cover,
.community-cover {
    width: 100%;
    height: 82px;
    display: block;
    object-fit: cover;
    background: #d1fae5;
}

.community-card-body {
    padding: 10px;
}

.community-card h1,
.community-card p {
    margin: 0;
}

.community-card h1 {
    font-size: 15px;
    line-height: 1.25;
    font-weight: 850;
}

.community-card h1 a {
    color: var(--text);
}

.community-card p,
.community-card-description {
    color: var(--muted);
    margin-top: 4px;
    font-size: 14px;
}

.community-card-description {
    display: -webkit-box;
    min-height: 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.community-card small {
    color: var(--muted);
    display: block;
    margin-top: 3px;
}

.community-hero {
    margin-bottom: 14px;
}

.community-hero > img,
.community-hero > .community-cover {
    width: 100%;
    height: 190px;
    object-fit: cover;
    display: block;
}

.community-hero > div {
    padding: 16px;
}

.community-hero h1,
.community-hero p {
    margin: 0;
}

.community-hero p {
    color: var(--muted);
    margin-top: 6px;
}

.community-admin-panel {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.contest-admin-form {
    margin-bottom: 14px;
}

.settings-inline-invite {
    max-width: 420px;
}

.danger-zone {
    border-color: rgba(185, 28, 28, 0.22);
}

.contest-cover-placeholder {
    background:
        linear-gradient(135deg, rgba(5, 150, 105, 0.16), rgba(20, 184, 166, 0.2)),
        #f0fdfa;
}

.contest-detail-cover {
    width: 100%;
    height: 210px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    margin-bottom: 14px;
    background: #f0fdfa;
}

.contest-options-form {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    padding: 12px;
}

.contest-options-form h2,
.contest-options-form p {
    margin: 0;
}

.contest-option-row {
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(150px, 0.7fr);
    gap: 10px;
    padding-top: 10px;
}

.contest-list {
    display: grid;
    gap: 16px;
}

.contest-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 16px;
}

.contest-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.contest-header h1,
.contest-header h2,
.contest-header p,
.contest-competitors h3 {
    margin: 0;
}

.contest-header p {
    color: var(--muted);
    margin-top: 5px;
}

.contest-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.contest-meta span {
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 13px;
    padding: 4px 9px;
}

.contest-actions {
    display: grid;
    gap: 8px;
    justify-items: end;
    min-width: 170px;
}

.contest-actions form {
    margin: 0;
}

.contest-podium {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: 10px;
}

.podium-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    display: grid;
    gap: 5px;
    justify-items: center;
    min-height: 178px;
    padding: 12px;
    text-align: center;
}

.podium-card form {
    margin: 4px 0 0;
}

.podium-card > strong {
    border-radius: 999px;
    background: #e5e7eb;
    color: #111827;
    padding: 3px 9px;
}

.podium-card a {
    color: var(--text);
    font-weight: 800;
}

.podium-card span {
    color: var(--muted);
    font-size: 13px;
}

.podium-card .contest-voters {
    width: 100%;
    justify-items: center;
}

.podium-card .contest-voters div {
    justify-content: center;
}

.podium-place-1 {
    border-color: rgba(217, 119, 6, 0.45);
    background: #fffbeb;
    min-height: 212px;
    order: 2;
}

.podium-place-2 {
    order: 1;
}

.podium-place-3 {
    order: 3;
}

.podium-empty {
    color: var(--muted);
}

.contest-competitors {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.contest-competitor-row {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 10px;
    min-width: 0;
}

.contest-competitor-main {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.contest-competitor-main span:last-child {
    display: grid;
    min-width: 0;
}

.contest-competitor-main a {
    color: var(--text);
}

.contest-position {
    color: var(--muted);
    font-weight: 800;
    min-width: 34px;
}

.contest-score {
    display: grid;
    justify-items: start;
    min-width: 0;
}

.contest-vote-action {
    justify-self: start;
    min-width: 0;
}

.contest-vote-action form {
    margin: 0;
}

.contest-score strong {
    font-size: 20px;
}

.contest-score span,
.contest-voters span,
.contest-competitor-main small {
    color: var(--muted);
}

.contest-voters {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.contest-voters div {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
}

.contest-voters a {
    font-size: 13px;
    font-weight: 700;
}

.contest-vote-action form {
    margin: 0;
}

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

.pending-member-row form,
.inline-actions {
    margin: 0;
}

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

.tag-pill {
    border-radius: 999px;
    background: #ecfdf5;
    color: var(--primary-dark);
    padding: 7px 11px;
    font-weight: 700;
}

.empty-state,
.text-panel,
.settings-panel {
    padding: 18px;
}

.empty-state h2,
.empty-state p {
    margin: 0;
}

.empty-state p {
    margin-top: 6px;
    color: var(--muted);
}

.notification-list {
    display: grid;
    gap: 10px;
}

.approval-list {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.approval-list h2 {
    margin: 0;
    font-size: 18px;
}

.approval-card {
    background: var(--surface);
    border: 1px solid rgba(5, 150, 105, 0.3);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 14px;
}

.approval-card header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.approval-card header span {
    display: grid;
}

.approval-card small {
    color: var(--muted);
}

.approval-card p {
    margin: 12px 0;
    overflow-wrap: anywhere;
}

.approval-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.notification-row {
    color: var(--text);
    padding: 14px;
}

.notification-row.is-unread {
    border-color: rgba(5, 150, 105, 0.32);
    background: #f0fdfa;
}

.user-row {
    padding: 12px;
    margin-bottom: 8px;
}

.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}

.settings-subpanel {
    display: grid;
    gap: 12px;
    padding: 14px;
    background: #f8fafc;
}

.settings-subpanel h3 {
    margin: 0;
    font-size: 16px;
}

.media-editor {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #f8fafc;
}

.media-editor h3 {
    margin: 0 0 10px;
    font-size: 16px;
}

.media-preview {
    display: grid;
    place-items: center;
    position: relative;
    min-height: 110px;
}

.media-preview.is-draggable-media {
    cursor: grab;
    touch-action: none;
}

.media-preview.is-dragging {
    cursor: grabbing;
}

.media-preview.is-draggable-media .media-frame img {
    pointer-events: none;
    user-select: none;
}

.media-zoom-buttons {
    position: absolute;
    top: 50%;
    right: 8px;
    display: grid;
    gap: 6px;
    transform: translateY(-50%);
    z-index: 2;
}

.media-zoom-buttons button {
    width: 30px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 18px;
    font-weight: 850;
    line-height: 1;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

.media-zoom-buttons button:hover {
    border-color: rgba(5, 150, 105, 0.35);
    background: #ecfdf5;
}

.cover-preview {
    min-height: 92px;
}

.cover-preview .profile-cover,
.cover-preview .community-cover {
    height: 92px;
    border-radius: 8px;
    overflow: hidden;
}

.media-controls {
    display: grid;
    gap: 12px;
}

.messages-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    height: var(--messages-shell-height, clamp(560px, calc(100vh - 150px), 760px));
    min-height: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.conversations-panel {
    border-right: 1px solid var(--line);
    background: #f8fafc;
    min-height: 0;
    min-width: 0;
    overflow-y: auto;
}

.message-start-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
}

.conversation-list {
    display: grid;
}

.conversation-suggestions {
    display: grid;
    gap: 8px;
    border-top: 1px solid var(--line);
    padding: 12px;
}

.conversation-suggestions h2 {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.conversation-suggestion-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 9px;
}

.conversation-suggestion-card div {
    display: grid;
    min-width: 0;
}

.conversation-suggestion-card strong,
.conversation-suggestion-card small,
.conversation-suggestion-card em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-suggestion-card small,
.conversation-suggestion-card em {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.conversation-suggestion-card form {
    margin: 0;
}

.conversation-suggestion-card .button {
    white-space: nowrap;
}

.conversation-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
    color: var(--text);
    border-bottom: 1px solid var(--line);
}

.conversation-item:hover,
.conversation-item.is-active {
    background: var(--surface-soft);
}

.conversation-item span {
    display: grid;
    min-width: 0;
}

.conversation-item strong,
.conversation-item small,
.conversation-item em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-item small,
.conversation-item em {
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
}

.conversation-item b {
    min-width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
}

.chat-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 64px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}

.chat-header div {
    display: grid;
}

.chat-thread {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px;
    background: #f8fafc;
}

.message-bubble {
    display: flex;
}

.message-bubble.is-own {
    justify-content: flex-end;
}

.message-bubble > div {
    max-width: min(78%, 520px);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 11px;
    background: #fff;
}

.message-bubble.is-own > div {
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.message-bubble p {
    margin: 0;
    overflow-wrap: anywhere;
}

.message-bubble time {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.chat-form {
    border-top: 1px solid var(--line);
    padding: 12px;
    background: #fff;
}

.chat-form textarea {
    min-height: 78px;
}

.message-empty-copy {
    margin: 12px;
}

.stack-form {
    display: grid;
    gap: 12px;
}

.stack-form label,
.form-row label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.stack-form label span,
.form-row label span {
    color: var(--muted);
    font-size: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.check-line {
    align-content: end;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
}

.check-line input {
    width: auto;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.admin-stats > div {
    position: relative;
    overflow: hidden;
    border: 0;
    padding: 16px;
    box-shadow: 0 7px 22px rgba(15, 23, 42, 0.08);
}

.admin-stats > div::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--primary);
}

.admin-stats > div:nth-child(2)::before {
    background: var(--teal);
}

.admin-stats > div:nth-child(3)::before {
    background: var(--amber);
}

.admin-stats > div:nth-child(4)::before {
    background: var(--danger);
}

.admin-stats strong {
    display: block;
    font-size: 26px;
}

.admin-stats span {
    color: var(--muted);
}

.admin-hub-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.admin-hub-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    color: var(--text);
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    min-height: 116px;
    padding: 16px;
}

.admin-hub-card:hover {
    border-color: rgba(5, 150, 105, 0.34);
    background: #f0fdfa;
}

.admin-hub-card-image {
    width: 74px;
    height: 74px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.admin-hub-card-copy {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.admin-hub-card strong {
    font-size: 18px;
}

.admin-hub-card-copy > span {
    color: var(--muted);
}

.version-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.version-summary-card {
    display: grid;
    gap: 6px;
}

.version-summary-card span,
.version-summary-card small {
    color: var(--muted);
}

.version-summary-card strong {
    font-size: 30px;
    line-height: 1.15;
}

.version-release-panel,
.version-changelog-panel {
    margin-top: 14px;
}

.version-steps {
    margin: 0 0 12px 20px;
    padding: 0;
}

.command-box,
.changelog-box {
    display: block;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--text);
    overflow-x: auto;
    padding: 10px 12px;
}

.changelog-box {
    margin: 0;
    max-height: 460px;
    white-space: pre-wrap;
}

.admin-analytics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.admin-analytics-single {
    margin-bottom: 12px;
}

.admin-device-single .pie-chart {
    max-width: 520px;
}

.admin-chart-wide {
    grid-column: span 2;
}

.pie-chart {
    display: grid;
    grid-template-columns: 142px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.pie-chart-visual {
    width: 142px;
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, var(--surface) 0 42%, transparent 43%),
        conic-gradient(#2563eb 0 var(--desktop-share), #f97316 var(--desktop-share) 100%);
    box-shadow: inset 0 0 0 1px var(--line);
}

.pie-chart-legend {
    display: grid;
    gap: 8px;
}

.pie-chart-legend span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 14px;
}

.pie-chart-legend i {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.pie-chart-legend strong {
    color: var(--text);
    margin-left: auto;
}

.pie-color-desktop {
    background: #2563eb;
}

.pie-color-mobile {
    background: #f97316;
}

.metric-row {
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
}

.metric-row:first-of-type {
    border-top: 0;
}

.admin-country-list {
    display: grid;
    gap: 8px;
}

.admin-country-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 10px 12px;
}

.responsive-table {
    overflow-x: auto;
}

.usage-table-scroll {
    max-height: 322px;
    overflow: auto;
}

.usage-table-scroll .admin-data-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface);
}

.admin-data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
    font-size: 14px;
}

.admin-data-table th,
.admin-data-table td {
    border-bottom: 1px solid var(--line);
    padding: 9px 8px;
    text-align: left;
    vertical-align: middle;
}

.admin-data-table th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.admin-data-table td span {
    color: var(--muted);
    display: block;
}

.admin-import-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.pending-image-list {
    display: grid;
    gap: 10px;
}

.pending-image-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 12px;
}

.pending-image-row img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.pending-image-row p {
    overflow-wrap: anywhere;
}

.report-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 14px;
    margin-bottom: 10px;
}

.report-row p {
    overflow-wrap: anywhere;
}

.report-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: start;
    justify-content: flex-end;
    gap: 8px;
}

.contest-card {
    padding: 18px;
}

.contest-detail-cover {
    height: 170px;
    margin-bottom: 16px;
    border: 1px solid rgba(5, 150, 105, 0.18);
    background:
        radial-gradient(circle at 16% 18%, rgba(255, 255, 255, 0.72), transparent 18%),
        linear-gradient(135deg, rgba(5, 150, 105, 0.18), rgba(20, 184, 166, 0.22)),
        #f0fdfa;
}

.contest-header {
    border-bottom: 1px solid var(--line);
    padding-bottom: 16px;
}

.contest-header h1,
.contest-header h2 {
    font-size: 25px;
    line-height: 1.18;
}

.contest-meta span {
    background: #f8fafc;
    font-weight: 700;
}

.contest-podium {
    position: relative;
    gap: 12px;
    margin-top: 18px;
    padding: 46px 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(248, 250, 252, 0.92), #fff 58%),
        var(--surface);
}

.contest-podium.podium-count-1 {
    grid-template-columns: minmax(220px, 360px);
    justify-content: center;
}

.contest-podium.podium-count-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contest-podium::before {
    content: "Pódio atual";
    position: absolute;
    left: 14px;
    top: 14px;
    color: var(--text);
    font-size: 18px;
    font-weight: 800;
}

.contest-podium::after {
    content: "Ranking em tempo real pelos votos abertos";
    position: absolute;
    right: 14px;
    top: 17px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.podium-card {
    position: relative;
    overflow: hidden;
    min-height: 214px;
    padding: 14px 12px 0;
    background: #fff;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.podium-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.12);
}

.podium-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.88;
    background: linear-gradient(180deg, var(--podium-glow, rgba(241, 245, 249, 0.8)), transparent 46%);
}

.podium-card > * {
    position: relative;
    z-index: 1;
}

.podium-card > strong:first-child {
    min-width: 44px;
    min-height: 34px;
    display: inline-grid;
    place-items: center;
    background: var(--podium-base, #94a3b8);
    color: #fff;
    font-size: 15px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.podium-card .avatar {
    width: 56px;
    height: 56px;
    border: 3px solid #fff;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.podium-card a,
.podium-card > strong:not(:first-child) {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
}

.podium-card::after {
    content: attr(data-place);
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: calc(100% + 24px);
    height: 46px;
    margin: 8px -12px 0;
    color: #fff;
    font-size: 26px;
    font-weight: 900;
    background: var(--podium-base, #94a3b8);
}

.podium-place-1 {
    --podium-glow: rgba(217, 119, 6, 0.2);
    --podium-base: linear-gradient(135deg, #b7791f, #d97706);
    min-height: 262px;
    border-color: rgba(217, 119, 6, 0.48);
    background: #fffbeb;
}

.podium-place-1 .avatar {
    width: 68px;
    height: 68px;
}

.podium-place-1::after {
    height: 62px;
}

.podium-place-2 {
    --podium-glow: rgba(148, 163, 184, 0.22);
    --podium-base: linear-gradient(135deg, #64748b, #94a3b8);
    min-height: 232px;
    border-color: rgba(148, 163, 184, 0.45);
    background: #f8fafc;
}

.podium-place-2::after {
    height: 52px;
}

.podium-place-3 {
    --podium-glow: rgba(180, 83, 9, 0.16);
    --podium-base: linear-gradient(135deg, #92400e, #b45309);
    min-height: 218px;
    border-color: rgba(180, 83, 9, 0.34);
    background: #fff7ed;
}

.contest-score {
    min-width: 70px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    padding: 5px 8px;
}

.contest-score-podium {
    min-width: 0;
    background: #fff;
    border-radius: 999px;
}

.vote-count-link {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    display: grid;
    justify-items: center;
    gap: 1px;
    padding: 0;
}

.vote-count-link:hover strong,
.vote-count-link:focus-visible strong {
    color: var(--primary-dark);
    text-decoration: underline;
}

.vote-count-link strong {
    color: var(--primary-dark);
    font-size: 20px;
    line-height: 1.05;
}

.vote-count-link span {
    color: var(--muted);
    font-size: 13px;
}

.voters-modal-panel {
    position: relative;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.voters-modal-list {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    max-height: min(420px, 58vh);
    overflow: auto;
}

.voters-modal-list a {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    padding: 8px;
}

.voters-modal-list small {
    color: var(--muted);
}

.vote-summary-panel {
    overflow: hidden;
    position: relative;
}

.vote-summary-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--teal), var(--amber));
}

.vote-summary-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.vote-summary-head h2 {
    margin: 0;
}

.vote-summary-head small {
    color: var(--muted);
    font-weight: 700;
}

.vote-summary-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #fffbeb;
    color: var(--amber);
    display: inline-grid;
    place-items: center;
    font-size: 16px;
    font-weight: 900;
    flex: 0 0 auto;
}

.vote-leader-card {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    border: 1px solid rgba(217, 119, 6, 0.24);
    border-radius: 8px;
    background: linear-gradient(135deg, #fff7ed, #ffffff 72%);
    padding: 10px;
    margin-bottom: 14px;
}

.vote-leader-card strong,
.vote-leader-card small {
    display: block;
}

.vote-leader-card small {
    color: var(--muted);
    margin-top: 2px;
}

.vote-progress-list {
    display: grid;
    gap: 11px;
}

.vote-progress-item strong {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
    color: var(--text);
    font-size: 13px;
}

.vote-progress-bar {
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: #e5e7eb;
}

.vote-progress-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--teal));
}

.contest-mini-calendar {
    display: grid;
    gap: 9px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.contest-mini-calendar div {
    border-left: 3px solid rgba(5, 150, 105, 0.28);
    padding-left: 10px;
}

.contest-mini-calendar strong,
.contest-mini-calendar span {
    display: block;
}

.contest-summary-card .community-card-body p {
    display: -webkit-box;
    min-height: 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.contest-edit-cover {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 12px;
    align-items: end;
}

.contest-lower-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    margin-top: 16px;
}

.contest-comments-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    display: grid;
    gap: 12px;
    padding: 12px;
}

.contest-comments-panel h3 {
    margin: 0;
}

.contest-comment-form {
    display: grid;
    gap: 8px;
}

.contest-comments-list {
    display: grid;
    gap: 10px;
    max-height: 560px;
    overflow: auto;
}

.contest-comment {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 9px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.contest-comment:first-child {
    border-top: 0;
    padding-top: 0;
}

.contest-comment strong,
.contest-comment small {
    display: block;
}

.contest-comment small {
    color: var(--muted);
}

.contest-comment p {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
}

.contest-comment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.contest-comment-actions details {
    flex: 1 1 180px;
}

.contest-comment-actions summary {
    color: var(--primary-dark);
    cursor: pointer;
    font-weight: 750;
}

.contest-comment-actions form {
    margin: 0;
}

.contest-comment-actions textarea {
    margin-top: 8px;
    min-height: 82px;
}

.voter-modal-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
}

.voter-modal-row > a {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    color: var(--text);
    min-width: 0;
}

.voter-modal-row form {
    margin: 0;
}

.voters-modal-list a {
    border: 0;
    padding: 0;
}

.admin-filter-form {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(140px, 0.8fr) minmax(140px, 0.8fr) auto;
    gap: 12px;
    align-items: end;
    border-color: rgba(148, 163, 184, 0.26);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.94)),
        var(--surface);
    box-shadow: 0 7px 22px rgba(15, 23, 42, 0.06);
    margin-bottom: 16px;
    padding: 14px;
}

.admin-filter-form label {
    display: grid;
    gap: 5px;
}

.admin-filter-form label span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.admin-filter-form input,
.admin-filter-form select {
    min-height: 42px;
    border-color: #d7dde7;
    border-radius: 6px;
    background-color: #fff;
    box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.03);
}

.bar-chart {
    display: grid;
    gap: 9px;
}

.bar-chart-row {
    display: grid;
    grid-template-columns: minmax(72px, 0.8fr) minmax(0, 1fr) 42px;
    gap: 8px;
    align-items: center;
    font-size: 13px;
}

.bar-chart-row > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-chart-row > div {
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: #e5e7eb;
}

.bar-chart-row i {
    display: block;
    height: 100%;
    min-width: 2px;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--teal));
}

.bar-chart-row strong {
    text-align: right;
}

.line-chart {
    display: grid;
    gap: 4px;
}

.line-chart svg {
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(241, 245, 249, 0.8), rgba(255, 255, 255, 0.9));
}

.line-chart polyline {
    fill: none;
    stroke: var(--primary);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 4;
}

.line-chart circle {
    fill: #fff;
    stroke: var(--primary-dark);
    stroke-width: 2;
}

.line-chart-labels {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 18px;
}

.auth-shell {
    width: 100%;
    max-width: 460px;
}

.auth-panel {
    box-shadow: var(--shadow);
    padding: 24px;
}

.brand-auth {
    margin-bottom: 20px;
}

.auth-switch {
    margin-bottom: 0;
}

.cookie-banner {
    position: fixed;
    left: 18px;
    right: 18px;
    bottom: 18px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 760px;
    margin: 0 auto;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

[hidden] {
    display: none !important;
}

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

    .right-sidebar {
        display: flex;
    }
}

@media (max-width: 1120px) {
    .layout {
        display: block;
        padding: 0;
    }

    .left-sidebar {
        position: sticky;
        top: 0;
        z-index: 5;
        min-height: 0;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        padding: 0;
        gap: 10px;
    }

    .brand {
        font-size: 18px;
    }

    .mobile-nav-toggle {
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 38px;
        padding: 8px 10px;
        font-weight: 750;
    }

    .primary-nav {
        display: none;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        background: var(--sidebar-soft);
        padding: 6px;
    }

    .primary-nav.is-open {
        display: flex;
    }

    .nav-link {
        padding: 8px 10px;
    }

    .sidebar-account {
        display: none;
    }

    .main-column {
        padding: 12px;
    }

    .right-sidebar {
        position: static;
        display: flex;
        gap: 12px;
        padding: 0 12px 14px;
    }

    .post-card,
    .composer-card {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .post-header {
        display: grid;
        gap: 2px;
    }

    .composer-footer,
    .editor-top-row,
    .profile-info,
    .profile-actions,
    .wide-search,
    .report-row,
    .contest-header,
    .contest-competitor-row {
        display: grid;
        grid-template-columns: 1fr;
    }

    .composer-footer select,
    .composer-footer .button,
    .editor-top-row .button,
    .profile-actions .button,
    .profile-actions form,
    .wide-search .button {
        width: 100%;
    }

    .profile-actions {
        padding-top: 0;
    }

    .profile-main {
        padding-top: 0;
    }

    .profile-info {
        margin-top: -52px;
    }

    .form-row,
    .admin-stats,
    .admin-filter-form,
    .admin-hub-grid,
    .version-summary-grid,
    .admin-analytics-grid,
    .admin-import-grid,
    .community-grid,
    .contest-podium,
    .contest-lower-grid,
    .contest-edit-cover,
    .contest-option-row,
    .media-editor,
    .messages-shell,
    .pending-image-row {
        grid-template-columns: 1fr;
    }

    .admin-chart-wide {
        grid-column: auto;
    }

    .pie-chart {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .contest-actions {
        justify-items: stretch;
        min-width: 0;
    }

    .contest-actions .button,
    .contest-actions form,
    .contest-vote-action .button,
    .contest-vote-action form {
        width: 100%;
    }

    .contest-podium::after {
        position: static;
        grid-column: 1 / -1;
        text-align: left;
        margin-top: -8px;
        margin-bottom: 2px;
    }

    .podium-card::after,
    .podium-place-1::after,
    .podium-place-2::after,
    .podium-place-3::after {
        height: 36px;
    }

    .podium-place-1,
    .podium-place-2,
    .podium-place-3 {
        order: initial;
        min-height: 0;
    }

    .podium-place-1 .avatar,
    .podium-card .avatar {
        width: 54px;
        height: 54px;
    }

    .conversations-panel {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .messages-shell {
        height: var(--messages-shell-height, calc(100vh - 116px));
        min-height: 0;
        grid-template-rows: minmax(96px, 28%) minmax(0, 1fr);
    }

    .chat-thread {
        min-height: 0;
    }

    .chat-form textarea {
        height: 56px;
        min-height: 56px;
        resize: none;
    }

    .chat-form .composer-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .chat-form .composer-footer .button {
        width: auto;
        padding: 9px 14px;
    }

    .cookie-banner {
        left: 10px;
        right: 10px;
        bottom: 10px;
        display: grid;
    }
}

.mobile-topbar,
.mobile-bottom-nav,
.mobile-create-fab,
.mobile-more-menu,
.mobile-tab-list {
    display: none;
}

.mobile-tabs,
.mobile-tab-panel:not(.mobile-side-panel) {
    display: contents;
}

.mobile-side-panel {
    display: none;
}

.mobile-inline-aside {
    display: none;
}

.mobile-only,
.is-desktop-hidden {
    display: none !important;
}

@media (min-width: 1200px) {
    body.sidebar-collapsed .layout,
    html.sidebar-collapsed-preload .layout,
    .layout.sidebar-collapsed {
        --sidebar-column: 76px;
        max-width: 1148px;
    }
}

@media (min-width: 1025px) and (max-width: 1199px) {
    .layout {
        grid-template-columns: var(--sidebar-column) minmax(0, 620px) 280px;
        max-width: 1180px;
        gap: 16px;
        padding: 16px;
    }

    body.sidebar-collapsed .layout,
    html.sidebar-collapsed-preload .layout,
    .layout.sidebar-collapsed {
        --sidebar-column: 76px;
        max-width: 996px;
    }
}

@media (min-width: 769px) {
    body.sidebar-collapsed .sidebar-topbar,
    html.sidebar-collapsed-preload .sidebar-topbar,
    .layout.sidebar-collapsed .sidebar-topbar {
        flex-direction: column;
        justify-content: center;
        min-height: 96px;
        padding: 14px 8px;
    }

    body.sidebar-collapsed .sidebar-topbar .brand,
    html.sidebar-collapsed-preload .sidebar-topbar .brand,
    .layout.sidebar-collapsed .sidebar-topbar .brand {
        flex: 0 0 auto;
        justify-content: center;
    }

    body.sidebar-collapsed .brand-logo,
    html.sidebar-collapsed-preload .brand-logo,
    .layout.sidebar-collapsed .brand-logo {
        width: 40px;
        height: 40px;
    }

    body.sidebar-collapsed .d-sidebar-narrow-none,
    body.sidebar-collapsed .nav-title,
    body.sidebar-collapsed .nav-label,
    body.sidebar-collapsed .sidebar-account summary span,
    body.sidebar-collapsed .sidebar-account summary i,
    body.sidebar-collapsed .sidebar-account-dropdown,
    body.sidebar-collapsed .sidebar-footer,
    body.sidebar-collapsed .left-sidebar > .button-full,
    html.sidebar-collapsed-preload .d-sidebar-narrow-none,
    html.sidebar-collapsed-preload .nav-title,
    html.sidebar-collapsed-preload .nav-label,
    html.sidebar-collapsed-preload .sidebar-account summary span,
    html.sidebar-collapsed-preload .sidebar-account summary i,
    html.sidebar-collapsed-preload .sidebar-account-dropdown,
    html.sidebar-collapsed-preload .sidebar-footer,
    html.sidebar-collapsed-preload .left-sidebar > .button-full,
    .layout.sidebar-collapsed .d-sidebar-narrow-none,
    .layout.sidebar-collapsed .nav-title,
    .layout.sidebar-collapsed .nav-label,
    .layout.sidebar-collapsed .sidebar-account summary span,
    .layout.sidebar-collapsed .sidebar-account summary i,
    .layout.sidebar-collapsed .sidebar-account-dropdown,
    .layout.sidebar-collapsed .sidebar-footer,
    .layout.sidebar-collapsed .left-sidebar > .button-full {
        display: none;
    }

    body.sidebar-collapsed .primary-nav,
    html.sidebar-collapsed-preload .primary-nav,
    .layout.sidebar-collapsed .primary-nav {
        align-items: center;
        padding: 12px 8px;
    }

    body.sidebar-collapsed .nav-link,
    html.sidebar-collapsed-preload .nav-link,
    .layout.sidebar-collapsed .nav-link {
        justify-content: center;
        gap: 0;
        min-height: 44px;
        padding: 7px;
        position: relative;
    }

    body.sidebar-collapsed .nav-icon,
    html.sidebar-collapsed-preload .nav-icon,
    .layout.sidebar-collapsed .nav-icon {
        width: 30px;
        height: 30px;
    }

    body.sidebar-collapsed .nav-badge,
    html.sidebar-collapsed-preload .nav-badge,
    .layout.sidebar-collapsed .nav-badge {
        position: absolute;
        top: 3px;
        right: 3px;
        min-width: 18px;
        height: 18px;
        margin-left: 0;
        padding: 0 4px;
        font-size: 10px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .layout {
        --sidebar-column: 88px;
        display: grid;
        grid-template-columns: var(--sidebar-column) minmax(0, 1fr);
        gap: 14px;
        max-width: none;
        padding: 14px;
    }

    .left-sidebar {
        position: sticky;
        top: 14px;
        min-height: calc(100vh - 28px);
        border-radius: 8px;
    }

    .right-sidebar,
    .tablet-hidden {
        display: none !important;
    }

    .main-column {
        padding: 0;
    }

    .sidebar-topbar {
        flex-direction: column;
        justify-content: center;
        min-height: 96px;
        padding: 14px 8px;
    }

    .sidebar-topbar .brand {
        flex: 0 0 auto;
        justify-content: center;
    }

    .brand-logo {
        width: 40px;
        height: 40px;
    }

    .d-sidebar-narrow-none,
    .nav-title,
    .nav-label,
    .sidebar-account summary span,
    .sidebar-account summary i,
    .sidebar-account-dropdown,
    .sidebar-footer,
    .left-sidebar > .button-full {
        display: none;
    }

    .primary-nav {
        display: flex;
        align-items: center;
        padding: 12px 8px;
    }

    .nav-item {
        width: 100%;
    }

    .nav-link {
        justify-content: center;
        gap: 0;
        min-height: 44px;
        padding: 7px;
        position: relative;
    }

    .nav-icon {
        width: 30px;
        height: 30px;
    }

    .nav-badge {
        position: absolute;
        top: 3px;
        right: 3px;
        min-width: 18px;
        height: 18px;
        margin-left: 0;
        padding: 0 4px;
        font-size: 10px;
    }

    .sidebar-account {
        padding: 10px 8px;
    }

    .sidebar-account summary {
        grid-template-columns: 40px;
        justify-content: center;
        padding: 6px 4px;
    }

    .admin-analytics-grid,
    .community-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body.app-body {
        padding-bottom: calc(82px + env(safe-area-inset-bottom));
    }

    .layout {
        display: block;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 10px 10px calc(92px + env(safe-area-inset-bottom));
    }

    .left-sidebar,
    .right-sidebar,
    .desktop-only,
    .is-mobile-hidden {
        display: none !important;
    }

    .mobile-only,
    .is-desktop-hidden {
        display: initial !important;
    }

    .main-column {
        width: 100%;
        max-width: 760px;
        margin: 0 auto;
        padding: 0;
    }

    .mobile-topbar {
        position: sticky;
        top: 0;
        z-index: 30;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) 40px;
        align-items: center;
        gap: 8px;
        min-height: 58px;
        padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
        border-bottom: 1px solid var(--line);
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(14px);
    }

    .mobile-topbar-brand,
    .mobile-topbar-action {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
        min-height: 40px;
        color: var(--text);
    }

    .mobile-topbar-brand {
        gap: 6px;
        justify-content: flex-start;
    }

    .mobile-topbar-brand img {
        width: 32px;
        height: 32px;
        object-fit: contain;
    }

    .mobile-topbar-brand strong {
        display: none;
    }

    .mobile-topbar-search {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 36px;
        min-width: 0;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fff;
        overflow: hidden;
    }

    .mobile-topbar-search input {
        min-width: 0;
        min-height: 40px;
        border: 0;
        background: transparent;
        padding: 8px 10px;
        font-size: 14px;
    }

    .mobile-topbar-search input:focus {
        outline: 0;
        box-shadow: none;
    }

    .mobile-topbar-search button {
        min-width: 36px;
        border: 0;
        border-left: 1px solid var(--line);
        background: #ecfdf5;
        color: var(--primary-dark);
        cursor: pointer;
        font-size: 18px;
        font-weight: 900;
    }

    .mobile-topbar-title {
        min-width: 0;
        overflow: hidden;
        color: var(--text);
        font-weight: 800;
        text-align: center;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-tabs {
        display: contents;
    }

    .mobile-tab-list {
        display: none !important;
    }

    .mobile-tab-list::-webkit-scrollbar {
        display: none;
    }

    .mobile-tab-button {
        min-height: 36px;
        min-width: max-content;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: #fff;
        color: var(--muted);
        cursor: pointer;
        font-size: 14px;
        font-weight: 800;
        padding: 7px 12px;
    }

    .mobile-tab-button:focus-visible,
    .mobile-bottom-nav-item:focus-visible,
    .mobile-create-fab:focus-visible {
        outline: 3px solid rgba(5, 150, 105, 0.25);
        outline-offset: 2px;
    }

    .mobile-tab-button.is-active,
    .mobile-tab-button[aria-selected="true"] {
        border-color: var(--primary);
        background: var(--primary);
        color: #fff;
    }

    .mobile-tab-panel,
    .mobile-tab-panel:not(.mobile-side-panel) {
        display: block;
    }

    .mobile-tab-panel.is-active {
        display: block;
    }

    .mobile-side-panel {
        display: none;
        padding-bottom: 12px;
    }

    .mobile-side-panel.is-active {
        display: grid;
        gap: 12px;
    }

    .mobile-inline-aside {
        display: grid;
        gap: 12px;
        margin: 16px 0 0;
    }

    .page-header {
        align-items: stretch;
        gap: 10px;
        margin: 2px 0 12px;
    }

    .page-header h1 {
        font-size: 24px;
        line-height: 1.1;
    }

    .feed-title-row,
    .page-title-row,
    .section-title-row {
        align-items: stretch;
        gap: 10px;
    }

    .sort-form-title,
    .sort-form-title label {
        width: 100%;
    }

    .composer-card,
    .post-card {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 10px;
        margin-bottom: 12px;
    }

    .composer-card textarea {
        min-height: 92px;
    }

    .post-actions {
        flex-wrap: wrap;
        gap: 6px;
    }

    .post-images img,
    .contest-detail-cover,
    .community-card-cover {
        width: 100%;
        object-fit: cover;
    }

    .community-grid,
    .contest-podium,
    .contest-lower-grid,
    .admin-analytics-grid,
    .settings-grid,
    .settings-panel,
    .messages-shell {
        grid-template-columns: 1fr;
    }

    .admin-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-stats > div strong {
        font-size: 25px;
    }

    .contest-podium {
        align-items: stretch;
    }

    .podium-card {
        min-height: 0;
    }

    .contest-competitor-row,
    .contest-header,
    .profile-info,
    .profile-actions {
        grid-template-columns: 1fr;
    }

    .profile-cover,
    .cover-preview {
        min-height: 148px;
    }

    .profile-info {
        margin-top: -44px;
    }

    .profile-tabs {
        position: sticky;
        top: calc(102px + env(safe-area-inset-top));
        z-index: 15;
        overflow-x: auto;
        background: var(--bg);
        padding-bottom: 6px;
    }

    .messages-shell {
        height: auto;
        min-height: calc(100vh - 174px);
    }

    .conversations-panel,
    .chat-panel {
        min-height: 0;
    }

    .chat-panel {
        max-height: calc(100vh - 168px);
    }

    .mobile-bottom-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 40;
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        min-height: 58px;
        padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--line);
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 -12px 24px rgba(15, 23, 42, 0.08);
    }

    .mobile-bottom-nav-item {
        position: relative;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-width: 0;
        min-height: 48px;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: var(--muted);
        cursor: pointer;
        font-weight: 800;
        line-height: 1.1;
        padding: 4px 2px;
    }

    .mobile-bottom-nav-item.is-active {
        color: var(--primary-dark);
        background: var(--surface-soft);
    }

    .mobile-nav-icon {
        position: relative;
        display: grid;
        width: 24px;
        height: 24px;
        place-items: center;
        font-size: 26px;
        font-weight: 800;
        line-height: 1;
    }

    .mobile-nav-icon img {
        width: 24px;
        height: 24px;
        object-fit: contain;
    }

    .mobile-nav-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .mobile-nav-badge {
        position: absolute;
        top: -7px;
        right: -10px;
        display: grid;
        min-width: 18px;
        height: 18px;
        place-items: center;
        border-radius: 999px;
        background: var(--danger);
        color: #fff;
        font-size: 10px;
        padding: 0 4px;
    }

    .mobile-create-fab {
        position: fixed;
        right: 18px;
        bottom: calc(82px + env(safe-area-inset-bottom));
        z-index: 39;
        display: grid;
        width: 54px;
        height: 54px;
        place-items: center;
        border: 0;
        border-radius: 999px;
        background: var(--primary);
        color: #fff;
        cursor: pointer;
        font-size: 34px;
        font-weight: 500;
        line-height: 1;
        box-shadow: 0 14px 28px rgba(5, 150, 105, 0.3);
    }

    .mobile-more-menu {
        position: fixed;
        right: 10px;
        bottom: calc(68px + env(safe-area-inset-bottom));
        left: 10px;
        z-index: 41;
        display: grid;
        gap: 10px;
        max-width: 420px;
        margin: 0 auto;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    }

    .mobile-more-menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 2px 2px 8px;
        border-bottom: 1px solid var(--line);
    }

    .mobile-more-menu-header button {
        width: 34px;
        height: 34px;
        border: 0;
        border-radius: 999px;
        background: var(--surface-soft);
        color: var(--text);
        cursor: pointer;
        font-size: 24px;
        line-height: 1;
    }

    .mobile-more-menu-list {
        display: grid;
        gap: 6px;
    }

    .mobile-more-item {
        display: grid;
        grid-template-columns: 34px minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        min-height: 44px;
        width: 100%;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: var(--text);
        cursor: pointer;
        font-weight: 750;
        padding: 6px 8px;
        text-align: left;
    }

    .mobile-more-item:hover,
    .mobile-more-item:focus-visible {
        background: var(--surface-soft);
    }

    .mobile-more-icon {
        display: grid;
        width: 34px;
        height: 34px;
        place-items: center;
    }

    .mobile-more-icon img {
        width: 24px;
        height: 24px;
        object-fit: contain;
    }

    .mobile-more-badge {
        display: grid;
        min-width: 22px;
        height: 22px;
        place-items: center;
        border-radius: 999px;
        background: var(--danger);
        color: #fff;
        font-size: 11px;
        padding: 0 6px;
    }

    .mobile-more-logout {
        margin: 0;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 15px;
    }

    .layout {
        padding-right: 8px;
        padding-left: 8px;
    }

    .mobile-topbar {
        grid-template-columns: 36px minmax(0, 1fr) 36px;
        padding-right: 10px;
        padding-left: 10px;
    }

    .mobile-topbar-brand strong {
        display: none;
    }

    .admin-stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .mobile-nav-icon img {
        width: 22px;
        height: 22px;
    }
}

body.native-flutter-body,
html.words-flutter-app body {
    background: var(--bg);
}

body.native-flutter-body .layout,
html.words-flutter-app body .layout {
    display: block;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 10px 10px 96px;
}

body.native-flutter-body .left-sidebar,
body.native-flutter-body .right-sidebar,
html.words-flutter-app body .left-sidebar,
html.words-flutter-app body .right-sidebar {
    display: none !important;
}

body.native-flutter-body .main-column,
html.words-flutter-app body .main-column {
    padding: 0;
}

body.native-flutter-body .page-header,
html.words-flutter-app body .page-header {
    margin: 6px 2px 12px;
}

body.native-flutter-body .composer-card,
body.native-flutter-body .post-card,
body.native-flutter-body .profile-hero,
body.native-flutter-body .settings-panel,
body.native-flutter-body .settings-subpanel,
body.native-flutter-body .text-panel,
body.native-flutter-body .notification-row,
body.native-flutter-body .user-row,
body.native-flutter-body .empty-state,
html.words-flutter-app body .composer-card,
html.words-flutter-app body .post-card,
html.words-flutter-app body .profile-hero,
html.words-flutter-app body .settings-panel,
html.words-flutter-app body .settings-subpanel,
html.words-flutter-app body .text-panel,
html.words-flutter-app body .notification-row,
html.words-flutter-app body .user-row,
html.words-flutter-app body .empty-state {
    box-shadow: none;
}

body.native-flutter-body .post-card,
body.native-flutter-body .composer-card,
html.words-flutter-app body .post-card,
html.words-flutter-app body .composer-card {
    border-radius: 10px;
}

body.native-flutter-body .cookie-banner,
html.words-flutter-app body .cookie-banner {
    bottom: 92px;
}
