:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #d9dee7;
  --text: #17202c;
  --muted: #657184;
  --accent: #0b7a75;
  --accent-2: #2357c6;
  --danger: #a53535;
  --ok: #167348;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 0 14px;
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: var(--accent);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
}

.app {
  width: min(1040px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.topbar {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.1;
}

h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

.topbar p,
.drop-copy span,
.stats,
.token span,
.controls span,
.muted {
  color: var(--muted);
}

.intro {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

.intro p {
  max-width: 820px;
}

.intro ul {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.dropzone {
  display: flex;
  min-height: 190px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 2px dashed #aab4c3;
  border-radius: 8px;
  background: var(--panel);
  padding: 28px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone.dragging {
  border-color: var(--accent);
  background: #effaf8;
}

.drop-copy {
  display: grid;
  gap: 6px;
}

.drop-copy strong {
  font-size: 21px;
}

.actions,
.controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.controls {
  margin: 14px 0;
}

.controls label {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.controls input {
  width: 72px;
}

.progress {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.details {
  margin-top: 18px;
}

.details summary {
  width: max-content;
  max-width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  padding: 0 14px;
  cursor: pointer;
  user-select: none;
}

.details[open] summary {
  border-color: var(--accent);
}

.progress-head,
.stats {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.bar {
  height: 12px;
  margin: 12px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e9f0;
}

.bar div {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.2s ease;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  margin-top: 12px;
}

.file-list,
.session-list {
  display: grid;
  gap: 8px;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px 12px;
}

.row-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row small {
  display: block;
  color: var(--muted);
}

.status-ok {
  color: var(--ok);
}

.status-bad {
  color: var(--danger);
}

@media (max-width: 820px) {
  .topbar,
  .dropzone,
  .progress-head,
  .stats {
    display: grid;
  }

  .split {
    grid-template-columns: 1fr;
  }

  .controls label {
    margin-left: 0;
  }
}
