/* Global styles + CSS variables. Dark mode follows the OS preference. */

:root {
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --bg-card: #ffffff;
  --text: #1a2027;
  --text-muted: #5c6670;
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-text: #ffffff;
  --border: #dde2e8;
  --danger: #dc2626;
  --ok: #16a34a;
  --diff-add: #dcfce7;
  --diff-del: #fee2e2;
  --radius: 8px;
  --font-mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10151b;
    --bg-alt: #171e26;
    --bg-card: #1b232d;
    --text: #e6eaee;
    --text-muted: #96a1ac;
    --accent: #2dd4bf;
    --accent-hover: #5eead4;
    --accent-text: #0b1215;
    --border: #2c3946;
    --danger: #f87171;
    --ok: #4ade80;
    --diff-add: #14351f;
    --diff-del: #3d1a1a;
  }
}

* { 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, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Header ---- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.site-header nav {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.7rem 1rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.site-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}
.site-logo:hover { text-decoration: none; color: var(--accent); }
.crumb { color: var(--text-muted); font-size: 0.95rem; }

/* ---- Layout ---- */
main {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.2rem 1rem 3rem;
}

h1 { font-size: 1.6rem; margin: 0.6rem 0 0.25rem; }
.tool-desc { color: var(--text-muted); margin: 0 0 1.2rem; }

/* ---- Controls ---- */
button, .btn {
  font: inherit;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
}
button:hover, .btn:hover { border-color: var(--accent); }
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}
button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

textarea, input[type="text"], input[type="number"], input[type="datetime-local"], select {
  font: inherit;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
}
textarea {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  resize: vertical;
  min-height: 220px;
}
textarea:focus, input:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

/* ---- Ad slots ---- */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.2rem auto;
  background: var(--bg-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.8rem;
  overflow: hidden;
}
.ad-slot:empty::after { content: ""; }
.ad-leaderboard { max-width: 728px; min-height: 90px; }
.ad-rect { max-width: 300px; min-height: 250px; }
body.ad-free .ad-slot { display: none; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-muted);
  font-size: 0.85rem;
}
.site-footer .inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.2rem 1rem;
}
.site-footer .tool-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  padding: 0;
  margin: 0 0 0.8rem;
  list-style: none;
}
