.cm { --cm-red: #c7404e; --cm-ink: #e2dbd1; color: var(--cm-ink); background: #111112; border: 1px solid #544047; border-radius: 15px; padding: 0; width: min(1220px, calc(100% - 36px)); max-width: none; max-height: calc(100dvh - 36px); overflow: auto; overscroll-behavior: contain; box-shadow: 0 30px 140px #000d; font: 14px/1.5 var(--tech-font, Arial, sans-serif); }
.cm::backdrop { background: #030304ed; }
.cm [hidden] { display: none !important; }
.cm button, .cm input, .cm textarea { font: inherit; }
.cm button, .cm label.cm-upload { -webkit-tap-highlight-color: transparent; }
.cm button { cursor: pointer; }
.cm button:focus-visible, .cm input:focus-visible, .cm textarea:focus-visible { outline: 2px solid #ed8b92; outline-offset: 4px; }
.cm-header { display: flex; align-items: center; gap: 24px; padding: 22px 32px; border-bottom: 1px solid #ffffff15; }
.cm-wordmark { color: var(--cm-ink); font: bold 28px/1 Georgia, serif; text-decoration: none; letter-spacing: -.04em; }
.cm-wordmark span { display: block; margin-top: 6px; color: #a89b98; font: 9px/1.5 var(--tech-font, Arial, sans-serif); text-transform: uppercase; letter-spacing: .18em; }
.cm-private { margin: 0 0 0 auto; color: #b7adaa; font-size: 11px; letter-spacing: .04em; }
.cm-private span { color: #b94b57; padding-right: 5px; }
.cm-close { flex: none; width: 38px; height: 38px; padding: 0; border: 1px solid #ffffff25; border-radius: 50%; color: #dad1c8; background: transparent; font-size: 27px !important; line-height: 1 !important; }
.cm-close:hover { background: #ffffff10; }
.cm-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); max-height: calc(100dvh - 132px); overflow: hidden; }
.cm-editor { min-width: 0; min-height: 0; max-height: calc(100dvh - 132px); padding: 46px 34px 30px; overflow: auto; overscroll-behavior: contain; }
.cm-card-title { position: relative; margin: 10px 0 24px; padding-top: 20px; font: 42px/1.1 'Baskerville', Georgia, serif; letter-spacing: .01em; }
.cm-card-title s { text-decoration-color: #e34e5c; text-decoration-thickness: 2px; color: #8b8580; }
.cm-correction { position: absolute; left: 5px; top: -9px; color: #de5965; transform: rotate(-6deg); font: italic 30px/1 Georgia, serif; }
.cm-steps { display: flex; gap: 18px; padding-bottom: 20px; margin-bottom: 28px; border-bottom: 1px solid #ffffff1a; }
.cm-steps button { flex: 1; padding: 0; background: transparent; border: 0; text-align: left; color: #a89d99; font-size: 11px; white-space: nowrap; }
.cm-steps b { display: block; margin-bottom: 4px; color: #8f8180; font-weight: 400; font-size: 10px; letter-spacing: .12em; }
.cm-steps [aria-current="step"] { color: #f2ddd9; }
.cm-steps [aria-current="step"] b { color: #ea6570; }
.cm h3 { margin: 0; color: #e6ddd3; font: 400 27px/1.15 'Baskerville', Georgia, serif; letter-spacing: .01em; }
.cm-section-top { display: flex; align-items: baseline; gap: 16px; }
.cm-section-top h3 { flex: 1; }
.cm-section-top button { flex: none; font-size: 11px; }
.cm-intro { margin: 12px 0 25px; color: #aaa09d; font-size: 12px; }
.cm-field { display: block; color: #d4c9c3; font-size: 12px; margin-top: 19px; }
.cm-field > span { color: #a79a96; font-size: 10px; }
.cm-field input, .cm-field textarea { display: block; width: 100%; margin-top: 7px; padding: 12px 13px; border: 1px solid #ffffff27; border-radius: 6px; background: #08090a; color: #f1e7dd; font-size: 14px; line-height: 1.45; resize: vertical; }
.cm-field input::placeholder, .cm-field textarea::placeholder { color: #786f6c; }
.cm-field input:hover, .cm-field textarea:hover { border-color: #ffffff45; }
.cm-field input:focus, .cm-field textarea:focus { border-color: #b04c59; }
.cm-link { padding: 3px 0; color: #d8c3be; background: transparent; border: 0; text-decoration: underline; text-underline-offset: 4px; }
.cm-link:hover { color: #f08690; }
.cm-controls { display: flex; align-items: center; gap: 24px; margin-top: 23px; }
.cm-controls > .cm-button { margin-left: auto; }
.cm-button { display: inline-flex; align-items: center; justify-content: center; gap: 25px; min-height: 48px; border: 1px solid #b84555; border-radius: 6px; background: #85273a; color: #fff0e7; padding: 12px 18px; text-decoration: none; font-size: 13px; font-weight: 500; }
.cm-button:hover { background: #a33043; }
.cm-button:disabled { opacity: .45; cursor: wait; }
.cm-button.cm-secondary { display: flex; width: 100%; min-height: 39px; margin-top: 9px; padding: 8px 12px; font-size: 12px; background: #191719; border-color: #665055; }
.cm-button.cm-secondary:hover { background: #302027; }
.cm-reset { margin-top: 24px; font-size: 10px !important; color: #9c8b88; }
.cm-status { color: #e7adad; font-size: 12px; margin: 14px 0 0; }
.cm-status:empty { display: none; }
.cm-preview { min-width: 0; align-self: start; padding: 27px 30px; background: radial-gradient(ellipse at 50% 37%, #39252a6b, transparent 75%), #0a0a0b; border-left: 1px solid #ffffff15; }
.cm-preview-heading { display: flex; justify-content: space-between; gap: 15px; padding-bottom: 16px; font-size: 8px; color: #bdacaa; letter-spacing: .12em; }
#cm-card { display: block; width: auto; max-width: 100%; height: auto; max-height: calc(100dvh - 247px); margin: 0 auto; border-radius: 5px; box-shadow: 0 18px 32px #0008; background: #181719; }
.cm-preview > p { color: #b19f9b; font-size: 10px; text-align: center; letter-spacing: .1em; margin: 18px 0 0; }
.cm-options { padding: 0; margin: 0; border: 0; display: grid; gap: 10px; }
.cm-options label { position: relative; min-width: 0; cursor: pointer; }
.cm-options input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cm-options label > span { display: block; height: 100%; padding: 13px 12px; border: 1px solid #ffffff25; border-radius: 7px; background: #0a0a0b; transition: border-color .15s; }
.cm-options input:checked + span { border-color: #c84e60; background: #2b161d; }
.cm-options input:focus-visible + span { outline: 2px solid #ed8b92; outline-offset: 4px; }
.cm-options strong { display: block; color: #e6dcd1; font-size: 13px; font-weight: 500; }
.cm-options small { display: block; margin-top: 5px; color: #ac9f9c; font-size: 10px; }
.cm-monsters { grid-template-columns: 1fr; }
.cm-monsters label > span { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 1px 9px; padding: 11px 14px; }
.cm-monsters i { grid-row: span 2; color: #df6973; font: normal 28px Georgia,serif; text-align: center; }
.cm-monsters small { margin: 0; }
.cm-photo-tools { display: grid; grid-template-columns: 126px 1fr; gap: 23px; align-items: center; margin: 26px 0; }
#cm-face-preview { width: 126px; height: 144px; border: 1px solid #5c444a; border-radius: 50% 50% 44% 44%; background: #1a1719; }
.cm-photo-title { margin: 0 0 7px; color: #dfd3c9; font: 19px/1.2 Georgia,serif; }
.cm-small { color: #a99c99; font-size: 11px; line-height: 1.65; }
.cm-photo-tools .cm-small { margin: 0; font-size: 10px; }
.cm-upload { position: relative; overflow: hidden; cursor: pointer; }
.cm-upload input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.cm-upload:focus-within { outline: 2px solid #ed8b92; outline-offset: 4px; }
#cm-remove-photo { font-size: 10px; margin-top: 9px; }
.cm-camera-panel { margin: 20px 0; }
.cm-viewfinder { position: relative; background: #060607; aspect-ratio: 4/3; overflow: hidden; border: 1px solid #6c4c53; border-radius: 8px; }
.cm-viewfinder video { width: 100%; height: 100%; display: block; object-fit: cover; transform: scaleX(-1); }
.cm-face-guide { position: absolute; inset: 8% 25% 9%; border: 1px dashed #f2d3c4ba; border-radius: 50%; box-shadow: 0 0 0 180px #0005; }
.cm-viewfinder > span { position: absolute; left: 0; bottom: 5%; width: 100%; text-align: center; color: #ffefe1; font-size: 10px; }
.cm-camera-actions { display: flex; align-items: center; gap: 18px; margin-top: 10px; }
.cm-crop { padding: 15px 0 5px; border: 0; border-top: 1px solid #ffffff25; margin: 0 0 16px; }
.cm-crop legend { font-size: 11px; padding-right: 15px; }
.cm-crop label { display: grid; grid-template-columns: 85px 1fr; align-items: center; gap: 12px; font-size: 11px; color: #c2aeaa; margin: 11px 0; }
.cm-crop input { width: 100%; accent-color: #b83f54; }
.cm-scenes { grid-template-columns: 1fr 1fr; }
.cm-scenes label > span { padding: 0 0 13px; overflow: hidden; }
.cm-scenes canvas { display: block; width: 100%; height: auto; border-bottom: 1px solid #ffffff20; margin-bottom: 12px; }
.cm-scenes strong, .cm-scenes small { margin-left: 13px; margin-right: 8px; }
.cm-scenes strong { font-size: 12px; }
.cm-scenes small { font-size: 9px; }
.cm-export-note { display: flex; gap: 17px; margin-top: 27px; padding: 20px 0 0; border-top: 1px solid #ffffff20; }
.cm-export-note > span { font-size: 28px; color: #ce5966; }
.cm-export-note strong { font: 22px/1.2 Georgia, serif; font-weight: 400; }
.cm-export-note p { color: #b1a19c; margin: 8px 0 0; font-size: 12px; }
.cm-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.cm-editor { position: relative; }
.cm-vial { position: absolute; right: 27px; top: 30px; width: 68px; height: 110px; object-fit: contain; transform: rotate(12deg); filter: drop-shadow(0 9px 13px #0008); pointer-events: none; }
.cm-card-title { margin-right: 65px; }
.cm-preview { background: radial-gradient(ellipse at 50% 40%, #5d322b55, transparent 76%), #0c0a0a; }
#cm-card { background: transparent; border-radius: 0; box-shadow: none; filter: drop-shadow(0 10px 13px #0006); }
.cm-monsters { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; }
.cm-monsters label > span { display: block; padding: 0 0 13px; overflow: hidden; text-align: center; }
.cm-monsters canvas { display: block; width: 100%; height: 116px; object-fit: cover; object-position: center 35%; margin-bottom: 11px; border-bottom: 1px solid #ffffff20; }
.cm-monsters strong { padding: 0 7px; font-size: 11px; overflow-wrap: anywhere; }
.cm-monsters small { margin: 5px 6px 0; font-size: 9px; }
.cm-photo-tools { margin-top: 23px; }
#cm-face-preview { border-radius: 7px; object-fit: contain; background: #161114; }
.cm-photo-title { color: #e5d2bd; }
.cm-scenes input:checked + span { box-shadow: 0 0 0 1px #bc4d54; background: #301b1b; }
.cm-scenes canvas { filter: saturate(.9); }
.cm-loading #cm-card { opacity: .15; }
.blood-cta .blood-cta-vial { width: 27px; height: 40px; object-fit: contain; margin: -10px 0; filter: drop-shadow(0 0 6px #a52e4855); }
html.cm-open { overflow: hidden; }
.cm-actionbar { padding: 12px 28px 15px; border-top: 1px solid #ffffff1d; background: #131112; }
.cm-actionbar .cm-controls { margin: 0; }
.cm-actionbar .cm-status { margin: 0 0 8px; font-size: 12px; }
.cm-short-label, #cm-preview-toggle, .cm-preview-loading { display: none; }
.cm-loading .cm-preview-loading, .cm-load-error .cm-preview-loading { display: block; color: #d5b6ac; font: italic 20px/1.4 Georgia,serif; text-align: center; padding: 35px 10px; }
.cm-load-error .cm-preview-loading { font-size: 0; }
.cm-load-error .cm-preview-loading::after { content: 'Your scene photos need another try.'; font-size: 18px; }
.cm-camera-button img { width: 34px; height: 25px; object-fit: contain; }
.cm-open-image { display: block; width: fit-content; margin: 0 0 7px auto; font-size: 12px; }
.cm-button.cm-camera-button { display: flex; gap: 9px; }
#cm-share.cm-secondary { width: auto; margin: 0; min-height: 48px; }
@media (max-width: 760px), (max-width: 1000px) and (max-height: 550px) {
  .cm { width: calc(100% - 16px); max-height: calc(100dvh - 16px); border-radius: 10px; }
  .cm-header { padding: 17px 19px; gap: 12px; }
  .cm-wordmark { font-size: 24px; }
  .cm-wordmark span { font-size: 8px; }
  .cm-private { font-size: 9px; max-width: 110px; line-height: 1.45; }
  .cm-private span { display: none; }
  .cm-close { width: 33px; height: 33px; }
  .cm-layout { grid-template-columns: minmax(0,1fr); max-height: none; overflow: visible; }
  .cm-editor { padding: 35px 22px 26px; max-height: none; overflow: visible; }
  .cm-card-title { font-size: 39px; }
  .cm-vial { width: 48px; height: 84px; right: 18px; top: 20px; }
  .cm-card-title { margin-right: 40px; font-size: 34px; }
  .cm-correction { font-size: 28px; }
  .cm-steps { gap: 12px; }
  .cm-steps button { font-size: 10px; }
  .cm h3 { font-size: 25px; }
  .cm-section-top { align-items: flex-start; gap: 9px; }
  .cm-section-top .cm-link { font-size: 10px; white-space: nowrap; }
  .cm-preview { position: static; border-left: 0; border-top: 1px solid #ffffff20; padding: 24px; }
  #cm-card { width: 100%; max-width: 410px; max-height: none; margin: 0 auto; }
  .cm-preview-heading { max-width: 410px; margin: 0 auto; font-size: 7px; }
  .cm-photo-tools { grid-template-columns: 105px 1fr; gap: 18px; }
  #cm-face-preview { width: 105px; height: 120px; }
  .cm-photo-title { font-size: 17px; }
  .cm-monsters { grid-template-columns: 1fr; }
  .cm-monsters label > span { display: grid; grid-template-columns: 62px 1fr; gap: 0 12px; padding: 0; text-align: left; align-items: center; }
  .cm-monsters canvas { width: 62px; height: 72px; grid-row: span 2; margin: 0; border: 0; }
  .cm-monsters strong { padding: 6px 8px 0 0; align-self: end; font-size: 13px; }
  .cm-monsters small { margin: 3px 8px 9px 0; align-self: start; font-size: 10px; }
  .cm-controls { gap: 14px; }
  .cm-controls .cm-button { padding: 13px; gap: 17px; font-size: 12px; }
}
/* Desktop studio. */
@media (min-width: 761px) and (min-height: 551px), (min-width: 1001px) {
  .cm-header { padding: 12px 28px; }
  .cm-layout, .cm-editor { max-height: calc(var(--studio-height, 100dvh) - 188px); }
  .cm-editor { padding: 28px 30px 22px; }
  .cm-card-title { margin-top: 8px; margin-bottom: 20px; }
  .cm-vial { top: 15px; right: 23px; }
  .cm-card-title, .cm-vial { display: none; }
  .cm-steps { margin-bottom: 20px; padding-bottom: 13px; }
  .cm-steps button { font-size: 12px; }
  .cm-intro { margin: 10px 0 20px; font-size: 13px; }
  .cm h3 { font-size: 29px; }
  .cm-madlib .cm-field { display: flex; align-items: baseline; gap: 12px; margin: 10px 0; white-space: nowrap; font: 400 20px/1.7 Georgia, serif; color: #e0cfc0; }
  .cm-madlib .cm-field > span { display: none; }
  .cm-madlib input { flex: 1; width: auto; min-width: 0; margin: 0; padding: 6px 8px; border: 0; border-bottom: 1px dashed #9e5b5d; border-radius: 0; background: #21151755; color: #f1d8c7; font: italic 19px/1.4 Georgia, serif; }
  .cm-madlib input::placeholder { color: #978379; }
  .cm-madlib input:focus { background: #3c1e254d; border-color: #f0858a; }
  .cm-preview { padding: 14px 22px; }
  .cm-preview-heading { font-size: 10px; padding-bottom: 10px; letter-spacing: .06em; }
  #cm-card { max-height: calc(var(--studio-height, 100dvh) - 268px); }
  .cm-preview > p { margin-top: 10px; }
  .cm[data-step="1"] .cm-card-title, .cm[data-step="1"] .cm-vial,
  .cm[data-step="2"] .cm-card-title, .cm[data-step="2"] .cm-vial { display: none; }
  .cm-scenes canvas { height: 116px; object-fit: cover; object-position: center top; margin-bottom: 8px; }
  .cm-scenes strong { font-size: 13px; }
  .cm-scenes small, .cm[data-step="2"] .cm-intro { display: none; }
  .cm-export-note { display: none; }
  .cm-controls { margin-top: 19px; }
  .cm-button { font-size: 14px; }
}
/* Phone / tablet studio: one scrolling content pane and reachable actions. */
@media (max-width: 760px), (max-width: 1000px) and (max-height: 550px) {
  .cm { width: 100%; max-width: 100%; height: var(--studio-height, 100dvh); max-height: var(--studio-height, 100dvh); margin: 0; border: 0; border-radius: 0; overflow: hidden; }
  .cm-shell { display: grid; grid-template-rows: auto minmax(0,1fr) auto; height: 100%; min-height: 0; }
  .cm-header { padding: calc(12px + env(safe-area-inset-top)) 18px 12px; gap: 12px; }
  .cm-wordmark { font-size: 25px; }
  .cm-private { font-size: 10px; max-width: 128px; }
  .cm-close { min-width: 44px; width: 44px; height: 44px; }
  .cm-layout { display: block; min-height: 0; overflow-y: auto; overflow-x: hidden; max-height: none; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scroll-padding: 18px; }
  .cm-editor { overflow: visible; max-height: none; padding: 22px 24px 20px 18px; }
  .cm-card-title, .cm-vial { display: none; }
  .cm-steps { margin: 0 0 22px; padding-bottom: 16px; gap: 12px; }
  .cm-steps button { min-height: 38px; font-size: 11px; }
  .cm h3 { font-size: clamp(25px, 7vw, 31px); }
  .cm-intro { font-size: 13px; margin: 10px 0 18px; }
  .cm-section-top { gap: 12px; align-items: center; }
  .cm-section-top .cm-link { font-size: 11px; line-height: 1.5; max-width: 78px; white-space: normal; }
  .cm-madlib .cm-field { margin-top: 17px; color: #ddc9bb; font: 18px/1.35 Georgia,serif; }
  .cm-madlib .cm-field > span { font-size: 11px; }
  .cm-madlib input { font: italic 18px/1.4 Georgia,serif; min-height: 46px; margin-top: 7px; border-radius: 3px; border-width: 0 0 1px; border-bottom-style: dashed; border-color: #a36063; background: #2b181c66; padding: 9px 10px; }
  .cm-photo-tools { grid-template-columns: 110px minmax(0,1fr); gap: 16px; }
  #cm-face-preview { width: 110px; height: 126px; }
  .cm-photo-title { font-size: 19px; }
  .cm-small, .cm-photo-tools .cm-small { font-size: 12px; }
  .cm-button.cm-secondary { min-height: 44px; font-size: 13px; }
  .cm-monsters label > span { grid-template-columns: 68px minmax(0,1fr); }
  .cm-monsters canvas { width: 68px; height: 80px; }
  .cm-monsters strong { font-size: 15px; }
  .cm-monsters small { font-size: 11px; }
  .cm-scenes { grid-template-columns: minmax(0,1fr); gap: 17px; }
  .cm-scenes canvas { width: 100%; height: auto; aspect-ratio: 5/3; object-fit: cover; margin-bottom: 10px; }
  .cm-scenes strong { font-size: 16px; }
  .cm-scenes small { font-size: 12px; }
  .cm-scenes label > span { padding-bottom: 14px; }
  .cm-export-note { display: none; }
  .cm-preview { padding: 22px 20px 28px; }
  .cm-preview-heading { font-size: 9px; gap: 12px; line-height: 1.5; }
  .cm-preview-heading > span:last-child { text-align: right; }
  #cm-card { width: 100%; max-width: 430px; height: auto; max-height: none; }
  .cm-preview > p { font-size: 11px; }
  .cm-actionbar { padding: 9px 14px calc(9px + env(safe-area-inset-bottom)); }
  .cm-actionbar .cm-status { font-size: 11px; line-height: 1.4; margin-bottom: 7px; }
  .cm-controls { gap: 9px; min-width: 0; }
  .cm-controls .cm-link { font-size: 12px; min-height: 44px; white-space: nowrap; }
  #cm-preview-toggle { display: block; }
  .cm-controls .cm-button { min-height: 46px; padding: 11px 13px; font-size: 13px; gap: 10px; }
  .cm-full-label { display: none; }
  .cm-short-label { display: inline; }
  #cm-share.cm-secondary { min-height: 46px; width: auto; margin: 0; padding: 10px; }
  .cm-camera-actions { flex-wrap: wrap; }
  .cm-crop input { min-height: 32px; }
}
@media (max-width: 350px) {
  .cm-header { padding-left: 14px; padding-right: 12px; gap: 8px; }
  .cm-wordmark { font-size: 23px; }
  .cm-private { font-size: 9px; max-width: 94px; }
  .cm-editor { padding-left: 15px; padding-right: 22px; }
  .cm-controls { gap: 7px; }
  .cm-controls .cm-button { padding: 11px 10px; font-size: 12px; gap: 7px; }
  .cm-controls .cm-link { font-size: 11px; }
  .cm-photo-tools { grid-template-columns: 90px minmax(0,1fr); gap: 12px; }
  #cm-face-preview { width: 90px; height: 103px; }
}
@media (min-width: 761px) and (min-height: 551px), (min-width: 1001px) {
  .cm { height: calc(var(--studio-height, 100dvh) - 36px); }
  .cm-shell { display: grid; grid-template-rows: auto minmax(0,1fr) auto; height: 100%; min-height: 0; }
  .cm-layout { height: 100%; max-height: none; min-height: 0; }
  .cm-editor { max-height: none; }
  .cm-preview { height: 100%; min-height: 0; display: flex; flex-direction: column; align-items: center; }
  .cm-preview-heading { width: 100%; flex: none; }
  #cm-card { flex: 1; min-height: 0; height: 0; width: 100%; max-height: none; object-fit: contain; }
  .cm-preview > p { flex: none; }
}
@media (max-width: 760px), (max-width: 1000px) and (max-height: 550px) { .cm-reset { min-height: 44px; font-size: 12px !important; } }
@media (prefers-reduced-motion: reduce) { .cm * { scroll-behavior: auto !important; transition: none !important; } }

@media (max-width: 1000px) and (max-height: 550px) { .cm-preview { max-width: 600px; margin: auto; } .cm-scenes { max-width: 600px; margin-left: auto; margin-right: auto; } .cm-editor { padding-top: 18px; } .cm-header { padding-top: max(9px,env(safe-area-inset-top)); padding-bottom: 9px; } }
