:root {
  color-scheme: light;
  --bg: #f3f0e7;
  --panel: rgba(255, 252, 245, 0.96);
  --border: #d7ccbb;
  --text: #1d1a16;
  --muted: #5f5649;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --danger: #b42318;
  --shadow: 0 18px 48px rgba(48, 36, 20, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 30%),
    linear-gradient(180deg, #f8f5ee 0%, var(--bg) 100%);
}

.shell {
  width: min(900px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.hero {
  margin-bottom: 18px;
}

h1,
h2 {
  margin: 0;
  font-family: "IBM Plex Serif", Georgia, serif;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 12px;
  font-size: 1.2rem;
}

.panel {
  margin-top: 18px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
}

.status-label,
.muted,
.note {
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0;
}

.actions-main,
.actions-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

button,
input[type="file"] {
  font: inherit;
}

button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.button-primary {
  background: var(--accent);
  color: #fff;
}

.button-primary:hover:not(:disabled) {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.button-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}

.button-secondary:hover:not(:disabled) {
  border-color: #b9ac98;
  color: var(--text);
  background: rgba(95, 86, 73, 0.06);
}

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

.action-hint {
  margin: 0 0 16px;
  min-height: 1.4em;
  font-weight: 600;
}

.support-note {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  line-height: 1.4;
}

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

.note-info {
  background: rgba(15, 118, 110, 0.08);
  border-color: rgba(15, 118, 110, 0.18);
  color: var(--accent-strong);
}

.note-warning {
  background: rgba(180, 35, 24, 0.1);
  border-color: rgba(180, 35, 24, 0.28);
  color: var(--danger);
  font-weight: 700;
}

.progress-block {
  display: grid;
  gap: 8px;
}

progress {
  width: 100%;
  height: 14px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #ebe3d5;
}

progress::-webkit-progress-bar {
  background: #ebe3d5;
}

progress::-webkit-progress-value {
  background: linear-gradient(90deg, #c17c2f 0%, var(--accent) 100%);
}

progress::-moz-progress-bar {
  background: linear-gradient(90deg, #c17c2f 0%, var(--accent) 100%);
}

.file-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.file-picker {
  display: grid;
  gap: 8px;
}

.log {
  margin: 0;
  min-height: 260px;
  max-height: 420px;
  overflow: auto;
  padding: 14px;
  border-radius: 14px;
  background: #171411;
  color: #f7f0e3;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.note {
  min-height: 1.4em;
}

code {
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
}

@media (max-width: 640px) {
  .shell {
    width: min(100vw - 20px, 900px);
    padding-top: 24px;
  }

  .panel {
    padding: 16px;
  }

  .status-row {
    flex-direction: column;
    gap: 4px;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions-main,
  .actions-secondary {
    width: 100%;
  }

  .actions-main button,
  .actions-secondary button {
    flex: 1 1 auto;
  }
}