:root {
  --bg: #f4ede3;
  --card: #fffaf4;
  --ink: #2a211c;
  --muted: #6d6158;
  --faint: #8a7c72;
  --line: #e4d8cc;
  --line-strong: #d3c4b4;
  --accent: #c45c26;
  --accent-press: #9a4318;
  --paper: #f7f1e8;
  --good: #2f6b4f;
  --bad: #9a3b32;
  --shadow: 0 16px 40px rgba(42, 33, 28, 0.08);
  color-scheme: light;
  font-family: "Segoe UI", "Segoe UI Variable Text", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
}

body { min-height: 100vh; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.app {
  width: min(760px, calc(100% - 24px));
  margin: 0 auto;
  padding: 14px 0 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 8px 4px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 0 0 auto;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex: 0 0 auto;
  object-fit: cover;
}

.brand span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand strong {
  font-family: Georgia, serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--accent);
  line-height: 1.1;
}

.brand em {
  font-style: normal;
  font-size: 13px;
  color: var(--muted);
}

.aside-note {
  margin: 0;
  max-width: 16rem;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

h1 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}


.stage {
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drop {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-height: 96px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.72), rgba(255, 250, 244, 0.88)),
    url("../img/drop.jpg") center/cover;
}

.drop.is-over {
  border-style: solid;
  border-color: var(--accent);
}

.drop-title {
  margin: 0 0 4px;
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 500;
}

.drop-text, .micro, .hint, .result {
  margin: 0;
  color: var(--muted);
}

.drop-text { max-width: 360px; }

.drop-actions, .inline, .chips, .label-row, .list-head, .switch-row {
  display: flex;
  align-items: center;
}

.drop-actions, .chips { gap: 6px; flex-wrap: wrap; }
.inline { gap: 8px; flex-wrap: wrap; }
.label-row, .list-head, .switch-row { justify-content: space-between; gap: 12px; }
.list-head { margin: 16px 2px 8px; }
.hint { min-height: 18px; margin-top: 8px; }
.hint.is-bad { color: var(--bad); }

.progress {
  height: 3px;
  background: transparent;
  margin-bottom: 4px;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 99px;
}

.files {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 180px;
  min-height: 72px;
  overflow: auto;
}

.file {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 2px;
  border-top: 1px solid var(--line);
}

.file-name, .file-path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-name { font-weight: 600; }
.file-path, .file-meta { color: var(--faint); font-size: 12px; }
.file-meta { text-align: right; }
.file-status { color: var(--muted); font-size: 12px; text-align: right; }
.file-status.is-ok { color: var(--good); }
.file-status.is-bad { color: var(--bad); }

.icon-btn {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--faint);
}

.icon-btn:hover { background: var(--paper); color: var(--ink); }

.field { display: flex; flex-direction: column; gap: 8px; }

.label, .label-row label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

output { color: var(--ink); font-variant-numeric: tabular-nums; }

.seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  background: var(--paper);
  border-radius: 14px;
}

.seg-btn, .btn, .chip {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 12px;
}

.seg-btn {
  height: 34px;
  color: var(--muted);
}

.seg-btn[aria-checked="true"] {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(42, 33, 28, 0.08);
}

.btn {
  height: 36px;
  padding: 0 14px;
  border-color: var(--line-strong);
  background: #fff;
  border-radius: 999px;
}

.btn:hover { border-color: var(--accent); }

.btn-primary {
  height: 48px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fffaf4;
  font-size: 17px;
  gap: 10px;
  justify-content: center;
  width: 100%;
}

.run-arrow {
  font-size: 20px;
  line-height: 1;
}

.btn-primary:hover { background: var(--accent-press); }

.btn-primary:disabled, .btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.btn-ghost, .btn-quiet { background: transparent; }
.btn-quiet { padding: 0 6px; color: var(--muted); }

.chip {
  height: 28px;
  padding: 0 10px;
  border-color: var(--line);
  color: var(--muted);
  background: #fff;
  border-radius: 999px;
}

.chip.is-on {
  border-color: var(--accent);
  color: var(--ink);
}

input[type="number"] {
  width: 76px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
}

input[type="range"] {
  width: 100%;
  height: 16px;
  margin: 0;
  appearance: none;
  background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  background: var(--line-strong);
  border-radius: 99px;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--accent);
}

.unit { color: var(--muted); }
.size-row[hidden] { display: none; }
.switch-row .micro { margin-top: 3px; }

.switch {
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: #d3c4b4;
  position: relative;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
}

.switch.is-on { background: var(--accent); }
.switch.is-on::after { left: 21px; }
.is-dim { opacity: 0.45; }
.result:empty { display: none; }
.result.is-ok { color: var(--good); }
.result.is-bad { color: var(--bad); }
.result-link { align-self: flex-start; padding-left: 0; }

.settings-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 8px;
  padding: 10px 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-toggle .chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  margin-right: 6px;
}

.settings-toggle[aria-expanded="true"] .chevron {
  transform: rotate(-135deg);
  margin-top: 6px;
}

.settings {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 0 12px;
  border-top: 1px solid var(--line);
}

.settings[hidden] { display: none; }

.actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 860px) {
  .topbar { align-items: flex-start; }
  .aside-note { display: none; }
  .files { max-height: 140px; }
  .drop { flex-direction: column; align-items: flex-start; }
}
