/* App shell + teleprompter styles (Tailwind handles most layout). */

:root {
  --accent: #e11d48;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: "Noto Sans Bengali", ui-sans-serif, system-ui, sans-serif;
}

body.tp-open,
body.sidebar-open,
body.pin-lock-open {
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* PIN lock screen — match ERP /public/newsroom/tasks (mobile-safe) */
.pin-lock {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Scroll when content is taller than the viewport (keyboard / short phones) */
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  min-height: 100%;
  height: 100%;
  height: 100dvh;
  padding: max(1rem, env(safe-area-inset-top, 0px))
    max(1rem, env(safe-area-inset-right, 0px))
    max(1.25rem, env(safe-area-inset-bottom, 0px))
    max(1rem, env(safe-area-inset-left, 0px));
}

.pin-lock.hidden {
  display: none !important;
}

.pin-lock__bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: #020617;
  background-image: url('/images/sokal-dark-bg.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
}

.pin-lock__scrim {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: rgba(2, 6, 23, 0.7);
  pointer-events: none;
}

.pin-lock__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 28rem;
  margin-block: auto; /* centers when short; scrolls when tall */
  padding-block: 0.5rem 1rem;
  text-align: center;
  color: #fff;
}

.pin-lock__logo {
  display: block;
  margin: 0 auto 1.5rem;
  height: 4.5rem;
  width: auto;
  max-width: min(70vw, 14rem);
  object-fit: contain;
}

@media (min-width: 640px) and (min-height: 700px) {
  .pin-lock__logo {
    height: 7rem;
    margin-bottom: 2.5rem;
    max-width: none;
  }
}

@media (min-width: 768px) and (min-height: 800px) {
  .pin-lock__logo {
    height: 8rem;
  }
}

.pin-lock__eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

@media (min-width: 640px) {
  .pin-lock__eyebrow {
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
  }
}

.pin-lock__title {
  margin: 0 0 0.5rem;
  font-size: 1.625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.2;
}

@media (min-width: 640px) {
  .pin-lock__title {
    font-size: 2.25rem;
  }
}

.pin-lock__hint {
  margin: 0 auto 1.25rem;
  max-width: 22rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.8);
}

@media (min-width: 640px) and (min-height: 700px) {
  .pin-lock__hint {
    margin-bottom: 2rem;
    font-size: 0.9375rem;
  }
}

.pin-lock__form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: 100%;
}

.pin-lock__input {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: 0.35em;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  padding: 1rem 0.75rem;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.pin-lock__input::placeholder {
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.35em;
}

.pin-lock__input:focus {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.55);
}

@media (min-width: 640px) and (min-height: 700px) {
  .pin-lock__input {
    font-size: 3rem;
    padding: 1.5rem 1rem;
  }
}

.pin-lock__error {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: #fda4af;
}

.pin-lock__submit {
  margin-top: 1.25rem;
  width: 100%;
  min-height: 2.75rem;
  border: none;
  border-radius: 0.75rem;
  background: #2563eb;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.875rem 1.25rem;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease, opacity 0.15s ease;
}

@media (min-width: 640px) and (min-height: 700px) {
  .pin-lock__submit {
    margin-top: 2rem;
  }
}

.pin-lock__submit:hover:not(:disabled) {
  background: #1d4ed8;
}

.pin-lock__submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* When mobile keyboard opens, keep submit reachable */
@media (max-height: 520px) {
  .pin-lock__logo {
    height: 3.25rem;
    margin-bottom: 0.75rem;
  }

  .pin-lock__hint {
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
  }

  .pin-lock__title {
    font-size: 1.375rem;
  }

  .pin-lock__input {
    font-size: 1.5rem;
    padding: 0.75rem;
  }

  .pin-lock__submit {
    margin-top: 0.75rem;
    position: sticky;
    bottom: 0;
    box-shadow: 0 -8px 24px rgba(2, 6, 23, 0.65);
  }
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  border-radius: 0.75rem;
  border: 1px solid transparent;
  background: transparent;
  color: #9aadc4;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
  color: #e6ecf4;
  border-color: #35485c;
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid #35485c;
  background: #172636;
  color: #e6ecf4;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.action-btn-compact {
  min-width: 2.5rem;
  padding: 0 0.55rem;
}

@media (min-width: 640px) {
  .action-btn-compact {
    padding: 0 0.75rem;
  }
}

.action-btn:hover:not(:disabled) {
  background: #243447;
  border-color: #4a6078;
}

.action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.action-btn-accent {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}

.action-btn-accent:hover:not(:disabled) {
  background: #be123c;
  border-color: transparent;
}

.day-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid #35485c;
  background: #0f1a26;
  color: #9aadc4;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.day-chip:hover {
  border-color: #4a6078;
  color: #e6ecf4;
}

.day-chip-selected {
  background: rgba(225, 29, 72, 0.16);
  border-color: rgba(225, 29, 72, 0.55);
  color: #fecdd3;
}

.day-chip-focus {
  box-shadow: 0 0 0 1px rgba(225, 29, 72, 0.35);
}

.day-chip-ghost {
  border-style: dashed;
  opacity: 0.75;
}

.day-chip-count {
  display: inline-flex;
  min-width: 1.15rem;
  height: 1.15rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.65rem;
  font-variant-numeric: tabular-nums;
}

.day-chip-selected .day-chip-count {
  background: rgba(225, 29, 72, 0.28);
}

.task-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.35rem;
  border-radius: 0.85rem;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.task-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: #243447;
}

.task-item-selected {
  background: rgba(225, 29, 72, 0.12);
  border-color: rgba(225, 29, 72, 0.45);
  box-shadow: inset 3px 0 0 var(--accent);
}

.task-item-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.task-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  color: #e8edf2;
}

.task-item-selected .task-item-title {
  color: #fff;
}

.task-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.badge {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: capitalize;
  background: #243447;
  color: #c9d5e5;
  white-space: nowrap;
}

.badge.status-completed {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}

.badge.status-in_progress {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.badge.status-pending,
.badge.status-draft {
  background: #243041;
  color: #8b98a8;
}

.badge.status-rejected {
  background: rgba(225, 29, 72, 0.2);
  color: #fda4af;
}

.section-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6b829c;
}

.prose-task {
  border: 1px solid #243447;
  border-radius: 1rem;
  background: #0f1a26;
  padding: 1rem 1.1rem;
  white-space: pre-wrap;
  line-height: 1.55;
  color: #e6ecf4;
}

.prose-task :is(p, ul, ol) {
  margin-top: 0;
}

.prose-task a {
  color: #fb7185;
}

.step-card {
  border: 1px solid #243447;
  border-radius: 0.9rem;
  background: #0f1a26;
  padding: 0.85rem 1rem;
}

.scrollbar-thin {
  scrollbar-width: thin;
  scrollbar-color: #35485c transparent;
}

/* ---- Teleprompter (parity with ERP TeleprompterModal) ---- */

.tp-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: #000;
  color: #fafafa;
  outline: none;
}

.tp-root.tp-light {
  color: #111111;
}

.tp-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  padding: 0 0.75rem;
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 30;
}

.tp-root.tp-light .tp-top {
  border-bottom-color: #e5e5e5;
  background: rgba(255, 255, 255, 0.9);
}

.tp-title {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tp-root.tp-light .tp-title {
  color: #262626;
}

.tp-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: #d4d4d4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.375rem;
  cursor: pointer;
  flex-shrink: 0;
}

.tp-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.tp-root.tp-light .tp-close {
  color: #525252;
}

.tp-root.tp-light .tp-close:hover {
  background: #f5f5f5;
  color: #171717;
}

.tp-progress {
  height: 2px;
  width: 100%;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
}

.tp-root.tp-light .tp-progress {
  background: #e5e5e5;
}

.tp-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: #ef4444;
  transition: width 150ms linear;
}

.tp-stage-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
}

.tp-cue-row {
  pointer-events: none;
  position: absolute;
  inset-inline: 0;
  top: 40%;
  z-index: 10;
  display: flex;
  align-items: center;
}

.tp-cue-arrow {
  margin-left: 0.75rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #dc2626;
  line-height: 1;
}

.tp-cue-line {
  position: relative;
  height: 2px;
  flex: 1;
  background: #dc2626;
  left: -50px;
  margin-right: -50px;
}

.tp-stage {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  /* Avoid -webkit-overflow-scrolling:touch — Safari ignores programmatic scrollTop with it */
}

.tp-stage.is-autoplaying {
  overflow-y: hidden;
  touch-action: none;
}

.tp-flip {
  transform-origin: center center;
  will-change: transform;
  backface-visibility: hidden;
}

.tp-script {
  margin: 0 auto;
  width: min(48rem, 100%);
  padding-inline: 1rem;
  text-align: center;
  font-weight: 400;
  word-break: break-word;
  selection-background-color: rgba(127, 29, 29, 0.4);
}

.tp-script::selection {
  background: rgba(127, 29, 29, 0.4);
}

.tp-dock {
  position: relative;
  z-index: 30;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.7);
  padding: 0.5rem 0.75rem;
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
}

.tp-root.tp-light .tp-dock {
  border-top-color: #e5e5e5;
  background: rgba(255, 255, 255, 0.95);
}

.tp-basic-panel {
  margin-bottom: 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid #404040;
  background: rgba(23, 23, 23, 0.95);
  color: #f5f5f5;
  padding: 0.75rem;
}

.tp-root.tp-light .tp-basic-panel {
  border-color: #e5e5e5;
  background: #fff;
  color: #262626;
}

.tp-basic-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.tp-basic-row:last-child {
  margin-bottom: 0;
}

.tp-basic-label {
  font-size: 0.75rem;
  opacity: 0.7;
}

.tp-size-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.375rem;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.tp-size-step:hover {
  background: rgba(255, 255, 255, 0.1);
}

.tp-root.tp-light .tp-size-step:hover {
  background: #f5f5f5;
}

.tp-speed-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tp-speed-row input[type="range"] {
  flex: 1;
  accent-color: #e11d48;
}

.tp-dock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tp-dock-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tp-round-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  border: 1px solid #525252;
  background: #171717;
  color: #f5f5f5;
  cursor: pointer;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.tp-root.tp-light .tp-round-btn {
  border-color: #e5e5e5;
  background: #fff;
  color: #404040;
}

.tp-round-btn:hover {
  background: #262626;
}

.tp-root.tp-light .tp-round-btn:hover {
  background: #fafafa;
}

.tp-round-btn.is-active {
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.6);
}

.tp-play {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.tp-play:hover {
  background: #ef4444;
}

.tp-settings-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  padding: 1rem;
}

@media (min-width: 640px) {
  .tp-settings-overlay {
    align-items: center;
  }
}

.tp-settings-sheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 28rem;
  max-height: min(85dvh, 640px);
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid #404040;
  background: #171717;
  color: #f5f5f5;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.tp-root.tp-light .tp-settings-sheet {
  border-color: #e5e5e5;
  background: #fff;
  color: #171717;
}

.tp-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #404040;
  flex-shrink: 0;
}

.tp-root.tp-light .tp-settings-head {
  border-bottom-color: #e5e5e5;
}

.tp-settings-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.tp-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tp-settings-row > span {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.7;
}

.tp-select {
  border-radius: 0.375rem;
  border: 1px solid #404040;
  background: #0a0a0a;
  color: #f5f5f5;
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  outline: none;
}

.tp-root.tp-light .tp-select {
  border-color: #d4d4d4;
  background: #fff;
  color: #171717;
}

.tp-switch {
  appearance: none;
  width: 2.5rem;
  height: 1.4rem;
  border-radius: 999px;
  background: #404040;
  position: relative;
  cursor: pointer;
  border: 0;
  transition: background 0.15s ease;
}

.tp-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  background: #fff;
  transition: transform 0.15s ease;
}

.tp-switch.is-on {
  background: #e11d48;
}

.tp-switch.is-on::after {
  transform: translateX(1.1rem);
}

.tp-color-swatches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.tp-swatch {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}

.tp-swatch.is-active {
  border-color: #ef4444;
}

.tp-linebreak-btn {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 0.5rem;
  border: 1px solid #404040;
  background: transparent;
  color: inherit;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.tp-root.tp-light .tp-linebreak-btn {
  border-color: #e5e5e5;
}

.tp-linebreak-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.tp-root.tp-light .tp-linebreak-btn:hover {
  background: #fafafa;
}

.tp-linebreak-btn.is-active {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.tp-linebreak-btn strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
}

.tp-linebreak-btn span {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.75rem;
  opacity: 0.6;
}

.tp-icon-svg {
  width: 1.25rem;
  height: 1.25rem;
}

.tp-chevron-flip {
  transition: transform 0.15s ease;
}

.tp-chevron-flip.is-open {
  transform: rotate(180deg);
}
