/* css/daily-view.css (수정 완료) */
@import url('https://fonts.googleapis.com/css2?family=Gaegu:wght@300;400;700&display=swap');

/* --- Global & Wrapper --- */
.dv-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: #f0f2f5;
    color: #333;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
    z-index: 0;
}


.dv-wrapper * {
    box-sizing: border-box;
}

.dv-wrapper .dv-diary-section,
.dv-wrapper .dv-diary-section textarea {
    font-family: 'Gaegu', cursive;
}

/* --- Date Header --- */
.dv-date-header {
    padding: 0;
    background-color: #1a2533;
    color: white;
    text-align: center;
    height: 28px;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    position: relative;
    display: flex;
    align-items: center;
}

.dv-year-progress-bar {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
}

.dv-day-segment {
    flex: 1 1 auto;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}
.dv-day-segment:last-child { border-right: none; }
.dv-day-segment.dv-passed { background-color: #4CAF50; }
.dv-day-segment.dv-future { background-color: rgba(255, 255, 255, 0.15); }
.dv-day-segment.dv-month-end-segment {
    border-right-color: rgba(255, 255, 255, 0.4);
    border-right-width: 2px;
}
.dv-day-segment.dv-month-end-segment:last-child { border-right: none; }

#current-date-display {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    color: white;
    font-size: 0.9em;
    font-weight: bold;
    padding: 3px 10px;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 3px;
    white-space: nowrap;
}

/* --- Day Progress Bar --- */
.dv-day-progress-container {
    width: 100%;
    height: 12px;
    background-color: #e0e4e8;
    padding: 2px 0;
    box-sizing: border-box;
    display: flex;
    flex-shrink: 0;
}

.dv-day-progress-bar-visual {
    display: flex;
    width: 100%;
    height: 100%;
    border-left: 1px solid #b0b8c0;
    border-right: 1px solid #b0b8c0;
}

.dv-time-segment {
    flex: 1 1 auto;
    position: relative;
}
.dv-time-segment::after {
    content: '';
    position: absolute;
    right: -1px;
    top: 25%;
    height: 50%;
    width: 1px;
    background-color: rgba(0, 0, 0, 0.2);
}
.dv-time-segment.dv-hour-marker::after {
    top: 10%;
    height: 80%;
    width: 2px;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1;
}
.dv-time-segment:last-child::after { display: none; }
.dv-time-segment.dv-passed-time { background-color: #64b5f6; }
.dv-time-segment.dv-future-time { background-color: #d0d4d8; }

/* --- Main Page Container --- */
.dv-page-container {
    display: flex;
    width: 100%;
    flex-grow: 1;
    padding: 15px;
    gap: 15px;
    overflow: hidden;
}

.dv-left-pane, .dv-right-pane {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    overflow-y: auto;
    padding: 15px;
}

/* Center pane is styled separately below */

.dv-right-pane {
    display: flex;
    flex-direction: column;
}

/* --- Left Pane --- */
.dv-left-pane {
    flex: 1 1 22%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 0;
    position: relative;
    z-index: 20;
}
.dv-left-pane:has(.dv-color-option:hover),
.dv-left-pane:has(.dv-color-picker-popup.dv-show),
.dv-left-pane:has(.dv-color-option-context-menu) {
    z-index: 4200;
    overflow: visible;
}

.dv-left-pane-top, .dv-left-pane-bottom {
    position: relative;
    display: flex;
    border: 1px solid #e7eaf0;
    border-radius: 6px;
    padding: 15px;
    flex-direction: column;
    overflow: hidden;
    color: #777;
}
.dv-left-pane-top { flex: 0.35; min-height: 160px; }
.dv-left-pane-bottom { flex: 1 1 auto; min-height: 220px; z-index: 10; }
.dv-left-pane-bottom:has(.dv-color-option:hover),
.dv-left-pane-bottom:has(.dv-color-picker-popup.dv-show),
.dv-left-pane-bottom:has(.dv-color-option-context-menu) {
    z-index: 4100;
    overflow: visible;
}

/* --- Project TODOs (추가된 스타일) --- */
#project-todo-app-container {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
}
.dv-projects-scroll-area {
    flex-grow: 1; overflow-y: auto;
    padding: 10px; position: relative;
}
.dv-project-item-wrapper {
    background-color: #fff;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 6px;
    border-radius: 4px;
    position: relative;
}
.dv-project-item-wrapper.open { z-index: 50; }
.dv-project-header {
    display: flex; align-items: center;
    padding: 10px 12px;
    cursor: pointer; user-select: none;
    transition: background-color 0.15s ease;
}
.dv-project-header:hover { background-color: #f1f5f9; }
.dv-project-item-wrapper:hover .dv-project-controls { opacity: 1; visibility: visible; }
.dv-project-arrow {
    font-size: 0.65em; margin-right: 10px;
    color: #667788; transition: transform 0.2s ease-out;
    display: inline-block;
}
.dv-project-item-wrapper.open .dv-project-arrow { transform: rotate(90deg); }
.dv-project-name {
    flex-grow: 1; font-weight: 500; color: #2c3e50;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    padding-right: 8px;
}
.dv-project-completion {
    font-size: 0.8em; color: #52616b;
    margin-left: auto; padding-left: 10px;
    white-space: nowrap; flex-shrink: 0;
}
.dv-project-controls {
    display: flex; align-items: center;
    opacity: 0; visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    margin-left: 8px;
}
.dv-project-action-btn {
    background: none; border: none; cursor: pointer;
    padding: 3px; margin-left: 5px; font-size: 1em;
    color: #7f8c8d; line-height: 1;
}
.dv-project-action-btn:hover { color: #34495e; }
.dv-project-delete-btn:hover { color: #c0392b; }
/* 드롭다운 내부의 리스트 스타일 */
.dv-sub-todo-list {
    list-style: none;
    padding: 8px 12px;
    margin: 0;
}
.dv-sub-todo-list-container.dv-floating-dropdown {
    position: fixed;
    background-color: #ffffff;
    border: 1px solid #d1dce5;
    box-shadow: 0 5px 15px rgba(0,0,0,0.12);
    border-radius: 5px;
    min-width: 280px;
    max-height: 80vh;
    overflow-y: auto;
    padding-bottom: 8px;
    box-sizing: border-box;
}
.dv-sub-todo-list {
    list-style: none; padding: 8px 12px; margin: 0;
}
.dv-sub-todo-item {
    position: relative; display: flex; align-items: center;
    padding: 7px 6px; border-bottom: 1px solid #f2f4f6;
    font-size: 0.9em;
    border-radius: 8px;
    transition: background-color 0.18s ease;
}
.dv-sub-todo-item:last-child { border-bottom: none; }
.dv-sub-todo-item.completed .dv-sub-todo-text {
    text-decoration: line-through; color: #a0a0a0; opacity: 0.7;
}
.dv-sub-todo-number {
    margin-right: 7px; color: #888; font-size: 0.9em;
    min-width: 20px; text-align: right; user-select: none;
}
.dv-sub-todo-checkbox { margin-right: 8px; transform: scale(0.9); cursor: pointer; }
.dv-sub-todo-text { flex-grow: 1; padding: 2px 4px; cursor: text; line-height: 1.4; }
.dv-sub-todo-text-edit {
    flex-grow: 1; padding: 3px 5px; font-size: inherit;
    border: 1px solid #badcff; border-radius: 3px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.07);
}
.dv-sub-todo-delete-btn {
    background: none; border: none; cursor: pointer; color: #c0c0c0;
    font-size: 1.1em; padding: 2px 6px; margin-left: 8px;
    opacity: 0; visibility: hidden;
    transition: opacity 0.2s ease, color 0.2s ease;
    line-height: 1;
}
.dv-sub-todo-item:hover .dv-sub-todo-delete-btn { opacity: 1; visibility: visible; color: #e74c3c; }
.dv-sub-todo-delete-btn:hover { color: #c0392b !important; }
/* 드롭다운 내부의 'Add Task' 버튼 스타일 */
.dv-add-sub-task-btn {
    display: block;
    margin: 10px 15px 5px 35px; /* 버튼 위치 조정 */
    padding: 6px 12px;
    font-size: 0.85em;
    color: #333;
    background-color: #f0f2f5; /* 버튼 자체 배경색 (기존 스타일 유지 또는 흰색으로 변경 가능) */
    border: 1px solid #d1dce5;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    width: auto;
}
.dv-add-sub-task-btn:hover { background-color: #e4e9ed; border-color: #c1cdd8; }
.dv-add-project-btn {
    display: none; width: calc(100% - 20px);
    margin: 15px auto 10px auto; padding: 10px 15px;
    font-size: 0.9em; font-weight: 500; color: #fff;
    background-color: #28a745; border: none; border-radius: 5px;
    cursor: pointer; text-align: center;
    transition: background-color 0.2s ease;
}

.dv-add-project-btn:hover { 
    background-color: #e4e9ed; 
    border-color: #adb5bd;
}

.dv-sub-todo-list-container.dv-floating-project-dropdown {
    /* position, z-index, display 등은 JavaScript에서 inline으로 설정됩니다. */
    background-color: #ffffff; /* ✨ 흰색 배경을 지정합니다 ✨ */
    border: 1px solid #d1dce5; /* 약간 부드러운 테두리 */
    box-shadow: 0 5px 15px rgba(0,0,0,0.12); /* 그림자 효과 */
    border-radius: 5px; /* 모서리 둥글게 */
    min-width: 280px; /* 최소 너비 (JS가 실제 너비 설정) */
    max-height: 80vh; /* 화면 높이의 80%를 넘지 않도록 */
    overflow-y: auto; /* 내용이 많으면 스크롤 */
    padding-bottom: 8px; /* 내부 'Add Task' 버튼 등을 위한 하단 여백 */
    box-sizing: border-box;
}





/* --- General TODOs (추가된 스타일) --- */
#todo-app-container {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    overflow: hidden;
}
.dv-todo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 10px 4px;
    flex-shrink: 0;
}
.dv-todo-header-title {
    display: flex;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
}
.dv-todo-header-title-label {
    font-size: 0.88em;
    font-weight: 700;
    color: #2c3e50;
    white-space: nowrap;
}
.dv-todo-header-summary {
    color: #7c8a9a;
    font-size: 0.68em;
    font-weight: 650;
    white-space: nowrap;
}
.dv-todo-header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}
.dv-todo-header-action {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: #98a2b3;
    padding: 4px;
    border-radius: 6px;
    transition: color 0.2s ease, background-color 0.2s ease;
}
.dv-todo-header-action:hover {
    color: #c0392b;
    background-color: #f8ebea;
}
.dv-todo-header-carry-forward:hover {
    color: #2563eb;
    background-color: #eff6ff;
}
.dv-todo-header-eat-the-frog:hover {
    color: #475569;
    background-color: #f1f5f9;
}
.dv-todo-header-eat-the-frog {
    opacity: 0.72;
    filter: grayscale(0.62) saturate(0.58);
}
.dv-todo-header-eat-the-frog:hover,
.dv-todo-header-eat-the-frog:focus-visible {
    opacity: 0.9;
    filter: grayscale(0.38) saturate(0.72);
}
.dv-eat-the-frog-tooltip {
    position: fixed;
    z-index: 6400;
    width: min(280px, calc(100vw - 24px));
    padding: 11px 12px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.97);
    color: #f8fafc;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.24);
    pointer-events: none;
}
.dv-eat-the-frog-tooltip__title {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
}
.dv-eat-the-frog-tooltip__divider {
    height: 1px;
    margin: 8px 0;
    background: rgba(148, 163, 184, 0.24);
}
.dv-eat-the-frog-tooltip__body {
    color: #cbd5e1;
    font-size: 12px;
    line-height: 1.5;
}
.dv-todo-header-action:disabled,
.dv-todo-header-action:disabled:hover {
    cursor: not-allowed;
    color: #cbd5e1;
    background-color: transparent;
    opacity: 0.58;
}
.dv-eat-the-frog-celebration {
    position: fixed;
    inset: 0;
    z-index: 6200;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(6, 10, 18, 0.72);
    backdrop-filter: blur(6px);
}
.dv-eat-the-frog-celebration__modal {
    position: relative;
    width: min(360px, calc(100vw - 40px));
    overflow: hidden;
    padding: 36px 28px 28px;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.28);
    text-align: center;
    animation: dv-eat-the-frog-modal-enter 0.35s cubic-bezier(.2,.8,.2,1) both;
}
.dv-eat-the-frog-celebration__icon {
    position: relative;
    z-index: 2;
    margin-bottom: 12px;
    font-size: 58px;
    line-height: 1;
    animation: dv-eat-the-frog-icon-pop 0.65s cubic-bezier(.2,.9,.2,1.2) both;
}
.dv-eat-the-frog-celebration h2 {
    position: relative;
    z-index: 2;
    margin: 0 0 22px;
    color: #14532d;
    font-size: 24px;
    line-height: 1.3;
}
.dv-eat-the-frog-celebration__reward {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    margin: -7px auto 22px;
    padding: 12px 14px;
    border: 1px solid #f5d16f;
    border-radius: 8px;
    background: #fffbeb;
    color: #713f12;
    text-align: left;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.dv-eat-the-frog-celebration__reward-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid #f4c84d;
    border-radius: 50%;
    background: #fff7d6;
    color: #e69a00;
    font-size: 16px;
    box-shadow: 0 5px 12px rgba(180, 111, 0, 0.14);
}
.dv-eat-the-frog-celebration__reward-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}
.dv-eat-the-frog-celebration__reward-copy small {
    color: #9a6700;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
}
.dv-eat-the-frog-celebration__reward-copy b {
    color: #713f12;
    font-size: 12px;
    line-height: 1.3;
}
.dv-eat-the-frog-celebration__reward strong {
    color: #b45309;
    font-size: 22px;
    line-height: 1;
    letter-spacing: 0;
}
.dv-eat-the-frog-celebration button {
    position: relative;
    z-index: 2;
    min-width: 112px;
    border: 0;
    border-radius: 8px;
    padding: 10px 18px;
    background: #15803d;
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
}
.dv-eat-the-frog-celebration button:hover,
.dv-eat-the-frog-celebration button:focus-visible {
    background: #166534;
}
.dv-eat-the-frog-celebration__burst {
    position: absolute;
    inset: 50% auto auto 50%;
}
.dv-eat-the-frog-confetti {
    position: absolute;
    width: 7px;
    height: 13px;
    border-radius: 2px;
    background: var(--frog-color);
    animation: dv-eat-the-frog-confetti 1.25s ease-out var(--frog-delay) both;
}
@keyframes dv-eat-the-frog-modal-enter {
    from { opacity: 0; transform: translateY(10px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes dv-eat-the-frog-icon-pop {
    0% { opacity: 0; transform: scale(.35) rotate(-12deg); }
    60% { opacity: 1; transform: scale(1.12) rotate(4deg); }
    100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes dv-eat-the-frog-confetti {
    0% { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(.6); }
    20% { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--frog-x), var(--frog-y)) rotate(260deg) scale(1); }
}
.dv-todo-list {
    list-style: none;
    padding: 0; /* 버튼 컨테이너가 자체 패딩을 가질 것이므로 여기서 패딩 제거 가능 */
    margin: 0;
    flex-grow: 1;
    overflow-y: auto;
    /* 리스트 맨 아래 약간의 여유 공간 (선택적) */
    /* padding-bottom: 10px; */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.dv-todo-list::-webkit-scrollbar { display: none; }

.dv-project-todo-drop-ready {
    position: relative;
    border-radius: 20px;
    box-shadow: inset 0 0 0 2px rgba(148, 163, 184, 0.28);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
}

.dv-project-todo-drop-ready::after {
    content: "";
    position: absolute;
    inset: 10px;
    border: 2px dashed rgba(148, 163, 184, 0.42);
    border-radius: 16px;
    pointer-events: none;
}

.dv-project-todo-drop-target {
    position: relative;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(248, 250, 252, 0.98));
    box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.28);
}

.dv-project-todo-drop-target::after {
    content: "";
    position: absolute;
    inset: 10px;
    border: 2px dashed rgba(59, 130, 246, 0.65);
    border-radius: 16px;
    pointer-events: none;
}

.dv-project-todo-drop-target .dv-todo-list {
    min-height: 96px;
}

.dv-todo-section-marker {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 10px;
    padding: 0 4px;
    font-size: 0.72em;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.dv-todo-section-marker::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.4), rgba(148, 163, 184, 0));
}
.dv-todo-section-duration {
    order: 2;
    margin-left: auto;
    color: #94a3b8;
    font-size: 0.92em;
    font-weight: 750;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
}
.dv-todo-section-marker::after {
    order: 1;
}

.dv-todo-section-marker-important {
    margin-top: 0;
    color: #9a3412;
}

.dv-todo-section-marker-important::after {
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.38), rgba(249, 115, 22, 0));
}

.dv-todo-item {
    display: flex;
    align-items: center;
    padding: 8px 10px; /* 좌우 패딩 약간 늘림 */
    border-bottom: 1px solid #f0f0f0;
    border-left: 4px solid transparent;
    border-radius: 10px;
    gap: 8px; /* 아이템 간 간격 조정 */
    font-size: 0.9em;
    position: relative;
    width: 100%; /* 부모 너비에 맞춤 */
    box-sizing: border-box; /* 패딩과 테두리를 너비에 포함 */
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}
.dv-todo-item.dv-todo-item-important {
    background: linear-gradient(180deg, #f8fbff 0%, #fdfefe 100%);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.12);
}
.dv-todo-item:last-child { border-bottom: none; }
.dv-todo-item.dv-todo-item-diary-try {
    border-radius: 10px;
    border-left-color: #22c55e;
}
.dv-todo-priority-badge {
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.96);
    color: #1d4ed8;
    border: 1px solid rgba(37, 99, 235, 0.28);
    font-size: 0.74em;
    font-weight: 700;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
    position: relative;
    z-index: 1;
}
.dv-todo-text {
    flex-grow: 1;
    min-width: 0;
    color: #1f2937;
    font-size: 0.98em;
    line-height: 1.4;
    word-break: break-word;
}
.dv-todo-content {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}
.dv-todo-content .dv-todo-text {
    flex: 0 1 auto;
}
.dv-todo-project-contribution {
    overflow: hidden;
    color: #718096;
    font-size: 0.72em;
    font-weight: 600;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dv-todo-item.completed .dv-todo-project-contribution {
    color: #a8b1bd;
}
.dv-todo-text.completed {
    text-decoration: line-through;
    color: #98a2b3;
}
.dv-todo-item-decomposed {
    background: #f8fafc;
    cursor: default;
}
.dv-todo-item-decomposed .dv-todo-text {
    color: #64748b;
    font-weight: 650;
}
.dv-todo-item-decomposed .dv-todo-time-badge {
    display: none;
}
.dv-todo-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}
.dv-todo-edit-fields {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dv-todo-origin-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 38px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 0.68em;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}
.dv-todo-origin-badge-try {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.28);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.48);
}
.dv-todo-origin-badge-decomposed {
    min-width: 48px;
    background: rgba(71, 85, 105, 0.08);
    color: #475569;
    border: 1px solid rgba(71, 85, 105, 0.2);
    letter-spacing: 0;
    text-transform: none;
}
.dv-todo-try-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 34px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 0.68em;
    font-weight: 800;
    white-space: nowrap;
}
.dv-todo-try-status-pending {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #cbd5e1;
}
.dv-todo-try-status-applied {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.28);
}
.dv-todo-time-badge {
    flex-shrink: 0;
    padding: 3px 9px;
    border-radius: 999px;
    background: #eef2f6;
    color: #475467;
    font-size: 0.82em;
    font-weight: 600;
}
.dv-todo-edit-text-input {
    flex-grow: 1;
    min-width: 0;
    padding: 6px 9px;
    border: 1px solid #007bff;
    border-radius: 6px;
    background: #fff;
    font-size: 0.95em;
    outline: none;
}
.dv-todo-edit-time-input {
    width: 72px;
    flex-shrink: 0;
    padding: 6px 8px;
    border: 1px solid #007bff;
    border-radius: 6px;
    background: #fff;
    font-size: 0.85em;
    text-align: center;
    outline: none;
}

.dpl-progress-delta {
    font-size: 0.72em;
    color: #7f8c8d;
    margin-top: 4px;
}

.dpl-progress-stack {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dpl-progress-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-height: 18px;
}

.dpl-progress-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 18px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 0.68em;
    font-weight: 800;
    line-height: 1.4;
    white-space: nowrap;
}

.dpl-progress-badge-base {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}

.dpl-progress-badge-today {
    background: rgba(16, 185, 129, 0.14);
    color: #047857;
}

.dpl-project-name-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.dpl-project-deadline {
    font-size: 0.72em;
    color: #9a3412;
    font-weight: 700;
    white-space: normal;
    flex-shrink: 0;
}

.dpl-project-estimate-left {
    font-size: 0.72em;
    color: #64748b;
    font-weight: 600;
    white-space: normal;
}

.dpl-progress-bar-mini {
    display: flex;
    align-items: stretch;
    overflow: hidden;
    flex: 1;
    width: 100%;
    height: 6px;
    background-color: #e9ecef !important;
    border-radius: 3px;
    min-width: 40px;
}

.dpl-progress-fill-base {
    background-color: #2563EB;
    border-radius: 999px 0 0 999px;
}

.dpl-progress-fill-today {
    background-color: #10B981;
    border-left: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 0 999px 999px 0;
}

.dpl-progress-text {
    flex: 0 0 auto;
    color: #0f172a;
    font-size: 0.8em;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.mv-todo-debug-meta {
    flex-basis: 100%;
    margin-left: 28px;
    margin-top: 2px;
    font-size: 0.7em;
    color: #9aa4af;
    word-break: break-word;
}
.dv-todo-number {
    color: #909090; font-size: 0.9em; min-width: 20px;
    text-align: right; margin-right: 3px; user-select: none;
}
.dv-todo-checkbox { margin-right: 6px; flex-shrink: 0; transform: scale(0.9); }
.dv-todo-text-input {
    flex-grow: 1; /* 사용 가능한 공간을 모두 차지 */
    border: 1px solid transparent;
    padding: 5px;
    border-radius: 3px;
    font-size: 1em;
    background-color: transparent;
    min-width: 0; /* flex 아이템이 줄어들 수 있도록 함 */
    overflow: hidden; /* 내용이 넘칠 경우 숨김 */
    text-overflow: ellipsis; /* 넘치는 텍스트는 ...으로 표시 */
    white-space: nowrap; /* 줄바꿈 방지 */
}
.dv-todo-text-input:focus { border: 1px solid #007bff;
    background-color: #fff; /* 포커스 시에는 흰색 배경 */
    white-space: normal; /* 포커스 시에는 줄바꿈 허용 (선택사항) */ }
.dv-todo-text-input.completed { text-decoration: line-through; color: #a0a0a0; }
.dv-todo-controls {
    display: flex; align-items: center; gap: 8px;
    flex-shrink: 0; margin-left: auto;
}
.dv-todo-importance {
    width: 35px; padding: 3px 2px; border: 1px solid #ddd;
    border-radius: 3px; font-size: 0.9em; text-align: center;
}
.dv-todo-time-label {
    font-size: 0.9em; color: #555; display: flex;
    align-items: center; cursor: default;
}
.dv-todo-time {
    width: 40px; padding: 3px 2px; border: 1px solid #ddd;
    border-radius: 3px; font-size: 0.9em; text-align: center; margin-left: 2px;
}
.dv-todo-delete-btn {
    background-color: transparent; color: #adb5bd; border: none;
    padding: 3px 7px; border-radius: 3px; cursor: pointer; font-size: 0.8em;
    opacity: 0; visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s, color 0.2s;
    font-weight: bold;
}
.dv-todo-item:hover .dv-todo-delete-btn { opacity: 1; visibility: visible; color: #dc3545; }
.dv-todo-delete-btn:hover { color: #c82333 !important; }


.dv-add-todo-btn-container {
    /* 버튼 컨테이너 자체의 시각적 스타일 */
    padding: 15px 10px 10px 10px; /* 버튼 주변 여백 */
    width: 100%;
    box-sizing: border-box;
    margin-top: 10px; /* 마지막 할 일 항목과의 간격 */

    /* 항상 보이도록 설정 */
    opacity: 1;
    visibility: visible;
    max-height: 100px;
    overflow: visible;
}

.dv-add-todo-btn {
    width: 100%;
    padding: 10px 12px;
    background: linear-gradient(135deg, #2C3E50 0%, #34495e 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.3);
    transition: all 0.2s ease;
}

.dv-add-todo-btn:hover {
    background: linear-gradient(135deg, #34495e 0%, #2C3E50 100%);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.4);
}

/* --- Routines (추가된 스타일) --- */
#routines-app-container {
    position: relative; width: 100%; height: 100%;
    display: flex; flex-direction: column;
    overflow-y: auto; padding: 10px;
}
.dv-routines-table {
    width: 100%; border-collapse: collapse;
    font-size: 0.85em; table-layout: fixed;
    margin-bottom: auto;
}
.dv-routines-table thead {
    display: table-header-group; position: sticky;
    top: -1px; background-color: #f8f9fa; z-index: 1;
}
.dv-routines-table thead tr,
.dv-routines-table tbody .dv-routine-table-row {
    display: table-row; position: relative;
}
.dv-routines-table tbody { display: table-row-group; }
.dv-routines-table th, .dv-routines-table td {
    border: 1px solid #e7e9ec; padding: 8px 10px;
    text-align: left; vertical-align: middle;
    word-break: break-word;
}
.dv-routines-table th { font-weight: 600; color: #343a40; background-color: #f8f9fa; }
.dv-routines-table td { background-color: #fff; }
.dv-routines-table tr:hover td:not(.editing-row td) { background-color: #f8f9fa; }
.dv-routines-table select, .dv-routines-table input[type="text"], .dv-routines-table textarea {
    width: 100%; padding: 6px; border: 1px solid #ced4da;
    border-radius: 4px; box-sizing: border-box; font-size: 1em;
    font-family: inherit; background-color: #fff;
}
.dv-routines-table textarea { resize: vertical; min-height: 40px; line-height: 1.4; }
.dv-routines-table select:focus, .dv-routines-table input[type="text"]:focus, .dv-routines-table textarea:focus {
    border-color: #86b7fe; outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, .25);
}
.dv-routine-row-actions-container {
    position: absolute; right: 8px; top: 50%;
    transform: translateY(-50%); display: flex; align-items: center;
    gap: 6px; background-color: rgba(255, 255, 255, 0.9);
    padding: 4px 6px; border-radius: 5px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    opacity: 0; visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    z-index: 2;
}
.dv-routine-table-row:hover .dv-routine-row-actions-container,
.dv-routine-table-row.editing-row .dv-routine-row-actions-container {
    opacity: 1; visibility: visible;
}
button.dv-routine-action-btn {
    background: none; border: none; cursor: pointer; padding: 4px;
    font-size: 1em; color: #6c757d; line-height: 1;
}
.dv-routine-action-btn.dv-routine-edit-btn:hover { color: #007bff; }
.dv-routine-action-btn.dv-routine-delete-btn:hover { color: #dc3545; }
.dv-routine-action-btn.dv-routine-confirm-btn { color: #198754; }
.dv-routine-action-btn.dv-routine-confirm-btn:hover { color: #157347; }
.dv-routine-action-btn.dv-routine-cancel-btn { color: #ffc107; }
.dv-routine-action-btn.dv-routine-cancel-btn:hover { color: #d39e00; }
.dv-empty-routines-message {
    text-align: center; padding: 20px !important; color: #6c757d;
    font-style: italic; font-size: 0.9em;
}
.dv-add-routine-btn {
    margin: 15px auto 10px auto; padding: 10px 18px;
    background-color: #0d6efd; color: white; border: none;
    border-radius: 5px; cursor: pointer; font-size: 0.95em;
    display: block; width: fit-content; flex-shrink: 0;
    opacity: 0; visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s, background-color 0.2s;
}
#routines-app-container:hover .dv-add-routine-btn { opacity: 1; visibility: visible; }
.dv-add-routine-btn:hover { background-color: #0b5ed7; }

/* --- Center Pane & Timelines --- */
.dv-center-pane {
    flex: 2 1 56%;
    display: flex; flex-direction: column;
    align-items: center; gap: 4px;
    padding: 12px;
    overflow: hidden; /* Zoom 시 스크롤 방지 */
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    position: relative;
    z-index: 0;
}
.dv-date-nav {
    position: absolute;
    top: 8px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 5;
}
.dv-date-nav-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 120px);
    padding: 7px 16px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 248, 252, 0.98) 100%);
    border: 1px solid rgba(214, 221, 230, 0.98);
    box-shadow: 0 10px 24px rgba(20, 31, 46, 0.1);
    color: #213246;
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 0.015em;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}
.dv-date-nav-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #d6dde6;
    border-radius: 999px;
    background: #ffffff;
    color: #25313d;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    box-shadow: 0 6px 18px rgba(20, 31, 46, 0.12);
    pointer-events: auto;
}
.dv-date-nav-btn:hover {
    background-color: #f4f7fb;
    border-color: #b8c4d1;
    transform: translateY(-1px);
}
.dv-timelines-side-by-side-wrapper {
    display: flex; gap: 15px;
    width: 100%; justify-content: space-around;
    flex: 1; /* 남은 공간 모두 차지 */
    min-height: 0; /* flex overflow 방지 */
}
.dv-timelines-side-by-side-wrapper > .dv-grid-wrapper { flex: 1; min-width: 0; }
.dv-grid-wrapper {
    display: flex; flex-direction: column; align-items: center;
    width: 100%;
    flex: 1; /* 남은 공간 모두 차지 */
    min-height: 0; /* flex overflow 방지 */
}
.dv-grid-label {
    font-weight: 600; 
    margin-top: 8px;
    margin-bottom: 8px;
    font-size: 1.05em; color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 32px; /* 두 라벨 높이 동일하게 */
    flex-shrink: 0;
}
.dv-grid-container {
    display: grid; grid-template-columns: minmax(35px, 10%) repeat(var(--dv-timeline-columns, 6), 1fr);
    grid-template-rows: auto repeat(var(--dv-timeline-rows, 24), minmax(0, 1fr));
    gap: 1px; background-color: #dde1e6;
    width: 100%; border: 1px solid #c5cdd3;
    border-radius: 4px; overflow: hidden;
    position: relative; /* 자식 absolute 요소들의 기준점 */
    z-index: 0;
    flex: 1; /* 남은 공간 모두 차지 */
    min-height: 300px; /* 최소 높이 확보 */
}
.dv-grid-container .dv-header-cell,
.dv-grid-container .dv-time-cell {
    background-color: #edf2f7; padding: 0.4em 0.3em; text-align: center;
    font-weight: 500; user-select: none; font-size: 0.8em; color: #4a5568;
}
.dv-grid-container .dv-time-cell { text-align: right; }
.dv-grid-container .dv-grid-cell {
    background-color: white; min-height: 1.2em; border: 1px solid #e2e8f0;
    padding: 2px 3px; cursor: pointer; position: relative; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; z-index: 0;
    font-size: 0.7em;
    transition:
        border-color 0.2s ease,
        transform 0.16s ease,
        box-shadow 0.16s ease,
        filter 0.16s ease,
        opacity 0.16s ease;
}
.dv-grid-container .dv-grid-cell:hover { border-color: #a0aec0; }
.dv-grid-container.dv-routine-hover-active .dv-grid-cell:not(.dv-routine-linked-hover) {
    opacity: 0.58;
    filter: saturate(0.62) brightness(0.96);
}
.dv-grid-container.dv-routine-adherence-hover-active .dv-grid-cell:not(.dv-routine-adherence-linked-hover) {
    opacity: 0.38;
    filter: saturate(0.46) brightness(0.92);
}
.dv-grid-container .dv-grid-cell.dv-routine-linked-hover,
.dv-grid-container .dv-grid-cell.dv-routine-adherence-linked-hover {
    opacity: 1;
    transform: translateY(-2px) scale(1.025);
    border-color: rgba(255, 255, 255, 0.82);
    box-shadow:
        0 10px 20px rgba(15, 23, 42, 0.18),
        0 3px 8px rgba(15, 23, 42, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.72),
        inset 0 0 0 1px rgba(255, 255, 255, 0.28);
    filter: saturate(1.16) brightness(1.08);
    z-index: 4;
}
.dv-grid-container .dv-grid-cell.dv-timeline-drop-target-hover {
    background-color: #d0e9ff !important;
    outline: 2px dashed #007bff; outline-offset: -2px;
}
.dv-task-overlay-container {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none; z-index: 5;
}
.dv-timeline-divider-overlay-container {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none; z-index: 8;
}
.dv-timeline-divider-line,
.dv-timeline-divider-preview {
    position: absolute;
    height: 0;
    border-top: 2px solid rgba(51, 65, 85, 0.48);
    transform: translateY(-1px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}
.dv-timeline-divider-line {
    pointer-events: auto;
    cursor: grab;
}
.dv-timeline-divider-line:active {
    cursor: grabbing;
}
.dv-timeline-divider-line::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -7px;
    height: 14px;
}
.dv-timeline-divider-line:hover,
.dv-timeline-divider-dragging .dv-timeline-divider-line {
    border-top-color: rgba(30, 41, 59, 0.72);
    border-top-width: 3px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.74),
        0 2px 8px rgba(15, 23, 42, 0.12);
}
.dv-timeline-divider-preview {
    pointer-events: none;
    border-top-style: dashed;
    border-top-width: 2px;
    border-top-color: rgba(37, 99, 235, 0.78);
    filter: drop-shadow(0 1px 3px rgba(37, 99, 235, 0.28));
    z-index: 9;
}
.dv-grid-container.dv-timeline-divider-mode {
    outline: 2px solid rgba(37, 99, 235, 0.38);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1), inset 0 0 0 9999px rgba(37, 99, 235, 0.025);
}
.dv-grid-container.dv-timeline-divider-mode .dv-grid-cell {
    cursor: crosshair;
}
.dv-grid-container.dv-timeline-divider-mode .dv-grid-cell:hover {
    background-color: #eff6ff !important;
    border-color: rgba(37, 99, 235, 0.58);
}
.dv-timeline-divider-context-menu {
    position: fixed;
    z-index: 10000;
    min-width: 132px;
    padding: 6px;
    border: 1px solid #d6dde6;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(20, 31, 46, 0.16);
}
.dv-timeline-divider-context-menu button {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #25313d;
    font-size: 0.82rem;
    text-align: left;
    cursor: pointer;
}
.dv-timeline-divider-context-menu button:hover {
    background: #f1f5f9;
}
.dv-scheduled-task-segment-overlay {
    position: absolute; padding: 2px 0px 2px 4px; box-sizing: border-box;
    border: 3px solid #f7a6a6; background-color: rgba(247, 166, 166, 0.3);
    display: flex; align-items: center; overflow: hidden; font-size: 0.75em;
    border-radius: 3px; pointer-events: auto; cursor: default; z-index: 6;
}
.dv-scheduled-task-text {
    flex-grow: 1; white-space: nowrap; overflow: hidden;
    text-overflow: ".."; color: #2c3e50; padding-right: 8px;
}
.dv-scheduled-task-delete-btn {
    position: absolute; top: 50%; right: 5px; transform: translateY(-50%);
    opacity: 0; visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    background: none; border: none; color: #7f8c8d; cursor: pointer;
    font-size: 1.3em; padding: 0 3px; line-height: 1;
}
.dv-scheduled-task-segment-overlay:hover .dv-scheduled-task-delete-btn {
    opacity: 1; visibility: visible;
}
.dv-scheduled-task-delete-btn:hover { color: #c0392b; }
.dv-task-tooltip {
    position: fixed;
    left: 0;
    top: 0;
    max-width: min(360px, calc(100vw - 16px));
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(24, 32, 44, 0.94);
    color: #ffffff;
    font-size: 0.8rem;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
    box-shadow: 0 10px 28px rgba(10, 18, 28, 0.24);
    pointer-events: none;
    z-index: 9999;
}
.dv-task-tooltip[data-interactive="true"] {
    pointer-events: auto;
}
.dv-task-tooltip-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 220px;
}
.dv-task-tooltip-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.72);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.dv-task-tooltip-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
}
.dv-task-tooltip-row-text {
    flex: 1;
    min-width: 0;
    color: #ffffff;
}
.dv-task-tooltip-remove-btn {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 5px;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0;
}
.dv-task-tooltip-remove-btn:hover {
    border-color: rgba(255, 148, 148, 0.5);
    background: rgba(255, 148, 148, 0.12);
    color: #ffd7d2;
}

/* ▼▼▼ [추가] 타임라인 블록 리사이즈 핸들 스타일 ▼▼▼ */
body.dv-task-resizing .dv-scheduled-task-segment-overlay {
    pointer-events: none;
}

.dv-resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px; /* 핸들의 너비 */
    cursor: ew-resize; /* 동-서 리사이즈 커서 */
    z-index: 7; /* 텍스트보다 위에 오도록 */
}

.dv-resize-handle-left {
    left: 0;
}

.dv-resize-handle-right {
    right: 0;
}

/* 핸들에 마우스를 올렸을 때 시각적 피드백 (선택 사항) */
.dv-resize-handle:hover::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 60%;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 2px;
}

/* "어제" 버튼 스타일 */
.dv-load-yesterday-btn {
    padding: 2px 8px;
    font-size: 0.8em;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    color: #495057;
    white-space: nowrap;
    transition: background-color 0.15s, border-color 0.15s;
}
.dv-load-yesterday-btn:hover {
    background-color: #e9ecef;
    border-color: #ced4da;
}
.dv-load-yesterday-btn:active {
    background-color: #dee2e6;
}
.dv-apply-yesterday-routine-btn {
    padding: 2px 8px;
    font-size: 0.8em;
    background-color: #eef7f2;
    border: 1px solid #b9dcc7;
    border-radius: 4px;
    cursor: pointer;
    color: #1f6a3e;
    white-space: nowrap;
    transition: background-color 0.15s, border-color 0.15s;
}
.dv-apply-yesterday-routine-btn:hover {
    background-color: #e3f1e9;
    border-color: #9dcdb2;
}
.dv-apply-yesterday-routine-btn:active {
    background-color: #d5e9de;
}

/* --- Color Picker & Modal & Diary --- */
/* Color picker - compact and responsive */
.dv-color-picker {
    display: flex; flex-wrap: wrap; gap: 4px; padding: 8px;
    width: fit-content; max-width: 100%; min-width: 0;
    align-items: center; align-content: flex-start; justify-content: flex-start;
    background-color: #f8f9fa; border-radius: 6px;
    border: 1px solid #e0e0e0; position: relative;
    box-sizing: border-box; align-self: center; margin-left: auto; margin-right: auto;
    flex-shrink: 0; /* Don't shrink too much */
}
.dv-add-color-btn{ width:26px;height:26px;border:2px dashed #ccc;border-radius:4px;cursor:pointer; display:flex;align-items:center;justify-content:center;font-size:16px; background:#fff;color:#777;transition:all .2s ease }
.dv-add-color-btn:hover{border-color:#aaa;color:#555}
.dv-color-picker-popup{ position:absolute;bottom:calc(100% + 8px);left:50%;transform:translateX(-50%); min-width:220px;background:#fff;padding:15px;border-radius:8px; box-shadow:0 4px 12px rgba(0,0,0,.15);z-index:4100;display:none }
.dv-color-picker-popup.dv-show{display:block}
.dv-color-input-group{display:flex;flex-direction:column;gap:10px;margin-bottom:12px}
.dv-color-input-group input[type="color"]{height:30px;padding:0 2px; border:1px solid #ddd; border-radius:4px;}
.dv-color-input-group input[type="text"]{padding:8px;border:1px solid #ddd;border-radius:4px;}
.dv-color-option{ width:28px;height:28px;border:1px solid #ccc;border-radius:4px;cursor:pointer; position:relative;transition:transform .1s ease }
.dv-color-option--none{background:#fff;border-color:#adb5bd}
.dv-color-option--clear{background:#fff;border-color:#adb5bd}
.dv-color-option:hover{transform:scale(1.1);border-color:#999}
.dv-color-option:hover::after{ content:attr(data-label);position:absolute;bottom:calc(100% + 5px);left:50%; transform:translateX(-50%);padding:5px 8px;background:rgba(0,0,0,.85);color:#fff; border-radius:4px;font-size:11px;white-space:nowrap;z-index:4101 }
.dv-color-option.is-selected{border-color:#2563eb;box-shadow:0 0 0 2px rgba(37,99,235,.22);transform:scale(1.05)}
.dv-color-option.is-dragging{opacity:.45;transform:scale(.96)}
.dv-color-option.is-drop-target{border-color:#2563eb;box-shadow:0 0 0 2px rgba(37,99,235,.18)}
.dv-color-picker-popup .dv-save-btn { width:100%; padding:10px; font-size:0.9em; background-color: #28a745; border-color: #28a745; color: white; }
.dv-color-picker-popup .dv-save-btn:hover { background-color: #218838; border-color: #1e7e34; }
.dv-color-option-context-menu {
    position: absolute; /* JS에서 pageX, pageY 기준으로 위치 설정 */
    background-color: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 5px 0;
    min-width: 80px; /* 최소 너비 */
    z-index: 4102; /* 색상 추가 팝업보다 위에 오도록 */
    font-size: 13px; /* 내부 폰트 크기 */
}

.dv-color-option-menu-item {
    padding: 8px 12px;
    cursor: pointer;
    color: #334155;
}

.dv-color-option-menu-item:hover {
    background-color: #f5f5f5;
}

.dv-color-option-delete-item {
    color: #e74c3c; /* 삭제 텍스트는 빨간색 계열 */
}
.dv-modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,.5);display:flex;align-items:center;justify-content:center;z-index:2000;backdrop-filter:blur(3px);animation:dv-fadeIn .2s ease-out}
.dv-modal-content{background-color:#fff;padding:20px 24px;border-radius:10px;width:90%;max-width:420px;min-height:200px;position:relative;box-shadow:0 5px 20px rgba(0,0,0,.2);animation:dv-slideIn .25s ease-out;color:#000;display:flex;flex-direction:column}
.dv-editing-textarea{width:100%;flex-grow:1;border:1px solid #ccc;padding:10px;resize:vertical;font-family:inherit;font-size:1em;box-sizing:border-box;background-color:transparent;z-index:10;border-radius:4px;margin-bottom:15px}
.dv-modal-buttons{display:flex;justify-content:flex-end;padding-top:0;gap:10px}
.dv-modal-button, .dv-save-text-button, .dv-cancel-text-button{padding:8px 18px;border:none;border-radius:5px;cursor:pointer;font-weight:500;font-size:0.9em;transition:all .2s ease}
.dv-save-text-button{background-color:#007bff;color:#fff}.dv-save-text-button:hover{background-color:#0056b3}
.dv-cancel-text-button{background-color:#f0f0f0;color:#333}.dv-cancel-text-button:hover{background-color:#e0e0e0}
.dv-todo-modal {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #dbe3ec;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
    width: min(420px, calc(100vw - 32px));
}
.dv-todo-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}
.dv-todo-modal-save,
.dv-todo-modal-cancel {
    min-width: 88px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
}
.dv-todo-modal-save {
    background: linear-gradient(135deg, #2C3E50 0%, #34495e 100%);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(44, 62, 80, 0.22);
}
.dv-todo-modal-save:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(44, 62, 80, 0.28);
}
.dv-todo-modal-cancel {
    background: #ffffff;
    color: #2C3E50;
    border-color: #cfd8e3;
}
.dv-todo-modal-cancel:hover:not(:disabled) {
    background: #f4f7fa;
    border-color: #b9c7d6;
}
.dv-todo-modal-save:disabled,
.dv-todo-modal-cancel:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}
.dv-todo-modal-input:focus {
    outline: none;
    border-color: #2C3E50;
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.14);
}
@keyframes dv-fadeIn{from{opacity:0}to{opacity:1}}
@keyframes dv-slideIn{from{opacity:0;transform:translateY(-20px)}to{opacity:1;transform:translateY(0)}}
.dv-right-pane { flex: 1 1 22%; display: flex; padding: 0; }
#diary-app-container { width: 100%; height: 100%; background-color: #fff; border-radius: 8px; padding: 15px; display: flex; flex-direction: column; gap: 15px; overflow-y: auto; }
.dv-diary-section { width: 100%; display: flex; flex-direction: column; flex: 1; min-height: 120px; background-color: #ffffff; border: 1px solid #e0e0e0; border-radius: 6px; padding: 15px 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.dv-diary-section h3 { margin: 0 0 12px 0; font-size: 1.1em; font-weight: 600; color: #2c5282; border-bottom: 1px solid #e2e8f0; padding-bottom: 8px; }
.dv-diary-section textarea { 
    width: 100%; flex-grow: 1; 
    border: 1px solid #d2d6dc; 
    border-radius: 4px; padding: 10px 12px; 
    font-size: 22px; line-height: 1.7; 
    resize: none; box-sizing: border-box; 
    background-color: #fdfdfd; 
    color: #333; 
}
.dv-diary-section textarea::placeholder { color: #a0aec0; font-style: italic; }
.dv-diary-section textarea:focus { border-color: #66afe9; box-shadow: 0 0 0 0.2rem rgba(102, 175, 233, 0.25); outline: none; }
.dv-current-time-indicator {
    position: absolute;
    /* top: 0;  */
    /* left: 0;  */
    width: 2px;
    /* height: 100%;  */
    background-color: red;
    z-index: 10; 
    pointer-events: none;
    display: none; /* JS로 표시/숨김 제어 */
}
.dv-grid-cell.dv-passed-time-block {
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(0, 0, 0, 0.05),
        rgba(0, 0, 0, 0.05) 4px,
        transparent 4px,
        transparent 8px
    );
    /* 기존 배경색과 섞이도록 background-blend-mode 사용 가능 (선택적) */
    /* background-blend-mode: multiply; */
}
.dv-grid-cell.dv-current-time-block {
    /* 특별한 스타일이 필요하면 여기에 추가 */
    /* 예: background-color: rgba(255, 255, 0, 0.1); */
}

/* --- Right Pane --- */
.dv-right-pane-content {
    flex: 1;
    min-height: 200px;
    padding: 15px;
    border: 1px solid #e7eaf0;
    border-radius: 6px;
    background-color: #f8f9fa;
    margin-bottom: 10px;
    overflow-y: auto;
}

.dv-right-pane-footer {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    border-top: 1px solid #e7eaf0;
}

.dv-right-pane-footer[hidden] {
    display: none;
}

.dv-diary-toggle-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #2C3E50 0%, #34495e 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.3);
}

.dv-diary-toggle-btn:hover {
    background: linear-gradient(135deg, #34495e 0%, #2C3E50 100%);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.4);
}

.dv-experiment-test-btn {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid rgba(154, 52, 18, 0.2);
    border-radius: 8px;
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    color: #9a3412;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(154, 52, 18, 0.14);
    transition: all 0.2s ease;
}

.dv-experiment-test-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(154, 52, 18, 0.2);
}

.dv-experiment-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(4px);
}

.dv-experiment-modal {
    width: min(1180px, 96vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 18px;
    background: #f8fafc;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.36);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.dv-experiment-modal-header,
.dv-experiment-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

.dv-experiment-modal-footer {
    justify-content: flex-end;
    border-top: 1px solid #e2e8f0;
    border-bottom: 0;
}

.dv-experiment-kicker {
    margin-bottom: 4px;
    color: #f97316;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.dv-experiment-modal-header h2 {
    margin: 0;
    color: #172033;
    font-size: 20px;
}

.dv-experiment-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.dv-experiment-steps {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 9px 24px;
    background: #fff7ed;
    border-bottom: 1px solid #fed7aa;
}

.dv-experiment-steps span {
    padding: 6px 10px;
    border-radius: 999px;
    background: #ffffff;
    color: #9a3412;
    font-size: 12px;
    font-weight: 800;
}

.dv-experiment-modal-body {
    display: grid;
    grid-template-columns: minmax(560px, 1fr) 360px;
    gap: 18px;
    padding: 16px 24px;
    overflow: auto;
}

.dv-experiment-timeline-panel,
.dv-experiment-card {
    border: 1px solid #dbe4ef;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.dv-experiment-timeline-panel {
    padding: 14px;
}

.dv-experiment-section-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
}

.dv-experiment-section-head h3,
.dv-experiment-card h3 {
    margin: 0;
    color: #1f2a3d;
    font-size: 15px;
}

#experiment-selected-range {
    padding: 6px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
}

#experiment-selected-range.is-error {
    background: #fee2e2;
    color: #b91c1c;
}

.dv-experiment-grid {
    position: relative;
    display: grid;
    grid-template-columns: 54px repeat(6, minmax(60px, 1fr));
    grid-auto-rows: 24px;
    gap: 2px;
    user-select: none;
    --experiment-hour-col-width: 54px;
    --experiment-cell-gap: 2px;
    --experiment-row-height: 24px;
    --experiment-data-col-width: calc((100% - var(--experiment-hour-col-width) - (6 * var(--experiment-cell-gap))) / 6);
}

.dv-experiment-grid-head,
.dv-experiment-time-label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    height: 24px;
    border-radius: 7px;
    background: #f1f5f9;
    color: #52627a;
    font-size: 11px;
    font-weight: 800;
}

.dv-experiment-cell {
    position: relative;
    z-index: 1;
    min-height: 0;
    height: 24px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: crosshair;
}

.dv-experiment-cell.is-selected {
    z-index: 4;
    border-color: #ef4444;
    box-shadow: inset 0 0 0 2px rgba(239, 68, 68, 0.75);
}

.dv-experiment-cell.is-selection-start::after {
    content: "!";
    position: absolute;
    top: 2px;
    right: 3px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
}

.dv-experiment-task-segment {
    position: absolute;
    top: calc((var(--experiment-task-row) - 1) * (var(--experiment-row-height) + var(--experiment-cell-gap)));
    left: calc(var(--experiment-hour-col-width) + var(--experiment-cell-gap) + ((var(--experiment-task-col) - 2) * (var(--experiment-data-col-width) + var(--experiment-cell-gap))));
    width: calc((var(--experiment-task-span) * var(--experiment-data-col-width)) + ((var(--experiment-task-span) - 1) * var(--experiment-cell-gap)));
    height: var(--experiment-row-height);
    z-index: 3;
    display: flex;
    align-items: center;
    min-width: 0;
    margin: 0;
    padding: 0 7px;
    overflow: hidden;
    border: 2px solid #4A90E2;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.42);
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.18);
    pointer-events: none;
}

.dv-experiment-task-segment span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #0f172a;
    font-size: 11px;
    font-weight: 900;
}

.dv-experiment-help {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 12px;
}

.dv-experiment-form-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dv-experiment-card {
    padding: 14px;
}

.dv-experiment-empty-state {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dv-experiment-empty-state p {
    margin: 10px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.55;
}

.dv-experiment-selected-summary {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 10px;
    padding: 10px 11px;
    border-radius: 12px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 800;
}

.dv-experiment-selected-summary span {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.dv-experiment-search-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.dv-experiment-search-box strong {
    display: block;
    color: #334155;
    font-size: 13px;
    font-weight: 900;
}

.dv-experiment-search-box span {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.35;
}

.dv-experiment-search-input {
    width: 118px;
    flex: 0 0 auto;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 7px 10px;
    background: #ffffff;
    color: #172033;
    font-size: 12px;
}

.dv-experiment-search-input:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

.dv-problem-routine-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.dv-problem-routine-filter-btn {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 9px;
    border: 1px solid #dbe4ef;
    border-radius: 999px;
    background: #ffffff;
    color: #475569;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
    transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.dv-problem-routine-filter-btn:hover,
.dv-problem-routine-filter-btn:focus-visible,
.dv-problem-routine-filter-btn.is-active {
    border-color: #f97316;
    background: #fff7ed;
    color: #9a3412;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
    outline: none;
}

.dv-problem-routine-filter-swatch,
.dv-problem-routine-badge-swatch {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.dv-problem-routine-filter-btn em {
    color: #94a3b8;
    font-style: normal;
    font-size: 10px;
}

.dv-experiment-problem-options,
.dv-experiment-existing-solutions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.dv-experiment-problem-option,
.dv-experiment-solution-option {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px;
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    background: #f8fafc;
    color: #1e293b;
    text-align: left;
    cursor: pointer;
}

.dv-experiment-problem-option.is-active {
    border-color: #f97316;
    background: #fff7ed;
}

.dv-problem-routine-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 2px;
}

.dv-problem-routine-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    max-width: 100%;
    padding: 2px 7px;
    border-radius: 999px;
    background: #ffffff;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.9);
}

.dv-problem-choice-divider {
    margin: 12px 0;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.dv-experiment-input:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.dv-experiment-problem-option span,
.dv-experiment-empty,
.dv-experiment-solution-option small {
    color: #64748b;
    font-size: 12px;
}

.dv-experiment-solution-option {
    flex-direction: row;
    align-items: center;
}

.dv-experiment-solution-history {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 12px;
}

.dv-experiment-solution-history strong {
    flex: 0 0 auto;
    color: #2563eb;
    font-weight: 900;
}

.dv-experiment-solution-history span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
}

.dv-experiment-label {
    display: block;
    margin: 12px 0 6px;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.dv-experiment-input,
.dv-experiment-textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 11px;
    background: #fff;
    color: #172033;
    font-size: 14px;
}

.dv-experiment-time-note {
    margin-top: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}

.dv-experiment-date-choice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0 0;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}

.dv-problem-detail-date-choice {
    margin-top: -2px;
}

.dv-experiment-prompt-date-choice {
    margin: 0;
    padding: 10px 12px;
    border-color: #e2e8f0;
    border-top: 0;
    border-radius: 0 0 10px 10px;
    background: #f8fafc;
}

.dv-experiment-prompt-date-choice .dv-experiment-date-choice__label {
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
}

.dv-experiment-prompt-date-choice .dv-experiment-date-choice__control {
    border-color: #dbe3ec;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.dv-experiment-prompt-date-choice .dv-experiment-date-choice__btn {
    min-width: 44px;
    padding: 6px 11px;
    color: #64748b;
}

.dv-experiment-prompt-date-choice .dv-experiment-date-choice__btn.is-active {
    background: #243447;
    color: #fff;
    box-shadow: 0 5px 12px rgba(36, 52, 71, 0.18);
}

.dv-experiment-date-choice__label {
    color: #334155;
    font-size: 13px;
    font-weight: 900;
}

.dv-experiment-date-choice__control {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 4px;
    padding: 3px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #f8fafc;
}

.dv-experiment-date-choice__btn {
    min-width: 48px;
    border: 0;
    border-radius: 999px;
    padding: 6px 10px;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.dv-experiment-date-choice__btn.is-active {
    background: #f97316;
    color: #fff;
    box-shadow: 0 6px 14px rgba(249, 115, 22, 0.22);
}

.dv-diary-experiment-badge {
    flex: 0 0 auto;
    min-width: 24px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 11px;
    font-weight: 900;
}

.dv-diary-experiment-badge-try {
    min-width: 34px;
    background: #dcfce7;
    color: #15803d;
}

.dv-experiment-textarea {
    min-height: 86px;
    resize: vertical;
}

.dv-experiment-primary-btn,
.dv-experiment-secondary-btn {
    border: 0;
    border-radius: 10px;
    padding: 11px 16px;
    font-weight: 900;
    cursor: pointer;
}

.dv-experiment-primary-btn {
    background: #f97316;
    color: #fff;
    box-shadow: 0 10px 20px rgba(249, 115, 22, 0.22);
}

.dv-experiment-primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.dv-experiment-secondary-btn {
    background: #e2e8f0;
    color: #334155;
}

.dv-experiment-danger-btn {
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 11px 16px;
    background: #fee2e2;
    color: #b91c1c;
    font-weight: 900;
    cursor: pointer;
}

.dv-problem-occurrence-overlay {
    position: absolute;
    z-index: 8;
    box-sizing: border-box;
    border: 2px solid #ef4444;
    border-radius: 7px;
    background: rgba(254, 226, 226, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.36), 0 1px 6px rgba(239, 68, 68, 0.18);
    pointer-events: none;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.dv-problem-occurrence-overlay.is-summary-hover {
    z-index: 10;
    transform: translateY(-2px) scale(1.01);
    background: rgba(254, 202, 202, 0.4);
    box-shadow: 0 6px 13px rgba(239, 68, 68, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.48);
}

.dv-problem-occurrence-trigger {
    position: absolute;
    top: 2px;
    right: 3px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    border: 0;
    padding: 0;
    cursor: pointer;
    pointer-events: auto;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.dv-problem-occurrence-trigger:hover,
.dv-problem-occurrence-trigger:focus-visible,
.dv-problem-occurrence-overlay.is-summary-hover .dv-problem-occurrence-trigger {
    transform: translateY(-1px) scale(1.08);
    background: #dc2626;
    box-shadow: 0 0 0 3px rgba(254, 202, 202, 0.78), 0 6px 12px rgba(239, 68, 68, 0.28);
}

.dv-problem-pin-panel {
    position: fixed;
    top: 92px;
    right: 24px;
    bottom: 28px;
    z-index: 9200;
    width: min(380px, calc(100vw - 40px));
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding: 16px;
    border: 1px solid #dbe4ef;
    border-radius: 18px;
    background: #f8fafc;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.dv-right-pane-content:has(.dv-task-context-panel.is-problem-panel-host) {
    margin-bottom: 0;
    overflow: hidden;
}

.dv-right-pane:has(.dv-task-context-panel.is-problem-panel-host) {
    overflow: hidden;
}

.dv-right-pane:has(.dv-task-context-panel.is-problem-panel-host) > .dv-right-pane-footer {
    display: none;
}

.dv-task-context-panel.is-problem-panel-host {
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.dv-task-context-panel.is-problem-panel-host .dv-problem-pin-panel {
    position: static;
    inset: auto;
    z-index: auto;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    padding: 12px;
    border-radius: 12px;
    box-shadow: none;
    overflow-y: auto;
    overflow-x: hidden;
}

.dv-task-context-panel.is-problem-panel-host .dv-problem-pin-panel *,
.dv-task-context-panel.is-problem-panel-host .dv-problem-pin-panel *::before,
.dv-task-context-panel.is-problem-panel-host .dv-problem-pin-panel *::after {
    max-width: 100%;
    box-sizing: border-box;
}

.dv-task-context-panel.is-problem-panel-host .dv-experiment-card,
.dv-task-context-panel.is-problem-panel-host .dv-experiment-search-box,
.dv-task-context-panel.is-problem-panel-host .dv-experiment-problem-option,
.dv-task-context-panel.is-problem-panel-host .dv-problem-detail-choice {
    min-width: 0;
}

.dv-task-context-panel.is-problem-panel-host .dv-problem-detail-head-actions {
    overflow: visible;
}

.dv-task-context-panel.is-problem-panel-host .dv-problem-pin-panel-footer {
    position: static;
    bottom: auto;
    margin: auto 0 0;
    padding-right: 0;
    padding-left: 0;
    padding-bottom: 0;
    background: #f8fafc;
}

.dv-problem-pin-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 2px 4px;
}

.dv-problem-pin-panel-header span {
    color: #ef4444;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.dv-problem-pin-panel-header h3 {
    margin: 3px 0 0;
    color: #172033;
    font-size: 18px;
}

.dv-problem-pin-close {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.dv-problem-pin-panel-footer {
    position: sticky;
    bottom: -16px;
    margin: auto -16px -16px;
    padding: 14px 16px 16px;
    border-top: 1px solid #e2e8f0;
    background: rgba(248, 250, 252, 0.96);
    backdrop-filter: blur(8px);
    display: flex;
    gap: 8px;
}

.dv-problem-pin-panel-footer .dv-experiment-primary-btn {
    flex: 1 1 auto;
}

.dv-problem-pin-panel-footer .dv-experiment-secondary-btn {
    flex: 0 0 auto;
}

.dv-problem-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 2px;
}

.dv-problem-detail-head span {
    color: #ef4444;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.dv-problem-detail-head h3 {
    margin: 5px 0 3px;
    color: #172033;
    font-size: 20px;
    line-height: 1.25;
}

.dv-problem-detail-head p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.dv-problem-detail-head-actions {
    position: relative;
    display: flex;
    gap: 8px;
    align-items: center;
}

.dv-problem-detail-menu-btn {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #64748b;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.dv-problem-detail-menu-btn:hover {
    background: #e2e8f0;
}

.dv-problem-detail-menu {
    position: absolute;
    top: 38px;
    right: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: max-content;
    min-width: max-content;
    max-width: none;
    padding: 5px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.dv-problem-detail-menu button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    border-radius: 6px;
    padding: 9px 10px;
    background: transparent;
    color: #334155;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}

.dv-problem-detail-menu button:hover {
    background: #f1f5f9;
}

.dv-problem-detail-menu button:last-child {
    color: #b91c1c;
}

.dv-problem-detail-menu button:last-child:hover {
    background: #fee2e2;
}

.dv-problem-occurrence-context-menu {
    position: fixed;
    z-index: 4600;
    padding: 5px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
}

.dv-problem-occurrence-context-menu button {
    border: 0;
    border-radius: 6px;
    padding: 9px 11px;
    background: transparent;
    color: #b91c1c;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}

.dv-problem-occurrence-context-menu button:hover:not(:disabled) {
    background: #fee2e2;
}

.dv-problem-occurrence-context-menu button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.dv-problem-detail-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.dv-problem-detail-section-head h3,
.dv-problem-detail-solutions > h3 {
    margin: 0;
    color: #172033;
    font-size: 14px;
}

.dv-problem-detail-text-btn {
    border: 0;
    background: transparent;
    color: #2563eb;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.dv-problem-detail-note-text {
    margin: 0;
    color: #334155;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.dv-problem-detail-note-text.is-empty {
    color: #94a3b8;
}

.dv-problem-detail-note-save {
    width: 100%;
    margin-top: 8px;
}

.dv-problem-detail-choice-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    margin-bottom: 10px;
}

.dv-problem-detail-choice {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 11px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #ffffff;
    color: #172033;
    text-align: left;
    cursor: pointer;
}

.dv-problem-detail-choice.is-active {
    border-color: #f97316;
    background: #fff7ed;
    box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.18);
}

.dv-problem-detail-version-label {
    color: #2563eb;
    font-size: 12px;
    font-weight: 900;
}

.dv-problem-detail-choice strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.dv-problem-detail-choice em,
.dv-problem-detail-choice small {
    border-radius: 999px;
    padding: 3px 6px;
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
}

.dv-problem-detail-choice em {
    background: #dbeafe;
    color: #2563eb;
}

.dv-problem-detail-choice small {
    background: #dcfce7;
    color: #15803d;
}

.dv-problem-detail-new-choice {
    width: 100%;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
    color: #475569;
    font-size: 13px;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

.dv-problem-detail-new-choice.is-active {
    border-color: #f97316;
    color: #c2410c;
    background: #fff7ed;
}

.dv-problem-detail-new-editor {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 2px;
}

.dv-problem-detail-new-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.dv-problem-detail-new-actions .dv-experiment-secondary-btn {
    flex: 0 0 auto;
}

.dv-problem-detail-new-actions .dv-experiment-primary-btn {
    flex: 1 1 auto;
}

.dv-problem-detail-hint {
    margin: 10px 0 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}

.dv-problem-detail-footer .dv-experiment-primary-btn {
    width: 100%;
}

@media (max-width: 980px) {
    .dv-experiment-modal-body {
        grid-template-columns: 1fr;
    }

    .dv-experiment-grid {
        grid-template-columns: 48px repeat(6, minmax(42px, 1fr));
    }
}

.dv-execution-summary-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.dv-execution-summary-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.dv-execution-summary-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #334155;
}

.dv-execution-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.dv-execution-metric {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.dv-execution-metric--linked {
    cursor: default;
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        background-color 0.16s ease,
        border-color 0.16s ease;
}

.dv-execution-metric--linked:hover {
    background: #faf8ff;
    border-color: rgba(139, 92, 246, 0.32);
    transform: translateY(-2px) scale(1.01);
    box-shadow:
        0 14px 28px rgba(124, 58, 237, 0.13),
        0 0 0 1px rgba(167, 139, 250, 0.2);
    z-index: 1;
}

.dv-execution-metric__label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #475467;
}

.dv-execution-metric__value {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1;
    color: #0f172a;
}

.dv-execution-metric__meta {
    font-size: 0.78rem;
    line-height: 1.45;
    color: #64748b;
    white-space: pre-line;
}

.dv-execution-metric--todo .dv-execution-metric__value {
    color: #1d4ed8;
}

.dv-execution-metric--routine .dv-execution-metric__value {
    color: #1e3a8a;
}

.dv-execution-metric--routine-linked {
    cursor: default;
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        background-color 0.16s ease,
        border-color 0.16s ease;
}

.dv-execution-metric--routine-linked:hover {
    background: #f7f9ff;
    border-color: rgba(59, 130, 246, 0.28);
    transform: translateY(-2px) scale(1.01);
    box-shadow:
        0 14px 28px rgba(30, 58, 138, 0.12),
        0 0 0 1px rgba(147, 197, 253, 0.22);
    z-index: 1;
}

.dv-execution-metric--accuracy .dv-execution-metric__value {
    color: #7c3aed;
}

.dv-execution-metric--actual .dv-execution-metric__value {
    color: #0f766e;
}

.dv-problem-summary-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 12px;
    padding: 14px 16px;
    box-sizing: border-box;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.dv-problem-summary-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.dv-problem-summary-header h3 {
    margin: 0;
    color: #334155;
    font-size: 0.95rem;
    font-weight: 700;
}

.dv-problem-summary-header span {
    display: block;
    margin-top: 4px;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 600;
}

.dv-problem-summary-section {
    min-width: 0;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.dv-problem-summary-problems {
    cursor: pointer;
    transition: border-color 140ms ease, background 140ms ease;
}

.dv-problem-summary-problems:hover,
.dv-problem-summary-problems:focus-visible {
    border-color: #fecaca;
    background: #fffafa;
    outline: none;
}

.dv-problem-summary-section h4 {
    margin: 0 0 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.dv-experiment-summary-row {
    width: 100%;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 8px 0;
    border: 0;
    border-top: 1px solid #e2e8f0;
    background: transparent;
    text-align: left;
}

.dv-experiment-summary-row:first-of-type {
    padding-top: 0;
    border-top: 0;
}

.dv-experiment-summary-row strong {
    display: block;
    color: #172033;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
}

.dv-experiment-summary-row p {
    margin: 3px 0 0;
    overflow: hidden;
    color: #64748b;
    font-size: 11px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dv-problem-loop {
    width: 100%;
    display: block;
    min-width: 0;
    margin: 0;
    padding: 9px 0;
    box-sizing: border-box;
    border: 0;
    border-top: 1px solid #e2e8f0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.dv-problem-loop:first-of-type {
    padding-top: 0;
    border-top: 0;
}

.dv-problem-loop-head {
    display: flex;
    align-items: flex-start;
    min-width: 0;
    gap: 8px;
}

.dv-problem-loop-head > div {
    flex: 1 1 auto;
    min-width: 0;
}

.dv-problem-loop-head strong {
    display: block;
    color: #172033;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.dv-problem-loop-head p {
    margin: 3px 0 0;
    overflow: hidden;
    color: #64748b;
    font-size: 11px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dv-problem-loop:hover .dv-problem-loop-head strong,
.dv-problem-loop:focus-visible .dv-problem-loop-head strong {
    color: #dc2626;
}

.dv-problem-loop:focus-visible {
    outline: none;
}

.dv-problem-loop-connector {
    width: fit-content;
    margin: 7px 8px 0 26px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 10px;
    font-weight: 800;
}

.dv-problem-loop-tries {
    width: calc(100% - 34px);
    min-width: 0;
    margin: 7px 8px 0 26px;
    padding: 7px 8px;
    box-sizing: border-box;
    overflow: hidden;
    border-radius: 8px;
    background: #ffffff;
}

.dv-problem-loop-try {
    display: flex;
    align-items: flex-start;
    min-width: 0;
    gap: 6px;
    padding: 5px 0;
}

.dv-problem-loop-try + .dv-problem-loop-try {
    border-top: 1px solid #e2e8f0;
}

.dv-problem-loop-try > div {
    min-width: 0;
}

.dv-problem-loop-try strong {
    display: block;
    color: #172033;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.dv-problem-loop-try p {
    margin: 2px 0 0;
    color: #64748b;
    font-size: 11px;
}

.dv-problem-loop-empty {
    color: #94a3b8;
    font-size: 11px;
    line-height: 1.4;
}

.dv-experiment-summary-empty {
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.45;
}

/* --- Diary Modal --- */
.dv-diary-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.25s ease-out;
}

/* Modal이 열린 상태일 때 */
.dv-diary-modal[style*="flex"] {
    display: flex !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.dv-diary-modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    width: 90%;
    max-width: 1120px;
    height: min(90vh, 820px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.dv-diary-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, #2C3E50 0%, #34495e 100%);
    border-radius: 16px 16px 0 0;
    position: relative;
}

.dv-diary-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

.dv-diary-modal-close {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 28px;
    color: #ffffff;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.dv-diary-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dv-diary-modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
    color: #ffffff;
}

.dv-diary-modal-body {
    padding: 22px;
    overflow-y: auto;
    flex: 1;
    display: grid;
    grid-template-columns: minmax(420px, 1.16fr) minmax(330px, 0.84fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
}

.dv-diary-modal-section {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.dv-diary-modal-section:last-child {
    margin-bottom: 0;
}

.dv-diary-modal-section label {
    display: block;
    font-weight: 700;
    color: #495057;
    margin-bottom: 12px;
    font-size: 14px;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.dv-diary-textarea {
    width: 100%;
    flex: 1;
    min-height: 100px;
    padding: 14px 16px;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    background: #f8f9fa;
    transition: all 0.2s ease;
    line-height: 1.6;
}

.dv-diary-score-section {
    min-height: 0;
}

.dv-diary-vision-section {
    grid-column: 1;
    grid-row: 1;
}

.dv-diary-vision-card {
    flex: 1;
    min-height: 0;
    border: 1px solid #d9e2ec;
    border-radius: 14px;
    background: linear-gradient(180deg, #fbfdff 0%, #f3f7fb 100%);
    padding: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dv-diary-vision-frame {
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #eef3f8;
    box-shadow: inset 0 0 0 1px rgba(120, 138, 158, 0.14);
}

.dv-diary-vision-frame-button {
    position: relative;
    border: 0;
    padding: 0;
    cursor: zoom-in;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.dv-diary-vision-frame-button:hover {
    transform: translateY(-1px);
    box-shadow: inset 0 0 0 1px rgba(120, 138, 158, 0.14), 0 10px 22px rgba(44, 62, 80, 0.14);
}

.dv-diary-vision-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
}

.dv-diary-vision-zoom-hint {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(44, 62, 80, 0.78);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    pointer-events: none;
}

.dv-diary-vision-empty {
    width: 100%;
    min-height: 100%;
    border: 1px dashed #c7d3df;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
    color: #6c7a89;
    font-size: 13px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px;
}

.dv-diary-vision-empty-button {
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.dv-diary-vision-empty-button:hover,
.dv-diary-vision-empty-button:focus-visible {
    border-color: #7aa2cf;
    background: #ffffff;
    color: #2c5f93;
    transform: translateY(-1px);
    outline: none;
}

.dv-diary-vision-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10040;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(14, 23, 35, 0.76);
    backdrop-filter: blur(6px);
}

.dv-diary-vision-lightbox-panel {
    position: relative;
    width: min(1180px, calc(100vw - 56px));
    height: min(84vh, 860px);
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(180deg, #fbfdff 0%, #edf3f8 100%);
    box-shadow: 0 28px 72px rgba(10, 18, 28, 0.36);
    padding: 20px;
}

.dv-diary-vision-lightbox-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
}

.dv-diary-vision-lightbox-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: rgba(44, 62, 80, 0.86);
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    z-index: 1;
}

.dv-diary-keep-section {
    flex: 1 1 auto;
}

.dv-diary-keep-section .dv-diary-textarea {
    min-height: 240px;
}

.dv-diary-reflection-column {
    grid-column: 2;
    grid-row: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}


.dv-diary-textarea:focus {
    outline: none;
    border-color: #2C3E50;
    box-shadow: 0 0 0 4px rgba(44, 62, 80, 0.15), 0 4px 12px rgba(44, 62, 80, 0.1);
    background: #ffffff;
}

.dv-diary-modal-footer {
    padding: 20px 28px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    border-radius: 0 0 16px 16px;
}

.dv-diary-save-btn {
    padding: 12px 32px;
    background: linear-gradient(135deg, #2C3E50 0%, #34495e 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(44, 62, 80, 0.3);
}

.dv-diary-save-btn:hover {
    background: linear-gradient(135deg, #34495e 0%, #2C3E50 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 62, 80, 0.4);
}

.dv-diary-save-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(44, 62, 80, 0.2);
}

@media (max-width: 900px) {
    .dv-diary-modal-content {
        width: 95%;
        max-width: 680px;
        height: 90vh;
    }

    .dv-diary-modal-body {
        display: flex;
        flex-direction: column;
        gap: 1.25rem;
    }

    .dv-diary-reflection-column {
        display: flex;
        flex-direction: column;
        gap: 1.25rem;
    }

    .dv-diary-keep-section,
    .dv-diary-vision-section,
    .dv-diary-score-section {
        grid-column: auto;
        grid-row: auto;
        flex: 0 0 auto;
    }

    .dv-diary-keep-section .dv-diary-textarea,
    .dv-diary-textarea {
        flex: none;
        height: 120px;
        min-height: 120px;
    }

    .dv-diary-keep-section .dv-diary-textarea {
        height: 140px;
    }

    .dv-diary-vision-card {
        min-height: 320px;
    }
}


/* --- merged from shared/styles/daily-view.css --- */

/* css/daily-view.css */
@import url('https://fonts.googleapis.com/css2?family=Gaegu:wght@300;400;700&display=swap');

/* --- Global & Wrapper --- */
.dv-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: #f0f2f5;
    color: #333;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%; /* #view-container??flex ??ш끽維쀩??筌믨퀡?????ш끽維??????낅４ 癲ル슓堉곁땟? */
    overflow: hidden;
}

.dv-wrapper * {
    box-sizing: border-box;
}

.dv-wrapper .dv-diary-section,
.dv-wrapper .dv-diary-section textarea {
    font-family: 'Gaegu', cursive;
}

/* --- Date Header --- */
.dv-date-header {
    padding: 0;
    background-color: #1a2533;
    color: white;
    text-align: center;
    height: 28px;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    position: relative;
    display: flex;
    align-items: center;
}

.dv-year-progress-bar {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
}

.dv-day-segment {
    flex: 1 1 auto;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}
.dv-day-segment:last-child { border-right: none; }
.dv-day-segment.dv-passed { background-color: #4CAF50; }
.dv-day-segment.dv-future { background-color: rgba(255, 255, 255, 0.15); }
.dv-day-segment.dv-month-end-segment {
    border-right-color: rgba(255, 255, 255, 0.4);
    border-right-width: 2px;
}
.dv-day-segment.dv-month-end-segment:last-child { border-right: none; }

#current-date-display {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    color: white;
    font-size: 0.9em;
    font-weight: bold;
    padding: 3px 10px;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 3px;
    white-space: nowrap;
}

/* --- Day Progress Bar --- */
.dv-day-progress-container {
    width: 100%;
    height: 12px;
    background-color: #e0e4e8;
    padding: 2px 0;
    box-sizing: border-box;
    display: flex;
    flex-shrink: 0;
}

.dv-day-progress-bar-visual {
    display: flex;
    width: 100%;
    height: 100%;
    border-left: 1px solid #b0b8c0;
    border-right: 1px solid #b0b8c0;
}

.dv-time-segment {
    flex: 1 1 auto;
    position: relative;
}
.dv-time-segment::after {
    content: '';
    position: absolute;
    right: -1px;
    top: 25%;
    height: 50%;
    width: 1px;
    background-color: rgba(0, 0, 0, 0.2);
}
.dv-time-segment.dv-hour-marker::after {
    top: 10%;
    height: 80%;
    width: 2px;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1;
}
.dv-time-segment:last-child::after { display: none; }
.dv-time-segment.dv-passed-time { background-color: #64b5f6; }
.dv-time-segment.dv-future-time { background-color: #d0d4d8; }

/* --- Main Page Container --- */
.dv-page-container {
    display: flex;
    width: 100%;
    flex-grow: 1;
    padding: 15px;
    gap: 15px;
    overflow: hidden;
}

.dv-left-pane, .dv-center-pane, .dv-right-pane {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    overflow-y: auto;
    padding: 15px;
}

/* --- Left Pane --- */
.dv-left-pane {
    flex: 1 1 22%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 0;
    position: relative;
    z-index: 20;
}
.dv-left-pane:has(.dv-color-option:hover),
.dv-left-pane:has(.dv-color-picker-popup.dv-show),
.dv-left-pane:has(.dv-color-option-context-menu) {
    z-index: 4200;
    overflow: visible;
}

.dv-left-pane-top, .dv-left-pane-bottom {
    position: relative;
    display: flex;
    border: 1px solid #e7eaf0;
    border-radius: 6px;
    padding: 15px;
    flex-direction: column;
    overflow: hidden;
    color: #777;
}
.dv-left-pane-top { flex: 0 0 255px; max-height: 255px; }
.dv-left-pane-bottom { flex: 1 1 auto; min-height: 220px; z-index: 10; }
.dv-left-pane-bottom:has(.dv-color-option:hover),
.dv-left-pane-bottom:has(.dv-color-picker-popup.dv-show),
.dv-left-pane-bottom:has(.dv-color-option-context-menu) {
    z-index: 4100;
    overflow: visible;
}

.dv-yearly-goal-anchor {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-height: 50px;
    padding: 10px 14px;
    border: 1px solid #dbe4ef;
    border-left: 4px solid #2c3e50;
    border-radius: 6px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 2px 6px rgba(44, 62, 80, 0.08);
    cursor: default;
}

.dv-yearly-goal-anchor__label {
    color: #7a8798;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.2;
}

.dv-yearly-goal-anchor__text {
    color: #213044;
    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dv-yearly-goal-tooltip {
    position: fixed;
    z-index: 10040;
    width: min(620px, calc(100vw - 40px));
    padding: 14px 16px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.96);
    color: #f8fafc;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.28);
    pointer-events: none;
}

.dv-yearly-goal-tooltip[hidden] {
    display: none;
}

.dv-yearly-goal-tooltip__title {
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
}

.dv-yearly-goal-tooltip__image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    margin: 12px 0 10px;
    border-radius: 10px;
    object-fit: cover;
    object-position: center;
    background: #f8fafc;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.26);
}

.dv-yearly-goal-tooltip__goal {
    color: #f8fafc;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

/* --- Project TODOs --- */
#project-todo-app-container {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
}
.dv-projects-scroll-area {
    flex-grow: 1; overflow-y: auto;
    padding: 10px; position: relative;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.dv-projects-scroll-area::-webkit-scrollbar {
    display: none;
}
.dv-project-item-wrapper {
    background-color: #fff;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 6px;
    border-radius: 4px;
    position: relative;
}
.dv-project-item-wrapper.open { z-index: 50; }
.dv-project-header {
    display: flex; align-items: center;
    padding: 10px 12px;
    cursor: pointer; user-select: none;
    transition: background-color 0.15s ease;
}
.dv-project-header:hover { background-color: #f1f5f9; }
.dv-project-item-wrapper:hover .dv-project-controls { opacity: 1; visibility: visible; }
.dv-project-arrow {
    font-size: 0.65em; margin-right: 10px;
    color: #667788; transition: transform 0.2s ease-out;
    display: inline-block;
}
.dv-project-item-wrapper.open .dv-project-arrow { transform: rotate(90deg); }
.dv-project-name {
    flex-grow: 1; font-weight: 500; color: #2c3e50;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    padding-right: 8px;
}
.dv-project-completion {
    font-size: 0.8em; color: #52616b;
    margin-left: auto; padding-left: 10px;
    white-space: nowrap; flex-shrink: 0;
}
.dv-project-controls {
    display: flex; align-items: center;
    opacity: 0; visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    margin-left: 8px;
}
.dv-project-action-btn {
    background: none; border: none; cursor: pointer;
    padding: 3px; margin-left: 5px; font-size: 1em;
    color: #7f8c8d; line-height: 1;
}
.dv-project-action-btn:hover { color: #34495e; }
.dv-project-delete-btn:hover { color: #c0392b; }
/* Nested project todo list */
.dv-sub-todo-list {
    list-style: none;
    padding: 8px 12px;
    margin: 0;
}
.dv-sub-todo-list-container.dv-floating-dropdown {
    position: fixed;
    background-color: #ffffff;
    border: 1px solid #d1dce5;
    box-shadow: 0 5px 15px rgba(0,0,0,0.12);
    border-radius: 5px;
    min-width: 280px;
    max-height: 80vh;
    overflow-y: auto;
    padding-bottom: 8px;
    box-sizing: border-box;
}
.dv-sub-todo-list {
    list-style: none; padding: 8px 12px; margin: 0;
}
.dv-sub-todo-item {
    position: relative; display: flex; align-items: center;
    padding: 7px 3px; border-bottom: 1px solid #f2f4f6;
    font-size: 0.9em;
}
.dv-sub-todo-item:last-child { border-bottom: none; }
.dv-sub-todo-item.completed .dv-sub-todo-text {
    text-decoration: line-through; color: #a0a0a0; opacity: 0.7;
}
.dv-sub-todo-number {
    margin-right: 7px; color: #888; font-size: 0.9em;
    min-width: 20px; text-align: right; user-select: none;
}
.dv-sub-todo-checkbox { margin-right: 8px; transform: scale(0.9); cursor: pointer; }
.dv-sub-todo-text { flex-grow: 1; padding: 2px 4px; cursor: text; line-height: 1.4; }
.dv-sub-todo-text-edit {
    flex-grow: 1; padding: 3px 5px; font-size: inherit;
    border: 1px solid #badcff; border-radius: 3px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.07);
}
.dv-sub-todo-delete-btn {
    background: none; border: none; cursor: pointer; color: #c0c0c0;
    font-size: 1.1em; padding: 2px 6px; margin-left: 8px;
    opacity: 0; visibility: hidden;
    transition: opacity 0.2s ease, color 0.2s ease;
    line-height: 1;
}
.dv-sub-todo-item:hover .dv-sub-todo-delete-btn { opacity: 1; visibility: visible; color: #e74c3c; }
.dv-sub-todo-delete-btn:hover { color: #c0392b !important; }
/* Add task button inside the floating project dropdown */
.dv-add-sub-task-btn {
    display: block;
    margin: 10px 15px 5px 35px; /* Align with nested task content */
    padding: 6px 12px;
    font-size: 0.85em;
    color: #333;
    background-color: #f0f2f5; /* ?類??????????袁⑸즲??㏓き??(??れ삀??????????? ???獒????Β?띾룿???⑥???怨뚮뼚?????좊읈??? */
    border: 1px solid #d1dce5;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    width: auto;
}
.dv-add-sub-task-btn:hover { background-color: #e4e9ed; border-color: #c1cdd8; }
.dv-add-project-btn {
    display: none; width: calc(100% - 20px);
    margin: 15px auto 10px auto; padding: 10px 15px;
    font-size: 0.9em; font-weight: 500; color: #fff;
    background-color: #28a745; border: none; border-radius: 5px;
    cursor: pointer; text-align: center;
    transition: background-color 0.2s ease;
}

.dv-add-project-btn:hover {
    background-color: #e4e9ed;
    border-color: #adb5bd;
}

.dv-sub-todo-list-container.dv-floating-project-dropdown {
    /* Position and visibility are controlled by JavaScript. */
    background-color: #ffffff; /* Plain white background for the dropdown panel */
    border: 1px solid #d1dce5; /* Soft border to separate from the page */
    box-shadow: 0 5px 15px rgba(0,0,0,0.12); /* Floating dropdown shadow */
    border-radius: 5px; /* Rounded corners for the floating panel */
    min-width: 280px; /* Keep a readable minimum width */
    max-height: 80vh; /* Prevent the panel from exceeding the viewport */
    overflow-y: auto; /* Scroll when the list grows tall */
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 8px; /* Leave room above the 'Add Task' button */
    box-sizing: border-box;
}

.dv-sub-todo-list-container.dv-floating-project-dropdown::-webkit-scrollbar {
    display: none;
}




/* --- General TODOs --- */
#todo-app-container {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    overflow: hidden;
}
.dv-todo-list {
    list-style: none;
    padding: 3px 6px 3px 0; /* Keep card borders and shadows clear of the scroll clipping edge. */
    margin: 0;
    flex-grow: 1;
    overflow-y: auto;
    /* Keep space for the add button without forcing extra padding */
    /* padding-bottom: 10px; */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.dv-todo-list::-webkit-scrollbar { display: none; }

.dv-project-todo-drop-ready {
    position: relative;
    border-radius: 20px;
    box-shadow: inset 0 0 0 2px rgba(148, 163, 184, 0.28);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
}

.dv-project-todo-drop-ready::after {
    content: "";
    position: absolute;
    inset: 10px;
    border: 2px dashed rgba(148, 163, 184, 0.42);
    border-radius: 16px;
    pointer-events: none;
}

.dv-project-todo-drop-target {
    position: relative;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(248, 250, 252, 0.98));
    box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.28);
}

.dv-project-todo-drop-target::after {
    content: "";
    position: absolute;
    inset: 10px;
    border: 2px dashed rgba(59, 130, 246, 0.65);
    border-radius: 16px;
    pointer-events: none;
}

.dv-project-todo-drop-target .dv-todo-list {
    min-height: 96px;
}

.dv-todo-section-marker {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 10px;
    padding: 0 4px;
    font-size: 0.72em;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.dv-todo-section-marker::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.4), rgba(148, 163, 184, 0));
}

.dv-todo-section-marker-important {
    margin-top: 0;
    color: #9a3412;
}

.dv-todo-section-marker-important::after {
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.38), rgba(249, 115, 22, 0));
}

.dv-todo-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #eef2f6;
    gap: 10px;
    font-size: 0.9em;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    border-left: 4px solid #98a2b3;
    border-radius: 10px;
    background-color: #ffffff;
    margin-bottom: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, opacity 0.16s ease;
    cursor: grab;
}
.dv-todo-item.dv-todo-item-important {
    background: linear-gradient(180deg, #fffdf8 0%, #fffefa 100%);
    box-shadow: 0 2px 8px rgba(180, 83, 9, 0.05);
}
.dv-todo-item.dv-todo-risk-overdue {
    background: #fee2e2;
    box-shadow: 0 3px 12px rgba(220, 38, 38, 0.12);
}
.dv-todo-item.dv-todo-risk-due-today {
    background: #ffedd5;
    box-shadow: 0 3px 12px rgba(234, 88, 12, 0.11);
}
.dv-todo-item.dv-todo-risk-due-soon {
    background: #fff0d4;
    box-shadow: 0 3px 12px rgba(245, 158, 11, 0.1);
}
.dv-todo-item.dv-todo-risk-upcoming {
    background: #fef9c3;
    box-shadow: 0 3px 12px rgba(234, 179, 8, 0.1);
}
.dv-todo-item.dv-todo-risk-procrastinated {
    background: #f5f3ff;
    box-shadow: 0 3px 12px rgba(124, 58, 237, 0.09);
}
.dv-todo-list.dv-todo-list-dragging .dv-todo-item:not(.dragging-todo) {
    transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease, background-color 0.16s ease;
}
.dv-todo-item.dragging-todo {
    opacity: 0.62;
    transform: scale(1.02) rotate(0.35deg);
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.18);
    z-index: 12;
    cursor: grabbing;
}
.dv-todo-item.dv-drag-over-todo {
    transform: translateY(-4px);
    box-shadow:
        0 10px 24px rgba(71, 85, 105, 0.12),
        0 0 0 1px rgba(148, 163, 184, 0.28);
}
.dv-todo-item.dv-drag-over-todo::before {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    top: -6px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.95), rgba(100, 116, 139, 0.95));
    box-shadow: 0 4px 12px rgba(71, 85, 105, 0.16);
}
.dv-todo-item.dv-linked-hover {
    transform: translateY(-1px);
    box-shadow:
        0 14px 28px rgba(37, 99, 235, 0.12),
        0 0 0 1px rgba(96, 165, 250, 0.3);
    filter: saturate(1.02);
}
.dv-todo-item.dv-problem-linked-try-hover {
    transform: translateY(-2px);
    box-shadow:
        0 14px 28px rgba(16, 185, 129, 0.16),
        0 0 0 2px rgba(16, 185, 129, 0.32);
    filter: saturate(1.08) brightness(1.02);
}
.dv-todo-item.dv-todo-item-focus-running {
    box-shadow:
        0 14px 30px rgba(44, 82, 130, 0.14),
        inset 0 0 0 1px rgba(44, 82, 130, 0.18);
}
.dv-todo-item.dv-todo-item-focus-running::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 8px;
    border: 1px solid rgba(44, 82, 130, 0.18);
    pointer-events: none;
    animation: dv-pomodoro-row-pulse 1.8s ease-in-out infinite;
}
.dv-todo-dragging,
.dv-todo-dragging * {
    cursor: grabbing !important;
}
.dv-todo-item:last-child { border-bottom: 1px solid #eef2f6; }
.dv-todo-item.dv-todo-item-diary-try {
    background: transparent;
    border-left-color: #22c55e;
}
.dv-todo-risk-badges {
    position: absolute;
    top: 0;
    right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transform: translateY(-52%);
    z-index: 2;
    pointer-events: none;
}
.dv-todo-risk-badge,
.dv-todo-action-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 19px;
    padding: 0 7px;
    border-radius: 999px;
    background: #ffffff;
    font-size: 0.68em;
    font-weight: 750;
    letter-spacing: 0.04em;
    line-height: 1;
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.09);
}
.dv-todo-action-badge {
    letter-spacing: 0;
}
.dv-todo-risk-badge-action-do-now {
    border: 1px solid rgba(220, 38, 38, 0.24);
    color: #b91c1c;
    background: #fef2f2;
}
.dv-todo-risk-badge-action-keep-going {
    border: 1px solid rgba(37, 99, 235, 0.24);
    color: #1d4ed8;
    background: #eff6ff;
}
.dv-todo-risk-badge-action-quick-handle {
    border: 1px solid rgba(245, 158, 11, 0.28);
    color: #b45309;
    background: #fffbeb;
}
.dv-todo-risk-badge-action-reduce {
    border: 1px solid rgba(100, 116, 139, 0.24);
    color: #64748b;
    background: #f8fafc;
}
.dv-todo-risk-badge-deadline-overdue {
    border: 1px solid rgba(220, 38, 38, 0.4);
    color: #b91c1c;
    background: #fee2e2;
}
.dv-todo-risk-badge-deadline-today {
    border: 1px solid rgba(234, 88, 12, 0.42);
    color: #c2410c;
    background: #ffedd5;
}
.dv-todo-risk-badge-deadline-soon {
    border: 1px solid rgba(245, 158, 11, 0.48);
    color: #c2410c;
    background: #fff0d4;
}
.dv-todo-risk-badge-deadline-upcoming {
    border: 1px solid rgba(234, 179, 8, 0.44);
    color: #a16207;
    background: #fef9c3;
}
.dv-todo-risk-badge-procrastination {
    border: 1px solid rgba(124, 58, 237, 0.25);
    color: #6d28d9;
    background: #faf7ff;
}
.dv-todo-priority-badge {
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.96);
    color: #1d4ed8;
    border: 1px solid rgba(37, 99, 235, 0.28);
    font-size: 0.74em;
    font-weight: 700;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
    position: relative;
    z-index: 1;
}
.dv-todo-checkbox {
    margin-right: 2px;
    flex-shrink: 0;
    transform: scale(1.08);
    cursor: pointer;
}
.dv-todo-text {
    flex-grow: 1;
    min-width: 0;
    color: #1f2937;
    font-size: 0.98em;
    line-height: 1.4;
    word-break: break-word;
}
.dv-todo-text.completed {
    text-decoration: line-through;
    color: #98a2b3;
}
.dv-todo-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}
.dv-todo-pomodoro-btn {
    --todo-pomodoro-remaining-angle: 1turn;
    min-width: 44px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0 10px;
    border: 1px solid #cbd9e8;
    border-radius: 999px;
    background: linear-gradient(180deg, #f8fbff, #eef6ff);
    color: #1f3d5a;
    font-size: 11px;
    font-weight: 850;
    line-height: 1;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 4px 10px rgba(44, 82, 130, 0.12);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease, color 0.16s ease;
}
.dv-todo-pomodoro-btn:hover,
.dv-todo-pomodoro-btn:focus-visible {
    transform: translateY(-1px) scale(1.05);
    box-shadow:
        0 0 0 3px rgba(44, 82, 130, 0.12),
        0 8px 16px rgba(44, 82, 130, 0.18);
    filter: saturate(1.08);
    outline: none;
}
.dv-todo-pomodoro-btn.is-running {
    min-width: 52px;
    border: 2px solid transparent;
    background:
        linear-gradient(180deg, #fffafa, #ffffff) padding-box,
        conic-gradient(
            from -0.25turn,
            #dc2626 0 var(--todo-pomodoro-remaining-angle),
            #fee2e2 var(--todo-pomodoro-remaining-angle) 1turn
        ) border-box;
    color: #b91c1c;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.96),
        0 0 0 2px rgba(254, 226, 226, 0.85),
        0 8px 18px rgba(220, 38, 38, 0.16);
    font-weight: 950;
    animation: none;
}
.dv-todo-pomodoro-btn.is-running:hover,
.dv-todo-pomodoro-btn.is-running:focus-visible {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.96),
        0 0 0 3px rgba(248, 113, 113, 0.24),
        0 10px 20px rgba(220, 38, 38, 0.20);
}
.dv-todo-edit-fields {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dv-todo-origin-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 38px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 0.68em;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}
.dv-todo-origin-badge-try {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.28);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.48);
}
.dv-todo-time-badge {
    flex-shrink: 0;
    padding: 3px 9px;
    border-radius: 999px;
    background: #eef2f6;
    color: #475467;
    font-size: 0.82em;
    font-weight: 600;
}
.dv-todo-edit-text-input {
    flex-grow: 1;
    min-width: 0;
    padding: 6px 9px;
    border: 1px solid #007bff;
    border-radius: 6px;
    background: #fff;
    font-size: 0.95em;
    outline: none;
}
.dv-todo-edit-time-input {
    width: 72px;
    flex-shrink: 0;
    padding: 6px 8px;
    border: 1px solid #007bff;
    border-radius: 6px;
    background: #fff;
    font-size: 0.85em;
    text-align: center;
    outline: none;
}
.dv-todo-context-menu {
    position: fixed;
    min-width: 140px;
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
    padding: 6px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.dv-todo-context-menu-item {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #1f2937;
    cursor: pointer;
}
.dv-todo-context-menu-item:hover {
    background: #f3f6f9;
}
.dv-todo-context-menu-item.dv-todo-context-split-nudge {
    background: linear-gradient(135deg, #eff6ff 0%, #f8fbff 100%);
    border: 1px solid #93c5fd;
    color: #1d4ed8;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
    animation: dvSplitTodoNudgePulse 1.9s ease-in-out infinite;
}
.dv-todo-context-menu-item.dv-todo-context-split-nudge:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
}
.dv-todo-context-menu-item.dv-todo-context-quick-start {
    background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 100%);
    border: 1px solid rgba(245, 158, 11, 0.42);
    color: #b45309;
}
.dv-todo-context-menu-item.dv-todo-context-quick-start:hover {
    background: linear-gradient(135deg, #fef3c7 0%, #ffedd5 100%);
}
.dv-todo-context-menu-item.dv-todo-context-delete {
    color: #b42318;
}
.dv-todo-context-menu-item.dv-todo-context-delete:hover {
    background: #fef3f2;
}

@keyframes dvSplitTodoNudgePulse {
    0%, 100% {
        box-shadow:
            inset 0 0 0 1px rgba(255, 255, 255, 0.45),
            0 0 0 0 rgba(59, 130, 246, 0);
    }
    50% {
        box-shadow:
            inset 0 0 0 1px rgba(255, 255, 255, 0.45),
            0 0 0 4px rgba(59, 130, 246, 0.14);
    }
}

.dv-todo-split-coachmark {
    position: fixed;
    width: min(280px, calc(100vw - 32px));
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(248, 250, 252, 0.985) 0%, rgba(239, 246, 255, 0.98) 100%);
    border: 1px solid rgba(96, 165, 250, 0.34);
    box-shadow: 0 20px 45px rgba(37, 99, 235, 0.12);
    z-index: 4000;
    opacity: 0;
    transform: translateY(6px) scale(0.98);
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.dv-todo-split-coachmark.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.dv-todo-split-coachmark__eyebrow {
    align-self: flex-start;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
}
.dv-todo-split-coachmark__title {
    color: #2C3E50;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.35;
}
.dv-todo-split-coachmark__body {
    color: #475569;
    font-size: 12px;
    line-height: 1.5;
}
.dv-todo-split-coachmark__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.dv-todo-split-coachmark__action {
    align-self: flex-start;
    border: 1px solid rgba(44, 62, 80, 0.24);
    background: linear-gradient(135deg, #2C3E50 0%, #34495e 100%);
    color: #fff;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(44, 62, 80, 0.18);
}
.dv-todo-split-coachmark__action:hover {
    filter: brightness(1.03);
}
.dv-todo-split-coachmark__action.is-quick-start {
    border-color: rgba(217, 119, 6, 0.34);
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 10px 24px rgba(217, 119, 6, 0.2);
}

.dv-pomodoro-preview {
    --pomodoro-preview-remaining-angle: 1turn;
    --pomodoro-preview-total-progress: 0%;
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(6, 10, 18, 0.78);
    backdrop-filter: blur(7px);
    z-index: 5200;
}

.dv-pomodoro-preview-chip {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 5190;
    max-width: min(360px, calc(100vw - 44px));
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(44, 82, 130, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: #142033;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.22);
    cursor: pointer;
}

.dv-pomodoro-preview-chip__pulse {
    width: 12px;
    height: 12px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #2c5282;
    box-shadow: 0 0 0 0 rgba(44, 82, 130, 0.28);
    animation: dv-pomodoro-chip-pulse 1.5s ease-in-out infinite;
}

.dv-pomodoro-preview-chip.is-paused .dv-pomodoro-preview-chip__pulse {
    background: #94a3b8;
    animation: none;
}

.dv-pomodoro-preview-chip__body {
    min-width: 0;
    display: grid;
    gap: 2px;
    text-align: left;
}

.dv-pomodoro-preview-chip__label {
    color: #71819a;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.dv-pomodoro-preview-chip__task {
    max-width: 190px;
    overflow: hidden;
    color: #142033;
    font-size: 12px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dv-pomodoro-preview-chip__time {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 999px;
    background: #e8f1fb;
    color: #1f3d5a;
    font-size: 12px;
    font-weight: 900;
}

.dv-pomodoro-preview__panel {
    position: relative;
    width: min(360px, calc(100vw - 40px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 22px;
    border: 1px solid rgba(219, 227, 238, 0.95);
    border-radius: 24px;
    background:
        radial-gradient(circle at 50% 0%, rgba(143, 177, 215, 0.20), transparent 42%),
        #ffffff;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.26);
}

.dv-pomodoro-preview.is-long-focus .dv-pomodoro-preview__panel {
    width: min(390px, calc(100vw - 40px));
}

.dv-pomodoro-preview__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid #dbe3ee;
    border-radius: 999px;
    background: #f8fafc;
    color: #64748b;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.dv-pomodoro-preview__eyebrow {
    align-self: flex-start;
    color: #71819a;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0;
}

.dv-pomodoro-preview__ring {
    position: relative;
    width: 254px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        conic-gradient(from 0turn, #dc2626 0 var(--pomodoro-preview-remaining-angle), #f3f6fa var(--pomodoro-preview-remaining-angle) 1turn);
    box-shadow:
        inset 0 0 0 10px rgba(248, 113, 113, 0.28),
        inset 0 0 0 1px rgba(148, 163, 184, 0.32),
        0 18px 40px rgba(220, 38, 38, 0.16);
}

.dv-pomodoro-preview.is-long-focus .dv-pomodoro-preview__ring {
    width: 254px;
}

.dv-pomodoro-preview.is-over .dv-pomodoro-preview__ring {
    background:
        conic-gradient(from 0turn, #dc2626 0 0turn, #f3f6fa 0turn 1turn);
    box-shadow:
        inset 0 0 0 10px rgba(248, 113, 113, 0.16),
        inset 0 0 0 1px rgba(148, 163, 184, 0.28),
        0 18px 40px rgba(15, 23, 42, 0.08);
}

.dv-pomodoro-preview.is-over .dv-pomodoro-preview__ring::after {
    content: none;
}

.dv-pomodoro-preview__ring::before {
    content: "";
    position: absolute;
    inset: 84px;
    border-radius: 50%;
    background: linear-gradient(180deg, #ffffff, #f3f6fa);
    box-shadow:
        inset 0 0 0 1px rgba(203, 213, 225, 0.72),
        0 4px 14px rgba(15, 23, 42, 0.16);
}

.dv-pomodoro-preview__dial {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
}

.dv-pomodoro-preview__tick,
.dv-pomodoro-preview__minute-label {
    position: absolute;
    left: 50%;
    top: 50%;
    transform-origin: center;
}

.dv-pomodoro-preview__tick {
    width: 1.5px;
    height: 9px;
    border-radius: 999px;
    background: rgba(69, 18, 21, 0.44);
    transform:
        translate(-50%, -50%)
        rotate(calc(var(--mark-index) * 6deg))
        translateY(-93px);
}

.dv-pomodoro-preview__tick.is-five-minute {
    width: 2px;
    height: 14px;
    background: rgba(69, 18, 21, 0.62);
    transform:
        translate(-50%, -50%)
        rotate(calc(var(--mark-index) * 6deg))
        translateY(-90px);
}

.dv-pomodoro-preview__tick.is-ten-minute {
    width: 3px;
    height: 20px;
    background: rgba(69, 18, 21, 0.78);
    transform:
        translate(-50%, -50%)
        rotate(calc(var(--mark-index) * 6deg))
        translateY(-87px);
}

.dv-pomodoro-preview__minute-label {
    width: 30px;
    height: 20px;
    display: grid;
    place-items: center;
    color: rgba(31, 41, 55, 0.84);
    font-size: 15px;
    font-weight: 850;
    line-height: 1;
    transform:
        translate(-50%, -50%)
        rotate(calc(var(--mark-index) * 6deg))
        translateY(-108px)
        rotate(calc(var(--mark-index) * -6deg));
}

.dv-pomodoro-preview.is-paused .dv-pomodoro-preview__dial {
    opacity: 0.72;
}

.dv-pomodoro-preview.is-over .dv-pomodoro-preview__dial {
    opacity: 0.82;
}

.dv-pomodoro-preview.is-over .dv-pomodoro-preview__tick {
    background: rgba(69, 18, 21, 0.28);
}

.dv-pomodoro-preview.is-over .dv-pomodoro-preview__tick.is-five-minute,
.dv-pomodoro-preview.is-over .dv-pomodoro-preview__tick.is-ten-minute {
    background: rgba(69, 18, 21, 0.44);
}

.dv-pomodoro-preview.is-over .dv-pomodoro-preview__minute-label {
    color: rgba(31, 41, 55, 0.64);
}

.dv-pomodoro-preview.is-over .dv-pomodoro-preview__total-text {
    color: #be123c;
}

.dv-pomodoro-preview__core {
    position: relative;
    z-index: 1;
    width: 78px;
    height: 78px;
    border-radius: 999px;
    background:
        radial-gradient(circle at 42% 32%, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.94) 66%, rgba(203, 213, 225, 0.94));
    box-shadow:
        inset 0 2px 6px rgba(255, 255, 255, 0.9),
        inset 0 -5px 10px rgba(148, 163, 184, 0.25),
        0 8px 22px rgba(15, 23, 42, 0.20);
}

.dv-pomodoro-preview__task {
    max-width: 100%;
    color: #142033;
    font-size: 16px;
    font-weight: 850;
    line-height: 1.35;
    text-align: center;
    overflow-wrap: anywhere;
}

.dv-pomodoro-preview__long-focus {
    width: 100%;
    display: grid;
    gap: 8px;
}

.dv-pomodoro-preview__total-text {
    color: #172033;
    font-size: 14px;
    font-weight: 900;
    text-align: center;
}

.dv-pomodoro-preview__total-track {
    width: 100%;
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #e7edf5;
    box-shadow: inset 0 0 0 1px rgba(203, 213, 225, 0.58);
}

.dv-pomodoro-preview__total-fill {
    display: block;
    width: var(--pomodoro-preview-total-progress);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2c5282, #38bdf8);
    transition: width 0.24s linear;
}

.dv-pomodoro-preview.is-over .dv-pomodoro-preview__total-fill {
    width: 100%;
    background: linear-gradient(90deg, #e11d48, #fb7185);
}

.dv-pomodoro-preview__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.dv-pomodoro-preview__meta span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #52616b;
    font-size: 11px;
    font-weight: 800;
}

.dv-pomodoro-preview__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
}

.dv-pomodoro-preview__secondary,
.dv-pomodoro-preview__primary {
    min-height: 44px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 850;
    cursor: pointer;
}

.dv-pomodoro-preview__secondary {
    border: 1px solid #b7d0eb;
    background: #e8f1fb;
    color: #1d4ed8;
}

.dv-pomodoro-preview__primary {
    border: 1px solid #1f2937;
    background: #111827;
    color: #ffffff;
}

.dv-focus-mode-overlay {
    position: fixed;
    inset: 0;
    z-index: 5210;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(6, 10, 18, 0.76);
    backdrop-filter: blur(7px);
}

.dv-focus-mode-modal {
    position: relative;
    width: min(510px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 26px;
    border: 1px solid rgba(219, 227, 238, 0.95);
    border-radius: 24px;
    background:
        radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.14), transparent 42%),
        #fff;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.28);
}

.dv-focus-mode-modal:focus {
    outline: none;
}

.dv-focus-mode-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    border: 1px solid #dbe3ee;
    border-radius: 999px;
    background: #f8fafc;
    color: #64748b;
    font-size: 18px;
    cursor: pointer;
}

.dv-focus-mode-eyebrow {
    margin-bottom: 7px;
    color: #7c3aed;
    font-size: 11px;
    font-weight: 950;
    letter-spacing: .14em;
}

.dv-focus-mode-question {
    margin: 2px 42px 18px 0;
    color: #2d1b69;
    font-size: clamp(18px, 1.8vw, 21px);
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: -.025em;
}

.dv-focus-mode-modal h3 {
    margin: 0 34px 18px 0;
    color: #172033;
    font-size: 20px;
    line-height: 1.35;
}

.dv-focus-mode-modal > p {
    margin: -8px 0 18px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.55;
}

.dv-focus-mode-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.dv-focus-mode-card {
    min-height: 154px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 7px;
    padding: 20px;
    border: 1px solid #d8e1ec;
    border-radius: 18px;
    background: #f8fafc;
    color: #172033;
    text-align: left;
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.dv-focus-mode-card:hover:not(:disabled) {
    transform: translateY(-3px);
    border-color: #93c5fd;
    box-shadow: 0 14px 24px rgba(15, 23, 42, .10);
}

.dv-focus-mode-card.is-bet {
    border-color: #d8b4fe;
    background: linear-gradient(145deg, #faf5ff, #f5f3ff);
}

.dv-focus-mode-card:disabled {
    opacity: .48;
    cursor: not-allowed;
}

.dv-focus-mode-card__icon {
    font-size: 30px;
    line-height: 1;
}

.dv-focus-mode-card.is-bet .dv-focus-mode-card__icon {
    color: #f59e0b;
    text-shadow: 0 3px 12px rgba(245, 158, 11, .32);
}

.dv-focus-mode-card strong {
    font-size: 15px;
}

.dv-focus-mode-card small {
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.dv-focus-mode-note {
    margin: 16px 0 0 !important;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #52616b !important;
    font-size: 12px !important;
}

.dv-point-bet-setup__facts,
.dv-point-bet__result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.dv-point-bet-setup__todo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin: 2px 0 12px;
    padding: 13px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    background: #f8fafc;
}

.dv-point-bet-setup__todo > div:first-child {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.dv-point-bet-setup__todo-label,
.dv-point-bet-setup__estimate > span {
    color: #94a3b8;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .08em;
}

.dv-point-bet-setup__todo > div:first-child strong {
    overflow: hidden;
    color: #172033;
    font-size: 13px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dv-point-bet-setup__estimate {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    justify-items: end;
    gap: 3px 8px;
}

.dv-point-bet-setup__estimate > span {
    grid-column: 1 / -1;
}

.dv-point-bet-setup__estimate strong {
    color: #475569;
    font-size: 12px;
    white-space: nowrap;
}

.dv-point-bet-setup__estimate button {
    padding: 3px 7px;
    border: 1px solid #c4b5fd;
    border-radius: 999px;
    background: #fff;
    color: #6d28d9;
    font-size: 10px;
    font-weight: 900;
    cursor: pointer;
}

.dv-point-bet-setup__facts > div,
.dv-point-bet__result-grid > div {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #f8fafc;
}

.dv-point-bet-setup__facts span,
.dv-point-bet__result-grid span {
    color: #718096;
    font-size: 10px;
    font-weight: 800;
}

.dv-point-bet-setup__facts strong,
.dv-point-bet__result-grid strong {
    color: #172033;
    font-size: 14px;
}

.dv-point-bet-setup__stakes {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 16px 0 12px;
}

.dv-point-bet-setup__stake-input {
    display: grid;
    gap: 7px;
    margin-top: 16px;
}

.dv-point-bet-setup__stake-input > span {
    color: #475569;
    font-size: 12px;
    font-weight: 900;
}

.dv-point-bet-setup__stake-input > div {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 9px;
    min-height: 50px;
    padding: 0 15px;
    border: 2px solid #c4b5fd;
    border-radius: 15px;
    background: #faf5ff;
    color: #7c3aed;
}

.dv-point-bet-setup__stake-input input {
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #172033;
    font-size: 24px;
    font-weight: 1000;
}

.dv-point-bet-setup__stake-input strong {
    color: #64748b;
    font-size: 14px;
}

.dv-point-bet-setup__stakes button {
    min-width: 43px;
    min-height: 36px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-weight: 900;
    cursor: pointer;
}

.dv-point-bet-setup__stakes button:hover {
    border-color: #7c3aed;
    color: #6d28d9;
}

.dv-point-bet-setup__odds {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.dv-point-bet-setup__odds > strong {
    color: #475569;
    font-size: 12px;
}

.dv-point-bet-setup__potential {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 14px;
    padding: 11px 13px;
    border: 1px solid #fde68a;
    border-radius: 13px;
    background: linear-gradient(90deg, #fffbeb, #fefce8);
    color: #92400e;
}

.dv-point-bet-setup__potential span {
    font-size: 11px;
    font-weight: 850;
}

.dv-point-bet-setup__potential strong {
    font-size: 16px;
    font-weight: 1000;
}

.dv-point-bet-odds-table {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.dv-point-bet-odds-table > div {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 6px;
    padding: 8px 9px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.dv-point-bet-odds-table span {
    color: #64748b;
    font-size: 10px;
    font-weight: 850;
}

.dv-point-bet-odds-table strong {
    color: #334155;
    font-size: 13px;
    font-weight: 1000;
}

.dv-point-bet-odds-table small {
    grid-column: 1 / -1;
    color: #94a3b8;
    font-size: 9px;
    font-weight: 800;
}

.dv-point-bet-odds-table > div.is-current {
    position: relative;
    z-index: 1;
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    box-shadow:
        inset 0 0 0 1px #f59e0b,
        0 8px 18px rgba(217, 119, 6, 0.19);
}

.dv-point-bet-odds-table > div.is-current span,
.dv-point-bet-odds-table > div.is-current strong,
.dv-point-bet-odds-table > div.is-current small {
    color: #92400e;
}

.dv-point-bet-odds-table > div.is-spinning {
    border-color: #fbbf24;
    background: #fffbeb;
    box-shadow:
        inset 0 0 0 1px rgba(245, 158, 11, 0.7),
        0 5px 13px rgba(217, 119, 6, 0.13);
    transform: translateY(-1px);
}

.dv-point-bet-odds-table > div.is-landed {
    animation: dv-point-bet-cell-land 520ms cubic-bezier(.2, .9, .25, 1.25) both;
}

.dv-point-bet-setup__start {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #6d28d9, #9333ea);
    color: #fff;
    font-size: 14px;
    font-weight: 950;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(109, 40, 217, .24);
}

.dv-point-bet-setup__start:disabled {
    background: #cbd5e1;
    box-shadow: none;
    cursor: not-allowed;
}

.dv-point-bet {
    background:
        radial-gradient(circle at 50% 48%, rgba(124, 58, 237, .22), transparent 30%),
        rgba(6, 10, 18, .88);
}

.dv-point-bet__panel {
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 0%, rgba(124, 58, 237, .18), transparent 44%),
        #fff;
}

.dv-point-bet.is-result .dv-point-bet__panel {
    gap: 14px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 26px 22px 22px;
    background:
        radial-gradient(circle at 50% -8%, rgba(124, 58, 237, .13), transparent 38%),
        linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.dv-point-bet__ring {
    background: conic-gradient(from 0turn, #94a3b8, #475569, #cbd5e1, #64748b, #94a3b8);
    box-shadow:
        inset 0 0 0 10px rgba(148, 163, 184, .24),
        inset 0 0 0 1px rgba(148, 163, 184, .38),
        0 18px 42px rgba(15, 23, 42, .20);
}

.dv-point-bet__question,
.dv-point-bet__result-mark {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    color: #475569;
    font-size: 48px;
    font-weight: 950;
    text-shadow: 0 3px 12px rgba(15, 23, 42, .16);
}

.dv-point-bet__blind-copy {
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
}

.dv-point-bet__stake-chip {
    padding: 7px 12px;
    border: 1px solid #fde68a;
    border-radius: 999px;
    background: #fffbeb;
    color: #b45309;
    font-size: 12px;
    font-weight: 950;
}

.dv-point-bet__blind-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dv-point-bet__odds-toggle {
    padding: 7px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #64748b;
    font-size: 11px;
    font-weight: 850;
    cursor: pointer;
}

.dv-point-bet__blind-odds {
    width: 100%;
    max-height: 180px;
    overflow-y: auto;
    padding: 8px;
    border-radius: 13px;
    background: rgba(241, 245, 249, .82);
}

.dv-point-bet__blind-odds[hidden] {
    display: none;
}

.dv-point-bet__forfeit-note {
    margin: -6px 0 0;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 750;
    text-align: center;
}

.dv-point-bet-odds-table.is-compact {
    grid-template-columns: repeat(2, 1fr);
}

.dv-point-bet__hold {
    position: relative;
    overflow: hidden;
    user-select: none;
    touch-action: none;
}

.dv-point-bet__hold span {
    position: relative;
    z-index: 2;
}

.dv-point-bet__hold i {
    position: absolute;
    z-index: 1;
    inset: 0;
    width: 0;
    background: linear-gradient(90deg, #7c3aed, #ec4899);
}

.dv-point-bet__hold.is-holding {
    animation: dv-point-bet-shake .12s linear infinite;
}

.dv-point-bet__hold.is-holding i {
    width: 100%;
    transition: width 1s linear;
}

.dv-point-bet.is-settling .dv-point-bet__ring {
    animation: dv-point-bet-reveal .55s ease-in-out infinite alternate;
}

.dv-point-bet__result-heading {
    width: 100%;
    display: grid;
    justify-items: center;
    gap: 5px;
    padding: 4px 4px 10px;
}

.dv-point-bet__result-heading .dv-pomodoro-preview__eyebrow {
    justify-self: start;
    margin-bottom: 8px;
    color: #5d6f89;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.dv-point-bet__accuracy-label {
    color: #7c879a;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.dv-point-bet__accuracy {
    color: #24163f;
    font-family: Inter, Pretendard, "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(52px, 14vw, 68px);
    font-variant-numeric: tabular-nums lining-nums;
    font-weight: 720;
    letter-spacing: -0.065em;
    line-height: 0.98;
    text-rendering: geometricPrecision;
}

.dv-point-bet__accuracy b {
    font: inherit;
}

.dv-point-bet__accuracy span {
    margin-left: 0.08em;
    color: #6d4cc7;
    font-size: 0.48em;
    font-weight: 680;
    letter-spacing: -0.03em;
}

.dv-point-bet__accuracy-rule {
    width: min(230px, 76%);
    height: 4px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e9eaf1;
}

.dv-point-bet__accuracy-rule i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #4f46e5, #8b5cf6);
}

.dv-point-bet__result-grid {
    width: 100%;
}

.dv-point-bet__result-odds {
    width: 100%;
    display: grid;
    gap: 8px;
}

.dv-point-bet__result-odds > strong {
    color: #64748b;
    font-size: 11px;
    font-weight: 850;
}

.dv-point-bet__result-odds .dv-point-bet-odds-table {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
}

.dv-point-bet__result-odds .dv-point-bet-odds-table > div {
    min-width: 0;
    box-sizing: border-box;
    min-height: 50px;
    padding: 7px 8px;
}

.dv-point-bet.is-result .dv-point-bet__result-grid {
    box-sizing: border-box;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
}

.dv-point-bet.is-result .dv-point-bet__result-grid > div {
    min-width: 0;
    box-sizing: border-box;
}

.dv-point-bet__payout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 15px;
    border-radius: 14px;
    background: #f1f5f9;
    color: #475569;
}

.dv-point-bet__payout span {
    font-size: 12px;
    font-weight: 800;
}

.dv-point-bet__payout strong {
    flex: 0 0 auto;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    font-weight: 900;
}

.dv-point-bet__payout.is-positive {
    background: #ecfdf5;
    color: #047857;
}

.dv-point-bet__payout.is-negative {
    border: 1px solid #ffe0e5;
    background: #fff7f8;
    color: #be123c;
}

.dv-point-bet__reveal-item {
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
}

.dv-point-bet.is-result-settled .dv-point-bet__result-grid {
    animation: dv-point-bet-reveal-item 420ms ease 120ms forwards;
}

.dv-point-bet.is-result-settled .dv-point-bet__payout {
    animation: dv-point-bet-reveal-item 420ms ease 280ms forwards;
}

.dv-point-bet.is-result-settled .dv-point-bet__close-result {
    animation: dv-point-bet-reveal-item 420ms ease 420ms forwards;
}

.dv-point-bet.is-win .dv-point-bet__ring {
    background: conic-gradient(from 0turn, #f59e0b, #fde047, #22c55e, #38bdf8, #a855f7, #f59e0b);
    animation: dv-point-bet-win-ring .9s cubic-bezier(.2,.8,.2,1) both;
}

.dv-point-bet.is-win .dv-point-bet__result-mark {
    color: #d97706;
}

.dv-point-bet.is-loss .dv-point-bet__ring {
    background: conic-gradient(from 0turn, #475569, #94a3b8, #334155, #64748b, #475569);
    animation: dv-point-bet-loss-ring .55s ease both;
}

.dv-point-bet.is-loss .dv-point-bet__result-mark {
    color: #be123c;
}

.dv-point-bet__close-result {
    width: 100%;
}

@keyframes dv-point-bet-shake {
    0%, 100% { transform: translateX(0) rotate(0); }
    25% { transform: translateX(-1.5px) rotate(-.35deg); }
    75% { transform: translateX(1.5px) rotate(.35deg); }
}

@keyframes dv-point-bet-reveal {
    from { transform: scale(.98); filter: brightness(.88); }
    to { transform: scale(1.03); filter: brightness(1.18); }
}

@keyframes dv-point-bet-win-ring {
    0% { transform: scale(.72) rotate(-20deg); opacity: .2; }
    60% { transform: scale(1.08) rotate(6deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); }
}

@keyframes dv-point-bet-loss-ring {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

@keyframes dv-point-bet-cell-land {
    0% { transform: scale(.94); filter: brightness(1.25); }
    55% { transform: scale(1.055); }
    100% { transform: scale(1); filter: brightness(1); }
}

.dv-point-bet.is-win.is-result-settled .dv-point-bet__accuracy {
    animation: dv-point-bet-win-accuracy-settle 680ms cubic-bezier(.18, .88, .24, 1.18) both;
}

.dv-point-bet-odds-table > div.is-current.is-success {
    animation:
        dv-point-bet-cell-land 520ms cubic-bezier(.2, .9, .25, 1.25) both,
        dv-point-bet-success-cell-wave 760ms ease-out 110ms both;
}

@keyframes dv-point-bet-win-accuracy-settle {
    0% { transform: translateY(0) scale(1); }
    42% { transform: translateY(-2px) scale(1.055); }
    68% { transform: translateY(1px) scale(.992); }
    100% { transform: translateY(0) scale(1); }
}

@keyframes dv-point-bet-success-cell-wave {
    0% {
        box-shadow:
            inset 0 0 0 1px #f59e0b,
            0 8px 18px rgba(217, 119, 6, 0.19),
            0 0 0 0 rgba(245, 158, 11, 0.34);
    }
    55% {
        box-shadow:
            inset 0 0 0 1px #f59e0b,
            0 8px 18px rgba(217, 119, 6, 0.19),
            0 0 0 8px rgba(245, 158, 11, 0);
    }
    100% {
        box-shadow:
            inset 0 0 0 1px #f59e0b,
            0 8px 18px rgba(217, 119, 6, 0.19),
            0 0 0 0 rgba(245, 158, 11, 0);
    }
}

@keyframes dv-point-bet-reveal-item {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dv-point-bet-odds-table > div.is-landed,
    .dv-point-bet.is-result-settled .dv-point-bet__result-grid,
    .dv-point-bet.is-result-settled .dv-point-bet__payout,
    .dv-point-bet.is-result-settled .dv-point-bet__close-result,
    .dv-point-bet.is-win.is-result-settled .dv-point-bet__accuracy,
    .dv-point-bet-odds-table > div.is-current.is-success {
        animation-duration: 1ms;
        animation-delay: 0ms;
    }
}

@media (max-width: 560px) {
    .dv-focus-mode-options {
        grid-template-columns: 1fr;
    }
    .dv-focus-mode-card {
        min-height: 112px;
    }
    .dv-point-bet-setup__facts,
    .dv-point-bet__result-grid {
        grid-template-columns: 1fr;
    }
    .dv-point-bet-setup__todo {
        grid-template-columns: 1fr;
    }
    .dv-point-bet-setup__estimate {
        justify-items: start;
    }
    .dv-point-bet-odds-table,
    .dv-point-bet-odds-table.is-compact {
        grid-template-columns: 1fr 1fr;
    }
}

@keyframes dv-pomodoro-button-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 10px rgba(44, 82, 130, 0.12);
    }
    50% {
        transform: scale(1.08);
        box-shadow:
            0 0 0 3px rgba(56, 189, 248, 0.18),
            0 8px 16px rgba(44, 82, 130, 0.18);
    }
}

@keyframes dv-pomodoro-row-pulse {
    0%, 100% {
        opacity: 0.28;
    }
    50% {
        opacity: 0.72;
    }
}

@keyframes dv-pomodoro-chip-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(44, 82, 130, 0.28);
    }
    50% {
        box-shadow: 0 0 0 7px rgba(44, 82, 130, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .dv-todo-pomodoro-btn.is-running,
    .dv-todo-item.dv-todo-item-focus-running::after,
    .dv-pomodoro-preview-chip__pulse {
        animation: none;
    }
}


.dv-add-todo-btn-container {
    /* Keep the add-todo container visible at the bottom of the panel */
    padding: 15px 10px 10px 10px; /* Match the panel inner spacing */
    width: 100%;
    box-sizing: border-box;
    margin-top: 10px; /* Separate the button area from the list above */

    /* Force visibility so the add button does not collapse */
    opacity: 1;
    visibility: visible;
    max-height: 100px;
    overflow: visible;
}

.dv-add-todo-btn {
    width: 100%;
    padding: 10px 12px;
    background: linear-gradient(135deg, #2C3E50 0%, #34495e 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.3);
    transition: all 0.2s ease;
}

.dv-add-todo-btn:hover {
    background: linear-gradient(135deg, #34495e 0%, #2C3E50 100%);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.4);
}
.dv-add-todo-btn.dv-add-todo-btn-nudge {
    position: relative;
    z-index: 2;
    animation: dv-add-todo-nudge 0.9s ease-in-out 3;
}
@keyframes dv-add-todo-nudge {
    0%, 100% {
        transform: translateY(0);
        box-shadow: 0 2px 8px rgba(44, 62, 80, 0.3);
    }
    50% {
        transform: translateY(-3px);
        box-shadow:
            0 0 0 3px rgba(255, 255, 255, 0.95),
            0 0 0 7px rgba(0, 113, 227, 0.28),
            0 10px 22px rgba(44, 62, 80, 0.38);
    }
}
@media (prefers-reduced-motion: reduce) {
    .dv-add-todo-btn.dv-add-todo-btn-nudge {
        animation: none;
        box-shadow:
            0 0 0 3px rgba(255, 255, 255, 0.95),
            0 0 0 7px rgba(0, 113, 227, 0.28),
            0 4px 12px rgba(44, 62, 80, 0.34);
    }
}
.dv-todo-item.dv-todo-item-selected {
    background-color: #e8f1fb;
    border-left-color: #2c5282 !important;
    box-shadow: inset 0 0 0 1px rgba(44, 82, 130, 0.18);
}
.dv-todo-item.dv-todo-item-selected .dv-todo-text {
    color: #1f3d5a;
    font-weight: 600;
}
.dv-todo-item.dv-todo-item-selected .dv-todo-time-badge {
    background-color: rgba(44, 82, 130, 0.08);
    color: #1f3d5a;
}
.dv-todo-item.dv-todo-item-diary-try.dv-todo-item-selected {
    border-left-color: #16a34a !important;
}

/* --- Routines --- */
#routines-app-container {
    position: relative; width: 100%; height: 100%;
    display: flex; flex-direction: column;
    overflow-y: auto; padding: 10px;
}
.dv-routines-table {
    width: 100%; border-collapse: collapse;
    font-size: 0.85em; table-layout: fixed;
    margin-bottom: auto;
}
.dv-routines-table thead {
    display: table-header-group; position: sticky;
    top: -1px; background-color: #f8f9fa; z-index: 1;
}
.dv-routines-table thead tr,
.dv-routines-table tbody .dv-routine-table-row {
    display: table-row; position: relative;
}
.dv-routines-table tbody { display: table-row-group; }
.dv-routines-table th, .dv-routines-table td {
    border: 1px solid #e7e9ec; padding: 8px 10px;
    text-align: left; vertical-align: middle;
    word-break: break-word;
}
.dv-routines-table th { font-weight: 600; color: #343a40; background-color: #f8f9fa; }
.dv-routines-table td { background-color: #fff; }
.dv-routines-table tr:hover td:not(.editing-row td) { background-color: #f8f9fa; }
.dv-routines-table select, .dv-routines-table input[type="text"], .dv-routines-table textarea {
    width: 100%; padding: 6px; border: 1px solid #ced4da;
    border-radius: 4px; box-sizing: border-box; font-size: 1em;
    font-family: inherit; background-color: #fff;
}
.dv-routines-table textarea { resize: vertical; min-height: 40px; line-height: 1.4; }
.dv-routines-table select:focus, .dv-routines-table input[type="text"]:focus, .dv-routines-table textarea:focus {
    border-color: #86b7fe; outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, .25);
}
.dv-routine-row-actions-container {
    position: absolute; right: 8px; top: 50%;
    transform: translateY(-50%); display: flex; align-items: center;
    gap: 6px; background-color: rgba(255, 255, 255, 0.9);
    padding: 4px 6px; border-radius: 5px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    opacity: 0; visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    z-index: 2;
}
.dv-routine-table-row:hover .dv-routine-row-actions-container,
.dv-routine-table-row.editing-row .dv-routine-row-actions-container {
    opacity: 1; visibility: visible;
}
button.dv-routine-action-btn {
    background: none; border: none; cursor: pointer; padding: 4px;
    font-size: 1em; color: #6c757d; line-height: 1;
}
.dv-routine-action-btn.dv-routine-edit-btn:hover { color: #007bff; }
.dv-routine-action-btn.dv-routine-delete-btn:hover { color: #dc3545; }
.dv-routine-action-btn.dv-routine-confirm-btn { color: #198754; }
.dv-routine-action-btn.dv-routine-confirm-btn:hover { color: #157347; }
.dv-routine-action-btn.dv-routine-cancel-btn { color: #ffc107; }
.dv-routine-action-btn.dv-routine-cancel-btn:hover { color: #d39e00; }
.dv-empty-routines-message {
    text-align: center; padding: 20px !important; color: #6c757d;
    font-style: italic; font-size: 0.9em;
}
.dv-add-routine-btn {
    margin: 15px auto 10px auto; padding: 10px 18px;
    background-color: #0d6efd; color: white; border: none;
    border-radius: 5px; cursor: pointer; font-size: 0.95em;
    display: block; width: fit-content; flex-shrink: 0;
    opacity: 0; visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s, background-color 0.2s;
}
#routines-app-container:hover .dv-add-routine-btn { opacity: 1; visibility: visible; }
.dv-add-routine-btn:hover { background-color: #0b5ed7; }

/* --- Center Pane & Timelines --- */
.dv-center-pane {
    flex: 2 1 56%;
    display: flex; flex-direction: column;
    align-items: center; gap: 12px;
    padding: 0;
    position: relative;
    z-index: 0;
    overflow: hidden;
}
.dv-date-nav {
    position: absolute;
    top: 8px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 5;
}
.dv-date-nav-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 120px);
    padding: 7px 16px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 248, 252, 0.98) 100%);
    border: 1px solid rgba(214, 221, 230, 0.98);
    box-shadow: 0 10px 24px rgba(20, 31, 46, 0.1);
    color: #213246;
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 0.015em;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}
.dv-date-nav-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #d6dde6;
    border-radius: 999px;
    background: #ffffff;
    color: #25313d;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    box-shadow: 0 6px 18px rgba(20, 31, 46, 0.12);
    pointer-events: auto;
}
.dv-date-nav-btn:hover {
    background-color: #f4f7fb;
    border-color: #b8c4d1;
    transform: translateY(-1px);
}
.dv-timelines-side-by-side-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr);
    column-gap: 14px;
    width: 100%;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
}
.dv-timelines-side-by-side-wrapper > .dv-grid-wrapper { flex: 1; min-width: 0; }
.dv-grid-wrapper {
    display: flex; flex-direction: column; align-items: center;
    width: 100%; max-width: 520px;
    min-height: 0;
    justify-self: center;
}
.dv-grid-label {
    font-weight: 600; margin-bottom: 12px;
    font-size: 1.05em; color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}
.dv-load-yesterday-btn {
    padding: 6px 12px;
    font-size: 0.85em;
    font-weight: 600;
    letter-spacing: 0.01em;
    background: linear-gradient(180deg, #f7f9fc 0%, #edf2f7 100%);
    border: 1px solid rgba(44, 62, 80, 0.22);
    border-radius: 999px;
    cursor: pointer;
    color: #2C3E50;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.dv-load-yesterday-btn:hover {
    background: linear-gradient(180deg, #eef3f8 0%, #e3ebf3 100%);
    border-color: rgba(44, 62, 80, 0.4);
    box-shadow: 0 6px 14px rgba(44, 62, 80, 0.12);
    transform: translateY(-1px);
}
.dv-load-yesterday-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(44, 62, 80, 0.12);
}
.dv-load-yesterday-btn.active {
    background: linear-gradient(180deg, #2f4358 0%, #243547 100%);
    border-color: #2C3E50;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(44, 62, 80, 0.18);
}
.dv-load-yesterday-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.18);
}
.dv-plan-tools {
    align-self: end;
    justify-self: center;
    margin-bottom: 18px;
    padding: 8px;
    border: 1px solid #d6dee7;
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 10px 24px rgba(20, 31, 46, 0.08);
    display: flex;
    flex-direction: column;
    gap: 7px;
    align-items: stretch;
}
.dv-plan-tools-title {
    color: #334155;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-align: center;
    text-transform: uppercase;
}
.dv-plan-preset-select,
.dv-plan-unit-select {
    width: 100%;
    min-height: 30px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    appearance: none;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='%2364758b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px 6px;
    color: #1e293b;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 24px 4px 7px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dv-plan-unit-select {
    font-weight: 800;
}
.dv-plan-tool-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}
.dv-plan-save-preset-btn {
    min-height: 30px;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #ffffff;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}
.dv-plan-save-preset-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    transform: translateY(-1px);
}
.dv-plan-save-preset-btn.is-delete-mode {
    border-color: #fecaca;
    background: #fff7f7;
    color: #dc2626;
    font-size: 0.88rem;
    font-weight: 900;
}
.dv-plan-save-preset-btn.is-delete-mode:hover {
    background: #fee2e2;
    border-color: #f87171;
    color: #b91c1c;
}
.dv-plan-tools .dv-daily-ai-btn,
.dv-plan-tools .dv-load-yesterday-btn,
.dv-plan-tools .dv-apply-yesterday-routine-btn,
.dv-plan-tools .dv-problem-pin-tool-btn {
    width: 100%;
    min-height: 30px;
    margin-left: 0;
    border-radius: 8px;
}

.dv-problem-pin-tool-btn {
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #dc2626;
    font-weight: 900;
}

.dv-problem-pin-tool-btn:hover,
.dv-problem-pin-tool-btn.is-active {
    border-color: #ef4444;
    background: #fee2e2;
    color: #b91c1c;
    box-shadow: 0 8px 18px rgba(239, 68, 68, 0.18);
}

.dv-problem-pin-tool-btn.is-hint-flashing {
    animation: dv-problem-pin-hint-flash 780ms ease-in-out 2;
}

@keyframes dv-problem-pin-hint-flash {
    0%, 100% {
        border-color: #fecaca;
        background: #fff1f2;
        box-shadow: none;
        transform: scale(1);
    }
    45% {
        border-color: #ef4444;
        background: #fee2e2;
        box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.16);
        transform: scale(1.06);
    }
}

.dv-grid-container.dv-problem-pin-mode {
    outline: 2px solid rgba(239, 68, 68, 0.36);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1), inset 0 0 0 9999px rgba(239, 68, 68, 0.025);
}

.dv-grid-container.dv-problem-pin-mode .dv-grid-cell {
    cursor: crosshair;
}

.dv-grid-container.dv-problem-pin-mode .dv-grid-cell:hover {
    background-color: #fff1f2 !important;
    border-color: rgba(239, 68, 68, 0.58);
}

.dv-grid-container.dv-problem-pin-mode .dv-scheduled-task-segment-overlay {
    opacity: 0.56;
    pointer-events: none;
}

.dv-grid-container.dv-problem-pin-mode .dv-problem-occurrence-overlay {
    cursor: pointer;
    pointer-events: auto;
}

.dv-grid-container.dv-problem-pin-mode .dv-problem-occurrence-overlay.is-selected {
    z-index: 10;
    cursor: grab;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.36), 0 0 0 2px rgba(239, 68, 68, 0.18);
}

.dv-grid-container.dv-problem-pin-mode .dv-problem-occurrence-overlay.is-selected .dv-problem-occurrence-trigger {
    right: 12px;
}

.dv-problem-resize-handle {
    position: absolute;
    top: -2px;
    bottom: -2px;
    z-index: 12;
    width: 11px;
    background: transparent;
    cursor: ew-resize;
    pointer-events: auto;
    display: none;
}

.dv-grid-container.dv-problem-pin-mode .dv-problem-resize-handle {
    display: block;
}

.dv-problem-resize-handle-left {
    left: -5px;
}

.dv-problem-resize-handle-right {
    right: -5px;
}

.dv-problem-resize-handle::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 16px;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    background: #ef4444;
    opacity: 0;
    transition: opacity 0.12s ease;
}

@media (hover: hover) and (pointer: fine) {
    .dv-grid-container.dv-problem-pin-mode .dv-problem-occurrence-overlay:hover .dv-problem-resize-handle::after,
    .dv-grid-container.dv-problem-pin-mode .dv-problem-occurrence-overlay.is-selected .dv-problem-resize-handle::after {
        opacity: 1;
    }
}

@media (hover: none), (pointer: coarse) {
    .dv-grid-container.dv-problem-pin-mode .dv-problem-occurrence-overlay.is-selected .dv-problem-resize-handle::after {
        opacity: 1;
    }
}

.dv-problem-pin-preview-overlay {
    position: absolute;
    z-index: 13;
    box-sizing: border-box;
    border: 2px solid #ef4444;
    border-radius: 7px;
    background: rgba(254, 226, 226, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.36), 0 1px 6px rgba(239, 68, 68, 0.18);
    pointer-events: none;
}

.dv-problem-pin-preview-badge {
    position: absolute;
    top: 2px;
    right: 3px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
}
.dv-plan-icon-btn {
    width: 100%;
    aspect-ratio: 1;
    min-height: 30px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    line-height: 1;
}
.dv-plan-icon-btn .mv-ai-smart-btn-icon {
    margin: 0;
}
.dv-timeline-divider-tool-btn.is-active {
    border-color: rgba(37, 99, 235, 0.45);
    background: #eff6ff;
    color: #1d4ed8;
}
.dv-apply-yesterday-routine-btn {
    padding: 6px 12px;
    font-size: 0.85em;
    font-weight: 600;
    letter-spacing: 0.01em;
    background: linear-gradient(180deg, #edf8f2 0%, #e3f4ea 100%);
    border: 1px solid rgba(44, 111, 74, 0.28);
    border-radius: 999px;
    cursor: pointer;
    color: #1f6a3e;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.dv-apply-yesterday-routine-btn:hover {
    background: linear-gradient(180deg, #e5f3eb 0%, #dcefe4 100%);
    border-color: rgba(44, 111, 74, 0.4);
    box-shadow: 0 6px 14px rgba(31, 106, 62, 0.12);
    transform: translateY(-1px);
}
.dv-apply-yesterday-routine-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(31, 106, 62, 0.12);
}
.dv-apply-yesterday-routine-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(31, 106, 62, 0.18);
}
.mv-ai-btn {
    border: 1px solid #1f6feb;
    background: #1f6feb;
    color: #fff;
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 0.85rem;
    cursor: pointer;
}
.mv-ai-btn:hover {
    background: #1859c9;
}
.mv-ai-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}
.mv-ai-smart-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 24px rgba(31, 111, 235, 0.22);
}
.mv-ai-smart-btn:hover {
    transform: translateY(-1px);
}
.dv-plan-tools .dv-plan-icon-btn {
    padding: 0;
    display: inline-grid;
    place-items: center;
    gap: 0;
}
.mv-ai-smart-btn-icon {
    position: relative;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.mv-ai-btn-spinner {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    display: inline-block;
    animation: mv-ai-btn-spin 0.8s linear infinite;
}
.mv-ai-spark {
    position: absolute;
    font-size: 0.72rem;
    line-height: 1;
    opacity: 0.85;
    animation: mv-ai-sparkle 1.8s ease-in-out infinite;
}
.mv-ai-spark-1 {
    top: -2px;
    left: 1px;
}
.mv-ai-spark-2 {
    right: 0;
    bottom: -1px;
    font-size: 0.58rem;
    animation-delay: 0.45s;
}
@keyframes mv-ai-sparkle {
    0%, 100% {
        opacity: 0.35;
        transform: scale(0.8) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.18) rotate(10deg);
    }
}
@keyframes mv-ai-btn-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
.dv-daily-ai-btn {
    margin-left: 2px;
}.dv-grid-container {
    display: grid; grid-template-columns: 45px repeat(var(--dv-timeline-columns, 6), 1fr);
    grid-template-rows: auto repeat(var(--dv-timeline-rows, 24), minmax(0, 1fr));
    gap: 1px; background-color: #dde1e6;
    width: 100%; border: 1px solid #c5cdd3;
    border-radius: 4px; overflow: hidden;
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
    position: relative; /* ???筌?absolute ??釉먯뒠????源낃틖 ??れ삀????*/
    z-index: 0;
}
.dv-grid-container .dv-header-cell,
.dv-grid-container .dv-time-cell {
    background-color: #edf2f7; padding: 7px 5px; text-align: center;
    font-weight: 500; user-select: none; font-size: 0.8em; color: #4a5568;
}
.dv-grid-container .dv-time-cell { text-align: right; }
.dv-grid-container .dv-grid-cell {
    background-color: white; min-height: 26px; border: 1px solid #e2e8f0;
    padding: 3px; cursor: pointer; position: relative; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; z-index: 0;
    font-size: 0.7em; transition: border-color 0.2s ease;
}
.dv-grid-container .dv-grid-cell:hover { border-color: #a0aec0; }
.dv-grid-container .dv-grid-cell.dv-timeline-drop-target-hover {
    background-color: #d0e9ff !important;
    outline: 2px dashed #007bff; outline-offset: -2px;
}
.dv-grid-container .dv-grid-cell.dv-range-start-selected {
    outline: 2px solid #2c5282;
    outline-offset: -2px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}
.dv-task-overlay-container {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none; z-index: 5;
}
.dv-timeline-divider-overlay-container {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none; z-index: 8;
}
.dv-timeline-divider-line,
.dv-timeline-divider-preview {
    position: absolute;
    height: 0;
    border-top: 2px solid rgba(51, 65, 85, 0.48);
    transform: translateY(-1px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}
.dv-timeline-divider-line {
    pointer-events: auto;
    cursor: grab;
}
.dv-timeline-divider-line:active {
    cursor: grabbing;
}
.dv-timeline-divider-line::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -7px;
    height: 14px;
}
.dv-timeline-divider-line:hover,
.dv-timeline-divider-dragging .dv-timeline-divider-line {
    border-top-color: rgba(30, 41, 59, 0.72);
    border-top-width: 3px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.74),
        0 2px 8px rgba(15, 23, 42, 0.12);
}
.dv-timeline-divider-preview {
    pointer-events: none;
    border-top-style: dashed;
    border-top-width: 2px;
    border-top-color: rgba(37, 99, 235, 0.78);
    filter: drop-shadow(0 1px 3px rgba(37, 99, 235, 0.28));
    z-index: 9;
}
.dv-grid-container.dv-timeline-divider-mode {
    outline: 2px solid rgba(37, 99, 235, 0.38);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1), inset 0 0 0 9999px rgba(37, 99, 235, 0.025);
}
.dv-grid-container.dv-timeline-divider-mode .dv-grid-cell {
    cursor: crosshair;
}
.dv-grid-container.dv-timeline-divider-mode .dv-grid-cell:hover {
    background-color: #eff6ff !important;
    border-color: rgba(37, 99, 235, 0.58);
}
.dv-timeline-divider-context-menu {
    position: fixed;
    z-index: 10000;
    min-width: 132px;
    padding: 6px;
    border: 1px solid #d6dde6;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(20, 31, 46, 0.16);
}
.dv-timeline-divider-context-menu button {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #25313d;
    font-size: 0.82rem;
    text-align: left;
    cursor: pointer;
}
.dv-timeline-divider-context-menu button:hover {
    background: #f1f5f9;
}
.dv-scheduled-task-segment-overlay {
    position: absolute; padding: 2px 0px 2px 4px; box-sizing: border-box;
    border: 3px solid #f7a6a6; background-color: rgba(247, 166, 166, 0.3);
    display: flex; align-items: center; overflow: hidden; font-size: 0.75em;
    border-radius: 3px; pointer-events: auto; cursor: grab; z-index: 6;
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}
.dv-scheduled-task-segment-overlay.dv-task-moving-segment {
    opacity: 0.72;
    box-shadow:
        0 16px 30px rgba(15, 23, 42, 0.18),
        0 0 0 2px rgba(191, 219, 254, 0.72);
    filter: saturate(1.04);
    pointer-events: none;
    z-index: 10;
}
.dv-task-moving,
.dv-task-moving * {
    cursor: grabbing !important;
}
.dv-scheduled-task-segment-overlay.dv-linked-hover {
    transform: translateY(-1px) scale(1.01);
    box-shadow:
        0 10px 24px rgba(37, 99, 235, 0.18),
        0 0 0 2px rgba(191, 219, 254, 0.88);
    filter: saturate(1.04) brightness(1.02);
    z-index: 8;
}
.dv-scheduled-task-segment-overlay.dv-problem-linked-try-hover {
    transform: translateY(-2px) scale(1.015);
    border-color: #047857 !important;
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.98),
        0 10px 24px rgba(16, 185, 129, 0.34);
    filter: saturate(1.1) brightness(1.04);
    z-index: 11;
}
.dv-scheduled-task-segment-overlay.dv-scheduled-task-segment-overlay-try {
    border-color: #10b981 !important;
    overflow: visible;
    background:
        repeating-linear-gradient(
            135deg,
            rgba(16, 185, 129, 0.3) 0,
            rgba(16, 185, 129, 0.3) 5px,
            rgba(255, 255, 255, 0.28) 5px,
            rgba(255, 255, 255, 0.28) 10px
        ) !important;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.95),
        0 4px 12px rgba(16, 185, 129, 0.22);
}
.dv-scheduled-task-segment-overlay.dv-scheduled-task-segment-overlay-try:hover,
.dv-scheduled-task-segment-overlay.dv-scheduled-task-segment-overlay-try:focus-within {
    z-index: 120;
}
.dv-scheduled-task-segment-overlay.dv-scheduled-task-segment-overlay-try::after {
    content: "TRY";
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    padding: 1px 5px;
    border-radius: 999px;
    background: #059669;
    color: #ffffff;
    font-size: 8px;
    line-height: 1.2;
    font-weight: 900;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.22);
    pointer-events: none;
}
.dv-scheduled-task-segment-overlay.dv-scheduled-task-segment-overlay-try .dv-scheduled-task-text {
    padding-right: 36px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dv-try-rating-controls {
    position: fixed;
    z-index: 10050;
    display: flex;
    gap: 4px;
    padding: 5px;
    border: 1px solid rgba(148, 163, 184, 0.38);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -3px);
    transition: opacity 0.14s ease, visibility 0.14s ease, transform 0.14s ease;
    cursor: default;
}
.dv-try-rating-controls.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}
.dv-try-rating-btn {
    min-width: 48px;
    padding: 4px 7px;
    border: 1px solid #dbe4ee;
    border-radius: 7px;
    background: #f8fafc;
    color: #334155;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
}
.dv-try-rating-btn:hover,
.dv-try-rating-btn:focus-visible {
    transform: translateY(-1px);
    outline: none;
}
.dv-try-rating-btn.is-good:hover,
.dv-try-rating-btn.is-good.is-selected {
    border-color: #22c55e;
    background: #dcfce7;
    color: #166534;
}
.dv-try-rating-btn.is-medium:hover,
.dv-try-rating-btn.is-medium.is-selected {
    border-color: #eab308;
    background: #fef9c3;
    color: #854d0e;
}
.dv-try-rating-btn.is-bad:hover,
.dv-try-rating-btn.is-bad.is-selected {
    border-color: #ef4444;
    background: #fee2e2;
    color: #991b1b;
}
.dv-try-rating-btn:disabled {
    cursor: wait;
    opacity: 0.65;
}
.dv-scheduled-task-text {
    flex-grow: 1; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; color: #2c3e50; padding-right: 20px;
}
.dv-scheduled-task-delete-btn {
    position: absolute; top: 50%; right: 5px; transform: translateY(-50%);
    opacity: 0; visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    background: none; border: none; color: #7f8c8d; cursor: pointer;
    font-size: 1.3em; padding: 0 3px; line-height: 1;
}
.dv-scheduled-task-segment-overlay:hover .dv-scheduled-task-delete-btn {
    opacity: 1; visibility: visible;
}
.dv-scheduled-task-delete-btn:hover { color: #c0392b; }
.dv-scheduled-task-segment-overlay.dv-tablet-resize-selected {
    box-shadow: inset 0 0 0 2px #2c5282, 0 0 0 1px rgba(44, 82, 130, 0.2);
}
.dv-task-tooltip {
    position: fixed;
    left: 0;
    top: 0;
    max-width: min(360px, calc(100vw - 16px));
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: #f8fafc;
    font-size: 12px;
    line-height: 1.45;
    white-space: normal;
    word-break: break-word;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.22);
    pointer-events: none;
    z-index: 9999;
}
.dv-task-tooltip[data-interactive="true"] {
    pointer-events: auto;
}
.dv-task-tooltip-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 220px;
}
.dv-task-tooltip-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.72);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.dv-task-tooltip-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
}
.dv-task-tooltip-row-text {
    flex: 1;
    min-width: 0;
    color: #ffffff;
}
.dv-task-tooltip-remove-btn {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 5px;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0;
}
.dv-task-tooltip-remove-btn:hover {
    border-color: rgba(255, 148, 148, 0.5);
    background: rgba(255, 148, 148, 0.12);
    color: #ffd7d2;
}

/* Disable pointer events on overlays while resizing a scheduled task */
body.dv-task-resizing .dv-scheduled-task-segment-overlay {
    pointer-events: none;
}

.dv-resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px; /* Resize handle width */
    cursor: ew-resize; /* Horizontal resize cursor */
    z-index: 7; /* Keep handles above the task body */
}

.dv-resize-handle-left {
    left: 0;
}

.dv-resize-handle-right {
    right: 0;
}

/* Show a subtle visual handle on hover */
.dv-resize-handle:hover::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 60%;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 2px;
}

/* --- Color Picker & Modal & Diary --- */
/* --- Color Picker & Modal & Diary --- */
.dv-color-picker { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; width: fit-content; max-width: 100%; min-width: 0; align-items: center; align-content: flex-start; justify-content: flex-start; background-color: #f8f9fa; border-radius: 6px; border: 1px solid #e0e0e0; position: relative; margin: -8px auto 0; box-sizing: border-box; align-self: center; }
.dv-add-color-btn{ width:30px;height:30px;border:2px dashed #ccc;border-radius:4px;cursor:pointer; display:flex;align-items:center;justify-content:center;font-size:18px; background:#fff;color:#777;transition:all .2s ease }
.dv-add-color-btn:hover{border-color:#aaa;color:#555}
.dv-color-picker-popup{ position:absolute;bottom:calc(100% + 8px);left:50%;transform:translateX(-50%); min-width:220px;background:#fff;padding:15px;border-radius:8px; box-shadow:0 4px 12px rgba(0,0,0,.15);z-index:4100;display:none }
.dv-color-picker-popup.dv-show{display:block}
.dv-color-input-group{display:flex;flex-direction:column;gap:10px;margin-bottom:12px}
.dv-color-input-group input[type="color"]{height:30px;padding:0 2px; border:1px solid #ddd; border-radius:4px;}
.dv-color-input-group input[type="text"]{padding:8px;border:1px solid #ddd;border-radius:4px;}
.dv-color-option{ width:28px;height:28px;border:1px solid #ccc;border-radius:4px;cursor:pointer; position:relative;transition:transform .1s ease }
.dv-color-option--none{background:#fff;border-color:#adb5bd}
.dv-color-option--clear{background:#fff;border-color:#adb5bd}
.dv-color-option:hover{transform:scale(1.1);border-color:#999}
.dv-color-option:hover::after{ content:attr(data-label);position:absolute;bottom:calc(100% + 5px);left:50%; transform:translateX(-50%);padding:5px 8px;background:rgba(0,0,0,.85);color:#fff; border-radius:4px;font-size:11px;white-space:nowrap;z-index:4101 }
.dv-color-option.is-selected{border-color:#2563eb;box-shadow:0 0 0 2px rgba(37,99,235,.22);transform:scale(1.05)}
.dv-color-option.is-dragging{opacity:.45;transform:scale(.96)}
.dv-color-option.is-drop-target{border-color:#2563eb;box-shadow:0 0 0 2px rgba(37,99,235,.18)}
.dv-color-picker-popup .dv-save-btn { width:100%; padding:10px; font-size:0.9em; background-color: #28a745; border-color: #28a745; color: white; }
.dv-color-picker-popup .dv-save-btn:hover { background-color: #218838; border-color: #1e7e34; }
.dv-color-option-context-menu {
    position: absolute; /* JS?????pageX, pageY ??れ삀?????⑥????ш끽維?????源놁젳 */
    background-color: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 5px 0;
    min-width: 80px; /* 癲ル슔?됭짆??????낅４ */
    z-index: 4102;
    font-size: 13px; /* ???? ???μ쪚獄?????*/
}

.dv-color-option-menu-item {
    padding: 8px 12px;
    cursor: pointer;
    color: #334155;
}

.dv-color-option-menu-item:hover {
    background-color: #f5f5f5;
}

.dv-color-option-delete-item {
    color: #e74c3c; /* ????????몄릇?嶺뚮ㅎ?볢짆???筌륁슕?????節뚮쳮??*/
}
.dv-modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,.5);display:flex;align-items:center;justify-content:center;z-index:2000;backdrop-filter:blur(3px);animation:dv-fadeIn .2s ease-out}
.dv-modal-content{background-color:#fff;padding:20px 24px;border-radius:10px;width:90%;max-width:420px;min-height:200px;position:relative;box-shadow:0 5px 20px rgba(0,0,0,.2);animation:dv-slideIn .25s ease-out;color:#000;display:flex;flex-direction:column}
.dv-daily-ai-preview-modal{
    max-width: 760px;
    max-height: 84vh;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(44, 62, 80, 0.1);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
}
.dv-daily-ai-preview-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    padding: 22px 26px 18px;
    background: linear-gradient(135deg, #1f2d3d 0%, #2C3E50 100%);
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.dv-daily-ai-preview-header h3{
    margin:0;
    font-size:1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.dv-daily-ai-preview-close{
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.08);
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}
.dv-daily-ai-preview-close:hover{
    background: rgba(255,255,255,0.16);
    border-color: rgba(255,255,255,0.28);
    transform: translateY(-1px);
}
.dv-daily-ai-preview-body{
    overflow-y:auto;
    display:flex;
    flex-direction:column;
    gap:16px;
    min-height:0;
    padding: 22px 26px 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
}
.dv-daily-ai-preview-summary{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px 18px;
    padding:18px 20px;
    border:1px solid rgba(44, 62, 80, 0.1);
    border-radius:16px;
    background: #f8fbfe;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
.dv-daily-ai-preview-summary > div{
    color: #243444;
    font-size: 0.96rem;
    line-height: 1.5;
}
.dv-daily-ai-preview-summary > div strong{
    color: #102030;
}
.dv-daily-ai-preview-strategy{
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.dv-daily-ai-preview-strategy p{
    margin: 0;
    color: #243444;
    line-height: 1.6;
}
.dv-daily-ai-preview-summary > div:last-child{
    grid-column: 1 / -1;
    padding-top: 6px;
    border-top: 1px solid rgba(44, 62, 80, 0.08);
}
.dv-daily-ai-preview-section{
    border: 1px solid rgba(44, 62, 80, 0.08);
    border-radius: 16px;
    background: #ffffff;
    padding: 16px 18px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}
.dv-daily-ai-preview-section h4{
    margin:0 0 12px 0;
    font-size:1rem;
    font-weight: 700;
    color: #1d2c3a;
}
.dv-daily-ai-preview-list{
    margin:0;
    padding-left:18px;
    display:flex;
    flex-direction:column;
    gap:10px;
}
.dv-daily-ai-preview-list li{
    color: #1f2933;
    line-height: 1.5;
    padding-left: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.dv-daily-ai-preview-item-text strong{
    font-size: 1rem;
    font-weight: 700;
    color: #162331;
}
.dv-daily-ai-preview-item-meta{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.dv-daily-ai-preview-pill{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.83rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
}
.dv-daily-ai-preview-pill-source{
    background: #eef3f8;
    border-color: rgba(44, 62, 80, 0.14);
    color: #2C3E50;
}
.dv-daily-ai-preview-pill-time{
    background: rgba(31, 111, 235, 0.08);
    border-color: rgba(31, 111, 235, 0.16);
    color: #1f6feb;
}
.dv-daily-ai-preview-footer{
    display:flex;
    justify-content:flex-end;
    gap:10px;
    padding: 16px 26px 22px;
    border-top: 1px solid rgba(44, 62, 80, 0.08);
    background: #f8fafc;
}
.dv-daily-ai-preview-btn{
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
    border: 1px solid transparent;
}
.dv-daily-ai-preview-btn:hover{
    transform: translateY(-1px);
}
.dv-daily-ai-preview-btn-primary{
    background: linear-gradient(135deg, #2C3E50 0%, #34495e 100%);
    color: #fff;
    box-shadow: 0 10px 20px rgba(44, 62, 80, 0.2);
}
.dv-daily-ai-preview-btn-primary:hover{
    box-shadow: 0 14px 24px rgba(44, 62, 80, 0.24);
}
.dv-daily-ai-preview-btn-secondary{
    background: #ffffff;
    color: #2C3E50;
    border-color: rgba(44, 62, 80, 0.18);
}
.dv-daily-ai-preview-btn-secondary:hover{
    background: #eef3f8;
    border-color: rgba(44, 62, 80, 0.32);
}
.dv-daily-ai-preview-btn-ghost{
    background: #eef2f6;
    color: #465869;
    border-color: rgba(44, 62, 80, 0.08);
}
.dv-daily-ai-preview-btn-ghost:hover{
    background: #e3e9ef;
}
@media (max-width: 720px){
    .dv-daily-ai-preview-modal{
        width: calc(100% - 24px);
        max-height: 88vh;
    }
    .dv-daily-ai-preview-header,
    .dv-daily-ai-preview-body,
    .dv-daily-ai-preview-footer{
        padding-left: 18px;
        padding-right: 18px;
    }
    .dv-daily-ai-preview-summary{
        grid-template-columns: 1fr;
    }
    .dv-daily-ai-preview-footer{
        flex-wrap: wrap;
    }
    .dv-daily-ai-preview-btn{
        flex: 1 1 140px;
    }
}
.dv-editing-textarea{width:100%;flex-grow:1;border:1px solid #ccc;padding:10px;resize:vertical;font-family:inherit;font-size:1em;box-sizing:border-box;background-color:transparent;z-index:10;border-radius:4px;margin-bottom:15px}
.dv-modal-buttons{display:flex;justify-content:flex-end;padding-top:0;gap:10px}
.dv-modal-button, .dv-save-text-button, .dv-cancel-text-button{padding:8px 18px;border:none;border-radius:5px;cursor:pointer;font-weight:500;font-size:0.9em;transition:all .2s ease}
.dv-save-text-button{background-color:#007bff;color:#fff}.dv-save-text-button:hover{background-color:#0056b3}
.dv-cancel-text-button{background-color:#f0f0f0;color:#333}.dv-cancel-text-button:hover{background-color:#e0e0e0}
@keyframes dv-fadeIn{from{opacity:0}to{opacity:1}}
@keyframes dv-slideIn{from{opacity:0;transform:translateY(-20px)}to{opacity:1;transform:translateY(0)}}
.dv-right-pane { flex: 1 1 22%; display: flex; padding: 0; }
.dv-right-pane-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    width: 100%;
}
.dv-stats-section {
    width: 100%;
}
#diary-app-container { width: 100%; height: 100%; background-color: #fff; border-radius: 8px; padding: 15px; display: flex; flex-direction: column; gap: 15px; overflow-y: auto; }
.dv-diary-section { width: 100%; display: flex; flex-direction: column; flex: 1; min-height: 120px; background-color: #ffffff; border: 1px solid #e0e0e0; border-radius: 6px; padding: 15px 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }

@media (min-width: 1024px) and (max-width: 1279px) {
    .dv-page-container {
        padding: 10px;
        gap: 10px;
    }

    .dv-left-pane,
    .dv-right-pane {
        padding: 10px;
    }

    .dv-center-pane {
        gap: 10px;
        min-width: 0;
    }

    .dv-timelines-side-by-side-wrapper {
        grid-template-columns: minmax(0, 1fr) 82px minmax(0, 1fr);
        column-gap: 8px;
        min-height: 0;
        padding-left: 10px;
        padding-right: 10px;
    }

    .dv-plan-tools {
        margin-bottom: 6px;
        padding: 8px;
        gap: 6px;
    }

    .dv-plan-tools-title {
        font-size: 0.66rem;
    }

    .dv-plan-save-preset-btn,
    .dv-plan-tools .dv-daily-ai-btn,
    .dv-plan-tools .dv-load-yesterday-btn,
    .dv-plan-tools .dv-apply-yesterday-routine-btn {
        min-height: 28px;
        font-size: 0.68rem;
        padding: 0;
    }

    .dv-plan-preset-select {
        min-height: 28px;
        font-size: 0.68rem;
        padding: 3px 22px 3px 7px;
        background-position: right 7px center;
    }

    .dv-grid-wrapper {
        min-width: 0;
        max-width: none;
        min-height: 0;
    }

    .dv-grid-label {
        margin-bottom: 8px;
        min-height: 28px;
        font-size: 0.88em;
        gap: 6px;
        white-space: nowrap;
        flex-wrap: nowrap;
        line-height: 1;
    }

    .dv-load-yesterday-btn {
        padding: 4px 9px;
        font-size: 0.73em;
    }

    .mv-ai-btn {
        padding: 5px 8px;
        font-size: 0.75rem;
    }

    .mv-ai-smart-btn {
        gap: 6px;
        box-shadow: 0 6px 16px rgba(31, 111, 235, 0.18);
    }

    .mv-ai-smart-btn-icon {
        width: 14px;
        height: 14px;
    }

    .mv-ai-spark {
        font-size: 0.58rem;
    }

    .mv-ai-spark-2 {
        font-size: 0.48rem;
    }

    .dv-grid-container {
        grid-template-columns: 40px repeat(var(--dv-timeline-columns, 6), 1fr);
        grid-template-rows: auto repeat(var(--dv-timeline-rows, 24), minmax(0, 1fr));
        min-height: 0;
        height: min(100%, 560px);
    }

    .dv-grid-container .dv-header-cell,
    .dv-grid-container .dv-time-cell {
        padding: 4px 3px;
        font-size: 0.7em;
        line-height: 1;
    }

    .dv-grid-container .dv-grid-cell {
        min-height: 24px;
        padding: 1px 2px;
        font-size: 0.62em;
        line-height: 1;
    }

    .dv-color-picker {
        gap: 4px;
        padding: 10px;
        min-width: 0;
    }
}
.dv-diary-section h3 { margin: 0 0 12px 0; font-size: 1.1em; font-weight: 600; color: #2c5282; border-bottom: 1px solid #e2e8f0; padding-bottom: 8px; }
.dv-diary-section textarea {
    width: 100%; flex-grow: 1;
    border: 1px solid #d2d6dc;
    border-radius: 4px; padding: 10px 12px;
    font-size: 22px; line-height: 1.7;
    resize: none; box-sizing: border-box;
    background-color: #fdfdfd;
    color: #333;
}
.dv-diary-section textarea::placeholder { color: #a0aec0; font-style: italic; }
.dv-diary-section textarea:focus { border-color: #66afe9; box-shadow: 0 0 0 0.2rem rgba(102, 175, 233, 0.25); outline: none; }
.dv-diary-score-section {
  flex: 0 0 auto;
}
.dv-diary-score-card {
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  background: radial-gradient(circle at top left, rgba(70, 111, 161, 0.08), transparent 42%), linear-gradient(180deg, #f8fbff 0%, #f2f6fb 100%);
  padding: 16px 16px 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.dv-diary-score-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.dv-diary-score-copy {
  color: #738396;
  font-size: 12px;
  line-height: 1.45;
}
.dv-diary-score-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(44, 62, 80, 0.08);
  color: #2c3e50;
  white-space: nowrap;
}
.dv-diary-score-badge-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7b8c;
}
.dv-diary-score-badge strong {
  font-size: 22px;
  line-height: 1;
}
.dv-diary-score-badge-max {
  font-size: 12px;
  color: #6b7b8c;
}
.dv-diary-score-scale {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.dv-diary-score-btn {
  min-height: 40px;
  border: 1px solid #ccd6e0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  color: #425466;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.dv-diary-score-btn:hover {
  transform: translateY(-1px);
  border-color: #8ca0b6;
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(44, 62, 80, 0.1);
}
.dv-diary-score-btn.is-active {
  border-color: #2c3e50;
  background: linear-gradient(135deg, #334a62 0%, #45617e 100%);
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(44, 62, 80, 0.18);
}
.dv-diary-score-hint {
  margin-top: 8px;
  min-height: 20px;
  color: #5f7183;
  font-size: 13px;
  font-weight: 600;
}
.dv-diary-score-hint.is-low { color: #b54747; }
.dv-diary-score-hint.is-midlow { color: #b26a2d; }
.dv-diary-score-hint.is-mid { color: #556270; }
.dv-diary-score-hint.is-midhigh { color: #2f6f62; }
.dv-diary-score-hint.is-high { color: #1f5e99; }
.dv-current-time-indicator {
    position: absolute;
    /* top: 0;  */
    /* left: 0;  */
    width: 2px;
    /* height: 100%;  */
    background-color: red;
    z-index: 10;
    pointer-events: none;
    display: none; /* JS????筌?六???? ??筌?苑?*/
}
.dv-grid-cell.dv-passed-time-block {
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(0, 0, 0, 0.05),
        rgba(0, 0, 0, 0.05) 4px,
        transparent 4px,
        transparent 8px
    );
    /* Optional blend mode kept disabled for readability */
    /* background-blend-mode: multiply; */
}
.dv-grid-cell.dv-current-time-block {
    /* Optional current-time highlight hook */
    /* background-color: rgba(255, 255, 0, 0.1); */
}

/* Landing-inspired timeline polish */
.dv-grid-container {
    gap: 2px;
    background-color: transparent;
    border: 1px solid rgba(36, 52, 71, 0.12);
    border-radius: 20px;
    padding: 10px;
    overflow: hidden;
    box-shadow: 0 18px 48px rgba(20, 32, 51, 0.08);
}

.dv-grid-container .dv-header-cell,
.dv-grid-container .dv-time-cell {
    background-color: #eef3fa;
    color: #4c5d73;
    border-radius: 8px;
    border: 1px solid rgba(44, 62, 80, 0.04);
    font-weight: 700;
}

.dv-grid-container .dv-header-cell {
    background-color: #ffffff;
    color: #637081;
}

.dv-grid-container .dv-time-cell {
    display: grid;
    place-items: center;
    padding-inline: 4px;
    text-align: center;
}

.dv-grid-container .dv-grid-cell {
    min-height: 26px;
    border: 1px solid rgba(44, 62, 80, 0.06);
    border-radius: 8px;
    background-color: #ffffff;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.dv-grid-container .dv-grid-cell:hover {
    border-color: rgba(44, 62, 80, 0.18);
    box-shadow: inset 0 0 0 1px rgba(44, 62, 80, 0.06);
}

.dv-grid-container .dv-grid-cell.dv-timeline-drop-target-hover {
    background-color: rgba(114, 223, 229, 0.18) !important;
    outline: 2px solid #72dfe5;
    outline-offset: -2px;
}

.dv-scheduled-task-segment-overlay {
    padding: 0 5px;
    border-width: 2px;
    background-color: rgba(255, 255, 255, 0.42);
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(20, 32, 51, 0.12);
    backdrop-filter: blur(2px);
    font-weight: 700;
}

.dv-task-moving .dv-scheduled-task-segment-overlay {
    pointer-events: none;
}

.dv-scheduled-task-text {
    color: #142033;
    text-overflow: "..";
    padding-right: 8px;
}

.dv-scheduled-task-segment-1-cell .dv-scheduled-task-text,
.dv-scheduled-task-segment-2-cell .dv-scheduled-task-text {
    padding-right: 2px;
}

.dv-current-time-indicator {
    width: 2px;
    background-color: #df1f27;
    border-radius: 999px;
    box-shadow: 0 0 0 2px rgba(223, 31, 39, 0.12);
}

.dv-grid-cell.dv-passed-time-block {
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(20, 32, 51, 0.055),
        rgba(20, 32, 51, 0.055) 4px,
        transparent 4px,
        transparent 8px
    );
}

/* --- Color Statistics Styles --- */
.dv-stats-section {
    width: 100%;
}

.dv-task-context-panel {
    width: 100%;
}

.dv-task-context-card {
    --task-context-color: #2c3e50;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    color: #142033;
}

.dv-try-context-flow {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dv-try-context-section {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 14px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fff7f7;
}

.dv-try-context-section strong {
    color: #172033;
    font-size: 15px;
    line-height: 1.4;
}

.dv-try-context-section small,
.dv-try-context-section p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

.dv-try-context-label {
    color: #dc2626;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.dv-try-context-solution {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.dv-try-context-solution .dv-try-context-label {
    color: #16a34a;
}

.dv-try-context-arrow {
    color: #65a30d;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
}

.dv-try-context-attempts {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 4px;
}

.dv-try-context-attempts-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #166534;
    font-size: 12px;
    font-weight: 800;
}

.dv-try-context-attempts-head strong {
    padding: 3px 8px;
    border-radius: 999px;
    background: #dcfce7;
    color: #15803d;
    font-size: 11px;
}

.dv-try-context-attempt-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dv-try-context-attempt {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 11px 12px;
    border: 1px solid #d1fae5;
    border-radius: 10px;
    background: #ffffff;
}

.dv-try-context-attempt.is-selected {
    border-color: #22c55e;
    background: #f0fdf4;
    box-shadow: inset 3px 0 0 #22c55e;
}

.dv-try-context-attempt-main,
.dv-try-context-attempt-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.dv-try-context-attempt-main span {
    flex: 0 0 auto;
    color: #16a34a;
    font-size: 11px;
    font-weight: 900;
}

.dv-try-context-attempt-main strong {
    min-width: 0;
    overflow: hidden;
    color: #172033;
    font-size: 13px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dv-try-context-attempt-meta {
    justify-content: space-between;
    color: #64748b;
    font-size: 11px;
}

.dv-try-context-attempt-meta em {
    padding: 2px 7px;
    border-radius: 999px;
    background: #dcfce7;
    color: #15803d;
    font-style: normal;
    font-weight: 800;
}

.dv-task-context-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.dv-task-context-header h3 {
    margin: 2px 0 0;
    font-size: 16px;
    line-height: 1.35;
    color: #142033;
    overflow-wrap: anywhere;
}

.dv-task-context-eyebrow {
    margin: 0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7c93;
}

.dv-task-context-close {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    background: #f8fafc;
    color: #52616b;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.dv-task-context-close:hover,
.dv-task-context-close:focus-visible {
    background: #eef3fa;
    color: #142033;
}

.dv-task-context-project {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 13px;
    color: #2c3e50;
}

.dv-task-context-project strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dv-task-context-project-dot {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--task-context-color);
}

.dv-task-context-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    font-size: 11px;
    color: #6b7c93;
}

.dv-task-context-breadcrumb span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
}

.dv-task-context-breadcrumb span:not(:last-child)::after {
    content: ">";
    color: #a9b6c8;
}

.dv-task-context-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    background: #f4f7fb;
    font-size: 12px;
    color: #52616b;
}

.dv-task-context-summary strong {
    color: var(--task-context-color);
    font-size: 16px;
}

.dv-task-context-path {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dv-task-context-node-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 18px;
    color: color-mix(in srgb, var(--task-context-color) 70%, #64748b);
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
}

.dv-task-context-node {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 10px;
    border: 1px solid #dbe3ee;
    border-radius: 11px;
    background: #fbfcfe;
    position: relative;
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.dv-task-context-node.is-focus-node {
    border-color: color-mix(in srgb, var(--task-context-color) 55%, #dbe3ee);
    background: color-mix(in srgb, var(--task-context-color) 5%, #ffffff);
}

.dv-task-context-node.is-hover-focus {
    border-color: color-mix(in srgb, var(--task-context-color) 72%, #8fb6ff);
    background: color-mix(in srgb, var(--task-context-color) 9%, #ffffff);
    box-shadow:
        0 12px 24px rgba(44, 62, 80, 0.12),
        0 0 0 2px color-mix(in srgb, var(--task-context-color) 18%, transparent);
    transform: translateY(-1px) scale(1.01);
}

.dv-task-context-node-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
    color: #142033;
}

.dv-task-context-node-title span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.dv-task-context-node-title em {
    flex: 0 0 auto;
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
    color: #71819a;
}

.dv-task-context-node-title .dv-task-context-deadline-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 19px;
    padding: 3px 7px;
    border: 1px solid rgba(37, 99, 235, 0.24);
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;
}

.dv-task-context-node-title .dv-task-context-deadline-badge.is-today {
    border-color: rgba(217, 119, 6, 0.3);
    background: #fffbeb;
    color: #b45309;
}

.dv-task-context-node-title .dv-task-context-deadline-badge.is-overdue {
    border-color: rgba(220, 38, 38, 0.28);
    background: #fff7f6;
    color: #b42318;
}

.dv-task-context-row {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 7px 8px;
    border: 1px solid #e5ebf3;
    border-radius: 9px;
    background: #ffffff;
    font-size: 12px;
    position: relative;
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.dv-task-context-row:has(.dv-task-context-add-today)::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 7px;
    background: rgba(15, 23, 42, 0.18);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.14s ease;
    z-index: 1;
}

.dv-task-context-row:has(.dv-task-context-add-today):hover::after,
.dv-task-context-row:has(.dv-task-context-add-today):focus-within::after {
    opacity: 1;
}

.dv-task-context-row.is-focus {
    border-color: color-mix(in srgb, var(--task-context-color) 58%, #8fb6ff);
    background: color-mix(in srgb, var(--task-context-color) 10%, #ffffff);
    box-shadow: inset 3px 0 0 var(--task-context-color);
}

.dv-task-context-row.is-selected-todo {
    border-color: #b7d0eb;
    background: #e8f1fb;
    box-shadow:
        inset 3px 0 0 #2c5282,
        inset 0 0 0 1px rgba(44, 82, 130, 0.18),
        0 8px 18px rgba(44, 82, 130, 0.14);
    animation: dv-task-context-selected-pulse 1.15s ease-in-out 2;
    transform-origin: center;
}

.dv-task-context-row.is-selected-todo .dv-task-context-title {
    color: #1f3d5a;
    font-weight: 800;
}

.dv-task-context-row.is-selected-todo .dv-task-context-check {
    border-color: #8fb1d7;
    background: #f7fbff;
}

@keyframes dv-task-context-selected-pulse {
    0%,
    100% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.025);
    }
}

.dv-task-context-row.is-path {
    border-color: color-mix(in srgb, var(--task-context-color) 34%, #dbe3ee);
    background: color-mix(in srgb, var(--task-context-color) 6%, #ffffff);
}

.dv-task-context-row.is-hover-parent-link {
    border-color: color-mix(in srgb, var(--task-context-color) 68%, #8fb6ff);
    background: color-mix(in srgb, var(--task-context-color) 12%, #ffffff);
    box-shadow:
        inset 3px 0 0 var(--task-context-color),
        0 8px 16px rgba(44, 62, 80, 0.12);
    transform: scale(1.018);
}

.dv-task-context-row.is-node-link {
    font-weight: 800;
}

.dv-task-context-row.is-completed .dv-task-context-title {
    color: #7c8b9d;
    text-decoration: line-through;
}

.dv-task-context-check {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border: 2px solid #b7c4d6;
    border-radius: 999px;
    color: #118a68;
    font-size: 11px;
    font-weight: 900;
}

.dv-task-context-row.is-completed .dv-task-context-check {
    border-color: #8bd1bb;
    background: #eefaf5;
}

.dv-task-context-node-marker {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    border: 1px solid color-mix(in srgb, var(--task-context-color) 45%, #cbd5e1);
    background: color-mix(in srgb, var(--task-context-color) 10%, #ffffff);
}

.dv-task-context-node-marker::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: var(--task-context-color);
    opacity: 0.72;
}

.dv-task-context-title {
    min-width: 0;
    color: #142033;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.dv-task-context-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

.dv-task-context-time {
    padding: 4px 7px;
    border-radius: 999px;
    background: #eef3fa;
    color: #52616b;
    font-size: 11px;
    font-weight: 800;
}

.dv-task-context-add-today {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: #2c5282;
    color: #ffffff;
    box-shadow:
        0 8px 18px rgba(15, 23, 42, 0.24),
        0 0 0 1px rgba(44, 82, 130, 0.22);
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.84);
    transition: opacity 0.14s ease, transform 0.14s ease, background 0.14s ease;
}

.dv-task-context-row:hover .dv-task-context-add-today,
.dv-task-context-row:focus-within .dv-task-context-add-today {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.dv-task-context-add-today:hover,
.dv-task-context-add-today:focus-visible {
    background: #1f3d5a;
    outline: none;
}

.dv-task-context-add-today:disabled {
    cursor: wait;
    opacity: 0.65;
}

.dv-task-context-empty {
    margin: 0;
    padding: 10px;
    border-radius: 9px;
    background: #f8fafc;
    color: #7c8b9d;
    font-size: 12px;
    line-height: 1.45;
}

.dv-task-context-open-project {
    width: 100%;
    min-height: 38px;
    border: none;
    border-radius: 9px;
    background: #2c3e50;
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
}

.dv-task-context-open-project:hover,
.dv-task-context-open-project:focus-visible {
    background: #1f3144;
}

.dv-color-stats-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.dv-color-stats-header {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    flex-shrink: 0;
}
.dv-color-stats-empty {
    color: #adb5bd;
    font-style: italic;
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

/* Color statistics table */
.dv-color-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background: white;
    border-radius: 6px;
    overflow: hidden;
}

.dv-color-stats-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.dv-color-stats-table th {
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dv-color-stats-table th.col-action {
    width: 35%;
}
.dv-color-stats-table th.col-goal {
    width: 20%;
    text-align: right;
}
.dv-color-stats-table th.col-actual {
    width: 20%;
    text-align: right;
}
.dv-color-stats-table th.col-diff {
    width: 25%;
    text-align: right;
}

.dv-color-stats-table tbody tr {
    border-bottom: 1px solid #e9ecef;
}

.dv-color-stats-table tbody tr.dv-color-stats-linked-row {
    position: relative;
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        background-color 0.16s ease;
}

.dv-color-stats-table tbody tr.dv-color-stats-linked-row:hover {
    background: #f8fbff;
    transform: translateY(-1px);
    box-shadow:
        0 12px 24px rgba(37, 99, 235, 0.11),
        0 0 0 1px rgba(96, 165, 250, 0.26);
    z-index: 1;
}

.dv-color-stats-table tbody tr:last-child {
    border-bottom: none;
}

.dv-color-stats-table tbody tr:hover {
    background: #f8f9fa;
}

.dv-color-stats-table td {
    padding: 8px 10px;
    vertical-align: middle;
}

.dv-color-stats-table td.col-action {
    text-align: left;
}

.dv-color-stats-table td.col-goal,
.dv-color-stats-table td.col-actual,
.dv-color-stats-table td.col-diff {
    text-align: right;
}

/* Shared action cell layout */
.action-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-preview {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid #dee2e6;
    flex-shrink: 0;
}

.action-label {
    font-size: 12px;
    color: #212529;
    font-weight: 500;
}

/* Positive differences are highlighted in red */
.dv-color-stats-table td.col-diff.positive {
    color: #e03131;
    font-weight: 600;
}
.dv-color-stats-table td.col-diff.negative {
    color: #2f9e44;
    font-weight: 600;
}
.dv-color-stats-table td.col-diff.neutral {
    color: #868e96;
}


/* --- Overall Progress Bar Styles --- */
.dv-overall-progress-card {
    background: white;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.dv-overall-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.dv-overall-progress-label {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.dv-overall-progress-value {
    font-size: 18px;
    font-weight: 700;
    color: #495057;
}

.dv-overall-progress-section {
    position: relative;
}

.dv-overall-progress-labels {
    position: relative;
    height: 20px;
    margin-bottom: 4px;
}

.dv-overall-progress-marker {
    position: absolute;
    transform: translateX(-50%);
    font-size: 11px;
    white-space: nowrap;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.dv-overall-progress-marker--base {
    color: #6b7280;
    background: rgba(107, 114, 128, 0.15);
}

.dv-overall-progress-marker--today {
    color: #059669;
    background: rgba(16, 185, 129, 0.2);
}

.dv-overall-progress-marker--base-apart {
    transform: translateX(calc(-100% - 6px)) !important;
}

.dv-overall-progress-marker--today-apart {
    transform: translateX(6px) !important;
}

.dv-overall-progress-track {
    width: 100%;
    height: 12px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.dv-overall-progress-fill {
    height: 100%;
    position: absolute;
    top: 0;
    transition: width 0.3s ease, left 0.3s ease;
}

.dv-overall-progress-fill--base {
    background: #d1d5db;
    left: 0;
}

.dv-overall-progress-fill--today {
    background: #10b981;
}

.dv-overall-project-progress-row {
    border-radius: 8px;
    transition: background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.dv-overall-project-progress-row:hover,
.dv-overall-project-progress-row:focus-visible {
    background: rgba(248, 250, 252, 0.92);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
    transform: translateY(-1px);
}

/* --- TODO Statistics Styles --- */
.dv-stats-header {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.dv-stats-empty {
    color: #adb5bd;
    font-style: italic;
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

/* Todo statistics table */
.dv-todo-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background: white;
    border-radius: 6px;
    overflow: hidden;
}

.dv-todo-stats-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.dv-todo-stats-table th {
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dv-todo-stats-table th.col-todo {
    width: 40%;
}
.dv-todo-stats-table th.col-goal {
    width: 20%;
    text-align: right;
}
.dv-todo-stats-table th.col-actual {
    width: 20%;
    text-align: right;
}
.dv-todo-stats-table th.col-diff {
    width: 20%;
    text-align: right;
}

.dv-todo-stats-table tbody tr {
    border-bottom: 1px solid #e9ecef;
}

.dv-todo-stats-table tbody tr.dv-todo-stats-linked-row {
    position: relative;
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        background-color 0.16s ease;
}

.dv-todo-stats-table tbody tr.dv-todo-stats-linked-row:hover {
    background: #f8fbff;
    transform: translateY(-1px);
    box-shadow:
        0 14px 28px rgba(37, 99, 235, 0.12),
        0 0 0 1px rgba(96, 165, 250, 0.3);
    z-index: 1;
}

.dv-todo-stats-table tbody tr:last-child {
    border-bottom: none;
}

.dv-todo-stats-table tbody tr:hover {
    background: #f8f9fa;
}

.dv-todo-stats-table td {
    padding: 8px 10px;
    vertical-align: middle;
}

.dv-todo-stats-table td.col-todo {
    text-align: left;
}

.dv-todo-stats-table td.col-goal,
.dv-todo-stats-table td.col-actual,
.dv-todo-stats-table td.col-diff {
    text-align: right;
}

.todo-text {
    font-size: 12px;
    color: #212529;
    word-break: break-word;
}

.todo-project-color-bar {
    display: inline-block;
    width: 4px;
    height: 16px;
    margin-right: 8px;
    border-radius: 2px;
    vertical-align: middle;
}

/* Positive todo deltas are highlighted in red */
.dv-todo-stats-table td.col-diff.positive {
    color: #e03131;
    font-weight: 600;
}
.dv-todo-stats-table td.col-diff.negative {
    color: #2f9e44;
    font-weight: 600;
}
.dv-todo-stats-table td.col-diff.neutral {
    color: #868e96;
}

/* ============================================
 * Todo Groups (2-Layer Structure) Styles
 * ============================================ */

.dv-todo-groups-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dv-todo-group {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background-color: #ffffff;
    transition: box-shadow 0.2s ease;
}

.dv-todo-group.dragging-group {
    opacity: 0.5;
}

.dv-todo-group-drag-over {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.dv-todo-group-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid #f0f0f0;
}

.dv-todo-group-header:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.dv-todo-group-collapse-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    margin-right: 8px;
    font-size: 0.7em;
    color: #666;
    transition: transform 0.2s ease;
}

.dv-todo-group-collapsed .dv-todo-group-collapse-btn {
    transform: rotate(-90deg);
}

.dv-todo-group-name {
    flex-grow: 1;
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.95em;
}

.dv-todo-group-count {
    font-size: 0.8em;
    color: #666;
    margin-right: 8px;
    padding: 2px 6px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.dv-todo-group-drag-handle {
    color: #999;
    font-size: 0.8em;
    margin-right: 8px;
    cursor: grab;
}

.dv-todo-group-drag-handle:active {
    cursor: grabbing;
}

.dv-todo-group-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 1em;
    padding: 2px 6px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.dv-todo-group-header:hover .dv-todo-group-delete-btn {
    opacity: 1;
    visibility: visible;
}

.dv-todo-group-delete-btn:hover {
    color: #dc3545;
}

.dv-todo-group-todos {
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
    transition: max-height 0.3s ease;
}

.dv-todo-group-collapsed .dv-todo-group-todos {
    max-height: 0;
    overflow: hidden;
}

.dv-todo-group-todos .dv-sub-todo-list {
    padding: 4px 0;
}

.dv-todo-group-add-btn {
    display: block;
    margin: 8px 12px;
    padding: 6px 12px;
    font-size: 0.85em;
    color: #555;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.dv-todo-group-add-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.dv-add-group-btn {
    display: block;
    margin: 12px;
    padding: 10px 12px;
    font-size: 0.9em;
    color: #555;
    background-color: #f0f2f5;
    border: 1px dashed #ccc;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.dv-add-group-btn:hover {
    background-color: #e4e9ed;
    border-color: #999;
}

/* ============================================
 * Todo Groups (2-Layer) - mv- prefix for Main View
 * ============================================ */

.mv-todo-groups-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mv-todo-group {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background-color: #ffffff;
    transition: box-shadow 0.2s ease;
}

.mv-todo-group.mv-dragging-group {
    opacity: 0.5;
}

.mv-todo-group-drag-over {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Group drop placeholder */
.mv-group-drop-placeholder {
    border: 2px dashed #007bff;
    border-radius: 6px;
    background-color: rgba(0, 123, 255, 0.05);
    margin: 6px 0;
    pointer-events: none;
}

.mv-todo-group-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid #f0f0f0;
}

.mv-todo-group-header:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.mv-todo-group-collapse-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    margin-right: 8px;
    font-size: 0.7em;
    color: #666;
    transition: transform 0.2s ease;
}

.mv-todo-group-collapsed .mv-todo-group-collapse-btn {
    transform: rotate(-90deg);
}

.mv-todo-group-name {
    flex-grow: 1;
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.95em;
}

.mv-todo-group-count {
    font-size: 0.8em;
    color: #666;
    margin-right: 8px;
    padding: 2px 6px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.mv-todo-group-drag-handle {
    color: #999;
    font-size: 0.8em;
    margin-right: 8px;
    cursor: grab;
}

.mv-todo-group-drag-handle:active {
    cursor: grabbing;
}

.mv-todo-group-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 1em;
    padding: 2px 6px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.mv-todo-group-header:hover .mv-todo-group-delete-btn {
    opacity: 1;
    visibility: visible;
}

.mv-todo-group-delete-btn:hover {
    color: #dc3545;
}

.mv-todo-group-todos {
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
    transition: max-height 0.3s ease;
}

.mv-todo-group-collapsed .mv-todo-group-todos {
    max-height: 0;
    overflow: hidden;
}

.mv-todo-group-todos .mv-project-todo-list {
    padding: 4px 0;
}

.mv-todo-group-add-btn {
    display: block;
    width: calc(100% - 24px);
    margin: 8px 12px;
    padding: 9px 12px;
    font-size: 0.9em;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #2C3E50 0%, #34495e 100%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.22);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.mv-todo-group-add-btn:hover {
    background: linear-gradient(135deg, #34495e 0%, #2C3E50 100%);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.3);
    transform: translateY(-1px);
}

.mv-add-group-btn {
    display: block;
    margin: 12px;
    padding: 10px 12px;
    font-size: 0.9em;
    color: #555;
    background-color: #f0f2f5;
    border: 1px dashed #ccc;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.mv-add-group-btn:hover {
    background-color: #e4e9ed;
    border-color: #999;
}

/* Selected todo items (for selection mode) */
.mv-project-todo-item.mv-selected {
    background-color: #e3f2fd !important;
    border-left: 3px solid #2196f3;
}

.mv-project-todo-item.mv-selected .mv-todo-text {
    color: #1565c0;
}

/* Dragging todo item */
.mv-project-todo-item.mv-dragging {
    opacity: 0.5;
}

/* Selection mode button */
.mv-selection-mode-btn {
    padding: 6px 12px;
    font-size: 0.85em;
    color: #555;
    background-color: #f0f2f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}

.mv-selection-mode-btn:hover {
    background-color: #e4e9ed;
    border-color: #999;
}

/* Selection action buttons */
.mv-selection-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mv-group-selected-btn {
    padding: 6px 12px;
    font-size: 0.85em;
    color: white;
    background-color: #28a745;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.mv-group-selected-btn:hover {
    background-color: #218838;
}

.mv-clear-selection-btn {
    padding: 6px 12px;
    font-size: 0.85em;
    color: #555;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.mv-clear-selection-btn:hover {
    background-color: #e2e6ea;
}

/* Ungrouped todos (not in any group) */
.mv-ungrouped-todos {
    margin-bottom: 12px;
}

.mv-ungrouped-todos:empty {
    display: none;
}

.dv-stats-empty {
    color: #adb5bd;
    font-style: italic;
    font-size: 13px;
    text-align: center;
    padding: 20px;
}
.dv-stats-summary-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}
.dv-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #e9ecef;
}
.dv-stat-item:last-child {
    border-bottom: none;
}
.dv-stat-label {
    font-size: 11px;
    color: #6c757d;
    font-weight: 500;
}
.dv-stat-value {
    font-size: 13px;
    font-weight: 600;
    color: #212529;
}
.dv-stat-value.over {
    color: #e03131;
}
.dv-stat-value.under {
    color: #2f9e44;
}
.dv-stat-value.exact {
    color: #1971c2;
}
.dv-stats-todo-list {
    overflow-y: auto;
    padding: 5px 0;
}
.dv-stats-todo-list-header {
    font-size: 11px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e9ecef;
}
.dv-stats-todo-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 8px;
}
.dv-stats-todo-info {
    font-size: 12px;
    font-weight: 500;
    color: #212529;
    margin-bottom: 6px;
}
.dv-stats-todo-time {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.dv-stats-goal-time {
    font-size: 11px;
    color: #6c757d;
}
.dv-stats-current-time {
    font-size: 11px;
    font-weight: 500;
}
.dv-stats-current-time.over {
    color: #e03131;
}
.dv-stats-current-time.under {
    color: #2f9e44;
}
.dv-stats-current-time.exact {
    color: #1971c2;
}

/* ============================================
 * Daily Project List Component (dpl- prefix)
 * ============================================ */

.dpl-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dpl-empty-state {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    justify-content: center;
    height: 100px;
    color: #999;
    font-size: 0.9em;
    font-style: italic;
}

.dpl-empty-state-action {
    margin: 2px;
    padding: 16px;
    border: 1px dashed #cfd6df;
    border-radius: 12px;
    background: #fff;
    color: #6b7a90;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.dpl-empty-state-message {
    line-height: 1.45;
}

.dpl-empty-state-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: #34495e;
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
    box-shadow: none;
}

.dpl-empty-state-cta::after {
    content: '→';
    transition: transform 0.18s ease;
}

.dpl-empty-state-action:hover,
.dpl-empty-state-action:focus-visible {
    border-color: #9aa7b5;
    background: #fbfcfd;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    color: #475569;
    outline: none;
    transform: translateY(-1px);
}

.dpl-empty-state-action:hover .dpl-empty-state-cta,
.dpl-empty-state-action:focus-visible .dpl-empty-state-cta {
    color: #24384d;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.dpl-empty-state-action:hover .dpl-empty-state-cta::after,
.dpl-empty-state-action:focus-visible .dpl-empty-state-cta::after {
    transform: translateX(3px);
}

.dpl-empty-state-action.dpl-empty-state-nudge {
    animation: dpl-empty-state-nudge 0.9s ease-in-out 3;
}

@keyframes dpl-empty-state-nudge {
    0%, 100% {
        transform: translateY(0);
        box-shadow: none;
    }
    50% {
        transform: translateY(-2px);
        border-color: #9aa7b5;
        box-shadow:
            0 0 0 4px rgba(148, 163, 184, 0.14),
            0 10px 24px rgba(15, 23, 42, 0.08);
        color: #475569;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dpl-empty-state-action.dpl-empty-state-nudge {
        animation: none;
        border-color: #9aa7b5;
        box-shadow:
            0 0 0 4px rgba(148, 163, 184, 0.14),
            0 10px 24px rgba(15, 23, 42, 0.08);
        color: #475569;
    }
}

.dpl-project-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 11px;
    overflow-y: auto;
    flex: 1;
    overflow-x: visible;
}

.dpl-project-item {
    background-color: #fff;
    border: 1px solid #e7eaf0;
    border-radius: 6px;
    overflow: visible;
    transition: box-shadow 0.2s ease;
    position: relative;
    z-index: 1;
}

.dpl-project-item.dpl-expanded {
    z-index: 100;
}

.dpl-project-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dpl-project-deadline-badge {
    position: absolute;
    top: 0;
    right: 10px;
    transform: translateY(-52%);
    z-index: 20;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 19px;
    padding: 0 7px;
    border: 1px solid rgba(220, 38, 38, 0.28);
    border-radius: 999px;
    background: #fff7f6;
    color: #b42318;
    font-size: 0.68em;
    font-weight: 750;
    letter-spacing: 0.04em;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.09);
    pointer-events: none;
}

.dpl-project-deadline-badge.is-upcoming {
    border-color: rgba(37, 99, 235, 0.24);
    background: #eff6ff;
    color: #1d4ed8;
}

.dpl-project-deadline-badge.is-today {
    border-color: rgba(217, 119, 6, 0.3);
    background: #fffbeb;
    color: #b45309;
}

.dpl-project-deadline-badge.is-overdue {
    border-color: rgba(220, 38, 38, 0.28);
    background: #fff7f6;
    color: #b42318;
}

.dpl-project-header {
    display: flex;
    align-items: center;
    padding: 12px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
}

.dpl-project-header:hover {
    background-color: #f8f9fa;
}

.dpl-color-indicator {
    width: 4px;
    height: 52px;
    border-radius: 2px;
    margin-right: 12px;
    flex-shrink: 0;
}

.dpl-project-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.dpl-project-name-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.dpl-project-name {
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.95em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dpl-project-deadline {
    font-size: 0.72em;
    color: #9a3412;
    font-weight: 700;
    white-space: normal;
    flex-shrink: 0;
}

.dpl-project-estimate-left {
    font-size: 0.72em;
    color: #64748b;
    font-weight: 600;
    white-space: normal;
}

.dpl-completion-status {
    font-size: 0.75em;
    color: #6c757d;
}

/* Progress bar container */
.dpl-progress-container {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    width: 100%;
    margin-top: 4px;
}

.dpl-progress-stack {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dpl-progress-labels {
    position: relative;
    height: 14px;
    margin-bottom: 2px;
}

.dpl-progress-marker {
    position: absolute;
    bottom: 0;
    transform: translateX(-50%);
    font-size: 0.68em;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.dpl-progress-marker-base {
    color: #2563eb;
}

.dpl-progress-marker-today {
    color: #38bdf8;
}

.dpl-progress-marker-base-apart {
    transform: translateX(calc(-100% - 4px));
}

.dpl-progress-marker-today-apart {
    transform: translateX(4px);
}

.dpl-progress-bar-mini {
    flex: 1;
    height: 6px;
    background-color: #e9ecef !important;
    border-radius: 3px;
    overflow: hidden;
    min-width: 40px;
}

.dpl-progress-fill-mini {
    height: 100%;
    display: block;
    flex: 0 0 auto;
    background-color: transparent;
    border-radius: 0;
    transition: width 0.3s ease;
}

.dpl-progress-text {
    font-size: 0.7em;
    color: #6c757d;
    font-weight: 700;
    min-width: 35px;
    text-align: right;
    padding-bottom: 1px;
}

.dpl-expand-indicator {
    font-size: 0.7em;
    color: #999;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 8px;
}

.dpl-project-item.dpl-expanded .dpl-expand-indicator {
    transform: rotate(90deg);
}

.dpl-project-item.dpl-expanded {
    position: relative;
    z-index: 100;
}

/* When any project is expanded, allow overflow to show above */
.dpl-container:has(.dpl-project-item.dpl-expanded) .dpl-project-list {
    overflow: visible;
}

/* Expanded Content Styles */
.dpl-expanded-content {
    display: block;
    position: fixed;
    box-sizing: border-box;
    border: 1px solid #e7eaf0;
    background-color: #fafbfc;
    max-height: 500px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    z-index: 1000;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dpl-expanded-content::-webkit-scrollbar {
    display: none;
}

/* When expanded, allow content to overflow outside the list */
.dpl-container:has(.dpl-project-item.dpl-expanded) .dpl-project-list {
    overflow-y: visible;
}

.dpl-expanded-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background-color: #fff;
    border-bottom: 1px solid #e7eaf0;
}

.dpl-expanded-title {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #2c3e50;
}

.dpl-close-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.dpl-close-btn:hover {
    background-color: #f0f0f0;
    color: #666;
}

/* Progress Bar */
.dpl-progress-bar {
    padding: 12px 16px;
    background-color: #fff;
    border-bottom: 1px solid #e7eaf0;
}

.dpl-progress-info {
    font-size: 0.85em;
    color: #6c757d;
    margin-bottom: 6px;
}

.dpl-progress-track {
    height: 6px;
    background-color: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.dpl-progress-fill {
    height: 100%;
    background-color: #007bff;
    transition: width 0.3s ease, background-color 0.3s ease;
}

/* Form Container */
.dpl-form-container {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background-color: #fff;
    border-bottom: 1px solid #e7eaf0;
    align-items: center;
    flex-wrap: wrap;
}

.dpl-add-todo-form {
    display: flex;
    gap: 6px;
    flex: 1;
    min-width: 200px;
}

.dpl-todo-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.9em;
    transition: border-color 0.2s ease;
}

.dpl-todo-input:focus {
    outline: none;
    border-color: #007bff;
}

.dpl-add-todo-btn {
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.dpl-add-todo-btn:hover {
    background-color: #0056b3;
}

.dpl-selection-mode-btn {
    padding: 8px 12px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    color: #495057;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.dpl-selection-mode-btn:hover {
    background-color: #e9ecef;
}

.dpl-selection-actions {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-top: 8px;
}

.dpl-group-selected-btn {
    flex: 1;
    padding: 8px 12px;
    background-color: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
}

.dpl-clear-selection-btn {
    padding: 8px 12px;
    background-color: #6c757d;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
}

/* Todos Container */
.dpl-todos-container {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Todo List */
.dpl-todo-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dpl-ungrouped-todos {
    padding-bottom: 8px;
    border-bottom: 1px dashed #e7eaf0;
}

/* Todo Item */
.dpl-todo-item {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 10px 14px;
    background-color: #fff;
    border: 1px solid #e7eaf0;
    border-radius: 10px;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
}

.dpl-todo-item:hover {
    background-color: #fbfcfe;
    border-color: #dbe3ee;
}

.dpl-todo-item.dpl-todo-selected {
    background-color: #e7f3ff;
    border-color: #007bff;
}

.dpl-todo-assign-btn {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    border: 1px solid #dde5ef;
    border-radius: 9px;
    background-color: #f5f7fb;
    color: #5b6b82;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.dpl-todo-assign-btn:hover {
    background-color: #eef4fb;
    border-color: #c7d6ea;
    color: #365c8d;
    transform: translateY(-1px);
}

.dpl-todo-leading-spacer {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    margin-right: 12px;
}

.dpl-todo-assigned-badge {
    flex-shrink: 0;
    min-width: 30px;
    height: 30px;
    padding: 0 10px;
    margin-right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background-color: #f3f6fa;
    color: #667085;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.01em;
}

.dpl-todo-text {
    flex: 1;
    font-size: 0.9em;
    color: #344054;
    line-height: 1.45;
    word-break: break-word;
}

.dpl-todo-completed .dpl-todo-text {
    text-decoration: line-through;
    color: #999;
}

.dpl-todo-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

.dpl-todo-item:hover .dpl-todo-actions {
    opacity: 1;
    visibility: visible;
}

.dpl-edit-btn,
.dpl-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    font-size: 0.9em;
    color: #6c757d;
    transition: color 0.2s ease;
}

.dpl-edit-btn:hover {
    color: #007bff;
}

.dpl-delete-btn:hover {
    color: #dc3545;
}

.dpl-todo-edit-input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #007bff;
    border-radius: 3px;
    font-size: 0.9em;
}

/* Todo Group */
.dpl-todo-group {
    background-color: #fff;
    border: 1px solid #e7eaf0;
    border-radius: 6px;
    overflow: hidden;
    -webkit-user-drag: auto;
    user-select: none;
}

.dpl-group-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
    -webkit-user-drag: auto;
    transition: background-color 0.15s ease;
}

.dpl-group-header:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.dpl-collapse-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    margin-right: 8px;
    font-size: 0.7em;
    color: #666;
    transition: transform 0.2s ease;
}

.dpl-group-collapsed .dpl-collapse-btn {
    transform: rotate(-90deg);
}

.dpl-group-name {
    flex: 1;
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.95em;
}

.dpl-group-count {
    font-size: 0.8em;
    color: #666;
    margin-right: 8px;
    padding: 2px 6px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.dpl-delete-group-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 1em;
    padding: 2px 6px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.dpl-group-header:hover .dpl-delete-group-btn {
    opacity: 1;
    visibility: visible;
}

.dpl-delete-group-btn:hover {
    color: #dc3545;
}

.dpl-group-todos {
    padding: 0 12px;
    max-height: 300px;
    overflow-y: auto;
    transition: max-height 0.3s ease;
}

.dpl-group-collapsed .dpl-group-todos {
    max-height: 0;
    overflow: hidden;
}

.dpl-group-add-btn {
    display: block;
    margin: 8px 0;
    padding: 6px 12px;
    font-size: 0.85em;
    color: #555;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.dpl-group-add-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.dpl-add-group-btn {
    display: block;
    margin: 12px;
    padding: 10px 12px;
    font-size: 0.9em;
    color: #555;
    background-color: #f0f2f5;
    border: 1px dashed #ccc;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.dpl-add-group-btn:hover {
    background-color: #e4e9ed;
    border-color: #999;
}

/* Drag handle for group reordering */
.dpl-group-drag-handle {
    color: #999;
    font-size: 0.8em;
    margin-right: 8px;
    cursor: move;
    user-select: none;
    pointer-events: auto;
    -webkit-user-drag: auto;
}

.dpl-group-drag-handle:active {
    cursor: move;
}

/* Dragging group state */
.dpl-todo-group.dpl-dragging-group {
    opacity: 0.5;
}

/* Group drop placeholder */
.dpl-group-drop-placeholder {
    background-color: rgba(0, 122, 255, 0.1);
    border: 2px dashed #007bff;
    border-radius: 8px;
    margin: 8px 0;
    pointer-events: none;
}

/* Group drag over highlight */
.dpl-todo-group-drag-over {
    background-color: rgba(0, 122, 255, 0.05);
}

/* Todo Modal */
.dv-todo-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    backdrop-filter: blur(3px);
    animation: dv-fadeIn 0.2s ease-out;
}

.dv-todo-modal {
    background-color: #fff;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    animation: dv-slideIn 0.25s ease-out;
    overflow: hidden;
}

.dv-todo-modal-header {
    background-color: #1a2533;
    color: white;
    padding: 15px 20px;
    font-size: 1.1em;
    font-weight: 600;
    text-align: left;
}

.dv-todo-modal-header h3 {
    margin: 0;
}

.dv-todo-modal-body {
    padding: 20px;
}

.dv-todo-modal-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.dv-todo-modal-row:last-child {
    margin-bottom: 0;
}

.dv-todo-modal-label {
    width: 90px;
    font-weight: 500;
    color: #333;
    flex-shrink: 0;
}

.dv-todo-modal-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    transition: border-color 0.2s ease;
}

.dv-todo-modal-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.dv-todo-modal-input.dv-input-error {
    border-color: #e74c3c;
    background-color: #fff5f5;
}

.dv-try-todo-modal-overlay .dv-todo-modal-input {
    border: none;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
}

.dv-todo-modal-time-input {
    width: 80px;
}

.dv-todo-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.dv-todo-modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.dv-todo-modal-cancel-btn {
    background-color: #f0f0f0;
    color: #333;
}

.dv-todo-modal-cancel-btn:hover {
    background-color: #e0e0e0;
}

.dv-todo-modal-save-btn {
    background: linear-gradient(135deg, #2C3E50 0%, #34495e 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dv-todo-modal-save-btn:hover {
    background: linear-gradient(135deg, #34495e 0%, #2C3E50 100%);
}

.dv-todo-modal-save-btn:disabled {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    cursor: not-allowed;
    opacity: 0.6;
}
@media (max-width: 900px) {
  .dv-diary-score-header {
    flex-direction: column;
    align-items: stretch;
  }
  .dv-diary-score-scale {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
.dv-timeline-point-reward {
  position: fixed;
  z-index: 10020;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transform: translate(-50%, -10px);
  pointer-events: none;
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(22, 101, 52, 0.2);
  animation: dvTimelinePointReward 1250ms ease-out forwards;
}

.dv-timeline-point-reward__icon {
  color: #eab308;
  font-size: 10px;
}

@keyframes dvTimelinePointReward {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.8); }
  20% { opacity: 1; transform: translate(-50%, -8px) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -34px) scale(1); }
}
