:root {
  --ink: #12161a;
  --muted: #5b6470;
  --line: #dde2e7;
  --bg: #f6f7f6;
  --panel: #ffffff;
  --accent: #0f474c;
  --accent-2: #0d6a72;
  --warn: #9a5208;
  --danger: #a4232b;
  --ok: #16643f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 32, 0.06), 0 10px 26px rgba(16, 24, 32, 0.05);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; }

body {
  font-family: -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.62;
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.chrome { background: #fff; border-bottom: 1px solid var(--line); }
.chrome .in {
  max-width: 1080px; margin: 0 auto; padding: 10px 16px;
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}
.brand { font-weight: 700; color: var(--ink); font-size: 15px; }
nav.chrome a { font-size: 14px; color: var(--muted); }
nav.chrome a[aria-current="page"] { color: var(--ink); font-weight: 600; }

main { max-width: 1080px; margin: 0 auto; padding: 20px 16px 56px; }

h1 { font-size: clamp(21px, 4vw, 29px); line-height: 1.32; margin: 6px 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 22px 0 10px; }
h3 { font-size: 15px; margin: 18px 0 6px; }
p, li { font-size: 15px; }
.lead { color: var(--muted); margin: 0 0 18px; font-size: 15px; }
.muted { color: var(--muted); font-size: 13.5px; }
.small { font-size: 13px; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 0 0 16px; box-shadow: var(--shadow);
}
.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.step { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.step b { display: block; font-size: 12.5px; color: var(--accent); letter-spacing: 0.02em; }
.step span { display: block; font-size: 13.5px; color: var(--muted); margin-top: 4px; }
@media (max-width: 680px) { .steps { grid-template-columns: 1fr; } }

.privacy-note {
  display: inline-block; background: #eef6f1; color: var(--ok);
  border: 1px solid #cfe6da; border-radius: 999px; padding: 5px 12px;
  font-size: 12.5px; margin: 0 0 14px;
}

.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 0 0 12px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.field > span { font-weight: 600; }
input[type="text"], input[type="date"], input[type="number"], select, textarea {
  font: inherit; font-size: 14.5px; color: var(--ink);
  background: #fff; border: 1px solid #c9d0d6; border-radius: 9px;
  padding: 8px 10px; min-width: 0; width: 100%;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent-2); outline-offset: 2px;
}
textarea { min-height: 132px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; }

.btn {
  font: inherit; font-size: 14px; cursor: pointer;
  background: #fff; color: var(--ink); border: 1px solid #c9d0d6;
  border-radius: 10px; padding: 9px 14px; display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { border-color: #aeb7bf; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { background: #0c393d; }
.btn-ghost { border-color: transparent; color: var(--muted); }
.btn-danger { border-color: #e3c3c5; color: var(--danger); }
.btn[disabled] { opacity: 0.55; cursor: progress; }

.drop {
  border: 1.5px dashed #b9c2ca; border-radius: 12px; background: #fbfcfb;
  padding: 18px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.drop.over { border-color: var(--accent-2); background: #f0f7f7; }
.drop p { margin: 0; font-size: 13.5px; color: var(--muted); }
.drop input[type="file"] { max-width: 100%; }

.cards { display: grid; gap: 12px; }
.card {
  display: grid; grid-template-columns: 132px minmax(0, 1fr) auto; gap: 12px;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fff;
}
.card .thumb {
  width: 100%; aspect-ratio: 3 / 4; background: #f1f3f2; border-radius: 8px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; text-align: center;
}
.card .thumb img { width: 100%; height: 100%; object-fit: contain; }
.card .fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.card .fields .wide { grid-column: 1 / -1; }
.card .side { display: flex; flex-direction: column; gap: 6px; justify-content: flex-start; }
.card .side .btn { padding: 6px 9px; font-size: 12.5px; }
@media (max-width: 720px) {
  .card { grid-template-columns: 92px minmax(0, 1fr); }
  .card .side { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
}
.badge {
  display: inline-block; font-size: 11.5px; border-radius: 999px; padding: 2px 8px;
  background: #eef2f5; color: var(--muted); border: 1px solid #e1e7ec;
}
.badge.warn { background: #fdf3e3; color: var(--warn); border-color: #f0ddbe; }
.badge.ok { background: #eef6f1; color: var(--ok); border-color: #cfe6da; }

.banner {
  border: 1px solid #d8e3ea; background: #f2f8fb; border-radius: 12px;
  padding: 12px 14px; margin: 0 0 12px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  font-size: 14px;
}

.result {
  border: 1px solid #cfe6da; background: #f4faf6; border-radius: 12px; padding: 14px;
  margin-top: 12px;
}
.result b { font-size: 15px; }
.result .name { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

.sheets { display: grid; gap: 16px; }
.sheet-wrap { width: 100%; overflow: hidden; }
.sheet {
  width: 210mm; height: 297mm; background: #fff; position: relative;
  transform-origin: top left; box-shadow: 0 2px 10px rgba(16, 24, 32, 0.12);
  color: #12161a; overflow: hidden;
}
.sheet .sheet-head { position: absolute; left: 10mm; right: 10mm; }
.sheet table.sheet-table { position: absolute; left: 10mm; width: 190mm; border-collapse: collapse; }
.sheet-table th, .sheet-table td { font-size: 2.9mm; padding: 1.4mm 1.6mm; border-bottom: 0.2mm solid #d5dbe0; text-align: left; }
.sheet-table th { background: #f2f5f7; color: #5b6470; font-weight: 600; }
.sheet-table td.num, .sheet-table th.num { text-align: right; }
.sheet-table tr.total td { font-weight: 700; border-top: 0.3mm solid #b8c0c7; }
.sheet .sheet-meta { position: absolute; left: 10mm; right: 10mm; font-size: 2.9mm; color: #5b6470; }
.sheet .sheet-foot { position: absolute; bottom: 4mm; left: 0; right: 0; text-align: center; font-size: 2.6mm; color: #6b7480; }
.sheet .cell { position: absolute; border: 0.2mm solid #d5dbe0; overflow: hidden; }
.sheet .cell img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sheet .cell .label {
  position: absolute; left: 0; right: 0; bottom: 0; height: 5mm;
  font-size: 2.3mm; padding: 1.4mm 1.5mm 0; border-top: 0.2mm solid #e2e7eb;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sheet .cell .empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 3mm; color: #6b7480; }

.links { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.links a { font-size: 14.5px; }

table.data { width: 100%; border-collapse: collapse; margin: 10px 0 14px; font-size: 14px; }
table.data th, table.data td { border-bottom: 1px solid var(--line); padding: 8px 8px; text-align: left; vertical-align: top; }
table.data th { background: #f7f8f8; font-size: 13px; color: var(--muted); }

details.faq { border-bottom: 1px solid var(--line); padding: 10px 0; }
details.faq summary { cursor: pointer; font-weight: 600; font-size: 14.5px; }
details.faq p { margin: 8px 0 0; color: #2b3339; }

.callout { border-left: 3px solid var(--accent-2); background: #f3f7f7; padding: 10px 12px; border-radius: 0 10px 10px 0; margin: 12px 0; font-size: 14px; }
.callout.warn { border-left-color: var(--warn); background: #fdf7ee; }
.note-list { margin: 8px 0 0; padding-left: 18px; }
.note-list li { margin-bottom: 4px; }

.ad-slot {
  border: 1px dashed #c9d0d6; border-radius: 10px; background: #fbfcfc;
  min-height: 60px; display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; color: var(--muted); margin: 10px 0;
}
.aff { border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 13.5px; color: var(--muted); }

footer.chrome { border-top: 1px solid var(--line); border-bottom: 0; margin-top: 24px; }
footer.chrome .in { display: block; padding: 20px 16px 28px; }
footer.chrome h2 { font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
footer.chrome ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
footer.chrome a { font-size: 13px; }
footer.chrome .disc { font-size: 12.5px; color: var(--muted); margin: 0 0 6px; }

.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.kpi div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fbfcfc; }
.kpi b { display: block; font-size: 20px; }
.kpi span { font-size: 12.5px; color: var(--muted); }

@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  body > nav.chrome, body > footer.chrome, .no-print { display: none !important; }
  main { max-width: none; padding: 0; }
  .panel { border: 0; box-shadow: none; padding: 0; margin: 0; }
  .sheet-wrap { height: auto !important; overflow: visible !important; }
  .sheet { transform: none !important; box-shadow: none; break-after: page; page-break-after: always; }
  .sheet:last-child { break-after: auto; page-break-after: auto; }
}
