/* Compose area styles (loaded after styles.css). Full-screen composer: accounts column · centre
   card stack · right panel · icon rail, with a sticky footer. */

.cmp { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--bg); color: var(--text); }
.cmp-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 268px minmax(0, 1fr) auto 52px; }
.cmp.is-acct-collapsed .cmp-body { grid-template-columns: 76px minmax(0, 1fr) auto 52px; }
.cmp-accounts { min-height: 0; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border); }
.cmp-main { min-height: 0; min-width: 0; overflow-y: auto; scroll-padding-top: 12px; }
.cmp-main-inner { max-width: 860px; margin: 0 auto; padding: 16px 22px 40px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cmp-side { min-height: 0; width: 384px; overflow-y: auto; background: var(--surface); border-left: 1px solid var(--border); }
.cmp[data-device="desktop"] .cmp-side { width: 500px; }
.cmp-side-body { padding: 14px 16px 24px; }
.cmp-side-bar { display: none; }
.cmp-side-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cmp-side-head h2 { font-size: 14px; }
.cmp-side h3 { font-size: 13px; color: var(--text-2); }
.cmp-side-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 32px 12px; color: var(--text-3); }
.cmp-device { display: flex; flex-direction: column; gap: 12px; }
.cmp-device.is-mobile { max-width: 360px; margin-inline: auto; width: 100%; }
.cmp-net-label { white-space: nowrap; }

/* icon rail */
.cmp-rail { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0; background: var(--surface); border-left: 1px solid var(--border); }
.cmp-rail-btn { position: relative; width: 36px; height: 36px; border-radius: 9px; border: 0; background: none; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.cmp-rail-btn:hover { background: var(--hover); color: var(--text); }
.cmp-rail-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); }
.cmp-rail-btn .badge { position: absolute; top: -2px; right: -4px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }

/* centre header */
.cmp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; min-width: 0; }
.cmp-head-start, .cmp-head-end { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.cmp-head-end { margin-left: auto; }
.cmp-close { flex: none; }
.cmp-head h1 { font-size: 18px; white-space: nowrap; }
.cmp-preview-toggle { display: none; }

/* cards */
.cmp-card > .card-header { padding: 12px 16px; }
.cmp-card.is-foldable > .card-header { border-bottom-color: var(--border); }
.cmp-card.is-foldable:has(> .card-body[hidden]) > .card-header { border-bottom: 0; }
.cmp-card-toggle { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 0; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 650; color: var(--text); cursor: pointer; text-align: left; }
.cmp-card-toggle .cmp-chev { color: var(--text-3); transition: transform .15s ease; }
.cmp-card-toggle[aria-expanded="false"] .cmp-chev { transform: rotate(-90deg); }
.cmp-editor { container: cmped / inline-size; }
.cmp-editor .editor-box textarea { min-height: 170px; }
.cmp-tools { gap: 2px; }
.cmp-tools .btn.is-active { background: var(--accent-soft); color: var(--accent-ink); }
.cmp-tools .counters { margin-left: 0; margin-right: 6px; }
.cmp-customize.is-active { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--accent-ink); }
@container cmped (max-width: 560px) {
  .cmp-tool-label { display: none; }
}
.cmp-net-tabs { margin-bottom: 2px; }
.cmp-media-strip { padding: 0; }
.cmp-drop { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 18px 12px; }
.cmp-drop > .icon-wrap { color: var(--accent-ink); margin-bottom: 2px; }
.cmp-uploading { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px; }

/* "When to post" radio row */
.cmp-when { display: flex; flex-wrap: wrap; gap: 6px; }
.cmp-when-opt { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px 0 10px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 550; cursor: pointer; user-select: none; }
.cmp-when-opt:hover { color: var(--text); background: var(--surface-2); }
.cmp-when-opt input { margin: 0; width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.cmp-when-opt:has(input:checked), .cmp-when-opt.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.cmp-when-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* footer */
.cmp-footer { flex: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 58px; padding: 10px 18px; background: var(--surface); border-top: 1px solid var(--border); }
.cmp-foot-info { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; }
.cmp-foot-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.cmp-foot-err { display: inline-flex; align-items: center; gap: 4px; color: var(--danger-ink); }
.cmp-split > .btn-icon { width: 34px; border-left-color: color-mix(in srgb, var(--accent-contrast) 35%, var(--accent)); }

/* ---------- accounts column ---------- */
.acol { display: flex; flex-direction: column; min-width: 0; }
.acol-head { position: sticky; top: 0; z-index: 2; background: var(--surface); padding: 12px 12px 6px; }
.acol-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 6px 6px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 14px; font-weight: 650; color: var(--text); cursor: pointer; text-align: left; }
.acol-toggle:hover { background: var(--hover); }
.acol-count { color: var(--text-3); font-weight: 550; font-variant-numeric: tabular-nums; }
.acol-toggle .acol-chev { color: var(--text-3); }
.acol-body { display: flex; flex-direction: column; gap: 8px; padding: 2px 12px 18px; min-width: 0; }
.acol-tools { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.acol-opts { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 2px 4px; }
.acol-opts .check input { width: 15px; height: 15px; }
.acol-list { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acol-group { display: flex; flex-direction: column; min-width: 0; }
.acol-group + .acol-group { margin-top: 6px; }
.acol-group-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); min-width: 0; }
.acol-group-head > input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); flex: none; cursor: pointer; }
.acol-group-btn { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 650; color: var(--text-2); cursor: pointer; text-align: left; }
.acol-group-btn:hover { color: var(--text); }
.acol-group-btn .acol-chev { color: var(--text-3); transition: transform .15s ease; }
.acol-group-btn[aria-expanded="false"] .acol-chev { transform: rotate(-90deg); }
.acol-gcount { font-size: 11.5px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.acol-rows { display: flex; flex-direction: column; gap: 1px; padding: 4px 0 2px; }
.acol-row { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.acol-row:hover { background: var(--hover); }
.acol-row.is-on { background: var(--accent-soft); }
.acol-row > input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); flex: none; cursor: pointer; }
.acol-row:has(> input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.acol-row > input:focus-visible { outline: none; }
.acol-name { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; font-size: 13px; line-height: 1.3; }
.acol-kind { font-size: 11.5px; color: var(--text-3); }
.acol-kind:empty { display: none; }
.acol-warn { color: var(--danger-ink); flex: none; }
.acol-demo { height: 16px; font-size: 10px; flex: none; }
.acol-mini { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 0 4px; }
.acol.is-collapsed .acol-body { display: none; }
.acol.is-collapsed .acol-head { padding-inline: 8px; }
.cmp.is-acct-collapsed .acol-toggle { flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 12px; }
.cmp.is-acct-collapsed .acol-title { display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--text-2); }

@media (max-width: 480px) { .cmp-hide-xs { display: none; } }

/* medium screens: the right panel floats over the centre column */
@media (min-width: 900px) and (max-width: 1199px) {
  .cmp-body { grid-template-columns: 240px minmax(0, 1fr) 52px; }
  .cmp.is-acct-collapsed .cmp-body { grid-template-columns: 76px minmax(0, 1fr) 52px; }
  .cmp-side { position: fixed; top: 0; right: 52px; bottom: 58px; z-index: 65; box-shadow: var(--shadow-overlay); width: min(400px, calc(100vw - 120px)); }
  .cmp[data-device="desktop"] .cmp-side { width: min(500px, calc(100vw - 120px)); }
}

/* phones and small tablets: one column; accounts fold at the top; panels open as a sheet */
@media (max-width: 899px) {
  .cmp-body, .cmp.is-acct-collapsed .cmp-body { display: block; overflow-y: auto; }
  .cmp-accounts { border-right: 0; border-bottom: 1px solid var(--border); overflow: visible; }
  .acol-head { position: static; padding: 10px 12px 6px; }
  .acol.is-collapsed .acol-head { padding: 10px 12px; }
  .cmp.is-acct-collapsed .acol-toggle { flex-direction: row; font-size: 14px; padding: 6px; }
  .cmp.is-acct-collapsed .acol-title { flex-direction: row; display: inline; font-size: 14px; color: var(--text); }
  .acol-mini { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; padding: 4px 6px 0; gap: 6px; }
  .acol-toggle .acol-chev { transform: rotate(90deg); }
  .cmp-main { overflow: visible; }
  .cmp-main-inner { padding: 12px 12px 28px; }
  .cmp-rail { display: none; }
  .cmp-preview-toggle { display: inline-flex; }
  .cmp-side, .cmp[data-device="desktop"] .cmp-side { position: fixed; inset: 0; z-index: 70; width: auto; border-left: 0; }
  .cmp-side-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: 0; z-index: 1; padding: 10px 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .cmp-footer { padding: 8px 12px; gap: 8px; }
  .cmp-foot-info { flex-basis: 100%; }
  .cmp-foot-info:empty { display: none; }
  .cmp-foot-actions { width: 100%; }
  .cmp-foot-actions > .btn { flex: 1 1 auto; }
  .cmp-split { flex: 1 1 auto; }
  .cmp-split > .btn:first-child { flex: 1 1 auto; }
}
@media (max-width: 899px) {
  /* title + close on the first row, pickers below */
  .cmp-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .cmp-head-end { grid-column: 1 / -1; grid-row: 2; margin-left: 0; }
  .cmp-close { grid-column: 2; grid-row: 1; }
}
@media (max-width: 480px) {
  .cmp-head h1 { font-size: 16px; }
  .cmp-when-opt { flex: 1 1 calc(50% - 6px); justify-content: flex-start; }
}
.cmp-loading { overflow: auto; padding-top: 16px; }
