:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --panel: #ffffff;
  --border: #d7dce8;
  --accent: #2f5bea;
  --text: #1b2333;
  --muted: #6a7385;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 1.5rem 3rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 0 1.25rem;
}

header h1 { margin: 0 0 .35rem; font-size: 1.6rem; }
header p { margin: 0; color: #5c6579; }

main {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(340px, 460px) 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 900px) {
  main { grid-template-columns: 1fr; }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.files { display: grid; gap: .75rem; }

.drop {
  display: block;
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.drop:hover, .drop.dragover { border-color: var(--accent); background: #f0f4ff; }
.drop.filled { border-style: solid; border-color: var(--accent); }
.drop-title { display: block; font-weight: 600; margin-bottom: .2rem; }
.drop-hint { display: block; font-size: .85rem; color: #6b7385; word-break: break-all; }
.drop input { display: none; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-top: 1.25rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .85rem;
  font-weight: 600;
  min-width: 0;
  white-space: nowrap;
}

label.checkbox {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: .5rem;
  font-weight: 500;
}

input[type="text"], input[type="number"], select, input[type="range"] {
  width: 100%;
  min-width: 0;
}

input[type="text"], input[type="number"], select {
  padding: .5rem .6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-weight: 400;
  background: #fff;
}

input[type="range"] { accent-color: var(--accent); }

.actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

button, .button {
  border: 0;
  border-radius: 8px;
  padding: .6rem 1.1rem;
  font: inherit;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}

button:disabled { opacity: .6; cursor: progress; }
.button.secondary { background: #10893e; }

#status { font-size: .85rem; color: #5c6579; }
#status.error { color: #c0281c; font-weight: 600; }

.preview { display: flex; flex-direction: column; min-height: 640px; }
.preview h2 { margin: 0 0 .75rem; font-size: 1rem; }

#preview {
  flex: 1;
  width: 100%;
  min-height: 560px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfbfd;
}

#preview[hidden] { display: none; }
.empty { color: #7a8296; font-size: .9rem; }
