:root {
    --background: #f4f6f8;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #172033;
    --text-secondary: #667085;
    --border: #dfe4ea;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --success: #157347;
    --success-bg: #e9f8f0;
    --warning: #9a5b00;
    --warning-bg: #fff5dc;
    --danger: #b42318;
    --danger-bg: #fef0ef;
    --sidebar: #111827;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .04);
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--background); }
body { margin: 0; color: var(--text); background: var(--background); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
button, input, select { font: inherit; }
button, a, input, select, summary { outline-offset: 3px; }
:focus-visible { outline: 3px solid rgba(37, 99, 235, .35); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(26px, 3vw, 34px); line-height: 1.2; letter-spacing: -.025em; }
h2 { margin-bottom: 16px; font-size: 19px; }
h3 { font-size: 16px; }
code { padding: 2px 5px; border-radius: 5px; background: #edf1f5; }

.page-loading { position: fixed; z-index: 100; top: 0; left: 0; width: 0; height: 3px; background: var(--accent); opacity: 0; transition: width .25s, opacity .2s; }
.page-loading.is-active { width: 70%; opacity: 1; }
.app-shell { min-height: calc(100vh - 64px); }
.app-shell--guest { display: grid; min-height: 100vh; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 32px 16px; }
.topbar { position: sticky; z-index: 50; top: 0; color: #d7deea; background: var(--sidebar); box-shadow: 0 1px 0 rgba(255, 255, 255, .08); }
.topbar__inner { position: relative; display: flex; min-height: 64px; max-width: 1600px; align-items: center; gap: 32px; margin: 0 auto; padding: 0 32px; }
.brand { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; color: white; font-size: 18px; font-weight: 750; }
.brand:hover { color: white; }
.brand__mark { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: white; background: var(--accent); font-size: 13px; font-weight: 800; letter-spacing: .04em; }
.topnav { display: flex; align-self: stretch; align-items: center; gap: 4px; }
.nav__link { display: inline-flex; min-height: 40px; align-items: center; padding: 8px 14px; border-radius: 8px; color: #aeb8c8; font-weight: 650; }
.nav__link:hover, .nav__link.is-active { color: white; background: #263244; }
.topbar__account { display: flex; min-width: 0; align-items: center; gap: 12px; margin-left: auto; }
.topbar__account form { margin: 0; }
.topbar__user { max-width: 220px; overflow: hidden; color: white; text-overflow: ellipsis; white-space: nowrap; }
.cabinet-switcher { min-width: 180px; margin-left: auto; }
.cabinet-switcher label { display: grid; gap: 2px; }
.cabinet-switcher label > span { color: #9eabba; font-size: 10px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.cabinet-switcher select { width: 100%; max-width: 240px; min-height: 34px; padding: 5px 30px 5px 9px; border: 1px solid #48556a; border-radius: 8px; color: white; background: #1b2636; font-size: 13px; font-weight: 700; }
.button--topbar { min-height: 36px; padding: 6px 12px; color: #d7deea; border-color: #48556a; background: transparent; }
.button--topbar:hover { color: white; border-color: #718096; background: #263244; }
.main-content { width: 100%; max-width: 1600px; margin: 0 auto; padding: 32px; }
.app-shell--guest .main-content { max-width: 560px; padding: 0; }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-header__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.page-header p { margin-bottom: 0; color: var(--text-secondary); }
.page-header--compact { align-items: center; }
.eyebrow { margin-bottom: 6px !important; color: var(--accent) !important; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.back-link { display: inline-block; margin-bottom: 16px; font-weight: 650; }
.panel { margin-bottom: 24px; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-header h2 { margin-bottom: 0; }
.section-header > span { color: var(--text-secondary); }

.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 8px 14px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-weight: 700; line-height: 1.2; transition: background .15s, border-color .15s; }
.button--primary { color: white; background: var(--accent); }
.button--primary:hover { color: white; background: var(--accent-dark); }
.button--secondary { color: #24436f; border-color: #b9cae2; background: #eef4fc; }
.button--secondary:hover { color: #18345c; background: #e3ecf8; }
.button--ghost { color: var(--text); border-color: var(--border); background: transparent; }
.sidebar .button--ghost { color: #d7deea; border-color: #48556a; }
.button--warning { color: var(--warning); border-color: #eed59f; background: var(--warning-bg); }
.button--danger { color: white; border-color: var(--danger); background: var(--danger); }
.button--danger:hover { color: white; background: #912018; }
.button--small { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.button--full { width: 100%; }
.button:disabled { cursor: not-allowed; opacity: .55; }

.alert { margin-bottom: 24px; padding: 14px 16px; border: 1px solid; border-radius: 10px; }
.alert ul { margin: 8px 0 0; padding-left: 20px; }
.alert--success { color: var(--success); border-color: #b9e5cc; background: var(--success-bg); }
.alert--danger { color: var(--danger); border-color: #f0c1bd; background: var(--danger-bg); }
.auth-card { width: 100%; padding: 32px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.auth-card__heading { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.auth-card__heading p, .auth-card--center p { color: var(--text-secondary); }
.auth-card__switch { margin: 24px 0 0; text-align: center; }
.auth-card--center { text-align: center; }
.state-icon { display: grid; width: 52px; height: 52px; place-items: center; margin: 0 auto 16px; border-radius: 50%; color: var(--accent); background: #eaf1ff; font-size: 24px; font-weight: 800; }
.form-stack { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; color: #344054; font-size: 13px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #cbd3dc; border-radius: 8px; color: var(--text); background: white; }
.field textarea { min-height: 112px; resize: vertical; }
.field input::placeholder { color: #98a2b3; font-weight: 400; }
.field__error { color: var(--danger); }
.check { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); }
.field-help { color: var(--text-secondary); font-size: 13px; font-weight: 400; }
.settings-panel { max-width: 920px; }
.settings-form { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding-top: 8px; }
.webhook-box { padding: 18px; border: 1px solid #b9cae2; border-radius: 12px; background: #f4f8ff; }
.webhook-box > div:first-child { margin-bottom: 12px; }
.webhook-box p { margin: 2px 0 0; color: var(--text-secondary); }
.copy-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.copy-field input { min-width: 0; padding: 9px 11px; border: 1px solid #b9cae2; border-radius: 8px; color: #24436f; background: white; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.copy-status { min-height: 20px; font-size: 13px; }
.danger-zone { display: flex; max-width: 920px; align-items: center; justify-content: space-between; gap: 24px; border-color: #eed59f; }
.danger-zone h2 { margin-bottom: 4px; }
.danger-zone p { margin-bottom: 0; color: var(--text-secondary); }
.danger-zone form { flex: 0 0 auto; }
.access-options { min-width: 0; margin: 0; padding: 0; border: 0; }
.access-options legend { margin-bottom: 4px; font-size: 16px; font-weight: 800; }
.access-options > p { color: var(--text-secondary); }
.access-options__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.access-option { display: flex; min-width: 0; align-items: flex-start; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); cursor: pointer; }
.access-option:has(input:checked) { border-color: #75a0e2; background: #eaf2ff; }
.access-option input { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px; accent-color: var(--accent); }
.access-option span { display: grid; min-width: 0; }
.access-option strong { overflow: hidden; text-overflow: ellipsis; }
.access-option small { color: var(--text-secondary); }

.metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.metric { display: grid; gap: 6px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.metric span { color: var(--text-secondary); font-size: 13px; }
.metric strong { font-size: 28px; letter-spacing: -.03em; }
.metric--link { color: var(--text); transition: border-color .15s, box-shadow .15s; }
.metric--link:hover { color: var(--text); border-color: #b9cae2; box-shadow: var(--shadow); }
.compact-post { display: grid; grid-template-columns: minmax(130px, .6fr) minmax(220px, 2fr) auto; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); color: var(--text); }
.compact-post__source { font-weight: 700; }
.compact-post__text { overflow: hidden; color: var(--text-secondary); text-overflow: ellipsis; white-space: nowrap; }
.compact-post time { color: var(--text-secondary); font-size: 13px; }

.page-header--posts { align-items: center; }
.filters-toggle { display: none; }
.posts-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); align-items: start; gap: 24px; }
.filters-sidebar { position: sticky; top: 88px; max-height: calc(100vh - 112px); overflow-y: auto; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); scrollbar-width: thin; }
.filters-sidebar__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.filters-sidebar__heading h2 { margin-bottom: 2px; }
.filters-sidebar__heading p { margin: 0; color: var(--text-secondary); font-size: 12px; }
.filters-reset { min-height: 32px; padding: 4px 2px; border: 0; color: var(--accent); background: transparent; cursor: pointer; font-size: 13px; font-weight: 750; }
.filters-reset:hover { color: var(--accent-dark); text-decoration: underline; }
.filters-form { display: grid; gap: 16px; }
.filter-section { border-bottom: 1px solid var(--border); }
.filter-section summary { display: flex; min-height: 40px; align-items: center; gap: 8px; padding: 6px 0; cursor: pointer; font-size: 13px; font-weight: 800; list-style-position: outside; }
.filter-section summary span { display: inline-grid; min-width: 20px; height: 20px; place-items: center; margin-left: auto; border-radius: 999px; color: #24436f; background: #e8f1ff; font-size: 11px; }
.filter-section summary span:empty { display: none; }
.filter-section__body { display: grid; gap: 12px; padding: 4px 0 16px; }
.date-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.range-filter { min-width: 0; margin: 0; padding: 0; border: 0; }
.range-filter legend { margin-bottom: 7px; padding: 0; font-size: 13px; font-weight: 700; }
.range-filter__fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.range-filter .field > span { font-size: 12px; }
.range-filter > .field-help { display: block; margin-top: 6px; }
.category-filter { min-width: 0; margin: 0; padding: 18px; border: 1px solid #d6deea; border-radius: 12px; background: linear-gradient(180deg, #fbfcff 0%, #f8fafc 100%); }
.category-filter legend { padding: 0 8px; color: var(--text); font-size: 16px; font-weight: 800; }
.category-filter--sidebar { padding: 4px 0 16px; border: 0; border-radius: 0; background: transparent; }
.category-filter__actions { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; }
.category-filter--sidebar .category-filter__actions { justify-content: space-between; margin-bottom: 8px; color: var(--text-secondary); font-size: 11px; }
.category-filter__clear { padding: 4px 2px; border: 0; color: var(--accent); background: transparent; cursor: pointer; font-size: 13px; font-weight: 750; }
.category-filter__clear:hover { color: var(--accent-dark); text-decoration: underline; }
.category-filter__clear:disabled { color: #98a2b3; cursor: default; text-decoration: none; }
.filter-options { display: grid; gap: 8px; }
.filter-options--sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.filter-options--compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.filter-option { display: flex; min-width: 0; min-height: 44px; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid #d7dee8; border-radius: 9px; color: #344054; background: var(--surface); cursor: pointer; font-size: 13px; font-weight: 700; transition: border-color .15s, box-shadow .15s, color .15s, background .15s, transform .15s; }
.filter-options--sidebar .filter-option { min-height: 44px; padding: 7px 8px; font-size: 12px; }
.filter-option:hover { border-color: #9eb8df; background: #f5f8fd; transform: translateY(-1px); }
.filter-option:has(input:checked) { color: #174079; border-color: #75a0e2; background: #eaf2ff; box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .08); }
.filter-option:focus-within { outline: 3px solid rgba(37, 99, 235, .25); outline-offset: 2px; }
.filter-option input { width: 17px; height: 17px; flex: 0 0 auto; margin: 0; accent-color: var(--accent); }
.filter-option span { overflow: hidden; text-overflow: ellipsis; }
.filters__selection-summary { margin: 0; color: var(--text-secondary); font-size: 13px; }
.filter-live { min-height: 20px; margin-top: 12px; color: var(--text-secondary); font-size: 12px; }
.filter-error { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding: 10px; border-radius: 8px; color: var(--danger); background: var(--danger-bg); font-size: 12px; }
.filter-error[hidden] { display: none; }
.filter-error button { padding: 3px; border: 0; color: var(--danger); background: transparent; cursor: pointer; font-weight: 800; text-decoration: underline; }
.posts-results { position: relative; min-width: 0; transition: opacity .15s; }
.posts-results.is-loading { min-height: 320px; opacity: .46; pointer-events: none; }
.posts-results.is-loading::after { position: absolute; top: 80px; left: 50%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 999px; color: var(--text); background: var(--surface); box-shadow: var(--shadow); content: "Обновляем…"; font-size: 13px; font-weight: 750; transform: translateX(-50%); }
.filter-notice { margin: -8px 0 24px; padding: 12px 16px; border: 1px solid #bcd0ee; border-radius: 10px; color: #254d82; background: #edf4ff; }
.filter-notice--spam { color: #7a271a; border-color: #f0c1bd; background: var(--danger-bg); }
.table-panel { padding: 0; overflow: hidden; }
.table-panel > .section-header { padding: 20px 24px 0; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 12px 16px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); color: var(--text-secondary); background: var(--surface-soft); font-size: 12px; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
.data-table td { max-width: 420px; padding: 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table small { display: block; margin-top: 3px; color: var(--text-secondary); }
.source-name { display: block; max-width: 180px; overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.post-preview { display: -webkit-box; overflow: hidden; margin: 0; white-space: pre-line; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.post-preview-button { display: -webkit-box; width: 100%; max-width: 560px; padding: 0; overflow: hidden; border: 0; color: var(--text); background: transparent; cursor: pointer; line-height: 1.5; text-align: left; white-space: pre-line; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.post-preview-button:hover { color: var(--accent-dark); text-decoration: underline; text-decoration-color: #b9cae2; text-underline-offset: 3px; }
.badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; color: #475467; background: #eef1f4; font-size: 12px; font-weight: 750; white-space: nowrap; }
.badge--active { color: var(--success); background: var(--success-bg); }
.badge--hidden { color: var(--warning); background: var(--warning-bg); }
.badge--archived { color: #475467; background: #eaecf0; }
.badge--neutral { color: #475467; background: #eef1f4; }
.duplicate-link { font-size: 13px; font-weight: 750; white-space: nowrap; }
.competition-link { display: grid; justify-items: start; gap: 4px; text-decoration: none; }
.competition-link:hover .competition-badge { box-shadow: 0 0 0 2px rgba(37, 99, 235, .18); }
.competition-badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.competition-badge--none { color: #475467; background: #eef1f4; }
.competition-badge--low { color: #166534; background: #dcfce7; }
.competition-badge--medium { color: #92400e; background: #fef3c7; }
.competition-badge--high { color: #b42318; background: #fee4e2; }
.muted { color: var(--text-secondary); }
.empty-state { padding: 48px 24px; text-align: center; }
.empty-state p { color: var(--text-secondary); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 18px 24px; border-top: 1px solid var(--border); }
.pagination a { font-weight: 700; }
.pagination__control, .pagination__page { display: inline-flex; min-width: 38px; min-height: 38px; align-items: center; justify-content: center; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.pagination__control { min-width: 92px; }
.pagination__pages { display: flex; align-items: center; justify-content: center; gap: 5px; }
.pagination__page.is-current { color: white; border-color: var(--accent); background: var(--accent); font-weight: 800; }
.pagination__ellipsis { min-width: 28px; color: var(--text-secondary); text-align: center; }
.pagination__disabled { color: #98a2b3; }

.post-modal { width: min(760px, calc(100vw - 32px)); max-height: min(820px, calc(100vh - 32px)); padding: 0; overflow: hidden; border: 0; border-radius: 16px; color: var(--text); background: var(--surface); box-shadow: 0 24px 80px rgba(16, 24, 40, .28); }
.post-modal::backdrop { background: rgba(15, 23, 42, .58); backdrop-filter: blur(3px); }
.post-modal__panel { display: flex; max-height: min(820px, calc(100vh - 32px)); flex-direction: column; }
.post-modal__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 24px 16px; border-bottom: 1px solid var(--border); }
.post-modal__header h2 { margin-bottom: 0; }
.post-modal__close { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 50%; color: #475467; background: var(--surface); cursor: pointer; font-size: 26px; line-height: 1; }
.post-modal__close:hover { color: var(--text); background: var(--surface-soft); }
.post-modal__loading, .post-modal__error { padding: 64px 24px; color: var(--text-secondary); text-align: center; }
.post-modal__error { display: grid; justify-items: center; gap: 16px; color: var(--danger); }
.post-modal__error[hidden], .post-modal__content[hidden] { display: none; }
.post-modal__content { min-height: 0; overflow-y: auto; padding: 20px 24px 24px; }
.post-modal__meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; color: var(--text-secondary); font-size: 13px; }
.post-modal__text { max-height: 52vh; margin-top: 20px; overflow-y: auto; padding: 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.post-modal__footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.post-modal__action-status { min-height: 20px; margin: 8px 0 0; color: var(--text-secondary); font-size: 13px; text-align: right; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, .85fr); gap: 24px; }
.full-text { max-width: 850px; white-space: pre-wrap; overflow-wrap: anywhere; }
.media-box { margin-top: 24px; padding: 16px; border-radius: 8px; background: var(--surface-soft); }
.meta-list { display: grid; gap: 12px; margin: 0 0 24px; }
.meta-list div { display: grid; gap: 2px; }
.meta-list dt { color: var(--text-secondary); font-size: 12px; }
.meta-list dd { margin: 0; font-weight: 650; }
.meta-list--inline { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 20px; }
.status-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-action-title { margin: 24px 0 6px; }
.technical-details summary { cursor: pointer; font-weight: 750; }
.technical-details pre { max-height: 520px; overflow: auto; padding: 16px; border-radius: 8px; color: #dbe6f5; background: #111827; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.break-all { word-break: break-all; }
.duplicate-stack { display: grid; gap: 16px; }
.duplicate-card { margin-bottom: 0; }
.duplicate-card--canonical { border-left: 4px solid var(--success); }
.duplicate-card__header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.duplicate-card__header > div { display: flex; align-items: center; gap: 10px; }
.duplicate-card time { color: var(--text-secondary); font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 1100px) {
    .topbar__inner { gap: 16px; padding-inline: 20px; }
    .nav__link { padding-inline: 10px; }
    .topbar__user { display: none; }
    .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .posts-layout { grid-template-columns: 280px minmax(0, 1fr); gap: 16px; }
    .filter-options--sidebar { grid-template-columns: 1fr; }
    .filter-options--compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .detail-grid { grid-template-columns: 1fr; }
    .metrics--import { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .topbar__inner { flex-wrap: wrap; padding-block: 10px; }
    .topnav { order: 3; width: 100%; overflow-x: auto; }
    .cabinet-switcher { margin-left: 0; }
    .app-shell { min-height: calc(100vh - 112px); }
    .filters-toggle { display: inline-flex; }
    .posts-layout { grid-template-columns: 1fr; }
    .filters-sidebar { position: static; max-height: none; }
    .js .filters-sidebar { display: none; }
    .js .filters-sidebar.is-open { display: block; }
    .filter-options--sidebar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .topbar { position: static; }
    .topbar__inner { flex-wrap: wrap; gap: 8px 16px; padding: 12px 16px 0; }
    .topbar__account { gap: 8px; }
    .topbar__user { max-width: 120px; }
    .topnav { order: 3; width: calc(100% + 32px); overflow-x: auto; margin: 4px -16px 0; padding: 6px 16px 10px; border-top: 1px solid #2b3647; }
    .nav__link { min-height: 36px; padding: 6px 12px; white-space: nowrap; }
    .main-content { padding: 24px 16px; }
    .page-header, .duplicate-card__header { align-items: stretch; flex-direction: column; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .category-filter__actions { justify-content: space-between; }
    .filter-options--sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters-toggle { width: 100%; }
    .compact-post { grid-template-columns: 1fr; gap: 4px; }
    .data-table thead { display: none; }
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .data-table tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
    .data-table td { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 12px; max-width: none; padding: 6px 0; border: 0; }
    .data-table td::before { content: attr(data-label); color: var(--text-secondary); font-size: 12px; font-weight: 700; }
    .meta-list--inline { grid-template-columns: 1fr; }
    .import-grid, .import-summary__grid { grid-template-columns: 1fr; }
    .pagination { flex-wrap: wrap; gap: 10px; }
    .pagination__pages { order: 3; width: 100%; overflow-x: auto; padding-bottom: 2px; }
    .post-modal__footer { align-items: stretch; flex-direction: column-reverse; }
    .post-modal__footer .button { width: 100%; }
    .danger-zone { align-items: stretch; flex-direction: column; }
    .access-options__grid { grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
    .cabinet-switcher { width: 100%; order: 2; }
    .cabinet-switcher select { max-width: none; }
    .topbar__account { position: absolute; top: 12px; right: 12px; }
    .topnav { order: 4; }
    .copy-field { grid-template-columns: 1fr; }
    .metrics { grid-template-columns: 1fr; }
    .panel, .auth-card { padding: 20px; }
    .table-panel { padding: 0; }
    .data-table td { grid-template-columns: 84px minmax(0, 1fr); }
    .metrics--import { grid-template-columns: 1fr; }
    .filter-options--sidebar { grid-template-columns: 1fr; }
    .filter-options--compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .topbar__user { display: none; }
    .post-modal { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
    .post-modal__panel { max-height: calc(100vh - 16px); }
    .post-modal__header, .post-modal__content { padding-right: 16px; padding-left: 16px; }
}
