:root {
  --bg: #ffffff;
  --surface: #f6f8fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #5a6475;
  --line: #d9e0ea;
  --primary: #176b5b;
  --primary-dark: #0f4f43;
  --accent: #224b7a;
  --warning: #8a4b00;
  --focus: #f2b84b;
  --shadow: 0 10px 28px rgba(23, 32, 51, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

p,
li,
dt,
dd,
small,
.lead,
.metric strong {
  overflow-wrap: anywhere;
}

a {
  color: var(--primary-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-size: 16px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
}

.nav-primary,
.nav-more summary {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 8px;
}

.nav-primary:hover,
.nav-more summary:hover {
  background: var(--surface);
}

.nav-links a[aria-current="page"],
.nav-menu a[aria-current="page"] {
  color: var(--primary-dark);
  font-weight: 700;
}

.nav-links .nav-primary[aria-current="page"] {
  background: #eef8f5;
}

.nav-more {
  position: relative;
}

.nav-more summary {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}

.nav-more summary::-webkit-details-marker {
  display: none;
}

.nav-more summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
}

.nav-more[open] summary::after {
  transform: translateY(2px) rotate(225deg);
}

.nav-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: grid;
  min-width: 238px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.nav-menu a {
  padding: 9px 10px;
  border-radius: 6px;
  line-height: 1.35;
  white-space: nowrap;
}

.nav-menu a:hover {
  background: var(--surface);
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.hero {
  background: linear-gradient(180deg, #f7faf9 0%, #ffffff 100%);
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 44px;
  align-items: center;
  min-height: 430px;
  padding: 44px 20px 34px;
}

.hero h1,
.page-title h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.8rem, 3.4vw, 2.8rem);
  line-height: 1.18;
  letter-spacing: 0;
}

.lead {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary {
  background: #ffffff;
  color: var(--primary-dark);
}

.button:hover {
  background: var(--primary-dark);
  color: #ffffff;
}

.hero-panel,
.tool-panel,
.content-box,
.notice,
.ad-slot {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 24px;
}

.mini-chart {
  display: grid;
  align-items: end;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  height: 180px;
  margin: 24px 0;
  padding: 18px;
  border-radius: 8px;
  background: var(--surface);
}

.mini-chart span {
  display: block;
  border-radius: 5px 5px 0 0;
  background: var(--primary);
}

.quick-facts {
  display: grid;
  gap: 12px;
  margin: 0;
}

.quick-facts div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.quick-facts div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.quick-facts dt {
  color: var(--muted);
}

.quick-facts dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.section {
  padding: 42px 0;
}

.section h2,
.content-box h2,
.tool-panel h2 {
  margin: 0 0 16px;
  font-size: 1.42rem;
  line-height: 1.3;
  letter-spacing: 0;
}

.section h3,
.content-box h3 {
  margin: 30px 0 10px;
  font-size: 1.18rem;
  line-height: 1.35;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.panel-heading h2 {
  margin-bottom: 8px;
}

.panel-heading p {
  margin: 0;
  color: var(--muted);
}

.tip-button {
  flex: 0 0 auto;
  min-width: 48px;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid #cfe4df;
  border-radius: 999px;
  background: #eef8f5;
  color: var(--primary-dark);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.tip-button:hover {
  border-color: var(--primary);
  background: #dff2ed;
}

.grid-2,
.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.feature-card,
.content-box,
.tool-panel,
.notice,
.ad-slot {
  padding: 20px;
}

.feature-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.feature-card h2,
.feature-card h3 {
  margin-top: 0;
}

.page-title {
  padding: 38px 0 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.visual-title {
  padding: 34px 0;
}

.page-title-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 380px);
  gap: 28px;
  align-items: center;
}

.page-visual {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(23, 32, 51, 0.08);
}

.title-action {
  margin-top: 16px;
}

.breadcrumbs {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 8px;
  color: #8892a3;
}

.calculator-form {
  display: grid;
  gap: 15px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-weight: 700;
}

.field small {
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid #b9c3d2;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 12px) 20px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 38px;
}

.money-input {
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: 0;
}

.amount-help {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 3px 9px;
  border: 1px solid #cfe4df;
  border-radius: 8px;
  background: #eef8f5;
  color: var(--primary-dark);
  font-size: 0.92rem;
  font-weight: 700;
}

[hidden] {
  display: none !important;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

.result-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}

.metric {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.metric strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 1.12rem;
  overflow-wrap: anywhere;
}

.chart-wrap {
  position: relative;
  min-height: 260px;
  margin-top: 14px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
  background: #ffffff;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

.notice {
  margin-top: 18px;
  border-color: #e8c98f;
  background: #fff9ed;
  color: #4a3200;
  box-shadow: none;
}

.notice strong {
  color: var(--warning);
}

.ad-slot {
  margin: 34px 0;
  background: #fafbfc;
  color: var(--muted);
  text-align: center;
  box-shadow: none;
}

.tip-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 24px 0 0;
  padding: 16px 18px;
  border: 1px solid #cfe4df;
  border-radius: 8px;
  background: #f3faf7;
}

.tip-strip strong {
  display: block;
  margin-bottom: 4px;
  color: var(--primary-dark);
  font-size: 1.05rem;
}

.tip-strip p {
  margin: 0;
  color: var(--muted);
}

.tip-modal {
  width: min(820px, calc(100% - 32px));
  max-height: min(760px, calc(100vh - 40px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.tip-modal::backdrop {
  background: rgba(23, 32, 51, 0.56);
}

.tip-modal-inner {
  position: relative;
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(23, 32, 51, 0.24);
}

.tip-modal-inner h2 {
  margin: 0 0 16px;
  padding-right: 40px;
}

.tip-modal-inner h3 {
  margin: 28px 0 8px;
}

.tip-modal-inner p {
  color: #334055;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: var(--surface);
}

.content-box {
  margin-top: 24px;
  box-shadow: none;
}

.content-box p,
.content-box li {
  color: #334055;
}

.content-box ul {
  padding-left: 22px;
}

.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: start;
  padding: 30px 20px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.footer-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--text);
  color: #ffffff;
}

.skip-link:focus {
  left: 8px;
}

@media (max-width: 860px) {
  .nav-wrap,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-wrap {
    display: grid;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .nav-more {
    margin-left: auto;
  }

  .hero-inner,
  .page-title-inner,
  .grid-2,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .hero-inner {
    min-height: auto;
    padding-top: 44px;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 14px;
  }

  .container,
  .nav-wrap,
  .hero-inner,
  .footer-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .nav-links {
    width: 100%;
    gap: 6px;
    font-size: 0.9rem;
  }

  .nav-primary,
  .nav-more summary {
    min-height: 36px;
    padding: 6px 9px;
  }

  .section {
    padding: 32px 0;
  }

  .feature-card,
  .content-box,
  .tool-panel,
  .notice,
  .ad-slot,
  .hero-panel {
    padding: 16px;
  }

  .result-summary {
    grid-template-columns: 1fr;
  }

  .panel-heading,
  .tip-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .tip-strip .button {
    width: 100%;
  }

  .tip-modal-inner {
    padding: 24px 18px;
  }

  .hero-actions .button {
    width: 100%;
  }

  .chart-wrap {
    min-height: 230px;
  }
}
