/* ─────────────── 크롭 마크 ─────────────── */

.crops {
  position: absolute;
  inset: 0;
  pointer-events: none;
  --cm: 14px;
  --cw: 1.5px;
  --cg: 0px; /* 모서리와의 간격 */
}

.crops i {
  position: absolute;
  width: var(--cm);
  height: var(--cm);
  border: 0 solid currentColor;
  transition: transform var(--t-med) var(--ease-out), opacity var(--t-med);
}

.crops i:nth-child(1) {
  left: calc(var(--cg) * -1);
  top: calc(var(--cg) * -1);
  border-left-width: var(--cw);
  border-top-width: var(--cw);
}

.crops i:nth-child(2) {
  right: calc(var(--cg) * -1);
  top: calc(var(--cg) * -1);
  border-right-width: var(--cw);
  border-top-width: var(--cw);
}

.crops i:nth-child(3) {
  left: calc(var(--cg) * -1);
  bottom: calc(var(--cg) * -1);
  border-left-width: var(--cw);
  border-bottom-width: var(--cw);
}

.crops i:nth-child(4) {
  right: calc(var(--cg) * -1);
  bottom: calc(var(--cg) * -1);
  border-right-width: var(--cw);
  border-bottom-width: var(--cw);
}

/* ─────────────── 크롭 마크 커서 ─────────────── */

.frame-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 90;
  width: 0;
  height: 0;
  pointer-events: none;
  color: var(--fg);
  mix-blend-mode: difference;
  will-change: transform;
}

.frame-cursor .crops {
  --cm: 9px;
  --cw: 1.5px;
  color: #fff;
}

.frame-cursor.is-hidden {
  opacity: 0;
}

/* ─────────────── 버튼 ─────────────── */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  padding: 0 20px;
  border-radius: 3px;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: transform var(--t-fast) var(--ease-out), color var(--t-med), background-color var(--t-med),
    border-color var(--t-med), opacity var(--t-med);
}

.btn:active {
  transform: scale(0.965);
}

.btn--ink {
  background: var(--inverse-bg);
  color: var(--inverse-fg);
}

.btn--ink::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--fg-2);
  transform: translateY(101%);
  transition: transform var(--t-med) var(--ease-out);
}

.btn--ink:hover::before {
  transform: translateY(0);
}

.btn--line {
  border: 1.5px solid var(--fg);
  color: var(--fg);
}

.btn--line::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-med) var(--ease-out);
}

.btn--line:hover {
  color: var(--bg);
}

.btn--line:hover::before {
  transform: scaleX(1);
}

.btn--ghost {
  color: var(--fg-2);
  padding: 0 12px;
}

.btn--ghost:hover {
  color: var(--fg);
  background: color-mix(in srgb, var(--fg) 7%, transparent);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.38;
  cursor: not-allowed;
}

.btn[disabled]::before,
.btn[aria-disabled="true"]::before {
  display: none;
}

.btn--sm {
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
}

.btn .ico {
  width: 16px;
  height: 16px;
  flex: none;
}

/* ─────────────── 도장(판정) ─────────────── */

.stamp {
  --c: var(--fg);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 24px;
  padding: 0 8px;
  border: 1.5px solid var(--c);
  border-radius: 3px;
  outline: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  outline-offset: 2px;
  color: var(--c);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  white-space: nowrap;
  transform: rotate(var(--rot, -2deg));
}

.stamp[data-kind="fail"] {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.stamp[data-kind="warn"] {
  background: linear-gradient(90deg, transparent 50%, color-mix(in srgb, var(--fg) 14%, transparent) 50%);
}

.stamp[data-kind="human"] {
  border-style: dashed;
}

.stamp[data-kind="na"] {
  --c: var(--fg-4);
  outline-color: transparent;
}

/* 참고용 — 재기는 했지만 이 영상 유형에서는 지적으로 남기지 않는 항목 */
.stamp[data-kind="ref"] {
  --c: var(--fg-3);
  border-style: dashed;
  outline-color: transparent;
}

.stamp[data-kind="running"] {
  --c: var(--fg-2);
  outline-color: transparent;
  overflow: hidden;
}

.stamp[data-kind="running"]::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hatch);
  opacity: 0.35;
  animation: hatch-run 0.9s linear infinite;
}

.stamp[data-kind="todo"] {
  --c: var(--line-2);
  outline-color: transparent;
  color: var(--fg-4);
  font-weight: 650;
}

@keyframes hatch-run {
  to {
    background-position: 19.8px 0;
  }
}

.stamp.is-pressed {
  animation: press 520ms var(--ease-snap) both;
}

@keyframes press {
  0% {
    transform: scale(1.9) rotate(-9deg);
    opacity: 0;
    filter: blur(2px);
  }
  55% {
    transform: scale(0.94) rotate(var(--rot, -2deg));
    opacity: 1;
    filter: blur(0);
  }
  100% {
    transform: scale(1) rotate(var(--rot, -2deg));
  }
}

/* 정성 평가 3단계 */
.level {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--fg-2);
  white-space: nowrap;
}

.level__bars {
  display: inline-flex;
  gap: 2px;
}

.level__bars i {
  width: 7px;
  height: 14px;
  border: 1.5px solid var(--fg);
}

.level__bars i.on {
  background: var(--fg);
}

/* ─────────────── 중요도 모양 ─────────────── */

.sev {
  display: inline-block;
  flex: none;
  width: 11px;
  height: 11px;
  color: var(--fg);
}

.sev svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.sevs {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 650;
  color: var(--fg-2);
}

.sevs span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sevs .zero {
  color: var(--fg-4);
}

/* ─────────────── 선택 묶음(세그먼트) ─────────────── */

.seg {
  position: relative;
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  gap: 2px;
}

.seg button {
  position: relative;
  z-index: 1;
  height: 30px;
  padding: 0 12px;
  border-radius: 2px;
  font-size: 13px;
  font-weight: 650;
  color: var(--fg-3);
  white-space: nowrap;
  transition: color var(--t-med);
}

.seg button:hover {
  color: var(--fg);
}

.seg button[aria-pressed="true"] {
  color: var(--bg);
}

.seg__thumb {
  position: absolute;
  z-index: 0;
  top: 3px;
  bottom: 3px;
  border-radius: 2px;
  background: var(--fg);
  transition: transform 360ms var(--ease-snap), width 360ms var(--ease-snap);
}

/* 어두운 화면에서 흰 판은 너무 무겁다 — 한 단계 밝은 회색 판 위에 흰 글자 */
[data-theme="dark"] .seg__thumb {
  background: var(--room-rule-2);
}

[data-theme="dark"] .seg button[aria-pressed="true"] {
  color: var(--fg);
}

/* ─────────────── 체크박스 ─────────────── */

.tick {
  position: relative;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid var(--fg-3);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color var(--t-fast), background-color var(--t-fast), transform var(--t-fast) var(--ease-out);
}

.tick:hover {
  border-color: var(--fg);
}

.tick:active {
  transform: scale(0.88);
}

.tick:checked {
  background: var(--fg);
  border-color: var(--fg);
}

.tick::after {
  content: "";
  position: absolute;
  left: 5.5px;
  top: 1.5px;
  width: 5px;
  height: 10px;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 260ms var(--ease-snap);
}

.tick:checked::after {
  transform: rotate(45deg) scale(1);
}

/* ─────────────── 알림(슬레이트) ─────────────── */

.toasts {
  position: fixed;
  left: var(--rail);
  bottom: 24px;
  z-index: 95;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 260px;
  max-width: min(440px, calc(100vw - 32px));
  padding: 12px 16px 12px 0;
  background: var(--inverse-bg);
  color: var(--inverse-fg);
  font-size: 14px;
  font-weight: 600;
  border-radius: 3px;
  overflow: hidden;
  pointer-events: auto;
  animation: toast-in 420ms var(--ease-out) both;
}

.toast::before {
  content: "";
  align-self: stretch;
  width: 22px;
  margin: -12px 0;
  background: repeating-linear-gradient(-45deg, currentColor 0 4px, transparent 4px 8px);
  opacity: 0.85;
}

.toast .num {
  margin-left: auto;
  font-size: 12px;
  opacity: 0.6;
}

.toast.is-out {
  animation: toast-out 260ms var(--ease-io) both;
}

@keyframes toast-in {
  from {
    transform: translateY(14px);
    clip-path: inset(0 100% 0 0);
  }
  to {
    transform: none;
    clip-path: inset(0 0 0 0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ─────────────── 말풍선 ─────────────── */

[data-tip] {
  position: relative;
}

[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 20;
  width: max-content;
  max-width: 260px;
  padding: 8px 11px;
  border-radius: 3px;
  background: var(--inverse-bg);
  color: var(--inverse-fg);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.01em;
  white-space: normal;
  text-align: left;
  opacity: 0;
  transform: translate(-50%, 4px);
  pointer-events: none;
  transition: opacity var(--t-fast), transform var(--t-med) var(--ease-out);
}

[data-tip]:hover::after,
[data-tip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ─────────────── 줄무늬 영역 ─────────────── */

.hatch {
  background: var(--hatch);
}

/* ─────────────── 첫 접속 인트로 ─────────────── */

.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
}

.intro svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* 인트로 워드마크 — 녹화등(점)에서 글자가 양쪽으로 열린다 */
.intro__wm {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  color: var(--fg);
}

.intro__wm .wm__dot {
  animation: none;
  background: var(--rec);
}

.intro__seg {
  display: inline-block;
}

.intro__frame {
  position: absolute;
  left: 0;
  top: 0;
  color: var(--fg);
}

.intro__frame .crops {
  --cm: 18px;
  --cw: 2px;
}

.intro__ratio {
  position: absolute;
  right: 0;
  bottom: -26px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-3);
}

.intro__tc {
  position: absolute;
  right: var(--gutter);
  bottom: 22px;
  font-size: 14px;
  color: var(--fg-3);
}

.intro__skip {
  position: absolute;
  left: var(--gutter);
  bottom: 22px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fg-4);
}

/* 선 아이콘(ui/icons.js) — 글줄 안에서는 글자 가운데에 맞춘다 */
svg.gi {
  flex: none;
  display: inline-block;
  vertical-align: -0.2em;
}

/* 정보 행 */
.facts {
  display: flex;
  flex-wrap: wrap;
  column-gap: 18px;
  row-gap: 4px;
  font-size: 13px;
  color: var(--fg-3);
}

.facts > * {
  white-space: nowrap;
}

.facts b {
  font-weight: 650;
  color: var(--fg-2);
}

/* 빈 상태 */
.empty {
  padding: 48px 0;
  color: var(--fg-3);
  font-size: 15px;
}

/* ─────────────── 판독 표시(오버레이) ─────────────── */

.ov {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: #fff;
  container-type: inline-size;
}

.ov-box {
  position: absolute;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.ov-box.is-drawing {
  animation: ovdraw 520ms var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}

@keyframes ovdraw {
  from {
    clip-path: inset(0 100% 100% 0);
  }
  to {
    clip-path: inset(-40px -40px -40px -40px);
  }
}

/* 문제 영역 — 빗금은 상자 바깥 테두리에만 둘러 안쪽(자막·화면)이 그대로 보이게 */
.ov-box.is-bad {
  border-width: 2px;
}

.ov-box.is-bad::before {
  content: "";
  position: absolute;
  inset: -9px;
  padding: 7px;
  background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.62) 0 2px, transparent 2px 6px);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}

.ov-box.is-ok {
  border-style: dashed;
}

.ov-box--quiet {
  border-style: dashed;
  opacity: 0.7;
}

.ov-box__l {
  position: absolute;
  left: -1.5px;
  bottom: calc(100% + 4px);
  padding: 2px 6px 3px;
  background: #fff;
  color: #000;
  font-size: clamp(10px, 2.6cqw, 12.5px);
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.ov-box.lab-in .ov-box__l {
  bottom: auto;
  top: 4px;
  left: 4px;
}

.ov-box.is-bad .ov-box__l {
  background: #000;
  color: #fff;
  outline: 1px solid #fff;
}

.ov-box--probe .ov-box__l {
  font-family: var(--num);
  font-stretch: 80%;
  font-size: clamp(11px, 3cqw, 14px);
}

.ov-zone {
  position: absolute;
  background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.28) 0 1.5px, rgba(0, 0, 0, 0.18) 1.5px 8px);
  outline: 1px solid rgba(255, 255, 255, 0.4);
  outline-offset: -1px;
  animation: zonein 420ms var(--ease-out) both;
}

@keyframes zonein {
  from {
    opacity: 0;
  }
}

.ov-zone__l {
  position: absolute;
  left: 6px;
  top: 4px;
  font-size: clamp(9px, 2.3cqw, 11.5px);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}

.ov-safe {
  position: absolute;
  border: 1.5px dashed rgba(255, 255, 255, 0.85);
}

.ov-safe span {
  position: absolute;
  right: 6px;
  top: 4px;
  font-size: clamp(9px, 2cqw, 11.5px);
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.ov-safe + .ov-safe span {
  top: auto;
  bottom: 4px;
}

.ov-safe--crop {
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.45);
}

.ov-platform {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.62);
  font-size: clamp(11px, 3cqw, 14px);
  font-weight: 750;
  white-space: nowrap;
}

.ov-ui {
  position: absolute;
  display: block;
  background: rgba(255, 255, 255, 0.55);
}

.ov-ui--btn {
  width: 7.5cqw;
  height: 7.5cqw;
  max-width: 34px;
  max-height: 34px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.ov-ui--line {
  height: 1.3cqw;
  min-height: 5px;
  border-radius: 3px;
}

.ov-pair {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 38%;
  border: 1.5px solid #fff;
  background: #000;
  animation: pairin 520ms var(--ease-out) both;
}

.ov-pair img {
  width: 100%;
}

.ov-pair figcaption {
  position: absolute;
  left: 0;
  bottom: 100%;
  padding: 2px 6px;
  background: #fff;
  color: #000;
  font-size: 12px;
}

@keyframes pairin {
  from {
    clip-path: inset(0 0 100% 0);
    transform: translateY(8px);
  }
}

.ov-loupe {
  position: absolute;
  aspect-ratio: 1;
  border: 2px solid #fff;
  border-radius: 50%;
  overflow: hidden;
  background: #000;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  animation: loupein 560ms var(--ease-snap) both;
}

.ov-loupe img {
  position: absolute;
  max-width: none;
  height: auto;
}

.ov-loupe span {
  position: absolute;
  right: 18%;
  bottom: 10%;
  padding: 1px 5px;
  background: #fff;
  color: #000;
  font-size: 12px;
}

@keyframes loupein {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
}

.ov-swatches {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
}

.ov-sw {
  display: grid;
  gap: 2px;
}

.ov-sw i {
  height: 13cqw;
  max-height: 60px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  transform-origin: bottom;
}

.ov-sw b {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.ov-readout {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  justify-items: center;
  transform: translate(-50%, -50%);
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.7);
}

.ov-readout .num {
  font-size: clamp(30px, 10cqw, 56px);
  font-weight: 300;
  line-height: 1.05;
}

.ico {
  width: 16px;
  height: 16px;
  flex: none;
}

.mlab,
.cr__side span,
.judge__method {
  white-space: nowrap;
}

/* 검수에 쓴 AI 모델 표시 (실시간·결과 화면의 정보 행) */
.live__model,
.rv__model {
  font-family: var(--num);
  font-weight: 680;
  font-stretch: 92%;
  color: var(--fg);
}

/* ─────────────── 입력 양식(피드백 쓰기·학습노트) ─────────────── */

.form textarea,
.form input:not([type="checkbox"]):not([type="radio"]),
.form select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  background: var(--bg);
  font: inherit;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--fg);
  resize: vertical;
  transition: border-color var(--t-fast);
}

.form input:not([type="checkbox"]):not([type="radio"]),
.form select {
  height: 38px;
  padding-block: 0;
}

.form :is(textarea, input, select):focus {
  outline: none;
  border-color: var(--fg);
}

.form ::placeholder {
  color: var(--fg-4);
}

.form select {
  appearance: none;
  padding-right: 32px;
  cursor: pointer;
}

.selwrap {
  position: relative;
  display: block;
}

.selwrap::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--fg-2);
  border-bottom: 1.5px solid var(--fg-2);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.selwrap--sm select {
  height: 30px !important;
  padding: 0 28px 0 9px !important;
  font-size: 12.5px !important;
  font-weight: 650;
}

.selwrap--sm::after {
  right: 11px;
  width: 5px;
  height: 5px;
}

.form__k {
  font-size: 12px;
  font-weight: 760;
  color: var(--fg-2);
}

.form__field {
  display: grid;
  gap: 5px;
}

.form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.form__note {
  flex: 1 1 180px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--fg-3);
}

.form__msg {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--fg);
}

.form__msg:empty {
  display: none;
}

.form__check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-2);
  cursor: pointer;
}

.form__check .tick {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.form__check .tick::after {
  left: 4px;
  top: 0.5px;
  width: 4px;
  height: 8px;
}

.form__check b {
  color: var(--fg);
}

.form__merge {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--fg-3);
}

.form__merge b {
  padding-top: 1px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--fg-2);
  white-space: nowrap;
}

.form__why {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--fg-3);
}
