/* Dashboard */
body { background: var(--bg-soft); }
.small { font-size: .85rem; }
.boot { padding: 40px; text-align: center; color: var(--muted); }

label { display: block; margin: 0 0 14px; font-size: .9rem; font-weight: 500; }
label .input { margin-top: 6px; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { margin-top: 4px; }
input[type="range"] { display: block; width: 100%; margin-top: 8px; accent-color: var(--accent); }

.btn-block { width: 100%; margin-top: 4px; }
.btn-danger { background: var(--danger); color: #fff; }

.badge {
  display: inline-block;
  padding: .15em .6em;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .8rem;
  font-weight: 600;
  vertical-align: middle;
}

/* ---------- auth screens ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 56px 16px; gap: 28px; }
.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 1.4rem; margin-bottom: 18px; }
.auth-card .notice { margin-bottom: 16px; }
.auth-alt { margin: 14px 0 0; font-size: .9rem; color: var(--muted); text-align: center; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px 16px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
}

.ws-switch { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ws-new { display: flex; gap: 6px; width: 100%; }
.ws-new .input { flex: 1; min-width: 0; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { padding: .5em .7em; border-radius: 7px; color: var(--muted); font-weight: 500; font-size: .95rem; }
.side-nav a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.side-nav a.active { background: var(--accent-soft); color: var(--accent); }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.me { min-width: 0; }
.me-name { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-email { font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.content { padding: 32px 40px; max-width: 920px; width: 100%; }
.content > .notice { margin-bottom: 16px; }

.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.page-head h1 { font-size: 1.5rem; margin: 0; }

.empty {
  padding: 48px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty h2 { font-size: 1.15rem; }
.empty-mascot { width: 84px; margin-bottom: 12px; }

.limit-notice {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--accent-soft);
}
.limit-notice ai-mascot { width: 78px; }
.limit-notice p { margin: .2em 0 .7em; }
.limit-notice .btn { padding: .4em .9em; }
.ai-badge.ai-working { display: inline-flex; align-items: center; gap: 4px; }
.ai-badge.ai-working::after { content: ""; width: 14px; height: 4px; background: radial-gradient(circle, currentColor 1.5px, transparent 2px) 0 0 / 5px 4px repeat-x; }
@media (prefers-reduced-motion: no-preference) {
  .ai-badge.ai-working::after { animation: m-dot 1.2s ease-in-out infinite; }
}

.platform-list { display: flex; flex-direction: column; gap: 10px; }
.platform {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.settings { display: flex; flex-direction: column; gap: 16px; }
.card { padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card h2 { font-size: 1.05rem; margin-bottom: 14px; }
.card.danger { border-color: var(--danger-soft); }

.stack { display: flex; flex-direction: column; gap: 16px; }
.text-danger { color: var(--danger); }
.input-sm { width: auto; padding: .4em .6em; font-size: .9rem; }

/* ---------- inbox ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; }
.tabs button {
  padding: .35em .85em;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--accent-soft); color: var(--accent); }

.comments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.comment { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.comment.open { border-color: var(--accent); }
.comment.is-deleted .comment-text { text-decoration: line-through; color: var(--muted); }
.comment-head {
  display: flex;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.comment-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.comment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.comment-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.post-ref { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment-body { padding: 0 16px 16px 60px; }
.comment-body textarea { resize: vertical; }
.comment-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.comment-actions a { margin-left: auto; }
.reply-sent { padding: 10px 14px; background: var(--bg-soft); border-radius: 8px; }
.reply-sent p { margin: 4px 0 0; white-space: pre-wrap; }
.status { padding: .05em .5em; border-radius: 999px; background: var(--bg-soft); color: var(--muted); }
.more { display: flex; justify-content: center; margin-top: 14px; }

.avatar {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: .9rem;
}
.pill { padding: .05em .5em; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--bg-soft); color: var(--muted); }
.pill-facebook { background: #e7f0ff; color: #1b5fd1; }
.pill-instagram { background: #fde8f1; color: #c0306a; }
.pill-youtube { background: #fde7e7; color: #b3261e; }
.pill-tiktok { background: #e3f7f8; color: #0b6e75; }
.pill-email { background: #fff3dc; color: #8a5300; }
@media (prefers-color-scheme: dark) {
  .pill-facebook { background: #16264a; color: #8db4ff; }
  .pill-instagram { background: #3d1828; color: #ff8fbd; }
  .pill-youtube { background: #3d1616; color: #ff8a80; }
  .pill-tiktok { background: #123236; color: #7fe3ea; }
  .pill-email { background: #3a2a0e; color: #ffc861; }
}
.email-form { margin-top: 4px; }
.email-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.email-servers { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); margin-top: 10px; }
.email-servers .email-user { grid-column: 1 / -1; }
.email-form details summary { cursor: pointer; color: var(--muted); }
@media (max-width: 640px) {
  .email-grid { grid-template-columns: minmax(0, 1fr); }
  .email-servers { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); }
}
/* Long comments and emails show a few lines until opened. */
.comment:not(.open) .comment-text { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }

.tabs { flex-wrap: wrap; }
.ai-badge { padding: .05em .5em; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.ai-badge.ai-flagged, .ai-badge.ai-error { background: var(--danger-soft); color: var(--danger); }
.ai-badge.ai-no_match { background: var(--bg-soft); color: var(--muted); }
.ai-note { margin: 0 0 10px; }
.suggestion { margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 8px; background: var(--bg-soft); }
.suggestion p { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.insert-reply { display: block; max-width: 100%; margin-bottom: 8px; }

.btn-link { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
.btn-link:disabled { opacity: .5; cursor: default; }
.grow { flex: 1; min-width: 0; }
.label { margin-bottom: 6px; font-size: .9rem; font-weight: 500; }
.reply-form .variant + .btn-link, .reply-form .btn-link { margin-bottom: 14px; }
.usage-list { margin: 0 0 12px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.usage-list li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- reply library ---------- */
.reply-form { gap: 0; }
.reply-form h2 { margin-bottom: 14px; }
.variant { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.variant textarea { flex: 1; resize: vertical; }
.reply-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.saved-reply { padding: 16px 18px; }
.saved-reply.inactive { opacity: .65; }
.saved-reply-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.saved-reply > p { margin: 6px 0 0; }
.row-actions { display: inline-flex; gap: 14px; }
.variants { margin: 8px 0 0; padding-left: 18px; }
.variants li { white-space: pre-wrap; overflow-wrap: anywhere; }
.variants li + li { margin-top: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cases { margin-bottom: 14px; }
.cases code, .paste-rows code { padding: 0 .3em; border-radius: 4px; background: var(--bg-soft); font-size: .85em; }
.cases-wrap { max-width: 100%; overflow-x: auto; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 8px; }
.cases-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.cases-table th { position: sticky; top: 0; padding: 6px 8px; background: var(--bg-soft); color: var(--muted); font-size: .8rem; font-weight: 600; text-align: start; white-space: nowrap; }
.cases-table td { padding: 4px 8px; border-top: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.cases-table .input-sm { width: 100%; min-width: 110px; }
.cases-table .case-actions { white-space: nowrap; text-align: end; }
.case-own td { background: var(--bg-soft); }
.case-own label { display: block; margin: 4px 0 8px; }
.paste-rows { margin-top: 8px; }
.paste-rows textarea { width: 100%; }
.cases-view { margin-top: 8px; }
.cases-view summary { cursor: pointer; color: var(--accent); }
.cases-view .cases-wrap { margin-top: 6px; max-height: 420px; overflow-y: auto; }
.post-picks { margin-bottom: 14px; }
.post-picks ul { list-style: none; margin: 0 0 4px; padding: 0; max-height: 260px; overflow-y: auto; }
.post-picks li { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.post-picks li .check { min-width: 0; }

/* ---------- accounts ---------- */
.account-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.account { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.account:first-child { border-top: 0; padding-top: 0; }
.account-pic { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; }
.account-main { flex: 1; min-width: 0; }

@media (max-width: 760px) {
  .comment-body { padding-left: 16px; }
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); gap: 14px; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { flex-direction: row; align-items: center; justify-content: space-between; }
  .content { padding: 20px 16px; }
  .platform { flex-direction: column; align-items: flex-start; }
}

.learned { margin-top: .5rem; }
.learned summary { cursor: pointer; color: var(--muted); }
.learned-list { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .3rem; }
.learned-list li { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }

.dm-preview { margin-top: .5rem; padding: .5rem .7rem; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 6px; }
.dm-preview p { margin: .2rem 0 0; }
.dm-compose { display: grid; gap: .4rem; margin: .4rem 0; }
.dm-note { margin: .5rem 0; color: var(--muted); }
.dm-note p { margin: .2rem 0 0; color: inherit; }
.dm-note.dm-failed { color: var(--danger); }
.table-wrap { overflow-x: auto; padding: 0; }
table.contacts { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.contacts th, table.contacts td { padding: .55rem .8rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.contacts th { font-weight: 600; color: var(--muted); font-size: .8rem; }
table.contacts .num { text-align: right; }

/* ---------- telegram ---------- */
.stack-sm { display: flex; flex-direction: column; gap: 12px; }
.stack-sm > p, .stack-sm > div > p { margin: 0; }
.tg-chat { padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; }
.tg-chat-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.tg-chat-head .btn { margin-left: auto; }
.tg-chat .notice { margin: 8px 0 0; }
.tg-events { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 16px; margin-top: 10px; }
.tg-events label.check { margin: 0; }
.tg-link { padding: 12px 14px; border: 1px dashed var(--accent); border-radius: 8px; background: var(--bg-soft); }
.tg-link p { margin: 0 0 8px; }
.tg-link .row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.btn-small { padding: .3em .7em; font-size: .85rem; }
.badge-warn { background: var(--danger-soft); color: var(--danger); }

/* ---------- desktop companion ---------- */
.link-page { display: flex; justify-content: center; }
.link-card { width: 100%; max-width: 440px; text-align: center; }
.link-card h2 { margin: 0; }
.link-card .row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.link-mascot { width: 96px; margin: 0 auto 8px; display: block; }
.link-code { font: 600 1.6rem/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .12em; padding: 10px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.link-code-input { text-align: center; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 1.2rem; letter-spacing: .12em; text-transform: uppercase; }
.link-device { margin: 0; }
.device-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; }
.device-row .btn { margin-inline-start: auto; }
/* ---------- team ---------- */
.member-who { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.device-row .input-small { width: auto; padding: .3em .5em; font-size: .85rem; }
.device-row .member-who ~ .btn { margin-inline-start: 0; }
.invite-form { display: flex; flex-wrap: wrap; gap: 8px; }
.invite-form input { flex: 1 1 220px; }
.invite-form select { flex: 0 0 auto; width: auto; }
.invite-link { display: block; margin: 6px 0; padding: 6px 8px; border-radius: 6px; background: var(--bg-soft); overflow-wrap: anywhere; font-size: .8rem; }
/* Hide / show / delete on the platform (M9) */
.moderate-actions { margin-top: .5rem; padding-top: .5rem; border-top: 1px dashed var(--border); }
.status-hidden { background: var(--danger-soft); color: var(--danger); }

/* Tags and assignment (M9) */
.tag { display: inline-flex; align-items: center; gap: .3em; padding: .05em .55em; border-radius: 999px; font-size: .8rem;
  background: var(--bg-soft); color: var(--muted); border: 1px solid transparent; }
.tag-blue { background: rgba(59,130,246,.14); color: #3b82f6; }
.tag-green { background: rgba(34,197,94,.14); color: #16a34a; }
.tag-amber { background: rgba(245,158,11,.16); color: #d97706; }
.tag-red { background: rgba(239,68,68,.14); color: #dc2626; }
.tag-purple { background: rgba(168,85,247,.14); color: #9333ea; }
.tag-toggle { cursor: pointer; opacity: .7; font: inherit; font-size: .8rem; }
.tag-toggle.on { opacity: 1; border-color: currentColor; }
.tag-toggle:disabled { cursor: default; }
.tag-x { background: none; border: 0; color: inherit; cursor: pointer; padding: 0 .1em; font-size: 1rem; line-height: 1; }
.tag-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.assignee { color: var(--accent); }
.organize { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: .6rem; }
.organize-assign { display: flex; align-items: center; gap: .4rem; margin: 0; }
.organize-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
/* Working hours (M9) */
.hours { border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .9rem .8rem; margin: 0; min-width: 0; }
.hours legend { padding: 0 .3rem; font-weight: 600; }
.day-picks { display: flex; flex-wrap: wrap; gap: .35rem; }
.day-pick { font: inherit; font-size: .85rem; padding: .3em .7em; border-radius: 999px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); cursor: pointer; }
.day-pick.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.hours-times { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: end; }
.hours-times label { margin: 0; }
.hours-tz { flex: 1 1 14rem; min-width: 0; }
/* ---------- insights ---------- */
.insights {
  --series-auto: #2a78d6;
  --series-manual: #eb6834;
  --series-other: #1baf7a;
  --grid: #eceef1;
}
@media (prefers-color-scheme: dark) {
  .insights {
    --series-auto: #3987e5;
    --series-manual: #d95926;
    --series-other: #199e70;
    --grid: #232731;
  }
}
.insights .toolbar { justify-content: flex-start; margin-bottom: 0; }
.insights .period { width: auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile { padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.tile-label { font-size: .85rem; color: var(--muted); }
.tile-value { font-size: 1.7rem; font-weight: 650; line-height: 1.2; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.tile-note { font-size: .8rem; color: var(--muted); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0 0 14px; padding: 0; font-size: .85rem; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.key-auto { background: var(--series-auto); }
.key-manual { background: var(--series-manual); }
.key-other { background: var(--series-other); }

.chart-plot { position: relative; height: 180px; margin-left: 28px; }
.gridline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--grid); }
.gridline span { position: absolute; right: 100%; transform: translateY(-50%); padding-right: 6px; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cols { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 3px; }
.cols.dense { gap: 1px; }
.col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.col.on { background: var(--bg-soft); border-radius: 4px 4px 0 0; }
.col-stack { width: 100%; max-width: 28px; margin: 0 auto; display: flex; flex-direction: column; gap: 2px; border-radius: 4px 4px 0 0; overflow: hidden; }
.seg { flex: 1 1 0; min-height: 2px; }
.seg-auto { background: var(--series-auto); }
.seg-manual { background: var(--series-manual); }
.seg-other { background: var(--series-other); }
.chart-tip {
  position: absolute; top: 0; z-index: 2; min-width: 150px; padding: 8px 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow);
  font-size: .8rem; pointer-events: none;
}
.chart-tip div { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.chart-tip b { margin-left: auto; font-variant-numeric: tabular-nums; }
.chart-tip .tip-total { color: var(--muted); }
.chart-x { position: relative; height: 22px; margin-left: 28px; font-size: .72rem; color: var(--muted); }
.chart-x span { position: absolute; top: 6px; transform: translateX(-50%); white-space: nowrap; }
.chart-x span:first-child { transform: none; left: 0 !important; }
.chart-x span:last-child { transform: none; left: auto !important; right: 0; }

table.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
table.data-table th, table.data-table td { padding: .45rem .7rem; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data-table th:first-child, table.data-table td:first-child { text-align: left; }
table.data-table th { font-weight: 600; color: var(--muted); font-size: .8rem; }

.breakdowns { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bars li { display: grid; grid-template-columns: minmax(0, 9rem) 1fr 2.5rem; align-items: center; gap: 10px; font-size: .9rem; }
.bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; }
.bar-fill { display: block; height: 100%; min-width: 4px; background: var(--series-auto); border-radius: 0 4px 4px 0; }
.bar-num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- scheduled posts ---------- */
.post-form { max-width: 560px; }
.post-form .counter { display: block; text-align: right; margin-top: 4px; font-weight: 400; }
.post-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.post-item { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--border); }
.post-item:first-child { border-top: 0; padding-top: 0; }
.post-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; background: var(--bg-soft); }
.post-main { min-width: 0; flex: 1; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.post-text { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-error { margin: 6px 0 0; color: var(--danger); }
.post-actions { display: flex; gap: 8px; margin-top: 8px; }
.post-scheduled, .post-publishing { background: var(--accent-soft); color: var(--accent); }
.post-published { background: var(--success-soft); color: var(--success); }
.post-failed { background: var(--danger-soft); color: var(--danger); }

/* ---------- emoji picker (emoji.js) ---------- */
.emoji-btn { position: fixed; z-index: 60; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px;
  background: transparent; font-size: 16px; line-height: 26px; cursor: pointer; opacity: .65; }
.emoji-btn:hover, .emoji-btn[aria-expanded="true"] { opacity: 1; background: var(--bg-soft); }
.emoji-btn:focus-visible { outline: 2px solid var(--accent); opacity: 1; }
.emoji-picker { position: fixed; z-index: 61; width: min(320px, calc(100vw - 16px)); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(16, 24, 40, .18); }
.emoji-tabs { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.emoji-tabs button, .emoji-grid button { border: 0; background: transparent; border-radius: 6px; cursor: pointer;
  font-size: 20px; line-height: 1; padding: 5px; }
.emoji-tabs button[aria-pressed="true"] { background: var(--accent-soft); }
.emoji-tabs button:hover, .emoji-grid button:hover, .emoji-grid button:focus-visible { background: var(--bg-soft); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); max-height: 220px;
  overflow-y: auto; padding: 6px; }
/* Room for the 😊 button, kept all the time so the text doesn't jump on focus. */
textarea:not([data-no-emoji]), input[type="text"]:not([data-no-emoji]), input:not([type]):not([data-no-emoji]) { padding-right: 34px; }
