/* ===== Design tokens ===== */
:root{
  --bg:#ffffff;
  --ink:#0d0d0d;
  --muted:#616161;
  --brand:#2563eb;
  --card:#f8fafc;
  --line:#e5e7eb;
  --radius:14px;
  --shadow:0 6px 24px rgba(15,23,42,.05), 0 1px 2px rgba(15,23,42,.05);
  --shadow-lg:0 10px 28px rgba(15,23,42,.08), 0 2px 4px rgba(15,23,42,.06);
}

/* ===== Base ===== */
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,'Helvetica Neue',Arial,'Noto Sans',sans-serif;
  line-height:1.6;color:var(--ink);background:var(--bg);
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
}
img,svg,video{max-width:100%;height:auto}
.container{max-width:1000px;margin:0 auto;padding:24px}
h1,h2{line-height:1.25;word-wrap:break-word}
p,li{word-wrap:break-word}

/* Links */
a{color:var(--brand);text-decoration:none}
a:hover{text-decoration:underline}

/* Skip link (a11y) */
.skip-link{position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden}
.skip-link:focus-visible{left:16px;top:16px;width:auto;height:auto;background:#fff;border:2px solid var(--brand);padding:8px;border-radius:8px}

/* ===== Header / Footer ===== */
header,footer{background:var(--card)}
header .container, footer .container{padding:18px 24px}
nav a{margin-right:16px;color:var(--ink)}
nav a:hover{text-decoration:underline}

/* ===== Hero ===== */
.hero{padding:24px;background:var(--card);border-radius:16px;margin:16px 0}

/* When the hero is used on the dark header variant, keep the card readable */
header.hero .card{
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.18);
  color:#ECF1FF;
  box-shadow:none;
}
header.hero .card a{color:#93c5fd}
header.hero .card .kicker,
header.hero .card .meta{color:#A3ACCD}

/* Avoid horizontal jiggle on small screens without forcing a dark html bg */
html,body{overflow-x:hidden}
header.hero{border-radius:0;margin:0}

/* ===== Grid ===== */
.grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
  gap:18px;
}

/* ===== Card ===== */
.card{
  padding:16px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:#fff;
  box-shadow:var(--shadow);
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  will-change:transform;
}
.card:hover{
  transform:translateY(-2px);
  border-color:#dbe2ea;
  box-shadow:var(--shadow-lg);
}

.card h3{margin:0 0 .25rem;font-size:1.05rem;line-height:1.3}
.card h3 a{color:var(--brand)}
.card h3 a:hover{text-decoration:underline}
.card p{margin:0 0 .5rem;color:var(--muted);font-size:.95rem}

.card .meta{
  display:flex;gap:.5rem;align-items:center;
  color:#64748b;font-size:.85rem;
}
.card .meta span[aria-hidden]{margin-right:.15rem}

/* ===== Forms ===== */
label{display:block;margin:8px 0 4px}
input,textarea,select{
  width:100%;padding:10px;border:1px solid var(--line);border-radius:10px;background:#fff;color:inherit;
}
input:focus-visible,textarea:focus-visible,select:focus-visible{
  outline:none;border-color:var(--brand);box-shadow:0 0 0 3px rgba(37,99,235,.15)
}
button{
  padding:10px 16px;border-radius:10px;border:1px solid var(--brand);
  background:var(--brand);color:#fff;font-weight:600;cursor:pointer;
  transition:transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
button:hover{transform:translateY(-1px);box-shadow:0 4px 10px rgba(37,99,235,.25)}
button:active{transform:translateY(0);box-shadow:none}
button:disabled{opacity:.55;cursor:not-allowed}
button:focus-visible{outline:none;box-shadow:0 0 0 3px rgba(37,99,235,.25)}

/* ===== Tables ===== */
table{border-collapse:collapse;width:100%}
td,th{border:1px solid var(--line);padding:8px;text-align:left}
th{background:#f5f7fb}

/* ===== Related tools (consolidated + refined) ===== */
.related-tools{
  margin:2rem auto;padding:1.25rem;max-width:1000px;text-align:center;
  border:1px solid #e1e5ee;background:linear-gradient(180deg, rgba(0,0,0,.03), rgba(0,0,0,.01));
  border-radius:14px;box-shadow:0 6px 16px rgba(0,0,0,.08);
}
.related-tools h2{
  margin:0 0 .75rem;font-size:1.25rem;line-height:1.2;letter-spacing:.2px;
}
.related-tools ul{
  list-style:none;margin:0;padding:0;
  display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,300px));
  gap:.75rem 1rem;justify-content:center;
}
.related-tools li a{
  display:flex;align-items:center;justify-content:space-between;gap:.5rem;
  padding:.75rem .9rem;border:1px solid #e1e5ee;border-radius:12px;
  text-decoration:none;color:inherit;background:#fff;
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.related-tools li a::after{content:"›";font-size:1.1rem;opacity:.7}
.related-tools li a:hover,
.related-tools li a:focus-visible{
  transform:translateY(-1px);background:#f9fbff;border-color:#cfd7eb;
  box-shadow:0 6px 16px rgba(0,0,0,.12);outline:none;
}
@media (max-width:420px){ .related-tools li a{padding:.9rem 1rem} }
@media (prefers-reduced-motion:reduce){
  .card, .related-tools li a, button{transition:none}
}

/* ===== Misc ===== */
footer nav a{margin-right:12px}
.small{color:var(--muted);font-size:.9rem}
.popular-list{margin:8px 0 0 18px}

/* Utility: visually-hidden for SVG-only icons with labels */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
