:root {
  --bg: #ffffff;
  --surface: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #475569;
  --accent: #111827;
  --accent-soft: #f1f5f9;
  --good: #047857;
  --good-bg: #ecfdf5;
  --radius: 10px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px; }

.site-header { border-bottom: 1px solid var(--border); padding: 14px 0; }
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 16px; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.badge {
  font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--muted); border: 1px solid var(--border);
}
.top-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }
.top-nav a { text-decoration: none; color: var(--muted); }
.top-nav a:hover { color: var(--text); text-decoration: underline; }

main.wrap { padding-top: 28px; padding-bottom: 56px; }
.hero { margin-bottom: 22px; }
.hero h1 { font-size: 28px; line-height: 1.25; margin: 0 0 8px; letter-spacing: -0.02em; }
.hero p { margin: 0; color: var(--muted); font-size: 15px; max-width: 740px; }

.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 24px;
}
.tool-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; }
.controls { display: flex; flex-direction: column; gap: 14px; }
.control-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
select, input[type="number"], input[type="text"] {
  width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; background: #fff; color: var(--text);
}
.custom-fields { min-width: 0; margin: 0; padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
.custom-fields legend { padding: 0 4px; font-size: 13px; font-weight: 600; }
.architecture-row { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 10px; }

.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-self: start; }
.stat-box { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.stat-box.highlight { background: var(--good-bg); border-color: #a7f3d0; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 22px; font-weight: 700; font-family: var(--font-mono); margin-top: 2px; overflow-wrap: anywhere; }
.stat-box.highlight .stat-value { color: var(--good); }
.stat-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.command-panel { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.toolbar .field-label { margin: 0 4px 0 0; }
.toolbar select { width: auto; font-family: var(--font-mono); font-size: 13px; padding: 7px 10px; }
.btn {
  padding: 7px 12px; border-radius: 7px; border: 1px solid var(--border);
  background: #fff; color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer;
}
.btn:hover:not(:disabled) { background: var(--accent-soft); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-primary, .btn-primary:hover:not(:disabled) { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { opacity: 0.9; }
#launchTargetField { margin-top: 10px; }
.command-box, .formula-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; font-family: var(--font-mono); font-size: 13px; overflow-wrap: anywhere;
}
.command-box { margin: 10px 0 0; white-space: pre-wrap; }
.command-box code { font: inherit; }
.command-box:has(code:empty) { display: none; }
#launchNote { margin: 8px 0 0; overflow-wrap: anywhere; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
h2 { font-size: 20px; margin: 0; letter-spacing: -0.01em; }
.meta-note { font-size: 12.5px; color: var(--muted); }
.table-note, .method-note { margin: 12px 0 0; }
.method-note { font-size: 14px; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
thead th { background: var(--surface); font-weight: 600; color: var(--muted); font-size: 12.5px; }
tbody th { font-weight: 500; }
.num { text-align: right; font-family: var(--font-mono); }
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; border: 1px solid; border-radius: 999px; }
.pill.fits { color: var(--good); background: var(--good-bg); border-color: #a7f3d0; }
.pill.partial { color: #854d0e; background: #fefce8; border-color: #fde68a; }
.pill.oom { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }

.cross-link {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  padding: 12px 16px; margin-bottom: 24px; font-size: 14px; font-weight: 600;
}
.resource-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.resource-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--surface);
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
}
.resource-card h2 { margin-bottom: 4px; font-size: 15.5px; }
.resource-card p { margin: 0; font-size: 13.5px; color: var(--muted); }
.resource-link {
  align-self: flex-start; padding: 7px 12px; border-radius: 7px; background: var(--accent);
  color: #fff; text-decoration: none; font-size: 13px; font-weight: 600;
}

.faq-list { display: grid; gap: 14px; }
.faq-item { border-bottom: 1px solid var(--border); padding-bottom: 14px; }
.faq-item:last-child { border-bottom: none; padding-bottom: 0; }
.faq-item h3 { font-size: 15.5px; margin: 0 0 6px; }
.faq-item p { margin: 0; font-size: 14px; color: var(--muted); }

.site-footer { border-top: 1px solid var(--border); padding: 20px 0; font-size: 13px; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

@media (max-width: 820px) { .tool-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .resource-grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) {
  .wrap { padding-right: 14px; padding-left: 14px; }
  .card { padding: 14px; }
  .control-row { align-items: end; }
  .stat-value { font-size: 18px; }
}
