/* 03_create.css — частина style.css, винесена без перестановки правил.
   Огляд, заглушки, Чат, Скіли, Композер, живе прев'ю поста.
   Порядок підключення в index.html повторює порядок частин:
   каскад від розділення не змінився (перевірено побайтно). */
/* ── Overview ─────────────────────────────────────────────────────────── */
.hero{
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 30px 28px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-20); flex-wrap: wrap;
}
.hero::before{
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background: var(--grad-brand-soft);
  opacity: .8; pointer-events: none;
}
.hero::after{
  /* Restrained per the "not-toy-like" pass — was opacity .35, competing with
     every other gradient use on screen. Kept as a faint ambient glow only. */
  content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px;
  border-radius: 50%; background: var(--grad-brand); filter: blur(90px); opacity: .16;
}
.hero-l{ position: relative; z-index: 1; }
.hero-greet{ font: 800 var(--fs-24)/1.2 var(--sans); letter-spacing: -.01em; }
.hero-sub{ margin-top: 6px; color: var(--text-dim); font-size:  var(--fs-13); max-width: 480px; }
.hero-r{ position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-end; gap: var(--sp-10); }
.hero-clock{ font: 700 26px/1 var(--mono); }
.hero-date{ font: 500 var(--fs-12)/1 var(--sans); color: var(--text-dim); text-transform: capitalize; }

.tiles{
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--sp-12);
}
.tile{
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 16px; position: relative; overflow: hidden;
}
.tile{ transition: transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.tile[data-goto]:hover{ border-color: var(--border-hover); transform: translateY(-3px); box-shadow: var(--shadow-2); }
.tile .tl-top{ display:flex; align-items:center; justify-content: space-between; margin-bottom: 10px; }
.tile .tl-ic{
  width: 34px; height: 34px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
  /* 🛑 НЕЙТРАЛЬНИЙ. Це вже третє місце в застосунку з тією самою вадою:
     значок-ярлик пофарбовано брендом, і оскільки значок стоїть на КОЖНІЙ
     картці, теплих плям стає стільки ж, скільки карток. Виміряно: 26 у
     вітрині Studio (`.cmpz-card-ic`), 5 у сервісах (`.svc-card-ic`), 5 на
     плитках показників (тут).

     Значок тут не позначає стан і не є дією — він називає предмет. Колір
     на ньому не несе повідомлення, лише витрачає увагу. */
  background: var(--fill-2); color: var(--text-dim); flex: none;
  box-shadow: inset 0 0 0 1px var(--border);
}
.tile .tl-ic .svg-ic, .tile .tl-ic > svg{ width: 18px; height: 18px; }
.tile .tl-label{ font: 600 var(--fs-11)/1 var(--sans); color: var(--text-mute);letter-spacing: .04em; }
.tile .tl-val{ font: 700 20px/1.2 var(--sans); margin-top: 2px; }
.tile .tl-sub{ font: 500 var(--fs-11)/1.3 var(--sans); color: var(--text-mute); margin-top: 4px; }

.conn-grid{
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-12);
}
.conn-card{
  display: flex; align-items: center; gap: var(--sp-12);
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 14px 16px;
}
.conn-card .cc-ic{
  width: 38px; height: 38px; border-radius: var(--radius-sm); display:flex; align-items:center; justify-content:center;
  font-size:  var(--fs-18); flex: none; background: var(--bg-soft);
}
.conn-card .cc-body{ flex: 1; min-width: 0; }
.conn-card .cc-name{ font: 700 var(--fs-13)/1.3 var(--sans); }
.conn-card .cc-status{ font: 500 var(--fs-11)/1.3 var(--sans); color: var(--text-mute); margin-top: 2px; }
.conn-card .cc-status.pending{ color: var(--warn); }
.conn-card .cc-status.ok{ color: var(--ok); font-weight: 600; }

/* ── Stub views ("в розробці") ────────────────────────────────────────── */
.stub{
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: var(--sp-10);
  padding: 70px 20px; border-radius: var(--radius-lg);
  border: 1.5px dashed var(--border); background: var(--panel);
  margin-top: 10px;
}
.stub .stub-ic{ font-size: 38px; margin-bottom: 6px; }
.stub h3{ margin: 0; font-size: 17px; }
.stub p{ margin: 0; color: var(--text-dim); font-size:  var(--fs-13); max-width: 380px; }

/* ── Chat ─────────────────────────────────────────────────────────────── */
.chat-shell{
  display: flex; flex-direction: column;
  height: calc(100vh - var(--topbar-h) - 150px); min-height: 420px;
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  overflow: hidden;
}
.chat-head{
  display: flex; align-items: center; gap: var(--sp-10);
  padding: 12px 16px; border-bottom: 1px solid var(--border-soft);
  background: var(--panel-2);
}
.chat-head .ch-ic{
  width: 30px; height: 30px; border-radius: var(--ctl-radius-sm); display:flex; align-items:center; justify-content:center;
  background: var(--grad-brand); flex: none; font-size:  var(--fs-15);
}
.chat-head .ch-t{ font: 700 var(--fs-13)/1.3 var(--sans); }
.chat-head .ch-t span{ display:block; font: 500 var(--fs-11)/1.3 var(--mono); color: var(--text-mute); }
.chat-memo{
  margin-left: auto; font: 600 var(--fs-10)/1 var(--mono); color: var(--text-mute);
  display: flex; align-items: center; gap: 5px;
}
.chat-memo.on::before{ content:""; width:6px; height:6px; border-radius:50%; background: var(--ok); box-shadow: 0 0 6px var(--ok); }

.chat-stream{
  flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: var(--sp-12);
}
.msg{ max-width: 78%; padding: 11px 14px; border-radius: var(--radius); font-size:  var(--fs-13); line-height: 1.55; word-wrap: break-word; }
.msg .who{ font: 700 var(--fs-11)/1 var(--sans); margin-bottom: 5px; opacity: .7; }
.msg.assistant{
  align-self: flex-start; background: var(--panel-2); border: 1px solid var(--border-soft);
  border-bottom-left-radius: 4px;
}
.msg.user{
  /* Solid ink — a full rainbow gradient repeated on every chat message
     bubble read as busy, not premium. */
  align-self: flex-end; background: var(--brand-ink); color: var(--on-brand);
  border-bottom-right-radius: 4px;
}
.msg.user .who{ opacity: .85; }
.msg p{ margin: 0 0 8px; }
.msg p:last-child{ margin-bottom: 0; }
.msg pre{ background: var(--code-bg); padding: 10px; border-radius: var(--ctl-radius-sm); overflow-x: auto; font:var(--fs-12)/1.4 var(--mono); }
.msg code{ font:var(--fs-12)/1.4 var(--mono); }
.msg.error{ color: var(--danger); background: rgba(var(--danger-rgb),.08); border-color: rgba(var(--danger-rgb),.3); }

.chat-status{
  padding: 0 16px; height: 0; overflow: hidden; color: var(--text-mute); font: 500 var(--fs-12)/1 var(--sans);
  display: flex; align-items: center; gap: var(--sp-8); transition: var(--t-fast) var(--ease);
}
.chat-status.show{ height: 30px; }
.typing-dot{
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  animation: pulse-dot 1s infinite ease-in-out;
}
@keyframes pulse-dot{ 0%,100%{ opacity:.3; } 50%{ opacity:1; } }

.chat-input{
  display: flex; align-items: center; gap: var(--sp-8);
  padding: 12px 14px; border-top: 1px solid var(--border-soft); background: var(--panel-2);
}
.chat-input input{
  flex: 1; background: var(--bg-soft); border: 1px solid var(--border);
  color: var(--text); border-radius: 999px; padding: 11px 16px; font: 500 var(--fs-13)/1.2 var(--sans);
}
.chat-input input::placeholder{ color: var(--text-mute); }
.chat-input input:focus{ outline: none; border-color: var(--accent); }
.chat-input .btn{ border-radius: 50%; width: 40px; height: 40px; padding: 0; flex: none; }

/* ── Skills ───────────────────────────────────────────────────────────── */
.skill-group{ margin-bottom: 22px; }
.skill-group h4{
  margin: 0 0 10px; font: 700 var(--fs-12)/1 var(--sans); color: var(--text-dim);
  display: flex; align-items: center; gap: var(--sp-8);
}
.skill-group h4 .sg-n{
  font: 700 var(--fs-10)/1 var(--mono); color: var(--text-mute); background: var(--panel-2);
  border: 1px solid var(--border); padding: 2px 7px; border-radius: 999px;
}
.skill-cards{ display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--sp-12); }
.skill-card{
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 14px; display: flex; flex-direction: column; gap: var(--sp-8); transition: var(--t-fast) var(--ease);
}
.skill-card:hover{ border-color: var(--border-hover); transform: translateY(-3px); box-shadow: var(--shadow-2); }
.skill-card-flagship{
  position: relative;
  border-color: transparent;
  background:
    linear-gradient(var(--panel), var(--panel)) padding-box,
    var(--grad-brand) border-box;
  border: 1px solid transparent;
}
.skill-card-flagship:hover{ filter: brightness(1.05); }
.sc-top{ display: flex; align-items: center; gap: var(--sp-8); }
.sc-ic{
  width: 30px; height: 30px; border-radius: var(--ctl-radius-sm); display: flex; align-items: center; justify-content: center;
  background: var(--grad-brand-soft); flex: none; font-size:  var(--fs-15);
}
.sc-kind{ font: 600 var(--fs-11)/1 var(--sans); color: var(--text-mute); }
.sc-dot{ margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--text-mute); }
.skill-card[data-state="running"] .sc-dot{ background: var(--warn); box-shadow: 0 0 6px var(--warn); animation: pulse-dot 1s infinite; }
.skill-card[data-state="done"] .sc-dot{ background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.skill-card[data-state="error"] .sc-dot{ background: var(--danger); box-shadow: 0 0 6px var(--danger); }
.sc-label{ font: 700 var(--fs-13)/1.3 var(--sans); }
.sc-desc{ font: 500 var(--fs-12)/1.4 var(--sans); color: var(--text-dim); flex: 1; }
.sc-input{
  width: 100%; resize: none; overflow: hidden; min-height: 36px; max-height: 200px;
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 8px 10px; font: 500 var(--fs-12)/1.4 var(--sans);
}
.sc-input::placeholder{ color: var(--text-mute); }
.sc-input:focus{ outline: none; border-color: var(--accent); }
.sc-status{ font: 500 var(--fs-11)/1.3 var(--mono); color: var(--text-mute); min-height: 14px; }
.sc-actions{ display: flex; gap: var(--sp-8); margin-top: 4px; }
.sc-actions .btn{ flex: 1; }
.sc-stop{ display: none; }
.skill-card[data-state="running"] .sc-stop{ display: inline-flex; }
.skill-card[data-state="running"] .sc-run{ display: none; }

.skill-log{
  font:var(--fs-12)/1.6 var(--mono); max-height: 260px; overflow-y: auto;
  background: var(--bg-soft); border-radius: var(--radius-sm); padding: 10px 12px;
}
.skill-log .ln{ color: var(--text-dim); border-bottom: 1px dashed var(--border-soft); padding: 3px 0; }
.skill-log .ln .tag{ color: var(--accent); margin-right: 8px; font-weight: 700; }
.skill-log .ln:last-child{ border-bottom: none; }

/* ── Composer ─────────────────────────────────────────────────────────── */
.cmp-grid{ display: grid; grid-template-columns: 1fr 320px; gap: var(--sp-16); align-items: start; }
.cmp-main{ display: flex; flex-direction: column; gap: 22px; padding-bottom: 0; }

/* Composer section rhythm: kicker labels + grouped blocks instead of a flat
   list of subheads. */
.cmp-lbl{ display: flex; align-items: center; gap: var(--sp-8); margin: 0 0 12px; font: 800 var(--fs-11)/1 var(--sans); letter-spacing: .07em;color: var(--text-dim); }
.cmp-lbl::before{ content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--grad-brand); flex: none; }
.cmp-block{ min-width: 0; }
.cmp-setup-row{ display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 720px){ .cmp-setup-row{ grid-template-columns: 1fr; } }

/* AI-assistant: an accent card so the smart tools read as a distinct panel. */
/* Картка AI-інструментів. Була рожево-синім градієнтом із кольорів
   Instagram і LinkedIn — двох платформ, до яких ці інструменти не
   мають стосунку. Тепер тихий бурштиновий шар: панель виділена, але
   акцент лишається одним. */
.cmp-ai-card{ padding: 16px; border-radius: var(--radius); border: 1px solid var(--accent-edge); background: var(--grad-brand-soft); }
.cmp-ai-card .cmp-lbl{ color: var(--text); }
.cmp-ai-card .cmp-lbl::before{ background: var(--grad-brand); }
.cmp-lbl-ai .cmp-ai-spark{ filter: drop-shadow(0 0 6px var(--accent-t-glow)); }
.cmp-ai-card .ca-assist{ margin-bottom: 0; }
.cmp-ai-card .ca-assist-actions{ margin-bottom: 0; }
/* .cmp-main now spaces blocks with gap — drop the legacy per-block bottom
   margins so spacing doesn't double up. */
.cmp-main > .cmp-block .cmp-editor{ margin-bottom: 0; }
.cmp-main > .cmp-block .cmp-media-actions{ margin-bottom: 0; }
.cmp-main > .cmp-actionbar{ margin-top: 4px; }

.cmp-nets{ display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-8); margin-bottom: 8px; }
.cmp-net-hint{ font: 500 var(--fs-12)/1.5 var(--sans); color: var(--text-mute); margin: 0 0 16px; }
.cmp-net-hint a{ color: var(--link); cursor: pointer; text-decoration: underline; }

/* AI-content disclosure toggle (composer + calendar modal) — EU AI Act art. 50(4) */
.cmp-ai-label-toggle{ display: flex; align-items: center; gap: var(--sp-6); font: 600 var(--fs-12)/1.4 var(--sans); color: var(--text-dim); cursor: pointer; margin-top: 8px; }
.cmp-ai-label-toggle input[type="checkbox"]{ accent-color: var(--accent); cursor: pointer; }
.modal-ai-label-preview{ font: 500 var(--fs-12)/1.4 var(--sans); color: var(--text-mute); margin-top: 4px; }
.net-toggle{
  display: inline-flex; align-items: center; gap: var(--sp-8);
  height: 32px; padding: 0 14px 0 4px; border-radius: 999px; box-sizing: border-box;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text-dim);
  font: 600 var(--fs-12)/normal var(--sans); cursor: pointer; transition: var(--t-fast) var(--ease);
}
.net-toggle:hover:not(:disabled){ border-color: var(--border-hover); color: var(--text); }
.net-toggle:active:not(:disabled){ transform: scale(.96); }
.net-toggle .nt-ic{
  width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--elevated); font-size:  var(--fs-13); flex: none;
}
.net-toggle.active{
  color: #fff; border-color: transparent;
  background: var(--brand-ink);
  box-shadow: 0 3px 10px rgba(var(--brand-ink-rgb), 0.25);
}
.net-toggle.active .nt-ic{ background: rgba(255,255,255,.22); }
.net-toggle:disabled{ opacity: .5; cursor: not-allowed; }
.net-toggle .nt-warn{ font: 600 var(--fs-10)/1 var(--mono); color: var(--warn); }

/* flex-wrap matters here: the three kind chips need ~394px, but the setup
   row gives each block half the main column — which the preview rail made
   narrower. Without wrapping the row simply overflowed its column. */
.cmp-kind{ display: flex; align-items: center; gap: var(--sp-8); margin-bottom: 16px; flex-wrap: wrap; }

/* Вибір формату каруселі LinkedIn. Показується лише коли доречний, тому
   відділений рискою — це не ще один тип поста, а уточнення до вже обраного. */
.cmp-li-format{ margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.cmp-li-format .cmp-kind{ margin-bottom: 8px; }
.cmp-li-format .cmp-hint{ font: 600 var(--fs-11)/1.45 var(--sans); color: var(--text-mute); }
.cmp-li-format .cmp-hint.bad{ color: var(--danger); }
.kind-btn.active{
  border-color: transparent; color: #fff; background: var(--grad-li);
}

.cmp-tabs{ display: flex; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: 6px; }
.cmp-tab{
  padding: 6px 12px; border-radius: 999px; border: 1px solid transparent;
  background: transparent; color: var(--text-mute); font: 600 var(--fs-12)/1 var(--sans); cursor: pointer;
}
.cmp-tab:hover{ color: var(--text-dim); }
.cmp-tab.active{ background: var(--panel-2); border-color: var(--border); color: var(--text); }
.cmp-tab .tb-dot{ display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--ok); margin-left: 5px; opacity: 0; }
.cmp-tab.filled .tb-dot{ opacity: 1; }
.cmp-tabs-hint{
  font: 500 var(--fs-11)/1.4 var(--sans); color: var(--text-mute);
  margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border-soft);
}

.cmp-editor{ position: relative; margin-bottom: 18px; }
.cmp-textarea{
  width: 100%; min-height: 200px; resize: vertical;
  background: linear-gradient(180deg, var(--bg-soft), rgba(var(--bg-soft-rgb), 0.92));
  border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius); padding: 18px 20px 34px;
  font: 450 var(--fs-15)/1.7 var(--sans); letter-spacing: 0.1px;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.cmp-textarea::placeholder{ color: var(--text-mute); font-weight: 450; }
.cmp-textarea:hover{ border-color: var(--border-soft); }
.cmp-textarea:focus{
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18), 0 8px 28px -12px rgba(0,0,0,.45);
  background: var(--bg-soft);
}
.cmp-counter{
  position: absolute; right: 12px; bottom: 12px; font: 600 var(--fs-11)/1 var(--mono); color: var(--text-mute);
  background: rgba(var(--bg-rgb), 0.78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  padding: 4px 9px; border-radius: 999px; border: 1px solid var(--border);
  pointer-events: none; transition: color var(--t-fast) var(--ease);
}
.cmp-counter.over{ color: var(--danger); border-color: var(--danger); }

.cmp-media-head{
  display: flex; align-items: center; justify-content: space-between;
  font: 700 var(--fs-12)/1 var(--sans); color: var(--text-dim); margin-bottom: 10px;
}
.cmp-upload-btn{ cursor: pointer; }

/* Selected-media strip: only what's actually attached to the post, in post
   order — replaces the old inline gallery dump. Picker modal (below) is
   where the full gallery lives now. */
.cmp-media-strip{ display: flex; gap: var(--sp-10); overflow-x: auto; padding: 2px 2px 8px; margin-bottom: 4px; }
.cmp-media-strip .media-item{ flex: none; width: 88px; height: 88px; cursor: default; }
.cmp-media-strip .media-item .mi-del{ display: flex; } /* always visible here, unlike the hover-only picker grid */
.cmp-media-empty{
  font: 500 var(--fs-12)/1.5 var(--sans); color: var(--text-mute);
  padding: 16px 4px; border: 1.5px dashed var(--border-soft); border-radius: var(--radius-sm);
  text-align: center; width: 100%;
}
.cmp-media-actions{ display: flex; gap: var(--sp-8); flex-wrap: wrap; margin-bottom: 18px; }

/* Video tile placeholder — no <video> element (unreliable first-frame
   rendering was the "black square" complaint), just an icon + duration
   filled in once probed client-side. */
.cmp-vid-ph{
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--sp-4); background: var(--bg-soft); color: var(--text-mute);
}
.cmp-vid-ph .cmp-vid-ic{ font-size: 22px; text-shadow: 0 1px 4px rgba(0,0,0,.7); }
.cmp-vid-ph .cmp-vid-dur{ font: 700 var(--fs-10)/1 var(--mono); color: #fff; min-height: 10px; text-shadow: 0 1px 4px rgba(0,0,0,.7); }

.cmp-pick-tabs{ display: flex; gap: var(--sp-8); margin-bottom: 12px; }

.media-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: var(--sp-8); margin-bottom: 18px; }
.media-item{
  position: relative; aspect-ratio: 1; border-radius: var(--ctl-radius-sm); overflow: hidden; cursor: pointer;
  border: 2px solid var(--border-soft); background: var(--bg-soft);
}
.media-item img, .media-item video{ width: 100%; height: 100%; object-fit: cover; display: block; }
.media-item .mi-kind{
  position: absolute; left: 4px; bottom: 4px; font-size:  var(--fs-10); background: rgba(0,0,0,.55);
  padding: 1px 5px; border-radius: var(--radius-xs); color: #fff;
}
.media-item.selected{ border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-t-edge-hi); }
.media-item.selected::after{
  content: "✓"; position: absolute; top: 4px; right: 4px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--brand-ink); color: var(--on-brand); font-size:  var(--fs-11); font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.media-item .mi-del{
  position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; border: none; font-size:  var(--fs-10); cursor: pointer;
  display: none; align-items: center; justify-content: center;
}
.media-item:hover .mi-del{ display: flex; }

/* Sticky action bar — always visible at the bottom of the composer panel:
   validation hint on the left, draft/schedule/publish on the right. */
.cmp-actionbar{
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-12); flex-wrap: wrap;
  margin: 18px -16px -16px; padding: 14px 16px;
  background: var(--panel); border-top: 1px solid var(--border-soft);
  border-radius: 0 0 var(--radius) var(--radius);
}
.cmp-valid-hint{
  font: 600 var(--fs-12)/1.3 var(--sans); color: var(--text-mute);
  opacity: 0; transition: opacity var(--t-fast) var(--ease);
}
.cmp-valid-hint.show{ opacity: 1; }
.cmp-actionbar-btns{ display: flex; gap: var(--sp-8); flex-wrap: wrap; margin-left: auto; }

/* The side rail now carries two stacked panels (live preview, then publish
   history) instead of being a single panel itself. */
.cmp-side{
  position: sticky; top: calc(var(--topbar-h) + 20px);
  max-height: calc(100vh - var(--topbar-h) - 40px); overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--sp-16);
}

/* ── Live preview ──────────────────────────────────────────────────────
   Deliberately restrained: this is a faithful sketch of the post, not a
   pixel-copy of Instagram chrome. A half-convincing fake feed would look
   cheap and would over-promise accuracy we don't have. */
.cmp-pv-panel{ padding-bottom: 14px; }
.cmp-pv-head{ display: flex; align-items: center; justify-content: space-between; gap: var(--sp-10); margin-bottom: 12px; }
.cmp-pv-title{ font: 800 var(--fs-11)/1 var(--sans); letter-spacing: .07em;color: var(--text-dim); }
.cmp-pv-tabs{ display: flex; gap: var(--sp-4); }
.cmp-pv-tab{
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--ctl-radius-sm); background: none;
  opacity: .42; transition: opacity var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.cmp-pv-tab:hover{ opacity: .8; }
.cmp-pv-tab.active{ opacity: 1; background: var(--panel-2); border-color: var(--border); }

.cmp-pv-card{
  border: 1px solid var(--border-soft); border-radius: var(--radius-sm); overflow: hidden;
  background: var(--panel-2);
}
.cmp-pv-top{ display: flex; align-items: center; gap: 9px; padding: 10px 12px; }
.cmp-pv-av{
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--elevated); border: 1px solid var(--border-soft);
}
.cmp-pv-who{ display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.cmp-pv-who b{ font: 700 var(--fs-12)/1.15 var(--sans); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-pv-who i{ font: 600 var(--fs-10)/1 var(--mono); color: var(--text-mute); font-style: normal; }

.cmp-pv-media{ position: relative; width: 100%; background: var(--elevated); overflow: hidden; }
.cmp-pv-media img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.cmp-pv-media-empty{
  display: flex; align-items: center; justify-content: center;
  font: 600 var(--fs-11)/1 var(--sans); color: var(--text-mute);
  border-top: 1px dashed var(--border-soft); border-bottom: 1px dashed var(--border-soft);
}
.cmp-pv-count{
  position: absolute; top: 8px; right: 8px; padding: 3px 8px; border-radius: 999px;
  font: 700 var(--fs-10)/1 var(--mono); color: #fff; background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}

.cmp-pv-body{ padding: 11px 12px 13px; }
.cmp-pv-ai{
  display: inline-block; margin-bottom: 7px; padding: 3px 8px; border-radius: 999px;
  font: 700 var(--fs-11)/1 var(--sans);
  color: var(--text-dim); background: var(--elevated); border: 1px solid var(--border-soft);
}
.cmp-pv-cap{ font: 500 var(--fs-12)/1.55 var(--sans); color: var(--text); white-space: pre-wrap; word-break: break-word; }
.cmp-pv-ph{ color: var(--text-mute); font-style: italic; }
/* Past the fold: still readable, but visibly "below the cut" so the writer
   can judge whether the opening carries the post on its own. */
.cmp-pv-cut{ opacity: .34; }
.cmp-pv-more{ color: var(--text-mute); font-weight: 700; }

.cmp-pv-foot{
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-8); flex-wrap: wrap;
  margin-top: 10px; font: 600 var(--fs-11)/1 var(--mono); color: var(--text-mute);
}
.cmp-pv-foot.over{ color: var(--danger); }
.cmp-pv-over{ font-weight: 700; }
.cmp-pv-note{ margin-top: 6px; font: 500 var(--fs-10)/1.4 var(--sans); color: var(--text-mute); opacity: .75; }
.cmp-pv-empty{
  padding: 22px 14px; text-align: center; border: 1px dashed var(--border-soft); border-radius: var(--radius-sm);
  font: 500 var(--fs-12)/1.5 var(--sans); color: var(--text-mute);
}

/* Upload constraints line — was an inline style on the element. */
.cmp-media-hint{ font: 500 var(--fs-11)/1.45 var(--sans); color: var(--text-mute); margin-top: 6px; }

.job-card{
  background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 10px;
}
.job-card .jc-top{ display: flex; align-items: center; gap: var(--sp-8); flex-wrap: wrap; }
.job-card .jc-ic{ width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size:  var(--fs-11); background: var(--elevated); flex: none; }
/* min-width guarantees the label a real amount of room before it competes
   with the badge/time/spinner for space — those wrap to their own line
   (jc-top is flex-wrap) instead of squeezing the label down to a sliver.
   Ellipsis is now only a fallback for a label that's actually too long. */
.job-card .jc-label{ font: 700 var(--fs-12)/1.3 var(--sans); flex: 1 1 140px; min-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-card .jc-time{ flex: none; font: 600 var(--fs-10)/1 var(--mono); color: var(--text-mute); }
.job-card .jc-spin{ width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: spin .7s linear infinite; }
@keyframes spin{ to{ transform: rotate(360deg); } }
.job-card .jc-body{ margin-top: 8px; font: 500 var(--fs-12)/1.5 var(--sans); color: var(--text-dim); }
.job-card .jc-body a{ color: var(--link); text-decoration: none; }
.job-card .jc-body a:hover{ text-decoration: underline; }
.job-card .jc-body ul{ margin: 4px 0 0; padding-left: 16px; }
.job-card.status-published{ border-color: rgba(var(--ok-rgb),.3); }
.job-card.status-failed{ border-color: rgba(var(--danger-rgb),.3); }

@media (max-width: 980px){
  .cmp-grid{ grid-template-columns: 1fr; }
  .cmp-side{ position: static; max-height: none; }
}
@media (max-width: 640px){
  .cmp-actionbar{ flex-direction: column; align-items: stretch; }
  .cmp-valid-hint{ text-align: center; }
  .cmp-actionbar-btns{ margin-left: 0; display: grid; grid-template-columns: 1fr 1fr; }
  .cmp-actionbar-btns .btn-primary{ grid-column: 1 / -1; }
}

