:root {
    --bg: #0b0e14;
    --card: #151a24;
    --card-border: #262f40;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --accent: #e2b96f;
    --accent-dim: rgba(226, 185, 111, 0.14);
    --danger: #ef4444;
    --success: #22c55e;
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    padding-bottom: 84px;
}

.hidden {
    display: none !important;
}

/* Верхняя панель */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(11, 14, 20, 0.92);
    backdrop-filter: blur(12px);
    padding: 12px 16px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    width: fit-content;
}

.profile-pill .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

.profile-pill .chevron {
    color: var(--accent);
    font-size: 14px;
}

.meta-text {
    font-size: 12px;
    color: var(--muted);
}

/* Общие контейнеры и карточки */
.screen, .tab-pane {
    padding: 16px;
    max-width: 640px;
    margin: 0 auto;
}

.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 14px;
}

.hero-card h1 {
    font-size: 22px;
    margin-bottom: 8px;
    color: var(--accent);
}

.muted {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 16px;
}

.section-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin: 16px 0 10px 2px;
    font-weight: 600;
}

/* Формы и кнопки */
.form-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-stack label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}

input, select {
    width: 100%;
    background: #0d1118;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    border-color: var(--accent);
}

.btn-primary {
    background: var(--accent);
    color: #0b0e14;
    border: none;
    border-radius: 12px;
    padding: 13px 18px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.5;
}

.btn-sm {
    padding: 10px 14px;
    white-space: nowrap;
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Натальная схема и Большая тройка */
.chart-card {
    text-align: center;
}

.wheel-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.big-three-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.stat-box {
    background: #0e131b;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 10px 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 10px;
    letter-spacing: 0.05em;
    color: var(--accent);
    font-weight: 600;
}

.stat-val {
    font-size: 14px;
    font-weight: 700;
}

/* Аккордеоны разбора */
.accordion-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.accordion-item {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    overflow: hidden;
}

.accordion-header {
    width: 100%;
    background: none;
    border: none;
    color: var(--text);
    padding: 15px 16px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    text-align: left;
}

.accordion-header .arrow {
    color: var(--accent);
    font-size: 18px;
    font-weight: 400;
}

.accordion-body {
    padding: 0 16px 16px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 14px;
    font-size: 14.5px;
    line-height: 1.6;
    white-space: pre-line;
}

/* Текстовый блок аналитики */
.analysis-card {
    font-size: 14.5px;
    line-height: 1.62;
    white-space: pre-line;
}

.analysis-card b, .accordion-body b {
    color: var(--accent);
}

/* Чипсы периодов прогноза */
.chips-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 6px;
    scrollbar-width: none;
}

.chips-scroll::-webkit-scrollbar {
    display: none;
}

.chip {
    background: var(--card);
    border: 1px solid var(--card-border);
    color: var(--text);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.chip.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

/* Список профилей */
.profiles-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-row {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 13px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.profile-row.active-row {
    border-color: var(--accent);
    background: rgba(226, 185, 111, 0.06);
}

.profile-info {
    flex: 1;
    cursor: pointer;
}

.profile-info .p-name {
    font-weight: 700;
    font-size: 15px;
}

.profile-info .p-sub {
    font-size: 12px;
    color: var(--muted);
}

.btn-del {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    padding: 7px 10px;
    font-size: 12px;
    cursor: pointer;
}

/* Нижняя навигация */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
    background: rgba(15, 19, 27, 0.96);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--card-border);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}

.nav-btn {
    background: none;
    border: none;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
}

.nav-btn .nav-icon {
    font-size: 18px;
}

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

/* Лоадер и тост */
.loader {
    text-align: center;
    color: var(--accent);
    padding: 24px 10px;
    font-size: 14px;
}

.toast {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    border: 1px solid var(--accent);
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13px;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

/* Выпадающий список подсказок городов */
.city-autocomplete-wrap {
    position: relative;
}

.city-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: #151a24;
    border: 1px solid var(--accent);
    border-radius: 12px;
    z-index: 50;
    max-height: 210px;
    overflow-y: auto;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65);
}

.city-option {
    padding: 11px 14px;
    font-size: 13.5px;
    color: var(--text);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

.city-option:last-child {
    border-bottom: none;
}

.city-option:active {
    background: var(--accent-dim);
    color: var(--accent);
}
