:root {
    --primary-green: #345941;
    --primary-green-hover: #264330;
    --accent-red: #b71c1c;
    --bg-light: #f4eee0;
    /* Paper tone from user image */
    --app-bg: #faf7f0;
    /* Slightly lighter paper tone */
    --text-dark: #2d2a26;
    --text-muted: #6e675f;
    --card-bg: #ffffff;
    --border-color: #e4dccb;
    /* Muted paper border */
    --shadow: 0 4px 12px rgba(45, 42, 38, 0.08);
    --gold: #b89552;
}

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

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--bg-light);
    /* Subtle traditional cloud/pattern background */
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 50 Q 25 35 40 50 Q 55 65 70 50 Q 85 35 100 50' fill='none' stroke='%23dccab2' stroke-width='0.5' opacity='0.3'/%3E%3Cpath d='M-10 80 Q 5 65 20 80 Q 35 95 50 80 Q 65 65 80 80 Q 95 95 110 80' fill='none' stroke='%23dccab2' stroke-width='0.5' opacity='0.3'/%3E%3C/svg%3E");
    background-attachment: fixed;
    color: var(--text-dark);
    line-height: 1.6;
}

.app-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--app-bg);
    /* Subtle traditional lattice pattern overlay */
    background-image:
        linear-gradient(rgba(250, 247, 240, 0.95), rgba(250, 247, 240, 0.95)),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23e4dccb' stroke-width='0.5' opacity='0.4'%3E%3Cpath d='M0 30h60M30 0v60'/%3E%3Cpath d='M15 0v60M45 0v60M0 15h60M0 45h60'/%3E%3C/g%3E%3C/svg%3E");
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

/* Header */
.main-header {
    padding: 18px 20px;
    background: var(--app-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-header h1 {
    font-family: 'Noto Serif KR', serif;
    font-size: 1.8rem;
    color: var(--primary-green);
    cursor: pointer;
    font-weight: 700;
}

.menu-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.menu-icon span {
    width: 20px;
    height: 2px;
    background: var(--text-dark);
}

/* Main Content */
.content {
    flex: 1;
    padding: 0;
}

.view {
    padding: 20px;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.hidden {
    display: none !important;
}

/* Home View */
.banner {
    position: relative;
    width: 100%;
    aspect-ratio: 32 / 9;
    /* More compact height */
    min-height: 250px;
    overflow: hidden;
    margin-bottom: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    /* Center vertically */
    justify-content: center;
    /* Center horizontally */
    text-align: center;
    padding: 20px;
}

.banner.space-theme {
    background-color: #050510;
    background-image: url('images/hero_space_background.png');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.banner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    /* Hide video in traditional theme */
}

/* Cosmic Animation Effects */
.stars-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Large Stars: Container for JS-generated individual stars */
.stars-large {
    opacity: 1;
    overflow: hidden;
    z-index: 1;
    /* Ensure it's on top of other layers */
}

.individual-star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px #fff, 0 0 20px rgba(255, 255, 255, 0.4);
    animation: realTwinkle 2s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes realTwinkle {
    0% {
        opacity: 0.3;
        transform: scale(0.6);
        filter: brightness(0.8);
        box-shadow: 0 0 5px #fff;
    }

    100% {
        opacity: 1;
        transform: scale(1.1);
        filter: brightness(1.5);
        box-shadow: 0 0 15px #fff, 0 0 25px rgba(255, 255, 255, 0.6);
    }
}

/* Hero Typography */
.hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 15px;
    white-space: nowrap;
    /* Force single line */
    letter-spacing: -0.5px;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

.hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    /* Force single line */
    letter-spacing: -0.3px;
    font-family: 'Noto Sans KR', sans-serif;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .banner {
        aspect-ratio: auto;
        min-height: 200px;
        padding: 30px 15px;
    }

    .hero-title {
        font-size: 1.25rem;
        white-space: normal;
        word-break: keep-all;
        line-height: 1.4;
    }

    .hero-subtitle {
        font-size: 0.85rem;
        white-space: normal;
        word-break: keep-all;
        line-height: 1.5;
        opacity: 0.8;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.15rem;
    }

    .hero-subtitle {
        font-size: 0.75rem;
    }
}

/* Remove text overlay and gradient as they are no longer needed */
.banner::after,
.banner-text {
    display: block !important;
}

.banner::after {
    display: none !important;
    /* Remove the dark gradient overlay from the video theme */
}


.banner>* {
    position: relative;
    z-index: 1;
}


.banner-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    /* Ensure full width for centering */
}

.banner-book {
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Golden backlight effect */
.banner-book::before {
    content: '';
    position: absolute;
    width: 140%;
    height: 140%;
    background: radial-gradient(ellipse at center, rgba(212, 175, 55, 0.4) 0%, rgba(212, 175, 55, 0.2) 40%, transparent 70%);
    filter: blur(40px);
    z-index: 0;
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {

    0%,
    100% {
        opacity: 0.6;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.book-image {
    width: 100%;
    max-width: 280px;
    height: auto;
    border-radius: 8px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(212, 175, 55, 0.2);
    transition: transform 0.4s ease;
    transform: perspective(1000px) rotateY(-3deg) rotateX(2deg);
    position: relative;
    z-index: 1;
}

.book-image:hover {
    transform: perspective(1000px) rotateY(-5deg) rotateX(3deg) scale(1.05);
    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.6),
        0 15px 40px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(212, 175, 55, 0.3);
}

.banner-text {
    text-align: center;
    max-width: 700px;
}

.banner h2 {
    position: relative;
    z-index: 3;
    font-size: 2.8rem;
    margin: 0 0 15px 0;
    color: #fff;
    font-weight: 700;
    letter-spacing: 3px;
    word-break: keep-all;
    line-height: 1.2;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.4), 0 0 40px rgba(212, 175, 55, 0.2);
}

.banner p {
    position: relative;
    z-index: 3;
    font-size: 1.25rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Noto Serif KR', serif;
    font-weight: 500;
    letter-spacing: 1px;
    word-break: keep-all;
    line-height: 1.6;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* PC: 4 columns */
    gap: 20px;
}

.category-card {
    position: relative;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    /* Fixed aspect ratio */
    aspect-ratio: 3 / 4;
    border: 1px solid #D4AF37;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15);
    display: flex;
    flex-direction: column;
}

.category-card:hover {
    border-color: var(--primary-green);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.card-image {
    flex: 7;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.card-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 42, 38, 0.1);
    /* Subtle dark overlay for consistency */
    z-index: 1;
    pointer-events: none;
}

/* Background images for each category */
.category-card[data-category="personal_book"] .card-image {
    background-image: url('images/card_personal_book.png');
}

.category-card[data-category="tarot"] .card-image {
    background-image: url('images/card_tarotfree.png');
}

.category-card[data-category="tarot_chat"] .card-image {
    background-image: url('images/card_tarot.png');
}

.category-card[data-category="lifetime"] .card-image {
    background-image: url('images/card_lifetime.png');
}

.category-card[data-category="newyear2026"] .card-image,
.category-card[data-category="newyear2027"] .card-image {
    background-image: url('images/card_newyear.png');
}

.category-card[data-category="wealth"] .card-image {
    background-image: url('images/card_wealth.png');
}

.category-card[data-category="love"] .card-image {
    background-image: url('images/card_love.png');
}

.category-card[data-category="marriage"] .card-image {
    background-image: url('images/card_marriage.png');
}

.category-card[data-category="job"] .card-image {
    background-image: url('images/card_career.png');
}

.category-card[data-category="business"] .card-image {
    background-image: url('images/card_business.png');
}

.category-card[data-category="health"] .card-image {
    background-image: url('images/card_health.png');
}

.category-card[data-category="health"] .card-image::after {
    content: '🌿';
    font-size: 3rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5));
    z-index: 2;
    pointer-events: none;
}

.category-card[data-category="move"] .card-image {
    background-image: url('images/card_moving.png');
}

.category-card[data-category="move"] .card-image::after {
    content: '🐎';
    font-size: 3rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5));
    z-index: 2;
    pointer-events: none;
}

/* Text area - 30% of card height */
.card-content {
    flex: 3;
    background: #fdfaf5;
    padding: 20px 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-top: 1px solid #f0ede5;
}

.card-content h3 {
    font-family: 'Noto Serif KR', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #2f4f4f;
    margin: 0 0 8px 0;
    letter-spacing: 0.5px;
}

.card-content p {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 0.85rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* Korean paper texture overlay */
.category-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' /%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    mix-blend-mode: overlay;
}

.category-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15), 0 0 20px rgba(212, 175, 55, 0.2);
}

/* Hide old icon elements */
.category-card .icon {
    display: none;
}

/* Form View */
.view-header {
    margin-bottom: 25px;
}

.loading-pulse {
    text-align: center;
    padding: 60px 30px;
    color: var(--text-muted);
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-geometric {
    width: 60px;
    height: 60px;
    position: relative;
    animation: rotateGeo 3s linear infinite;
}

.loading-geometric::before,
.loading-geometric::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid var(--primary-green);
    border-radius: 50%;
    opacity: 0.4;
}

.loading-geometric::before {
    animation: pulseGeo1 2s ease-in-out infinite;
}

.loading-geometric::after {
    animation: pulseGeo2 2s ease-in-out infinite 1s;
    transform: rotate(60deg);
}

@keyframes rotateGeo {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes pulseGeo1 {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    50% {
        opacity: 0.7;
        transform: scale(1);
    }
}

@keyframes pulseGeo2 {

    0%,
    100% {
        opacity: 0.3;
        transform: rotate(60deg) scale(0.8);
    }

    50% {
        opacity: 0.7;
        transform: rotate(60deg) scale(1);
    }
}

.loading-message {
    font-size: 1rem;
    color: var(--primary-green);
    font-weight: 500;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

.loading-pulse-small {
    text-align: center;
    padding: 15px;
    margin-top: 20px;
    color: var(--primary-green);
    font-size: 0.9rem;
    font-weight: 600;
    background: rgba(52, 89, 65, 0.05);
    border: 1px solid rgba(52, 89, 65, 0.1);
    border-radius: 12px;
    animation: pulse 1.5s ease-in-out infinite;
    backdrop-filter: blur(4px);
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.02);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

.back-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 10px;
}

.view-header h2 {
    font-size: 1.5rem;
    border-left: 4px solid var(--primary-green);
    padding-left: 10px;
}

.form-container {
    background: #fff;
}

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.input-group input[type="text"],
.input-group input[type="datetime-local"] {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-dark);
    transition: all 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(52, 89, 65, 0.1);
}

.gender-toggle,
.calendar-toggle {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.form-row .input-group {
    margin-bottom: 0;
}

.gender-toggle input,
.calendar-toggle input {
    display: none;
}

.gender-toggle label,
.calendar-toggle label {
    flex: 1;
    text-align: center;
    padding: 14px;
    cursor: pointer;
    background: #faf7f0;
    color: var(--text-muted);
    transition: all 0.2s;
    font-weight: 500;
}

.gender-toggle input:checked+label,
.calendar-toggle input:checked+label {
    background: var(--primary-green);
    color: #fff;
    font-weight: 500;
}

.submit-btn {
    width: 100%;
    padding: 18px;
    background: var(--primary-green);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(52, 89, 65, 0.2);
}

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

/* Result View */
.manse-area {
    margin-bottom: 40px;
}

.pillars-container {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 15px;
}

.pillar {
    flex: 1;
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 18px 5px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.pillar .label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.pillar .gan {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
}

.pillar .zhi {
    font-size: 1.5rem;
    font-weight: 700;
    color: #222;
}

.lunar-date-info {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* Charts */
.charts-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 40px;
    animation: fadeIn 0.5s ease-in-out;
}

.chart-item {
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 25px;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.chart-item h4.chart-title {
    font-family: 'Noto Serif KR', serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 25px;
    text-align: center;
    color: var(--primary-green);
    position: relative;
    padding-bottom: 10px;
}

.chart-item h4.chart-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: var(--primary-green);
}

.donut-container {
    max-width: 250px;
    margin: 0 auto 30px;
}

/* Energy Bars */
.energy-list {
    margin-top: 20px;
    margin-bottom: 30px;
}

.energy-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.energy-label {
    width: 60px;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.energy-track {
    flex: 1;
    height: 10px;
    background: #f0f0f0;
    border-radius: 5px;
    overflow: hidden;
}

.energy-fill {
    height: 100%;
    width: 0;
    transition: width 0.8s ease-out;
}

.energy-count {
    width: 100px;
    font-size: 0.85rem;
    color: #666;
    text-align: right;
}

/* Diagnosis Box */
.diagnosis-box {
    background: #fffdf5;
    border: 1px solid #ffe9a0;
    border-left: 4px solid #fbc02d;
    padding: 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 10px;
}

.diagnosis-box strong {
    color: #e65100;
    display: block;
    margin-bottom: 5px;
}

/* Luck Descriptions */
.luck-descriptions {
    margin-top: 30px;
    border-top: 1px dashed #ddd;
    padding-top: 20px;
}

.luck-desc-item {
    margin-bottom: 18px;
    padding-left: 15px;
    position: relative;
}

.luck-desc-item::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-green);
    font-weight: bold;
}

.luck-desc-item h5 {
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 4px;
}

.luck-desc-item p {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.5;
}

/* Analysis Report Styles */
.analysis-report {
    line-height: 1.8;
    color: #444;
    font-size: 0.95rem;
    animation: fadeIn 0.8s ease-out forwards;
}

.analysis-report h3 {
    font-family: 'Noto Serif KR', serif;
    font-size: 1.4rem;
    color: #333;
    border-bottom: 2px solid #333;
    padding-bottom: 8px;
    margin: 40px 0 20px;
}

.report-box {
    background: #fffdf5;
    border: 1px solid #ffe9a0;
    border-left: 5px solid #fbc02d;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.report-tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
}

.report-tag {
    background: #546e7a;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.pros-cons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.pro-box {
    color: #2d7a4d;
}

.con-box {
    color: #d32f2f;
}

.pro-box h5,
.con-box h5 {
    border-bottom: 2px solid currentColor;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.saju-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    text-align: center;
}

.saju-table th {
    background: #444;
    color: white;
    padding: 10px;
    font-size: 0.85rem;
}

.saju-table td {
    border: 1px solid #ddd;
    padding: 15px 10px;
    font-size: 1rem;
    font-weight: 600;
}

.interpretation-quote {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    font-style: italic;
    color: #666;
    text-align: center;
    margin: 30px 0;
    border: none;
    position: relative;
}

.interpretation-quote::before {
    content: '"';
    font-size: 3rem;
    color: #ddd;
    position: absolute;
    top: -10px;
    left: 10px;
    font-family: serif;
}

#aiInterpretationArea {
    white-space: normal;
    /* Allow HTML flow */
}

.help-text {
    font-size: 0.75rem;
    color: #888;
    margin-top: 5px;
}

.info-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #ccc;
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 11px;
    line-height: 16px;
    cursor: help;
    margin-left: 4px;
}

/* Chat Styles */
.chat-section {
    margin-top: 50px;
    background: #f9f9f9;
    border-radius: 15px;
    padding: 25px;
    border: 1px solid #eee;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
}

.chat-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Radio Toggle Button Styles (Image 1 style) */
.gender-toggle,
.calendar-toggle {
    display: flex;
    background: #f8f9fa;
    border: 1px solid #eee;
    padding: 2px;
    border-radius: 10px;
}

.gender-toggle input,
.calendar-toggle input {
    display: none;
}

.gender-toggle label,
.calendar-toggle label {
    flex: 1;
    text-align: center;
    padding: 12px;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
    color: #888;
    background: transparent;
}

.gender-toggle input:checked+label,
.calendar-toggle input:checked+label {
    background: var(--primary-green);
    color: white;
    box-shadow: 0 4px 10px rgba(45, 122, 77, 0.2);
}

.secondary-btn {
    background: #fff;
    border: 1px solid var(--primary-green);
    color: var(--primary-green);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: var(--primary-green);
    color: #fff;
}

.chat-header .chart-title {
    margin-bottom: 0 !important;
}

.clear-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-btn:hover {
    background: #f0f0f0;
    color: var(--accent-red);
}

.chat-messages {
    height: 300px;
    overflow-y: auto;
    background: white;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.msg {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.msg.ai {
    align-self: flex-start;
    background: #f0f0f0;
    color: #333;
    border-bottom-left-radius: 2px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.03);
    animation: msgSlideInLeft 0.3s ease-out;
}

.msg.user {
    align-self: flex-end;
    background: var(--primary-green);
    color: white;
    border-bottom-right-radius: 2px;
    box-shadow: -2px 2px 5px rgba(0, 0, 0, 0.1);
    animation: msgSlideInRight 0.3s ease-out;
}

@keyframes msgSlideInLeft {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

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

@keyframes msgSlideInRight {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

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

.msg.loading {
    padding: 15px 20px;
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 8px;
}

.msg.loading::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid #ddd;
    border-top-color: var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.chat-input-area {
    display: flex;
    gap: 10px;
    align-items: center;
}

.voice-btn {
    background: none;
    border: none;
    color: var(--primary-green);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.voice-btn:hover {
    background: #e8f5e9;
}

.voice-btn.recording {
    color: var(--accent-red);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

#chatInput,
#tarotChatInput,
#consultationChatInput {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
}

.send-btn {
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
}

canvas {
    max-width: 100%;
}

.ai-interpretation-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.expert-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
}

.expert-avatar {
    width: 50px;
    height: 50px;
    background: var(--primary-green);
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Noto Serif KR', serif;
    font-size: 1.5rem;
    font-weight: bold;
}

.expert-info strong {
    display: block;
    font-size: 1rem;
}

.expert-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.ai-content {
    font-size: 0.95rem;
    line-height: 1.8;
    white-space: pre-wrap;
    min-height: 200px;
}

.loading-pulse {
    animation: pulse 1.5s infinite;
    color: var(--text-muted);
    text-align: center;
    padding: 50px 0;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

.home-btn {
    width: 100%;
    padding: 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: var(--text-dark);
    font-weight: 500;
    cursor: pointer;
}

/* Footer */
.footer {
    padding: 30px 20px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

/* Modal Styles */
/* Modal Base Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(3px);
}

.modal-content {
    background: #fff;
    width: 95%;
    max-width: 500px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

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

.modal-header {
    padding: 24px 24px 10px;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-green);
    font-family: 'Noto Serif KR', serif;
    font-size: 1.5rem;
}

.close-btn {
    background: #f0f0f0;
    border: none;
    font-size: 1.2rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    color: #666;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #e0e0e0;
}

.modal-body {
    padding: 10px 24px 30px;
}

.modal-body .pillars-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.modal-body .pillar {
    background: #fff;
    border: 1.5px solid #f0f0f0;
    border-radius: 20px;
    padding: 25px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: all 0.3s;
}

.modal-body .label {
    font-size: 1rem;
    color: #bbb;
    font-weight: 500;
}

.modal-body .gan {
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -2px;
}

.modal-body .footer-info {
    text-align: center;
    color: #444;
    border-top: 1px solid #f5f5f5;
    padding-top: 30px;
    margin-top: 10px;
}

.modal-body .birth-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #444;
    margin-bottom: 8px;
}

.modal-body .note-text {
    font-size: 0.85rem;
    color: #888;
}

/* Tarot Consultation Styles */
.tarot-consultation-container {
    padding: 20px 0;
}

.tarot-instruction {
    text-align: center;
    font-size: 1.1rem;
    color: var(--accent-red);
    margin-bottom: 20px;
    font-weight: 500;
}

.card-counter {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.card-counter strong {
    color: var(--primary-green);
    font-size: 1.3rem;
}

/* Tarot Card Grid */
.tarot-card-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #1a1410 0%, #2f2520 100%);
    border-radius: 12px;
    position: relative;
    overflow-x: auto;
}

/* Desktop: 26 cards per row, 3 rows, fan style with overlap */
@media (min-width: 769px) {
    .tarot-card-grid {
        flex-wrap: wrap;
        gap: 0;
        padding: 30px 10px;
    }

    .tarot-card-item {
        width: 70px;
        height: 105px;
        background-image: url('images/card_tarotback.png');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s ease;
        border: none;
        position: relative;
        margin-right: -15px;
        /* Overlap effect */
        margin-bottom: 15px;
        flex-shrink: 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    }

    /* Moon and stars decoration removed */
    .tarot-card-item::before {
        display: none;
    }

    /* Every 26th card: no right margin (end of row) */
    .tarot-card-item:nth-child(26n) {
        margin-right: 0;
    }

    /* Create 3 rows effect */
    .tarot-card-item:nth-child(n+53) {
        margin-top: 0;
    }
}

/* Mobile: 6 cards per row with wrapping */
@media (max-width: 768px) {
    .tarot-card-grid {
        flex-wrap: wrap;
        gap: 5px;
        justify-content: center;
        padding: 20px 10px;
    }

    .tarot-card-item {
        width: calc((100% - 30px) / 6);
        /* 6 cards per row */
        min-width: 45px;
        max-width: 60px;
        aspect-ratio: 2/3;
        background-image: url('images/card_tarotback.png');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.3s ease;
        border: none;
        position: relative;
        margin: 0;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    }

    .tarot-card-item::before {
        display: none;
    }
}

.tarot-card-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 16px rgba(212, 175, 55, 0.4);
    z-index: 10;
}

.tarot-card-item.selected {
    border: 3px solid var(--primary-gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.8);
    transform: translateY(-12px);
    z-index: 20;
}

.tarot-card-item.selected::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--primary-gold);
    color: #1a1410;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Privacy Policy Section */
.privacy-policy-section {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 12px;
}

.privacy-policy-section h3 {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.privacy-policy-box {
    max-height: 300px;
    overflow-y: auto;
    padding: 20px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.privacy-policy-box h4 {
    font-size: 1rem;
    color: var(--primary-green);
    margin-top: 15px;
    margin-bottom: 10px;
}

.privacy-policy-box ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.privacy-policy-box li {
    margin-bottom: 8px;
}

/* Payment Button */
.payment-button {
    width: 100%;
    padding: 18px;
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.payment-button:hover:not(:disabled) {
    background: #2d5f2e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 106, 53, 0.3);
}

.payment-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Mobile Responsive */
/* Tablet Devices */
@media (max-width: 1024px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }
}

/* Extra Small Mobile Devices */
@media (max-width: 400px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .payment-method-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .method-box:nth-child(5) {
        grid-column: span 2;
    }
}

/* Selected Cards Display in Consultation Area */
.selected-cards-display {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 30px auto;
    padding: 40px;
    background: rgba(43, 34, 29, 0.95);
    border-radius: 16px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    width: 100%;
    max-width: 900px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    z-index: 10;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.selected-cards-display::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.selected-card-v {
    width: 160px;
    /* Exactly double the original 80px */
    text-align: center;
    opacity: 0;
    transform: scale(0.5) translateY(20px);
    animation: cardEntry 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.selected-card-v:nth-child(1) {
    animation-delay: 0.1s;
}

.selected-card-v:nth-child(2) {
    animation-delay: 0.3s;
}

.selected-card-v:nth-child(3) {
    animation-delay: 0.5s;
}

@keyframes cardEntry {
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.selected-card-v .card-img {
    width: 100%;
    aspect-ratio: 2/3;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    /* Slightly more rounded */
    border: 3px solid var(--primary-gold);
    /* Thicker border */
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
    margin-bottom: 12px;
    background-color: #1a1410;
}

.selected-card-v span {
    display: block;
    font-size: 1rem;
    /* Larger font */
    color: var(--primary-gold);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Mobile Devices (Portrait) */
@media (max-width: 768px) {
    .app-container {
        max-width: 100%;
        box-shadow: none;
    }

    .main-header {
        padding: 12px 16px;
    }

    .main-header h1 {
        font-size: 1.5rem;
    }

    .banner {
        padding: 30px 16px;
        margin-bottom: 20px;
    }

    .banner-content {
        flex-direction: column;
        gap: 15px;
    }

    .banner-text {
        text-align: center;
        max-width: 100%;
        width: 100%;
    }

    .banner-book {
        display: none;
    }

    /* If showing book on tablet, adjust size */
    @media (min-width: 600px) and (max-width: 768px) {
        .banner-book {
            display: flex;
            width: 50%;
        }

        .banner-book::before {
            display: none;
            /* Remove backlight on smaller screens */
        }

        .book-image {
            max-width: 200px;
        }
    }

    .banner h2 {
        font-size: 1.6rem;
        letter-spacing: 2px;
        text-shadow: 0 0 15px rgba(255, 255, 255, 0.4), 0 0 30px rgba(212, 175, 55, 0.2);
    }

    .banner p {
        font-size: 0.95rem;
        opacity: 0.95;
    }

    /* Category Grid: 2 columns on mobile */
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .category-card {
        padding: 20px 12px;
    }

    .category-card .icon {
        font-size: 2rem;
    }

    .category-card h3 {
        font-size: 1rem;
    }

    .category-card p {
        font-size: 0.75rem;
    }

    /* Form adjustments */
    .view {
        padding: 16px;
    }

    .input-group input[type="text"],
    .input-group input[type="datetime-local"] {
        padding: 10px 12px;
        font-size: 0.95rem;
    }

    .submit-btn {
        padding: 14px;
        font-size: 1rem;
    }

    /* Chat section mobile */
    .chat-section {
        padding: 20px;
        margin-top: 30px;
    }

    .chat-messages {
        height: 250px;
    }

    .msg {
        max-width: 85%;
        font-size: 0.85rem;
    }

    /* Pillars mobile */
    .pillars-container {
        gap: 6px;
    }

    .pillar {
        padding: 12px 3px;
    }

    .pillar .gan,
    .pillar .zhi {
        font-size: 1.2rem;
    }

    .pillar .label {
        font-size: 0.7rem;
    }

    /* Modal mobile */
    .modal-content {
        width: 95%;
        max-width: 95%;
    }

    .payment-modal-content.upgraded {
        width: 95%;
        max-width: 95%;
        padding: 20px;
    }

    .payment-header h2 {
        font-size: 1.4rem;
    }

    .payment-method-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .method-box {
        padding: 12px 5px;
    }

    .method-box:nth-child(5) {
        grid-column: span 2;
    }

    .pay-cancel-btn,
    .pay-submit-btn {
        padding: 14px;
        font-size: 1rem;
    }

    /* Service intro card mobile */
    .service-intro-card {
        padding: 20px;
    }

    .intro-main {
        flex-direction: column;
        text-align: center;
    }

    .intro-image-placeholder {
        width: 80px;
        height: 80px;
    }

    .placeholder-icon {
        font-size: 2rem;
    }

    .intro-info h3 {
        font-size: 1.3rem;
    }

    .current-price {
        font-size: 1.4rem;
    }

    /* Charts mobile */
    .chart-item {
        padding: 16px;
    }

    .donut-container {
        max-width: 200px;
    }

    /* Analysis report mobile */
    .analysis-report {
        font-size: 0.9rem;
    }

    .analysis-report h3 {
        font-size: 1.2rem;
    }

    .pros-cons-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Tablet Devices */
@media (min-width: 769px) and (max-width: 1024px) {
    .app-container {
        max-width: 800px;
    }

    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .payment-method-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet: 2 columns */
@media (min-width: 769px) and (max-width: 1024px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
}

/* Desktop Devices */
@media (min-width: 1025px) {
    .app-container {
        max-width: 900px;
    }

    /* Hover effects only on desktop */
    .category-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    }

    .method-box:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }
}

/* Touch-friendly adjustments for all mobile devices */
@media (hover: none) and (pointer: coarse) {

    /* Increase touch targets */
    .category-card {
        min-height: 120px;
    }

    .submit-btn,
    .send-btn,
    .secondary-btn {
        min-height: 44px;
    }

    .clear-btn,
    .voice-btn {
        min-width: 44px;
        min-height: 44px;
    }

    /* Remove hover effects on touch devices */
    .category-card:hover {
        transform: none;
    }

    .method-box:hover {
        transform: none;
    }

    /* Active states for touch feedback */
    .category-card:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    .submit-btn:active,
    .send-btn:active {
        transform: scale(0.98);
    }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .chat-messages {
        height: 200px;
    }

    .banner {
        padding: 20px 16px;
    }

    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Upgraded Payment Modal (Image Based) */
.payment-modal-content.upgraded {
    background: #fff;
    padding: 25px;
    border-radius: 28px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    border: none;
}

.payment-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    position: relative;
}

.payment-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #000;
    margin: 0;
}

.modal-close {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    line-height: 1;
}

.payment-info-box {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.info-label {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #444;
}

.info-row {
    display: flex;
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.info-row .label {
    color: #333;
    width: 80px;
    flex-shrink: 0;
}

.info-row .value {
    font-weight: 500;
    color: #000;
}

.info-row .price {
    font-weight: 700;
}

.payment-methods-section {
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 18px;
    padding: 25px;
    margin-bottom: 25px;
}

.payment-method-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.method-box {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.method-box:nth-child(4),
.method-box:nth-child(5) {
    grid-column: span 1;
}

.method-box.active {
    border-color: #2d4540;
    background: rgba(45, 69, 64, 0.03);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.method-icon {
    font-size: 1.5rem;
    color: #333;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.method-icon.npay {
    background: #03c75a;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 4px;
}

.method-icon.kpay {
    background: #fee500;
    color: #000;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 4px;
}

.method-box span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

.payment-footer {
    display: flex;
    gap: 12px;
}

.pay-cancel-btn {
    flex: 1;
    background: #e0e0e0;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #000;
    cursor: pointer;
}

.pay-submit-btn {
    flex: 2;
    background: #2d4540;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
}

/* Terms & Timer Styles */
.modal-terms-container {
    margin-top: 15px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 12px;
}

.terms-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #333;
}

.terms-content {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.5;
    max-height: 100px;
    overflow-y: auto;
    padding-right: 8px;
}

.terms-content strong {
    color: #333;
}

/* Chat Timer Styles */
.chat-timer {
    padding: 15px 20px 5px;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.timer-progress-bg {
    width: 100%;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.timer-progress {
    width: 100%;
    height: 100%;
    background: var(--primary-green);
    transition: width 1s linear, background-color 0.3s;
}

.timer-progress.warning {
    background: #e53935;
}

.timer-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    text-align: right;
}

#timeLeft {
    color: var(--primary-green);
    font-family: 'monospace';
}

.timer-progress.warning+.timer-text #timeLeft {
    color: #e53935;
}

/* Service Intro Card Styles */
.service-intro-card {
    background: #fff;
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(45, 42, 38, 0.05);
    border: 1px solid var(--border-color);
    background-image: radial-gradient(circle at 1px 1px, #fdfbf7 1px, transparent 0);
    background-size: 40px 40px;
}

.intro-main {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: center;
}

/* Removed redundant banner styles */

.intro-image-placeholder {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #f5f0e6 0%, #e8dfd0 100%);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #8c7e6a;
    border: 1px solid #dcd3c1;
    flex-shrink: 0;
}

.placeholder-icon {
    font-size: 2.5rem;
    margin-bottom: 4px;
}

.intro-image-placeholder span {
    font-size: 0.8rem;
    font-weight: 700;
}

.intro-info h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary-green);
    font-family: 'Noto Serif KR', serif;
}

.intro-slug {
    font-size: 0.95rem;
    color: #666;
    margin: 4px 0 10px;
}

.intro-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.current-price {
    font-size: 1.6rem;
    font-weight: 800;
    color: #333;
}

.original-price {
    font-size: 0.95rem;
    color: #bbb;
    text-decoration: line-through;
}

.intro-content .section-title {
    font-size: 1.1rem;
    color: #b71c1c;
    margin: 20px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #fee;
}

.intro-text {
    font-size: 0.95rem;
    color: #444;
    line-height: 1.7;
    margin-bottom: 10px;
}

.analysis-list {
    padding-left: 20px;
    margin: 0;
}

.analysis-list li {
    font-size: 0.92rem;
    color: #555;
    margin-bottom: 8px;
    line-height: 1.4;
}

.analysis-list li strong {
    color: #333;
    font-weight: 600;
}

/* --- New Agreement & Warning Styles --- */
.agreement-section {
    margin: 30px 0;
    padding: 20px;
    background: #fdfdfd;
    border: 1px solid #f0f0f0;
    border-radius: 15px;
}

.terms-container {
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.02);
}

.terms-sub-section {
    margin-bottom: 25px;
}

.terms-sub-section:last-child {
    margin-bottom: 0;
}

.terms-title {
    font-size: 1rem;
    color: var(--primary-green);
    border-bottom: 2px solid #e8f5e9;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.terms-content-box {
    font-size: 0.9rem;
    line-height: 1.8;
    /* Increased line spacing */
    color: #555;
}

.terms-content-box p {
    margin-bottom: 12px;
}

.terms-content-box ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.terms-content-box li {
    margin-bottom: 8px;
}

.terms-item {
    margin-bottom: 20px;
    padding-left: 5px;
}

.terms-item h5 {
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 8px;
}

.agreement-check {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #444;
    cursor: pointer;
    margin: 20px 0;
    line-height: 1.6;
}

.agreement-check input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-green);
}

/* Custom Warning Style */
.custom-warning {
    position: relative;
    background: #fff8f8;
    border: 1px solid #ffdde0;
    color: #d32f2f;
    padding: 15px 40px 15px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 15px;
    display: flex;
    align-items: center;
    animation: slideDown 0.3s ease-out;
}

.warning-close-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #d32f2f;
    cursor: pointer;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.warning-close-btn:hover {
    opacity: 1;
}

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

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

.agreement-section.compact {
    margin: 15px 0 0;
    padding: 10px 0;
    background: none;
    border: none;
}

/* Delivery Order Section */
.delivery-order-container {
    margin: 30px 0;
    padding: 25px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: var(--shadow);
    animation: fadeIn 0.8s ease-out forwards;
}

.delivery-order-container h3 {
    font-family: 'Noto Serif KR', serif;
    font-size: 1.25rem;
    color: var(--primary-green);
    margin-bottom: 8px;
    text-align: center;
}

.delivery-notice {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 20px;
}

.delivery-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.delivery-form input,
.delivery-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    background: var(--app-bg);
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--text-dark);
    transition: all 0.2s;
}

.delivery-form textarea {
    min-height: 80px;
    resize: vertical;
}

.delivery-form input:focus,
.delivery-form textarea:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(52, 89, 65, 0.1);
}

.order-submit-btn {
    width: 100%;
    padding: 15px;
    background: #8d1919;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(141, 25, 25, 0.2);
    margin-top: 5px;
}

.order-submit-btn:hover {
    background: #751414;
    transform: translateY(-1px);
}

.order-submit-btn:disabled {
    background: #999;
    cursor: not-allowed;
    transform: none;
}

/* Saju Book Detail Page Styles */
.book-detail-container {
    margin-top: 50px;
    padding: 0;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    background: transparent;
    animation: fadeIn 1s ease-out forwards;
}

.book-detail-hero,
.book-detail-section {
    margin-bottom: 40px;
}

.detail-img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    display: block;
}

.section-title {
    font-family: 'Noto Serif KR', serif;
    font-size: 1.5rem;
    color: var(--primary-green);
    text-align: center;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: var(--accent-red);
}

.author-card {
    background: #fff;
    padding: 30px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.author-text h3 {
    font-size: 1.3rem;
    color: var(--primary-green);
    margin-bottom: 15px;
}

.author-text p {
    line-height: 1.8;
    color: #444;
    margin-bottom: 15px;
}

.author-text ul {
    list-style: none;
    padding: 0;
}

.author-text ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #666;
}

.author-text ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-green);
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-item {
    background: rgba(255, 255, 255, 0.7);
    padding: 20px;
    border-radius: 15px;
    border-left: 4px solid var(--primary-green);
}

.review-text {
    font-style: italic;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.6;
}

.review-user {
    display: block;
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.disclosure-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.disclosure-table th,
.disclosure-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.disclosure-table th {
    background: var(--app-bg);
    color: var(--primary-green);
    font-weight: 600;
    width: 30%;
}

.disclosure-table tr:last-child th,
.disclosure-table tr:last-child td {
    border-bottom: none;
}

/* Modal Detail Page Adjustments */
#inputModal .modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

#sajuBookDetailPage {
    margin-top: 30px;
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
}

#sajuBookDetailPage .section-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
}

/* Payment Modal Styles */
.payment-modal-content {
    max-width: 400px;
}

.payment-body {
    padding: 20px;
    text-align: center;
}

.payment-item-info {
    margin-bottom: 25px;
    padding: 20px;
    background: #fcf8e8;
    border-radius: 12px;
    border: 1px solid #e8d5a0;
}

.item-name {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 8px;
}

.item-price {
    font-size: 1.8rem;
    font-weight: 800;
    color: #b89552;
}


.process-payment-btn {
    width: 100%;
    padding: 15px;
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 15px;
}

.payment-notice {
    font-size: 0.8rem;
    color: #999;
}

.dismissible-notice {
    background: #fdf2f2 !important;
    border: 1px dashed #feb2b2 !important;
    color: #c53030 !important;
    font-size: 0.9rem !important;
    text-align: center !important;
    position: relative;
    padding-bottom: 25px !important;
}

.dismiss-hint {
    display: block;
    margin-top: 8px;
    font-size: 0.75rem;
    color: #fc8181;
    font-weight: 400;
    text-decoration: underline;
}

.chat-price-badge {
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.chat-payment-btn {
    background: var(--primary-green);
    color: #fff;
    border: 1px solid var(--gold);
    border-radius: 20px;
    padding: 7px 18px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(52, 89, 65, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.chat-payment-btn:hover {
    background: var(--primary-green-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(52, 89, 65, 0.4);
    border-color: #d4af37;
}

.chat-payment-btn::before {
    content: "💳";
    font-size: 0.9rem;
}

.chat-payment-btn:active {
    transform: translateY(0);
}

.payment-terms-container {
    margin-bottom: 25px;
    text-align: left;
}

.terms-box {
    background: #f9f9f9;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 15px;
}

.terms-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #444;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.terms-content {
    font-size: 0.8rem;
    color: #666;
    height: 100px;
    overflow-y: auto;
    line-height: 1.5;
}

.agreement-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #444;
    cursor: pointer;
}

.agreement-label input {
    width: 18px;
    height: 18px;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}