/* settings-social.css — Settings → Social accounts.
 *
 * app-shell.css ONLY (CODING-STANDARDS §"UI Kit": rk-* is legacy and must not
 * appear on a new page). Everything here is page LAYOUT over shell tokens; the
 * primitives themselves — .card, .btn, .badge, .empty-block, .callout, .avatar
 * — come from the shell and are not restated.
 *
 * Its own file rather than an addition to app-shell.css because .ss-row is one
 * page's row layout, not a platform primitive. Same precedent as
 * control-centre.css, which the standards name as the worked example.
 */

.ss-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border-top: 1px solid var(--border-soft);
}
.ss-row:first-of-type { border-top: 0; }

.ss-row-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;              /* lets the name truncate instead of pushing the buttons off */
}

.ss-row-text { min-width: 0; }

.ss-row-name {
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Amber rather than red: every one of these states is fixed by one button, and
 * a coach reading red concludes something is broken that they have to
 * understand. */
.ss-row-problem {
  font-size: 13px;
  color: var(--warn-text, var(--text-3));
  margin-top: 2px;
}

.ss-row-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* The Page avatar, when Meta gave us one. The letter fallback uses the same box
 * so the row height never jumps between the two. */
.ss-row .avatar {
  width: 40px; height: 40px;
  border-radius: 10px;
  object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3);
  color: var(--text-3);
  font-weight: 600;
  flex-shrink: 0;
}

/* Mobile first (Alex's standing rule): below the shell's small breakpoint the
 * actions drop under the name rather than squeezing it to nothing. */
@media (max-width: 640px) {
  .ss-row { flex-direction: column; align-items: stretch; }
  .ss-row-actions { justify-content: flex-start; }
}

/* ── Marketing → Social: the composer (js/grow-social.js) ──────────────────
 * ⚠️ Unlike facebook-preview.css, this IS our design system — app-shell
 * tokens only. The preview inside it is Facebook's chrome; the surface around
 * it is ours, and mixing the two up in either direction is the mistake.
 * Two columns on desktop (write | preview), stacked on a phone, because on a
 * phone a side-by-side preview is neither.
 */
.gs-writebar { display: flex; justify-content: flex-end; margin-bottom: 14px; }

.gs-composer-body { display: flex; gap: 22px; padding: 18px 22px 22px; align-items: flex-start; }
.gs-col { flex: 1 1 0; min-width: 0; }
.gs-preview-col { flex: 0 1 500px; }

.gs-composer .cw-ta {
  width: 100%; box-sizing: border-box; min-height: 220px; resize: vertical;
  font: inherit; font-size: 15px; line-height: 1.5; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 0 0 12px 12px; border-top: 0;
  background: var(--surface); color: var(--text);
}
.gs-composer .cw-ta:focus { outline: 2px solid var(--accent); outline-offset: -2px; }

.gs-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.gs-chip { position: relative; width: 96px; height: 96px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.gs-chip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gs-chip-rm {
  position: absolute; top: 4px; right: 4px; width: 26px; height: 26px;
  border: 0; border-radius: 50%; background: rgba(0,0,0,.62); color: #fff;
  font-size: 16px; line-height: 1; cursor: pointer;
}

.gs-toolrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.gs-toolrow .tool {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 13.5px;
  cursor: pointer; min-height: 40px;
}
.gs-toolrow .tool:hover { background: var(--surface-2); color: var(--text); }

.gs-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.gs-when { flex: 0 1 220px; min-height: 40px; }
.gs-note { margin-top: 10px; font-size: 12.5px; }

@media (max-width: 900px) {
  /* ⚠️ align-items MUST BE RESET WITH THE DIRECTION, AND THIS IS THE SAME TRAP
     control-centre.css already documents for .cc-row. The desktop rule sets
     `align-items: flex-start`, which is right across a row. Once the container
     becomes a COLUMN, that same property governs the CROSS axis — the width —
     and flex-start sizes every child to its MAX-CONTENT.
     Measured at 390px on dev 2026-08-14 with a video attached: .gs-col went to
     758px inside a 390px viewport, dragging the textarea, the toolbar and both
     buttons off the right edge, because the video's filename is long and
     .gs-videochip-name is nowrap. `stretch` is what makes min-width:0 and the
     ellipsis do their jobs. */
  .gs-composer-body { flex-direction: column; padding: 14px 16px 18px; gap: 18px; align-items: stretch; }
  .gs-preview-col { flex: 1 1 auto; width: 100%; }
  .gs-actions { flex-direction: column; align-items: stretch; }
  .gs-when { flex: 1 1 auto; }
}

/* Facebook takes plain text, so the writing box has no toolbar joined to it —
   see the note in grow-social.js's composerHtml(). It gets its own top border
   back, and a quiet line above explaining why there is nothing to click. */
.gs-plain { font-size: 12.5px; color: var(--text-3); margin: 4px 0 8px; line-height: 1.45; }
.gs-composer .cw-ta.gs-ta-plain { border-radius: 12px; border-top: 1px solid var(--border); }

/* Posts | Comments tabs, and the moderation rows. */
.gs-writebar { align-items: center; gap: 12px; justify-content: space-between; }
.gs-tabs { display: inline-flex; }
.gs-comment-side { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gs-comment-body { margin: 6px 0 4px; }
.gs-reply { margin-top: 12px; }
.gs-reply-ta { min-height: 90px; width: 100%; box-sizing: border-box; border-radius: 12px; }

/* ⚠️ THE CONTROL CENTRE'S MOBILE ROW TREATMENT IS WRONG FOR A COMMENT, AND
   THIS IS THE ONLY PLACE THAT DIFFERS FROM IT. control-centre.css turns
   its own .cc-row-side into a full-width stretched COLUMN under 640px,
   which is right
   for its own rows — one or two big decisions per card ("Send now",
   "Approve"), each worth a full-width tap target.
   A comment row has three small actions plus a status badge, so that rule made
   every comment card four stacked full-width buttons tall: measured at 390px
   on dev 2026-08-14, fourteen comments came to 5,140px of page. Put the three
   back on one wrapping line, keeping a 44px tap height so nothing gets harder
   to hit on the way. */
@media (max-width: 640px) {
  .gs-comment-side {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }
  .gs-comment-side > .badge { align-self: center; }
  .gs-comment-side > .btn { min-height: 44px; padding-left: 14px; padding-right: 14px; }
}

/* "Hold new comments until I approve them" — the per-Page switch (519).
   It sits under the row's name/sub line rather than in .ss-row-actions,
   because it is a setting the coach reads, not an action they take: the
   sentence below it changes with the state and is the whole point. */
.ss-hide { display: flex; align-items: center; gap: 8px; margin-top: 10px; cursor: pointer; font-size: 13.5px; }
.ss-hide input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.ss-hide input:disabled { cursor: default; opacity: .6; }
.ss-hide-note { margin-top: 4px; font-size: 12.5px; color: var(--text-3); line-height: 1.45; max-width: 62ch; }
@media (pointer: coarse) {
  /* A 16px checkbox is a 16px target. Give the whole label the height. */
  .ss-hide { min-height: 44px; }
}

/* The one-line "are these hidden or not" note above the moderation queue. */
.gs-holdmode { padding: 0 18px 12px; font-size: 12.5px; color: var(--text-3); line-height: 1.5; }

/* The attached video in the composer — poster, play badge, name, length and a
   Remove. Sits where the photo chips sit; a post has one or the other. */
.gs-videochip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  position: relative;
}
.gs-videochip img,
.gs-videochip-blank {
  width: 96px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  flex: 0 0 auto;
  background: var(--surface-3, #1c1e21);
}
.gs-videochip-blank { display: flex; align-items: center; justify-content: center; font-size: 20px; }
/* Over the thumbnail, not the row — 96px wide, so 48px in from the padding. */
.gs-videochip-play {
  position: absolute;
  left: 58px;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  color: #1c1e21;
  font-size: 11px;
  padding-left: 2px;
  box-sizing: border-box;
  pointer-events: none;
}
.gs-videochip { min-width: 0; }
.gs-videochip-meta { flex: 1 1 auto; min-width: 0; }
.gs-videochip-name {
  font-weight: 600;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gs-toolrow .tool[disabled] { opacity: .45; cursor: not-allowed; }

/* Why the attached video cannot go out — Meta's limits, said while the coach
   is still choosing rather than after they have written the post. */
.gs-videowarn {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--warn-border, #f0c987);
  background: var(--warn-bg, #fdf6e7);
  color: var(--warn-text, #7a5a12);
  font-size: 12.5px;
  line-height: 1.5;
}
