:root {
  --ink: #1b1f2a;
  --muted: #697386;
  --canvas: #f5f6f9;
  --surface: #ffffff;
  --line: #e4e7ee;
  --accent: #355fe5;
  --accent-hover: #284ccb;
  --accent-soft: #edf2ff;
  --sidebar: #15171e;
  --danger: #b33a45;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 92px; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 14px/1.55 "Segoe UI Variable", "Segoe UI", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; line-height: 1.25; font-weight: 650; letter-spacing: -.9px; }
h2 { font-size: 17px; line-height: 1.4; font-weight: 650; letter-spacing: -.2px; }
h3 { font-size: 16px; font-weight: 600; line-height: 1.45; }
strong { font-weight: 600; }
.muted { color: var(--muted); }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { display: inline-block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-button { border: 0; background: transparent; color: inherit; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 8px; border-radius: 8px; }
.icon-button:hover { background: #ffffff0d; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 8px; padding: 11px 16px; min-height: 44px; font-size: 13px; font-weight: 600; line-height: 1.4; transition: background .15s, border-color .15s; }
.button .icon { width: 17px; height: 17px; }
.button-primary, .button-dark { background: var(--accent); color: #fff; box-shadow: 0 2px 3px #274abb12; }
.button-primary:hover, .button-dark:hover { background: var(--accent-hover); }
.button-secondary { background: var(--surface); border-color: #dce1ea; color: #3e4657; }
.button-secondary:hover { background: #f7f8fb; border-color: #c8cfdb; }
.button-danger { background: var(--danger); color: white; }
.button-danger:hover { background: #922d36; }
button:focus-visible, a:focus-visible { outline: 3px solid #90adff; outline-offset: 3px; }
input:focus, select:focus { border-color: #6586ee; box-shadow: 0 0 0 3px #355fe514; outline: 0; }
.text-link { color: var(--accent); font-size: 13px; font-weight: 500; }
.text-link:hover { text-decoration: underline; }
.text-link + h1 { margin-top: 14px; }

/* Shell */
.app-shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar { width: 248px; flex-shrink: 0; background: var(--sidebar); color: #a7afbf; padding: 26px 18px 20px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; scrollbar-width: thin; }
.brand { display: block; align-self: flex-start; margin: 0 6px; border-radius: 8px; }
.brand img { width: 196px; height: 56px; }
.workspace-label { display: flex; align-items: center; gap: 10px; margin: 28px 0 30px; padding: 12px 10px; border: 1px solid #2b2e39; border-radius: 10px; background: #1c1f28; }
.workspace-label:hover { border-color: #42485a; }
.workspace-avatar { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px; background: #2b3040; color: #d6dceb; font-size: 13px; font-weight: 600; }
.workspace-copy { flex: 1; min-width: 0; }
.workspace-copy strong { display: block; color: #e8ebf3; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace-copy > span { display: block; color: #9099ac; font-size: 10px; margin-top: 2px; }
.workspace-label > .icon { width: 15px; height: 15px; color: #78839b; }
.nav-label { font-size: 9px; font-weight: 600; letter-spacing: 1.4px; color: #727c93; margin: 0 12px 14px; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 12px; margin-bottom: 5px; border-radius: 8px; color: #a8b0c2; font-size: 13px; font-weight: 500; transition: background .15s, color .15s; }
.nav-item .icon { width: 19px; height: 19px; color: #8793ac; }
.nav-item:hover { background: #222632; color: #f1f4ff; }
.nav-item.active { background: #355fe5; color: #fff; box-shadow: 0 4px 12px #07113830; }
.nav-item.active .icon { color: #e3eaff; }
.nav-badge { margin-left: auto; border: 1px solid #3b4356; border-radius: 4px; padding: 0 5px; font-size: 9px; color: #9da8bf; line-height: 1.7; font-weight: 400; }
.nav-item.active .nav-badge { color: #fff; border-color: #ffffff50; }
.sidebar-bottom { margin-top: auto; padding-top: 36px; }
.account-mini { display: flex; align-items: center; gap: 10px; border-top: 1px solid #2a2d38; padding: 20px 4px 0; }
.account-avatar { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: #303647; color: #e2e8f8; font-size: 13px; font-weight: 600; }
.account-mini > div { min-width: 0; }
.account-mini strong { display: block; color: #e6eaf4; font-size: 12px; max-width: 105px; overflow: hidden; text-overflow: ellipsis; }
.account-mini div > span { display: block; color: #8a95ac; font-size: 10px; margin-top: 2px; }
.account-mini form { margin-left: auto; }
.account-mini .icon-button { color: #8e9ab3; }
.main-column { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.topbar { height: 72px; min-height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 36px; border-bottom: 1px solid var(--line); background: var(--surface); }
.breadcrumb { display: flex; align-items: center; gap: 13px; color: #788295; font-size: 12px; min-width: 0; }
.breadcrumb strong { color: #3f485a; font-weight: 500; }
.breadcrumb-slash { color: #c5cbd7; }
.private-label { display: flex; align-items: center; gap: 7px; color: #788295; font-size: 11px; }
.private-label .icon { width: 14px; height: 14px; }
.main-content { padding: 36px; width: 100%; max-width: 1520px; margin: 0 auto; flex: 1; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading .muted { font-size: 13px; margin-top: 9px; }
.heading-actions { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.date-chip { display: inline-flex; align-items: center; gap: 8px; color: #788295; font-size: 12px; white-space: nowrap; }
.date-chip .icon { width: 16px; height: 16px; }
.app-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 36px 24px; color: #818b9d; font-size: 10px; }
.app-footer > span:first-child { letter-spacing: .4px; font-weight: 500; }
.mobile-menu, .sidebar-backdrop { display: none; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; background: white; color: var(--ink); padding: 10px 16px; border-radius: 6px; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.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; }

/* Cards and overview */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 3px #15234302; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 21px 24px; border-bottom: 1px solid #edf0f5; }
.card-heading h2 { font-size: 15px; }
.pill { display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; padding: 4px 8px; font-size: 10px; line-height: 1.5; white-space: nowrap; font-weight: 500; }
.pill-neutral { color: #667085; background: #f4f5f8; border: 1px solid #e8ebf1; }
.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 18px; margin-bottom: 26px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.stat-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #586176; font-size: 13px; font-weight: 500; }
.stat-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: #f2f4f9; color: #7383a5; flex-shrink: 0; }
.stat-icon .icon { width: 17px; height: 17px; }
.stat-card > strong { display: block; font-size: 36px; font-weight: 600; line-height: 1.2; letter-spacing: -1.2px; margin-top: 16px; font-variant-numeric: tabular-nums; }
.stat-card > p { font-size: 11px; color: #7d8799; margin-top: 9px; }
.overview-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(290px,1fr); gap: 24px; align-items: stretch; }
.empty-state { display: flex; align-items: center; flex-direction: column; text-align: center; padding: 38px 24px; }
.empty-illustration { display: grid; place-items: center; width: 54px; height: 54px; border: 1px solid #e5eaf5; border-radius: 14px; background: #f3f6fd; color: #7185b6; flex-shrink: 0; }
.empty-illustration .icon { width: 26px; height: 26px; }
.empty-state h3, .empty-state h2 { margin-top: 20px; }
.empty-state p { font-size: 13px; color: #778195; line-height: 1.75; margin-top: 9px; }
.empty-state .button { margin-top: 24px; }
.dashboard-empty { min-height: 310px; justify-content: center; }
.shortcut-list { padding: 10px 12px; }
.shortcut { display: flex; align-items: center; gap: 13px; padding: 19px 12px; border-radius: 9px; }
.shortcut + .shortcut { border-top: 1px solid #edf0f5; }
.shortcut:hover { background: #f8f9fc; }
.shortcut-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: #f1f4fb; color: #5d78b4; flex-shrink: 0; }
.shortcut-icon .icon { width: 19px; height: 19px; }
.shortcut > span:nth-child(2) { min-width: 0; }
.shortcut strong { display: block; font-size: 13px; }
.shortcut small { display: block; color: #7d8799; font-size: 11px; margin-top: 4px; }
.shortcut-arrow { width: 16px; height: 16px; color: #9aa5ba; margin-left: auto; }
.large { min-height: 420px; justify-content: center; }
.large h2 { font-size: 21px; }
.large .empty-illustration { width: 64px; height: 64px; }
.post-list { padding: 8px 24px; }
.post-list article { padding: 22px 0; overflow-wrap: anywhere; }
.post-list article + article { border-top: 1px solid var(--line); }
.post-list p { margin: 12px 0; color: #626d81; }
.post-list time { margin-left: 15px; font-size: 12px; color: var(--muted); }

/* Forms */
.settings-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(290px,1fr); gap: 24px; align-items: start; }
.settings-card { padding: 26px; min-width: 0; }
.settings-card .card-heading { padding: 0 0 22px; margin-bottom: 24px; }
.settings-card .card-heading > .icon { width: 18px; height: 18px; color: #8a96af; }
.form-stack { display: flex; flex-direction: column; gap: 22px; }
.field { min-width: 0; }
.field label { display: block; margin-bottom: 8px; font-size: 12px; color: #465067; font-weight: 600; }
.field input, .field select { display: block; width: 100%; height: 46px; padding: 0 13px; border: 1px solid #dce1eb; border-radius: 8px; background: #fff; color: #262d3d; font-size: 14px; transition: border-color .15s, box-shadow .15s; }
.field select { padding-right: 10px; }
.field input::placeholder { color: #99a2b3; }
.field-help { font-size: 11px; color: #7a8599; line-height: 1.7; margin-top: 9px; }
.form-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.errorlist { list-style: none; padding: 0; margin: 7px 0 0; color: #b13b47; font-size: 12px; }
.form-error { padding: 12px 14px; border: 1px solid #f0ced3; background: #fff4f5; border-radius: 8px; }
.form-error .errorlist { margin: 0; }
.notice { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border: 1px solid #d9e3ff; border-radius: 9px; background: #edf2ff; color: #3452a1; margin-bottom: 24px; font-size: 13px; }
.notice .icon { width: 18px; height: 18px; }
.notice-error { border-color: #f0ced3; background: #fff4f5; color: #a13241; }
.account-details { margin: 0 0 28px; }
.account-details div { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 12px 0; border-bottom: 1px solid #f0f2f6; }
.account-details div:first-child { padding-top: 0; }
.account-details dt { color: #7c879a; font-size: 12px; flex-shrink: 0; }
.account-details dd { margin: 0; font-size: 13px; text-align: right; overflow-wrap: anywhere; }
.password-card { max-width: 580px; }

/* Compact account settings */
.settings-page { max-width: 1040px; }
.settings-page .page-heading { margin-bottom: 22px; }
.settings-page h1 { font-size: 26px; letter-spacing: -.7px; }
.settings-panel { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.settings-section { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 28px; padding: 24px; }
.settings-section + .settings-section { border-top: 1px solid var(--line); }
.settings-section-title h2 { font-size: 14px; line-height: 1.5; letter-spacing: -.1px; }
.settings-section-title p { margin-top: 5px; color: #7a8599; font-size: 11px; }
.settings-section-body { position: relative; min-width: 0; }
.settings-page .button { min-height: 36px; padding: 8px 12px; font-size: 12px; border-radius: 7px; white-space: nowrap; }
.settings-page .field label { font-size: 11px; margin-bottom: 6px; }
.settings-page .field input, .settings-page .field select { height: 40px; font-size: 13px; padding-left: 11px; border-radius: 7px; }
.settings-meta { font-size: 11px; color: #7a8599; margin-top: 7px; line-height: 1.6; }
.saved-key-summary { min-height: 44px; padding: 1px 136px 0 0; }
.credential-status { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12px; font-weight: 500; }
.credential-status .status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.credential-status code { font-size: 12px; color: #64718a; letter-spacing: .6px; }
.key-editor > summary { position: absolute; top: 0; right: 0; cursor: pointer; list-style: none; }
.key-editor > summary::-webkit-details-marker { display: none; }
.key-editor > summary:focus-visible, .credential-remove summary:focus-visible { outline: 3px solid #90adff; outline-offset: 3px; }
.key-editor .when-open, .key-editor[open] .when-closed { display: none; }
.key-editor[open] .when-open { display: inline; }
.key-editor-body { min-width: 0; }
.key-editor[open] > .key-editor-body { margin-top: 18px; padding-top: 18px; border-top: 1px solid #edf0f5; }
.empty-key-status { margin: 0 0 12px; }
.compact-key-form > .errorlist { margin: 0 0 12px; }
.key-input-row { display: flex; align-items: center; gap: 10px; }
.key-input-row input { min-width: 0; flex: 1; }
.settings-page .key-input-row .button { min-height: 40px; flex-shrink: 0; }
.key-form-note { display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-top: 8px; font-size: 11px; color: #7a8599; }
.key-form-note a { color: var(--accent); }
.key-form-note a:hover { text-decoration: underline; }
.credential-remove { margin-top: 14px; }
.credential-remove summary { width: fit-content; cursor: pointer; color: var(--danger); font-size: 11px; }
.credential-remove .button { margin-top: 10px; }
.workspace-settings-form { min-width: 0; }
.workspace-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.settings-form-footer { display: flex; justify-content: flex-end; margin-top: 14px; }
.settings-account-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-width: 0; }
.settings-account-info { min-width: 0; }
.settings-account-name { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; font-size: 13px; overflow-wrap: anywhere; }
.settings-account-name .pill { padding: 2px 6px; font-size: 10px; }
@media (max-width: 1150px) {
  .settings-section { grid-template-columns: 155px minmax(0, 1fr); gap: 22px; padding: 22px; }
}
@media (max-width: 960px) {
  .settings-section { grid-template-columns: 1fr; gap: 16px; }
  .settings-section-title { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; }
  .settings-section-title p { margin: 0; }
}
@media (max-width: 560px) {
  .settings-page .page-heading { margin-bottom: 18px; }
  .settings-section { padding: 18px; gap: 18px; }
  .settings-section-title { display: block; }
  .settings-section-title p { margin-top: 3px; }
  .settings-page .button { min-height: 40px; }
  .settings-page .field input, .settings-page .field select { font-size: 16px; height: 42px; }
  .workspace-fields { grid-template-columns: 1fr; gap: 14px; }
  .saved-key-summary { padding-right: 0; }
  .key-editor > summary { position: static; margin-top: 12px; }
  .key-editor[open] > .key-editor-body { margin-top: 14px; padding-top: 14px; }
  .key-input-row { flex-wrap: wrap; }
  .key-input-row input { flex-basis: 100%; }
  .settings-account-row { align-items: flex-start; flex-direction: column; gap: 12px; }
  .settings-form-footer { justify-content: flex-start; }
}

/* Community registry */
.communities-grid { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 24px; align-items: start; }
.communities-list, .community-add { min-width: 0; }
.community-items { list-style: none; margin: 0; padding: 0; }
.community-item { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 24px; }
.community-item + .community-item { border-top: 1px solid var(--line); }
.community-info { min-width: 0; }
.community-info h3 { font-size: 15px; overflow-wrap: anywhere; }
.community-id { font: 12px/1.6 Consolas, "Cascadia Mono", monospace; color: #7b869b; margin-top: 7px; }
.community-vk-link { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-size: 12px; margin-top: 10px; min-height: 28px; }
.community-vk-link:hover { text-decoration: underline; }
.community-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; flex-shrink: 0; }
.community-actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 6px 10px; border: 1px solid #e5e9f1; border-radius: 6px; font-size: 11px; font-weight: 500; }
.community-actions a:hover { background: #f5f7fc; border-color: #d2d9e7; }
.danger-link { color: var(--danger); }
.community-add { padding: 24px; scroll-margin-top: 30px; }
.communities-empty { min-height: 280px; justify-content: center; }
.community-form-card { max-width: 580px; }
.community-delete-name { overflow-wrap: anywhere; }
.community-delete-note { margin: 22px 0; color: var(--muted); }

/* VK and browser window */
.connection-card { padding: 32px; max-width: 800px; }
.connection-card h2 { font-size: 20px; margin-bottom: 14px; }
.connection-card > .muted { font-size: 14px; line-height: 1.8; max-width: 650px; }
.connection-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.connection-note { display: flex; align-items: center; gap: 10px; margin-top: 28px; padding: 15px 16px; border-radius: 8px; background: #f5f7fb; color: #6b7790; font-size: 12px; }
.connection-note .icon { width: 17px; height: 17px; }
.browser-heading { align-items: flex-start; }
.browser-heading form { flex-shrink: 0; }
.browser-card { overflow: hidden; }
.browser-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.browser-toolbar .button { min-height: 34px; padding: 7px 12px; font-size: 11px; }
#browser-stage { height: calc(100dvh - 270px); min-height: 470px; width: 100%; background: #f5f6f9; overflow: hidden; }
#browser-stage:fullscreen { width: 100vw; height: 100dvh; min-height: 0; }

/* Sign-in remains a single form. */
.auth-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--canvas); }
.auth-card { width: 100%; max-width: 390px; padding: 34px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 45px #23314c06; }
.auth-card h1 { margin-bottom: 28px; font-size: 26px; font-weight: 600; letter-spacing: -.6px; }
.auth-card .form-stack { gap: 20px; }
.auth-card .field label { font-size: 13px; }
.auth-card .field input { font-size: 16px; }
.auth-submit { width: 100%; margin-top: 5px; min-height: 46px; font-size: 14px; }
.password-field { position: relative; }
.password-field input { padding-right: 47px; }
.password-toggle { position: absolute; right: 5px; top: 5px; color: #8791a5; }
.password-toggle:hover { background: #f1f4fa; }
.password-toggle .icon { width: 18px; height: 18px; }
.standalone { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.standalone-card { max-width: 520px; padding: 36px; }
.standalone-card h1 { margin: 20px 0 14px; font-size: 27px; }
.standalone-card p { line-height: 1.8; margin-bottom: 26px; }
.section-icon { background: var(--accent-soft); color: var(--accent); padding: 12px; border-radius: 11px; display: inline-flex; }

/* Responsive layout */
@media (min-width: 1700px) {
  .main-content { padding-top: 44px; }
  .stat-card { padding: 24px; }
  .stat-card > strong { font-size: 40px; }
  .dashboard-empty { min-height: 340px; }
}
@media (max-width: 1320px) {
  .date-chip { display: none; }
  .main-content { padding: 30px; }
  .topbar { padding: 0 30px; }
  .stats-grid { gap: 14px; }
  .stat-card { padding: 18px; }
  .stat-label { font-size: 12px; }
}
@media (max-width: 1120px) {
  .communities-grid { grid-template-columns: 1fr; }
  .community-add { order: -1; }
  .community-add .form-stack { max-width: 520px; }
  .settings-grid { grid-template-columns: 1fr; }
  .overview-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .page-heading { align-items: flex-start; }
  .heading-actions .button { max-width: 180px; }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; z-index: 40; top: 0; left: 0; width: 256px; transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility .2s; box-shadow: 16px 0 50px #11182730; }
  .sidebar.is-open { transform: translateX(0); visibility: visible; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 35; width: 100%; height: 100%; border: 0; background: #0b10235c; opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
  .sidebar.is-open + .sidebar-backdrop { opacity: 1; visibility: visible; }
  .mobile-menu { display: inline-flex; margin-left: -8px; margin-right: 3px; color: #61708e; }
  .mobile-menu:hover { background: #f0f3fa; }
  .main-column { width: 100%; }
  .main-content { padding: 28px; }
  .topbar { height: 66px; min-height: 66px; padding: 0 28px; }
  .app-footer { padding-left: 28px; padding-right: 28px; }
  .heading-actions .button { max-width: none; }
}
@media (max-width: 560px) {
  h1 { font-size: 26px; letter-spacing: -.7px; }
  .main-content { padding: 26px 20px; }
  .topbar { padding: 0 20px; }
  .breadcrumb { gap: 9px; font-size: 11px; }
  .private-label { display: none; }
  .page-heading { flex-direction: column; gap: 18px; margin-bottom: 24px; }
  .page-heading .muted { font-size: 12px; line-height: 1.7; margin-top: 8px; }
  .heading-actions, .heading-actions > .button { width: 100%; }
  .stats-grid { gap: 12px; margin-bottom: 20px; }
  .stat-card { padding: 16px; border-radius: 12px; }
  .stat-label { align-items: flex-start; font-size: 12px; gap: 6px; }
  .stat-icon { width: 26px; height: 26px; border-radius: 7px; }
  .stat-icon .icon { width: 15px; height: 15px; }
  .stat-card > strong { font-size: 32px; margin-top: 12px; }
  .stat-card > p { font-size: 10px; line-height: 1.6; min-height: 32px; margin-top: 6px; }
  .overview-grid, .settings-grid, .communities-grid { gap: 20px; }
  .card-heading { padding: 19px 20px; }
  .card-heading h2 { font-size: 14px; }
  .pill { font-size: 9px; }
  .empty-state { padding: 32px 20px; }
  .empty-state p { font-size: 12px; }
  .dashboard-empty { min-height: 300px; }
  .shortcut-list { padding: 7px 8px; }
  .shortcut { padding: 18px 12px; gap: 11px; }
  .shortcut strong { font-size: 13px; }
  .shortcut small { font-size: 11px; }
  .shortcut-icon { width: 36px; height: 36px; }
  .large { min-height: 360px; }
  .large h2 { font-size: 19px; }
  .desktop-break { display: none; }
  .settings-card, .community-add, .connection-card { padding: 22px; }
  .field input, .field select { font-size: 16px; }
  .account-details div { gap: 14px; }
  .account-details dd { font-size: 12px; }
  .community-item { padding: 22px; align-items: flex-start; flex-direction: column; gap: 15px; }
  .community-actions { flex-direction: row; gap: 10px; }
  .community-actions a { min-height: 38px; padding: 8px 13px; font-size: 12px; }
  .communities-empty { min-height: 240px; }
  .connection-card > .muted { font-size: 13px; }
  .connection-note { align-items: flex-start; padding: 14px; font-size: 11px; }
  .connection-note .icon { margin-top: 2px; }
  .browser-toolbar { padding: 10px; font-size: 10px; gap: 10px; }
  .browser-toolbar .button { white-space: nowrap; }
  #browser-stage { height: 65dvh; min-height: 350px; }
  .app-footer { padding: 8px 20px 22px; font-size: 9px; }
  .auth-page { padding: 20px; }
  .auth-card { padding: 28px; }
  .standalone-card { padding: 28px; }
}
@media (max-width: 370px) {
  .main-content { padding-left: 16px; padding-right: 16px; }
  .stat-card { padding: 14px; }
  .stat-icon { display: none; }
  .app-footer { align-items: flex-start; flex-direction: column; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { transition: none !important; scroll-behavior: auto !important; }
}

/* Discussion editor and queue */
.publication-modes { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.publication-modes a { display: flex; align-items: center; gap: 9px; padding: 0 0 14px; color: var(--muted); font-size: 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.publication-modes a[aria-current] { color: var(--ink); border-color: var(--accent); font-weight: 600; }
.publication-modes .icon { width: 18px; height: 18px; }
.gray-source { color: var(--accent); font-size: 10px; }
.publications-page { max-width: 1180px; }
.publications-page h1 { font-size: 26px; }
.publications-page .page-heading { margin-bottom: 24px; }
.publications-page .button { min-height: 40px; padding: 10px 14px; font-size: 12px; }
.back-link { display: inline-block; margin-bottom: 18px; font-size: 12px; color: var(--muted); }
.back-link:hover, .inline-link { color: var(--accent); }
.post-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.post-filters a { display: flex; align-items: center; gap: 9px; padding: 7px 11px; border-radius: 7px; font-size: 12px; color: var(--muted); border: 1px solid transparent; }
.post-filters a[aria-current] { background: #fff; color: var(--ink); border-color: var(--line); }
.post-filters span { color: #8893a7; font-size: 11px; }
.publication-row { display: flex; align-items: center; gap: 24px; padding: 22px; }
.publication-row + .publication-row { border-top: 1px solid var(--line); }
.publication-main { display: flex; gap: 15px; flex: 1; min-width: 0; align-items: flex-start; }
.publication-main > span:last-child { min-width: 0; }
.publication-type { display: grid; place-items: center; width: 38px; height: 42px; border: 1px solid var(--line); border-radius: 8px; color: var(--accent); flex-shrink: 0; background: #f7f9ff; }
.publication-main strong { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.publication-main:hover strong { color: var(--accent); }
.publication-main small { display: block; margin-top: 5px; font-size: 11px; color: var(--muted); }
.publication-excerpt { display: block; margin-top: 9px; color: #7a8497; font-size: 12px; overflow-wrap: anywhere; }
.publication-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex-shrink: 0; }
.publication-meta small { font-size: 11px; color: var(--muted); }
.publications-empty { min-height: 340px; justify-content: center; }
.publications-empty h2 { font-size: 20px; }
.pagination { display: flex; gap: 20px; justify-content: flex-end; margin: 20px 0; font-size: 12px; }
.pagination a { color: var(--accent); }
.status-draft { background: #f1f3f7; color: #6b7689; }
.status-scheduled, .status-queued, .status-publishing { background: #edf2ff; color: #3456be; }
.status-published { background: #edf2ff; color: #304fa8; }
.status-failed, .status-uncertain { background: #fff0e9; color: #9e5326; }
.post-editor { display: grid; grid-template-columns: minmax(0, 1fr) 302px; gap: 22px; align-items: start; }
.editor-main { min-width: 0; padding: 26px; }
.editor-main > .field + .field { margin-top: 22px; }
.editor-main .field input { height: 44px; }
.field textarea { display: block; width: 100%; height: 245px; min-height: 180px; padding: 13px; border: 1px solid #dce1eb; border-radius: 8px; background: #fff; font-family: inherit; font-size: 14px; line-height: 1.7; color: #262d3d; resize: vertical; }
.field textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px #3863ec12; }
.field textarea::placeholder { color: #99a2b3; }
.attachment-section { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 20px; }
.attachment-section h2, .editor-target > h2 { font-size: 14px; font-weight: 600; }
.attachment-section h2 span { color: #8a95a7; font-size: 11px; font-weight: 400; margin-left: 7px; }
.upload-control { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
.upload-control > span { color: #8a95a7; font-size: 11px; }
.upload-control label { cursor: pointer; }
.upload-control input[type=file] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.upload-control:focus-within label { outline: 3px solid #90adff; outline-offset: 3px; }
.attachment-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 15px; }
.attachment-grid:empty { display: none; }
.attachment-tile { width: 104px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.attachment-tile img { display: block; width: 100%; height: 86px; object-fit: cover; }
.attachment-tile > span { display: flex; align-items: center; gap: 5px; padding: 7px; font-size: 11px; color: var(--muted); }
.attachment-tile:has(input:checked) { opacity: .5; border-color: var(--danger); }
.new-attachments img { width: 90px; height: 80px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); }
.editor-side { min-width: 0; }
.editor-target { padding: 22px; min-width: 0; }
.editor-target > h2 { margin-bottom: 22px; }
.editor-target .field select { font-size: 13px; height: 42px; }
.check-row { display: flex; align-items: flex-start; gap: 9px; margin-top: 20px; font-size: 12px; font-weight: 500; cursor: pointer; }
.check-row input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.check-row small { display: block; color: #8993a6; font-size: 11px; line-height: 1.6; font-weight: 400; margin-top: 5px; }
.editor-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.editor-actions form .button { width: 100%; }
.editor-actions .inline-link { font-size: 12px; margin-top: 8px; }
.draft-delete { display: inline-block; font-size: 11px; margin: 18px 22px; }
.topic-preview { padding: 26px; min-width: 0; }
.topic-destination { display: flex; gap: 13px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 24px; }
.topic-destination > .icon { color: var(--accent); width: 23px; height: 23px; }
.topic-destination strong { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.topic-destination small { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.topic-preview > h2 { font-size: 20px; margin-bottom: 14px; overflow-wrap: anywhere; }
.topic-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.85; color: #465067; }
.topic-images { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.topic-images a { width: 145px; max-width: 100%; }
.topic-images img { display: block; width: 100%; height: 122px; object-fit: contain; background: #f7f8fb; border-radius: 8px; border: 1px solid var(--line); }
.schedule-options { border: 0; padding: 0; margin: 0; }
.schedule-options label { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 14px; cursor: pointer; }
.schedule-options input { accent-color: var(--accent); width: 16px; height: 16px; }
.schedule-time { margin-top: 8px; }
.schedule-time[hidden] { display: none; }
.schedule-time input { font-size: 13px; padding: 0 9px; }
.publish-confirm-note { font-size: 11px; line-height: 1.8; color: var(--muted); margin: 20px 0 16px; }
.publish-form > .button { width: 100%; }
.publication-timing-note { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 20px; }
.resolution-form { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 4px; }
.resolution-form .field { margin-top: 16px; }
.resolution-form > .button { margin-top: 14px; width: 100%; }
.uncertain-reset { margin-top: 20px; font-size: 12px; }
.uncertain-reset summary { cursor: pointer; }
.uncertain-reset .button { margin-top: 12px; }
.delete-draft-card { max-width: 580px; }
.delete-draft-card > h2 { overflow-wrap: anywhere; }
.delete-draft-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
@media (max-width: 1100px) {
  .post-editor { grid-template-columns: minmax(0, 1fr) 270px; gap: 16px; }
  .editor-main, .editor-target, .topic-preview { padding: 20px; }
}
@media (max-width: 960px) {
  .post-editor { grid-template-columns: 1fr; }
  .editor-target { max-width: none; }
  .editor-actions { flex-direction: row; flex-wrap: wrap; }
  .editor-actions > * { flex: 1 1 auto; }
  .editor-actions .field-help, .editor-actions .inline-link { flex-basis: 100%; }
}
@media (max-width: 560px) {
  .publications-page h1 { font-size: 24px; }
  .field textarea { font-size: 16px; min-height: 220px; }
  .publication-row { padding: 18px; gap: 16px; align-items: flex-start; flex-direction: column; }
  .publication-type { display: none; }
  .publication-meta { flex-direction: row; align-items: center; gap: 12px; }
  .editor-main, .editor-target, .topic-preview { padding: 18px; }
  .topic-preview > h2 { font-size: 18px; }
  .editor-target .field select, .schedule-time input { font-size: 16px; }
  .topic-images a { width: calc(50% - 5px); }
}
