:root {
  color-scheme: dark;
  --bg: #222222;
  --panel: #2d2d2d;
  --border: #1a1a1a;
  --accent: #ff9500;
  --txt: #eeeeee;
  --sub: #8e44ad;
  --extra-green: #00ffaa;
  --extra-yellow: #ffee55;
  --extra-pink: #ff55aa;
  --extra-blue: #22aaff;
  --extra-red: #ff4422;
  --overlay: rgb(0 0 0 / 75%);
  --radius: 10px;
  --radius-sm: 6px;
  --font-min: 14px;
  --muted-opacity: .65;
  font-family: 'Courier New', 'Menlo', monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--txt);
  font-family: inherit;
  font-size: var(--font-min);
  line-height: 1.7;
}

body.modal-open { overflow: hidden; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: var(--sub); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; }

.app-shell {
  width: min(960px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0 32px;
}

.app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border);
}

.brand-block { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--bg);
}
.brand-mark svg { width: 24px; height: 24px; }
.header-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 5px; font-size: 38px; line-height: 1; letter-spacing: 0; }
h2 { margin-bottom: 0; font-size: 20px; line-height: 1.3; letter-spacing: 0; }
.lead { max-width: 620px; margin-bottom: 0; color: var(--txt); opacity: var(--muted-opacity); font-size: var(--font-min); }

.privacy-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 5px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--extra-green);
  font-size: var(--font-min);
  font-weight: 700;
  white-space: nowrap;
}
.privacy-badge svg { width: 18px; height: 18px; flex: 0 0 auto; }

.info-button, .modal-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid var(--border);
  color: var(--txt);
  background: var(--panel);
  transition: border-color .15s, color .15s, opacity .15s;
}
.info-button { border-radius: 50%; opacity: .65; }
.info-button svg, .modal-close svg { width: 18px; height: 18px; }
.info-button:hover, .info-button:focus-visible { border-color: var(--accent); color: var(--accent); opacity: 1; }

.notice, .panel, .status-area {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  color: var(--txt);
}
.notice p { margin: 2px 0 0; opacity: var(--muted-opacity); }
.notice p + p { margin-top: 8px; }
.notice strong { display: block; color: var(--txt); }
.notice-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.notice-icon svg { width: 18px; height: 18px; }
.notice-warm { border-left: 4px solid var(--accent); }
.notice-warm .notice-icon { color: var(--accent); }
.usage-notice { margin: 14px 0 0; }

.panel { padding: 20px; margin-bottom: 16px; }
.drop-panel { padding: 10px; }
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 44px 20px 40px;
  text-align: center;
  transition: border-color .16s, background .16s;
}
.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.dragging {
  border-color: var(--accent);
  background: var(--bg);
  outline: none;
}
.drop-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--accent);
  background: var(--panel);
}
.drop-icon svg { width: 24px; height: 24px; }
.drop-zone h2 { margin-bottom: 4px; font-size: 22px; }
.drop-zone p { margin-bottom: 18px; color: var(--txt); opacity: var(--muted-opacity); font-size: var(--font-min); }

.button {
  min-height: 42px;
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--txt);
  background: var(--panel);
  font-weight: 700;
  font-size: var(--font-min);
  letter-spacing: 0;
  transition: border-color .15s, color .15s, opacity .15s;
}
.button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.button-primary { border-color: var(--accent); color: var(--bg); background: var(--accent); }
.button-primary:hover:not(:disabled) { border-color: var(--txt); color: var(--bg); opacity: .85; }
.button:disabled { cursor: not-allowed; opacity: .35; }
.button-small { min-height: 38px; padding: 6px 12px; }

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 16px; }

.queue-panel { padding-bottom: 10px; }
.queue-heading { margin-bottom: 10px; }
.file-list { display: grid; gap: 0; }
.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 4px;
  border-top: 2px solid var(--border);
}
.file-main { min-width: 0; }
.file-name { overflow: hidden; margin: 0 0 3px; text-overflow: ellipsis; white-space: nowrap; font-size: var(--font-min); font-weight: 700; }
.file-meta { margin: 0; color: var(--txt); opacity: var(--muted-opacity); font-size: var(--font-min); }
.file-status { margin-top: 6px; color: var(--txt); opacity: var(--muted-opacity); font-size: var(--font-min); overflow-wrap: anywhere; }
.file-status.ok { color: var(--extra-green); opacity: 1; }
.file-status.warn { color: var(--extra-yellow); opacity: 1; }
.file-status.error { color: var(--extra-red); opacity: 1; }
.file-actions { display: flex; align-items: center; gap: 8px; }

.status-area {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 54px;
  padding: 14px 16px;
  color: var(--txt);
}
.status-area p { margin: 0; opacity: var(--muted-opacity); }
.status-mark { flex: 0 0 auto; width: 10px; height: 10px; margin-top: 7px; border-radius: 50%; background: var(--sub); }
.status-area.success { border-color: var(--extra-green); }
.status-area.success .status-mark { background: var(--extra-green); }
.status-area.error { border-color: var(--extra-red); }
.status-area.error .status-mark { background: var(--extra-red); }
.status-area.success p, .status-area.error p { opacity: 1; }

.app-version { white-space: nowrap; }

.app-footer {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  padding: 14px 2px 0;
  color: var(--txt);
  opacity: .5;
  font-size: var(--font-min);
  text-align: right;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  width: min(500px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 28px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  transform: translateY(12px);
  transition: transform .2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.modal-title { display: flex; align-items: center; gap: 10px; color: var(--accent); font-size: 18px; font-weight: 700; }
.modal-title svg { width: 20px; height: 20px; }
.modal-close { border-radius: var(--radius-sm); }
.modal-close:hover, .modal-close:focus-visible { border-color: var(--extra-red); color: var(--extra-red); }
.credit-block { margin-bottom: 18px; }
.credit-block:last-child { margin-bottom: 0; }
.credit-label { margin-bottom: 7px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: uppercase; }
.credit-item { margin-bottom: 4px; color: var(--txt); font-size: var(--font-min); }
.credit-item .muted { margin-left: 6px; opacity: .55; font-size: var(--font-min); }
.divider { height: 2px; margin: 15px 0; background: var(--border); }

@media (max-width: 700px) {
  .app-shell { width: min(100% - 24px, 960px); padding-top: 24px; }
  .app-header { align-items: stretch; flex-direction: column; gap: 16px; }
  .header-actions { justify-content: space-between; }
  .brand-block { gap: 10px; }
  .brand-mark { width: 36px; height: 36px; }
  h1 { font-size: 32px; }
  .notice { padding: 12px; }
  .drop-zone { padding: 34px 14px 30px; }
  .section-heading.queue-heading { align-items: stretch; flex-direction: column; }
  .queue-heading .button { width: 100%; }
  .file-row { grid-template-columns: 1fr; }
  .file-actions .button { width: 100%; }
  .app-footer { display: block; }
  .app-footer span { display: block; }
  .app-footer span + span { margin-top: 6px; }
  .modal { padding: 22px; }
}

@media (max-width: 430px) {
  .privacy-badge { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
}
