/* jukebox 톤(다크/미니멀) 동일 팔레트. */
:root {
  --bg: #0d0f14;
  --panel: #171a22;
  --panel2: #1f2430;
  --line: #2b3140;
  --fg: #e8ebf2;
  --muted: #8c93a3;
  --accent: #5b8cff;
  --danger: #ff5b6e;
  --ok: #43d17a;
  --warn: #f0b429;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--fg);
  font-family: -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  font-size: 17px; line-height: 1.5;
}
.hidden { display: none !important; }

/* PIN 게이트 (jukebox 동일) */
#gate { position: fixed; inset: 0; z-index: 300; background: var(--bg); display: flex; align-items: center; justify-content: center; }
#gate.hidden { display: none; }
#gate .gate-box { text-align: center; padding: 40px; }
#gate .gate-lock { font-size: 56px; margin-bottom: 8px; }
#gate h2 { margin: 0 0 24px; color: var(--fg); font-weight: 600; }
#gate #pin-input {
  font-size: 40px; letter-spacing: 18px; text-align: center; width: 220px;
  padding: 14px 10px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--panel); color: var(--fg); outline: none;
}
#gate #pin-input:focus { border-color: var(--accent); }
#gate .pin-err { color: var(--danger); margin-top: 14px; min-height: 22px; font-size: 16px; }
#gate.shake .gate-box { animation: shake .35s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-10px)} 75%{transform:translateX(10px)} }

button {
  font: inherit; color: var(--fg); background: var(--panel2);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; cursor: pointer;
}
button:hover, button:focus { border-color: var(--accent); outline: none; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary.big { width: 100%; padding: 14px; font-size: 19px; margin-top: 8px; }
button:disabled { opacity: .4; cursor: not-allowed; }
input, select { font: inherit; color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
input[type=range] { padding: 0; accent-color: var(--accent); }
a { color: var(--accent); }

.wrap { max-width: 1200px; margin: 0 auto; padding: 24px; }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
header.top h1 { font-size: 24px; margin: 0; }
.status { font-size: 14px; color: var(--muted); }
.status b.on { color: var(--ok); }
.status b.off { color: var(--danger); }
.inline { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 14px; }
.sliderval { color: var(--fg); float: right; font-variant-numeric: tabular-nums; }
.hint { display: block; color: var(--muted); font-size: 12px; margin-top: 8px; line-height: 1.4; }
.load-err, .save-err { color: var(--danger); min-height: 20px; margin-top: 8px; font-size: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; cursor: pointer; user-select: none; }
.chip.sel { border-color: var(--accent); background: #24304d; }

/* 편집 레이아웃: 좌 캔버스 / 우 컨트롤 */
.edit-layout { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
.canvas-wrap { min-width: 0; }
.img-box { background: #000; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; max-height: 70vh; }
.img-box img { display: block; max-width: 100%; }
.meta-line { color: var(--muted); font-size: 13px; margin-top: 10px; }
.controls-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }

.radio { display: block; margin-bottom: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.radio:hover { border-color: var(--accent); }
.radio input { width: auto; margin-right: 8px; }
.radio b { font-size: 15px; }
.radio small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; margin-left: 24px; }
.radio.disabled { opacity: .55; cursor: not-allowed; }

/* 체크리스트 */
.checklist { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.cl-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.cl-icon { font-size: 20px; width: 26px; text-align: center; flex: none; }
.cl-body { flex: 1; min-width: 0; }
.cl-label { font-size: 16px; }
.cl-detail { font-size: 13px; color: var(--muted); word-break: break-all; }
.cl-item.ok .cl-icon { color: var(--ok); }
.cl-item.fail { border-color: var(--danger); }
.cl-item.fail .cl-icon { color: var(--danger); }
.cl-item.skip { opacity: .6; }
.cl-item.pending .cl-icon { color: var(--warn); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line); padding: 12px 18px; border-radius: 10px; z-index: 200; }

@media (max-width: 900px) {
  .edit-layout { grid-template-columns: 1fr; }
  .controls-panel { order: 2; }
  /* low 수정: 세로로 긴 사진에서 70vh + overflow:hidden 이 하단 크롭 핸들을 가림 → 55vh 로 줄여 핸들 노출. */
  .img-box { max-height: 55vh; }
}
