@import url('./css/colors.css');
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: 'Noto Sans KR', sans-serif; background: var(--bg-color); color: var(--text-color); font-size: 15px; line-height: 1.8; background-image: repeating-linear-gradient(
  0deg, transparent, transparent 31px, rgba(139,69,19,0.04) 32px
); }
h1, h2, h3, .serif { font-family: 'Noto Serif KR', serif; }
.container { max-width: 900px; margin: 0 auto; padding: 20px; }

/* ===== INPUT FORM ===== */
#inputSection { max-width: 520px; margin: 60px auto; background: var(--color-white); border: 3px double var(--sub-color); border-radius: 12px; padding: 40px 36px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); outline: 1px solid var(--sub-color); outline-offset: -8px; }
#inputSection h1 { text-align: center; color: var(--main-color); font-size: 26px; margin-bottom: 6px; }
#inputSection .subtitle { text-align: center; color: var(--sub-color); font-size: 14px; margin-bottom: 24px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 6px; color: var(--main-color); font-size: 14px; }
.form-group input, .form-group select { width: 100%; padding: 10px 14px; border: 1px solid #ccc; border-radius: 6px; font-size: 15px; font-family: 'Noto Sans KR', sans-serif; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--sub-color); box-shadow: 0 0 0 2px rgba(139,69,19,0.15); }
.radio-group { display: flex; gap: 20px; margin-top: 6px; }
.radio-group label { font-weight: 400; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.time-unknown { margin-top: 8px; font-size: 13px; }
.time-unknown label { font-weight: 400; display: flex; align-items: center; gap: 6px; cursor: pointer; }
#btnAnalyze { width: 100%; padding: 14px; background: var(--main-color); color: var(--color-white); border: none; border-radius: 8px; font-size: 17px; font-weight: 700; cursor: pointer; font-family: 'Noto Serif KR', serif; letter-spacing: 2px; margin-top: 10px; transition: background 0.2s; }
#btnAnalyze:hover { background: var(--sub-color); }
.decor-line { height: 2px; background: linear-gradient(90deg, transparent, var(--sub-color), transparent); margin: 16px 0 24px; }

/* ===== MODE SELECTOR (카드 UI) ===== */
.mode-selector { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }
.mode-card { flex: 1; min-width: 120px; max-width: 160px; text-align: center; padding: 16px 10px; border: 2px solid var(--color-border); border-radius: 12px; cursor: pointer; transition: all 0.25s; background: var(--color-white); }
.mode-card:hover { border-color: var(--sub-color); background: rgba(139,69,19,0.04); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.mode-card.active { border-color: var(--sub-color); background: rgba(139,69,19,0.08); box-shadow: 0 4px 16px rgba(139,69,19,0.15); }
.mode-card-icon { font-size: 32px; margin-bottom: 6px; }
.mode-card-label { font-weight: 700; color: var(--main-color); font-size: 15px; margin-bottom: 2px; }
.mode-card-desc { font-size: 12px; color: var(--color-text-sub); }

/* ===== RESULT SECTION ===== */
#resultSection { display: none; }
.report-header { text-align: center; padding: 40px 20px 30px; border-bottom: 3px double var(--sub-color); margin-bottom: 30px; }
.report-header h1 { font-size: 28px; color: var(--main-color); margin-bottom: 4px; word-break: keep-all; white-space: normal; line-height: 1.5; letter-spacing: 0; }
.report-subtitle { font-size: 14px; color: var(--sub-color); letter-spacing: 3px; margin-top: 4px; }
.report-header .hanja { font-size: 16px; color: var(--sub-color); margin-bottom: 16px; }
.report-header .client-info { font-size: 16px; color: var(--text-color); }
.report-header .client-name { font-size: 22px; font-weight: 700; color: var(--main-color); margin-bottom: 6px; }

/* Cards */
.card { background: #FDFAF3; border-radius: 4px; border-left: 3px solid var(--sub-color); box-shadow: 0 2px 12px rgba(0,0,0,0.06); padding: 28px; margin-bottom: 28px; orphans: 3; widows: 3; }
.card h2 { font-size: 20px; color: var(--main-color); margin-bottom: 4px; border-bottom: 1px dashed var(--sub-color); letter-spacing: 1px; }
.card .section-hanja { font-size: 13px; color: var(--sub-color); margin-bottom: 18px; }
.card p { margin-bottom: 16px; }

/* Saju Table */
.saju-table { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 600px; margin: 0 auto 20px; }
.saju-col { text-align: center; border: 2px solid var(--sub-color); border-radius: 8px; overflow: hidden; }
.saju-col .col-title { background: var(--main-color); color: var(--color-white); padding: 6px; font-size: 14px; font-weight: 700; }
.saju-col .gan-cell, .saju-col .ji-cell { padding: 14px 8px; font-size: 22px; font-weight: 700; }
.saju-col .gan-cell .hanja-small, .saju-col .ji-cell .hanja-small { display: block; font-size: 13px; font-weight: 400; color: var(--color-text-muted); margin-top: 2px; }
.saju-col .sipsin-label { font-size: 12px; padding: 4px; background: var(--section-bg); color: var(--sub-color); }
.oh-wood { background-color: rgba(46,139,87,0.1); }
.oh-fire { background-color: rgba(220,20,60,0.1); }
.oh-earth { background-color: rgba(218,165,32,0.1); }
.oh-metal { background-color: rgba(192,192,192,0.15); }
.oh-water { background-color: rgba(25,25,112,0.1); }

/* Oheng bar */
.oheng-bar-wrap { margin-bottom: 12px; }
.oheng-bar-label { display: flex; justify-content: space-between; font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.oheng-bar-outer { height: 22px; background: var(--color-border-light); border-radius: 11px; overflow: hidden; }
.oheng-bar-inner { height: 100%; border-radius: 11px; transition: width 0.5s; }
.oheng-status { font-size: 13px; color: var(--color-text-sub); margin-top: 2px; }

/* Daeun timeline */
.daeun-timeline { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.daeun-card { flex: 0 0 calc(12.5% - 10px); min-width: 90px; border: 1px solid var(--color-border); border-radius: 8px; text-align: center; padding: 10px 6px; font-size: 13px; background: var(--color-white); }
.daeun-card.current { border: 2px solid var(--accent); background: rgba(184,134,11,0.08); font-weight: 700; }
.daeun-card .age { font-weight: 700; color: var(--main-color); font-size: 15px; }
.daeun-card .ganji { font-size: 18px; margin: 4px 0; }
.daeun-card .sipsin-d { font-size: 11px; color: var(--sub-color); }

/* Seun */
.seun-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; background: rgba(184,134,11,0.08); border: 2px solid var(--accent); border-radius: 10px; padding: 20px; margin: 16px 0; }
.seun-summary .seun-item { text-align: center; }
.seun-summary .seun-item .label { font-size: 12px; color: var(--sub-color); margin-bottom: 4px; }
.seun-summary .seun-item .value { font-size: 22px; font-weight: 700; color: var(--main-color); }
.seun-summary .seun-item .sub { font-size: 13px; color: var(--color-text-muted); margin-top: 2px; }
.wolun-timeline { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.wolun-card { flex: 0 0 calc(16.666% - 10px); min-width: 80px; border: 1px solid var(--color-border); border-radius: 8px; text-align: center; padding: 8px 4px; font-size: 12px; background: var(--color-white); }
.wolun-card.current-month { border: 2px solid var(--accent); background: rgba(184,134,11,0.08); font-weight: 700; }
.wolun-card .month-label { font-weight: 700; color: var(--main-color); font-size: 13px; }
.wolun-card .ganji { font-size: 16px; margin: 3px 0; }
.wolun-card .sipsin-d { font-size: 10px; color: var(--sub-color); }

/* Buttons */
.btn-row { text-align: center; margin: 30px 0; }
.btn-row button { padding: 12px 28px; border: none; border-radius: 8px; font-size: 15px; font-weight: 700; cursor: pointer; margin: 0 8px; font-family: 'Noto Sans KR', sans-serif; }
#btnPrint, #btnPrint2 { background: var(--main-color); color: var(--color-white); }
#btnPrint:hover, #btnPrint2:hover { background: var(--sub-color); }
#btnNew, #btnNew2 { background: var(--color-border-light); color: var(--main-color); }
#btnNew:hover, #btnNew2:hover { background: var(--color-border); }

/* Footer */
.report-footer { text-align: center; padding: 30px 20px; border-top: 2px solid var(--sub-color); margin-top: 20px; font-size: 13px; color: var(--color-text-sub); }

/* Print */
@media print {
  /* 표지·목차 각각 새 페이지 */
  .cover-page { page-break-after: always; break-after: page; }
  .toc-page   { page-break-after: always; break-after: page; }

  /* 카드(섹션)는 중간에서 잘리지 않도록 */
  .card {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* 제목이 내용과 분리되지 않도록 */
  h2, h3 {
    page-break-after: avoid;
    break-after: avoid;
  }
  h2 + *, h3 + * {
    page-break-before: avoid;
    break-before: avoid;
  }

  /* 리스트·표·그리드 항목 안에서 잘리지 않도록 */
  li, tr, .seun-item, .wolun-card, .pillar, .pillar-item {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* 대운 행·월운 행 잘림 방지 */
  .daeun-row, .wolun-timeline, .wolun-card,
  .compat-category, .compat-summary-section {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* 섹션 그룹: 헤더와 첫 내용이 같은 페이지에 */
  .card > h2:first-child {
    page-break-after: avoid;
    break-after: avoid;
  }

  /* 도표·차트류 잘림 방지 */
  table, figure, .oheng-chart, .chart-wrap {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* 인쇄 시 불필요 UI 숨김 */
  #inputSection, .btn-print, .mode-selector,
  .nav-bar, button, select { display: none !important; }

  /* 인쇄 여백 */
  @page {
    margin: 18mm 15mm;
  }

  /* 본문 폰트 크기 조정 */
  body { font-size: 11pt; }
  .card { margin-bottom: 12pt; padding: 12pt; }

  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; background: var(--color-white); }
  .no-print { display: none !important; }
  .card { box-shadow: none; border: 1px solid var(--color-border); }
  .container { max-width: 100%; padding: 0; }
  .page-break { break-before: page; }
  #inputSection { display: none !important; }
  #resultSection { display: block !important; }
  .report-header { padding-top: 10px; }
  .saju-comparison { grid-template-columns: 1fr 30px 1fr; gap: 8px; }
  .compat-score-circle { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .gunghap-persons { gap: 20px; }
  .compat-bar-inner { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .oheng-comparison { gap: 12px; }
}

/* ===== GUNGHAP STYLES ===== */
.person-label { display: none; font-size: 13px; font-weight: 700; color: var(--sub-color); padding: 8px 12px; background: rgba(139,69,19,0.08); border-radius: 6px; margin-bottom: 16px; text-align: center; }
.person-label.show { display: block; }
.gunghap-header { text-align: center; padding: 40px 20px 30px; border-bottom: 3px double var(--sub-color); margin-bottom: 30px; }
.gunghap-header h1 { font-size: 28px; color: var(--main-color); margin-bottom: 4px; }
.gunghap-header .hanja { font-size: 16px; color: var(--sub-color); margin-bottom: 16px; }
.gunghap-header .heart-icon { font-size: 40px; margin: 12px 0; color: var(--fire); }
.gunghap-persons { display: flex; justify-content: center; gap: 40px; margin: 16px 0; }
.gunghap-person-info { text-align: center; }
.gunghap-person-info .person-name { font-size: 20px; font-weight: 700; color: var(--main-color); }
.gunghap-person-info .person-detail { font-size: 14px; color: var(--color-text-muted); margin-top: 4px; }
.compat-score-circle { width: 140px; height: 140px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 20px auto; border: 6px solid var(--sub-color); background: var(--color-white); box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.compat-score-circle .score-value { font-size: 36px; font-weight: 900; font-family: 'Noto Serif KR', serif; color: var(--main-color); }
.compat-score-circle .score-label { font-size: 13px; color: var(--sub-color); margin-top: 2px; }
.compat-grade { text-align: center; font-size: 22px; font-weight: 700; color: var(--sub-color); margin: 8px 0 20px; font-family: 'Noto Serif KR', serif; }
.saju-comparison { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: start; margin: 20px 0; }
.saju-comparison .vs-divider { display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 900; color: var(--sub-color); min-height: 200px; font-family: 'Noto Serif KR', serif; }
.mini-saju-table { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mini-saju-col { text-align: center; border: 1px solid var(--sub-color); border-radius: 6px; overflow: hidden; font-size: 13px; }
.mini-saju-col .mini-title { background: var(--main-color); color: var(--color-white); padding: 3px; font-size: 11px; font-weight: 700; }
.mini-saju-col .mini-gan, .mini-saju-col .mini-ji { padding: 8px 4px; font-size: 18px; font-weight: 700; }
.mini-saju-col .mini-sipsin { font-size: 10px; padding: 2px; background: var(--section-bg); color: var(--sub-color); }
.saju-person-label { text-align: center; font-weight: 700; color: var(--main-color); margin-bottom: 8px; font-size: 15px; }
.compat-category { margin-bottom: 20px; }
.compat-category-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.compat-category-header .cat-name { font-weight: 700; color: var(--main-color); font-size: 15px; }
.compat-category-header .cat-score { font-weight: 700; color: var(--sub-color); font-size: 15px; }
.compat-bar-outer { height: 20px; background: var(--color-border-light); border-radius: 10px; overflow: hidden; }
.compat-bar-inner { height: 100%; border-radius: 10px; transition: width 0.6s ease-out; }
.compat-bar-excellent { background: linear-gradient(90deg, #2E8B57, #3CB371); }
.compat-bar-good { background: linear-gradient(90deg, #DAA520, #FFD700); }
.compat-bar-average { background: linear-gradient(90deg, #CD853F, #DEB887); }
.compat-bar-caution { background: linear-gradient(90deg, #DC143C, #FF6347); }
.compat-detail { margin-top: 10px; padding: 14px; background: var(--section-bg); border-radius: 8px; font-size: 14px; line-height: 1.8; color: #444; }
.compat-detail strong { color: var(--main-color); }
.oheng-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 16px 0; }
.oheng-comparison .person-oheng { padding: 16px; background: var(--color-white); border-radius: 8px; border: 1px solid var(--color-border); }
.oheng-comparison .person-oheng h4 { text-align: center; color: var(--main-color); margin-bottom: 12px; font-size: 15px; }

/* ===== GYEOKGUK BADGE ===== */
.gyeokguk-badge { display: inline-flex; align-items: center; gap: 10px; background: linear-gradient(135deg, var(--main-color), var(--sub-color)); color: var(--color-white); padding: 10px 20px; border-radius: 30px; font-size: 16px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.gyeokguk-badge .gyeokguk-type { font-weight: 700; font-family: 'Noto Serif KR', serif; }
.gyeokguk-badge .gyeokguk-name { font-size: 14px; opacity: 0.85; }

/* ===== LUCKY GRID ===== */
.lucky-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.lucky-card { background: var(--color-white); border: 1px solid #e8e0d4; border-radius: 10px; padding: 16px 12px; text-align: center; transition: all 0.2s; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.lucky-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); border-color: var(--accent); }
.lucky-card-icon { font-size: 28px; margin-bottom: 6px; }
.lucky-card-title { font-size: 12px; color: var(--sub-color); font-weight: 700; margin-bottom: 4px; }
.lucky-card-value { font-size: 13px; color: var(--text-color); line-height: 1.5; }

/* ===== SUB-SECTION ===== */
.sub-section { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px dashed #e0d5c5; }
.sub-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.sub-section h3 { color: var(--sub-color); font-size: 16px; margin-bottom: 8px; font-family: 'Noto Serif KR', serif; }

/* ===== HEALTH TIMELINE ===== */
.health-timeline { background: rgba(220,20,60,0.04); border-radius: 8px; padding: 16px; border-left: 4px solid var(--fire); }

/* ===== AVOID ITEM ===== */
.avoid-item { display: inline-block; margin: 4px 0; padding: 8px 14px; background: rgba(220,20,60,0.06); border: 1px solid rgba(220,20,60,0.2); border-radius: 6px; font-size: 14px; color: var(--fire); margin-right: 8px; }

/* ===== GUNGHAP ENHANCED CONTENT ===== */
.compat-meaning { margin: 14px 0; padding: 16px 18px; background: rgba(184,134,11,0.06); border-left: 4px solid var(--accent); border-radius: 0 8px 8px 0; font-size: 14px; line-height: 1.8; color: #444; }
.compat-meaning strong { display: block; color: var(--sub-color); font-size: 13px; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.compat-meaning p { margin: 0; }

.compat-good { margin: 12px 0; padding: 14px 18px; background: rgba(46,139,87,0.05); border-left: 4px solid var(--wood); border-radius: 0 8px 8px 0; font-size: 14px; line-height: 1.8; }
.compat-good strong { display: block; color: var(--wood); font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.compat-good ul { margin: 0; padding-left: 20px; }
.compat-good li { margin-bottom: 4px; color: #444; }
.compat-good li::marker { color: var(--wood); }
.compat-good p { margin: 0; color: #444; }

.compat-bad { margin: 12px 0; padding: 14px 18px; background: rgba(205,133,63,0.06); border-left: 4px solid #CD853F; border-radius: 0 8px 8px 0; font-size: 14px; line-height: 1.8; }
.compat-bad strong { display: block; color: #B8730A; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.compat-bad ul { margin: 0; padding-left: 20px; }
.compat-bad li { margin-bottom: 4px; color: #555; }
.compat-bad li::marker { color: #CD853F; }
.compat-bad p { margin: 0; color: #555; }

.compat-daily { margin: 12px 0; padding: 16px 18px; background: rgba(139,69,19,0.04); border: 1px dashed rgba(139,69,19,0.25); border-radius: 8px; font-size: 14px; line-height: 1.8; color: #444; }
.compat-daily strong { display: block; color: var(--sub-color); font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.compat-daily p { margin: 0; }

.compat-resolution { margin: 12px 0; padding: 16px 18px; background: rgba(25,25,112,0.04); border-left: 4px solid var(--water); border-radius: 0 8px 8px 0; font-size: 14px; line-height: 1.8; color: #444; }
.compat-resolution strong { display: block; color: var(--water); font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.compat-resolution p { margin: 0; }

.compat-summary-section { margin-top: 20px; padding: 20px; border-radius: 10px; font-size: 14px; line-height: 1.8; }
.compat-summary-section h3 { font-size: 16px; margin-bottom: 10px; font-family: 'Noto Serif KR', serif; }
.compat-summary-section p { margin: 0; color: #444; }

.compat-summary-good { background: rgba(46,139,87,0.06); border: 1px solid rgba(46,139,87,0.2); }
.compat-summary-good h3 { color: var(--wood); }

.compat-summary-bad { background: rgba(205,133,63,0.06); border: 1px solid rgba(205,133,63,0.2); }
.compat-summary-bad h3 { color: #B8730A; }

.compat-summary-resolution { background: rgba(25,25,112,0.05); border: 1px solid rgba(25,25,112,0.15); }
.compat-summary-resolution h3 { color: var(--water); }

.action-guide { margin-top: 14px; padding: 14px 18px; background: rgba(255,255,255,0.6); border-radius: 8px; }
.action-guide strong { display: block; font-size: 13px; color: var(--water); margin-bottom: 8px; }
.action-guide ul { margin: 0; padding-left: 20px; }
.action-guide li { margin-bottom: 6px; color: #444; font-size: 13px; }
.action-guide li::marker { color: var(--water); }

@media (max-width: 600px) {
  .saju-comparison { grid-template-columns: 1fr; gap: 8px; }
  .saju-comparison .vs-divider { min-height: auto; padding: 8px 0; font-size: 20px; }
  .gunghap-persons { flex-direction: column; gap: 12px; }
  .oheng-comparison { grid-template-columns: 1fr; gap: 12px; }
  .mode-selector { flex-direction: column; align-items: center; }
  .mode-card { max-width: 100%; min-width: auto; }
  .lucky-grid { grid-template-columns: repeat(2, 1fr); }
  .compat-meaning, .compat-good, .compat-bad, .compat-daily, .compat-resolution { padding: 12px 14px; }
  .compat-summary-section { padding: 14px; }
}

@media print {
  .compat-meaning, .compat-good, .compat-bad, .compat-daily, .compat-resolution { break-inside: avoid; }
  .compat-summary-section { break-inside: avoid; }
  .compat-meaning { background: rgba(184,134,11,0.04) !important; }
  .compat-good { background: rgba(46,139,87,0.03) !important; }
  .compat-bad { background: rgba(205,133,63,0.04) !important; }
  .compat-resolution { background: rgba(25,25,112,0.03) !important; }
  .compat-summary-good { background: rgba(46,139,87,0.04) !important; }
  .compat-summary-bad { background: rgba(205,133,63,0.04) !important; }
  .compat-summary-resolution { background: rgba(25,25,112,0.03) !important; }
}

/* ===== 표지 페이지 (고급 리디자인) ===== */
.cover-page {
  page-break-after: always;
  break-after: page;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F7F0E2;
  padding: 0;
  position: relative;
  overflow: hidden;
}

/* 외곽 이중 테두리 장식 */
.cover-page::before {
  content: '';
  position: absolute;
  inset: 20px;
  border: 1px solid rgba(107,61,30,0.35);
  pointer-events: none;
}
.cover-page::after {
  content: '';
  position: absolute;
  inset: 26px;
  border: 1px solid rgba(107,61,30,0.18);
  pointer-events: none;
}

.cover-inner {
  max-width: 520px;
  width: 100%;
  text-align: center;
  padding: 80px 60px;
  position: relative;
  z-index: 1;
}

/* 상단 삼선 장식 */
.cover-top-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 36px;
}
.cover-top-ornament span {
  display: inline-block;
  height: 1px;
  background: var(--sub-color);
  opacity: 0.5;
}
.cover-top-ornament span:nth-child(1),
.cover-top-ornament span:nth-child(3) { width: 40px; }
.cover-top-ornament span:nth-child(2) { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: 1; }

.cover-logo {
  font-size: 60px;
  font-weight: 900;
  color: var(--sub-color);
  letter-spacing: 6px;
  margin-bottom: 6px;
  line-height: 1;
  text-shadow: 2px 2px 0 rgba(107,61,30,0.12);
}
.cover-institute {
  font-size: 15px;
  color: var(--sub-color);
  letter-spacing: 5px;
  margin-bottom: 0;
  opacity: 0.85;
}

/* 중앙 황금 구분선 */
.cover-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 32px auto;
}
.cover-divider::before,
.cover-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent));
}
.cover-divider::after {
  background: linear-gradient(to left, transparent, var(--accent));
}
.cover-divider-diamond {
  width: 8px;
  height: 8px;
  background: var(--accent);
  transform: rotate(45deg);
  flex-shrink: 0;
}

.cover-title {
  font-size: 30px;
  font-weight: bold;
  color: var(--main-color);
  line-height: 1.7;
  margin-bottom: 10px;
  letter-spacing: 2px;
}
.cover-name {
  font-size: 34px;
  font-weight: 900;
  color: var(--sub-color);
  letter-spacing: 3px;
}
.cover-subtitle {
  font-size: 13px;
  color: var(--sub-color);
  letter-spacing: 4px;
  margin: 18px 0 0;
  opacity: 0.75;
}
.cover-message {
  font-size: 13px;
  color: #8a7060;
  line-height: 2.2;
  margin: 32px 0 36px;
  font-style: italic;
  padding: 18px 24px;
  background: rgba(156,107,40,0.07);
  border-top: 1px solid rgba(107,61,30,0.2);
  border-bottom: 1px solid rgba(107,61,30,0.2);
}
.cover-info {
  font-size: 12.5px;
  color: #7a6a5a;
  line-height: 2.4;
  border-top: 1px dashed rgba(107,61,30,0.3);
  padding-top: 20px;
}
.cover-info-row {
  display: flex;
  justify-content: center;
  gap: 6px;
}
.cover-info-label {
  color: var(--sub-color);
  font-weight: bold;
  min-width: 80px;
  text-align: right;
}
.cover-info-value {
  text-align: left;
  min-width: 140px;
}
.cover-date {
  margin-top: 12px;
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 1px;
}

/* 하단 삼선 장식 */
.cover-bottom-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 36px;
}
.cover-bottom-ornament span:nth-child(1),
.cover-bottom-ornament span:nth-child(3) {
  display: inline-block; width: 40px; height: 1px;
  background: var(--sub-color); opacity: 0.4;
}
.cover-bottom-ornament span:nth-child(2) {
  display: inline-block; width: 5px; height: 5px;
  border-radius: 50%; background: var(--sub-color); opacity: 0.4;
}

/* ===== 목차 페이지 ===== */
.toc-page {
  page-break-after: always;
  min-height: 60vh;
  padding: 60px 48px;
  background: var(--bg-color);
}
.toc-header {
  text-align: center;
  margin-bottom: 40px;
}
.toc-header h2 {
  font-size: 26px;
  color: var(--main-color);
  letter-spacing: 8px;
  border-bottom: none;
  margin-bottom: 6px;
}
.toc-hanja {
  font-size: 13px;
  color: var(--sub-color);
  letter-spacing: 4px;
}
.toc-list {
  list-style: none;
  counter-reset: toc-counter;
  padding: 0;
  margin: 0 auto;
  max-width: 500px;
}
.toc-list li {
  counter-increment: toc-counter;
  display: flex;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px dotted rgba(107,61,30,0.25);
  font-size: 15px;
  color: var(--main-color);
  line-height: 1.5;
}
.toc-list li::before {
  content: counter(toc-counter);
  min-width: 28px;
  font-size: 13px;
  color: var(--sub-color);
  font-weight: bold;
  flex-shrink: 0;
}
.toc-footer {
  text-align: center;
  margin-top: 40px;
  font-size: 13px;
  color: var(--sub-color);
  letter-spacing: 2px;
}

@media screen {
  .cover-page,
  .toc-page {
    border-bottom: 2px dashed rgba(107,61,30,0.2);
    margin-bottom: 32px;
    padding-bottom: 0;
  }
}

/* ══════════════════════════════════════════════
   신살 분석 섹션 스타일
══════════════════════════════════════════════ */
.sinssal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 12px 0 20px;
}
.sinssal-item {
  padding: 14px 16px;
  border-radius: 6px;
  font-size: 13.5px;
  line-height: 1.6;
  break-inside: avoid;
  page-break-inside: avoid;
}
.sinssal-good {
  background: rgba(100, 150, 80, 0.08);
  border-left: 3px solid #6a9a50;
}
.sinssal-bad {
  background: rgba(180, 80, 60, 0.07);
  border-left: 3px solid #b05040;
}
.sinssal-name {
  font-weight: bold;
  color: var(--main-color);
  margin-bottom: 4px;
  font-size: 14px;
}
.sinssal-name span {
  font-size: 11px;
  color: var(--sub-color);
  margin-left: 6px;
}
.sinssal-pillars {
  font-size: 12px;
  color: var(--color-text-sub);
  margin-bottom: 6px;
}
.sinssal-desc {
  font-size: 13px;
  color: #555;
  line-height: 1.6;
}
.sinssal-summary {
  margin-top: 20px;
  padding: 16px;
  background: var(--section-bg);
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.8;
  color: #555;
}
.sinssal-empty {
  font-size: 13px;
  color: var(--color-text-faint);
  font-style: italic;
  margin: 8px 0 16px;
}

/* ── 신살 콘텐츠 강화 블록 (Pain→Relief→Action→Mindset / Gift→How→Caution) ── */

/* 살 — Pain 블록 */
.sinssal-pain {
  background: rgba(180, 80, 60, 0.05);
  border-left: 3px solid #b05040;
  padding: 10px 14px;
  margin: 10px 0;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  line-height: 1.8;
  color: #555;
}
.sinssal-pain::before {
  content: "공감 — ";
  font-weight: 700;
  color: #b05040;
  display: block;
  font-size: 11px;
  margin-bottom: 4px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* 살 — Relief 블록 */
.sinssal-relief {
  background: rgba(46, 139, 87, 0.06);
  border-left: 3px solid var(--color-success);
  padding: 10px 14px;
  margin: 10px 0;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  line-height: 1.8;
  color: #444;
}
.sinssal-relief::before {
  content: "재해석 — ";
  font-weight: 700;
  color: var(--color-success);
  display: block;
  font-size: 11px;
  margin-bottom: 4px;
  letter-spacing: 1px;
}

/* 살 — Action 블록 */
.sinssal-action {
  background: rgba(156, 107, 40, 0.07);
  border-left: 3px solid var(--accent, #9c6b28);
  padding: 10px 14px;
  margin: 10px 0;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  line-height: 1.8;
  color: #444;
}
.sinssal-action::before {
  content: "개운법 — ";
  font-weight: 700;
  color: var(--accent, #9c6b28);
  display: block;
  font-size: 11px;
  margin-bottom: 4px;
  letter-spacing: 1px;
}

/* 살 — Mindset 블록 */
.sinssal-mindset {
  font-style: italic;
  font-family: 'Noto Serif KR', serif;
  font-size: 13px;
  color: #6b3d1e;
  border: 1px solid rgba(107, 61, 30, 0.2);
  border-radius: 6px;
  padding: 10px 14px;
  margin: 10px 0;
  text-align: center;
  line-height: 1.7;
  background: rgba(245, 237, 216, 0.6);
}
.sinssal-mindset::before {
  content: '"';
  font-size: 18px;
  color: rgba(107, 61, 30, 0.4);
  margin-right: 4px;
}
.sinssal-mindset::after {
  content: '"';
  font-size: 18px;
  color: rgba(107, 61, 30, 0.4);
  margin-left: 4px;
}

/* 귀인 — Gift 블록 */
.sinssal-gift {
  background: rgba(156, 107, 40, 0.08);
  border-left: 3px solid var(--accent, #9c6b28);
  padding: 10px 14px;
  margin: 10px 0;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  line-height: 1.8;
  color: #444;
}
.sinssal-gift::before {
  content: "선물 — ";
  font-weight: 700;
  color: var(--accent, #9c6b28);
  display: block;
  font-size: 11px;
  margin-bottom: 4px;
  letter-spacing: 1px;
}

/* 귀인 — How 블록 */
.sinssal-how {
  background: rgba(46, 139, 87, 0.07);
  border-left: 3px solid var(--color-success);
  padding: 10px 14px;
  margin: 10px 0;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  line-height: 1.8;
  color: #444;
}
.sinssal-how::before {
  content: "활용법 — ";
  font-weight: 700;
  color: var(--color-success);
  display: block;
  font-size: 11px;
  margin-bottom: 4px;
  letter-spacing: 1px;
}

/* 귀인 — Caution 블록 */
.sinssal-caution {
  background: rgba(180, 120, 60, 0.06);
  border-left: 3px solid #b47840;
  padding: 10px 14px;
  margin: 10px 0;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  line-height: 1.8;
  color: #555;
}
.sinssal-caution::before {
  content: "주의 — ";
  font-weight: 700;
  color: #b47840;
  display: block;
  font-size: 11px;
  margin-bottom: 4px;
  letter-spacing: 1px;
}

@media print {
  .sinssal-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .sinssal-pain, .sinssal-relief, .sinssal-action, .sinssal-mindset,
  .sinssal-gift, .sinssal-how, .sinssal-caution {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* ══════════════════════════════════════════════
   12운성 분석 섹션 스타일
══════════════════════════════════════════════ */
.unseong-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.unseong-card {
  padding: 16px;
  background: var(--section-bg);
  border-radius: 4px;
  text-align: center;
  border-top: 3px solid var(--accent);
}
.unseong-pillar {
  font-size: 12px;
  color: var(--sub-color);
  font-weight: bold;
  margin-bottom: 6px;
}
.unseong-name {
  font-size: 22px;
  font-weight: bold;
  color: var(--main-color);
}
.unseong-hanja {
  font-size: 13px;
  color: var(--sub-color);
  margin-bottom: 8px;
}
.unseong-desc {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.7;
  text-align: left;
}
.unseong-summary {
  margin-top: 16px;
  padding: 16px;
  background: var(--section-bg);
  border-radius: 4px;
  font-size: 14px;
  color: #555;
  line-height: 1.9;
}

/* 인쇄 시 unseong-grid 보정 */
@media print {
  .unseong-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .unseong-card {
    break-inside: avoid;
  }
}

/* ===== 일주론 섹션 ===== */
.ilju-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #2a1a0e, var(--sub-color));
  color: var(--color-white);
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 18px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.ilju-badge .ilju-name { font-weight: 700; font-family: 'Noto Serif KR', serif; font-size: 22px; }
.ilju-badge .ilju-hanja { font-size: 15px; opacity: 0.85; }
.ilju-comment {
  margin-top: 16px;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  background: rgba(156,107,40,0.08);
  font-size: 14px;
  color: var(--sub-color);
  font-weight: 700;
  font-style: italic;
  line-height: 1.8;
}

/* ===== 형충파해합 섹션 ===== */
.hcph-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.hcph-item {
  padding: 14px;
  border-radius: 6px;
  background: var(--section-bg);
  border-top: 3px solid var(--accent);
}
.hcph-item.hap { border-top-color: var(--wood); }
.hcph-item.chung { border-top-color: var(--fire); }
.hcph-item.hyung { border-top-color: var(--fire); }
.hcph-item.pa { border-top-color: var(--metal); }
.hcph-item.hae { border-top-color: var(--metal); }
.hcph-item-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--main-color);
}
.hcph-item-pillars {
  font-size: 12px;
  color: var(--sub-color);
  margin-bottom: 6px;
}
.hcph-item-desc {
  font-size: 13px;
  color: #555;
  line-height: 1.7;
}
.hcph-item-classical {
  font-size: 12px;
  color: var(--color-text-faint);
  margin-bottom: 4px;
  line-height: 1.6;
}
.hcph-item-life {
  font-size: 14px;
  color: #444;
  line-height: 1.7;
  border-left: 3px solid currentColor;
  padding-left: 8px;
  margin-top: 6px;
}
.hcph-none {
  padding: 16px;
  background: var(--section-bg);
  border-radius: 6px;
  font-size: 14px;
  color: #777;
  text-align: center;
}
.hcph-summary {
  margin-top: 20px;
  padding: 14px 18px;
  border-left: 3px solid var(--sub-color);
  background: rgba(107,61,30,0.06);
  font-size: 14px;
  color: #555;
  line-height: 1.9;
}

/* 인쇄 시 */
@media print {
  .hcph-grid { grid-template-columns: repeat(2, 1fr); }
  .ilju-badge { background: var(--sub-color) !important; }
}

/* ─── 인과 설명 블록 ─────────────────────────────────────── */
.reason-block {
  margin-top: 14px;
  padding: 14px 18px;
  background: rgba(184, 134, 11, 0.05);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  font-size: 13.5px;
  color: #5a4a2a;
  line-height: 2;
  font-style: italic;
}
.reason-block strong {
  font-style: normal;
  color: var(--sub-color);
}

/* ─── 개운법 한자 배지 그리드 ───────────────────────────── */
.gaeun-hanja-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.gaeun-hanja-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--section-bg);
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-size: 18px;
  font-weight: bold;
  color: var(--sub-color);
  font-family: 'Noto Serif KR', serif;
  cursor: default;
}

/* ─── 월운 상세 카드 ───────────────────────────────────────── */
.wolun-detail-card {
  margin-bottom: 16px;
  padding: 16px;
  background: #f9f9f9;
  border-radius: 10px;
  border-left: 4px solid var(--metal);
}
.wolun-detail-card.current-month {
  background: rgba(184,134,11,0.08);
  border-left-color: var(--accent);
}
.wolun-detail-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.wolun-month-num { font-size:18px; font-weight:700; color:var(--accent); min-width:36px; }
.wolun-ganji { font-size:18px; font-weight:700; }
.wolun-hanja { font-size:13px; color:var(--color-text-faint); }
.wolun-sipsin-badge {
  display:inline-block; padding:2px 8px; border-radius:12px;
  font-size:12px; font-weight:600; background:var(--accent); color:var(--color-white);
}
.wolun-oheng-tag { font-size:12px; color:var(--color-text-sub); }
.current-badge { font-size:12px; color:var(--fire); font-weight:600; }
.wolun-detail-body {
  display:grid; grid-template-columns:1fr 1fr; gap:10px;
}
@media(max-width:600px) { .wolun-detail-body { grid-template-columns:1fr; } }
.wolun-section { padding:10px 12px; border-radius:8px; font-size:13px; line-height:1.6; }
.wolun-section.energy  { background:rgba(70,130,180,0.08); }
.wolun-section.good    { background:rgba(76,153,0,0.08); }
.wolun-section.caution { background:rgba(200,60,60,0.08); }
.wolun-section.gaeun   { background:rgba(184,134,11,0.08); }
.wolun-section-label {
  font-weight:700; font-size:11px; margin-bottom:4px;
  text-transform:uppercase; letter-spacing:0.5px;
}
.wolun-section.energy .wolun-section-label  { color:steelblue; }
.wolun-section.good .wolun-section-label    { color:var(--wood); }
.wolun-section.caution .wolun-section-label { color:var(--fire); }
.wolun-section.gaeun .wolun-section-label   { color:var(--accent); }

/* ══════════════════════════════════════════════
   세운 상세 블록 (개운법 / 주의사항 / 마음가짐)
══════════════════════════════════════════════ */
.seun-gaeun-block {
  background: var(--color-success-bg);
  border-left: 4px solid var(--color-success);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin: 14px 0;
}
.seun-caution-block {
  background: var(--color-danger-bg);
  border-left: 4px solid var(--color-danger);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin: 14px 0;
}
.seun-mindset-block {
  background: var(--color-mindset-bg);
  border-left: 4px solid var(--color-mindset);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin: 14px 0;
  font-style: italic;
  font-family: 'Noto Serif KR', serif;
}
.seun-block-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--color-text);
  font-style: normal;
  font-family: 'Noto Sans KR', sans-serif;
}
.seun-gaeun-list, .seun-caution-list {
  margin: 0;
  padding-left: 20px;
}
.seun-gaeun-list li { color: var(--color-success-text); margin-bottom: 4px; font-size: 13px; }
.seun-caution-list li { color: var(--color-danger-text); margin-bottom: 4px; font-size: 13px; }

/* ══════════════════════════════════════════════
   궁합 전면 개편 — 개인 요약 섹션 및 신규 클래스
══════════════════════════════════════════════ */
.person-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0;
}
.person-summary-item {
  padding: 10px 14px;
  background: var(--section-bg);
  border-radius: 8px;
}
.person-summary-label {
  font-size: 12px;
  color: var(--sub-color);
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.person-summary-value {
  font-size: 14px;
  color: var(--text-color);
  line-height: 1.6;
}
.person-summary-narrative {
  margin-top: 12px;
  padding: 14px;
  background: linear-gradient(135deg, var(--section-bg), #f8f5f0);
  border-radius: 8px;
  border-left: 3px solid var(--sub-color);
  font-size: 14px;
  line-height: 1.8;
}

/* 두 사람 비교 그리드 */
.person-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 12px 0;
}
.person-card {
  background: #fafafa;
  border: 1px solid #e0d4c0;
  border-radius: 8px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.6;
}

/* 용신 궁합 박스 */
.ys-compat-box {
  padding: 12px 16px;
  border-radius: 8px;
  margin: 8px 0;
}

/* 갈등 패턴 */
.conflict-item {
  margin-bottom: 16px;
  padding: 14px;
  background: var(--section-bg);
  border-radius: 8px;
  border-left: 3px solid #e74c3c;
}
.conflict-situation {
  font-weight: 700;
  color: #c0392b;
  margin-bottom: 6px;
  font-size: 15px;
}
.conflict-reason {
  font-size: 13px;
  color: #777;
  margin-bottom: 6px;
  line-height: 1.6;
}
.conflict-solution {
  font-size: 14px;
  color: var(--text-color);
  line-height: 1.7;
}

/* 하이라이트 박스 */
.highlight-good {
  padding: 14px;
  background: rgba(46,139,87,0.1);
  border-radius: 8px;
  border-left: 3px solid var(--wood);
  margin: 12px 0;
  font-size: 14px;
  line-height: 1.7;
}
.highlight-caution {
  padding: 14px;
  background: rgba(220,20,60,0.07);
  border-radius: 8px;
  border-left: 3px solid var(--fire);
  margin: 12px 0;
  font-size: 14px;
  line-height: 1.7;
}

/* 마무리 서명 */
.closing-sign {
  text-align: right;
  color: var(--sub-color);
  font-style: italic;
  margin-top: 16px;
}

@media (max-width: 600px) {
  .person-summary-grid { grid-template-columns: 1fr; }
  .person-compare-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════
   7대 신규 기능 — 스타일
══════════════════════════════════════════════ */

/* 기능 1: 십신 뱃지 */
.sipsin-badge { display:inline-block; padding:4px 14px; border-radius:12px; font-weight:700; font-size:15px; margin:8px 0; color:var(--color-white); }

/* 기능 3·5 공용: 타이밍 행 */
.timing-row     { padding:12px 16px; border-radius:8px; margin:8px 0; }
.timing-best    { background:rgba(46,139,87,0.12); border-left:4px solid var(--wood); }
.timing-one     { background:rgba(218,165,32,0.12); border-left:4px solid var(--earth); }
.timing-caution { background:rgba(220,20,60,0.10); border-left:4px solid var(--fire); }

/* 기능 4: 월별 표 */
.month-table { width:100%; border-collapse:collapse; font-size:13px; margin-top:12px; }
.month-table th,
.month-table td { padding:8px 10px; border:1px solid #e0d9ce; text-align:center; }
.month-table th { background:var(--section-bg); font-weight:700; color:var(--sub-color); }
.month-current  { background:rgba(139,90,43,0.12) !important; font-weight:700; }

/* ── Pain → Relief → Action 블록 (오행) ──────────────────── */
.oheng-insight-block {
  margin-top: 12px;
  padding: 14px;
  background: rgba(0,0,0,0.02);
  border-radius: 6px;
  border-left: 3px solid var(--accent);
}
.oheng-pain {
  font-size: 13px;
  color: #555;
  line-height: 1.9;
  margin-bottom: 8px;
  font-style: italic;
}
.oheng-relief {
  font-size: 13px;
  color: var(--wood);
  line-height: 1.9;
  margin-bottom: 8px;
  font-weight: 500;
}
.oheng-action {
  font-size: 12.5px;
  color: var(--sub-color);
  line-height: 1.8;
  background: rgba(184,134,11,0.06);
  padding: 8px 12px;
  border-radius: 4px;
}

/* ── 십신 인사이트 블록 ──────────────────────────────────── */
.sipsin-insight-block {
  margin-top: 12px;
  padding: 14px;
  background: rgba(0,0,0,0.02);
  border-radius: 6px;
  border-left: 3px solid var(--sub-color);
}
.sipsin-pain {
  font-size: 13px;
  color: #555;
  line-height: 1.9;
  margin-bottom: 8px;
  font-style: italic;
}
.sipsin-relief {
  font-size: 13px;
  color: var(--wood);
  line-height: 1.9;
  margin-bottom: 8px;
  font-weight: 500;
}
.sipsin-pattern {
  font-size: 12.5px;
  color: var(--sub-color);
  line-height: 1.8;
  background: rgba(107,61,30,0.05);
  padding: 8px 12px;
  border-radius: 4px;
}

/* ── 개운 루틴 그리드 ────────────────────────────────────── */
.gaeun-routine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.gaeun-routine-card {
  padding: 14px;
  background: var(--section-bg);
  border-radius: 8px;
  border-top: 3px solid var(--accent);
}
.gaeun-routine-card.morning   { border-top-color: #f4a460; }
.gaeun-routine-card.daily     { border-top-color: var(--wood); }
.gaeun-routine-card.evening   { border-top-color: #4a7fb5; }
.gaeun-routine-card.thismonth { border-top-color: var(--sub-color); }
.routine-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--sub-color);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
.routine-content {
  font-size: 13px;
  color: #555;
  line-height: 1.8;
}

/* ── 편지 블록 ─────────────────────────────────────────── */
.letter-block {
  margin-top: 20px;
  padding: 28px 32px;
  background: linear-gradient(135deg, rgba(184,134,11,0.06), rgba(139,69,19,0.06));
  border-radius: 12px;
  border: 1px solid rgba(184,134,11,0.2);
}
.letter-salutation {
  font-size: 18px;
  font-weight: 700;
  color: var(--main-color);
  margin-bottom: 20px;
}
.letter-body p {
  font-size: 14.5px;
  color: #444;
  line-height: 2.1;
  margin-bottom: 12px;
}
.letter-closing {
  margin-top: 24px;
  font-size: 14px;
  color: var(--sub-color);
  font-weight: 600;
  text-align: right;
}

/* ── 역학자 당부 마무리 박스 ─────────────────────────────── */
.closing-statement {
  margin-top: 24px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(184,134,11,0.08), rgba(139,69,19,0.08));
  border-radius: 12px;
  font-size: 14.5px;
  color: var(--main-color);
  line-height: 2.1;
  white-space: pre-line;
  border-left: 4px solid var(--accent);
}

/* ==============================
   주의하실 것 (注意事項) 섹션
   ============================== */
.juyui-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 20px;
}

.juyui-item {
  background: var(--color-white);
  border: 1.5px solid var(--color-danger-border);
  border-left: 5px solid var(--color-danger);
  border-radius: 8px;
  padding: 20px 22px;
  box-shadow: 0 2px 8px rgba(194,59,34,0.07);
}

.juyui-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.juyui-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--color-danger);
  color: var(--color-white);
  font-size: 13px;
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
}

.juyui-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.2px;
}

.juyui-hanja {
  font-size: 12px;
  color: var(--color-text-sub);
  font-family: 'Noto Serif KR', serif;
}

.juyui-context {
  display: inline-block;
  background: #fff3cd;
  border: 1px solid #f0c040;
  color: #7a5c00;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
  letter-spacing: 0.3px;
}

.juyui-ground {
  background: var(--color-danger-bg);
  border-left: 4px solid var(--color-danger);
  padding: 10px 14px;
  margin: 10px 0;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  line-height: 1.85;
  color: var(--color-danger-text);
}
.juyui-ground::before {
  content: "역학적 근거";
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-danger);
  background: rgba(194,59,34,0.1);
  padding: 1px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.juyui-reality {
  background: var(--color-info-bg);
  border-left: 4px solid var(--color-info);
  padding: 10px 14px;
  margin: 10px 0;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  line-height: 1.85;
  color: var(--color-info-text);
}
.juyui-reality::before {
  content: "현실에서의 모습";
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #4a5c8a;
  background: rgba(107,125,179,0.12);
  padding: 1px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.juyui-solution {
  background: var(--color-success-bg);
  border-left: 4px solid var(--color-success);
  padding: 10px 14px;
  margin: 10px 0;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  line-height: 1.85;
  color: var(--color-success-text);
}
.juyui-solution::before {
  content: "해결책 · 행동 지침";
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-success);
  background: rgba(46,156,98,0.1);
  padding: 1px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.juyui-solution ul {
  margin: 6px 0 0 0;
  padding-left: 20px;
}
.juyui-solution li {
  margin-bottom: 5px;
  color: var(--color-success-text);
}

.juyui-mindset {
  font-style: italic;
  font-family: 'Noto Serif KR', serif;
  font-size: 13px;
  color: var(--color-mindset-text);
  background: var(--color-mindset-bg);
  border: 1px solid var(--color-mindset-border);
  text-align: center;
  padding: 12px 18px;
  margin: 12px 0 0 0;
  border-radius: 6px;
  line-height: 1.75;
}
.juyui-mindset::before {
  content: "🧘 마음가짐";
  display: block;
  font-size: 11px;
  font-weight: 700;
  font-style: normal;
  color: #6b4fa0;
  margin-bottom: 5px;
  letter-spacing: 0.5px;
}

.juyui-empty {
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.9;
  padding: 24px;
  background: #fafafa;
  border: 1px dashed var(--color-border);
  border-radius: 8px;
  margin-top: 12px;
}

@media print {
  .conflict-item { break-inside: avoid; }
  .highlight-good, .highlight-caution { break-inside: avoid; }
  .person-summary-narrative { break-inside: avoid; }
  .person-compare-grid { grid-template-columns: 1fr 1fr; }
  .person-summary-grid { grid-template-columns: 1fr 1fr; }
  .oheng-insight-block { break-inside: avoid; }
  .sipsin-insight-block { break-inside: avoid; }
  .gaeun-routine-grid { grid-template-columns: 1fr 1fr; }
  .letter-block { break-inside: avoid; }
  .closing-statement { break-inside: avoid; }
  .juyui-item {
    break-inside: avoid;
    border: 1.5px solid var(--color-danger-border);
    border-left: 5px solid var(--color-danger);
    background: var(--color-white);
  }
  .juyui-ground { background: var(--color-danger-bg); color: var(--color-danger-text); border-left-color: var(--color-danger); }
  .juyui-reality { background: var(--color-info-bg); color: var(--color-info-text); border-left-color: var(--color-info); }
  .juyui-solution { background: var(--color-success-bg); color: var(--color-success-text); border-left-color: var(--color-success); }
  .juyui-mindset { color: var(--color-mindset-text); background: var(--color-mindset-bg); border-color: var(--color-mindset-border); }
  .juyui-ground, .juyui-reality, .juyui-solution { break-inside: avoid; }
}

/* ============================================================
   PRO 섹션 공통
   ============================================================ */
.pro-section-wrap { margin-bottom: 32px; }
.pro-section-badge {
  display: inline-block;
  background: var(--gold);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.pro-section-header {
  border-left: 5px solid var(--gold);
  padding: 20px 20px 20px 24px;
  margin-bottom: 24px;
  background: rgba(196,151,59,0.05);
}

/* 섹션 1: 이상적 궁합 유형 */
.ideal-match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.ideal-match-card { padding: 16px; border-radius: 8px; border: 1px solid var(--card-border); }
.ideal-match-card.positive { border-left: 4px solid #4CAF50; background: rgba(76,175,80,0.05); }
.ideal-match-card.caution { border-left: 4px solid #E53935; background: rgba(229,57,53,0.05); }
.ideal-match-card.style { border-left: 4px solid var(--gold); background: rgba(196,151,59,0.05); }
.pro-cta-box {
  padding: 16px 20px;
  background: rgba(196,151,59,0.1);
  border: 1px solid var(--gold);
  border-radius: 8px;
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--gold);
  font-weight: 600;
}

/* 섹션 2: 연애·결혼 적기 */
.love-timing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.love-timing-card { padding: 16px; border-radius: 8px; background: var(--card-bg); border: 1px solid var(--card-border); }
.love-index-badge { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 700; }
.love-index-badge.great { background: #4CAF50; color: #fff; }
.love-index-badge.good { background: #8BC34A; color: #fff; }
.love-index-badge.normal { background: #9E9E9E; color: #fff; }
.love-index-badge.weak { background: #E53935; color: #fff; }
.love-month-cards { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.love-month-card {
  padding: 10px 14px;
  background: rgba(196,151,59,0.1);
  border: 1px solid var(--gold);
  border-radius: 8px;
  text-align: center;
  min-width: 80px;
}

/* 섹션 3: 3년 로드맵 */
.roadmap-3year-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.roadmap-year-card {
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  text-align: center;
}
.roadmap-year-card.current { border: 2px solid var(--gold); background: rgba(196,151,59,0.08); }
.roadmap-year-label { font-size: 11px; font-weight: 700; letter-spacing: 1px; margin-bottom: 8px; color: var(--sub-text); }
.roadmap-ganji { font-size: 22px; font-weight: 800; color: var(--gold); font-family: 'Noto Serif KR', serif; margin-bottom: 4px; }
.roadmap-keyword { font-size: 13px; font-weight: 600; margin: 8px 0; }
.roadmap-opportunity { font-size: 12px; color: #4CAF50; margin-bottom: 4px; }
.roadmap-caution-text { font-size: 12px; color: #E53935; }

/* 섹션 4: DO/DON'T */
.do-dont-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.do-card { padding: 16px; border-radius: 8px; border: 2px solid #4CAF50; background: rgba(76,175,80,0.04); }
.dont-card { padding: 16px; border-radius: 8px; border: 2px solid #E53935; background: rgba(229,57,53,0.04); }
.do-card h4 { color: #4CAF50; margin-bottom: 10px; font-size: 13px; }
.dont-card h4 { color: #E53935; margin-bottom: 10px; font-size: 13px; }
.do-dont-item { font-size: 13px; line-height: 1.9; padding: 3px 0; }
.monthly-guide-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 20px; }
.monthly-guide-table th { background: rgba(196,151,59,0.15); padding: 8px; text-align: center; font-weight: 600; border-bottom: 1px solid rgba(196,151,59,0.2); }
.monthly-guide-table td { padding: 7px 8px; text-align: center; border-bottom: 1px solid rgba(196,151,59,0.08); }
.monthly-favorable { color: #4CAF50; font-weight: 700; }
.monthly-caution-mark { color: #E53935; font-weight: 700; }
.monthly-normal-mark { color: #9E9E9E; }
.action-card {
  padding: 20px;
  border: 2px solid var(--gold);
  border-radius: 12px;
  background: rgba(196,151,59,0.07);
  text-align: center;
  margin-top: 16px;
}
.action-card-label { font-size: 11px; letter-spacing: 2px; color: var(--gold); font-weight: 700; margin-bottom: 8px; }
.action-card-text { font-size: 15px; font-weight: 700; line-height: 1.7; }

/* PRO 섹션 반응형 */
@media (max-width: 640px) {
  .ideal-match-grid,
  .love-timing-grid,
  .do-dont-grid { grid-template-columns: 1fr; }
  .roadmap-3year-grid { grid-template-columns: 1fr; }
}

/* PRO 섹션 인쇄 */
@media print {
  .pro-section-header { page-break-inside: avoid; }
  .roadmap-3year-grid { page-break-inside: avoid; }
  .do-dont-grid { page-break-inside: avoid; }
}

/* === BEST 풀 달력 (wolun-year-calendar) === */
.wolun-year-calendar {
  margin: 20px 0;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(196,151,59,0.2);
  border-radius: 10px;
}
.wolun-year-cal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--sub-color, #C4973B);
  margin-bottom: 16px;
  text-align: center;
  letter-spacing: 1px;
}
.wolun-year-cal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (max-width: 768px) {
  .wolun-year-cal-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .wolun-year-cal-grid { grid-template-columns: 1fr; }
}
.wolun-ycal-month {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 10px 8px;
}
.wolun-ycal-month.ycal-current-month {
  border-color: var(--accent, #C4973B);
  background: rgba(196,151,59,0.06);
}
.wolun-ycal-header {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.wolun-ycal-month-name { font-size: 13px; font-weight: 700; color: var(--text, #FFFEF9); }
.wolun-ycal-ganji      { font-size: 11px; color: rgba(255,254,249,0.6); }
.wolun-ycal-sipsin {
  font-size: 10px;
  padding: 1px 5px;
  background: rgba(196,151,59,0.15);
  color: var(--sub-color, #C4973B);
  border-radius: 3px;
  margin-left: auto;
}
.wolun-ycal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 3px;
}
.wolun-ycal-weekdays span { font-size: 9px; color: rgba(255,254,249,0.35); padding: 1px 0; }
.wolun-ycal-weekdays span:first-child { color: rgba(255,100,100,0.6); }
.wolun-ycal-weekdays span:last-child  { color: rgba(100,150,255,0.6); }
.wolun-ycal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}
.wolun-ycal-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  border-radius: 2px;
  cursor: default;
  min-height: 20px;
}
@media (min-width: 769px) {
  .wolun-ycal-cell { font-size: 11px; min-height: 22px; }
}
.wolun-ycal-cell.empty    { background: transparent; }
.wolun-ycal-cell.day-gil  { background: rgba(196,151,59,0.22); color: #C4973B; font-weight: 700; }
.wolun-ycal-cell.day-pyung{ background: rgba(255,255,255,0.05); color: rgba(255,254,249,0.65); }
.wolun-ycal-cell.day-hung { background: rgba(220,53,69,0.18); color: rgba(220,100,100,0.85); }
.wolun-ycal-cell.today    { outline: 1.5px solid var(--accent, #C4973B); outline-offset: -1px; }
@media print {
  .wolun-year-cal-grid        { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .wolun-ycal-cell            { min-height: 16px; font-size: 8px; }
  .wolun-year-calendar        { page-break-inside: avoid; }
}

/* ===== [10.5] 사주로 본 당신의 현재 — 겉과 속 대조표 ===== */
.outer-inner-table {
  border: 2px solid var(--sub-color);
  border-radius: 10px;
  overflow: hidden;
  margin: 16px 0;
}
.oi-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.oi-header {
  background: var(--main-color);
  color: var(--color-white);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
}
.oi-header .oi-col {
  padding: 12px 16px;
  text-align: center;
}
.oi-col {
  padding: 16px;
  font-size: 14px;
  line-height: 1.7;
}
.oi-outer {
  background: rgba(184,134,11,0.06);
  border-right: 1px dashed var(--sub-color);
}
.oi-inner {
  background: rgba(139,69,19,0.04);
}
.oi-scene {
  font-style: italic;
  color: var(--color-text-sub);
  font-size: 14px;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  margin: 12px 0;
  background: rgba(184,134,11,0.04);
  border-radius: 0 6px 6px 0;
}
.oi-dayji-note {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ===== [10.5] 현실 장면 예측 ===== */
.reality-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 16px 0;
}
.reality-card {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 20px;
  background: var(--color-white);
}
.reality-card-category {
  font-weight: 700;
  font-size: 15px;
  color: var(--main-color);
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.reality-card-prediction {
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 8px;
}
.reality-card-detail {
  font-size: 13px;
  color: var(--color-text-sub);
  line-height: 1.7;
  margin-bottom: 8px;
}
.reality-card-age {
  font-size: 13px;
  color: var(--accent);
  font-style: italic;
  padding: 8px 12px;
  background: rgba(184,134,11,0.06);
  border-radius: 6px;
}

/* ===== [10.5] 내면 독백 ===== */
.monologue-list {
  margin: 16px 0;
}
.monologue-quote {
  border: none;
  border-left: 4px solid var(--accent);
  padding: 16px 20px;
  margin: 12px 0;
  font-size: 16px;
  font-style: italic;
  color: var(--main-color);
  background: rgba(184,134,11,0.04);
  border-radius: 0 8px 8px 0;
  line-height: 1.8;
  font-family: 'Noto Serif KR', serif;
}
.monologue-age-note,
.monologue-daeun-note {
  font-size: 13px;
  color: var(--color-text-sub);
  padding: 8px 0;
}

/* ===== [10.5] 생활 패턴 체크리스트 ===== */
.pattern-checklist {
  margin: 16px 0;
}
.pattern-item {
  padding: 16px;
  border-bottom: 1px dashed var(--color-border);
}
.pattern-item:last-child {
  border-bottom: none;
}
.pattern-label {
  font-weight: 700;
  font-size: 14px;
  color: var(--main-color);
  margin-bottom: 4px;
}
.pattern-prediction {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 8px;
}
.pattern-check {
  display: inline-block;
  font-size: 13px;
  color: var(--accent);
  padding: 6px 10px;
  background: rgba(184,134,11,0.06);
  border-radius: 6px;
  margin-top: 4px;
}

/* ===== [10.5] 모바일 반응형 ===== */
@media (max-width: 640px) {
  .oi-row {
    grid-template-columns: 1fr;
  }
  .oi-header {
    display: none;
  }
  .oi-outer::before {
    content: "남들이 보는 나";
    display: block;
    font-weight: 700;
    font-size: 12px;
    color: var(--sub-color);
    margin-bottom: 6px;
  }
  .oi-inner::before {
    content: "진짜 나의 속마음";
    display: block;
    font-weight: 700;
    font-size: 12px;
    color: var(--sub-color);
    margin-bottom: 6px;
  }
  .oi-outer {
    border-right: none;
    border-bottom: 1px dashed var(--sub-color);
  }
}

/* ===== [10.5] 인쇄 미디어 쿼리 ===== */
@media print {
  .current-life-outer-inner,
  .current-life-reality,
  .current-life-monologue,
  .current-life-patterns {
    break-inside: avoid;
    orphans: 3;
    widows: 3;
  }
  .monologue-quote {
    border-left-color: #333;
    background: #f9f9f9;
  }
  .reality-card,
  .pattern-item {
    break-inside: avoid;
  }
}

/* ===== [Mobile] styles.css 전역 모바일 보정 (≤640px) ===== */
@media (max-width: 640px) {
  /* 안전망: body 가로 오버플로우 차단 */
  body {
    overflow-x: hidden;
  }

  /* ① 입력폼 iOS 자동확대 방지 (font-size 16px 강제) */
  .form-group input,
  .form-group select {
    font-size: 16px !important;
  }

  /* ② 사주 테이블 — 360px에서도 4열 유지, 컨테이너 내 가둠 */
  .saju-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ③ 대운/월운 타임라인 — wrap 시 overflow 가둠 */
  .daeun-timeline,
  .wolun-timeline {
    overflow-x: hidden;
  }

  /* ④ 보고서 헤더 제목 줄바꿈 */
  .report-header h1,
  .gunghap-header h1 {
    word-break: keep-all;
  }

  /* ⑤ 버튼 rows 모바일에서 세로 stack */
  .btn-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .btn-row button {
    width: 100%;
    min-height: 48px;
  }
}

/* ≤360px 추가 보정 */
@media (max-width: 360px) {
  /* 럭키 그리드 1열로 */
  .lucky-grid {
    grid-template-columns: 1fr;
  }
  /* 오행 비교 1열 유지 */
  .oheng-comparison {
    grid-template-columns: 1fr;
  }
}
