.work-log-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal-child, 40000);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(9, 18, 42, .66);
    box-sizing: border-box;
}
.work-log-overlay[hidden] { display: none !important; }

.work-log-detail-entry {
    width: auto;
    min-height: 44px;
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.modal-actions > .work-log-detail-entry { margin: 0; }

.work-log-shared-links {
    display: grid;
    flex: 0 0 100%;
    width: 100%;
    gap: 8px;
}
.work-log-shared-links[hidden] { display: none !important; }
.work-log-shared-diary-btn {
    width: 100%;
    min-height: 44px;
    border-color: #a7d7b4;
    background: #f0fbf3;
    color: #17633a;
}

.work-log-private-actions {
    display: flex;
    justify-content: flex-end;
    padding: 16px clamp(16px, 3vw, 28px) 24px;
    border-top: 1px solid #dbe3ef;
    background: #fff;
}

.work-log-private-actions .work-log-detail-entry { margin: 0; }

.work-log-detail-entry:hover {
    background: #dbeafe;
}
.work-log-dialog {
    width: min(760px, 100%);
    height: min(820px, calc(100dvh - 36px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border-radius: 22px;
    background: #f7f9fc;
    box-shadow: 0 22px 70px rgba(0, 0, 0, .34);
    color: #17233b;
}
.work-log-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: center;
    gap: 12px;
    min-height: 76px;
    padding: 12px 16px 12px 20px;
    background: linear-gradient(135deg, #173a8f, #355bd4);
    color: #fff;
}
.work-log-header-copy { min-width: 0; }
.work-log-header h2 { margin: 0; font-size: 1.18rem; line-height: 1.35; }
.work-log-resource-title {
    margin: 3px 0 0;
    overflow: hidden;
    color: rgba(255, 255, 255, .82);
    font-size: .82rem;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.work-log-close {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 13px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font: 700 1.5rem/1 system-ui, sans-serif;
    cursor: pointer;
}
.work-log-scroll {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px;
    scrollbar-gutter: stable;
}
.work-log-intro {
    display: grid;
    gap: 4px;
    margin: 0 0 12px;
    padding: 13px 14px;
    border: 1px solid #bed2f4;
    border-radius: 13px;
    background: #eef5ff;
    color: #3e5673;
    font-size: .86rem;
    line-height: 1.5;
}
.work-log-intro strong { color: #1f4d9f; }
.work-log-status {
    min-height: 44px;
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 9px 12px;
    border: 1px solid #d9e2f2;
    border-radius: 12px;
    background: #fff;
    color: #486078;
    font-size: .86rem;
    box-sizing: border-box;
}
.work-log-status.is-error { border-color: #efb4b4; background: #fff4f4; color: #a52828; }
.work-log-loading-shell { min-height: 230px; display: grid; gap: 12px; }
.work-log-loading-shell[hidden] { display: none !important; }
.work-log-skeleton {
    min-height: 92px;
    border-radius: 16px;
    background: linear-gradient(90deg, #e8edf5 25%, #f7f9fc 45%, #e8edf5 65%);
    background-size: 220% 100%;
    animation: work-log-shimmer 1.2s linear infinite;
}
@keyframes work-log-shimmer { to { background-position: -220% 0; } }
.work-log-empty {
    min-height: 160px;
    display: grid;
    place-items: center;
    margin: 0 0 16px;
    padding: 22px;
    border: 1px dashed #bfcce0;
    border-radius: 16px;
    background: #fff;
    color: #61748b;
    text-align: center;
}
.work-log-timeline { display: grid; gap: 22px; margin: 0 0 18px; }
.work-log-entry {
    position: relative;
    margin: 0;
    padding: 20px;
    border: 1px solid #d8e2f0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 7px 24px rgba(24, 58, 120, .08);
}
.work-log-entry-head { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 10px; }
.work-log-date-tag,
.work-log-time-tag,
.work-log-verify-tag {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 750;
    box-sizing: border-box;
}
.work-log-date-tag { background: #e8efff; color: #2455ba; }
.work-log-time-tag { background: #eef2f7; color: #53657a; }
.work-log-verify-tag { background: #e8f8ef; color: #167143; }
.work-log-verify-tag.is-declared { background: #fff4d8; color: #8b5e00; }
.work-log-author { margin-left: auto; color: #4d6078; font-size: .8rem; font-weight: 700; }
.work-log-entry-title {
    margin: 3px 0 12px;
    color: #17233b;
    font-size: clamp(1.08rem, 3vw, 1.3rem);
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.work-log-content { margin: 0; color: #24334b; line-height: 1.68; white-space: pre-wrap; overflow-wrap: anywhere; }
.work-log-media-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 18px; }
.work-log-media-grid img,
.work-log-media-grid video {
    width: 100%;
    max-height: 72dvh;
    display: block;
    border-radius: 13px;
    background: #111827;
    object-fit: contain;
}
.work-log-entry-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; }
.work-log-entry-actions button,
.work-log-action {
    min-width: 44px;
    min-height: 44px;
    border: 1px solid #b9c8dc;
    border-radius: 11px;
    background: #fff;
    color: #29415f;
    font: 700 .86rem/1.2 system-ui, sans-serif;
    cursor: pointer;
    box-sizing: border-box;
}
.work-log-entry-actions button { min-height: 36px; padding: 6px 10px; }
.work-log-card {
    margin-top: 14px;
    padding: 16px;
    border: 1px solid #d6e0ef;
    border-radius: 16px;
    background: #fff;
}
.work-log-card h3 { margin: 0 0 8px; font-size: 1rem; }
.work-log-card p { margin: 0 0 10px; color: #53667d; line-height: 1.55; }
.work-log-card input[type="text"],
.work-log-card textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #b9c8dc;
    border-radius: 12px;
    font: inherit;
    line-height: 1.55;
    box-sizing: border-box;
}
.work-log-card input[type="text"] { min-height: 48px; margin-bottom: 10px; }
.work-log-card textarea { min-height: 210px; resize: vertical; }
.work-log-card input[type="text"]:focus,
.work-log-card textarea:focus,
.work-log-close:focus-visible,
.work-log-action:focus-visible,
.work-log-entry-actions button:focus-visible { outline: 3px solid #f4b942; outline-offset: 2px; }
.work-log-upload-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.work-log-upload-label { display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px; }
.work-log-upload-label input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.work-log-upload-status { min-height: 24px; color: #52667f; font-size: .82rem; }
.work-log-preview { min-height: 0; }
.work-log-preview:empty { display: none; }
.work-log-submit { padding: 9px 16px; border-color: #3168d4; background: #3168d4; color: #fff; }
.work-log-cancel-edit[hidden] { display: none; }
.work-log-legal {
    padding: 12px;
    border-left: 4px solid #e4a827;
    border-radius: 8px;
    background: #fff8e6;
    color: #5e4a1d;
    font-size: .84rem;
    line-height: 1.55;
}
.work-log-legal-links { display: flex; flex-wrap: wrap; gap: 9px; margin: 8px 0; }
.work-log-legal-links a { color: #275ebc; font-weight: 700; }
.work-log-consent { display: flex; align-items: flex-start; gap: 9px; min-height: 44px; margin-top: 10px; }
.work-log-consent input { width: 22px; height: 22px; margin-top: 2px; }
.work-log-sharing-card { border-color: #b9ddc4; background: #f7fcf8; }
.work-log-share-toggle[aria-pressed="true"] { border-color: #247148; background: #247148; color: #fff; }
.work-log-legal details { margin-top: 10px; }
.work-log-legal summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 750; }
body.work-log-open { overflow: hidden !important; }

@media (max-width: 767px) {
    .work-log-overlay {
        inset: var(--app-dialog-viewport-top, 0px) 0 auto;
        width: 100%;
        height: calc(
            var(--app-dialog-viewport-height, 100dvh)
            - var(--app-bottom-reserved, 0px)
        );
        padding: 0;
    }
    .work-log-dialog { width: 100%; height: 100%; max-height: none; border-radius: 0; }
    .work-log-header { padding-top: max(12px, env(safe-area-inset-top)); }
    .work-log-scroll { padding: 12px; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
    .work-log-private-actions { padding: 12px 16px max(18px, env(safe-area-inset-bottom)); }
    .work-log-private-actions .work-log-detail-entry { width: 100%; }
    .work-log-entry { padding: 15px; }
    .work-log-entry-actions button,
    .work-log-action,
    .work-log-upload-label { min-height: 44px; }
    .work-log-legal-links a {
        display: inline-flex;
        min-height: 44px;
        align-items: center;
    }
}

@media (max-width: 360px) {
    .work-log-author { width: 100%; margin-left: 0; }
}
