/* MetaScrub — editorial utilitarian theme */
:root {
  --bg: #f5f1e8;
  --bg-soft: #efe8d9;
  --bg-card: #fffdf7;
  --border: #d9cfba;
  --border-strong: #c3b697;
  --text: #23201a;
  --text-dim: #6d6455;
  --accent: #a8412a;
  --accent-soft: #efdccf;
  --ink: #23201a;
  --danger: #a8412a;
  --danger-dim: #f2ddd4;
  --ok: #3f6b3a;
  --ok-dim: #e2ebda;
  --warn: #8a6d1f;
  --radius: 5px;
  --max: 760px;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", "Consolas", "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191612;
    --bg-soft: #211d17;
    --bg-card: #221e18;
    --border: #38312a;
    --border-strong: #4c4238;
    --text: #ece4d5;
    --text-dim: #a2957f;
    --accent: #d8714f;
    --accent-soft: #38251c;
    --ink: #ece4d5;
    --danger: #d8714f;
    --danger-dim: #37231c;
    --ok: #9bbd7f;
    --ok-dim: #26301d;
    --warn: #cdaa5b;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------- header ---------- */
header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
header .wrap { display: flex; align-items: center; min-height: 56px; padding-top: 0; }
.logo {
  font-family: var(--serif);
  font-weight: 600; font-size: 22px; letter-spacing: -0.01em;
  color: var(--text); text-decoration: none; margin-right: 16px; flex-shrink: 0;
}
.logo span { color: var(--accent); font-style: italic; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: var(--radius); padding: 5px 10px; cursor: pointer; color: var(--text-dim); font-size: 13px; font-family: var(--sans); margin-left: auto; }
nav { display: flex; gap: 2px; flex-wrap: wrap; align-items: center; margin-left: auto; }
nav a {
  color: var(--text-dim); text-decoration: none; font-size: 13px;
  padding: 4px 6px; border-radius: 4px;
}
nav a:hover { color: var(--text); background: var(--bg-soft); }

@media (max-width: 700px) {
  .nav-toggle { display: block; }
  nav { display: none; width: 100%; flex-direction: column; padding: 8px 0 12px; gap: 0; }
  nav.open { display: flex; }
  nav a { font-size: 15px; padding: 10px 0; border-bottom: 1px solid var(--border); border-radius: 0; width: 100%; }
  nav a:last-child { border-bottom: none; }
}

/* ---------- hero ---------- */
.hero { padding: 56px 0 20px; }
h1 {
  font-family: var(--serif);
  font-size: clamp(33px, 5.5vw, 50px); line-height: 1.08;
  margin: 0 0 18px; letter-spacing: -0.015em; font-weight: 600;
  max-width: 14ch;
}
.sub { color: var(--text-dim); font-size: 19px; max-width: 60ch; margin: 0; }
.badges {
  display: flex; gap: 8px 20px; flex-wrap: wrap; margin-top: 24px;
  padding-top: 18px; border-top: 1px solid var(--border);
}
.badge {
  font-size: 12px; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--text-dim); font-weight: 600; position: relative;
}
.badge::before { content: "\2713"; color: var(--accent); margin-right: 7px; font-weight: 700; }

/* ---------- dropzone ---------- */
.drop {
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 46px 24px; text-align: center; cursor: pointer;
  background: var(--bg-card); transition: .15s; margin: 30px 0 20px;
  box-shadow: 0 1px 0 var(--border);
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop h2 { font-family: var(--sans); margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.drop p { margin: 0; color: var(--text-dim); font-size: 14px; }
.drop svg { margin-bottom: 14px; opacity: .5; color: var(--accent); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--ink); color: var(--bg); border: 1px solid var(--ink);
  padding: 10px 20px; border-radius: var(--radius); font-size: 15px; font-weight: 600;
  cursor: pointer; text-decoration: none; font-family: inherit;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border-strong); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); background: transparent; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 20px 0; }

/* ---------- privacy meter ---------- */
.privacy-meter {
  display: flex; align-items: center; gap: 11px;
  background: transparent; border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0; padding: 11px 15px; margin: 4px 0 10px;
  font-size: 14.5px; color: var(--text); font-family: var(--mono);
}
.privacy-meter .dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--accent);
}
.privacy-meter a { color: var(--accent); font-weight: 600; }

/* ---------- results ---------- */
.file-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
}
.file-head { display: flex; align-items: center; gap: 14px; }
.thumb {
  width: 52px; height: 52px; border-radius: 4px; object-fit: cover;
  background: var(--bg-soft); flex: none; border: 1px solid var(--border);
}
.fname { font-weight: 600; font-size: 15px; word-break: break-all; }
.fmeta { color: var(--text-dim); font-size: 13px; font-family: var(--mono); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.tag {
  font-size: 12px; padding: 3px 9px; border-radius: 3px; font-family: var(--mono);
  background: var(--bg-soft); color: var(--text-dim); border: 1px solid var(--border);
}
.tag.bad { background: var(--danger-dim); color: var(--danger); border-color: transparent; }
.tag.ok { background: var(--ok-dim); color: var(--ok); border-color: transparent; }

table.meta { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 14px; }
table.meta td { padding: 7px 8px; border-top: 1px solid var(--border); vertical-align: top; }
table.meta td:first-child { color: var(--text-dim); width: 42%; font-family: var(--mono); font-size: 13px; }
.gps-alert {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--danger-dim); color: var(--danger);
  font-size: 14px; border: 1px solid transparent;
}
.gps-alert a { color: inherit; font-weight: 600; }

/* ---------- options ---------- */
.opts { display: flex; gap: 22px; flex-wrap: wrap; font-size: 14.5px; color: var(--text-dim); align-items: center; }
.opts label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.opts select {
  background: var(--bg-card); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: 4px; padding: 5px 8px; font: inherit; font-size: 14px;
}
.opts input[type=range] { vertical-align: middle; accent-color: var(--accent); }

/* ---------- content ---------- */
main section { padding: 38px 0; border-top: 1px solid var(--border); }
main section:first-of-type { border-top: 0; }
h2 { font-family: var(--serif); font-size: 29px; letter-spacing: -0.01em; margin: 0 0 16px; font-weight: 600; }
h3 { font-family: var(--serif); font-size: 21px; margin: 30px 0 8px; font-weight: 600; }
main p { margin: 0 0 15px; }
ul, ol { padding-left: 22px; }
li { margin-bottom: 8px; }
a { color: var(--accent); text-underline-offset: 2px; }
code { font-family: var(--mono); font-size: .88em; background: var(--bg-soft); padding: 1px 5px; border-radius: 3px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 38px 0; }

.callout {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 15px 18px; border-radius: 0 var(--radius) var(--radius) 0; margin: 20px 0;
}
.callout p:last-child { margin: 0; }

details {
  border: 0; border-bottom: 1px solid var(--border);
  padding: 15px 2px; margin: 0; background: transparent;
}
details summary { cursor: pointer; font-weight: 600; font-size: 16px; }
details p { margin: 12px 0 0; color: var(--text-dim); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0; border-top: 1px solid var(--border); }
.card {
  background: transparent; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
  border-radius: 0; padding: 20px 20px 20px 0; text-decoration: none; color: var(--text);
  display: block;
}
.card:nth-child(odd) { padding-right: 24px; }
.card:hover h3 { color: var(--accent); }
.card h3 { font-family: var(--serif); margin: 0 0 6px; font-size: 18px; }
.card p { margin: 0; color: var(--text-dim); font-size: 14.5px; }

/* ---------- ad slot ---------- */
.ad-slot {
  margin: 32px 0; min-height: 90px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-dim); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  font-family: var(--mono);
}

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--border-strong); margin-top: 56px;
  padding: 30px 0 48px; color: var(--text-dim); font-size: 14px;
}
footer .wrap { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
footer a { color: var(--text-dim); text-decoration: none; border-bottom: 1px solid transparent; }
footer a:hover { color: var(--text); border-bottom-color: var(--accent); }
footer .spacer { margin-left: auto; }

.article-meta { color: var(--text-dim); font-size: 14px; margin-bottom: 28px; font-family: var(--mono); }

/* ---------- tool pages (word-to-pdf, pdf-to-word) ---------- */
.drop-zone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  padding: 48px 24px; text-align: center; cursor: pointer;
  color: var(--text-dim); font-size: 16px; margin: 16px 0;
  transition: border-color .15s, background .15s;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent); background: var(--accent-soft);
}
.file-label {
  color: var(--accent); font-weight: 600; cursor: pointer;
  border-bottom: 1px solid var(--accent);
}
.meta-table {
  width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 12px;
}
.meta-table td {
  padding: 7px 8px; border-top: 1px solid var(--border); vertical-align: top;
}
.meta-table td:first-child {
  color: var(--text-dim); width: 40%; font-family: var(--mono); font-size: 13px;
}
.note { color: var(--text-dim); font-size: 13px; font-style: italic; }
.doc-preview {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; max-height: 400px; overflow-y: auto; font-size: 14px; line-height: 1.6;
}
.doc-preview pre {
  white-space: pre-wrap; word-break: break-word; font-family: var(--sans);
  font-size: 14px; margin: 0;
}
.page-preview { margin-bottom: 24px; }
.page-preview strong { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.toolbar { margin-top: 16px; }
.pm-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ok);
  display: inline-block;
}
.pm-label { font-family: var(--mono); font-size: 14px; }
