/* 엔코어 툴박스(웹) 공용 스타일 — 허브와 신규 4개 도구(볼트·밀핀·무게·구배) */
:root {
  --c-main: #2c5f8a;
  --c-main-d: #1f4a6e;
  --c-bg: #f4f7fa;
  --c-card: #fff;
  --c-line: #d5dee8;
  --c-text: #1d2b3a;
  --c-sub: #5a6b7e;
  --c-calc: #fff5be;
  --c-zebra: #e8eef7;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--c-bg); color: var(--c-text);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px; line-height: 1.5;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 14px 16px calc(28px + env(safe-area-inset-bottom)); }
h1 { font-size: 19px; margin: 6px 0 12px; color: var(--c-main-d); }
h1 small { font-weight: 400; font-size: 13px; color: var(--c-sub); margin-left: 6px; }
.card { background: var(--c-card); border: 1px solid var(--c-line); border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.note { color: var(--c-sub); font-size: 13px; margin: 10px 0; }
.note p { margin: 4px 0; }
.err { color: #b00020; font-weight: 600; }

/* 표 */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--c-line); border-radius: 10px; background: var(--c-card); }
table { border-collapse: collapse; width: 100%; font-size: 14px; white-space: nowrap; }
th, td { padding: 9px 10px; text-align: center; border-bottom: 1px solid var(--c-line); }
thead th { background: var(--c-main); color: #fff; font-weight: 600; position: sticky; top: 0; }
tbody tr:nth-child(even) { background: var(--c-zebra); }
tbody tr.sel { outline: 2px solid var(--c-main); outline-offset: -2px; background: #d6e6f7; }
tbody tr { cursor: pointer; }
td:first-child, th:first-child { position: sticky; left: 0; font-weight: 700; background: inherit; }
tbody td:first-child { background: #fff; }
tbody tr:nth-child(even) td:first-child { background: var(--c-zebra); }
tbody tr.sel td:first-child { background: #d6e6f7; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { background: #eef3f9; border: 1px solid var(--c-line); border-radius: 6px; padding: 2px 8px; font-size: 13px; }

/* 입력 */
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input, select {
  width: 100%; font: inherit; padding: 10px 12px; min-height: 44px;
  border: 1px solid #b9c7d6; border-radius: 8px; background: #fff; color: var(--c-text);
}
input[readonly] { background: #eef1f4; color: var(--c-sub); }
input.calc { background: var(--c-calc); }
.row { display: flex; align-items: center; gap: 8px; }
.row > input, .row > select { flex: 1; min-width: 0; }
.unit { flex: none; color: var(--c-sub); min-width: 2.2em; }
button.btn, a.btn {
  font: inherit; min-height: 44px; padding: 0 18px; border: 0; border-radius: 8px;
  background: var(--c-main); color: #fff; font-weight: 600; cursor: pointer;
}
button.btn.ghost, a.btn.ghost { background: #e4ecf4; color: var(--c-main-d); }
img.diagram { display: block; max-width: 100%; height: auto; margin: 10px auto; border: 1px solid var(--c-line); border-radius: 8px; background: #fff; }

/* 결과 */
.result { font-size: 15px; }
.result .line { margin: 2px 0; }
.result .big { font-size: 17px; font-weight: 700; color: var(--c-main-d); margin-top: 6px; }
.dms { color: var(--c-main-d); font-weight: 600; margin: 4px 0 0 2px; min-height: 1.4em; }
