/* 지명원 — print A4 document styles */
:root {
  --accent: #1B4F8A;
  --accent-soft: #3a6ca6;
  --paper: #ffffff;
  --ink: #14181f;
  --ink-2: #2a2f38;
  --mute: #7a7f88;
  --line: rgba(20,24,31,0.14);
  --line-2: rgba(20,24,31,0.07);
  --night: #2c3a49;
  --sans: 'Pretendard Variable', Pretendard, sans-serif;
  --serif-ko: 'Noto Serif KR', serif;
  --serif: 'Cormorant Garamond', serif;
  --mono: 'IBM Plex Mono', monospace;
  --head: var(--sans);
}
html[data-headfont="명조"] { --head: var(--serif-ko); }

* { box-sizing: border-box; }
body {
  margin: 0; background: #3b3f46;
  font-family: var(--sans); color: var(--ink);
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}

.page {
  width: 210mm; height: 297mm;
  background: var(--paper);
  margin: 24px auto;
  padding: 18mm 16mm 14mm;
  position: relative;
  box-shadow: 0 8px 40px rgba(0,0,0,0.35);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.page.dark { background: var(--night); color: #f6f3ec; }

/* running header / footer */
.run-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 8px; margin-bottom: 32px;
  font-size: 10px; letter-spacing: 0.18em; color: var(--mute);
  text-transform: uppercase;
}
.run-head .doc { font-weight: 700; color: var(--accent); }
.run-foot {
  margin-top: auto; padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between;
  font-size: 9px; letter-spacing: 0.14em; color: var(--mute);
}
.run-foot .pno { font-family: var(--mono); }

/* section heading */
.sec-no {
  font-family: var(--mono); font-size: 11px; color: var(--accent);
  letter-spacing: 0.22em; margin-bottom: 10px;
}
h2.sec-t {
  font-family: var(--head); font-weight: 700;
  font-size: 30px; letter-spacing: -0.02em;
  margin: 0 0 6px 0; line-height: 1.2;
}
.sec-sub { font-size: 12.5px; color: var(--mute); margin: 0 0 28px 0; }

/* tables */
table.doc-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
table.doc-tbl th, table.doc-tbl td {
  border: 1px solid var(--line);
  padding: 9px 12px; text-align: left; vertical-align: top;
}
table.doc-tbl thead th {
  background: var(--accent); color: #fff;
  font-weight: 600; font-size: 11px; letter-spacing: 0.06em;
}
table.doc-tbl tbody th {
  background: rgba(20,24,31,0.04);
  font-weight: 600; width: 32mm; white-space: nowrap;
}
table.doc-tbl.center td { text-align: center; }
table.doc-tbl .num { font-family: var(--mono); font-size: 11px; }

/* key-figure band */
.figs { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); margin: 22px 0; }
.figs > div { padding: 14px 16px; border-left: 1px solid var(--line); }
.figs > div:first-child { border-left: 0; }
.figs .v { font-family: var(--head); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.figs .v small { font-size: 12px; font-weight: 500; color: var(--mute); margin-left: 2px; }
.figs .k { font-size: 10px; color: var(--mute); letter-spacing: 0.1em; margin-top: 4px; }

/* timeline */
.tl { border-top: 1px solid var(--line); }
.tl-row { display: grid; grid-template-columns: 24mm 1fr; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.tl-row .y { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--accent); }
.tl-row ul { margin: 0; padding: 0; list-style: none; font-size: 12px; line-height: 1.65; color: var(--ink-2); }
.tl-row li { display: grid; grid-template-columns: 12mm 1fr; gap: 10px; }
.tl-row li .m { font-family: var(--mono); font-size: 10px; color: var(--mute); padding-top: 2px; }

/* org chart */
.org { display: grid; gap: 10px; justify-items: center; margin-top: 28px; }
.org-card { border: 1px solid var(--line); padding: 12px 22px; text-align: center; min-width: 46mm; background: #fff; }
.org-card.top { background: var(--accent); color: #fff; border-color: var(--accent); }
.org-card .r { font-size: 9.5px; letter-spacing: 0.14em; opacity: 0.75; text-transform: uppercase; }
.org-card .n { font-family: var(--head); font-size: 15px; font-weight: 700; margin-top: 3px; }
.org-v { width: 1px; height: 12px; background: var(--line); }
.org-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; width: 100%; }
.org-row .org-card { min-width: 0; padding: 10px 6px; }
.org-row .org-card .n { font-size: 12px; }

/* cert grid */
.cert-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cert-grid figure { margin: 0; }
.cert-grid img { width: 100%; aspect-ratio: 1 / 1.38; object-fit: cover; border: 1px solid var(--line); display: block; background: #f2f0ea; }
.cert-grid figcaption { font-size: 9.5px; color: var(--ink-2); margin-top: 5px; line-height: 1.4; }
.cert-grid figcaption b { display: block; font-size: 10.5px; }

/* product blocks */
.prod { display: grid; grid-template-columns: 52mm 1fr; gap: 14px; border: 1px solid var(--line); padding: 12px; margin-bottom: 12px; align-items: start; }
.prod img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.prod h4 { margin: 2px 0 6px; font-family: var(--head); font-size: 15.5px; font-weight: 700; }
.prod h4 small { font-family: var(--mono); font-weight: 400; font-size: 10px; color: var(--accent); margin-left: 8px; letter-spacing: 0.08em; }
.prod p { margin: 0 0 8px; font-size: 11.5px; line-height: 1.65; color: var(--ink-2); }
.prod .tags { display: flex; flex-wrap: wrap; gap: 5px; }
.prod .tags span { font-size: 9.5px; border: 1px solid var(--line); padding: 3px 8px; color: var(--mute); letter-spacing: 0.04em; }

/* equipment photo grid */
.eq-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.eq-grid figure { margin: 0; }
.eq-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border: 1px solid var(--line); display: block; }
.eq-grid figcaption { font-size: 9.5px; color: var(--mute); margin-top: 4px; }

/* registration docs */
.reg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.reg-cell { border: 1px dashed var(--line); padding: 10px; }
.reg-cell .t { font-size: 11px; font-weight: 700; margin-bottom: 8px; }
.reg-cell .t small { font-weight: 400; color: var(--mute); margin-left: 6px; }

/* notes */
.note { font-size: 10px; color: var(--mute); line-height: 1.6; margin-top: 10px; }
.note::before { content: '※ '; color: var(--accent); }

@media print {
  body { background: #fff; }
  .page { margin: 0; box-shadow: none; page-break-after: always; }
  .page:last-child { page-break-after: auto; }
  #tweaks-root { display: none !important; }
}
@page { size: A4; margin: 0; }
