/* ========================================
   Cabinet — Layout & Navigation
   ======================================== */

/* ── Header ─────────────────────────────── */
.cabinet-header {
    position: sticky;
    top: 0;
    z-index: var(--z-dropdown, 100);
    background: var(--white, #fff);
    border-bottom: 1px solid var(--border-gray, #e5e7eb);
    padding: 0 24px;
    height: 56px;
}

.cabinet-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.cabinet-header-left {
    flex: 1;
    display: flex;
    align-items: center;
}

.cabinet-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--medium-gray, #6b7280);
    text-decoration: none;
    font-size: 14px;
    font-family: var(--font-primary, 'Inter', sans-serif);
    transition: color var(--transition-fast, 0.15s);
}

.cabinet-back-link:hover {
    color: var(--emerald, #059669);
}

.cabinet-header-center {
    flex: 0 0 auto;
}

.cabinet-logo-link img {
    display: block;
    height: 36px;
}

.cabinet-header-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.cabinet-user-menu-wrap {
    position: relative;
}

.cabinet-user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 24px;
    transition: background 0.15s ease;
}

.cabinet-user-btn:hover {
    background: var(--light-gray, #f3f4f6);
}

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

.cabinet-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--emerald, #059669);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-primary, 'Inter', sans-serif);
}

.cabinet-user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--dark-gray, #1f2937);
    font-family: var(--font-primary, 'Inter', sans-serif);
}

/* ── Page layout ────────────────────────── */
.cabinet-page {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    min-height: calc(100vh - 56px);
    font-family: var(--font-primary, 'Inter', sans-serif);
}

/* ── Sidebar ────────────────────────────── */
.cabinet-sidebar {
    width: 220px;
    flex-shrink: 0;
    border-inline-end: 1px solid var(--border-gray, #e5e7eb);
    padding: 20px 0;
    background: var(--white, #fff);
    display: flex;
    flex-direction: column;
}

.cabinet-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 8px;
}

.cabinet-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-md, 8px);
    color: var(--medium-gray, #6b7280);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast, 0.15s);
}

.cabinet-nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.cabinet-nav-item:hover {
    background: var(--emerald-50, #ecfdf5);
    color: var(--emerald, #059669);
}

.cabinet-nav-item.active {
    background: var(--emerald-50, #ecfdf5);
    color: var(--emerald, #059669);
    font-weight: 600;
}

.cabinet-nav-item.active svg {
    stroke: var(--emerald, #059669);
}

/* ── Content area ───────────────────────── */
.cabinet-content {
    flex: 1;
    padding: 28px 32px;
    min-width: 0;
    background: var(--white, #fff);
}

.cabinet-loading {
    display: flex;
    justify-content: center;
    padding: 60px 0;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-gray, #e5e7eb);
    border-top-color: var(--emerald, #059669);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ── Section title ──────────────────────── */
.cabinet-section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--dark-gray, #1f2937);
    margin-bottom: 24px;
}

/* ── Profile form ───────────────────────── */
.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
}

.profile-avatar-large {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--emerald, #059669);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
}

.profile-avatar-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark-gray, #1f2937);
    margin: 0 0 4px;
}

.profile-avatar-info p {
    font-size: 13px;
    color: var(--medium-gray, #6b7280);
    margin: 0;
}

.profile-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    max-width: 600px;
}

.profile-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-form .form-group.full-width {
    grid-column: 1 / -1;
}

.profile-form .form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark-gray, #1f2937);
}

.profile-form .form-input,
.profile-form .form-select {
    padding: 10px 14px;
    border: 1px solid var(--border-gray, #e5e7eb);
    border-radius: var(--radius-md, 8px);
    font-size: 14px;
    font-family: var(--font-primary, 'Inter', sans-serif);
    color: var(--dark-gray, #1f2937);
    background: var(--white, #fff);
    transition: border-color var(--transition-fast, 0.15s);
}

.profile-form .form-input:focus,
.profile-form .form-select:focus {
    outline: none;
    border-color: var(--emerald, #059669);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--emerald) 10%, transparent);
}

.profile-form .form-input[readonly] {
    background: var(--light-gray, #f3f4f6);
    color: var(--medium-gray, #6b7280);
    cursor: not-allowed;
}

/* Значение поля в режиме просмотра */
.form-value {
    padding: 10px 14px;
    font-size: 14px;
    font-family: var(--font-primary, 'Inter', sans-serif);
    color: var(--dark-gray, #1f2937);
    background: var(--light-gray, #f3f4f6);
    border: 1px solid var(--border-gray, #e5e7eb);
    border-radius: var(--radius-md, 8px);
    min-height: 42px;
    display: flex;
    align-items: center;
}

/* Кнопка «Редактировать» */
.btn-edit-profile {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    border: 1px solid var(--border-gray, #e5e7eb);
    border-radius: var(--radius-md, 8px);
    background: var(--white, #fff);
    color: var(--medium-gray, #6b7280);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-primary, 'Inter', sans-serif);
    transition: all var(--transition-fast, 0.15s);
}

.btn-edit-profile:hover {
    border-color: var(--emerald, #059669);
    color: var(--emerald, #059669);
}

/* Кнопка «Отмена» */
.btn-cancel {
    padding: 10px 28px;
    background: transparent;
    color: var(--medium-gray, #6b7280);
    border: 1px solid var(--border-gray, #e5e7eb);
    border-radius: var(--radius-md, 8px);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-primary, 'Inter', sans-serif);
    transition: all var(--transition-fast, 0.15s);
}

.btn-cancel:hover {
    border-color: var(--medium-gray, #6b7280);
}

.gender-radios {
    display: flex;
    gap: 20px;
    padding-top: 2px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--dark-gray, #1f2937);
    cursor: pointer;
}

.radio-label input[type="radio"] {
    accent-color: var(--emerald, #059669);
}

.profile-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.btn-save {
    padding: 10px 28px;
    background: var(--emerald, #059669);
    color: #fff;
    border: none;
    border-radius: var(--radius-md, 8px);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-primary, 'Inter', sans-serif);
    transition: background var(--transition-fast, 0.15s);
}

.btn-save:hover {
    background: var(--emerald-dark, #047857);
}

.btn-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-logout {
    padding: 10px 28px;
    background: transparent;
    color: var(--danger, #dc2626);
    border: 1px solid var(--danger, #dc2626);
    border-radius: var(--radius-md, 8px);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-primary, 'Inter', sans-serif);
    transition: all var(--transition-fast, 0.15s);
}

.btn-logout:hover {
    background: var(--danger-light, #fef2f2);
}

/* ── Subscription badge ─────────────────── */
.subscription-section {
    margin-top: 32px;
    padding: 20px;
    background: var(--light-gray, #f3f4f6);
    border-radius: var(--radius-lg, 12px);
    max-width: 600px;
}

.subscription-section h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark-gray, #1f2937);
    margin: 0 0 8px;
}

.subscription-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.subscription-badge.free {
    background: var(--emerald-50, #ecfdf5);
    color: var(--emerald, #059669);
}

.subscription-badge.premium {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

/* ── Updates ────────────────────────────── */
.updates-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.update-card {
    padding: 18px 20px;
    border: 1px solid var(--border-gray, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
    transition: box-shadow var(--transition-fast, 0.15s);
}

.update-card:hover {
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.05));
}

.update-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.update-type-badge {
    display: inline-flex;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.update-type-badge.feature {
    background: var(--emerald-50, #ecfdf5);
    color: var(--emerald, #059669);
}

.update-type-badge.update {
    background: var(--info-light, #eff6ff);
    color: #1d4ed8;
}

.update-type-badge.announcement {
    background: var(--warning-light, #fffbeb);
    color: #92400e;
}

.update-date {
    font-size: 12px;
    color: var(--medium-gray, #6b7280);
}

.update-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-gray, #1f2937);
    margin: 0 0 6px;
}

.update-card p {
    font-size: 14px;
    color: var(--medium-gray, #6b7280);
    margin: 0;
    line-height: 1.5;
}

/* ── Section header (title + action) ───── */
.cabinet-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.cabinet-section-header .cabinet-section-title {
    margin-bottom: 0;
}

.btn-clear-history {
    padding: 6px 16px;
    border: 1px solid var(--border-gray, #e5e7eb);
    border-radius: var(--radius-md, 8px);
    background: transparent;
    color: var(--medium-gray, #6b7280);
    font-size: 13px;
    cursor: pointer;
    font-family: var(--font-primary, 'Inter', sans-serif);
    transition: all var(--transition-fast, 0.15s);
}

.btn-clear-history:hover {
    border-color: var(--danger, #dc2626);
    color: var(--danger, #dc2626);
}

/* ── Bookmarks ─────────────────────────── */
.bm-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.bm-type-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.bm-filter-btn {
    padding: 5px 14px;
    border: 1px solid var(--border-gray, #e5e7eb);
    border-radius: 20px;
    background: var(--white, #fff);
    color: var(--medium-gray, #6b7280);
    font-size: 13px;
    font-family: var(--font-primary, 'Inter', sans-serif);
    cursor: pointer;
    transition: all var(--transition-fast, 0.15s);
}

.bm-filter-btn:hover {
    border-color: var(--emerald, #059669);
    color: var(--emerald, #059669);
}

.bm-filter-btn.active {
    background: var(--emerald, #059669);
    border-color: var(--emerald, #059669);
    color: #fff;
}

.bm-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.bm-folder-select {
    max-width: 160px;
    padding: 6px 10px;
    font-size: 13px;
}

.bm-search-wrap {
    display: flex;
    align-items: center;
    background: var(--white, #fff);
    border: 1.5px solid var(--border-gray, #e5e7eb);
    border-radius: 10px;
    padding: 0 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 180px;
}

.bm-search-wrap:focus-within {
    border-color: var(--emerald, #059669);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--emerald) 10%, transparent);
}

.bm-search-icon {
    color: #9ca3af;
    flex-shrink: 0;
    transition: color 0.2s;
}

.bm-search-wrap:focus-within .bm-search-icon {
    color: var(--emerald, #059669);
}

.bm-search {
    flex: 1;
    border: none;
    outline: none;
    padding: 8px 8px;
    font-size: 13px;
    font-family: var(--font-primary, 'Inter', sans-serif);
    background: transparent;
    color: #1f2937;
    min-width: 0;
}

.bm-search::placeholder {
    color: #9ca3af;
}

.bm-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bm-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--border-gray, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
    transition: box-shadow var(--transition-fast, 0.15s), border-color var(--transition-fast, 0.15s);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.bm-card:hover {
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.05));
    border-color: var(--emerald, #059669);
}

.bm-card-icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 2px;
}

.bm-card-body {
    flex: 1;
    min-width: 0;
}

.bm-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark-gray, #1f2937);
    margin-bottom: 4px;
    word-break: break-word;
}

.bm-card-note {
    font-size: 13px;
    color: var(--medium-gray, #6b7280);
    margin-bottom: 6px;
    font-style: italic;
}

.bm-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--medium-gray, #6b7280);
}

.bm-folder-badge {
    display: inline-flex;
    padding: 1px 8px;
    border-radius: 10px;
    background: var(--emerald-50, #ecfdf5);
    color: var(--emerald, #059669);
    font-size: 11px;
    font-weight: 600;
}

.bm-date {
    color: var(--medium-gray, #6b7280);
}

.bm-card-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.bm-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: var(--radius-md, 8px);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast, 0.15s);
}

.bm-action-btn:hover {
    background: var(--light-gray, #f3f4f6);
}

/* ── History ───────────────────────────── */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md, 8px);
    transition: background var(--transition-fast, 0.15s);
}

.history-item:hover {
    background: var(--light-gray, #f3f4f6);
}

a.history-item {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

a.history-item:hover {
    border-color: var(--emerald, #10b981);
    background: var(--light-gray, #f3f4f6);
}

.history-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.history-title {
    flex: 1;
    font-size: 14px;
    color: var(--dark-gray, #1f2937);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-time {
    font-size: 12px;
    color: var(--medium-gray, #6b7280);
    flex-shrink: 0;
}

/* ── Questions ─────────────────────────── */
.questions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.question-card {
    border: 1px solid var(--border-gray, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
    overflow: hidden;
}

.question-card[open] {
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.05));
}

.question-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    font-family: var(--font-primary, 'Inter', sans-serif);
    list-style: none;
}

.question-summary::-webkit-details-marker { display: none; }
.question-summary::marker { display: none; content: ''; }

.question-summary:hover {
    background: var(--light-gray, #f3f4f6);
}

.question-status {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.question-status.status-pending { color: #ca8a04; }
.question-status.status-review { color: #2563eb; }
.question-status.status-clarification { color: #ea580c; }
.question-status.status-answered { color: var(--emerald, #059669); }
.question-status.status-draft { color: var(--medium-gray, #6b7280); }
.question-status.status-spam { color: var(--danger, #dc2626); }

.question-topic {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--dark-gray, #1f2937);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.question-date {
    font-size: 12px;
    color: var(--medium-gray, #6b7280);
    flex-shrink: 0;
}

.question-body {
    padding: 0 16px 16px;
    border-top: 1px solid var(--border-gray, #e5e7eb);
}

.question-text {
    font-size: 14px;
    color: var(--dark-gray, #1f2937);
    line-height: 1.6;
    padding-top: 14px;
    white-space: pre-wrap;
}

.question-answer {
    margin-top: 14px;
    padding: 14px;
    background: var(--emerald-50, #ecfdf5);
    border-radius: var(--radius-md, 8px);
    font-size: 14px;
    line-height: 1.6;
}

.question-answer strong {
    color: var(--emerald, #059669);
    display: block;
    margin-bottom: 6px;
}

.question-fatwa-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--emerald, #059669);
    text-decoration: none;
}

.question-fatwa-link:hover {
    text-decoration: underline;
}

/* ── Reading — трекер прогресса ────────── */
.reading-section-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-gray, #1f2937);
    margin: 28px 0 14px;
}

.text-muted {
    color: var(--medium-gray, #6b7280) !important;
}

/* Активные сессии */
.reading-sessions-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reading-session-card {
    padding: 16px 20px;
    border: 1px solid var(--border-gray, #e5e7eb);
    border-radius: var(--radius-md, 8px);
    background: var(--white, #fff);
    transition: box-shadow var(--transition-fast, 0.15s);
}

.reading-session-card:hover {
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.1));
}

.reading-session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--medium-gray, #6b7280);
    margin-bottom: 6px;
}

.reading-remove-btn {
    background: none;
    border: none;
    color: var(--medium-gray, #9ca3af);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
}

.reading-remove-btn:hover {
    color: var(--red, #ef4444);
    background: rgba(239, 68, 68, 0.08);
}

.reading-session-label {
    font-size: 15px;
    font-weight: 500;
    color: var(--dark-gray, #1f2937);
    margin-bottom: 10px;
}

.reading-progress-bar {
    height: 6px;
    background: var(--light-gray, #f3f4f6);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.reading-progress-fill {
    height: 100%;
    background: var(--emerald, #059669);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.reading-session-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.reading-pct {
    color: var(--medium-gray, #6b7280);
}

.reading-continue-link {
    color: var(--emerald, #059669);
    text-decoration: none;
    font-weight: 500;
}

.reading-continue-link:hover {
    text-decoration: underline;
}

/* Блоки «Начать чтение» */
.reading-start-blocks {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reading-start-block {
    padding: 16px 20px;
    border: 1px solid var(--border-gray, #e5e7eb);
    border-radius: var(--radius-md, 8px);
    background: var(--white, #fff);
}

.reading-start-header {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark-gray, #1f2937);
    margin-bottom: 12px;
}

.reading-start-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.reading-select {
    flex: 1;
    min-width: 140px;
    padding: 8px 12px;
    border: 1px solid var(--border-gray, #e5e7eb);
    border-radius: var(--radius-md, 8px);
    font-size: 14px;
    font-family: var(--font-primary, 'Inter', sans-serif);
    color: var(--dark-gray, #1f2937);
    background: var(--white, #fff);
    cursor: pointer;
    appearance: auto;
}

.reading-select:focus {
    outline: none;
    border-color: var(--emerald, #059669);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--emerald) 10%, transparent);
}

.reading-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-go {
    width: 40px;
    height: 38px;
    border: none;
    border-radius: var(--radius-md, 8px);
    background: var(--emerald, #059669);
    color: white;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast, 0.15s);
}

.btn-go:hover {
    background: var(--emerald-dark, #047857);
}

/* Бейдж режима чтения — стили в global.css */

/* ── Diary ─────────────────────────────── */
.diary-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.diary-nav-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-gray, #e5e7eb);
    border-radius: var(--radius-md, 8px);
    background: var(--white, #fff);
    color: var(--dark-gray, #1f2937);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast, 0.15s);
}

.diary-nav-btn:hover {
    border-color: var(--emerald, #059669);
    color: var(--emerald, #059669);
}

.diary-month-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-gray, #1f2937);
    min-width: 160px;
    text-align: center;
}

.diary-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px;
    margin-bottom: 24px;
}

.diary-calendar {
    border: 1px solid var(--border-gray, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
    padding: 16px;
}

.diary-cal-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 6px;
}

.diary-cal-header span {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--medium-gray, #6b7280);
    padding: 4px 0;
}

.diary-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.diary-cal-empty {
    aspect-ratio: 1;
}

.diary-cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--dark-gray, #1f2937);
    cursor: pointer;
    transition: all var(--transition-fast, 0.15s);
    border: 2px solid transparent;
}

.diary-cal-day:hover {
    border-color: var(--emerald, #059669);
}

.diary-cal-day.today {
    border-color: var(--emerald, #059669);
    font-weight: 700;
}

.diary-cal-day.level-0 { background: var(--light-gray, #f3f4f6); }
.diary-cal-day.level-1 { background: color-mix(in srgb, var(--emerald, #059669) 20%, transparent); color: var(--emerald-dark, #065f46); }
.diary-cal-day.level-2 { background: var(--emerald-light, #6ee7b7); color: #064e3b; }
.diary-cal-day.level-3 { background: var(--emerald, #059669); color: #fff; }

.diary-day-form {
    border: 1px solid var(--border-gray, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
    padding: 20px;
}

.diary-day-form h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark-gray, #1f2937);
    margin: 0 0 16px;
    text-transform: capitalize;
}

.diary-section {
    margin-bottom: 16px;
}

.diary-section:last-child {
    margin-bottom: 0;
}

.diary-section-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark-gray, #1f2937);
    margin-bottom: 8px;
}

.diary-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
}

.diary-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--dark-gray, #1f2937);
    cursor: pointer;
}

.diary-check input[type="checkbox"] {
    accent-color: var(--emerald, #059669);
}

.diary-radios {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.diary-radio {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--dark-gray, #1f2937);
    cursor: pointer;
}

.diary-radio input[type="radio"] {
    accent-color: var(--emerald, #059669);
}

.diary-stats {
    display: flex;
    gap: 24px;
    padding: 16px 20px;
    background: var(--light-gray, #f3f4f6);
    border-radius: var(--radius-lg, 12px);
}

.diary-stat {
    font-size: 14px;
    color: var(--dark-gray, #1f2937);
}

.diary-stat strong {
    color: var(--emerald, #059669);
}

/* ── Хайд-трекер в дневнике ──────────── */

.diary-hayd-divider {
    border: none;
    border-top: 1px solid var(--border-gray, #e5e7eb);
    margin: 24px 0;
}

.diary-hayd-section {
    max-width: 280px;
}

.diary-hayd-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 700;
    color: var(--dark-gray, #1f2937);
    margin: 0 0 12px;
}

.diary-hayd-status {
    margin-bottom: 10px;
}

.diary-hayd-status-label {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: var(--light-gray, #f3f4f6);
    color: var(--dark-gray, #374151);
}

.diary-hayd-mode-switch {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.diary-hayd-mode-btn {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--border-gray, #e5e7eb);
    background: var(--white, #fff);
    border-radius: 8px;
    font-size: 0.6875rem;
    color: var(--medium-gray, #6b7280);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.diary-hayd-mode-btn:hover {
    background: var(--light-gray, #f3f4f6);
}

.diary-hayd-mode-btn.active {
    background: var(--emerald-50, #ECFDF5);
    border-color: var(--emerald, #059669);
    color: var(--emerald-dark, #065F46);
    font-weight: 600;
}

.diary-hayd-calendar {
    margin-bottom: 12px;
}

.diary-hayd-cal-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
}

.diary-hayd-cal-header span {
    text-align: center;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--medium-gray, #6b7280);
    text-transform: uppercase;
}

.diary-hayd-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.diary-hayd-cal-empty {
    aspect-ratio: 1;
}

.diary-hayd-cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    border-radius: 6px;
    color: var(--dark-gray, #374151);
}

.diary-hayd-cal-day.today {
    font-weight: 700;
    box-shadow: inset 0 0 0 1.5px var(--emerald, #059669);
}

.diary-hayd-cal-day.hayd-day {
    background: rgba(220, 38, 38, 0.18);
}

.diary-hayd-cal-day.nifas-day {
    background: rgba(127, 29, 29, 0.22);
}

.diary-hayd-cal-day.istihada-day {
    background: rgba(245, 158, 11, 0.18);
}

.diary-hayd-adat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: var(--light-gray, #f9fafb);
    border-radius: 8px;
    font-size: 0.75rem;
    margin-bottom: 12px;
}

.diary-hayd-adat-label {
    color: var(--medium-gray, #6b7280);
}

.diary-hayd-adat-value {
    font-weight: 700;
    color: var(--dark-gray, #1f2937);
}

.diary-hayd-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: var(--emerald, #059669);
    color: #fff;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}

.diary-hayd-link:hover {
    background: var(--emerald-dark, #047857);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--emerald) 30%, transparent);
}

/* Onboarding в ЛК */
.diary-hayd-onboarding {
    padding: 10px 0;
}

.diary-hayd-onb-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.diary-hayd-onb-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1.5px solid var(--border-gray, #e5e7eb);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: border-color 0.15s;
}

.diary-hayd-onb-opt:hover {
    border-color: var(--emerald, #10B981);
}

.diary-hayd-onb-opt:has(input:checked) {
    border-color: var(--emerald, #10B981);
    background: rgba(16, 185, 129, 0.06);
}

.diary-hayd-onb-opt input[type="radio"] {
    accent-color: var(--emerald, #10B981);
}

/* Секция адата */
.diary-hayd-adat-section {
    padding: 10px 0;
    border-top: 1px solid var(--border-gray, #e5e7eb);
    margin-top: 8px;
}

.diary-hayd-edit-adat-btn {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 12px;
    font-size: 0.75rem;
    color: var(--emerald, #059669);
    background: transparent;
    border: 1px solid var(--emerald, #059669);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.12s;
}

.diary-hayd-edit-adat-btn:hover {
    background: var(--emerald, #059669);
    color: #fff;
}

.diary-hayd-adat-edit {
    padding: 10px;
    background: var(--light-gray, #f9fafb);
    border-radius: 8px;
    margin-top: 8px;
}

/* ── Settings ──────────────────────────── */
.settings-section {
    margin-bottom: 28px;
    max-width: 500px;
}

.settings-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark-gray, #1f2937);
    margin: 0 0 12px;
}

.settings-section .form-select {
    padding: 10px 14px;
    border: 1px solid var(--border-gray, #e5e7eb);
    border-radius: var(--radius-md, 8px);
    font-size: 14px;
    font-family: var(--font-primary, 'Inter', sans-serif);
    color: var(--dark-gray, #1f2937);
    background: var(--white, #fff);
    width: 100%;
}

.settings-section .form-select:focus {
    outline: none;
    border-color: var(--emerald, #059669);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--emerald) 10%, transparent);
}

.theme-swatches {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.theme-swatch {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all var(--transition-fast, 0.15s);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.theme-swatch:hover {
    transform: scale(1.1);
}

.theme-swatch.active {
    border-color: var(--dark-gray, #1f2937);
    box-shadow: 0 0 0 2px var(--white, #fff), 0 0 0 4px var(--dark-gray, #1f2937);
}

.font-size-options {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.settings-toggles {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--dark-gray, #1f2937);
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    accent-color: var(--emerald, #059669);
    width: 18px;
    height: 18px;
}

/* ── Access Gate / Premium lock ────────── */
.content-locked {
    position: relative;
    user-select: none;
}

.content-locked > *:not(.content-locked-overlay) {
    filter: blur(5px);
    pointer-events: none;
}

.content-locked-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-lg, 12px);
    z-index: 10;
    text-align: center;
    padding: 20px;
}

.content-locked-overlay .crown-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.content-locked-overlay p {
    font-size: 14px;
    color: var(--dark-gray, #1f2937);
    margin: 0 0 12px;
    max-width: 300px;
}

.content-locked-overlay .btn-upgrade {
    padding: 8px 24px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border: none;
    border-radius: var(--radius-md, 8px);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-primary, 'Inter', sans-serif);
}

.btn-upgrade:hover {
    opacity: 0.9;
}

/* ── Access gate: стили перенесены в global.css ── */

/* ── Bookmark toggle (inline in modules) ── */
.bookmark-toggle {
    background: none;
    border: 1px solid var(--border-gray, #d1d5db);
    border-radius: 8px;
    cursor: pointer;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.15s;
}

.bookmark-toggle:hover {
    background: var(--emerald-50, #ecfdf5);
    border-color: var(--emerald, #059669);
    color: var(--emerald, #059669);
}

.bookmark-toggle.active {
    color: var(--emerald, #059669);
    border-color: var(--emerald, #059669);
    background: var(--emerald-50, #ecfdf5);
}
.bookmark-toggle.active svg {
    fill: var(--emerald, #059669);
}

/* ── Stub tabs ──────────────────────────── */
.cabinet-stub {
    text-align: center;
    padding: 60px 20px;
    color: var(--medium-gray, #6b7280);
}

.cabinet-stub svg {
    width: 48px;
    height: 48px;
    stroke: var(--border-gray, #d1d5db);
    margin-bottom: 16px;
}

.cabinet-stub h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark-gray, #1f2937);
    margin: 0 0 8px;
}

.cabinet-stub p {
    font-size: 14px;
    margin: 0;
    max-width: 400px;
    margin-inline-start: auto;
    margin-inline-end: auto;
    line-height: 1.5;
}

/* ── Toast (дубликат для кабинета) ──────── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    border-radius: var(--radius-md, 8px);
    font-size: 14px;
    font-family: var(--font-primary, 'Inter', sans-serif);
    color: #fff;
    z-index: var(--z-toast, 800);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success { background: var(--emerald, #059669); }
.toast.error { background: var(--danger, #dc2626); }

/* ── Mobile: горизонтальные табы ─────────── */
@media (max-width: 768px) {
    .cabinet-header {
        padding: 0 16px;
    }

    .cabinet-back-link span {
        display: none;
    }

    .cabinet-user-name {
        display: none;
    }

    .cabinet-page {
        flex-direction: column;
    }

    .cabinet-sidebar {
        width: 100%;
        border-inline-end: none;
        border-bottom: 1px solid var(--border-gray, #e5e7eb);
        padding: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .cabinet-nav {
        flex-direction: row;
        gap: 0;
        padding: 0 8px;
        min-width: max-content;
    }

    .cabinet-nav-item {
        flex-direction: column;
        gap: 4px;
        padding: 10px 14px;
        border-radius: 0;
        font-size: 11px;
        white-space: nowrap;
        border-bottom: 2px solid transparent;
    }

    .cabinet-nav-item.active {
        background: transparent;
        border-bottom-color: var(--emerald, #059669);
    }

    .cabinet-nav-item:hover {
        background: transparent;
    }

    .cabinet-nav-item svg {
        width: 20px;
        height: 20px;
    }

    .cabinet-content {
        padding: 20px 16px;
    }

    .profile-form {
        grid-template-columns: 1fr;
    }

    .profile-actions {
        flex-direction: column;
    }

    .bm-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .bm-type-filters {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }

    .bm-controls {
        flex-direction: column;
    }

    .bm-search, .bm-folder-select {
        max-width: none;
    }

    .diary-layout {
        grid-template-columns: 1fr;
    }

    .diary-stats {
        flex-direction: column;
        gap: 10px;
    }

    .reading-start-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .reading-select {
        min-width: 100%;
    }

    .btn-go {
        width: 100%;
    }

    .question-summary {
        flex-wrap: wrap;
        gap: 6px 10px;
    }
}

/* ══════════════════════════════════════════════════════
   РАЗДЕЛ ХИЛЯЛЬ В КАБИНЕТЕ
   ══════════════════════════════════════════════════════ */

.cab-hilal-card {
    background: #fff;
    border: 1px solid var(--border-gray, #e5e7eb);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.cab-hilal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.cab-hilal-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark-gray, #1f2937);
}

.cab-hilal-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.cab-hilal-status-pending {
    background: #fef3c7;
    color: #92400e;
}

.cab-hilal-status-approved {
    background: #d1fae5;
    color: #065f46;
}

.cab-hilal-status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.cab-hilal-status-suspended {
    background: #e5e7eb;
    color: #4b5563;
}

.cab-hilal-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.cab-hilal-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cab-hilal-info-label {
    font-size: 12px;
    color: var(--medium-gray, #6b7280);
}

.cab-hilal-info-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--dark-gray, #1f2937);
}

.cab-hilal-actions {
    margin-top: 12px;
}

.cab-hilal-btn-primary {
    display: inline-block;
    padding: 10px 24px;
    background: var(--emerald, #059669);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s ease;
    cursor: pointer;
    border: none;
}

.cab-hilal-btn-primary:hover {
    background: #047857;
}

.cab-hilal-note {
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--light-gray, #f9fafb);
    border-radius: 8px;
    font-size: 13px;
    color: var(--medium-gray, #6b7280);
    line-height: 1.5;
}

.cab-hilal-promo {
    text-align: center;
    padding: 24px 16px;
}

.cab-hilal-promo-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.cab-hilal-promo h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark-gray, #1f2937);
    margin-bottom: 8px;
}

.cab-hilal-promo p {
    font-size: 14px;
    color: var(--medium-gray, #6b7280);
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 480px;
    margin-inline-start: auto;
    margin-inline-end: auto;
}

.cab-hilal-testimonies {
    display: flex;
    flex-direction: column;
}

.cab-hilal-testimony-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--light-gray, #f3f4f6);
}

.cab-hilal-testimony-row:last-child {
    border-bottom: none;
}

.cab-hilal-testimony-month {
    font-size: 14px;
    font-weight: 500;
    color: var(--dark-gray, #1f2937);
    min-width: 160px;
}

.cab-hilal-testimony-result {
    font-size: 13px;
    font-weight: 600;
    min-width: 100px;
}

.cab-hilal-seen {
    color: #059669;
}

.cab-hilal-notseen {
    color: #6b7280;
}

.cab-hilal-testimony-date {
    font-size: 12px;
    color: var(--medium-gray, #6b7280);
    margin-inline-start: auto;
}

.cab-hilal-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cab-hilal-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.cab-hilal-form-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cab-hilal-form-field label {
    font-size: 12px;
    font-weight: 500;
    color: var(--medium-gray, #6b7280);
}

.cab-hilal-input {
    padding: 10px 12px;
    border: 1px solid var(--border-gray, #e5e7eb);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font-primary, 'Inter', sans-serif);
    color: var(--dark-gray, #1f2937);
    background: var(--light-gray, #f9fafb);
    transition: border-color 0.15s ease;
    width: 100%;
    box-sizing: border-box;
}

.cab-hilal-input:focus {
    outline: none;
    border-color: var(--emerald, #059669);
    background: #fff;
}

@media (max-width: 480px) {
    .cab-hilal-info-grid {
        grid-template-columns: 1fr 1fr;
    }
    .cab-hilal-testimony-row {
        flex-wrap: wrap;
        gap: 4px 12px;
    }
    .cab-hilal-testimony-date {
        margin-inline-start: 0;
    }
    .cab-hilal-form-row {
        grid-template-columns: 1fr;
    }
}

/* ══════════════════════════════════════════════════════
   КОЛОКОЛЬЧИК УВЕДОМЛЕНИЙ
   ══════════════════════════════════════════════════════ */

.notify-bell-wrap {
    position: relative;
}

.notify-bell-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--medium-gray, #6b7280);
    transition: color 0.15s ease;
    display: flex;
    align-items: center;
}

.notify-bell-btn:hover {
    color: var(--emerald, #059669);
}

.notify-badge {
    position: absolute;
    top: 2px;
    right: 0;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    font-family: var(--font-primary, 'Inter', sans-serif);
}

.notify-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 420px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    border: 1px solid var(--border-gray, #e5e7eb);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notify-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-gray, #e5e7eb);
}

.notify-dropdown-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark-gray, #1f2937);
}

.notify-mark-all {
    background: none;
    border: none;
    font-size: 12px;
    color: var(--emerald, #059669);
    cursor: pointer;
    font-weight: 500;
}

.notify-mark-all:hover {
    text-decoration: underline;
}

.notify-dropdown-list {
    overflow-y: auto;
    flex: 1;
    max-height: 360px;
}

.notify-item {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--light-gray, #f3f4f6);
    cursor: pointer;
    transition: background 0.1s ease;
}

.notify-item:hover {
    background: var(--light-gray, #f9fafb);
}

.notify-item.unread {
    background: #f0fdf4;
}

.notify-item-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}

.notify-item-content {
    flex: 1;
    min-width: 0;
}

.notify-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark-gray, #1f2937);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notify-item-body {
    font-size: 12px;
    color: var(--medium-gray, #6b7280);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notify-item-time {
    font-size: 11px;
    color: var(--light-text, #9ca3af);
    margin-top: 4px;
}

.notify-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--medium-gray, #6b7280);
    font-size: 13px;
}

@media (max-width: 480px) {
    .notify-dropdown {
        width: calc(100vw - 24px);
        right: -8px;
    }
}

/* ══════════════════════════════════════════════════════
   ВКЛАДКА «НОВОСТИ» — подтабы и контент
   ══════════════════════════════════════════════════════ */

.cab-news-header {
    margin-bottom: 16px;
}

.cab-news-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-gray, #e5e7eb);
    margin-bottom: 24px;
}

.cab-news-tab {
    padding: 10px 24px;
    border: none;
    background: transparent;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--medium-gray, #6b7280);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font-primary, 'Inter', sans-serif);
}

.cab-news-tab:hover {
    color: var(--dark-gray, #1f2937);
}

.cab-news-tab.active {
    color: var(--emerald, #059669);
    border-bottom-color: var(--emerald, #059669);
}

.cab-news-content {
    min-height: 200px;
}

/* Пустое состояние */
.cab-news-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--medium-gray, #6b7280);
}

.cab-news-empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.cab-news-empty p {
    margin: 0 0 8px;
    font-size: 15px;
}

.cab-news-empty-hint {
    font-size: 13px;
    color: var(--light-text, #9ca3af);
    max-width: 400px;
    margin: 0 auto;
}

/* ── Карточка новости ── */
.cab-news-item {
    background: #fff;
    border: 1px solid var(--border-gray, #e5e7eb);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 12px;
    transition: box-shadow 0.15s ease;
}

.cab-news-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.cab-news-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}

.cab-news-item-icon {
    font-size: 1.1rem;
}

.cab-news-tag {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.cab-news-tag-hilal {
    background: #ecfdf5;
    color: #059669;
}

.cab-news-tag-update {
    background: #eff6ff;
    color: #2563eb;
}

.cab-news-tag-important {
    background: #fef2f2;
    color: #dc2626;
}

.cab-news-item-date {
    color: var(--light-text, #9ca3af);
    margin-inline-start: auto;
}

.cab-news-item-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-gray, #1f2937);
    margin: 0 0 8px;
    line-height: 1.4;
}

.cab-news-item-body {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary, #4b5563);
}

.cab-news-item-body p {
    margin: 0 0 8px;
}

/* ── Элемент уведомления (полная страница) ── */
.cab-notify-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--border-gray, #e5e7eb);
    border-radius: 10px;
    margin-bottom: 8px;
    background: #fff;
    transition: background 0.15s ease;
}

.cab-notify-item.unread {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.cab-notify-item.clickable {
    cursor: pointer;
}

.cab-notify-item.clickable:hover {
    background: #f9fafb;
}

.cab-notify-item.unread.clickable:hover {
    background: #e6fbee;
}

.cab-notify-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    padding-top: 2px;
}

.cab-notify-content {
    flex: 1;
    min-width: 0;
}

.cab-notify-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark-gray, #1f2937);
    margin-bottom: 4px;
}

.cab-notify-body {
    font-size: 13px;
    color: var(--text-secondary, #4b5563);
    line-height: 1.5;
    margin-bottom: 4px;
}

.cab-notify-time {
    font-size: 12px;
    color: var(--light-text, #9ca3af);
}

/* ══════════════════════════════════════════════════════════ */
/* ДНЕВНИК: КАРТОЧКИ ДОЛГОВ ПОКЛОНЕНИЙ                         */
/* ══════════════════════════════════════════════════════════ */

.diary-debts-panel {
    margin-bottom: 24px;
}

.diary-debts-loading {
    padding: 14px;
    color: var(--medium-gray, #6b7280);
    font-size: 13px;
}

.diary-debts-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark-gray, #1f2937);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.diary-debts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.diary-debt-card {
    border: 1px solid var(--border-gray, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
    background: var(--white, #fff);
    padding: 14px 16px;
}

.diary-debt-card--prayers {
    border-inline-start: 4px solid #b45309; /* янтарный акцент — это долг, не награда */
}
.diary-debt-card--fasts {
    border-inline-start: 4px solid #b45309;
}
.diary-debt-card--forgiven {
    border-inline-start: 4px solid var(--emerald, #059669);
    background: color-mix(in srgb, var(--emerald, #059669) 4%, var(--white, #fff));
}

.diary-debt-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.diary-debt-icon {
    font-size: 20px;
    line-height: 1;
}

.diary-debt-title {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark-gray, #1f2937);
}

.diary-debt-total {
    font-size: 20px;
    font-weight: 700;
    color: #b45309;
}
.diary-debt-card--forgiven .diary-debt-total {
    color: var(--emerald-dark, #065f46);
}

.diary-debt-breakdown {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px 10px;
    margin-bottom: 10px;
}

.diary-debt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: var(--light-gray, #f3f4f6);
    border-radius: 6px;
    font-size: 12px;
}

.diary-debt-p-label {
    color: var(--medium-gray, #6b7280);
}

.diary-debt-p-count {
    font-weight: 700;
    color: #b45309;
}
.diary-debt-p-count.zero {
    color: var(--light-text, #9ca3af);
    font-weight: 500;
}

.diary-debt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.diary-debt-hayd {
    padding: 10px;
    background: color-mix(in srgb, #b45309 8%, var(--white, #fff));
    border-radius: 8px;
    margin-bottom: 10px;
}

.diary-debt-hayd-label,
.diary-debt-own-label {
    font-size: 13px;
    color: var(--dark-gray, #1f2937);
    margin-bottom: 6px;
}

.diary-debt-hayd-year {
    font-size: 12px;
    color: var(--medium-gray, #6b7280);
    padding: 2px 0;
}

.diary-debt-own {
    padding-top: 4px;
}

.diary-debt-hint {
    font-size: 12px;
    color: var(--medium-gray, #6b7280);
    margin-bottom: 10px;
    font-style: italic;
}

.diary-kada-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--emerald, #059669);
    background: var(--emerald, #059669);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}
.diary-kada-btn:hover:not([disabled]) {
    background: var(--emerald-dark, #047857);
    border-color: var(--emerald-dark, #047857);
}
.diary-kada-btn[disabled] {
    background: var(--light-gray, #f3f4f6);
    border-color: var(--border-gray, #e5e7eb);
    color: var(--light-text, #9ca3af);
    cursor: not-allowed;
}
.diary-kada-btn--bulk {
    background: transparent;
    color: var(--emerald, #059669);
}
.diary-kada-btn--bulk:hover:not([disabled]) {
    background: color-mix(in srgb, var(--emerald, #059669) 10%, transparent);
    color: var(--emerald-dark, #047857);
}
.diary-kada-btn--hayd {
    margin-top: 6px;
}
.diary-kada-btn--link {
    background: var(--emerald, #059669);
}
.diary-kada-btn--mini {
    padding: 4px 10px;
    font-size: 11px;
}

/* ── Модалка ─── */
.diary-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.diary-modal-box {
    background: var(--white, #fff);
    border-radius: var(--radius-lg, 12px);
    padding: 20px 24px;
    max-width: 460px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.diary-modal-box h3 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-gray, #1f2937);
}
.diary-modal-hint {
    font-size: 13px;
    color: var(--medium-gray, #6b7280);
    margin: 0 0 14px;
    line-height: 1.5;
}
.diary-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
    flex-wrap: wrap;
}
.diary-modal-cancel {
    padding: 6px 14px;
    font-size: 13px;
    background: transparent;
    color: var(--medium-gray, #6b7280);
    border: 1px solid var(--border-gray, #e5e7eb);
    border-radius: 6px;
    cursor: pointer;
}
.diary-modal-cancel:hover {
    background: var(--light-gray, #f3f4f6);
}

.diary-kada-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}
.diary-kada-opt {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border: 1px solid var(--border-gray, #e5e7eb);
    background: var(--white, #fff);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}
.diary-kada-opt:hover:not([disabled]) {
    border-color: var(--emerald, #059669);
    background: color-mix(in srgb, var(--emerald, #059669) 5%, transparent);
}
.diary-kada-opt[disabled] {
    background: var(--light-gray, #f3f4f6);
    color: var(--light-text, #9ca3af);
    cursor: not-allowed;
}
.diary-kada-opt-name {
    font-weight: 600;
    color: var(--dark-gray, #1f2937);
}
.diary-kada-opt-count {
    font-weight: 700;
    color: #b45309;
    background: color-mix(in srgb, #b45309 10%, transparent);
    padding: 2px 10px;
    border-radius: 10px;
    min-width: 28px;
    text-align: center;
}
.diary-kada-opt[disabled] .diary-kada-opt-count {
    color: var(--light-text, #9ca3af);
    background: transparent;
}

.diary-bulk-auto {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--light-gray, #f3f4f6);
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    flex-wrap: wrap;
}
.diary-bulk-auto input {
    width: 60px;
    padding: 4px 8px;
    font-size: 13px;
    border: 1px solid var(--border-gray, #e5e7eb);
    border-radius: 4px;
}
.diary-bulk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}
.diary-bulk-field {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.diary-bulk-field span {
    flex: 1;
    color: var(--medium-gray, #6b7280);
}
.diary-bulk-field input {
    width: 70px;
    padding: 4px 8px;
    font-size: 13px;
    border: 1px solid var(--border-gray, #e5e7eb);
    border-radius: 4px;
    text-align: end;
}

/* ── Чекбокс "пропущено" — янтарный цвет, не зелёный ── */
.diary-check--missed input[type="checkbox"] {
    accent-color: #b45309;
}

/* ── Бейдж "сунна-день" ── */
.diary-sunnah-badge {
    display: inline-block;
    padding: 2px 8px;
    background: color-mix(in srgb, var(--emerald, #059669) 15%, transparent);
    color: var(--emerald-dark, #065f46);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-inline-start: 8px;
}

/* ── Презумпция выполнения (подсказка в форме дня) ── */
.diary-section-hint,
.diary-presumption-hint {
    font-size: 12px;
    color: var(--medium-gray, #6b7280);
    font-style: italic;
    margin: 4px 0 8px;
}

.diary-ramadan-hint {
    font-size: 12px;
    color: var(--emerald-dark, #065f46);
    background: color-mix(in srgb, var(--emerald, #059669) 10%, transparent);
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    display: inline-block;
}

.diary-check--disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ══════════════════════════════════════════════════════════
   Блок 5 (отделка): скелетоны, SVG-иконки, анимация вкладок
   ══════════════════════════════════════════════════════════ */

/* Стопка карточек-скелетонов на время загрузки вкладки (см. cabSkeleton в JS) */
.cab-skeleton-list {
    display: grid;
    gap: 12px;
}

/* Инлайн stroke-SVG иконки интерфейса (cabIcon в JS) — выравнивание по тексту */
.cab-ico {
    display: inline-block;
    vertical-align: -0.15em;
    flex-shrink: 0;
}

/* Появление контента вкладки: мягкий fade + сдвиг (навешивается в loadTab) */
@media (prefers-reduced-motion: no-preference) {
    .tab-enter {
        animation: cabTabEnter 0.18s ease-out;
    }
    @keyframes cabTabEnter {
        from { opacity: 0; transform: translateY(4px); }
        to   { opacity: 1; transform: none; }
    }
}

/* ── Вкладка «ИИ-поиск» ── */
.cab-ai-quota { padding: 14px 18px; border-radius: var(--radius-lg); background: var(--surface-1); border: 1px solid var(--border-subtle); margin-bottom: 20px; }
.cab-ai-quota-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-1); margin: 4px 0; }
.cab-ai-bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin: 6px 0 10px; }
.cab-ai-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.cab-ai-costs, .cab-ai-note { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.cab-ai-subtitle { font-size: 15px; margin: 18px 0 4px; color: var(--text-1); }
.cab-ai-item { align-items: flex-start; }
.cab-ai-item .history-title { display: flex; flex-direction: column; gap: 2px; white-space: normal; }
.cab-ai-open { color: var(--text-1); text-decoration: none; font-weight: 600; }
.cab-ai-open:hover { color: var(--accent); }
.cab-ai-meta { font-size: 12px; color: var(--text-3); }
.cab-ai-actions { display: flex; gap: 6px; flex-shrink: 0; }
.cab-ai-btn { border: 1px solid var(--border-subtle); background: transparent; color: var(--text-2); border-radius: var(--radius-full); padding: 2px 10px; font-size: 12px; cursor: pointer; text-decoration: none; font-family: inherit; }
.cab-ai-btn:hover { border-color: var(--accent); color: var(--accent); }
.cab-ai-btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.cab-ai-btn.danger:hover { border-color: var(--danger); color: var(--danger); }

/* ── Вкладка «Подписка» (renderSubscriptionTab, данные — /api/me/entitlements) ── */
.cab-sub-current { display: flex; flex-direction: column; gap: 2px; }
.cab-sub-plan-name { font-size: 18px; font-weight: 700; color: var(--text-1); }
.cab-sub-features { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin: 10px 0 6px; }
.cab-sub-feature { padding: 12px 14px; border-radius: var(--radius-lg); background: var(--surface-1); border: 1px solid var(--border-subtle); }
.cab-sub-feature-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--text-1); margin-bottom: 4px; }
.cab-sub-feature-name { font-weight: 600; }
.cab-sub-ok { font-size: 12px; color: var(--accent); white-space: nowrap; }
.cab-sub-off { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.cab-sub-packs { padding: 8px 14px; border-radius: var(--radius-lg); background: var(--surface-1); border: 1px solid var(--border-subtle); }
.cab-sub-plans { margin-top: 10px; }
.cab-sub-req { display: flex; flex-direction: column; gap: 8px; max-width: 520px; margin-top: 8px; }
.cab-sub-req select, .cab-sub-req textarea { font: inherit; font-size: 14px; padding: 8px 10px; border-radius: var(--radius-md, 8px); border: 1px solid var(--border-subtle); background: var(--surface-1); color: var(--text-1); }
.cab-sub-req button { align-self: flex-start; }
.cab-sub-req-status { font-size: 13px; color: var(--text-2); margin: 6px 0; }

.cab-sub-buy-packs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.cab-sub-buy-packs .kpw-btn { width: auto; }
.cab-pay-pending { color: var(--text-2); }
.cab-pay-failed { color: var(--danger); }

.cab-crypto-start { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.cab-crypto-start select { font: inherit; font-size: 14px; padding: 8px 10px; border-radius: var(--radius-md, 8px); border: 1px solid var(--border-subtle); background: var(--surface-1); color: var(--text-1); }
.cab-crypto-start .kpw-btn { width: auto; }
