/* Shared theme for the standalone tools under /tools/ — matches the main site
   (green accent, clean typography, light/dark). Style generic elements so each
   tool inherits the look without per-element classes. */
:root {
  --accent: #1f9d55;
  --accent-hover: #17753f;
  --bg: #ffffff;
  --bg-subtle: #f6f7f5;
  --bg-elevated: #ffffff;
  --text: #16181d;
  --muted: #5c6068;
  --border: #e4e6e1;
  --radius: 12px;
  --radius-sm: 8px;
  --good-bg: #e7f6ec; --good-fg: #1a7a3f;
  --warn-bg: #fff4e0; --warn-fg: #9a6a00;
  --bad-bg: #fdecea; --bad-fg: #b3271e;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0d0f12; --bg-subtle: #14171b; --bg-elevated: #171a1f;
    --text: #eef0ee; --muted: #a4aab2; --border: #262b31;
    --accent: #55d98a; --accent-hover: #7fe6a8;
    --good-bg: #10231a; --good-fg: #7fe6a8;
    --warn-bg: #2a220e; --warn-fg: #e6c266;
    --bad-bg: #2a1614; --bad-fg: #f0a59c;
  }
}
:root[data-theme='dark'] {
  --bg: #0d0f12; --bg-subtle: #14171b; --bg-elevated: #171a1f;
  --text: #eef0ee; --muted: #a4aab2; --border: #262b31;
  --accent: #55d98a; --accent-hover: #7fe6a8;
  --good-bg: #10231a; --good-fg: #7fe6a8;
  --warn-bg: #2a220e; --warn-fg: #e6c266;
  --bad-bg: #2a1614; --bad-fg: #f0a59c;
}

* { box-sizing: border-box; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: 2rem 1rem 5rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.tool { max-width: 900px; margin: 0 auto; }
.tool-back { display: inline-block; margin-bottom: 1.25rem; color: var(--muted); text-decoration: none; font-size: 0.92rem; }
.tool-back:hover { color: var(--accent); }
h1 { font-size: 1.9rem; letter-spacing: -0.02em; margin: 0 0 0.5rem; line-height: 1.15; }
h2 { font-size: 1.3rem; letter-spacing: -0.01em; margin: 2rem 0 0.75rem; }
p.lead { color: var(--muted); margin: 0 0 1.5rem; max-width: 65ch; }
a { color: var(--accent); }
label { font-weight: 600; display: block; margin-bottom: 0.4rem; }
textarea, input[type="text"], input[type="number"], input[type="search"], select {
  width: 100%; font: inherit; padding: 0.65rem 0.75rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-subtle); color: var(--text);
  margin-bottom: 0.75rem;
}
textarea { min-height: 150px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 0.92rem; line-height: 1.5; }
input[type="number"] { width: auto; }
button {
  cursor: pointer; font: inherit; font-weight: 600; padding: 0.6rem 1.25rem;
  border: 1px solid transparent; border-radius: 999px; background: var(--accent); color: #fff;
  margin: 0 0.4rem 0.4rem 0;
}
button:hover { background: var(--accent-hover); }
button.secondary, button.ghost {
  background: transparent; color: var(--text); border-color: var(--border);
}
button.secondary:hover, button.ghost:hover { border-color: var(--accent); color: var(--accent); background: transparent; }
.hint, .muted { color: var(--muted); font-size: 0.88rem; }
code { font-family: ui-monospace, Consolas, monospace; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 5px; padding: 0.08em 0.4em; font-size: 0.9em; }

/* tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; margin-top: 0.5rem; font-size: 0.92rem; }
th, td { border: 1px solid var(--border); padding: 0.55rem 0.7rem; text-align: left; }
th { background: var(--bg-subtle); font-weight: 700; }

/* status row/cell colors reused by the migrated tools */
.green, .google-ip { background: var(--good-bg); color: var(--good-fg); }
.orange { background: var(--warn-bg); color: var(--warn-fg); }
.red { background: var(--bad-bg); color: var(--bad-fg); }

/* boxes (kwds text-stats / instructions) */
.text-stats { background: var(--bg-subtle); border: 1px solid var(--border); padding: 1rem 1.15rem; border-radius: var(--radius); }
.text-stats p { margin: 0.25rem 0; }
.instructions { margin-top: 2.5rem; border-top: 1px solid var(--border); padding-top: 1.5rem; color: var(--muted); }
.instructions h2 { color: var(--text); }
