:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --panel-soft: #f9fafb;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #dc2626;
  --accent-soft: rgba(220, 38, 38, 0.08);
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(220, 38, 38, 0.07), transparent 28%),
    linear-gradient(180deg, #fbfbfc 0%, var(--bg) 100%);
  color: var(--text);
  font-family: "Avenir Next", "Helvetica Neue", "Segoe UI", sans-serif;
}

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

button,
input,
textarea {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 20px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero__copy,
.hero__meta,
.panel {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero__copy {
  padding: 34px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.hero__subtitle {
  max-width: 64ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.hero__meta {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.meta-card {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

.meta-card strong,
.toggle-row strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1rem;
}

.meta-card span,
.panel__head p,
.toggle-row p,
.tips__content p,
.guide-step p,
.summary-card p,
.faq-item p,
.site-footer p,
.upload-box__hint,
.upload-box__filename {
  color: var(--muted);
  line-height: 1.6;
}

.workspace {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.panel {
  padding: 24px;
  min-width: 0;
}

.previews.is-dark {
  background: linear-gradient(180deg, #161616, #0f0f0f);
  border-color: rgba(255, 255, 255, 0.08);
}

.previews.is-dark .panel__head h2,
.previews.is-dark .preview-card__head h3,
.previews.is-dark .preview-note h3 {
  color: #f8fafc;
}

.previews.is-dark .panel__head p,
.previews.is-dark .preview-card__head span,
.previews.is-dark .preview-note p {
  color: #94a3b8;
}

.previews.is-dark .preview-card,
.previews.is-dark .preview-note {
  background: rgba(24, 24, 27, 0.92);
  border-color: rgba(255, 255, 255, 0.08);
}

.previews.is-dark .youtube-shell {
  background: #18181b;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.previews.is-dark .meta-copy h4,
.previews.is-dark .mobile-meta h4,
.previews.is-dark .sidebar-meta h4 {
  color: #f8fafc;
}

.previews.is-dark .meta-copy p,
.previews.is-dark .mobile-meta p,
.previews.is-dark .sidebar-meta p {
  color: #a1a1aa;
}

.previews.is-dark .ad-slot {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    #18181b;
  border-color: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.panel__head {
  margin-bottom: 20px;
}

.panel__head h2 {
  margin: 0 0 8px;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
}

.panel__head p {
  margin: 0;
}

.controls {
  position: sticky;
  top: 18px;
  align-self: start;
}

.upload-box,
.field textarea,
.field input,
.toggle-row,
.export-button,
.preview-card,
.faq-item {
  border: 1px solid var(--line);
}

.upload-box {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #f9fafb);
}

.upload-box__button,
.export-button {
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.upload-box__button {
  padding: 12px 16px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.field {
  display: block;
  margin-top: 18px;
}

.field span {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
}

.field em {
  color: var(--muted);
  font-style: normal;
  font-weight: 500;
}

.field textarea,
.field input {
  width: 100%;
  border-radius: 16px;
  padding: 14px 15px;
  background: #fff;
  color: var(--text);
}

.field textarea {
  min-height: 102px;
  resize: vertical;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  border-radius: 18px;
  padding: 16px;
  background: #fff;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch__track {
  position: relative;
  width: 48px;
  height: 28px;
  background: #cbd5e1;
  border-radius: 999px;
  transition: background 160ms ease;
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
  transition: transform 160ms ease;
}

.switch input:checked + .switch__track {
  background: var(--accent);
}

.switch input:checked + .switch__track::after {
  transform: translateX(20px);
}

.switch__label {
  font-weight: 600;
}

.export-button {
  width: 100%;
  margin-top: 18px;
  padding: 14px 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(220, 38, 38, 0.2);
}

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

.preview-grid {
  display: grid;
  gap: 18px;
}

.preview-note {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 16px;
  margin-top: 18px;
}

.preview-note h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.preview-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.preview-card {
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  padding: 18px;
  min-width: 0;
}

.preview-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.preview-card__head h3 {
  margin: 0;
  font-size: 1rem;
}

.preview-card__head span {
  color: var(--muted);
  font-size: 0.88rem;
}

.youtube-shell {
  background: #fff;
  border: 1px solid #edf2f7;
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  min-width: 0;
}

.thumb-wrap {
  margin-bottom: 12px;
}

.thumb-wrap--sidebar {
  width: 42%;
  min-width: 160px;
  margin: 0;
}

.thumb-canvas {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(220, 38, 38, 0.75), rgba(15, 23, 42, 0.92)),
    #e2e8f0;
}

.thumb-canvas img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.safe-zone {
  position: absolute;
  inset: 8%;
  border: 2px dashed rgba(255, 255, 255, 0.82);
  border-radius: 10px;
  box-shadow: 0 0 0 200vmax rgba(15, 23, 42, 0.12);
  pointer-events: none;
}

.safe-zone::after {
  content: "";
  position: absolute;
  right: -7%;
  bottom: -7%;
  width: 26%;
  height: 26%;
  border-radius: 9px;
  background: rgba(220, 38, 38, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.safe-zone.is-hidden {
  display: none;
}

.duration-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 7px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.desktop-meta,
.youtube-shell--sidebar {
  display: flex;
  gap: 12px;
}

.avatar-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fecaca, #ef4444);
  flex: 0 0 auto;
}

.meta-copy,
.mobile-meta,
.sidebar-meta {
  min-width: 0;
}

.meta-copy h4,
.mobile-meta h4,
.sidebar-meta h4 {
  margin: 0 0 6px;
  font-family: "Roboto", "Arial", sans-serif;
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.34;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta-copy h4 {
  -webkit-line-clamp: 2;
}

.mobile-meta h4,
.sidebar-meta h4 {
  -webkit-line-clamp: 2;
}

.meta-copy p,
.mobile-meta p,
.sidebar-meta p {
  margin: 0;
  font-family: "Roboto", "Arial", sans-serif;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.42;
}

.youtube-shell--mobile {
  max-width: 420px;
}

.youtube-shell--mobile .thumb-wrap {
  margin: 0 0 10px;
}

.youtube-shell--sidebar {
  align-items: flex-start;
}

.sidebar-meta p + p {
  margin-top: 4px;
}

.tips,
.guide,
.content-links,
.content-summary,
.faq {
  margin-bottom: 24px;
}

.tips__content,
.faq-list,
.link-grid,
.guide-grid,
.summary-grid {
  display: grid;
  gap: 14px;
}

.link-grid,
.guide-grid,
.summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.link-card,
.guide-step,
.summary-card,
.ad-slot {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.link-card {
  display: block;
  padding: 18px;
  color: inherit;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.link-card:hover {
  transform: translateY(-2px);
  border-color: rgba(220, 38, 38, 0.25);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.link-card strong,
.guide-step h3,
.summary-card h3 {
  display: block;
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.4;
}

.link-card span {
  color: var(--muted);
  line-height: 1.6;
}

.link-card:focus-visible,
.footer-nav a:focus-visible {
  outline: 2px solid rgba(220, 38, 38, 0.45);
  outline-offset: 3px;
}

.guide-step,
.summary-card {
  padding: 18px;
}

.guide-step h3,
.summary-card h3 {
  margin-bottom: 10px;
}

.guide-step p,
.summary-card p {
  margin: 0;
}

.ad-slot {
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(220, 38, 38, 0.05), rgba(15, 23, 42, 0.02)),
    #fff;
  color: var(--muted);
  text-align: center;
  font-weight: 600;
}

.ad-slot:empty {
  display: none;
}

.ad-slot--upload {
  min-height: 120px;
  margin-top: 16px;
}

.ad-slot--leaderboard {
  min-height: 120px;
  margin-bottom: 18px;
}

.ad-slot--infeed {
  min-height: 120px;
}

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

.faq-item {
  border-radius: 18px;
  background: #fff;
  padding: 18px;
}

.faq-item h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.4;
}

.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 36px;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

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

.footer-nav a:hover {
  color: var(--accent);
}

.site-footer p {
  margin: 0;
  text-align: center;
  font-size: 0.92rem;
}

.simple-page {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 48px;
}

.doc-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px;
}

.doc-card h1 {
  margin-bottom: 18px;
}

.doc-card p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.75;
}

.doc-card a {
  color: var(--accent);
  text-decoration: none;
}

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

.doc-card h2 {
  margin: 30px 0 12px;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.doc-card h3 {
  margin: 20px 0 10px;
  font-size: 1.02rem;
}

.doc-card ul {
  margin: 0 0 16px 20px;
  color: var(--muted);
  line-height: 1.7;
}

.doc-card li + li {
  margin-top: 8px;
}

.related-links {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

@media (max-width: 1040px) {
  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .controls {
    position: static;
  }
}

@media (max-width: 720px) {
  .page {
    width: min(100% - 20px, 1180px);
    padding-top: 20px;
  }

  .simple-page {
    width: min(100% - 20px, 860px);
    padding-top: 20px;
  }

  .hero__copy,
  .hero__meta,
  .panel,
  .doc-card {
    padding: 18px;
  }

  .preview-card {
    padding: 14px;
  }

  .preview-card__head,
  .toggle-row,
  .youtube-shell--sidebar {
    flex-direction: column;
  }

  .thumb-wrap--sidebar {
    width: 100%;
  }

  .faq-list {
    grid-template-columns: 1fr;
  }

  .link-grid,
  .guide-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .ad-slot--infeed,
  .ad-slot--leaderboard {
    min-height: 100px;
  }

  h1 {
    line-height: 1.02;
  }
}
