/* ============================================================================
   QL-MXH TRUYỀN THÔNG ĐA KÊNH — MỞ RỘNG TRÊN NỀN DUCMINH DESIGN SYSTEM
   (Chạy 100% với biến CSS của ducminh-ui-kit cho cả 3 chế độ: Sáng / Tối / Luxury)
   ============================================================================ */

:root {
  color-scheme: light dark;
  --surface-soft: var(--surface-2);
  --muted: var(--text-3);
  --teal: var(--brand-secondary);
  --ok-bg: var(--good-bg);
  --ok-fg: var(--good);
  --warn-fg: var(--warn);
  --err-bg: var(--bad-bg);
  --err-fg: var(--bad);
  --info-fg: var(--info-text);
  --shadow: var(--shadow-card);
  accent-color: var(--brand-primary);

  &:has(> head > meta[name="color-scheme"][content="dark"]) {
    color-scheme: dark;
  }
  &:has(> head > meta[name="color-scheme"][content="light"]) {
    color-scheme: light;
  }
}

*, *::before, *::after {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* Sidebar Brand + Collapse support */
.sb-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.sb-brand-logo {
  display: grid;
  place-items: center;
  inline-size: 32px;
  block-size: 32px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--gradient-primary);
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.15rem;
}

.sb-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sb-brand-text strong {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-brand-text small {
  font-size: 0.68rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme='luxury'] .sb-brand-text strong {
  color: #fde68a;
}
html[data-theme='luxury'] .sb-brand-text small {
  color: #a3b8b0;
}

.nav-item.nav-btn {
  width: 100%;
  background: transparent;
  text-align: start;
  cursor: pointer;
  font-family: var(--font);
}

.nav-group:not(.open) .nav-sub {
  display: none;
}

.nav-group-chev {
  transition: transform 0.16s ease;
}

.nav-group:not(.open) .nav-group-chev {
  transform: rotate(-90deg);
}

html.sb-collapsed .sb-brand-text,
html.sb-collapsed .nav-group-head,
html.sb-collapsed .nav-label,
html.sb-collapsed .sb-apk-link,
html.sb-collapsed .sb-duty-box > .sb-duty-top span:not(.sb-duty-dot),
html.sb-collapsed .sb-duty-sub,
html.sb-collapsed .sb-user-info {
  display: none;
}

html.sb-collapsed .sb-collapse-btn svg {
  transform: rotate(180deg);
}

html.sb-collapsed .nav-sub {
  margin-left: 0;
  padding-left: 0;
  border-left: 0;
  align-items: center;
}

html.sb-collapsed .nav-item {
  justify-content: center;
  padding: 8px;
}

html.sb-collapsed .sb-apk-row,
html.sb-collapsed .sb-user-row {
  justify-content: center;
}

/* Mobile Drawer */
.mobile-only-btn {
  display: none;
}

.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.52);
}

.mobile-drawer-backdrop[hidden] {
  display: none;
}

@media (max-width: 899px) {
  .mobile-only-btn {
    display: inline-flex;
  }
  .sidebar.mobile-open {
    display: flex;
    z-index: 90;
    inline-size: 264px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  }
}

.dm-live-clock {
  display: inline-flex;
  align-items: center;
  min-block-size: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
}

.app-view[hidden] {
  display: none;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

/* ModuleBanner đồng bộ nền trắng (var(--surface)) + Icon điểm nhấn chuyên nghiệp trên cả 3 chế độ */
.dm-banner,
html[data-theme='dark'] .dm-banner,
html[data-theme='luxury'] .dm-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow-card);
}

.dm-banner::before {
  display: none;
}

html[data-theme='luxury'] .dm-banner::after {
  content: '';
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, #c59b27, #0b5d46, #c59b27, transparent);
  opacity: 0.72;
  pointer-events: none;
}

.dm-banner-badge,
html[data-theme='luxury'] .dm-banner-badge {
  background: var(--brand-soft);
  border-color: var(--brand-border);
  color: var(--brand-primary);
}

.dm-banner-title {
  color: var(--heading);
}

.dm-banner-hint {
  color: var(--text-3);
}

.dm-banner-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--heading);
}

.dm-banner-item:hover {
  background: var(--surface);
  border-color: var(--brand-primary);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.dm-banner-item.is-active,
html[data-theme='luxury'] .dm-banner-item.is-active {
  background: var(--brand-soft);
  border-color: var(--brand-primary);
  box-shadow: 0 2px 10px rgba(7, 89, 133, 0.1);
}

.dm-bi-icon {
  inline-size: 32px;
  block-size: 32px;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand-primary);
  border: 1px solid var(--brand-border);
}

.dm-banner-item:hover .dm-bi-icon,
.dm-banner-item.is-active .dm-bi-icon,
html[data-theme='luxury'] .dm-banner-item:hover .dm-bi-icon,
html[data-theme='luxury'] .dm-banner-item.is-active .dm-bi-icon {
  background: var(--gradient-primary);
  border-color: transparent;
  color: #ffffff;
}

.dm-bi-label {
  color: var(--heading);
}

.dm-banner-item.is-active .dm-bi-label {
  color: var(--brand-primary);
}

.dm-bi-meta {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-2);
}

.dm-banner-item.is-active .dm-bi-meta {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
}

.dm-footer {
  padding-top: 10px;
}

.dm-footer-bottom {
  padding-top: 0;
}

/* 5-stage Pipeline */
.pipeline-card {
  padding: 14px 16px;
  margin-block-end: 12px;
}

.pipeline-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.stage-btn {
  text-align: start;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.stage-btn:hover {
  transform: translateY(-2px);
  border-color: var(--brand-primary);
  background: var(--surface);
}

.stage-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stage-count {
  font-family: var(--font-heading);
  font-variant-numeric: tabular-nums;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--brand-primary);
}

.stage-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--heading);
}

.stage-desc {
  font-size: 0.78rem;
  color: var(--text-3);
}

/* Analytics Charts + Mini KPI */
.analytics-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.95fr;
  gap: 12px;
  margin-block-end: 12px;
}

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

.chart-card {
  padding: 14px 16px;
}

.chart-box {
  margin-block-start: 6px;
  min-block-size: 165px;
}

.donut-layout {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.legend-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-2);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
}

.dot {
  inline-size: 11px;
  block-size: 11px;
  border-radius: 999px;
  display: inline-block;
  flex-shrink: 0;
}

.kpi-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.kpi-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  box-shadow: var(--shadow-card);
}

.kpi-label { color: var(--text-3); font-size: 0.82rem; font-weight: 600; }
.kpi-value {
  font-family: var(--font-heading);
  font-variant-numeric: tabular-nums;
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.1;
}
.warn-text { color: var(--warn); }
.ok-text { color: var(--good); }
.primary-text { color: var(--brand-primary); }
.err-text { color: var(--bad); }

/* Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-block-end: 12px;
}

.filter-tabs,
.toolbar-right,
.search-box {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.filter-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 600;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.filter-btn:hover {
  border-color: var(--brand-border);
  background: var(--brand-soft);
}

.filter-btn.active,
.dm-seg-bar button.active {
  background: var(--gradient-primary);
  color: #ffffff;
  border-color: transparent;
}

input[type="search"],
input[type="text"],
input[type="password"],
input[type="datetime-local"],
select,
textarea {
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  font-size: 0.88rem;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: var(--focus-ring);
}

.btn {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 7px 13px;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.84rem;
  line-height: 1.3;
  transition: transform 0.12s ease, opacity 0.15s ease, background-color 0.15s ease;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #ffffff;
}
.btn-primary:hover:not(:disabled) {
  opacity: 0.94;
}
.btn-secondary {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--brand-soft);
  border-color: var(--brand-border);
}
.btn-danger {
  background: var(--bad-bg);
  color: var(--bad);
  border-color: var(--bad-border);
}
.btn-icon {
  background: transparent;
  color: var(--text-3);
  font-size: 1.1rem;
  padding: 4px 8px;
}

/* Visual Social Card Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(305px, 1fr));
  gap: 12px;
}

.cards-grid[hidden] { display: none; }

.post-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
}

.card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--gradient-banner);
  overflow: hidden;
}

.card-thumb img,
.card-thumb video {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  display: block;
}

.thumb-placeholder {
  inline-size: 100%;
  block-size: 100%;
  display: grid;
  place-items: center;
  color: var(--text-3);
  font-weight: 600;
  font-size: 0.85rem;
}

.thumb-overlay-top {
  position: absolute;
  inset: 8px 8px auto;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
}

.card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.card-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-3);
}

.card-meta-row strong {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--brand-primary);
}

.card-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 0.96rem;
  line-height: 1.35;
  text-wrap: balance;
}

.card-excerpt {
  margin: 0;
  font-size: 0.83rem;
  color: var(--text-3);
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.channel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ch-chip {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  color: #ffffff;
}

.ch-facebook { background: #1877f2; }
.ch-wordpress { background: #21759b; }
.ch-zalo_oa { background: #0068ff; }
.ch-youtube { background: #dc2626; }
.ch-tiktok { background: #111827; }

.card-foot {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
}

/* Responsive Table */
#table-container[hidden] { display: none; }

.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  max-block-size: min(620px, 75vh);
  container-type: inline-size;
}

table {
  inline-size: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.87rem;
}

caption {
  text-align: start;
  padding: 12px 14px;
  font-weight: 600;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
}

thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
  background: var(--surface-2);
}
th, td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: start;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
tbody th {
  position: sticky;
  inset-inline-start: 0;
  background: var(--surface);
  z-index: 1;
  font-family: var(--mono);
  font-weight: 700;
}

.table-thumb {
  inline-size: 72px;
  block-size: 42px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
}

@container (width < 600px) {
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  tr { margin-block-end: 14px; border: 1px solid var(--border); border-radius: 8px; }
  tbody th { position: sticky; inset-block-start: 0; z-index: 2; background: var(--brand-soft); }
  table { --label-2: "Ảnh"; --label-3: "Chủ đề"; --label-4: "Tầng"; --label-5: "Kênh"; --label-6: "Y khoa"; --label-7: "Trạng thái"; --label-8: "Thao tác"; }
  td:nth-child(2)::before { content: var(--label-2) ": "; font-weight: 600; }
  td:nth-child(3)::before { content: var(--label-3) ": "; font-weight: 600; }
  td:nth-child(4)::before { content: var(--label-4) ": "; font-weight: 600; }
  td:nth-child(5)::before { content: var(--label-5) ": "; font-weight: 600; }
  td:nth-child(6)::before { content: var(--label-6) ": "; font-weight: 600; }
  td:nth-child(7)::before { content: var(--label-7) ": "; font-weight: 600; }
  td:nth-child(8)::before { content: var(--label-8) ": "; font-weight: 600; }
}

/* Calendar View */
.calendar-card { padding: 14px 16px; }
.calendar-controls { display: flex; align-items: center; gap: 8px; }
.cal-label { min-inline-size: 130px; text-align: center; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.cal-dow {
  background: var(--surface-2);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 8px;
  text-align: center;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.cal-cell {
  min-block-size: 105px;
  padding: 6px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cal-cell.is-empty { background: var(--surface-2); }
.cal-day-num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-3);
}
.cal-event {
  border: 1px solid var(--brand-border);
  background: var(--brand-soft);
  color: var(--brand-primary);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: start;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Media, Connections & Control */
.studio-grid,
.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 960px) {
  .studio-grid, .control-grid { grid-template-columns: 1fr; }
}

.studio-panel {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.studio-panel h2, .studio-panel h3 { margin: 0; }

.dropzone {
  border: 2px dashed var(--brand-border);
  background: var(--brand-soft);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 10px;
}

.media-tile {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
}

.media-tile img,
.media-tile video {
  inline-size: 100%;
  block-size: 115px;
  object-fit: cover;
  display: block;
}

.media-tile-foot {
  padding: 6px 8px;
  font-size: 0.76rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.knowledge-list { display: flex; flex-wrap: wrap; gap: 6px; }
.knowledge-viewer {
  max-block-size: 180px;
  overflow: auto;
  background: var(--surface-2);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.knowledge-form { display: flex; flex-direction: column; gap: 8px; }

.killswitch-box {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.readiness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 8px;
}

.ready-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.ready-item:hover {
  border-color: var(--brand-primary);
  background: var(--brand-soft);
}

.connections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 12px;
}

.conn-card {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.conn-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.conn-head > div {
  min-width: 0;
  flex: 1;
}

.conn-head h3 { margin: 0; font-size: 0.98rem; }
.conn-head p { margin: 3px 0 0; font-size: 0.8rem; }

.conn-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.quick-connect-box {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--brand-border);
  background: var(--brand-soft);
}

.quick-connect-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--heading);
  margin-bottom: 4px;
}

.quick-connect-desc {
  font-size: 0.78rem;
  margin: 0 0 8px;
}

.quick-status-msg {
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 6px;
  min-block-size: 1.1rem;
}

.conn-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.conn-result {
  margin: 0;
  font-size: 0.82rem;
  min-block-size: 1.1rem;
}

.audit-timeline {
  margin: 0;
  padding-inline-start: 18px;
  max-block-size: 420px;
  overflow: auto;
  font-size: 0.83rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
  background: var(--surface-3);
  color: var(--text);
}
.pill-ok { background: var(--good-bg); color: var(--good); border-color: rgba(5, 150, 105, 0.32); }
.pill-warn { background: var(--warn-bg); color: var(--warn); border-color: rgba(180, 83, 9, 0.32); }
.pill-err { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-border); }
.pill-info { background: var(--info-bg); color: var(--info-text); border-color: var(--brand-border); }

/* Native Modal Dialogs + Mandatory Scroll Containment */
dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  inline-size: min(1020px, 95vw);
  max-block-size: 92vh;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.35);
}

dialog[open] { display: flex; flex-direction: column; }
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop {
  background: rgba(15, 23, 42, 0.58);
  overflow: hidden;
  overscroll-behavior: contain;
}

#force-update-modal { inline-size: min(560px, 92vw); }

.dialog-header {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dialog-header h1 { margin: 0; font-size: 1.08rem; }
.lock-header { background: var(--bad-bg); color: var(--bad); }

.dialog-body {
  padding: 14px 18px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dialog-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.compliance-box { border-radius: var(--radius-sm); padding: 10px 13px; font-size: 0.85rem; }

/* Accessible Tabs inside Review Modal */
.modal-tablist {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  gap: 4px;
}

.modal-tablist [role="tab"] {
  flex: none;
  position: relative;
  border: none;
  background: transparent;
  color: var(--text-3);
  padding: 9px 13px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.modal-tablist [role="tab"][aria-selected="true"] {
  color: var(--brand-primary);
}

.modal-tablist [role="tab"][aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  border-block-end: 3px solid var(--brand-primary);
}

.panel-inner {
  margin-block-start: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  background: var(--surface-2);
}

/* Realistic Facebook Mockup */
.fb-mockup {
  max-inline-size: 560px;
  margin-inline: auto;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.fb-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 8px; }
.fb-avatar {
  inline-size: 40px; block-size: 40px; border-radius: 999px;
  background: #1877f2; color: #ffffff; font-weight: 800; font-size: 1.2rem;
  display: grid; place-items: center;
}
.fb-sub { font-size: 0.76rem; color: var(--text-3); }
.fb-body { margin: 0; padding: 6px 14px 12px; white-space: pre-wrap; font-family: var(--font); font-size: 0.9rem; overflow-wrap: break-word; }
.fb-media img, .fb-media video { inline-size: 100%; max-block-size: 360px; object-fit: cover; display: block; }
.fb-actions-bar {
  display: flex; justify-content: space-around; padding: 9px;
  border-top: 1px solid var(--line); font-size: 0.84rem; font-weight: 600; color: var(--text-3);
}

/* Website SEO Mockup (.paper keeps clean clinical white for readability & A4 print) */
.serp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  margin-block-end: 10px;
}
.serp-url { font-family: var(--mono); font-size: 0.76rem; color: var(--good); }
.serp-title { font-family: var(--font-heading); font-size: 1.04rem; color: var(--brand-primary); font-weight: 700; }
.serp-desc { font-size: 0.83rem; color: var(--text-3); }

.wp-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-family: var(--font-report);
}
.wp-browser-bar {
  background: #eef2f7;
  padding: 7px 12px;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: #475569;
  display: flex;
  gap: 10px;
}
.wp-cover img { inline-size: 100%; max-block-size: 260px; object-fit: cover; display: block; }
.wp-article-title { margin: 14px 16px 6px; font-size: 1.2rem; color: #0f172a; }
.seo-render { padding: 0 16px 14px; max-block-size: 280px; overflow: auto; color: #17263c; }

/* TikTok / Shorts 9:16 Smartphone Mockup */
.video-mockup-grid {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 14px;
  align-items: start;
}
@media (max-width: 720px) {
  .video-mockup-grid { grid-template-columns: 1fr; }
}

.phone-frame {
  inline-size: 260px;
  aspect-ratio: 9 / 16;
  background: #0b1120;
  border-radius: 26px;
  border: 5px solid #1e293b;
  position: relative;
  overflow: hidden;
  margin-inline: auto;
  color: #ffffff;
}
.phone-notch {
  position: absolute; inset-block-start: 8px; inset-inline-start: 50%;
  transform: translateX(-50%); inline-size: 74px; block-size: 14px;
  background: #020617; border-radius: 999px; z-index: 3;
}
.phone-stage { inline-size: 100%; block-size: 100%; }
.phone-stage img, .phone-stage video { inline-size: 100%; block-size: 100%; object-fit: cover; display: block; }
.phone-side-actions {
  position: absolute; inset-inline-end: 8px; inset-block-end: 72px;
  display: flex; flex-direction: column; gap: 8px; text-align: center; font-size: 0.72rem; z-index: 2;
}
.phone-side-actions span { display: block; font-size: 0.68rem; }
.phone-caption {
  position: absolute; inset: auto 0 0; padding: 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  font-size: 0.76rem; z-index: 2;
}
.phone-caption p { margin: 3px 0 0; }

.storyboard-box h3 { margin-top: 0; }
.copy-box { margin: 0; white-space: pre-wrap; font-family: var(--font); font-size: 0.87rem; overflow-wrap: break-word; }

/* Editor & Forms */
.edit-grid { display: flex; flex-direction: column; gap: 10px; }
.edit-actions-row { display: flex; flex-wrap: wrap; gap: 8px; }
.media-picker-list { display: flex; flex-wrap: wrap; gap: 7px; margin-block-start: 6px; }
.media-pick-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.approval-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.form-row { display: flex; flex-direction: column; gap: 4px; font-size: 0.84rem; }
.checkbox-row { display: flex; flex-wrap: wrap; gap: 10px; padding-block-start: 4px; }

.simple-list { margin: 0; padding-inline-start: 18px; font-size: 0.85rem; }
.muted { color: var(--text-3); }
.lock-message { margin: 0; font-weight: 600; color: var(--bad); }
.lock-meta { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px; display: flex; flex-direction: column; gap: 5px; font-size: 0.86rem; overflow-wrap: break-word; }
.update-progress { margin: 0; font-size: 0.87rem; min-block-size: 1.25rem; }
