:root {
  --bg: #f6f7fb;
  --card: #fff;
  --ink: #1d2433;
  --muted: #5f6b7d;
  --brand: #4f46e5;
  --line: #e4e7ec;
  --ok: #15803d;
  --warn: #b45309;
  --bad: #dc2626;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
header.site { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
header.site .wrap { display: flex; align-items: center; gap: 16px; min-height: 56px; }
.brand { font-weight: 800; color: var(--ink); text-decoration: none; font-size: 1.15rem; white-space: nowrap; }
header nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
header nav a { padding: 6px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; white-space: nowrap; font-size: .92rem; }
header nav a:hover, header nav a[aria-current] { background: #eef2ff; color: var(--brand); }
main { padding: 24px 0 40px; min-height: 60vh; }
h1 { font-size: 1.9rem; line-height: 1.25; margin: .2em 0 .4em; }
h2 { font-size: 1.25rem; margin: 1.8em 0 .5em; }
.crumbs { font-size: .88rem; color: var(--muted); margin: 0; }
.crumbs a { color: var(--muted); }
.lead { color: var(--muted); font-size: 1.05rem; max-width: 70ch; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin: 18px 0; }
.sub { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.sub:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.sec-title { font-weight: 700; margin: 0 0 10px; font-size: 1.02rem; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: .92rem; color: var(--muted); font-weight: 600; }
input, select, textarea {
  font: inherit; font-size: 1rem; padding: 10px 12px; border: 1px solid #d0d5dd;
  border-radius: 10px; color: var(--ink); background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #c7d2fe; border-color: var(--brand); }
textarea { min-height: 220px; resize: vertical; }
.result { font-size: 1.4rem; font-weight: 800; color: var(--brand); margin: 12px 0 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 16px; }
.card { background: linear-gradient(135deg, #eef2ff, #f5f3ff); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; }
.card span { font-size: .85rem; color: var(--muted); }
.card strong { font-size: 1.35rem; margin-top: 2px; word-break: break-word; }
.card.good strong { color: var(--ok); }
.card.bad strong { color: var(--bad); }
.warn { color: var(--warn); font-weight: 600; }
.muted { color: var(--muted); }
.bar { height: 14px; background: #e0e7ff; border-radius: 99px; overflow: hidden; margin-top: 16px; }
.bar span { display: block; height: 100%; background: var(--brand); transition: width .3s; }
.legend { font-size: .9rem; color: var(--muted); margin: 8px 0 0; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 4px 0 12px; }
.dot.p { background: var(--brand); }
.dot.i { background: #e0e7ff; }
.ad { margin: 20px 0; min-height: 100px; text-align: center; }
.ad-placeholder {
  display: flex; align-items: center; justify-content: center; background: #f2f4f7;
  border: 1px dashed #d0d5dd; border-radius: 12px; color: #98a2b3; font-size: .85rem; min-height: 100px;
}
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 18px; }
.tool {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px;
  text-decoration: none; color: var(--ink); display: block; transition: transform .15s, box-shadow .15s;
}
.tool:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16, 24, 40, .08); }
.tool .ico { font-size: 1.8rem; }
.tool h3 { margin: .3em 0 .2em; font-size: 1.05rem; }
.tool p { margin: 0; color: var(--muted); font-size: .92rem; }
.prose p, .prose li { max-width: 70ch; }
.prose code { background: #eef2f7; padding: 1px 6px; border-radius: 6px; font-size: .92em; word-break: break-word; }
details { border-top: 1px solid var(--line); padding: 12px 0; }
details:last-child { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; }
footer.site { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; padding: 20px 0; background: #fff; }
footer.site a { color: var(--muted); }
footer.site p { margin: 4px 0; }
@media (max-width: 600px) {
  h1 { font-size: 1.5rem; }
  .brand { font-size: 1rem; }
}
