/* Unsecat Design System */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.6/dist/web/variable/pretendardvariable.css");
@import url("https://fonts.googleapis.com/css2?family=Gowun+Batang:wght@400;700&family=Playfair+Display:wght@600;700&display=swap");

:root {
    /* Typography */
    --font-sans: "Pretendard Variable", "SUIT", "Noto Sans KR", "Apple SD Gothic Neo", "Segoe UI", sans-serif;
    --font-serif: "Gowun Batang", "Noto Serif KR", serif;
    --font-display: "Playfair Display", "Pretendard Variable", serif;

    /* Brand palette for chubby-but-sharp fortune cat */
    --brand-ink: #241726;
    --brand-plum: #4c2c50;
    --brand-rose: #e9a3a1;
    --brand-petal: #d95a8a;
    --brand-blush: #f7e3dd;
    --brand-cream: #fff9f3;
    --brand-mint: #81c7bd;
    --brand-gold: #d9b36f;
    --brand-silver: #c8c2c8;
    --brand-shadow: 0 18px 45px rgba(36, 23, 38, 0.18);
    --brand-border: rgba(76, 44, 80, 0.12);
    --brand-glass: rgba(255, 249, 243, 0.08);

    /* Semantic tokens */
    --text-primary: var(--brand-ink);
    --text-muted: #6f6472;
    --surface: #fff9f3;
    --surface-alt: #fff2e8;
    --surface-soft: #fff8f2;
    --line-soft: rgba(36, 23, 38, 0.08);
    --gradient-hero:
        radial-gradient(circle at 18% 20%, rgba(233, 163, 161, 0.25), transparent 32%),
        radial-gradient(circle at 78% 16%, rgba(129, 199, 189, 0.24), transparent 28%),
        radial-gradient(circle at 80% 70%, rgba(76, 44, 80, 0.2), transparent 35%),
        linear-gradient(160deg, #fff3eb 0%, #f6d7d0 38%, #f3c5c3 70%, #3c253d 100%);

    /* Legacy compatibility */
    --primary-color: var(--brand-plum);
    --secondary-color: #6c757d;
    --success-color: #56b88a;
    --danger-color: #d16060;
    --warning-color: var(--brand-gold);
    --info-color: #5fb4d6;

    /* Ensure Bootstrap uses our font stack */
    --bs-body-font-family: var(--font-sans);
}

/* Body */
html, body {
    height: 100%;
    min-height: 100vh;
    overscroll-behavior: none;
    background-color: #fdf0e8;
    background-image: radial-gradient(circle at 12% 18%, rgba(233, 163, 161, 0.18), transparent 30%),
        radial-gradient(circle at 82% 8%, rgba(129, 199, 189, 0.16), transparent 30%),
        radial-gradient(circle at 80% 72%, rgba(76, 44, 80, 0.08), transparent 32%),
        linear-gradient(180deg, #fffdf9 0%, #fff6ed 30%, #fdf0e8 100%);
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: scroll;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
    font-family: var(--font-sans);
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

body.fortuna-surface {
    color: var(--text-primary);
}

/* Ensure new UI pieces inherit brand font without per-component overrides */
body, button, input, select, textarea, .btn, .offcanvas {
    font-family: var(--font-sans);
}

main {
    flex: 1;
}

main.py-5 {
    padding-top: 4rem !important;
    padding-bottom: 4rem !important;
}

/* Design utilities */
.font-serif {
    font-family: var(--font-serif);
}

.text-plum {
    color: var(--brand-plum) !important;
}

.eyebrow {
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    color: var(--text-muted);
}

/* 고운바탕체 섹션 내 heading 상속 보장 */
.navbar-glass h1, .navbar-glass h2, .navbar-glass h3, .navbar-glass h4, .navbar-glass h5, .navbar-glass h6,
.auth-shell h1, .auth-shell h2, .auth-shell h3, .auth-shell h4, .auth-shell h5, .auth-shell h6,
.account-shell h1, .account-shell h2, .account-shell h3, .account-shell h4, .account-shell h5, .account-shell h6,
.history-shell h1, .history-shell h2, .history-shell h3, .history-shell h4, .history-shell h5, .history-shell h6,
.community-feed h1, .community-feed h2, .community-feed h3, .community-feed h4, .community-feed h5, .community-feed h6 {
    font-family: var(--font-serif);
}

/* Navigation */
.navbar-glass {
    background: linear-gradient(135deg, rgba(44, 27, 51, 0.96), rgba(36, 23, 38, 0.92));
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.28);
    margin-bottom: 1.25rem;
    position: relative;
    font-family: var(--font-serif);
}

/* 네비게이션 꾹꾹이 아이콘 */
.nav-paw-icon {
    width: 38px;
    height: 38px;
}

/* 네비게이션 로고 */
.nav-logo {
    border-radius: 10px;
}

.nav-drawer-toggle {
    width: 42px;
    height: 42px;
    border: none;
    background: transparent;
    color: #fff;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: transform 0.2s ease, opacity 0.2s ease;
    padding: 0;
}

.nav-drawer-toggle:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.nav-actions {
    gap: 0.75rem;
}

.navbar-brand {
    font-size: 1.4rem;
    letter-spacing: -0.4px;
    color: #fef7f0 !important;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.navbar-glass .nav-link {
    color: rgba(255, 248, 243, 0.78);
    font-weight: 600;
    letter-spacing: -0.1px;
    border-radius: 12px;
    padding: 0.45rem 0.75rem;
    transition: color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.navbar-glass .nav-link:hover,
.navbar-glass .nav-link:focus {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

/* Consultation Drawer */
.consultation-drawer {
    width: min(420px, 90vw);
    background: #fff9f3;
    border-right: 1px solid var(--brand-border);
    box-shadow: 16px 0 60px rgba(36, 23, 38, 0.18);
    font-family: var(--font-serif);
}

.consultation-drawer .offcanvas-header {
    border-bottom: 1px solid var(--brand-border);
    padding: 12px 16px;
}

.drawer-paw {
    width: 28px;
    height: 28px;
}

.drawer-title-wrap {
    gap: 0.5rem;
}

.drawer-title {
    font-weight: 800;
    letter-spacing: -0.3px;
    font-family: var(--font-serif);
}

.drawer-section {
    background: #ffffff;
    border: 1px solid var(--brand-border);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 14px 40px rgba(36, 23, 38, 0.08);
    margin-bottom: 16px;
    font-family: var(--font-serif);
}

.drawer-section-title {
    font-weight: 700;
    color: var(--brand-ink);
    font-family: var(--font-serif);
    letter-spacing: -0.2px;
}

.consultation-drawer .btn {
    font-family: var(--font-serif);
}

.drawer-link {
    color: var(--brand-plum);
    font-weight: 600;
}

.drawer-link:hover {
    color: #2c1b33;
}

.drawer-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 14px;
    font-weight: 700;
    letter-spacing: -0.2px;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
    font-family: var(--font-serif);
}

.drawer-cta.primary {
    background: linear-gradient(135deg, var(--brand-rose), var(--brand-plum));
    color: #fff;
    border: 1px solid rgba(76, 44, 80, 0.35);
    box-shadow: 0 10px 28px rgba(76, 44, 80, 0.22);
}

.drawer-cta.outline {
    background: #fffdf9;
    color: var(--brand-ink);
    border: 1px solid var(--brand-border);
}

.drawer-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(36, 23, 38, 0.14);
}

.drawer-state {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px;
    border-radius: 10px;
    background: rgba(76, 44, 80, 0.04);
    color: var(--text-muted);
}

.drawer-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.drawer-history-item {
    width: 100%;
    text-align: left;
    border: 1px solid var(--brand-border);
    background: #fffdf9;
    border-radius: 12px;
    padding: 12px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.drawer-history-item:hover {
    border-color: rgba(76, 44, 80, 0.24);
    box-shadow: 0 12px 30px rgba(36, 23, 38, 0.08);
    transform: translateY(-1px);
}

.drawer-history-item.selected {
    border-color: rgba(76, 44, 80, 0.4);
    box-shadow: 0 12px 30px rgba(36, 23, 38, 0.12);
    background: #fff6ec;
}

.drawer-history-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.drawer-history-title {
    font-weight: 700;
    color: var(--brand-ink);
    letter-spacing: -0.1px;
    font-family: var(--font-serif);
}

.drawer-history-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.drawer-history-meta .dot {
    color: rgba(36, 23, 38, 0.2);
}

.drawer-refresh {
    color: var(--brand-plum);
}

.drawer-checkbox-wrap {
    display: none;
    align-items: center;
    justify-content: center;
}

.drawer-history-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1px solid rgba(76, 44, 80, 0.25);
    box-shadow: none;
}

.drawer-history-item.selected .drawer-history-checkbox {
    background-color: var(--brand-plum);
    border-color: var(--brand-plum);
}

.drawer-edit-bar {
    background: #fff7f2;
    border: 1px solid rgba(76, 44, 80, 0.14);
    border-radius: 12px;
    padding: 12px 12px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.drawer-edit-main {
    flex: 1;
}

.drawer-edit-action {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.drawer-edit-action:hover {
    color: var(--brand-plum);
    background: rgba(76, 44, 80, 0.06);
}

.drawer-edit-action:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.drawer-edit-action:disabled:hover {
    color: var(--text-muted);
    background: transparent;
}

#drawerEditActions .form-check-input.drawer-select-all {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1px solid rgba(76, 44, 80, 0.25);
    box-shadow: none;
    accent-color: var(--brand-plum);
}

#drawerEditActions .form-check-input.drawer-select-all:checked {
    background-color: var(--brand-plum);
    border-color: var(--brand-plum);
}

.drawer-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.drawer-more {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 4px;
}

.drawer-more:hover {
    color: var(--brand-plum);
}

.drawer-more-icon {
    font-size: 1.15rem;
}

.drawer-more-menu {
    position: absolute;
    z-index: 1055;
    background: #fff;
    border: 1px solid var(--brand-border);
    box-shadow: 0 12px 30px rgba(36, 23, 38, 0.12);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    min-width: 140px;
    overflow: hidden;
}

.drawer-more-menu button {
    background: none;
    border: none;
    padding: 10px 12px;
    text-align: left;
    font-size: 0.95rem;
    color: var(--brand-ink);
    transition: background 0.15s ease;
}

.drawer-more-menu button:hover {
    background: rgba(76, 44, 80, 0.06);
}

.drawer-pin {
    color: #f59e0b;
    margin-left: 6px;
    font-size: 0.95rem;
}

.drawer-guest .btn {
    border-radius: 10px;
}

.usage-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.usage-meta-pill {
    background: rgba(76, 44, 80, 0.08);
    color: var(--brand-ink);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 0.82rem;
    letter-spacing: -0.1px;
}

/* Footer */
.footer {
    background: linear-gradient(180deg, #2c1b33 0%, #241726 80%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 248, 243, 0.9);
    position: relative;
}

.footer-glass {
    backdrop-filter: blur(12px);
}

/* Cards */
.card {
    border-radius: 18px;
    border: 1px solid var(--brand-border);
    box-shadow: var(--brand-shadow);
    background: #ffffff;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(36, 23, 38, 0.18);
}

/* Form Elements */
.form-control,
input,
select,
textarea,
button {
    font-family: var(--font-sans);
}

.form-control {
    border-radius: 12px;
    border: 1px solid var(--line-soft);
    background-color: #fff;
    padding: 0.65rem 0.9rem;
    color: var(--text-primary);
}

.form-control:focus {
    border-color: var(--brand-rose);
    box-shadow: 0 0 0 0.2rem rgba(233, 163, 161, 0.25);
}

/* Buttons */
.btn {
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: -0.2px;
    transition: all 0.25s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-rose) 0%, var(--brand-plum) 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(233, 163, 161, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 36px rgba(76, 44, 80, 0.3);
}

.btn-outline-light {
    border-color: var(--brand-border);
    color: var(--text-primary);
    background: #fff;
}

.btn-outline-light:hover {
    background: var(--brand-blush);
    color: var(--brand-ink);
    border-color: rgba(76, 44, 80, 0.2);
}

.btn-lg {
    font-size: 1.05rem;
    padding: 0.9rem 1.6rem;
}

/* Badges & Pills */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    background: var(--brand-blush);
    border-radius: 999px;
    color: var(--brand-ink);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Loading Spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--brand-plum);
}

/* Utilities */
.text-primary {
    color: var(--brand-plum) !important;
}

.text-dark {
    color: var(--brand-ink) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.bg-primary {
    background-color: var(--brand-plum) !important;
}

.section-title {
    font-family: var(--font-display);
    letter-spacing: -0.4px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    letter-spacing: -0.02em;
}

/* Hero & storytelling components */
.hero-section {
    background: var(--gradient-hero);
    position: relative;
    color: var(--brand-ink);
}

.hero-background {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.element {
    position: absolute;
    font-size: 3rem;
    font-weight: 700;
    opacity: 0.12;
    animation: float-element 22s infinite ease-in-out;
    font-family: var(--font-display);
}

.element-1 {
    top: 12%;
    left: 10%;
    animation-delay: 0s;
    color: var(--brand-mint);
}

.element-2 {
    top: 24%;
    right: 14%;
    animation-delay: 4s;
    color: var(--brand-rose);
}

.element-3 {
    bottom: 32%;
    left: 22%;
    animation-delay: 8s;
    color: var(--brand-gold);
}

.element-4 {
    top: 60%;
    right: 26%;
    animation-delay: 12s;
    color: var(--brand-silver);
}

.element-5 {
    bottom: 16%;
    right: 10%;
    animation-delay: 16s;
    color: #7ca6c7;
}

.current-moment {
    animation: ds-fade-in 1.5s ease-in;
}

.moment-text {
    font-family: var(--font-sans);
    font-weight: 800;
    letter-spacing: 0.15em;
    color: var(--brand-petal);
}

.moment-time {
    font-weight: 600;
    margin: 0;
    font-size: 1.35rem;
}

.moment-element {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--brand-plum);
}

.hero-title {
    font-family: var(--font-serif);
    font-weight: 700;
    color: var(--brand-plum);
    letter-spacing: -0.02em;
    word-break: keep-all;
    text-shadow: 0 2px 0 rgba(255, 255, 255, 0.5);
}

.hero-subtitle {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 1.25rem;
    color: #6f5e76;
    margin-top: 1rem;
}

.birth-input {
    font-family: var(--font-serif) !important;
    color: var(--brand-plum) !important;
    font-weight: 700;
    height: 58px;
    width: 100%;
}

.birth-unknown-toggle .form-check-input {
    width: 2.4em;
    height: 1.3em;
}

.birth-unknown-toggle .form-check-label {
    font-family: var(--font-serif);
}

.birth-input::placeholder {
    font-family: var(--font-serif);
    color: #9e8fa3;
    font-weight: 500;
}

.birth-label {
    font-family: var(--font-serif);
    color: #3c253d;
    font-weight: 700;
    opacity: 0.8;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.4);
    font-size: 0.875rem;
    line-height: 1.4;
}

/* 라벨 영역 높이 통일 - 모름 토글이 없는 필드도 같은 높이 유지 */
.birth-field > .birth-label {
    min-height: 24px;
    display: flex;
    align-items: center;
}

/* 태어난 시각 필드의 라벨+모름 토글 래퍼 */
.birth-field .d-flex.justify-content-between {
    width: 100%;
    min-height: 24px;
}

.birth-unknown-toggle {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.birth-input:focus {
    color: var(--brand-ink) !important;
    border-color: var(--brand-petal);
}

.birth-inline-row .birth-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.birth-toggle {
    display: flex;
    border: 1px solid rgba(76, 44, 80, 0.25);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    width: 100%;
    padding: 0;
}

.birth-toggle-btn {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--brand-ink);
    padding: 0.6rem 0.5rem;
    font-weight: 700;
    letter-spacing: -0.1px;
    font-family: var(--font-serif);
    text-align: center;
    margin: 0;
    border-radius: 0;
}

.birth-toggle .btn-check:checked + .birth-toggle-btn {
    background: linear-gradient(135deg, #eeb7b3, #4c2c50);
    color: #fff;
}

/* 첫 번째와 마지막 버튼에 라운드 적용 */
.birth-toggle .btn-check:first-of-type + .birth-toggle-btn {
    border-radius: 13px 0 0 13px;
}

.birth-toggle .birth-toggle-btn:last-of-type {
    border-radius: 0 13px 13px 0;
}

.birth-toggle-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 1rem;
    justify-content: stretch;
    align-items: flex-start;
    margin-bottom: 1.5rem !important;
    width: 100%;
}

.birth-toggle-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    flex: 1;
}

.birth-toggle-group .birth-label {
    text-align: center;
}

.birth-input-container {
    max-width: 720px;
    margin: 0 auto;
}

.birth-inline-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 1rem;
    justify-content: stretch;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    width: 100%;
}

.birth-input-container .birth-inline-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 1rem;
    justify-content: stretch;
    align-items: flex-start;
    width: 100%;
}

/* Quick fortune form layout */
.birth-input-container {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(14px);
    border-radius: 20px;
    padding: 1.6rem 1.25rem;
    box-shadow: 0 18px 50px rgba(36, 23, 38, 0.2);
}

.mystical-btn {
    font-family: var(--font-serif);
    background: linear-gradient(135deg, #eeb7b3 0%, #4c2c50 100%);
    border: none;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.35s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 14px 32px rgba(233, 163, 161, 0.35);
}

.mystical-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(76, 44, 80, 0.35);
}

.mystical-btn::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.mystical-btn:hover::before {
    width: 320px;
    height: 320px;
}

.btn-text {
    position: relative;
    z-index: 1;
}

.animate-float-slow {
    animation: float-slow 8s ease-in-out infinite;
}

.smooth-scroll {
    transition: opacity 0.3s ease;
}

.smooth-scroll:hover {
    opacity: 1 !important;
}

.animate-fade-in {
    animation: ds-fade-in 1.5s ease-in;
}

.feature-card {
    padding: 1.5rem;
    border-radius: 18px;
    border: 1px solid var(--brand-border);
    box-shadow: 0 12px 32px rgba(36, 23, 38, 0.08);
    background: #ffffff;
    font-family: var(--font-serif);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--brand-blush);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--brand-plum);
    margin-bottom: 1rem;
}

.feature-card-rose {
    background: #fff8f8;
}

.feature-card-mist {
    background: #f4f7f6;
}

.feature-card-sun {
    background: #fffaf0;
}

.community-feed {
    background: linear-gradient(180deg, rgba(247, 227, 221, 0.7), rgba(255, 249, 243, 0.4));
    padding-bottom: 5rem;
    font-family: var(--font-serif);
}

.community-feed h2,
.community-feed p,
.community-feed .feed-eyebrow {
    font-family: var(--font-serif);
}

.feed-eyebrow {
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: #6f6472;
}

/* Fortune Carousel - Use serif font (Gowun Batang) */
.fortune-carousel,
.fortune-card,
.fortune-card p,
.chat-bubble,
.chat-bubble p,
.badge-case,
.chat-label,
.chat-tip,
.keyword {
    font-family: var(--font-serif);
}

.fortune-carousel .carousel-indicators [data-bs-target] {
    background-color: #4c2c50;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    opacity: 0.35;
}

.fortune-carousel .carousel-indicators {
    position: static;
    margin-top: 1.25rem;
    gap: 10px;
}

.fortune-carousel .carousel-indicators .active {
    opacity: 1;
}

.fortune-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 1.75rem;
    border: 1px solid rgba(76, 44, 80, 0.12);
    box-shadow: 0 15px 35px rgba(36, 23, 38, 0.12);
    position: relative;
    overflow: hidden;
}

.fortune-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 10%, rgba(233, 163, 161, 0.16), transparent 42%);
    pointer-events: none;
}

.fortune-header {
    margin-bottom: 1rem;
}

.fortune-avatar {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #eeb7b3, #4c2c50);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    overflow: hidden;
}

.fortune-avatar img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.badge-case {
    font-size: 0.95rem;
    font-weight: 700;
    color: #4c2c50;
    margin: 0;
}

.chat-bubbles {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-bottom: 1.25rem;
}

.chat-bubble {
    border-radius: 14px;
    padding: 1rem 1.1rem;
    position: relative;
    background: #f8f4f5;
    border: 1px solid rgba(76, 44, 80, 0.08);
}

.chat-bubble p {
    margin-bottom: 0;
}

.chat-bubble.me {
    background: #fff;
    border: 1px solid rgba(76, 44, 80, 0.1);
}

.chat-bubble.cat {
    background: linear-gradient(135deg, rgba(238, 183, 179, 0.25), rgba(255, 255, 255, 0.85));
    border: 1px solid rgba(76, 44, 80, 0.16);
}

.chat-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #4c2c50;
    margin-bottom: 0.3rem;
    letter-spacing: 0.02em;
}

.chat-tip {
    font-weight: 600;
    color: #4c2c50;
}

.keyword {
    color: #d95a8a;
    font-weight: 800;
    background: rgba(217, 90, 138, 0.12);
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
}

.btn-outline-brand {
    border: 1.5px solid #4c2c50;
    color: #4c2c50;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.6rem 1.25rem;
    transition: all 0.2s ease;
    font-family: var(--font-serif);
}

.btn-outline-brand:hover {
    background: linear-gradient(135deg, #eeb7b3, #4c2c50);
    color: #fff;
    box-shadow: 0 10px 26px rgba(76, 44, 80, 0.25);
}

.display-6 {
    font-weight: 700;
    letter-spacing: -1px;
    font-family: var(--font-serif);
}

.lead {
    font-size: 1.15rem;
    font-weight: 400;
    font-family: var(--font-serif);
}

.heading-serif {
    font-family: var(--font-serif);
    letter-spacing: -0.02em;
}

/* Auth & account */
.account-shell {
    font-family: var(--font-serif);
}

.account-shell .btn {
    font-family: var(--font-serif);
}

.glass-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--brand-border);
    box-shadow: 0 12px 28px rgba(36, 23, 38, 0.12);
    border-radius: 16px;
    backdrop-filter: blur(12px);
}

.auth-shell {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    font-family: var(--font-serif);
}

.auth-card {
    max-width: 480px;
    width: 100%;
    padding: 3rem;
    text-align: center;
}

.auth-logo {
    width: 96px;
    height: 96px;
    margin-bottom: 1.5rem;
}

.account-logout {
    color: #a69a96;
    font-size: 0.82rem;
    text-decoration: none;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-family: var(--font-serif);
}

.account-logout:hover,
.account-logout:focus {
    color: #8a7f7a;
    text-decoration: none;
    background: rgba(166, 154, 150, 0.12);
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--brand-ink);
    margin-bottom: 0.75rem;
}

.auth-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 2rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    gap: 0.75rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--brand-border);
}

.auth-features {
    text-align: left;
    margin-top: 2rem;
}

.auth-feature-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.auth-feature-icon {
    width: 20px;
    height: 20px;
    color: var(--brand-rose);
}

.auth-error {
    background: rgba(217, 90, 138, 0.1);
    border: 1px solid rgba(217, 90, 138, 0.25);
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 1.25rem;
    color: var(--brand-petal);
    font-size: 0.95rem;
    display: none;
}

.auth-loading {
    display: none;
    margin-top: 1.25rem;
}

.auth-spinner {
    border: 3px solid rgba(76, 44, 80, 0.12);
    border-top: 3px solid var(--brand-rose);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.glass-card .badge {
    font-weight: 700;
}

/* Consultation history */
.history-shell {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    font-family: var(--font-serif);
}

.history-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--brand-ink);
    margin-bottom: 0.25rem;
}

.history-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
}

.history-header {
    margin-bottom: 2rem;
}

.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.session-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(36, 23, 38, 0.08);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.session-card:hover {
    border-color: var(--brand-rose);
    box-shadow: 0 16px 42px rgba(76, 44, 80, 0.12);
    transform: translateY(-2px);
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.session-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.session-birth-info {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-ink);
}

.session-date {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.session-delete-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.session-delete-btn:hover {
    background: rgba(233, 163, 161, 0.15);
    color: var(--brand-rose);
}

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

.session-meta {
    display: flex;
    gap: 12px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.session-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.history-state {
    text-align: center;
    padding: 60px 20px;
}

.history-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(76, 44, 80, 0.12);
    border-top-color: var(--brand-rose);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

.history-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.history-empty-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-ink);
    margin-bottom: 0.5rem;
}

.history-empty-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOpacity {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes ds-fade-in {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float-element {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.07;
    }
    25% {
        transform: translate(18px, -28px) rotate(4deg);
        opacity: 0.18;
    }
    50% {
        transform: translate(-24px, -46px) rotate(-4deg);
        opacity: 0.12;
    }
    75% {
        transform: translate(26px, -12px) rotate(2deg);
        opacity: 0.16;
    }
}

@keyframes float-slow {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

@keyframes pulse-input {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 0 20px 5px rgba(102, 126, 234, 0.2);
    }
}

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

.card {
    animation: fadeIn 0.5s ease;
}

.hero-section {
    animation: fadeOpacity 0.5s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.25rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

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

    .birth-input {
        font-size: 1.2rem;
        width: 90px;
    }

    .element {
        font-size: 2rem;
    }

    .fortune-card {
        padding: 1.2rem;
    }

    .fortune-avatar {
        width: 44px;
        height: 44px;
    }

    .chat-bubble {
        padding: 0.9rem 1rem;
    }
}

@media (max-width: 576px) {
    .card-body {
        padding: 1.5rem !important;
    }

    .btn-lg {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .birth-input {
        font-size: 1rem;
        width: 100%;
        max-width: none;
        padding: 0.85rem 0.95rem;
    }

    .birth-toggle-row {
        flex-wrap: nowrap;
        gap: 0.75rem;
    }

    .birth-toggle-btn {
        padding: 0.5rem 0.5rem;
        font-size: 0.85rem;
    }

    .birth-inline-row,
    .birth-input-container .birth-inline-row {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .birth-inline-row .birth-field {
        width: 100%;
        max-width: none;
    }

    .birth-field .d-flex.justify-content-between {
        margin-bottom: 0.35rem;
    }

    .birth-unknown-toggle .form-check-input {
        width: 2em;
        height: 1.1em;
    }

    .birth-unknown-toggle .form-check-label {
        font-size: 0.75rem;
    }

    #revealBtn {
        width: 100%;
        font-size: 1.05rem;
        padding: 0.9rem 1.2rem;
        letter-spacing: 0.01em;
    }

    /* 로그인 페이지 모바일 반응형 */
    .auth-card {
        padding: 2rem 1.5rem;
    }

    .auth-title {
        font-size: 1.4rem;
    }

    .auth-logo {
        width: 72px;
        height: 72px;
    }

    .g_id_signin {
        width: 100% !important;
        max-width: 100% !important;
    }

    .g_id_signin iframe {
        width: 100% !important;
        max-width: 100% !important;
    }

    .g_id_signin > div {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* =============================================
   운세냥이 커스텀 알림 (Nyang Alert)
   ============================================= */
.nyang-alert-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.nyang-alert-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.nyang-alert-overlay.is-closing {
    opacity: 0;
}

.nyang-alert-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(76, 44, 80, 0.4);
    backdrop-filter: blur(4px);
}

.nyang-alert-dialog {
    position: relative;
    background: #fffcfa;
    border-radius: 20px;
    padding: 28px 32px;
    width: min(340px, 88vw);
    text-align: center;
    box-shadow: 0 20px 50px rgba(76, 44, 80, 0.2);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nyang-alert-overlay.is-visible .nyang-alert-dialog {
    transform: scale(1) translateY(0);
}

.nyang-alert-overlay.is-closing .nyang-alert-dialog {
    transform: scale(0.95) translateY(10px);
}

.nyang-alert-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-plum);
    margin: 0 0 8px;
}

.nyang-alert-message {
    font-family: var(--font-sans);
    font-size: 15px;
    color: #6f6472;
    margin: 0 0 24px;
    line-height: 1.6;
    word-break: keep-all;
}

.nyang-alert-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    padding: 14px 32px;
    border: none;
    border-radius: 12px;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--brand-plum);
    color: white;
    box-shadow: 0 4px 14px rgba(76, 44, 80, 0.25);
}

.nyang-alert-btn:hover {
    background: #5d3860;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(76, 44, 80, 0.3);
}

.nyang-alert-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(233, 163, 161, 0.4), 0 4px 14px rgba(76, 44, 80, 0.25);
}

.nyang-alert-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.nyang-prompt-input {
    width: 100%;
    border: 1px solid var(--brand-border, rgba(76, 44, 80, 0.2));
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 15px;
    color: var(--brand-ink);
    background: #fff;
    outline: none;
}

.nyang-prompt-input:focus {
    border-color: var(--brand-plum);
    box-shadow: 0 0 0 3px rgba(233, 163, 161, 0.2);
}

body.nyang-alert-open {
    overflow: hidden;
}
