:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5d6878;
  --line: #d9e0e8;
  --paper: #fbfcfe;
  --panel: #ffffff;
  --accent: #0e7c86;
  --accent-dark: #095860;
  --gold: #b57718;
  --green: #23784d;
  --shadow: 0 18px 50px rgba(26, 43, 67, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Pretendard,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 5vw;
  border-bottom: 1px solid rgba(217, 224, 232, 0.8);
  background: rgba(251, 252, 254, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
}

nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

nav a {
  text-decoration: none;
}

.hero {
  display: block;
  min-height: 0;
  padding: 16px 5vw;
  background:
    linear-gradient(120deg, rgba(14, 124, 134, 0.16), transparent 36%),
    linear-gradient(315deg, rgba(181, 119, 24, 0.16), transparent 34%),
    #f6f9fb;
}

.compact-hero {
  min-height: 0;
  padding-top: 14px;
  padding-bottom: 14px;
}

.hero-copy {
  max-width: 980px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(2.25rem, 6vw, 4.75rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.compact-hero h1 {
  margin-bottom: 4px;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.hero-copy p:last-child {
  max-width: 620px;
  color: var(--muted);
  font-size: 0.98rem;
}

.hero-panel,
.control-panel,
.results,
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  gap: 8px;
  padding: 22px;
}

.hero-panel span,
.hero-panel small {
  color: var(--muted);
}

.hero-panel strong {
  color: var(--accent-dark);
  font-size: clamp(1.75rem, 4vw, 2.45rem);
}

.menu-band,
.table-band {
  padding: 28px 5vw;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.section-title {
  max-width: 760px;
  margin-bottom: 12px;
}

.section-title h2 {
  margin-bottom: 10px;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.15;
}

.section-title p:last-child {
  color: var(--muted);
}

.calculator-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
  gap: 8px;
  margin-top: 14px;
  color: var(--ink);
}

.calculator-menu a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.calculator-menu a.active,
.calculator-menu a:focus-visible,
.calculator-menu a:hover {
  border-color: rgba(14, 124, 134, 0.44);
  background: rgba(14, 124, 134, 0.08);
  color: var(--accent-dark);
}

.tool-menu-band {
  margin: 0 -5vw;
  padding-top: 18px;
  padding-bottom: 18px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: 36px 5vw 56px;
}

.control-panel,
.results {
  padding: 22px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 22px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f6;
}

button,
input,
select {
  font: inherit;
}

.tab,
.primary {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
}

.tab {
  background: transparent;
  color: var(--muted);
}

.tab.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 5px 16px rgba(26, 43, 67, 0.1);
}

.panel-section {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
}

.input-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 13px;
  font-weight: 750;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(14, 124, 134, 0.28);
  outline-offset: 2px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
}

.check-row input {
  width: 20px;
  min-height: 20px;
}

.primary {
  width: 100%;
  margin-top: 18px;
  background: var(--accent);
  color: #fff;
}

.primary:hover {
  background: var(--accent-dark);
}

.notice {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.result-head {
  display: grid;
  gap: 5px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.result-head p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.result-head strong {
  color: var(--accent-dark);
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 1.08;
}

.result-head span {
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0;
}

.metric-grid article,
.info-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metric-grid article {
  display: grid;
  gap: 6px;
  min-height: 96px;
  padding: 16px;
}

.metric-grid span,
dt {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.metric-grid strong {
  font-size: 1.2rem;
}

dt {
  display: grid;
  gap: 2px;
}

dt span {
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.breakdown h2 {
  margin: 6px 0 12px;
  font-size: 1.15rem;
}

dl {
  display: grid;
  gap: 2px;
  margin: 0;
}

dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #edf1f4;
}

dd {
  margin: 0;
  font-weight: 850;
}

.table-band {
  background: #f6f9fb;
}

.table-wrap {
  overflow-x: auto;
  background: #fff;
}

table {
  width: 100%;
  min-width: 1180px;
  table-layout: auto;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 14px;
  border-bottom: 1px solid #edf1f4;
  text-align: right;
  white-space: nowrap;
}

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

th {
  background: #f0f5f7;
  color: var(--muted);
  font-size: 0.84rem;
}

td {
  font-size: 0.92rem;
  font-weight: 760;
}

td:last-child {
  color: var(--accent-dark);
  font-weight: 900;
}

.content-band {
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr);
  gap: 26px;
  padding: 48px 5vw 68px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.tool-page {
  padding: 28px 5vw 56px;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.tool-card,
.tool-result,
.article-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.tool-card,
.tool-result {
  padding: 22px;
}

.tool-form {
  display: grid;
  gap: 14px;
}

.tool-result {
  display: grid;
  gap: 16px;
}

.tool-result strong {
  color: var(--accent-dark);
  font-size: clamp(1.8rem, 5vw, 3rem);
  line-height: 1.1;
}

.result-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.result-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid #edf1f4;
}

.result-list dt {
  color: var(--muted);
}

.article-box {
  margin-top: 24px;
  padding: 22px;
  color: var(--muted);
}

.article-box h2,
.article-box h3 {
  color: var(--ink);
}

.back-link {
  display: inline-flex;
  margin-bottom: 14px;
  color: var(--accent-dark);
  font-weight: 900;
  text-decoration: none;
}

.ad-slot {
  display: grid;
  place-items: center;
  min-height: 90px;
  margin: 18px 0;
  border: 1px dashed #b9c5cf;
  border-radius: 8px;
  background: #f6f9fb;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.content-band h2 {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  line-height: 1.15;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.info-grid article {
  padding: 18px;
}

.info-grid h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.info-grid p,
footer {
  color: var(--muted);
}

footer {
  padding: 24px 5vw 36px;
  font-size: 0.9rem;
}

footer p {
  margin: 0;
}

@media (max-width: 860px) {
  .hero,
  .workspace,
  .content-band,
  .tool-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 42px;
  }

  .compact-hero {
    gap: 16px;
    min-height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .metric-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .calculator-menu {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  nav {
    width: 100%;
    justify-content: space-between;
  }

  .split {
    grid-template-columns: 1fr;
  }

  .control-panel,
  .results,
  .hero-panel {
    padding: 18px;
  }

  .compact-hero h1 {
    font-size: 1.25rem;
  }

  .compact-hero .hero-copy p:last-child {
    margin-bottom: 0;
    font-size: 0.86rem;
  }

  .compact-hero .hero-panel {
    display: none;
  }

  .table-band {
    padding-right: 3vw;
    padding-left: 3vw;
  }

  .table-wrap {
    border-radius: 6px;
  }

  th,
  td {
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  td:last-child {
    font-size: 0.82rem;
  }

  .calculator-menu {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .calculator-menu a {
    min-height: 40px;
    padding: 7px 4px;
    font-size: 0.74rem;
  }
}

.info-table {
  width: 100%;
  min-width: 680px;
  margin: 12px 0 18px;
}

.info-table th,
.info-table td {
  white-space: normal;
  vertical-align: top;
}

.article-box .table-wrap {
  box-shadow: none;
}

.article-box ul {
  padding-left: 18px;
}
