:root {
  --paper: #ffffff;
  --ink: #0a0a0a;
  --muted: #5f5f5f;
  --line: #0a0a0a;
  --soft-line: #bdbdbd;
  --field: #ffffff;
  --selected: #1f7a3a;
  --selected-text: #ffffff;
  --warn: #6f6f6f;
  --disabled: #d9d9d9;
  --font: "Noto Sans KR", "Noto Sans CJK KR", "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.cover-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--paper);
}

.cover-card {
  width: min(760px, 94vw);
  border: 2px solid var(--line);
  background: var(--field);
  padding: clamp(28px, 6vw, 64px);
  box-shadow: 9px 9px 0 var(--ink);
}

.cover-card h1 {
  margin: 0 0 18px;
  max-width: 660px;
  font-size: clamp(44px, 8vw, 86px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.cover-card p {
  margin: 0 0 32px;
  max-width: 440px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.cover-card .primary-button {
  width: 100%;
  margin-top: 14px;
}

.gate-message {
  min-height: 20px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.topbar {
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 2px solid var(--line);
  background: var(--paper);
}

.topbar-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

.icon-button {
  width: 42px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  background: var(--field);
  cursor: pointer;
}

.icon-button:disabled,
.secondary-button:disabled,
.primary-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.scene-counter {
  min-width: 76px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
}

.topbar-rule {
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--line) 0 14px, transparent 14px 22px);
}

.session-chip {
  border: 2px solid var(--line);
  background: var(--field);
  padding: 8px 12px;
  font-size: 13px;
  text-transform: uppercase;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.75fr);
  gap: 18px;
  padding: 18px;
  height: calc(100vh - 58px - 76px);
  min-height: 0;
}

.media-column {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 16px;
  min-width: 0;
  min-height: 0;
}

.decision-column {
  display: flex;
  min-width: 0;
  min-height: 0;
}

.media-frame {
  position: relative;
  min-height: 0;
  height: 100%;
  border: 2px solid var(--line);
  background: #000;
  box-shadow: 8px 8px 0 var(--ink);
}

.media-frame video,
.media-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

.video-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
  color: #fff;
  background: #050505;
}

.video-empty strong {
  font-size: 22px;
  font-weight: 700;
  text-transform: uppercase;
}

.video-empty span {
  color: #cfcfcf;
  font-size: 13px;
}

.playback-strip {
  display: flex;
  align-items: center;
  gap: 14px;
}

.primary-button,
.secondary-button {
  border: 2px solid var(--line);
  min-height: 42px;
  padding: 10px 14px;
  cursor: pointer;
}

.primary-button {
  background: var(--ink);
  color: var(--selected-text);
  font-weight: 700;
}

.secondary-button {
  background: var(--field);
}

.time-readout {
  color: var(--muted);
  font-size: 14px;
}

.decision-panel {
  border: 2px solid var(--line);
  background: var(--field);
  padding: 16px;
  box-shadow: 8px 8px 0 var(--ink);
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(236px, auto) auto auto;
  gap: 12px;
  overflow: hidden;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

input,
textarea {
  width: 100%;
  border: 2px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 12px;
  resize: vertical;
  text-transform: none;
}

.decision-panel h2 {
  margin: 0;
  font-size: clamp(22px, 2.1vw, 32px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.option-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(4, minmax(54px, 1fr));
  gap: 8px;
  min-height: 236px;
  overflow: visible;
}

.option-button {
  min-height: 54px;
  border: 2px solid var(--line);
  background: var(--field);
  padding: 8px 12px;
  text-align: left;
  cursor: pointer;
}

.option-button strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.option-button span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.option-button.selected {
  background: var(--selected);
  color: var(--selected-text);
}

.option-button.selected span {
  color: #dddddd;
}

.note-field {
  margin-top: 0;
}

.note-field textarea {
  min-height: 52px;
  height: 52px;
  resize: none;
}

.submit-button {
  width: 100%;
  min-height: 48px;
  border: 2px solid var(--line);
  background: var(--ink);
  color: var(--selected-text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.action-row {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.action-row .secondary-button,
.action-row .submit-button {
  min-height: 48px;
  width: 100%;
  margin: 0;
}

.submit-button:disabled {
  background: var(--disabled);
  color: #777;
  border-color: var(--soft-line);
  cursor: not-allowed;
}

.bottom-ledger {
  display: grid;
  grid-template-columns: auto auto auto 1fr;
  gap: 14px;
  align-items: center;
  min-height: 76px;
  padding: 12px 18px;
  border-top: 2px solid var(--line);
  background: var(--paper);
}

.scene-rail {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px;
}

.scene-dot {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 2px solid var(--line);
  background: var(--field);
  cursor: pointer;
  font-size: 11px;
}

.scene-dot.current {
  background: var(--ink);
  color: var(--selected-text);
}

.scene-dot.done::after {
  content: "";
  display: block;
  width: 12px;
  height: 2px;
  margin: 2px auto 0;
  background: currentColor;
}

@media (max-width: 920px) {
  .workspace {
    grid-template-columns: 1fr;
    height: auto;
  }

  .media-frame {
    aspect-ratio: 16 / 9;
    height: auto;
  }

  .decision-panel {
    min-height: 620px;
  }

  .bottom-ledger {
    grid-template-columns: auto auto auto;
  }

  .scene-rail {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .session-chip {
    display: none;
  }

  .workspace {
    padding: 12px;
  }

  .media-frame,
  .identity-panel,
  .decision-panel {
    box-shadow: 5px 5px 0 var(--ink);
  }
}

.admin-shell {
  min-height: 100vh;
  padding: 24px;
  background: #fff;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--line);
}

.admin-header h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1;
}

.admin-header p {
  margin: 12px 0 0;
  color: var(--muted);
}

.admin-link {
  text-decoration: none;
}

.admin-gate {
  display: grid;
  grid-template-columns: minmax(220px, 420px) auto;
  align-items: end;
  gap: 12px;
  padding: 18px 0;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.admin-card,
.admin-empty,
.admin-table-card {
  border: 2px solid var(--line);
  background: #fff;
}

.admin-card,
.admin-empty {
  padding: 16px;
}

.admin-card h2,
.admin-table-card h2 {
  margin: 0;
  font-size: 18px;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.admin-metrics span {
  border: 2px solid var(--line);
  padding: 10px;
  text-align: center;
  font-weight: 700;
}

.admin-detail {
  display: grid;
  gap: 18px;
}

.admin-table-card h2 {
  padding: 14px;
  border-bottom: 2px solid var(--line);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

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

td:nth-child(5) {
  min-width: 240px;
  white-space: normal;
}

.is-correct {
  color: var(--selected);
  font-weight: 700;
}

.is-wrong {
  color: var(--ink);
  font-weight: 700;
}

@media (max-width: 720px) {
  .admin-header,
  .admin-gate {
    display: grid;
    grid-template-columns: 1fr;
  }
}
