:root {
  --bg: #0c0c0e;
  --text: #c5c5ca;
  --text-muted: #6e6e73;
  --border: #242428;
  --border-focus: #44444a;
  --surface: #121215;
  --accent: #5e5e66;

  --font-mono:
    ui-monospace, SFMono-Regular, SF Mono, Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-mono);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 13px;
  display: flex;
  justify-content: center;
  padding: 60px 20px;
}

.container {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* HEADER */
header h1 {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

header .subtitle {
  color: var(--text-muted);
}

/* STATUS BAR */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  color: var(--text-muted);
}

#wasm-status {
  color: var(--text);
}

#wasm-status.status-success {
  color: #4ade80; /* simple flat green */
}

#wasm-status.status-error {
  color: #fca5a5;
}

/* DROP ZONE */
.drop-zone {
  border: 1px dashed var(--border);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.15s ease;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--border-focus);
}

.hidden-picker {
  display: none;
}

/* OUTPUT BAR */
.output-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  color: var(--text-muted);
}

#output-target {
  color: var(--text);
}

.output-note::before {
  content: ' · ';
}

.output-note:empty {
  display: none;
}

.output-note.note-error {
  color: #fca5a5;
}

/* QUEUE CONTROLS */
.queue-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.actions {
  display: flex;
  gap: 8px;
}

.btn {
  font-family: inherit;
  font-size: 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 12px;
  cursor: pointer;
}

.btn:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.btn-primary {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.btn-primary:hover {
  background: #dddddd;
  color: #000000;
}

.hidden {
  display: none !important;
}

/* QUEUE */
.queue-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.empty-state {
  color: var(--text-muted);
  font-style: italic;
}

.queue-item {
  border: 1px solid var(--border);
  padding: 16px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.queue-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.file-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* A flex item refuses to shrink below its content, and the file name never wraps, so
     without this the header grows past the card rather than the name ellipsising. */
  min-width: 0;
}

.file-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  color: var(--text-muted);
  font-size: 11px;
}

.item-status-area {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.badge-status {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
}

.btn-remove {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
}

.btn-remove:hover {
  color: #f87171; /* red */
}

/* PROGRESS BAR */
.progress-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-track {
  height: 4px;
  background: var(--bg);
  width: 100%;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--text);
  transition: width 0.1s ease;
}

.progress-detail {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.error-panel {
  background: rgba(239, 68, 68, 0.05);
  border-left: 2px solid #ef4444;
  padding: 8px;
  color: #fca5a5;
  font-size: 11px;
  overflow-x: auto;
}

/* FOOTER */
footer {
  margin-top: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
}
