/* ═══════════════════════════════════════════════════════════
   SHOTDECK — 시네마토그래퍼의 콘솔
   웜 블랙 + 텅스텐 앰버 · 뷰파인더 모티프 · 필름 그레인
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #0c0b09;
  --bg2: #100e0b;
  --panel: #16130e;
  --panel2: #1c1812;
  --line: #2b261d;
  --line2: #3a3324;
  --amber: #e8a33d;
  --amber-hi: #ffc46b;
  --amber-dim: rgba(232, 163, 61, .14);
  --tally: #ff3b30;
  --teal: #57c7b8;
  --sage: #a3b18a;
  --violet: #b39ddb;
  --rose: #e78895;
  --sky: #82b4d8;
  --text: #ece5d4;
  --dim: #96897245;
  --muted: #968972;
  --faint: #6b6153;
  --mono: "IBM Plex Mono", "IBM Plex Sans KR", ui-monospace, monospace;
  --sans: "IBM Plex Sans KR", -apple-system, sans-serif;
  --disp: "Oswald", "IBM Plex Sans KR", sans-serif;
  --rail-w: 218px;
  --mon-w: 372px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { color-scheme: dark; }

body {
  background:
    radial-gradient(1200px 800px at 78% -10%, rgba(232,163,61,.06), transparent 60%),
    radial-gradient(900px 700px at -10% 110%, rgba(87,199,184,.04), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── 필름 그레인 ── */
.grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none;
  z-index: 999;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 1.2s steps(4) infinite;
}
@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 1%); }
  50% { transform: translate(1%, -2%); }
  75% { transform: translate(-1%, 2%); }
  100% { transform: translate(2%, -1%); }
}

::selection { background: var(--amber); color: #14100a; }

/* ═══ 상단 바 ═══ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(28,24,18,.9), rgba(16,14,11,.7));
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand-lens {
  width: 40px; height: 40px; border-radius: 50%;
  background:
    radial-gradient(circle at 35% 32%, rgba(255,255,255,.25), transparent 42%),
    radial-gradient(circle at 50% 50%, #241d10 30%, transparent 31%),
    conic-gradient(from 20deg, #3a2f1a, #6b5426, #3a2f1a, #7d6330, #3a2f1a);
  border: 2px solid var(--line2);
  box-shadow: 0 0 0 3px rgba(232,163,61,.12), inset 0 0 14px rgba(0,0,0,.8);
  position: relative;
}
.brand-lens::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 9px; height: 9px; border-radius: 50%;
  transform: translate(-50%,-50%);
  background: radial-gradient(circle at 35% 30%, #ff8a80, var(--tally));
  animation: tally 2.4s ease-in-out infinite;
}
@keyframes tally { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.brand-text h1 {
  font-family: var(--disp); font-size: 21px; font-weight: 600;
  letter-spacing: .14em; line-height: 1.1; color: var(--amber-hi);
}
.brand-text p {
  font-family: var(--mono); font-size: 10px; letter-spacing: .18em;
  color: var(--muted); margin-top: 2px;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.tb-btn {
  font-family: var(--sans); font-size: 12.5px; font-weight: 500;
  color: var(--text); background: var(--panel2);
  border: 1px solid var(--line2); border-radius: 7px;
  padding: 7px 13px; cursor: pointer;
  transition: border-color .18s, background .18s, transform .12s;
}
.tb-btn:hover { border-color: var(--amber); background: #241e14; transform: translateY(-1px); }
.save-state {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em;
  color: var(--faint); padding-left: 6px;
}
.save-state.flash { color: var(--sage); }

/* ═══ 메인 3열 덱 ═══ */
.deck {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr var(--mon-w);
  gap: 0;
  min-height: calc(100vh - 132px);
}

/* ── 좌: 샷 타임라인 ── */
.rail {
  border-right: 1px solid var(--line);
  background: var(--bg2);
  padding: 16px 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.rail-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 0 4px 4px;
}
.rail-title { font-family: var(--disp); font-size: 12px; letter-spacing: .22em; color: var(--muted); }
.rail-count {
  font-family: var(--mono); font-size: 11px; color: var(--amber);
  border: 1px solid var(--line2); border-radius: 20px; padding: 1px 8px;
}
.shot-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1; }
.shot-card {
  position: relative;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel);
  padding: 10px 12px 9px;
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.shot-card:hover { border-color: var(--line2); }
.shot-card.active {
  border-color: var(--amber);
  background: linear-gradient(180deg, #221c11, var(--panel));
  box-shadow: 0 0 0 1px rgba(232,163,61,.25), 0 4px 18px rgba(0,0,0,.4);
}
.shot-card .sc-num {
  font-family: var(--disp); font-size: 10.5px; letter-spacing: .2em;
  color: var(--amber);
}
.shot-card .sc-title {
  font-size: 12.5px; font-weight: 500; margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text);
}
.shot-card .sc-sub {
  font-family: var(--mono); font-size: 10px; color: var(--faint);
  margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shot-card .sc-body { display: flex; gap: 8px; align-items: center; }
.shot-card .sc-thumb {
  width: 34px; height: 34px; border-radius: 6px; object-fit: cover;
  border: 1px solid var(--line2); flex: 0 0 auto;
}
.shot-card .sc-txt { min-width: 0; flex: 1; }
.shot-card .sc-imgbadge {
  position: absolute; top: 8px; right: 26px;
  font-family: var(--mono); font-size: 9.5px; color: var(--rose);
  background: rgba(231,136,149,.12); border: 1px solid rgba(231,136,149,.3);
  border-radius: 10px; padding: 1px 6px; line-height: 1.4;
}
.shot-card:hover .sc-imgbadge { right: 26px; }
.shot-card .sc-del {
  position: absolute; top: 7px; right: 8px;
  width: 18px; height: 18px; border-radius: 5px;
  border: none; background: transparent; color: var(--faint);
  font-size: 11px; cursor: pointer; line-height: 1;
  opacity: 0; transition: opacity .15s, color .15s, background .15s;
}
.shot-card:hover .sc-del { opacity: 1; }
.shot-card .sc-del:hover { color: var(--tally); background: rgba(255,59,48,.12); }
.add-shot {
  border: 1px dashed var(--line2); border-radius: 9px;
  background: transparent; color: var(--muted);
  font-family: var(--sans); font-size: 12.5px; font-weight: 500;
  padding: 10px; cursor: pointer;
  transition: color .18s, border-color .18s, background .18s;
}
.add-shot:hover { color: var(--amber); border-color: var(--amber); background: var(--amber-dim); }
.rail-foot { padding: 4px; }
.rail-hint { font-size: 10.5px; color: var(--faint); line-height: 1.6; }

/* ── 중앙: 스테이지 ── */
.stage {
  padding: 18px 22px 26px;
  overflow-y: auto;
  max-height: calc(100vh - 132px);
}

/* 프리셋 스트립 */
.preset-strip { margin-bottom: 18px; }
.preset-strip-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 9px; }
.strip-label { font-family: var(--disp); font-size: 11.5px; letter-spacing: .22em; color: var(--amber); }
.strip-sub { font-size: 11.5px; color: var(--faint); }
.preset-cards {
  display: flex; gap: 9px; overflow-x: auto; padding-bottom: 6px;
  scrollbar-width: thin; scrollbar-color: var(--line2) transparent;
}
.preset-card {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-width: 118px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel);
  padding: 10px 13px 9px;
  cursor: pointer; text-align: left;
  font-family: var(--sans);
  transition: border-color .16s, background .16s, transform .13s;
}
.preset-card:hover { border-color: var(--amber); transform: translateY(-2px); background: var(--panel2); }
.preset-card.active { border-color: var(--amber); background: var(--amber-dim); box-shadow: 0 0 0 1px rgba(232,163,61,.3); }
.preset-card .pc-emoji { font-size: 19px; }
.preset-card .pc-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.preset-card .pc-cat { font-family: var(--mono); font-size: 9.5px; color: var(--faint); letter-spacing: .05em; }

/* 스텝 네비 */
.step-nav {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 12px 0 14px;
  border-top: 1px solid var(--line);
  position: sticky; top: -18px; z-index: 10;
  background: linear-gradient(180deg, var(--bg) 82%, transparent);
}
.step-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--sans); font-size: 12px; font-weight: 500;
  color: var(--muted); background: var(--panel);
  border: 1px solid var(--line); border-radius: 20px;
  padding: 6px 12px; cursor: pointer;
  transition: all .16s;
}
.step-chip:hover { color: var(--text); border-color: var(--line2); }
.step-chip.active { color: #171207; background: var(--amber); border-color: var(--amber); font-weight: 600; }
.step-chip .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--line2); transition: background .16s;
}
.step-chip.filled .dot { background: var(--sage); }
.step-chip.active .dot { background: #171207; }

/* 카테고리 패널 */
.category-panel { animation: panel-in .28s ease; }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.cat-head { margin: 6px 0 4px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.cat-title { font-family: var(--disp); font-size: 22px; font-weight: 500; letter-spacing: .06em; color: var(--text); }
.cat-title .cat-ko { font-family: var(--sans); font-size: 17px; font-weight: 700; margin-right: 8px; }
.cat-en { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--amber); text-transform: uppercase; }
.cat-desc { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; max-width: 640px; }
.cat-clear {
  font-size: 11px; color: var(--faint); background: none; border: none;
  cursor: pointer; text-decoration: underline dotted; padding: 0;
}
.cat-clear:hover { color: var(--rose); }

.opt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 9px;
}
.opt-chip {
  position: relative;
  text-align: left;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel);
  padding: 11px 13px 10px;
  cursor: pointer;
  font-family: var(--sans);
  transition: border-color .15s, background .15s, transform .12s, box-shadow .15s;
}
.opt-chip:hover {
  border-color: var(--line2); background: var(--panel2);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.opt-chip.selected {
  border-color: var(--amber);
  background: linear-gradient(180deg, rgba(232,163,61,.16), rgba(232,163,61,.05));
  box-shadow: 0 0 0 1px rgba(232,163,61,.35), 0 0 22px rgba(232,163,61,.1);
}
.opt-chip.selected::after {
  content: "●"; position: absolute; top: 9px; right: 11px;
  color: var(--tally); font-size: 9px;
  animation: tally 2s ease-in-out infinite;
}
.opt-chip .oc-ko { font-size: 13.5px; font-weight: 600; color: var(--text); display: block; }
.opt-chip .oc-en { font-family: var(--mono); font-size: 10px; color: var(--amber); display: block; margin-top: 2px; letter-spacing: .03em; }
.opt-chip .oc-desc { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.5; display: block; }
.opt-chip .oc-tip {
  display: none;
  font-size: 10.5px; color: var(--sage); margin-top: 6px;
  padding-top: 6px; border-top: 1px dashed var(--line);
  line-height: 1.5;
}
.opt-chip:hover .oc-tip, .opt-chip.selected .oc-tip { display: block; }

/* ── 이미지 레퍼런스 패널 ── */
.ref-syntax { color: var(--faint); font-size: 11px; }
.img-drop {
  border: 1.5px dashed var(--line2); border-radius: 12px;
  background: var(--panel);
  padding: 22px 16px; margin: 4px 0 14px;
  cursor: pointer; text-align: center; max-width: 640px;
  transition: border-color .16s, background .16s;
}
.img-drop:hover, .img-drop:focus { border-color: var(--rose); background: #1d1712; outline: none; }
.img-drop.drag { border-color: var(--rose); background: rgba(231,136,149,.08); }
.img-drop-inner { display: flex; flex-direction: column; gap: 4px; align-items: center; pointer-events: none; }
.img-drop-ico { font-size: 24px; }
.img-drop-t { font-size: 13px; font-weight: 600; color: var(--text); }
.img-drop-s { font-size: 11px; color: var(--faint); }
.img-empty { font-size: 12px; color: var(--faint); }
.img-warn {
  font-size: 11.5px; color: var(--amber-hi); line-height: 1.6;
  background: rgba(232,163,61,.08); border: 1px solid rgba(232,163,61,.25);
  border-radius: 8px; padding: 9px 12px; margin-top: 12px; max-width: 640px;
}
.img-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; max-width: 900px; }
.img-card {
  position: relative; display: flex; gap: 11px;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--panel); padding: 10px;
}
.img-card.over { border-color: var(--tally); }
.img-thumb {
  width: 66px; height: 66px; border-radius: 8px; object-fit: cover;
  border: 1px solid var(--line2); flex: 0 0 auto;
}
.img-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.img-token { font-family: var(--mono); font-size: 12px; color: var(--rose); font-weight: 500; }
.img-token .over-tag { color: var(--tally); font-size: 9.5px; margin-left: 4px; }
.img-role {
  font-family: var(--sans); font-size: 12px; color: var(--text);
  background: var(--panel2); border: 1px solid var(--line2); border-radius: 7px;
  padding: 5px 8px; cursor: pointer; width: 100%;
}
.img-role:focus { outline: none; border-color: var(--rose); }
.img-hint { font-size: 10.5px; color: var(--muted); line-height: 1.5; }
.img-del {
  position: absolute; top: 7px; right: 8px;
  width: 20px; height: 20px; border-radius: 6px; border: none;
  background: transparent; color: var(--faint); font-size: 11px; cursor: pointer;
  transition: color .15s, background .15s;
}
.img-del:hover { color: var(--tally); background: rgba(255,59,48,.12); }

/* ── 레퍼런스 트레이 (모니터) ── */
.ref-tray {
  border: 1px solid rgba(231,136,149,.28); border-radius: 10px;
  background: linear-gradient(180deg, rgba(231,136,149,.06), var(--panel));
  padding: 11px 12px;
}
.ref-tray[hidden] { display: none; }
.rt-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 9px; }
.rt-title { font-size: 12px; font-weight: 600; color: var(--rose); }
.rt-count { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.rt-grid { display: flex; flex-direction: column; gap: 7px; }
.rt-item { display: flex; align-items: center; gap: 9px; }
.rt-item.over { opacity: .5; }
.rt-thumb { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line2); flex: 0 0 auto; }
.rt-tok { font-family: var(--mono); font-size: 11px; color: var(--rose); flex: 0 0 58px; }
.rt-role { font-size: 11.5px; color: var(--text); }
.rt-note { font-size: 10.5px; color: var(--faint); line-height: 1.55; margin-top: 9px; }
.rt-note b { color: var(--rose); }

/* 텍스트 입력형 (피사체/액션) */
.free-input-wrap { margin-top: 4px; max-width: 640px; }
.free-suggest { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.suggest-chip {
  font-family: var(--sans); font-size: 12px;
  color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 18px;
  padding: 6px 13px; cursor: pointer;
  transition: all .15s;
}
.suggest-chip:hover { border-color: var(--teal); color: var(--teal); }
.suggest-chip.selected { border-color: var(--teal); background: rgba(87,199,184,.12); color: var(--teal); }
.free-input {
  width: 100%;
  font-family: var(--sans); font-size: 13.5px;
  color: var(--text); background: var(--panel);
  border: 1px solid var(--line2); border-radius: 9px;
  padding: 11px 14px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.free-input:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(232,163,61,.12); }
.free-input::placeholder { color: var(--faint); }
.free-note { font-size: 11px; color: var(--faint); margin-top: 7px; }

/* ── 우: 모니터/뷰파인더 ── */
.monitor {
  border-left: 1px solid var(--line);
  background: var(--bg2);
  padding: 16px 16px 20px;
  display: flex; flex-direction: column; gap: 12px;
  max-height: calc(100vh - 132px);
  overflow-y: auto;
  position: sticky; top: 66px;
}
.monitor > * { flex-shrink: 0; }
.monitor .krview { flex-shrink: 1; }
.viewfinder {
  position: relative;
  border: 1px solid var(--line2);
  border-radius: 12px;
  background:
    radial-gradient(140% 100% at 50% 0%, #191510, #0e0c09 70%);
  padding: 15px 16px 13px;
  min-height: 240px;
  display: flex; flex-direction: column;
  box-shadow: inset 0 0 40px rgba(0,0,0,.55), 0 8px 30px rgba(0,0,0,.45);
}
.vf-corners i {
  position: absolute; width: 17px; height: 17px;
  border-color: var(--amber); border-style: solid; opacity: .75;
}
.vf-corners i:nth-child(1) { top: 8px; left: 8px; border-width: 2px 0 0 2px; }
.vf-corners i:nth-child(2) { top: 8px; right: 8px; border-width: 2px 2px 0 0; }
.vf-corners i:nth-child(3) { bottom: 8px; left: 8px; border-width: 0 0 2px 2px; }
.vf-corners i:nth-child(4) { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; }
.vf-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; padding: 0 6px;
}
.rec {
  font-family: var(--mono); font-size: 11px; letter-spacing: .2em;
  color: var(--tally); display: inline-flex; align-items: center; gap: 6px;
}
.rec-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--tally);
  box-shadow: 0 0 8px rgba(255,59,48,.8);
  animation: tally 1.6s ease-in-out infinite;
}
.vf-meta { font-family: var(--mono); font-size: 10.5px; color: var(--muted); letter-spacing: .08em; }
.vf-body {
  flex: 1;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.75;
  color: var(--text);
  padding: 2px 6px;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.vf-body .frag { transition: background .3s; border-radius: 3px; padding: 0 1px; }
.vf-body .frag.new { background: rgba(232,163,61,.28); }
.vf-body .f-camera { color: var(--amber-hi); }
.vf-body .f-subject { color: var(--teal); }
.vf-body .f-env { color: var(--sky); }
.vf-body .f-light { color: #ffd97a; }
.vf-body .f-style { color: var(--violet); }
.vf-body .f-audio { color: var(--rose); }
.vf-body .f-plain { color: var(--text); }
.vf-body .f-quality { color: var(--faint); font-style: italic; }
.vf-body .f-ref { color: var(--rose); font-weight: 500; }
.vf-body .vf-empty {
  color: var(--faint); font-family: var(--sans); font-size: 12.5px;
  display: block; padding-top: 34px; text-align: center; line-height: 1.9;
}
.vf-body .shot-label {
  display: block;
  font-size: 10px; letter-spacing: .22em; color: var(--amber);
  margin: 10px 0 2px; opacity: .85;
}
.vf-body .shot-label:first-child { margin-top: 0; }
.vf-foot { margin-top: 10px; padding: 0 6px; }
.meter { display: flex; align-items: center; gap: 10px; }
.meter-track {
  flex: 1; height: 4px; border-radius: 4px;
  background: var(--line);
  overflow: hidden;
}
.meter-fill {
  height: 100%; width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, #7d5a1e, var(--amber), var(--amber-hi));
  transition: width .4s cubic-bezier(.2,.8,.3,1);
}
.meter-label { font-family: var(--mono); font-size: 10.5px; color: var(--muted); min-width: 34px; text-align: right; }

/* 한국어 해설 */
.krview {
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel);
  padding: 12px 14px;
  font-size: 12px; color: var(--muted); line-height: 1.7;
  overflow-y: auto; min-height: 60px;
}
.krview .kr-row { display: flex; gap: 8px; padding: 2.5px 0; }
.krview .kr-key {
  flex: 0 0 74px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .06em;
  color: var(--faint); padding-top: 2px;
}
.krview .kr-val { color: var(--text); font-size: 12px; }
.krview .kr-val em { color: var(--amber); font-style: normal; }
.krview .kr-empty { color: var(--faint); }

/* 액션 버튼 */
.monitor-actions { display: flex; gap: 8px; }
.act-btn {
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line2);
  background: var(--panel2); color: var(--text);
  padding: 12px 14px;
  transition: all .16s;
}
.act-btn:hover { border-color: var(--amber); transform: translateY(-1px); }
.act-btn.primary {
  flex: 1;
  background: linear-gradient(180deg, var(--amber-hi), var(--amber));
  color: #1a1305; border-color: transparent;
  box-shadow: 0 4px 16px rgba(232,163,61,.25);
}
.act-btn.primary:hover { filter: brightness(1.07); box-shadow: 0 6px 22px rgba(232,163,61,.35); }
.act-btn.primary:active { transform: translateY(1px); }

/* ═══ 파라미터 바 ═══ */
.params-bar {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  border-top: 1px solid var(--line);
  background: var(--bg2);
  padding: 12px 22px;
  position: sticky; bottom: 0; z-index: 40;
}
.param-group { display: flex; align-items: center; gap: 8px; }
.param-label {
  font-family: var(--disp); font-size: 10.5px; letter-spacing: .18em;
  color: var(--faint); text-transform: uppercase;
}
.param-opts { display: flex; gap: 4px; }
.param-btn {
  font-family: var(--mono); font-size: 11px;
  color: var(--muted); background: transparent;
  border: 1px solid var(--line); border-radius: 6px;
  padding: 4px 10px; cursor: pointer;
  transition: all .14s;
}
.param-btn:hover { color: var(--text); border-color: var(--line2); }
.param-btn.selected { color: #171207; background: var(--amber); border-color: var(--amber); font-weight: 600; }

/* ═══ 모달 ═══ */
.modal-veil[hidden], .toast[hidden] { display: none; }
.modal-veil {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8,7,5,.78);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 30px;
  animation: veil-in .2s ease;
}
@keyframes veil-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(860px, 100%); max-height: 84vh;
  background: var(--panel);
  border: 1px solid var(--line2); border-radius: 14px;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: panel-in .25s ease;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-family: var(--sans); font-size: 16px; font-weight: 700; }
.modal-x {
  background: none; border: none; color: var(--muted);
  font-size: 15px; cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.modal-x:hover { color: var(--text); background: var(--panel2); }
.modal-body { padding: 18px 20px; overflow-y: auto; }

.ex-card {
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg2); padding: 14px 16px;
  margin-bottom: 12px;
}
.ex-card h3 { font-size: 13.5px; font-weight: 600; margin-bottom: 2px; }
.ex-card .ex-cat { font-family: var(--mono); font-size: 10px; color: var(--amber); letter-spacing: .1em; }
.ex-card .ex-prompt {
  font-family: var(--mono); font-size: 11.5px; line-height: 1.7;
  color: var(--muted); margin: 9px 0;
  background: var(--bg); border-radius: 7px; padding: 10px 12px;
  border: 1px solid var(--line);
}
.ex-card .ex-break { font-size: 11.5px; color: var(--sage); line-height: 1.6; }
.ex-card .ex-actions { margin-top: 9px; display: flex; gap: 8px; }
.ex-card .ex-btn {
  font-size: 11.5px; font-weight: 500; color: var(--amber);
  background: var(--amber-dim); border: 1px solid transparent;
  border-radius: 6px; padding: 5px 11px; cursor: pointer;
  transition: all .14s;
}
.ex-card .ex-btn:hover { border-color: var(--amber); }

.guide-sec { margin-bottom: 20px; }
.guide-sec h3 {
  font-family: var(--disp); font-size: 13px; letter-spacing: .14em;
  color: var(--amber); margin-bottom: 8px; text-transform: uppercase;
}
.guide-sec table { width: 100%; border-collapse: collapse; font-size: 12px; }
.guide-sec th, .guide-sec td {
  text-align: left; padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.guide-sec th { color: var(--faint); font-weight: 500; font-size: 11px; }
.guide-sec td:first-child { color: var(--text); font-weight: 500; white-space: nowrap; }
.guide-sec td { color: var(--muted); line-height: 1.55; }
.guide-sec code { font-family: var(--mono); font-size: 11px; color: var(--teal); }

/* ═══ 토스트 ═══ */
.toast {
  position: fixed; bottom: 76px; left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: #221c11;
  border: 1px solid var(--amber);
  color: var(--amber-hi);
  font-size: 13px; font-weight: 600;
  border-radius: 10px;
  padding: 11px 22px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5), 0 0 24px rgba(232,163,61,.15);
  animation: toast-in .25s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(14px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ═══ 스크롤바 ═══ */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

/* ═══ 반응형 ═══ */
@media (max-width: 1180px) {
  :root { --mon-w: 320px; --rail-w: 190px; }
}
@media (max-width: 980px) {
  .deck { grid-template-columns: 1fr; }
  .rail {
    border-right: none; border-bottom: 1px solid var(--line);
    flex-direction: row; align-items: center; overflow-x: auto;
  }
  .rail-head { flex-direction: column; align-items: flex-start; }
  .shot-list { flex-direction: row; }
  .shot-card { min-width: 128px; }
  .add-shot { white-space: nowrap; }
  .rail-foot { display: none; }
  .stage { max-height: none; }
  .monitor {
    position: static; max-height: none;
    border-left: none; border-top: 1px solid var(--line);
  }
  .topbar { flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 560px) {
  .opt-grid { grid-template-columns: 1fr 1fr; }
  .params-bar { gap: 10px; padding: 10px 14px; }
}
