:root {
  --navy: #17324d;
  --navy-dark: #0f2437;
  --blue: #1677ff;
  --sky: #eaf4ff;
  --ink: #17202a;
  --muted: #64748b;
  --line: #dce3ea;
  --surface: #ffffff;
  --background: #f4f7fa;
  --warning: #fff7db;
  font-family: Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--background);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.topbar {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  color: white;
  padding: 34px max(24px, calc((100% - 1180px) / 2));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.topbar h1 { margin: 3px 0 8px; font-size: clamp(1.7rem, 4vw, 2.5rem); }
.topbar p { margin: 0; color: #dbeafe; }
.eyebrow { font-weight: 800; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; }

main { width: min(1180px, calc(100% - 32px)); margin: 28px auto 44px; display: grid; gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: 0 8px 28px rgba(15, 36, 55, .06); }
.section-heading { margin-bottom: 22px; }
.section-heading > div:first-child { display: flex; align-items: center; gap: 10px; }
.section-heading h2 { margin: 0; font-size: 1.25rem; }
.section-heading p { margin: 8px 0 0 42px; color: var(--muted); }
.step { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--sky); color: var(--blue); font-weight: 900; }
.actions-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
label { display: grid; gap: 7px; color: #405064; font-size: .9rem; font-weight: 700; }
input, select { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 10px; background: white; color: var(--ink); }
input:focus, select:focus { outline: 3px solid rgba(22, 119, 255, .16); border-color: var(--blue); }
.area-summary { margin-top: 20px; padding: 17px 20px; border-radius: 12px; background: var(--sky); display: flex; justify-content: space-between; align-items: center; color: var(--navy); }
.area-summary strong { font-size: 1.35rem; }

.material-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.material-group { border: 1px solid var(--line); border-radius: 13px; padding: 15px; }
.material-group h3 { margin: 0 0 10px; font-size: .95rem; color: var(--navy); }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.material-check { display: flex; align-items: center; gap: 9px; padding: 10px; border-radius: 9px; font-weight: 600; color: #334155; }
.material-check:hover { background: #f8fafc; }
.material-check input { width: 19px; min-height: auto; height: 19px; accent-color: var(--blue); }

.small-actions { display: flex; gap: 8px; }
.small-actions button, .ghost-button { border: 1px solid rgba(255,255,255,.4); background: transparent; color: inherit; border-radius: 9px; padding: 9px 13px; }
.small-actions button { border-color: var(--line); color: var(--navy); }
.primary-button { border: 0; background: var(--blue); color: white; border-radius: 10px; padding: 11px 16px; font-weight: 800; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 700px; }
th, td { border-bottom: 1px solid var(--line); padding: 14px 12px; text-align: right; white-space: nowrap; }
th { background: #f8fafc; color: #475569; font-size: .82rem; }
th:first-child, th:nth-child(2), td:first-child, td:nth-child(2) { text-align: left; }
td:first-child { font-weight: 800; color: var(--navy); }
.purchase { color: var(--blue); font-weight: 900; }
.empty-state { text-align: center; padding: 34px; color: var(--muted); }
.notice { margin: 18px 0 0; color: var(--muted); font-size: .83rem; }
.warning { background: var(--warning); color: #755800; border-radius: 10px; padding: 12px 15px; margin-bottom: 14px; }
footer { text-align: center; color: var(--muted); padding: 0 20px 35px; font-size: .82rem; }

@media (max-width: 760px) {
  .topbar { padding: 25px 20px; align-items: flex-start; flex-direction: column; }
  main { width: min(100% - 20px, 1180px); margin-top: 12px; gap: 12px; }
  .card { padding: 17px; border-radius: 14px; }
  .form-grid, .material-groups { grid-template-columns: 1fr; }
  .checks { grid-template-columns: 1fr 1fr; }
  .actions-heading { align-items: flex-start; flex-direction: column; }
  .section-heading p { margin-left: 0; }
  .primary-button { width: 100%; }
}

@media (max-width: 430px) { .checks { grid-template-columns: 1fr; } }

@media print {
  :root { background: white; }
  .topbar { color: #000; background: white; padding: 10px 0 20px; }
  .topbar p, .eyebrow { color: #444; }
  .topbar button, main > section:not(.result-card), .primary-button, footer { display: none !important; }
  main { width: 100%; margin: 0; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .result-card { display: block; }
  table { min-width: 0; }
}
