:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f0f4fa;
  --border: #dfe5f0;
  --text: #111827;
  --muted: #526076;
  --primary: #1d4ed8;
  --primary-dark: #1e40af;
  --primary-soft: #eff6ff;
  --accent: #0f766e;
  --accent-soft: #ecfdf5;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 18px;
}

.site-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #0f766e 100%);
  color: #ffffff;
  padding: 22px 0 28px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.16);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.5px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.brand-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.brand-sub {
  margin: 2px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.82);
}

.lang-switch {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.14);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.lang-btn {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.hero-copy {
  margin-top: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-copy h2 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.hero-copy p {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.88);
  max-width: 680px;
}

.hub-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hub-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.hub-pill:hover {
  background: rgba(255, 255, 255, 0.24);
  text-decoration: none;
}

.ticker-bar {
  margin: -18px auto 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

.ticker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ticker-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.ticker-select, .fx-input {
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 13px;
  background: #ffffff;
  color: var(--text);
}

.ticker-select {
  min-width: 220px;
  flex: 1;
}

.fx-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-soft);
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--muted);
}

.fx-input {
  width: 92px;
  height: 30px;
  font-weight: 700;
  text-align: right;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  background: var(--surface-soft);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

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

.btn-sm {
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 8px;
}

.ticker-meta {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.quick-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tabs-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  margin-bottom: 10px;
  scrollbar-width: thin;
}

.tab-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  padding: 10px 15px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  border-color: #93c5fd;
  color: var(--primary);
}

.tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.22);
}

.calc-card {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

.calc-card.active {
  display: block;
}

.calc-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.calc-head h3 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.calc-head p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
}

.calc-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 22px;
  align-items: start;
}

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

.form-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

@media (max-width: 520px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
}

.field input, .field select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: #ffffff;
  transition: border-color 0.15s ease;
}

.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.field-hint {
  font-size: 11.5px;
  color: var(--muted);
}

.chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: #334155;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.result-panel {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}

.result-hero {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}

.result-hero-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}

.result-hero-val {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--primary);
  word-break: break-word;
}

.result-hero-val.up {
  color: #dc2626;
}

.result-hero-val.down {
  color: #1d4ed8;
}

.result-hero-val.good {
  color: #0f766e;
}

.result-hero-sub {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}

.result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.result-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13.5px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #d5deec;
}

.result-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

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

.result-list strong {
  color: var(--text);
  font-weight: 700;
  text-align: right;
}

.callout {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.55;
}

.callout-info {
  background: var(--primary-soft);
  color: #1e3a8a;
  border: 1px solid #bfdbfe;
}

.callout-good {
  background: var(--accent-soft);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.callout-warn {
  background: var(--warn-soft);
  color: #92400e;
  border: 1px solid #fde68a;
}

.bar-wrap {
  margin-top: 14px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}

.bar-track {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  display: flex;
}

.bar-seg-base {
  background: #3b82f6;
  height: 100%;
}

.bar-seg-gain {
  background: #10b981;
  height: 100%;
}

.bar-legend {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 12.5px;
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.data-table th, .data-table td {
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid #edf2f7;
}

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

.data-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
}

.guide-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 22px;
}

.guide-section h3 {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 800;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.guide-box {
  background: var(--surface-soft);
  border-radius: 12px;
  padding: 14px;
  font-size: 13px;
}

.guide-box h4 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--primary-dark);
}

.guide-box p {
  margin: 0;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--border);
  background: #ffffff;
  padding: 24px 0 36px;
  font-size: 12.5px;
  color: var(--muted);
}

.disclaimer-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.hidden {
  display: none !important;
}
