body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: #f3f4f6; }
.glass { background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.3); }
.hide { display: none !important; }

.daily-body {
    min-height: 100vh;
    margin: 0;
    color: #172033;
    background:
        linear-gradient(120deg, rgba(238, 242, 243, 0.94), rgba(249, 250, 251, 0.96)),
        repeating-linear-gradient(90deg, rgba(23, 32, 51, 0.04) 0, rgba(23, 32, 51, 0.04) 1px, transparent 1px, transparent 44px);
}

.daily-page {
    width: min(860px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 20px;
    padding: 18px 0 36px;
}

.daily-header,
.daily-panel {
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(23, 32, 51, 0.1);
    border-radius: 8px;
}

.daily-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
}

.daily-brand {
    color: #172033;
    text-decoration: none;
    font-size: 22px;
    font-weight: 800;
}

.daily-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.daily-nav a,
.daily-nav button,
.daily-date-row a {
    color: #2563eb;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
}

.daily-nav button {
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.daily-panel {
    align-self: start;
    padding: 28px;
    box-shadow: 0 22px 60px rgba(23, 32, 51, 0.1);
}

.daily-date-row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 72px;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    color: #64748b;
    font-size: 14px;
    font-weight: 700;
}

.daily-date-row time {
    text-align: center;
}

.daily-date-row a:last-child {
    text-align: right;
}

.daily-panel h1 {
    margin: 0;
    color: #172033;
    font-size: clamp(24px, 4vw, 36px);
    letter-spacing: 0;
    line-height: 1.25;
}

.daily-meta {
    margin: 10px 0 24px;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

.daily-content {
    white-space: pre-wrap;
    color: #1f2937;
    font-size: 17px;
    line-height: 1.9;
}

.daily-login-panel {
    width: min(400px, 100%);
    justify-self: center;
}

.daily-login-form {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.daily-login-form input {
    min-width: 0;
    border: 1px solid rgba(23, 32, 51, 0.16);
    border-radius: 6px;
    padding: 11px 12px;
    font: inherit;
}

.daily-login-form button {
    border: 0;
    border-radius: 6px;
    padding: 11px 14px;
    background: #172033;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.daily-error {
    color: #be123c;
    font-weight: 700;
}

.daily-empty p {
    color: #64748b;
    line-height: 1.7;
}

.daily-section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.daily-section-head h2,
.daily-chart-card h3 {
    margin: 0;
    color: #172033;
    letter-spacing: 0;
}

.daily-subtle {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

.daily-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.daily-chart-card {
    padding: 18px;
    border: 1px solid rgba(23, 32, 51, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
}

.daily-chart-wrap {
    position: relative;
    height: 260px;
    margin-top: 12px;
}

.daily-conversation-list {
    display: grid;
    gap: 14px;
}

.daily-log-card {
    padding: 18px;
    border: 1px solid rgba(23, 32, 51, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
}

.daily-log-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.daily-bubble-stack {
    display: grid;
    gap: 8px;
}

.daily-bubble-row {
    display: flex;
}

.daily-bubble-row.user {
    justify-content: end;
}

.daily-bubble-row.wool {
    justify-content: start;
}

.daily-bubble {
    max-width: min(100%, 520px);
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.65;
    white-space: pre-wrap;
}

.daily-bubble.user {
    background: #dbeafe;
    color: #1e3a8a;
    border-top-right-radius: 6px;
}

.daily-bubble.wool {
    background: #fce7f3;
    color: #9d174d;
    border-top-left-radius: 6px;
}

.diary-list-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.diary-list-link:hover h3 {
    color: #2563eb;
}

@media (max-width: 760px) {
    .daily-page {
        width: min(100%, calc(100% - 20px));
        padding: 12px 0 24px;
    }

    .daily-header,
    .daily-panel {
        padding: 18px;
    }

    .daily-header,
    .daily-section-head,
    .daily-log-head {
        align-items: start;
        flex-direction: column;
    }

    .daily-chart-grid {
        grid-template-columns: 1fr;
    }

    .daily-chart-wrap {
        height: 220px;
    }

    .daily-date-row {
        grid-template-columns: 56px minmax(0, 1fr) 56px;
        gap: 8px;
    }
}
