html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.status-preview-shell {
  display: flex;
  justify-content: center;
}

.status-viewer-screen {
  --preview-status-color: #0a53be;
  --preview-status-background: #e7f0ff;
  container-type: inline-size;
  width: min(100%, 1180px);
  aspect-ratio: 16 / 9;
  min-height: 360px;
  border-radius: 28px;
  background: var(--preview-status-background);
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.04), 0 20px 48px rgba(2, 6, 23, 0.12);
  overflow: hidden;
  position: relative;
}

.preview-render {
  min-height: 100%;
  height: 100%;
}

.preview-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 2rem;
  padding: 2rem 2.5rem;
}

.preview-copy {
  flex: 1 1 280px;
  min-width: 220px;
}

.preview-media {
  flex: 0 1 44%;
  width: 44%;
  max-width: 420px;
  min-width: 200px;
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.2);
  overflow: hidden;
  display: none;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
}

.preview-media.is-visible {
  display: block;
}

.preview-media img,
.preview-media video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #0f172a;
}

.media-dropzone {
  border: 1px dashed rgba(100, 116, 139, 0.55);
  border-radius: 14px;
  padding: 0.9rem;
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.65) 0%, rgba(241, 245, 249, 0.35) 100%);
  transition: border-color 120ms ease, background-color 120ms ease;
}

.media-dropzone.is-dragover {
  border-color: #0d6efd;
  background: linear-gradient(180deg, rgba(219, 234, 254, 0.9) 0%, rgba(219, 234, 254, 0.55) 100%);
}

.media-dropzone-title {
  font-weight: 600;
  color: #0f172a;
}

.media-dropzone-subtitle {
  color: #475569;
  font-size: 0.84rem;
}

.media-inline-preview {
  display: none;
}

.media-inline-preview.is-visible {
  display: block;
}

.media-inline-label {
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.media-inline-surface {
  width: min(100%, 320px);
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #0f172a;
}

.media-inline-surface img,
.media-inline-surface video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-fullscreen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  text-align: center;
  padding: 30px 24px;
  width: 100%;
  height: 100%;
  position: relative;
  background: var(--preview-status-background);
}

.preview-source {
  font-size: 0.78rem;
  color: #475569;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.preview-message {
  display: block;
  max-width: 20em;
  margin-inline: auto;
  font-size: clamp(1.6rem, 6cqw, 6.5rem);
  letter-spacing: -0.035em;
  font-weight: 800;
  line-height: 1.15;
  color: var(--preview-status-color);
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.preview-expiry {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(1.5rem, env(safe-area-inset-bottom));
  white-space: nowrap;
  font-size: 0.82rem;
  color: var(--preview-status-color);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  padding: 0.28rem 0.62rem;
  backdrop-filter: blur(3px);
}

.status-viewer-screen:fullscreen,
.status-viewer-screen:-webkit-full-screen {
  width: 100vw !important;
  min-height: 100vh !important;
  height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  background: var(--preview-status-background);
}

.status-viewer-screen:fullscreen .preview-render,
.status-viewer-screen:-webkit-full-screen .preview-render {
  min-height: 100vh;
  height: 100vh;
}

@media (max-width: 575.98px) {
  .status-viewer-screen {
    min-height: 320px;
    border-radius: 20px;
  }

  .preview-render {
    min-height: 100%;
  }

  .preview-content {
    flex-direction: column;
    padding: 1.1rem;
    gap: 1rem;
  }

  .preview-copy,
  .preview-media {
    width: 100%;
    min-width: 0;
  }
}
/* The artwork belongs to the display, including browser fullscreen. */
.preview-fullscreen {
  isolation: isolate;
  background: linear-gradient(135deg, #fff 0%, var(--preview-status-background) 65%, #fff 140%);
  overflow: hidden;
  padding: clamp(1rem, 3cqw, 3rem);
  padding-bottom: max(4.5rem, env(safe-area-inset-bottom));
}

.preview-fullscreen::before {
  content: "";
  position: absolute;
  inset: -40%;
  z-index: -1;
  background: radial-gradient(ellipse at 25% 35%, #ffffffb3, transparent 45%),
              radial-gradient(ellipse at 75% 70%, var(--preview-status-background), transparent 55%);
  animation: preview-drift 24s ease-in-out infinite alternate;
  pointer-events: none;
}

.preview-watermark {
  position: absolute;
  width: 52%;
  right: -8%;
  top: 50%;
  transform: translateY(-50%) rotate(-12deg);
  color: var(--preview-status-color);
  opacity: 0.065;
  z-index: -1;
  pointer-events: none;
}

.preview-watermark svg { display: block; width: 100%; }
.preview-content { position: relative; gap: 4cqw; padding: 2cqw; }
.preview-copy { flex: 1 1 0; min-width: 0; }
.preview-media { max-width: none; }
.preview-expiry { font-size: clamp(0.8rem, 1.5cqw, 1.25rem); }

.preview-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.65);
}

.preview-progress > div {
  height: 100%;
  background: var(--preview-status-color);
  opacity: 0.55;
  transition: width 1s linear;
}

@keyframes preview-drift {
  from { transform: translate(-3%, -2%) rotate(-3deg); }
  to { transform: translate(3%, 2%) rotate(3deg); }
}

@media (orientation: portrait) {
  .status-viewer-screen:fullscreen,
  .status-viewer-screen:-webkit-full-screen { aspect-ratio: auto; }
}

@container (max-width: 560px) {
  .preview-content { flex-direction: column; gap: 1.5rem; }
  .preview-copy { flex: 0 1 auto; width: 100%; }
  .preview-message { font-size: clamp(1.5rem, 7cqw, 2.8rem); }
  .preview-media { flex: 0 1 auto; width: 65%; min-width: 0; max-height: 35vh; }
  .preview-watermark { width: 85%; right: -25%; top: 35%; }
}

@media (prefers-reduced-motion: reduce) {
  .preview-fullscreen::before { animation: none; }
  .preview-progress > div { transition: none; }
}

/* Media is the visual focus; the watermark returns when media is removed. */
.status-viewer-screen:has(.preview-media.is-visible) .preview-watermark {
  display: none;
}

.preview-media img,
.preview-media video {
  object-fit: contain;
  background: #f8fafc;
}

/* The editor shows a scaled landscape display, rather than a mobile layout. */
[data-preview-mode="draft"] .status-viewer-screen {
  min-height: 0;
  aspect-ratio: 16 / 9;
}

[data-preview-mode="draft"] .preview-fullscreen {
  gap: 0;
  padding: 3cqw 5cqw 6cqw;
}

[data-preview-mode="draft"] .preview-content {
  flex-direction: row;
  gap: 4cqw;
  padding: 0;
}

[data-preview-mode="draft"] .preview-copy {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
}

[data-preview-mode="draft"] .preview-media {
  flex: 0 0 44%;
  width: 44%;
  min-width: 0;
  max-height: none;
  border-radius: 2cqw;
}

[data-preview-mode="draft"] .preview-message {
  font-size: clamp(0.85rem, 6cqw, 6.5rem);
}

[data-preview-mode="draft"] .preview-watermark {
  width: 52%;
  right: -8%;
  top: 50%;
}
