:root {
  --bg-deep: #040814;
  --bg-panel: #0a142e;
  --bg-card: #0f1d40;
  --bg-input: #081129;
  --border: rgba(255, 255, 255, 0.13);
  --border-gold: rgba(250, 204, 21, 0.55);
  --navy-bright: #1d4ed8;
  --red: #d90429;
  --red-dark: #991b1b;
  --gold: #facc15;
  --white: #f8fafc;
  --muted: #94a3b8;
  --green: #16a34a;
  --font-sd: 'Noto Naskh Arabic', 'Segoe UI', 'Tahoma', sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-deep);
  color: var(--white);
  font-family: var(--font-sd);
  font-size: 14px;
  line-height: 1.45;
  min-height: 100vh;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 13px;
}

/* Top Broadcast Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 18px;
  background: linear-gradient(90deg, #060d20 0%, #0b1c48 55%, #4a0814 100%);
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.65);
  flex-wrap: wrap;
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-img {
  height: 50px;
  width: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.7));
}

.brand-titles h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  color: var(--white);
  letter-spacing: 0.4px;
}

.brand-titles p {
  margin: 0;
  font-size: 11px;
  color: var(--gold);
}

.topbar-telemetry {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.pill-live {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  border-color: var(--gold);
  color: #fff;
}

.pill-rec-active {
  background: #b91c1c;
  border-color: #fca5a5;
  animation: pulseGlow 1.1s infinite;
}

.pill-stream-live {
  background: #15803d;
  border-color: #86efac;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  display: inline-block;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* Main Layout */
.studio-shell {
  display: grid;
  grid-template-columns: 225px 1fr;
  min-height: calc(100vh - 70px);
}

.nav-rail {
  background: #060d22;
  border-left: 1px solid var(--border);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #cbd5e1;
  font-weight: 700;
  cursor: pointer;
  text-align: right;
  transition: all 0.15s ease;
}

.nav-btn:hover {
  background: rgba(29, 78, 216, 0.22);
  color: #fff;
}

.nav-btn.active {
  background: linear-gradient(135deg, var(--red) 0%, #0f2b75 100%);
  border-color: var(--gold);
  color: #fff;
  box-shadow: 0 4px 12px rgba(217, 4, 41, 0.35);
}

.nav-sub {
  font-size: 10px;
  opacity: 0.78;
  font-weight: 500;
}

/* Workspace Body */
.workspace {
  padding: 14px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* Persistent Program Monitor Deck */
.monitor-deck {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(290px, 0.95fr);
  gap: 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.monitor-deck.is-hidden-panel {
  display: none;
}

.monitor-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.monitor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.canvas-frame {
  position: relative;
  background: #000;
  border: 2px solid var(--border-gold);
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  width: 100%;
}

.canvas-frame canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.timeline-visual-strip {
  display: flex;
  gap: 4px;
  min-height: 36px;
  background: rgba(5, 11, 28, 0.9);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px;
  margin-bottom: 10px;
  overflow-x: auto;
  align-items: stretch;
}

.timeline-seg-pill {
  min-width: 64px;
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.72), rgba(14, 116, 144, 0.72));
  border: 1px solid rgba(250, 204, 21, 0.45);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.meta-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(250, 204, 21, 0.14);
  border: 1px solid rgba(250, 204, 21, 0.35);
  color: #fde68a;
}

.monitor-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Cards & Grids */
.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.card-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 7px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 9px;
}

.field label {
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--white);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
}

input[type="range"] {
  accent-color: var(--gold);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #172554;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.15s ease;
  text-decoration: none;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.15);
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.btn-red {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  border-color: rgba(250, 204, 21, 0.65);
}

.btn-gold {
  background: linear-gradient(135deg, #facc15, #eab308);
  color: #071336;
  border-color: #fff;
}

.btn-green {
  background: linear-gradient(135deg, #16a34a, #15803d);
  border-color: #86efac;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
}

.btn-sm, .btn-xs {
  padding: 4px 9px;
  font-size: 11px;
}

input[type="email"] {
  width: 100%;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--white);
  outline: none;
}

.btn.active-scene {
  background: linear-gradient(135deg, var(--red), #1d4ed8);
  border: 2px solid var(--gold);
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.35);
}

/* Scene Switcher Grid */
.scene-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.brand-gallery {
  margin: 10px 0 12px;
  padding: 12px;
  border: 1px solid var(--border, #334155);
  border-radius: 12px;
  background: rgba(15, 23, 42, .42);
}
.brand-gallery-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.brand-palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.brand-palette {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 8px;
  color: var(--text, #e2e8f0);
  text-align: left;
  border: 1px solid var(--border, #334155);
  border-radius: 10px;
  background: rgba(2, 6, 23, .56);
  cursor: pointer;
  transition: border-color .16s ease, transform .16s ease, background .16s ease;
}
.brand-palette:hover, .brand-palette:focus-visible, .brand-palette.selected {
  border-color: var(--gold, #fbbf24);
  background: rgba(30, 41, 59, .9);
  transform: translateY(-1px);
  outline: none;
}
.brand-palette > span:last-child { display: grid; gap: 2px; }
.brand-palette small { color: var(--muted, #94a3b8); font-size: 11px; }
.brand-palette-preview {
  display: grid;
  width: 54px;
  height: 38px;
  flex: 0 0 54px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px;
  background: var(--palette-base);
}
.brand-palette-preview i:nth-child(1) { height: 6px; background: var(--palette-accent); }
.brand-palette-preview i:nth-child(2) { width: 66%; height: 5px; margin: 5px 5px 0; background: rgba(255,255,255,.88); }
.brand-palette-preview i:nth-child(3) { width: 42%; height: 4px; margin: 3px 5px; background: var(--palette-accent); }

/* VU Audio Meter */
.vu-bar-wrap {
  height: 12px;
  background: #020617;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  width: 100%;
}

.vu-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #22c55e 0%, #facc15 72%, #ef4444 100%);
  transition: width 0.06s linear;
}

/* Lists & Media Cards */
.list-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.media-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.media-thumb {
  height: 124px;
  background: #020617;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.media-body {
  padding: 9px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.dropzone {
  border: 2px dashed var(--border-gold);
  border-radius: 10px;
  padding: 18px;
  text-align: center;
  background: rgba(29, 78, 216, 0.08);
  cursor: pointer;
}

.dropzone.drag-over {
  background: rgba(250, 204, 21, 0.14);
}

/* Progress Bar */
.progress-track {
  height: 14px;
  border-radius: 999px;
  background: #020617;
  border: 1px solid var(--border);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red), var(--gold));
  transition: width 0.2s ease;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.tab-panel.active {
  display: flex;
}

.alert-box {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: rgba(29, 78, 216, 0.16);
}

.alert-warn {
  background: rgba(217, 4, 41, 0.18);
  border-color: rgba(248, 113, 113, 0.6);
}

.alert-ok {
  background: rgba(22, 163, 74, 0.18);
  border-color: rgba(134, 239, 172, 0.55);
}

.small-meta {
  font-size: 11px;
  color: var(--muted);
}

/* Format Cards */
.format-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 8px;
}

.format-card {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  text-align: right;
  color: var(--white);
}

.format-card.selected {
  border: 2px solid var(--gold);
  background: linear-gradient(135deg, rgba(217, 4, 41, 0.25), rgba(29, 78, 216, 0.35));
}

/* Toast */
.toast {
  position: fixed;
  bottom: 18px;
  left: 18px;
  z-index: 90;
  padding: 10px 16px;
  border-radius: 8px;
  background: #0f172a;
  border: 2px solid var(--gold);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.65);
  display: none;
}

@media (max-width: 1100px) {
  .studio-shell {
    grid-template-columns: 1fr;
  }
  .nav-rail {
    flex-direction: row;
    overflow-x: auto;
    border-left: none;
    border-bottom: 1px solid var(--border);
  }
  .nav-btn {
    width: auto;
    white-space: nowrap;
  }
  .monitor-deck, .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ===========================
   IN-BUILT SINDHI & URDU VIRTUAL KEYBOARD
   =========================== */
body.has-vk-open {
  padding-bottom: 320px;
}

.vk-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.vk-inline-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(250, 204, 21, 0.45);
  background: rgba(250, 204, 21, 0.12);
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.vk-inline-trigger:hover {
  background: rgba(250, 204, 21, 0.26);
}

.vk-target-active {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.28);
}

.fln-vk-fab {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 94;
  padding: 9px 14px;
  border-radius: 999px;
  border: 2px solid var(--gold);
  background: linear-gradient(135deg, #0b1c48, #172554);
  color: var(--gold);
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
}

.fln-vk-fab:hover {
  filter: brightness(1.15);
}

.fln-vk-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 95;
  background: linear-gradient(180deg, rgba(10, 20, 46, 0.98) 0%, #040814 100%);
  border-top: 2px solid var(--gold);
  box-shadow: 0 -10px 34px rgba(0, 0, 0, 0.78);
  padding: 8px 10px 10px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  max-height: 55vh;
  overflow-y: auto;
}

.fln-vk-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fln-vk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.fln-vk-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fln-vk-brand {
  font-size: 12px;
  font-weight: 800;
  color: var(--gold);
}

.fln-vk-target-pill {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(29, 78, 216, 0.22);
  color: #e2e8f0;
}

.fln-vk-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.fln-vk-lang-switch {
  display: inline-flex;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-gold);
  background: var(--bg-input);
}

.fln-vk-lang-btn {
  border: none;
  background: transparent;
  color: #cbd5e1;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.fln-vk-lang-btn.active {
  background: linear-gradient(135deg, #facc15, #eab308);
  color: #06112d;
}

.fln-vk-util-btn {
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #172554;
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.fln-vk-util-btn:hover {
  border-color: var(--gold);
}

.fln-vk-hide-btn {
  background: rgba(217, 4, 41, 0.24);
  border-color: rgba(248, 113, 113, 0.6);
  color: #fecaca;
}

.fln-vk-diacritics {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  padding: 3px 6px;
  border-radius: 7px;
  background: rgba(8, 17, 41, 0.78);
  border: 1px solid var(--border);
}

.fln-vk-dia-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  margin-left: 4px;
}

.fln-vk-dia-btn {
  min-width: 28px;
  height: 24px;
  padding: 0 7px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.fln-vk-dia-btn:hover {
  border-color: var(--gold);
  background: #1e3a8a;
}

.fln-vk-keys {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fln-vk-row {
  display: flex;
  justify-content: center;
  gap: 4px;
  width: 100%;
}

.fln-vk-key {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: 44px;
  padding: 2px 4px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg, #162652 0%, #0d1838 100%);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.55);
  transition: transform 0.06s ease, background 0.12s ease, border-color 0.12s ease;
}

.fln-vk-key:hover {
  border-color: var(--gold);
  background: linear-gradient(180deg, #1d3572 0%, #132453 100%);
}

.fln-vk-key:active {
  transform: translateY(1px) scale(0.97);
  background: rgba(250, 204, 21, 0.25);
}

.vk-k-main {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
}

.vk-k-sub {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 10px;
  color: #93c5fd;
  opacity: 0.85;
  line-height: 1;
}

.vk-key-action {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

.vk-key-backspace {
  flex: 1.55 1 0;
  color: #fda4af;
}

.vk-key-enter {
  flex: 1.7 1 0;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  border-color: rgba(134, 239, 172, 0.5);
}

.vk-key-shift {
  flex: 1.55 1 0;
}

.vk-key-shift.active {
  background: linear-gradient(135deg, #facc15, #eab308);
  color: #06112d;
  border-color: #fff;
}

.vk-key-space {
  flex: 5 1 0;
  font-size: 13px;
}

.vk-key-nav {
  flex: 0.9 1 0;
  font-size: 15px;
}

@media (max-width: 768px) {
  .fln-vk-dock {
    padding: 7px 6px 9px;
  }
  .fln-vk-key {
    height: 40px;
  }
  .vk-k-main {
    font-size: 16px;
  }
}

@media (max-width: 520px) {
  body.has-vk-open {
    padding-bottom: 360px;
  }
  .fln-vk-row {
    flex-wrap: wrap;
    gap: 3px;
  }
  .fln-vk-key {
    flex: 1 1 calc(100% / 10 - 4px);
    min-width: 30px;
    height: 36px;
    padding: 2px;
  }
  .vk-k-main {
    font-size: 15px;
  }
  .vk-k-sub {
    font-size: 8.5px;
    left: 2px;
    top: 1px;
  }
  .vk-key-shift,
  .vk-key-backspace,
  .vk-key-enter {
    flex: 1.5 1 62px;
    font-size: 11px;
  }
  .vk-key-space {
    flex: 4 1 150px;
  }
  .vk-key-nav {
    flex: 1 1 38px;
  }
  .fln-vk-fab {
    bottom: 10px;
    right: 10px;
    padding: 8px 12px;
    font-size: 11px;
  }
}

/* =========================================================
   Phase 4 Slice 4D — Chief KPIs, Editorial Governance & RBAC UI
   ========================================================= */
.cd-phase4-kpi-card {
  margin-top: 14px;
}

.cd-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.cd-kpi-box {
  padding: 12px;
  border-radius: 10px;
  background: rgba(7, 16, 38, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.22);
  display: grid;
  gap: 4px;
  min-width: 0;
}

.cd-kpi-num {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--gold, #fbbf24);
  line-height: 1.15;
}

.cd-kpi-lbl {
  font-size: 0.85rem;
  font-weight: 700;
  color: #e2e8f0;
}

.cd-kpi-sub {
  font-size: 0.76rem;
  color: var(--muted, #94a3b8);
}

.nd-p4-card,
.nd-p4-assign-card {
  margin-top: 12px;
}

.nd-p4-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.nd-assign-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.nd-checklist-box {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(7, 16, 38, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.nd-checklist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.nd-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  min-width: 0;
}

.nd-stale-pill {
  background: rgba(245, 158, 11, 0.18) !important;
  color: #fde68a !important;
  border: 1px solid rgba(245, 158, 11, 0.45) !important;
}

.nd-subcard {
  padding: 12px;
  border-radius: 10px;
  background: rgba(7, 16, 38, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.2);
  margin-top: 10px;
  min-width: 0;
}

.nd-subhead {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--gold, #fbbf24);
  margin-bottom: 8px;
}

.nd-review-item,
.nd-rev-row,
.nd-corr-item,
.nd-ev-item {
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
  min-width: 0;
  overflow-wrap: anywhere;
}

.nd-action-items {
  margin-top: 6px;
  padding: 6px 9px;
  border-radius: 6px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px dashed rgba(251, 191, 36, 0.35);
  font-size: 0.84rem;
}

.nd-auth-corr-box {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  display: grid;
  gap: 6px;
}

.nd-diff-panel {
  margin-top: 10px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(5, 11, 28, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.nd-diff-field-box {
  margin-top: 8px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.nd-diff-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.nd-diff-old {
  padding: 8px;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.09);
  border: 1px solid rgba(239, 68, 68, 0.28);
  min-width: 0;
}

.nd-diff-new {
  padding: 8px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.09);
  border: 1px solid rgba(16, 185, 129, 0.28);
  min-width: 0;
}

.nd-diff-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted, #94a3b8);
  margin-bottom: 4px;
}

.nd-diff-val {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.84rem;
  line-height: 1.5;
}

.nd-diff-pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  max-width: 100%;
  font-size: 0.78rem;
}

@media (max-width: 1023px) {
  .cd-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .cd-kpi-grid,
  .nd-assign-grid,
  .nd-checklist-grid,
  .nd-diff-cols {
    grid-template-columns: 1fr;
  }
  .nd-p4-tabs .btn {
    flex: 1 1 auto;
    text-align: center;
  }
}

/* Phase 5 Master Fix: Preview vs Program Output + 10-Element Graphics Control Grid */
.dual-monitors-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.monitor-pane {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(8, 16, 36, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  padding: 8px;
  min-width: 0;
}

.monitor-pane.program-pane {
  border-color: rgba(250, 204, 21, 0.45);
}

.monitor-pane.preview-pane {
  border-color: rgba(56, 189, 248, 0.45);
}

.pane-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.pane-badge.preview {
  background: rgba(2, 132, 199, 0.25);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.5);
}

.pane-badge.program {
  background: rgba(220, 38, 38, 0.28);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.6);
}

.stage-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.stage-action-bar.has-pending {
  border-color: rgba(250, 204, 21, 0.65);
  background: rgba(113, 63, 18, 0.25);
}

.scene-grid button.preview-scene {
  outline: 2px solid #38bdf8;
  background: rgba(14, 116, 144, 0.35);
}

.gfx-10-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.gfx-10-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(8, 16, 36, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.gfx-10-title {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  min-width: 0;
}

.gfx-10-state {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

.gfx-10-state.on {
  background: rgba(22, 163, 74, 0.25);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.45);
}

.gfx-10-state.off {
  background: rgba(100, 116, 139, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

@media (max-width: 1120px) {
  .dual-monitors-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .gfx-10-grid {
    grid-template-columns: 1fr;
  }
  .monitor-header,
  .stage-action-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* =========================================================
   Full-Screen Studio Authentication Gate & Workspace Lock
   ========================================================= */
body.studio-auth-locked {
  overflow: hidden !important;
}

body.studio-auth-locked .topbar,
body.studio-auth-locked .studio-shell > .nav-rail,
body.studio-auth-locked .workspace > :not(#studioAuthGateBanner),
body.studio-auth-locked .fln-vk-fab,
body.studio-auth-locked .fln-vk-dock {
  display: none !important;
  pointer-events: none !important;
  user-select: none !important;
}

body.studio-auth-locked .studio-shell {
  grid-template-columns: 1fr !important;
  min-height: 100vh !important;
}

#studioAuthGateBanner.studio-auth-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  width: 100vw;
  height: 100vh;
  margin: 0 !important;
  padding: 24px 16px;
  border-radius: 0;
  border: none !important;
  background: radial-gradient(circle at 50% 18%, #0f2557 0%, #060e24 58%, #02050d 100%);
  overflow-y: auto;
}

.studio-auth-fullscreen-inner {
  min-height: calc(100vh - 48px);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.studio-auth-card {
  width: 100%;
  max-width: 500px;
  background: linear-gradient(180deg, rgba(10, 20, 46, 0.96) 0%, rgba(6, 12, 30, 0.98) 100%);
  border: 2px solid var(--gold);
  border-radius: 14px;
  padding: 24px 22px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.82), 0 0 28px rgba(250, 204, 21, 0.16);
}

.studio-auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(250, 204, 21, 0.35);
}

.studio-auth-logo {
  height: 58px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.7));
}

.studio-auth-heading {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: var(--white);
  letter-spacing: 0.3px;
}

.studio-auth-sub {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--gold);
}

.studio-auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.studio-auth-submit {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  margin-top: 4px;
}

.studio-onetime-reset-box {
  margin-top: 12px;
}

.studio-onetime-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
  margin: 10px 0 12px;
}

.studio-onetime-form {
  margin-top: 10px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(4, 9, 22, 0.85);
  border: 1px dashed rgba(250, 204, 21, 0.55);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (max-width: 560px) {
  .studio-auth-card {
    padding: 18px 14px;
  }
  .studio-auth-brand {
    flex-direction: column;
    text-align: center;
  }
}

/* Password Show / Hide Toggle Wrapper & UI Language Selector */
.pwd-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  gap: 6px;
}

.pwd-input-wrap input {
  flex: 1;
  min-width: 0;
}

.pwd-toggle-btn {
  flex-shrink: 0;
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid rgba(250, 204, 21, 0.45);
  background: rgba(23, 37, 84, 0.9);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pwd-toggle-btn:hover {
  background: rgba(29, 78, 216, 0.6);
  border-color: var(--gold);
}

.ui-lang-select {
  width: auto !important;
  padding: 5px 10px !important;
  font-size: 12px !important;
  font-weight: 700;
  border-radius: 999px !important;
  border: 1px solid var(--border-gold) !important;
  background: rgba(8, 17, 41, 0.92) !important;
  color: var(--gold) !important;
  cursor: pointer;
}

html[dir="ltr"] .nav-rail {
  border-left: none;
  border-right: 1px solid var(--border);
}

html[dir="ltr"] .nav-btn,
html[dir="ltr"] .format-card {
  text-align: left;
}
