:root {
  --bg: #eef2f7;
  --panel: #ffffff;
  --line: #c8d4e3;
  --text: #07111f;
  --muted: #607089;
  --teal: #118474;
  --teal-soft: #e1f7f3;
  --danger: #dd4a3b;
  --dark: #111827;
  --amber: #f7b640;
  --shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

.rank-shell {
  min-width: 1780px;
  padding: 10px 12px 18px;
}

.rank-workspace {
  display: grid;
  grid-template-columns: 350px 310px 500px 350px 244px;
  gap: 10px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.image-panel,
.text-panel,
.preview-panel,
.settings-panel {
  padding: 12px;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

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

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.field span,
.range-field span {
  color: #26364c;
  font-size: 13px;
  font-weight: 800;
}

input[type="text"],
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
}

input[type="text"],
select {
  min-height: 38px;
  padding: 8px 10px;
}

textarea {
  min-height: 42px;
  padding: 9px 10px;
  resize: vertical;
}

.bulk-compact-row {
  display: grid;
  grid-template-columns: 1fr 66px;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 10px;
}

.bulk-compact-row textarea {
  min-height: 92px;
}

.text-panel {
  display: grid;
  align-content: start;
  gap: 8px;
}

.rank-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.rank-card {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #4b5f78;
  font-size: 14px;
  font-weight: 900;
}

.rank-card.is-selected {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(17, 132, 116, 0.15);
}

.rank-card.is-dragging {
  opacity: 0.52;
}

.image-tile {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.image-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.rank-card.is-over {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.rank-text-list {
  display: grid;
  gap: 7px;
}

.rank-text-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: start;
  gap: 8px;
}

.rank-text-label {
  padding-top: 12px;
  color: #111827;
  font-size: 14px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.rank-text-list textarea {
  min-height: 46px;
  font-size: 13px;
  font-weight: 800;
}

.shorts-stage,
.longform-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid #aab8cc;
  border-radius: 7px;
  background: #f8fafc;
}

.shorts-stage canvas {
  width: 100%;
  aspect-ratio: 9 / 16;
  display: block;
}

.longform-stage canvas {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
}

.canvas-play-button {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 60px;
  height: 60px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.2);
}

.canvas-play-button::before,
.canvas-play-button::after {
  content: "";
  position: absolute;
  top: 18px;
  width: 8px;
  height: 24px;
  border-radius: 3px;
  background: #0f172a;
}

.canvas-play-button::before {
  left: 21px;
}

.canvas-play-button::after {
  right: 21px;
}

.canvas-play-button:not(.is-playing)::before {
  left: 23px;
  top: 17px;
  width: 0;
  height: 0;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-left: 20px solid #0f172a;
  border-radius: 0;
  background: transparent;
}

.canvas-play-button:not(.is-playing)::after {
  display: none;
}

.seek-zone {
  margin-top: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.seek-zone input {
  width: 100%;
  accent-color: var(--amber);
}

.readout {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.timeline-strip {
  display: flex;
  gap: 5px;
  margin-top: 10px;
  overflow-x: auto;
}

.timeline-chip {
  min-width: 42px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.timeline-chip.is-active {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: #075f55;
}

.settings-panel {
  display: grid;
  gap: 10px;
}

.settings-panel section {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.settings-panel h2 {
  font-size: 16px;
}

.dark-button,
.teal-button,
.danger-button,
.outline-button {
  min-height: 42px;
  border-radius: 7px;
  padding: 0 12px;
  font-weight: 900;
}

.dark-button {
  border: 0;
  background: var(--dark);
  color: #fff;
}

.teal-button {
  border: 1px solid #0d766b;
  background: var(--teal);
  color: #fff;
}

.danger-button {
  border: 0;
  background: var(--danger);
  color: #fff;
}

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

.status-line {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.range-field {
  display: grid;
  grid-template-columns: 40px 1fr 46px;
  align-items: center;
  gap: 8px;
}

.range-field input {
  width: 100%;
  accent-color: var(--danger);
}

.range-field b {
  font-size: 12px;
  text-align: right;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.mode-switch label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
  font-weight: 900;
}

.mode-switch label:has(input:checked) {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: #075f55;
}

.mode-switch input {
  width: 14px;
  height: 14px;
}
