:root {
  --bg: #0f1419;
  --surface: #1a222d;
  --surface2: #243040;
  --border: #2f3d4f;
  --text: #e8eef6;
  --muted: #9aabbd;
  --accent: #3d9cf0;
  --accent-hover: #5aaff5;
  --ok: #3ecf8e;
  --warn: #f0b429;
  --danger: #f07178;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; }
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: .5rem 1rem; z-index: 100;
}
.skip:focus { left: 0; }
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .75rem 1.25rem;
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.logo {
  font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none;
}
.logo span { color: var(--accent); }
.nav-tools {
  display: flex; flex-wrap: wrap; gap: .35rem .65rem;
  font-size: .82rem;
}
.nav-tools a { color: var(--muted); text-decoration: none; }
.nav-tools a:hover, .nav-tools a[aria-current="page"] { color: var(--accent); }
main { flex: 1; max-width: 1100px; width: 100%; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.hero { margin-bottom: 1.75rem; }
.hero h1 { margin: 0 0 .5rem; font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.2; }
.hero .lead { color: var(--muted); margin: 0; max-width: 42rem; font-size: 1.05rem; }
.badge {
  display: inline-block; font-size: .75rem; font-weight: 600;
  background: var(--surface2); color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: .15rem .6rem; margin-bottom: .75rem;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.panel h2 { margin: 0 0 1rem; font-size: 1.15rem; }
.tool-grid { display: grid; gap: 1rem; }
@media (min-width: 720px) {
  .tool-grid.two { grid-template-columns: 1fr 1fr; }
}
label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: .35rem; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; margin-top: .15rem; }
input[type="text"], input[type="url"], input[type="number"], input[type="email"],
input[type="search"], input[type="date"], input[type="color"],
select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: .6rem .75rem;
  font: inherit;
  margin-bottom: .85rem;
}
textarea { min-height: 140px; resize: vertical; font-family: var(--mono); font-size: .88rem; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.row > * { flex: 1; min-width: 140px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  background: var(--accent); color: #061018; border: none;
  font: inherit; font-weight: 700; padding: .65rem 1.1rem;
  border-radius: 8px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--accent-hover); color: #061018; }
.btn-secondary {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: transparent; }
.btn-upgrade {
  background: linear-gradient(135deg, #f0b429, #e89a1a);
  color: #1a1200;
}
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: .5rem 0 0; }
.output {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  font-family: var(--mono);
  font-size: .85rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 420px;
  overflow: auto;
  margin-top: .75rem;
}
.output:empty { display: none; }
.status { font-size: .9rem; color: var(--muted); margin: .5rem 0; }
.status.ok { color: var(--ok); }
.status.err { color: var(--danger); }
.status.warn { color: var(--warn); }
.table-wrap { overflow-x: auto; margin-top: .75rem; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .5rem .65rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; }
.faq { margin-top: 2rem; }
.faq h2 { margin-bottom: 1rem; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .75rem 1rem;
  margin-bottom: .6rem;
}
.faq summary { cursor: pointer; font-weight: 600; }
.faq details[open] summary { margin-bottom: .5rem; }
.faq p { margin: 0; color: var(--muted); }
.note {
  font-size: .85rem; color: var(--muted);
  border-left: 3px solid var(--border);
  padding-left: .75rem; margin: 1rem 0;
}
.attr {
  font-size: .8rem; color: var(--muted);
  background: var(--surface2);
  border-radius: 8px; padding: .75rem 1rem; margin-top: 1rem;
}
.card-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex; flex-direction: column; gap: .4rem;
  text-decoration: none; color: inherit;
  transition: border-color .15s;
}
.card:hover { border-color: var(--accent); }
.card h3 { margin: 0; font-size: 1rem; color: var(--text); }
.card p { margin: 0; font-size: .88rem; color: var(--muted); flex: 1; }
.card .card-link { font-size: .82rem; font-weight: 600; color: var(--accent); }
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1.5rem 1.25rem 2rem;
  margin-top: auto;
}
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-inner h2 { font-size: .95rem; margin: 0 0 .75rem; color: var(--muted); font-weight: 600; }
.footer-links {
  display: flex; flex-wrap: wrap; gap: .35rem .85rem;
  font-size: .82rem; margin-bottom: 1rem;
}
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-copy { font-size: .78rem; color: var(--muted); margin: 0; }
.upgrade-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin: 1.5rem 0;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
}
.upgrade-box p { margin: 0; color: var(--muted); font-size: .92rem; max-width: 36rem; }
.upgrade-box strong { color: var(--text); }
.canvas-wrap {
  background: #fff; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border); max-width: 100%;
}
canvas { display: block; max-width: 100%; height: auto; }
.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;
}
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.chip {
  font-size: .78rem; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 999px; padding: .2rem .55rem; color: var(--muted);
}
.list-clean { list-style: none; padding: 0; margin: 0; }
.list-clean li {
  padding: .55rem .7rem; border-bottom: 1px solid var(--border); font-size: .9rem;
}
.list-clean li:last-child { border-bottom: none; }
.sev-high { color: var(--danger); }
.sev-med { color: var(--warn); }
.sev-low { color: var(--ok); }
@media (max-width: 640px) {
  .nav-tools { display: none; }
}
