/* 케이스펙 — 기계설계 규격표·계산기
   설계 언어: 도면. 흰 종이, 남색 잉크, 얇은 치수선, 검토 도장 빨강 하나. */

:root {
  --paper: #ffffff;
  --paper-2: #f3f5f8;
  --ink: #14213d;
  --ink-2: #5b6470;
  --rule: #d5dae1;
  --rule-2: #aab3c0;
  --stamp: #b3261e;
  --stamp-bg: #fbeceb;
  --focus: #1d4ed8;
  --w: 920px;
  --font: "IBM Plex Sans KR", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
}
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--stamp); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.wrap { max-width: var(--w); margin: 0 auto; padding: 0 16px; }

/* 머리 */
.top { border-bottom: 1px solid var(--rule); }
.top .wrap { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 12px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 20px; letter-spacing: -0.01em; text-decoration: none; }
.brand small { font-weight: 400; color: var(--ink-2); font-size: 14px; margin-left: 10px; }
.top nav a { font-size: 14px; color: var(--ink-2); margin-left: 16px; text-decoration: none; }
.top nav a:hover { color: var(--stamp); }

/* 본문 */
main { padding: 28px 0 56px; }
h1 { font-size: 28px; line-height: 1.3; margin: 0 0 10px; letter-spacing: -0.02em; font-weight: 700; }
.lead { color: var(--ink-2); margin: 0 0 6px; max-width: 70ch; }
.meta { font-size: 14px; color: var(--ink-2); margin: 0 0 28px; }
.meta b { color: var(--ink); font-weight: 600; }
h2 { font-size: 20px; margin: 44px 0 12px; padding-top: 14px; border-top: 1px solid var(--rule); letter-spacing: -0.01em; }
h3 { font-size: 16px; margin: 22px 0 6px; }
p, li { max-width: 72ch; }
ul { padding-left: 20px; }
.note { font-size: 14px; color: var(--ink-2); }

/* 계산기: 그림 + 입력 + 표제란 */
.calc { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; margin-top: 8px; }
.calc svg { width: 100%; height: auto; display: block; }
.calc .dim { fill: var(--stamp); font-weight: 600; font-size: 15px; }
.calc .lbl { fill: var(--ink-2); font-size: 11px; }
.calc .steel { fill: var(--paper-2); stroke: var(--ink); stroke-width: 1.4; }
.calc .hole { fill: var(--paper); stroke: var(--ink); stroke-width: 1.4; }
.calc .line { stroke: var(--ink-2); stroke-width: 0.8; }
.calc .arrow { fill: var(--ink-2); }

.fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
.field input, .field select {
  width: 100%; font: inherit; font-size: 17px; color: var(--ink);
  padding: 8px 10px; border: 1px solid var(--rule-2); border-radius: 3px; background: #fff;
}
.field input:focus, .field select:focus { border-color: var(--focus); }
.field .unit { font-size: 13px; color: var(--ink-2); margin-left: 6px; }
.field.wide { grid-column: 1 / -1; }

/* 표제란(도면 title block) 모양의 결과 */
.titleblock { grid-column: 1 / -1; margin-top: 4px; border: 1.4px solid var(--ink); display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; }
.titleblock > div { padding: 10px 12px; border-right: 1px solid var(--ink); }
.titleblock > div:last-child { border-right: 0; }
.titleblock .k { display: block; font-size: 12px; color: var(--ink-2); }
.titleblock .v { display: block; font-size: 22px; font-weight: 700; line-height: 1.2; margin-top: 2px; }
.titleblock .v small { font-size: 13px; font-weight: 400; color: var(--ink-2); margin-left: 3px; }
.titleblock .main .v { color: var(--stamp); }
.titleblock .warn { grid-column: 1 / -1; border-top: 1px solid var(--ink); font-size: 13px; color: var(--stamp); background: var(--stamp-bg); }
.titleblock .warn:empty { display: none; }

/* 규격표 */
.tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 6px 0 12px; }
.tools input { font: inherit; font-size: 15px; padding: 7px 10px; border: 1px solid var(--rule-2); border-radius: 3px; width: 220px; max-width: 100%; }
.tools .count { font-size: 14px; color: var(--ink-2); }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--rule); margin-top: 8px; }
.tabs button { font: inherit; font-size: 15px; background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 14px; margin-bottom: -1px; color: var(--ink-2); cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.tabs button:hover { color: var(--stamp); }

table.spec { width: 100%; border-collapse: collapse; font-size: 15px; margin-top: 10px; }
table.spec th, table.spec td { padding: 7px 10px; border-bottom: 1px solid var(--rule); text-align: right; white-space: nowrap; }
table.spec th { background: var(--paper-2); color: var(--ink-2); font-weight: 600; font-size: 13px; text-align: right; border-bottom: 1px solid var(--rule-2); position: sticky; top: 0; }
table.spec th:first-child, table.spec td:first-child { text-align: left; }
table.spec td.size { font-weight: 600; }
table.spec tr.group td { border-top: 1px solid var(--rule-2); }
table.spec tr:hover td { background: #fafbfc; }
table.spec button.use { font: inherit; font-size: 12px; color: var(--ink-2); background: none; border: 1px solid var(--rule-2); border-radius: 3px; padding: 2px 8px; cursor: pointer; }
table.spec button.use:hover { color: var(--stamp); border-color: var(--stamp); }
.tablewrap { overflow-x: auto; }

/* 계산식 */
.formula { font-size: 18px; padding: 12px 16px; background: var(--paper-2); border-left: 3px solid var(--ink); margin: 12px 0; overflow-x: auto; }
.formula .sub { font-size: 12px; vertical-align: sub; }
table.diff { border-collapse: collapse; font-size: 14px; margin: 10px 0; }
table.diff th, table.diff td { border: 1px solid var(--rule); padding: 5px 10px; text-align: right; }
table.diff th { background: var(--paper-2); font-weight: 600; color: var(--ink-2); }
table.diff td:first-child { text-align: left; }

/* 출처·면책 */
.sources li { font-size: 14px; color: var(--ink-2); }
.disclaimer { font-size: 14px; color: var(--ink-2); border: 1px dashed var(--rule-2); padding: 12px 14px; margin-top: 16px; }

/* 홈 */
.index-list { list-style: none; padding: 0; margin: 12px 0 0; }
.index-list li { max-width: none; display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.index-list li .soon { color: var(--ink-2); }
.index-list li .soon-lbl { font-size: 13px; color: var(--ink-2); }

footer { border-top: 1px solid var(--rule); padding: 20px 0 40px; font-size: 13px; color: var(--ink-2); }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 720px) {
  h1 { font-size: 23px; }
  .calc { grid-template-columns: 1fr; }
  .calc svg { max-width: 300px; margin: 0 auto; }
  .titleblock { grid-template-columns: 1fr 1fr; }
  .titleblock > div:nth-child(2) { border-right: 0; }
  .titleblock > div:nth-child(n+3) { border-top: 1px solid var(--ink); }
  .titleblock .warn { border-top: 1px solid var(--ink); }
  table.spec { font-size: 14px; }
  table.spec th, table.spec td { padding: 6px 8px; }
}
@media (prefers-reduced-motion: no-preference) {
  .titleblock .v { transition: color 120ms ease; }
}
@media print {
  .top nav, .tools, .tabs, table.spec button.use { display: none; }
  h2 { break-after: avoid; }
}
