/* CreatorHQ V2 — styles for individual screens (Lab, Teleprompter, Media
   Kit, Studio import, Series, Brand Kit, Script…). Theme tokens only, except
   the YouTube preview and the teleprompter, which copy fixed looks on purpose. */

/* =========================================================
   Shared bits used by several pages
   ========================================================= */
.title-input { font-family: 'DM Serif Display', Georgia, serif; font-size: clamp(1.375rem, 1.1rem + 1.2vw, 2rem); border-color: transparent; background: transparent; padding-left: 0.25rem; color: var(--heading); }
.title-input:hover, .title-input:focus { border-color: var(--border-accent); background: var(--surface); }
.chart-box { position: relative; height: 240px; min-width: 0; }
.legend-list { list-style: none; padding: 0; margin: 0.75rem 0 0; display: flex; flex-wrap: wrap; gap: 0.375rem 1rem; font-size: 0.8125rem; }
.legend-list li { display: inline-flex; align-items: center; gap: 0.375rem; }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--chart-edge); display: inline-block; }
.tab-count { display: inline-block; min-width: 1.4em; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--chip-3-bg); color: var(--chip-3-text); font-size: 0.75rem; }
.progress-ring-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9375rem; color: var(--heading); }
.danger-zone { border-color: var(--danger-text); }
.danger-zone .card-title { color: var(--danger-text); }
.note-card { margin-bottom: 0.5rem; }
.note-card + .note-card { margin-top: 0; }
input[type="range"].range { width: 100%; accent-color: var(--accent-1-deep); min-height: 44px; }
input[type="color"] { width: 44px; height: 44px; padding: 2px; border: 1px solid var(--border-accent); border-radius: 10px; background: var(--surface); cursor: pointer; }
.seo-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
@media (min-width: 1024px) {
  .seo-layout { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
  .seo-checklist { position: sticky; top: 5rem; }
}
.seo-layout > .card { margin: 0; }
details > summary { cursor: pointer; }
.script-section { border-bottom: 1px solid var(--divider); padding: 0.25rem 0; }
.script-section:last-child { border-bottom: 0; }
.script-section > summary { display: flex; align-items: center; gap: 0.5rem; min-height: 44px; list-style: none; }
.script-section > summary::-webkit-details-marker { display: none; }
.script-section > summary::before { content: '▸'; color: var(--text-muted); transition: transform 150ms ease; }
.script-section[open] > summary::before { transform: rotate(90deg); }
.script-section > summary h2 { font-size: 1.0625rem; }
.script-main-section { margin-bottom: 0.75rem; padding: 0.75rem; background: var(--surface-alt); border-radius: 12px; display: flex; flex-direction: column; gap: 0.5rem; }
.performer-list { margin: 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.performer-list li span { display: block; }

/* Thumbnail concepts / brand */
.concept-image, .logo-preview {
  aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--surface-alt);
  border: 1px dashed var(--border-accent); display: flex; align-items: center; justify-content: center;
}
.logo-preview { aspect-ratio: 3 / 2; background: repeating-conic-gradient(var(--surface-alt) 0% 25%, var(--surface) 0% 50%) 50% / 16px 16px; }
.concept-image img { width: 100%; height: 100%; object-fit: cover; }
.logo-preview img { max-width: 90%; max-height: 90%; object-fit: contain; }
.color-chip { display: inline-flex; align-items: center; gap: 4px; }
.brand-color { display: grid; grid-template-columns: 44px 7rem auto; gap: 0.5rem; align-items: center; }

/* Series episodes */
.ep-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 0.5rem; align-items: center; padding: 0.5rem; margin-bottom: 0.5rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.ep-row.dragging { opacity: 0.5; }
.ep-handle { cursor: grab; color: var(--text-muted); font-size: 1.125rem; padding: 0 2px; }
.ep-num { font-weight: 700; color: var(--text-muted); font-size: 0.8125rem; min-width: 1.25rem; text-align: center; }
.ep-fields { display: flex; flex-direction: column; gap: 0.375rem; min-width: 0; }
.ep-sub { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.375rem; align-items: center; }
.ep-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) {
  .ep-row { grid-template-columns: auto minmax(0, 1fr); }
  .ep-handle { display: none; }
  .ep-actions { grid-column: 1 / -1; }
  .ep-sub { grid-template-columns: minmax(0, 1fr); }
}

/* =========================================================
   Studio import
   ========================================================= */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
  border: 2px dashed var(--border-accent); border-radius: 14px; padding: 1.5rem 1rem; text-align: center;
  background: var(--surface-alt); cursor: pointer; margin-bottom: 1rem; min-height: 120px; color: var(--text);
}
.dropzone svg { width: 28px; height: 28px; color: var(--accent-2-deep); }
.dropzone.over { border-color: var(--accent-1-deep); background: var(--chip-2-bg); }
.dropzone:focus-within { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.studio-rows { display: flex; flex-direction: column; gap: 0.5rem; max-height: 50vh; overflow-y: auto; }
.studio-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.375rem; padding: 0.625rem; border: 1px solid var(--border); border-radius: 10px; }
.studio-row.unmatched { border-color: var(--border-accent); background: var(--surface-alt); }
@media (min-width: 640px) { .studio-row { grid-template-columns: minmax(0, 1fr) minmax(0, 16rem); align-items: center; } }

/* =========================================================
   Title & Thumbnail Lab + YouTube preview simulator
   ========================================================= */
.lab-variants { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 0.75rem; }
.lab-variant { border: 1px solid var(--border); border-radius: 14px; padding: 0.875rem; display: flex; flex-direction: column; gap: 0.5rem; background: var(--surface); min-width: 0; }
.lab-variant.chosen { border-color: var(--accent-2-deep); border-width: 2px; }
.lab-title-input { min-height: 64px; font-weight: 600; }
.check-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8125rem; }
.check-list li { display: grid; grid-template-columns: 1rem minmax(0, 1fr); gap: 0.375rem; }
.check-list li.good span { color: var(--success-text); font-weight: 700; }
.check-list li.tip span { color: var(--text-muted); }
.check-list li.warn span { color: var(--danger-text); font-weight: 700; }

/* The simulator copies YouTube's own light/dark look (a picture of another
   app), so its colours are YouTube's, defined once here. */
.yt-sim { --yt-bg: #FFFFFF; --yt-text: #0F0F0F; --yt-meta: #606060; --yt-ph: #E5E5E5; --yt-ph-text: #606060;
  font-family: Roboto, Arial, system-ui, sans-serif; background: var(--yt-bg); color: var(--yt-text);
  border-radius: 14px; padding: 1rem; border: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 1.25rem; align-items: start; }
.yt-sim.yt-dark { --yt-bg: #0F0F0F; --yt-text: #F1F1F1; --yt-meta: #AAAAAA; --yt-ph: #272727; --yt-ph-text: #AAAAAA; }
.yt-block { min-width: 0; }
.yt-block.yt-wide { grid-column: 1 / -1; }
.yt-label { font-family: 'DM Sans', system-ui, sans-serif; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--yt-meta); margin: 0 0 0.5rem; font-weight: 700; }
.yt-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--yt-ph); }
.yt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--yt-ph-text); font-weight: 700; font-size: 1.25rem; text-align: center; padding: 1rem; }
.yt-dur { position: absolute; right: 6px; bottom: 6px; background: rgba(0, 0, 0, 0.8); color: #FFFFFF; font-size: 12px; font-weight: 500; padding: 1px 4px; border-radius: 4px; }
.yt-row { display: flex; gap: 12px; margin-top: 12px; min-width: 0; }
.yt-text { min-width: 0; flex: 1; }
.yt-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.yt-avatar-ph { display: inline-flex; align-items: center; justify-content: center; background: #5F6368; color: #FFFFFF; font-weight: 700; }
.yt-title { font-size: 16px; line-height: 22px; font-weight: 500; color: var(--yt-text); overflow-wrap: anywhere; }
.yt-title-lg { font-size: 18px; line-height: 26px; font-weight: 400; }
.yt-title-sm { font-size: 14px; line-height: 20px; }
.yt-meta { font-size: 14px; line-height: 20px; color: var(--yt-meta); }
.yt-clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yt-home { width: 100%; max-width: 360px; }
.yt-mobile { width: 100%; max-width: 390px; }
.yt-mobile .yt-thumb { border-radius: 0; }
.yt-mobile .yt-title { font-size: 14px; line-height: 20px; }
.yt-mobile .yt-meta { font-size: 12px; line-height: 18px; }
.yt-search { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 16px; }
.yt-search .yt-chan { margin: 8px 0; align-items: center; }
.yt-search .yt-chan .yt-avatar { width: 24px; height: 24px; font-size: 11px; }
.yt-side { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 8px; max-width: 402px; }
.yt-side .yt-thumb { border-radius: 8px; }
.yt-side .yt-meta { font-size: 12px; line-height: 18px; }
@media (max-width: 640px) { .yt-search { grid-template-columns: minmax(0, 1fr); } }

/* =========================================================
   Teleprompter: always white on black, because it's read from a distance.
   ========================================================= */
:root { --tp-bg: #0B0B0C; --tp-text: #F5F5F2; --tp-dim: #A3A3A3; --tp-guide: rgba(255, 255, 255, 0.12); --tp-bar: rgba(30, 30, 32, 0.92); }
.tp-help { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.9375rem; }
kbd { font-family: inherit; font-size: 0.8125rem; border: 1px solid var(--border-accent); border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; background: var(--surface-alt); color: var(--text); }
.tp-overlay { position: fixed; inset: 0; z-index: 900; background: var(--tp-bg); color: var(--tp-text); }
.tp-viewport { position: absolute; inset: 0; overflow: hidden; outline: none; cursor: pointer; }
.tp-text { font-family: 'DM Sans', system-ui, sans-serif; font-weight: 600; }
.tp-text p { margin: 0 0 0.8em; }
.tp-pad-top { height: 33vh; }
.tp-pad-bottom { height: 70vh; }
.tp-part-title { font-size: 0.45em; text-transform: uppercase; letter-spacing: 0.1em; color: var(--tp-dim); margin-bottom: 0.4em !important; }
.tp-end { text-align: center; color: var(--tp-dim); font-size: 0.6em; padding: 1em 0; }
.tp-guide { display: none; position: absolute; left: 0; right: 0; top: 33vh; height: 4rem; background: var(--tp-guide); border-top: 2px solid rgba(255, 255, 255, 0.35); pointer-events: none; }
.tp-overlay.tp-guide-on .tp-guide { display: block; }
.tp-count { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; font-size: 30vmin; font-weight: 700; pointer-events: none; background: rgba(0, 0, 0, 0.55); }
.tp-count.on { display: flex; }
.tp-progress { position: absolute; left: 0; right: 0; top: 0; height: 4px; background: rgba(255, 255, 255, 0.12); }
.tp-progress-fill { height: 100%; width: 0; background: var(--tp-text); }
.tp-bar { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 4px; background: var(--tp-bar); border-radius: 999px; padding: 6px; flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 16px); width: max-content; }
.tp-btn { min-width: 44px; height: 44px; border-radius: 999px; color: var(--tp-text); font-size: 1.05rem; font-weight: 700; padding: 0 10px; }
.tp-btn:focus-visible { outline: 2px solid #FFFFFF; }
.tp-btn[aria-pressed="true"] { background: rgba(255, 255, 255, 0.2); }
.tp-play { background: var(--tp-text); color: var(--tp-bg); min-width: 56px; }
.tp-speed { color: var(--tp-dim); font-size: 0.8125rem; padding: 0 6px; min-width: 4.5rem; text-align: center; }

/* =========================================================
   Media kit
   ========================================================= */
.mk-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (min-width: 1100px) { .mk-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .mk-sheet { position: sticky; top: 5rem; } }
.mk-layout .card { margin: 0; }
.rate-result { margin: 0.75rem 0; padding: 0.875rem 1rem; border-radius: 12px; background: var(--callout-bg); border: 1.5px solid var(--callout-border); }
.rate-range { font-family: 'DM Serif Display', serif; font-size: 1.75rem; color: var(--heading); }
.mk-sheet { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1.75rem; box-shadow: var(--shadow-card); color: var(--text); min-width: 0; }
.mk-head { display: flex; gap: 1rem; align-items: center; }
.mk-logo { width: 72px; height: 72px; object-fit: contain; border-radius: 14px; }
.mk-name { font-size: 2rem; }
.mk-tagline { color: var(--text-muted); }
.mk-colors { display: flex; height: 10px; border-radius: 999px; overflow: hidden; margin: 1rem 0; }
.mk-colors span { flex: 1; }
.mk-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: 0.75rem; margin: 1rem 0 1.25rem; }
.mk-stat { background: var(--surface-alt); border-radius: 12px; padding: 0.75rem; text-align: center; }
.mk-stat-v { font-family: 'DM Serif Display', serif; font-size: 1.5rem; color: var(--heading); }
.mk-stat-l { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.mk-sheet section { margin-top: 1rem; }
.mk-sheet h3 { font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-2-deep); font-family: 'DM Sans', sans-serif; font-weight: 700; margin-bottom: 0.375rem; }
.mk-facts { color: var(--text-muted); font-size: 0.875rem; margin-top: 0.25rem; }
.mk-pillars { margin: 0; padding-left: 1.25rem; }
.mk-table { width: 100%; border-collapse: collapse; }
.mk-table td { padding: 0.5rem 0; border-bottom: 1px solid var(--divider); }
.mk-table td:last-child { text-align: right; font-weight: 700; }
.mk-foot { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--divider); font-size: 0.875rem; text-align: center; overflow-wrap: anywhere; }

/* =========================================================
   Luna Sync card
   ========================================================= */
.sync-code { font-family: 'DM Serif Display', serif; font-size: 2.5rem; letter-spacing: 0.15em; text-align: center; color: var(--heading); margin: 0.5rem 0; }
.sync-code-input { font-size: 1.5rem !important; letter-spacing: 0.2em; text-align: center; }
.sync-pics { display: flex; justify-content: center; gap: 1.25rem; margin: 0.75rem 0; flex-wrap: wrap; }
.sync-pics > span { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sync-pic { font-size: 2.25rem; }
.sync-key { display: block; width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9375rem; letter-spacing: 0.05em; padding: 0.75rem; border-radius: 10px; border: 1px solid var(--border-accent); background: var(--surface-alt); color: var(--text); text-align: left; overflow-wrap: anywhere; }
.sync-key-hidden { filter: blur(6px); cursor: pointer; }
