:root {
  color-scheme: light;
  --ink: #172032;
  --muted: #667085;
  --line: #d9e0ea;
  --panel: #ffffff;
  --canvas: #eef2f7;
  --accent: #e64a2e;
  --accent-dark: #bd321c;
  --navy: #183153;
  --success: #147a52;
  font-family: Inter, "Noto Sans KR", "Malgun Gothic", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 95% 0%, #ffd9ca 0, transparent 25rem),
    var(--canvas);
}

button,
input,
select {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.app-shell {
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

.topbar,
.section-heading,
.request-panel form,
.workload-grid {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  margin-bottom: 24px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.04em;
}

h2 {
  font-size: 21px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.mode-badge,
.status {
  border-radius: 999px;
  background: #e6edf6;
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 13px;
}

.request-panel,
.review-panel {
  border: 1px solid rgba(217, 224, 234, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 50px rgba(30, 47, 72, 0.08);
}

.request-panel {
  padding: 22px;
}

.request-panel h2 {
  margin-bottom: 16px;
}

.request-panel form {
  align-items: end;
  gap: 14px;
}

label {
  display: grid;
  flex: 1;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(230, 74, 46, 0.25);
  outline-offset: 2px;
}

.check-label {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 44px;
  gap: 8px;
  padding: 0 8px;
}

.check-label input {
  width: 18px;
  min-height: 18px;
}

button {
  display: flex;
  align-items: center;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 0;
  overflow: hidden;
}

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

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.button-label {
  padding: 0 20px;
}

.button-shortcut {
  display: grid;
  align-self: stretch;
  place-items: center;
  width: 38px;
  background: rgba(0, 0, 0, 0.14);
}

.logout-button {
  min-height: 38px;
  background: #d9472c;
  padding: 0 16px;
}

.workload-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 18px 0;
}

.workload-grid article {
  min-height: 92px;
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  background: var(--panel);
  padding: 17px 18px;
}

.workload-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.workload-grid strong {
  display: block;
  font-size: 21px;
  overflow-wrap: anywhere;
}

.review-panel {
  overflow: hidden;
}

.section-heading {
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.status.error {
  background: #fee8e5;
  color: #a32617;
}

.status.success {
  background: #dff4eb;
  color: var(--success);
}

.table-wrap {
  overflow-x: auto;
}

.review-workspace {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 570px;
}

.player-panel {
  order: 1;
}

.table-wrap {
  order: 2;
  border-top: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  background: #f4f6f9;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tbody tr:hover:not(.empty-row) {
  background: #fff5f1;
}

tbody tr:not(.empty-row) {
  cursor: pointer;
}

tbody tr.selected {
  background: #ffe7dd;
  box-shadow: inset 4px 0 var(--accent);
}

.empty-row td {
  height: 180px;
  color: var(--muted);
  text-align: center;
}

.player-panel {
  min-width: 0;
  background: #101722;
  color: #fff;
  padding: 20px;
}

.player-heading,
.player-controls {
  display: flex;
  align-items: center;
}

.player-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.player-heading strong {
  color: #f1b29f;
  font-size: 13px;
  text-align: right;
}

.video-stage {
  display: grid;
  min-height: 430px;
  border: 1px solid #344154;
  border-radius: 12px;
  background: #05080c;
  overflow: hidden;
}

.video-stage.dual {
  grid-template-rows: 1fr 1fr;
}

.video-stage p {
  place-self: center;
  color: #98a5b7;
}

.video-stage video {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.video-stage video[hidden],
.video-stage p[hidden] {
  display: none;
}

.video-status {
  min-height: 20px;
  margin: 10px 0;
  color: #aeb9c9;
  font-size: 12px;
}

.video-status.error {
  color: #ff9c8d;
}

.timeline {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin: 10px 0 14px;
  color: #aeb9c9;
  font-size: 12px;
}

.timeline input {
  min-height: auto;
  padding: 0;
}

.player-controls {
  justify-content: center;
  gap: 10px;
}

.control-button {
  justify-content: center;
  min-width: 72px;
  background: #26364d;
  padding: 0 14px;
}

.control-button:hover {
  background: #354b69;
}

.speed-control {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  color: #c9d2df;
}

.speed-control input {
  width: 72px;
  min-height: 40px;
}

.decision-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.decision-controls.compact {
  grid-template-columns: repeat(3, minmax(0, 220px));
  justify-content: center;
}

.decision-button {
  justify-content: space-between;
  min-height: 54px;
  padding-left: 20px;
  font-size: 14px;
}

.decision-button kbd {
  display: grid;
  align-self: stretch;
  place-items: center;
  width: 46px;
  background: rgba(0, 0, 0, 0.16);
}

kbd {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 5px;
  color: inherit;
  font: 700 10px/1 Inter, sans-serif;
  padding: 4px 6px;
}

.control-button {
  gap: 7px;
}

.control-button kbd,
.speed-control kbd {
  color: #c9d2df;
}

.decision-button.accept {
  background: #16845a;
}

.decision-button.accept:hover {
  background: #0f6845;
}

.decision-button.reject {
  background: #c53b32;
}

.decision-button.reject:hover {
  background: #9f2c25;
}

.decision-button.issue {
  background: #345b7d;
}

.decision-button.issue:hover {
  background: #274561;
}

.decision-button.sheet {
  background: #6a4d96;
}

.decision-button.sheet:hover {
  background: #543b78;
}

.decision-dialog {
  width: min(520px, calc(100% - 32px));
  border: 0;
  border-radius: 16px;
  color: var(--ink);
  padding: 0;
  box-shadow: 0 28px 90px rgba(13, 25, 43, 0.35);
}

.decision-dialog::backdrop {
  background: rgba(10, 18, 29, 0.72);
}

.decision-dialog form {
  padding: 24px;
}

.decision-detail {
  display: grid;
  gap: 1px;
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--line);
  overflow: hidden;
}

.decision-detail div {
  display: grid;
  grid-template-columns: 110px 1fr;
  background: #fff;
  padding: 11px 13px;
}

.decision-detail dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.decision-detail dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.decision-warning {
  min-height: 20px;
  color: #a32617;
  font-size: 13px;
  font-weight: 700;
}

.dialog-shortcut-hint {
  color: var(--muted);
  font-size: 12px;
}

.dialog-shortcut-hint kbd {
  border-color: var(--line);
  color: var(--ink);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.dialog-actions button {
  justify-content: center;
  min-width: 100px;
  padding: 0 16px;
}

.dialog-actions .dialog-cancel {
  background: #e6ebf2;
  color: var(--ink);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-shell {
  width: min(460px, calc(100% - 32px));
  padding: 24px 0;
}

.login-card {
  border: 1px solid rgba(217, 224, 234, 0.95);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(30, 47, 72, 0.14);
  padding: 28px;
}

.login-copy {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.login-form button {
  justify-content: center;
  min-height: 48px;
}

.login-status {
  min-height: 20px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.login-status.error {
  color: #a32617;
}

@media (max-width: 900px) {
  .request-panel form {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .workload-grid {
    grid-template-columns: 1fr 1fr;
  }

  .review-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .app-shell {
    width: min(100% - 24px, 1440px);
    padding-top: 20px;
  }

  .topbar {
    align-items: flex-start;
    gap: 14px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .request-panel form,
  .workload-grid {
    grid-template-columns: 1fr;
  }

  .check-label {
    padding: 0;
  }
}
