/* ============================================================
   운세풀이 — Korean Fortune App
   Palette: Warm traditional brown/gold
   Features: 이름풀이 + 육임풀이
   ============================================================ */

:root {
    --primary:    #5d4037;
    --secondary:  #8d6e63;
    --accent:     #d4a574;
    --accent-light: #f0dfc0;
    --bg:         #faf7f2;
    --card-bg:    #ffffff;
    --text:       #3e2723;
    --text-muted: #795548;
    --border:     #d7c4b0;
    --border-light: #ede3d8;
    --shadow:     rgba(93, 64, 55, 0.12);
    --shadow-md:  rgba(93, 64, 55, 0.18);
}

/* ============================================================
   Reset & Base
   ============================================================ */

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

body {
    font-family: 'Noto Serif KR', 'Malgun Gothic', '맑은 고딕', serif;
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 48px 16px 60px;
    min-height: 100vh;
    margin: 0;
}

/* ============================================================
   Container — input view (default) + result view expansion
   ============================================================ */

.container {
    background-color: var(--card-bg);
    padding: 16px 32px;
    padding-bottom: 70px;
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow);
    width: 100%;
    max-width: 450px;
    text-align: center;
    transition: max-width 0.35s ease;
}

/* Expand when result view is visible */
.container:has(#result-view[style*="block"]) {
    max-width: 900px;
}

/* Expand for hyunse/yearly views */
.container:has(#hyunse-view[style*="block"]),
.container:has(#yearly-view[style*="block"]) {
    max-width: 600px;
}

/* ============================================================
   Typography
   ============================================================ */

h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 28px;
    letter-spacing: 0.05em;
}

/* ============================================================
   Input Form
   ============================================================ */

.input-group {
    margin-bottom: 24px;
    text-align: left;
}

/* Visually hidden labels — preserved for accessibility */
.input-group label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.input-group label.lunar-toggle {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
}
.birthdate-label-row {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}
.birthdate-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.input-group input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    font-weight: 700;
    color: var(--text);
    background-color: var(--card-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.2);
}

/* Birthdate hint */
.birthdate-hint {
    font-size: 12px;
    color: #bf6c00;
    margin-bottom: 6px;
}

/* ============================================================
   Select Groups — birthdate & birthtime
   ============================================================ */

.birthdate-select-group,
.birthtime-select-group {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.birthdate-select-group select,
.birthtime-select-group select {
    flex: 1;
    padding: 9px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    font-weight: 700;
    color: var(--text);
    background-color: var(--card-bg);
    height: 40px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: auto;
}

.birthdate-select-group .year-input {
    flex: 1;
    padding: 9px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    font-weight: 700;
    color: var(--text);
    background-color: var(--card-bg);
    height: 40px;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-align: center;
    -moz-appearance: textfield;
}

.birthdate-select-group .year-input::-webkit-outer-spin-button,
.birthdate-select-group .year-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.birthdate-select-group .year-input::placeholder {
    color: var(--text-light);
    font-size: 13px;
}

.birthdate-select-group select:focus,
.birthtime-select-group select:focus,
.birthdate-select-group .year-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.2);
}

/* ============================================================
   Gender Selection
   ============================================================ */

/* Section divider between form groups */
.form-divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 6px 0;
}

.gender-selection {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.gender-button {
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background-color: var(--card-bg);
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-light);
    flex-grow: 1;
    transition: all 0.2s ease;
}

.gender-button:hover {
    border-color: var(--accent);
    color: var(--primary);
}

.gender-button.active {
    background: linear-gradient(180deg, #6d4c41 0%, #5d4037 100%);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(93, 64, 55, 0.25);
}

/* MBTI Select */
#mbtiSelect {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    box-sizing: border-box;
    height: 40px;
    background-color: var(--card-bg);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

#mbtiSelect:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.2);
}

/* ============================================================
   Hanja Display
   ============================================================ */

.hanja-display {
    background-color: #fdf6eb;
    border: 1px solid var(--accent-light);
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    min-height: 70px;
}

.hanja-syllable-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 12px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: border-color 0.2s ease;
}

.hanja-syllable-container.active-selection {
    border-bottom-color: var(--accent);
}

.hanja-char {
    font-size: 36px;
    font-weight: bold;
    color: var(--primary);
    line-height: 1.1;
}

.hanja-num-val {
    font-size: 0.78em;
    color: var(--text-muted);
    margin-top: 3px;
    min-height: 1em;
}

/* ============================================================
   Year value & Total sum
   ============================================================ */

.year-value {
    text-align: center;
    font-size: 0.88em;
    color: var(--text-muted);
    margin-top: 4px;
    margin-bottom: 18px;
    min-height: 1.2em;
}

.total-sum {
    text-align: center;
    font-size: 1.05em;
    font-weight: bold;
    color: var(--primary);
    margin-top: 14px;
    margin-bottom: 22px;
    min-height: 1.3em;
}

/* ============================================================
   Hanja Selection
   ============================================================ */

.hanja-selection {
    text-align: left;
    margin-bottom: 22px;
}

.hanja-selection h2 {
    font-size: 15px;
    color: var(--primary);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    font-weight: 700;
}

.hanja-selection h2 .highlight {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary);
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    line-height: 1;
    text-align: center;
    margin-right: 8px;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.hanja-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.hanja-option {
    padding: 14px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background-color: var(--card-bg);
    cursor: pointer;
    font-size: 20px;
    text-align: center;
    color: var(--primary);
    transition: background-color 0.15s, border-color 0.15s;
}

.hanja-option .hanja-number {
    font-size: 0.75em;
    color: var(--secondary);
    margin-left: 3px;
}

.hanja-option:hover {
    background-color: #fdf6eb;
    border-color: var(--accent);
}

.hanja-option.selected {
    background-color: #fdf0e0;
    border-color: var(--accent);
    color: var(--primary);
}

/* ============================================================
   Analysis Button
   ============================================================ */

.analysis-button {
    display: block;
    width: 100%;
    padding: 13px 20px;
    margin: 28px 0 0;
    font-size: 17px;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    background: linear-gradient(180deg, #6d4c41 0%, #4e342e 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    letter-spacing: 0.05em;
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 2px 8px var(--shadow);
}

.analysis-button:hover {
    background: linear-gradient(180deg, #795548 0%, #5d4037 100%);
    box-shadow: 0 4px 14px var(--shadow-md);
    transform: translateY(-1px);
}

.analysis-button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 4px var(--shadow);
}

.analysis-buttons {
    display: flex;
    gap: 10px;
    margin: 28px 0 0;
}

.analysis-buttons .analysis-button {
    flex: 1;
    margin: 0;
}

.analysis-buttons .yukrim-button {
    background: linear-gradient(180deg, #283593 0%, #1a237e 100%);
}

.analysis-buttons .yukrim-button:hover {
    background: linear-gradient(180deg, #303f9f 0%, #1a237e 100%);
}

.name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.reset-form-button {
    padding: 10px 14px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 700;
    color: #888;
    background: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.reset-form-button:hover {
    color: #555;
    border-color: #bbb;
    background: #f5f5f5;
}

.yukrim-view-header {
    text-align: center;
    margin-bottom: 20px;
}

.yukrim-view-header h2 {
    font-size: 22px;
    margin-bottom: 4px;
}

.yukrim-view-desc {
    font-size: 13px;
    color: #888;
}

.yukrim-guide {
    background: #f9f6f1;
    border-left: 3px solid var(--primary);
    padding: 14px 16px;
    margin-top: 12px;
    border-radius: 0 8px 8px 0;
    text-align: left;
    font-weight: 700;
}

.yukrim-guide p {
    font-size: 13px;
    line-height: 1.7;
    color: #555;
    margin: 0 0 8px;
}

.yukrim-guide p:last-child {
    margin-bottom: 0;
}

/* ============================================================
   Result View
   ============================================================ */

#result-view {
    margin-top: 20px;
}

/* Hanja name at top of results */
.hanja-name {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 24px;
    color: var(--primary);
    font-family: 'Noto Serif KR', serif;
    letter-spacing: 0.35em;
}

/* ============================================================
   Two-column result layout
   ============================================================ */

.result-columns {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: flex-start;
}

/* Individual result column */
.result-column {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-weight: 700;
}

.result-column h3 {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background-color: var(--primary);
    margin: 0;
    padding: 10px 16px;
    text-align: center;
    letter-spacing: 0.08em;
}

/* Inner scroll area inside each column */
.result-column-content {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

/* ============================================================
   Name section (이름풀이) — standalone in result-view
   ============================================================ */

.result-name-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
    font-weight: 700;
}

.result-name-section h3 {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background-color: var(--primary);
    margin: 0;
    padding: 10px 16px;
    text-align: center;
    letter-spacing: 0.08em;
}

.result-name-section .name-meaning {
    padding: 16px;
}

/* Legacy (kept for dead CSS compatibility) */
.name-column {
    display: flex;
    flex-direction: column;
}

.name-column .result-column-content {
    flex: 1;
}

/* Name meaning text block */
.name-meaning {
    padding: 0;
    margin: 0;
    background-color: transparent;
    border: none;
    text-align: left;
    color: var(--text);
    font-size: 13px;
    line-height: 1.9;
    font-family: 'Noto Serif KR', serif;
    white-space: pre-wrap;
    font-weight: 700;
}

/* ============================================================
   Yukrim column (육임풀이)
   ============================================================ */

.yukrim-column {
    display: flex;
    flex-direction: column;
}

.yukrim-result {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text);
    font-weight: 700;
}

.yukrim-sinjang-display {
    text-align: center;
    margin: 0 0 16px;
    padding: 18px 16px;
    background: #fdf6eb;
    border: 1px solid var(--accent-light);
    border-radius: 8px;
}

.yukrim-sinjang-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.05em;
}

.yukrim-sinjang-hanja {
    font-size: 15px;
    color: var(--secondary);
    margin-top: 5px;
    letter-spacing: 0.1em;
}

.yukrim-detail-title {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
    font-size: 13px;
}

.yukrim-interpretation {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.85;
    color: var(--text);
}

/* ============================================================
   Result Actions
   ============================================================ */

.result-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.retry-button {
    padding: 11px 28px;
    font-size: 15px;
    font-family: inherit;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(180deg, #6d4c41 0%, #4e342e 100%);
    border: none;
    border-radius: 7px;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: all 0.2s;
    box-shadow: 0 2px 8px var(--shadow);
}

.retry-button:hover {
    background: linear-gradient(180deg, #795548 0%, #5d4037 100%);
    box-shadow: 0 4px 14px var(--shadow-md);
    transform: translateY(-1px);
}

/* ============================================================
   Navigation link
   ============================================================ */

.nav-link {
    text-align: center;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border-light);
}

.nav-link a {
    color: var(--secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.15s;
}

.nav-link a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* ============================================================
   Mobile — 768px breakpoint
   ============================================================ */

@media (max-width: 768px) {
    body {
        padding: 0 0 40px;
    }

    .container {
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
        padding: 0 16px;
    }

    .container:has(#result-view[style*="block"]) {
        max-width: 100%;
    }

    h1 {
        font-size: 18px;
        margin-bottom: 24px;
    }

    /* Stack columns vertically on mobile */
    .result-columns {
        flex-direction: column;
        gap: 14px;
    }

    .result-column {
        width: 100%;
    }

    .hanja-name {
        font-size: 1.6rem;
        margin-bottom: 18px;
    }

    .birthdate-select-group,
    .birthtime-select-group {
        gap: 5px;
    }

    .birthdate-select-group select,
    .birthtime-select-group select {
        font-size: 14px;
        padding: 9px 4px;
        height: 44px;
    }

    .birthdate-select-group .year-input {
        font-size: 14px;
        padding: 9px 4px;
        height: 44px;
    }

    .hanja-char {
        font-size: 30px;
    }

    .hanja-grid {
        gap: 7px;
    }

    .hanja-option {
        font-size: 18px;
        padding: 12px 6px;
    }

    .analysis-button {
        font-size: 16px;
        padding: 14px;
    }

    .result-column h3 {
        font-size: 14px;
        padding: 10px 14px;
    }

    .name-meaning {
        font-size: 12px;
    }

    .yukrim-result {
        font-size: 12px;
    }

    .yukrim-sinjang-name {
        font-size: 19px;
    }

    .result-actions {
        margin-top: 16px;
    }

    .retry-button {
        font-size: 14px;
        padding: 12px 24px;
    }
}

/* ============================================================
   Extra small — 360px
   ============================================================ */

@media (max-width: 360px) {
    .container {
        padding: 16px 12px;
    }

    h1 {
        font-size: 16px;
    }

    .hanja-char {
        font-size: 26px;
    }

    .hanja-option {
        font-size: 16px;
        padding: 10px 4px;
    }

    .birthdate-select-group select,
    .birthtime-select-group select {
        font-size: 13px;
        padding: 8px 3px;
    }

    .birthdate-select-group .year-input {
        font-size: 13px;
        padding: 8px 3px;
    }

    .result-column h3 {
        font-size: 13px;
    }
}

/* ========== 과식판 해석 섹션 ========== */

.yukrim-chart-interp {
    margin-top: 16px;
    padding: 16px;
    background: rgba(93, 64, 55, 0.05);
    border-radius: 8px;
    font-weight: 700;
}

.interp-section {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(93, 64, 55, 0.1);
}

.interp-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.interp-subtitle {
    font-size: 0.95rem;
    font-weight: 600;
    color: #5d4037;
    margin-bottom: 8px;
}

.interp-method {
    font-size: 0.85rem;
    color: #8d6e63;
    margin-bottom: 6px;
    font-style: italic;
}

.interp-flow {
    font-size: 0.95rem;
    font-weight: 500;
    color: #4e342e;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: rgba(93, 64, 55, 0.08);
    border-radius: 6px;
    text-align: center;
}

.interp-detail p, .interp-section > p {
    font-size: 0.88rem;
    color: #5d4037;
    line-height: 1.6;
    margin: 4px 0;
}

.interp-judgment {
    background: rgba(93, 64, 55, 0.08);
    padding: 12px;
    border-radius: 8px;
}

.interp-advice {
    margin-top: 8px;
    font-weight: 500;
    color: #4e342e;
}

/* ============================================================
   결과페이지 한자 변경 영역
   ============================================================ */

.result-hanja-changer {
    margin: 0 auto 20px;
    max-width: 600px;
}

.result-hanja-section {
    margin-bottom: 12px;
}

.result-hanja-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.result-hanja-syllable {
    display: inline-block;
    background: #5d4037;
    color: #fff;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    font-size: 13px;
    margin-right: 6px;
}

.result-hanja-fixed {
    color: #999;
    font-size: 13px;
}

.result-hanja-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    max-height: 150px;
    overflow-y: auto;
}

.result-hanja-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    cursor: pointer;
    font-size: 18px;
    min-width: 44px;
    transition: all 0.15s;
}

.result-hanja-btn small {
    font-size: 10px;
    color: #999;
    margin-top: 2px;
}

.result-hanja-btn:hover {
    border-color: #5d4037;
    background: #efebe9;
}

.result-hanja-btn.selected {
    background: #5d4037 !important;
    color: #fff !important;
    border-color: #5d4037 !important;
}

.result-hanja-btn.selected small {
    color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 768px) {
    .result-hanja-changer {
        max-width: 100%;
    }

    .result-hanja-btn {
        font-size: 16px;
        min-width: 38px;
        padding: 5px 6px;
    }

    .result-hanja-grid {
        max-height: 120px;
    }
}

/* ============================================================
   로그인 영역
   ============================================================ */

.auth-area {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    margin-bottom: 8px;
    position: relative;
}

.header-logo {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Noto Serif KR', serif;
    letter-spacing: 15px;
}

.header-icon-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    transition: color 0.2s, background 0.2s;
}
.header-icon-btn:active {
    background: var(--border-light);
    color: var(--primary);
}
.header-left {
    position: absolute;
    left: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-right {
    position: absolute;
    right: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kakao-login-btn {
    background: #FEE500;
    color: #3C1E1E;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.kakao-login-btn:hover {
    background: #F0D800 !important;
    border-color: #F0D800 !important;
    color: #3C1E1E !important;
}

.user-nickname {
    font-size: 13px;
    color: var(--text);
    font-weight: 600;
}

.my-readings-btn {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    color: var(--text);
}

.logout-btn {
    background: transparent;
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    color: #999;
    white-space: nowrap;
}

.save-reading-btn {
    background: #FEE500;
    color: #3C1E1E;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-left: 8px;
}

/* ============================================================
   풀이 기록 모달
   ============================================================ */

.readings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.readings-modal-content {
    background: var(--bg);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.readings-modal-header h3 {
    margin: 0;
    font-size: 16px;
}

.readings-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text);
}

.readings-modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.reading-item {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--card-bg);
    cursor: pointer;
    transition: background 0.2s;
}

.reading-item:hover {
    background: rgba(0,0,0,0.03);
}

.reading-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    gap: 6px;
}

.reading-share-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    line-height: 1;
    flex-shrink: 0;
    opacity: 0.85;
    transition: opacity 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
}

.reading-share-icon:hover {
    opacity: 1;
    transform: scale(1.15);
}

.reading-item-header::after {
    content: '▼';
    font-size: 10px;
    color: #999;
    margin-left: 8px;
    transition: transform 0.3s;
}

.reading-item.expanded .reading-item-header::after {
    transform: rotate(180deg);
}

.reading-date {
    font-size: 11px;
    color: #999;
}

.reading-item-detail {
    font-size: 12px;
    color: #777;
}

.reading-item-meaning {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
}

.reading-item.expanded .reading-item-meaning {
    max-height: none;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid var(--border);
}

.reading-share-btn {
    display: none;
    margin-top: 10px;
    padding: 8px 16px;
    background: #FEE500;
    color: #191919;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.reading-item.expanded .reading-share-btn {
    display: inline-block;
}

.reading-share-btn:hover {
    background: #F5DC00;
}

/* ============================================================
   공유 아이콘 버튼
   ============================================================ */

.auth-left-icons {
    display: contents;
}

.share-text-btn,
.install-text-btn {
    display: flex;
    align-items: center;
    gap: 3px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    color: var(--text);
    transition: all 0.2s;
    white-space: nowrap;
}

.share-text-btn:hover,
.install-text-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(93, 64, 55, 0.05);
}

.kakao-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 28px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #3C1E1E;
    background: #FEE500;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.2s;
}

.kakao-share-btn:hover {
    background: #F0D800;
}

/* 과전 해석 (육임서적 데이터) */
.yukrim-book-section {
    background: linear-gradient(135deg, #f5f0e8 0%, #ede4d4 100%);
    border: 1px solid #d4c5a9;
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
}
.yukrim-book-section .yukrim-detail-title {
    color: #5d4037;
    font-weight: 700;
    margin-bottom: 12px;
}
.yukrim-book-gwache {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #c4b89a;
}
.gwache-name {
    background: linear-gradient(180deg, #6d4c41 0%, #4e342e 100%);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}
.gwache-desc {
    color: #5d4037;
    font-size: 14px;
}
.yukrim-book-raejeong {
    padding: 8px 0;
}
.raejeong-topic {
    color: #283593;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}
.raejeong-item {
    color: #4e342e;
    font-size: 13px;
    padding: 4px 0 4px 12px;
    border-left: 3px solid #8d6e63;
    margin-bottom: 4px;
}

/* 종합풀이 카드 */
.yukrim-summary-card {
    background: linear-gradient(135deg, #faf6f0 0%, #f5ede0 100%);
    border: 1px solid #e0d6c8;
    border-radius: 12px;
    padding: 16px 18px;
    margin: 16px 0;
}

.yukrim-summary-title {
    font-size: 13px;
    font-weight: 700;
    color: #8d6e4a;
    margin-bottom: 8px;
}

.yukrim-summary-text {
    font-size: 13px;
    line-height: 1.8;
    color: #4a3728;
    word-break: keep-all;
}

.yukrim-summary-text b {
    color: #8d6e4a;
}

/* 과식판 */
.yukrim-chart-section {
    margin: 16px 0;
}

.yukrim-chart-info {
    text-align: center;
    font-size: 12px;
    color: #888;
    margin-bottom: 12px;
}

.samjeon-sigwa-wrap {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 16px;
}

.samjeon-table,
.sigwa-table {
    border-collapse: collapse;
    font-size: 13px;
    text-align: center;
}

.samjeon-table th,
.sigwa-table th {
    background: #f5f0e8;
    padding: 6px 10px;
    font-weight: 600;
    letter-spacing: 2em;
    text-indent: 2em;
    font-size: 12px;
    color: #5d4037;
}

.samjeon-table td,
.sigwa-table td {
    padding: 5px 8px;
    border-bottom: 1px solid #eee;
}

.samjeon-table td:first-child,
.sigwa-table td:first-child {
    font-size: 11px;
    color: #999;
}

.gwasik-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 1px;
    background: #e0d6c8;
    border: 1px solid #d4c9b8;
    border-radius: 8px;
    overflow: hidden;
    max-width: 340px;
    margin: 0 auto;
}

.gw-cell {
    background: #fff;
    text-align: center;
    padding: 6px 2px;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gw-tj {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
}

.gw-tp {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.gw-dp {
    font-size: 12px;
    color: #999;
    line-height: 1.2;
}

.gw-wx {
    font-size: 10px;
    color: #bbb;
    line-height: 1.2;
}

.gw-center {
    background: #faf6f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.gw-center-title {
    font-size: 14px;
    font-weight: 700;
    color: #5d4037;
}

.gw-center-gwache {
    font-size: 13px;
    font-weight: 600;
    color: #8d6e4a;
    margin-top: 4px;
}

.gw-center-method {
    font-size: 10px;
    color: #aaa;
    margin-top: 2px;
}

@media (max-width: 480px) {
    .samjeon-sigwa-wrap {
        flex-direction: column;
        align-items: center;
    }
    .gwasik-board {
        max-width: 300px;
    }
    .gw-tp {
        font-size: 16px;
    }
}

/* ===== 육임달력 ===== */
.yukrim-calendar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 16px 0 12px;
}

.yukrim-calendar-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #3e2723;
    margin: 0;
    min-width: 140px;
    text-align: center;
}

.cal-nav-btn {
    background: #f5f0eb;
    border: 1px solid #d7ccc8;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    font-size: 18px;
    color: #5d4037;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-nav-btn:hover {
    background: #5d4037 !important;
    color: #fff !important;
}

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #8d6e63;
    margin-bottom: 4px;
    padding: 0 4px;
}

.cal-weekdays span:first-child { color: #e53935; }
.cal-weekdays span:last-child { color: #1565c0; }

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 0 4px;
    margin-bottom: 12px;
}

.cal-day {
    min-height: 84px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 2px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    background: #faf7f4;
    border: 1px solid transparent;
    transition: all 0.15s;
}

.cal-day:hover {
    background: #efebe9;
    border-color: #d7ccc8;
}

.cal-day.today {
    border: 2px solid #5d4037;
    font-weight: 700;
}

.cal-day.selected {
    background: #5d4037;
    color: #fff;
}

.cal-day.empty {
    background: transparent;
    cursor: default;
}

.cal-day.empty:hover {
    background: transparent;
    border-color: transparent;
}

.cal-day.sunday { color: #e53935; }
.cal-day.saturday { color: #1565c0; }
.cal-day.selected.sunday,
.cal-day.selected.saturday { color: #fff; }

.cal-day .cal-memo-preview {
    font-size: 8px;
    font-weight: 700;
    color: #8d6e63;
    line-height: 1.2;
    margin-top: 2px;
    text-align: center;
    word-break: break-all;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-width: 100%;
    padding: 0 1px;
}

.cal-day.selected .cal-memo-preview { color: #d7ccc8; }

/* 시간 드롭다운 */
.cal-time-dropdown {
    background: #fff;
    border: 1px solid #d7ccc8;
    border-radius: 12px;
    padding: 12px;
    margin: 0 4px 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.cal-time-dropdown-title {
    font-size: 15px;
    font-weight: 700;
    color: #3e2723;
    margin-bottom: 10px;
    text-align: center;
}

.cal-time-list-v {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cal-time-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid #e0e0e0;
    transition: all 0.15s;
}

.cal-time-row:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.cal-time-row-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 44px;
    flex-shrink: 0;
}

.cal-time-range {
    font-size: 14px;
    font-weight: 700;
    color: #3e2723;
}

.cal-time-label {
    font-size: 10px;
    color: #aaa;
}

.cal-time-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.cal-time-badge.gil {
    background: #e8f5e9;
    color: #2e7d32;
}

.cal-time-badge.hyung {
    background: #ffebee;
    color: #c62828;
}

.cal-time-badge.pyeong {
    background: #fff8e1;
    color: #f57f17;
}

.cal-time-row.gil { border-left: 3px solid #4caf50; }
.cal-time-row.hyung { border-left: 3px solid #e53935; }
.cal-time-row.pyeong { border-left: 3px solid #ffc107; }

.cal-time-row-right {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.cal-time-topic {
    font-size: 11px;
    font-weight: 600;
    color: #8d6e63;
}

.cal-time-result {
    font-size: 12px;
    color: #4e342e;
    line-height: 1.4;
    word-break: keep-all;
}

.cal-time-memo {
    font-size: 11px;
    color: #5d4037;
    font-weight: 600;
    margin-top: 3px;
    padding: 2px 6px;
    background: #f5f0eb;
    border-radius: 4px;
    display: inline-block;
}

/* 메모 모달 */
.cal-memo-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    font-weight: 700;
}

.cal-memo-modal-content {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.cal-memo-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 12px;
    border-bottom: 1px solid #f0ebe6;
}

.cal-memo-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #3e2723;
}

.cal-memo-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.cal-memo-close:hover {
    color: #333 !important;
    background: none !important;
}

.cal-memo-fortune {
    padding: 16px 20px;
    background: #faf7f4;
    border-bottom: 1px solid #f0ebe6;
    font-size: 13px;
    line-height: 1.7;
    color: #4e342e;
}

.cal-memo-fortune .fortune-label {
    font-size: 12px;
    font-weight: 700;
    color: #8d6e63;
    margin-bottom: 6px;
}

.cal-memo-fortune .fortune-gwache {
    font-weight: 700;
    color: #5d4037;
    margin-bottom: 4px;
}

.cal-memo-body {
    padding: 16px 20px;
}

.cal-memo-body textarea {
    width: 100%;
    min-height: 100px;
    border: 1px solid #d7ccc8;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    font-family: 'Noto Serif KR', serif;
    resize: vertical;
    box-sizing: border-box;
}

.cal-memo-body textarea:focus {
    border-color: #5d4037 !important;
    outline: none;
}

.cal-memo-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.cal-memo-actions button {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #d7ccc8;
}

.cal-memo-save {
    background: #5d4037;
    color: #fff;
    border-color: #5d4037 !important;
}

.cal-memo-save:hover {
    background: #4e342e !important;
}

.cal-memo-delete {
    background: #fff;
    color: #e53935;
    border-color: #e53935 !important;
}

.cal-memo-delete:hover {
    background: #ffebee !important;
    color: #c62828 !important;
}

/* ============================================================
   음력 토글
   ============================================================ */
.lunar-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    margin-left: 8px;
}
.lunar-toggle input[type="checkbox"] {
    cursor: pointer;
}

/* ============================================================
   결제 모달
   ============================================================ */
.payment-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.payment-modal {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 28px 24px;
    max-width: 340px;
    width: 90%;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.payment-modal h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 12px;
}
.payment-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 20px;
    line-height: 1.6;
}
.payment-buttons {
    display: flex;
    gap: 10px;
}
.payment-confirm-btn {
    flex: 1;
    padding: 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}
.payment-confirm-btn:hover {
    background: var(--secondary);
}
.payment-cancel-btn {
    flex: 1;
    padding: 12px;
    background: transparent;
    color: var(--text-muted);
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}
.payment-cancel-btn:hover {
    background: rgba(0,0,0,0.03);
}

/* Credits display */
.credits-display {
    text-align: center;
    font-size: 13px;
    color: #8d6e63;
    margin-top: 6px;
    font-weight: 700;
}

/* 하단 네비게이션바 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 6px 0;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    font-size: 10px;
    font-family: inherit;
    font-weight: 600;
    padding: 4px 12px;
    transition: color 0.2s;
    opacity: 0.7;
}

.nav-item:hover,
.nav-item:active {
    color: var(--primary);
    opacity: 1;
}

.nav-item svg {
    stroke: currentColor;
}

/* ============================================================
   인앱브라우저 앱 설치 유도 배너 (결과 화면 하단)
   ============================================================ */

.inapp-install-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #fdf6e3 0%, #fff8e7 100%);
    border: 1px solid #e6c97a;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(93, 64, 55, 0.08);
}

.inapp-install-banner-text {
    font-size: 14px;
    color: #5d4037;
    line-height: 1.4;
    flex: 1;
}

.inapp-install-banner-btn {
    flex-shrink: 0;
    padding: 9px 18px;
    background: #5d4037;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.inapp-install-banner-btn:hover,
.inapp-install-banner-btn:active {
    background: #4e342e;
}

/* ─── 사주 운세 뷰 (메인 페이지 — 고동색 테마) ────────── */
.saju-fortune-header { text-align: center; margin-bottom: 20px; }
.saju-fortune-header h2 { font-size: 1.3rem; color: var(--primary); font-family: 'Noto Serif KR', serif; }
.fortune-yongshin { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; padding: 12px; background: var(--bg); border-radius: 10px; border: 1px solid var(--border); }
.fortune-badge { padding: 6px 14px; border-radius: 20px; font-weight: bold; font-size: 0.9rem; white-space: nowrap; }
.fortune-badge.strong { background: var(--accent-light); color: var(--primary); }
.fortune-badge.weak { background: #fff3e0; color: #bf6c00; }
.fortune-detail { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }
.fortune-gauge { margin-bottom: 15px; padding: 15px; background: var(--bg); border-radius: 10px; border: 1px solid var(--border); }
.fortune-gauge-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: bold; color: var(--primary); }
.fortune-total-grade { font-size: 1.1rem; padding: 2px 10px; border-radius: 12px; }
.fortune-total-grade.great { background: var(--accent-light); color: var(--primary); }
.fortune-total-grade.good { background: #f0dfc0; color: #5d4037; }
.fortune-total-grade.normal { background: var(--border-light); color: var(--text-muted); }
.fortune-total-grade.bad { background: #fff3e0; color: #bf6c00; }
.fortune-total-grade.terrible { background: #f8d7da; color: #8b0000; }
.fortune-gauge-bar { height: 12px; background: var(--border-light); border-radius: 6px; overflow: hidden; }
.fortune-gauge-fill { height: 100%; border-radius: 6px; transition: width 0.8s ease; background: linear-gradient(90deg, var(--accent), var(--primary)); }
.fortune-gauge-score { text-align: center; margin-top: 5px; font-size: 0.8rem; color: var(--text-muted); }
.fortune-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 15px; }
.fortune-card { padding: 12px; border-radius: 10px; background: var(--card-bg); border: 1px solid var(--border); text-align: center; }
.fortune-card-title { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 5px; }
.fortune-card-ganji { font-size: 1.3rem; font-weight: bold; color: var(--primary); margin-bottom: 3px; font-family: 'Noto Serif KR', serif; }
.fortune-card-sipsin { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 5px; }
.fortune-card-grade { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 0.8rem; font-weight: bold; margin-bottom: 5px; }
.fortune-card-desc { font-size: 0.75rem; color: var(--text-muted); line-height: 1.3; }
.grade-great { background: var(--accent-light); color: var(--primary); }
.grade-good { background: #f0dfc0; color: #5d4037; }
.grade-ok { background: var(--border-light); color: var(--text-muted); }
.grade-bad { background: #fff3e0; color: #bf6c00; }
.grade-terrible { background: #f8d7da; color: #8b0000; }
.interaction-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 6px; border-radius: 8px; font-size: 0.85rem; }
.interaction-item.positive { background: var(--accent-light); color: var(--primary); }
.interaction-item.negative { background: #f8d7da; color: #8b0000; }
.interaction-icon { font-size: 1.1rem; }
.fortune-daeun h4 { margin: 15px 0 10px; font-size: 1rem; color: var(--primary); font-family: 'Noto Serif KR', serif; }
#sf-interactions h4 { margin: 15px 0 10px; font-size: 1rem; color: var(--primary); }
.daeun-timeline { display: flex; overflow-x: auto; gap: 8px; padding: 10px 0; }
.daeun-item { min-width: 60px; text-align: center; padding: 8px 6px; border-radius: 8px; background: var(--card-bg); border: 1px solid var(--border); flex-shrink: 0; }
.daeun-item.current { background: var(--accent-light); border: 2px solid var(--primary); }
.daeun-age { font-size: 0.65rem; color: var(--text-muted); }
.daeun-ganji { font-size: 1rem; font-weight: bold; color: var(--primary); margin: 3px 0; font-family: 'Noto Serif KR', serif; }
.daeun-sipsin { font-size: 0.7rem; color: var(--text-muted); }

/* ─── 박청화 24주기 뷰 ──────────────────────────────── */
.c24-sinsal-card { display: flex; align-items: center; gap: 12px; padding: 15px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; }
.c24-sinsal-icon { font-size: 2.2rem; }
.c24-sinsal-info { flex: 1; }
.c24-sinsal-name { font-size: 1.2rem; font-weight: bold; color: var(--primary); font-family: 'Noto Serif KR', serif; }
.c24-sinsal-phase { font-size: 0.8rem; color: var(--text-muted); }
.c24-sinsal-score { font-size: 1.5rem; font-weight: bold; }
.c24-summary { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.c24-grade { padding: 4px 14px; border-radius: 20px; font-weight: bold; font-size: 0.9rem; }
.c24-summary-text { font-size: 0.85rem; color: var(--text-muted); }
.c24-detail { padding: 12px; background: var(--bg); border: 1px solid var(--border-light); border-radius: 10px; font-size: 0.85rem; color: var(--text); line-height: 1.6; margin-bottom: 12px; }
.c24-advice { padding: 12px; background: var(--accent-light); border-radius: 10px; font-size: 0.85rem; color: var(--primary); line-height: 1.5; margin-bottom: 15px; font-weight: 500; }
.c24-notes { padding: 10px 12px; background: #fff3e0; border-radius: 8px; font-size: 0.8rem; color: #bf6c00; margin-bottom: 12px; line-height: 1.4; }
.c24-graph-title { font-size: 1rem; color: var(--primary); font-family: 'Noto Serif KR', serif; margin: 15px 0 10px; }
.c24-pivot { font-size: 0.8rem; color: var(--text-muted); text-align: center; margin: 8px 0 15px; }
.c24-sinsal-timeline { display: flex; overflow-x: auto; gap: 6px; padding: 8px 0; }
.c24-sinsal-item { min-width: 52px; text-align: center; padding: 6px 4px; border-radius: 8px; background: var(--card-bg); border: 1px solid var(--border-light); flex-shrink: 0; }
.c24-sinsal-item.current { background: var(--accent-light); border: 2px solid var(--primary); }
.c24-sinsal-item-icon { font-size: 1rem; }
.c24-sinsal-item-name { font-size: 0.65rem; color: var(--primary); font-weight: bold; }
.c24-sinsal-item-age { font-size: 0.6rem; color: var(--text-muted); }
.c24-offset-control { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 10px; }
.c24-offset-btn { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; font-size: 0.8rem; color: var(--primary); cursor: pointer; font-weight: bold; }
.c24-offset-btn:active { background: var(--accent-light); }
.c24-offset-label { font-size: 0.8rem; color: var(--text-muted); min-width: 100px; text-align: center; }

/* ─── 24년 주기 ──────────────────────────────────────── */
.cycle24-section { margin-bottom: 20px; }
.cycle24-section h4 { font-size: 1rem; color: var(--primary); font-family: 'Noto Serif KR', serif; margin-bottom: 12px; }
.cycle24-status { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; }
.cycle24-season-icon { font-size: 1.8rem; }
.cycle24-season-info { flex: 1; }
.cycle24-season-name { font-weight: bold; color: var(--primary); font-size: 1.1rem; }
.cycle24-season-phase { font-size: 0.8rem; color: var(--text-muted); }
.cycle24-season-desc { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.cycle24-advice { padding: 10px 12px; background: var(--accent-light); border-radius: 8px; font-size: 0.85rem; color: var(--primary); line-height: 1.5; margin-bottom: 12px; }
.cycle24-pivot { font-size: 0.8rem; color: var(--text-muted); text-align: center; margin-top: 8px; }

/* ─── 나의 사주 저장 버튼 ────────────────────────────── */
.my-saju-btn {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s;
}
.my-saju-btn:active {
    background: var(--accent-light);
    border-color: var(--primary);
}
.my-saju-btn.saved {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.my-saju-btn.saved:active {
    background: #4e342e;
}
