:root {
  --bg: #070d1e;
  --panel: #111a34;
  --panel-2: #182449;
  --text: #f7fbff;
  --muted: #b9c8ea;
  --line: rgba(255,255,255,.13);
  --accent: #73efb8;
  --accent-2: #56a8ff;
  --danger: #ff7575;
  --brand-blue: #56a8ff;
  --brand-blue-2: #1778ff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(43, 93, 205, .34) 0, transparent 34rem),
    radial-gradient(circle at 92% 18%, rgba(86, 168, 255, .12) 0, transparent 30rem),
    var(--bg);
}
a { color: inherit; }
.site-header, .site-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.site-header nav, .footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.site-header nav a, .footer-links a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover, .footer-links a:hover { color: var(--text); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 20px; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #06101b; }
main { max-width: 1120px; margin: 0 auto; padding: 20px; }
.hero { display: grid; grid-template-columns: minmax(0,1.1fr) 360px; gap: 42px; align-items: center; padding: 56px 0 46px; }
.hero h1 { font-size: clamp(42px, 7vw, 76px); line-height: .95; margin: 14px 0 18px; letter-spacing: -0.06em; }
.hero p, .section-head p, .card p, .legal p { color: var(--muted); font-size: 18px; line-height: 1.65; }
.pill { display: inline-flex; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--accent); background: rgba(255,255,255,.05); }
.hero-actions, .actions-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; border-radius: 12px; padding: 10px 16px; border: 1px solid var(--line); text-decoration: none; cursor: pointer; font-weight: 700; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #06101b; border: 0; }
.btn.secondary { background: rgba(255,255,255,.06); color: var(--text); }
.btn.big { width: 100%; font-size: 17px; min-height: 54px; }
.phone-card { aspect-ratio: 9/16; border-radius: 38px; padding: 28px; background: linear-gradient(180deg, #19265a, #10152f); box-shadow: 0 30px 80px rgba(0,0,0,.38); border: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.phone-top { color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; }
.question { font-size: 28px; font-weight: 800; line-height: 1.15; }
.answer { background: rgba(255,255,255,.08); border: 1px solid var(--line); padding: 12px 14px; border-radius: 14px; }
.answer.correct { background: rgba(101,228,163,.16); border-color: rgba(101,228,163,.5); }
.timer { color: var(--muted); text-align: center; margin-top: 10px; }
.cards, .example-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.card, .example, .status-card, .question-block, .notice, .list-row { background: rgba(18,25,54,.72); border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.card h3, .example b { margin-top: 0; display: block; }
.section { padding: 42px 0; }
.section.narrow { max-width: 820px; margin: 0 auto; }
.section-head { margin-bottom: 26px; }
.section h1, .section h2 { letter-spacing: -0.04em; }
.quiz-form { display: grid; gap: 18px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
label { display: grid; gap: 8px; color: var(--muted); font-weight: 650; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--text); border-radius: 12px; padding: 12px 13px; font: inherit; }
select option { color: #111; }
fieldset { margin: 0; }
legend { font-weight: 800; padding: 0 8px; }
legend span { color: var(--muted); font-weight: 500; }
.questions { display: grid; gap: 16px; }
.optional { opacity: .86; }
.notice.good { border-color: rgba(101,228,163,.45); background: rgba(101,228,163,.12); }
.video-wrap { display: grid; place-items: center; margin: 20px 0; }
.video-wrap video { width: min(100%, 360px); border-radius: 28px; border: 1px solid var(--line); background: #000; }
.small-video video { width: min(100%, 280px); }
.placeholder-video { min-height: 420px; border: 1px dashed var(--line); border-radius: 28px; display: grid; place-items: center; color: var(--muted); background: rgba(255,255,255,.04); }
.checks { display: grid; gap: 10px; padding: 10px 0; }
.checks label, .confirm { display: flex; align-items: center; gap: 10px; }
.checks input, .confirm input { width: auto; }
.list { display: grid; gap: 10px; }
.list-row { text-decoration: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.list-row small { color: var(--muted); }
code { color: var(--accent); }
.site-footer { color: var(--muted); font-size: 14px; align-items: flex-start; }
.build { font-size: 11px; opacity: .65; }
@media (max-width: 860px) {
  .site-header, .site-footer { align-items: flex-start; flex-direction: column; }
  .hero { grid-template-columns: 1fr; }
  .phone-card { max-width: 340px; margin: 0 auto; }
  .cards, .example-grid, .grid.two, .grid.three { grid-template-columns: 1fr; }
}

.status-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); font-weight: 800; }
.status-pill.good { color: var(--accent); background: rgba(101,228,163,.12); border-color: rgba(101,228,163,.38); }
.status-pill.busy { color: #ffd36c; background: rgba(255,211,108,.12); border-color: rgba(255,211,108,.32); }
.render-loader { margin-top: 14px; }
.loader-bar { width: 100%; height: 10px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid var(--line); }
.loader-bar span { display: block; width: 42%; height: 100%; border-radius: inherit; background: linear-gradient(135deg, var(--accent), var(--accent-2)); animation: loader-slide 1.4s ease-in-out infinite; }
@keyframes loader-slide {
  0% { transform: translateX(-110%); }
  55% { transform: translateX(90%); }
  100% { transform: translateX(250%); }
}
.rendering-preview { display: grid; place-items: center; min-height: 420px; margin: 20px 0; border: 1px dashed var(--line); border-radius: 28px; background: rgba(255,255,255,.04); }
.phone-skeleton { width: min(100%, 300px); aspect-ratio: 9/16; border-radius: 32px; padding: 28px; background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03)); border: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.skeleton-logo, .skeleton-title, .skeleton-question, .skeleton-answer { position: relative; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.12); }
.skeleton-logo { width: 82px; height: 28px; align-self: center; margin-bottom: 22px; }
.skeleton-title { width: 72%; height: 20px; align-self: center; margin-bottom: 16px; }
.skeleton-question { width: 100%; height: 64px; border-radius: 16px; background: rgba(255,255,255,.18); margin-bottom: 18px; }
.skeleton-answer { width: 86%; height: 18px; }
.skeleton-answer.short { width: 68%; }
.skeleton-logo::after, .skeleton-title::after, .skeleton-question::after, .skeleton-answer::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent); animation: shimmer 1.6s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }

.form-panel { background: rgba(18,25,54,.54); border: 1px solid var(--line); border-radius: 24px; padding: 18px; display: grid; gap: 18px; }
.settings-group { display: grid; gap: 12px; padding-top: 4px; }
.hint { color: var(--muted); margin: 6px 0 0; line-height: 1.55; }
.hint-inline { color: var(--muted); font-size: 12px; font-weight: 500; }
.choice-row { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.choice-card { display: flex; align-items: center; gap: 10px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.05); color: var(--text); cursor: pointer; }
.choice-card input { width: auto; }
.question-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 8px; }
.question-toolbar h2 { margin: 0; }
.toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.question-block { position: relative; }
.question-actions { position: absolute; top: 14px; right: 16px; }
.text-btn { background: transparent; border: 0; color: var(--accent-2); font: inherit; font-weight: 800; cursor: pointer; padding: 4px 0; }
.text-btn.danger { color: var(--danger); }
.question-block.only-two [data-remove-question] { opacity: .35; pointer-events: none; }
@media (max-width: 720px) {
  .choice-row { grid-template-columns: 1fr; }
  .question-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions .btn { flex: 1; }
}

.category-panel { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.035); }
.category-panel.is-hidden { display: none; }
.panel-note b { display: block; margin-bottom: 2px; }
.settings-group.compact { padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: rgba(101,228,163,.07); }
.question-actions { display: flex; gap: 12px; align-items: center; }
.question-block { padding-top: 28px; }
@media (max-width: 720px) {
  .question-actions { position: static; margin: 8px 0 14px; justify-content: flex-end; }
  .question-block { padding-top: 18px; }
}

/* v9 homepage examples */
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-card { border: 1px solid var(--line); border-radius: 28px; background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.035)); box-shadow: 0 24px 80px rgba(0,0,0,.28); }
.mini-quiz-card { padding: 26px; min-height: 520px; display: flex; flex-direction: column; justify-content: center; gap: 18px; position: relative; overflow: hidden; }
.mini-quiz-card::before { content: ""; position: absolute; inset: -40%; background: radial-gradient(circle at 40% 20%, rgba(101,228,163,.22), transparent 28%), radial-gradient(circle at 70% 70%, rgba(108,168,255,.18), transparent 30%); pointer-events: none; }
.mini-quiz-card > * { position: relative; }
.mini-video-top { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 14px; }
.mini-video-top span { border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; background: rgba(0,0,0,.18); }
.mini-quiz-card h2 { margin: 0; font-size: 34px; letter-spacing: -.03em; }
.mini-question { font-size: 25px; line-height: 1.25; color: var(--text); margin: 0; }
.mini-answers { display: grid; gap: 10px; }
.mini-answers span { display: block; padding: 14px 16px; border-radius: 16px; background: rgba(255,255,255,.075); border: 1px solid var(--line); color: var(--muted); }
.mini-answers .correct { color: #06101b; background: linear-gradient(135deg, var(--accent), #b8ffd7); border-color: transparent; font-weight: 800; }
.compact-head { max-width: 760px; }
.steps-grid, .ideas-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.step-card, .idea-card, .recent-card { display: block; text-decoration: none; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.055); padding: 20px; }
.step-card b { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #06101b; margin-bottom: 14px; }
.step-card h3, .idea-card h3, .example-video-copy h3 { margin: 0 0 8px; }
.step-card p, .idea-card p, .example-video-copy p { margin: 0; color: var(--muted); line-height: 1.55; }
.example-video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.example-video-card { border: 1px solid var(--line); border-radius: 26px; background: rgba(255,255,255,.055); overflow: hidden; }
.example-video-frame { aspect-ratio: 9 / 16; background: #050816; border-bottom: 1px solid var(--line); display: grid; place-items: center; }
.example-video-frame video { width: 100%; height: 100%; object-fit: cover; display: block; background: #050816; }
.video-placeholder { min-height: 100%; width: 100%; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); }
.video-placeholder span { display: block; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.video-placeholder small { overflow-wrap: anywhere; }
.example-video-copy { padding: 18px; }
.example-kicker { display: inline-block; color: var(--accent); font-size: 13px; font-weight: 800; margin-bottom: 8px; }
.example-video-copy small { display: block; color: var(--muted); opacity: .86; margin-top: 12px; line-height: 1.45; }
.recent-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.recent-card b { display: block; margin-bottom: 8px; }
.recent-card span { color: var(--muted); }
.cta-section { padding-bottom: 52px; }
.cta-panel { border: 1px solid var(--line); border-radius: 30px; background: linear-gradient(135deg, rgba(101,228,163,.12), rgba(108,168,255,.12)); padding: 34px; text-align: center; }
.cta-panel h2 { margin: 10px 0 10px; font-size: clamp(28px, 4vw, 46px); letter-spacing: -.04em; }
.cta-panel p { color: var(--muted); margin: 0 auto 22px; max-width: 620px; }
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .mini-quiz-card { min-height: auto; }
  .steps-grid, .ideas-grid, .example-video-grid, .recent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hero-actions .btn { width: 100%; }
  .steps-grid, .ideas-grid, .example-video-grid, .recent-grid { grid-template-columns: 1fr; }
  .example-video-frame { aspect-ratio: 9 / 13; }
  .cta-panel { padding: 24px; }
}

/* Hide internal build/version marker from public pages. Health check still exposes the build for debugging. */
.build { display: none !important; }

/* v14: mobile audit fixes, sticky footer, long IDs, export layout, header PNG logo */
html { min-height: 100%; }
body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
main {
  width: 100%;
  flex: 1 0 auto;
}
.site-footer { flex-shrink: 0; }
.brand-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
  filter:
    drop-shadow(0 0 1px rgba(255,255,255,.95))
    drop-shadow(0 0 2px rgba(255,255,255,.82))
    drop-shadow(0 4px 10px rgba(0,0,0,.28));
}
.brand-mark-fallback { display: none; }
.lesson-id-line,
.lesson-id-line code,
.summary-grid code,
code {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.preview-section .section-head,
.export-section .section-head { min-width: 0; }
.preview-video video { max-height: min(72vh, 680px); object-fit: contain; }
.export-section { max-width: 900px; }
.export-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(190px, 280px);
  gap: 24px;
  align-items: start;
}
.export-layout.is-posted {
  grid-template-columns: minmax(280px, 1fr) minmax(190px, 280px);
}
.export-panel { min-width: 0; }
.export-video {
  margin: 0;
  align-self: start;
  position: sticky;
  top: 16px;
}
.export-video video {
  width: min(100%, 260px);
  max-height: min(56vh, 520px);
  object-fit: contain;
}
.compact-card { margin-bottom: 14px; }
.compact-actions { margin-top: 16px; }
.summary-grid {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}
.summary-grid p { margin: 6px 0 0; color: var(--muted); }
.success-card { border-color: rgba(101,228,163,.42); background: rgba(101,228,163,.09); }

@media (max-width: 760px) {
  body { background: radial-gradient(circle at 20% 0%, #1d2b64 0, transparent 20rem), var(--bg); }
  main { padding: 10px 14px 20px; }
  .site-header, .site-footer {
    width: 100%;
    padding: 16px 14px;
    gap: 12px;
  }
  .site-header nav, .footer-links {
    gap: 12px;
    font-size: 14px;
  }
  .brand { font-size: 18px; }
  .brand-logo, .brand-mark { width: 30px; height: 30px; border-radius: 10px; }
  .section { padding: 24px 0; }
  .section.narrow { max-width: 100%; }
  .section-head { margin-bottom: 18px; }
  .section h1 { font-size: 28px; line-height: 1.1; }
  .section-head p, .card p, .legal p { font-size: 15px; line-height: 1.55; }
  .lesson-id-line { font-size: 14px; }
  .status-card, .question-block, .notice, .form-panel, .category-panel {
    border-radius: 16px;
    padding: 14px;
  }
  .video-wrap { margin: 16px 0; }
  .preview-video video {
    width: min(100%, 260px);
    max-height: 58vh;
    border-radius: 22px;
  }
  .actions-row .btn { flex: 1 1 100%; }
  .export-layout,
  .export-layout.is-posted {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .export-panel { order: 1; width: 100%; }
  .export-video { order: 2; position: static; width: 100%; margin: 0; }
  .export-video video {
    width: min(72vw, 230px);
    max-height: 36vh;
    border-radius: 22px;
  }
  .export-form textarea { min-height: 104px; }
  .success-card { width: 100%; }
  .site-footer { margin-top: auto; }
}

@media (max-width: 420px) {
  .site-header nav { font-size: 13px; gap: 9px; }
  .site-header, .site-footer { padding-left: 12px; padding-right: 12px; }
  main { padding-left: 12px; padding-right: 12px; }
  .export-video video { width: min(68vw, 210px); max-height: 34vh; }
  .preview-video video { width: min(86vw, 250px); max-height: 55vh; }
  .btn.big { min-height: 50px; }
}


/* v15: logo-aligned public styling */
.site-header {
  padding-top: 24px;
  padding-bottom: 24px;
}
.site-header nav {
  align-items: center;
}
.site-header nav a,
.footer-links a {
  transition: color .18s ease, opacity .18s ease;
}
.brand {
  min-height: 38px;
  gap: 0;
  line-height: 1;
  flex: 0 0 auto;
}
.brand-logo {
  width: 116px !important;
  height: auto !important;
  max-height: 32px !important;
  border-radius: 0 !important;
  object-fit: contain;
  object-position: center;
  display: block;
  flex: 0 0 auto;
  filter: drop-shadow(0 2px 7px rgba(0,0,0,.30));
}
.brand-text-fallback {
  display: none;
  margin-left: 10px;
  font-weight: 800;
  color: var(--text);
}
.brand-mark-fallback {
  display: none;
}
.hero h1 {
  text-shadow: 0 10px 36px rgba(4, 10, 28, .28);
}
.pill {
  border-color: rgba(115,239,184,.18);
  background: rgba(115,239,184,.075);
}
.btn.primary {
  background: linear-gradient(135deg, var(--accent) 0%, #78ddfb 54%, var(--brand-blue) 100%);
  box-shadow: 0 12px 28px rgba(86,168,255,.12);
}
.btn.secondary,
.answer,
.step-card,
.idea-card,
.recent-card,
.example-video-card {
  background: rgba(255,255,255,.052);
}
.hero-card,
.phone-card,
.form-panel,
.status-card,
.question-block,
.notice,
.category-panel {
  box-shadow: 0 18px 60px rgba(0,0,0,.16);
}
.mini-answers .correct {
  background: linear-gradient(135deg, #73efb8, #aaffd1);
}
.site-footer {
  padding-top: 24px;
  padding-bottom: 24px;
}

@media (max-width: 760px) {
  .site-header {
    padding-top: 16px;
    padding-bottom: 14px;
  }
  .brand {
    min-height: 32px;
  }
  .brand-logo {
    width: 104px !important;
    max-height: 28px !important;
  }
}

@media (max-width: 420px) {
  .brand-logo {
    width: 96px !important;
    max-height: 26px !important;
  }
}


/* v16: desktop-only header logo optical alignment */
@media (min-width: 761px) {
  .site-header {
    align-items: center;
    padding-top: 22px;
    padding-bottom: 22px;
  }
  .brand {
    min-height: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    overflow: visible;
  }
  .brand-logo {
    width: 112px !important;
    max-height: 30px !important;
    transform: translateY(2px);
    transform-origin: left center;
  }
  .site-header nav {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding-top: 0;
  }
}


/* v17: strict desktop header layout — logo left, navigation right, same baseline */
@media (min-width: 861px) {
  .site-header {
    width: min(calc(100% - 40px), 1120px) !important;
    max-width: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 24px 0 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 28px !important;
  }

  .site-header .brand {
    height: 36px !important;
    min-height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex: 0 0 auto !important;
    line-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .site-header .brand-logo {
    width: 112px !important;
    height: auto !important;
    max-height: 30px !important;
    display: block !important;
    object-fit: contain !important;
    object-position: left center !important;
    transform: none !important;
    position: relative !important;
    top: -1px !important;
    margin: 0 !important;
    flex: 0 0 auto !important;
  }

  .site-header nav {
    height: 36px !important;
    min-height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex: 1 1 auto !important;
    gap: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
  }

  .site-header nav a {
    display: inline-flex !important;
    align-items: center !important;
    height: 36px !important;
    line-height: 1 !important;
  }
}

@media (max-width: 860px) {
  .site-header {
    width: 100% !important;
  }
}
