:root {
  --bg: #04100f;
  --ink: #fff7e8;
  --muted: #aeb9ad;
  --subtle: #7d8c84;
  --surface: #101b18;
  --surface-2: #162821;
  --surface-3: #0b1916;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(211, 164, 70, 0.38);
  --gold: #d3a446;
  --gold-deep: #9a6c25;
  --green: #2d8b68;
  --teal: #1f7480;
  --rose: #c98791;
  --blue: #8199c8;
  --amber: #cf9850;
  --radius: 6px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 0%, rgba(211, 164, 70, 0.12), transparent 30rem),
    radial-gradient(circle at 88% 12%, rgba(31, 116, 128, 0.12), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family: "Tajawal", "Cairo", "Noto Kufi Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  line-height: 1.4;
}

h2 {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  min-height: 100vh;
  direction: ltr;
}

.workspace {
  grid-column: 1;
  min-width: 0;
  direction: rtl;
  background: transparent;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  gap: 20px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 16, 15, 0.96);
  backdrop-filter: blur(14px);
}

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

.topbar-brand img {
  width: 154px;
  max-height: 46px;
  object-fit: contain;
}

.eyebrow {
  margin-bottom: 3px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

.top-actions,
.inline-actions,
.render-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logout-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding-inline-start: 10px;
  border-inline-start: 1px solid var(--line);
}

.logout-form span {
  max-width: 120px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-form input {
  display: none;
}

.logout-form button {
  min-height: 34px;
}

.primary-btn,
.ghost-btn,
.download-link,
.mode-btn,
.tab,
.week-tab,
.platform-link,
.plan-chip {
  min-height: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 7px 12px;
  color: var(--ink);
  background: var(--surface-2);
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.primary-btn {
  border-color: var(--gold);
  background: var(--gold);
  color: #17130b;
  font-weight: 700;
}

.ghost-btn:disabled,
.primary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.ghost-btn:hover:not(:disabled),
.primary-btn:hover:not(:disabled),
.download-link:hover,
.mode-btn:hover,
.tab:hover,
.platform-link:hover,
.week-tab:hover,
.plan-chip:hover {
  border-color: var(--line-strong);
  filter: brightness(1.06);
}

.mode-switcher {
  position: sticky;
  top: 76px;
  z-index: 11;
  display: flex;
  gap: 4px;
  padding: 9px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 16, 15, 0.96);
  backdrop-filter: blur(14px);
  overflow-x: auto;
  scrollbar-width: thin;
}

.mode-btn {
  min-width: 116px;
  min-height: 34px;
  border-color: transparent;
  color: var(--muted);
  background: transparent;
}

.mode-btn.active {
  border-color: rgba(211, 164, 70, 0.34);
  color: var(--gold);
  background: rgba(211, 164, 70, 0.12);
  font-weight: 700;
}

.mode-btn.audio-lab-main-link {
  border-color: rgba(45, 139, 104, 0.34);
  color: #d8f6e8;
  background: rgba(45, 139, 104, 0.12);
}

.mode-btn.audio-lab-main-link:hover {
  border-color: rgba(255, 224, 138, 0.56);
  color: var(--gold);
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 22px 0;
}

.metric-card {
  min-height: 62px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.metric-card strong {
  display: block;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.1;
}

.metric-card span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

body[data-mode="studio"] .metrics-strip,
body[data-mode="library"] .metrics-strip,
body[data-mode="voice"] .metrics-strip,
body[data-mode="calendar"] .metrics-strip,
body[data-mode="publisher"] .metrics-strip {
  display: none;
}

body:not([data-mode="designer"]) .top-actions > #resetBtn,
body:not([data-mode="designer"]) .top-actions > #saveImageBtn,
body:not([data-mode="designer"]) .top-actions > #downloadBtn {
  display: none;
}

.view-pane {
  display: none;
  min-height: calc(100vh - 185px);
}

.view-pane.active {
  display: block;
}

.preview-stage {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 185px);
  padding: 22px;
  overflow: auto;
}

#designCanvas {
  display: block;
  width: min(100%, 76vh, 900px);
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  background: #050605;
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.5);
}

.controls {
  grid-column: 2;
  height: 100vh;
  overflow: auto;
  direction: rtl;
  border-right: 1px solid var(--line);
  background: rgba(11, 25, 22, 0.96);
  padding: 0 16px 20px;
  scrollbar-color: #343b35 transparent;
  scrollbar-width: thin;
}

.brand-block {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  margin: 0 -16px 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 16, 15, 0.97);
  backdrop-filter: blur(14px);
}

.brand-block img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: contain;
  padding: 4px;
  background: rgba(255, 247, 232, 0.9);
  border: 1px solid var(--line-strong);
}

.brand-block strong,
.brand-block small {
  display: block;
}

.brand-block small {
  margin-top: 4px;
  color: var(--subtle);
  font-size: 11px;
  line-height: 1.5;
}

.control-panel {
  display: none;
}

.control-panel.active {
  display: block;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 10px;
}

.tab {
  min-height: 34px;
  color: var(--muted);
  background: var(--surface-2);
}

.tab.active {
  border-color: var(--line-strong);
  color: var(--gold);
  background: rgba(221, 182, 93, 0.1);
  font-weight: 700;
}

.control-section {
  padding: 17px 2px;
  border-top: 1px solid var(--line);
}

.first-section {
  border-top: 0;
  padding-top: 4px;
}

.control-section h2 {
  margin-bottom: 13px;
  color: var(--ink);
  font-size: 13px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(207, 195, 165, 0.22);
  border-radius: var(--radius);
  background: var(--surface-3);
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 38px;
  padding: 7px 9px;
}

textarea {
  resize: vertical;
  min-height: 92px;
  padding: 10px;
  line-height: 1.7;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(221, 182, 93, 0.7);
  box-shadow: 0 0 0 3px rgba(221, 182, 93, 0.1);
}

input[type="range"] {
  padding: 0;
  accent-color: var(--gold);
}

.file-control input {
  padding: 8px;
}

.check-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid rgba(207, 195, 165, 0.22);
  border-radius: var(--radius);
  background: var(--surface-3);
}

.check-control input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--gold);
}

.compact label {
  margin-bottom: 10px;
}

.motion-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.motion-control-grid label {
  min-width: 0;
}

.inline-actions {
  justify-content: stretch;
}

.inline-actions button {
  flex: 1;
}

.video-workbench {
  display: grid;
  grid-template-columns: minmax(280px, 520px) minmax(280px, 1fr);
  gap: 18px;
  align-items: start;
  padding: 24px 30px 30px;
}

.studio-workspace {
  padding: 14px 18px 24px;
}

.studio-preview-column {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 1.5fr);
  gap: 14px 18px;
  align-items: start;
}

.studio-pro-banner {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid rgba(211, 164, 70, 0.34);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(211, 164, 70, 0.13), rgba(31, 116, 128, 0.10)),
    var(--surface);
}

.studio-pro-banner h2 {
  font-size: 16px;
}

.studio-pro-chips,
.studio-toolbar-actions,
.timeline-head,
.platform-preset-grid,
.green-screen-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.studio-pro-chips {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.studio-pro-chips span {
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid rgba(211, 164, 70, 0.28);
  border-radius: 999px;
  color: #f6dc9c;
  background: rgba(6, 12, 10, 0.42);
  font-size: 11px;
}

.studio-toolbar,
.timeline-editor,
.render-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.studio-toolbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  gap: 14px;
  padding: 8px 12px;
}

.studio-toolbar-actions {
  justify-content: flex-end;
}

.preview-zoom-control {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.preview-zoom-control input {
  width: 104px;
  min-height: 28px;
}

.transport-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface-2);
}

.transport-play {
  min-width: 92px;
}

.timecode {
  direction: ltr;
  color: var(--muted);
  font-family: Consolas, monospace;
  font-size: 13px;
}

.compact-button {
  min-height: 36px;
  padding: 6px 10px;
}

.video-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  align-self: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #080b08;
}

.video-stage {
  --preview-zoom: 1;
}

#videoCanvas {
  display: block;
  width: min(100%, 60vh, 520px);
  max-height: calc(100vh - 245px);
  aspect-ratio: 9 / 16;
  height: auto;
  background: #050605;
  box-shadow: 0 18px 64px rgba(0, 0, 0, 0.42);
  transform: scale(var(--preview-zoom));
  transform-origin: center;
  transition: transform 140ms ease;
}

#videoSource,
#audioSource,
#voiceSource {
  display: none;
}

.drop-overlay {
  position: absolute;
  inset: 16px;
  z-index: 3;
  display: none;
  place-content: center;
  gap: 7px;
  border: 1px dashed rgba(221, 182, 93, 0.72);
  border-radius: var(--radius);
  text-align: center;
  color: var(--ink);
  background: rgba(12, 16, 12, 0.92);
  pointer-events: none;
}

.drop-overlay span {
  color: var(--muted);
  font-size: 12px;
}

.video-stage.is-empty .drop-overlay,
.video-stage.is-dragging .drop-overlay {
  display: grid;
}

.video-stage.is-dragging .drop-overlay {
  border-color: var(--gold);
  background: rgba(26, 28, 20, 0.96);
}

.timeline-editor {
  display: grid;
  gap: 9px;
  padding: 12px;
  min-width: 0;
}

.timeline-head {
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.timeline-head h2 {
  font-size: 14px;
}

.timeline-head > span {
  flex: 0 1 auto;
  color: var(--subtle);
  font-size: 11px;
  line-height: 1.5;
  text-align: left;
}

.timeline-ruler {
  display: flex;
  justify-content: space-between;
  direction: ltr;
  color: var(--subtle);
  font-family: Consolas, monospace;
  font-size: 10px;
}

.timeline-scrubber {
  min-height: 22px;
  margin: 0;
}

.timeline-track {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  min-height: 78px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025), transparent 38%),
    #101410;
}

.track-label {
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px;
  border-left: 1px solid var(--line);
}

.track-label strong {
  color: var(--gold);
  font-size: 12px;
}

.track-label span {
  overflow: hidden;
  color: var(--subtle);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-content {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 72px),
    linear-gradient(180deg, rgba(255,255,255,0.025), transparent);
}

.clip-block {
  position: absolute;
  top: 10px;
  right: 10px;
  bottom: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  min-width: 46px;
  overflow: hidden;
  padding: 0 12px;
  border: 1px solid rgba(107, 166, 162, 0.56);
  border-radius: 5px;
  color: #dff8f5;
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
  background:
    linear-gradient(90deg, rgba(107, 166, 162, 0.22), rgba(129, 153, 200, 0.2)),
    #182321;
  cursor: grab;
  user-select: none;
}

.clip-block:active {
  cursor: grabbing;
}

.clip-block::before,
.clip-block::after {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  width: 7px;
  border-radius: 4px;
  background: rgba(255, 241, 194, 0.94);
  box-shadow: 0 0 0 1px rgba(54, 38, 10, 0.58);
}

.clip-block::before {
  left: 6px;
}

.clip-block::after {
  right: 6px;
}

.clip-block.is-dragging {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(211, 164, 70, 0.30), 0 10px 28px rgba(0, 0, 0, 0.24);
}

.original-audio-clip {
  border-color: rgba(232, 184, 94, 0.58);
  color: #ffefc2;
  background:
    linear-gradient(90deg, rgba(232, 184, 94, 0.28), rgba(94, 121, 160, 0.16)),
    #251f13;
}

.original-audio-clip.is-empty {
  border-style: dashed;
  color: var(--subtle);
  background: var(--surface-3);
}

.voice-clip {
  border-color: rgba(201, 135, 145, 0.56);
  color: #ffe5e9;
  background:
    linear-gradient(90deg, rgba(201, 135, 145, 0.26), rgba(207, 152, 80, 0.16)),
    #271a1e;
}

.voice-clip.is-empty {
  border-style: dashed;
  color: var(--subtle);
  background: var(--surface-3);
}

.effects-track .track-label strong {
  color: #c9c5f2;
}

.effects-clip {
  border-color: rgba(201, 197, 242, 0.56);
  color: #f1efff;
  background:
    linear-gradient(90deg, rgba(201, 197, 242, 0.25), rgba(211, 164, 70, 0.14)),
    #1b1930;
}

.effects-clip.is-empty {
  border-style: dashed;
  color: var(--subtle);
  background: var(--surface-3);
}

.waveform-wrap {
  min-height: 74px;
}

#audioWaveform {
  display: block;
  width: 100%;
  height: 76px;
  cursor: crosshair;
}

.trim-mask {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  background: rgba(4, 6, 4, 0.72);
  pointer-events: none;
}

.trim-mask-start {
  left: 0;
  border-right: 2px solid var(--gold);
}

.trim-mask-end {
  right: 0;
  border-left: 2px solid var(--gold);
}

.render-panel,
.platform-board,
.calendar-board {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.render-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
}

.render-actions {
  flex-wrap: wrap;
}

.download-link {
  display: none;
  align-items: center;
}

.download-link.ready {
  display: inline-flex;
}

.status-line {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.connection-tools {
  display: grid;
  grid-template-columns: minmax(130px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: -2px 0 14px;
}

.connection-status {
  color: var(--subtle);
  font-size: 11px;
  line-height: 1.55;
}

.connection-status.is-success {
  color: #91c8a0;
}

.connection-status.is-error {
  color: #e1a0a7;
}

.render-panel .status-line {
  grid-column: 1 / -1;
}

.platform-export-summary {
  margin-top: 7px;
  color: #f2d58c;
  font-family: Consolas, monospace;
  font-size: 12px;
}

.platform-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 8px 0 10px;
}

.platform-preset-grid .check-control {
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-3);
}

.green-screen-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  margin: 8px 0 10px;
  padding: 10px;
  border: 1px solid rgba(45, 139, 104, 0.32);
  border-radius: var(--radius);
  background: rgba(45, 139, 104, 0.08);
}

.green-screen-controls label {
  margin: 0;
}

.media-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.media-upload {
  position: relative;
  min-height: 78px;
  align-content: center;
  gap: 3px;
  margin: 0;
  padding: 10px;
  border: 1px dashed rgba(221, 182, 93, 0.3);
  border-radius: var(--radius);
  text-align: center;
  background: var(--surface-3);
  cursor: pointer;
}

.media-upload:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.media-upload strong {
  color: var(--ink);
  font-size: 12px;
}

.media-upload span {
  color: var(--subtle);
  font-size: 9px;
}

.media-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  opacity: 0;
  pointer-events: none;
}

.image-sequence-manager {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(208, 161, 78, 0.28);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(208, 161, 78, 0.08), rgba(255, 255, 255, 0.025));
}

.image-sequence-manager[hidden],
.image-sequence-timeline[hidden] {
  display: none;
}

.image-sequence-heading,
.image-sequence-actions,
.image-sequence-item,
.image-sequence-item-actions {
  display: flex;
  align-items: center;
}

.image-sequence-heading {
  justify-content: space-between;
  gap: 10px;
}

.image-sequence-heading > div:first-child {
  display: grid;
  gap: 3px;
}

.image-sequence-heading strong {
  color: var(--ink);
  font-size: 13px;
}

.image-sequence-heading span {
  color: var(--gold);
  font-family: Consolas, monospace;
  font-size: 11px;
}

.image-sequence-actions,
.image-sequence-item-actions {
  gap: 5px;
}

.image-sequence-actions button {
  min-height: 32px;
  font-size: 10px;
}

.image-sequence-list {
  display: grid;
  gap: 7px;
  max-height: 390px;
  padding-left: 2px;
  overflow-y: auto;
}

.image-sequence-item {
  gap: 9px;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-3);
  cursor: pointer;
}

.image-sequence-item.is-active {
  border-color: rgba(208, 161, 78, 0.72);
  box-shadow: inset 0 0 0 1px rgba(208, 161, 78, 0.16);
}

.image-sequence-thumb {
  flex: 0 0 48px;
  width: 48px;
  height: 62px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  background: #070907;
}

.image-sequence-meta {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 3px;
}

.image-sequence-meta strong,
.image-sequence-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-sequence-meta strong {
  color: var(--ink);
  font-size: 11px;
}

.image-sequence-meta span {
  color: var(--subtle);
  font-size: 9px;
}

.image-sequence-duration {
  display: grid;
  flex: 0 0 62px;
  gap: 3px;
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.image-sequence-duration input {
  width: 62px;
  min-height: 31px;
  padding: 4px 6px;
  direction: ltr;
  text-align: center;
}

.image-sequence-item-actions button {
  width: 29px;
  min-width: 29px;
  min-height: 29px;
  padding: 3px;
  font-size: 11px;
}

.image-sequence-timeline {
  position: absolute;
  inset: 10px;
  display: flex;
  gap: 2px;
  overflow: hidden;
  direction: ltr;
  border-radius: 5px;
}

.image-sequence-clip {
  position: relative;
  min-width: 6px;
  overflow: hidden;
  border: 1px solid rgba(107, 166, 162, 0.42);
  border-radius: 4px;
  color: #e9fffb;
  background:
    linear-gradient(180deg, rgba(107, 166, 162, 0.34), rgba(63, 104, 101, 0.2)),
    #182321;
  cursor: pointer;
}

.image-sequence-clip::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-sequence-clip.is-active {
  border-color: var(--gold);
  color: #fff4d0;
  background:
    linear-gradient(180deg, rgba(208, 161, 78, 0.48), rgba(107, 90, 48, 0.3)),
    #251f13;
}

@media (max-width: 560px) {
  .studio-pro-banner,
  .timeline-head,
  .studio-toolbar,
  .studio-toolbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .studio-pro-chips {
    justify-content: flex-start;
  }

  .preview-zoom-control input {
    width: 100%;
  }

  .green-screen-controls,
  .platform-preset-grid {
    grid-template-columns: 1fr;
  }

  .image-sequence-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .image-sequence-actions button {
    flex: 1;
  }

  .image-sequence-item {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .image-sequence-item-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

.range-value-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
}

.range-value-row output {
  direction: ltr;
  color: var(--gold);
  font-family: Consolas, monospace;
}

.effect-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 13px;
}

.effect-preset {
  min-height: 36px;
  padding: 6px;
  border: 1px solid rgba(207, 195, 165, 0.2);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface-3);
  font-size: 11px;
}

.effect-preset.active {
  border-color: var(--gold);
  color: #16120a;
  background: var(--gold);
  font-weight: 700;
}

.audio-library-shell {
  display: grid;
  gap: 18px;
  padding: 22px 30px 30px;
}

.audio-library-board,
.content-library-board {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.library-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 0.55fr);
  gap: 8px;
  width: min(520px, 100%);
}

.library-category-tabs {
  display: flex;
  gap: 7px;
  margin-bottom: 14px;
  padding-bottom: 3px;
  overflow-x: auto;
}

.library-category-tab {
  min-width: max-content;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface-3);
}

.library-category-tab.active {
  border-color: var(--gold);
  color: #17130b;
  background: var(--gold);
  font-weight: 700;
}

.audio-library-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 10px;
}

.audio-library-card,
.content-template-card {
  min-width: 0;
  border: 1px solid rgba(207, 195, 165, 0.18);
  border-radius: var(--radius);
  background: var(--surface-3);
  overflow: hidden;
}

.audio-library-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 13px;
}

.audio-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.audio-card-header h3,
.content-template-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.audio-category-label,
.content-template-type {
  display: inline-block;
  margin-top: 5px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
}

.audio-duration {
  direction: ltr;
  color: var(--teal);
  font-family: Consolas, monospace;
  font-size: 11px;
}

.audio-library-card audio,
.voice-record-preview {
  width: 100%;
  min-height: 38px;
}

.audio-source,
.audio-rights,
.audio-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.audio-rights {
  color: #91c8a0;
}

.audio-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
}

.audio-card-actions button {
  flex: 1;
  min-width: 92px;
}

.danger-btn {
  border-color: rgba(201, 135, 145, 0.35);
  color: #e7a7b0;
}

.library-empty {
  grid-column: 1 / -1;
  min-height: 100px;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.content-template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 10px;
}

.ai-voice-shell {
  display: grid;
  gap: 18px;
  padding: 22px 30px 30px;
}

.ai-voice-board {
  min-height: calc(100vh - 190px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 22% 0%, rgba(221, 182, 93, 0.12), transparent 32rem),
    linear-gradient(180deg, rgba(25, 29, 26, 0.98), rgba(10, 12, 11, 0.98));
}

.ai-voice-pill {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 6px 11px;
  border: 1px solid rgba(201, 135, 145, 0.35);
  border-radius: var(--radius);
  color: #e7a7b0;
  background: rgba(201, 135, 145, 0.08);
  font-size: 11px;
  font-weight: 700;
}

.ai-voice-pill.is-ready {
  border-color: rgba(145, 200, 160, 0.4);
  color: #91c8a0;
  background: rgba(145, 200, 160, 0.08);
}

.ai-voice-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.ai-voice-status-grid > div,
.ai-voice-result {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(207, 195, 165, 0.16);
  border-radius: var(--radius);
  background: var(--surface-3);
}

.ai-voice-status-grid strong,
.ai-voice-status-grid span {
  display: block;
}

.ai-voice-status-grid strong {
  color: var(--gold);
  font-size: 12px;
}

.ai-voice-status-grid span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.ai-voice-result {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.ai-voice-result h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.55;
}

.ai-voice-result p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.ai-voice-result audio {
  width: 100%;
}

.counter-line {
  margin-top: -8px;
  color: var(--subtle);
  direction: ltr;
  font-family: Consolas, monospace;
  font-size: 11px;
}

.counter-line.is-warning {
  color: var(--amber);
}

.content-template-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  min-height: 210px;
}

.content-template-card img {
  width: 100%;
  height: 100%;
  min-height: 210px;
  object-fit: cover;
}

.content-template-card > div {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 13px;
}

.content-template-card p {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.content-template-card small {
  color: var(--subtle);
  font-size: 10px;
  line-height: 1.6;
}

.content-template-card button {
  align-self: end;
  margin-top: auto;
}

.calendar-shell {
  display: grid;
  gap: 16px;
  padding: 24px 30px 30px;
}

.publisher-shell {
  display: grid;
  gap: 16px;
  padding: 24px 30px 30px;
}

.platform-board {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
}

.platform-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.platform-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 112px;
  justify-content: center;
  color: var(--ink);
  background: rgba(111, 148, 109, 0.16);
}

.calendar-board {
  padding: 16px;
}

.publisher-board {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(23, 27, 23, 0.72);
}

.publisher-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(240px, 0.8fr);
  gap: 12px;
}

.publish-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(207, 195, 165, 0.18);
  border-radius: var(--radius);
  background: rgba(17, 22, 17, 0.76);
}

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

.tiktok-readiness {
  display: grid;
  gap: 13px;
  padding: 16px;
  border: 1px solid rgba(98, 167, 160, 0.38);
  border-radius: var(--radius);
  background: #101410;
}

.tiktok-readiness[hidden],
.tiktok-readiness [hidden] {
  display: none;
}

.tiktok-readiness-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.tiktok-readiness-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.tiktok-readiness-header p:not(.eyebrow) {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.tiktok-api-badge {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid rgba(98, 167, 160, 0.45);
  border-radius: var(--radius);
  color: #a8d7d3;
  background: rgba(98, 167, 160, 0.09);
  font-size: 10px;
}

.tiktok-publish-grid,
.tiktok-interaction-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tiktok-interaction-controls {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tiktok-interaction-controls .check-control,
.tiktok-consent {
  margin: 0;
}

.tiktok-consent {
  padding: 11px 12px;
  border: 1px solid rgba(221, 182, 93, 0.28);
  border-radius: var(--radius);
  background: rgba(221, 182, 93, 0.06);
}

.youtube-readiness {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(221, 182, 93, 0.34);
  border-radius: var(--radius);
  background: #101410;
}

.youtube-readiness[hidden] {
  display: none;
}

.youtube-readiness-header,
.youtube-readiness-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.youtube-readiness-header p:not(.eyebrow),
.youtube-readiness-footer p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.youtube-score {
  display: grid;
  place-items: center;
  flex: 0 0 94px;
  min-height: 70px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(221, 182, 93, 0.08);
}

.youtube-score strong {
  color: var(--gold);
  font-size: 24px;
  line-height: 1;
}

.youtube-score span {
  color: var(--muted);
  font-size: 10px;
}

.youtube-score.is-ready {
  border-color: rgba(118, 155, 128, 0.7);
  background: rgba(118, 155, 128, 0.13);
}

.youtube-score.is-ready strong,
.youtube-score.is-ready span {
  color: #a9d6b4;
}

.youtube-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
}

.youtube-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold);
  transition: width 180ms ease, background 180ms ease;
}

.youtube-progress span.is-ready {
  background: var(--green);
}

.youtube-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.youtube-guide-section {
  min-width: 0;
  padding: 15px;
  border-bottom: 1px solid var(--line);
  border-inline-start: 1px solid var(--line);
  background: rgba(17, 22, 17, 0.76);
}

.youtube-guide-section:nth-child(odd) {
  border-inline-start: 0;
}

.youtube-guide-section:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.youtube-step-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.youtube-step-title > span {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--gold);
  font-weight: 700;
}

.youtube-step-title h3,
.youtube-after-publish h3 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

.youtube-step-title p {
  margin-top: 3px;
  color: var(--subtle);
  font-size: 10px;
  line-height: 1.6;
}

.youtube-guide-section label small {
  justify-self: end;
  direction: ltr;
  color: var(--subtle);
  font-family: Consolas, monospace;
  font-size: 10px;
}

.youtube-thumbnail-preview {
  display: grid;
  place-items: center;
  min-height: 118px;
  overflow: hidden;
  border: 1px dashed rgba(221, 182, 93, 0.3);
  border-radius: var(--radius);
  color: var(--subtle);
  background: rgba(0, 0, 0, 0.18);
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
}

.youtube-thumbnail-preview img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #070907;
}

.youtube-thumbnail-preview small {
  width: 100%;
  padding: 8px;
  color: var(--muted);
}

.youtube-checklist {
  display: grid;
  gap: 8px;
}

.youtube-checklist .check-control {
  align-items: flex-start;
  margin: 0;
  line-height: 1.6;
}

.youtube-readiness-footer {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.16);
}

.youtube-readiness-footer strong {
  color: var(--gold);
}

.youtube-readiness-footer.is-ready strong {
  color: #a9d6b4;
}

.youtube-after-publish {
  padding: 13px 15px;
  border-right: 3px solid var(--teal);
  background: rgba(98, 167, 160, 0.08);
}

.youtube-after-publish ol {
  display: grid;
  gap: 7px;
  margin: 9px 0 0;
  padding-inline-start: 22px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.youtube-official-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}

.youtube-official-links a {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(98, 167, 160, 0.3);
  border-radius: var(--radius);
  color: #a8d7d3;
  background: rgba(98, 167, 160, 0.08);
  font-size: 10px;
  text-decoration: none;
}

.youtube-official-links a:hover {
  border-color: var(--teal);
}

.asset-preview {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px dashed rgba(233, 196, 110, 0.28);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.18);
}

.asset-preview img,
.asset-preview video {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: #070907;
}

.asset-meta {
  width: 100%;
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.caption-limit-status {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.caption-limit-status.is-success {
  color: #91c8a0;
}

.caption-limit-status.is-error {
  color: #e1a0a7;
  font-weight: 700;
}

.publish-log {
  min-height: 150px;
  max-height: 310px;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--muted);
  font-family: Consolas, Tahoma, Arial, sans-serif;
  font-size: 12px;
  line-height: 1.65;
}

.publish-log strong {
  color: var(--gold);
}

.publish-result {
  margin-bottom: 7px;
}

.publish-result.is-success {
  color: #91c8a0;
}

.publish-result.is-error {
  color: #e1a0a7;
}

.publish-result a {
  margin-inline-start: 7px;
  color: var(--gold);
  font-weight: 700;
  text-decoration: underline;
}

.board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.compact-actions {
  width: auto;
  flex-wrap: wrap;
}

.week-tabs,
.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.week-tab {
  color: var(--muted);
  background: var(--surface-2);
}

.week-tab.active {
  border-color: var(--gold);
  color: #16120a;
  background: var(--gold);
  font-weight: 700;
}

.legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(207, 195, 165, 0.18);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 10px;
}

.day-card {
  min-height: 170px;
  border: 1px solid rgba(207, 195, 165, 0.18);
  border-radius: var(--radius);
  background: rgba(17, 22, 17, 0.75);
  overflow: hidden;
}

.day-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid rgba(207, 195, 165, 0.14);
  color: var(--ink);
  font-weight: 700;
}

.day-card header small {
  color: var(--subtle);
  font-weight: 400;
}

.day-items {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.plan-chip {
  display: block;
  width: 100%;
  min-height: 42px;
  border-color: transparent;
  color: #11140f;
  text-align: right;
  line-height: 1.45;
  font-size: 12px;
  font-weight: 700;
}

.chip-ayah {
  background: #bfe6d3;
}

.chip-hadith {
  background: #cbc5f0;
}

.chip-dhikr {
  background: #f1d6ad;
}

.chip-story {
  background: #b8d4ec;
}

.chip-question {
  background: #eed0bf;
}

.chip-reel {
  background: #d8e8bf;
}

.chip-afterlife {
  background: #efc5d4;
}

.workflow-list {
  display: grid;
  gap: 8px;
}

.workflow-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid rgba(207, 195, 165, 0.18);
  border-radius: var(--radius);
  background: var(--surface-3);
  color: var(--muted);
  font-size: 13px;
}

.workflow-item span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(233, 196, 110, 0.16);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
}

.toast {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(18, 22, 18, 0.96);
  color: var(--ink);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(7, 10, 8, 0.86), rgba(7, 10, 8, 0.94)),
    url("assets/backgrounds/grand-mosque-sunset.jpg") center / cover fixed;
}

.auth-shell {
  width: min(100%, 440px);
}

.auth-panel {
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(15, 19, 16, 0.96);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(18px);
}

.auth-logo {
  width: min(100%, 290px);
  max-height: 82px;
  margin: 0 auto 24px;
  object-fit: contain;
}

.auth-heading {
  margin-bottom: 20px;
  text-align: center;
}

.auth-heading h1 {
  font-size: 20px;
}

.auth-heading > p:last-child {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.auth-error {
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid rgba(201, 135, 145, 0.45);
  border-radius: var(--radius);
  color: #efb2bb;
  background: rgba(201, 135, 145, 0.1);
  font-size: 12px;
  line-height: 1.7;
}

.auth-notice {
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid rgba(104, 181, 127, 0.45);
  border-radius: var(--radius);
  color: #c9f3d5;
  background: rgba(104, 181, 127, 0.1);
  font-size: 12px;
  line-height: 1.7;
}

.auth-form {
  display: grid;
  gap: 2px;
}

.auth-form label small {
  color: var(--subtle);
  font-size: 10px;
  line-height: 1.6;
}

.auth-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
}

.auth-note {
  margin-top: 16px;
  color: var(--subtle);
  font-size: 10px;
  line-height: 1.7;
  text-align: center;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr) 390px;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
  }

  .top-actions {
    width: auto;
    flex-wrap: wrap;
  }

  .top-actions button {
    flex: 1;
  }

  .logout-form {
    flex: 1 1 100%;
    justify-content: flex-end;
    padding: 8px 0 0;
    border-inline-start: 0;
    border-top: 1px solid var(--line);
  }

  .metrics-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .video-workbench {
    grid-template-columns: 1fr;
  }

  .studio-preview-column {
    grid-template-columns: minmax(240px, 0.8fr) minmax(300px, 1.2fr);
  }

  .calendar-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .audio-library-grid,
  .content-template-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
  }

  .workspace,
  .controls {
    grid-column: 1;
  }

  .controls {
    height: auto;
    border-right: 0;
    border-top: 1px solid var(--line);
  }

  .topbar {
    position: static;
  }

  .mode-switcher {
    top: 0;
  }

  .brand-block {
    position: static;
  }

  .topbar,
  .mode-switcher,
  .metrics-strip,
  .preview-stage,
  .video-workbench,
  .studio-workspace,
  .audio-library-shell,
  .ai-voice-shell,
  .calendar-shell,
  .publisher-shell {
    padding-left: 18px;
    padding-right: 18px;
  }

  .view-pane {
    min-height: auto;
  }

  .preview-stage {
    min-height: 520px;
  }

  .platform-board,
  .board-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .publisher-grid {
    grid-template-columns: 1fr;
  }

  .youtube-guide-grid {
    grid-template-columns: 1fr;
  }

  .youtube-guide-section,
  .youtube-guide-section:nth-child(odd),
  .youtube-guide-section:nth-last-child(-n + 2) {
    border-inline-start: 0;
    border-bottom: 1px solid var(--line);
  }

  .youtube-guide-section:last-child {
    border-bottom: 0;
  }

  .studio-preview-column {
    grid-template-columns: 1fr;
  }

  .studio-toolbar,
  .timeline-editor,
  .render-panel {
    grid-column: 1;
  }

  .video-stage {
    min-height: 520px;
  }

  .render-panel {
    grid-template-columns: 1fr;
  }

  .render-panel .status-line {
    grid-column: 1;
  }

  .platform-links,
  .compact-actions {
    width: 100%;
  }

  .youtube-readiness-header,
  .youtube-readiness-footer,
  .tiktok-readiness-header {
    align-items: stretch;
    flex-direction: column;
  }

  .youtube-score {
    width: 100%;
  }

  .tiktok-publish-grid,
  .tiktok-interaction-controls {
    grid-template-columns: 1fr;
  }

  .library-filters {
    width: 100%;
  }

  .ai-voice-status-grid {
    grid-template-columns: 1fr;
  }

  .platform-link,
  .compact-actions button {
    flex: 1;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 20px;
  }

  .topbar-brand {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-brand img {
    width: 165px;
  }

  .top-actions,
  .mode-switcher,
  .render-actions,
  .inline-actions {
    flex-direction: column;
  }

  .logout-form {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
  }

  .top-actions button,
  .mode-btn,
  .render-actions button,
  .inline-actions button,
  .download-link {
    width: 100%;
    justify-content: center;
  }

  .metrics-strip,
  .calendar-grid,
  .tabs,
  .publish-platforms,
  .media-upload-grid,
  .audio-library-grid,
  .content-template-grid,
  .library-filters {
    grid-template-columns: 1fr;
  }

  .content-template-card {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .content-template-card img {
    min-height: 230px;
  }

  .studio-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .transport-controls {
    justify-content: center;
  }

  .timecode {
    text-align: center;
  }

  .timeline-track {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .track-label {
    padding: 7px;
  }

  .effect-presets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .motion-control-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .auth-page {
    padding: 14px;
  }

  .auth-panel {
    padding: 22px 16px;
  }

  .connection-tools {
    grid-template-columns: 1fr;
  }

  #designCanvas {
    width: 100%;
  }

  #videoCanvas {
    width: 100%;
    max-height: none;
  }
}


.server-extract-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(224, 190, 95, 0.22);
  border-radius: 14px;
  background: rgba(224, 190, 95, 0.05);
}
.server-extract-box label {
  display: grid;
  gap: 8px;
}
.download-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.download-link.hidden {
  display: none;
}

/* Corporate admin shell */
:root {
  --bg: #0d1414;
  --surface: #121b1b;
  --surface-2: #192626;
  --surface-3: #0f1919;
  --ink: #fffaf0;
  --muted: #b8c1bd;
  --subtle: #87948f;
  --gold: #d0a14e;
  --green: #1d7a6f;
  --teal: #247f8f;
  --blue: #6d8fc8;
  --rose: #c67a8c;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(208, 161, 78, 0.42);
  --radius: 6px;
}

body {
  background: #0d1414;
}

.app-shell {
  grid-template-columns: minmax(0, 1fr) 372px;
}

.topbar {
  min-height: 72px;
  background: rgba(13, 20, 20, 0.97);
}

.topbar-brand img {
  width: 170px;
}

.top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

body:not([data-mode="designer"]) #resetBtn,
body:not([data-mode="designer"]) #saveImageBtn,
body:not([data-mode="designer"]) #downloadBtn {
  display: none;
}

.admin-public-link {
  border-color: rgba(109, 143, 200, 0.38);
  color: #dbe7ff;
}

.mode-switcher {
  gap: 6px;
  padding-block: 10px;
  background: rgba(13, 20, 20, 0.97);
}

.mode-btn {
  min-width: auto;
  white-space: nowrap;
}

.mode-btn.active {
  border-color: var(--gold);
  color: #17130b;
  background: var(--gold);
  font-weight: 800;
}

body:not([data-mode="dashboard"]) .metrics-strip {
  display: none;
}

body[data-mode="dashboard"] .metrics-strip {
  display: grid;
}

.admin-dashboard,
.published-shell,
.settings-shell,
.system-shell {
  padding: 18px 22px 28px;
}

.dashboard-hero,
.published-board,
.settings-board,
.system-board,
.audio-suite-banner {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.dashboard-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  align-items: center;
  gap: 22px;
  min-height: 278px;
  padding: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 24%, rgba(244, 185, 67, 0.20), transparent 22%),
    radial-gradient(circle at 16% 78%, rgba(32, 117, 214, 0.16), transparent 30%),
    linear-gradient(118deg, rgba(8, 17, 31, 0.98) 0%, rgba(7, 27, 54, 0.94) 45%, rgba(10, 19, 28, 0.98) 100%);
}

.dashboard-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%);
  pointer-events: none;
  z-index: 0;
}

.dashboard-hero::after {
  content: "";
  position: absolute;
  inset: auto -80px -110px auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 185, 67, 0.16) 0%, rgba(244, 185, 67, 0.03) 46%, transparent 72%);
  filter: blur(8px);
  pointer-events: none;
  z-index: 0;
}

.dashboard-hero > * {
  position: relative;
  z-index: 1;
}

.dashboard-hero h2,
.published-board h2,
.settings-board h2,
.audio-suite-banner h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(25px, 3.4vw, 42px);
  line-height: 1.25;
}

.dashboard-hero p,
.audio-suite-banner p,
.published-guidelines p,
.settings-note p {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.dashboard-hero > div:first-child {
  padding: 10px 8px 10px 0;
}

.dashboard-hero > div:first-child h2 {
  text-wrap: balance;
}

.dashboard-status-grid {
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: calc(var(--radius) - 6px);
  padding: 14px;
}

.dashboard-status-grid,
.published-summary-grid,
.role-grid {
  display: grid;
  gap: 10px;
}

.dashboard-status-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-status-grid article,
.published-summary-grid article,
.role-grid article,
.published-guidelines article,
.settings-note {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.dashboard-status-grid strong,
.published-summary-grid strong {
  color: var(--gold);
  font-size: 30px;
  line-height: 1;
}

.dashboard-status-grid span,
.published-summary-grid span,
.role-grid span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.production-gateway {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: 14px;
  align-items: stretch;
  margin-top: 14px;
  padding: 18px;
  border: 1px solid rgba(208, 161, 78, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(208, 161, 78, 0.08), rgba(255, 255, 255, 0.025)),
    var(--surface);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.18);
}

.production-gateway-copy {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 6px;
}

.production-gateway-copy h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(22px, 2.4vw, 31px);
  line-height: 1.28;
}

.production-gateway-copy p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.production-gateway-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.production-gateway-step {
  display: grid;
  min-height: 142px;
  place-items: start;
  padding: 15px;
  text-align: right;
  border-color: rgba(208, 161, 78, 0.18);
  background: rgba(255, 255, 255, 0.045);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.production-gateway-step.active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.045);
}

.production-gateway-step:hover {
  transform: translateY(-2px);
  border-color: rgba(208, 161, 78, 0.38);
  background: rgba(255, 255, 255, 0.065);
}

.production-gateway-step span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.production-gateway-step strong {
  margin-top: 12px;
  color: var(--ink);
  font-size: 19px;
}

.production-gateway-step small {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.65;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.dashboard-card {
  display: grid;
  min-height: 172px;
  padding: 18px;
  place-items: start;
  text-align: right;
  border-color: var(--line);
  background: var(--surface-2);
}

.dashboard-card.active {
  color: var(--ink);
  background: var(--surface-2);
}

.dashboard-card span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.dashboard-card strong {
  margin-top: 14px;
  color: var(--ink);
  font-size: 22px;
}

.dashboard-card small {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.7;
}

.admin-quick-stack {
  display: grid;
  gap: 8px;
}

.dashboard-side-link {
  justify-content: flex-start;
  width: 100%;
  min-height: 40px;
  text-align: right;
  background: var(--surface-2);
}

.audio-suite-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 20px;
}

.published-board,
.settings-board,
.system-board {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.published-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.published-guidelines {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.published-guidelines h3,
.settings-note h3,
.role-grid strong {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.role-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.controls {
  width: 372px;
  background: #101818;
}

.brand-block {
  border-color: var(--line);
  background: var(--surface-2);
}

.control-section,
.server-extract-box {
  border-radius: var(--radius);
}

.admin-published-checklist {
  display: grid;
  gap: 8px;
}

.admin-published-checklist span {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface-2);
}

.system-status-line,
.system-result-line {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface-3);
  line-height: 1.6;
}

.system-check-grid,
.system-directory-grid,
.system-storage-grid,
.system-test-grid {
  display: grid;
  gap: 12px;
}

.system-check-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.system-check-card,
.system-directory-card,
.system-storage-card,
.system-test-grid article {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.system-check-card[data-state="ok"],
.system-directory-card[data-state="ok"],
.system-result-line.is-ok {
  border-color: rgba(45, 139, 104, 0.52);
}

.system-check-card[data-state="warn"],
.system-directory-card[data-state="warn"],
.system-result-line.is-warn {
  border-color: rgba(208, 161, 78, 0.58);
}

.system-check-card[data-state="error"],
.system-directory-card[data-state="error"],
.system-result-line.is-error {
  border-color: rgba(198, 122, 140, 0.62);
}

.system-check-card header,
.system-directory-card header,
.system-storage-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.system-check-card h3,
.system-directory-card h3,
.system-storage-card h3,
.system-test-grid h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.system-check-card p,
.system-directory-card p,
.system-storage-card p,
.system-test-grid p,
.system-detail-list {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.system-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: var(--radius);
  color: #10201b;
  background: var(--gold);
  font-size: 11px;
  font-weight: 900;
}

.system-badge.ok {
  color: #061711;
  background: #7ed4ad;
}

.system-badge.warn {
  color: #1e1606;
  background: #e6bd66;
}

.system-badge.error {
  color: #fff;
  background: #b85d73;
}

.system-detail-list {
  display: grid;
  gap: 4px;
  word-break: break-word;
}

.system-section {
  display: grid;
  gap: 12px;
}

.system-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.system-section-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
}

.system-section-heading span {
  color: var(--muted);
  font-size: 12px;
}

.system-directory-grid,
.system-storage-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.system-test-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.system-test-grid input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--ink);
  background: var(--surface-3);
}

.system-platform-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.system-platform-results {
  display: grid;
  gap: 7px;
}

.system-platform-result {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface-3);
  font-size: 12px;
  line-height: 1.6;
}

.system-platform-result.is-ok {
  border-color: rgba(45, 139, 104, 0.52);
}

.system-platform-result.is-error {
  border-color: rgba(198, 122, 140, 0.62);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr) 350px;
  }

  .controls {
    width: 350px;
  }

  .dashboard-grid,
  .published-guidelines {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .production-gateway {
    grid-template-columns: 1fr;
  }

  .production-gateway-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .controls {
    width: auto;
  }

  .admin-dashboard,
  .published-shell,
  .settings-shell,
  .system-shell {
    padding: 14px;
  }

  .dashboard-grid,
  .published-summary-grid,
  .role-grid,
  .production-gateway-flow,
  .audio-suite-banner,
  .system-check-grid,
  .system-directory-grid,
  .system-storage-grid,
  .system-test-grid {
    grid-template-columns: 1fr;
  }

  .audio-suite-banner {
    display: grid;
  }
}

@media (max-width: 560px) {
  .dashboard-status-grid,
  .dashboard-grid,
  .published-guidelines,
  .published-summary-grid,
  .role-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-hero,
  .production-gateway,
  .published-board,
  .settings-board {
    padding: 16px;
  }
}

/* Designer Pro controls - scoped to the design page only */
body[data-mode="designer"] .app-shell {
  grid-template-columns: minmax(0, 1fr) 430px;
}

body[data-mode="designer"] .controls {
  width: 430px;
  background:
    radial-gradient(circle at 100% 0%, rgba(208, 161, 78, 0.10), transparent 260px),
    linear-gradient(180deg, rgba(18, 29, 29, 0.98), rgba(12, 20, 20, 0.98));
}

body[data-mode="designer"] .preview-stage {
  padding: 30px;
  background:
    radial-gradient(circle at 50% 8%, rgba(208, 161, 78, 0.12), transparent 460px),
    radial-gradient(circle at 12% 80%, rgba(36, 127, 143, 0.10), transparent 360px);
}

body[data-mode="designer"] #designCanvas {
  width: min(100%, 82vh, 980px);
  border-radius: 14px;
  border: 1px solid rgba(208, 161, 78, 0.34);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.62), 0 0 0 10px rgba(255, 255, 255, 0.018);
}

.designer-pro-controls {
  margin: 14px -2px 0;
  padding: 14px;
  border: 1px solid rgba(208, 161, 78, 0.26);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(208, 161, 78, 0.11), rgba(255, 255, 255, 0.035)),
    rgba(12, 23, 23, 0.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 14px 34px rgba(0,0,0,.18);
}

.designer-pro-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.designer-pro-head h2 {
  font-size: 15px;
}

.designer-pro-note {
  margin-bottom: 12px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.14);
  font-size: 11px;
  line-height: 1.7;
}

.designer-pro-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.designer-pro-controls label {
  margin-bottom: 0;
}

.designer-pro-controls input[type="color"] {
  min-height: 38px;
  padding: 4px;
}

.full-width-btn {
  width: 100%;
  margin-top: 10px;
  justify-content: center;
}

body[data-mode="designer"] .tabs {
  grid-template-columns: repeat(4, 1fr);
}

body[data-mode="designer"] .control-section h2 {
  color: #fff5dd;
  font-size: 14px;
}

@media (max-width: 1180px) {
  body[data-mode="designer"] .app-shell {
    grid-template-columns: minmax(0, 1fr) 390px;
  }

  body[data-mode="designer"] .controls {
    width: 390px;
  }
}

@media (max-width: 900px) {
  body[data-mode="designer"] .app-shell {
    grid-template-columns: 1fr;
  }

  body[data-mode="designer"] .controls {
    width: auto;
  }

  .designer-pro-grid {
    grid-template-columns: 1fr;
  }
}
