/* PC + low-vision: large text, high contrast, generous spacing */
:root {
  --bg: #faf6ed;
  --fg: #1a1a1a;
  --muted: #555;
  --accent: #1a1a2e;
  --accent-fg: #faf6ed;
  --success: #006e2e;
  --error: #b00020;
  --border: #1a1a1a;
  --soft-border: #c0b8a0;
  --focus-ring: #0044cc;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--fg);
  font-family: "맑은 고딕", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  font-size: 22px; line-height: 1.5;
}
*:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }

main {
  max-width: 920px;
  margin: 40px auto;
  padding: 32px 40px 80px;
}

h1 {
  font-size: 56px;
  font-weight: 800;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}
.subhead {
  font-size: 26px;
  margin: 0 0 40px;
  color: var(--muted);
}
.subhead strong { color: var(--fg); }

/* Dropzone — big tap target */
.dropzone {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px;
  min-height: 240px;
  padding: 32px;
  border: 4px dashed var(--soft-border);
  border-radius: 16px;
  background: #fffaf0;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
  text-align: center;
}
.dropzone:hover, .dropzone.dragging {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
.dropzone-icon { font-size: 64px; line-height: 1; }
.dropzone-label { font-size: 30px; font-weight: 700; }
.dropzone-hint { font-size: 20px; color: inherit; opacity: 0.75; }
.dropzone-filename { font-size: 22px; margin-top: 8px; font-weight: 700; }

/* Mode toggle */
.mode-toggle {
  display: flex; align-items: flex-start; gap: 16px;
  margin: 32px 0 0;
  padding: 18px 22px;
  background: #fffaf0;
  border: 2px solid var(--soft-border);
  border-radius: 12px;
  cursor: pointer;
}
.mode-toggle:hover { border-color: var(--accent); }
.mode-toggle input[type="checkbox"] {
  width: 32px; height: 32px;
  margin-top: 4px;
  flex: 0 0 auto;
  accent-color: var(--accent);
  cursor: pointer;
}
.mode-toggle-text { display: flex; flex-direction: column; gap: 4px; }
.mode-toggle-text strong { font-size: 24px; }
.mode-toggle-hint { font-size: 18px; color: var(--muted); line-height: 1.4; }

/* Advanced disclosure */
.advanced { margin: 24px 0; }
.advanced summary {
  font-size: 22px;
  cursor: pointer;
  padding: 12px 0;
  color: var(--muted);
}
.advanced summary:hover { color: var(--fg); }
.advanced textarea {
  width: 100%;
  margin-top: 12px;
  padding: 16px;
  font-family: inherit;
  font-size: 22px;
  line-height: 1.5;
  border: 2px solid var(--soft-border);
  border-radius: 8px;
  background: white;
  color: var(--fg);
  resize: vertical;
}

/* Primary button */
button[type="submit"] {
  display: block;
  width: 100%;
  min-height: 80px;
  padding: 16px 24px;
  font-family: inherit;
  font-size: 32px;
  font-weight: 800;
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 120ms ease, transform 80ms ease;
}
button[type="submit"]:hover:not(:disabled) { background: #0a0a14; }
button[type="submit"]:active:not(:disabled) { transform: translateY(1px); }
button[type="submit"]:disabled {
  background: #888;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Status section */
.status {
  margin-top: 40px;
  padding: 32px;
  background: white;
  border: 2px solid var(--soft-border);
  border-radius: 12px;
  text-align: center;
}
.status p { font-size: 28px; margin: 16px 0; }
.spinner {
  width: 80px; height: 80px;
  margin: 0 auto;
  border: 8px solid var(--soft-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
progress {
  width: 100%; height: 24px;
  margin-top: 20px;
  border: 2px solid var(--soft-border);
  border-radius: 12px;
  overflow: hidden;
}
progress::-webkit-progress-bar { background: #fff; }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }

/* Result section */
.result {
  margin-top: 40px;
  padding: 32px;
  background: #e8f5ed;
  border: 2px solid var(--success);
  border-radius: 12px;
  text-align: center;
}
.success {
  font-size: 32px;
  font-weight: 800;
  color: var(--success);
  margin: 0 0 24px;
}
.download-button {
  display: inline-block;
  min-height: 80px;
  padding: 16px 48px;
  font-size: 32px;
  font-weight: 800;
  background: var(--success);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  line-height: 48px;
}
.download-button:hover { background: #00521e; }
button.secondary {
  display: block;
  width: 100%;
  min-height: 60px;
  margin-top: 24px;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 24px;
  background: white;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 12px;
  cursor: pointer;
}
button.secondary:hover { background: var(--accent); color: var(--accent-fg); }

/* Error section */
.error {
  margin-top: 40px;
  padding: 24px 32px;
  background: #fff0f0;
  border: 3px solid var(--error);
  border-radius: 12px;
  font-size: 24px;
  color: var(--error);
  font-weight: 700;
}

.hidden { display: none !important; }

/* Jobs panel */
.jobs {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 2px solid var(--soft-border);
}
.jobs h2 {
  font-size: 32px;
  font-weight: 800;
  margin: 0 0 20px;
}
.jobs-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 16px;
}
.job {
  padding: 20px 24px;
  background: white;
  border: 2px solid var(--soft-border);
  border-radius: 12px;
}
.job-running { border-color: var(--accent); background: #f5f1e3; }
.job-done    { border-color: var(--success); background: #e8f5ed; }
.job-error,
.job-cancelled { border-color: var(--error); background: #fff0f0; }
.job-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; margin-bottom: 8px;
}
.job-row:last-child { margin-bottom: 0; }
.job-name {
  font-size: 22px; font-weight: 700;
  word-break: break-all;
}
.job-state {
  font-size: 20px; font-weight: 700;
  padding: 4px 14px; border-radius: 999px;
  white-space: nowrap;
}
.job-state-running  { background: var(--accent); color: var(--accent-fg); }
.job-state-pending  { background: #888; color: white; }
.job-state-done     { background: var(--success); color: white; }
.job-state-error,
.job-state-cancelled { background: var(--error); color: white; }
.job-progress { font-size: 18px; color: var(--muted); }
.job-actions { display: flex; gap: 8px; }
.job-button {
  display: inline-block;
  min-height: 48px; min-width: 96px;
  padding: 10px 20px;
  font-family: inherit;
  font-size: 22px; font-weight: 700;
  border: none; border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  line-height: 28px;
}
.job-button.cancel { background: var(--error); color: white; }
.job-button.cancel:hover:not(:disabled) { background: #800014; }
.job-button.cancel:disabled { opacity: 0.5; cursor: not-allowed; }
.job-button.download { background: var(--success); color: white; }
.job-button.download:hover { background: #00521e; }
.job-button.preview { background: white; color: var(--accent); border: 2px solid var(--accent); }
.job-button.preview:hover { background: var(--accent); color: var(--accent-fg); }
.job progress {
  width: 100%; height: 16px;
  margin-top: 8px;
  border-radius: 8px;
}
.job-error {
  margin-top: 8px;
  padding: 10px 14px;
  background: white;
  border-radius: 8px;
  font-size: 18px;
  color: var(--error);
}

/* Login page */
.login-main { max-width: 600px; }
.login-form {
  display: flex; flex-direction: column; gap: 20px;
  margin-top: 32px;
}
.login-label {
  font-size: 26px;
  font-weight: 700;
}
.login-form input[type="password"] {
  font-family: inherit;
  font-size: 30px;
  padding: 18px 20px;
  border: 3px solid var(--soft-border);
  border-radius: 12px;
  background: white;
  color: var(--fg);
  min-height: 72px;
}
.login-form button[type="submit"] { margin-top: 8px; }
