/* =========================================
   APP HOME
   Стили главного экрана /app:
   прогресс за сегодня, профиль участника,
   быстрый обзор недели, сопровождение,
   дневник терапии, сообщество.
   ========================================= */

.app-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) 360px;
    gap: 18px;
    align-items: stretch;
}

.app-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) 360px;
    gap: 18px;
    align-items: stretch;
}

.app-overview-side-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.today-summary-card,
.profile-status-card {
    min-height: 100%;
}

.today-summary-head,
.community-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.today-summary-title {
    margin: 0;
    font-size: 34px;
    line-height: 1.06;
    letter-spacing: -0.04em;
    color: #241f24;
    font-weight: 800;
}

.today-summary-subtitle {
    margin: 10px 0 0;
    color: #756c76;
    font-size: 15px;
    line-height: 1.7;
}

.today-metrics-grid {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.today-metric-card {
    position: relative;
    overflow: hidden;
    min-height: 248px;
    padding: 20px;
    border-radius: 24px;
    border: 1px solid rgba(234, 223, 229, 0.9);
    box-shadow: var(--shadow-soft);
    background: #fff;
    display: flex;
    flex-direction: column;
}

.today-metric-fill {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 100%;
    opacity: 1;
    transition: width 0.2s ease;
}

.today-metric-card.pink .today-metric-fill {
    background: linear-gradient(90deg, rgba(255, 194, 224, 0.98) 0%, rgba(255, 228, 240, 0.78) 100%);
}

.today-metric-card.blue .today-metric-fill {
    background: linear-gradient(90deg, rgba(160, 214, 255, 0.98) 0%, rgba(216, 238, 255, 0.8) 100%);
}

.today-metric-card.gold .today-metric-fill {
    background: linear-gradient(90deg, rgba(255, 213, 133, 0.98) 0%, rgba(255, 240, 209, 0.8) 100%);
}

.today-metric-card.green .today-metric-fill {
    background: linear-gradient(90deg, rgba(158, 231, 184, 0.98) 0%, rgba(223, 246, 231, 0.8) 100%);
}

.today-metric-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    height: 100%;
}

.today-metric-actions {
    margin-top: auto;
    padding-top: 16px;
}

.today-metric-btn {
    width: 100%;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid rgba(219, 39, 119, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98);
    color: #5a4a56;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.metric-title {
    margin: 0;
    color: #6d6470;
    font-size: 14px;
    font-weight: 600;
}

.metric-value {
    margin-top: 12px;
    font-size: 28px;
    line-height: 1.1;
    font-weight: 800;
    color: #241f24;
}

.metric-meta {
    margin: 10px 0 0;
    color: #8a818b;
    font-size: 13px;
    line-height: 1.5;
}

.profile-status-card {
    height: 100%;
}

.profile-status-actions {
    margin-top: 18px;
}

.profile-apply-btn {
    width: 100%;
}

.weekly-summary-metrics {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.weekly-mini-stat {
    padding: 16px 16px 14px;
    border-radius: 18px;
    background: rgba(255, 251, 253, 0.96);
    border: 1px solid rgba(234, 223, 229, 0.86);
}

.weekly-mini-value {
    font-size: 22px;
    font-weight: 800;
    color: #241f24;
}

.weekly-mini-value.value-good {
    color: #1f9d57;
}

.weekly-mini-value.value-bad {
    color: #d94b6a;
}

.weekly-mini-label {
    margin: 8px 0 0;
    color: #756c76;
    font-size: 13px;
    line-height: 1.4;
}

.weekly-overview-chart {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.weekly-overview-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.weekly-overview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.weekly-overview-label {
    color: #302830;
    font-size: 15px;
    font-weight: 700;
}

.weekly-overview-note {
    color: #8b7f89;
    font-size: 13px;
}

.weekly-overview-track {
    height: 16px;
    border-radius: 999px;
    background: rgba(239, 234, 238, 0.96);
    overflow: hidden;
}

.weekly-overview-fill {
    height: 100%;
    border-radius: 999px;
}

.weekly-overview-fill.pink {
    background: linear-gradient(90deg, rgba(219, 39, 119, 0.72) 0%, rgba(239, 76, 151, 1) 100%);
}

.weekly-overview-fill.blue {
    background: linear-gradient(90deg, rgba(86, 164, 255, 0.72) 0%, rgba(58, 140, 255, 1) 100%);
}

.weekly-overview-fill.gold {
    background: linear-gradient(90deg, rgba(232, 169, 63, 0.72) 0%, rgba(241, 189, 82, 1) 100%);
}

.weekly-overview-fill.green {
    background: linear-gradient(90deg, rgba(68, 181, 113, 0.72) 0%, rgba(55, 168, 101, 1) 100%);
}

.support-card {
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-height: 100%;
}

.support-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.therapy-diary-block,
.support-actions-block {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.small-add-btn {
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(219, 39, 119, 0.18);
    background: rgba(255, 248, 251, 0.96);
    color: #6f5866;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.therapy-inline-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 800;
    color: #241f24;
}

.therapy-inline-text {
    margin: 10px 0 0;
    color: #756c76;
    font-size: 14px;
    line-height: 1.7;
}

.therapy-med-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.medicine-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 14px;
    border-radius: 18px;
    border: 1px solid rgba(234, 223, 229, 0.86);
    background: rgba(255, 251, 253, 0.96);
}

.medicine-item-main {
    min-width: 0;
}

.medicine-item-title {
    margin: 0;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 800;
    color: #241f24;
}

.medicine-item-subtitle {
    margin: 8px 0 0;
    color: #756c76;
    font-size: 13px;
    line-height: 1.6;
}

.medicine-delete-btn {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid rgba(217, 75, 106, 0.18);
    background: #fff;
    color: #b14a67;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.community-feed-list {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.community-post-card {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 251, 253, 0.96);
    border: 1px solid rgba(234, 223, 229, 0.86);
}

.community-post-image-wrap {
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(180deg, #fff4fa 0%, #fff 100%);
    min-height: 160px;
}

.community-post-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #fff;
}

.community-post-category {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 241, 247, 0.96);
    color: var(--pink);
    font-size: 12px;
    font-weight: 800;
}

.community-post-title {
    margin: 12px 0 0;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 800;
    color: #241f24;
}

.community-post-meta {
    margin: 10px 0 0;
    color: #9b6a84;
    font-size: 13px;
    font-weight: 700;
}

.community-post-text {
    margin: 10px 0 0;
    color: #706772;
    font-size: 15px;
    line-height: 1.7;
}

@media (max-width: 1000px) {

    .app-top-grid,
    .app-overview-grid,
    .today-metrics-grid,
    .weekly-summary-metrics {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {

    .today-summary-head,
    .community-section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .today-summary-title {
        font-size: 28px;
    }

    .community-post-card {
        grid-template-columns: 1fr;
    }

    .community-post-image-wrap {
        min-height: 180px;
    }
}