:root {
  --bg: #0e1013;
  --panel: #161a1f;
  --panel-2: #1c2128;
  --line: #2a313a;
  --text: #e8ecf1;
  --muted: #9aa5b1;
  --green: #38d27a;
  --amber: #e3d44a;
  --orange: #f0913a;
  --red: #ff6b6b;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--green); }
.wrap { max-width: 760px; margin: 0 auto; padding: 24px 16px 64px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; padding-bottom: 14px; margin-bottom: 26px; border-bottom: 1px solid var(--line); font-size: .95rem; }
.site-nav .brand { font-weight: 800; color: var(--text); text-decoration: none; letter-spacing: -0.01em; margin-right: 8px; }
.site-nav .brand b { color: var(--green); }
.site-nav a.t { color: var(--muted); text-decoration: none; }
.site-nav a.t:hover, .site-nav a.t[aria-current="page"] { color: var(--text); }
h1 { font-size: clamp(1.8rem, 5vw, 2.5rem); line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.02em; }
h2 { font-size: 1.3rem; margin: 40px 0 10px; letter-spacing: -0.01em; }
h3 { font-size: 1.05rem; margin: 22px 0 4px; }
p { margin: 0 0 12px; }
.lede { color: var(--muted); font-size: 1.05rem; margin-bottom: 24px; }
.mono, .out { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.note { color: var(--muted); font-size: .9rem; }

.tool { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 18px; }
.tool h2 { margin-top: 0; font-size: 1.1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { color: var(--muted); font-size: .85rem; }
input[type=text], input[type=number], select {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 12px; font: inherit; min-height: 44px; width: 100%;
}
input.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
input:focus-visible, select:focus-visible, .chip:focus-visible, .btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
input.bad { border-color: var(--red); }
.msg { color: var(--red); font-size: .9rem; min-height: 1.4em; margin-top: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chip {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px; font: inherit; font-size: .9rem; cursor: pointer; min-height: 40px;
}
.chip:hover { border-color: var(--green); }
.results { margin-top: 14px; display: grid; gap: 8px; }
.res { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.res span:first-child { color: var(--muted); }
.res .out { font-weight: 700; word-break: break-all; text-align: right; }
.big { font-size: 1.3rem; color: var(--green); }

table { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 8px 0 12px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.table-scroll { overflow-x: auto; }
.tag { display: inline-block; font-size: .75rem; line-height: 1.35; padding: 3px 9px; border-radius: 8px; border: 1px solid var(--line); }
#l-table { min-width: 700px; }
#l-table th:nth-child(1) { width: 20%; }
#l-table th:nth-child(2) { width: 13%; }
#l-table th:nth-child(3) { width: 17%; }
#l-table th:nth-child(4) { width: 25%; }
#l-table th:nth-child(5) { width: 25%; }
.tag.ok { color: var(--green); border-color: #245a3b; }
.tag.warn { color: var(--amber); border-color: #5a5624; }
.over { color: var(--orange); }
.under { color: var(--amber); }
.hit { color: var(--green); }

.cards { display: grid; gap: 12px; margin-top: 8px; }
.card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; text-decoration: none; color: var(--text); }
.card:hover { border-color: var(--green); }
.card strong { display: block; font-size: 1.1rem; margin-bottom: 2px; }
.card span { color: var(--muted); font-size: .95rem; }

footer { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
