:root {
  --bg-0: #e7edf2;
  --bg-1: #f8fbfc;
  --ink-0: #0f2636;
  --ink-1: #426174;
  --panel: rgba(255, 255, 255, 0.9);
  --safe-top: 0px;
  --safe-bottom: 0px;
  --safe-left: 0px;
  --safe-right: 0px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink-0);
  font-family: "Segoe UI", "Noto Sans KR", sans-serif;
  background:
    radial-gradient(circle at 10% 0%, #f6efdf, transparent 35%),
    radial-gradient(circle at 80% 20%, #d9edf9, transparent 40%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1));
}

body {
  padding-top: calc(8px + constant(safe-area-inset-top, 44px));
  padding-top: calc(8px + env(safe-area-inset-top, 44px));
  padding-right: calc(8px + constant(safe-area-inset-right, 0px));
  padding-right: calc(8px + env(safe-area-inset-right, 0px));
  padding-bottom: calc(8px + constant(safe-area-inset-bottom, 0px));
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  padding-left: calc(8px + constant(safe-area-inset-left, 0px));
  padding-left: calc(8px + env(safe-area-inset-left, 0px));
}

.shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel {
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 6px 16px rgba(10, 24, 36, 0.08);
}

.top {
  padding: 8px;
  flex: 0 0 auto;
}

.work {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  padding: 8px;
  gap: 8px;
}

input[type="file"] {
  width: 100%;
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 5px;
}

.stage-wrap {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 220px;
  border-radius: 12px;
  background: #09131b;
  touch-action: none;
  overflow: hidden;
}

video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  background: #09131b;
}

#overlay {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  border-radius: 12px;
  pointer-events: none;
}

.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

button {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  color: #fff;
  font-weight: 700;
}

#selectModeBtn {
  background: #2b5c44;
}

#addKeyframeBtn {
  background: #396288;
}

#clearKeyframesBtn {
  background: #6d5d70;
}

#previewBtn {
  background: #0f6c8f;
}

#applyBtn {
  background: #2b5f9e;
}

#exportBtn {
  background: #d66f2f;
}

button:disabled {
  opacity: 0.45;
}

.meta {
  color: var(--ink-1);
  min-height: 18px;
  font-size: 14px;
}
