/* ==========================================================================
   AI Tâm Sự — Character.AI-inspired Design
   Light theme, sidebar layout, horizontal scroll sections
   ========================================================================== */

/* ---- CSS Variables ---- */
:root {
    --bg-primary: #f8f8fa;
    --bg-secondary: #ffffff;
    --bg-sidebar: #f0f0f4;
    --bg-card: #ffffff;
    --bg-card-hover: #f5f3ff;
    --bg-input: #f0f0f4;
    --border: #e5e5ea;
    --border-light: #efefef;
    --text-primary: #1a1a2e;
    --text-secondary: #6b6b80;
    --text-tertiary: #9e9eb0;
    --accent: #5b4dc7;
    --accent-light: #7c6df0;
    --accent-bg: rgba(91, 77, 199, 0.08);
    --accent-bg-hover: rgba(91, 77, 199, 0.12);
    --user-bubble: #5b4dc7;
    --ai-bubble: #f0f0f4;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-dropdown: 0 4px 16px rgba(0, 0, 0, 0.12);
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --sidebar-width: 260px;
    --sidebar-collapsed: 64px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---- Reset ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: var(--font);
}

/* ==========================================================================
   LAYOUT: Sidebar + Main
   ========================================================================== */

.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ---- LEFT SIDEBAR ---- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100vh;
    overflow: hidden;
    transition: width var(--transition-base);
    z-index: 50;
}

.sidebar-header {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.sidebar-logo-img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
}

.sidebar-toggle {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--bg-input);
}

/* Sidebar Nav */
.sidebar-nav {
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.sidebar-nav-item:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.sidebar-nav-item.active {
    background: var(--accent-bg);
    color: var(--accent);
}

.sidebar-nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* Sidebar Submenu */
.sidebar-nav-group { position: relative; }

.sidebar-nav-toggle {
    width: 100%;
    background: none;
    text-align: left;
    position: relative;
    cursor: pointer;
}

.sidebar-nav-link {
    flex: 1;
    color: inherit;
    text-decoration: none;
}

.sidebar-nav-arrow {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    transition: transform 0.2s;
}

.sidebar-nav-toggle.open .sidebar-nav-arrow {
    transform: rotate(90deg);
}

.sidebar-submenu {
    display: flex;
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.sidebar-submenu.open {
    max-height: 400px;
}

.sidebar-sub-item {
    display: block;
    width: 100%;
    padding: 7px 12px 7px 44px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-sub-item:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

/* Sidebar Search */
.sidebar-search {
    padding: 12px;
    flex-shrink: 0;
}

.sidebar-search input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-input);
    font-size: 0.8125rem;
    color: var(--text-primary);
    outline: none;
    font-family: var(--font);
    transition: border-color var(--transition-fast);
}

.sidebar-search input:focus {
    border-color: var(--accent);
}

.sidebar-search input::placeholder {
    color: var(--text-tertiary);
}

.sidebar-search-wrapper {
    position: relative;
}

.sidebar-search-wrapper::before {
    content: '🔍';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
}

/* Recent Chats */
.sidebar-section-label {
    padding: 12px 16px 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
}

.sidebar-chats {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px;
}

.sidebar-chats::-webkit-scrollbar {
    width: 3px;
}

.sidebar-chats::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.sidebar-chat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
    cursor: pointer;
}

.sidebar-chat-item:hover {
    background: var(--bg-input);
}

.sidebar-chat-item.active {
    background: var(--accent-bg);
}

.sidebar-chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-chat-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
    cursor: pointer;
    position: relative;
}

.sidebar-user:hover {
    background: var(--bg-input);
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-tier {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
}

/* Login btn in sidebar */
.sidebar-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    border-radius: var(--radius-md);
    background: var(--accent);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: background var(--transition-fast);
}

.sidebar-login-btn:hover {
    background: var(--accent-light);
}

/* ---- MAIN CONTENT ---- */
.main-content {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-primary);
    min-width: 0;
}

/* ==========================================================================
   HOME PAGE
   ========================================================================== */

.home-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 32px 80px;
}

.welcome-section {
    margin-bottom: 28px;
}

.welcome-greeting {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.welcome-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ---- Quick Feature Categories ---- */
.quick-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.qf-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 18px 12px 14px;
    border-radius: 16px;
    text-decoration: none;
    color: #fff;
    text-align: center;
    transition: all 0.25s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.qf-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background 0.25s;
}

.qf-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.qf-card:hover::before {
    background: rgba(255,255,255,0.08);
}

.qf-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.qf-label {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
}

.qf-desc {
    font-size: 0.65rem;
    opacity: 0.8;
    font-weight: 400;
    line-height: 1.2;
}

/* Gradient variants */
.qf-grad-1 { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.qf-grad-2 { background: linear-gradient(135deg, #ec4899, #f472b6); }
.qf-grad-3 { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.qf-grad-4 { background: linear-gradient(135deg, #0ea5e9, #38bdf8); }
.qf-grad-5 { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.qf-grad-6 { background: linear-gradient(135deg, #10b981, #34d399); }

@media (max-width: 640px) {
    .quick-features {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .qf-card { padding: 14px 8px 12px; }
    .qf-icon { font-size: 1.5rem; }
    .qf-label { font-size: 0.7rem; }
    .qf-desc { font-size: 0.6rem; }
}

/* ---- Filters Bar ---- */
.filters-bar {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ---- Section ---- */
.home-section {
    margin-bottom: 36px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.section-count {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.section-see-all {
    font-size: 0.8125rem;
    color: var(--accent);
    font-weight: 500;
}

/* ---- Horizontal Scroll ---- */
.scroll-container {
    position: relative;
}

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.scroll-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 4px 14px rgba(91, 77, 199, 0.3);
    transform: translateY(-50%) scale(1.08);
}

.scroll-btn-left {
    left: -16px;
}

.scroll-btn-right {
    right: -16px;
}

.scroll-row {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.scroll-row::-webkit-scrollbar {
    height: 0;
}

/* ---- Character Card (list style — Popular row) ---- */
.char-card-list {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    min-width: 320px;
    max-width: 380px;
    flex-shrink: 0;
    scroll-snap-align: start;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.char-card-list:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-card);
}

.char-card-list-avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
    overflow: hidden;
    background: var(--accent-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.char-card-list-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.char-card-list-info {
    flex: 1;
    min-width: 0;
}

.char-card-list-name {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 1px;
}

.char-card-list-creator {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.char-card-list-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}

.char-card-list-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.char-card-list-meta {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ---- Mini Tag Pill ---- */
.mini-tag {
    font-size: 0.625rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--accent-bg);
    color: var(--accent);
    font-weight: 500;
    white-space: nowrap;
}

/* ---- Character Grid (all characters) ---- */
.char-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}

.char-card-grid {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.char-card-grid:hover {
    border-color: var(--accent);
    box-shadow: 0 6px 24px rgba(91, 77, 199, 0.12);
    transform: translateY(-3px);
}

.card-grid-image {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--accent-bg);
}

.card-grid-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.char-card-grid:hover .card-grid-image img {
    transform: scale(1.05);
}

.card-grid-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-bg), var(--bg-input));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--accent);
}

.card-grid-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
}

.card-grid-rating {
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.card-grid-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-grid-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-grid-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-grid-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.card-grid-meta {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* ---- Scene Card (image style — tall) ---- */
.char-card-scene {
    position: relative;
    min-width: 180px;
    height: 240px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    scroll-snap-align: start;
    cursor: pointer;
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.char-card-scene:hover {
    transform: scale(1.03);
}

.char-card-scene img.scene-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.char-card-scene .scene-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-bg), var(--bg-input));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.scene-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: #fff;
}

.scene-overlay .scene-name {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.scene-overlay .scene-action {
    font-size: 0.6875rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ---- Filters ---- */
.filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.tag-filters::-webkit-scrollbar {
    height: 3px;
}

.tag-filters::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.filter-btn {
    padding: 7px 16px;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 500;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: all var(--transition-fast);
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent-bg);
    color: var(--accent);
    border-color: var(--accent);
}

/* ---- Feature Menu (Homepage) ---- */
.feature-group {
    margin-bottom: 20px;
}

.feature-group-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    padding-left: 2px;
}

.feature-cards-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.feature-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
}

.feature-card:hover {
    border-color: var(--accent);
    background: var(--accent-bg);
    color: var(--accent);
    box-shadow: 0 2px 12px rgba(91, 77, 199, 0.12);
    transform: translateY(-1px);
}

.feature-card-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.feature-card-name {
    line-height: 1;
}

/* ==========================================================================
   CHARACTER DETAIL
   ========================================================================== */

.character-detail {
    max-width: 640px;
    margin: 0 auto;
    padding: 48px 24px;
    text-align: center;
}

.detail-avatar {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-xl);
    background: var(--accent-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 20px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.detail-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-xl);
}

.character-detail h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.rating-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: var(--radius-full);
    background: var(--accent-bg);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.character-detail .description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 28px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.btn-start-chat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-full);
    font-size: 0.9375rem;
    font-weight: 600;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.btn-start-chat:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-card);
}

.skills-section {
    margin-top: 32px;
}

.skills-section h2 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.skill-badge {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: var(--accent-bg);
    font-size: 0.8125rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    font-size: 0.6875rem;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: var(--accent-bg);
    color: var(--accent);
    font-weight: 500;
}

/* ==========================================================================
   CHAT PAGE
   ========================================================================== */

.chat-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Chat header */
.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.chat-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--accent-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.chat-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-header-info h2 {
    font-size: 0.9375rem;
    font-weight: 600;
}

.chat-header-info .status {
    font-size: 0.6875rem;
    color: #22c55e;
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Messages area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--bg-primary);
    max-width: 780px;
    width: 100%;
    margin: 0 auto;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.message {
    max-width: 70%;
    animation: msgIn 0.2s ease;
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    align-self: flex-end;
}

.message.assistant {
    align-self: flex-start;
}

.message-bubble {
    padding: 10px 16px;
    border-radius: var(--radius-lg);
    font-size: 0.9375rem;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.message.user .message-bubble {
    background: var(--user-bubble);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-bubble {
    background: var(--ai-bubble);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

/* Message meta: avatar + name */
.message-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.message.user .message-meta {
    justify-content: flex-end;
}

.message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.message.user .message-avatar {
    background: var(--user-bubble);
}

.message-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Typing */
.typing-indicator {
    display: none;
    align-self: flex-start;
    padding: 12px 18px;
    background: var(--ai-bubble);
    border-radius: var(--radius-lg);
    border-bottom-left-radius: 4px;
}

.typing-indicator.active {
    display: flex;
    gap: 5px;
    align-items: center;
}

.typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-tertiary);
    animation: bounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-5px);
    }
}

/* Chat input */
.chat-input-container {
    padding: 12px 20px 20px;
    background: var(--bg-primary);
    flex-shrink: 0;
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    max-width: 760px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 6px 6px 6px 16px;
    transition: border-color var(--transition-fast);
}

.chat-input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(91, 77, 199, 0.08);
}

#chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: var(--font);
    resize: none;
    max-height: 120px;
    min-height: 36px;
    line-height: 1.5;
    padding: 6px 0;
}

#chat-input::placeholder {
    color: var(--text-tertiary);
}

.btn-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.btn-send:hover {
    background: var(--accent-light);
}

.btn-send:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Greeting */
.greeting-message {
    text-align: center;
    padding: 40px 20px;
}

.greeting-message .greeting-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--accent-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 14px;
    overflow: hidden;
}

.greeting-message h3 {
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.greeting-message p {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    max-width: 400px;
    margin: 0 auto;
}

/* Chat disclaimer */
.chat-disclaimer {
    text-align: center;
    padding: 4px 0 8px;
    font-size: 0.6875rem;
    color: var(--text-tertiary);
}

/* Rate limit / remaining */
.rate-limit-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #fff3e0;
    border: 1px solid #ffe0b2;
    border-radius: var(--radius-md);
    color: #e65100;
    font-size: 0.8125rem;
    align-self: center;
    animation: msgIn 0.2s ease;
}

.remaining-banner {
    text-align: center;
    padding: 4px 12px;
    background: var(--accent-bg);
    border-radius: var(--radius-full);
    color: var(--accent);
    font-size: 0.6875rem;
    align-self: center;
}

/* ==========================================================================
   TAROT / ZODIAC CARD DISPLAY IN CHAT
   ========================================================================== */

/* --- Tarot Card Strip --- */
.tarot-card-strip {
    align-self: flex-start;
    max-width: 90%;
    margin: 8px 0;
    animation: msgIn 0.3s ease;
}

.tarot-spread-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 10px;
    padding-left: 4px;
}

.tarot-card-row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 0 8px;
    -webkit-overflow-scrolling: touch;
}

.tarot-card-row::-webkit-scrollbar {
    height: 3px;
}

.tarot-card-row::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

/* --- Individual Tarot Card --- */
.tarot-card-item {
    flex-shrink: 0;
    width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    animation: tarotCardIn 0.4s ease both;
}

@keyframes tarotCardIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tarot-card-position {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: center;
}

.tarot-card-img-wrap {
    width: 100px;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    background: var(--accent-bg);
}

.tarot-card-img-wrap:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 20px rgba(91, 77, 199, 0.25);
}

.tarot-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Reversed card — rotate the image 180° */
.tarot-card-reversed .tarot-card-img-wrap {
    transform: rotate(180deg);
}

.tarot-card-reversed .tarot-card-img-wrap:hover {
    transform: rotate(180deg) scale(1.06);
}

.tarot-card-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.3;
}

.tarot-card-reversed-label {
    font-size: 0.625rem;
    color: #e65100;
    font-weight: 500;
}

/* --- Zodiac Card --- */
.zodiac-card {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(91, 77, 199, 0.08), rgba(91, 77, 199, 0.03));
    border: 1px solid rgba(91, 77, 199, 0.15);
    border-radius: var(--radius-lg);
    margin: 8px 0;
    max-width: 340px;
    animation: msgIn 0.3s ease;
}

.zodiac-card-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(91, 77, 199, 0.2);
    flex-shrink: 0;
}

.zodiac-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.zodiac-card-symbol {
    font-size: 1.5rem;
    line-height: 1;
}

.zodiac-card-name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
}

.zodiac-card-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Mobile responsive for tarot cards */
@media (max-width: 600px) {
    .tarot-card-strip {
        max-width: 100%;
    }

    .tarot-card-item {
        width: 100px;
    }

    .tarot-card-img-wrap {
        width: 80px;
        height: 120px;
    }

    .zodiac-card {
        max-width: 100%;
    }
}

/* ==========================================================================
   USER DROPDOWN
   ========================================================================== */

.user-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    min-width: 220px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-dropdown);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: all var(--transition-fast);
    z-index: 200;
}

.user-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dropdown-email {
    font-size: 0.75rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
}

.tier-badge {
    font-size: 0.625rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tier-free {
    background: var(--bg-input);
    color: var(--text-secondary);
}

.tier-paid {
    background: var(--accent-bg);
    color: var(--accent);
}

.tier-premium {
    background: #fff3e0;
    color: #e65100;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
}

.dropdown-item {
    display: block;
    padding: 10px 14px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    transition: background var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

/* Login dropdown */
.login-dropdown {
    min-width: 240px;
}

.dropdown-login-header {
    padding: 10px 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
}

.dropdown-oauth {
    display: flex !important;
    align-items: center;
    gap: 10px;
}

.dropdown-terms {
    padding: 8px 14px;
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    text-align: center;
    line-height: 1.5;
}

.dropdown-terms a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer {
    border-top: 1px solid var(--border-light);
    padding: 20px 0;
    text-align: center;
    background: var(--bg-secondary);
}

.footer-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 6px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.75rem;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-sep {
    color: var(--text-tertiary);
}

/* ==========================================================================
   LEGAL PAGES
   ========================================================================== */

.legal-page {
    max-width: 680px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.legal-page h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.legal-updated {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-bottom: 28px;
}

.legal-page section {
    margin-bottom: 24px;
}

.legal-page h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.legal-page p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.legal-page ul {
    padding-left: 20px;
    margin-top: 4px;
}

.legal-page li {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2px;
}

.disclaimer-highlight {
    padding: 14px 18px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.disclaimer-highlight p {
    color: #f57f17;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 24px;
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state h2 {
    font-size: 1.25rem;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.empty-state p {
    color: var(--text-tertiary);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 100;
        box-shadow: var(--shadow-dropdown);
        transition: left var(--transition-base);
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: 99;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .mobile-header {
        display: flex !important;
    }

    .message {
        max-width: 85%;
    }

    .char-card-list {
        min-width: 260px;
    }

    .char-card-scene {
        min-width: 150px;
        height: 200px;
    }

    .char-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .card-grid-body {
        padding: 10px;
    }

    .card-grid-name {
        font-size: 0.875rem;
    }

    .card-grid-desc {
        -webkit-line-clamp: 2;
    }

    .home-content {
        padding: 24px 16px 80px;
    }
}

.mobile-header {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

.mobile-menu-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.mobile-header-title {
    font-weight: 600;
    font-size: 1rem;
}

/* ==========================================================================
   SEO
   ========================================================================== */

.seo-intro {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 8px;
    max-width: 640px;
}

.seo-intro strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ==========================================================================
   CONTENT PAGES  (shared)
   ========================================================================== */

.content-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 32px 80px;
}

.content-header {
    margin-bottom: 32px;
}

.content-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.content-subtitle {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 640px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
    font-size: 0.9375rem;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 10px 24px;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: #4a3db5;
    color: #fff;
    box-shadow: 0 4px 14px rgba(91, 77, 199, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* CTA section */
.content-cta {
    text-align: center;
    padding: 40px 20px;
    margin-top: 48px;
    background: var(--accent-bg);
    border-radius: var(--radius-lg);
}

.content-cta h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.content-cta p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 0.9375rem;
}

/* ==========================================================================
   CHANGELOG
   ========================================================================== */

.changelog-timeline {
    position: relative;
    padding-left: 0;
}

.changelog-entry {
    display: flex;
    gap: 20px;
    margin-bottom: 32px;
}

.changelog-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 20px;
}

.changelog-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--accent-bg);
    flex-shrink: 0;
}

.changelog-line {
    width: 2px;
    flex: 1;
    background: var(--border-light);
    margin-top: 4px;
}

.changelog-card {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
}

.changelog-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.changelog-version {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    background: var(--accent-bg);
}

.changelog-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.changelog-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.changelog-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.changelog-items li {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 4px 0;
    padding-left: 18px;
    position: relative;
    line-height: 1.5;
}

.changelog-items li::before {
    content: "✦";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 0.65rem;
    top: 6px;
}

/* ==========================================================================
   BLOG
   ========================================================================== */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.blog-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.blog-card:hover {
    border-color: var(--accent);
    box-shadow: 0 6px 24px rgba(91, 77, 199, 0.1);
    transform: translateY(-2px);
}

.blog-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-card-body {
    padding: 16px 18px;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.blog-card-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.blog-card-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.4;
}

.blog-card-excerpt {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Article Detail ---- */
.article-page {
    max-width: 800px;
}

.article-back {
    font-size: 0.8125rem;
    color: var(--accent);
    font-weight: 500;
    display: inline-block;
    margin-bottom: 16px;
}

.article-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 12px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.article-tags {
    display: flex;
    gap: 4px;
}

.article-cover {
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 28px;
}

.article-cover img {
    width: 100%;
    height: auto;
    display: block;
}

.article-content {
    font-size: 0.9375rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.article-content h2 {
    font-size: 1.375rem;
    font-weight: 700;
    margin: 32px 0 12px;
    color: var(--text-primary);
}

.article-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 24px 0 8px;
}

.article-content p {
    margin-bottom: 16px;
}

.article-content ul,
.article-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 6px;
}

.article-content a {
    color: var(--accent);
    font-weight: 500;
}

.article-content strong {
    font-weight: 600;
}

.article-footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

/* ---- Gender Interest Modal ---- */
.gi-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.gi-overlay.open {
    display: flex;
}

.gi-modal {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 36px 32px 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: gi-pop 0.3s ease;
}

@keyframes gi-pop {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.gi-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-tertiary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.gi-close:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.gi-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.gi-brand {
    color: var(--accent);
}

.gi-header p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.gi-cards {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.gi-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 12px;
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
}

.gi-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(91, 77, 199, 0.15);
}

.gi-card.selected {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--accent), #7c6fe0);
}

.gi-card.selected .gi-card-label {
    color: #fff;
}

.gi-card-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.gi-card-label {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ---- FAQ Section ---- */
.faq-section {
    margin-top: 40px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.2s ease;
}

.faq-item:hover {
    border-color: var(--accent);
}

.faq-item[open] {
    border-color: var(--accent);
    box-shadow: 0 2px 12px rgba(91, 77, 199, 0.1);
}

.faq-question {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    user-select: none;
    gap: 12px;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::before {
    content: "▸";
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--accent);
    transition: transform 0.2s ease;
}

.faq-item[open] .faq-question::before {
    transform: rotate(90deg);
}

.faq-question:hover {
    color: var(--accent);
}

.faq-answer {
    padding: 0 18px 16px 42px;
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.faq-answer strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ---- Blog Pagination ---- */
.blog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    padding: 24px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 18px;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
}

.page-btn:hover:not(.disabled):not(.active) {
    border-color: var(--accent);
    color: #fff;
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(91, 77, 199, 0.3);
}

.page-btn.active {
    background: linear-gradient(135deg, var(--accent), #7c6fe0);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 18px rgba(91, 77, 199, 0.4);
    transform: scale(1.08);
}

.page-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: var(--bg-input);
}

.page-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 44px;
    font-size: 1rem;
    color: var(--text-tertiary);
    user-select: none;
    letter-spacing: 2px;
}

/* ==========================================================================
   TAROT
   ========================================================================== */

.tarot-section {
    margin-bottom: 48px;
}

.tarot-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.section-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.tarot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.tarot-card-item {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-fast);
    text-align: center;
}

.tarot-card-item:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(91, 77, 199, 0.12);
}

.tarot-card-image {
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: var(--accent-bg);
}

.tarot-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tarot-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--accent-bg), var(--bg-input));
}

.tarot-card-placeholder.large {
    width: 240px;
    height: 360px;
    font-size: 4rem;
    border-radius: var(--radius-lg);
}

.tarot-card-info {
    padding: 10px 8px 12px;
}

.tarot-card-number {
    font-size: 0.6875rem;
    color: var(--accent);
    font-weight: 700;
}

.tarot-card-name {
    font-size: 0.8125rem;
    font-weight: 600;
    margin: 2px 0;
    color: var(--text-primary);
}

.tarot-card-name-en {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    display: block;
    margin-bottom: 6px;
}

.tarot-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: center;
}

/* ---- Tarot Detail ---- */
.tarot-detail-header {
    display: flex;
    gap: 28px;
    margin-bottom: 32px;
    align-items: flex-start;
}

.tarot-detail-image {
    flex-shrink: 0;
}

.tarot-detail-image img {
    width: 240px;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.tarot-detail-info h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.tarot-name-en {
    font-size: 1rem;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.tarot-card-number.large {
    font-size: 0.8125rem;
    display: inline-block;
    padding: 2px 10px;
    background: var(--accent-bg);
    border-radius: var(--radius-full);
    margin-bottom: 8px;
}

.tarot-meaning {
    margin-bottom: 28px;
}

.tarot-meaning h2 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.tarot-meaning p {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* ==========================================================================
   ZODIAC
   ========================================================================== */

.zodiac-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
}

.zodiac-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-fast);
    text-align: center;
}

.zodiac-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(91, 77, 199, 0.12);
}

.zodiac-card-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--accent-bg);
}

.zodiac-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.zodiac-symbol {
    font-size: 4rem;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-bg), var(--bg-input));
}

.zodiac-symbol.large {
    width: 200px;
    height: 200px;
    border-radius: var(--radius-lg);
    font-size: 5rem;
}

.zodiac-card-body {
    padding: 14px 12px 16px;
}

.zodiac-symbol-small {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 4px;
}

.zodiac-card-name {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.zodiac-card-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    display: block;
    margin-bottom: 4px;
}

.zodiac-card-element {
    font-size: 0.6875rem;
    color: var(--accent);
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

.zodiac-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}

/* ---- Zodiac Detail ---- */
.zodiac-detail-header {
    display: flex;
    gap: 28px;
    margin-bottom: 32px;
    align-items: flex-start;
}

.zodiac-detail-image {
    flex-shrink: 0;
}

.zodiac-detail-image img {
    width: 200px;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.zodiac-detail-info h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.zodiac-name-en {
    font-size: 1rem;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.zodiac-symbol-badge {
    font-size: 2rem;
    margin-bottom: 8px;
}

.zodiac-meta-grid {
    display: flex;
    gap: 20px;
    margin-top: 12px;
}

.zodiac-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.zodiac-meta-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.zodiac-meta-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.zodiac-section {
    margin-bottom: 28px;
}

.zodiac-section h2 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.zodiac-section p {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.zodiac-traits-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.trait-pill {
    padding: 6px 16px;
    border-radius: var(--radius-full);
    background: var(--accent-bg);
    color: var(--accent);
    font-size: 0.8125rem;
    font-weight: 500;
}

/* ==========================================================================
   RESPONSIVE — Content Pages
   ========================================================================== */

@media (max-width: 768px) {
    .content-page {
        padding: 24px 16px 80px;
    }

    .content-header h1 {
        font-size: 1.375rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .tarot-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
    }

    .zodiac-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .tarot-detail-header,
    .zodiac-detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .tarot-detail-image img {
        width: 180px;
    }

    .zodiac-detail-image img {
        width: 150px;
    }

    .tarot-keywords,
    .zodiac-traits {
        justify-content: center;
    }

    .article-footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
}