/* ============================================================
   SenseStars · Editorial v3 · Раздел «Я» (diary)
   ----------------------------------------------------------------
   Скоупаны на body.app[data-section="diary"].
   Эталон: design-system-v2/reference-mockups/03-diary-profile.html
   ============================================================ */

/* ── Прячем старое окружение, оно конфликтует с Editorial ── */
body.app[data-section="diary"] #dynamic-bg,
body.app[data-section="diary"] #oracle-glow,
body.app[data-section="diary"] #magic-particles {
    display: none;
}
body.app[data-section="diary"] > header.legacy-header {
    display: none;
}
/* На diary прячем top-pills v3 от altar (там кнопка баланса) — у diary свой brand-pill */
body.app[data-section="diary"] .top-pills-v3 {
    display: none;
}

body.app[data-section="diary"] {
    background: var(--section-bg, var(--bg));
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
    color: var(--text);
}
body.app[data-section="diary"] #app-content {
    max-width: 420px;
    margin: 0 auto;
    padding: 0 0 110px;
    position: relative;
    z-index: 1;
    background: var(--section-bg, var(--bg));
}

/* ── Top pills (свои для diary: brand-pill + settings) ── */
.top-pills-v3-diary {
    position: fixed;
    top: env(safe-area-inset-top, 12px);
    left: 0;
    right: 0;
    padding: 14px 16px 0;
    display: none;
    justify-content: space-between;
    z-index: 90;
    max-width: 420px;
    margin: 0 auto;
    pointer-events: none;
}
body.app[data-section="diary"] .top-pills-v3-diary {
    display: flex;
}
.top-pills-v3-diary > * { pointer-events: auto; }
.brand-pill-v3 {
    background: rgba(29, 31, 37, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    padding: 8px 16px;
    font-family: var(--serif);
    font-size: 13px;
    letter-spacing: 0.3em;
    color: var(--text);
    text-transform: uppercase;
    font-weight: 500;
}
.brand-pill-v3 .dot {
    color: var(--section-voice, var(--accent));
}

/* ── Cover diary ── */
body.app[data-section="diary"] .section-cover-v3 {
    text-align: center;
}
body.app[data-section="diary"] .section-cover-v3__emblem {
    width: 360px;
    height: 360px;
    left: 50%;
    right: auto;
    top: 50%;
    transform: translate(-50%, -52%);
    opacity: 0.10;
}
body.app[data-section="diary"] .section-cover-v3__eyebrow {
    justify-content: center;
}
body.app[data-section="diary"] .section-cover-v3__title {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}
body.app[data-section="diary"] .section-cover-v3__rule {
    margin-left: auto;
    margin-right: auto;
}

.diary-avatar {
    width: 96px;
    height: 96px;
    margin: 0 auto 22px;
    border-radius: 50%;
    background: linear-gradient(160deg, #0a1428 0%, #050b18 60%, #02050d 100%);
    border: 1px solid var(--section-voice, var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--serif);
    font-size: 38px;
    color: var(--text);
    position: relative;
    box-shadow: 0 0 30px rgba(200, 162, 106, 0.18), 0 12px 30px rgba(0, 0, 0, 0.5);
}
.diary-avatar::before {
    content: '';
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    border: 1px solid rgba(200, 162, 106, 0.22);
}

body.app[data-section="diary"] .section-cover-v3__meta {
    font-size: 13px;
    color: var(--text-dim);
    letter-spacing: 0.04em;
    margin-top: 12px;
}
body.app[data-section="diary"] .section-cover-v3__meta span {
    color: var(--text);
    margin: 0 6px;
}

/* ── Перехватываем существующий profile-hero-card в Editorial ── */
body.app[data-section="diary"] #profile-hero-card.section-card {
    margin: 0 24px 16px;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 22px;
    position: relative;
    z-index: 1;
    text-align: left;
}
body.app[data-section="diary"] #profile-hero-card .profile-hero-v2 {
    display: none; /* верхний бейдж с именем — он теперь в cover */
}
body.app[data-section="diary"] #profile-hero-card .profile-card-thumbs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0 0 14px;
}
body.app[data-section="diary"] #profile-hero-card .profile-card-mini {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: none;
    text-align: left;
}
body.app[data-section="diary"] #profile-hero-card .profile-card-mini .label {
    font-size: 10px;
    color: var(--section-voice, var(--accent));
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
body.app[data-section="diary"] #profile-hero-card .profile-card-mini .value {
    font-family: var(--serif);
    font-size: 16px;
    line-height: 1.2;
    color: var(--text);
}
body.app[data-section="diary"] #profile-hero-card .profile-card-corner {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
}
body.app[data-section="diary"] #profile-hero-card .profile-motto {
    font-family: var(--serif);
    font-style: italic;
    font-size: 14px;
    color: var(--text-dim);
    margin-top: 4px;
    line-height: 1.5;
}

/* ── Аккордионы (Матрица Судьбы / Натальная карта) ── */
body.app[data-section="diary"] .profile-accordion.section-card {
    margin: 12px 24px 0;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 0;
    position: relative;
    z-index: 1;
}
body.app[data-section="diary"] .profile-accordion summary {
    list-style: none;
    cursor: pointer;
    padding: 18px 22px;
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 500;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 12px;
    border: none;
    background: transparent;
}
body.app[data-section="diary"] .profile-accordion summary::-webkit-details-marker { display: none; }
body.app[data-section="diary"] .profile-accordion summary::after {
    content: '';
    width: 16px;
    height: 16px;
    margin-left: auto;
    background: linear-gradient(transparent 7px, currentColor 7px, currentColor 8px, transparent 8px),
                linear-gradient(90deg, transparent 7px, currentColor 7px, currentColor 8px, transparent 8px);
    color: var(--text-muted);
    transition: transform 0.2s;
}
body.app[data-section="diary"] .profile-accordion details[open] summary::after {
    background: linear-gradient(transparent 7px, currentColor 7px, currentColor 8px, transparent 8px);
}
body.app[data-section="diary"] .profile-accordion details > div {
    padding: 0 22px 18px;
    font-family: var(--sans);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-dim);
    border-top: 1px solid var(--line);
    margin-top: 0;
    padding-top: 14px;
}
body.app[data-section="diary"] .profile-accordion details > div:first-of-type {
    border-top: none;
    padding-top: 14px;
}
body.app[data-section="diary"] .profile-accordion .profile-premium-gate {
    background: rgba(200, 162, 106, 0.06);
    border: 1px solid rgba(200, 162, 106, 0.20);
    border-radius: 12px;
    padding: 14px;
    margin: 8px 22px 14px;
}
body.app[data-section="diary"] .profile-accordion .profile-premium-gate .btn {
    background: var(--section-voice, var(--accent));
    color: #15110a;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-family: var(--sans);
    font-size: 13px;
    cursor: pointer;
    box-shadow: none;
    text-shadow: none;
    margin-top: 10px;
}

/* ── Edit box ── */
body.app[data-section="diary"] #profile-edit-box.section-card {
    margin: 12px 24px 0;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 18px;
}
body.app[data-section="diary"] #profile-edit-toggle-btn,
body.app[data-section="diary"] #profile-edit-save-btn,
body.app[data-section="diary"] #profile-edit-cancel-btn {
    background: var(--bg-elev);
    color: var(--text);
    border: 1px solid var(--line-strong);
    padding: 10px 16px;
    border-radius: 10px;
    font-family: var(--sans);
    font-size: 13px;
    box-shadow: none;
    text-shadow: none;
}
body.app[data-section="diary"] #profile-edit-form {
    border: none;
    background: transparent;
    padding: 0;
    margin-top: 12px;
}
body.app[data-section="diary"] #profile-edit-form .oracle-input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 10px;
    font-family: var(--sans);
}

/* ── Cross-sell card по умолчанию скрыт inline-стилем display:none. Если когда-то покажут, разметку перепишем отдельно. ── */
