:root {
  --bg: #f7faf3;
  --surface: #ffffff;
  --surface-2: #f1f5ec;
  --text: #0f172a;
  --muted: #475569;
  --border: #d9e2cf;
  --accent: #4d7c0f;
  --accent-strong: #3f6212;
  --accent-soft: #ecfccb;
  --on-accent: #ffffff;
  --danger: #b91c1c;
  --ok: #047857;
  --code-bg: #f8fafc;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .05);
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1206; --surface: #121a0c; --surface-2: #18220f; --text: #f1f5f9; --muted: #a3b18f;
    --border: #2b3a1c; --accent: #bef264; --accent-strong: #d9f99d; --accent-soft: #1f2d10; --on-accent: #0b1206;
    --danger: #f87171; --ok: #34d399; --code-bg: #0e150a; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1206; --surface: #121a0c; --surface-2: #18220f; --text: #f1f5f9; --muted: #a3b18f;
  --border: #2b3a1c; --accent: #bef264; --accent-strong: #d9f99d; --accent-soft: #1f2d10; --on-accent: #0b1206;
  --danger: #f87171; --ok: #34d399; --code-bg: #0e150a; --shadow: none; color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
a:hover { color: var(--accent-strong); }
img { max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 18px; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand span b { color: var(--accent); }
.site-nav { margin-left: auto; display: flex; gap: 16px; flex-wrap: wrap; font-size: 15px; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
main { padding: 28px 0 48px; }
.hero { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; }
.hero img { width: 64px; height: 64px; flex: none; }
h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
.lede { color: var(--muted); margin: 8px 0 20px; max-width: 760px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.badges li { background: var(--accent-soft); color: var(--text); border-radius: 999px; padding: 4px 12px; font-size: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.tool { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tool.single { grid-template-columns: 1fr; }
@media (max-width: 820px) { .tool { grid-template-columns: 1fr; } }
.pane { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pane-head h2 { font-size: 16px; margin: 0; }
textarea, .output {
  width: 100%; min-height: 340px; resize: vertical; border: 1px solid var(--border); border-radius: 10px;
  background: var(--code-bg); color: var(--text); padding: 12px; font: 13.5px/1.5 var(--mono); tab-size: 2;
}
.output { white-space: pre-wrap; word-break: break-word; overflow: auto; margin: 0; }
textarea:focus, button:focus-visible, select:focus-visible, input:focus-visible, .drop:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.opts { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--muted); }
.opts label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
select, input[type="text"], input[type="number"], input[type="url"], input[type="search"] {
  border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 14px;
}
button, .btn {
  appearance: none; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); border-radius: 10px;
  padding: 8px 14px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
button.secondary, .btn.secondary { background: transparent; color: var(--accent); }
button:disabled { opacity: .5; cursor: not-allowed; }
.drop {
  border: 2px dashed var(--border); border-radius: 12px; padding: 22px 16px; text-align: center; color: var(--muted);
  background: var(--surface-2); cursor: pointer;
}
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { color: var(--text); }
.status { font-size: 14px; color: var(--muted); min-height: 1.5em; }
.status.error { color: var(--danger); }
.status.ok { color: var(--ok); }
.files { list-style: none; margin: 0; padding: 0; font-size: 14px; display: grid; gap: 6px; }
.files li { display: flex; justify-content: space-between; gap: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; background: var(--surface); }
.files li .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files li .meta { color: var(--muted); white-space: nowrap; }
.table-wrap { overflow: auto; max-height: 360px; border: 1px solid var(--border); border-radius: 10px; }
table.preview { border-collapse: collapse; font-size: 13px; width: max-content; min-width: 100%; }
table.preview th, table.preview td { border-bottom: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.preview th { position: sticky; top: 0; background: var(--surface-2); }
.upsell { margin-top: 24px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; border-left: 4px solid var(--accent); }
.upsell p { margin: 0; flex: 1 1 320px; }
section.content { margin-top: 32px; max-width: 820px; }
section.content h2 { font-size: 22px; margin: 28px 0 8px; }
section.content h3 { font-size: 17px; margin: 18px 0 4px; }
details { border-bottom: 1px solid var(--border); padding: 10px 0; }
details summary { cursor: pointer; font-weight: 600; }
details p { margin: 8px 0 0; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tile { display: flex; gap: 14px; align-items: flex-start; text-decoration: none; color: var(--text); }
.tile img { width: 56px; height: 56px; flex: none; }
.tile h3 { margin: 0 0 4px; font-size: 17px; }
.tile p { margin: 0; color: var(--muted); font-size: 14px; }
.tile:hover h3 { color: var(--accent); }
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; padding: 20px 0 32px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* HTML table tool: list of tables found */
.table-list { list-style: none; margin: .5rem 0; padding: 0; display: grid; gap: .25rem; }
.table-list li { display: flex; align-items: center; gap: .5rem; }
.table-list input { width: 1.1rem; height: 1.1rem; flex: none; }
.linklike { background: none; border: 0; padding: .2rem 0; color: inherit; text-align: left; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font: inherit; }
.linklike.active { font-weight: 700; text-decoration: none; }
.preview td.num { text-align: right; font-variant-numeric: tabular-nums; }
/* Link Extractor */
.opts .wide { flex: 1 1 100%; }
.opts .wide input { flex: 1; min-width: 0; }
.opts p.meta { flex: 1 1 100%; margin: 0; }
.domain-list { list-style: none; margin: .25rem 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.domain-list li { font-size: 13px; padding: .15rem .55rem; border-radius: 999px; background: var(--accent-soft); color: var(--text); overflow-wrap: anywhere; }
.preview td a { overflow-wrap: anywhere; }
.meta:empty { display: none; }
/* CSV & Excel to JSON */
.col-list { list-style: none; margin: .25rem 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.col-list li { font-size: 13px; padding: .15rem .55rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow-wrap: anywhere; }
.col-list .meta { color: var(--muted); }
.opts label[hidden] { display: none; }
[hidden] { display: none !important; }
/* Markdown to PDF */
.paper { background: #fff; color: #1f2328; border: 1px solid var(--border); border-radius: 10px; padding: 20px 24px; min-height: 340px; max-height: 640px; overflow: auto; }
@media (max-width: 480px) { .paper { padding: 14px; } }
.notes { margin: 0; padding-left: 1.2em; font-size: 14px; color: var(--muted); }
.notes:empty { display: none; }
.tool > .card { min-width: 0; }
