/* CineMorph — professional voice designer. Matches the DVP suite system:
   tokens from premium-core.css, orbs positioned per page. */

.dvp-orb { position: fixed; border-radius: 50%; pointer-events: none; will-change: transform; z-index: 0; }
.dvp-orb-1 { width: 620px; height: 430px; filter: blur(72px); top: -130px; left: -90px; animation: cmOrb1 26s ease-in-out infinite; }
.dvp-orb-2 { width: 480px; height: 380px; filter: blur(80px); bottom: -140px; right: -80px; animation: cmOrb2 31s ease-in-out infinite; }
.dvp-orb-3 { width: 360px; height: 300px; filter: blur(90px); top: 40%; left: 60%; animation: cmOrb3 37s ease-in-out infinite; }
@keyframes cmOrb1 { 50% { transform: translate(60px, 40px); } }
@keyframes cmOrb2 { 50% { transform: translate(-50px, -30px); } }
@keyframes cmOrb3 { 50% { transform: translate(-40px, 50px); } }
@media (prefers-reduced-motion: reduce) {
  .dvp-orb { animation: none; }
}

/* premium-core styles `body` for background and font smoothing only — it sets
   NO base color and NO base font-family, applying type through utility classes
   instead. So every page must establish its own, and this one never did: all
   body copy was rendering in the browser's default serif while the headings
   used Archivo. Set both once, here, and everything inherits. */
.cinemorph-page {
  color: var(--text-primary, #edf2f8);
  font-family: var(--font-body, "Hanken Grotesk", system-ui, sans-serif);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Form controls do not inherit type from their ancestors — without this the
   selects, inputs and buttons drop back to the system UI face. */
.cinemorph-page button,
.cinemorph-page input,
.cinemorph-page select,
.cinemorph-page textarea {
  font-family: inherit;
}

/* Every text field and select, styled ONCE. Previously only a handful were
   targeted by id, so the ElevenLabs key field and the voice picker kept the
   browser default: a white box with black text on a dark page, which reads as
   a broken control rather than a deliberate one. */
.cinemorph-page input[type="text"],
.cinemorph-page input[type="password"],
.cinemorph-page input[type="search"],
.cinemorph-page input:not([type]),
.cinemorph-page select,
.cinemorph-page textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 2.5rem;
  background: rgba(3, 5, 8, .88);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: .5rem;
  color: var(--text-primary, #edf2f8);
  font: 500 .88rem/1.4 var(--font-body, "Hanken Grotesk", sans-serif);
  padding: .7rem .75rem;
  transition: border-color .15s;
}
.cinemorph-page input:hover:not(:disabled),
.cinemorph-page select:hover:not(:disabled),
.cinemorph-page textarea:hover:not(:disabled) { border-color: rgba(255, 255, 255, .3); }
.cinemorph-page input:focus-visible,
.cinemorph-page select:focus-visible,
.cinemorph-page textarea:focus-visible {
  outline: 2px solid var(--accent, #ff7338);
  outline-offset: 2px;
  border-color: var(--accent, #ff7338);
}
.cinemorph-page input::placeholder,
.cinemorph-page textarea::placeholder { color: var(--muted, #9fb0c3); opacity: .75; }
.cinemorph-page input:disabled,
.cinemorph-page select:disabled { opacity: .45; cursor: not-allowed; }
/* Checkboxes keep their native box; only the tint is ours. */
.cinemorph-page input[type="checkbox"] { width: auto; min-height: 0; accent-color: var(--accent, #ff7338); }
@media (prefers-reduced-motion: reduce) {
  .cinemorph-page input, .cinemorph-page select, .cinemorph-page textarea { transition: none; }
}

.wrap { position: relative; z-index: 1; max-width: 1060px; margin: 0 auto; padding: 48px 24px 96px; }

/* Hero: the house treatment every tool page uses — left-aligned, oversized
   uppercase display type on a tight leading, over a mono accent kicker.
   Matches .sd-title / CineQC h1 exactly; do not re-centre it. */
header { margin-bottom: 40px; }
.kicker { font: 700 .68rem/1 var(--font-mono, "JetBrains Mono", monospace); letter-spacing: .18em; text-transform: uppercase; color: var(--accent, #ff7338); }
header h1 { font-family: var(--font-display, "Archivo", sans-serif); font-size: clamp(3.2rem, 11vw, 6.5rem); font-weight: 900; line-height: .9; letter-spacing: -.035em; text-transform: uppercase; margin: .65rem 0 0; color: var(--text-primary, #edf2f8); }
header h1 span { color: var(--accent, #ff7338); }
.tagline { font-family: var(--font-display, "Archivo", sans-serif); font-size: clamp(1.15rem, 2.8vw, 1.7rem); font-weight: 700; letter-spacing: -.01em; margin: .85rem 0 10px; color: var(--text-primary, #edf2f8); }
.sub { max-width: 640px; margin: 0 0 14px; color: var(--muted, #9fb0c3); line-height: 1.6; }
.privacy { display: inline-block; font-family: var(--font-mono, "JetBrains Mono", monospace); font-size: 12px; padding: 6px 14px; border: 1px solid rgba(255, 115, 56, .35); border-radius: 999px; color: var(--accent, #ff7338); }

/* Panels are the spine of the page: one card per numbered step, with enough
   air that the three steps read as three decisions rather than one long form. */
/* Guide imagery: real screenshots of the tool, generated by
   scripts/gen-cinemorph-guide-art.mjs so they can never drift from the UI.
   width and height are set on each image element so the layout does not jump
   while they load. */
.cm-figure { margin: 0 0 26px; }
.cm-figure img { display: block; width: 100%; height: auto; border-radius: 18px; border: 1px solid rgba(255, 255, 255, .09); }
.cm-figure figcaption { margin-top: 10px; font-size: 13px; color: var(--muted, #9fb0c3); text-align: center; }
.cm-figure-hero { margin-bottom: 34px; }

.cm-panel { background: radial-gradient(circle at 0% 0%, rgba(255, 115, 56, .08), transparent 36%), rgba(8, 9, 15, .86); border: 1px solid rgba(255, 255, 255, .12); border-radius: .75rem; padding: 30px 32px; margin-bottom: 26px; box-shadow: 0 24px 70px rgba(0, 0, 0, .38); }
.cm-panel h2 { font-family: var(--font-display, "Archivo", sans-serif); font-size: 17px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted, #9fb0c3); margin: 0 0 22px; }

.cm-label { display: block; font: 700 .68rem/1 var(--font-mono, "JetBrains Mono", monospace); letter-spacing: .12em; text-transform: uppercase; color: var(--muted, #9fb0c3); margin-bottom: 8px; }
.hint { font-size: 13px; color: var(--muted, #9fb0c3); line-height: 1.55; }

/* Errors and warnings carry an icon as well as a colour, so the distinction
   survives greyscale and colour-blindness. */
.cm-error { color: #ff8a9c; font-size: 14px; }
.cm-error:not(:empty)::before { content: "⚠ "; }
.cm-warnings li { color: #ffc46b; font-size: 13px; line-height: 1.55; }

/* Source — the first thing a new user must do, so the drop zone is large and
   the two ways in sit side by side rather than one being hidden. */
#cm-drop { border: 2px dashed rgba(255, 255, 255, .18); border-radius: 14px; padding: 34px 26px; text-align: center; transition: border-color .2s, background .2s; }
#cm-drop:hover { border-color: rgba(255, 255, 255, .3); }
#cm-drop.cm-dragover { border-color: var(--accent, #ff7338); background: rgba(255, 115, 56, .07); }
.cm-source-actions { display: flex; gap: 12px; justify-content: center; margin: 16px 0; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { #cm-drop { transition: none; } }
.cm-file-label { position: relative; overflow: hidden; }
.cm-file-label input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.cm-source-status { font-family: var(--font-mono, "JetBrains Mono", monospace); font-size: 13px; min-height: 1.2em; }
#cm-record.cm-recording { border-color: #ff5f7a; color: #ff5f7a; }

/* Buttons — the house control: small uppercase mono on a 2.5rem body, ghost by
   default, solid accent for the primary action. Same spec as .sd-btn. */
.cm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 2.5rem; font: 800 .68rem/1 var(--font-mono, "JetBrains Mono", monospace); letter-spacing: .1em; text-transform: uppercase; color: var(--text-primary, #edf2f8); background: transparent; border: 1px solid rgba(255, 255, 255, .14); border-radius: .375rem; padding: 0 .875rem; cursor: pointer; text-decoration: none; transition: transform .25s cubic-bezier(.16,1,.3,1), border-color .25s cubic-bezier(.16,1,.3,1), box-shadow .25s cubic-bezier(.16,1,.3,1); }
.cm-btn:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(255, 115, 56, .45); }
.cm-btn:focus-visible { outline: 2px solid var(--accent, #ff7338); outline-offset: 2px; }
.cm-btn:disabled { opacity: .5; cursor: not-allowed; }
.cm-btn-primary { background: var(--accent, #ff7338); border-color: var(--accent, #ff7338); color: var(--text-primary, #edf2f8); box-shadow: 0 0 20px rgba(255, 115, 56, .16); }
@media (prefers-reduced-motion: reduce) { .cm-btn { transition: none; } .cm-btn:hover:not(:disabled) { transform: none; } }

/* Tabs — the active one is marked by weight and a filled pill, not colour
   alone, so it is still obvious in greyscale. */
.cm-tabs { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.cm-tab { font: 700 .68rem/1 var(--font-mono, "JetBrains Mono", monospace); letter-spacing: .1em; text-transform: uppercase; min-height: 2.5rem; padding: 0 1.125rem; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .14); background: transparent; color: var(--muted, #9fb0c3); cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.cm-tab:hover { color: var(--text-primary, #edf2f8); border-color: rgba(255, 255, 255, .3); }
.cm-tab.active { color: #fff; font-weight: 800; border-color: var(--accent, #ff7338); background: rgba(255, 115, 56, .16); box-shadow: inset 0 0 0 1px rgba(255, 115, 56, .35); }
.cm-tab:focus-visible { outline: 2px solid var(--accent, #ff7338); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .cm-tab { transition: none; } }

/* Quick Character */
.cm-quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
#cm-preset, #cm-add-module, #cm-char-desc { width: 100%; background: rgba(6, 13, 24, .9); border: 1px solid rgba(255, 255, 255, .15); border-radius: 10px; color: var(--text, #e8eef5); font-size: 14px; padding: 10px 12px; }
.cm-macros { margin-top: 20px; display: grid; gap: 14px; }
.cm-macro-row { display: grid; grid-template-columns: 110px 1fr 52px; align-items: center; gap: 12px; }
.cm-macro-row label { font-size: 14px; color: var(--text-primary, #edf2f8); text-transform: capitalize; }
/* Tabular figures so the value does not jitter sideways while dragging. */
.cm-macro-row output { font-family: var(--font-mono, "JetBrains Mono", monospace); font-size: 12px; text-align: right; color: var(--text-primary, #edf2f8); font-variant-numeric: tabular-nums; }
input[type="range"] { accent-color: var(--accent, #ff7338); width: 100%; height: 24px; cursor: pointer; }
input[type="range"]:focus-visible { outline: 2px solid var(--accent, #ff7338); outline-offset: 4px; border-radius: 4px; }

#cm-morphpad { position: relative; aspect-ratio: 1; max-width: 320px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 14px; background:
  radial-gradient(circle at 0% 100%, rgba(255, 115, 56, .16), transparent 60%),
  radial-gradient(circle at 100% 0%, rgba(255, 45, 120, .16), transparent 60%),
  rgba(6, 13, 24, .8); cursor: crosshair; touch-action: none; }
#cm-morphpad:focus-visible { outline: 2px solid var(--accent, #ff7338); outline-offset: 2px; }
/* The resting position must match the inset the JS uses (MORPH_HANDLE_INSET),
   or the handle sits half outside the pad until the first drag moves it. */
#cm-morph-cursor { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: var(--accent, #ff7338); box-shadow: 0 0 0 3px rgba(6, 13, 24, .9), 0 0 14px rgba(255, 115, 56, .7); transform: translate(-50%, -50%); left: 11px; top: calc(100% - 11px); }
.cm-corner { position: absolute; font-family: var(--font-mono, "JetBrains Mono", monospace); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted, #9fb0c3); padding: 6px; }
.cm-corner-a { left: 4px; bottom: 2px; }
.cm-corner-b { right: 4px; bottom: 2px; }
.cm-corner-c { left: 4px; top: 2px; }
.cm-corner-d { right: 4px; top: 2px; }

.cm-charbuilder { margin-top: 26px; }
.cm-char-row { display: flex; gap: 10px; }
.cm-char-row input { flex: 1; }
.cm-char-proposal { margin-top: 14px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; padding: 14px 16px; }
.cm-char-proposal ul { margin: 6px 0; padding-left: 18px; font-size: 13px; }
.cm-char-actions { display: flex; gap: 10px; margin-top: 10px; }

/* Voice Designer */
#cm-designer { display: grid; gap: 14px; }
.cm-module-card { border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; padding: 14px 16px; }
.cm-module-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cm-module-head strong { font-size: 14px; }
.cm-module-head .cm-compat { margin-left: auto; }
.cm-param-row { display: grid; grid-template-columns: 150px 1fr 70px 30px; align-items: center; gap: 10px; margin: 4px 0; }
.cm-param-row label { font-size: 13px; color: var(--muted, #9fb0c3); }
.cm-param-row output { font-family: var(--font-mono, "JetBrains Mono", monospace); font-size: 12px; text-align: right; }
.cm-reset { background: none; border: none; color: var(--muted, #9fb0c3); cursor: pointer; font-size: 14px; }
.cm-reset:hover { color: var(--accent, #ff7338); }

/* Studio Rack */
.cm-rack-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.cm-rack-tools label { margin: 0; }
#cm-add-module { width: auto; min-width: 220px; }
#cm-rack-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cm-rack-item { display: flex; align-items: center; gap: 10px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 10px; padding: 10px 14px; }
.cm-rack-item.cm-bypassed { opacity: .45; }
.cm-rack-item strong { font-size: 14px; min-width: 150px; }
.cm-rack-item .cm-compat { font-family: var(--font-mono, "JetBrains Mono", monospace); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .2); }
.cm-compat[data-level="native"] { color: #6be675; border-color: rgba(107, 230, 117, .4); }
.cm-compat[data-level="approximated"] { color: #ffc46b; border-color: rgba(255, 196, 107, .4); }
.cm-compat[data-level="studioOnly"] { color: #7db4ff; border-color: rgba(125, 180, 255, .4); }
.cm-compat[data-level="unavailable"] { color: #ff5f7a; border-color: rgba(255, 95, 122, .4); }
.cm-rack-actions { margin-left: auto; display: flex; gap: 6px; }
.cm-rack-actions button { padding: 6px 10px; font-size: 12px; }
.cm-rack-actions .cm-solo[aria-pressed="true"] { border-color: var(--accent2, #ff2d78); color: var(--accent2, #ff2d78); }

/* Projects & batch */
.cm-project-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
#cm-audio-recovery-row { margin-top: 12px; }
.cm-batch { margin-top: 16px; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 14px; }
#cm-batch-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
#cm-batch-list a { color: var(--accent, #ff7338); text-decoration: none; }
#cm-batch-list a:hover { text-decoration: underline; }
#cm-batch-progress { flex: 1; min-width: 160px; height: 10px; accent-color: var(--accent, #ff7338); }

/* AI voice (BYOK) */
.cm-optional { font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--muted, #9fb0c3); }
.cm-ai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.cm-ai-keyrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0 14px; }
.cm-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted, #9fb0c3); cursor: pointer; }
.cm-check input { accent-color: var(--accent, #ff7338); }
.cm-ai-enable-row { margin-top: 14px; }
.cm-consent { margin: 10px 0; }
#cm-ai-clone-name { width: 100%; background: rgba(6, 13, 24, .9); border: 1px solid rgba(255, 255, 255, .15); border-radius: 10px; color: var(--text, #e8eef5); font-size: 14px; padding: 10px 12px; }
@media (max-width: 760px) { .cm-ai-grid { grid-template-columns: 1fr; } }

/* Transport & results */
.cm-transport { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
#cm-progress { flex: 1; min-width: 160px; height: 10px; accent-color: var(--accent, #ff7338); }
.cm-status { font-family: var(--font-mono, "JetBrains Mono", monospace); font-size: 13px; min-height: 1.4em; color: var(--muted, #9fb0c3); }
.cm-status-error,
.cm-source-status.cm-status-error { color: #ff5f7a; }
.cm-section-gap { margin-top: 14px; }
.cm-results { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 14px; }
.cm-result-col audio { width: 100%; }
.cm-result-col .cm-btn { margin-top: 10px; }
.cm-guard { margin-top: 16px; border: 1px solid rgba(255, 196, 107, .4); border-radius: 12px; padding: 14px 16px; font-size: 13px; color: #ffc46b; }
.cm-guard strong { color: #fff; }
.cm-consent-note { text-align: center; font-size: 13px; color: var(--muted, #9fb0c3); margin-top: 8px; }

/* Mobile: Quick Character is the professional-lite surface */
@media (max-width: 760px) {
  .wrap { padding: 32px 14px 72px; }
  .cm-quick-grid, .cm-results { grid-template-columns: 1fr; }
  .cm-param-row { grid-template-columns: 110px 1fr 54px 24px; }
  .cm-rack-item strong { min-width: 0; }
}

/* Guide */
.cm-guide-step { display: grid; grid-template-columns: 52px 1fr; gap: 16px; margin-bottom: 22px; }
.cm-guide-num { font-family: var(--font-display, "Archivo", sans-serif); font-size: 30px; font-weight: 900; color: var(--accent, #ff7338); }
.cm-guide-step h3 { margin: 2px 0 6px; font-size: 17px; color: var(--text, #e8eef5); }
.cm-guide-step p,
.cm-guide-step li { color: var(--muted, #9fb0c3); line-height: 1.65; font-size: 15px; }
.cm-guide-step ul { margin: 6px 0; padding-left: 18px; }
.cm-callout { border: 1px solid rgba(255, 115, 56, .3); padding: 12px 16px; background: rgba(255, 115, 56, .06); border-radius: 10px; margin: 14px 0; font-size: 14px; color: var(--text, #e8eef5); }
.cm-callout.warn { border-color: rgba(255, 196, 107, .35); background: rgba(255, 196, 107, .06); }
.cm-compat-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cm-compat-table th,
.cm-compat-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid rgba(255, 255, 255, .08); color: var(--muted, #9fb0c3); }
.cm-compat-table th { font-family: var(--font-mono, "JetBrains Mono", monospace); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.cm-cta { text-align: center; margin: 34px 0 10px; }
