@font-face { font-family: Inter; src: url("/static/inter-variable.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --panel: #fff;
  --line: #e5e8ee;
  --text: #202635;
  --muted: #626d80;
  --accent: #315ce7;
  --accent-hover: #244bd0;
  --accent-soft: #edf2ff;
  --danger: #a13b39;
  --sidebar: 238px;
  font: 16px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
body:has(dialog[open]) { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 27px; line-height: 1.2; letter-spacing: -.8px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 650; overflow-wrap: anywhere; }
h3 { font-size: 14px; margin-top: 24px; }
p, .muted { font-size: 14px; color: var(--muted); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  padding: 28px 18px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow: auto;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-size: 21px; font-weight: 700; letter-spacing: -.6px; }
.brand:hover { text-decoration: none; }
.sidebar .brand { padding-inline: 10px; }
.brand-icon, .group-avatar, .source-avatar {
  display: grid;
  place-items: center;
  border-radius: 6px;
  flex-shrink: 0;
}
.brand-icon { background: var(--accent); color: white; width: 30px; height: 32px; font-size: 13px; }
.sidebar nav { display: grid; gap: 5px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 11px 10px; border-radius: 6px; color: var(--muted); font-size: 14px; font-weight: 500; }
.sidebar nav a span { font-size: 17px; line-height: 1; }
.sidebar nav a:hover, .sidebar nav a[aria-current] { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.shell { margin-left: var(--sidebar); min-width: 0; }
.top { min-height: 73px; background: var(--panel); border-bottom: 1px solid var(--line); padding: 8px 36px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--muted); }
.frame { max-width: 1600px; padding: 32px 36px 48px; margin-inline: auto; }
.intro, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.intro { margin-bottom: 26px; }
.intro p { margin-top: 8px; }
.stack, .community-settings { display: grid; gap: 18px; min-width: 0; }
.card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 7px; min-width: 0; }
.card { padding: 22px; }
.panel { overflow: hidden; }
.section-title { padding: 18px 20px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.stats > div { display: grid; gap: 6px; padding: 20px 23px; }
.stats > div + div { border-left: 1px solid var(--line); }
.stats span { color: var(--muted); font-size: 13px; }
.stats strong { font-size: 29px; font-weight: 650; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.alert { border-color: #ecd2d2; background: #fff7f6; }
.alert p { margin-top: 8px; }
.alert ul { margin-bottom: 0; padding-left: 20px; }
.table-wrap { overflow-x: auto; }
.table-wrap:focus-visible { outline-offset: -3px; }
table { border-collapse: collapse; width: 100%; min-width: 640px; text-align: left; }
th { background: #fafbfc; color: var(--muted); padding: 12px 16px; font-size: 12px; font-weight: 550; border-block: 1px solid var(--line); }
td { padding: 16px; border-bottom: 1px solid #eef0f4; vertical-align: top; font-size: 13px; overflow-wrap: anywhere; }
td:first-child { width: 35%; }
td p { font-size: 12px; margin-top: 4px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcff; }
.publication-links > * { display: block; }
.title { font-weight: 650; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty p { margin-top: 8px; }
.badge { display: inline-block; border-radius: 4px; padding: 4px 7px; color: #526581; background: #eff3fa; font-size: 12px; white-space: nowrap; }
.badge.waiting { color: #805714; background: #fff4df; }
.badge.found, .badge.uploading, .badge.processing { color: #2349ba; background: var(--accent-soft); }
.badge.enabled { color: #226547; background: #eaf6ef; }
.badge.error, .load-error, .login-error { color: var(--danger); background: #fff0ef; }
.load-error, .login-error { border-radius: 5px; padding: 10px 12px; }

input, select, textarea { font: inherit; border: 1px solid #dfe3eb; border-radius: 8px; }
button { font: inherit; cursor: pointer; }
.busy-label, .loading .idle-label { display: none; }
.loading .busy-label { display: inline; }
.form { display: grid; gap: 12px; margin-top: 16px; }
.form > button { justify-self: start; }
label { display: grid; gap: 6px; min-width: 0; font-size: 13px; font-weight: 550; }
input:not([type=checkbox]), select, textarea { width: 100%; background: var(--panel); color: var(--text); padding: 9px 12px; font-size: 14px; }
input[type=checkbox] { accent-color: var(--accent); }
textarea { resize: vertical; }
.check { display: flex; align-items: start; gap: 8px; }
.check input { flex: none; margin-top: 4px; }
.actions, .inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 9px; }
.inline select { flex: 1; min-width: 145px; }
.remove { margin-top: 18px; }
.source, .entry { border-top: 1px solid var(--line); padding-block: 12px; margin-top: 6px; }
.source { display: flex; gap: 10px; align-items: center; justify-content: space-between; font-size: 13px; overflow-wrap: anywhere; }
.source > :first-child { min-width: 0; }
.source form { flex-shrink: 0; }
.source-channel, .group-identity, .vk-account, .vk-account a { display: flex; gap: 9px; align-items: center; }
.source-channel img, .source-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; }
.source-avatar, .group-avatar { background: var(--accent-soft); color: var(--accent); }
.group { padding: 0; }
.group-row, .group-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.group-row, .group-settings-bar { justify-content: space-between; padding: 16px 20px; }
.group-identity img, .group-avatar { width: 46px; height: 46px; border-radius: 6px; object-fit: cover; flex: none; }
.group-identity h2 a { color: var(--text); }
.group-identity h2 a:hover { color: var(--accent); }
.group-mode, .group-settings-bar, .vk-account { color: var(--muted); font-size: 13px; }
.vk-account { padding: 0 20px 14px; flex-wrap: wrap; }
.vk-account img { border-radius: 50%; object-fit: cover; }
.group-settings-bar { border-top: 1px solid var(--line); background: #fcfdff; border-radius: 0 0 7px 7px; cursor: pointer; color: var(--accent); font-weight: 550; }
.group-settings-bar:hover, .group-settings[open] .group-settings-bar { background: var(--accent-soft); }
.group-settings-bar:focus-visible { outline-offset: -3px; }
.group-settings-bar .muted { margin-inline-start: 8px; font-size: 12px; }
.integration-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 22px; align-items: start; }
.integration-key h2 { margin-bottom: 8px; }
.integration-guide { font-size: 13px; }
.integration-guide ol { padding-left: 20px; color: var(--muted); }
.integration-guide li + li { margin-top: 8px; }
.error-page { max-width: 680px; }
.error-page p { margin-block: 12px; }
.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(100%, 420px); padding: clamp(20px, 5vw, 36px); }
.login-card h1 { margin-top: 24px; }
.login-card .form { margin-top: 22px; }
.login-card .form > button { justify-self: stretch; }
.login-error { margin-top: 14px; }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); padding: 0; }
dialog::backdrop { background: #18233455; backdrop-filter: blur(2px); }
.dialog-header, .community-picker-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 23px; }
.dialog-header { border-bottom: 1px solid var(--line); }
.dialog-header h2 { font-size: 19px; }
.community-picker { position: fixed; inset: 0; margin: auto; width: min(550px, calc(100% - 24px)); height: fit-content; max-height: 86dvh; padding: 0; overflow: hidden; }
.community-picker[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.picker-content { overflow-y: auto; min-height: 0; padding: 14px 23px; }
.picker-content .search { margin-bottom: 12px; }
.community-picker-footer { flex-wrap: wrap; border-top: 1px solid var(--line); }
.settings-content { max-width: 720px; padding: 6px 20px 20px; }
@media (max-width: 1100px) {
  :root { --sidebar: 205px; }
  .sidebar { padding-inline: 12px; }
  .top, .frame { padding-inline: 22px; }
  .integration-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .sidebar { position: static; width: 100%; padding: 16px 16px 8px; border-right: 0; }
  .sidebar .brand { font-size: 19px; padding: 0; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 12px; padding-top: 0; border-top: 0; }
  .sidebar nav a { font-size: 12px; padding: 7px; }
  .sidebar nav a span { font-size: 14px; }
  .shell { margin: 0; }
  .top { min-height: 48px; padding: 4px 16px; }
  .frame { padding: 24px 16px 36px; }
  h1 { font-size: 24px; }
  .stats > div { padding: 10px; }
  .stats span { font-size: 12px; }
  .stats strong { font-size: 23px; }
  .group-row, .group-settings-bar { padding: 12px; }
  .vk-account { padding-inline: 12px; }
  .dialog-header, .community-picker-footer, .picker-content, .settings-content { padding-inline: 14px; }
}

.community-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; align-items: start; }
.group-folder { min-width: 0; }
.group-folder > summary { cursor: pointer; font-weight: 650; }
.group-folder > .community-grid { margin-top: 12px; }
.group-folder.drop-highlight { outline: 2px dashed var(--accent); outline-offset: 3px; background: var(--accent-soft); }
.group-row[draggable] { cursor: grab; }
.group-row[draggable]:active { cursor: grabbing; }
.community-grid .group-identity img, .community-grid .group-avatar { border-radius: 50%; }
.community-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 16px 14px; }
.community-metrics > div { display: grid; padding: 7px 10px; background: #f5f7fc; border-radius: 6px; }
.community-metrics span { font-size: 12px; color: var(--muted); }

button.posting-switch { border-radius: 9999px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; }
.posting-switch span { display: block; position: relative; width: 36px; height: 20px; border-radius: 999px; background: #dbe5ef; }
.posting-switch span::before { content: ""; position: absolute; inset: 1px auto 1px 1px; width: 18px; border-radius: 50%; background: #657c94; }
.posting-switch[aria-checked="true"] span::before { transform: translateX(16px); background: #258cf0; }

.community-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.community-grid > .group { width: 100%; max-width: 350px; }

.posting-settings { width: min(820px, calc(100% - 24px)); }
.posting-settings[open] { grid-template-rows: auto minmax(0, 1fr); }
.posting-settings-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); gap: 24px; padding-block: 20px; }
.posting-settings-section { min-width: 0; }
.posting-settings-section h3 { margin: 0 0 12px; }
.posting-settings-section .inline select { min-width: 0; }
.posting-source-list { max-height: min(34vh, 290px); overflow: auto; padding-right: 6px; }
@media (max-width: 620px) {
  .posting-settings-content { grid-template-columns: minmax(0, 1fr); }
}

/* Shared controls and workspace surfaces */
:root { --bg: #f6f7fa; --line: #e1e6ee; --text: #192338; --muted: #536179; }
.sidebar nav a { min-height: 40px; }
.top { min-height: 56px; }
.intro h1 { letter-spacing: -.035em; }
.community-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 265px), 320px)); gap: 14px; align-items: stretch; }
.community-grid > .group { display: flex; flex-direction: column; max-width: none; border-radius: 12px; }
.group > .group-row:first-child { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; padding: 14px 12px 12px 16px; }
.group-identity { min-width: 0; }
.group-identity h2 { line-height: 1.3; overflow-wrap: anywhere; }
.group-mode { margin-top: 4px; }
.community-metrics { gap: 0; padding: 0 16px 12px; }
.community-metrics > div { background: transparent; padding: 0 10px; border-radius: 0; }
.community-metrics > div:first-child { padding-left: 0; border-right: 1px solid var(--line); }
.community-metrics strong { font-size: 19px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.group-publication-error { display: block; padding: 10px 12px; margin: 0 12px 12px; border-radius: 7px; font-size: 13px; }
.group-publication-error a { display: inline-block; margin: 6px 8px 0 0; }
.community-picker { border-radius: 14px; box-shadow: 0 18px 60px #19233835; }
.posting-settings-content { gap: 20px; }
.posting-settings-section + .posting-settings-section { border-inline-start: 1px solid var(--line); padding-inline-start: 20px; }
.posting-settings-section .inline { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; margin-block: 12px; }
.posting-settings-section .inline label { min-width: 0; }
.posting-settings-section .inline select { width: 100%; }
.posting-settings-section .remove { margin-top: 22px; }
.posting-source-list .source { padding-block: 7px; }
.posting-source-list .source-channel { min-width: 0; overflow-wrap: anywhere; }
table td { vertical-align: top; }
@media (max-width: 760px) {
  .top { min-height: 48px; }
  .sidebar nav a { min-height: 36px; }
  .community-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 245px), 1fr)); }
}
@media (max-width: 620px) {
  .posting-settings-section + .posting-settings-section { border-inline-start: 0; border-top: 1px solid var(--line); padding: 16px 0 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .community-picker[open] { animation: panel-open .14s ease-out; }
  .posting-switch span::before { transition: transform .24s ease, background .24s ease; }
  @keyframes panel-open { from { opacity: 0; transform: translateY(4px); } }
}
/* АвтоКлип design system */
:root { --bg:#f8f9fc; --panel:#fff; --line:#e4e4e7; --text:#18181b; --muted:#71717a; --accent:#4f46e5; --accent-hover:#4338ca; --accent-soft:#eeedff; --sidebar:236px; font-size:14px; }
h1 { font-size:28px; letter-spacing:-.035em; }
.sidebar { display:flex; flex-direction:column; padding:20px 12px 12px; }
.sidebar .brand { font-size:20px; padding-inline:8px; }
.sidebar .brand-icon { width:36px; height:36px; border-radius:10px; }
.ui-icon { flex:none; width:18px; height:18px; vertical-align:middle; }
.sidebar nav { border:0; padding-top:0; margin-top:24px; gap:4px; }
.sidebar nav a { min-height:40px; padding:8px 12px; gap:12px; border-radius:8px; }
.sidebar nav a .nav-text { font-size:14px; line-height:1.4; }
.sidebar nav a[aria-current] { font-weight:650; }
.sidebar-footer { display:grid; gap:4px; margin-top:auto; padding-top:24px; }
.sidebar-footer #collapse-nav { background:transparent; color:var(--muted); border:0; border-radius:8px; padding:8px 12px; display:flex; align-items:center; gap:12px; width:100%; min-height:40px; border-color:transparent; text-align:left; }
@media (min-width:761px) {
  .nav-collapsed { --sidebar:68px; }
  .nav-collapsed .sidebar .nav-text { display:none; }
  .nav-collapsed .sidebar a, .nav-collapsed #collapse-nav { justify-content:center; padding-inline:0; }
}
.frame { max-width:none; width:100%; padding:32px; }
.intro { margin-bottom:24px; }
select, input:not([type=checkbox]) { min-height:36px; border-radius:8px; }
.card, .panel, .stats { border-radius:12px; box-shadow:none; }
.community-summary { grid-template-columns:repeat(4,minmax(0,1fr)); margin-bottom:24px; }
.stats > div { padding:16px 20px; }
.stats strong { color:var(--text); }
.community-toolbar { display:flex; align-items:center; gap:12px; margin-bottom:24px; }
details.group-folder { padding:0 0 16px; background:transparent; border:0; }
.group-folder > summary { padding:12px 0; border-bottom:1px solid var(--line); color:var(--text); }
.group-folder > summary .ui-icon { margin-inline:6px; color:var(--muted); }
.folder-count { margin-left:6px; color:var(--muted); font-size:12px; }
.community-grid { grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; }
.community-grid > .group { width:100%; min-height:184px; min-width:0; }
.group-identity img, .group-avatar { width:44px; height:44px; }
.group-identity h2 { font-size:15px; }
.community-metrics { margin-top:auto; padding-bottom:16px; }
.community-metrics strong { font-size:22px; }
.community-card-footer { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:48px; padding:4px 12px; border-top:1px solid var(--line); }
.integration-tag { display:inline-flex; align-items:center; gap:4px; color:var(--muted); font-size:12px; }
.integration-tag .ui-icon { width:14px; height:14px; }
.posting-switch[aria-checked=true] span::before { background:var(--accent); }
.posting-sheet { position:fixed; inset:0 0 0 auto; margin:0; padding:0; width:min(500px,100%); max-width:100%; height:100dvh; max-height:100dvh; border-radius:12px 0 0 12px; background:var(--panel); border:0; border-left:1px solid var(--line); overflow:hidden; }
.posting-sheet[open] { display:grid; grid-template-rows:auto auto minmax(0,1fr); }
.posting-sheet::backdrop,.community-picker::backdrop { background:#18181b44; backdrop-filter:none; }
.posting-sheet .dialog-header { align-items:flex-start; padding:24px; }
.posting-sheet h2 { font-size:20px; }
.sheet-tabs { display:flex; gap:4px; border-bottom:1px solid var(--line); padding:0 16px; }
.sheet-tabs button { min-height:36px; color:var(--text); background:none; border:0; border-radius:0; border-bottom:2px solid transparent; padding:8px 12px; }
.sheet-tabs button[aria-selected=true] { color:var(--accent); border-bottom-color:var(--accent); }
.sheet-body { overflow:auto; padding:24px; }
.sheet-body h3 { margin:0 0 12px; }
.sheet-body .inline { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; align-items:end; margin-bottom:16px; }
.sheet-body .inline select { width:100%; min-width:0; }
.sheet-body .danger-section { color:var(--danger); padding-top:16px; margin-top:32px; border-top:1px solid var(--line); }
.posting-source-list { max-height:40dvh; }
@media (max-width:1550px) { .community-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:1150px) { .community-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:760px) {
  .sidebar { position:static; width:100%; padding:12px 16px; border-bottom:1px solid var(--line); }
  .sidebar nav { margin-top:8px; }
  .sidebar-footer { padding-top:0; margin-top:4px; justify-content:start; }
  #collapse-nav { display:none; }
  .frame { padding:24px 16px; }
  .community-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .community-summary > div:nth-child(n+3) { border-top:1px solid var(--line); }
  .posting-sheet { border-radius:0; }
}
@media (max-width:520px) {
  .community-grid { grid-template-columns:minmax(0,1fr); }
  .community-toolbar { gap:8px; }
}
@media (prefers-reduced-motion:no-preference) {
  .posting-sheet[open] { animation:sheet-in .18s ease-out; }
  @keyframes sheet-in { from { transform:translateX(24px); opacity:.55; } }
}

/* Approved community card */
:root { --bg: #f7f9fc; --text: #20354b; --muted: #7996b1; --accent: #3999f9; --accent-hover: #177bcf; --accent-soft: #edf6ff; --line: #e4edf5; }
.frame { max-width: 1056px; }
.community-grid {
  grid-template-columns: repeat(auto-fill, min(100%, 320px));
  gap: 16px;
  align-items: start;
  justify-content: center;
}
.community-grid > .group {
  display: block;
  padding: 16px;
  min-height: 0;
  border: 1px solid #e7ebef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 12px rgb(32 53 75 / 5%);
}
.group > .group-row:first-child { padding: 0; gap: 8px; }
.group-identity { gap: 12px; }
.group-identity img, .group-avatar { width: 48px; height: 48px; }
.group-identity h2 { font-size: 14px; }
.group-mode { font-size: 12px; }
.community-metrics { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 16px 0 22px; padding: 0; }
.community-metrics > div, .community-metrics > div:first-child { display: flex; align-items: center; gap: 4px; padding: 0; border: 0; }
.community-metrics .ui-icon { width: 13px; height: 13px; color: var(--accent); }
.community-metrics strong { font-size: 13px; font-weight: 650; line-height: 1.4; }
.community-metrics span { font-size: 12px; }
.community-card-footer { padding: 14px 0 0; min-height: 0; }
.integration-tag .ui-icon { width: 13px; height: 13px; }
button.posting-switch { width: 36px; }
.posting-switch span { width: 34px; background: #cfe1f1; }
.posting-switch[aria-checked=true] span::before { transform: translateX(14px); background: var(--accent); }
.vk-account { padding: 0; margin-bottom: 12px; }
.group-publication-error { margin-inline: 0; }
button.posting-switch:hover:not(:disabled) { background: transparent; }
button.posting-switch:hover:not(:disabled) span { box-shadow: 0 0 0 3px var(--accent-soft); }
button.posting-switch:focus-visible { outline: none; }
button.posting-switch:focus-visible span { outline: 2px solid var(--accent-hover); outline-offset: 3px; }

.community-actions { gap: 15px; }
/* SmmBox community picker */
.community-connect { width: min(560px, calc(100% - 24px)); border: 0; background: #fff; }
.community-connect .dialog-header { align-items: flex-start; border: 0; padding: 22px 24px 16px; }
.community-connect .dialog-header h2 { font-size: 21px; }
.community-connect .dialog-header p { font-size: 12px; margin-top: 4px; }
.community-connect .picker-content { display: flex; flex-direction: column; padding: 0 24px 12px; }
.community-connect .field-input { flex: none; max-width: none; }
.community-connect #available-communities { min-height: 0; max-height: min(336px, 46dvh); overflow: auto; scrollbar-color: #c7d8e8 transparent; scrollbar-width: thin; padding-right: 6px; }
.picker-tools, .picker-connect-help { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.picker-tools { margin: 14px 0 10px; }
.picker-tools button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; color: #1684ee; }
.picker-tools button .ui-icon { width: 14px; height: 14px; }
.picker-community { display: flex; align-items: center; gap: 12px; padding: 10px; min-height: 66px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; }
.picker-community + .picker-community { margin-top: 4px; }
.picker-community:has(input:enabled):hover { background: #f6faff; }
.picker-community:has(:checked) { background: #edf6ff; border-color: #cfe5ff; }
.picker-community:has(input:disabled) { cursor: default; }
.picker-community strong { font-weight: 400; flex: 1; min-width: 0; color: var(--text); font-size: 14px; overflow-wrap: anywhere; }
.picker-community input { appearance: none; display: grid; place-content: center; flex: none; width: 19px; height: 19px; margin: 0; border: 1px solid #bfd5e9; border-radius: 5px; cursor: inherit; }
.picker-community input:checked { background: #3999f9; border-color: #3999f9; }
.picker-community input:checked::before { content: ""; width: 8px; height: 5px; border: solid white; border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.picker-community input:disabled { background: #f3f7fb; }
.picker-avatar { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #e4f1ff; color: var(--text); }
.community-connect .community-picker-footer { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; gap: 16px; padding: 16px 24px 22px; }
.picker-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.picker-submit-actions { display: flex; justify-content: flex-end; gap: 10px; margin-inline-start: auto; }
.picker-actions > span { flex: 1; color: var(--muted); font-size: 12px; white-space: nowrap; }
@media(max-width: 500px) {
  .community-connect .dialog-header, .community-connect .picker-content, .community-connect .community-picker-footer { padding-inline: 14px; }
  .picker-community { gap: 8px; padding-inline: 6px; }
  .picker-avatar { width: 40px; height: 40px; }
}
/* Shared Button system */

.button {

  --button-height: 44px;

  --button-padding: 26px;

  --button-size: 14px;

  --button-bg: #fff;

  --button-ink: #1684ee;

  --button-border: #3999f9;

  --button-hover: #eff7ff;

  --button-shadow: none;

  --button-hover-shadow: none;

  display: inline-flex;

  align-items: center;

  justify-content: center;

  gap: 8px;

  inline-size: fit-content;

  max-inline-size: 100%;

  min-block-size: var(--button-height);

  padding: 0 var(--button-padding);

  border: 2px solid var(--button-border);

  border-radius: 9999px;

  background: var(--button-bg);

  box-shadow: var(--button-shadow);

  color: var(--button-ink);

  font: 600 var(--button-size)/1.2 Inter, "Segoe UI", sans-serif;

  text-align: center;

  text-decoration: none;

  vertical-align: middle;

  cursor: pointer;

  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;

}

.button.primary {

  --button-bg: #3999f9;

  --button-ink: #fff;

  --button-border: transparent;

  --button-hover: #2589eb;

  --button-shadow: 0 0 16px rgba(57, 153, 249, .20);

  --button-hover-shadow: 0 0 18px rgba(57, 153, 249, .28);

}

.button.danger {

  --button-ink: #dc2626;

  --button-border: #ef4444;

  --button-hover: #fef2f2;

}

.button--small { --button-height: 32px; --button-padding: 16px; --button-size: 12px; }

.button--large { --button-height: 48px; --button-padding: 30px; --button-size: 15px; }

.button--icon { inline-size: var(--button-height); padding: 0; }

.button .ui-icon { inline-size: 16px; block-size: 16px; color: inherit; }

.button:not(:disabled):not([aria-busy=true]):is(:hover,:active) {

  background: var(--button-hover);

  box-shadow: var(--button-hover-shadow);

  color: var(--button-ink);

  text-decoration: none;

}

.button:focus-visible { outline: 2px solid var(--button-border, #3999f9); outline-offset: 3px; }

.button.primary:focus-visible { outline-color: #1684ee; }

.button:disabled:not([aria-busy=true]) {

  background: #dce8f3; color: #8da5bd; border-color: transparent;

  box-shadow: none; cursor: not-allowed; transition: none;

}

.button[aria-busy=true] { cursor: wait; }

.button[aria-busy=true]::before {

  content: ""; width: 12px; height: 12px; border: 2px solid currentColor;

  border-right-color: transparent; border-radius: 50%; flex: none;

  animation: button-spin .8s linear infinite;

}

@keyframes button-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {

  .button { transition: none; }

  .button[aria-busy=true]::before { animation: none; }

}

.community-card-footer .group-settings-trigger { margin-inline-start: auto; }

/* Community settings panel */
.posting-sheet { width: min(376px, 100%); border-radius: 0; }
.posting-sheet[open] { grid-template-rows: auto auto minmax(0, 1fr) auto; }
.posting-sheet .dialog-header { align-items: center; border: 0; padding: 20px 14px 20px 22px; }
.sheet-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sheet-avatar { width: 42px; height: 42px; border-radius: 50%; flex: none; object-fit: cover; display: grid; place-items: center; background: #e4f1ff; }
.sheet-identity h2 { font-size: 18px; line-height: 1.25; font-weight: 600; }
.sheet-identity p { font-size: 12px; margin-top: 3px; }
.posting-sheet .sheet-tabs { padding: 0; margin: 0 22px; gap: 0; }
.posting-sheet .sheet-tabs button { flex: 1; min-height: 44px; color: var(--muted); }
.posting-sheet .sheet-tabs button[aria-selected=true] { color: #1684ee; background: transparent; font-weight: 600; }
.posting-sheet .sheet-body { padding: 22px; }
.sheet-source-heading { display: flex; align-items: center; justify-content: space-between; }
.sheet-source-heading span { color: #1684ee; background: #edf6ff; border-radius: 9999px; padding: 2px 8px; font-size: 11px; }
.posting-sheet .posting-source-list { max-height: none; overflow: visible; padding: 0; }
.posting-sheet .posting-source-list .source { min-height: 64px; margin: 0; border-top: 0; border-bottom: 1px solid var(--line); }
.posting-sheet .source-channel { color: var(--text); }
.posting-sheet .source-channel .source-avatar { background: #edf6ff; color: #1684ee; }
.posting-sheet .source-avatar svg { width: 14px; height: 14px; }
.posting-sheet textarea { min-height: 38px; }
.posting-sheet form[action$="/sources"] { gap: 8px; }
.posting-sheet form[action$="/sources"] .button { justify-self: stretch; inline-size: 100%; }
.sheet-footer { display: flex; justify-content: flex-end; padding: 12px 22px 22px; border-top: 1px solid var(--line); background: #fff; }
.button--quiet { --button-bg: transparent; --button-border: transparent; --button-ink: #617f9b; }
.sheet-general .inline { grid-template-columns: minmax(0, 1fr) minmax(112px, 42%); }
.sheet-general .inline .button { width: 100%; padding-inline: 8px; }
.sheet-general .inline select { min-height: 44px; }
.sheet-general > a.button { margin-block: 0 12px; }
.posting-sheet .source-channel { font-size: 15px; }
.posting-sheet .source-channel img, .posting-sheet .source-channel .source-avatar { width: 32px; height: 32px; flex-basis: 32px; }
.posting-sheet { width: min(452px, 100%); }
.posting-sheet .dialog-header { padding: 32px 16px 24px 18px; }
.posting-sheet .sheet-tabs { margin-inline: 18px; }
.posting-sheet .sheet-body { padding: 32px 18px; }
.posting-sheet:has(.sheet-general:not([hidden])) .sheet-footer-close { display: none; }
.sheet-folder-form select { min-height: 42px; background: #fff; border-color: #cfe1f1; }
.sheet-folder-form label { gap: 8px; }
.sheet-posting-row { display: flex; justify-content: space-between; align-items: center; padding-block: 8px; margin-top: 14px; border-bottom: 1px solid var(--line); }
.sheet-wide-action { inline-size: 100%; }
.sheet-general > a.sheet-wide-action { margin: 16px 0 0; }
.sheet-mode { margin-top: 12px; font-size: 12px; color: var(--muted); }
.sheet-mode > summary { cursor: pointer; width: fit-content; }

/* Shared Input and Dropdown */
.community-toolbar { gap: 12px; }
.field-input { position: relative; display: flex; align-items: center; flex: 1; min-width: 0; max-width: 360px; }
.field-input > .ui-icon { color: #3999f9; position: absolute; inset-inline-start: 13px; pointer-events: none; }
.field-input input[type=search], .dropdown-trigger {
  width: 100%; min-height: 42px; height: 42px; padding: 0 13px;
  border: 1px solid #d6e3ef; border-radius: 8px; background: #fff;
  color: #20354b; font: 400 14px/1.2 Inter, "Segoe UI", sans-serif;
  box-shadow: none;
}
.field-input input[type=search] { padding-inline: 41px 40px; }
.field-input input::placeholder { color: #7996b1; }
.field-input input::-webkit-search-cancel-button { appearance: none; }
.field-input input:focus, .dropdown-trigger:focus, .dropdown-trigger[aria-expanded=true] {
  outline: none; border-color: #3999f9; box-shadow: none;
}
.field-clear { position: absolute; inset-inline-end: 5px; width: 32px; height: 32px; display: grid; place-items: center; background: none; border: 0; color: #617f9b; border-radius: 6px; }
.field-clear:hover { background: #f6f7f9; }
.dropdown { min-width: 0; }
.dropdown-trigger { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: start; }
.dropdown-trigger span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown-trigger svg { width: 14px; height: 14px; flex: none; color: #7996b1; }
.dropdown-trigger:disabled { cursor: not-allowed; color: #7996b1; }
.community-toolbar > .dropdown { width: 170px; flex: none; }
.dropdown-menu {
  position: fixed; inset: auto; margin: 0; padding: 6px; border: 1px solid #e7e9ed;
  border-radius: 13px; background: #fff; color: #20354b;
  box-shadow: 0 4px 18px rgb(32 53 75 / 9%); overflow: auto;
}
.dropdown-menu:popover-open { display: grid; gap: 4px; }
.dropdown-option {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 34px; padding: 8px 11px; text-align: start;
  border: 0; border-radius: 7px; background: transparent;
  color: #20354b; font: 400 13px/1.3 Inter, "Segoe UI", sans-serif;
  transition: background-color 150ms ease;
}
.dropdown-option[aria-selected=true] { background: #edf0f3; }
.dropdown-option[aria-selected=false]:is(:hover,:focus-visible) { background: #f6f7f9; }
.dropdown-option:focus-visible { outline: 1px solid #3999f9; outline-offset: -1px; }
.dropdown-option:disabled { opacity: .5; cursor: not-allowed; }
.dropdown-option svg { width: 14px; height: 14px; flex: none; }
.dropdown-option[aria-selected=false] svg { visibility: hidden; }
@media(max-width: 440px) {
  .community-toolbar > .dropdown { width: 145px; }
}
@media(prefers-reduced-motion: reduce) { .dropdown-option { transition: none; } }
/* Publication history */
.publication-totals { display: flex; flex-wrap: wrap; gap: 24px 32px; margin: 0 0 24px; }
.publication-totals div { display: grid; gap: 4px; }
.publication-totals strong { font-size: 25px; line-height: 1.1; color: var(--text); }
.publication-totals span, .publication-count { color: var(--muted); font-size: 12px; }
.publication-tabs { display: flex; overflow-x: auto; gap: 20px; padding-inline: 16px; border-bottom: 1px solid var(--line); }
.publication-tabs button { white-space: nowrap; padding: 14px 0; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); }
.publication-tabs button[aria-pressed=true] { color: #1684ee; border-bottom-color: #3999f9; font-weight: 600; }
.publication-filters { display: flex; gap: 12px; padding: 16px; }
.publication-filters .field-input { max-width: none; }
.publication-filters .dropdown { width: min(160px, 42%); flex: none; }
.publication-table table { min-width: 610px; }
.publication-table th { color: var(--muted); background: #f3f7fb; border: 0; }
.publication-table td { vertical-align: middle; }
.publication-table th:last-child { text-align: end; }
.publication-title { border: 0; padding: 0; background: none; color: var(--text); text-align: start; font-weight: 600; }
.publication-title:hover { color: #1684ee; }
.publication-state { display: inline-flex; align-items: center; gap: 5px; border-radius: 6px; padding: 4px 8px; font-size: 11px; white-space: nowrap; }
.publication-state i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.publication-state.is-published { background: #e6f5ed; color: #197758; }
.publication-state.is-processing { background: #e8f3ff; color: #166cbd; }
.publication-state.is-error { background: #ffeded; color: #b63838; }
.publication-state.is-skipped { background: #edf0f3; color: #60748a; }
.publication-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.button.publication-icon { --button-border: #d6e3ef; }
.publication-count { margin: 0; padding: 14px 16px; border-top: 1px solid var(--line); }
.publication-dialog { width: min(392px, calc(100% - 24px)); padding: 22px; background: #fff; border: 0; border-radius: 12px; }
.publication-dialog[open] { display: block; overflow: auto; }
.publication-dialog dl { margin: 18px 0; }
.publication-dialog dl div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.publication-dialog dt { color: var(--muted); flex: none; }
.publication-dialog dd { margin: 0; text-align: end; overflow-wrap: anywhere; }
.publication-dialog .publication-links, .publication-detail-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 14px; }
@media(max-width: 500px) {
  .publication-totals { gap: 16px; }
  .publication-tabs { gap: 12px; }
  .publication-filters { padding: 12px; }
}

@media(max-width: 380px) { .picker-submit-actions .button { padding-inline: 12px; } }

/* Publication plan, scoped to the group settings sheet */
.publication-plan > section { padding: 20px 0; border-bottom: 1px solid var(--line); }
.publication-plan h3 { margin: 0 0 12px; }
.publication-plan .plan-row h3 { margin: 0; }
.plan-row, .plan-counter, .plan-time { display: flex; align-items: center; gap: 8px; }
.plan-row { justify-content: space-between; }
.plan-counter, .plan-days, .plan-times, .plan-zone { margin: 12px 0; }
.plan-counter input { width: 76px; text-align: center; }
.plan-switch { appearance: none; width: 36px; height: 21px; border: 0; padding: 2px; border-radius: 999px; background: #dce5ef; cursor: pointer; }
.plan-switch::before { content: ""; display: block; width: 17px; height: 17px; background: white; border-radius: 50%; }
.plan-switch:checked { background: var(--accent); }
.plan-switch:checked::before { transform: translateX(15px); }
.plan-segments, .plan-days { display: flex; gap: 4px; }
.plan-segments { background: #f1f5fa; border-radius: 9px; padding: 4px; margin-bottom: 16px; }
.plan-days label, .plan-segments label { flex: 1; min-width: 0; display: grid; place-items: center; position: relative; padding: 8px 2px; border-radius: 7px; border: 1px solid var(--line); cursor: pointer; }
.plan-days label:has(:checked), .plan-segments label:has(:checked) { background: #eaf4ff; color: #1684ee; border-color: #c3dfff; }
.plan-days input, .plan-segments input { position: absolute; opacity: 0; }
.plan-days label:focus-within, .plan-segments label:focus-within { outline: 2px solid var(--accent); }
.plan-times { display: grid; grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); gap: 8px; }
.plan-time { background: #f5f8fc; border: 1px solid var(--line); border-radius: 8px; padding: 4px; }
.plan-time input { min-width: 0; padding-inline: 4px; }
.plan-info { background: #edf6ff; color: var(--text); padding: 12px; border-radius: 8px; margin-top: 12px; }
.schedule-manual { margin-block: 12px; }
.plan-save { display: none; }
.posting-sheet:has(.sheet-general:not([hidden])) .sheet-footer { padding: 18px 24px; }
.posting-sheet:has(.sheet-general:not([hidden])) .plan-save {
  display: flex; width: 100%; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px;
}
.plan-save .button { min-height: 42px; height: 42px; padding-inline: 22px; border-width: 1.5px; }
.plan-save [data-plan-feedback] { margin-right: auto; font-size: 12px; }
.plan-save [data-plan-feedback]:empty { display: none; }
.plan-delete { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.plan-delete .button { --button-ink: #d45750; padding-inline: 0; min-height: 32px; }
.plan-segments label { border-color: transparent; color: var(--muted); }
.plan-segments label:has(:checked) { background: white; border-color: #e3eaf2; box-shadow: 0 1px 5px #20354b0a; font-weight: 600; }
.plan-time input { width: 100%; border: 0; background: transparent; }
.plan-time { gap: 2px; }
.clip-stat-period { display:flex; flex-wrap:wrap; gap:4px; margin:0 0 12px; }
.clip-stat-period [aria-pressed=true] { --button-bg:#eaf4ff; --button-ink:#1684ee; }
.clip-card-stats { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; padding:0 16px 12px; color:#20354b; }
.clip-card-stats span { display:flex; align-items:center; gap:6px; font-size:12px; color:#7996b1; }
.clip-card-stats svg { color:#3999f9; }
.clip-card-stats strong { font-size:22px; font-weight:600; }
.clip-card-stats .positive { color:#299368; }
.clip-card-stats .negative { color:#c33d3d; }
.clip-card-stats small { display:block; font-size:12px; color:#7996b1; }
.clip-card-stats small[hidden] { display:none; }
