:root {
  --bg: #0f1218;
  --panel: #171b24;
  --line: #2a3140;
  --text: #e8ecf4;
  --muted: #9aa3b5;
  --accent: #3d8bfd;
  --warn: #e6a23c;
  --bad: #e35d6a;
  --ok: #3bb273;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
.login-body { display: grid; place-items: center; min-height: 100vh; }
.login-card {
  width: min(420px, 92vw);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  display: grid;
  gap: 10px;
}
.login-card input, .login-card button, select, input, textarea, button { font: inherit; }
.login-card input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0e1118;
  color: var(--text);
}
.login-card button, button {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--accent);
  color: white;
  cursor: pointer;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.ghost { background: #222836; }
.muted { color: var(--muted); }
.err { color: var(--bad); }
.errbar {
  background: #3a1518;
  color: #ffc9cf;
  padding: 8px 16px;
  border-bottom: 1px solid var(--bad);
}
.top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #12161f;
}
.top-selectors select {
  margin-left: 4px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #0e1118;
  color: var(--text);
  min-width: 140px;
}
.layout {
  display: grid;
  grid-template-columns: 280px minmax(420px, 1fr) 380px;
  height: calc(100vh - 64px);
  max-height: calc(100vh - 64px);
  min-height: 0;
  overflow: hidden;
}
@media (max-width: 1280px) {
  .layout { grid-template-columns: 240px 1fr 340px; }
}
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .sidebar {
    max-height: 42vh;
  }
}
.sidebar, .inspector {
  background: var(--panel);
  min-height: 0;
}
.sidebar {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.inspector {
  border-left: 1px solid var(--line);
  padding: 12px;
  overflow: auto;
}
.insp-section {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.insp-section > summary {
  cursor: pointer;
  margin-bottom: 8px;
}
.insp-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
}
.cap-placeholder {
  background: #12161f;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  min-height: 72px;
}
.cap-block img.roi[data-scale="4"] { max-height: 240px; width: auto; }
.round-gap-flag { color: var(--warn); }
.event-hint { color: var(--muted); font-size: 11px; margin-top: 2px; }

/* UX7 — B. 시점 설정 event title readability */
#eventEditors {
  display: grid;
  gap: 14px;
}
#eventEditors .event-field {
  margin-bottom: 0;
  padding-left: 10px;
  border-left: 4px solid var(--event-accent, var(--muted));
  min-width: 0;
}
#eventEditors .event-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin-bottom: 8px;
  min-width: 0;
}
#eventEditors .event-title-ko {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--event-accent, var(--text));
  word-break: keep-all;
}
#eventEditors .event-title-en {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--muted);
  letter-spacing: 0.02em;
  word-break: break-word;
}
#eventEditors .event-field--BET_OPEN { --event-accent: #60A5FA; }
#eventEditors .event-field--BET_CLOSE { --event-accent: #FBBF24; }
#eventEditors .event-field--DEAL_START { --event-accent: #34D399; }
#eventEditors .event-field--CARD_REVEAL { --event-accent: #C4B5FD; }
#eventEditors .event-field--RESULT_ANNOUNCE { --event-accent: #FB7185; }
#timingSection .event-field .grid2,
#timingSection .event-field .controls {
  min-width: 0;
}
#timingSection .event-field .controls {
  flex-wrap: wrap;
}
@media (max-width: 900px) {
  #eventEditors .event-title-ko { font-size: 16px; }
  #eventEditors .event-title-en { font-size: 11px; }
}
.side-head {
  padding: 10px 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
  display: grid;
  gap: 6px;
}
.side-head .sort-label select {
  margin-left: 4px;
  max-width: 100%;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #0e1118;
  color: var(--text);
}
.round-list {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.main {
  padding: 12px 16px;
  display: grid;
  gap: 8px;
  align-content: start;
  overflow: auto;
  min-height: 0;
}
.review-seek button { background: #222836; }
.player-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
  max-height: 48vh;
  cursor: grab;
}
.player-wrap.panning { cursor: grabbing; }
.player-zoom-stage {
  transform-origin: center center;
  will-change: transform;
  transition: transform 0.05s linear;
}
.player-wrap video {
  max-height: 48vh;
  display: block;
}
.zoom-btn.active { outline: 2px solid #fff; }
.card-capture-panel {
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 8px;
  margin: 8px 0 12px;
  background: #12161f;
}
.card-capture-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.card-capture-grid .cap-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #0e1118;
}
.card-capture-grid img.roi,
.card-capture-grid img.full-frame {
  width: 100%;
  min-height: 72px;
  max-height: 140px;
  object-fit: contain;
  background: #000;
  border-radius: 4px;
  cursor: pointer;
  display: block;
}
.card-capture-grid img.roi[data-scale="4"] {
  max-height: 240px;
  border: 1px solid var(--accent);
}
.card-capture-grid .full-span { grid-column: 1 / -1; }
.cap-label { font-size: 11px; color: var(--muted); margin: 4px 0; }
.cap-err {
  color: #ffc9cf;
  background: #3a1518;
  border: 1px solid var(--bad);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  margin-top: 4px;
}
.sa-list .sa-item {
  border: 1px dashed #6b5b2a;
  border-radius: 6px;
  padding: 6px 8px;
  margin: 4px 0;
  cursor: pointer;
  background: #1a170f;
}
.sa-list .sa-item:hover { background: #2a2414; }
@media (max-width: 900px) {
  #cardCaptureDetails[open] .card-capture-grid { grid-template-columns: 1fr; }
}
.queue-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.queue-item:hover, .queue-item.active { background: #1d2431; }
.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  margin-right: 4px;
}
.badge.mismatch { color: #ffd7a8; border-color: var(--warn); background: #3a2a12; }
video {
  width: 100%;
  max-height: 48vh;
  background: #000;
  border-radius: 8px;
}
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.controls input[type="number"] {
  width: 96px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #0e1118;
  color: var(--text);
}
.field { display: grid; gap: 4px; margin-bottom: 10px; }
.field label { font-size: 12px; color: var(--muted); }
.field select, .field input, .field textarea {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #0e1118;
  color: var(--text);
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tiny { font-size: 12px; color: var(--muted); }
.syncbox {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #12161f;
}
.preview-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #12161f;
}
.preview-panel summary { cursor: pointer; color: var(--muted); margin-bottom: 8px; }
.preview {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 6px;
  background: #000;
}
.warnbox {
  border: 1px solid var(--warn);
  background: #2b2110;
  color: #ffd7a8;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 10px;
}
h3 { margin: 12px 0 8px; font-size: 15px; }

.player-wrap, .preview-roi-wrap {
  position: relative;
  width: 100%;
}
.roi-overlay {
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.roi-overlay.active { pointer-events: auto; cursor: crosshair; }
.tl-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #12161f;
}
.tl-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}
.tl-canvas {
  width: 100%;
  display: block;
  background: #0a0d12;
  border-radius: 6px;
  cursor: pointer;
  touch-action: none;
}
.thumb-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.thumb-card {
  width: 160px;
  background: #0e1118;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
}
.thumb-card img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  background: #000;
  border-radius: 4px;
}
.thumb-card.unresolved {
  opacity: 0.75;
  border-style: dashed;
}
.thumb-card.candidate { border-color: var(--warn); }
.thumb-card.confirmed { border-color: var(--ok); }
.evidence-list { margin: 6px 0 10px; display: grid; gap: 6px; }
.evidence-list img { max-width: 120px; border-radius: 4px; border: 1px solid var(--line); }
.zoom-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 16px;
}
.zoom-modal[hidden] { display: none !important; }
.zoom-card {
  width: min(920px, 96vw);
  max-height: 94vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  display: grid;
  gap: 10px;
}
#zoomCanvas {
  width: 100%;
  max-height: 56vh;
  background: #000;
  border-radius: 8px;
}
.suggestion-panel {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  max-height: 360px;
  overflow: auto;
}
.sug-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e1118;
}
.sug-card img {
  width: 72px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  background: #000;
  cursor: pointer;
}
.sug-card .sug-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.sug-card .sug-actions button {
  padding: 4px 8px;
  font-size: 12px;
}
.sug-card.locked { opacity: 0.7; border-style: dashed; }
.sug-card.confirmed { border-color: var(--ok); }
.sug-card.rejected { border-color: var(--bad); }
.badge.pri1 { background: #5a2a10; color: #ffd2a8; }
.badge.pri2 { background: #3a2f10; color: #ffe9a8; }
.badge.pri3 { background: #1a3350; color: #b8d8ff; }
.qa2-progress {
  margin: 0 0 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #12161f;
}
.qa2-panel {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  margin: 8px 0 12px;
}
.qa2-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #0e1118;
  display: grid;
  gap: 6px;
}
.qa2-item img.roi {
  width: 100%;
  max-height: 90px;
  object-fit: contain;
  background: #000;
  border-radius: 4px;
  cursor: pointer;
}
.qa2-item .row { display: flex; flex-wrap: wrap; gap: 4px; }
.qa2-item button { padding: 4px 8px; font-size: 12px; }
