/* Zoom Social Manager — vanilla CSS, no build step, CSP-safe (no inline styles needed). */
:root {
  --c-ink: #17203a; --c-ink-2: #36415e; --c-muted: #65708a; --c-line: #e3e7ef; --c-line-2: #cfd6e3;
  --c-bg: #f4f6fa; --c-panel: #fff; --c-brand: #1d2b53; --c-accent: #2f6bff; --c-accent-50: #eaf1ff;
  --c-ok: #1a7f45; --c-ok-50: #e5f5ec; --c-bad: #c62a2a; --c-bad-50: #fdeaea; --c-warn: #a86200; --c-warn-50: #fff4e0;
  --c-info: #2459c9; --c-info-50: #e8efff;
  --c-ig: #c13584; --c-ig-50: #fbe9f3; --c-tt: #111; --c-tt-50: #e8fbfb; --c-tt-accent: #00b8b0;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --r-sm: 6px; --r: 10px; --r-lg: 14px; --sidebar-w: 236px;
  --shadow: 0 1px 2px rgba(23, 32, 58, .05), 0 4px 16px rgba(23, 32, 58, .05);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--c-ink); background: var(--c-bg); -webkit-font-smoothing: antialiased; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--c-accent); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .75rem; }
p { margin: 0 0 .75rem; }
ul, ol { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
code { background: #eef1f6; padding: .05rem .35rem; border-radius: 4px; font-size: .88em; word-break: break-all; }
pre.code, pre.debug { background: #0f1629; color: #e6ebf5; padding: .75rem 1rem; border-radius: var(--r); overflow: auto; font-size: .8rem; white-space: pre-wrap; word-break: break-all; }
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.visually-hidden-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.skip-link { position: absolute; left: 1rem; top: -60px; z-index: 100; background: var(--c-ink); color: #fff; padding: .5rem 1rem; border-radius: var(--r-sm); }
.skip-link:focus { top: .5rem; }
.muted { color: var(--c-muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 650; color: var(--c-ink); text-decoration: none; }
.strong:hover { text-decoration: underline; }
.text-ok { color: var(--c-ok); }
.text-bad { color: var(--c-bad); }
.req { color: var(--c-bad); }
.lead { font-size: 1rem; color: var(--c-ink-2); max-width: 70ch; }
.h2 { font-size: 1.25rem; margin: 0 0 .25rem; }
.h3 { font-size: 1rem; margin: 1.25rem 0 .5rem; }
.link { font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: .25rem; background: none; border: 0; padding: 0; color: var(--c-accent); cursor: pointer; }
.link:hover { text-decoration: underline; }
.icon { width: 20px; height: 20px; flex: none; }
.icon--sm { width: 16px; height: 16px; }
.icon--xs { width: 13px; height: 13px; display: inline-block; vertical-align: -2px; }
.icon--xl { width: 40px; height: 40px; }
.na { color: var(--c-muted); font-size: .8rem; font-style: italic; }

/* Buttons */
.btn { --bg: var(--c-ink); --fg: #fff; --bd: var(--bg); display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 38px; padding: .4rem .95rem; background: var(--bg); color: var(--fg); border: 1.5px solid var(--bd); border-radius: var(--r-sm); font-weight: 600; font-size: .875rem; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color .15s, border-color .15s; }
.btn:hover { filter: brightness(1.08); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn--primary { --bg: var(--c-accent); --fg: #fff; }
.btn--outline { --bg: #fff; --fg: var(--c-ink); --bd: var(--c-line-2); }
.btn--outline:hover { --bd: var(--c-ink); filter: none; }
.btn--ghost { --bg: transparent; --fg: var(--c-ink-2); --bd: transparent; }
.btn--ghost:hover { --bg: #e9edf4; filter: none; }
.btn--danger-text { color: var(--c-bad) !important; }
.btn--sm { min-height: 32px; padding: .25rem .65rem; font-size: .82rem; }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.btn-stack { display: grid; gap: .5rem; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-sm); border: 0; background: transparent; cursor: pointer; color: var(--c-ink-2); }
.icon-btn:hover { background: #e9edf4; }
.inline-form { display: inline; margin: 0; }
.inline-fields { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.inline-fields input[type="url"], .inline-fields input[type="password"] { min-width: 200px; flex: 1; }

/* Status & badges */
.status { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 700; background: #eceff5; color: var(--c-ink-2); white-space: nowrap; }
.status--scheduled, .status--queued { background: var(--c-info-50); color: var(--c-info); }
.status--publishing { background: #f1e8ff; color: #6b34c9; }
.status--published, .status--connected { background: var(--c-ok-50); color: var(--c-ok); }
.status--sent_to_inbox, .status--partial { background: var(--c-warn-50); color: var(--c-warn); }
.status--failed, .status--error, .status--expired { background: var(--c-bad-50); color: var(--c-bad); }
.status--cancelled, .status--disconnected, .status--not_connected { background: #eceff5; color: var(--c-muted); }
.badge { display: inline-block; padding: .05rem .45rem; border-radius: 999px; font-size: .72rem; font-weight: 650; background: #eceff5; color: var(--c-ink-2); }
.badge--ok { background: var(--c-ok-50); color: var(--c-ok); }
.role { display: inline-block; padding: .05rem .45rem; border-radius: 4px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: #eceff5; }
.role--admin { background: #1d2b53; color: #fff; }
.role--marketing { background: var(--c-accent-50); color: var(--c-accent); }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: #fff; border: 1px solid var(--c-line); color: var(--c-ink-2); text-decoration: none; }
.chip.is-active { background: var(--c-ink); color: #fff; border-color: var(--c-ink); }
.chip__n { font-size: .72rem; opacity: .75; }
.chip--instagram { color: var(--c-ig); background: var(--c-ig-50); border-color: transparent; padding: .1rem .45rem; }
.chip--tiktok { color: var(--c-tt); background: var(--c-tt-50); border-color: transparent; padding: .1rem .45rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c-muted); }
.dot--ok { background: var(--c-ok); box-shadow: 0 0 0 3px var(--c-ok-50); }
.dot--stale { background: var(--c-bad); }
.dot--never { background: var(--c-warn); }
.token--valid { color: var(--c-ok); }
.token--expiring { color: var(--c-warn); font-weight: 650; }
.token--expired { color: var(--c-bad); font-weight: 650; }
.token--none { color: var(--c-muted); }
.level { font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.level--error { color: var(--c-bad); }
.level--warning { color: var(--c-warn); }
.level--info { color: var(--c-info); }

/* Alerts */
.alert { padding: .7rem 1rem; border-radius: var(--r); border: 1px solid; margin: 0 0 1rem; font-size: .9rem; background: #fff; }
.alert--success { border-color: #b5dfc5; background: var(--c-ok-50); }
.alert--error { border-color: #f2b9b9; background: var(--c-bad-50); }
.alert--info { border-color: #c3d4fb; background: var(--c-info-50); }
.alert--warning { border-color: #f1d29a; background: var(--c-warn-50); }
.alert.small { padding: .4rem .65rem; margin: .5rem 0; }

/* Layout */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--c-brand); color: #c9d2e8; overflow-y: auto; z-index: 30; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: .6rem; padding: 1.1rem 1rem; color: #fff; text-decoration: none; }
.brand--center { justify-content: center; color: var(--c-ink); margin-bottom: 1.25rem; }
.brand__mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--c-accent); color: #fff; font-weight: 800; font-size: 1.1rem; }
.brand__text { font-size: .95rem; line-height: 1.15; }
.nav { list-style: none; padding: .25rem .6rem; display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: .65rem; padding: .55rem .7rem; border-radius: var(--r-sm); color: inherit; text-decoration: none; font-weight: 550; font-size: .9rem; }
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav a[aria-current="page"] { background: #fff; color: var(--c-brand); }
.nav__badge { margin-left: auto; background: #ff5a5a; color: #fff; border-radius: 999px; font-size: .7rem; font-weight: 800; padding: 0 .45rem; }
.sidebar__foot { margin-top: auto; padding: 1rem; display: flex; align-items: center; gap: .5rem; border-top: 1px solid rgba(255, 255, 255, .1); }
.backdrop { position: fixed; inset: 0; background: rgba(10, 15, 30, .45); z-index: 25; }
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .75rem; padding: .55rem 1.5rem; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--c-line); backdrop-filter: blur(6px); }
.topbar__title { font-size: 1.15rem; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__filter select { max-width: 260px; }
.topbar__user { display: flex; align-items: center; gap: .25rem; }
.topbar__profile { display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; color: var(--c-ink-2); font-size: .85rem; padding: .3rem .5rem; border-radius: var(--r-sm); }
.topbar__profile:hover { background: #e9edf4; }
.topbar__menu { display: none; }
.content { padding: 1.5rem; max-width: 1360px; width: 100%; }
.content:focus { outline: none; }
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.is-open { transform: none; }
  .main { margin-left: 0; }
  .topbar__menu { display: inline-grid; }
  .topbar { padding: .45rem .75rem; flex-wrap: wrap; }
  .topbar__filter { order: 5; width: 100%; }
  .topbar__filter select { max-width: none; width: 100%; }
  .content { padding: 1rem .75rem 5rem; }
  .hide-sm { display: none; }
}

/* Auth */
.auth { display: grid; place-items: center; min-height: 100vh; padding: 1rem; background: linear-gradient(160deg, #1d2b53, #2f6bff); }
.auth__card { width: 100%; max-width: 420px; background: #fff; border-radius: var(--r-lg); padding: 2rem; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.auth__title { font-size: 1.3rem; text-align: center; }
.error-page { text-align: center; }
.error-page__code { font-size: 3rem; font-weight: 800; color: var(--c-accent); margin: 0; }

/* Panels & grids */
.panel { background: var(--c-panel); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: 1.15rem 1.25rem; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.panel--flush { padding: 0; overflow: hidden; }
.panel--narrow { max-width: 560px; }
.panel--inset { background: #f7f9fc; box-shadow: none; padding: .75rem 1rem; margin: 1rem 0; }
.panel--inline { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .65rem 1rem; }
.panel--warning { border-color: #f1d29a; background: var(--c-warn-50); }
.panel--sticky { position: sticky; top: 72px; z-index: 2; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; flex-wrap: wrap; }
.panel__head .panel__title { margin: 0; }
.panel__title { font-size: 1rem; display: flex; align-items: center; gap: .45rem; }
details.panel > summary { cursor: pointer; list-style: none; margin: 0; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel[open] > summary { margin-bottom: .75rem; }
.grid { display: grid; gap: 1.25rem; }
.grid > .panel { margin-bottom: 0; }
.grid { margin-bottom: 1.25rem; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .grid--2, .grid--2-1 { grid-template-columns: 1fr; } }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head p { margin: 0; }
.empty { text-align: center; color: var(--c-muted); padding: 2rem 1rem; display: grid; justify-items: center; gap: .5rem; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--c-line); margin-bottom: 1rem; overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .9rem; text-decoration: none; color: var(--c-muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--c-ink); border-color: var(--c-accent); }
.segmented { display: inline-flex; border: 1px solid var(--c-line-2); border-radius: var(--r-sm); overflow: hidden; }
.segmented a { padding: .35rem .8rem; text-decoration: none; color: var(--c-ink-2); font-weight: 600; font-size: .85rem; }
.segmented a[aria-current="true"] { background: var(--c-ink); color: #fff; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { display: grid; gap: .15rem; background: #fff; border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: 1rem 1.1rem; text-decoration: none; color: var(--c-ink); box-shadow: var(--shadow); border-top: 3px solid var(--c-ink); }
.kpi:hover { border-color: var(--c-line-2); }
.kpi--ok { border-top-color: var(--c-ok); }
.kpi--info { border-top-color: var(--c-info); }
.kpi--bad { border-top-color: var(--c-bad); }
.kpi__label { font-size: .8rem; color: var(--c-muted); font-weight: 600; }
.kpi__value { font-size: 1.9rem; font-weight: 750; line-height: 1.1; }
.kpi__value small { font-size: 1rem; color: var(--c-muted); font-weight: 600; }
.kpi__hint { font-size: .72rem; color: var(--c-muted); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: 0 0 1rem; }
.stats div { background: #f7f9fc; border-radius: var(--r); padding: .6rem .75rem; }
.stats dt { font-size: .75rem; color: var(--c-muted); }
.stats dd { margin: 0; font-weight: 700; font-size: 1.1rem; }
@media (max-width: 600px) { .stats { grid-template-columns: 1fr; } }

/* Forms */
.field { display: grid; gap: .3rem; margin-bottom: .9rem; }
.field label, .label { font-weight: 600; font-size: .85rem; color: var(--c-ink-2); }
.field__hint { font-size: .78rem; color: var(--c-muted); margin: 0; }
.field__error { font-size: .8rem; color: var(--c-bad); margin: 0; font-weight: 600; }
.field--wide { grid-column: 1 / -1; }
.field--end { align-self: end; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="url"], input[type="number"], input[type="date"], input[type="datetime-local"], input:not([type]), select, textarea {
  width: 100%; padding: .5rem .65rem; border: 1px solid var(--c-line-2); border-radius: var(--r-sm); background: #fff; min-height: 38px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--c-accent); outline: 2px solid var(--c-accent-50); }
[aria-invalid="true"] { border-color: var(--c-bad) !important; }
.input--sm { max-width: 110px; }
.input-group { display: flex; gap: .25rem; }
.stack > * + * { margin-top: .25rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 1rem; align-items: start; }
.form-grid--3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: .75rem; }
.checks { display: flex; flex-wrap: wrap; gap: .4rem 1rem; border: 0; padding: 0; margin: 0 0 .75rem; }
.checks label { display: inline-flex; gap: .4rem; align-items: center; font-weight: 500; font-size: .9rem; }
.checks--stack { flex-direction: column; }
.checks--indent { padding-left: 2.6rem; }
.switch { display: flex; align-items: center; gap: .6rem; margin: 0 0 .7rem; cursor: pointer; font-size: .9rem; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__ui { width: 38px; height: 22px; border-radius: 999px; background: var(--c-line-2); position: relative; flex: none; transition: background .15s; }
.switch__ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .switch__ui { background: var(--c-accent); }
.switch input:checked + .switch__ui::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__ui { outline: 3px solid var(--c-accent); outline-offset: 2px; }
.consent { display: flex; gap: .5rem; align-items: flex-start; font-size: .85rem; background: #f7f9fc; padding: .6rem .75rem; border-radius: var(--r); margin: .5rem 0; }
.consent input { margin-top: .2rem; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; margin-bottom: 1rem; background: #fff; border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: .7rem .9rem; }
.filters label { display: grid; gap: .2rem; font-size: .75rem; font-weight: 600; color: var(--c-muted); }
.filters select, .filters input { min-height: 34px; padding: .3rem .5rem; font-size: .85rem; }
.filters__search { flex: 1 1 220px; }
.filters__end { margin-left: auto; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--c-line); vertical-align: top; }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--c-muted); background: #f7f9fc; font-weight: 700; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.table--compact th, .table--compact td { padding: .4rem .55rem; }
.table__group th { background: #eef1f6; color: var(--c-ink); }
tr.is-muted td { opacity: .6; }
.log--error td:first-child { box-shadow: inset 3px 0 var(--c-bad); }
.log--warning td:first-child { box-shadow: inset 3px 0 var(--c-warn); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0 0 1rem; font-size: .9rem; }
.kv dt { color: var(--c-muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv--inline { margin: .5rem 0; }
.plain-list { list-style: none; display: grid; gap: .35rem; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; margin: 1rem 0; }

/* Accounts */
.account-list { list-style: none; display: grid; gap: .55rem; }
.account-list li { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .9rem; }
.account-list a { color: var(--c-ink); text-decoration: none; }
.profile { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar--empty { display: grid; place-items: center; background: #eef1f6; color: var(--c-muted); }
.scope-list, .mode-list { list-style: none; display: grid; gap: .55rem; margin-bottom: 1rem; }
.scope-list li { display: flex; gap: .5rem; align-items: flex-start; }
.scope-list .is-ok svg, .mode-list .is-ok { color: var(--c-ok); }
.scope-list .is-missing svg { color: var(--c-bad); }
.mode-list li { padding: .45rem .65rem; border-radius: var(--r-sm); background: #f7f9fc; font-size: .9rem; }
.mode-list .is-missing { color: var(--c-muted); }
.role-list { list-style: none; display: grid; gap: .4rem; }

/* Week strip & calendar */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; }
@media (max-width: 900px) { .week { grid-template-columns: 1fr; } }
.week__day { background: #f7f9fc; border-radius: var(--r); padding: .5rem; min-height: 90px; display: grid; align-content: start; gap: .35rem; }
.week__day.is-today { background: var(--c-accent-50); box-shadow: inset 0 0 0 1.5px var(--c-accent); }
.week__date { font-size: .78rem; font-weight: 700; margin: 0; }
.week__date span { color: var(--c-muted); font-weight: 600; }
.event { display: grid; gap: 1px; padding: .3rem .45rem; border-radius: 6px; background: #fff; border-left: 3px solid var(--c-muted); text-decoration: none; color: var(--c-ink); font-size: .75rem; line-height: 1.3; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.event:hover { background: #fdfdff; box-shadow: 0 2px 6px rgba(0, 0, 0, .1); }
.event--instagram { border-left-color: var(--c-ig); }
.event--tiktok { border-left-color: var(--c-tt-accent); }
.event--failed { background: var(--c-bad-50); }
.event--published { opacity: .8; }
.event--cancelled { opacity: .5; text-decoration: line-through; }
.event__time { font-weight: 700; }
.event__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.event__meta { color: var(--c-muted); font-size: .7rem; display: flex; gap: .2rem; align-items: center; }
.cal-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.cal-toolbar__label { font-size: 1.15rem; margin: 0 0 0 .5rem; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--c-line); border: 1px solid var(--c-line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: .75rem; }
.calendar__dow { background: #f7f9fc; padding: .4rem; font-size: .75rem; font-weight: 700; color: var(--c-muted); text-align: center; }
.calendar__day { background: #fff; min-height: 118px; padding: .35rem; display: grid; align-content: start; gap: .3rem; min-width: 0; }
.calendar--week .calendar__day { min-height: 360px; }
.calendar__day.is-out { background: #fafbfd; }
.calendar__day.is-out .calendar__date { color: #b3bacb; }
.calendar__day.is-today .calendar__date { color: var(--c-accent); }
.calendar__date { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; font-weight: 700; }
.calendar__dow-sm { display: none; }
.calendar__add { opacity: 0; color: var(--c-muted); }
.calendar__day:hover .calendar__add, .calendar__add:focus { opacity: 1; }
@media (max-width: 760px) {
  .calendar { grid-template-columns: 1fr; }
  .calendar__dow { display: none; }
  .calendar__day { min-height: 0; }
  .calendar--week .calendar__day { min-height: 0; }
  .calendar__day.is-out { display: none; }
  .calendar__dow-sm { display: inline; color: var(--c-muted); font-weight: 600; }
}

/* Timeline */
.timeline { list-style: none; display: grid; gap: .55rem; }
.timeline__item { display: grid; grid-template-columns: 130px 1fr; gap: .75rem; font-size: .87rem; padding-left: .6rem; border-left: 3px solid var(--c-line-2); }
.timeline__item--error { border-left-color: var(--c-bad); }
.timeline__item--warning { border-left-color: var(--c-warn); }
.timeline__time { color: var(--c-muted); font-size: .78rem; }
.timeline--compact .timeline__item { grid-template-columns: 150px 1fr; font-size: .8rem; }
@media (max-width: 600px) { .timeline__item, .timeline--compact .timeline__item { grid-template-columns: 1fr; gap: .1rem; } }

/* Media library */
.media-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .9rem; margin-bottom: 1rem; }
.media-grid--pick { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); max-height: 460px; overflow-y: auto; padding: .25rem; }
.media-card { background: #fff; border: 1px solid var(--c-line); border-radius: var(--r); overflow: hidden; display: grid; align-content: start; }
.media-card > a, .media-card > label:first-child { text-decoration: none; color: var(--c-ink); display: grid; }
.media-card__title { font-size: .82rem; font-weight: 600; padding: .45rem .55rem 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card__meta { font-size: .72rem; color: var(--c-muted); padding: .15rem .55rem; display: flex; gap: .3rem; flex-wrap: wrap; align-items: center; }
.media-card__meta:last-child { padding-bottom: .5rem; }
.media-card--pick { position: relative; cursor: pointer; }
.media-card--pick input[type="checkbox"] { position: absolute; top: .45rem; left: .45rem; z-index: 2; width: 18px; height: 18px; }
.media-card--pick:has(input:checked) { border-color: var(--c-accent); box-shadow: 0 0 0 2px var(--c-accent); }
.media-card__order { font-size: .72rem; padding: .3rem .55rem .5rem; display: flex; gap: .35rem; align-items: center; color: var(--c-muted); }
.media-card__order input { width: 56px; min-height: 26px; padding: .1rem .3rem; }
.js .media-card__order { display: none; }
.thumb { position: relative; display: block; aspect-ratio: 1; background: #eef1f6; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb__ph { display: grid; place-items: center; height: 100%; color: var(--c-muted); }
.thumb__badge { position: absolute; right: .35rem; bottom: .35rem; background: rgba(10, 15, 30, .7); color: #fff; font-size: .7rem; font-weight: 700; border-radius: 4px; padding: .05rem .35rem; display: flex; gap: .2rem; align-items: center; }
.media-strip { list-style: none; display: flex; gap: .4rem; flex-wrap: wrap; margin: .75rem 0; }
.media-strip li { width: 64px; }
.preview-box { background: #0f1629; border-radius: var(--r); overflow: hidden; margin-bottom: 1rem; display: grid; place-items: center; max-height: 560px; }
.preview-box img, .preview-box video { max-height: 560px; width: auto; }

/* Uploader */
.dropzone { display: grid; justify-items: center; gap: .35rem; text-align: center; padding: 1.5rem 1rem; border: 2px dashed var(--c-line-2); border-radius: var(--r-lg); cursor: pointer; color: var(--c-ink-2); background: #fafbfd; }
.dropzone:hover, .dropzone.is-over { border-color: var(--c-accent); background: var(--c-accent-50); }
.dropzone--sm { padding: .7rem; display: flex; justify-content: center; align-items: center; }
.upload-list { list-style: none; display: grid; gap: .4rem; margin-top: .6rem; }
.upload-item { display: grid; grid-template-columns: 1fr auto; gap: .2rem .75rem; font-size: .82rem; padding: .45rem .6rem; background: #f7f9fc; border-radius: var(--r-sm); }
.upload-item progress { grid-column: 1 / -1; width: 100%; height: 6px; }
.upload-item--error { background: var(--c-bad-50); color: var(--c-bad); }
.upload-item--done { background: var(--c-ok-50); }
.picker summary { cursor: pointer; font-weight: 600; font-size: .9rem; margin: .75rem 0 .5rem; }

/* Composer */
.composer { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 1100px) { .composer { grid-template-columns: 1fr; } .panel--sticky { position: static; } }
.tray { list-style: none; display: grid; gap: .45rem; margin-bottom: .5rem; }
.tray__item { display: grid; grid-template-columns: 26px 56px 1fr auto; gap: .6rem; align-items: center; padding: .35rem .5rem; background: #f7f9fc; border-radius: var(--r-sm); font-size: .85rem; }
.tray__item .thumb { width: 56px; border-radius: 4px; }
.tray__n { font-weight: 700; color: var(--c-muted); text-align: center; }
.targets { border: 0; padding: 0; margin: 0 0 1rem; display: grid; gap: .45rem; }
.targets legend { font-weight: 700; display: flex; gap: .4rem; align-items: center; margin-bottom: .35rem; font-size: .9rem; }
.target { display: grid; gap: .3rem; padding: .5rem .6rem; border: 1px solid var(--c-line); border-radius: var(--r-sm); }
.target.is-locked { background: #f7f9fc; }
.target__check { display: flex; gap: .5rem; align-items: center; font-size: .88rem; cursor: pointer; }
.target__mode { min-height: 32px !important; font-size: .82rem; padding: .2rem .4rem !important; }
.creator-info { background: var(--c-tt-50); border-radius: var(--r-sm); padding: .5rem .65rem; margin-bottom: .75rem; }
/* Without JS the TikTok options are always visible; with JS they follow the account selection. */
.js [data-tt-options]:not(.is-visible) { display: none; }

/* Preview (phone mock) */
.preview, .phone { border: 1px solid var(--c-line); border-radius: 18px; overflow: hidden; background: #fff; max-width: 340px; margin: 0 auto .75rem; }
.phone__bar { display: flex; gap: .45rem; align-items: center; padding: .55rem .75rem; font-size: .85rem; border-bottom: 1px solid var(--c-line); }
.phone--tiktok { background: #000; color: #fff; border-color: #000; }
.phone--tiktok .phone__bar { border-color: #222; }
.phone__media, .preview__media { position: relative; background: #0f1629; display: grid; place-items: center; min-height: 200px; aspect-ratio: 4 / 5; }
.phone--tiktok .phone__media { aspect-ratio: 9 / 16; }
.phone__media img, .phone__media video, .preview__media img, .preview__media video { width: 100%; height: 100%; object-fit: cover; }
.phone__count { position: absolute; top: .5rem; right: .5rem; background: rgba(0, 0, 0, .6); color: #fff; font-size: .72rem; padding: .05rem .4rem; border-radius: 999px; }
.phone__caption, .preview__caption { padding: .6rem .75rem; font-size: .82rem; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow-y: auto; }
.caption-text { white-space: pre-wrap; font-family: inherit; font-size: .85rem; background: #f7f9fc; padding: .6rem .75rem; border-radius: var(--r); max-height: 240px; overflow: auto; }

/* Post detail */
.target-card { border: 1px solid var(--c-line); border-radius: var(--r); padding: .75rem .9rem; margin-bottom: .75rem; border-left: 4px solid var(--c-line-2); }
.target-card--published { border-left-color: var(--c-ok); }
.target-card--failed { border-left-color: var(--c-bad); }
.target-card--scheduled, .target-card--queued { border-left-color: var(--c-info); }
.target-card--publishing { border-left-color: #6b34c9; }
.target-card--sent_to_inbox { border-left-color: var(--c-warn); }
.target-card__head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.target-card .btn-row { margin-top: .5rem; }
.manual-box, .log-box { margin-top: .6rem; font-size: .88rem; }
.manual-box summary, .log-box summary { cursor: pointer; font-weight: 600; display: inline-flex; gap: .35rem; align-items: center; }
.manual-box ol { padding-left: 1.2rem; margin: .5rem 0; display: grid; gap: .3rem; }
.log-box .timeline { margin-top: .5rem; }
.target-dots { display: flex; flex-wrap: wrap; gap: .25rem; }
.target-dot { display: inline-flex; gap: .2rem; align-items: center; font-size: .7rem; padding: .05rem .4rem; border-radius: 999px; background: #eceff5; color: var(--c-ink-2); }
.target-dot--published { background: var(--c-ok-50); color: var(--c-ok); }
.target-dot--failed { background: var(--c-bad-50); color: var(--c-bad); }
.target-dot--scheduled, .target-dot--queued { background: var(--c-info-50); color: var(--c-info); }
.target-dot--publishing { background: #f1e8ff; color: #6b34c9; }
.target-dot--sent_to_inbox { background: var(--c-warn-50); color: var(--c-warn); }
.check-list { list-style: none; display: grid; gap: .6rem; margin-bottom: 1rem; }
.check { border: 1px solid var(--c-line); border-radius: var(--r); padding: .6rem .8rem; border-left: 4px solid var(--c-ok); }
.check--warn { border-left-color: var(--c-warn); }
.check--bad { border-left-color: var(--c-bad); background: #fffafa; }
.check__head { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }
.check__msgs { margin: .35rem 0 0 1.1rem; font-size: .84rem; display: grid; gap: .2rem; color: var(--c-warn); }
.check__msgs--bad { color: var(--c-bad); }

/* Analytics charts */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.chart { margin: 0; background: #f7f9fc; border-radius: var(--r); padding: .6rem .75rem; }
.chart figcaption { font-size: .85rem; margin-bottom: .4rem; }
.bars { width: 100%; height: 90px; }
.bars rect { fill: var(--c-ig); opacity: .85; }
.bars rect:hover { opacity: 1; }
.chart__axis { display: flex; justify-content: space-between; }
