@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* 🌟 테마 색상 변수 (기본 쌩얼: 민트 테마) */
:root {
    /* 배경색 */
    --bg-main: #F4F7F6;         /* 전체 배경 */
    --bg-header: #FFFFFF;       /* 상단 헤더 배경 */
    --bg-card: #FFFFFF;         /* 과목 카드, 모달, 입력창 컨테이너 배경 */
    --bg-task: #FAFDFD;         /* 세부 작업 목록, 테이블 헤더 등 보조 배경 */
    --bg-input: #FFFFFF;        /* 인풋, 셀렉트 박스 배경 */
    --bg-table-th: #FAFDFD;     /* 테이블 상단 헤더 배경 */
    --bg-progress-empty: #E8F0ED; /* 게이지바 빈 공간 배경 */
    --bg-hover: rgba(0, 0, 0, 0.03); /* 클릭/마우스오버 시 미세한 배경 변화 */
    --bg-modal-overlay: rgba(0, 0, 0, 0.6); /* 모달 떴을 때 뒤에 깔리는 어두운 막 */
    
    /* 텍스트 & 테두리 */
    --text-main: #333333;       /* 기본 텍스트, 제목 */
    --text-sub: #889993;        /* 날짜, 보조 텍스트, 테이블 헤더 글자 */
    --text-muted: #666666;      /* 아주 연한 메타 텍스트 */
    --text-time: #555555;       /* 타이머 등 진한 보조 텍스트 */
    --text-time-total: #5EBA9E; /* 상단 총 공부시간 텍스트 */
    --border-light: #E8F0ED;    /* 전체적인 테두리 선 */
    
    /* 포인트 색상 (민트) */
    --point-main: #7BC5AE;      /* 주 버튼, 진행바, 활성 탭 */
    --point-hover: #5EBA9E;     /* 버튼 마우스 오버 색상 */
    --icon-color: #A4B3AE;      /* 아이콘 기본 색상 */
    --btn-logout-bg: #FFF0F0;   /* 로그아웃 버튼 배경 */
    --btn-logout-text: #E57373; /* 로그아웃 버튼 텍스트 */
    
    /* 상태 표시 색상 */
    --state-0: #DCE6E3;         /* 빈 상태 (회색) */
    --state-1: #7BC5AE;         /* 성공 (민트) */
    --state-2: #FFCC80;         /* 보통 (주황/노랑) */
    --state-3: #E57373;         /* 미흡 (빨강) */
    
    /* 동그라미 버튼 전용 색상 */
    --circle-border: #DCE6E3;
    --circle-bg-2: #FAFDFD;
    
    /* 그림자 및 입체감 */
    --shadow-card: 0 4px 12px rgba(0,0,0,0.03);
    --shadow-modal: 0 8px 30px rgba(0,0,0,0.08);
}

/* =========================================
   기본 세팅 및 뼈대
   ========================================= */
* { box-sizing: border-box; }
html, body { max-width: 100vw; overflow-x: hidden; }
body { font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; margin: 0; background-color: var(--bg-main); color: var(--text-main); transition: background-color 0.3s, color 0.3s; }

/* 공통 입력 폼 스타일 */
input, select, button { font-family: inherit; }
input, select { background: var(--bg-input); border: 1px solid var(--border-light); color: var(--text-main); border-radius: 10px; transition: 0.2s; }
input:focus, select:focus { border: 1px solid var(--point-main); outline: none; }
select {
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23889993'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center; background-size: 20px;
    padding-right: 35px !important;
}

/* =========================================
   상단 헤더 영역
   ========================================= */
#header-login-btn {
    background: var(--point-main); color: white; border: none; padding: 8px 16px; 
    font-size: 14px; border-radius: 6px; font-weight: bold; cursor: pointer; transition: 0.2s;
}
#header-login-btn:hover { background: var(--point-hover); }

#header-section { position: sticky; top: 0; background-color: var(--bg-header); z-index: 100; border-bottom: 1px solid var(--border-light); transition: 0.3s; }
.header-content { display: flex; justify-content: space-between; align-items: center; padding: 15px 25px; background: var(--bg-header); transition: 0.3s; gap: 15px; }
.header-left { display: flex; flex-direction: column; gap: 5px; flex-shrink: 1; min-width: 0; }
#date-display { font-size: 16px; font-weight: bold; color: var(--text-sub); white-space: nowrap; }
#today-total-time { font-size: 20px; font-weight: bold; color: var(--text-time-total); font-variant-numeric: tabular-nums; white-space: nowrap; }

.header-right { display: flex; align-items: center; gap: 15px; flex-shrink: 0; }.auth-buttons-row { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.header-right button { padding: 10px 16px; border-radius: 8px; border: none; font-weight: bold; font-size: 14px; cursor: pointer; transition: 0.2s; }
.user-name-box { font-weight: bold; font-size: 15px; margin: 0 5px; color: var(--text-main); }
#settings-btn { background: var(--bg-card); color: var(--text-sub); border: 1px solid var(--border-light); display: inline-block; }
#settings-btn:hover { border-color: var(--point-main); color: var(--point-main); }
#switch-account-btn { background: var(--bg-card); color: var(--point-main); border: 1px solid var(--point-main); display: inline-block; }
#logout-btn { background: var(--btn-logout-bg); color: var(--btn-logout-text); display: inline-block; }

/* 탭 버튼 */
.app-tabs { display: flex; width: 100%; }
.tab-btn { flex: 1; padding: 15px 0; background: var(--bg-header); color: var(--text-sub); border: none; font-size: 16px; font-weight: bold; cursor: pointer; border-bottom: 3px solid transparent; transition: 0.2s; border-radius: 0; }
.tab-btn:hover { background: var(--bg-hover); color: var(--text-main); }
.tab-btn.active { color: var(--text-main); border-bottom-color: var(--point-main); background: transparent; }

/* 메인 타이머 */
#timer-container { padding: 25px; text-align: center; background: transparent; }
#time-display { font-size: 65px; font-weight: bold; margin: 0; line-height: 1; font-variant-numeric: tabular-nums; color: var(--text-time); }
#active-task-info { color: var(--text-sub); margin-top: 10px; font-size: 15px; }

/* =========================================
   메인 컨텐츠 레이아웃
   ========================================= */
.main-content { padding: 20px 15px; max-width: 800px; margin: 0 auto; padding-bottom: 100px; }
.break-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-sub);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}
.break-btn:hover {
    background: rgba(0,0,0,0.05);
    color: var(--text-main);
}
#plan-tab, #execution-tab { max-width: 100% !important; padding-bottom: 100px; }

/* 빠른 추가 박스 */
.study-add-box { max-width: 500px; margin: 0 auto 30px auto; }
.quick-add-container { background: var(--bg-card); padding: 20px; border-radius: 16px; border: 1px solid var(--border-light); box-shadow: var(--shadow-card); transition: 0.3s; }
.qa-grid-container { display: flex; gap: 15px; margin-top: 5px; }
.qa-left-col, .qa-right-col { flex: 1; display: flex; flex-direction: column; }

.action-btn { 
    background: transparent; 
    color: var(--point-main); 
    border: 1px solid var(--point-main); 
    padding: 8px 16px; 
    border-radius: 8px; 
    font-weight: bold; 
    cursor: pointer; 
    font-size: 14px; 
    transition: 0.2s; 
    white-space: nowrap;
}
.action-btn:hover { 
    background: rgba(123, 197, 174, 0.1); 
}

/* 상단 컨트롤 버튼들 */
#gear-btn { background: var(--bg-card); border: 1px solid var(--border-light); color: var(--text-main); border-radius: 10px; padding: 0 15px; cursor: pointer; font-size: 16px; transition: 0.2s; }
#gear-btn:hover { border: 1px solid var(--point-main); }
#qa-btn { background: var(--point-main); color: #fff; border: none; border-radius: 10px; font-weight: bold; }
.add-subj-btn { background: var(--bg-card); border: 1px solid var(--point-main); color: var(--point-main); border-radius: 8px; padding: 5px 0; width: 75px; text-align: center; cursor: pointer; font-size: 12px; font-weight: bold; }
.add-subj-btn:hover { background: var(--bg-task); color: var(--point-hover); }

/* =========================================
   실행실 (Execution Room) 카드
   ========================================= */
.subject-card { background: var(--bg-card); border-radius: 16px; margin-bottom: 25px; padding: 20px; border: 1px solid var(--border-light); box-shadow: var(--shadow-card); transition: 0.3s; }
.subject-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 1px solid var(--border-light); padding-bottom: 10px; }
.subject-title { font-size: 20px; font-weight: bold; color: var(--text-main); cursor: pointer; }
.subject-controls { display: flex; gap: 8px; }
.view-mode-select { background: var(--bg-input); color: var(--text-main); border: 1px solid var(--border-light); padding: 6px 10px; border-radius: 10px; font-size: 13px; }

.task-container { background: var(--bg-task); border-radius: 12px; padding: 15px; margin-bottom: 15px; border: 1px solid var(--border-light); transition: 0.3s; }
.task-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.task-title-group { display: flex; align-items: center; cursor: pointer; flex-wrap: wrap; gap: 8px; }
.task-title { font-size: 17px; font-weight: bold; color: var(--text-main); margin-left: 5px; }
.task-meta { font-size: 15px; color: var(--text-muted); font-weight: bold; margin-left: 8px; }
.task-controls { display: flex; gap: 6px; }
.session-btn { background: var(--point-main); color: #fff; }

.icon-btn { background: transparent; border: none; cursor: pointer; font-size: 18px; padding: 2px 5px; transition: 0.2s; color: var(--icon-color); }
.icon-btn:hover { color: var(--point-hover); transform: scale(1.1); }

/* 실행실 테이블 */
table { width: 100%; border-collapse: collapse; background: transparent; border-radius: 6px; min-width: 100%; transition: 0.3s; border: none; }
th, td { padding: 12px 8px; text-align: center; font-size: 15px; white-space: nowrap; transition: 0.3s; }
th { background: var(--bg-table-th); color: var(--text-sub); border: none; border-bottom: 1px solid var(--border-light); font-weight: bold; }
td { border-bottom: 1px solid var(--border-light); }
.total-row { background: var(--bg-table-th); font-weight: bold; color: var(--text-main); border-top: 2px solid var(--border-light); }
.subject-highlight { color: var(--point-hover); }

/* 진행 상태 동그라미 버튼 */
.circle-btn { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--circle-border); background: transparent; cursor: pointer; margin: 0 auto; position: relative; transition: 0.3s; }
.circle-btn.state-1 { background: var(--state-1); border-color: var(--state-1); }


.circle-btn.state-2 { background: var(--state-2); border-color: var(--state-2); }
.circle-btn.state-2::after { content: ''; }

.circle-btn.state-3 { background: transparent; border-color: var(--border-light); }
.circle-btn.state-3::after { content: '✕'; color: var(--text-sub); position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 14px; }
.circle-btn.state-4 { border-color: var(--circle-border); }
.circle-btn.state-4::after { content: '⏸'; color: var(--text-sub); position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 12px; }

/* =========================================
   모달 (Modal) 팝업
   ========================================= */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-modal-overlay); z-index: 2000; justify-content: center; align-items: center; }
.modal-content { background: var(--bg-card); padding: 25px; border-radius: 20px; width: 90%; max-width: 400px; box-sizing: border-box; transition: 0.3s; box-shadow: var(--shadow-modal); color: var(--text-main); border: 1px solid var(--border-light); }
.modal-content h3 { color: var(--text-main); }
.modal-content p { color: var(--text-sub); }

.modal-btn { display: block; width: 100%; padding: 14px; margin-bottom: 10px; border: 1px solid var(--border-light); border-radius: 10px; font-size: 15px; font-weight: bold; cursor: pointer; color: var(--text-time); background: var(--bg-task); text-align: left; transition: 0.3s; }
.modal-save-btn { width: 100%; padding: 12px; margin-top: 10px; background: var(--point-main); color: #fff; border: none; border-radius: 8px; font-size: 15px; font-weight: bold; cursor: pointer; transition: 0.2s; } 
.modal-save-btn:hover { background: var(--point-hover); }

.edit-session-row { display: flex; align-items: center; gap: 5px; margin-bottom: 8px; background: var(--bg-task); padding: 10px; border-radius: 6px; border: 1px solid var(--border-light); color: var(--text-main); }
.edit-session-row input[type="time"] { background: var(--bg-input); color: var(--text-time); border: 1px solid var(--border-light); padding: 5px; border-radius: 4px; font-size: 14px; }

/* =========================================
   🌟 계획실 (Plan Room) 칸반 보드형 3단 레이아웃
   ========================================= */
.plan-wrapper { width: 100%; max-width: 1600px; margin: 0 auto; padding: 0 15px; transition: 0.3s; }
.plan-main-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; width: 100%; }
.plan-board-title { color: var(--text-main); }
.add-book-btn { background: var(--bg-card); color: var(--point-main); border: 1px solid var(--point-main); padding: 8px 15px; border-radius: 8px; font-weight: bold; cursor: pointer; transition: 0.2s; }
.add-book-btn:hover { background: var(--bg-task); color: var(--point-hover); }
.add-row-btn { background: var(--bg-card); border: 1px solid var(--point-main); color: var(--point-main); padding: 8px 15px; border-radius: 8px; cursor: pointer; width: 100%; font-weight: bold; transition: 0.2s; white-space: nowrap; }
.add-row-btn:hover { background: var(--bg-task); color: var(--point-hover); }

.plan-main-header-actions { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 5px; flex-wrap: nowrap; }

.plan-columns-wrapper { display: flex; gap: 20px; width: 100%; align-items: stretch; flex-wrap: wrap; }
.plan-column { flex: 1; min-width: min(100%, 480px); display: flex; flex-direction: column; gap: 20px; min-height: 100px; border-radius: 8px; padding-bottom: 80px; }

.plan-columns-wrapper.list-view { flex-direction: row; justify-content: center; max-width: 1000px; margin: 0 auto; }
.plan-columns-wrapper.list-view .plan-column { flex: 1; min-width: min(100%, 480px); max-width: 480px; }

.plan-card { 
    background: var(--bg-card); border-radius: 16px; margin-bottom: 0px; 
    border: 1px solid var(--border-light); box-shadow: var(--shadow-card); overflow: hidden; 
    transition: 0.3s; width: 100%; 
}
.plan-card.sortable-ghost { opacity: 0.4; border: 2px dashed var(--point-main); background: var(--bg-task); } 

.plan-header { padding: 15px 20px; background: var(--bg-header); display: flex; justify-content: space-between; align-items: center; cursor: grab; transition: 0.3s; border-bottom: 1px solid var(--border-light); }
.plan-header:active { cursor: grabbing; }

.plan-title-area { display: flex; align-items: center; gap: 10px; flex: 1; pointer-events: auto; }
.plan-subj-input { background: transparent; border: none; font-weight: bold; color: var(--text-main); font-size: 20px; outline: none; transition: 0.2s; width: 100px; padding: 0; pointer-events: auto; box-shadow: none; }
.plan-subj-input:focus { border-bottom: 1px solid var(--text-main); }

.plan-book-input { 
    background: transparent; border: none; color: var(--text-muted); font-size: 14px; font-weight: bold; 
    outline: none; width: 100px; margin-left: 5px; transition: 0.2s; box-shadow: none;
}
.plan-book-input:focus { border-bottom: 1px solid var(--text-muted); color: var(--text-main); }

.plan-input-group { display: flex; align-items: center; gap: 10px; }

.progress-container { 
    flex-shrink: 0; width: 130px; height: 16px; 
    background: var(--bg-progress-empty); border-radius: 10px; overflow: hidden; border: none; 
    display: flex; align-items: center; position: relative; 
    margin-left: auto; margin-right: 15px; pointer-events: auto; 
}
.progress-fill { height: 100%; background: var(--point-main); border-radius: 10px; transition: width 0.3s ease; }
.progress-text { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--text-main); font-weight: bold; text-shadow: 1px 1px 2px #fff, -1px -1px 2px #fff; z-index: 2; }

.plan-controls { display: flex; gap: 5px; align-items: center; pointer-events: auto; margin-right: 20px; }
.plan-body { padding: 15px; display: none; }

.plan-table { width: 100% !important; min-width: 100% !important; background: transparent; table-layout: fixed; border: none; }
.plan-table th { background: var(--bg-table-th); font-size: 13px; padding: 10px 5px; color: var(--text-sub); text-align: center; border-bottom: 1px solid var(--border-light); font-weight: bold; }
.plan-table td { border-bottom: 1px solid var(--border-light); padding: 8px 5px; text-align: center; }

.col-handle { width: 35px; }
.col-name { width: auto; } 
.col-state { width: 14%; min-width: 45px; } 
.col-delete { width: 45px; } 

.drag-handle { cursor: grab; color: var(--text-muted); font-size: 18px; font-weight: bold; padding: 5px; }
.drag-handle:active { cursor: grabbing; color: var(--point-main); }
.row-name-input { width: 100%; background: transparent; border: none; color: var(--text-main); font-size: 14px; outline: none; transition: 0.3s; text-align: left; border-bottom: 1px solid transparent; }
.row-name-input:focus { border-bottom: 1px solid var(--point-main); }

.state-cell { cursor: pointer; user-select: none; font-size: 16px; text-align: center; position: relative; transition: 0.2s; }
.state-cell:hover { background: var(--bg-hover); }
.state-icon { display: inline-block; transition: 0.3s; opacity: 1; filter: none; }
.state-0 { color: var(--state-0); }
.state-1 { color: var(--state-1); }
.state-2 { color: var(--state-2); }
.state-3 { color: var(--state-3); }
.memo-icon { position: absolute; top: 0px; right: 2px; font-size: 10px; }
.time-input { width: 65px; }

/* =========================================
   내 과목 관리 리스트
   ========================================= */
.subject-manage-item { display: flex; justify-content: space-between; align-items: center; padding: 10px; margin-bottom: 5px; border-radius: 6px; transition: 0.2s; background: var(--bg-task); border: 1px solid var(--border-light); }
.subject-manage-name { color: var(--text-main); font-weight: bold; }

/* =========================================
   📱 모바일 반응형
   ========================================= */
@media (max-width: 600px) {
    .header-content { display: grid; grid-template-columns: max-content 1fr; grid-gap: 8px; align-items: center; padding: 12px 15px 10px; }
    .header-left, .header-right { display: contents; }
    
    #date-display { grid-column: 1; grid-row: 1; font-size: 13px; margin: 0; }
    #header-login-btn, #user-info-area { grid-column: 2; grid-row: 1; justify-self: end; width: 100%; justify-content: flex-end; }
    
    .header-study-summary { grid-column: 1 / -1; grid-row: 2; }
    
    .user-name-box { margin: 0; padding: 0; font-size: 13px; font-weight: bold; white-space: nowrap; }
    .auth-buttons-row { display: flex; flex-direction: row; align-items: center; gap: 8px; justify-content: flex-end; flex-wrap: wrap; width: auto; }
    
    #today-total-time { font-size: 15px; }
    .break-btn { font-size: 11px; padding: 4px 8px; }
    #adhoc-study-toggle-btn { font-size: 11px; padding: 4px 8px; }
    #settings-btn, #switch-account-btn, #logout-btn {
        padding: 6px 8px; min-height: 36px; font-size: 12px; margin: 0;
    }

    #timer-container { padding: 15px 10px; }
    #time-display { font-size: 50px; }

    .qa-grid-container { flex-direction: column; gap: 10px; }

.subject-header-row { flex-direction: row; align-items: center; gap: 5px; flex-wrap: nowrap; }
    .subject-controls { width: auto; justify-content: flex-end; flex-shrink: 0; }
    .task-header { flex-direction: row; align-items: center; gap: 5px; flex-wrap: nowrap; }
    .task-controls { width: auto; justify-content: flex-end; flex-shrink: 0; }
    
    .subject-card { padding: 15px 8px !important; }
    .task-container { padding: 10px 5px !important; }
    table { min-width: 100%; }
    th, td { padding: 8px 4px !important; font-size: 13px !important; white-space: normal !important; word-break: keep-all; }
.task-container th:nth-child(4), 
    .task-container td:nth-child(4) { 
        padding-left: 25px !important; 
    }

.subject-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .task-title-group { flex: 1; min-width: 0; flex-wrap: nowrap; }
    .task-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    .time-input { width: 100% !important; }

    .plan-wrapper { width: 100%; min-width: 0; }
    .plan-main-header { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;}
    .plan-board-title { font-size: 15px; }
    .add-book-btn { font-size: 12px; padding: 6px 10px !important; }

    .plan-header { 
        display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto;   
        row-gap: 12px; align-items: center; padding: 15px; 
    }
    
    .plan-title-area { display: contents; }
    .plan-input-group {
        grid-column: 1 / 2; grid-row: 1 / 2; display: flex; align-items: center; gap: 8px; width: 100%;
        min-width: 0;
    }
    
    .plan-subj-input { 
        flex: 1; min-width: 0; width: 100%; margin: 0; 
        text-overflow: ellipsis; 
        white-space: nowrap;
    }
    
    .plan-book-input { 
        display: block; width: 80px; flex-shrink: 0; margin: 0; 
        text-overflow: ellipsis; 
        white-space: nowrap;
    }
    
    .plan-controls { grid-column: 2 / 3; grid-row: 1 / 2; margin: 0; width: auto; display: flex; justify-content: flex-end; gap: 8px; }
    .progress-container { grid-column: 1 / 3; grid-row: 2 / 3; width: 100%; max-width: 100%; margin: 0; }

    .plan-table { width: 100% !important; }
    .plan-table th, .plan-table td { padding: 4px 2px !important; font-size: 11px !important; word-break: keep-all; }
    .col-name { width: auto; } 
    .col-state { width: 14%; } 
    .col-delete { width: 30px; }
    .state-cell { font-size: 12px; }
    .memo-icon { font-size: 9px; right: 0px; }
    .row-name-input { font-size: 11px; padding: 2px; }
    .col-handle { width: 25px; } 
    .drag-handle { font-size: 14px; padding: 2px; } 
    .plan-header, .plan-header:active { cursor: default; }

    .plan-column { padding-bottom: 0 !important; gap: 15px !important; }
    .plan-columns-wrapper { gap: 15px !important; }
    .plan-column { min-height: 0 !important; }
    .plan-column:empty { display: none !important; }
}

/* =========================================
   🏃 실행 탭 연동 런너 아이콘 (PC / 모바일 반응형)
   ========================================= */
.runner-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(10px, 4px); 
    font-size: 12px; 
    filter: drop-shadow(1px 1px 1px rgba(255,255,255,0.8));
    pointer-events: none; 
    z-index: 2;
}

@media (max-width: 600px) {
    .runner-icon {
        top: auto;      
        left: auto;     
        transform: none;
        bottom: 2px;    
        right: 2px;     
        font-size: 12px;
    }
}

/* =========================================
   🍞 토스트 알림 (Toast Notification)
   ========================================= */
.custom-toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: var(--point-main);
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 9999;
    white-space: nowrap;
}

.custom-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

/* =========================================
   ✏️ 세부 설정 편집 모달 카드 스타일
   ========================================= */
.edit-step-card {
    background: var(--bg-task);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
}
.edit-step-card:focus-within {
    border-color: var(--point-main);
    box-shadow: 0 0 0 2px rgba(123, 197, 174, 0.1);
}
.edit-step-category {
    font-weight: bold;
    color: var(--text-main);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.edit-step-time-inputs {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    font-size: 13px;
}
.edit-step-time-inputs input {
    width: 45px;
    padding: 8px;
    text-align: center;
    border-radius: 8px;
    font-size: 14px;
    border: 1px solid var(--border-light);
    background: var(--bg-input);
}
.edit-step-time-inputs input:focus {
    border-color: var(--point-main);
}

#global-highlight-palette {
    position: fixed;
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
    background: var(--bg-card);
    padding: 20px 12px;
    border-radius: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 3000;
    border: 1px solid var(--border-light);
}

.palette-divider {
    width: 20px;
    height: 1px;
    background: var(--border-light);
    margin: 5px 0;
}

.palette-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.palette-btn:hover {
    transform: scale(1.15);
}

.palette-btn.selected {
    box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--point-main);
}

.palette-done-btn {
    background: var(--point-main);
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 5px;
    transition: 0.2s;
}

.palette-done-btn:hover {
    background: var(--point-hover);
}

body.highlight-active .row-name-input,
body.highlight-active .state-cell {
    pointer-events: none;
}


.plan-divider-row td {
    padding: 0 !important;
    height: 35px;
    border: none !important;
}
.plan-divider-row .drag-handle {
    opacity: 0;
    transition: 0.2s;
}
.plan-divider-row:hover .drag-handle {
    opacity: 1;
}

.divider-input-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.divider-text-input {
    width: 90%;
    background: transparent;
    border: none;
    text-align: center;
    color: var(--text-main);
    outline: none;
    transition: 0.2s;
    padding: 5px;
}

.divider-text-input:focus {
    border-bottom: 1px solid var(--point-main);
}

.divider-controls {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 4px 8px;
    display: flex;
    gap: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transition: 0.2s;
    z-index: 10;
}

.divider-input-wrapper.focused .divider-controls {
    opacity: 1;
    visibility: visible;
    top: -40px;
}

.divider-controls button {
    background: var(--bg-task);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
    color: var(--text-main);
    font-weight: bold;
    transition: 0.2s;
}

.divider-controls button:hover {
    background: var(--point-main);
    color: #fff;
}

/* ==========================================
   실행 리스트 세련된 드래그 앤 드롭 고스트
   ========================================== */
.task-sortable-ghost {
    background: var(--bg-card) !important;
    border: 2px solid var(--point-main) !important;
    opacity: 0.9 !important;
    transform: scale(0.98);
    border-radius: 12px;
    height: 50px !important;
    overflow: hidden;
    position: relative;
    box-shadow: 0 15px 30px rgba(123, 197, 174, 0.2) !important;
}
.task-sortable-ghost * {
    visibility: hidden;
}
.task-sortable-ghost::after {
    content: '이동 중...';
    visibility: visible;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    color: var(--point-main);
    font-size: 14px;
}




/* 루틴 탭 hover 시에만 UI 노출 */
.routine-group-header .routine-drag-handle,
.routine-group-header .routine-delete-btn {
    opacity: 0 !important;
    transition: opacity 0.2s;
}
.routine-group-header:hover .routine-drag-handle,
.routine-group-header:hover .routine-delete-btn,
.routine-group-header:focus-within .routine-drag-handle,
.routine-group-header:focus-within .routine-delete-btn {
    opacity: 1 !important;
}

.routine-item-row .routine-drag-handle,
.routine-item-row .routine-delete-btn {
    opacity: 0 !important;
    transition: opacity 0.2s;
}
.routine-item-row:hover .routine-drag-handle,
.routine-item-row:hover .routine-delete-btn,
.routine-item-row:focus-within .routine-drag-handle, 
.routine-item-row:focus-within .routine-delete-btn {
    opacity: 1 !important;
}

/* 편집 모드(토글됨) 시 항상 노출 */
body.routine-edit-mode .routine-group-header .routine-drag-handle,
body.routine-edit-mode .routine-group-header .routine-delete-btn,
body.routine-edit-mode .routine-item-row .routine-drag-handle,
body.routine-edit-mode .routine-item-row .routine-delete-btn {
    opacity: 1 !important;
}

/* 루틴 필터링/추가/수정 UI 관련 스타일 */
.routine-day-filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--text-sub);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s;
}
.routine-day-filter-btn:hover { background: var(--bg-hover); }
.routine-day-filter-btn.active {
    background: rgba(123, 197, 174, 0.15);
    color: var(--point-main);
    border-color: var(--point-main);
}
.routine-day-toggle {
    flex: 1;
    background: var(--bg-task);
    border: 1px solid var(--border-light);
    color: var(--text-sub);
    padding: 10px 0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    transition: 0.2s;
}
.routine-day-toggle.active {
    background: rgba(123, 197, 174, 0.15);
    color: var(--point-main);
    border-color: var(--point-main);
}

/* ==========================================
   📅 주간 미니 캘린더 바 (마이루틴 스타일)
   ========================================== */
.routine-week-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    gap: 2px;
}
.routine-week-day-cell {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-user-select: none;
    user-select: none;
}
.routine-week-day-cell:hover { background: var(--bg-hover); }
.routine-week-day-cell.selected { background: rgba(123, 197, 174, 0.15); border: 1px solid var(--point-main); margin: -1px; }
.routine-week-day-cell .day-name { font-size: 12px; font-weight: 700; color: var(--text-sub); line-height: 1; }
.routine-week-day-cell.selected .day-name { color: var(--point-main); }
.routine-week-day-cell .day-number {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 800; color: var(--text-main);
    transition: all 0.2s; line-height: 1;
}
.routine-week-day-cell.selected .day-number { color: var(--point-main); }
.routine-week-day-cell.is-today .day-number {
    background: var(--point-main); color: #fff;
    box-shadow: 0 2px 8px rgba(123, 197, 174, 0.4);
}
.routine-week-day-cell.selected.is-today .day-number { background: var(--point-main); color: #fff; box-shadow: 0 2px 8px rgba(123, 197, 174, 0.4); }
.routine-week-day-cell .day-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: transparent; transition: all 0.2s;
}
.routine-week-day-cell .day-dot.done { background: var(--state-1); }
.routine-week-day-cell .day-dot.partial { background: var(--state-2); }
.routine-week-day-cell .day-dot.none { background: var(--state-0); }
.routine-week-day-cell.selected .day-dot.done { background: var(--state-1); }
.routine-week-day-cell.selected .day-dot.partial { background: var(--state-2); }

/* 📊 오늘 달성률 프로그레스 바 */
.routine-progress-wrapper {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px; background: var(--bg-card);
    border-radius: 14px; border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card); margin-bottom: 15px;
    width: 100%; max-width: 600px;
}
.routine-progress-info { display: flex; flex-direction: column; gap: 2px; min-width: fit-content; }
.routine-progress-title { font-size: 13px; font-weight: 700; color: var(--text-sub); }
.routine-progress-count { font-size: 18px; font-weight: 800; color: var(--text-main); }
.routine-progress-count .done-count { color: var(--point-main); }
.routine-progress-track {
    flex: 1; height: 10px; background: var(--bg-progress-empty);
    border-radius: 10px; overflow: hidden;
}
.routine-progress-fill {
    height: 100%; border-radius: 10px;
    background: linear-gradient(90deg, var(--point-main), #5fb89b);
    transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.routine-progress-percent { font-size: 15px; font-weight: 800; color: var(--point-main); min-width: 45px; text-align: right; }

.active-connector {
    background-color: var(--point-main) !important;
    transform: scale(1.5);
    border: 2px solid white;
    box-shadow: 0 0 8px var(--point-main);
}

/* ==========================================
   루틴 시간 배지 (스마트 파싱)
   ========================================== */
.routine-name-display {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    cursor: text;
}

.routine-time-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(123, 197, 174, 0.1);
    color: var(--point-main);
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
    letter-spacing: -0.3px;
    border: 1px solid rgba(123, 197, 174, 0.15);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
    min-width: 90px;
    text-align: center;
}

.routine-text-content {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.routine-onetime-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(240, 151, 59, 0.1);
    color: #f0973b;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    white-space: nowrap;
    border: 1px solid rgba(240, 151, 59, 0.2);
    flex-shrink: 0;
    letter-spacing: -0.3px;
}

@media (max-width: 600px) {
    .routine-onetime-badge {
        font-size: 10px;
        padding: 1px 5px;
    }
}

/* 현재 시간 화살표 인디케이터 */
.routine-now-arrow {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-left: 2px;
    margin-right: -2px;
    background: #E53935;
    clip-path: polygon(0% 15%, 55% 15%, 55% 0%, 100% 50%, 55% 100%, 55% 85%, 0% 85%);
    animation: arrowPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 1px 4px rgba(229, 57, 53, 0.45));
}

.routine-now-arrow-placeholder {
    width: 16px;
    margin-left: 2px;
    margin-right: -2px;
    flex-shrink: 0;
}

@keyframes arrowPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

.routine-now-active {
    background: linear-gradient(90deg, rgba(229, 57, 53, 0.06) 0%, transparent 60%);
    border-radius: 10px;
    margin: 0 -10px;
    padding-left: 10px !important;
    padding-right: 10px !important;
    border-left: 3px solid rgba(229, 57, 53, 0.4);
}

.routine-name-input-hidden {
    display: none;
}

@media (max-width: 600px) {
    .routine-time-badge {
        font-size: 10px;
        padding: 1px 6px;
        min-width: 44px;
    }
    .routine-text-content {
        font-size: 14px;
    }
}

/* ==========================================
   🔄 루틴 탭 — 공통 구조 스타일
   ========================================== */
.routine-group-card {
    background: var(--bg-card);
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}
.routine-group-header {
    background: var(--bg-header);
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
    -webkit-user-select: none;
    user-select: none;
}
.routine-group-header:active { background: var(--bg-hover); }
.routine-group-title-input {
    background: transparent;
    border: none;
    font-weight: bold;
    font-size: 16px;
    color: var(--text-main);
    flex: 1;
    outline: none;
    min-width: 0;
    padding: 0;
    box-shadow: none;
}
.routine-item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    transition: background 0.15s;
    position: relative;
}
.routine-item-row:last-child { border-bottom: none; }
.routine-item-row:hover { background: rgba(0,0,0,0.015); }
.routine-name-area {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* ==========================================
   📱 루틴 모바일 전용 — 오늘 체크 중심 레이아웃
   ========================================== */

/* 모바일: 오늘 체크 큰 동그라미 */
.routine-today-check {
    display: none;
    align-items: center;
    flex-shrink: 0;
}
.routine-today-check .circle-btn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    transition: transform 0.15s;
    border-width: 2.5px;
}
.routine-today-check .circle-btn:active {
    transform: scale(0.88);
}

/* 모바일: 주간 확장 패널 */
.routine-week-expand {
    display: none;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.3s ease;
    background: var(--bg-task);
    border-radius: 12px;
    margin: 0 0 4px 24px;
    padding: 0 14px;
    border: 1px solid transparent;
}
.routine-week-expand.open {
    display: block;
    max-height: 80px;
    opacity: 1;
    padding: 10px 14px;
    border-color: var(--border-light);
}
.routine-week-expand-inner {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 2px;
}
.routine-week-expand-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}
.routine-week-expand-day .day-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-sub);
}
.routine-week-expand-day .day-label.is-today {
    color: var(--point-main);
}
.routine-week-expand-day .circle-btn {
    width: 26px;
    height: 26px;
    border-width: 2px;
}

/* 롱프레스 컨텍스트 메뉴 */
.routine-context-menu {
    position: fixed;
    z-index: 5000;
    background: var(--bg-card);
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.04);
    padding: 6px 0;
    min-width: 180px;
    display: none;
    animation: contextPop 0.15s ease-out;
    overflow: hidden;
}
.routine-context-menu.show { display: block; }
@keyframes contextPop {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}
.routine-context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.1s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}
.routine-context-menu-item:hover,
.routine-context-menu-item:active {
    background: var(--bg-hover);
}
.routine-context-menu-item.danger { color: #E53935; }
.routine-context-menu-separator {
    height: 1px;
    background: var(--border-light);
    margin: 4px 0;
}

/* 오늘 요약 카운터 */
.routine-today-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 12px 20px;
    background: var(--bg-card);
    border-radius: 14px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    margin-bottom: 15px;
    width: 100%;
    max-width: 600px;
}
.routine-summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.routine-summary-stat .stat-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
}
.routine-summary-stat .stat-label {
    font-size: 11px;
    color: var(--text-sub);
    font-weight: 600;
}
.routine-summary-divider {
    width: 1px;
    height: 30px;
    background: var(--border-light);
}

/* PC: 주간 동그라미 영역 (개선된 크기) */
.routine-week-header {
    display: flex;
    gap: 6px;
    width: 240px;
    justify-content: space-around;
    flex-shrink: 0;
}
.routine-week-header-cell {
    width: 30px;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    color: var(--text-sub);
}
.routine-week-header-cell.is-today {
    color: var(--point-main);
}
.routine-week-checks {
    display: flex;
    gap: 6px;
    width: 240px;
    justify-content: space-around;
    flex-shrink: 0;
}
.routine-week-checks .circle-btn {
    width: 30px;
    height: 30px;
    border-width: 2px;
    transition: transform 0.15s, box-shadow 0.15s;
}
.routine-week-checks .circle-btn:hover {
    transform: scale(1.15);
}
.routine-week-checks .circle-btn.is-today {
    box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--point-main);
}

/* 루틴 아이템 번호 */
.routine-row-number {
    width: 28px;
    text-align: center;
    font-size: 13px;
    color: var(--text-sub);
    font-weight: 600;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* 루틴 편집 액션 (PC hover 전용) */
.routine-edit-actions {
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}
.routine-item-row:hover .routine-edit-actions {
    opacity: 1;
}
body.routine-edit-mode .routine-edit-actions {
    opacity: 1 !important;
}

@media (max-width: 600px) {
    /* 모바일: 오늘 체크 표시, 주간 체크 숨김 */
    .routine-today-check { display: flex !important; }
    .routine-week-checks { display: none !important; }
    .routine-week-header { display: none !important; }
    .routine-edit-actions { display: none !important; }

    .routine-group-header .routine-drag-handle,
    .routine-group-header .routine-delete-btn {
        opacity: 0 !important;
    }
    body.routine-edit-mode .routine-group-header .routine-drag-handle,
    body.routine-edit-mode .routine-group-header .routine-delete-btn {
        opacity: 1 !important;
    }
    body.routine-edit-mode .routine-edit-actions {
        display: flex !important;
    }

    .routine-items-wrapper { padding: 2px 14px !important; }
    .routine-row-number { width: 24px; font-size: 12px; }

    .routine-week-day-cell .day-number { width: 28px; height: 28px; font-size: 14px; }
    .routine-week-day-cell .day-name { font-size: 11px; }
    .routine-week-day-cell .day-dot { width: 5px; height: 5px; }
    .routine-progress-wrapper { padding: 10px 14px; }
    .routine-progress-count { font-size: 15px; }
}

/* =========================================
   실행실 (Execution Room) 태스크 리스트 디자인 (Flexbox)
   ========================================= */
.exec-task-body {
    padding: 0 10px 10px 10px;
}

.exec-step-list {
    display: flex;
    flex-direction: column;
    gap: 8px; /* List items spacing */
}

/* 개별 태스크 row */
.exec-step-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.exec-step-row:hover {
    box-shadow: 0 6px 16px rgba(123, 197, 174, 0.1);
    transform: translateY(-2px);
    border-color: rgba(123, 197, 174, 0.3);
}

.exec-step-row.running {
    background: rgba(123, 197, 174, 0.08); /* Mint background when running */
    border-color: var(--point-main);
    box-shadow: 0 4px 12px rgba(123, 197, 174, 0.15);
}

.exec-step-row.completed {
    background: rgba(240, 245, 243, 0.6); /* Very faint mint/grey */
    border-color: transparent;
    opacity: 0.85;
}

/* 완료 시 글자 색상만 흐리게 변경 (줄 긋기 제거) */
.exec-step-row.completed .exec-step-name {
    color: var(--text-muted);
}

/* 태스크 왼쪽 영역 */
.exec-step-left {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

.exec-step-arrow {
    color: #a4b3ae;
    font-size: 11px;
    transition: transform 0.2s;
}

.exec-step-name {
    font-weight: 700;
    color: var(--text-main);
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s;
}

.exec-step-count {
    font-size: 12px;
    color: #888;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

/* 태스크 오른쪽 영역 (시간, 버튼들) */
.exec-step-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.exec-step-time {
    display: flex;
    align-items: baseline;
    gap: 2px;
    font-size: 15px;
    font-weight: bold;
    color: var(--text-time);
}

.exec-step-actual {
    color: var(--text-main);
}

.exec-step-target {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500; /* 숫자가 조금 더 잘 보이도록 굵기 조정 */
    font-family: 'Poppins', 'Pretendard', sans-serif; /* 영어/숫자는 Poppins 우선, 한글은 Pretendard */
}

.exec-step-btn-wrapper {
    width: 80px; /* 고정 크기로 레이아웃 틀어짐 방지 */
    display: flex;
    justify-content: center;
}

.exec-step-state-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 5px;
}

.exec-step-delete-cb {
    display: flex;
    align-items: center;
}

/* 세부 세션 기록 컨테이너 */
.exec-step-sessions-container {
    padding: 0 10px 10px 10px;
}

.exec-step-sessions-inner {
    padding: 12px 16px;
    background: var(--bg-task);
    border-radius: 10px;
    margin-top: -4px; /* Row와 살짝 붙게 */
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    border: 1px solid var(--border-light);
    font-size: 14px;
    color: var(--text-time);
}

/* Total 바 */
.exec-step-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    margin-top: 5px;
    background: var(--bg-table-th);
    border-radius: 12px;
    font-weight: 800;
    color: var(--text-main);
}

.exec-total-label {
    font-size: 15px;
}

.exec-total-value {
    font-size: 15px;
    color: var(--text-time);
}

/* 모바일 뷰 대응 (화면 작을 때 간격 조절) */
@media (max-width: 500px) {
    .exec-step-row {
        padding: 12px;
    }
    .exec-step-right {
        gap: 8px;
    }
    .exec-step-time {
        font-size: 13px;
    }
    .exec-step-target {
        font-size: 11px;
    }
    .exec-step-btn-wrapper {
        width: 60px;
    }
    .exec-step-start-btn {
        padding: 6px 10px !important;
        font-size: 11px !important;
    }
}


.state-4 {
    border-color: #d1d8e0 !important;
    background-color: transparent !important;
    border-style: dashed !important;
}

.day-dot.event {
    background-color: #3742fa !important;
}

/* =========================================
   🌙 Focus Mode (Yeolpumta Style Fullscreen)
   ========================================= */
.focus-mode-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: #0f1011; /* Deep dark background */
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    padding: 30px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s;
}

.focus-mode-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.focus-mode-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.focus-today-time {
    font-size: 24px;
    font-weight: 800;
    color: var(--point-main);
    letter-spacing: 1px;
}

.focus-exit-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.focus-exit-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.focus-mode-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    min-height: 0;
}

.focus-task-info {
    font-size: 20px;
    color: #a4b3ae;
    margin-bottom: 20px;
    font-weight: 600;
    text-align: center;
}

.focus-time-display {
    font-size: 18vw; /* responsive massive text */
    font-weight: 900;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 4px 20px rgba(123, 197, 174, 0.4);
    letter-spacing: 2px;
}

@media (min-width: 800px) {
    .focus-time-display {
        font-size: 150px;
    }
}

.focus-mode-bottom {
    display: flex;
    justify-content: center;
    padding-bottom: 20px;
}

.focus-pause-btn {
    background: var(--point-main);
    color: #000;
    border: none;
    width: auto;
    padding: 20px 50px;
    border-radius: 45px;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: 0 8px 30px rgba(123, 197, 174, 0.5);
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* =========================================
   🔁 집중 모드 복귀 플로팅 버튼 (FAB)
   ========================================= */
.focus-mode-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 8000;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 22px;
    background: linear-gradient(135deg, #0f1011 0%, #1a1d1f 100%);
    color: #fff;
    border: 1.5px solid rgba(123, 197, 174, 0.4);
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35), 0 0 20px rgba(123, 197, 174, 0.15);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: fabPulse 2.5s ease-in-out infinite;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.focus-mode-fab:hover {
    transform: scale(1.06);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 30px rgba(123, 197, 174, 0.25);
    border-color: rgba(123, 197, 174, 0.7);
}

.focus-mode-fab:active {
    transform: scale(0.96);
}

.focus-fab-icon {
    font-size: 18px;
    filter: drop-shadow(0 0 6px rgba(123, 197, 174, 0.6));
}

.focus-fab-text {
    letter-spacing: 0.5px;
}

@keyframes fabPulse {
    0%, 100% {
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35), 0 0 20px rgba(123, 197, 174, 0.15);
    }
    50% {
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35), 0 0 35px rgba(123, 197, 174, 0.3);
    }
}

@media (max-width: 600px) {
    .focus-mode-fab {
        bottom: 20px;
        right: 16px;
        padding: 12px 18px;
        font-size: 14px;
    }
    .focus-fab-icon {
        font-size: 16px;
    }
    .focus-mode-overlay {
        padding: 20px 16px;
    }
    .focus-mode-header {
        gap: 8px;
    }
    .focus-today-time {
        font-size: 18px;
        letter-spacing: 0;
    }
    .focus-exit-btn {
        font-size: 12px;
        padding: 8px 14px;
    }
    .focus-task-info {
        font-size: 16px;
        padding: 0 10px;
        word-break: keep-all;
    }
    .focus-pause-btn {
        padding: 18px 40px;
        font-size: 20px;
    }
}

/* =========================================
   📅 주간 계획 캘린더 (Weekly Planner)
   ========================================= */
.weekly-planner-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-main);
    z-index: 2500;
    overflow-y: auto;
    animation: weeklyFadeIn 0.25s ease;
}

@keyframes weeklyFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.weekly-planner-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px 60px;
}

.weekly-planner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-light);
}

.weekly-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.weekly-nav-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    width: 36px; height: 36px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
.weekly-nav-btn:hover {
    background: var(--point-main);
    color: #fff;
    border-color: var(--point-main);
}

.weekly-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.3px;
}

.weekly-today-btn {
    background: var(--point-main);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}
.weekly-today-btn:hover { background: var(--point-hover); }

.weekly-close-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-sub);
    width: 40px; height: 40px;
    border-radius: 12px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
.weekly-close-btn:hover {
    background: #ff4757;
    color: #fff;
    border-color: #ff4757;
}

.weekly-planner-body {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.weekly-grid-area {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
}

/* 요일 헤더 */
.weekly-day-headers {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}

.weekly-day-header {
    text-align: center;
    font-size: 14px;
    font-weight: 800;
    color: var(--text-sub);
    padding: 10px 0;
    background: var(--bg-card);
    border-radius: 10px 10px 0 0;
    border: 1px solid var(--border-light);
    border-bottom: 2px solid var(--point-main);
}
.weekly-day-header.sun { color: #E57373; border-bottom-color: #E57373; }
.weekly-day-header.sat { color: #64B5F6; border-bottom-color: #64B5F6; }

/* 날짜 헤더 행 */
.weekly-date-headers {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}

.weekly-date-cell {
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    padding: 8px 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 0;
    position: relative;
}
.weekly-date-cell.is-today {
    background: rgba(123, 197, 174, 0.12);
    border-color: var(--point-main);
}
.weekly-date-cell.is-today::after {
    content: '오늘';
    position: absolute;
    top: 2px; right: 4px;
    font-size: 9px;
    font-weight: 800;
    color: var(--point-main);
    background: rgba(123, 197, 174, 0.15);
    padding: 1px 4px;
    border-radius: 4px;
}

/* 날짜 셀 그리드 */
.weekly-cells-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.weekly-cell {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 0 0 10px 10px;
    min-height: 120px;
    padding: 8px 5px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

.weekly-cell-date-header {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    text-align: right;
    margin-bottom: 4px;
    padding-right: 4px;
}
.weekly-cell-date-header.is-today {
    color: var(--point-main);
}

.weekly-cell.is-today {
    background: rgba(123, 197, 174, 0.05);
    border-color: var(--point-main);
}
.weekly-cell:hover {
    box-shadow: inset 0 0 0 1.5px var(--point-main);
}

/* 셀 내 항목 */
.weekly-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    background: var(--bg-task);
    border: 1px solid var(--border-light);
    cursor: grab;
    transition: 0.2s;
    word-break: keep-all;
    line-height: 1.3;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}
.weekly-item:active {
    cursor: grabbing;
}
.sortable-ghost {
    opacity: 0.4;
    background-color: var(--bg-hover) !important;
}
.sortable-drag {
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    transform: scale(1.02);
}
.weekly-item:hover {
    border-color: var(--point-main);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.weekly-item .weekly-item-state {
    font-size: 11px;
    flex-shrink: 0;
}
.weekly-item .weekly-item-delete {
    position: absolute;
    top: -4px; right: -4px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #ff4757;
    color: #fff;
    border: none;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
    display: none;
    padding: 0;
}
.weekly-item:hover .weekly-item-delete {
    display: block;
}

.weekly-item-memo {
    background: rgba(123, 197, 174, 0.08);
    border: 1px dashed var(--point-main);
    color: var(--text-main);
}

/* 셀 추가 버튼 */
.weekly-cell-add-btn {
    margin-top: auto;
    background: transparent;
    border: 1px dashed var(--border-light);
    color: var(--text-sub);
    padding: 6px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
    text-align: center;
}
.weekly-cell-add-btn:hover {
    border-color: var(--point-main);
    color: var(--point-main);
    background: rgba(123, 197, 174, 0.05);
}

/* Weekly To Do 패널 */
.weekly-todo-panel {
    width: 260px;
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    position: sticky;
    top: 20px;
}
.weekly-todo-title {
    background: var(--text-main);
    color: var(--bg-card);
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.5px;
}
.weekly-todo-textarea {
    width: 100%;
    min-height: 300px;
    padding: 14px 16px;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-main);
    background: transparent;
    resize: vertical;
    line-height: 1.8;
    box-sizing: border-box;
}
.weekly-todo-textarea::placeholder {
    color: var(--text-sub);
    opacity: 0.6;
}

/* 항목 추가 모달 탭 */
.weekly-add-tab {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    background: var(--bg-task);
    color: var(--text-sub);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    text-align: center;
}
.weekly-add-tab.active {
    background: var(--point-main);
    color: #fff;
    border-color: var(--point-main);
}

/* 진도 행 선택 리스트 */
.weekly-plan-row-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid transparent;
    margin-bottom: 3px;
}
.weekly-plan-row-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}
.weekly-plan-row-item .plan-row-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}
.weekly-plan-row-item .plan-row-stages {
    display: flex;
    gap: 4px;
    font-size: 12px;
}
.weekly-plan-row-item .plan-row-stage-btn {
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    background: var(--bg-task);
    color: var(--text-sub);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}
.weekly-plan-row-item .plan-row-stage-btn:hover {
    background: var(--point-main);
    color: #fff;
    border-color: var(--point-main);
}

/* 📱 모바일 반응형 */
@media (max-width: 768px) {
    .weekly-planner-container {
        padding: 12px 10px 40px;
    }
    .weekly-planner-header {
        flex-wrap: wrap;
        gap: 10px;
    }
    .weekly-title {
        font-size: 16px;
    }
    .weekly-planner-body {
        flex-direction: column;
    }
    .weekly-todo-panel {
        width: 100%;
        position: static;
    }
    .weekly-todo-textarea {
        min-height: 120px;
    }
    .weekly-cell {
        min-height: 100px;
        padding: 4px 3px;
    }
    .weekly-item {
        font-size: 10px;
        padding: 4px 5px;
    }
    .weekly-day-header {
        font-size: 12px;
        padding: 8px 0;
    }
    .weekly-date-cell {
        font-size: 12px;
        padding: 6px 2px;
    }
    .weekly-cell-add-btn {
        font-size: 11px;
        padding: 4px;
    }
}

@media (max-width: 480px) {
    .weekly-cell {
        min-height: 70px;
    }
    .weekly-item {
        font-size: 9px;
        padding: 3px 4px;
        gap: 2px;
    }
    .weekly-item .weekly-item-state {
        font-size: 9px;
    }
    .weekly-date-cell {
        font-size: 11px;
    }
    .weekly-date-cell.is-today::after {
        font-size: 7px;
    }
}

/* Weekly Plan Item Addition UI overhaul */
.weekly-stage-toggle-btn {
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    background: var(--bg-task);
    color: var(--text-sub);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}
.weekly-stage-toggle-btn:hover {
    border-color: var(--point-main);
    color: var(--point-main);
}
.weekly-stage-toggle-btn.selected {
    background: rgba(123, 197, 174, 0.1);
    border-color: var(--point-main);
    color: var(--point-main);
}
.weekly-stage-toggle-btn.state-done {
    color: var(--point-main);
    border-color: rgba(123, 197, 174, 0.5);
}
.weekly-stage-toggle-btn.state-warn {
    color: #f57c00;
    border-color: rgba(255, 152, 0, 0.5);
}
.weekly-stage-toggle-btn.state-scheduled {
    color: #4a90e2;
    border-color: rgba(74, 144, 226, 0.5);
    background: rgba(74, 144, 226, 0.05);
}
.weekly-stage-toggle-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.weekly-bulk-stage-btn {
    flex: 1;
    padding: 8px 0;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: var(--bg-task);
    color: var(--text-sub);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}
.weekly-bulk-stage-btn:hover {
    border-color: var(--point-main);
    color: var(--point-main);
}


/* =========================================
   🍅 타임타이머 / 뽀모도로 시스템
   ========================================= */

/* --- 뷰 모드별 표시/숨김 --- */
.focus-mode-overlay[data-view="classic"] #focus-time-display { display: block; }
.focus-mode-overlay[data-view="classic"] #pomo-widget { display: none !important; }

.focus-mode-overlay[data-view="pomodoro"] #focus-time-display { display: none; }
.focus-mode-overlay[data-view="pomodoro"] #pomo-widget { display: flex !important; }

.focus-mode-overlay[data-view="pomodoro"] .focus-mode-center {
    container-type: size;
}

/* --- 뽀모도로 위젯 컨테이너 --- */
.pomo-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    animation: pomoFadeIn 0.5s ease;
}

@keyframes pomoFadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- SVG 디스크 --- */
.pomo-disc-wrap {
    position: relative;
    width: min(720px, 90vw, max(120px, calc(100dvh - 340px)));
    height: auto;
    aspect-ratio: 1;
    container-type: inline-size;
    transition: width 0.4s, height 0.4s;
    flex-shrink: 0;
}
.focus-mode-overlay[data-view="pomodoro"] .pomo-disc-wrap {
    width: min(720px, 100cqw, max(120px, calc(100cqh - 180px)));
}
.focus-mode-overlay[data-view="pomodoro"] .pomo-remaining {
    font-size: clamp(32px, 23cqw, 156px);
    letter-spacing: 1px;
    white-space: nowrap;
}
.pomo-disc-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 25px rgba(255, 71, 87, 0.25));
    transition: filter 0.5s;
}
.pomo-disc-svg.rest-phase {
    filter: drop-shadow(0 0 25px rgba(123, 197, 174, 0.3));
}
.pomo-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 14;
}
.pomo-arc {
    fill: none;
    stroke: #FF4757;
    stroke-width: 14;
    stroke-linecap: round;
    transition: stroke 0.5s ease;
}
.pomo-arc.rest-phase {
    stroke: #7BC5AE;
}
.pomo-marker {
    stroke: rgba(255,255,255,0.4);
    stroke-width: 2;
    stroke-linecap: round;
}

/* 디스크 중앙 텍스트 */
.pomo-disc-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}
.pomo-remaining {
    font-size: 64px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    letter-spacing: 3px;
    color: #fff;
    text-shadow: 0 2px 20px rgba(255, 71, 87, 0.3);
    transition: text-shadow 0.5s;
    line-height: 1.1;
}
.pomo-remaining.rest-phase {
    text-shadow: 0 2px 15px rgba(123, 197, 174, 0.3);
}
.pomo-phase-label {
    font-size: 18px;
    font-weight: 700;
    color: #FF4757;
    margin-top: 6px;
    letter-spacing: 3px;
    text-transform: uppercase;
    transition: color 0.5s;
}
.pomo-phase-label.rest-phase {
    color: #7BC5AE;
}

/* --- 세션 정보 --- */
.pomo-session-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
}
.pomo-session-dots {
    display: flex;
    gap: 6px;
}
.pomo-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    transition: all 0.3s;
}
.pomo-dot.done {
    background: #FF4757;
    box-shadow: 0 0 8px rgba(255, 71, 87, 0.4);
}
.pomo-dot.active {
    background: #FF4757;
    animation: pomoDotPulse 1.5s ease-in-out infinite;
}
.pomo-dot.rest {
    background: #7BC5AE;
    box-shadow: 0 0 8px rgba(123, 197, 174, 0.4);
}
@keyframes pomoDotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

/* --- 컨트롤 버튼 --- */
.pomo-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}
.pomo-ctrl-btn {
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.85);
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.pomo-ctrl-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}
.pomo-ctrl-btn:active {
    transform: scale(0.95);
}
.pomo-ctrl-start {
    background: rgba(255, 71, 87, 0.2);
    border-color: rgba(255, 71, 87, 0.5);
    color: #FF4757;
}
.pomo-ctrl-start:hover {
    background: rgba(255, 71, 87, 0.3);
    border-color: #FF4757;
}
.pomo-ctrl-pause {
    background: rgba(255, 165, 2, 0.2);
    border-color: rgba(255, 165, 2, 0.5);
    color: #ffa502;
}
.pomo-ctrl-resume {
    background: rgba(123, 197, 174, 0.2);
    border-color: rgba(123, 197, 174, 0.5);
    color: #7BC5AE;
}
.pomo-ctrl-settings {
    min-width: 44px;
    padding: 10px 14px;
}

/* --- 뷰 모드 전환 인디케이터 --- */
.focus-view-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 0 10px;
}
.focus-view-dot {
    background: rgba(255,255,255,0.08);
    border: 1.5px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.4);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    -webkit-tap-highlight-color: transparent;
}
.focus-view-dot:hover {
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.7);
}
.focus-view-dot.active {
    background: rgba(123, 197, 174, 0.15);
    border-color: rgba(123, 197, 174, 0.5);
    color: #7BC5AE;
    font-weight: 700;
}
.focus-view-sep {
    color: rgba(255,255,255,0.15);
    font-size: 16px;
    user-select: none;
}

/* --- 뽀모도로 설정 모달 --- */
.pomo-setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.pomo-setting-row label {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
}
.pomo-setting-control {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pomo-setting-control button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.06);
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.pomo-setting-control button:hover {
    background: rgba(123,197,174,0.2);
    border-color: var(--point-main);
}
.pomo-setting-control span {
    font-size: 20px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    min-width: 30px;
    text-align: center;
}
.pomo-set-unit {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: rgba(255,255,255,0.5);
    min-width: auto !important;
}

/* --- 디스크 완료 깜빡임 --- */
@keyframes pomoFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.pomo-disc-flash .pomo-remaining {
    animation: pomoFlash 0.4s ease 3;
}

/* --- 모바일 반응형 --- */
@media (max-width: 600px) {
    .pomo-remaining {
        font-size: clamp(48px, 18vw, 64px);
    }
    .pomo-phase-label {
        font-size: 15px;
    }
    .pomo-controls {
        gap: 6px;
    }
    .pomo-ctrl-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
    .focus-view-dot {
        padding: 6px 10px;
        font-size: 12px;
    }
}

 
 /* D-Day Planner Styles */
.dday-planner-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 15px;
  background: var(--bg-main);
  overflow-y: auto;
}

.dday-header-area {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.dday-goal-select {
  padding: 10px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  border: 1px solid var(--point-main);
  color: var(--point-main);
  background: var(--bg-task);
  flex: 1;
  min-width: 200px;
  outline: none;
}

.dday-header-actions {
  display: flex;
  gap: 10px;
}

.dday-btn {
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  transition: all 0.2s;
}

.dday-btn:hover {
  background: var(--bg-elevated);
}

.dday-sort-btn {
  background: var(--bg-task);
  color: var(--text-sub);
}

.dday-timeline-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  margin: 0 auto;
  max-width: 800px;
  width: 100%;
  padding-bottom: 20px;
}

.dday-timeline-container::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 14px;
  width: 2px;
  background: var(--border-light);
  z-index: 0;
}

.dday-item {
  display: flex;
  align-items: center;
  margin-bottom: 25px;
  position: relative;
  z-index: 1;
}

.dday-item-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-task);
  border: 3px solid var(--point-main);
  margin-right: 15px;
  flex-shrink: 0;
  margin-left: 5px;
}

.dday-item-dot.is-today {
  background: #ff4757;
  border-color: #ff4757;
}

.dday-item-dot.is-goal {
  width: 18px;
  height: 18px;
  background: var(--point-main);
  border-color: var(--point-main);
  margin-left: 3px;
  margin-right: 13px;
  box-shadow: 0 0 10px rgba(46, 213, 115, 0.5);
}

.dday-item-content {
  background: var(--bg-task);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 15px;
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.dday-item-content:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  border-color: var(--point-main);
}

.dday-item-content.is-goal-content {
  background: linear-gradient(135deg, var(--bg-task) 0%, rgba(46, 213, 115, 0.1) 100%);
  border-color: var(--point-main);
  border-width: 2px;
}

.dday-item-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.dday-item-title {
  font-size: 15px;
  font-weight: bold;
  color: var(--text-main);
}

.dday-item-date {
  font-size: 13px;
  color: var(--text-sub);
}

.dday-item-right {
  font-size: 18px;
  font-weight: 900;
  color: var(--point-main);
  background: rgba(46, 213, 115, 0.1);
  padding: 8px 12px;
  border-radius: 20px;
}

.dday-item-right.is-past {
  color: var(--text-muted);
  background: var(--bg-elevated);
}

.dday-item-right.is-today-badge {
  color: #ff4757;
  background: rgba(255, 71, 87, 0.1);
}

.dday-add-milestone-btn {
  background: transparent;
  border: 2px dashed var(--border-light);
  color: var(--text-sub);
  padding: 15px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  margin-top: 10px;
}

.dday-add-milestone-btn:hover {
  border-color: var(--point-main);
  color: var(--point-main);
  background: rgba(46, 213, 115, 0.05);
}
/* D-Day Calendar & Horizontal Layout Styles */
.dday-cal-day { flex: 1; text-align: center; font-size: 13px; font-weight: bold; color: var(--text-sub); }
.dday-cal-week { display: flex; border-bottom: 1px solid var(--border-light); }
.dday-cal-week:last-child { border-bottom: none; }
.dday-cal-cell { flex: 1; min-height: 80px; border-right: 1px solid var(--border-light); padding: 5px; box-sizing: border-box; display: flex; flex-direction: column; gap: 2px; }
.dday-cal-cell:last-child { border-right: none; }
.dday-cal-date-num { font-size: 11px; color: var(--text-sub); margin-bottom: 4px; text-align: center; }
.dday-cal-date-num.is-today { background: #ff4757; color: #fff; border-radius: 50%; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; margin: 0 auto 4px auto; }

.dday-cal-badge { font-size: 10px; padding: 3px 4px; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; transition: 0.2s; }
.dday-cal-badge:hover { filter: brightness(0.9); }
.badge-goal { background: var(--point-main); color: #fff; font-weight: bold; box-shadow: 0 2px 5px rgba(46, 213, 115, 0.4); }
.badge-milestone { background: rgba(46, 213, 115, 0.15); color: var(--text-main); border: 1px solid var(--point-main); }
.badge-milestone.is-past { background: var(--bg-elevated); color: var(--text-muted); border-color: var(--border-light); }

/* Horizontal Timeline Layout */
.dday-timeline-container.is-horizontal {
  flex-direction: row;
  overflow-x: auto;
  padding-bottom: 20px;
  margin: 0;
  max-width: 100%;
  padding-top: 20px;
}
.dday-timeline-container.is-horizontal::before {
  top: 26px;
  bottom: auto;
  left: 0;
  right: 0;
  height: 2px;
  width: auto;
}
.dday-timeline-container.is-horizontal .dday-item {
  flex-direction: column;
  margin-bottom: 0;
  margin-right: 20px;
  align-items: center;
}
.dday-timeline-container.is-horizontal .dday-item-dot {
  margin-right: 0;
  margin-left: 0;
  margin-bottom: 15px;
}
.dday-timeline-container.is-horizontal .dday-item-content {
  flex-direction: column;
  text-align: center;
  min-width: 160px;
  gap: 10px;
}
.dday-timeline-container.is-horizontal .dday-item-left {
  align-items: center;
}
.dday-timeline-container.is-horizontal .dday-item-right {
  margin-top: 0;
}

/* 시간표 관리 모달 호버 액션 및 체크마크 스타일 */
#schedule-manage-list > div {
  transition: background 0.2s;
}
#schedule-manage-list > div:hover {
  background: var(--border-light) !important;
}
.schedule-list-actions {
  opacity: 0;
  transition: opacity 0.2s;
}
#schedule-manage-list > div:hover .schedule-list-actions {
  opacity: 1;
}
@media (max-width: 768px) {
  .schedule-list-actions {
    opacity: 1; /* 모바일에서는 항상 보이게 */
  }
}

.schedule-color-btn {
  position: relative;
}
.schedule-color-btn.selected::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
  text-shadow: 0px 0px 2px rgba(0,0,0,0.5);
}

/* 스터디룸 (라운지) 스타일 */
.room-item {
  background: var(--bg-task);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}
.room-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  border-color: var(--point-main);
}
.room-item-name {
  font-size: 16px;
  font-weight: bold;
  color: var(--text-main);
}
.room-item-count {
  font-size: 13px;
  color: var(--text-sub);
  background: var(--bg-main);
  padding: 4px 8px;
  border-radius: 10px;
}

.live-members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 15px;
  width: 100%;
}

.live-member-card {
  background: var(--bg-task);
  border: 1px solid var(--border-light);
  border-radius: 15px;
  padding: 20px 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

.live-member-card[data-status="studying"] {
  border-color: #27ae60;
  box-shadow: 0 4px 15px rgba(39, 174, 96, 0.1);
}

.live-member-card[data-status="break"] {
  border-color: #f39c12;
}

.live-member-card[data-status="offline"] {
  opacity: 0.6;
}

.member-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 10px;
  color: var(--text-sub);
  border: 2px solid transparent;
}

.live-member-card[data-status="studying"] .member-avatar {
  border-color: #27ae60;
  color: #27ae60;
}

.live-member-card[data-status="break"] .member-avatar {
  border-color: #f39c12;
  color: #f39c12;
}

.member-name {
  font-weight: bold;
  font-size: 15px;
  margin-bottom: 5px;
  color: var(--text-main);
  text-align: center;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-subject {
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 10px;
  text-align: center;
  min-height: 15px;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-timer {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  font-family: monospace;
}

.live-member-card[data-status="studying"] .member-timer {
  color: #27ae60;
}

.member-total {
  font-size: 11px;
  color: var(--text-sub);
  margin-top: 5px;
}


/* Plan Board Control Buttons */
.plan-ctrl-btn {
    background: transparent;
    color: var(--text-sub);
    border: 1px solid var(--border-light);
    padding: 8px 5px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    flex: 1;
    transition: 0.2s;
}
.plan-ctrl-btn:hover {
    background: var(--bg-task);
    color: var(--text-main);
    border-color: #ccc;
}
.plan-ctrl-btn.danger:hover {
    color: #ff4757;
    border-color: #ff4757;
}
.plan-ctrl-btn.primary {
    background: var(--point-main);
    color: #fff;
    border: none;
}
.plan-ctrl-btn.primary:hover {
    background: var(--point-hover);
    color: #fff;
}

/* 저장 상태: 색상과 함께 문구를 제공하고 작은 화면에서도 줄바꿈한다. */
.save-status { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 6px; padding: 0 25px 8px; min-height: 28px; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.save-status[hidden], .save-status button[hidden] { display: none; }
.save-status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.save-status[data-state="saved"] { color: #26735e; }
.save-status[data-state="saving"], .save-status[data-state="pending"], .save-status[data-state="offline"] { color: #805b12; }
.save-status[data-state="error"] { color: #b33434; }
.save-status button { border: 1px solid currentColor; border-radius: 6px; padding: 4px 9px; background: transparent; color: inherit; font-size: 12px; cursor: pointer; min-height: 28px; }
.save-status button:disabled { opacity: .55; cursor: default; }
.save-status button:focus-visible { outline: 2px solid var(--point-main); outline-offset: 2px; }
@media (max-width: 600px) {
  .save-status { justify-content: flex-start; padding: 0 15px 8px; }
  .save-status button { min-height: 36px; padding: 6px 10px; }
}

/* Header groups keep time and start controls from wrapping independently. */
.header-study-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.study-total-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.study-session-actions { display: flex; align-items: center; gap: 8px; }
.study-session-actions .break-btn { min-height: 36px; padding: 7px 12px; }
.header-right #user-info-area { min-width: 0; }
.user-name-box { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
@media (max-width: 900px) and (min-width: 601px) {
  .header-content { flex-wrap: wrap; align-items: flex-start; }
  .header-left { flex: 1 1 360px; }
}
@media (max-width: 600px) {
  .header-content { grid-template-columns: minmax(0, 1fr) auto; gap: 12px 8px; padding: 12px 15px; }
  #date-display { font-size: 12px; line-height: 1.5; }
  .header-right { display: flex; grid-column: 2; grid-row: 1; min-width: 0; }
  .header-right #user-info-area { gap: 6px !important; width: auto; }
  .user-name-box { max-width: 72px; font-size: 12px; }
  .auth-buttons-row { gap: 6px; flex-wrap: nowrap; }
  .header-study-summary { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; width: 100%; margin: 0; }
  .study-total-row { justify-content: space-between; gap: 8px; }
  #today-total-time { font-size: 17px; }
  #current-schedule-widget { min-width: 36px; min-height: 36px; }
  .study-session-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .study-session-actions #break-toggle-btn, .study-session-actions #adhoc-study-toggle-btn { width: 100%; min-height: 44px; padding: 10px 8px; font-size: 13px; }
  #adhoc-study-toggle-btn { background: var(--point-main); color: #173f33; border-color: var(--point-main); }
  #header-login-btn { font-size: 12px; min-height: 36px; padding: 6px 10px; }
  .save-status { min-height: 30px; padding-top: 0; padding-bottom: 10px; }
}
@media (max-width: 359px) {
  .header-content { padding-left: 12px; padding-right: 12px; }
  .user-name-box { max-width: 46px; }
  .save-status { padding-left: 12px; padding-right: 12px; }
}

/* Records stay inside the app; only the selected document scrolls. */
#records-tab { width: 100%; max-width: 1440px; margin: 0 auto; padding: 16px 20px 20px; }
#records-tab [hidden] { display: none !important; }
.records-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-bottom: 14px; }
.records-toolbar h2 { margin: 0; font-size: 20px; }
.records-view-switch { display: flex; gap: 4px; padding: 4px; background: var(--border-light); border-radius: 12px; }
.records-view-switch button { min-height: 40px; padding: 8px 20px; border: 0; border-radius: 9px; background: transparent; color: var(--text-main); cursor: pointer; font-size: 14px; }
.records-view-switch button[aria-selected="true"] { background: var(--bg-card); font-weight: 700; box-shadow: var(--shadow-card); }
.records-view-switch button:focus-visible { outline: 2px solid var(--point-main); outline-offset: 2px; }
.records-frame { display: block; width: 100%; height: var(--records-frame-height, 65vh); min-height: 260px; border: 1px solid var(--border-light); border-radius: 14px; background: var(--bg-main); }
.records-login-notice { text-align: center; padding: 40px 16px; background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 14px; }
.viewing-records #timer-container { display: none; }
.viewing-records.records-has-session #timer-container { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 12px; padding: 8px 15px; }
.viewing-records #time-display { font-size: 24px; }
.viewing-records #active-task-info { margin: 0; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.viewing-records .timer-actions { margin-top: 0 !important; }
@media (max-width: 600px) {
  #records-tab { padding: 12px 12px 16px; }
  .records-toolbar { gap: 8px; padding-bottom: 10px; }
  .records-toolbar h2 { font-size: 18px; }
  .records-view-switch button { min-height: 44px; padding: 8px 14px; font-size: 13px; }
  .viewing-records:not(.records-has-session) .study-session-actions { display: none; }
}
