/* Daily Log (Story 2266 rework) -- a list of days (headers only), enter a day
   to see and rapid-add what you did. Tasks are a record of things DONE: plain
   rows, no checkboxes, no skips. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: #F2F2F4; color: #222;
    font-family: "Segoe UI", system-ui, sans-serif; }

/* Hard-pinned shell: the page never scrolls; only the active .dl-body scrolls,
   so the injected icon band and the header NEVER scroll off. 100dvh (dynamic
   viewport height) tracks the phone URL bar and -- with the viewport meta's
   interactive-widget=resizes-content -- the on-screen keyboard, so the shell
   compresses instead of the browser visually panning the chrome away. */
.page-shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
#lwIconBand, .ct-header, .dl-filter { flex: 0 0 auto; }
.dl-body { min-height: 0; }

.ct-header {
    background: #3C3C3C; color: #fff; padding: 10px 16px;
    display: flex; align-items: center; gap: 12px;
}
.ct-header h1 { margin: 0; font-size: 14pt; font-weight: 600; flex: 1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-header button, .ct-header a {
    color: #fff; background: #4F46E5; border: none; border-radius: 4px;
    padding: 7px 14px; font: inherit; font-size: 13px; cursor: pointer;
    text-decoration: none;
}
.ct-header button:hover, .ct-header a:hover { background: #6257F0; }
.ct-header .dl-back {
    background: transparent; font-size: 20px; padding: 2px 10px; line-height: 1;
}
.ct-header .dl-back:hover { background: rgba(255,255,255,.12); }

.dl-filter {
    background: #fff; border-bottom: 1px solid #E5E5EA;
    padding: 8px 16px; display: flex; align-items: center; gap: 12px;
}
.dl-chips { display: flex; gap: 6px; }
.dl-chip {
    border: 1px solid #D0D0D8; background: #F4F4F7; color: #444;
    border-radius: 999px; padding: 5px 14px; font: inherit; font-size: 12px; cursor: pointer;
}
.dl-chip.active { background: #4F46E5; border-color: #4F46E5; color: #fff; }
.dl-hint { font-size: 12px; color: #888; margin-left: auto; }

.dl-body { flex: 1; overflow: auto; padding: 14px 14px 30px 14px; }

/* ---- View 1: day list ---- */
.dl-day-row {
    background: #fff; border: 1px solid #E7E7EC; border-radius: 12px;
    margin-bottom: 10px; padding: 14px; cursor: pointer;
    display: flex; align-items: center; gap: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.dl-day-row:hover { background: #FAFAFC; }
.dl-day-title { flex: 1; min-width: 0; font-size: 13pt; font-weight: 700; color: #1A1A1A; }
.dl-day-title .dl-day-date { font-size: 10pt; font-weight: 400; color: #999; margin-left: 8px; }
.dl-day-row.today .dl-day-title { color: #4F46E5; }
.dl-day-count {
    flex: 0 0 auto; font-size: 11pt; font-weight: 600; color: #6A6A70;
    background: #F1F1F5; border-radius: 12px; padding: 3px 11px;
}
.dl-badge-resolved {
    flex: 0 0 auto; font-size: 9pt; font-weight: 700; text-transform: uppercase;
    letter-spacing: .4px; color: #14A08C; background: rgba(20,160,140,.14);
    padding: 2px 8px; border-radius: 10px;
}
.dl-day-row .dl-enter { flex: 0 0 auto; color: #B9B9C6; font-size: 16px; }

/* ---- View 2: one day ---- */
.dl-day-meta { font-size: 11pt; color: #777; margin: 2px 2px 12px 2px; }
.dl-day-meta .dl-resolved-note { color: #14A08C; font-weight: 600; }

/* The card wraps the entry list + the always-there add row (like a checklist
   group with its add-item row at the bottom). */
.dl-card { background: #fff; border: 1px solid #E7E7EC; border-radius: 12px; overflow: hidden; }
.dl-tasks { background: #fff; }
.dl-task {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 13px 14px; border-top: 1px solid #F1F1F4; cursor: pointer;
}
.dl-task:first-child { border-top: none; }
.dl-task:hover { background: #FAFAFC; }
.dl-task .dl-bullet { color: #B9B9C6; font-size: 15px; line-height: 1.4; flex: 0 0 auto; }
.dl-task .dl-task-text { flex: 1; min-width: 0; font-size: 12pt; color: #1A1A1A;
    line-height: 1.45; word-break: break-word; }
/* Unobtrusive "came from a checklist" marker */
.dl-task .dl-src { flex: 0 0 auto; font-size: 12px; color: #B7B7C0; cursor: default; }
.dl-task .dl-edit-hint { flex: 0 0 auto; color: #C5C5CE; font-size: 11px; opacity: 0; }
.dl-task:hover .dl-edit-hint { opacity: 1; }
@media (hover: none) { .dl-task .dl-edit-hint { opacity: .5; } }

.dl-empty {
    background: #fff; border: 1px dashed #CFCFD6; border-radius: 12px;
    padding: 30px 20px; color: #777; text-align: center;
}
.dl-loading { color: #999; text-align: center; padding: 30px; }

.dl-day-actions { display: flex; gap: 8px; margin-top: 14px; }
.dl-day-actions button {
    border: 1px solid #D5D5DC; background: #fff; color: #555;
    border-radius: 6px; padding: 8px 14px; font: inherit; font-size: 12px; cursor: pointer;
}
.dl-day-actions button:hover { background: #F3F3F6; }
.dl-day-actions .dl-resolve { color: #14A08C; border-color: rgba(20,160,140,.4); }
.dl-day-actions .dl-del-day { color: #C0392B; border-color: rgba(192,57,43,.35); margin-left: auto; }

/* ---- Rapid add row (in-flow at the bottom of the entry card, like the
   checklist add-item row -- always present, type + Enter, repeat) ---- */
.dl-add-task {
    display: flex; align-items: center; gap: 8px;
    background: #FAFAFC; border-top: 1px solid #F1F1F4;
    padding: 10px 14px;
}
.dl-add-task .dl-add-plus {
    width: 26px; height: 26px; flex: 0 0 auto; border-radius: 7px;
    background: #E8F0FE; color: #1A73E8; display: flex; align-items: center; justify-content: center;
    font-size: 17px; font-weight: 300; line-height: 1;
}
.dl-add-task input {
    flex: 1 1 auto; min-width: 0; display: block; width: 100%;
    font: inherit; font-size: 12pt; color: #1A1A1A;
    border: 1px solid #ccc; border-radius: 6px; background: #fff;
    padding: 9px 12px; outline: none;
}
.dl-add-task input:focus { border-color: #4F46E5; }
.dl-add-task .voice-mic-wrap { display: block; flex: 1 1 auto; min-width: 0; }
.dl-add-btn {
    flex: 0 0 auto; border: none; border-radius: 6px; background: #4F46E5;
    color: #fff; padding: 10px 18px; font: inherit; font-size: 14px; cursor: pointer;
}
.dl-add-btn:hover { background: #6257F0; }

/* ---- Modals ---- */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none;
    align-items: center; justify-content: center; z-index: 50; }
.modal-back.open { display: flex; }
.modal { background: #fff; border-radius: 8px; width: min(440px, 94vw); padding: 18px 20px; }
.modal h2 { margin: 0 0 14px; font-size: 16px; color: #333; }
.dl-field { display: block; margin: 0 0 12px; }
.dl-field > span { display: block; font-size: 12px; color: #666; margin-bottom: 4px; }
.dl-field input {
    display: block; width: 100%; box-sizing: border-box; padding: 8px 10px;
    font-size: 14px; color: #1a1a1a; background: #fff; border: 1px solid #ccc; border-radius: 4px;
}
.dl-field input:focus { outline: none; border-color: #4F46E5; }
.dl-field .voice-mic-wrap { display: block; }
.dl-modal-btns { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.dl-modal-btns .spacer { flex: 1 1 auto; }
.dl-modal-btns button { border: none; border-radius: 4px; padding: 9px 16px; font: inherit; font-size: 13px; cursor: pointer; }
.dl-btn-save { background: #4F46E5; color: #fff; }
.dl-btn-save:hover { background: #6257F0; }
.dl-btn-cancel { background: #E9E9EF; color: #333; }
.dl-btn-cancel:hover { background: #DDD; }
.dl-btn-delete { background: none; color: #C0392B; border: 1px solid rgba(192,57,43,.4) !important; }
.dl-btn-delete:hover { background: rgba(192,57,43,.08); }
