:root {
  --bg: #efe7db;
  --panel: rgba(255, 252, 246, 0.88);
  --panel-strong: #fffdfa;
  --line: rgba(58, 43, 25, 0.12);
  --ink: #201813;
  --muted: #6d6259;
  --accent: #ba532d;
  --accent-strong: #8f3818;
  --teal: #1f6673;
  --green: #2a7644;
  --gold: #d38b16;
  --danger: #ae2f2f;
  --radius: 24px;
  --shadow: 0 20px 60px rgba(65, 45, 21, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "IBM Plex Sans KR", "Pretendard", "Noto Sans KR", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(31, 102, 115, 0.16), transparent 26%),
    radial-gradient(circle at top right, rgba(186, 83, 45, 0.18), transparent 24%),
    linear-gradient(180deg, #f7f2ea 0%, var(--bg) 100%);
}

#app {
  width: min(1560px, calc(100vw - 32px));
  margin: 24px auto 40px;
}

.shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.sidebar,
.content {
  padding: 22px;
}

.eyebrow {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(31, 102, 115, 0.12);
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1, h2, h3 {
  margin: 0;
}

h1 {
  margin-top: 14px;
  font-size: 34px;
  line-height: 1.05;
  font-family: "IBM Plex Serif", "Noto Serif KR", serif;
}

.lede, .muted {
  color: var(--muted);
}

.lede {
  margin: 10px 0 18px;
  line-height: 1.5;
  font-size: 14px;
}

.stat-grid,
.meta-grid,
.form-grid,
.toolbar,
.task-grid,
.review-actions,
.list-head {
  display: grid;
  gap: 12px;
}

.stat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 18px 0;
}

.stat-card,
.task-card,
.event-card,
.video-card,
.list-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.64);
}

.stat-card {
  padding: 14px;
}

.stat-card strong {
  display: block;
  font-size: 22px;
  margin-top: 4px;
}

.stat-button {
  text-align: left;
  width: 100%;
  cursor: pointer;
}

.nav-button,
button,
select,
input,
textarea {
  font: inherit;
}

button,
.nav-button {
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

button:hover,
.nav-button:hover {
  transform: translateY(-1px);
}

button:disabled,
.nav-button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

button.primary,
.nav-button.active {
  background: var(--accent);
  color: white;
}

button.secondary,
.nav-button {
  background: var(--panel-strong);
  color: var(--ink);
  border-color: var(--line);
}

button.ghost {
  background: transparent;
  border-color: var(--line);
}

button.success {
  background: var(--green);
  color: white;
}

button.danger {
  background: var(--danger);
  color: white;
}

button.warn {
  background: var(--gold);
  color: #25170a;
}

.nav-stack {
  display: grid;
  gap: 10px;
}

.auth-box {
  width: min(480px, calc(100vw - 32px));
  margin: 60px auto;
  padding: 24px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--ink);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.content-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.pill-row,
.toolbar {
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-items: center;
  overflow: auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(31, 102, 115, 0.1);
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.frame-sync-pill.ok {
  background: rgba(42, 118, 68, 0.12);
  color: var(--green);
}

.frame-sync-pill.warn {
  background: rgba(211, 139, 22, 0.16);
  color: #8f3818;
}

.task-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.source-browser {
  display: grid;
  grid-template-columns: 280px 260px minmax(520px, 1fr);
  gap: 18px;
}

.browser-column {
  min-height: 60vh;
}

.clip-list {
  display: grid;
  gap: 12px;
}

.date-group {
  display: grid;
  gap: 8px;
}

.folder-stack {
  display: grid;
  gap: 8px;
  padding-left: 12px;
}

.folder-sort-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.folder-sort-row select {
  padding: 8px 10px;
}

.folder-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  padding: 10px 12px;
}

.folder-button.folder-assigned,
.folder-button.folder-in-progress {
  background: rgba(211, 139, 22, 0.12);
  border-color: rgba(211, 139, 22, 0.28);
  color: #8f5d12;
}

.folder-button.folder-submitted {
  background: rgba(31, 102, 115, 0.12);
  border-color: rgba(31, 102, 115, 0.3);
  color: var(--teal);
}

.folder-button.folder-completed {
  background: rgba(42, 118, 68, 0.14);
  border-color: rgba(42, 118, 68, 0.32);
  color: var(--green);
}

.folder-button.folder-rejected {
  background: rgba(174, 47, 47, 0.1);
  border-color: rgba(174, 47, 47, 0.24);
  color: var(--danger);
}

.folder-button.active {
  background: rgba(186, 83, 45, 0.12);
  border-color: rgba(186, 83, 45, 0.32);
  color: var(--accent-strong);
}

.clip-card {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.folder-preview-card {
  display: grid;
  gap: 16px;
}

.assign-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.assign-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.camera-preview-stack {
  display: grid;
  gap: 16px;
}

.camera-preview-block {
  display: grid;
  gap: 10px;
}

.folder-info-pane {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.priority-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.priority-badge.high {
  background: rgba(174, 47, 47, 0.12);
  color: var(--danger);
}

.priority-badge.medium {
  background: rgba(211, 139, 22, 0.16);
  color: #8f5d12;
}

.priority-badge.low {
  background: rgba(31, 102, 115, 0.12);
  color: var(--teal);
}

.priority-summary {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.clip-preview-pane {
  min-width: 0;
}

.clip-info-pane {
  display: grid;
  align-content: start;
}

.clip-info-pane h3 {
  margin-bottom: 8px;
}

.preview-card {
  display: grid;
  gap: 12px;
}

.preview-thumb-shell {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #121212;
  aspect-ratio: 16 / 9;
}

.preview-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

.preview-play-button {
  position: absolute;
  inset: auto auto 14px 14px;
  z-index: 1;
}

.preview-meta {
  display: grid;
  gap: 8px;
}

.inline-preview-placeholder {
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.38);
}

.clip-open-button {
  margin-top: 12px;
  width: 100%;
}

.list-head input,
.list-head select,
.list-head button {
  min-height: 46px;
}

.task-card,
.event-card,
.video-card,
.list-card {
  padding: 16px;
}

.task-card.active {
  border-color: rgba(186, 83, 45, 0.48);
  background: rgba(255, 248, 242, 0.92);
}

.task-card h3 {
  font-size: 18px;
}

.task-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 8px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 360px;
  gap: 18px;
}

.task-page {
  display: grid;
  gap: 18px;
}

.task-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
}

.task-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 380px;
  gap: 18px;
}

.inspection-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
}

.inspection-list-card {
  min-height: 70vh;
}

.inspection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.inspection-card {
  display: grid;
  gap: 12px;
}

.inspection-clip-button,
.inspection-frame-row {
  width: 100%;
  display: grid;
  gap: 4px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.inspection-clip-button strong {
  font-size: 14px;
}

.inspection-clip-button span,
.inspection-frame-row span {
  color: var(--muted);
  font-size: 12px;
}

.inspection-clip-button.active,
.inspection-frame-row.active {
  border-color: rgba(186, 83, 45, 0.44);
  background: rgba(255, 248, 242, 0.92);
}

.inspection-view-card {
  min-width: 0;
}

.inspection-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 300px;
  gap: 16px;
}

.inspection-canvas-shell {
  border-radius: 20px;
  overflow: hidden;
  background: #121212;
}

.inspection-canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  display: block;
}

.inspection-meta-card {
  display: grid;
  align-content: start;
}

.inspection-toolbar {
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
}

.inspection-frames-card {
  max-height: 320px;
}

.inspection-frame-list {
  display: grid;
  gap: 8px;
}

.video-shell {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #121212;
}

.viewer-stage {
  display: grid;
  gap: 14px;
}

.video-controls {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 72px;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.video-controls input[type="range"] {
  width: 100%;
}

.seek-stack {
  position: relative;
  min-width: 0;
  --seek-track-height: 8px;
  --seek-thumb-size: 18px;
}

.seek-stack input[type="range"] {
  width: 100%;
  position: relative;
  z-index: 2;
  height: var(--seek-thumb-size);
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  opacity: 0;
}

.seek-stack input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: var(--seek-thumb-size);
  height: var(--seek-thumb-size);
  border-radius: 50%;
  background: #2f7de1;
  border: 2px solid #eef5ff;
  margin-top: calc((var(--seek-track-height) - var(--seek-thumb-size)) / 2);
  box-shadow: 0 1px 2px rgba(32, 24, 19, 0.18);
}

.seek-stack input[type="range"]::-moz-range-thumb {
  width: var(--seek-thumb-size);
  height: var(--seek-thumb-size);
  border-radius: 50%;
  background: #2f7de1;
  border: 2px solid #eef5ff;
  box-shadow: 0 1px 2px rgba(32, 24, 19, 0.18);
}

.seek-annotations {
  position: absolute;
  inset: 0 0 auto 0;
  height: 30px;
  pointer-events: none;
  z-index: 3;
}

.seek-track-base {
  position: absolute;
  left: 0;
  right: 0;
  top: calc((var(--seek-thumb-size) - var(--seek-track-height)) / 2);
  height: var(--seek-track-height);
  border-radius: 999px;
  background: rgba(109, 98, 89, 0.25);
  border: 1px solid rgba(109, 98, 89, 0.38);
}

.seek-playable-region {
  position: absolute;
  top: calc((var(--seek-thumb-size) - var(--seek-track-height)) / 2);
  height: var(--seek-track-height);
  border-radius: 999px;
  background: #5b9bff;
  display: none;
  pointer-events: none;
}

.seek-range-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.seek-blocked-region {
  position: absolute;
  top: calc((var(--seek-thumb-size) - var(--seek-track-height)) / 2);
  height: var(--seek-track-height);
  border-radius: 999px;
  background: rgba(109, 98, 89, 0.25);
  border: 1px solid rgba(109, 98, 89, 0.38);
  pointer-events: none;
  display: none;
}

.seek-range-chip,
.seek-range-marker {
  position: absolute;
  top: calc(100% - 2px);
  height: 10px;
  border-radius: 999px;
}

.seek-range-chip {
  background: rgba(174, 47, 47, 0.18);
  border: 1px solid rgba(143, 56, 24, 0.3);
  cursor: pointer;
  pointer-events: auto;
}

.seek-range-chip.assigned {
  background: rgba(211, 139, 22, 0.24);
  border-color: rgba(143, 96, 18, 0.45);
}

.seek-range-chip.submitted {
  background: rgba(42, 118, 68, 0.24);
  border-color: rgba(42, 118, 68, 0.56);
}

.seek-range-marker {
  display: none;
}

.seek-range-marker.active {
  background: rgba(174, 47, 47, 0.26);
  border: 1px solid rgba(143, 56, 24, 0.62);
}

.seek-range-marker.draft {
  background: rgba(186, 83, 45, 0.18);
  border: 1px dashed rgba(186, 83, 45, 0.72);
}

.seek-point-marker {
  position: absolute;
  top: -8px;
  width: 0;
  height: 0;
  display: none;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 9px solid rgba(186, 83, 45, 0.95);
}

.seek-point-marker.end {
  border-top-color: rgba(143, 56, 24, 0.95);
}

.seek-current-indicator {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 26px;
  background: rgba(32, 24, 19, 0.92);
  display: none;
  transform: translateX(-50%);
}

.seek-current-dot {
  position: absolute;
  top: 0;
  width: var(--seek-thumb-size);
  height: var(--seek-thumb-size);
  border-radius: 50%;
  background: #2f7de1;
  border: 2px solid #eef5ff;
  box-shadow: 0 1px 2px rgba(32, 24, 19, 0.18);
  display: none;
  transform: translateX(-50%);
}

.camera-board {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.camera-toggle-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.camera-toggle.active {
  background: var(--accent);
  color: white;
}

.camera-timeline-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.camera-timeline-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}

.camera-timeline-canvas {
  width: 100%;
  height: 24px;
  display: block;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.52);
}

.timeline-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(32, 24, 19, 0.12);
  display: inline-block;
}

.legend-swatch.both {
  background: rgba(42, 118, 68, 0.95);
}

.legend-swatch.current-only {
  background: rgba(211, 139, 22, 0.92);
}

.legend-swatch.other-only {
  background: rgba(143, 56, 24, 0.72);
}

.legend-swatch.none {
  background: rgba(109, 98, 89, 0.25);
}

.legend-swatch.indicator {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(58, 43, 25, 0.32);
}

.magnifier-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
}

.magnifier-canvas {
  width: 100%;
  height: auto;
  max-height: 360px;
  display: block;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(45deg, rgba(255,255,255,0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.08) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.08) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.08) 75%),
    #171717;
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.zoom-controls {
  display: grid;
  grid-template-columns: 84px 1fr 84px;
  gap: 10px;
  align-items: center;
}

.zoom-controls .hint {
  margin-bottom: 0;
  text-align: center;
}

.magnifier-mode-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  align-items: center;
}

.magnifier-mode-row .hint {
  margin-bottom: 0;
}

.diff-threshold-field {
  grid-column: 1 / -1;
}

.cursor-readout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.frame-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.list-card {
  max-height: 80vh;
  overflow: auto;
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.spacer {
  flex: 1;
}

.hint,
.error,
.success-note {
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 16px;
}

.hint {
  background: rgba(31, 102, 115, 0.1);
  color: var(--teal);
}

.error {
  background: rgba(174, 47, 47, 0.14);
  color: var(--danger);
}

.success-note {
  background: rgba(42, 118, 68, 0.14);
  color: var(--green);
}

.autosave-indicator {
  margin-bottom: 0;
  padding: 8px 12px;
}

.autosave-indicator.saving {
  background: rgba(211, 139, 22, 0.14);
  color: #8f5d12;
}

.autosave-indicator.saved {
  background: rgba(42, 118, 68, 0.14);
  color: var(--green);
}

.autosave-indicator.error {
  background: rgba(174, 47, 47, 0.14);
  color: var(--danger);
}

.inspection-export-status {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(31, 102, 115, 0.1);
}

.inspection-export-status.building {
  color: #1f6673;
}

.inspection-export-status.ready {
  color: var(--green);
}

.inspection-export-status.failed {
  color: var(--danger);
  background: rgba(174, 47, 47, 0.1);
}

.range-list {
  gap: 8px;
}

.range-line {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.range-line.assigned {
  background: rgba(211, 139, 22, 0.1);
  border-color: rgba(143, 96, 18, 0.22);
}

.range-line.submitted {
  background: rgba(42, 118, 68, 0.12);
  border-color: rgba(42, 118, 68, 0.24);
}

.range-line.active {
  box-shadow: inset 0 0 0 2px rgba(186, 83, 45, 0.32);
}

.timeline {
  max-height: 280px;
  overflow: auto;
  display: grid;
  gap: 10px;
}

.frame-row {
  display: grid;
  grid-template-columns: 68px 1fr 80px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.frame-row.active {
  color: var(--accent);
  font-weight: 700;
}

.frame-row.modified {
  background: rgba(42, 118, 68, 0.14);
  border-radius: 12px;
  padding: 8px 10px;
}

.frame-row.deleted {
  background: rgba(174, 47, 47, 0.1);
  border-radius: 12px;
  padding: 8px 10px;
}

.frame-tag {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.frame-tag.auto {
  background: rgba(31, 102, 115, 0.12);
  color: var(--teal);
}

.frame-tag.manual {
  background: rgba(42, 118, 68, 0.14);
  color: var(--green);
}

.frame-tag.edited {
  background: rgba(42, 118, 68, 0.18);
  color: var(--green);
}

.frame-tag.deleted {
  background: rgba(174, 47, 47, 0.16);
  color: var(--danger);
}

.small {
  font-size: 12px;
}

.loading-note {
  margin-bottom: 12px;
}

@media (max-width: 1120px) {
  .shell,
  .workspace,
  .task-layout,
  .source-browser,
  .inspection-layout,
  .inspection-stage {
    grid-template-columns: 1fr;
  }
}
