:root {
  --bg: #14181F;
  --surface: #1D2330;
  --surface-raised: #242B3A;
  --border: rgba(237, 234, 224, 0.12);
  --text-primary: #EDEAE0;
  --text-secondary: #A9A79C;
  --gold: #C9A227;
  --gold-dim: rgba(201, 162, 39, 0.14);
  --teal: #2F9E8F;
  --teal-dim: rgba(47, 158, 143, 0.14);
  --font-display: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 12px;
}

[data-theme="light"] {
  --bg: #F5F3ED;
  --surface: #FFFFFF;
  --surface-raised: #F0EDE3;
  --border: rgba(28, 35, 51, 0.12);
  --text-primary: #1C2333;
  --text-secondary: #6B6960;
  --gold: #A8791E;
  --gold-dim: rgba(168, 121, 30, 0.10);
  --teal: #1F7A6C;
  --teal-dim: rgba(31, 122, 108, 0.10);
}

.theme-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 15px;
  cursor: pointer;
  margin-left: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  vertical-align: middle;
}
.theme-toggle-btn:hover {
  border-color: var(--gold);
}

.search-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 14px;
  cursor: pointer;
  margin-left: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  vertical-align: middle;
}
.search-toggle-btn:hover {
  border-color: var(--gold);
}

/* 전역 검색 모달 */
.search-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 100;
  padding: 12vh 20px 20px;
}
.search-modal.open {
  display: block;
}
.search-modal-inner {
  max-width: 560px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}
.search-modal-input {
  width: 100%;
  height: 52px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 17px;
  padding: 0 14px;
  font-family: var(--font-body);
  flex-shrink: 0;
}
.search-modal-input:focus {
  outline: none;
}
.search-results {
  overflow-y: auto;
  padding: 6px;
}
.search-result-item {
  display: block;
  padding: 12px 14px;
  border-radius: 8px;
}
.search-result-item:hover {
  background: var(--gold-dim);
  text-decoration: none;
}
.search-result-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 3px;
}
.search-result-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}
.search-empty {
  padding: 24px 14px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}
.search-hint {
  padding: 8px 14px 4px;
  font-size: 11px;
  color: var(--text-secondary);
  text-align: right;
  margin: 0;
  flex-shrink: 0;
}

/* 허브 페이지 인라인 검색창 */
.hub-search-wrap {
  max-width: 480px;
  margin: 28px auto 0;
}
.hub-search-input {
  width: 100%;
  height: 50px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-primary);
  font-size: 15px;
  padding: 0 20px;
  font-family: var(--font-body);
  text-align: center;
}
.hub-search-input::placeholder {
  color: var(--text-secondary);
}
.hub-search-input:focus {
  outline: none;
  border-color: var(--gold);
  text-align: left;
}
.hub-search-empty {
  display: none;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  padding: 40px 0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.7;
  transition: background-color 0.2s ease, color 0.2s ease;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

.narrow { max-width: 680px; }

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}
.site-header .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
}
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
}
.logo span { color: var(--gold); }
.site-header nav {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.site-header nav a {
  font-size: 14px;
  color: var(--text-secondary);
  margin-left: 20px;
  white-space: nowrap;
}
.theme-toggle-btn,
.search-toggle-btn {
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .site-header .wrap {
    padding: 0 16px;
  }
  .logo {
    font-size: 17px;
  }
  .site-header nav a.nav-home-link {
    display: none;
  }
  .site-header nav a.nav-lang-link {
    font-size: 12px;
  }
  .site-header nav a {
    margin-left: 10px;
  }
  .theme-toggle-btn,
  .search-toggle-btn {
    width: 32px;
    height: 32px;
    margin-left: 8px;
  }
}

/* Hero */
.hero {
  padding: 64px 0 40px;
}
.eyebrow {
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--gold);
  margin: 0 0 12px;
  font-weight: 500;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 20px;
}
.lede {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0;
}

/* Calc section */
.calc-section {
  padding: 0 0 64px;
}

.ledger-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.ledger-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.ledger-stamp {
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  color: var(--gold);
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.ledger-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  margin: 0 0 2px;
}
.ledger-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.field input[type="number"],
.field input[type="date"],
.field input[type="text"],
.field input[type="time"] {
  width: 100%;
  height: 44px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 16px;
  padding: 0 14px;
  font-family: var(--font-body);
  color-scheme: dark;
}
.field input[type="number"]:focus,
.field input[type="date"]:focus,
.field input[type="text"]:focus,
.field input[type="time"]:focus {
  outline: none;
  border-color: var(--gold);
}

.field select {
  width: 100%;
  height: 44px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 15px;
  padding: 0 36px 0 14px;
  font-family: var(--font-body);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23A9A79C' stroke-width='1.5' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.field select:focus {
  outline: none;
  border-color: var(--gold);
}

.slider-field { margin-bottom: 28px; }
.slider-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.slider-label-row label { margin: 0; }
.slider-label-row span {
  font-size: 15px;
  font-weight: 500;
  color: var(--gold);
}
input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
  height: 4px;
}
.field-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 8px 0 0;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.result-box {
  background: var(--surface-raised);
  border-radius: 8px;
  padding: 16px 18px;
}
.result-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0 0 6px;
}
.result-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.result-label-row .result-label { margin: 0; }
.toggle-label {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}
.toggle-label input {
  accent-color: var(--gold);
  margin-right: 5px;
  width: 14px;
  height: 14px;
}
.custom-target-input {
  width: 100%;
  height: 38px;
  background: var(--bg);
  border: 1px solid var(--gold);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 18px;
  font-family: var(--font-display);
  padding: 0 12px;
  margin-top: 2px;
}
.custom-target-input:focus {
  outline: none;
}
.result-value {
  font-size: 22px;
  font-weight: 500;
  margin: 0;
  font-family: var(--font-display);
}

.verdict-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 22px;
  transition: background 0.2s, border-color 0.2s;
}

.action-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}
.action-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  margin-left: 8px;
  font-family: var(--font-body);
}
.action-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.share-wrap {
  position: relative;
  display: inline-block;
  margin-left: 8px;
}
.share-wrap .action-btn {
  margin-left: 0;
}
.share-menu {
  display: none;
  flex-direction: column;
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  min-width: 170px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  z-index: 20;
}
.share-menu.open {
  display: flex;
}
.share-menu button {
  background: none;
  border: none;
  text-align: left;
  padding: 9px 10px;
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-body);
}
.share-menu button:hover {
  background: var(--gold-dim);
  color: var(--gold);
}

.progress-track {
  width: 100%;
  height: 10px;
  background: var(--surface-raised);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 20px;
}
.progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 5px;
  width: 0%;
  transition: width 0.3s ease;
}
.verdict-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 6px;
}
.verdict-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

/* Explain section */
.explain-section {
  padding: 48px 0 80px;
  border-top: 1px solid var(--border);
}
.explain-section h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin: 40px 0 16px;
}
.explain-section h2:first-child { margin-top: 0; }
.explain-section p {
  color: var(--text-secondary);
  font-size: 15px;
  margin: 0 0 16px;
}
.explain-section strong { color: var(--text-primary); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}
.site-footer .wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.site-footer p {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}
.site-footer nav {
  display: flex;
}
.site-footer nav a {
  font-size: 13px;
  color: var(--text-secondary);
  margin-right: 16px;
}
.site-footer nav a:last-child {
  margin-right: 0;
}

/* Tool hub */
.hub-hero {
  padding: 72px 0 24px;
  text-align: center;
}
.hub-hero .eyebrow { display: block; }
.hub-hero h1 {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  margin: 0 0 16px;
}
.hub-hero .lede {
  margin: 0 auto;
  text-align: center;
}
.tool-count-lede {
  font-size: 15px;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 12px !important;
}

.tool-grid-section {
  padding: 40px 0 80px;
}
.category-label {
  font-size: 13px;
  color: var(--gold);
  font-weight: 500;
  margin: 40px 0 16px;
  letter-spacing: 0.02em;
}
.category-label:first-child { margin-top: 0; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.tool-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  transition: border-color 0.15s, transform 0.15s;
}
.tool-card:hover {
  border-color: var(--gold);
  text-decoration: none;
  transform: translateY(-2px);
}
.tool-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.tool-card-stamp {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  color: var(--gold);
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}
.tool-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
  margin: 0;
}
.tool-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

@media (max-width: 600px) {
  .hero h1 { font-size: 28px; }
  .ledger-card { padding: 22px; }
  .result-grid { grid-template-columns: 1fr; }
  .hub-hero h1 { font-size: 30px; }
}

/* Trust badge */
.trust-badge {
  display: inline-block;
  margin: 16px 0 0;
  padding: 8px 14px;
  background: rgba(47, 158, 143, 0.1);
  border: 1px solid rgba(47, 158, 143, 0.3);
  border-radius: 999px;
  font-size: 12px;
  color: var(--teal);
}

/* Favorite button */
.fav-btn {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s;
}
.fav-btn:hover {
  border-color: var(--gold);
}
.fav-btn.active {
  color: var(--gold);
  border-color: var(--gold);
}

/* Situational nav ("이럴 땐 이 계산기") */
.situation-section {
  padding: 8px 0 56px;
}
.situation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.situation-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
}
.situation-card p.situation-title {
  font-size: 14px;
  color: var(--text-primary);
  margin: 0 0 10px;
  font-weight: 500;
}
.situation-links {
  display: flex;
  flex-wrap: wrap;
}
.situation-links a {
  font-size: 13px;
  background: var(--gold-dim);
  color: var(--gold);
  border-radius: 999px;
  padding: 5px 12px;
  margin-right: 8px;
  margin-bottom: 8px;
}
.situation-links a:hover { text-decoration: none; opacity: 0.85; }

/* Recent / favorite mini sections on hub */
.mini-section {
  padding: 0 0 8px;
}
.mini-section .category-label { margin-top: 0; }

/* FAQ */
.faq-section {
  padding: 8px 0 72px;
}
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}
.faq-item summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  color: var(--gold);
  font-size: 20px;
  margin-left: 12px;
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 12px 0 0;
  line-height: 1.7;
}

/* simple page (privacy/terms/about) */
.simple-page {
  padding: 56px 0 80px;
}
.simple-page h1 {
  font-family: var(--font-display);
  font-size: 28px;
  margin: 0 0 24px;
}
.simple-page h2 {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 32px 0 12px;
}
.simple-page p, .simple-page li {
  color: var(--text-secondary);
  font-size: 15px;
}

/* Contact form */
.contact-form {
  margin-top: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.contact-grid {
  margin-bottom: 20px;
}
.contact-form .field {
  margin-bottom: 20px;
}
.contact-form .field:last-of-type {
  margin-bottom: 0;
}
.contact-form textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 15px;
  padding: 12px 14px;
  font-family: var(--font-body);
  resize: vertical;
}
.contact-form textarea:focus {
  outline: none;
  border-color: var(--gold);
}
.honeypot-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}
.submit-btn {
  margin-top: 24px;
  background: var(--gold);
  color: var(--bg);
  border: none;
  border-radius: 999px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
}
.submit-btn:hover {
  opacity: 0.9;
}
.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.form-success {
  margin-top: 32px;
  background: rgba(47, 158, 143, 0.1);
  border: 1px solid rgba(47, 158, 143, 0.4);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}
.form-success p {
  color: var(--teal);
  font-size: 16px;
  font-weight: 500;
  margin: 0;
}

/* ==== 모두의 패밀리 공통 요소 (사이트 간 통일) ==== */
.nav-family-link{
  display:inline-flex;
  align-items:center;
  gap:5px;
  font-size:12.5px;
  font-weight:600;
  color:var(--text-primary);
  background:var(--gold-dim);
  border:1px solid var(--border);
  border-radius:999px;
  padding:6px 12px;
  margin-right:12px;
  text-decoration:none !important;
  transition:background 0.2s, border-color 0.2s;
}
.nav-family-link:hover{
  border-color:var(--gold);
  background:var(--gold-dim);
}

.ad-slot{
  margin:20px auto;
  max-width:880px;
  min-height:100px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
  border:1.5px dashed var(--border);
  border-radius:var(--radius);
  background:repeating-linear-gradient(45deg, rgba(237,234,224,0.025), rgba(237,234,224,0.025) 10px, transparent 10px, transparent 20px);
  color:var(--text-secondary);
  font-size:12px;
}
.ad-slot-tag{
  font-size:10px;
  font-weight:700;
  letter-spacing:0.08em;
  opacity:0.7;
}
.ad-slot-bottom{min-height:250px;}
