/* Composer view (mockup 01) — three-column grid: brand/platforms/brief on the
   left, the platform-tabbed editor + variants in the center, platform status
   + queue snapshot + the approve-guarantee card on the right. */

.composer-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
}

.composer-left,
.composer-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.composer-recovery {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  border: 1px solid var(--focus-ring);
  border-radius: var(--radius-md);
  background: var(--bg-sunken);
}

.composer-recovery > span { flex: 1 1 220px; }

.composer-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Left: platform list (one row per platform, not a chip row — matches the
   mockup's vertical "name … status" list; still driven by the same
   togglePlatform() selection state as before). */
.composer-platform-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.composer-platform-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 8px);
  background: none;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: var(--text);
}

.composer-platform-row:hover {
  background: var(--surface-hover, rgba(0, 0, 0, 0.03));
}

.composer-platform-row[aria-pressed="true"] {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.composer-platform-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.composer-platform-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85em;
  color: var(--text-muted);
}

/* Small colored platform mark (mockup 01's left-rail row + tab strip) —
   composer-scoped copy of queue.css/inbox.css's .platform-icon convention. */
.composer-platform-name .platform-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-pill);
  color: #fff;
  font-weight: 700;
  font-size: 0.7rem;
  line-height: 1;
}

/* Center: tab strip over the selected platforms' editors (reuses the
   generic .tabs/.tab pattern already used by Queue/Help — not the mac-*
   chrome tab strip). */
.composer-platform-tabs {
  flex-wrap: wrap;
}

.composer-platform-tabs .tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.composer-platform-tabs .tab .platform-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-pill);
  color: #fff;
  font-weight: 700;
  font-size: 0.6rem;
  line-height: 1;
}

.composer-empty {
  padding: 32px 8px;
  text-align: center;
}

/* views.css's shared .platform-editor gives every view a beige "second
   card" box; mockup 01 has the editor sit directly on composer-main's own
   card with no nested box, so it's neutralized here (composer-scoped
   selector — views.css itself stays untouched for the views that still
   want it). */
.composer-main .platform-editor {
  background: none;
  border: none;
  padding: 0;
}

.platform-editor-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

/* The mockup shows no heading above the textarea at all — the tab strip
   already names the platform. Only show this row when it's actually saying
   something (an AI-assisted badge or a "Generating…" note); a bare platform
   name here would just repeat the active tab. */
.platform-editor-header:not(:has(.badge, .muted-note)) {
  display: none;
}

.platform-editor-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.composer-section-label {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 4px 0 -4px;
}

.composer-char-count {
  display: block;
  text-align: right;
  font-size: 0.85em;
  color: var(--text-muted);
  margin-top: 4px;
}

.variant-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.variant-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border, #e5ddc9);
  border-radius: var(--radius-sm, 8px);
}

.variant-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.variant-card p {
  margin: 0;
  font-size: 0.92em;
}

/* Character count over the platform's real cap (mockup 01) — same warning
   color used elsewhere for blocking states. */
.composer-char-count.over-cap {
  color: var(--danger-ink);
  font-weight: 600;
}

/* Media strip: one thumbnail/video tile or a dashed add-tile, per draft. */
.composer-media-strip {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.composer-media-tile,
.composer-media-add {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 90px;
  border-radius: var(--radius-sm, 8px);
  overflow: hidden;
}

.composer-media-tile {
  border: 1px solid var(--border, #e5ddc9);
  background: var(--surface-hover, rgba(0, 0, 0, 0.03));
}

.composer-media-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.composer-media-video-icon {
  font-size: 2em;
}

.composer-media-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  line-height: 1;
  border: none;
  border-radius: var(--radius-sm, 8px);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
}

.composer-media-add {
  flex-direction: column;
  gap: 2px;
  border: 1px dashed var(--border, #c9beA0);
  color: var(--text-muted);
  font-size: 0.85em;
  text-align: center;
  padding: 8px;
  cursor: pointer;
  background: none;
}

.composer-media-add-icon {
  font-size: 1.2em;
  line-height: 1;
  color: var(--text);
}

.composer-media-add-title {
  font-weight: 600;
  color: var(--text);
}

.composer-media-add-caption {
  font-size: 0.9em;
}

.composer-media-add.uploading {
  opacity: 0.6;
  cursor: wait;
}

/* Footer: notes stacked above the Save-draft / Save-to-queue pair. */
.composer-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.composer-footer-notes {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.composer-footer-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Mockup 01's "Save to queue" is the one warm/coral call-to-action in an
   otherwise purple-primary footer — visually separates "save a draft" from
   "commit it to the queue" without changing what either button does. */
#composer-save-queue {
  background: var(--coral);
}

/* Right rail */
.composer-side .capability-status-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.queue-snapshot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.queue-snapshot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.composer-open-queue {
  width: 100%;
  text-align: center;
  text-decoration: none;
}

.composer-approve-card {
  background: color-mix(in srgb, var(--sunny) 15%, var(--paper, #fff));
  border-color: color-mix(in srgb, var(--sunny) 40%, transparent);
}

.composer-approve-card strong {
  display: block;
  margin-bottom: 4px;
}

@media (max-width: 1100px) {
  .composer-grid {
    grid-template-columns: 1fr;
  }
}
