    html {
      font-size: 62.5%;
    }

    *,
    *::before,
    *::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    :root {
      --bg: #EEEEEE;
      --surface: #ffffff;
      --border: #e4e2dc;
      --text-primary: #000000;
      --text-secondary: #68635F;
      --text-muted: #787370;
      --accent: #25198F;
      --accent-light: #D9E7FF;
      --danger: #FF4A32;
      --terms-badge-bg: #4130DF;
      --radius: 10px;
      --shadow: 0 1px 4px rgba(0, 0, 0, 0.05), 0 4px 16px rgba(0, 0, 0, 0.04);
      --nav-height: 64px;
      --top-nav-height: 54px;
      --font-main: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Segoe UI', sans-serif;
      --font-hanja: 'Noto Sans KR', sans-serif;

      /* 타로 색상: tarot-style.css로 이동 (2026-04-04) */
    }

    /* ── 유틸리티 클래스 ── */
    .flex-center {
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .modal-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.45);
      z-index: 1000;
      align-items: center;
      justify-content: center;
    }

    body {
      font-family: var(--font-main);
      background: var(--bg);
      color: var(--text-primary);
      font-size: 1.6rem;
      min-height: 100vh;
      padding-bottom: 30px;
    }

    button, input, select, textarea {
      font-family: var(--font-main);
    }

    /* ── PC 전환 ── */
    @media (min-width: 1024px) {
      body {
        padding-bottom: 24px;
        padding-top: calc(var(--top-nav-height) + 8px);
      }

      #top-nav {
        display: flex !important;
      }

      #bottom-nav-wrap {
        display: none !important;
      }

      .view {
        padding-top: 20px;
      }
    }

    /* ── 콘텐츠 래퍼 (네비게이션 제외) ── */
    #content-wrap {
      position: relative;
      min-width: 360px;
      max-width: 720px;
      margin: 0 auto;
      width: 100%;
      box-sizing: border-box;
    }

    /* ── 뷰 전환 ── */
    .view {
      display: none;
      padding: 0 16px 0;
    }

    .view.active {
      display: block;
    }

    /* 홈은 컨테이너가 패딩 직접 관리 */
    #view-home {
      padding-left: 0;
      padding-right: 0;
    }

    #view-home .container {
      padding: 0 10px;
    }

    /* ── 공통 헤더 ── */
    header {
      text-align: center;
      margin-bottom: 24px;
    }

    header h1 {
      font-size: 1.76rem;
      font-weight: 400;
      letter-spacing: 0.08em;
      color: var(--text-secondary);
    }

    /* ── 홈 화면 서비스명 ── */
    .home-service-title {
      text-align: center;
      font-weight: 500;
      font-size: 3.6rem; /* 모든 화면 크기에서 36px 고정 */
      color: #000000;
      letter-spacing: -0.02em;
      line-height: 1.3;
      padding: 30px 16px 0;
    }

    @media (min-width: 1024px) {
      .home-service-title {
        padding: 40px 16px 0;
      }
    }

    .container {
      margin: 0 auto;
    }

    /* ── 홈: 시계 ── */
    .home-clock {
      text-align: center;
      padding: 20px 0 12px;
    }

    .home-clock-date {
      font-size: 1.8rem;
      font-weight: 300;
      color: #000000;
      margin-bottom: 8px;
      letter-spacing: -0.01em;
    }

    .home-clock-time {
      font-size: 4.8rem;
      font-weight: 300;
      letter-spacing: 0.02em;
      color: #000000;
      line-height: 1.15;
    }

    @keyframes clockBlink {

      0%,
      49% {
        opacity: 1
      }

      50%,
      100% {
        opacity: 0
      }
    }

    .clock-colon {
      display: inline-block;
      animation: clockBlink 1s step-end infinite;
    }

    .home-clock-si {
      font-size: 1.8rem;
      font-weight: 300;
      color: #68635F;
      margin-top: 4px;
      letter-spacing: -0.01em;
    }

    .home-clock-si .si-hanja {
      font-family: var(--font-hanja);
      font-weight: 400;
    }

    @media (min-width: 1024px) {
      .home-clock {
        padding: 8px 0 4px;
      }

      .home-clock-date {
        font-size: 2rem;
        margin-bottom: 8px;
      }

      .home-clock-time {
        font-size: 6rem;
      }

      .home-clock-si {
        font-size: 2rem;
        margin-top: 4px;
      }
    }

    /* ── 홈: 사주 박스 (오행 배경색 박스) ── */
    .home-saju-area {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 10px;
      padding: 10px 10px 15px;
      width: 340px;
      margin: 0 auto;
    }

    .home-pillar {
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 16px 0 12px;
      text-align: center;
    }

    /* ── 홈: 현재 사주 섹션 레이블 (카드 외부) ── */
    .home-saju-section-label {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 8px 16px 10px;
      font-size: 2.0rem;
      font-weight: 500;
      color: #787878;
      letter-spacing: -0.01em;
    }

    .home-pillar-label {
      font-size: 1.8rem;
      font-weight: 600;
      color: #68635F;
      letter-spacing: 0;
      margin-bottom: 8px;
    }

    .home-pillar-box {
      width: 100%;
      aspect-ratio: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: var(--font-hanja);
      font-size: 3.6rem;
      font-weight: 500;
      border-radius: 20px;
      margin-bottom: 8px;
      line-height: 1;
    }

    .home-pillar-name {
      font-size: 1.8rem;
      font-weight: 400;
      color: #68635F;
      margin-top: 4px;
      letter-spacing: 0;
    }

    /* ── 홈: 로딩/에러 ── */
    .home-loading {
      text-align: center;
      padding: 48px 20px;
      color: var(--text-muted);
      font-size: 1.36rem;
    }

    /* ── 스켈레톤 로딩 ── */
    @keyframes sk-shimmer {
      0%   { background-position: 200% 0; }
      100% { background-position: -200% 0; }
    }
    .sk {
      background: linear-gradient(90deg, #e8e5e0 25%, #d6d3ce 50%, #e8e5e0 75%);
      background-size: 200% 100%;
      animation: sk-shimmer 1.4s ease-in-out infinite;
      border-radius: 6px;
      display: block;
      flex-shrink: 0;
    }
    .result-sk-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      margin-top: 20px;
      box-shadow: var(--shadow);
      overflow: hidden;
      max-width: 720px;
      margin-left: auto;
      margin-right: auto;
    }
    .result-sk-header {
      padding: 20px 24px 16px;
      border-bottom: 1px solid var(--border);
    }
    .result-sk-pillars {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      column-gap: 10px;
      padding: 30px 10px 20px;
      width: 340px;
      margin: 0 auto;
    }
    .result-sk-pillar {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 7px;
    }
    .result-sk-bar {
      height: 44px;
      border-top: 1px solid var(--border);
      background: var(--surface);
    }
    .result-sk-yunwoon {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      margin-top: 12px;
      box-shadow: var(--shadow);
      overflow: hidden;
      max-width: 720px;
      margin-left: auto;
      margin-right: auto;
      padding: 16px 20px 20px;
    }
    .home-sk-area {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 10px;
      padding: 10px 10px 20px;
      width: 340px;
      margin: 0 auto;
    }
    .home-sk-pillar {
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 16px 0 12px;
      gap: 8px;
    }

    /* ── 공통 카드 ── */
    .section-card {
      background: var(--surface);
      border: none;
      border-radius: var(--radius);
      box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07), 0 2px 14px rgba(0, 0, 0, 0.04);
      overflow: hidden;
      margin-bottom: 10px;
    }

    .section-title {
      padding: 10px 16px;
      font-size: 1.2rem;
      font-weight: 500;
      letter-spacing: 0.04em;
      color: var(--text-muted);
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }

    /* ── 사주 4주 박스 ── */
    .saju-table {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      column-gap: 10px;
      row-gap: 0;
      padding: 30px 10px 20px;
      width: 100%;
      max-width: 340px;
      box-sizing: border-box;
      margin: 0 auto;
    }

    .pillar {
      padding: 10px 0 20px;
      text-align: center;
      display: flex;
      flex-direction: column;
      align-items: center;
    }

    .pillar-label {
      font-size: 1.088rem;
      color: var(--text-muted);
      letter-spacing: 0.06em;
      margin-bottom: 6px;
    }

    .pillar-sipsung {
      font-size: 0.992rem;
      color: var(--text-muted);
      letter-spacing: 0.03em;
      margin-top: 6px;
      margin-bottom: 10px;
    }

    .pillar-sipsung-b {
      margin-top: 10px;
      margin-bottom: 4px;
    }

    .pillar-hanja {
      font-family: var(--font-hanja);
      font-size: 2.4rem;
      font-weight: 300;
      line-height: 1.4;
      width: 100%;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .pillar-nabeun {
      margin-bottom: 4px;
    }

    .pillar-nabeun .nabeun-btn {
      font-size: 1.4rem;
      padding: 2px 6px;
      margin-bottom: 0;
    }

    .pillar-hangul {
      margin-top: 0;
      margin-bottom: 6px;
      font-size: 1.8rem;
      font-weight: 400;
      color: #000;
    }

    .pillar-label-row {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      column-gap: 10px;
      border-bottom: 1px solid var(--border);
      margin-bottom: 0;
      grid-column: 1/-1;
    }

    .pillar-label-row .pillar-label-btn {
      border-radius: 0;
    }

    /* ── 대운/세운 공통 ── */
    .yunwoon-grid {
      display: grid;
      grid-template-columns: repeat(10, minmax(68px, 1fr));
      overflow-x: auto;
    }

    /* 홈 세운: 10개 가로 스크롤 (모바일/PC 공통) */
    #home-saewoon-grid {
      grid-template-columns: repeat(10, minmax(68px, 1fr));
      overflow-x: auto;
      transition: opacity 0.2s ease;
    }

    #home-saewoon-grid.loading-state {
      opacity: 0.5;
      pointer-events: none;
    }

    #home-saewoon-grid .yunwoon-age {
      font-size: 1.5rem;
      font-weight: 500;
    }

    #home-saewoon-grid .yunwoon-hanja {
      font-size: 2.8rem;
      font-weight: 400;
      color: #68635F;
    }

    #home-saewoon-grid .yunwoon-item.sw-selected .yunwoon-hanja,
    #home-saewoon-grid .yunwoon-item.sw-selected .yunwoon-hangul {
      color: var(--accent);
    }

    .yunwoon-item {
      padding: 14px 4px;
      text-align: center;
      border-right: 1px solid var(--border);
      min-width: 0;
    }

    .yunwoon-item:last-child {
      border-right: none;
    }

    .yunwoon-age {
      font-size: 1.5rem;
      color: var(--text-secondary);
      margin-bottom: 6px;
      font-weight: 500;
    }

    .yunwoon-hanja {
      font-size: 2.8rem;
      font-weight: 400;
      line-height: 1.3;
      color: #68635F;
    }

    .yun-stem, .yun-branch {
      display: block;
      width: 100%;
      padding: 4px 0;
      text-align: center;
      line-height: 1.3;
    }
    .yun-stem {
      margin-bottom: 3px;
      border-radius: 6px 6px 2px 2px;
    }
    .yun-branch {
      border-radius: 2px 2px 6px 6px;
    }

    /* ── 명식 목록 ── */
    .list-search-bar {
      display: flex;
      align-items: center;
      position: relative;
      margin-bottom: 12px;
    }
    .list-search-bar input {
      width: 100%;
      padding: 14px 48px 14px 18px;
      font-size: 1.6rem;
      border: none;
      border-radius: 28px;
      background: var(--surface);
      box-shadow: 0 2px 8px rgba(0,0,0,0.06);
      font-family: var(--font-main);
      color: var(--text-primary);
      outline: none;
      box-sizing: border-box;
    }
    .list-search-bar input::placeholder { color: #b0aca8; }
    .list-search-bar input:focus { box-shadow: 0 2px 12px rgba(37,25,143,0.12); }
    .list-search-icon {
      position: absolute;
      right: 16px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text-secondary);
      pointer-events: none;
    }
    .list-search-clear-btn {
      display: none;
      position: absolute;
      right: 44px;
      top: 50%;
      transform: translateY(-50%);
      background: none;
      border: none;
      font-size: 1.6rem;
      color: var(--text-muted);
      cursor: pointer;
    }
    .list-filter-row {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 12px;
    }
    .list-select-wrap {
      position: relative;
      flex-shrink: 0;
    }
    .list-select {
      appearance: none;
      -webkit-appearance: none;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 8px 30px 8px 12px;
      font-size: 1.4rem;
      font-family: var(--font-main);
      color: var(--text-secondary);
      background: var(--surface);
      cursor: pointer;
      outline: none;
    }
    .list-select:focus { border-color: var(--accent); }
    .list-select-arrow {
      position: absolute;
      right: 10px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text-muted);
      pointer-events: none;
    }
    .list-count-label {
      margin-left: auto;
      font-size: 1.4rem;
      color: var(--text-muted);
      white-space: nowrap;
    }
    .list-item {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 14px 16px;
      margin-bottom: 8px;
      cursor: pointer;
      transition: background 0.15s;
    }
    .list-item:active {
      background: var(--accent-light);
    }
    .list-item-main {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .list-item-fav {
      width: 36px;
      height: 36px;
      flex-shrink: 0;
      padding: 0;
      border: none;
      background: none;
      cursor: pointer;
      color: var(--text-muted, #aaa);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      -webkit-tap-highlight-color: transparent;
    }
    .list-item-fav.is-fav {
      color: #f5b301;
    }
    .list-item-fav:hover {
      opacity: 0.75;
    }
    .list-section-label {
      font-size: 1.3rem;
      color: var(--text-muted, #888);
      padding: 10px 4px 6px;
      font-weight: 500;
    }
    .list-section-label-all {
      border-top: 1px solid var(--border);
      margin-top: 8px;
    }
    .list-item-gender {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.4rem;
      font-weight: 600;
      flex-shrink: 0;
    }
    .list-item-gender.gender-m { background: #DBEAFE; color: #1D4ED8; }
    .list-item-gender.gender-f { background: #FCE7F3; color: #BE185D; }
    .list-item-info { flex: 1; min-width: 0; }
    .list-item-name {
      font-size: 1.6rem;
      font-weight: 500;
      color: var(--text-primary);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .list-item-date {
      font-size: 1.3rem;
      color: var(--text-muted);
      margin-top: 2px;
    }
    .list-item-group {
      font-size: 1.3rem;
      color: #666;
      background: #f3f3f0;
      padding: 3px 8px;
      border-radius: 10px;
      flex-shrink: 0;
    }
    .group-edit-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 0;
      border-bottom: 1px solid var(--border);
    }
    .group-edit-item:last-child { border-bottom: none; }

    /* 명식 목록 빈 상태 */
    .list-empty-card {
      background: var(--surface);
      border-radius: 16px;
      padding: 48px 24px 40px;
      text-align: center;
      box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    }
    .list-empty-img {
      width: 120px;
      height: 120px;
      object-fit: contain;
      margin-bottom: 20px;
      opacity: 0.85;
    }
    .list-empty-text {
      font-size: 1.6rem;
      color: var(--text-secondary);
      font-weight: 400;
      margin: 0;
    }

    .yunwoon-hangul {
      margin-top: 5px;
      font-size: 1.5rem;
      font-weight: 500;
      color: var(--text-secondary);
    }

    .yunwoon-item.current-year {
      background: var(--accent-light);
    }

    .yunwoon-item.current-year .yunwoon-age {
      color: var(--accent);
      font-weight: 600;
    }

    .yunwoon-item.current-year .yunwoon-hanja {
      color: var(--accent);
    }

    .yunwoon-item.current-year .yunwoon-hangul {
      color: var(--accent);
    }

    .yunwoon-item.clickable {
      cursor: pointer;
    }

    .yunwoon-item.clickable:hover {
      background: var(--accent-light);
    }

    /* 선택된 대운 */
    .yunwoon-item.dw-active {
      background: var(--accent-light);
      border-bottom: 2px solid var(--accent);
    }

    .yunwoon-item.dw-active .yunwoon-age {
      color: var(--accent);
      font-weight: 600;
    }

    .yunwoon-item.dw-active .yunwoon-hanja,
    .yunwoon-item.dw-active .yunwoon-hangul {
      color: var(--accent);
    }

    /* 선택된 세운 */
    .yunwoon-item.sw-selected {
      background: var(--accent-light);
      border-bottom: 2px solid var(--accent);
    }

    .yunwoon-item.sw-selected .yunwoon-age {
      color: var(--accent);
      font-weight: 600;
    }

    .yunwoon-item.sw-selected .yunwoon-hanja,
    .yunwoon-item.sw-selected .yunwoon-hangul {
      color: var(--accent);
    }

    /* 월운 그리드: 12칸 */
    .wolwoon-grid {
      display: grid;
      grid-template-columns: repeat(12, minmax(68px, 1fr));
      overflow-x: auto;
    }

    .badge-forward {
      font-size: 1.088rem;
      color: var(--accent);
      background: var(--accent-light);
      border-radius: 20px;
      padding: 2px 8px;
      font-weight: 400;
      letter-spacing: 0;
    }

    .badge-sub {
      font-size: 1.088rem;
      color: var(--text-muted);
      font-weight: 400;
      letter-spacing: 0;
    }

    .badge-terms {
      font-size: 1.5rem;
      font-weight: 400;
      color: #25198F;
      background: #D9E7FF;
      border-radius: 20px;
      padding: 1px 8px;
    }

    @keyframes fadeUp {
      from {
        opacity: 0;
        transform: translateY(10px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* ── 명식 입력 화면 ── */
    .card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 32px;
      box-shadow: var(--shadow);
    }

    .form-section {
      margin-bottom: 24px;
    }

    .section-label {
      font-size: 1.6rem;
      font-weight: 500;
      letter-spacing: 0;
      text-transform: none;
      color: var(--text-primary);
      margin-bottom: 10px;
    }

    .row {
      display: flex;
      gap: 10px;
    }

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

    label {
      font-size: 1.4rem;
      color: var(--text-secondary);
    }

    input {
      font-size: 1.44rem;
      border: 1px solid var(--border);
      border-radius: 5px;
      padding: 9px 11px;
      background: #EEEEEE;
      color: var(--text-primary);
      width: 100%;
      transition: border-color 0.15s;
      outline: none;
    }

    select {
      font-size: 1.44rem;
      border: 1px solid var(--border);
      border-radius: 5px;
      padding: 9px 34px 9px 11px;
      background: #EEEEEE;
      color: var(--text-primary);
      width: 100%;
      appearance: none;
      -webkit-appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 14px center;
      background-size: 14px;
      transition: border-color 0.15s;
      outline: none;
      cursor: pointer;
    }

    input:focus,
    select:focus {
      border-color: var(--accent);
    }

    .gender-group {
      display: flex;
      gap: 8px;
    }

    .gender-btn {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 9px;
      border: 1px solid #D5D5D5;
      border-radius: 5px;
      cursor: pointer;
      font-size: 1.6rem;
      font-weight: 500;
      color: var(--text-secondary);
      background: #FFFFFF;
      transition: all 0.15s;
      user-select: none;
    }

    .gender-btn input[type="radio"] {
      display: none;
    }

    #btn-male.selected {
      background: #75A8EB;
      color: #fff;
      font-weight: 500;
    }

    #btn-female.selected {
      background: #FF6262;
      color: #fff;
      font-weight: 500;
    }

    .checkbox-row {
      display: flex;
      align-items: center;
      gap: 8px;
      cursor: pointer;
      user-select: none;
    }

    .checkbox-row input[type="checkbox"] {
      width: 16px;
      height: 16px;
      accent-color: var(--accent);
      cursor: pointer;
    }

    .checkbox-row span {
      font-size: 1.6rem;
      color: var(--text-secondary);
    }

    /* 토글 스위치 (on/off) */
    .switch-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
      user-select: none;
    }
    .switch-row span {
      font-size: 1.6rem;
      color: var(--text-secondary);
    }
    .toggle-switch {
      position: relative;
      width: 44px;
      height: 24px;
      flex-shrink: 0;
    }
    .toggle-switch input {
      opacity: 0;
      width: 0;
      height: 0;
    }
    .toggle-slider {
      position: absolute;
      inset: 0;
      background: #ccc;
      border-radius: 24px;
      transition: background 0.2s;
      cursor: pointer;
    }
    .toggle-slider::before {
      content: '';
      position: absolute;
      left: 2px;
      top: 2px;
      width: 20px;
      height: 20px;
      background: #fff;
      border-radius: 50%;
      transition: transform 0.2s;
      box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    }
    .toggle-switch input:checked + .toggle-slider {
      background: var(--accent);
    }
    .toggle-switch input:checked + .toggle-slider::before {
      transform: translateX(20px);
    }

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

    .toggle-btn {
      flex: 1;
      padding: 8px;
      border: 1px solid #D5D5D5;
      border-radius: 5px;
      background: #FFFFFF;
      font-size: 1.6rem;
      font-weight: 500;
      color: var(--text-secondary);
      cursor: pointer;
      transition: all 0.15s;
      text-align: center;
    }

    .toggle-btn.active {
      border-color: #25198F;
      background: #D9E7FF;
      color: #25198F;
      font-weight: 500;
    }

    .leap-row {
      margin-top: 13px;
      display: none;
    }

    .divider {
      height: 1px;
      background: var(--border);
      margin: 24px 0;
    }

    .btn-primary {
      width: 100%;
      padding: 13px;
      background: var(--accent);
      color: #fff;
      border: none;
      border-radius: var(--radius);
      font-size: 1.6rem;
      font-weight: 500;
      letter-spacing: 0.04em;
      cursor: pointer;
      margin-top: 28px;
      transition: opacity 0.15s;
    }

    .btn-primary:hover {
      opacity: 0.88;
    }

    .btn-primary:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    .btn-just-view {
      width: 100%;
      padding: 13px;
      border: 1px solid #D5D5D5;
      color: var(--text-secondary);
      background: #FFFFFF;
      border-radius: var(--radius);
      font-size: 1.6rem;
      font-weight: 500;
      cursor: pointer;
      margin-top: 6px;
      font-family: var(--font-main);
      transition: all 0.15s;
    }
    .btn-just-view:hover {
      border-color: var(--text-secondary);
      color: var(--text-primary);
    }

    .btn-delete-chart {
      width: 100%;
      padding: 14px;
      border: 1px solid #FF4A32;
      color: #FF4A32;
      background: #f5f5f4;
      border-radius: var(--radius);
      font-size: 1.6rem;
      font-weight: 600;
      cursor: pointer;
      margin-top: 6px;
      font-family: var(--font-main);
      transition: background 0.15s, color 0.15s;
    }
    .btn-delete-chart:hover {
      background: #FF4A32;
      color: #fff;
    }

    .btn-reset {
      width: 100%;
      padding: 13px;
      background: #FFFFFF;
      color: var(--text-secondary);
      border: 1px solid #D5D5D5;
      border-radius: var(--radius);
      font-size: 1.6rem;
      font-weight: 500;
      cursor: pointer;
      margin-top: 8px;
      font-family: var(--font-main);
      transition: all 0.15s;
    }

    .btn-reset:hover {
      border-color: var(--text-secondary);
      color: var(--text-primary);
    }

    .error-box {
      background: #fef2f2;
      border: 1px solid #fecaca;
      border-radius: var(--radius);
      padding: 14px 16px;
      font-size: 1.32rem;
      color: var(--danger);
      margin-top: 16px;
      display: none;
    }

    .input-error {
      background: #fef2f2 !important;
      border-color: #ef4444 !important;
    }

    /* ── 토스트 ── */
    #toast-container {
      position: fixed;
      bottom: calc(var(--nav-height) + 20px);
      left: 50%;
      transform: translateX(-50%);
      z-index: 9999;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      pointer-events: none;
      width: 90%;
      max-width: 360px;
    }

    @keyframes toast-shake {
      0%   { transform: translateY(0) translateX(0); }
      15%  { transform: translateY(0) translateX(-6px); }
      30%  { transform: translateY(0) translateX(6px); }
      45%  { transform: translateY(0) translateX(-5px); }
      60%  { transform: translateY(0) translateX(5px); }
      75%  { transform: translateY(0) translateX(-3px); }
      90%  { transform: translateY(0) translateX(3px); }
      100% { transform: translateY(0) translateX(0); }
    }

    .toast {
      background: rgba(40, 40, 40, 0.92);
      color: #fff;
      padding: 12px 18px;
      border-radius: 8px;
      font-size: 1.4rem;
      width: 100%;
      text-align: center;
      opacity: 0;
      transform: translateY(10px);
      transition: opacity 0.25s, transform 0.25s;
    }

    .toast.shake {
      animation: toast-shake 0.45s ease;
    }

    .saju-card {
      max-width: 720px;
      width: 100%;
      box-sizing: border-box;
      margin-left: auto;
      margin-right: auto;
    }

    .result-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      margin-top: 20px;
      box-shadow: var(--shadow);
      overflow: hidden;
      display: none;
      animation: fadeUp 0.3s ease;
      max-width: 720px;
      width: 100%;
      box-sizing: border-box;
      margin-left: auto;
      margin-right: auto;
    }

    .result-header {
      padding: 20px 20px 16px;
      border-bottom: 1px solid var(--border);
    }

    /* 전시/후시 버튼 행 */
    .shi-shift-row {
      display: none;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      margin-top: 10px;
      flex-wrap: wrap;
    }

    .shi-shift-btn {
      padding: 4px 12px;
      border: 1px solid var(--border);
      border-radius: 4px;
      background: var(--surface);
      font-size: 1.6rem;
      font-weight: 500;
      color: var(--text-secondary);
      cursor: pointer;
      transition: all 0.15s;
    }

    .shi-shift-btn:hover {
      border-color: var(--accent);
      color: var(--accent);
      background: var(--accent-light);
    }

    .shi-shift-label {
      font-size: 1.12rem;
      color: var(--text-muted);
      flex: 1;
      text-align: center;
      letter-spacing: 0.04em;
    }

    .yajasi-toggle-btn {
      border-radius: 999px !important;
      min-width: 96px;
      text-align: center;
    }

    .yajasi-toggle-btn.active {
      background: var(--accent) !important;
      border-color: var(--accent) !important;
      color: #fff !important;
      font-weight: 600;
    }

    .result-name {
      font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Segoe UI', sans-serif;
      font-size: 1.76rem;
      font-weight: 400;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .result-meta {
      margin-top: 5px;
      font-size: 1.6rem;
      font-weight: 400;
      color: var(--text-secondary);
      display: flex;
      flex-wrap: wrap;
      gap: 4px 12px;
      align-items: center;
    }

    .gender-toggle-btn {
      display: inline-flex;
      align-items: center;
      gap: 0;
      padding: 3px;
      border: 1px solid var(--border);
      border-radius: 20px;
      background: var(--bg);
      cursor: pointer;
      font-size: 1.6rem;
      font-weight: 500;
      vertical-align: middle;
      flex-shrink: 0;
      transition: all 0.15s;
    }

    .gender-toggle-btn:hover {
      border-color: var(--accent);
    }

    .gender-seg-active {
      border-radius: 16px;
      padding: 2px 12px;
      transition: all 0.15s;
      color: #fff;
    }

    .gender-seg-active-m {
      background: #75A8EB;
    }

    .gender-seg-active-f {
      background: #FF6262;
    }

    .gender-seg-inactive {
      color: var(--text-muted);
      padding: 2px 12px;
    }

    .bday-btn {
      background: none;
      border: none;
      padding: 0;
      color: inherit;
      font-size: inherit;
      cursor: pointer;
      text-decoration: underline dotted;
      text-underline-offset: 3px;
      font-family: inherit;
    }

    .bday-btn:hover {
      color: var(--accent);
    }

    #bday-cal-popup {
      z-index: 300;
    }

    .result-footer {
      padding: 12px 24px;
      display: none;
      align-items: center;
      gap: 12px;
    }

    .footer-divider {
      width: 1px;
      height: 12px;
      background: var(--border);
    }

    .badge-eqtime {
      font-size: 1.5rem;
      font-weight: 400;
      color: var(--accent);
      background: var(--accent-light);
      border-radius: 20px;
      padding: 2px 9px;
    }

    .meta-option-row {
      width: 100%;
      display: flex;
      flex-wrap: wrap;
      gap: 4px 6px;
    }

    .meta-option-label {
      font-size: 1.5rem;
      font-weight: 400;
      color: var(--text-secondary);
    }

    .badge-option {
      font-size: 1.5rem;
      font-weight: 400;
      color: #6B5B00;
      background: #FFF4CC;
      border-radius: 20px;
      padding: 1px 8px;
    }

    .yunwoon-section {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      margin-top: 12px;
      box-shadow: var(--shadow);
      overflow: hidden;
      display: none;
      animation: fadeUp 0.3s ease;
    }

    .yunwoon-title {
      padding: 14px 20px;
      font-size: 1.6rem;
      font-weight: 500;
      letter-spacing: 0;
      color: #000;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .yunwoon-title-sep {
      color: var(--border);
      font-weight: 300;
    }

    .yunwoon-forward {
      font-size: 1.4rem;
      color: var(--accent);
      background: var(--accent-light);
      border-radius: 20px;
      padding: 2px 8px;
      text-transform: none;
      letter-spacing: 0;
    }

    .spinner {
      display: inline-block;
      width: 14px;
      height: 14px;
      border: 2px solid rgba(255, 255, 255, 0.4);
      border-top-color: #fff;
      border-radius: 50%;
      animation: spin 0.6s linear infinite;
      vertical-align: middle;
      margin-right: 6px;
    }

    @keyframes spin {
      to {
        transform: rotate(360deg);
      }
    }

    /* ── 사주 보기 상단 액션 버튼 ── */
    .result-top-bar {
      display: flex;
      gap: 8px;
      margin-bottom: 16px;
    }

    .result-top-bar button {
      flex: 1;
      padding: 9px;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      background: var(--surface);
      font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Segoe UI', sans-serif;
      font-size: 1.6rem;
      font-weight: 500;
      color: var(--text-secondary);
      cursor: pointer;
      transition: all 0.15s;
    }

    .result-top-bar button:hover {
      border-color: var(--accent);
      color: var(--accent);
    }

    .result-top-bar .btn-edit {
      background: var(--accent-light);
      border-color: var(--accent);
      color: var(--accent);
      font-weight: 500;
    }

    .btn-edit-bottom {
      width: 100%;
      max-width: 720px;
      padding: 12px 32px;
      border: 1px solid var(--accent);
      border-radius: var(--radius);
      background: var(--accent-light);
      font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Segoe UI', sans-serif;
      font-size: 1.6rem;
      font-weight: 500;
      color: var(--accent);
      cursor: pointer;
      box-sizing: border-box;
      transition: all 0.15s;
    }
    .btn-edit-bottom:hover {
      background: var(--accent);
      color: #fff;
    }

    /* ── 준비 중 화면 ── */
    .coming-soon {
      text-align: center;
      padding: 80px 20px;
      color: var(--text-muted);
    }

    .coming-soon p {
      font-size: 1.36rem;
      margin-top: 8px;
    }

    /* ── PC 상단 네비게이션 바 ── */
    #top-nav {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      height: var(--top-nav-height);
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
      z-index: 100;
      align-items: center;
    }

    .top-nav-inner {
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .top-nav-links {
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .top-nav-item {
      background: none;
      border: none;
      cursor: pointer;
      font-size: 1.36rem;
      color: var(--text-secondary);
      padding: 7px 18px;
      border-radius: 6px;
      text-decoration: none;
      transition: all 0.15s;
      letter-spacing: 0.02em;
    }

    .top-nav-item:hover {
      background: var(--accent-light);
      color: var(--accent);
    }

    .top-nav-item.active {
      color: var(--accent);
      font-weight: 500;
      background: none;
    }

    /* ── 하단 네비게이션 바 (모바일에서 숨김) ── */
    #bottom-nav-wrap {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 100;
      display: none;
    }

    #bottom-nav {
      height: var(--nav-height);
      background: var(--surface);
      border-top: 1px solid var(--border);
      display: flex;
      align-items: stretch;
      box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
    }

    .nav-item {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 4px;
      background: none;
      border: none;
      cursor: pointer;
      color: var(--text-muted);
      font-size: 0.992rem;
      text-decoration: none;
      padding: 6px 0;
      transition: color 0.15s;
      -webkit-tap-highlight-color: transparent;
    }

    .nav-item:hover {
      color: var(--text-secondary);
    }

    .nav-item.active {
      color: var(--accent);
      font-weight: 500;
    }

    .nav-item.active .nav-icon svg path,
    .nav-item.active .nav-icon svg circle,
    .nav-item.active .nav-icon svg rect,
    .nav-item.active .nav-icon svg line {
      stroke: var(--accent);
    }

    .nav-icon {
      font-size: 2rem;
      line-height: 1;
    }

    /* ── 역학 달력 ── */
    .cal-nav {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 16px 8px;
    }

    #home-saewoon-nav {
      border-bottom: 1px solid var(--border);
    }

    .cal-nav-title {
      font-size: 2rem;
      font-weight: 500;
      color: var(--text-primary);
    }

    .cal-nav-btn {
      background: none;
      border: 1px solid var(--border);
      cursor: pointer;
      color: var(--text-secondary);
      font-size: 1.6rem;
      width: 28px;
      height: 28px;
      border-radius: 4px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background 0.1s;
    }

    .cal-nav-btn:hover {
      background: var(--accent-light);
      color: var(--accent);
    }

    .cal-weekdays {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      border-bottom: 1px solid var(--border);
      background: var(--surface);
    }

    .cal-weekday {
      text-align: center;
      font-size: 1.8rem;
      font-weight: 400;
      color: var(--text-secondary);
      padding: 8px 2px;
      letter-spacing: 0.02em;
    }

    .cal-weekday.sun {
      color: #FF4A32;
    }

    .cal-weekday.sat {
      color: #2471a3;
    }

    .cal-grid {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
    }

    .cal-cell {
      border-right: 1px solid var(--border);
      border-bottom: 1px solid var(--border);
      padding: 6px 4px 5px;
      min-height: 76px;
      position: relative;
      cursor: pointer;
    }

    .cal-cell:hover {
      background: var(--accent-light);
    }

    .cal-cell.today:hover {
      filter: brightness(0.95);
    }

    .cal-cell:nth-child(7n) {
      border-right: none;
    }

    .cal-cell.empty {
      background: #ffffff;
      cursor: default;
    }

    .cal-cell.empty:hover {
      background: #ffffff;
    }

    .cal-cell.today,
    .cal-cell.cal-selected {
      background: #D9E7FF;
    }

    .cal-cell.holiday .cal-solar-day,
    .cal-cell.sun-col .cal-solar-day {
      color: #FF4A32;
    }

    .cal-cell.sat-col .cal-solar-day {
      color: #2471a3;
    }

    .cal-solar-day {
      font-size: 1.408rem;
      font-weight: 500;
      line-height: 1;
      margin-bottom: 3px;
    }

    .cal-today-mark {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 20px;
      height: 20px;
      background: var(--accent);
      color: white;
      border-radius: 50%;
      font-size: 1.184rem;
      font-weight: 600;
    }

    .cal-lunar-day {
      font-size: 1.2rem;
      font-weight: 400;
      color: #999999;
      margin-bottom: 2px;
      line-height: 1;
    }

    .cal-cell.today .cal-lunar-day,
    .cal-cell.cal-selected .cal-lunar-day {
      font-weight: 500;
      color: #25198F;
    }

    .cal-ganjee {
      font-size: 1.6rem;
      font-weight: 500;
      line-height: 1.25;
      color: #444444;
      margin-bottom: 3px;
    }

    .cal-cell.today .cal-ganjee,
    .cal-cell.cal-selected .cal-ganjee {
      font-weight: 600;
      color: #25198F;
    }

    .cal-lunar-day.new-month {
      font-weight: 500;
      color: #FF8000;
    }

    /* 달력 내부 배지 그룹 */
    .cal-badges-wrap {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-start; /* 왼쪽 정렬 */
      gap: 2px;
      width: 100%;
      padding-left: 2px;
    }

    .cal-terms {
      font-size: 1.3rem;
      font-weight: 400;
      color: #ffffff;
      background: var(--terms-badge-bg);
      border-radius: 3px;
      padding: 1px 4px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 20px;
      height: 18px;
    }

    .cal-nav-pick {
      cursor: pointer;
      padding: 2px 4px;
      border-radius: 4px;
      transition: background 0.2s;
    }

    .cal-nav-pick:hover {
      background: rgba(0, 0, 0, 0.05);
    }

    .cal-event {
      font-size: 0.8rem;
      color: #c0392b;
      margin-top: 1px;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      max-width: 100%;
    }

    /* 달력 하단 절기/음력 목록 */
    .cal-terms-footer {
      border-top: 1px solid var(--border);
      padding: 16px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .cal-terms-item {
      font-size: 1.5rem;
      font-weight: 400;
      color: #444;
      display: flex;
      align-items: flex-start; /* 상단 정렬 */
      line-height: 1.4;
    }

    .terms-title-group {
      display: flex;
      align-items: center;
      white-space: nowrap; /* 명칭 줄바꿈 금지 */
      flex-shrink: 0;
    }

    .terms-name {
      color: #444;
      font-weight: 500;
    }

    .terms-desc {
      flex: 1;
      margin-left: 4px;
      color: #666;
      word-break: keep-all;
    }

    .cal-terms-item .lunar-label {
      color: #25198F;
      font-weight: 500;
    }

    .cal-footer-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 24px;
      width: auto;
      height: 20px;
      padding: 0 4px;
      border-radius: 4px;
      color: #fff;
      font-size: 1.1rem;
      font-weight: 600;
      margin-right: 6px;
      flex-shrink: 0;
    }

    /* 홈 버튼 그룹 */
    .home-btn-group {
      display: flex;
      gap: 0;
    }

    .home-btn-card {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      padding: 15px 8px;
      background: var(--surface);
      border: none;
      border-right: 1px solid var(--border);
      font-size: 1.6rem;
      font-weight: 500;
      color: #777777;
      cursor: pointer;
      transition: background 0.15s, color 0.15s;
    }

    .home-btn-card:last-child {
      border-right: none;
    }

    .home-btn-card:hover {
      background: var(--accent-light);
      color: var(--accent);
    }

    .home-btn-card:hover svg path,
    .home-btn-card:hover svg circle,
    .home-btn-card:hover svg rect {
      stroke: var(--accent);
    }

    /* (레거시) 홈 명식 입력 버튼 */
    .btn-go-input-wrap {
      padding: 12px 16px;
    }

    .btn-go-input {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      width: 100%;
      padding: 11px;
      background: var(--accent-light);
      color: var(--accent);
      border: 1px solid var(--accent);
      border-radius: var(--radius);
      font-size: 1.4rem;
      font-weight: 500;
      cursor: pointer;
      transition: background 0.15s;
    }

    .btn-go-input:hover {
      background: var(--accent);
      color: #fff;
    }

    /* ── 지장간 ── */
    .pillar-jijanggan {
      margin-top: 6px;
      border-top: 1px solid var(--border);
      padding-top: 5px;
      display: flex;
      flex-direction: column;
      gap: 3px;
    }

    .jijang-item {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 3px;
      line-height: 1;
    }

    .jijang-h {
      font-family: var(--font-hanja);
      font-size: 1.4rem;
      font-weight: 400;
      color: #68635F;
    }

    /* ── 십이운성 / 십이신살 ── */
    .sipun-bar {
      padding: 8px 16px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      border-top: 1px solid var(--border);
      background: #f7f6f3;
      position: relative;
    }

    .sipun-bar-label {
      font-size: 1.6rem;
      font-weight: 400;
      letter-spacing: 0.04em;
      color: var(--text-muted);
    }

    .sipun-bar-icon {
      position: absolute;
      right: 16px;
      color: var(--text-muted);
      display: flex;
      align-items: center;
    }

    .sipun-bar-icon svg {
      transition: transform 0.2s;
    }

    .sipun-bar-icon.open svg {
      transform: rotate(90deg);
    }

    #view-result header {
      padding-top: 30px;
      margin-bottom: 0;
    }

    #view-result header h1 {
      font-size: 2.6rem;
      font-weight: 500;
      color: #000;
      letter-spacing: 0;
    }

    #view-input header,
    #view-list header,
    #view-auth header,
    #view-agreement header {
      padding-top: 30px;
    }

    #view-input header h1,
    #view-list header h1,
    #view-auth header h1,
    #view-agreement header h1 {
      font-size: 2.6rem;
      font-weight: 500;
      color: #000;
      letter-spacing: 0;
    }

    .cb-header-bar {
      padding: 30px 16px 0;
      text-align: center;
      margin-bottom: 0;
    }

    .cb-header-title {
      font-size: 2.6rem;
      font-weight: 500;
      color: #000;
      letter-spacing: 0;
    }

    .cb-header-bar.summary-mode {
      padding: 0;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      padding-left: 59px;
      padding-right: 16px;
      margin-top: 0;
      position: relative;
      top: 10px;
    }

    .cb-header-bar.summary-mode .cb-header-title {
      font-size: 1.44rem;
      font-weight: 400;
      color: var(--text-secondary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .sipun-base-btn {
      padding: 4px 10px;
      border: 1px solid var(--border);
      border-radius: 4px;
      background: var(--surface);
      font-size: 1.4rem;
      color: var(--text-secondary);
      cursor: pointer;
      transition: all 0.15s;
    }

    .sipun-base-btn.active {
      border-color: var(--accent);
      background: var(--accent-light);
      color: var(--accent);
      font-weight: 500;
    }

    .sipun-base-btn-year.active {
      background: #dcfce7;
      border-color: #15803d;
      color: #15803d;
      font-weight: 500;
    }

    .sipun-sinsal-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
    }

    .sipun-sinsal-grid+.sipun-sinsal-grid {
      border-top: 1px solid var(--border);
    }

    .ss-cell {
      padding: 7px 4px;
      text-align: center;
      border-right: 1px solid var(--border);
    }

    .ss-cell:last-child {
      border-right: none;
    }

    .ss-cell-label {
      font-size: 1.2rem;
      font-weight: 400;
      color: var(--text-muted);
      margin-bottom: 3px;
      letter-spacing: 0.03em;
    }

    .ss-cell-value {
      font-size: 1.4rem;
      font-weight: 400;
      color: var(--text-primary);
    }

    .jijang-ss {
      font-size: 1.4rem;
      font-weight: 400;
      color: #68635F;
      letter-spacing: 0;
    }

    /* 사령 지장간 강조 */
    .jijang-saryeong .jijang-h,
    .jijang-saryeong .jijang-ss {
      color: #e67e22;
      font-weight: 700;
    }

    /* ── 신살 버튼 ── */
    .sinsal-col {
      padding: 8px 5px;
      border-right: 1px solid var(--border);
      min-height: 48px;
    }

    .sinsal-col:last-child {
      border-right: none;
    }

    .sinsal-col-label {
      font-size: 1.4rem;
      font-weight: 400;
      color: var(--text-muted);
      text-align: center;
      margin-bottom: 5px;
      letter-spacing: 0.04em;
    }

    .sinsal-badge-btn {
      display: block;
      width: 100%;
      padding: 3px 4px;
      margin-bottom: 3px;
      background: var(--accent-light);
      color: var(--accent);
      border: 1px solid var(--accent);
      border-radius: 3px;
      font-size: 1.4rem;
      cursor: pointer;
      text-align: center;
      transition: all 0.15s;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .sinsal-badge-btn:hover {
      background: var(--accent);
      color: #fff;
    }

    .nabeun-btn {
      background: #f5efe4;
      color: #7a5c2e;
      border-color: #c9a96e;
      margin-bottom: 5px;
    }

    .nabeun-btn:hover {
      background: #c9a96e;
      color: #fff;
    }

    .sinsal-none {
      font-size: 1.4rem;
      font-weight: 400;
      color: var(--text-muted);
      text-align: center;
    }

    /* ── 신살 모달 ── */
    #sinsal-modal {
      z-index: 1000;
    }

    .sinsal-modal-box {
      background: var(--surface);
      border-radius: var(--radius);
      padding: 24px 0 20px 22px;
      max-width: 320px;
      width: 90%;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
      position: relative;
      display: flex;
      flex-direction: column;
    }

    .sinsal-modal-close {
      position: absolute;
      top: 10px;
      right: 14px;
      background: none;
      border: none;
      font-size: 1.76rem;
      cursor: pointer;
      color: var(--text-muted);
      line-height: 1;
    }

    .sinsal-modal-title {
      font-size: 1.6rem;
      font-weight: 600;
      margin-bottom: 10px;
      color: var(--text-primary);
      line-height: 1.4;
      padding-right: 42px;
      flex-shrink: 0;
    }

    .sinsal-modal-desc {
      font-size: 1.4rem;
      color: var(--text-secondary);
      line-height: 1.65;
      overflow-x: hidden;
      overflow-y: auto;
      flex: 1;
      min-height: 0;
      padding-right: 22px;
    }

    .sinsal-modal-desc img {
      max-width: 100%;
      height: auto;
      border-radius: 4px;
      margin: 4px 0;
      display: block;
    }

    /* ── 포커스 시 placeholder 숨김 ── */
    input:focus::placeholder {
      color: transparent;
    }

    input:focus::-webkit-input-placeholder {
      color: transparent;
    }

    input:focus::-moz-placeholder {
      color: transparent;
    }

    .sinsal-modal-box {
      max-height: 80vh;
      overflow: hidden;
    }

    .sinsal-calc-section {
      margin-top: 12px;
      padding-top: 10px;
      border-top: 1px solid var(--border);
    }

    .sinsal-calc-title {
      font-size: 1.4rem;
      font-weight: 500;
      letter-spacing: 0.08em;
      color: var(--text-muted);
      margin-bottom: 6px;
      text-transform: uppercase;
    }

    .sc-tbl {
      width: 100%;
      border-collapse: collapse;
      font-size: 1.4rem;
      margin-top: 4px;
    }

    .sc-tbl th,
    .sc-tbl td {
      padding: 3px 7px;
      border: 1px solid var(--border);
      text-align: center;
      font-family: var(--font-hanja);
    }

    .sc-tbl th {
      background: #f7f6f3;
      color: var(--text-muted);
      font-weight: 500;
      font-size: 1.4rem;
    }

    .sc-note {
      font-size: 1.4rem;
      color: var(--text-secondary);
      line-height: 1.55;
      margin-bottom: 6px;
    }

    /* ── 십이운성 클릭 버튼 (원국) ── */
    .sipun-val-btn {
      display: block;
      width: 100%;
      padding: 2px 3px;
      border: none;
      border-radius: 3px;
      cursor: pointer;
      font-size: 1.4rem;
      font-weight: 400;
      background: transparent;
      color: var(--text-primary);
      transition: background 0.15s;
      text-align: center;
    }

    .sipun-val-btn:hover {
      background: var(--accent-light);
      color: var(--accent);
    }

    .sipun-val-day {
      background: #dbeafe;
      color: #1d4ed8;
    }

    .sipun-val-year {
      background: #dcfce7;
      color: #15803d;
    }

    .sipun-val-base {
      background: #f3f4f6;
      color: #374151;
    }

    .sipun-base-bar {
      background: #fff !important;
    }

    .sipun-col-header {
      border-top: 1px solid var(--border);
    }

    .sipun-col-header .hchh-col-head {
      border-top: none;
    }

    /* ── 대운/세운/월운 내 배지 컨테이너 ── */
    .yun-badges {
      margin-top: 4px;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .yun-badges .sipun-val-btn {
      font-size: 1.4rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      pointer-events: none;
      cursor: default;
    }

    /* 선택된 대운 위 배지 가독성 (연한 배경이므로 별도 처리 불필요) */

    /* 명식 입력 헤더 부제목 */
    .header-subtitle {
      font-size: 1.4rem;
      color: var(--text-muted);
      margin-top: 5px;
    }

    .required-mark {
      color: #e53e3e;
      margin-left: 3px;
      font-weight: 700;
    }

    /* 사주 박스 — 천간/지지 클릭 버튼 */
    .ganjee-btn {
      -webkit-appearance: none;
      appearance: none;
      box-sizing: border-box;
      border: none;
      cursor: pointer;
      font-family: 'Noto Sans KR', sans-serif;
      font-size: 3.6rem;
      font-weight: 500;
      line-height: 1;
      padding: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      aspect-ratio: 1;
      border-radius: 20px;
      transition: opacity 0.15s;
    }

    .ganjee-btn:hover {
      opacity: 0.6;
    }

    /* 사주 박스 — 십성 클릭 버튼 */
    .pillar-sipsung-btn {
      background: none;
      border: none;
      cursor: pointer;
      font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Segoe UI', sans-serif;
      font-size: 1.6rem;
      font-weight: 400;
      color: var(--text-muted);
      letter-spacing: 0.03em;
      padding: 0;
      display: block;
      width: 100%;
      transition: color 0.15s;
    }

    .pillar-sipsung-btn:hover {
      color: var(--accent);
    }

    /* 사주 박스 — 주(柱) 레이블 클릭 버튼 */
    .pillar-label-btn {
      background: none;
      border: none;
      cursor: pointer;
      font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Segoe UI', sans-serif;
      font-size: 1.8rem;
      font-weight: 500;
      color: var(--text-muted);
      letter-spacing: 0.06em;
      padding: 0;
      margin-bottom: 6px;
      display: block;
      width: 100%;
      text-align: center;
      transition: color 0.15s;
    }

    .pillar-label-btn:hover {
      color: var(--accent);
    }

    /* 대운 간지 클릭 버튼 */
    .yun-ganjee-btn {
      background: none;
      border: none;
      cursor: pointer;
      font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Segoe UI', sans-serif;
      font-size: 2.8rem;
      font-weight: 400;
      line-height: 1.3;
      padding: 0;
      display: block;
      width: 100%;
      color: inherit;
      transition: opacity 0.15s;
    }

    .yun-ganjee-btn:hover {
      opacity: 0.6;
    }

    /* 대운/세운/월운 — 자체(柱) 십이운성 */
    .yun-sipun-own {
      font-size: 1.3rem;
      margin-top: 1px;
      text-align: center;
      font-style: italic;
      color: var(--text-muted);
      letter-spacing: 0.02em;
    }

    /* 간지 팝업 — 천간/지지 구분 노트 */
    .ganjee-type-note {
      font-size: 1.6rem;
      color: var(--accent);
      margin-bottom: 9px;
      padding: 4px 9px;
      background: var(--accent-light);
      border-radius: 4px;
      line-height: 1.5;
    }

    /* ── 형충회합 4열×2행 그리드 ── */
    .hchh-grid2 {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      border-top: 1px solid var(--border);
    }

    .hchh-col-head {
      padding: 5px 3px;
      text-align: center;
      border-right: 1px solid var(--border);
      font-size: 1.4rem;
      font-weight: 400;
      color: var(--text-muted);
      background: #fafaf9;
    }

    .hchh-col-head:last-child {
      border-right: none;
    }

    .hchh-col {
      padding: 5px 3px;
      border-right: 1px solid var(--border);
      border-top: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      gap: 2px;
      min-height: 28px;
    }

    .hchh-col:last-child {
      border-right: none;
    }

    .hchh-btn {
      display: block;
      width: 100%;
      padding: 2px 2px;
      border-radius: 3px;
      border: none;
      font-size: 1.4rem;
      font-weight: 400;
      transition: all 0.15s;
      line-height: 1.5;
      text-align: center;
    }

    .hchh-btn-hap {
      background: #f0fdf4;
      color: #166534;
    }

    .hchh-btn-hap:hover {
      background: #bbf7d0;
    }

    .hchh-btn-chung {
      background: #fff1f2;
      color: #9f1239;
    }

    .hchh-btn-chung:hover {
      background: #fecdd3;
    }

    .hchh-btn-kkeuk {
      background: #fff7ed;
      color: #9a3412;
    }

    .hchh-btn-kkeuk:hover {
      background: #fed7aa;
    }

    .hchh-btn-jijihap {
      background: #eff6ff;
      color: #1d4ed8;
    }

    .hchh-btn-jijihap:hover {
      background: #bfdbfe;
    }

    .hchh-btn-banghap {
      background: #f0fdf4;
      color: #166534;
    }

    .hchh-btn-banghap:hover {
      background: #bbf7d0;
    }

    .hchh-btn-samhap {
      background: #f0fdfa;
      color: #115e59;
    }

    .hchh-btn-samhap:hover {
      background: #99f6e4;
    }

    .hchh-btn-hyung {
      background: #fdf4ff;
      color: #7e22ce;
    }

    .hchh-btn-hyung:hover {
      background: #e9d5ff;
    }

    .hchh-btn-pa {
      background: #fffbeb;
      color: #b45309;
    }

    .hchh-btn-pa:hover {
      background: #fde68a;
    }

    .hchh-btn-hae {
      background: #fef2f2;
      color: #b91c1c;
    }

    .hchh-btn-hae:hover {
      background: #fecaca;
    }

    .hchh-distant {
      background: #f3f3f3 !important;
      color: #999 !important;
      border-color: #ddd !important;
    }

    .hchh-distant:hover {
      background: #e8e8e8 !important;
      color: #888 !important;
    }

    .hchh-distant .hchh-tag {
      background: #ddd !important;
      color: #999 !important;
    }

    .sinsal-distant {
      background: #f3f3f3 !important;
      color: #999 !important;
      border-color: #ddd !important;
    }

    .sinsal-distant:hover {
      background: #e8e8e8 !important;
      color: #888 !important;
    }

    .hchh-none-col {
      font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Segoe UI', sans-serif;
      font-size: 1.4rem;
      font-weight: 400;
      color: var(--text-muted);
      text-align: center;
      padding: 3px 0;
      line-height: 2;
    }

    /* ── 형충회합 태그 아이콘 ── */
    .hchh-tag {
      display: inline-block;
      padding: 0 4px;
      border-radius: 2px;
      font-size: 1.2rem;
      font-weight: 400;
      vertical-align: middle;
      margin-left: 2px;
      line-height: 1.5;
    }

    .hchh-tag-hap {
      background: #166534;
      color: #fff;
    }

    .hchh-tag-banghap {
      background: #166534;
      color: #fff;
    }

    .hchh-tag-samhap {
      background: #115e59;
      color: #fff;
    }

    .hchh-tag-chung {
      background: #9f1239;
      color: #fff;
    }

    .hchh-tag-hyung {
      background: #7e22ce;
      color: #fff;
    }

    .hchh-tag-kkeuk {
      background: #9a3412;
      color: #fff;
    }

    .hchh-tag-pa {
      background: #b45309;
      color: #fff;
    }

    .hchh-tag-hae {
      background: #b91c1c;
      color: #fff;
    }

    /* ── 플로팅 사주 바 ── */
    #floating-saju-bar {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 300;
      background: #333;
      border-bottom: 1px solid var(--border);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    @media (min-width:1024px) {
      #floating-saju-bar {
        top: var(--top-nav-height);
      }
    }

    /* 플로팅 바 내부: 사주 + 대운/세운/월운 그룹을 가운데 정렬 */
    .floating-saju-inner {
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 15px 16px;
      gap: 15px;
    }

    /* 구분선 간격: gap 15px 기준 동일 */

    /* 사주 4주 그룹 */
    .floating-saju-group {
      display: flex;
      align-items: flex-end;
      gap: 6px;
    }

    /* 사주↔대운, 대운↔세운 세로 구분선 */
    .floating-divider {
      width: 1px;
      min-width: 1px;
      max-width: 1px;
      height: 67px;
      align-self: flex-end;
      background: #d1d5db;
      flex-shrink: 0;
    }

    /* 대운/세운 개별 그룹 */
    .floating-yun-group {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
    }

    /* 그룹 위 레이블 (시주/일주/월주/년주, 대운, 세운) */
    .floating-col-label {
      font-size: 1.2rem;
      color: var(--border);
      letter-spacing: 0.04em;
      text-align: center;
      line-height: 1;
      margin-bottom: 2px;
    }

    /* 사주 4주 래퍼 */
    .floating-pillars-wrap {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
    }

    /* 레이블 행: 4개 가로 */
    .floating-labels-row {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 6px;
      width: 100%;
    }

    /* 사주 4주 박스 행 */
    .floating-pillars-row {
      display: flex;
      gap: 6px;
      align-items: center;
    }

    /* 개별 주(柱) */
    .floating-pillar {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 3px;
    }

    /* 45% 축소 ganjee 박스: 원본 ganjee-btn은 aspect-ratio:1, border-radius:20px, font-size:36px
       45% → border-radius ~9px, font-size ~16.2px 사용 */
    .floating-ganjee-box {
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 9px;
      font-family: var(--font-hanja);
      font-size: 1.8rem;
      font-weight: 500;
      line-height: 1;
    }

    /* 대운/세운 ganjee 박스 */
    .floating-yun-box {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 3px;
    }

    /* 기존 레거시용 (사용 안 함) */
    .floating-char {
      font-family: 'Noto Sans KR', sans-serif;
      font-size: 1.6rem;
      font-weight: 300;
      line-height: 1.25;
    }

    /* ── 햄버거 버튼 (절대 좌표, content-wrap 기준) ── */
    #hamburger-btn,
    .header-back-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      position: absolute;
      top: 10px;
      right: 4px;
      z-index: 10;
      width: 40px;
      height: 40px;
      padding: 0;
      background: transparent;
      border: none;
      cursor: pointer;
      color: var(--text-primary);
      -webkit-tap-highlight-color: transparent;
    }

    #hamburger-btn svg,
    .header-back-btn svg {
      width: 26px;
      height: 26px;
    }

    .header-back-btn {
      right: auto;
      left: 4px;
    }

    /* PC에서 햄버거·뒤로가기 모두 숨김 */
    @media (min-width: 1024px) {
      #hamburger-btn,
      .header-back-btn {
        display: none !important;
      }
    }

    /* ── 하단 뒤로가기/취소 버튼 (명식입력·명식수정) ── */
    .btn-input-back {
      display: block;
      width: 100%;
      padding: 14px;
      font-size: 1.6rem;
      background: #fff;
      color: var(--text-primary);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      cursor: pointer;
      font-family: var(--font-main);
    }
    .btn-input-back:hover {
      background: var(--surface-alt, #f7f7f7);
    }

    /* ── 사주보기 하단 뒤로가기 버튼 ── */
    .btn-result-back {
      background: #fff;
      color: var(--text-primary);
      border: 1px solid var(--border);
    }
    .btn-result-back:hover {
      background: var(--surface-alt, #f7f7f7);
    }

    /* ── 모바일 슬라이딩 메뉴 ── */
    #side-menu-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.45);
      z-index: 250;
      opacity: 0;
      transition: opacity 0.3s;
    }

    #side-menu-overlay.active {
      display: block;
      opacity: 1;
    }

    #side-menu {
      position: fixed;
      top: 0;
      right: 0;
      bottom: 0;
      width: 280px;
      max-width: 80vw;
      background: var(--surface);
      z-index: 260;
      transform: translateX(100%);
      transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      box-shadow: -4px 0 16px rgba(0,0,0,0.12);
      display: flex;
      flex-direction: column;
    }

    #side-menu.open {
      transform: translateX(0);
    }

    .side-menu-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 16px 20px;
      border-bottom: 1px solid var(--border);
    }

    .side-menu-title {
      font-size: 1.8rem;
      font-weight: 500;
      color: var(--text-primary);
    }

    #side-menu-close {
      background: none;
      border: none;
      font-size: 2rem;
      color: var(--text-muted);
      cursor: pointer;
      padding: 4px 8px;
      line-height: 1;
      -webkit-tap-highlight-color: transparent;
    }

    .side-menu-items {
      display: flex;
      flex-direction: column;
      padding: 12px 0;
      overflow-y: auto;
      flex: 1;
    }

    .side-menu-item {
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 14px 24px;
      background: none;
      border: none;
      cursor: pointer;
      font-size: 1.52rem;
      color: var(--text-secondary);
      text-decoration: none;
      transition: background 0.15s, color 0.15s;
      -webkit-tap-highlight-color: transparent;
    }

    .side-menu-item:hover {
      background: var(--accent-light);
    }

    .side-menu-item.active {
      color: var(--accent);
      font-weight: 500;
      background: var(--accent-light);
    }

    .side-menu-item.active svg path,
    .side-menu-item.active svg circle,
    .side-menu-item.active svg rect,
    .side-menu-item.active svg line {
      stroke: var(--accent);
    }

    /* PC에서 슬라이딩 메뉴 숨김 */
    @media (min-width: 1024px) {
      #side-menu,
      #side-menu-overlay {
        display: none !important;
      }
    }

    /* ══════════════════════════════════════
       사주 고전 챗봇
       ══════════════════════════════════════ */
    #view-chatbot {
      padding-bottom: 0;
    }

    .cb-wrapper {
      display: flex;
      flex-direction: column;
      height: calc(100vh - 120px);
      height: calc(100dvh - 120px);
      position: relative;
      overflow: hidden;
      background: var(--bg);
    }
    @media (min-width: 1024px) {
      .cb-wrapper {
        height: calc(100vh - var(--top-nav-height) - 100px);
      }
    }
    .cb-tab-bar {
      display: flex;
      align-items: center;
      background: var(--bg);
      padding: 8px 8px 4px;
      min-height: 42px;
      flex-shrink: 0;
      gap: 4px;
    }
    .cb-tab-list {
      display: flex;
      overflow-x: auto;
      scroll-behavior: smooth;
      flex: 1;
      gap: 6px;
      padding: 0 2px;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }
    .cb-tab-list::-webkit-scrollbar { display: none; }
    .cb-tab {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 6px 8px 6px 14px;
      font-size: 1.26rem;
      font-family: var(--font-main);
      color: var(--text-secondary);
      background: #dddcda;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      white-space: nowrap;
      flex-shrink: 0;
      transition: background 0.15s, color 0.15s;
    }
    .cb-tab:hover { background: #cccbc8; color: var(--text-primary); }
    .cb-tab.active { background: var(--accent); color: #fff; font-weight: 500; }
    .cb-tab-close {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 18px;
      height: 18px;
      border: none;
      background: transparent;
      color: inherit;
      font-size: 1.3rem;
      line-height: 1;
      cursor: pointer;
      border-radius: 50%;
      padding: 0;
      margin-left: 2px;
      opacity: 0.6;
      transition: opacity 0.12s, background 0.12s;
    }
    .cb-tab-close:hover { opacity: 1; background: rgba(0,0,0,0.1); }
    .cb-tab.active .cb-tab-close:hover { background: rgba(255,255,255,0.2); }
    .cb-tab-arrows {
      display: flex;
      align-items: center;
      gap: 0;
      flex-shrink: 0;
      background: #dddcda;
      border-radius: 8px;
      overflow: hidden;
      visibility: hidden;
    }
    .cb-tab-arrows.visible { visibility: visible; }
    .cb-tab-arrow {
      border: none;
      background: transparent;
      color: var(--text-secondary);
      cursor: pointer;
      padding: 6px 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background 0.15s, color 0.15s;
    }
    .cb-tab-arrow:hover { background: #cccbc8; color: var(--text-primary); }
    .cb-tab-arrow:first-child { border-right: 1px solid rgba(0,0,0,0.08); }
    .cb-conv-area {
      flex: 1;
      position: relative;
      overflow: hidden;
      display: none;
    }
    .cb-conv-messages {
      position: absolute;
      inset: 0;
      overflow-y: auto;
      overflow-x: hidden;
      padding: 20px 16px 8px;
      display: none;
      flex-direction: column;
      gap: 20px;
    }
    .cb-conv-messages.active { display: flex; }
    .cb-conv-messages::-webkit-scrollbar { width: 6px; }
    .cb-conv-messages::-webkit-scrollbar-track { background: #e6e6e6; border-radius: 3px; }
    .cb-conv-messages::-webkit-scrollbar-thumb { background: #c8c8c8; border-radius: 3px; }
    .cb-conv-messages::-webkit-scrollbar-thumb:hover { background: #b0b0b0; }
    .cb-conv-messages { scrollbar-width: thin; scrollbar-color: #c8c8c8 #e6e6e6; }
    .cb-confirm-toast {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background: #fff;
      border-radius: 14px;
      box-shadow: 0 8px 40px rgba(0,0,0,0.18);
      padding: 20px 24px;
      z-index: 1001;
      text-align: center;
      max-width: 320px;
      width: 90%;
    }
    .cb-confirm-toast p { font-size: 1.4rem; color: var(--text-primary); margin-bottom: 16px; line-height: 1.6; }
    .cb-confirm-toast .cb-confirm-btns { display: flex; gap: 10px; justify-content: center; }
    .cb-confirm-toast .cb-confirm-btns button {
      padding: 8px 20px; border-radius: 8px; font-size: 1.3rem;
      font-family: var(--font-main); cursor: pointer; border: 1px solid #d4d3cf;
      background: #fff; color: var(--text-primary); transition: background 0.15s;
    }
    .cb-confirm-toast .cb-confirm-btns button:hover { background: #f0efed; }
    .cb-confirm-toast .cb-confirm-btns button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
    .cb-confirm-toast .cb-confirm-btns button.primary:hover { background: #1d1273; }
    .cb-confirm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 1000; }
    .cb-center {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;
      flex: 1;
      padding: 50px 16px 40px;
      position: relative;
    }
    .cb-greeting { font-size: 2.2rem; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; text-align: center; letter-spacing: -0.02em; }
    .cb-greeting-sub { font-size: 1.5rem; color: #68635F; margin-bottom: 24px; text-align: center; }
    .cb-classic-buttons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 28px; max-width: 640px; padding: 0 8px; }
    .cb-classic-btn {
      padding: 7px 14px; border: 1px solid #d4d3cf; border-radius: 20px;
      background: #fff; font-size: 1.3rem; font-family: var(--font-main);
      color: var(--text-secondary); cursor: pointer; white-space: nowrap;
      transition: background 0.15s, border-color 0.15s, color 0.15s;
    }
    .cb-classic-btn:hover { background: #f0efed; border-color: #b5b2ad; color: var(--text-primary); }
    .cb-classic-btn.selected { background: var(--accent); border-color: var(--accent); color: #fff; }
    .cb-input-area { width: 100%; max-width: 640px; }
    .cb-question-box {
      display: flex; flex-direction: column; background: #fff;
      border: 1px solid #d4d3cf; border-radius: 22px; padding: 10px 10px 6px;
      transition: border-color 0.2s, box-shadow 0.2s; position: relative; z-index: 1;
    }
    .cb-question-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 25, 143, 0.08); }
    .cb-input-row { display: flex; align-items: center; }
    .cb-inner-input { flex: 1; min-width: 0; }
    .cb-textarea {
      width: 100%; border: none; outline: none; resize: none;
      font-size: 1.5rem; line-height: 1.55; font-family: var(--font-main);
      color: var(--text-primary); background: transparent;
      padding: 6px 4px 6px 6px; min-height: 40px; max-height: 150px;
      overflow-y: hidden; scrollbar-width: none; -ms-overflow-style: none;
    }
    .cb-textarea::-webkit-scrollbar { display: none; }
    .cb-textarea::placeholder { color: #b0ada8; }
    .cb-action-row { display: flex; justify-content: space-between; align-items: center; padding: 2px 0 0; }
    .cb-action-right { display: flex; align-items: center; gap: 4px; }
    .cb-action-btn {
      border: none; background: transparent; color: #3D3D3A;
      font-size: 1.28rem; font-family: var(--font-main); cursor: pointer;
      padding: 5px 6px; border-radius: 10px; transition: background 0.15s, color 0.15s;
      white-space: nowrap; display: inline-flex; align-items: center; gap: 4px;
    }
    .cb-action-btn svg { flex-shrink: 0; vertical-align: middle; }
    .cb-action-btn:hover { background: #f0efed; color: var(--text-primary); }
    .cb-action-btn.active { color: var(--accent); font-weight: 500; }
    .cb-send-btn {
      width: 34px; height: 34px; border: none; background: transparent;
      color: var(--accent); cursor: pointer; display: flex; align-items: center;
      justify-content: center; border-radius: 50%; flex-shrink: 0;
      transition: color 0.15s, transform 0.1s;
    }
    .cb-send-btn:hover { color: #1d1273; }
    .cb-send-btn:active { transform: scale(0.94); }
    .cb-stop-btn {
      width: 34px; height: 34px; border: none; background: transparent;
      color: var(--text-muted); cursor: pointer; display: flex; align-items: center;
      justify-content: center; border-radius: 50%; flex-shrink: 0; position: relative;
    }
    .cb-stop-btn svg { position: relative; z-index: 1; }
    .cb-stop-spinner {
      position: absolute; inset: 0; border: 2px solid transparent;
      border-top-color: var(--accent); border-right-color: var(--accent);
      border-radius: 50%; animation: cb-spin 0.8s linear infinite;
    }
    @keyframes cb-spin { to { transform: rotate(360deg); } }
    .cb-popup {
      position: absolute; left: 0; right: 0; background: #fff;
      border: 1px solid #d4d3cf; border-radius: 12px;
      box-shadow: 0 4px 20px rgba(0,0,0,0.1); padding: 6px 0;
      z-index: 10; max-height: 320px; overflow-y: auto;
    }
    .cb-popup-below { top: calc(100% + 8px); }
    .cb-popup-above { bottom: calc(100% + 8px); }
    .cb-popup-item { padding: 10px 16px; font-size: 1.36rem; color: var(--text-secondary); cursor: pointer; line-height: 1.5; transition: background 0.12s; }
    .cb-popup-item:hover { background: #f5f4f2; color: var(--text-primary); }
    .cb-popup-item.selected { color: var(--accent); font-weight: 500; background: #f0eef8; }
    .cb-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
    .cb-modal { background: #fff; border-radius: 16px; width: 100%; max-width: 400px; max-height: 70vh; display: flex; flex-direction: column; box-shadow: 0 8px 40px rgba(0,0,0,0.15); overflow: hidden; }
    .cb-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 12px; border-bottom: 1px solid #eae9e5; }
    .cb-modal-title { font-size: 1.5rem; font-weight: 600; color: var(--text-primary); }
    .cb-modal-close { border: none; background: transparent; font-size: 2.2rem; color: var(--text-muted); cursor: pointer; padding: 0 4px; line-height: 1; transition: color 0.15s; }
    .cb-modal-close:hover { color: var(--text-primary); }
    .cb-modal-list { overflow-y: auto; padding: 6px 0; }
    .cb-modal-list .cb-popup-item { padding: 12px 20px; font-size: 1.4rem; }
    .cb-msg-user { display: flex; justify-content: flex-end; }
    .cb-msg-user .cb-bubble { background: #d8d5ef; color: var(--text-primary); border-radius: 18px 18px 4px 18px; padding: 12px 16px; font-size: 1.44rem; line-height: 1.6; max-width: 85%; word-break: break-word; }
    .cb-msg-assistant { display: flex; flex-direction: column; gap: 4px; max-width: 100%; }
    .cb-msg-assistant .cb-content { font-size: 1.44rem; line-height: 1.75; color: var(--text-primary); word-break: break-word; padding: 0 4px; }
    .cb-msg-assistant .cb-content p { margin-bottom: 8px; }
    .cb-msg-assistant .cb-content p:last-child { margin-bottom: 0; }
    .cb-source-block { border-left: 3px solid var(--accent); padding-left: 14px; margin-bottom: 16px; }
    .cb-source-block:last-child { margin-bottom: 0; }
    .cb-source-name { font-size: 1.3rem; font-weight: 600; color: var(--accent); margin-bottom: 6px; }
    .cb-source-text { font-size: 1.44rem; line-height: 1.75; color: var(--text-primary); }
    .cb-citations { margin-top: 10px; padding-top: 8px; border-top: 1px solid #eae9e5; font-size: 1.2rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 2px; }
    .cb-loading-dots { display: flex; gap: 4px; padding: 8px 4px; }
    .cb-loading-dots span { width: 7px; height: 7px; background: #b0ada8; border-radius: 50%; animation: cb-bounce 1.2s ease-in-out infinite; }
    .cb-loading-dots span:nth-child(2) { animation-delay: 0.15s; }
    .cb-loading-dots span:nth-child(3) { animation-delay: 0.3s; }
    @keyframes cb-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-6px); opacity: 1; } }
    .cb-bottom-input { padding: 10px 16px 14px; background: var(--bg); position: relative; }

    /* 타로 CSS: tarot-style.css로 분리 (2026-04-04) */

    /* 홈화면 타로 진입 배너 (사주 홈에서 /tarot 링크) */
    .home-tarot-banner {
      margin: 16px 0;
      padding: 20px;
      background: linear-gradient(135deg, #2D1B69 0%, #0B0D21 100%);
      border-radius: var(--radius);
      cursor: pointer;
      transition: transform 0.15s;
      position: relative;
      overflow: hidden;
    }
    .home-tarot-banner:active {
      transform: scale(0.98);
    }
    .home-tarot-banner-title {
      color: #D4A843;
      font-size: 1.5rem;
      font-weight: 600;
      margin-bottom: 6px;
    }
    .home-tarot-banner-desc {
      color: rgba(255,255,255,0.7);
      font-size: 1.2rem;
      line-height: 1.5;
    }
    .home-tarot-banner::after {
      content: '✦';
      position: absolute;
      top: 12px;
      right: 16px;
      color: #D4A843;
      font-size: 1.8rem;
      opacity: 0.5;
    }

/* ── 로그인/회원가입 ── */
.auth-mode-toggle {
  display: flex;
  gap: 0;
  margin: 0 auto 24px;
  max-width: 320px;
  border-bottom: 2px solid var(--border);
}
.auth-mode-tab {
  flex: 1;
  padding: 12px 0;
  background: none;
  border: none;
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-main);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.auth-mode-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.auth-card {
  max-width: 400px;
  margin: 0 auto;
  padding: 20px 0;
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.social-login-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  min-height: 5.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1.6rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
  font-family: var(--font-main);
}
.social-btn:active { opacity: 0.8; }
.kakao-btn { background: #FEE500; color: #191919; border-color: #FEE500; }
.naver-btn { background: #03C75A; color: #fff; border-color: #03C75A; }
.google-btn { background: #fff; color: #333; }
.social-btn-apple { background:#000; color:#fff; border-color:#000; }
.social-btn-apple:hover { background:#1a1a1a; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 1.3rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}
.auth-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 1.6rem;
  background-color: #DEDEDE;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-main);
  box-sizing: border-box;
}
.auth-input:focus {
  outline: none;
  border-color: var(--accent);
}
.auth-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}
.auth-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1.6rem;
  cursor: pointer;
  text-decoration: underline;
  font-family: var(--font-main);
}
.auth-skip-btn {
  display: block;
  width: 100%;
  padding: 13px 16px;
  min-height: 5.2rem;
  margin-top: 16px;
  background: #FFF;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1.6rem;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-main);
}

/* 홈 화면 배너 (사주 배우기 + 오늘의 타로 2-column) */
.home-banners {
  display: flex;
  gap: 1rem;
  margin: 1.6rem 0;
}
.home-banner {
  flex: 1;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.6rem 1rem;
  text-align: center;
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.15s;
}
.home-banner:hover { transform: translateY(-2px); }
.home-banner-icon { font-size: 2.4rem; margin-bottom: 0.6rem; }
.home-banner-title { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.3rem; }
.home-banner-desc { font-size: 1.2rem; color: var(--text-secondary); }

/* 정보 화면 탭 (카드형) */
.info-tabs {
  display: flex;
  gap: 0.8rem;
  padding: 1rem 0;
  margin-bottom: 1rem;
  border-bottom: none;
}
.info-tab {
  flex: 1;
  padding: 1.2rem 0.8rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.info-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}
.info-tab-content.hidden { display: none; }

/* PC 푸터 */
#pc-footer {
  display: none;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.3rem;
}
#pc-footer a {
  color: var(--text-secondary);
  text-decoration: underline;
  margin-right: 1rem;
}
#pc-footer a:hover { color: var(--accent); }
@media (min-width: 768px) {
  #pc-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(0.3rem + 5px);
  }
}

/* ── 메모 글자수 카운터 ── */
.memo-wrap {
  display: block;
}
.memo-counter {
  display: block;
  text-align: right;
  margin-top: 4px;
  font-size: 1.2rem;
  color: var(--text-muted);
}

/* ── 약관 동의 화면 (view-agreement) ── */
.agreement-intro {
  padding: 0 0 1.6rem 0;
  font-size: 1.6rem;
  color: var(--text-secondary);
}
.agreement-item {
  display: flex;
  align-items: center;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--border);
}
.agreement-check {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  cursor: pointer;
}
.agreement-check input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.check-box {
  width: 2.4rem;
  height: 2.4rem;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.agreement-check input[type="checkbox"]:checked + .check-box {
  background: var(--accent);
  border-color: var(--accent);
}
.agreement-check input[type="checkbox"]:checked + .check-box::after {
  content: "";
  width: 0.7rem;
  height: 1.2rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: translateY(-2px) rotate(45deg);
}
.agreement-label {
  font-size: 1.5rem;
  color: var(--text-primary);
}
.agreement-view-btn {
  background: none;
  border: none;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  font-size: 1.3rem;
  font-family: inherit;
  padding: 0.4rem 0.6rem;
}
.agreement-actions {
  padding: 1.6rem 0 0 0;
  display: flex;
  gap: 1rem;
}
.agreement-actions button {
  flex: 1;
  padding: 1.4rem;
  font-size: 1.6rem;
  border-radius: 8px;
  font-family: inherit;
  cursor: pointer;
}
.agreement-actions .primary-btn {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}
.agreement-actions .primary-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.agreement-actions .secondary-btn {
  background: #fff;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

/* ── 가입 완료 화면 (view-signup-complete) ── */
#view-signup-complete.view.active {
  display: flex;
}
#view-signup-complete {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 2rem;
}
.complete-icon {
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
}
.complete-title {
  font-size: 2.4rem;
  margin-bottom: 1.2rem;
  color: var(--text-primary);
}
.complete-desc {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
}
#view-signup-complete .primary-btn {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  padding: 1.2rem 2.4rem;
  font-size: 1.6rem;
  border-radius: 8px;
  font-family: inherit;
  cursor: pointer;
  min-width: 20rem;
}

/* ── 약관 탭 래퍼 (흰색 라운드 박스) ── */
.info-tab-content[data-info-tab="terms"] {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.6rem;
  margin: 0 0 1.6rem 0;
}

/* ── 약관 서브탭 & 본문 ── */
.terms-subtabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.terms-subtab {
  flex: 1;
  padding: 0.8rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 1.4rem;
  cursor: pointer;
  font-family: inherit;
}
.terms-subtab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.terms-content.hidden { display: none; }
.terms-content {
  line-height: 1.6;
  font-size: 1.3rem;
  color: var(--text-primary);
}
.terms-content h2 {
  font-size: 1.8rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}
.terms-content h3 {
  font-size: 1.5rem;
  margin-top: 1.6rem;
  margin-bottom: 0.8rem;
}
.terms-content h4 {
  font-size: 1.35rem;
  margin-top: 1.2rem;
  margin-bottom: 0.6rem;
}
.terms-content p {
  margin: 0.6rem 0;
}
.terms-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 1.25rem;
}
.terms-content th,
.terms-content td {
  border: 1px solid var(--border);
  padding: 0.6rem;
  text-align: left;
  vertical-align: top;
}
.terms-content th {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}
.terms-content ul,
.terms-content ol {
  padding-left: 1.8rem;
  margin: 0.6rem 0;
}
.terms-content li {
  margin: 0.3rem 0;
}
.terms-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.4rem 1rem;
  color: var(--text-secondary);
  margin: 1rem 0;
  background: #f7f7f5;
}
.terms-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.6rem 0;
}
.terms-content a {
  color: var(--accent);
  text-decoration: underline;
}

/* ── 약관 전체보기 모달 ── */
.agreement-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.agreement-modal.hidden { display: none; }
.agreement-modal-box {
  background: #fff;
  width: 92vw;
  height: 88vh;
  max-width: 720px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.agreement-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.6rem;
  border-bottom: 1px solid var(--border);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-primary);
}
#agreement-modal-close {
  background: none;
  border: none;
  font-size: 2.4rem;
  cursor: pointer;
  line-height: 1;
  color: var(--text-secondary);
  padding: 0 0.4rem;
}
.agreement-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.6rem;
  line-height: 1.6;
  font-size: 1.3rem;
  color: var(--text-primary);
}
.agreement-modal-body h2 {
  font-size: 1.8rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}
.agreement-modal-body h3 {
  font-size: 1.5rem;
  margin-top: 1.6rem;
  margin-bottom: 0.8rem;
}
.agreement-modal-body p { margin: 0.6rem 0; }
.agreement-modal-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 1.25rem;
}
.agreement-modal-body th,
.agreement-modal-body td {
  border: 1px solid var(--border);
  padding: 0.6rem;
  text-align: left;
  vertical-align: top;
}
.agreement-modal-body th {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}
.agreement-modal-body ul,
.agreement-modal-body ol {
  padding-left: 1.8rem;
  margin: 0.6rem 0;
}
.agreement-modal-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.4rem 1rem;
  color: var(--text-secondary);
  margin: 1rem 0;
  background: #f7f7f5;
}
.agreement-modal-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.6rem 0;
}
.agreement-modal-body a {
  color: var(--accent);
  text-decoration: underline;
}

/* ── 회원 탈퇴 박스 ── */
.withdraw-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem 1.6rem;
  margin: 0 0 1.6rem 0;
}
.withdraw-title {
  font-size: 1.8rem;
  margin: 0 0 1.2rem 0;
}
.withdraw-notice {
  padding-left: 1.8rem;
  line-height: 1.6;
  color: var(--text-secondary);
  font-size: 1.3rem;
}
.withdraw-notice li {
  margin-bottom: 0.6rem;
}
.withdraw-consent {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 0.8rem;
  margin: 1.6rem 0;
  font-size: 1.3rem;
  line-height: 1.5;
  cursor: pointer;
}
.withdraw-consent input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1.8rem;
  height: 1.8rem;
  margin: 0.2rem 0 0 0;
  accent-color: var(--accent);
}
.withdraw-consent span {
  flex: 1 1 auto;
}
.btn-danger {
  width: 100%;
  padding: 1.3rem;
  background: #d9534f;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.5rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-danger:hover { background: #c9302c; }