:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --ink: #1c2530;
  --muted: #5d6b7a;
  --line: #dde3ea;
  --brand: #b4451f;
  --brand-2: #d9663a;
  --accent: #1769aa;
  --ok: #1f8a4c;
  --bad: #c0392b;
  --shadow: 0 1px 3px rgba(20,30,45,.08), 0 6px 18px rgba(20,30,45,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, "Noto Sans", "Microsoft YaHei", "Malgun Gothic", "Noto Sans CJK KR", "Noto Sans CJK JP", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }

/* Top bar */
#fd-topbar {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, #2a3340, #222a35);
  color: #fff; box-shadow: var(--shadow);
}
.fd-bar-inner {
  max-width: 1080px; margin: 0 auto; padding: 10px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.fd-brand { font-weight: 700; font-size: 16px; color: #fff; letter-spacing: .2px; white-space: nowrap; }
.fd-bar-right { display: flex; align-items: center; gap: 10px; }
.fd-lang-wrap { display: flex; align-items: center; gap: 6px; color: #cfd6df; font-size: 12px; }
.fd-lang {
  background: #36404d; color: #fff; border: 1px solid #46525f; border-radius: 6px;
  padding: 4px 6px; font-size: 12px;
}
.fd-btn {
  background: var(--brand); color: #fff; border-radius: 6px; padding: 6px 12px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.fd-btn:hover { background: var(--brand-2); }
.fd-btn-mail { background: var(--accent); }
.fd-btn-mail:hover { background: #1f7fc2; }

/* Layout */
.wrap { max-width: 1080px; margin: 0 auto; padding: 22px 18px 60px; }
.tagline { color: var(--muted); margin: 4px 0 18px; }

/* Module grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; box-shadow: var(--shadow); transition: transform .12s, border-color .12s;
  display: flex; flex-direction: column; gap: 6px;
}
.card:hover { transform: translateY(-2px); border-color: var(--brand-2); }
.card h3 { margin: 0; font-size: 15px; }
.card p { margin: 0; color: var(--muted); font-size: 13px; flex: 1; }
.card .go { margin-top: 8px; font-weight: 600; color: var(--brand); font-size: 13px; }

/* Tool page */
.tool { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .tool { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 12px; font-size: 18px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field .hint { font-size: 11px; color: #93a0ad; margin-top: 2px; }
.input, select.input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; background: #fff; color: var(--ink);
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn {
  background: var(--brand); color: #fff; border: none; border-radius: 8px;
  padding: 10px 16px; font-size: 14px; font-weight: 600; cursor: pointer; margin-right: 8px;
}
.btn:hover { background: var(--brand-2); }
.btn.ghost { background: #eef1f5; color: var(--ink); }
.btn.ghost:hover { background: #e2e7ee; }

/* Results */
.result-list { list-style: none; margin: 0; padding: 0; }
.result-list li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px;
}
.result-list li:last-child { border-bottom: none; }
.result-list .k { color: var(--muted); }
.result-list .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.verdict { margin-top: 12px; padding: 10px 12px; border-radius: 8px; font-weight: 700; }
.verdict.ok { background: #e7f6ec; color: var(--ok); border: 1px solid #bfe6cd; }
.verdict.bad { background: #fbeae8; color: var(--bad); border: 1px solid #f1c4be; }

.notes { margin-top: 14px; font-size: 12px; color: var(--muted); background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.notes b { color: var(--ink); }
.eqtbl { width: 100%; border-collapse: collapse; margin: 6px 0 10px; font-size: 12px; font-variant-numeric: tabular-nums; }
.eqtbl th { text-align: left; color: var(--muted); font-weight: 600; padding: 4px 6px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.eqtbl td { padding: 4px 6px; border-bottom: 1px solid var(--line); }
.eqtbl td:nth-child(n+3) { text-align: right; }
.shrink-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.shrink-table th, .shrink-table td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; }
.shrink-table th { background: #f0f3f7; }
.backlink { display: inline-block; margin-bottom: 14px; font-size: 13px; }
footer.foot { max-width: 1080px; margin: 0 auto; padding: 0 18px 40px; color: var(--muted); font-size: 12px; }

/* Unit selector (shares fd-lang styling) */
.fd-unit { background: #36404d; color: #fff; border: 1px solid #46525f; border-radius: 6px; padding: 4px 6px; font-size: 12px; }

/* 2D schematic panel */
.schema-wrap { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 14px; }
.schema-wrap h2 { margin: 0 0 10px; font-size: 16px; }
.schema-canvas { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.export-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.export-row .exp-label { font-size: 13px; color: var(--muted); margin-right: 2px; }
.export-row .btn.ghost { margin-right: 0; padding: 6px 12px; font-size: 13px; }
.tb-toggle { display: flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.tb-toggle input { width: 15px; height: 15px; accent-color: #b4451f; cursor: pointer; }
.tb-edit { margin: 10px 0 2px; padding: 10px 12px; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px 12px; }
.tb-edit .field.inline { display: flex; flex-direction: column; gap: 3px; margin: 0; }
.tb-edit .field.inline label { font-size: 11px; color: var(--muted); margin: 0; }
.tb-edit .input.sm { padding: 5px 8px; font-size: 12px; }
@media (max-width: 560px) { .tb-edit { grid-template-columns: 1fr; } }

