/* QR 오류정정 — 영상(PixelQrEccShort)의 남색 도트 그림판 스킨. 전부 .exp-qr 아래로 범위를 좁힘. */
.exp-qr { --q-bg: #0b1020; --q-chip: #141b30; --q-gold: #ffd23f; --q-cyan: #46c6ff; --q-cdim: #2a6f94; --q-red: #ff6b5b; --q-green: #5be3a0; --q-gdim: #2f7a58; --q-sub: #8fa0c8; --q-hi: #24345c; }
.exp-qr .lab { display: grid; grid-template-columns: 960px 300px; gap: 20px; align-items: start; }
.exp-qr .lab-main { min-width: 0; }
.exp-qr .stage-box { position: relative; background: var(--q-bg); box-shadow: 0 0 0 3px #000, 0 0 0 7px var(--q-hi), 8px 8px 0 7px #000; overflow: hidden; }
.exp-qr .stage-box.wide { width: 960px; height: 540px; }
.exp-qr .stage-box.tall { width: 540px; height: 720px; }
.exp-qr canvas#stage { display: block; width: 100%; height: 100%; image-rendering: pixelated; touch-action: none; cursor: crosshair; }
.exp-qr canvas#stage:focus-visible { outline: 3px solid var(--q-cyan); outline-offset: -3px; }

/* 영상 Chip: 모서리를 깎은 남색 칩. 글자는 화면에서 11px 아래로 내려가지 않게 축소 배율(--k)을 거꾸로 곱해 키운다 */
.exp-qr .chip { position: static; display: inline-flex; align-items: center; gap: .3em; font-weight: 700; font-size: max(22px, calc(11.5px / var(--k, 1))); color: var(--text); background: var(--q-chip); padding: .22em .6em; white-space: nowrap; line-height: 1.2;
  clip-path: polygon(5px 0, calc(100% - 5px) 0, 100% 5px, 100% calc(100% - 5px), calc(100% - 5px) 100%, 5px 100%, 0 calc(100% - 5px), 0 5px); }
.exp-qr .chip.sm { font-size: max(18px, calc(11.5px / var(--k, 1))); }
.exp-qr .chip.xs { font-size: max(15px, calc(11.5px / var(--k, 1))); }
.exp-qr .chip b.r { color: var(--q-red); }
.exp-qr .chip.ok { color: var(--q-bg); background: var(--q-green); }
.exp-qr .chip.jd.bad { color: var(--q-bg); background: var(--q-red); }
.exp-qr .chips { position: absolute; inset: 0; pointer-events: none; }
.exp-qr .rowbox { position: absolute; left: 452px; right: 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.exp-qr .rowbox.r1 { top: 10px; } .exp-qr .rowbox.r2 { top: 56px; } .exp-qr .rowbox.r3 { top: 104px; }
.exp-qr .sw { display: inline-block; width: .8em; height: .8em; margin-right: .1em; vertical-align: -1px; }
.exp-qr .sw.g { background: var(--q-gold); } .exp-qr .sw.c { background: var(--q-cdim); } .exp-qr .sw.n { background: var(--q-green); } .exp-qr .sw.x { background: var(--q-red); }
.exp-qr .chip:not(.ok) .sw + .sw { margin-left: .5em; }

/* 판독 결과 칩 (영상: QR 아래 초록 칩 + 도트 ✓ 아이콘 + 읽은 글) */
.exp-qr .status { position: absolute; display: flex; align-items: center; justify-content: center; gap: .5em; font-weight: 700; font-size: max(22px, calc(11.5px / var(--k, 1))); color: var(--q-bg); background: var(--q-green); padding: .15em .7em; line-height: 1.25; pointer-events: none;
  box-shadow: 0 0 14px rgba(91, 227, 160, .45); clip-path: polygon(5px 0, calc(100% - 5px) 0, 100% 5px, 100% calc(100% - 5px), calc(100% - 5px) 100%, 5px 100%, 0 calc(100% - 5px), 0 5px); }
.exp-qr .status.bad { background: var(--q-red); box-shadow: 0 0 14px rgba(255, 107, 91, .45); }
.exp-qr .status img { height: 20px; width: auto; image-rendering: pixelated; flex: none; filter: brightness(.25) contrast(1.4); }
.exp-qr .status span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.exp-qr .wide .status { left: 40px; width: 376px; top: 392px; height: 40px; }
.exp-qr .tall .status { left: 20px; width: 500px; top: 446px; height: 44px; font-size: max(24px, calc(11.5px / var(--k, 1))); }
.exp-qr .tall .chips { display: none; }

.exp-qr .caption { position: absolute; display: flex; align-items: center; justify-content: center; text-align: center; font-weight: 700; line-height: 1.32; color: var(--text); text-shadow: 3px 3px 0 #000; background: rgba(7, 10, 20, .72); pointer-events: none; }
.exp-qr .wide .caption { left: 14px; right: 14px; top: 446px; height: 84px; font-size: 25px; }
.exp-qr .tall .caption { left: 8px; right: 8px; top: 612px; height: 100px; font-size: max(24px, calc(11.5px / var(--k, 1))); }
.exp-qr .caption b { color: var(--q-gold); }

.exp-qr .title-card { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; background: rgba(7, 10, 20, .6); animation: qrTitleOut .4s steps(4) 2.6s forwards; }
.exp-qr .tt { display: grid; gap: 14px; justify-items: center; }
.exp-qr .tr { display: flex; gap: 10px; }
.exp-qr .tl { display: grid; place-items: center; width: 98px; height: 110px; font-weight: 700; font-size: 72px; color: var(--text); background: var(--q-chip); border: 6px solid var(--q-cyan); text-shadow: 5px 5px 0 #000; animation: qrPop .35s steps(5) both; animation-delay: calc(var(--i) * .08s); }
.exp-qr .tl.c2 { border-color: var(--q-gold); }
.exp-qr .ts { font-weight: 700; font-size: 24px; color: var(--q-sub); background: var(--q-chip); padding: .2em .7em; animation: qrPop .35s steps(5) .8s both; }
.exp-qr .tall .tl { width: 84px; height: 96px; font-size: 60px; } .exp-qr .tall .ts { font-size: max(22px, calc(11.5px / var(--k, 1))); }
@keyframes qrPop { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes qrTitleOut { to { opacity: 0; visibility: hidden; } }

/* 조작부 */
.exp-qr .panel { display: grid; gap: 16px; min-width: 0; width: 300px; }
.exp-qr .board { background: var(--panel); border: 3px solid var(--line2); box-shadow: 4px 4px 0 #000, inset 0 3px 0 #1f2a4a; padding: 14px 14px 12px; }
.exp-qr .board h2 { margin: 0 0 10px; font-size: 16px; color: var(--q-gold); }
.exp-qr .param { margin: 0 0 16px; }
.exp-qr .param:last-child { margin-bottom: 4px; }
.exp-qr .param .head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.exp-qr .param label { font-size: 15px; font-weight: 700; }
.exp-qr .param .help { font-family: var(--read); font-size: 12px; color: var(--sub); margin: 3px 0 6px; line-height: 1.5; }
.exp-qr .param .err { font-family: var(--read); font-size: 12px; line-height: 1.5; color: #ffb3a8; background: #3a1a1a; border: 2px solid var(--q-red); padding: 6px 8px; margin-top: 6px; }
.exp-qr .param .val { display: flex; align-items: center; gap: 2px; }
.exp-qr input[type=number], .exp-qr input.txt { font: 700 15px "Galmuri11", sans-serif; color: var(--q-gold); background: #070a14; border: 2px solid var(--line2); padding: 0 6px; height: 34px; }
.exp-qr input[type=number] { width: 66px; text-align: right; }
.exp-qr input.txt { width: 100%; margin-top: 4px; font-weight: 400; color: var(--text); }
.exp-qr .param .unit { color: var(--q-gold); font-weight: 700; }
.exp-qr .param input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: transparent; cursor: pointer; }
.exp-qr .param input[type=range]::-webkit-slider-runnable-track { height: 10px; background: #070a14; border: 2px solid var(--line2); }
.exp-qr .param input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 26px; margin-top: -10px; background: var(--q-gold); border: 3px solid #7a5f10; box-shadow: 2px 2px 0 #000; }
.exp-qr .param input[type=range]::-moz-range-track { height: 10px; background: #070a14; border: 2px solid var(--line2); }
.exp-qr .param input[type=range]::-moz-range-thumb { width: 18px; height: 24px; background: var(--q-gold); border: 3px solid #7a5f10; border-radius: 0; }
.exp-qr input:focus-visible, .exp-qr button:focus-visible, .exp-qr select:focus-visible { outline: 3px solid var(--q-cyan); outline-offset: 2px; }
.exp-qr .presets, .exp-qr .seg { display: flex; flex-wrap: wrap; gap: 6px; }
.exp-qr .presets button, .exp-qr .seg button { font: 700 13px "Galmuri11", sans-serif; color: var(--text); background: var(--q-chip); border: 2px solid var(--line2); padding: 5px 8px; min-height: 34px; cursor: pointer; }
.exp-qr .seg button { flex: 1 1 0; min-width: 0; padding: 5px 4px; }
.exp-qr .seg button small { display: block; font-size: 10px; font-weight: 400; opacity: .85; }
.exp-qr .presets button[aria-pressed=true], .exp-qr .seg button[aria-pressed=true] { color: #1a1406; background: var(--q-gold); border-color: #b8921c; }
.exp-qr .presets button small { font-size: 10px; opacity: .8; }
.exp-qr .dmg { font-family: var(--read); font-size: 12px; line-height: 1.5; color: var(--q-sub); margin: 0 0 4px; }
.exp-qr .btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.exp-qr button.chipbtn { cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 700; color: var(--text); background: var(--q-chip); border: 3px solid var(--line2); box-shadow: inset 0 3px 0 #1f2a4a, 3px 3px 0 #000; padding: 8px 10px; min-height: 44px; }
.exp-qr button.chipbtn.go { color: #1a1406; background: var(--q-gold); border-color: #b8921c; box-shadow: inset 0 3px 0 #ffe07a, 3px 3px 0 #000; }
.exp-qr button.chipbtn:active { transform: translate(2px, 2px); }
.exp-qr .save { flex: 1 1 100%; }
.exp-qr .hint { font-family: var(--read); font-size: 12px; color: var(--sub); text-align: center; margin-top: 8px; }
.exp-qr .limits { display: grid; gap: 6px; }
.exp-qr .lrow { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; line-height: 1.4; border-bottom: 1px dashed var(--line2); padding-bottom: 5px; }
.exp-qr .lrow b { color: var(--q-gold); text-align: right; flex: none; }
.exp-qr .lrow small { color: var(--q-sub); font-size: 11px; }
.exp-qr .lrow.stale b { color: var(--mute); }
.exp-qr .lrow.run b { color: var(--q-cyan); }
.exp-qr .lnote { font-family: var(--read); font-size: 12px; color: var(--q-sub); }
.exp-qr .hud-m { display: none; }

@media (max-width: 1340px) {
  .exp-qr .lab { grid-template-columns: minmax(0, 1fr); }
  .exp-qr .panel { width: auto; max-width: 520px; }
  .exp-qr .stage-wrap { width: 100%; position: relative; }
  .exp-qr .stage-box { transform-origin: 0 0; transform: scale(var(--k, 1)); position: absolute; }
}
@media (max-width: 700px) {
  .exp-qr .hud-m { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
  .exp-qr .hud-m .chip { display: block; text-align: center; font-size: 13px; padding: 6px; white-space: normal; }
  .exp-qr .hud-m .chip b { display: block; font-size: 20px; color: var(--q-gold); }
  .exp-qr .hud-m .chip b.g { color: var(--q-green); } .exp-qr .hud-m .chip b.r { color: var(--q-red); }
  .exp-qr .hud-m .chip b.txt { font-size: 16px; overflow-wrap: anywhere; max-height: 3.6em; overflow: hidden; }
  .exp-qr .hud-m .legend { grid-column: 1 / -1; font-size: 12px; color: var(--q-sub); text-align: center; }
  .exp-qr .board { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) { .exp-qr .title-card { animation: none; display: none; } }
