.page-day {
    --shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    background: radial-gradient(circle at 90% 10%, rgba(25, 118, 210, 0.08), transparent 35%),
        var(--bg);
}

.day-date-nav {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.day-date-nav-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    line-height: 1;
    cursor: pointer;
}

.day-date-current {
    border: 0;
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
}

.day-date-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-weight: 600;
    white-space: nowrap;
    height: 34px;
    padding: 0 12px;
}

.day-date-current:focus-visible,
.day-date-nav-btn:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.35);
    outline-offset: 2px;
}

@media (max-width: 576px) {
    .day-header-row {
        flex-wrap: wrap !important;
        align-items: flex-start;
        gap: 8px !important;
    }

    .day-header-row > :first-child {
        min-width: 0;
        flex: 0 0 100%;
        width: 100%;
    }

    .day-header-row > :last-child {
        flex: 0 0 100%;
        width: 100%;
    }

    .day-header-row .app-title {
        margin-bottom: 0;
        font-size: clamp(22px, 6vw, 30px);
        line-height: 1.1;
        white-space: nowrap;
    }

    .day-header-row .day-date-nav {
        width: 100%;
        display: grid;
        grid-template-columns: 30px minmax(0, 1fr) 30px;
        gap: 6px;
    }

    .day-date-current {
        height: 30px;
        font-size: 14px;
        gap: 4px;
        padding: 0 12px;
        width: 100%;
    }

    .day-date-nav-btn {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
}

.card-surface {
    background: var(--surface);
    border-radius: 20px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: var(--shadow);
    padding: 18px;
}

.energy-balance-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 260px;
}

.energy-balance-chart {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
}

.energy-balance-label-center {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    min-width: 140px;
}

.energy-balance-label {
    position: absolute;
    font-size: 15px;
    text-transform: uppercase;
    color: var(--muted);
    text-align: center;
    min-width: 120px;
    line-height: 1.2;
}

.energy-balance-label .energy-value {
    display: block;
    font-size: 26px;
    text-transform: none;
    font-weight: 600;
}

.energy-balance-label .energy-value .energy-unit {
    font-size: 11px;
    font-weight: 400;
}

/*.energy-balance-label strong {*/
/*    color: var(--text);*/
/*    font-weight: 600;*/
/*}*/

.energy-balance-bottom {
    display: grid;
    grid-template-columns: repeat(4, max-content);
    justify-content: space-between;
    column-gap: 0;
    row-gap: 0;
    width: 100%;
    margin: 0;
    align-items: start;
}

.energy-balance-item {
    display: block;
    line-height: 1.2;
    min-width: 0;
}

.energy-balance-item .energy-label {
    font-size: 13px;
    text-transform: uppercase;
    color: var(--muted);
    display: block;
    margin-right: 0;
    font-weight: 400;
    white-space: nowrap;
}

.energy-balance-item .energy-value {
    display: block;
    font-size: 20px;
    text-transform: none;
    white-space: nowrap;
    min-width: 0;
}

.energy-balance-item .energy-value .energy-unit {
    font-size: 11px;
    font-weight: 200;
    letter-spacing: 0;
    white-space: nowrap;
}

#energy-balance-label-base {
    justify-self: start;
    text-align: left;
}

#energy-balance-label-burn,
#energy-balance-label-consumed {
    justify-self: center;
    text-align: left;
}

#energy-balance-label-deficit,
#energy-balance-label-excess {
    justify-self: end;
    text-align: right;
}

.energy-balance-item-consumed .energy-value {
    font-weight: 600;
    color: #6fc186;
    letter-spacing: -0.04em;
}

.energy-balance-item-base .energy-value {
    font-weight: 600;
    color: #505050;
    letter-spacing: -0.04em;
}

.energy-balance-item-deficit .energy-value {
    font-weight: 600;
    color: #868fc1;
    letter-spacing: -0.04em;
}

.energy-balance-item-excess .energy-value {
    font-weight: 600;
    color: #d53f3f;
    letter-spacing: -0.04em;
}

.energy-balance-item-burn .energy-value {
    font-weight: 600;
    color: #dd6eb0;
    letter-spacing: -0.04em;
}

.energy-balance-chart canvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
}

.summary-label {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.macro-grid {
    display: grid;
    gap: 28px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-items: stretch;
}

.macro-grid-compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}

.macro-card {
    text-align: center;
    width: 100%;
    padding: 0 20px;
}

.macro-label {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.macro-chart {
    position: relative;
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 140px;
    margin: 0 auto 8px;
}

.macro-chart canvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
}

.macro-value {
    font-size: 12px;
}

.meta-labeled {
    font-size: 12px;
}

.meta-label {
    font-weight: 700;
    text-transform: lowercase;
    margin-right: 4px;
}

.meta-sep {
    margin: 0 4px;
}

.day-journal-card {
    padding: 0;
    overflow: hidden;
}

.day-journal-card .card-header {
    border-bottom-color: rgba(15, 23, 42, 0.08);
    padding: 0.75rem 1rem;
}

.day-journal-card .card-body {
    padding: 1rem;
}

.journal-card-title {
    gap: 0.35rem;
    font-size: 1.06rem;
    letter-spacing: -0.01em;
}

.journal-add-btn {
    border: 0;
    background: transparent;
    color: #334155;
    font-weight: 600;
    line-height: 1;
    padding: 0.2rem 0.35rem;
    box-shadow: none;
    transition: color 0.15s ease;
}

.journal-add-btn i {
    color: #16a34a;
}

.journal-add-btn:hover {
    background: transparent;
    border: 0;
    color: #0f172a;
}

.journal-add-btn:focus-visible {
    outline: 2px solid rgba(15, 23, 42, 0.22);
    outline-offset: 2px;
}

.timeline-card .status {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
}

.timeline-thumb {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    flex: 0 0 56px;
    object-fit: cover;
    border-radius: 12px;
    background: #fff;
}

.timeline-thumb-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.06);
    color: rgba(15, 23, 42, 0.55);
    font-size: 22px;
}

.timeline-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.timeline-media {
    flex: 0 0 56px;
}

.timeline-info {
    flex: 1 1 auto;
    min-width: 0;
}

.timeline-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.timeline-status-time-pill {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    padding: 1px 6px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(15, 23, 42, 0.06);
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.timeline-title {
    font-weight: 600;
    font-size: 13px;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    width: 16px;
    color: var(--muted);
}

.status-icon.status-pending {
    color: #c2410c;
}

.status-icon.status-processing {
    color: #2563eb;
}

.status-icon.status-done {
    color: #16a34a;
}

.status-icon.status-failed {
    color: #b91c1c;
}

.timeline-time-value {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.timeline-meta {
    color: var(--muted);
    font-size: 12px;
    margin-top: 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.timeline-meta .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.meta-icon {
    color: var(--muted);
    font-size: 11px;
    line-height: 1;
    transform: translateY(-1px);
}
