:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --panel: #ffffff;
  --line: #d7dce2;
  --text: #17202a;
  --muted: #637083;
  --accent: #0b6f6a;
  --accent-dark: #084f4c;
  --warn: #a53f00;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Noto Sans KR", sans-serif;
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  min-height: 34px;
  padding: 0 12px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

button.secondary {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
}

button.secondary:hover {
  background: #edf4f3;
}

input,
select,
textarea {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  padding: 7px 9px;
}

textarea {
  resize: vertical;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  height: 78px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.topbar h1 {
  margin: 0;
  font-size: 21px;
  letter-spacing: 0;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
}

.session {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(220px, 320px) auto;
  align-items: end;
  gap: 8px;
}

label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.layout {
  display: grid;
  grid-template-columns: 310px 1fr;
  height: calc(100vh - 78px);
  min-height: 0;
}

.sidebar {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #fbfcfd;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 118px;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.record-list {
  height: calc(100vh - 133px);
  overflow: auto;
}

.record-item {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.record-item:hover,
.record-item.active {
  background: #e9f3f2;
}

.record-item.in-batch {
  box-shadow: inset 4px 0 0 var(--accent);
}

.record-item .meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.record-item .motion {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  border-radius: 999px;
  padding: 2px 7px;
  background: #e7eaf0;
  color: #344054;
}

.status.approved {
  background: #d9f0e5;
  color: #11633d;
}

.status.needs_fix {
  background: #ffead6;
  color: var(--warn);
}

.status.skip {
  background: #e7e3f7;
  color: #4e3b8f;
}

.workspace {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.workspace-head h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.save-state {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 7px;
}

.batch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-height: 0;
  padding: 10px;
  overflow: hidden;
}

.review-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.card-head h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
}

.video-wrap {
  position: relative;
  display: grid;
  place-items: center;
  background: #111827;
  aspect-ratio: 16 / 9;
}

video {
  width: 100%;
  height: 100%;
  background: #111827;
  object-fit: contain;
}

.video-fallback {
  position: absolute;
  max-width: 90%;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  text-align: center;
}

.card-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-height: 0;
  padding: 9px;
  overflow: auto;
}

.card-form .wide {
  grid-column: 1 / -1;
}

.card-form textarea.motion-input {
  min-height: 76px;
}

.card-form textarea.notes-input {
  min-height: 54px;
}

.path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}

dialog {
  width: min(900px, 92vw);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
  margin: 0;
  font-size: 18px;
}

pre {
  max-height: 70vh;
  margin: 0;
  overflow: auto;
  padding: 14px;
  white-space: pre-wrap;
}

@media (max-width: 1300px) {
  .layout {
    grid-template-columns: 260px 1fr;
  }

  .batch-grid {
    grid-template-columns: repeat(3, minmax(240px, 1fr));
    overflow-x: auto;
  }
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .topbar,
  .session,
  .layout,
  .workspace-head,
  .batch-grid {
    display: grid;
    grid-template-columns: 1fr;
    height: auto;
  }

  .record-list {
    height: 220px;
  }

  .batch-grid {
    overflow: visible;
  }
}
