:root {
  --bg: #f4f6f8; --card: #fff; --ink: #1c2530; --muted: #6b7785; --line: #dde3ea;
  --accent: #1d9e75; --accent-ink: #fff; --warn: #c0392b;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 -apple-system, "Pretendard", "Noto Sans KR", "Segoe UI", sans-serif; }
header { background: var(--card); border-bottom: 1px solid var(--line); padding: 6px 24px 0; position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 16px; }
.brand { font-weight: 600; font-size: 15px; color: var(--muted); padding-bottom: 6px; white-space: nowrap; }
.crumb { font-size: 15px; margin: 0; padding-bottom: 6px; flex: 1; display: flex; align-items: baseline; min-width: 0; }
.crumb b { margin-left: 8px; color: var(--accent); }
.pid { margin-left: auto; font-size: 11px; color: var(--muted); }
.bar { height: 3px; background: var(--line); margin: 0 -24px; flex: 0 0 calc(100% + 48px); }
.bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
main { max-width: 1180px; margin: 0 auto; padding: 20px 24px 90px; }
main.narrow { max-width: 680px; }
/* intro teaser figure: wider than the 680px text column (its labels are small), centred on the page */
.teaser { display: block; position: relative; left: 50%; transform: translateX(-50%); width: min(1000px, calc(100vw - 32px));
  margin: 8px 0 22px; padding: 10px; background: #fff; border: 1px solid #e3e6ea; border-radius: 12px; box-sizing: border-box; }
.teaser img { display: block; width: 100%; height: auto; }
h2 { font-size: 20px; margin: 4px 0 6px; }
h3 { font-size: 14px; margin: 0 0 10px; }
.muted { color: var(--muted); font-weight: 400; font-size: 13px; }
.warn { color: var(--warn); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.grid { display: grid; gap: 14px; margin-top: 14px; }
.grid.t1 { grid-template-columns: minmax(260px, 1fr) 2fr; }
.grid.t2.withside { grid-template-columns: minmax(240px, 360px) 1fr; }
@media (max-width: 860px) { .grid.t1, .grid.t2.withside { grid-template-columns: minmax(0, 1fr); } }
.grid > * { min-width: 0; }
/* every clip: keep only the centre 50 % of the width (left/right 25 % cropped), shown at full box width */
.v video { width: 100%; aspect-ratio: 8 / 9; object-fit: cover; object-position: center; background: #0b0f14; border-radius: 8px; display: block; }
.target { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: #e7f6f0; display: flex; gap: 10px; align-items: center; }
.target span { font-size: 12px; color: var(--muted); }
.target b { color: #0f6e56; }
.ab { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt { position: relative; border: 2px solid var(--line); border-radius: 10px; padding: 8px; cursor: pointer; display: block; }
.opt.on { border-color: var(--accent); background: #effaf5; }
.opt .tag, .cand .tag { position: absolute; top: 14px; left: 14px; z-index: 2; background: rgba(0,0,0,.7); color: #fff; border-radius: 6px; padding: 1px 8px; font-weight: 600; }
.pick { text-align: center; padding: 8px 0 2px; color: var(--muted); }
.opt.on .pick { color: var(--accent); font-weight: 600; }
.vbar { display: flex; gap: 8px; margin-top: 10px; align-items: center; flex-wrap: wrap; }
.vbar input[type=range] { flex: 1 1 200px; min-width: 140px; accent-color: var(--accent); cursor: pointer; }
.pool, .drop { display: flex; flex-wrap: wrap; gap: 10px; min-height: 120px; border-radius: 10px; }
.pool { border: 2px dashed var(--line); padding: 8px; display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); align-content: start; }
.pool .cand { width: auto; grid-column: var(--col); grid-row: 1; }
.cand { position: relative; width: 210px; border: 2px solid var(--line); border-radius: 10px; padding: 6px; background: var(--card); cursor: grab; }
.cand.sel { border-color: var(--accent); box-shadow: 0 0 0 3px #1d9e7533; }
.slots { display: flex; align-items: stretch; gap: 8px; }
.slot { --c: var(--line); flex: 1 1 0; min-width: 0; border: 3px solid var(--c); border-radius: 10px; padding: 8px; background: #fafbfc; }
.slabel { font-size: 24px; font-weight: 800; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; line-height: 1.2; }
.dot { width: 18px; height: 18px; border-radius: 50%; background: var(--c); display: inline-block; }
.drop { border: 2px dashed var(--line); padding: 4px; justify-content: center; align-items: center; }
.drop .cand { width: 100%; }
.over { background: #e7f6f0; border-color: var(--accent); }
.ref-img img { width: 100%; height: auto; border-radius: 8px; background: #fff; }
/* no footer bar: only the prev/next buttons float bottom-right on a white card */
footer { position: fixed; bottom: 16px; right: 24px; z-index: 6; pointer-events: none; }
footer .navbox { pointer-events: auto; display: flex; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; box-shadow: 0 4px 16px rgba(16,24,40,.12); }
footer #savestate:empty { display: none; }
footer #savestate { padding: 0 6px; }
button { font: inherit; border-radius: 8px; padding: 8px 18px; cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button:disabled { opacity: .45; cursor: not-allowed; }
.unsure { display: block; margin-top: 10px; text-align: center; padding: 10px; border: 2px dashed var(--line); border-radius: 10px; cursor: pointer; }
.unsure.on { border-style: solid; border-color: #888; background: #f1f3f5; font-weight: 600; }
.unsure-box { display: block; margin: 4px 0 10px; color: var(--muted); }

/* task 2: property banner, order cue, reference image panel */
.propbanner { display: flex; align-items: baseline; gap: 14px; margin: 2px 0 2px; }
.pb-name { font-size: 36px; font-weight: 800; color: #0f6e56; letter-spacing: -.5px; }
.pb-task { font-size: 20px; font-weight: 600; color: var(--muted); }
.pb-sub { margin: 0 0 4px; }
.orderbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 20px; font-weight: 800; color: #0f6e56; }
.orderbar .line { flex: 1; height: 5px; border-radius: 3px; background: linear-gradient(90deg, #cfe9df, var(--accent)); position: relative; }
.orderbar .line::after { content: ""; position: absolute; right: -4px; top: -9px; border-left: 18px solid var(--accent); border-top: 11px solid transparent; border-bottom: 11px solid transparent; }
.sarrow { flex: 0 0 auto; align-self: center; font-size: 34px; line-height: 1; color: var(--accent); }
.ref-img h3 { font-size: 18px; font-weight: 800; }
.meshwrap { width: min(100%, calc(var(--ar) * 46vh)); margin: 0 auto; }
.meshwrap img { width: 100%; height: auto; display: block; border-radius: 0; background: #fff; }
.mcaps { position: relative; height: 56px; }
.mcaps span { position: absolute; top: 6px; transform: translateX(-50%); white-space: nowrap; font-size: 18px; font-weight: 800; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 6px 0; font-size: 17px; font-weight: 700; }
.legend i { display: inline-block; width: 16px; height: 16px; border-radius: 50%; margin-right: 6px; vertical-align: -2px; }
@media (min-width: 861px) { .ref-img { position: sticky; top: 64px; align-self: start; } }
@media (max-width: 600px) {
  .pool { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pool .cand { grid-column: var(--col2); grid-row: var(--row2); }
  .slots { flex-direction: column; }
  .sarrow { transform: rotate(90deg); }
  .pb-name { font-size: 30px; }
  .orderbar { font-size: 15px; gap: 8px; }
  .orderbar .line { min-width: 24px; }
  main { padding-left: 14px; padding-right: 14px; }
}

/* intro */
.props { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 16px; }
.props span { flex: 1 1 100px; text-align: center; padding: 12px 8px; border-radius: 10px; background: #e7f6f0; color: #0f6e56; font-size: 22px; font-weight: 800; }
.parts { padding-left: 22px; }
.parts li { margin-bottom: 12px; }
.thanks { margin-top: 18px; font-weight: 600; text-align: center; color: #0f6e56; }
/* empty slot reserves the size of a (cropped, portrait) clip so the page does not jump when a clip is dropped */
.slot .drop { aspect-ratio: 8 / 9.6; min-height: 0; }
.pb-sub b { color: var(--ink); }
/* clips fill the full width of their box: no inner padding around the video */
.opt, .cand { padding: 0; overflow: hidden; }
.opt .v video, .cand .v video { border-radius: 0; }
.opt .tag, .cand .tag { top: 8px; left: 8px; }
.pick { padding: 8px 0; }
.slot .drop { padding: 0; }
.pool { gap: 8px; padding: 6px; }
/* task 2: playback controls + "don't know" sit between the candidate clips and the slots */
.midbar { margin: 0 0 14px; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.midbar .vbar { flex: 1 1 360px; margin: 0; }
.midbar .unsure-box { margin: 0; white-space: nowrap; }
.slot.over { border-color: var(--c); background: #e7f6f0; box-shadow: 0 0 0 4px #1d9e7533; }
#slotsCard.is-hidden { visibility: hidden; pointer-events: none; }

/* per-task instruction page */
.taskintro h3 { font-size: 17px; margin: 18px 0 6px; color: #0f6e56; }
.taskintro ul { padding-left: 22px; margin: 4px 0 8px; }
.taskintro li { margin-bottom: 5px; }
.criteria { background: #e7f6f0; border-left: 5px solid var(--accent); border-radius: 8px; padding: 10px 14px; margin: 6px 0 10px; font-size: 16px; }
.introbtns { display: flex; gap: 10px; margin: 22px 0 40px; }

/* task 2 scale: height ruler beside the 1.25x object (a vertical dimension line, like measuring a person's height) */
.imgbox { position: relative; }
.ruler { position: absolute; width: 0; border-left: 2px solid #2b3440; }
.ruler::before, .ruler::after { content: ""; position: absolute; left: -7px; border-left: 6px solid transparent; border-right: 6px solid transparent; }
.ruler::before { top: -2px; border-bottom: 10px solid #2b3440; }
.ruler::after { bottom: -2px; border-top: 10px solid #2b3440; }
.ruler b { position: absolute; left: 3px; top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 17px; font-weight: 800; color: #2b3440; background: #fff; padding: 0 2px; }
.mcaps span { text-align: center; line-height: 1.15; }
.mcaps small { display: block; font-size: 14px; font-weight: 700; color: var(--muted); }
.imgbox.hasruler { margin-right: 88px; }
.imgbox.hasruler .ruler { left: calc(100% + 12px); }
.ruler b { font-size: 16px; }
.speed { display: inline-flex; gap: 4px; }
.speed button { padding: 6px 10px; }
.speed button.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }

/* finish screen */
.finish-hero { font-size: 64px; text-align: center; margin: 18px 0 0; line-height: 1.1; }
.finish-title { font-size: 28px; text-align: center; margin: 8px 0 12px; line-height: 1.35; }
.finish-title span { color: #0f6e56; font-size: 34px; font-weight: 900; display: inline-block; }
.finish-sub { text-align: center; font-size: 16px; }

.resumebox { display: flex; gap: 8px; margin: 4px 0 14px; }
.resumebox input { flex: 1; min-width: 0; font: 13px/1.4 ui-monospace, Menlo, Consolas, monospace; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
/* play/pause toggle keeps one width ("⏸ 일시정지" vs "▶ 재생") so the controls row never re-wraps */
.vbar button { white-space: nowrap; }
#vc-toggle { display: inline-grid; justify-items: center; }
#vc-toggle span { grid-area: 1 / 1; }  /* stacked: the button is as wide as the longer label */
#vc-toggle.paused .l-pause, #vc-toggle:not(.paused) .l-play { visibility: hidden; }
