@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700&family=Cormorant+Garamond:wght@500;600&display=swap");

:root {
  --bg: #070707;
  --card: #141414;
  --card-2: #1c1c1c;
  --text: #f4f1ea;
  --dim: rgba(244, 241, 234, 0.62);
  --line: rgba(244, 241, 234, 0.12);
  --line-2: rgba(244, 241, 234, 0.24);
  --accent: #e8c9a0;
  --accent-ink: #1a140c;
  --ok: #8fd19e;
  --warn: #f2b56b;
  --radius: 14px;
  --max: 760px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body.op {
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.05), transparent 40%), var(--bg);
  color: var(--text);
  font: 15px/1.55 "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.op-wrap { width: min(100% - 32px, var(--max)); margin: 0 auto; }

/* header */
.op-top { position: sticky; top: 0; z-index: 20; background: rgba(7, 7, 7, 0.92); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.op-top__inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 8px; }
.op-logo { font-family: "Cormorant Garamond", serif; font-size: 20px; letter-spacing: 3px; color: var(--text); text-decoration: none; }
.op-top__title { color: var(--dim); font-size: 13px; }
.op-steps { display: flex; align-items: center; gap: 10px; padding: 4px 0 10px; }
.op-step__badge { background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px; letter-spacing: .5px; }
.op-step__name { font-weight: 700; }
.op-step__count { margin-left: auto; color: var(--dim); font-size: 13px; }
.op-progress { height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; margin-bottom: 10px; }
.op-progress i { display: block; height: 100%; width: 25%; background: var(--accent); transition: width .3s; }

.op-main { padding: 18px 0 30px; }
.op-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.op-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.op-h1 { font-size: 22px; margin: 0 0 4px; }
.op-h2 { font-size: 17px; margin: 0 0 4px; }
.op-sub { color: var(--dim); margin: 0 0 16px; font-size: 14px; }
.op-mini { color: var(--dim); font-size: 13px; margin: 0 0 10px; }
.op-center { text-align: center; }
.op-accent { color: var(--accent); }

.op-field { margin-top: 14px; }
.op-label { display: block; font-size: 13px; color: var(--dim); margin-bottom: 6px; }
.op-label b { color: var(--accent); }
.op-input { width: 100%; background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; outline: none; color-scheme: dark; resize: vertical; }
.op-input:focus { border-color: var(--accent); }
.op-input.bad { border-color: #e06c6c; }
.op-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.op-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

.op-toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.op-toggle span { flex: 1; display: grid; }
.op-toggle small { color: var(--dim); }
.op-toggle input { display: none; }
.op-toggle i { width: 44px; height: 26px; border-radius: 13px; background: var(--line-2); position: relative; transition: background .2s; }
.op-toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text); transition: left .2s; }
.op-toggle input:checked + i { background: var(--accent); }
.op-toggle input:checked + i::after { left: 21px; background: var(--accent-ink); }

/* buttons */
.op-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-2); background: var(--card-2); border-radius: 12px; padding: 13px 16px; cursor: pointer; font-weight: 500; width: 100%; }
.op-btn--primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.op-btn--dark { background: var(--text); color: #111; border-color: var(--text); }
.op-btn--ghost { background: transparent; }
.op-btn:disabled { opacity: .4; cursor: default; }
.op-chip { border: 1px solid var(--line-2); background: var(--card); border-radius: 99px; padding: 7px 14px; cursor: pointer; font-size: 13px; }
.op-chip:hover, .op-btn:hover { border-color: var(--text); }

.op-bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(7, 7, 7, 0.94); border-top: 1px solid var(--line); padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); }
.op-bottom__inner { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.op-bottom .op-btn--ghost { background: var(--card); }

/* step 2 */
.op-count { display: flex; justify-content: space-between; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.op-count small { display: block; color: var(--dim); font-size: 12px; }
.op-count strong { font-size: 26px; }
.op-right { text-align: right; }
.op-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.op-th { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--card-2); cursor: pointer; border: 2px solid transparent; }
.op-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.op-th .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .7); color: #fff; font-size: 13px; line-height: 22px; padding: 0; cursor: pointer; }
.op-th .used { position: absolute; left: 4px; bottom: 4px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 6px; }
.op-th.sel { border-color: var(--accent); }
.op-th.sel::after { content: "✓ 선택됨"; position: absolute; top: 4px; left: 4px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.op-add { aspect-ratio: 1; border: 1.5px dashed var(--accent); border-radius: 10px; display: grid; place-content: center; text-align: center; cursor: pointer; color: var(--accent); }
.op-add span { font-size: 26px; line-height: 1; }
.op-add small { font-size: 11px; }
.op-notes { margin: 16px 0 0; padding-left: 18px; color: var(--dim); font-size: 13px; }
.op-notes b { color: var(--accent); }

/* step 3 */
.op-tools { display: flex; gap: 8px; justify-content: flex-end; }
.op-stagecard { padding: 10px; }
.op-stage { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
.op-stage > img { width: 100%; height: 100%; display: block; object-fit: cover; }
.op-spot { position: absolute; border: 2px solid var(--accent); border-radius: 6px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55); transition: all .25s; overflow: hidden; }
.op-spot canvas { width: 100%; height: 100%; display: block; }
.op-spot span { position: absolute; left: 6px; top: 6px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 12px; padding: 1px 7px; border-radius: 6px; }
.op-spot.nobox { inset: auto 10px 10px auto !important; width: 26% !important; height: auto !important; aspect-ratio: 1; box-shadow: none; }
.op-editbtn { position: absolute; right: 10px; bottom: 10px; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; padding: 8px 12px; font-weight: 700; cursor: pointer; box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }
.op-stage__info { padding: 10px 6px 4px; }
.op-stage__info b { color: var(--accent); font-size: 18px; margin-right: 4px; }
.op-stage__info span { font-weight: 700; }
.op-stage__info p { margin: 2px 0 0; color: var(--dim); font-size: 14px; }
.op-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; }
.op-strip button { flex: 0 0 104px; scroll-snap-align: start; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.op-strip .n { font-size: 11px; color: var(--dim); }
.op-strip .t { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: var(--card-2); }
.op-strip .t img { width: 100%; height: 100%; object-fit: cover; display: block; }
.op-strip .t em { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 11px; background: rgba(0, 0, 0, .45); }
.op-strip .on .t { border-color: var(--accent); }
.op-strip .on .n { color: var(--accent); }
.op-strip .done .t em { display: none; }
.op-nav { display: flex; align-items: center; justify-content: space-between; color: var(--dim); font-size: 13px; }

/* modals */
.op-modal { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .7); display: grid; place-items: center; padding: 16px; }
.op-modal__box { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; width: min(100%, 460px); max-height: 92vh; overflow: auto; position: relative; display: grid; gap: 12px; }
.op-modal__box--wide { width: min(100%, 760px); }
.op-modal__head { display: flex; justify-content: space-between; align-items: center; }
.op-x { background: none; border: 0; font-size: 24px; cursor: pointer; line-height: 1; }
.op-scenegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.op-scenegrid button { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.op-scenegrid .t { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; border: 2px solid transparent; }
.op-scenegrid .t img { width: 100%; height: 100%; object-fit: cover; display: block; }
.op-scenegrid .t em { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 12px; background: rgba(0, 0, 0, .45); }
.op-scenegrid .done .t em { display: none; }
.op-scenegrid .on .t { border-color: var(--accent); }
.op-scenegrid small { color: var(--dim); font-size: 12px; }

.op-editor { background: #000; border-radius: 10px; display: grid; place-items: center; padding: 10px; touch-action: none; }
.op-editor canvas { max-width: 100%; max-height: 46vh; cursor: grab; border-radius: 4px; }
.op-tools8 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.op-tools8 button { background: none; border: 0; display: grid; justify-items: center; gap: 4px; font-size: 12px; color: var(--dim); cursor: pointer; }
.op-tools8 button span { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 16px; color: var(--text); }
.op-zoom { display: flex; align-items: center; gap: 10px; }
.op-zoom input { flex: 1; accent-color: var(--accent); }
.op-sub-pop { background: var(--card-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.op-sub-pop button { border: 1px solid var(--line-2); background: var(--card); border-radius: 10px; padding: 10px; cursor: pointer; }
.op-sub-pop button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* step 4 */
.op-video { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.op-video video, .op-video canvas { width: 100%; height: 100%; object-fit: contain; display: block; }
.op-video__empty { position: absolute; inset: 0; }
.op-video__empty img { width: 100%; height: 100%; object-fit: cover; opacity: .45; }
.op-video__empty span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; }
.op-sumrow { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.op-sumrow:last-child { border-bottom: 0; }
.op-sumrow span:last-child { color: var(--dim); text-align: right; }
.op-sumrow.warn span:last-child { color: var(--warn); }

/* step 2: 사진 종류별로 넣기 */
.op-total .op-count { padding-bottom: 10px; margin-bottom: 10px; }
.op-progress--fill { margin: 0 0 14px; height: 6px; }
.op-progress--fill i { width: 0; }
.op-cats { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.op-cats button { flex: 0 0 auto; border: 1px solid var(--line-2); background: var(--card-2); border-radius: 99px; padding: 6px 12px; font-size: 12px; cursor: pointer; color: var(--dim); }
.op-cats button b { color: var(--text); font-weight: 500; margin-left: 2px; }
.op-cats button.full { border-color: rgba(143, 209, 158, .5); }
.op-cats button.full b { color: var(--ok); }
.op-cats button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.op-cats button.on b { color: var(--accent-ink); }
.op-cat__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.op-cat__no { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: 1px; }
.op-cat__count { font-size: 13px; color: var(--dim); }
.op-catcard .op-h2 { font-size: 21px; }
.op-cat__preview { margin: 14px -6px 14px; }
.op-cat__preview .op-stage { border: 1px solid var(--line); }
.op-cat__cap { margin: 8px 6px 0; font-size: 14px; color: var(--dim); }
.op-cat__cap b { color: var(--accent); margin-right: 2px; }
.op-cat__cap span { display: block; font-size: 12px; }
.op-navbtn { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; font-size: 22px; line-height: 34px; padding: 0; cursor: pointer; z-index: 2; }
.op-navbtn--prev { left: 8px; }
.op-navbtn--next { right: 8px; }
.op-slot .crop { position: absolute; inset: 0; background-repeat: no-repeat; opacity: .45; filter: grayscale(.2); }
.op-slot .plus { position: relative; text-shadow: 0 1px 6px rgba(0, 0, 0, .8); }
.op-slot .lbl, .op-slot .ori { z-index: 1; text-shadow: 0 1px 4px rgba(0, 0, 0, .9); }
.op-slot.focus { box-shadow: 0 0 0 2px var(--accent); border-color: var(--accent); }
.op-slot.over, .op-catcard.over { box-shadow: 0 0 0 3px var(--accent); }
.op-slot.has { cursor: grab; }
.op-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; margin-bottom: 12px; }
.op-slots.named { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.op-slot { position: relative; aspect-ratio: 1; border-radius: 12px; border: 1.5px dashed var(--line-2); background: var(--card-2); display: grid; place-items: center; cursor: pointer; overflow: hidden; }
.op-slot:hover { border-color: var(--accent); }
.op-slot.has { border-style: solid; border-color: transparent; }
.op-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.op-slot .plus { font-size: 26px; color: var(--accent); line-height: 1; }
.op-slots.named .op-slot .plus { font-size: 34px; }
.op-slot .lbl { position: absolute; left: 6px; top: 6px; font-size: 11px; font-weight: 700; color: var(--dim); }
.op-slots.named .op-slot .lbl { left: 0; right: 0; top: auto; bottom: 10px; text-align: center; font-size: 14px; color: var(--text); }
.op-slot.has .lbl { background: rgba(0, 0, 0, .6); color: #fff; border-radius: 6px; padding: 1px 6px; }
.op-slots.named .op-slot.has .lbl { left: 50%; right: auto; transform: translateX(-50%); }
.op-slot .ori { position: absolute; right: 6px; bottom: 6px; font-size: 10px; color: var(--dim); }
.op-slots.named .op-slot .ori { display: none; }
.op-slot .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .7); color: #fff; font-size: 13px; line-height: 22px; padding: 0; cursor: pointer; z-index: 1; }
.op-cat__tip { margin: 10px 0 0; }
.op-cat__nav { margin-top: 14px; }

/* intro */
.op-hero { text-align: center; padding: 34px 8px 18px; }
.op-hero__eyebrow { font-family: "Cormorant Garamond", serif; letter-spacing: 5px; color: var(--accent); font-size: 15px; margin: 0 0 10px; }
.op-hero__title { font-size: 30px; line-height: 1.3; margin: 0 0 14px; font-weight: 700; }
.op-hero__title span { font-size: 22px; font-weight: 500; color: var(--dim); }
.op-hero__lead { color: var(--dim); margin: 0 0 16px; font-size: 15px; }
.op-hero__lead b { color: var(--text); }
.op-hero__badge { display: inline-block; border: 1px solid var(--accent); color: var(--accent); border-radius: 99px; padding: 4px 14px; font-size: 13px; font-weight: 700; }
.op-text { color: var(--dim); margin: 6px 0 0; font-size: 14px; }
.op-text b { color: var(--text); }
.op-flow { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 8px; color: var(--dim); font-size: 14px; }
.op-flow b { color: var(--text); }
.op-flow small { display: block; color: var(--accent); font-size: 12px; }
.op-prep { list-style: none; margin: 10px 0 12px; padding: 0; display: grid; gap: 6px; }
.op-prep li { display: flex; justify-content: space-between; gap: 10px; background: var(--card-2); border-radius: 10px; padding: 9px 12px; font-size: 14px; }
.op-prep li span { color: var(--dim); }
.op-prep li b { color: var(--accent); white-space: nowrap; }
.op-prep li small { display: block; margin-top: 2px; font-size: 12px; color: var(--dim); opacity: .8; }
.op-notice { background: rgba(232, 201, 160, 0.07); border-color: rgba(232, 201, 160, 0.3); }
.op-notice ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; color: var(--dim); }
.op-notice b { color: var(--text); }
.op-start { margin-top: 4px; padding: 16px; font-size: 16px; }
.op-link { color: var(--accent); }

.op-done { text-align: center; }
.op-steps-list { text-align: left; color: var(--dim); padding-left: 20px; margin: 18px 0; display: grid; gap: 6px; }
.op-steps-list b { color: var(--text); }
.op-done .op-btn { margin-top: 8px; }

.op-busy { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .78); display: grid; place-items: center; text-align: center; padding: 24px; }
.op-busy > div { width: min(100%, 320px); }
.op-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--accent); margin: 0 auto 12px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.op-toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70; background: var(--text); color: #111; padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: min(92vw, 520px); text-align: center; white-space: pre-line; }

@media (max-width: 520px) {
  .op-row3 { grid-template-columns: 1fr; }
  .op-card { padding: 16px; }
  .op-thumbs { grid-template-columns: repeat(4, 1fr); }
  .op-editbtn { padding: 5px 9px; font-size: 12px; right: 6px; bottom: 6px; }
}

#catSpot { transition: none; }

#catSpotLabel, #spotLabel { white-space: nowrap; font-size: 11px; padding: 1px 6px; }

/* editor: scene preview */
.op-edscene { margin: 0 0 4px; }
.op-edscene .op-stage { border: 1px solid var(--line); }
#edSpot { transition: none; }
#edSpot.nobox { width: 30% !important; }
.op-editor canvas { max-height: 34vh; }
.op-cat__actions { display: grid; grid-template-columns: 2fr 2fr 1fr; gap: 6px; margin: 10px 6px 0; }
.op-cat__actions .op-btn { padding: 10px 8px; font-size: 14px; }
@media (max-width: 520px) {
  .op-editor canvas { max-height: 24vh; }
  .op-editor { padding: 6px; }
  .op-tools8 { gap: 4px; }
  .op-tools8 button span { width: 34px; height: 34px; font-size: 14px; }
  .op-modal__box { gap: 8px; padding: 12px; }
}

/* usability: counters, warnings, saved mark, composite grid */
.op-inwrap { position: relative; min-width: 0; }
.op-inwrap .op-input { padding-right: 46px; }
.op-cnt { position: absolute; right: 10px; bottom: 12px; font-size: 11px; color: var(--dim); pointer-events: none; }
.op-cnt.full { color: var(--warn); }
.op-warn { display: block; margin-top: 4px; font-style: normal; font-size: 12px; color: var(--warn); }
.op-edwarn { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 0; font-size: 13px; font-weight: 600; color: #ff6b5e; }
.op-edwarn[hidden] { display: none; }
.op-edwarn.ok { color: var(--dim); font-weight: 500; }
.op-edwarn.ok button { background: transparent; border: 1px solid var(--line); color: inherit; }
.op-edwarn button { border: 0; border-radius: 99px; padding: 6px 14px; background: #ff6b5e; color: #fff; font: inherit; cursor: pointer; }
.op-slot .warn { position: absolute; left: 6px; bottom: 6px; z-index: 1; background: rgba(0, 0, 0, .7); color: var(--warn); border-radius: 6px; padding: 0 5px; font-size: 13px; }
.op-saved { font-size: 11px; color: var(--ok); opacity: 0; transition: opacity .4s; margin-left: auto; }
.op-saved.on { opacity: 1; }
.op-saved + .op-step__count { margin-left: 8px; }
.op-scenegrid .t .ph { position: absolute; background-size: cover; background-position: center; outline: 1.5px solid var(--accent); border-radius: 2px; }
.op-scenegrid .t i { position: absolute; left: 4px; top: 4px; font-style: normal; background: rgba(0, 0, 0, .7); color: var(--warn); border-radius: 6px; padding: 0 5px; font-size: 12px; }
.op-gridall { margin-top: 12px; }
.op-linkbtn { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font-size: inherit; }

/* live text preview (same fonts as the video) */
.op-over { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.op-livecard { position: sticky; top: calc(var(--toph, 104px) + 6px); z-index: 6; padding: 10px; }
.op-livecard .op-mini { margin: 8px 2px 0; }
.op-livetabs { display: flex; gap: 6px; overflow-x: auto; margin-top: 8px; scrollbar-width: none; }
.op-livetabs::-webkit-scrollbar { display: none; }
.op-livetabs button { flex: none; border: 1px solid var(--line); background: transparent; color: var(--dim); border-radius: 999px; padding: 5px 11px; font-size: 13px; cursor: pointer; }
.op-livetabs button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
[data-step="1"] .op-input { scroll-margin-top: calc(var(--toph, 104px) + var(--liveh, 300px) + 20px); }
@media (max-width: 600px) { .op-livecard { padding: 6px; } .op-livecard .op-mini { display: none; } .op-livetabs { margin-top: 6px; } .op-livetabs button { padding: 4px 9px; font-size: 12px; } }

/* exact preview draws everything; the old focus box is not needed */
.op-stage .op-spot { display: none !important; }

/* saved time stays visible; brief highlight on each save */
.op-saved.on { opacity: .85; }
.op-saved.flash { opacity: 1; color: var(--accent); }

/* scene captions: edit, align, drag */
.op-stage .op-over.has-caps { pointer-events: auto; touch-action: none; }
.op-stage .op-over.dragging { cursor: grabbing; }
.op-caps { margin-top: 12px; display: grid; gap: 10px; }
.op-caps__head { margin: 0; font-weight: 700; font-size: 14px; }
.op-caps__head small { display: block; font-weight: 400; color: var(--dim); font-size: 12px; margin-top: 2px; }
.op-cap { border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: grid; gap: 6px; }
.op-cap.active { border-color: var(--accent); }
.op-cap textarea { resize: vertical; min-height: 40px; font-size: 14px; }
.op-cap__tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.op-cap__seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.op-cap__seg button { border: 0; background: transparent; color: var(--dim); padding: 5px 9px; font-size: 12px; cursor: pointer; }
.op-cap__seg button + button { border-left: 1px solid var(--line); }
.op-cap__seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; }

/* sample video + exact scene thumbnails */
.op-sample { margin: 12px 0; }
.op-sample video { width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; background: #000; display: block; }
.op-scenegrid .t canvas { width: 100%; height: 100%; display: block; background: #1a1a1a; }
.op-scenegrid .t canvas:not(.ready) { background: linear-gradient(90deg, #1a1a1a, #262626, #1a1a1a); }
#svStage { margin-top: 8px; }
#svStage .op-over { position: absolute; inset: 0; }
#sceneModal { z-index: 60; }

/* 첫 화면 샘플 영상: 가운데 큰 재생 버튼 (처음 재생 전까지) */
.op-sample { position: relative; }
.op-sample__play { position: absolute; left: 0; right: 0; top: 0; aspect-ratio: 16 / 9; width: 100%; border: 0; border-radius: 10px; background: rgba(0,0,0,.18); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.op-sample__play[hidden] { display: none; }
.op-sample__play span { width: 72px; height: 72px; border-radius: 50%; background: rgba(0,0,0,.6); box-shadow: 0 0 0 2px rgba(255,255,255,.85); position: relative; transition: transform .15s; }
.op-sample__play span::after { content: ''; position: absolute; left: 29px; top: 22px; border-left: 22px solid #fff; border-top: 14px solid transparent; border-bottom: 14px solid transparent; }
.op-sample__play:hover span { transform: scale(1.06); }

/* 장면 아래 정보 글자 칸 (이름·날짜·소개) */
.op-cap__title { font-size: 13px; }
.op-capfs { display: grid; gap: 6px; }
.op-capfs.multi { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.op-capf { display: grid; gap: 3px; font-size: 12px; color: var(--dim); }
.op-capf b { color: var(--accent); }
.op-capf .op-input { font-size: 14px; padding: 8px 10px; }
.op-cap--info { background: rgba(255,255,255,.02); }
.op-sumrow[data-ask] .op-linkbtn { margin-left: 6px; }
.op-cap__lbl { font-size: 11px; color: var(--dim); margin-right: -2px; }
.op-basic { margin: 10px 0 0; font-size: 13px; color: var(--dim); }
.op-basic b { color: var(--text, #fff); font-weight: 700; }
.op-endcard { margin-top: 14px; display: grid; gap: 8px; }

/* 결혼식 시간: 오전/오후 버튼 + 시 + 분 */
.op-time { display: grid; grid-template-columns: auto 1fr 1fr; gap: 6px; min-width: 0; }
.op-ampm { border: 1px solid var(--accent); background: transparent; color: var(--accent); border-radius: 10px; padding: 0 12px; font-weight: 700; font-size: 14px; cursor: pointer; }
.op-ampm:active { background: var(--accent); color: var(--accent-ink); }
.op-time select { padding-left: 8px; padding-right: 4px; min-width: 0; }

.op-vidscene { margin-top: 12px; display: grid; gap: 8px; }
.op-tipline { display: block; font-style: normal; font-size: 12px; color: var(--accent); margin-top: 4px; }

.op-catvideo { margin-top: 12px; display: grid; gap: 8px; }
.op-vidraw summary { cursor: pointer; font-size: 13px; color: var(--dim); }
.op-vidraw .op-video { margin-top: 8px; }

/* 휴대폰: 위쪽 단계 표시줄이 한 줄로 */
.op-step__badge, .op-step__name, .op-saved, .op-step__count { white-space: nowrap; }
.op-step__name { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 600px) {
  .op-steps { gap: 6px; }
  .op-step__badge { font-size: 10px; padding: 3px 8px; }
  .op-step__name { font-size: 15px; }
  .op-top__title { font-size: 12px; }
}
.op-label small { font-weight: 400; color: var(--dim); font-size: 12px; margin-left: 4px; }
.op-time select { font-size: 16px; }
.op-cap__grp { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
#editorCanvas { touch-action: none; }
.op-bottom .op-btn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* 휴대폰(큰 글자 설정 포함): 위쪽 줄과 아래 버튼이 두 줄로 깨지지 않게 */
.op-basic span { white-space: nowrap; }
@media (max-width: 520px) {
  .op-top__title { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .op-step__count { display: none; }
  .op-saved { margin-left: auto; font-size: 11px; }
  .op-step__name { font-size: 15px; flex: 1 1 auto; }
  .op-bottom .op-btn { font-size: 15px; padding-left: 8px; padding-right: 8px; }
  .op-cats button { white-space: nowrap; }
}
.op-note1 { white-space: nowrap; }
.op-dim { color: var(--dim); }
@media (max-width: 520px) { .op-catcard .op-h2 { font-size: 19px; } }
.op-capf .op-inwrap .op-input { padding-right: 52px; text-overflow: ellipsis; }

/* 커플 영상: 장면 안 재생 + 플레이바 */
.op-stage .op-live { pointer-events: none; }
.op-player { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 8px 10px; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; }
.op-player[hidden] { display: none; }
.op-player__btn { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 15px; font-weight: 700; cursor: pointer; }
.op-player input[type=range] { flex: 1; min-width: 0; accent-color: var(--accent); height: 28px; }
.op-player__time { flex: none; font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 커플 영상 플레이어: 미리보기 위에 겹쳐서 (가운데 ▶, 아래 재생 막대) */
.op-vctrl { position: absolute; inset: 0; pointer-events: none; }
.op-vctrl[hidden] { display: none; }
.op-vctrl__big { pointer-events: auto; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 60px; height: 60px; border-radius: 50%; border: 2px solid rgba(255,255,255,.9); background: rgba(0,0,0,.55); cursor: pointer; }
.op-vctrl__big[hidden] { display: none; }
.op-vctrl__big::after { content: ''; position: absolute; left: 24px; top: 18px; border-left: 18px solid #fff; border-top: 11px solid transparent; border-bottom: 11px solid transparent; }
.op-vctrl__bar { pointer-events: auto; position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 18px 10px 6px; background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.op-vctrl__btn { flex: none; width: 30px; height: 30px; border: 0; background: transparent; color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; }
.op-vctrl__bar input[type=range] { flex: 1; min-width: 0; accent-color: #fff; height: 22px; }
.op-vctrl__time { flex: none; font-size: 11px; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 미리보기 조작 안내 */
.op-hints { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.op-hints span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 12px; color: var(--dim); background: var(--card-2); border: 1px solid var(--line); border-radius: 99px; padding: 3px 9px; }
.op-hints i { font-style: normal; }
.op-coach { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.62); z-index: 3; pointer-events: none; animation: opCoach .3s ease; }
.op-coach[hidden] { display: none; }
.op-coach > div { display: grid; gap: 4px; text-align: left; color: #fff; font-size: 13px; padding: 10px 14px; }
.op-coach b { font-size: 14px; margin-bottom: 2px; color: var(--accent); }
.op-coach small { color: rgba(255,255,255,.6); font-size: 11px; margin-top: 2px; }
@keyframes opCoach { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 420px) { .op-coach > div { font-size: 12px; gap: 2px; } }
.op-coach { background: rgba(0,0,0,.86); z-index: 6; }
.op-coach > div { background: rgba(20,20,20,.9); border: 1px solid var(--line-2); border-radius: 12px; }
@media (max-width: 360px) { .op-coach > div { font-size: 10.5px; line-height: 1.35; gap: 1px; padding: 6px 10px; } .op-coach b { font-size: 12px; } }

/* 미리보기 구석 크기 버튼 */
.op-zoombtns { position: absolute; right: 8px; top: 8px; z-index: 4; display: flex; gap: 4px; }
.op-zoombtns[hidden] { display: none; }
.op-zoombtns button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid rgba(255,255,255,.5); background: rgba(0,0,0,.6); color: #fff; font-size: 18px; font-weight: 700; line-height: 1; cursor: pointer; }
.op-zoombtns button:active { background: var(--accent); color: var(--accent-ink); }
.op-zoombtns button[data-c] { width: auto; padding: 0 9px; font-size: 13px; }
@media (max-width: 340px) { .op-zoombtns button[data-c] { padding: 0 5px; font-size: 11px; } }
.op-zoombtns button { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }

/* 마지막 확인: 여러 장면에 나오는 사진 · 같은 사진을 여러 자리에 */
.op-multi { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.op-multi__h { margin: 0; font-weight: 700; font-size: 14px; }
.op-multi__h small { display: block; font-weight: 400; color: var(--dim); font-size: 12px; margin-top: 2px; }
.op-multi__row { display: grid; gap: 8px; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.op-multi__t { display: flex; align-items: center; gap: 8px; font-size: 13px; flex-wrap: wrap; }
.op-multi__t img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.op-multi__t .op-linkbtn { margin-left: auto; }
.op-multi__scenes { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.op-multi__scenes button { border: 1px solid var(--line); background: #000; border-radius: 8px; padding: 0 0 6px; cursor: pointer; color: var(--dim); overflow: hidden; }
.op-multi__scenes canvas { width: 100%; aspect-ratio: 16 / 9; display: block; background: #111; }
.op-multi__scenes small { display: block; font-size: 11px; margin-top: 4px; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-multi__chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* 같은 사진이 나오는 다른 장면 (작은 미리보기) */
.op-other { margin-top: 10px; display: grid; gap: 6px; }
.op-other[hidden] { display: none; }
.op-other__h { margin: 0; font-size: 13px; font-weight: 700; color: var(--accent); }
.op-other__h small { display: block; font-weight: 400; color: var(--dim); font-size: 12px; margin-top: 2px; }
.op-other__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.op-other__list button { border: 1px solid var(--line); background: #000; border-radius: 8px; padding: 0 0 5px; cursor: pointer; color: var(--dim); overflow: hidden; }
.op-other__list canvas { width: 100%; aspect-ratio: 16 / 9; display: block; }
.op-other__list small { display: block; font-size: 11px; margin-top: 4px; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

#catStage.over { outline: 3px solid var(--accent); outline-offset: 2px; }

.op-savebtn { flex: none; border: 1px solid var(--line-2); background: transparent; color: var(--text); border-radius: 99px; padding: 3px 10px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.op-savebtn:active { background: var(--accent); color: var(--accent-ink); }

/* 다른 장면에도 나오는 사진: 미리보기 위 표시 + 조정 중 띄우는 작은 화면 */
.op-linkpill { position: absolute; left: 8px; top: 8px; z-index: 4; border: 1px solid var(--accent); background: rgba(0,0,0,.72); color: var(--accent); border-radius: 99px; padding: 4px 10px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.op-linkpill[hidden] { display: none; }
/* 폰 화면: 오른쪽 위 가운데맞춤·－·＋ 버튼과 겹치지 않게 한 줄 아래로 */
@media (max-width: 480px) { .op-linkpill { top: 46px; } .op-pip { top: 78px; } }
.op-pip { position: absolute; left: 8px; top: 40px; z-index: 5; pointer-events: none; background: rgba(0,0,0,.82); border: 1px solid var(--accent); border-radius: 10px; padding: 6px 8px 8px; max-width: calc(100% - 16px); animation: opCoach .2s ease; }
.op-pip[hidden] { display: none; }
.op-pip p { margin: 0 0 5px; font-size: 12px; font-weight: 700; color: var(--accent); }
.op-pip__list { display: flex; gap: 6px; }
.op-pip__list span { display: grid; gap: 2px; min-width: 0; }
.op-pip__list canvas { width: min(150px, 26vw); aspect-ratio: 16 / 9; border-radius: 4px; background: #111; display: block; }
.op-pip__list small { font-size: 10px; color: #ddd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: min(150px, 26vw); }
/* 커플 영상 여러 개 · 자르기 */
.op-btn.off { opacity: .5; }
.op-clipmode { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.op-clipmode[hidden] { display: none; }
.op-clipmode button { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card-2); color: var(--text); cursor: pointer; }
.op-clipmode button small { color: var(--dim); font-size: 12px; }
.op-clipmode button.on { border-color: var(--accent); background: rgba(232, 201, 160, .12); }
.op-clipmode button.on b { color: var(--accent); }
.op-clips { display: grid; gap: 8px; }
.op-clips:empty { display: none; }
.op-clip { border: 1px solid var(--line-2); border-radius: 12px; padding: 10px; background: var(--card-2); cursor: pointer; }
.op-clip.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.op-clip__top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.op-clip__top img, .op-clip__noimg { flex: none; width: 64px; height: 36px; object-fit: cover; border-radius: 6px; background: #000; display: grid; place-items: center; color: var(--dim); font-size: 12px; }
.op-clip__name { flex: 1; min-width: 0; display: grid; }
.op-clip__name small { color: var(--dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-clip__btns { flex: none; display: flex; gap: 4px; }
.op-clip__btns button { border: 1px solid var(--line-2); background: transparent; color: var(--text); border-radius: 8px; padding: 6px 8px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.op-clip__btns button:disabled { opacity: .3; cursor: default; }
.op-trim { position: relative; height: 30px; margin: 8px 4px 0; }
.op-trim::before { content: ''; position: absolute; left: 0; right: 0; top: 13px; height: 4px; border-radius: 2px; background: var(--line-2); }
.op-trim__fill { position: absolute; top: 13px; height: 4px; border-radius: 2px; background: var(--accent); }
.op-trim input { position: absolute; left: 0; top: 0; width: 100%; height: 30px; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.op-trim input::-webkit-slider-runnable-track { background: none; border: 0; }
.op-trim input::-moz-range-track { background: none; border: 0; }
.op-trim input::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); cursor: ew-resize; }
.op-trim input::-moz-range-thumb { pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); cursor: ew-resize; }
.op-trim__txt { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.op-trim__txt b { color: var(--text); font-weight: 600; }
@media (max-width: 520px) { .op-clip__top img, .op-clip__noimg { width: 48px; height: 27px; } .op-clip__btns button { padding: 6px; } .op-clipmode button small { display: none; } }
.op-trim__fill { top: 11px; height: 8px; border-radius: 4px; background: repeating-linear-gradient(135deg, rgba(242, 181, 107, .7) 0 3px, transparent 3px 7px); }
.op-trim__use { position: absolute; top: 11px; height: 8px; border-radius: 4px; background: var(--accent); box-shadow: 0 0 0 1px rgba(0,0,0,.4); }
.op-trim__txt b.no { color: var(--warn); }
.op-trim__txt { flex-wrap: wrap; gap: 2px 10px; }

/* 영상 스타일 고르기 (넷플릭스형 · 슬라이드형) — opening.html · slide.html 같이 씀 */
.op-top__inner { gap: 10px; }
.op-logo { flex: none; }
.op-top__title { min-width: 0; margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-top__alt { flex: none; font-size: 12px; color: var(--accent); border: 1px solid rgba(232, 201, 160, .5); border-radius: 99px; padding: 3px 10px; text-decoration: none; white-space: nowrap; }
.op-top__alt:hover { border-color: var(--accent); }
.op-styles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.op-style { position: relative; display: grid; gap: 0; align-content: start; background: var(--card-2); border: 1.5px solid var(--line-2); border-radius: 12px; overflow: hidden; color: var(--text); text-decoration: none; }
.op-style:hover { border-color: var(--text); }
.op-style.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.op-style__img { position: relative; display: block; aspect-ratio: 16 / 9; background: #000 linear-gradient(135deg, #1a1a1a, #262626); overflow: hidden; }
.op-style__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.op-style__body { display: grid; gap: 2px; padding: 10px 12px 12px; }
.op-style__body b { font-size: 16px; }
.op-style__body small { color: var(--dim); font-size: 12px; line-height: 1.45; }
.op-style__tag { justify-self: start; margin-top: 6px; font-style: normal; font-size: 12px; font-weight: 700; border-radius: 99px; padding: 2px 10px; border: 1px solid var(--line-2); color: var(--text); }
.op-style.on .op-style__tag { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
#aboutCard { scroll-margin-top: 112px; }
@media (max-width: 520px) {
  .op-styles { grid-template-columns: 1fr; gap: 8px; }
  .op-style { grid-template-columns: 128px minmax(0, 1fr); align-items: center; }
  .op-style__img { align-self: stretch; height: auto; aspect-ratio: auto; min-height: 76px; }
  .op-style__body { padding: 10px 12px; }
  .op-top__alt { padding: 3px 8px; font-size: 11px; }
  .op-hide-m { display: none; }
}
