:root {
  color-scheme: light;
  --ink: #1c2130;
  --muted: #515d70;
  --accent: #6845d7;
  --line: #e2e5eb;
  --subtle: #f0eef5;
  --success: #215b37;
  --error: #a12424;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: #fafbf8;
  color: var(--ink);
  font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
main { max-width: 1080px; margin: 0 auto; padding: 0 40px 28px; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
.app-header { display: flex; justify-content: space-between; align-items: center; min-height: 112px; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); }
h1 { display: flex; align-items: center; gap: 14px; margin: 0; font-size: 25px; line-height: 1.2; font-weight: 700; letter-spacing: -.8px; }
.brandmark { display: grid; place-items: center; flex-shrink: 0; width: 42px; height: 42px; padding-right: 4px; background: var(--ink); color: #fff; border-radius: 11px; font: 24px Georgia, serif; letter-spacing: -3px; }
.brand-light { font-weight: 400; color: var(--muted); }
.app-header p { margin: 6px 0 0 56px; color: var(--muted); font-size: 14px; }
.app-header > a { font-size: 14px; white-space: nowrap; }
.workspace { margin-top: 28px; padding: 27px 30px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 8px 36px #24304405; }
h2 { margin: 0 0 22px; font-size: 18px; font-weight: 600; letter-spacing: -.3px; }
.controls { display: flex; flex-wrap: wrap; gap: 18px 36px; margin-bottom: 24px; }
.control-group { display: flex; align-items: center; gap: 12px; }
.control-label { font-size: 14px; font-weight: 600; }
.mode-switch { display: inline-flex; gap: 3px; padding: 4px; background: var(--subtle); border-radius: 9px; }
button, .button { font-family: inherit; font-size: 14px; line-height: 1.4; }
button { cursor: pointer; }
.mode-switch button { position: relative; min-height: 37px; padding: 8px 15px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-weight: 600; }
.mode-switch button[aria-pressed="true"] { background: #fff; color: var(--accent); box-shadow: 0 1px 4px #1c213014; }
#encode-operation[aria-pressed="true"], #decode-operation[aria-pressed="true"] { background: var(--accent); color: #fff; }
.mode-switch button:hover:not(:disabled) { background: #e5dff5; }
#encode-operation[aria-pressed="true"]:hover, #decode-operation[aria-pressed="true"]:hover { background: #5735c5; }
.mode-switch button:disabled { cursor: default; opacity: .65; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible { outline: 3px solid #ae9af0; outline-offset: 3px; }
.dropzone { padding: 24px 20px; text-align: center; border: 1.5px dashed #cbc5df; background: #faf9fd; border-radius: 12px; }
.drop-icon { display: block; width: 38px; height: 38px; margin: 0 auto 12px; color: var(--accent); }
.dropzone.dragover { background: #eee8ff; border-color: var(--accent); outline: 1px solid var(--accent); }
.dropzone h3 { margin: 0; font-size: 19px; font-weight: 600; }
.dropzone p { margin: 4px 0 16px; color: var(--muted); font-size: 14px; }
.input-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 20px; }
.drop-note { display: block; margin-top: 16px; color: var(--muted); font-size: 13px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 43px; padding: 10px 17px; border: 1px solid var(--accent); border-radius: 8px; font-weight: 600; text-decoration: none; cursor: pointer; }
.secondary { background: #fff; border-color: #d7d4e1; color: var(--ink); }
.secondary:hover:not(:disabled) { background: #f5f3fa; }
.primary { background: var(--accent); color: #fff; }
.primary:hover:not(:disabled) { background: #5735c5; }
.button:disabled { background: #eeedf2; color: #646777; border-color: #e2e0e9; cursor: default; }
.text-button { border: 0; padding: 7px 0; background: none; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover:not(:disabled) { text-decoration-thickness: 2px; }
.text-button:disabled { color: #68757e; cursor: default; }
.selected { display: flex; align-items: center; gap: 16px; padding: 20px; border: 1px solid #eeeaf7; border-radius: 10px; background: #f7f6fb; }
.file-icon { padding: 14px 10px; border-radius: 7px; background: #ebe5fd; color: var(--accent); font: 600 12px/1.4 ui-monospace, monospace; letter-spacing: .4px; }
.file-info { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.file-info strong { font-size: 15px; font-weight: 600; }
.file-info span { font-size: 13px; color: var(--muted); }
.settings { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.setting-main strong { font-size: 14px; font-weight: 600; }
.setting-main p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; cursor: pointer; }
.check input { flex-shrink: 0; width: 17px; height: 17px; margin: 0; accent-color: var(--accent); }
#verify-label { flex-shrink: 0; }
.status { margin: 18px 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.status.error { color: var(--error); }
.status.success { color: var(--success); }
.actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.actions > span { color: var(--muted); font-size: 13px; }
.actions > div { display: flex; flex-wrap: wrap; gap: 10px; }
code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .95em; }
.progress-area { margin-top: 20px; }
.progress-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.progress-label strong { font-weight: 600; }
.progress-label span { font-variant-numeric: tabular-nums; }
progress { display: block; width: 100%; height: 8px; margin: 12px 0 20px; border: 0; border-radius: 8px; overflow: hidden; accent-color: var(--accent); background: #eeeaf7; }
progress::-webkit-progress-bar { background: #eeeaf7; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 8px; }
progress::-moz-progress-bar { background: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stats > div { display: flex; flex-direction: column; gap: 3px; }
.stats span { font-size: 13px; color: var(--muted); }
.stats strong { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.processing-note { margin: 16px 0 20px; color: var(--muted); font-size: 14px; }
.limits { border-top: 1px solid var(--line); padding: 16px 0; font-size: 14px; }
summary { cursor: pointer; font-weight: 600; }
.limits dl { display: grid; grid-template-columns: 155px minmax(0, 1fr); gap: 16px 24px; margin: 22px 0 8px; }
.limits dt { font-weight: 600; }
.limits dd { margin: 0; color: var(--muted); }
footer { border-top: 1px solid var(--line); padding-top: 16px; color: var(--muted); font-size: 13px; }
.folder-options { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 18px 0; }
.folder-options > span { font-size: 13px; color: var(--muted); }
.folder-workers { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 18px; }
.folder-workers label { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; }
.folder-workers input { width: 80px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper, white); color: var(--ink); font: inherit; }
.folder-workers input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.folder-workers input:disabled { opacity: 0.6; }
.folder-workers span { font-size: 13px; color: var(--muted); }
.output-folder { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.output-folder > div { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.output-folder strong { font-size: 14px; font-weight: 600; }
.output-folder > div > span { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.batch-note { margin: 12px 0; font-size: 13px; color: var(--muted); }
.current-file { margin: 14px 0 0; color: var(--ink); font-size: 14px; overflow-wrap: anywhere; }
.current-file:empty { display: none; }
#queue-details { margin-top: 18px; font-size: 14px; }
#queue { list-style: none; max-height: 240px; margin: 12px 0 0; padding: 0; overflow: auto; border: 1px solid var(--line); }
#queue li { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
#queue li:last-child { border-bottom: 0; }
.queue-name { min-width: 0; overflow-wrap: anywhere; }
.queue-state { max-width: 50%; color: var(--muted); text-align: right; overflow-wrap: anywhere; }
#queue li[data-state="complete"] .queue-state { color: var(--success); }
#queue li[data-state="failed"] .queue-state { color: var(--error); }
#queue li[data-state="processing"] .queue-state { color: var(--accent); }
[hidden] { display: none !important; }
@media (max-width: 650px) {
  main { padding: 20px 16px; }
  .app-header { min-height: 100px; padding: 18px 0; }
  h1 { font-size: 23px; }
  .app-header p { font-size: 14px; }
  .workspace { margin-top: 20px; padding: 18px 16px; }
  .controls { flex-direction: column; gap: 14px; }
  .control-label { min-width: 70px; }
  .dropzone { padding: 22px 16px; }
  .input-actions { gap: 10px 16px; }
  .settings { align-items: flex-start; flex-direction: column; gap: 14px; }
  .actions { align-items: flex-start; flex-direction: column; }
  .actions > div { width: 100%; }
  .selected { gap: 10px; padding: 14px; flex-wrap: wrap; }
  .file-icon { display: none; }
  .file-info { flex-basis: 70%; }
  .stats { gap: 12px; }
  .stats span { font-size: 12px; }
  .stats strong { font-size: 16px; }
  .limits dl { grid-template-columns: 1fr; gap: 6px; }
  .limits dd + dt { margin-top: 12px; }
}
