:root {
    --bg-color: #0d0d12;
    --card-bg: rgba(255, 255, 255, 0.04);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary-text: #ffffff;
    --secondary-text: rgba(255, 255, 255, 0.6);
    --accent-color: #b088ff;
    --accent-gradient: linear-gradient(135deg, #b088ff 0%, #7e5bef 100%);
    --premium-gold: #ffd700;
    --safe-area-inset-top: env(safe-area-inset-top, 0px);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
    --bottom-nav-height: 64px;
    --bottom-nav-offset: 20px;
}

/* ── Override ALL Telegram WebApp SDK theme variables ─────────────────── */
:root {
    --tg-theme-bg-color: #0d0d12 !important;
    --tg-theme-text-color: #ffffff !important;
    --tg-theme-hint-color: rgba(255,255,255,0.6) !important;
    --tg-theme-link-color: #b088ff !important;
    --tg-theme-button-color: #b088ff !important;
    --tg-theme-button-text-color: #ffffff !important;
    --tg-theme-secondary-bg-color: #0d0d12 !important;
    --tg-color-scheme: dark !important;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    background-color: #0d0d12 !important;
    color: #ffffff !important;
}

body {
    background-color: #0d0d12 !important;
    color: #ffffff !important;
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
    user-select: none;
    transition: opacity 0.3s ease;
}

/* Force text color on all common text elements */
p, span, div, li, h1, h2, h3, h4, h5, h6, label, small, strong, em, a {
    color: inherit;
}

/* Prevent Telegram from making text invisible — force white on containers */
.card, .card-body, .card-header, .tab-content, #app, .content {
    color: #ffffff !important;
}
/* Restore secondary/muted hierarchy inside cards (override the !important above) */
.muted-line,
.placeholder-text,
.personal-note,
.report-expand-meta,
.conn-zodiac,
.report-action small,
.conn-info small,
.credit-ledger-row small,
.connection-prompt,
.lunar-block-label {
    color: var(--secondary-text) !important;
}

body.loading {
    opacity: 1;
}

#app {
    padding: calc(20px + var(--safe-area-inset-top)) 20px calc(80px + var(--safe-area-inset-bottom));
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
    min-height: 0;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(126, 91, 239, 0.3);
    overflow: hidden; /* For image */
}

.avatar-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.text-info h1 {
    font-size: 18px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
}

.zodiac-badge {
    font-size: 13px;
    color: var(--secondary-text);
}

.premium-status {
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255, 215, 0, 0.15);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    border: 1px solid rgba(255, 215, 0, 0.4);
    color: var(--premium-gold);
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin-bottom: 16px;
    overflow: hidden;
}

.card-header {
    padding: 20px 20px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(176, 136, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
}

.icon-wrapper i {
    width: 20px;
    height: 20px;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
}

.card-body {
    padding: 0 20px 20px;
}

.card-body p {
    font-size: 15px;
    color: var(--secondary-text);
    line-height: 1.6;
}

.skeleton-line {
    width: 72%;
    height: 12px;
    border-radius: 999px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, rgba(255,255,255,0.06), rgba(176,136,255,0.18), rgba(255,255,255,0.06));
    background-size: 220% 100%;
    animation: skeletonPulse 1.4s ease infinite;
}

.skeleton-line.wide {
    width: 100%;
}

.boot-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 14px;
}

.boot-steps span {
    border-radius: 999px;
    padding: 6px 8px;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.42);
    font-size: 10px;
    text-align: center;
}

.boot-steps span.active {
    color: var(--primary-text);
    background: rgba(176,136,255,0.22);
}

.boot-steps span.done {
    color: rgba(255,255,255,0.72);
    background: rgba(85,216,138,0.16);
}

body:not(.loading) .skeleton-line {
    display: none;
}

@keyframes skeletonPulse {
    from { background-position: 120% 0; }
    to { background-position: -120% 0; }
}

/* Grid layout */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.stat-card {
    padding: 20px;
    text-align: center;
}

.stat-card .icon-wrapper {
    margin: 0 auto 12px;
}

.stat-card h4 {
    font-size: 13px;
    color: var(--secondary-text);
    font-weight: 400;
    margin-bottom: 4px;
}

.stat-card p {
    font-size: 16px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
}

.moon-icon { background: rgba(100, 150, 255, 0.15); color: #6496ff; }
.fire-icon { background: rgba(255, 100, 100, 0.15); color: #ff6464; }
.focus-icon { background: rgba(85, 216, 138, 0.12); color: #55d88a; }

.focus-card {
    background:
        radial-gradient(circle at 10% 0%, rgba(85,216,138,0.14), transparent 34%),
        var(--card-bg);
}

.muted-line {
    margin-top: 8px;
    color: rgba(255,255,255,0.48) !important;
}

.quick-actions-card {
    padding: 16px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.quick-action {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    background: rgba(255,255,255,0.05);
    color: var(--primary-text);
    padding: 12px 10px;
    font-family: inherit;
    font-weight: 700;
    font-size: 12px;
}

.personal-note {
    color: var(--secondary-text);
    font-size: 13px;
}

.home-progress-card,
.premium-value-card {
    padding: 18px;
}

.progress-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.progress-grid div {
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 16px;
    padding: 12px;
    background: rgba(255,255,255,0.035);
}

.progress-grid span {
    display: block;
    color: var(--secondary-text);
    font-size: 11px;
    margin-bottom: 4px;
}

.progress-grid strong {
    display: block;
    font-size: 16px;
    font-family: 'Outfit', sans-serif;
    white-space: nowrap;
    overflow: visible;
    letter-spacing: -0.3px;
}

.premium-value-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    background:
        radial-gradient(circle at 100% 0%, rgba(255,215,0,0.18), transparent 38%),
        rgba(255,255,255,0.04);
}

.premium-value-label {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--premium-gold);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.premium-value-card h3 {
    margin-bottom: 6px;
    font-size: 18px;
}

.premium-value-card p {
    color: var(--secondary-text);
    font-size: 13px;
}

.premium-value-card button:disabled {
    opacity: .55;
}

/* Premium Promo */
.premium-promo {
    background: var(--accent-gradient);
    padding: 24px;
    text-align: center;
}

.reports-card .card-header {
    padding-bottom: 10px;
}

.report-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 16px 16px;
}

.report-action {
    min-height: 92px;
    border: 1px solid rgba(176, 136, 255, 0.25);
    border-radius: 18px;
    background:
        radial-gradient(circle at 20% 0%, rgba(176, 136, 255, 0.28), transparent 42%),
        rgba(255, 255, 255, 0.05);
    color: var(--primary-text);
    text-align: left;
    padding: 14px;
    font-family: inherit;
}

.report-action span {
    display: block;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.report-action small {
    display: block;
    color: var(--secondary-text);
    font-size: 12px;
    line-height: 1.35;
}

.promo-content h3 {
    margin-bottom: 8px;
}

.promo-content p {
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 20px;
}

.btn-premium {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    background: #ffffff;
    color: var(--bg-color);
    border: none;
    font-weight: 600;
    font-size: 15px;
}

/* Navigation */
.bottom-nav {
    position: fixed;
    bottom: calc(var(--bottom-nav-offset) + var(--safe-area-inset-bottom));
    left: 20px;
    right: 20px;
    height: var(--bottom-nav-height);
    background: rgba(20, 20, 30, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 32px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
    z-index: 1000;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-item {
    background: none;
    border: none;
    color: var(--secondary-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    transition: color 0.2s ease;
}

.nav-item i {
    width: 22px;
    height: 22px;
}

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

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

.card {
    animation: fadeIn 0.5s ease backwards;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }

/* Tab visibility */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

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

.section-header h2 {
    font-size: 24px;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 4px;
}

.section-header p {
    font-size: 14px;
    color: var(--secondary-text);
}

.astro-pulse-card {
    padding: 18px;
    background:
        radial-gradient(circle at 85% 0%, rgba(100,150,255,0.20), transparent 36%),
        rgba(255,255,255,0.04);
}

.pulse-label {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 4px 9px;
    border-radius: 999px;
    color: #9bc3ff;
    background: rgba(100,150,255,0.13);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.astro-pulse-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.astro-pulse-card p {
    color: var(--secondary-text);
    font-size: 14px;
}

.astro-pulse-card small {
    display: block;
    margin-top: 12px;
    color: rgba(255,255,255,0.46);
}

.community-feed-card {
    padding: 18px;
}

.section-mini-title {
    color: rgba(255,255,255,0.75) !important;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.natal-row-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.natal-row-item:last-child { border-bottom: none; }
.natal-row-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    margin-bottom: 3px;
}
.natal-row-hint {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    line-height: 1.4;
}

.community-feed-list {
    display: grid;
    gap: 10px;
}

.community-feed-item {
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 16px;
    padding: 12px;
    background: rgba(255,255,255,0.035);
}

.community-feed-item span {
    display: block;
    font-weight: 800;
    margin-bottom: 5px;
}

.community-feed-item p {
    color: var(--secondary-text);
    font-size: 13px;
}

.community-feed-item small,
.fast-compat-result small {
    display: block;
    color: rgba(255,255,255,0.46);
    margin-top: 7px;
}

.community-share-card {
    border: 1px solid rgba(176,136,255,0.28);
    border-radius: 18px;
    padding: 14px;
    background:
        radial-gradient(circle at 90% 0%, rgba(176,136,255,0.22), transparent 42%),
        rgba(176,136,255,0.08);
}

.community-share-card span {
    display: block;
    font-weight: 800;
    margin-bottom: 6px;
}

.community-share-card p {
    color: var(--secondary-text);
    font-size: 13px;
}

.mini-link-btn {
    margin-top: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: var(--primary-text);
    padding: 9px 12px;
    font-family: inherit;
    font-weight: 800;
}

/* Connections Grid */
.connections-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.connection-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.rich-connection-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.rich-connection-card small {
    display: block;
    color: rgba(255,255,255,0.42);
    margin-top: 4px;
}

.connection-score {
    min-width: 72px;
    border-radius: 16px;
    padding: 10px;
    background: rgba(176,136,255,0.12);
    text-align: center;
}

.connection-score strong {
    display: block;
    font-size: 22px;
}

.connection-score span {
    color: var(--secondary-text);
    font-size: 11px;
}

.connection-prompt {
    grid-column: 1 / -1;
    color: var(--secondary-text);
    font-size: 13px;
    line-height: 1.5;
}

.connection-card:active {
    transform: scale(0.98);
    border-color: var(--accent-color);
}

.conn-info {
    display: flex;
    flex-direction: column;
}

.conn-name {
    font-weight: 600;
    font-size: 16px;
}

.conn-zodiac {
    font-size: 12px;
    color: var(--secondary-text);
}

.conn-action {
    color: var(--accent-color);
    font-size: 12px;
    font-weight: 500;
}

/* Profile styles */
.profile-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-row:last-child {
    border-bottom: none;
}

.profile-row span {
    color: var(--secondary-text);
}

.profile-metrics {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 14px;
}

.profile-metrics div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-metrics span {
    color: var(--secondary-text);
}

.profile-metrics strong {
    text-align: right;
}

.btn-secondary {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--primary-text);
    padding: 14px;
    border-radius: 16px;
    font-weight: 500;
    margin-top: 12px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: flex-end;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-color);
    width: 100%;
    max-height: 80vh;
    border-top-left-radius: 32px;
    border-top-right-radius: 32px;
    padding: 24px;
    border-top: 1px solid var(--card-border);
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

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

.close-modal {
    background: none;
    border: none;
    color: var(--primary-text);
    font-size: 28px;
    line-height: 1;
}

/* Birth date picker */
.birth-date-picker {
    display: grid;
    grid-template-columns: 0.8fr 1.35fr 1fr;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 12px;
    margin-top: 10px;
}

.birth-date-picker select {
    width: 100%;
    min-width: 0;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: white;
    border-radius: 12px;
    padding: 12px 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
}

.birth-date-picker select:focus {
    outline: none;
    border-color: rgba(176, 136, 255, 0.65);
    box-shadow: 0 0 0 3px rgba(176, 136, 255, 0.12);
}

/* Chat Detail View */
#chat-detail-container {
    min-height: min(620px, calc(100dvh - 180px));
    height: 100%;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.02);
}

.back-btn {
    background: none;
    border: none;
    color: var(--secondary-text);
    padding: 4px;
    cursor: pointer;
}

.chat-title-info h3 {
    font-size: 16px;
    margin-bottom: 2px;
}

#chat-detail-status {
    font-size: 11px;
    color: #4ade80; /* Green active status */
}

.chat-tools {
    flex-shrink: 0;
    padding: 12px 16px;
    border-bottom: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.025);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tool-caption {
    flex-basis: 100%;
    color: var(--secondary-text);
    font-size: 11px;
    letter-spacing: 0.02em;
}

.support-category-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preset-row,
.mood-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preset-chip {
    max-width: 100%;
    white-space: normal;
    text-align: left;
}

.tool-chip {
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--secondary-text);
    padding: 8px 11px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
}

.tool-chip.active {
    color: var(--primary-text);
    border-color: rgba(176, 136, 255, 0.55);
    background: rgba(176, 136, 255, 0.22);
}

.chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: none;
    overscroll-behavior: contain;
}

.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
}

.message.received {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border-bottom-left-radius: 4px;
}

.message.sent {
    align-self: flex-end;
    background: var(--accent-gradient);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.sent.pending {
    opacity: 0.72;
}

.message.sent.failed {
    background: linear-gradient(135deg, #8b5cf6 0%, #ef4444 100%);
}

.msg-retry-btn {
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.18);
    color: #fff;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 700;
    font-family: inherit;
}

.chat-input-area {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding: 14px 16px calc(14px + var(--safe-area-inset-bottom));
    border-top: 1px solid var(--card-border);
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(13, 13, 18, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.chat-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 10px 16px;
    color: white;
    font-size: 14px;
}

#send-msg-btn {
    background: var(--accent-gradient);
    border: none;
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

body.chat-open #app {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    padding-top: 0;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: calc(12px + var(--safe-area-inset-bottom));
}

body.chat-open .header {
    display: none;
}

body.chat-open .bottom-nav {
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + var(--bottom-nav-offset) + var(--safe-area-inset-bottom)));
}

body.chat-open .content,
body.chat-open #ai-tab,
body.chat-open #chat-detail-container {
    flex: 1;
    min-height: 0;
    height: 100%;
}

body.chat-open .content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.chat-open #ai-tab.active,
body.chat-open #chat-detail-container {
    display: flex;
    flex-direction: column;
}

body.chat-open #chat-detail-container {
    max-height: 100dvh;
    border-radius: 0;
    border-left: none;
    border-right: none;
}

body.chat-open .chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

body.chat-open #chat-list-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Input Groups */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 13px;
    color: var(--secondary-text);
    margin-bottom: 8px;
}

.input-group input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 12px;
    color: white;
    font-family: inherit;
    font-size: 15px;
}

.btn-primary {
    width: 100%;
    background: var(--accent-gradient);
    border: none;
    color: white;
    padding: 14px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 8px 16px rgba(126, 91, 239, 0.2);
}

/* Chat List */
.chat-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chats-hint {
    margin-top: 28px;
    padding: 0 8px 24px;
    text-align: center;
    color: rgba(255,255,255,0.22);
    font-size: 13px;
    line-height: 1.6;
}

.chat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 16px;
    display: flex;
    gap: 16px;
    align-items: center;
    transition: transform 0.2s ease;
}

.chat-card:active {
    transform: scale(0.98);
}

.chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    background: rgba(176, 136, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
}

.chat-info {
    flex: 1;
}

.chat-info h4 {
    font-size: 16px;
    margin-bottom: 2px;
}

.chat-info p {
    font-size: 13px;
    color: var(--secondary-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.chat-meta {
    text-align: right;
}

.chat-time {
    font-size: 11px;
    color: var(--secondary-text);
    display: block;
    margin-bottom: 4px;
}

.unread-badge {
    background: var(--accent-color);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.fast-compat-card {
    margin-top: 16px;
}

.referral-share-card,
.add-connection-card {
    margin-bottom: 16px;
}

.share-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}

.relation-mode-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 16px;
}

.support-honest-card {
    width: 100%;
    border: 1px solid rgba(85,216,138,0.22);
    border-radius: 16px;
    padding: 12px;
    background: rgba(85,216,138,0.08);
}

.support-honest-card strong,
.support-honest-card span {
    display: block;
}

.support-attachment-field {
    width: 100%;
    display: grid;
    gap: 6px;
}

.support-attachment-field span {
    color: var(--secondary-text);
    font-size: 11px;
}

.support-attachment-field input {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--primary-text);
    border-radius: 14px;
    padding: 11px 12px;
    font-family: inherit;
    font-size: 13px;
}

.msg-attachment-wrap {
    margin-top: 8px;
}

.msg-attachment {
    max-width: 240px;
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: block;
}

.support-honest-card span {
    margin-top: 4px;
    color: var(--secondary-text);
    font-size: 12px;
    line-height: 1.45;
}

.fast-compat-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}

.fast-compat-controls select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 12px;
    color: white;
    font-family: inherit;
    font-weight: 700;
}

.fast-compat-result {
    margin-top: 12px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(176, 136, 255, 0.08);
    border: 1px solid rgba(176, 136, 255, 0.16);
}

.fast-compat-result:empty {
    display: none;
}

.fast-compat-result strong {
    display: block;
    margin-bottom: 8px;
}

.fast-compat-result p {
    color: var(--secondary-text);
    font-size: 13px;
    margin-top: 6px;
}

/* Support chat identity */
.chat-card[data-chat-id="support"] {
    border-color: rgba(74, 222, 128, 0.2);
}
.chat-card[data-chat-id="support"] .chat-avatar {
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
}

/* SLA response badge */
.sla-badge {
    display: inline-block;
    font-size: 10px;
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.2);
    border-radius: 20px;
    padding: 2px 8px;
    font-weight: 500;
}

.support-honest-card strong .sla-badge {
    vertical-align: middle;
    margin-left: 6px;
}

/* Support request status pills */
.msg-status-pill {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 6px;
}
.msg-status-new { background: rgba(250, 204, 21, 0.15); color: #facc15; }
.msg-status-in_progress { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.msg-status-replied { background: rgba(74, 222, 128, 0.15); color: #4ade80; }
.msg-status-closed { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }

/* Proactive astro check-in card */
.checkin-card {
    margin-bottom: 16px;
    border-color: rgba(176, 136, 255, 0.3);
    background: linear-gradient(135deg, rgba(176, 136, 255, 0.08) 0%, rgba(126, 91, 239, 0.05) 100%);
    animation: fadeSlideIn 0.4s ease;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.checkin-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 4px 0;
}

.checkin-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.checkin-inner div {
    flex: 1;
}

.checkin-inner strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}

.checkin-inner p {
    font-size: 12px;
    color: var(--secondary-text);
}

.checkin-close {
    background: none;
    border: none;
    color: var(--secondary-text);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    flex-shrink: 0;
}

/* Streak milestone card */
.streak-milestone-card {
    margin-bottom: 16px;
    border-color: rgba(255, 215, 0, 0.3);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.07) 0%, rgba(255, 165, 0, 0.04) 100%);
    animation: fadeSlideIn 0.4s ease;
}

/* Natal chart SVG wheel */
#zodiac-wheel {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

#natal-preview-canvas {
    width: 240px;
    height: 240px;
    max-width: 100%;
}

/* ── Achievement badges ─────────────────────────────────── */
.achievement-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.achievement-group-title {
    grid-column: 1 / -1;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted, rgba(255,255,255,0.45));
    margin-top: 4px;
}
.achievement-badge {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 12px;
    opacity: 0.4;
    transition: opacity 0.3s, border-color 0.3s;
}
.achievement-badge.unlocked {
    opacity: 1;
    border-color: rgba(176, 136, 255, 0.35);
    background: rgba(176, 136, 255, 0.07);
}
.achievement-badge.locked {
    border-color: rgba(255,255,255,0.08);
}
.achievement-badge .ach-icon { font-size: 22px; display: block; margin-bottom: 6px; }
.achievement-badge strong { display: block; font-size: 13px; margin-bottom: 3px; }
.achievement-badge span { font-size: 11px; color: var(--secondary-text); }

.credit-ledger-card,
.achievements-card,
.natal-chart-card {
    padding: 18px;
}

.credit-ledger-list {
    display: grid;
    gap: 8px;
}

.credit-ledger-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
    align-items: center;
    padding: 11px 12px;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    background: rgba(255,255,255,0.035);
}

.credit-ledger-row span {
    color: var(--primary-text);
    font-size: 13px;
}

.credit-ledger-row strong {
    font-size: 14px;
}

.credit-ledger-row.plus strong {
    color: #55d88a;
}

.credit-ledger-row.minus strong {
    color: #ffb86b;
}

.credit-ledger-row small {
    grid-column: 1 / -1;
    color: var(--secondary-text);
    font-size: 11px;
}

.natal-chart-lines {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.natal-chart-lines div {
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    color: var(--secondary-text);
    font-size: 13px;
}

/* ── Typing indicator ───────────────────────────────────── */
.message.typing {
    background: rgba(255, 255, 255, 0.06) !important;
    padding: 10px 16px !important;
    display: inline-flex !important;
    gap: 5px;
    align-items: center;
    max-width: 80px !important;
}
.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--secondary-text);
    animation: typingBounce 1.2s infinite;
    flex-shrink: 0;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* ── Save insight button ────────────────────────────────── */
.msg-save-btn {
    background: none;
    border: none;
    color: var(--secondary-text);
    cursor: pointer;
    font-size: 14px;
    padding: 0 4px;
    float: right;
    opacity: 0.5;
    transition: opacity 0.2s, color 0.2s;
    margin-left: 8px;
}
.msg-save-btn:hover, .msg-save-btn.saved { color: var(--premium-gold); opacity: 1; }

/* ── Saved insights section ─────────────────────────────── */
.saved-insight-row {
    padding: 10px 0;
    border-bottom: 1px solid var(--card-border);
    font-size: 13px;
    color: var(--secondary-text);
    line-height: 1.55;
}
.saved-insight-row:last-child { border-bottom: none; }

/* ── Notification settings toggles ─────────────────────── */
.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--card-border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row > span { font-size: 14px; }
.toggle-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: background 0.25s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: transform 0.25s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent-color); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Unread dot ─────────────────────────────────────────── */
/* ── Lunar Calendar ─────────────────────────────────────── */
.lunar-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, rgba(96,72,168,0.28) 0%, rgba(20,16,48,0.6) 100%);
    border: 1px solid rgba(144,112,208,0.2);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 16px;
}
.lunar-phase-icon {
    font-size: 48px;
    line-height: 1;
    filter: drop-shadow(0 0 12px rgba(180,140,255,0.5));
    flex-shrink: 0;
}
.lunar-hero-info { flex: 1; min-width: 0; }
.lunar-phase-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary-text);
    font-family: 'Outfit', sans-serif;
}
.lunar-sub {
    font-size: 12px;
    color: var(--secondary-text);
    margin-top: 2px;
}
.lunar-illum-badge {
    flex-shrink: 0;
    background: rgba(144,112,208,0.18);
    border: 1px solid rgba(144,112,208,0.3);
    color: #c0a0ff;
    font-size: 13px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
}
.lunar-card { overflow: visible; }
.lunar-icon-wrap { background: rgba(144,112,208,0.14); }
.lunar-icon-wrap i { color: #a080e8; }
.lunar-prem-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--premium-gold);
    background: rgba(255,215,0,0.1);
    border: 1px solid rgba(255,215,0,0.2);
    padding: 3px 8px;
    border-radius: 10px;
}
.lunar-energy-text {
    font-size: 15px;
    color: var(--primary-text) !important;
    line-height: 1.6;
    margin-bottom: 16px;
}
.lunar-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.lunar-col {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    padding: 12px;
}
.lunar-col-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase !important;
    margin-bottom: 8px;
}
.lunar-col-title.fit { color: #60d090 !important; text-transform: uppercase !important; }
.lunar-col-title.avoid { color: #e08060 !important; text-transform: uppercase !important; }
.lunar-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.lunar-list li {
    font-size: 13px;
    color: var(--secondary-text);
    line-height: 1.4;
}
.lunar-list.fit li::before { content: '✓ '; color: #60d090; }
.lunar-list.avoid li::before { content: '✗ '; color: #e08060; }
.lunar-block { margin-bottom: 16px; }
.lunar-block:last-child { margin-bottom: 0; }
.lunar-block-label {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 6px;
}
.lunar-block-text {
    font-size: 14px;
    color: var(--secondary-text);
    line-height: 1.6;
}
.lunar-next-event {
    margin-top: 14px;
    padding: 10px 14px;
    background: rgba(144,112,208,0.1);
    border: 1px solid rgba(144,112,208,0.2);
    border-radius: 12px;
    font-size: 13px;
    color: #c0a0ff;
    font-weight: 600;
}
.lunar-personal-card {
    background: linear-gradient(135deg, rgba(255,215,0,0.06), rgba(255,255,255,0.03));
    border-color: rgba(255,215,0,0.15) !important;
}
.lunar-day-block {
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.lunar-day-block:last-child { border-bottom: none; padding-bottom: 0; }
.lunar-day-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.lunar-day-date {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-text);
    font-family: 'Outfit', sans-serif;
}
.lunar-day-phase {
    font-size: 12px;
    color: var(--secondary-text);
}
.lunar-day-icon { font-size: 18px; }
.lunar-meta-badge {
    font-size: 11px;
    color: var(--secondary-text);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 3px 10px;
    white-space: nowrap;
}
.lunar-paywall-card {
    text-align: center;
    background: linear-gradient(135deg, rgba(96,72,168,0.18), rgba(255,255,255,0.03));
    border-color: rgba(144,112,208,0.2) !important;
}
.lunar-paywall-icon { font-size: 36px; margin-bottom: 10px; }
.lunar-paywall-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-text);
    font-family: 'Outfit', sans-serif;
    margin-bottom: 8px;
}
.lunar-paywall-text {
    font-size: 13px;
    color: var(--secondary-text);
    line-height: 1.5;
}
.lunar-week-block { margin-bottom: 14px; }
.lunar-week-block:last-child { margin-bottom: 0; }
.lunar-week-period {
    font-size: 12px;
    font-weight: 700;
    color: #a080e8;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 5px;
}

.unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-color);
    display: inline-block;
    margin-top: 4px;
}

/* ══ Credit toast (shared banner) ══════════════════════════════════════ */
.credit-toast {
    position: fixed;
    bottom: calc(var(--safe-bot, 0px) + 80px);
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: rgba(20,20,40,0.97);
    border: 1px solid rgba(144,112,208,0.35);
    border-radius: 14px;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text);
    box-shadow: 0 8px 24px rgba(0,0,0,0.55);
    z-index: 1000;
    transition: transform 0.35s cubic-bezier(0.25,0.8,0.25,1);
    white-space: nowrap;
    pointer-events: none;
}
.credit-toast.show { transform: translateX(-50%) translateY(0); }
.credit-toast-ico { font-size: 16px; }
.credit-toast-spent { font-weight: 700; color: #f0c060; }
.credit-toast-rem { color: var(--text-muted, #8888aa); font-size: 12px; }

/* ══ Inline report expand (Обзоры) ═════════════════════════════════════ */
.report-expand-item {
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.report-expand-item:last-child { border-bottom: none; }
.report-expand-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    cursor: pointer;
    gap: 10px;
    -webkit-tap-highlight-color: transparent;
}
.report-expand-left { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.report-expand-title { font-size: 15px; font-weight: 500; color: var(--text); }
.report-expand-meta { font-size: 12px; color: var(--text-muted, #8888aa); }
.report-chevron {
    width: 18px; height: 18px;
    color: var(--text-muted, #8888aa);
    transition: transform 0.25s ease;
    flex-shrink: 0;
}
.report-expand-item.open .report-chevron { transform: rotate(180deg); }
.report-expand-body {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s ease, padding 0.25s ease;
    padding: 0;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text);
}
.report-expand-item.open .report-expand-body {
    max-height: 2000px;
    padding-bottom: 16px;
}
.report-expand-body .report-loading {
    color: var(--text-muted, #8888aa);
    font-size: 13px;
    padding: 8px 0;
}
.report-expand-body .report-cached-note {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted, #8888aa);
}

/* ══ Lunar section tabs ════════════════════════════════════════════════ */
.lunar-section-tabs {
    display: flex;
    gap: 8px;
    padding: 0 0 4px;
    margin-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.lunar-section-tabs::-webkit-scrollbar { display: none; }
.lunar-stab {
    flex-shrink: 0;
    padding: 7px 16px;
    border-radius: 20px;
    border: 1px solid rgba(144,112,208,0.3);
    background: transparent;
    color: var(--text-muted, #8888aa);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.lunar-stab.active {
    background: rgba(144,112,208,0.22);
    color: #c0a0f8;
    border-color: rgba(144,112,208,0.6);
}

/* ── Lunar section panels ─────────────────────────────────────────────── */
.lunar-section-panel { display: none; }
.lunar-section-panel.active { display: block; }

/* ── Loader/CTA inside premium sections ─────────────────────────────── */
.lunar-section-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    gap: 10px;
    text-align: center;
    min-height: 60vh;
    justify-content: center;
}
.lunar-load-icon { font-size: 40px; margin-bottom: 4px; }
.lunar-load-text { font-size: 15px; color: var(--text); font-weight: 500; margin: 0; }
.lunar-load-cost { font-size: 12px; color: #a080e8; margin: 0; }
.btn-lunar-load {
    margin-top: 8px;
    padding: 10px 28px;
    border-radius: 22px;
    background: linear-gradient(135deg, #7050c8, #a080e8);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn-lunar-load:active { opacity: 0.75; }
.btn-lunar-load:disabled { opacity: 0.5; cursor: default; }
.lunar-locked-benefits {
    list-style: none;
    margin-top: 12px;
    padding: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 260px;
}
.lunar-locked-benefits li {
    font-size: 13px;
    color: rgba(255,255,255,0.45);
    line-height: 1.4;
    padding-left: 18px;
    position: relative;
}
.lunar-locked-benefits li::before {
    content: "✦";
    position: absolute;
    left: 0;
    color: #b088ff;
    font-size: 10px;
    top: 2px;
}
.lunar-section-error {
    text-align: center;
    padding: 30px 16px;
    color: var(--text-muted, #8888aa);
    font-size: 14px;
}
