/* Brand vars are overridden per-client via JS (style="--accent: ..."). */
:root {
  --accent:        #9C5140;
  --accent-warm:   #B6742F;
  --olive:         #59503D;
  --clay:          #926F5B;
  --sage:          #80968B;
  --cream:         #F4EBDF;

  --bg:            #1a1714;
  --surface:       #221d18;
  --surface-2:     #2a2420;
  --border:        rgba(244, 235, 223, 0.10);
  --text:          #f4ebdf;
  --muted:         #b2a695;

  --pos:           #6ec27a;
  --neg:           #d1665a;

  --font-display:  "Mont", "Montserrat", system-ui, sans-serif;
  --font-body:     "Montserrat", system-ui, sans-serif;

  --radius-sm:     8px;
  --radius:        14px;
  --radius-lg:     20px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

/* —— Top bar ——————————————————————————— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  background: linear-gradient(180deg, rgba(26, 23, 20, 0.92), rgba(26, 23, 20, 0.75));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.35));
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-eyebrow { color: var(--muted); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.brand-name { margin: 4px 0 0; font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: -0.01em; }

.tabs { display: flex; gap: 4px; overflow-x: auto; }

.tab {
  padding: 9px 16px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  cursor: pointer;
  font: 500 13px/1 var(--font-body);
  white-space: nowrap;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--text); border-color: var(--border); }
.tab.active {
  color: var(--cream);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 4px 18px -8px var(--accent);
}

/* —— Layout ——————————————————————————— */
#app {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 28px 80px;
}

.client-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.client-meta h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.refreshed { color: var(--muted); font-size: 12px; }
.refreshed b { color: var(--text); font-weight: 600; }

.empty { padding: 56px 0; text-align: center; color: var(--muted); }

.channel-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(580px, 1fr));
}

/* —— Weekend Inbox ——————————————————————— */
.inbox {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px 22px;
  margin-bottom: 28px;
}

.inbox-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 14px;
  flex-wrap: wrap;
}

.inbox-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.inbox-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--cream);
  letter-spacing: 0.04em;
}

.inbox-meta { color: var(--muted); font-size: 12px; }

.inbox-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.inbox-filter {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font: 500 12px/1 var(--font-body);
  cursor: pointer;
}
.inbox-filter.active { color: var(--cream); background: var(--accent); border-color: var(--accent); }
.inbox-filter:hover:not(.active) { color: var(--text); }

.inbox-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}

.inbox-empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.inbox-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: grid;
  grid-template-rows: auto auto auto auto;
  gap: 10px;
  position: relative;
  transition: opacity 0.2s;
}

.inbox-item.is-new::before {
  content: "";
  position: absolute;
  left: -1px; top: 14px; bottom: 14px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.inbox-item.is-seen { opacity: 0.55; }

.ii-author { display: flex; gap: 10px; align-items: center; }

.ii-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--cream);
  background: var(--clay);
}

.ii-author-meta { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.ii-author-line { display: flex; gap: 8px; align-items: center; }

.ii-handle {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ii-platform-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}
.ii-platform-badge.ig { background: rgba(225, 48, 108, 0.18); color: #ff6491; }
.ii-platform-badge.tt { background: rgba(255, 255, 255, 0.10); color: #d6e0eb; }
.ii-platform-badge.yt { background: rgba(255, 0, 0, 0.18); color: #ff7373; }
.ii-platform-badge.fb { background: rgba(24, 119, 242, 0.18); color: #6aa8ff; }

.ii-time { color: var(--muted); font-size: 11px; }

.ii-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}

.ii-post {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(244, 235, 223, 0.05);
  text-decoration: none !important;
  color: var(--muted);
  font-size: 11px;
}
.ii-post:hover { background: rgba(244, 235, 223, 0.10); }

.ii-post-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.ii-post-thumb[src=""], .ii-post-thumb:not([src]) { background: var(--surface); }

.ii-post-caption {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ii-actions { display: flex; gap: 8px; }

.ii-reply {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--cream);
  text-align: center;
  font-weight: 600;
  font-size: 12px;
  text-decoration: none !important;
}
.ii-reply:hover { filter: brightness(1.1); }

.ii-seen {
  padding: 8px 12px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font: 500 12px/1 var(--font-body);
  cursor: pointer;
}
.ii-seen:hover { color: var(--text); border-color: var(--text); }
.is-seen .ii-seen::after { content: " ✓"; }

/* —— Channel card ————————————————————— */
.channel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  overflow: hidden;
}

.channel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.channel-title { display: flex; gap: 12px; align-items: center; }

.channel-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-weight: 700; color: #fff; font-size: 14px;
  font-family: var(--font-display);
}
.channel-icon.ig { background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.channel-icon.tt { background: #000; }
.channel-icon.yt { background: #ff0000; }
.channel-icon.fb { background: #1877f2; }

.channel-name {
  margin: 0;
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
}
.channel-handle { color: var(--muted); font-size: 12px; }

.channel-stats { display: flex; gap: 22px; text-align: right; }
.stat { display: flex; flex-direction: column; align-items: flex-end; }
.stat-value { font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.stat-label {
  color: var(--muted); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.1em; margin-top: 2px;
}

/* —— Deltas strip ————————————————————— */
.deltas {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.delta {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 76px;
}

.delta.is-current::before { background: var(--clay); }
.delta.is-delta::before  { background: var(--pos); }

.delta::before {
  content: "";
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 0 2px 2px 0;
}

.delta-label { color: var(--muted); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }

.delta-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.delta-value { font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 1; }
.delta-change {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(110, 194, 122, 0.18);
  color: var(--pos);
  white-space: nowrap;
}
.delta-prev { color: var(--muted); font-size: 11px; }

.delta-empty {
  grid-column: 1 / -1;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

/* —— Post grid ———————————————————————— */
.post-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

.post {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
}
.post img { width: 100%; height: 100%; object-fit: cover; display: block; }

.post .meta {
  position: absolute; inset: auto 0 0 0;
  padding: 8px 8px 6px;
  background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.55) 60%, transparent 100%);
  display: flex; gap: 10px;
  font-size: 11px;
  color: #fff;
  font-weight: 500;
}
.post .meta span { display: inline-flex; align-items: center; gap: 3px; }

.post .placeholder {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--muted);
  font-size: 11px;
  padding: 10px;
  text-align: center;
  line-height: 1.35;
}

.error { color: var(--neg); padding: 8px 0; font-size: 12px; }

@media (max-width: 720px) {
  .channel-grid { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: repeat(3, 1fr); }
  .deltas { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
}

/* —— View toggle (branded segment control) ———— */
.view-toggle {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  gap: 2px;
  box-shadow: 0 1px 0 rgba(244, 235, 223, 0.04) inset;
}
.view-toggle button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 13px/1 var(--font-body);
  padding: 9px 16px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, transform 0.12s;
}
.view-toggle button .view-toggle-icon {
  width: 14px;
  height: 14px;
  opacity: 0.7;
  transition: opacity 0.18s;
}
.view-toggle button:hover:not(.active) {
  color: var(--text);
  background: rgba(244, 235, 223, 0.04);
}
.view-toggle button:hover:not(.active) .view-toggle-icon { opacity: 1; }
.view-toggle button.active {
  background: var(--accent);
  color: var(--cream);
  box-shadow: 0 4px 14px -6px var(--accent), 0 0 0 1px rgba(0,0,0,0.18) inset;
}
.view-toggle button.active .view-toggle-icon { opacity: 1; }
.view-toggle button:active:not(.active) { transform: scale(0.97); }
.view-toggle .vt-count {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(244, 235, 223, 0.10);
  color: inherit;
  font-weight: 700;
}
.view-toggle button.active .vt-count {
  background: rgba(0, 0, 0, 0.22);
}
.view-toggle .vt-count-alert {
  background: var(--accent);
  color: var(--cream);
  box-shadow: 0 0 0 2px var(--surface);
}
.view-toggle button.active .vt-count-alert {
  background: var(--cream);
  color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

/* —— Calendar grid ————————————————————— */
.calendar-section { margin-bottom: 28px; }

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 14px;
  flex-wrap: wrap;
}

.cal-title-block { display: flex; flex-direction: column; gap: 4px; }
.cal-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.cal-subtitle {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cal-nav {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  gap: 2px;
}
.cal-nav button {
  background: transparent;
  color: var(--text);
  border: 0;
  border-radius: 9px;
  padding: 8px 12px;
  font: 600 14px/1 var(--font-body);
  cursor: pointer;
  transition: background 0.15s;
}
.cal-nav button:hover { background: rgba(244, 235, 223, 0.06); }
.cal-month {
  padding: 0 18px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  min-width: 130px;
  text-align: center;
}

.cal-meta {
  color: var(--muted);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cal-meta b { color: var(--text); font-weight: 600; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 24px -10px rgba(0,0,0,0.4);
}

.cal-dow {
  padding: 14px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  text-align: center;
  font-weight: 700;
}

.cal-day {
  min-height: 132px;
  min-width: 0;
  padding: 10px 8px 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: var(--surface);
  position: relative;
  transition: background 0.2s;
  overflow: hidden;
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:hover { background: rgba(244, 235, 223, 0.025); }
.cal-day.is-other-month { opacity: 0.45; background: transparent; }
.cal-day.is-other-month:hover { background: transparent; }
.cal-day.is-today {
  background: linear-gradient(180deg, rgba(156, 81, 64, 0.18), rgba(156, 81, 64, 0.06));
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.cal-day.is-today .cal-day-num {
  background: var(--accent);
  color: var(--cream);
}

.cal-day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}

/* —— Calendar post chips —————————————————— */
.cal-chip {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.18s, background 0.18s;
  overflow: hidden;
  position: relative;
  font: 500 11.5px/1.3 var(--font-body);
  color: var(--text);
}
.cal-chip:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: rgba(156, 81, 64, 0.10);
}
.cal-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Pillar accent bar on left edge */
.cal-chip-bar {
  width: 3px;
  flex-shrink: 0;
  background: var(--clay);
}
.cal-chip[data-pillar="1"] .cal-chip-bar { background: var(--sage); }
.cal-chip[data-pillar="2"] .cal-chip-bar { background: var(--accent-warm); }
.cal-chip[data-pillar="3"] .cal-chip-bar { background: #d49ab0; }
.cal-chip[data-pillar="4"] .cal-chip-bar { background: var(--accent); }
.cal-chip[data-pillar="5"] .cal-chip-bar { background: var(--clay); }
.cal-chip[data-pillar="6"] .cal-chip-bar { background: var(--olive); }
.cal-chip[data-pillar="7"] .cal-chip-bar { background: #d9a05b; }

.cal-chip-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 7px 9px 7px 8px;
  min-width: 0;
}

.cal-chip-row1 {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.cal-chip-type {
  font-size: 12px;
  flex-shrink: 0;
  line-height: 1;
}
.cal-chip-title {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 600;
}

.cal-chip-row2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.cal-chip-platforms {
  display: inline-flex;
  gap: 3px;
}
.cal-plat-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  letter-spacing: 0;
}
.cal-plat-dot.ig { background: linear-gradient(135deg, #f09433, #dc2743, #bc1888); }
.cal-plat-dot.tt { background: #1a1a1a; border: 1px solid rgba(255,255,255,0.15); }
.cal-plat-dot.yt { background: #ff0000; }
.cal-plat-dot.fb { background: #1877f2; }

.cal-chip-status-pill {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.cal-chip-status-pill.s-draft     { background: rgba(178, 166, 149, 0.18); color: var(--muted); }
.cal-chip-status-pill.s-in-review { background: rgba(214, 169, 96, 0.22); color: #e2b878; }
.cal-chip-status-pill.s-approved  { background: rgba(110, 194, 122, 0.22); color: #8bd595; }
.cal-chip-status-pill.s-scheduled { background: rgba(106, 168, 255, 0.22); color: #8bb9ff; }
.cal-chip-status-pill.s-posted    { background: rgba(182, 116, 47, 0.25); color: #e0975e; }

/* —— Modal / detail view ——————————————— */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(8, 6, 4, 0.7);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  animation: fade 0.15s;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 1100px;
  width: 100%;
  max-height: calc(100vh - 80px);
  overflow: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, 1fr);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
}

.modal-media {
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  position: relative;
  min-height: 400px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.modal-media iframe { width: 100%; height: 100%; min-height: 500px; border: 0; background: #000; }
.modal-media img    { width: 100%; height: 100%; max-height: 600px; object-fit: contain; }
.modal-media .placeholder {
  padding: 32px;
  text-align: center;
  color: var(--muted);
}
.modal-media .placeholder a { color: var(--accent-warm); }

/* —— Carousel viewer (Drive folder → image array) —— */
.modal-carousel {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 520px;
  background: #0e0c0a;
  overflow: hidden;
}
.mc-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.32s cubic-bezier(0.4, 0.0, 0.2, 1);
  will-change: transform;
}
.mc-slide {
  flex: 0 0 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 14px;
}
.mc-slide img {
  width: 100%;
  height: 100%;
  max-height: 600px;
  object-fit: contain;
  border-radius: 6px;
  background: #1a1714;
  /* While Drive thumbnail resolves, show a subtle gradient instead of a stark blank */
  background-image: linear-gradient(135deg, rgba(244, 235, 223, 0.04), rgba(244, 235, 223, 0.0));
}

.mc-slide-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border-radius: 6px;
  color: var(--muted);
  font: 500 13px/1.5 var(--font-body);
  text-align: center;
  text-decoration: none !important;
  padding: 24px;
}
.mc-slide-fallback strong { color: var(--text); display: block; font-size: 15px; margin-bottom: 6px; font-family: var(--font-display); }
.mc-slide-fallback:hover { background: var(--surface); color: var(--accent-warm); }

.mc-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.55);
  color: var(--cream);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(6px);
  transition: background 0.15s, transform 0.12s;
  z-index: 3;
}
.mc-nav:hover { background: var(--accent); border-color: var(--accent); }
.mc-nav:active { transform: translateY(-50%) scale(0.94); }
.mc-prev { left: 14px; }
.mc-next { right: 14px; }

.mc-counter {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--cream);
  font: 600 11px/1 var(--font-display);
  letter-spacing: 0.06em;
  backdrop-filter: blur(6px);
  z-index: 2;
}

.mc-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  z-index: 2;
}
.mc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 0;
  background: rgba(244, 235, 223, 0.35);
  padding: 0;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.mc-dot:hover { background: rgba(244, 235, 223, 0.65); }
.mc-dot.active {
  background: var(--accent);
  transform: scale(1.4);
}

.modal-body {
  padding: 28px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.modal-pillar-strip {
  height: 4px;
  border-radius: 4px;
  background: var(--accent);
  margin-bottom: 4px;
}
.modal-pillar-strip[data-pillar="1"] { background: var(--sage); }
.modal-pillar-strip[data-pillar="2"] { background: var(--accent-warm); }
.modal-pillar-strip[data-pillar="3"] { background: #d49ab0; }
.modal-pillar-strip[data-pillar="4"] { background: var(--accent); }
.modal-pillar-strip[data-pillar="5"] { background: var(--clay); }
.modal-pillar-strip[data-pillar="6"] { background: var(--olive); }
.modal-pillar-strip[data-pillar="7"] { background: #d9a05b; }

.modal-eyebrow {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
}
.modal-eyebrow .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); }

.modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: rgba(0,0,0,0.55);
  color: var(--cream);
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  z-index: 2;
}

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  line-height: 1.18;
  letter-spacing: -0.01em;
}

.modal-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.modal-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(244, 235, 223, 0.08);
  color: var(--text);
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.modal-badge.status-draft     { background: rgba(178, 166, 149, 0.18); color: var(--muted); }
.modal-badge.status-in-review { background: rgba(214, 169, 96, 0.22); color: #e2b878; }
.modal-badge.status-approved  { background: rgba(110, 194, 122, 0.20); color: #8bd595; }
.modal-badge.status-scheduled { background: rgba(106, 168, 255, 0.20); color: #8bb9ff; }
.modal-badge.status-posted    { background: rgba(182, 116, 47, 0.22); color: #e0975e; }

.modal-platform-row { display: flex; gap: 5px; align-items: center; }
.modal-plat-dot {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
}
.modal-plat-dot.ig { background: linear-gradient(135deg, #f09433, #dc2743, #bc1888); }
.modal-plat-dot.tt { background: #1a1a1a; border: 1px solid rgba(255,255,255,0.12); }
.modal-plat-dot.yt { background: #ff0000; }
.modal-plat-dot.fb { background: #1877f2; }

.modal-field { display: flex; flex-direction: column; gap: 4px; }
.modal-field-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.modal-field-val { font-size: 13px; line-height: 1.5; color: var(--text); }
.modal-field-val.muted { color: var(--muted); font-style: italic; }

.caption-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.caption-editor textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  font: 400 13.5px/1.55 var(--font-body);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.caption-editor textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(156, 81, 64, 0.18);
}

.caption-save-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
}
.caption-status { min-height: 16px; }
.caption-status.is-saved   { color: var(--pos); }
.caption-status.is-saving  { color: var(--muted); }
.caption-status.is-error   { color: var(--neg); }
.caption-status.is-dirty   { color: var(--accent-warm); }

.modal-actions { display: flex; gap: 8px; margin-top: 4px; }
.modal-actions a, .modal-actions button {
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: 600 12px/1 var(--font-body);
  cursor: pointer;
  text-decoration: none !important;
}
.modal-actions a.primary {
  background: var(--accent);
  color: var(--cream);
  border-color: var(--accent);
}
.modal-actions a:hover { background: var(--surface-2); }
.modal-actions a.primary:hover { filter: brightness(1.1); }

@media (max-width: 900px) {
  .modal { grid-template-columns: 1fr; }
  .modal-media { border-right: 0; border-bottom: 1px solid var(--border); min-height: 280px; }
  .modal-media iframe { min-height: 320px; }
}

/* —— Postaway view —————————————————————————— */
.pw-item .ii-handle { font-weight: 600; }
.pw-status {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}
.pw-status.s-active   { color: #8fd19e; border-color: rgba(143,209,158,0.4); background: rgba(143,209,158,0.10); }
.pw-status.s-pending  { color: #e0b85c; border-color: rgba(224,184,92,0.4);  background: rgba(224,184,92,0.10); }
.pw-status.s-declined { color: #d98c8c; border-color: rgba(217,140,140,0.4); background: rgba(217,140,140,0.10); }
.pw-status.s-completed{ color: var(--muted); }
.pw-status.s-inquiry  { color: var(--accent-warm); border-color: rgba(182,116,47,0.4); background: rgba(182,116,47,0.10); }
.pw-dates { color: var(--muted); }
.pw-badge-muted { background: var(--border) !important; color: var(--muted) !important; }
.pw-open { cursor: pointer; }

/* —— Meta Ads view ——————————————————————————— */
.ads-sample-banner {
  background: rgba(182,116,47,0.14); border: 1px solid rgba(182,116,47,0.4);
  color: var(--accent-warm); padding: 9px 14px; border-radius: 10px;
  font-size: 13px; margin-bottom: 16px;
}
.ads-sample-banner code { background: rgba(0,0,0,0.25); padding: 1px 5px; border-radius: 4px; }
.ads-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
@media (max-width: 900px) { .ads-kpis { grid-template-columns: repeat(3, 1fr); } }
.ads-kpi {
  display: flex; flex-direction: column; gap: 3px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
}
.ads-kpi-val { font-size: 22px; font-weight: 700; color: var(--text); }
.ads-kpi-label { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.ads-target { color: var(--muted); font-size: 12px; margin: 12px 2px 0; }
.ads-actionbar {
  margin: 10px 0 4px; padding: 10px 14px; border-radius: 10px;
  background: rgba(143,209,158,0.08); border: 1px solid rgba(143,209,158,0.25);
  color: var(--text); font-size: 14px;
}
.ads-actionbar b { color: #8fd19e; }
.ads-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.ads-card {
  background: var(--card); border: 1px solid var(--border);
  border-left: 4px solid var(--border); border-radius: 12px; padding: 14px 16px;
}
.ads-card.ads-win  { border-left-color: #8fd19e; }
.ads-card.ads-kill { border-left-color: #d98c8c; }
.ads-card.ads-fat  { border-left-color: #e0b85c; }
.ads-card.ads-mon  { border-left-color: var(--muted); }
.ads-card.ads-ins  { border-left-color: rgba(244,235,223,0.18); opacity: 0.9; }
.ads-card-title { display: flex; align-items: center; gap: 10px; }
.ads-name { font-weight: 600; color: var(--text); }
.ads-status {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.ads-status.s-win  { color: #8fd19e; background: rgba(143,209,158,0.12); }
.ads-status.s-kill { color: #d98c8c; background: rgba(217,140,140,0.12); }
.ads-status.s-fat  { color: #e0b85c; background: rgba(224,184,92,0.12); }
.ads-status.s-mon  { color: var(--muted); background: var(--border); }
.ads-status.s-ins  { color: var(--muted); background: var(--border); }
.ads-card-sub { color: var(--muted); font-size: 12px; margin-top: 5px; }
.ads-delivery { text-transform: capitalize; }
.ads-metrics {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; margin: 12px 0;
}
@media (max-width: 900px) { .ads-metrics { grid-template-columns: repeat(4, 1fr); } }
.ads-m { display: flex; flex-direction: column; gap: 2px; }
.ads-m-val { font-size: 15px; font-weight: 600; color: var(--text); }
.ads-m-label { font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.ads-m-good .ads-m-val { color: #8fd19e; }
.ads-m-bad .ads-m-val  { color: #d98c8c; }
.ads-m-warn .ads-m-val { color: #e0b85c; }
.ads-action {
  display: flex; gap: 8px; align-items: baseline;
  font-size: 14px; color: var(--text); font-weight: 500;
  padding-top: 10px; border-top: 1px solid var(--border);
}
.ads-action-arrow { color: var(--accent-warm); font-weight: 700; }
.ads-reasons { color: var(--muted); font-size: 12px; margin-top: 6px; line-height: 1.5; }

.ads-note {
  margin: 10px 0 4px; padding: 10px 14px; border-radius: 10px;
  background: rgba(182,116,47,0.10); border: 1px solid rgba(182,116,47,0.3);
  color: var(--text); font-size: 13px; line-height: 1.5;
}
.ads-kpi-sub { font-size: 10px; color: var(--muted); }

.ads-gathering { margin-top: 8px; }
.ads-gathering > summary {
  cursor: pointer; color: var(--muted); font-size: 13px; padding: 10px 14px;
  background: var(--card); border: 1px dashed var(--border); border-radius: 10px;
}
.ads-gathering > summary:hover { color: var(--text); }

/* —— Posts list view (client-facing) ————————————— */
.posts-section { margin-bottom: 28px; }
.posts-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.posts-title-block { display: flex; flex-direction: column; gap: 4px; }
.posts-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.2px;
}
.posts-subtitle { color: var(--muted); font-size: 12.5px; }
.posts-month-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.posts-month-tab {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 6px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.posts-month-tab:hover { color: var(--text); }
.posts-month-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--cream, #fffdf6);
}
.posts-month-count {
  background: rgba(0,0,0,0.18);
  color: inherit;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
}
.posts-month-tab.active .posts-month-count { background: rgba(0,0,0,0.22); }

.posts-list { display: flex; flex-direction: column; gap: 10px; }
.posts-empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--muted);
  background: var(--panel, #161922);
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.post-card {
  display: grid;
  grid-template-columns: 120px 1fr minmax(280px, 1.5fr);
  gap: 18px;
  align-items: center;
  padding: 14px;
  background: var(--panel, #161922);
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
  transition: border-color 120ms ease, transform 120ms ease;
}
.post-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.post-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.post-thumb-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 7px;
  overflow: hidden;
  background: #0e1118;
  flex-shrink: 0;
}
.post-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.post-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  color: var(--muted);
  background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(0,0,0,0.2));
}
.post-thumb-emoji {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}

.post-meta { min-width: 0; }
.post-eyebrow {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.post-eyebrow .post-dot {
  width: 3px;
  height: 3px;
  background: currentColor;
  border-radius: 50%;
  display: inline-block;
  opacity: 0.6;
}
.post-title {
  font-size: 15.5px;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.post-badges { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.post-status-pill {
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,0.08);
  color: var(--text);
}
.post-status-pill.status-in-progress { background: rgba(74,184,255,0.16); color: #6bc5ff; }
.post-status-pill.status-done        { background: rgba(74,212,74,0.16);  color: #6ee06e; }
.post-status-pill.status-not-started { background: rgba(180,180,180,0.12); color: #b8b8b8; }

.post-caption-preview {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  padding-left: 14px;
  border-left: 2px solid rgba(255,255,255,0.06);
}
.post-caption-empty { font-style: italic; opacity: 0.7; }

@media (max-width: 1100px) {
  .post-card { grid-template-columns: 100px 1fr; }
  .post-caption-preview { display: none; }
  .post-thumb-wrap { width: 100px; height: 100px; }
}
@media (max-width: 700px) {
  .post-card { grid-template-columns: 80px 1fr; gap: 12px; padding: 10px; }
  .post-thumb-wrap { width: 80px; height: 80px; }
  .post-title { font-size: 14px; }
}

/* —— Modal: YouTube long description (collapsible) ————————— */
.modal-yt-desc {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.modal-yt-desc > summary {
  cursor: pointer;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  padding-bottom: 6px;
}
.modal-yt-desc > summary::-webkit-details-marker { display: none; }
.modal-yt-desc > summary::before {
  content: "▸";
  display: inline-block;
  transition: transform 120ms ease;
  font-size: 9px;
  color: var(--muted);
}
.modal-yt-desc[open] > summary::before { transform: rotate(90deg); }
.modal-yt-desc-body {
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  margin-top: 8px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  max-height: 360px;
  overflow-y: auto;
}
.modal-yt-len {
  margin-left: auto;
  font-weight: 400;
  font-size: 10.5px;
  letter-spacing: 0.2px;
  text-transform: none;
}
.modal-yt-hashtags {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--accent);
  padding: 8px 14px;
  background: rgba(217,119,87,0.06);
  border-radius: 6px;
}

/* —— Modal: prominent Hook block (drives the captions) ————————— */
.modal-hook-block {
  background: rgba(217,119,87,0.07);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 12px 16px;
  margin: 18px 0 22px;
}
.modal-hook-block .modal-field-label { display: block; margin-bottom: 6px; }
.modal-hook-text { font-size: 15px; line-height: 1.5; color: var(--text); font-weight: 500; }

/* —— Caption block with Minimize / Show full toggle ————————— */
.modal-caption-block .modal-caption-wrap { position: relative; }
.modal-caption-block .modal-field-val {
  white-space: pre-line;
  line-height: 1.6;
  transition: max-height 180ms ease;
}
.modal-caption-block.is-collapsed .modal-field-val {
  max-height: 100px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.modal-caption-block.is-collapsed .modal-caption-wrap::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 32px;
  background: linear-gradient(180deg, transparent, var(--panel, #161922) 92%);
  pointer-events: none;
  border-radius: 0 0 4px 4px;
}
.modal-caption-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}
.modal-caption-toggle {
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 2px 0;
}
.modal-caption-toggle:hover { text-decoration: underline; }
.modal-caption-chars { font-size: 11px; }
