:root {
  --ink: #101828;
  --muted: #475467;
  --line: #e4e7ec;
  --bg: #ffffff;
  --soft: #f9fafb;
  --brand: #17405c;
  --brand-soft: #eaf2f8;
  --high: #b42318;
  --high-soft: #fef3f2;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --info: #475467;
  --info-soft: #f2f4f7;
  --ok: #027a48;
  --ok-soft: #ecfdf3;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

a {
  color: #175cd3;
}

.chrome .in,
main {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
}

nav.chrome {
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

nav.chrome .in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 52px;
}

nav.chrome .brand {
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
  margin-right: auto;
}

nav.chrome a:not(.brand) {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 8px;
  border-radius: 8px;
}

nav.chrome a[aria-current="page"] {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

main {
  padding-bottom: 48px;
}

h1 {
  font-size: 26px;
  line-height: 1.35;
  margin: 28px 0 8px;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 20px;
  margin: 32px 0 10px;
}

h3 {
  font-size: 17px;
  margin: 22px 0 8px;
}

p.lead {
  color: var(--muted);
  margin: 0 0 18px;
}

p.updated {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 4px;
}

section {
  margin: 22px 0;
}

.card,
.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: #fff;
}

.panel.soft {
  background: var(--soft);
}

form .field {
  margin-bottom: 14px;
}

label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

.hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  font: inherit;
  color: inherit;
  padding: 10px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  background: #fff;
}

textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.6;
}

button,
.btn {
  font: inherit;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 11px 16px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

button.secondary,
.btn.secondary {
  background: #fff;
  color: var(--brand);
  border-color: #b9cde0;
}

button.ghost {
  background: #fff;
  color: var(--muted);
  border-color: var(--line);
  font-weight: 500;
}

button.small {
  padding: 6px 10px;
  font-size: 13px;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
}

.chips button {
  background: #fff;
  color: var(--brand);
  border: 1px solid #b9cde0;
  font-size: 13px;
  padding: 7px 11px;
  font-weight: 500;
}

.score {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 8px 0 4px;
}

.score strong {
  font-size: 34px;
  line-height: 1;
}

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.badge.high {
  color: var(--high);
  background: var(--high-soft);
  border-color: #fecdca;
}

.badge.warn {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: #fedf89;
}

.badge.info {
  color: var(--info);
  background: var(--info-soft);
  border-color: #d0d5dd;
}

.badge.quote,
.badge.advisory {
  color: var(--info);
  background: #fff;
  border-color: #d0d5dd;
  font-weight: 600;
}

.badge.ok {
  color: var(--ok);
  background: var(--ok-soft);
  border-color: #abefc6;
}

.finding {
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 10px;
  padding: 14px;
  margin: 12px 0;
  background: #fff;
}

.finding.high {
  border-left-color: var(--high);
}

.finding.warn {
  border-left-color: var(--warn);
}

.finding.info {
  border-left-color: var(--info);
}

.finding.quote,
.finding.advisory {
  border-left-color: #98a2b3;
  background: var(--soft);
}

.finding .head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.finding .title {
  font-weight: 700;
}

.finding .snippet {
  background: #fffbea;
  border-bottom: 2px solid #fdb022;
  padding: 0 2px;
}

.finding dl {
  margin: 8px 0 0;
  font-size: 14px;
}

.finding dt {
  font-weight: 600;
  color: var(--muted);
  margin-top: 6px;
  font-size: 13px;
}

.finding dd {
  margin: 0;
}

.finding .fix {
  margin-top: 10px;
  padding: 10px;
  background: var(--ok-soft);
  border: 1px solid #abefc6;
  border-radius: 8px;
  font-size: 14px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.summary-grid div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.summary-grid b {
  display: block;
  font-size: 20px;
}

.notice-box {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.7;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  margin-top: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 10px 0;
}

th,
td {
  text-align: left;
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  background: var(--soft);
  font-size: 13px;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.scroll-x {
  overflow-x: auto;
}

ul.links,
ul.plain {
  padding-left: 18px;
  margin: 8px 0;
}

ul.links li,
ul.plain li {
  margin: 5px 0;
}

.callout {
  border: 1px solid #fedf89;
  background: var(--warn-soft);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 16px 0;
  font-size: 14px;
}

.callout strong {
  color: var(--warn);
}

.note {
  font-size: 13px;
  color: var(--muted);
}

details {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 8px 0;
  background: #fff;
}

summary {
  cursor: pointer;
  font-weight: 600;
}

details[open] summary {
  margin-bottom: 8px;
}

ol.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
}

ol.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 14px 40px;
  margin: 0;
}

ol.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
}

.disclaimer {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  padding: 8px 16px;
  text-align: center;
}

footer.chrome {
  border-top: 1px solid var(--line);
  background: var(--soft);
  font-size: 13px;
  padding: 20px 0 28px;
}

footer.chrome .in {
  display: grid;
  gap: 14px;
}

footer.chrome h2 {
  font-size: 13px;
  margin: 0 0 6px;
  color: var(--muted);
}

footer.chrome ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

footer.chrome p.disc {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
}

.banner {
  border: 1px solid #fedf89;
  background: var(--warn-soft);
  color: #7a2e0e;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  margin: 14px 0;
}

.print-only {
  display: none;
}

@media (max-width: 480px) {
  h1 {
    font-size: 22px;
  }
  main {
    padding: 0 14px;
  }
  table,
  thead,
  tbody,
  th,
  td,
  tr {
    font-size: 13px;
  }
  .stack-mobile table,
  .stack-mobile thead,
  .stack-mobile tbody,
  .stack-mobile th,
  .stack-mobile td,
  .stack-mobile tr {
    display: block;
    width: 100%;
  }
  .stack-mobile thead {
    display: none;
  }
  .stack-mobile tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 8px;
    background: #fff;
  }
  .stack-mobile td {
    border: 0;
    padding: 4px 2px;
  }
  .stack-mobile td::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    color: var(--muted);
  }
}

@media print {
  @page {
    size: A4;
    margin: 18mm;
  }
  nav.chrome,
  footer.chrome,
  .disclaimer,
  .no-print,
  .actions {
    display: none !important;
  }
  body {
    font-size: 11pt;
    color: #000;
  }
  main {
    max-width: none;
    padding: 0;
  }
  h1 {
    font-size: 16pt;
    margin-top: 0;
  }
  .print-only {
    display: block;
  }
  .print-head {
    border-bottom: 1px solid #000;
    margin-bottom: 10px;
    padding-bottom: 6px;
    font-size: 9pt;
  }
  a {
    color: #000;
    text-decoration: none;
  }
  .card,
  .panel,
  .finding,
  .notice-box {
    break-inside: avoid;
  }
}
