:root {
  color-scheme: light;
  --paper: #f1f2e9;
  --white: #fbfcf6;
  --ink: #172923;
  --muted: #51655a;
  --line: #cdd5c9;
  --accent: #ddf18b;
  --error: #962e25;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
p, h1, h2, h3 { margin: 0; }
a { color: inherit; }

.shell { width: min(1056px, calc(100% - 80px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid #35473f; color: #fafdf4; background: var(--ink); }
.header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 850; letter-spacing: -.065em; }
.brand-mark { position: relative; width: 25px; height: 25px; border-radius: 7px; background: var(--accent); }
.brand-mark::before { position: absolute; content: ""; width: 6px; height: 6px; left: 9px; top: 7px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); }
.brand-mark::after { position: absolute; content: ""; width: 11px; height: 2px; left: 7px; bottom: 6px; background: var(--ink); }
.text-button { border: 0; padding: 10px 0 10px 10px; color: inherit; background: transparent; cursor: pointer; font-size: .875rem; }
.text-button:hover { text-decoration: underline; }

main { padding-block: 50px 64px; }
.intro { margin-bottom: 28px; }
.kicker { font-size: .79rem; font-weight: 800; color: #3c624b; margin-bottom: 10px; letter-spacing: .04em; }
h1 { font-size: clamp(2rem, 5.2vw, 3.8rem); line-height: 1.15; letter-spacing: -.075em; word-break: keep-all; }
.intro > p:last-child { margin-top: 13px; color: var(--muted); line-height: 1.55; }

.panel { background: var(--white); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 2px 0 #17292308; }
.lookup { padding: 20px 24px 24px; }
label { display: block; font-size: .86rem; font-weight: 750; margin-bottom: 8px; }
.input-row { display: flex; gap: 10px; }
input, select {
  min-width: 0;
  width: 100%;
  min-height: 50px;
  color: var(--ink);
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #aebcb0;
  border-radius: 8px;
}
input::placeholder { color: #5c6e64; }
select:disabled { opacity: 1; color: var(--muted); background: var(--paper); }
:focus-visible { outline: 3px solid #488148; outline-offset: 3px; }
.button {
  min-height: 50px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-decoration: none;
  white-space: nowrap;
  font-size: .9rem;
  font-weight: 750;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.primary { background: var(--accent); border-color: #bed26c; color: var(--ink); }
.primary:hover { background: #d0e677; border-color: #94ad48; }
.button:disabled { background: #e9ede0; border-color: #d1d9c9; color: #606e60; cursor: default; }

.editor { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.preview, .download { padding: 20px 24px 24px; }
.panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
h2 { font-size: 1.06rem; letter-spacing: -.035em; }
.meta { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.preview-frame { border-radius: 9px; overflow: hidden; aspect-ratio: 16 / 9; position: relative; background: var(--ink); }
.preview-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 17px;
  color: #e2eadd; font-size: .81rem; text-align: center;
  background: radial-gradient(ellipse at center, #345448, transparent 75%),
              repeating-linear-gradient(135deg, #ffffff07 0 1px, transparent 1px 12px);
}
.play-mark { display: grid; place-items: center; width: 54px; height: 54px; border: 1px solid #a7bc9d; border-radius: 50%; }
.play-mark::after { content: ""; margin-left: 4px; border-left: 11px solid var(--accent); border-block: 7px solid transparent; }
.video-details { margin-top: 14px; }
.video-details h3 { font-size: .98rem; overflow-wrap: anywhere; }
.video-details p { margin-top: 4px; color: var(--muted); overflow-wrap: anywhere; font-size: .85rem; }
.download .button, .login .button { width: 100%; }
.hint { color: var(--muted); font-size: .77rem; margin: 8px 0 16px; line-height: 1.45; }
.job { margin-top: 19px; padding-top: 15px; border-top: 1px solid var(--line); }
.job-title { font-weight: 750; font-size: .88rem; overflow-wrap: anywhere; }
.job-status { font-size: .84rem; color: var(--muted); line-height: 1.5; margin: 5px 0 8px; }
progress { display: block; width: 100%; height: 9px; accent-color: #587c44; }
#save { margin-top: 4px; }
.error { margin-top: 10px; color: var(--error); font-size: .86rem; line-height: 1.5; }
.login { max-width: 432px; margin: clamp(0px, 6vh, 60px) auto 0; padding: 30px; }
.login h1 { font-size: clamp(1.8rem, 6vw, 2.55rem); margin-bottom: 24px; }
.login .button { margin-top: 12px; }

@media (max-width: 720px) {
  .shell { width: calc(100% - 32px); }
  main { padding-block: 34px 44px; }
  .editor { grid-template-columns: minmax(0, 1fr); }
  .lookup, .preview, .download { padding: 17px; }
}
@media (max-width: 420px) {
  .input-row { flex-direction: column; }
  .header-inner { min-height: 58px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
