/* Экран «Дневник» (06.08.2026).

   Показывает только то, что копится само, пока человек занимается. Спокойный вид:
   ни счётчиков выполнения плана, ни красного. Верхний блок отвечает на «зачем я сюда
   зашла», график — «что происходит», лента — «а что конкретно было». */

.dy-card {
    background: var(--surface, #fff);
    border: 1px solid var(--border, rgba(0,0,0,0.05));
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: none;
}

.dy-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.dy-card-title { font: 500 1rem/1.375 var(--font-family); color: var(--text-primary); }
.dy-card-meta { font: 400 .875rem/1.25rem var(--font-family); color: var(--text-secondary); }

.dy-empty {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.5;
    padding: 6px 0;
}

/* ── Вывод сверху ── */
.dy-verdict {
    display: grid;
    gap: 4px;
}

.dy-verdict-period {
    color: var(--text-secondary);
    font: 400 .875rem/1.25rem var(--font-family);
}

.dy-verdict-count {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
    flex-wrap: wrap;
}

.dy-verdict-num {
    color: var(--text-primary);
    font: 500 1.25rem/1.625rem var(--font-family);
    font-variant-numeric: tabular-nums;
}

.dy-verdict-txt {
    color: var(--text-primary);
    font: 500 1rem/1.375rem var(--font-family);
}

/* ── График ── */
.dy-chart { width: 100%; height: auto; display: block; margin-top: 4px; }

.dy-grid    { stroke: var(--border, #E0D7CA); stroke-width: .6; }
.dy-lbl     { font-size: 7.5px; fill: var(--text-secondary); }
.dy-lbl-y   { font-size: 7.5px; fill: var(--text-secondary); }
.dy-ln-pre  { fill: none; stroke: var(--text-secondary); stroke-width: 1.5; stroke-dasharray: 3 2.5; opacity: .75; }
.dy-ln-post { fill: none; stroke: var(--primary); stroke-width: 2.2; stroke-linejoin: round; }
.dy-dot-pre { fill: var(--surface, #fff); stroke: var(--text-secondary); stroke-width: 1.3; }
.dy-dot-post{ fill: var(--primary); }

.dy-legend {
    display: flex;
    gap: 14px;
    margin-top: 6px;
    font-size: 11.5px;
    color: var(--text-secondary);
}

.dy-legend i {
    display: inline-block;
    width: 14px;
    height: 0;
    border-top: 2px solid var(--primary);
    vertical-align: 3px;
    margin-right: 5px;
}

.dy-legend .pre i { border-top: 2px dashed var(--text-secondary); }

/* ── Вес ── */
.dy-weight-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 14px;
    color: var(--text-primary);
}

.dy-weight-v { font-weight: 700; font-variant-numeric: tabular-nums; }

.dy-weight-hint {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.4;
}

.dy-weight-edit {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.dy-weight-input {
    flex: 1;
    min-width: 0;
    padding: 11px 12px;
    font-size: 15px;
    border: 1px solid var(--border, rgba(0,0,0,0.1));
    border-radius: 10px;
    background: var(--surface, #fff);
    color: var(--text-primary);
    font: 400 1rem/1.25rem var(--font-family);
}

.dy-weight-input:focus-visible { outline: 2px solid var(--success, #526B58); outline-offset: 2px; }

.dy-weight-save {
    min-height: 44px;
    flex-shrink: 0;
    padding: 11px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--accent-fill);
    color: #fff;
    font: 500 1rem/1.25rem var(--font-family);
    cursor: pointer;
}

.dy-weight-save:active { transform: scale(0.97); }
.dy-weight-save:disabled { opacity: .6; }

/* График веса. Появляется с первой отметки: точка на фоне пунктира цели уже
   показывает расстояние, которое предстоит пройти. */
.dy-w-chart { width: 100%; height: auto; display: block; margin: 10px 0 2px; }

.dy-w-line {
    fill: none;
    stroke: var(--primary);
    stroke-width: 2.2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.dy-w-dot { fill: var(--primary); }

.dy-w-goal {
    stroke: var(--text-secondary);
    stroke-width: 1;
    stroke-dasharray: 4 3;
    opacity: .55;
}

.dy-weight-note {
    font-size: 11.5px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-top: 2px;
}

/* ── Период дневника ── */
.dy-period {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 3.5rem), 1fr));
    gap: 2px;
    min-width: 0;
    margin: 0 0 12px;
    padding: 4px;
    border: 0;
    border-radius: 12px;
    background: var(--surface-secondary);
}

.dy-period label {
    position: relative;
    min-width: 0;
    cursor: pointer;
}

.dy-period input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.dy-period span {
    display: grid;
    place-items: center;
    min-height: 44px;
    padding: 4px 2px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text-secondary);
    font: 500 .8125rem/1.125rem var(--font-family);
    text-align: center;
}

.dy-period input:checked + span {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-primary);
    font-weight: 600;
}

.dy-period input:focus-visible + span,
.dy-history summary:focus-visible,
.dy-history-more:focus-visible {
    outline: 2px solid var(--success, #526B58);
    outline-offset: -2px;
}

/* История всех тренировок раскрывается в Дневнике. */
.dy-history { padding: 0; }

.dy-history summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    min-height: 44px;
    border-radius: inherit;
    color: var(--text-primary);
    font: 500 1rem/1.375rem var(--font-family);
    list-style: none;
    cursor: pointer;
}
.dy-history summary::-webkit-details-marker { display: none; }
.dy-history summary .homeza-icon { color: var(--accent-ink, var(--primary-dark, var(--primary))); }
.dy-history[open] .dy-history-chevron { transform: rotate(180deg); }
.dy-history-body { padding: 0 16px 12px; }
.dy-history-meta {
    margin: 0 0 8px;
    color: var(--text-secondary);
    font-size: 12px;
}
.dy-history .wj-empty-hint {
    padding: 10px 0;
    text-align: left;
    font-size: 13px;
}
.dy-history .wj-card {
    box-shadow: none;
    background: var(--surface-secondary);
}
.dy-history-more {
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 12px;
    background: var(--primary-very-light);
    color: var(--accent-ink, var(--primary-dark, var(--primary)));
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.dy-history-more:disabled { opacity: .6; }

#progress-screen {
    background: var(--bg-dashboard);
    height: 100%;
    min-height: 0;
}

.diary-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    margin: 0 var(--homeza-screen-gutter, 16px);
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.diary-tabs button {
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font: 500 .875rem/1.25rem var(--font-family);
    cursor: pointer;
}

.diary-tabs button[aria-selected="true"] {
    border-color: var(--text-primary);
    color: var(--text-primary);
    font-weight: 600;
}

.diary-tabs button:focus-visible {
    outline: 2px solid var(--success, #526B58);
    outline-offset: -2px;
}

#progress-screen .main-content--diary {
    min-height: 0;
    padding: 12px var(--homeza-screen-gutter, 16px) 90px;
}

.diary-tree-title {
    margin: 2px 0 10px;
    color: var(--text-primary);
    font: 500 1.25rem/1.625rem var(--font-family);
    letter-spacing: -.02em;
}

.dy-weight-entry .dy-weight-edit {
    margin: 0;
    padding: 0 16px 12px;
}

.dy-entry-value {
    color: var(--accent-ink);
    font-variant-numeric: tabular-nums;
}

.dy-feed-day h2 {
    margin: 0 0 9px;
    color: var(--text-primary);
    font: 500 1rem/1.375rem var(--font-family);
}

.dy-feed-day ul {
    display: grid;
    gap: 8px;
    padding: 0;
    list-style: none;
}

.dy-feed-entry {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    color: var(--text-primary);
    font: 400 1rem/1.375rem var(--font-family);
}

.dy-feed-entry svg {
    width: 20px;
    height: 20px;
    margin-top: 1px;
    color: var(--text-primary);
    stroke-width: 1.75;
}

.dy-workout-title {
    font: 500 1rem/1.375rem var(--font-family);
    overflow-wrap: anywhere;
}

.dy-workout-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
    margin-top: 4px;
}

.diary-workout-result {
    display: inline-block;
    color: var(--success, #526B58);
    font: 500 .875rem/1.25rem var(--font-family);
}

.diary-workout-result.is-partial { color: var(--text-secondary); }
.wj-card > .diary-workout-result { margin-bottom: 6px; }

.dy-feed-entry small {
    display: block;
    color: var(--text-secondary);
    font: 400 .875rem/1.25rem var(--font-family);
    overflow-wrap: anywhere;
}

.dy-charts-body { padding: 0 12px 1px; }
