:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #dbe3ef;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eaf1ff;
  --positive: #15803d;
  --negative: #dc2626;
  --neutral: #475569;
  --warning: #b45309;
  --danger: #dc2626;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  --radius-lg: 20px;
  --radius-md: 14px;
  --container: 1120px;
  --narrow: 640px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Pretendard Variable", "Pretendard", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans JP", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 34rem),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 38%, #f7f8fb 100%);
  color: var(--text);
  line-height: 1.6;
  letter-spacing: -0.015em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

.container.narrow {
  width: min(100% - 32px, var(--narrow));
}

.container.readable {
  width: min(100% - 32px, 860px);
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -100px;
  z-index: 9999;
  background: var(--text);
  color: white;
  padding: 10px 14px;
  border-radius: 10px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(219, 227, 239, 0.86);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
}

.header-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 22px;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -0.03em;
}


.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: block;
  object-fit: cover;
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.18);
  flex: 0 0 auto;
}
.brand-mark {
  display: none;
}

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

.top-nav a:hover,
.top-nav a:focus-visible {
  color: var(--primary);
}

.language-control select {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  padding: 8px 12px;
  color: var(--text);
}

.hero {
  padding: 76px 0 38px;
}

.hero-inner {
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

h1,
h2,
h3 {
  line-height: 1.18;
  letter-spacing: -0.035em;
}

:lang(ko) h1,
:lang(ko) h2,
:lang(ko) h3,
:lang(ja) h1,
:lang(ja) h2,
:lang(ja) h3,
:lang(zh-CN) h1,
:lang(zh-CN) h2,
:lang(zh-CN) h3 {
  word-break: keep-all;
  overflow-wrap: normal;
}

.hero h1 {
  max-width: 980px;
  text-wrap: balance;
}

h1 {
  max-width: 980px;
  margin: 0 auto;
  font-size: clamp(2rem, 4.35vw, 3.85rem);
}

.hero-description {
  max-width: 720px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.5vw, 1.2rem);
}

.section {
  padding: 38px 0;
}

.section-heading {
  text-align: center;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
}

.section-heading p {
  margin: 10px auto 0;
  color: var(--muted);
  max-width: 760px;
}

.card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(219, 227, 239, 0.96);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.form-card {
  padding: 24px;
}

.field-group {
  margin-bottom: 18px;
}

.field-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 750;
}

.field-group input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field-group input:focus {
  border-color: rgba(37, 99, 235, 0.9);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

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

.field-error {
  min-height: 1.25em;
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 650;
}

.primary-actions,
.secondary-actions,
.share-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.primary-actions {
  margin-top: 22px;
}

.secondary-actions {
  margin-top: 12px;
}

.button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-weight: 800;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--primary);
  color: white;
}

.button-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.button-secondary {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.18);
}

.button-ghost {
  background: white;
  color: var(--text);
  border-color: var(--line);
}

.button-danger {
  background: #fee2e2;
  color: var(--danger);
  border-color: #fecaca;
}

.status-message,
.inline-status {
  color: var(--muted);
  font-weight: 700;
}

.status-message {
  margin: 14px 0 0;
  min-height: 1.4em;
}

.condition-summary {
  padding: 20px;
  margin-bottom: 18px;
}


.compact-condition-summary {
  max-width: 920px;
  margin: -4px auto 16px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 650;
  text-align: center;
}

.interpretation-section {
  padding-top: 12px;
}

.condition-summary h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.condition-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.condition-list div {
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 14px;
  padding: 10px 12px;
}

.condition-list dt {
  color: var(--muted);
  font-size: 0.85rem;
}

.condition-list dd {
  margin: 2px 0 0;
  font-weight: 800;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.result-card {
  padding: 22px;
}

.result-card h3 {
  margin: 0 0 14px;
  font-size: 1.12rem;
}

.result-main-value {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -0.045em;
}

.result-main-label {
  margin-top: -2px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.metric-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.metric-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid #edf2f7;
}

.metric-list span:first-child {
  color: var(--muted);
}

.metric-list span:last-child {
  font-weight: 850;
  text-align: right;
}

.positive {
  color: var(--positive);
}

.negative {
  color: var(--negative);
}

.neutral {
  color: var(--neutral);
}

.share-row {
  justify-content: center;
  margin: 18px 0;
}

.interpretation-card {
  padding: 22px;
  max-width: 900px;
  margin: 0 auto;
}

.interpretation-card h3,
.chart-text-summary h3 {
  margin: 0 0 8px;
}

.interpretation-card p,
.chart-text-summary p {
  margin: 0;
  color: var(--muted);
}


.chart-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: -6px auto 8px;
}

.chart-controls-label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  margin-right: 4px;
}

.chart-view-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  padding: 8px 13px;
  font-size: 0.92rem;
  font-weight: 800;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.chart-view-button:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--primary);
}

.chart-view-button.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.chart-mode-notice {
  max-width: 760px;
  margin: 0 auto 14px;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

.chart-card {
  padding: 18px;
  min-height: 430px;
}

#capitalChart {
  width: 100%;
  min-height: 390px;
}

.chart-text-summary {
  margin-top: 16px;
  padding: 18px;
}

.content-section {
  padding-top: 56px;
}

.content-section h2 {
  font-size: clamp(1.55rem, 3vw, 2.15rem);
}

.content-section h3 {
  margin-top: 32px;
  font-size: 1.28rem;
}

.content-section p,
.content-section li {
  color: #334155;
}

.content-section ul {
  padding-left: 1.25rem;
}

.faq-list {
  display: grid;
  gap: 14px;
}

.faq-item {
  padding: 18px 20px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.faq-item h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
}

.faq-item p {
  margin: 0;
  color: var(--muted);
}

.disclaimer-section {
  padding-bottom: 70px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px 0;
  background: #fff;
}

.footer-inner {
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: flex-start;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-inner p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  justify-content: flex-end;
}

.footer-links a:hover {
  color: var(--primary);
}

.cookie-banner {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(100% - 32px, 760px);
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.cookie-banner p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 900px) {
  .header-inner {
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .top-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .condition-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-condition-summary {
    max-width: 720px;
  }

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

  
.chart-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: -6px auto 8px;
}

.chart-controls-label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  margin-right: 4px;
}

.chart-view-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  padding: 8px 13px;
  font-size: 0.92rem;
  font-weight: 800;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.chart-view-button:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--primary);
}

.chart-view-button.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.chart-mode-notice {
  max-width: 760px;
  margin: 0 auto 14px;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

.chart-card {
    min-height: 360px;
  }

  #capitalChart {
    min-height: 320px;
  }

  .footer-inner {
    flex-direction: column;
  }

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

@media (max-width: 560px) {
  .chart-controls {
    align-items: stretch;
  }

  .chart-controls-label {
    width: 100%;
    text-align: center;
    margin-right: 0;
  }

  .chart-view-button {
    flex: 1 1 44%;
  }

  .brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }


  .hero h1 {
    font-size: clamp(1.72rem, 8.4vw, 2.45rem);
    line-height: 1.22;
    max-width: 100%;
  }

  :lang(ko) .hero h1,
  :lang(ja) .hero h1,
  :lang(zh-CN) .hero h1 {
    word-break: keep-all;
    overflow-wrap: normal;
  }

  .container,
  .container.narrow,
  .container.readable {
    width: min(100% - 24px, var(--container));
  }

  .hero {
    padding: 52px 0 24px;
  }

  .section {
    padding: 28px 0;
  }

  .form-card {
    padding: 18px;
  }

  .primary-actions,
  .secondary-actions,
  .share-row,
  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .condition-list {
    grid-template-columns: 1fr;
  }

  .result-card {
    padding: 19px;
  }
}


@media (max-width: 380px) {
  .hero h1 {
    font-size: clamp(1.52rem, 8vw, 2rem);
  }
}


.results-section {
  padding-bottom: 24px;
}

#chart-section {
  padding-top: 18px;
}
