/* diary.css — вкладка ДНЕВНИК. Хитмап год×дни, серии, пропуски, % покрытия. */
/* Токены берутся из styles.css :root (--accent, --cal-level-*, --bg-* и т.д.) */

#view-diary.active { display: flex; flex-direction: column; gap: 14px; padding-bottom: 24px; }

.diary-loading, .diary-empty {
    text-align: center; color: var(--text-secondary);
    padding: 40px 16px; font-size: 13px;
}
.diary-empty .diary-sub, .diary-sub { color: var(--text-muted); font-size: 11px; }

/* ── метрик-карточки ── */
.diary-cards {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
@media (min-width: 560px) { .diary-cards { grid-template-columns: repeat(4, 1fr); } }
.diary-card {
    position: relative; overflow: hidden;
    background: linear-gradient(180deg, rgba(22,29,38,.9), rgba(20,25,31,.95));
    border: 1px solid var(--border-color); border-radius: 8px;
    padding: 12px 12px 11px; display: flex; flex-direction: column; gap: 3px;
}
.diary-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 46px; height: 2px;
    background: var(--accent); box-shadow: 0 0 6px rgba(95,180,201,.5);
}
.diary-card-streak::before { background: var(--ds-amber, #DC8D18); box-shadow: 0 0 6px rgba(220,141,24,.55); }
.diary-card-best::before   { background: var(--gold, #F4D136); box-shadow: 0 0 6px rgba(244,209,54,.5); }
.diary-card-icon { font-size: 15px; line-height: 1; }
.diary-card-val {
    font-size: 26px; font-weight: 600; color: var(--text-primary);
    font-variant-numeric: tabular-nums; letter-spacing: -.5px; line-height: 1.05;
}
.diary-card-streak .diary-card-val { color: var(--ds-amber, #DC8D18); }
.diary-card-best .diary-card-val   { color: var(--gold, #F4D136); }
.diary-card-lbl { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .8px; line-height: 1.4; }
.diary-card-lbl span { text-transform: none; letter-spacing: 0; color: var(--text-secondary); font-size: 10px; }
.diary-range { text-align: center; color: var(--text-muted); font-size: 11px; margin-top: -4px; }

/* ── секц-заголовки ── */
.diary-sec-title {
    font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--text-secondary); display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 6px;
}
.diary-legend { display: inline-flex; align-items: center; gap: 3px; font-size: 9px; color: var(--text-muted); letter-spacing: .3px; text-transform: none; }
.diary-legend .gh-cell { width: 9px; height: 9px; }

/* ── селектор года ── */
.diary-yearpick {
    display: flex; gap: 5px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}
.diary-yearbtn {
    flex: 0 0 auto; background: var(--bg-card, #161D26); border: 1px solid var(--border-color);
    color: var(--text-secondary); font-family: inherit; font-size: 12px; font-variant-numeric: tabular-nums;
    padding: 5px 11px; border-radius: 5px; cursor: pointer;
}
.diary-yearbtn:hover { color: var(--text-primary); border-color: var(--border-light, #3A4858); }
.diary-yearbtn.active { background: var(--accent); color: #0E1419; border-color: var(--accent); font-weight: 600; }

/* ── GitHub-style хитмап одного года (во всю ширину, без листания) ── */
.gh { background: rgba(14,20,25,.5); border: 1px solid var(--border-color); border-radius: 8px; padding: 10px 12px 12px; }
.gh-months { display: grid; gap: 2px; margin-left: 24px; margin-bottom: 3px; height: 12px; }
.gh-mon { font-size: 9px; color: var(--text-muted); grid-row: 1; align-self: end; }
.gh-body { display: flex; gap: 4px; }
.gh-wd { display: grid; grid-template-rows: repeat(7, 1fr); gap: 2px; width: 20px; }
.gh-wd span { font-size: 8px; color: var(--text-muted); display: flex; align-items: center; }
.gh-grid { flex: 1; display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 2px; }
.gh-cell { width: 100%; height: 100%; border-radius: 2px; background: var(--cal-level-0-bg, #161D26); }
.gh-cell.l1 { background: var(--cal-level-1, #1F3B47); }
.gh-cell.l2 { background: var(--cal-level-2, #2D5C6E); }
.gh-cell.l3 { background: var(--cal-level-3, #4690A8); }
.gh-cell.l4 { background: var(--cal-level-4, #5FB4C9); }
.gh-cell.gh-pad { background: transparent; }
.gh-cell[data-d] { cursor: pointer; }
.gh-cell[data-d]:hover { outline: 1px solid var(--accent); outline-offset: 1px; }
.gh-cell.gh-today { outline: 1.5px solid var(--ds-amber, #DC8D18); outline-offset: 0; z-index: 1; }
.gh-stat { margin-top: 9px; font-size: 11px; color: var(--text-secondary); text-align: center; }
.gh-stat b { color: var(--accent); font-variant-numeric: tabular-nums; }
.diary-hint { font-size: 10px; color: var(--text-muted); text-align: right; margin-top: 6px; }

/* ── две колонки: топ серий / пропуски ── */
.diary-twocol { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .diary-twocol { grid-template-columns: 1fr 1fr; } }
.diary-list ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.diary-list li {
    display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--text-secondary);
    padding: 5px 8px; background: var(--bg-card, #161D26); border: 1px solid var(--border-color); border-radius: 4px;
}
.diary-list li b { color: var(--accent); font-variant-numeric: tabular-nums; font-size: 14px; min-width: 26px; }
.diary-list li span { color: var(--text-muted); font-size: 10px; margin-left: auto; }

/* ── % покрытия по годам ── */
.diary-years { display: flex; flex-direction: column; gap: 4px; }
.diary-ybar { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 1px 3px; border-radius: 3px; }
.diary-ybar:hover { background: rgba(95,180,201,.06); }
.diary-ybar.active .diary-ybar-y { color: var(--accent); font-weight: 600; }
.diary-ybar.active .diary-ybar-fill { box-shadow: 0 0 6px rgba(95,180,201,.5); }
.diary-ybar-y { width: 34px; font-size: 11px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.diary-ybar-track { flex: 1; height: 10px; background: var(--bg-card, #161D26); border: 1px solid var(--border-color); border-radius: 3px; overflow: hidden; }
.diary-ybar-fill { height: 100%; background: linear-gradient(90deg, var(--ds-chiral, #5FB4C9), var(--accent, #5FB4C9)); }
.diary-ybar-v { width: 70px; text-align: right; font-size: 10px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.diary-ybar-v small { color: var(--text-muted); font-size: 9px; margin-left: 4px; }

/* ── пикер записей дня (когда несколько) ── */
.diary-picker {
    position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center;
    background: rgba(8,12,16,.7); backdrop-filter: blur(3px); padding: 20px;
}
.diary-picker-card {
    width: 100%; max-width: 460px; max-height: 70vh; overflow: hidden;
    background: var(--bg-card, #161D26); border: 1px solid var(--border-light, #3A4858); border-radius: 10px;
    display: flex; flex-direction: column;
}
.diary-picker-head {
    padding: 12px 14px; font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between;
}
.diary-picker-x { background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; line-height: 1; }
.diary-picker-body { overflow-y: auto; }
.diary-picker-list { display: flex; flex-direction: column; }
.diary-picker-item {
    text-align: left; background: none; border: none; border-bottom: 1px solid var(--border-color);
    color: var(--text-primary); font-family: inherit; font-size: 13px; padding: 12px 14px; cursor: pointer;
}
.diary-picker-item:hover { background: var(--bg-card-hover, #1D2832); color: var(--accent); }

/* ── коллаж фото дня ── */
.diary-collage-h { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; padding: 10px 14px 6px; }
.diary-collage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 0 14px 12px; }
.diary-thumb { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; cursor: pointer; background: var(--bg-card, #161D26); }
.diary-thumb:hover { outline: 1.5px solid var(--accent); outline-offset: -1px; }

/* ── лайтбокс ── */
.diary-light {
    position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center;
    background: rgba(6,9,12,.92); backdrop-filter: blur(4px);
}
.diary-light img { max-width: 92vw; max-height: 86vh; border-radius: 8px; object-fit: contain; }
.diary-light-nav {
    position: absolute; top: 50%; transform: translateY(-50%); background: rgba(22,29,38,.6);
    border: 1px solid var(--border-light, #3A4858); color: var(--text-primary); font-size: 28px; line-height: 1;
    width: 44px; height: 64px; border-radius: 8px; cursor: pointer;
}
.diary-light-prev { left: 12px; }
.diary-light-next { right: 12px; }
.diary-light-x {
    position: absolute; top: 14px; right: 16px; background: none; border: none; color: #fff; font-size: 30px; cursor: pointer; line-height: 1;
}
