@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  color: #1a1a19;
  background: #eeede9;
  font-family: Manrope, Arial, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
.page {
  min-height: 100vh;
  max-width: 580px;
  margin: 0 auto;
  padding: max(26px, env(safe-area-inset-top)) 30px max(30px, env(safe-area-inset-bottom));
  background-color: #f4f3ef;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
}
.masthead { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.brand { color: inherit; font-size: 19px; font-weight: 800; letter-spacing: -.07em; text-decoration: none; }
.intro { text-align: center; }
.intro-copy { max-width: none; white-space: nowrap; font-size: clamp(8px, 2.9vw, 12px); color: #888782; font-weight: 500; }
.primary { border-radius: 999px; }
.settings-details summary, .setting-group summary { list-style: none; position: relative; padding-right: 24px; }
.settings-details summary::-webkit-details-marker, .setting-group summary::-webkit-details-marker { display: none; }
.settings-details > summary::after, .setting-group > summary::after { content: ""; position: absolute; right: 4px; top: 19px; width: 7px; height: 7px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); transition: transform .15s; }
.settings-details[open] > summary::after, .setting-group[open] > summary::after { transform: rotate(225deg); top: 23px; }
.setting-group { border-top: 1px solid #deddd7; }
.setting-group > summary { padding: 16px 24px 16px 0; font-size: 13px; font-weight: 700; cursor: pointer; }
.group-content { padding: 4px 0 14px; }
.check-field { display: flex; align-items: center; gap: 9px; margin: 15px 0; font-size: 12px; font-weight: 600; }
.check-field input { width: 17px; height: 17px; accent-color: #1a1a19; }
.field input[type="range"] { min-height: 24px; padding: 0; accent-color: #1a1a19; }
.field input[type="color"] { width: 54px; min-height: 38px; padding: 3px; }
.template-field { margin: 0 0 22px; padding: 0; border: 0; min-width: 0; }
.template-field legend { font-size: 11px; font-weight: 700; }
.field-help { color: #777671; font-size: 11px; margin: 5px 0 12px; }
.template-categories { display: flex; gap: 20px; border-bottom: 1px solid #d6d5ce; margin: 0 0 14px; }
.template-category { position: relative; min-height: 44px; padding: 0 0 2px; border: 0; background: transparent; color: #777671; font: 600 12px Manrope, Arial, sans-serif; cursor: pointer; }
.template-category[aria-pressed="true"] { color: #1a1a19; }
.template-category[aria-pressed="true"]::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: #1a1a19; }
.template-category[data-has-selection="true"][aria-pressed="false"]::before { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 5px 2px 0; border-radius: 50%; background: #1a1a19; }
.template-panel[hidden] { display: none; }
.template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 10px; }
.template-card { cursor: pointer; min-width: 0; font-size: 11px; font-weight: 600; }
.template-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.template-picture { position: relative; display: block; height: 140px; border: 2px solid transparent; background: #1c1e22; overflow: hidden; }
.template-picture img { display: block; width: 100%; height: 100%; object-fit: contain; }
.template-card input:checked + .template-picture { border-color: #1a1a19; outline: 2px solid #f4f3ef; outline-offset: -5px; }
.template-card input:checked + .template-picture::before { content: ""; position: absolute; top: 9px; right: 9px; width: 21px; height: 21px; border-radius: 50%; background: #f4f3ef; }
.template-card input:checked + .template-picture::after { content: ""; position: absolute; top: 13px; right: 16px; width: 5px; height: 9px; border: solid #1a1a19; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.template-card input:focus-visible + .template-picture { outline: 2px solid #1a1a19; outline-offset: 2px; }
.text-action { border: 1px solid #b8b7b0; border-radius: 999px; background: transparent; padding: 10px 16px; color: #1a1a19; font: 700 11px Manrope, Arial, sans-serif; cursor: pointer; }
.text-action:disabled { opacity: .5; }
.hook-choice { display: block; width: 100%; margin-top: 8px; padding: 11px; text-align: left; background: transparent; border: 1px solid #c1c0b9; font: 12px Manrope, Arial, sans-serif; cursor: pointer; }
#transcript-words { max-height: 360px; overflow-y: auto; margin: 14px 0; }
.transcript-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; color: #777671; font-size: 10px; }
.transcript-row span { width: 55px; flex: none; }
.transcript-row input { min-width: 0; flex: 1; padding: 8px; border: 1px solid #c1c0b9; background: #f7f6f2; font: 13px Manrope, Arial, sans-serif; }
.transcript-row.flagged input { border-color: #9c7550; }
.masthead > span { color: #6c6b67; font-size: 10px; font-weight: 600; }
.intro { padding: 88px 0 72px; }
.intro-label { margin: 0 0 14px; font-size: 11px; font-style: italic; font-weight: 700; }
h1 { margin: 0; font-size: clamp(35px, 9.2vw, 53px); line-height: 1.06; letter-spacing: -.075em; font-weight: 800; }
h1 span { display: inline-block; color: #f7f6f1; background: #1a1a19; padding: 0 .11em .07em; }
.intro-copy { margin: 21px 0 0; line-height: 1.55; }
.workspace h2 { margin: 0; font-size: 20px; letter-spacing: -.055em; }
.section-copy { margin: 7px 0 20px; color: #6c6b67; font-size: 12px; line-height: 1.55; }
.upload {
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 16px;
  border: 1px solid #a9a8a2;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.upload:hover { background: rgba(255,255,255,.45); border-color: #1a1a19; }
.upload strong { font-size: 13px; }
.upload small { color: #777671; font-size: 10px; }
.file-state { display: flex; justify-content: space-between; gap: 12px; margin-top: 11px; color: #777671; font-size: 11px; overflow-wrap: anywhere; }
.file-state.ready { color: #1a1a19; }
.settings { margin-top: 30px; }
.settings-details { border-top: 1px solid #cecdc6; border-bottom: 1px solid #cecdc6; }
.settings-details > summary { padding: 16px 24px 16px 0; cursor: pointer; font-size: 13px; font-weight: 700; }
.settings-fields { padding: 5px 0 4px; }
.editing-preview:not([hidden]) { position: sticky; z-index: 5; top: max(8px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 14px; padding: 10px; margin: 0 0 20px; background: #f4f3ef; border: 1px solid #d6d5ce; }
.editing-frame { position: relative; width: 90px; flex: none; aspect-ratio: 9 / 16; overflow: hidden; background: #1c1e22; }
.editing-frame canvas, .editing-frame #editing-color { display: block; width: 100%; height: 100%; object-fit: cover; }
.editing-frame [hidden] { display: none !important; }
.editing-frame #editing-color:not([hidden]) { position: absolute; inset: 0; }
.editing-frame #editing-caption:not([hidden]) { position: absolute; left: 50%; top: 70%; height: auto; max-width: 90%; transform: translate(-50%, -50%); }
.editing-preview p { margin: 0; font-size: 12px; font-weight: 700; }
.editing-preview p span { color: #777671; font-size: 11px; font-weight: 500; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 7px; font-size: 11px; font-weight: 700; }
.field label span { margin-left: 5px; color: #777671; font-weight: 400; }
.field select, .field input {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid #c1c0b9;
  border-radius: 0;
  background: #f7f6f2;
  color: #1a1a19;
  font: 600 13px Manrope, Arial, sans-serif;
}
.field input::placeholder { color: #999891; }
.primary, .download {
  width: 100%;
  min-height: 52px;
  margin-top: 20px;
  border: 1px solid #1a1a19;
  border-radius: 0;
  background: #1a1a19;
  color: #fff;
  font: 700 13px Manrope, Arial, sans-serif;
  cursor: pointer;
}
.primary:disabled { opacity: .4; cursor: not-allowed; }
.primary { border-radius: 999px; }
.download { margin-top: 12px; background: transparent; color: #1a1a19; }
.download[hidden] { display: none; }
.notice { min-height: 16px; margin: 10px 0 0; color: #6c6b67; font-size: 11px; line-height: 1.5; }
.notice:empty { display: none; }
.notice.error { color: #9d3027; }
#result-video:not([hidden]) { display: block; width: 100%; max-height: 65vh; margin-top: 14px; background: #111; }
.source-stage:not([hidden]) { position: relative; width: 100%; max-width: 340px; aspect-ratio: 9 / 16; margin: 14px auto 0; overflow: hidden; background: #1c1e22; }
.source-stage video, .source-stage #source-color { display: block; width: 100%; height: 100%; object-fit: cover; }
.source-stage [hidden] { display: none !important; }
.source-stage #source-color:not([hidden]) { position: absolute; inset: 0; pointer-events: none; clip-path: inset(0 0 45px 0); }
.source-stage #source-caption:not([hidden]) { position: absolute; left: 50%; top: 70%; height: auto; max-width: 90%; transform: translate(-50%, -50%); pointer-events: none; }
.preview-note { max-width: 340px; margin: 9px auto 0; color: #777671; font-size: 11px; line-height: 1.5; }
.source-action { margin-top: 14px; }
.cancel-action:not([hidden]) { display: block; margin: 12px auto 0; }
.projects { margin-top: 22px; border-top: 1px solid #deddd7; }
.projects summary { padding: 14px 0; cursor: pointer; font-size: 12px; font-weight: 700; }
#project-list { color: #777671; font-size: 11px; }
.project-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 12px 0; border: 0; border-top: 1px solid #deddd7; background: transparent; color: #1a1a19; text-align: left; font: 600 12px Manrope, Arial, sans-serif; cursor: pointer; }
.project-item span { overflow-wrap: anywhere; }
.project-item small { flex: none; color: #777671; font-size: 10px; font-weight: 500; }
.project-item:disabled { cursor: default; }
#music-preview:not([hidden]) { display: block; width: 100%; margin: 12px 0; }
button:focus-visible, summary:focus-visible, .upload:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #1a1a19; outline-offset: 3px; }
footer { margin-top: 70px; color: #777671; font-size: 10px; font-weight: 600; }
@media (max-width: 360px) {
  .page { padding-left: 22px; padding-right: 22px; }
  .intro { padding: 68px 0 58px; }
  h1 { font-size: 33px; }
}
@media (max-width: 600px) {
  .field select, .field input:not([type="range"]):not([type="color"]), .transcript-row input { font-size: 16px; }
}
