:root {
  --bg: #f3eee4;
  --paper: #fffdf8;
  --ink: #1c1915;
  --muted: #6b6258;
  --line: #ddd4c6;
  --accent: #7a3b2e;
  --accent-hover: #632f24;
  --ok: #2d5a3a;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
}
.top {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 20px 8px;
}
.brand { display: flex; gap: 16px; align-items: center; }
.mark {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
h1 { font-size: 1.35rem; margin: 0 0 2px; font-weight: 650; }
.top p { margin: 0; color: var(--muted); font-size: 0.95rem; }
main { max-width: 920px; margin: 0 auto; padding: 12px 20px 48px; }
.panel, .out, .pages, .tools {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  margin-top: 14px;
}
.drop {
  text-align: center;
  border-style: dashed;
  border-width: 2px;
  padding: 36px 16px;
}
.drop.over { border-color: var(--accent); background: #fbf3ee; }
.lead { margin: 0 0 12px; }
.hint { margin: 12px 0 0; color: var(--muted); font-size: 0.9rem; }
kbd {
  font-family: inherit;
  border: 1px solid var(--line);
  background: #f7f1e8;
  border-radius: 4px;
  padding: 0 5px;
  font-size: 0.85em;
}
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px 16px;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}
.btn:hover { border-color: #c4b8a6; }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover { background: var(--accent-hover); }
.btn.primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.ghost { background: transparent; }
.pages {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.card img { display: block; width: 100%; height: 180px; object-fit: cover; object-position: top; }
.card .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  font-size: 0.8rem;
  color: var(--muted);
}
.card button {
  border: 0; background: none; cursor: pointer;
  color: var(--accent); font: inherit; padding: 0;
}
.tools {
  display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center;
}
.tools label { font-size: 0.92rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.tools input[type="range"] { width: 140px; }
.check { user-select: none; }
.status {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.status.err { color: var(--accent); }
.out-bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 10px; flex-wrap: wrap;
}
.out h2 { margin: 0; font-size: 1rem; }
.out-actions { display: flex; gap: 8px; }
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: "Noto Serif", "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink);
  background: #fff;
  resize: vertical;
}
footer {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 20px 32px;
  color: var(--muted);
  font-size: 0.82rem;
}
@media (max-width: 560px) {
  .tools { flex-direction: column; align-items: stretch; }
  .tools input[type="range"] { width: 100%; }
}
