:root {
  --page: #0f0f0f;
  --surface: #181818;
  --surface-2: #202020;
  --surface-3: #262626;
  --text: #f1f1f1;
  --muted: #aaa;
  --muted-2: #777;
  --line: rgba(255,255,255,.11);
  --line-strong: rgba(255,255,255,.18);
  --accent: #ff0033;
  --accent-hover: #cc0029;
  --accent-soft: rgba(255,0,51,.14);
  --good: #2ba640;
  --warn: #f2b200;
  --bad: #e84b4b;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 18px 60px rgba(0,0,0,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Roboto, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% -8%, rgba(255,0,51,.17), transparent 28%),
    linear-gradient(180deg, #111 0%, var(--page) 34%, #0b0b0b 100%);
  color: var(--text);
}

button, input, select { font: inherit; }
code { color: #ddd; }
a { color: inherit; text-decoration: none; }

.wrap {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  padding: 0 0 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(15,15,15,.92);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.brand-mark {
  width: 34px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 13px;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(255,0,51,.28);
}

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

.topnav a {
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 14px;
}

.topnav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.header-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: end;
  padding-top: 18px;
}

.eyebrow {
  color: #fff;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  margin: 0 0 12px;
  opacity: .74;
}

h1, h2 {
  letter-spacing: -.035em;
  line-height: 1.03;
}

h1 {
  font-size: clamp(34px, 5.2vw, 64px);
  margin: 0;
  max-width: 820px;
}

h2 {
  font-size: 22px;
  margin: 0 0 14px;
}

.lede {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
  max-width: 770px;
  margin: 14px 0 0;
}

.header-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.035));
  box-shadow: var(--shadow);
}

.header-card strong,
.header-card span { display: block; }
.header-card strong { font-size: 15px; }
.header-card span {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(330px, .68fr);
  gap: 22px;
  padding: 28px 0 58px;
}

.main-column,
.side-column {
  display: grid;
  gap: 18px;
  align-content: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 34px rgba(0,0,0,.25);
}

.panel-body { padding: 20px; }

#playerPanel,
#support-title,
#convert-title {
  scroll-margin-top: 180px;
}

.upload-panel .panel-body { padding: 18px; }

.drop-zone {
  min-height: 260px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025)),
    var(--surface-2);
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.drop-zone:hover,
.drop-zone.is-dragging,
.drop-zone:focus-visible {
  border-color: rgba(255,255,255,.34);
  background: linear-gradient(180deg, rgba(255,0,51,.13), rgba(255,255,255,.035)), var(--surface-2);
  box-shadow: inset 0 0 0 1px rgba(255,0,51,.16);
  outline: none;
}

.drop-zone.is-dragging { transform: translateY(-2px); }
.drop-zone strong { font-size: 24px; letter-spacing: -.02em; }
.drop-zone span,
.drop-zone small { color: var(--muted); }
.drop-zone small { display: block; }

.drop-icon {
  width: 64px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--accent);
  color: white;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(255,0,51,.3);
}

.url-loader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 14px;
}

input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: #121212;
  color: var(--text);
}

input::placeholder { color: #757575; }
input:focus, select:focus {
  outline: 2px solid rgba(255,0,51,.2);
  border-color: rgba(255,255,255,.35);
}

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

.button,
button {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  background: #f1f1f1;
  color: #0f0f0f;
  font-weight: 800;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.button:hover,
button:hover { transform: translateY(-1px); }

.button.secondary {
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--line);
}

.button.secondary:hover { background: #303030; }

.button.danger {
  color: white;
  background: var(--accent);
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 10px 24px rgba(255,0,51,.18);
}

.button.danger:hover { background: var(--accent-hover); }
.button.full { width: 100%; margin-top: 12px; }

.player-panel { background: #0b0b0b; }
.player-panel .panel-body { padding: 16px; }

.player-topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 2px 4px 14px;
}

.muted {
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 14px;
}

.video-frame {
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  place-items: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

video {
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
}

video.fit-contain { object-fit: contain; }
video.fit-cover { object-fit: cover; }
video.fit-fill { object-fit: fill; }
video.fit-scale-down { object-fit: scale-down; }

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

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.message {
  margin-top: 14px;
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255,255,255,.045);
  line-height: 1.45;
}

.message.good {
  color: #d7f9dd;
  border-color: rgba(43,166,64,.36);
  background: rgba(43,166,64,.12);
}
.message.warn {
  color: #fff4cf;
  border-color: rgba(242,178,0,.36);
  background: rgba(242,178,0,.12);
}
.message.bad {
  color: #ffe0e0;
  border-color: rgba(232,75,75,.4);
  background: rgba(232,75,75,.12);
}

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

.inspector-grid > div {
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  min-height: 78px;
}

.inspector-grid span,
.inspector-grid strong { display: block; }
.inspector-grid span {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}
.inspector-grid strong { overflow-wrap: anywhere; }

.capability-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.capability-row {
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.capability-row header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 8px;
}
.capability-row strong { line-height: 1.25; }
.capability-row small { color: var(--muted); }

.pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(255,255,255,.09);
  color: var(--muted);
}
.pill.good { color: #d7f9dd; background: rgba(43,166,64,.18); }
.pill.warn { color: #fff4cf; background: rgba(242,178,0,.18); }
.pill.bad { color: #ffe0e0; background: rgba(232,75,75,.18); }

.advanced-details {
  margin-top: 10px;
  color: var(--muted);
}
.advanced-details summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
}
.advanced-details small {
  display: block;
  margin-top: 6px;
}

.code-output {
  white-space: pre-wrap;
  overflow-x: auto;
  padding: 12px;
  border-radius: 14px;
  background: #101010;
  border: 1px solid var(--line);
  color: #ddd;
  max-height: 340px;
}

.is-hidden { display: none; }

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 22px 0;
  background: #0b0b0b;
}

@media (max-width: 960px) {
  .site-header { position: static; }
  .header-grid,
  .layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .wrap { width: min(100% - 28px, 1280px); }
  .topbar { height: auto; padding: 16px 0; align-items: flex-start; }
  .topnav { flex-wrap: wrap; justify-content: flex-end; }
  .header-grid { padding-top: 4px; }
  .controls-grid,
  .inspector-grid { grid-template-columns: 1fr; }
  .player-topline,
  .url-loader { grid-template-columns: 1fr; }
  .url-loader { display: grid; }
}

@media (max-width: 560px) {
  .topbar { display: grid; }
  .topnav { justify-content: flex-start; }
  .drop-zone { min-height: 220px; }
  h1 { font-size: 36px; }
}

/* Theme Toggle And Public-Site Polish */
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 9px 13px;
  font-size: 14px;
  box-shadow: none;
}

.theme-toggle:hover {
  background: var(--surface-3);
}

.lower-section {
  padding: 0 0 58px;
}

.codec-pack-card {
  background:
    linear-gradient(135deg, rgba(255,0,51,.13), transparent 45%),
    var(--surface);
}

.codec-pack-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 20px;
  align-items: center;
}

.eyebrow.compact {
  margin-bottom: 9px;
}

.codec-pack-actions {
  display: grid;
  gap: 10px;
  justify-items: stretch;
}

.cta-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.codec-pack-actions small {
  color: var(--muted);
  line-height: 1.45;
}

html[data-theme="light"] {
  --page: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #f1f1f3;
  --surface-3: #e8e8eb;
  --text: #111111;
  --muted: #5f6368;
  --muted-2: #777b80;
  --line: rgba(0,0,0,.11);
  --line-strong: rgba(0,0,0,.18);
  --accent: #e60023;
  --accent-hover: #b8001c;
  --accent-soft: rgba(230,0,35,.11);
  --good: #188038;
  --warn: #b77900;
  --bad: #c5221f;
  --shadow: 0 18px 50px rgba(0,0,0,.10);
  color-scheme: light;
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 18% -8%, rgba(230,0,35,.11), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, var(--page) 42%, #f1f1f3 100%);
}

html[data-theme="light"] .site-header {
  background: rgba(255,255,255,.93);
}

html[data-theme="light"] .topnav a:hover,
html[data-theme="light"] .theme-toggle:hover {
  background: #ececef;
}

html[data-theme="light"] .header-card {
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.72));
}

html[data-theme="light"] input,
html[data-theme="light"] select {
  background: #ffffff;
  color: var(--text);
}

html[data-theme="light"] input::placeholder { color: #8a8d91; }

html[data-theme="light"] .player-panel {
  background: #ffffff;
}

html[data-theme="light"] .video-frame,
html[data-theme="light"] video {
  background: #000;
}

html[data-theme="light"] .button.secondary {
  background: #f1f1f3;
  color: var(--text);
}

html[data-theme="light"] .button.secondary:hover {
  background: #e4e4e7;
}

html[data-theme="light"] .message,
html[data-theme="light"] .drop-zone {
  background: rgba(0,0,0,.035);
}

html[data-theme="light"] .code-output {
  background: #f4f4f6;
  color: #222;
}

html[data-theme="light"] code { color: #333; }

html[data-theme="light"] .site-footer {
  background: #ffffff;
}

html[data-theme="light"] .codec-pack-card {
  background:
    linear-gradient(135deg, rgba(230,0,35,.10), transparent 48%),
    #ffffff;
}

@media (max-width: 720px) {
  .top-actions { align-items: flex-end; flex-wrap: wrap; justify-content: flex-end; }
  .codec-pack-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .top-actions { justify-content: flex-start; }
}

/* Light Theme Contrast Fixes */
html[data-theme="light"] .eyebrow {
  color: #7a0013;
  opacity: 1;
}

html[data-theme="light"] .brand,
html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] .drop-zone strong,
html[data-theme="light"] .inspector-grid strong,
html[data-theme="light"] .capability-row strong,
html[data-theme="light"] .header-card strong {
  color: var(--text);
}

html[data-theme="light"] .topnav a,
html[data-theme="light"] .muted,
html[data-theme="light"] .lede,
html[data-theme="light"] label,
html[data-theme="light"] .drop-zone span,
html[data-theme="light"] .drop-zone small,
html[data-theme="light"] .header-card span,
html[data-theme="light"] .inspector-grid span,
html[data-theme="light"] .capability-row small,
html[data-theme="light"] .advanced-details,
html[data-theme="light"] .advanced-details summary,
html[data-theme="light"] .codec-pack-actions small,
html[data-theme="light"] .site-footer {
  color: #4f545a;
}

html[data-theme="light"] .message {
  color: #4f545a;
  background: #f5f6f8;
  border-color: rgba(0,0,0,.12);
}

html[data-theme="light"] .message.good {
  color: #0b5c22;
  background: #e8f5ec;
  border-color: rgba(24,128,56,.28);
}

html[data-theme="light"] .message.warn {
  color: #7a4d00;
  background: #fff6dc;
  border-color: rgba(183,121,0,.28);
}

html[data-theme="light"] .message.bad {
  color: #8c1d18;
  background: #fce8e6;
  border-color: rgba(197,34,31,.28);
}

html[data-theme="light"] .pill {
  color: #4f545a;
  background: #e8eaed;
}

html[data-theme="light"] .pill.good {
  color: #0b5c22;
  background: #dff2e5;
}

html[data-theme="light"] .pill.warn {
  color: #7a4d00;
  background: #fff1c7;
}

html[data-theme="light"] .pill.bad {
  color: #8c1d18;
  background: #f8d7d4;
}

html[data-theme="light"] .code-output.good {
  color: #0b5c22;
  background: #e8f5ec;
  border-color: rgba(24,128,56,.28);
}

html[data-theme="light"] .code-output.warn {
  color: #7a4d00;
  background: #fff6dc;
  border-color: rgba(183,121,0,.28);
}

html[data-theme="light"] .code-output.bad {
  color: #8c1d18;
  background: #fce8e6;
  border-color: rgba(197,34,31,.28);
}

html[data-theme="light"] .capability-row,
html[data-theme="light"] .inspector-grid > div {
  background: #f7f7f9;
}

/* Compliance And Legal Pages */
.compact-header {
  padding-bottom: 14px;
}

.legal-layout {
  padding: 42px 0 64px;
}

.legal-card {
  max-width: 920px;
  margin: 0 auto;
}

.legal-card h1 {
  margin: 0 0 8px;
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  letter-spacing: -0.055em;
}

.legal-card h2 {
  margin: 30px 0 10px;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.legal-card p,
.legal-card li {
  color: var(--muted);
  line-height: 1.75;
  font-size: 1rem;
}

.legal-card a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.legal-card a:hover {
  text-decoration: underline;
}

.legal-list {
  display: grid;
  gap: 9px;
  margin: 12px 0 0;
  padding-left: 22px;
}


.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 18px;
  color: var(--muted);
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

@media (max-width: 720px) {

  .footer-links {
    justify-content: flex-start;
  }
}

/* Multiplex Ad Slot */
.ad-placeholder-card {
  min-height: 300px;
  background: var(--surface);
}

.ad-slot {
  min-height: 300px;
  width: 100%;
}

.multiplex-ad-slot {
  display: block;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html[data-theme="light"] .ad-placeholder-card {
  background: #ffffff;
}

/* SEO Content Sections */
.seo-section,
.faq-section {
  padding: 0 0 22px;
}

.seo-card {
  background:
    linear-gradient(135deg, rgba(255,0,51,.10), transparent 42%),
    var(--surface);
}

.seo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 24px;
  align-items: start;
}

.seo-points {
  display: grid;
  gap: 10px;
}

.seo-points > div,
.faq-grid details {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.seo-points strong,
.seo-points span {
  display: block;
}

.seo-points strong {
  margin-bottom: 6px;
}

.seo-points span,
.faq-grid p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

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

.faq-grid summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--text);
}

.faq-grid p {
  margin-top: 10px;
}

html[data-theme="light"] .seo-card {
  background:
    linear-gradient(135deg, rgba(230,0,35,.08), transparent 42%),
    #ffffff;
}

html[data-theme="light"] .seo-points > div,
html[data-theme="light"] .faq-grid details {
  background: #f7f7f9;
}

html[data-theme="light"] .seo-points span,
html[data-theme="light"] .faq-grid p {
  color: #4f545a;
}

@media (max-width: 720px) {
  .seo-grid,
  .faq-grid {
    grid-template-columns: 1fr;
  }
}
