﻿.schedule-type-tabs {
  margin-bottom: 8px;
  gap: 0;
  justify-content: left;
}
.tab-btn {
  flex: 1 1 0;
  padding: 10px 0;
  border-radius: 10px 0 0 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  outline: none;
  border-right: none;
}
.tab-btn.right {
  border-radius: 0 10px 10px 0;
  border-left: none;
  border-right: 1px solid #e5e7eb;
}
.tab-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.tab-icon {
  font-size: 18px;
  margin-right: 6px;
  vertical-align: middle;
}
/* memo2_style_patch.css */
/* 위젯 스크롤 숨김 + 버튼/팔레트/체크/미니달력 스타일 */

/* 라이트 테마 (기본) */
:root{
  --color-primary:#5C8DFF;
  --color-primary-hover:#4A7AEE;
  --color-primary-light:#EEF2FF;
  --bg:#f6f7fb;
  --card:#ffffff;
  --line:#e9ecf2;
  --text:#111827;
  --text-muted:#8e9bb1;
  --muted:#8e9bb1;
  --primary:var(--color-primary);
  --cal-weekday-font:10px;
  --cal-daynum-font:9px;
  --cal-label-font:10px;
  --shadow:0 6px 18px rgba(17,24,39,.08);
  --card-hover-shadow:0 6px 28px rgba(0,0,0,0.12);
}

/* 레이아웃 최초 페인트 최적화 */
.sidebar,
.right{
  content-visibility:auto;
  contain-intrinsic-size:600px;
}
@media(min-width:1024px){
  .sidebar,
  .right{
    contain-intrinsic-size:780px;
  }
}
.usage-section,
#siteIntro{
  min-height:220px;
}

/* 초기 렌더 비용 감소: 카드를 지연 렌더링하고 예상 크기 확보 */
.main .card,
.right .card{
  content-visibility:auto;
  contain-intrinsic-size:820px 1200px;
}

/* 다크 테마 */
[data-theme="dark"]{
  --bg:#1a1a1a;
  --card:#2a2a2a;
  --line:#3a3a3a;
  --text:#e5e5e5;
  --text-muted:#9ca3af;
  --muted:#9ca3af;
  --primary:#667eea;
  --shadow:0 6px 18px rgba(0,0,0,.4);
  --card-hover-shadow:0 6px 28px rgba(0,0,0,0.6);
}

/* 다크 테마 추가 스타일 */
[data-theme="dark"]{
  color:#ffffff !important;
}
[data-theme="dark"] body{
  background:#1a1a1a !important;
  color:#ffffff !important;
}
[data-theme="dark"] .sidebar{
  background:#1f1f1f !important;
}
[data-theme="dark"] .sidebar__title,
[data-theme="dark"] .sidebar__hint{
  color:#ffffff !important;
}
[data-theme="dark"] .menu-btn{
  background:#2a2a2a !important;
  color:#ffffff !important;
  border-color:#3a3a3a !important;
  font-size:14px !important;
  font-weight:600 !important;
}
[data-theme="dark"] .menu-btn:hover{
  background:#3a3a3a !important;
}
[data-theme="dark"] .card{
  background:#2a2a2a !important;
  border-color:#3a3a3a !important;
}
[data-theme="dark"] .card__title,
[data-theme="dark"] .card__header{
  color:#ffffff !important;
  border-color:#3a3a3a !important;
}
[data-theme="dark"] .day{
  background:#2a2a2a !important;
  border-color:#3a3a3a !important;
}
[data-theme="dark"] .day__num{
  color:#ffffff !important;
}
[data-theme="dark"] .calendar__weekdays span{
  color:#9ca3af !important;
}
[data-theme="dark"] .calendar__weekdays{
  background:#2a2a2a !important;
  border-color:#3a3a3a !important;
}
[data-theme="dark"] .calendar__weekdays span{
  border-color:#3a3a3a !important;
}
[data-theme="dark"] .datebox{
  background:#2a2a2a !important;
  border-color:#3a3a3a !important;
}
[data-theme="dark"] .datebox__date{
  color:#ffffff !important;
}
[data-theme="dark"] .emoji-btn,
[data-theme="dark"] .del-btn{
  background:#1a1a1a !important;
  border-color:#3a3a3a !important;
  color:#ffffff !important;
}
[data-theme="dark"] .color-btn{
  background:#1a1a1a !important;
  background-image:url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"%3E%3Cdefs%3E%3ClinearGradient id="a" x1="0%25" y1="0%25" x2="100%25" y2="100%25"%3E%3Cstop offset="0%25" style="stop-color:rgb(255,0,0)"/%3E%3Cstop offset="16.67%25" style="stop-color:rgb(255,255,0)"/%3E%3Cstop offset="33.33%25" style="stop-color:rgb(0,255,0)"/%3E%3Cstop offset="50%25" style="stop-color:rgb(0,255,255)"/%3E%3Cstop offset="66.67%25" style="stop-color:rgb(0,0,255)"/%3E%3Cstop offset="83.33%25" style="stop-color:rgb(255,0,255)"/%3E%3Cstop offset="100%25" style="stop-color:rgb(255,0,0)"/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx="12" cy="12" r="10" fill="none" stroke="url(%23a)" stroke-width="4"/%3E%3C/svg%3E') !important;
  background-size:20px 20px !important;
  background-position:center !important;
  background-repeat:no-repeat !important;
  border-color:#3a3a3a !important;
}
[data-theme="dark"] .event-menu-btn{
  background:#1a1a1a !important;
  border-color:#3a3a3a !important;
  color:#9ca3af !important;
}
[data-theme="dark"] .event-menu-btn:hover{
  background:#2a2a2a !important;
  color:#60a5fa !important;
}
[data-theme="dark"] .event-menu-popup{
  background:#1a1a1a !important;
  border-color:#3a3a3a !important;
  box-shadow:0 4px 12px rgba(0,0,0,0.5) !important;
}
[data-theme="dark"] .event-menu-popup .menu-item{
  color:#e5e7eb !important;
}
[data-theme="dark"] .event-menu-popup .menu-item:hover{
  background:#2a2a2a !important;
  color:#60a5fa !important;
}
[data-theme="dark"] .event-menu-popup .menu-item.del{
  color:#f87171 !important;
}
[data-theme="dark"] .event-menu-popup .menu-item.del:hover{
  background:#3a1a1a !important;
  color:#fca5a5 !important;
}
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] textarea{
  background:#1a1a1a !important;
  border-color:#3a3a3a !important;
  color:#ffffff !important;
}
[data-theme="dark"] .event-title-input{
  background:#1a1a1a !important;
  border-color:#3a3a3a !important;
  color:#ffffff !important;
}
[data-theme="dark"] .event-title-input:focus{
  border-color:#60a5fa !important;
  box-shadow:0 0 0 2px rgba(96,165,250,0.2) !important;
}
[data-theme="dark"] .event-date-group label,
[data-theme="dark"] .event-time-group label,
[data-theme="dark"] .event-option{
  color:#9ca3af !important;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder{
  color:#6b7280 !important;
}
[data-theme="dark"] .btn{
  background:#2a2a2a !important;
  border-color:#3a3a3a !important;
  color:#ffffff !important;
}
[data-theme="dark"] .btn:hover{
  background:#3a3a3a !important;
}
[data-theme="dark"] .icon-btn{
  background:#2a2a2a !important;
  border-color:#3a3a3a !important;
  color:#ffffff !important;
}
[data-theme="dark"] .icon-btn:hover{
  background:#3a3a3a !important;
}
[data-theme="dark"] .event__label,
[data-theme="dark"] .todo__dates label{
  color:#9ca3af !important;
}
[data-theme="dark"] .event-text,
[data-theme="dark"] .todo-item .text,
[data-theme="dark"] .reminder-text,
[data-theme="dark"] .memo-text,
[data-theme="dark"] .label-text{
  color:#ffffff !important;
}
[data-theme="dark"] .btn-toggle{
  background:#1a1a1a;
  color:#9ca3af;
  border-color:#3a3a3a;
}
[data-theme="dark"] .btn-toggle:hover{
  background:#2a2a2a;
}
[data-theme="dark"] .color-pop-advanced,
[data-theme="dark"] .emoji-picker{
  background:#2a2a2a;
  border-color:#3a3a3a;
}
[data-theme="dark"] .emoji-picker-header{
  background:#2a2a2a;
  border-color:#3a3a3a;
}
[data-theme="dark"] .emoji-picker-search{
  background:#1f1f1f;
  border-color:#3a3a3a;
  color:#e5e7eb;
}
[data-theme="dark"] .emoji-picker-empty{
  color:#6b7280;
}
[data-theme="dark"] .emoji-item:hover{
  background:#333;
}
[data-theme="dark"] .color-section-title,
[data-theme="dark"] .emoji-category-title{
  color:#9ca3af;
}
[data-theme="dark"] .usage-section{
  background:#2a2a2a;
  border-color:#3a3a3a;
}
[data-theme="dark"] .usage-title{
  color:#ffffff;
}
[data-theme="dark"] .sidebar__title{
  font-size:14px !important;
}
[data-theme="dark"] .sidebar__hint{
  font-size:11px !important;
}
[data-theme="dark"] .footer{
  background:#2a2a2a;
  border-color:#3a3a3a;
}
[data-theme="dark"] .footer-link{
  color:#9ca3af;
}
[data-theme="dark"] .footer-link:hover{
  color:var(--primary);
}
[data-theme="dark"] .modal-content{
  background:#2a2a2a;
}
[data-theme="dark"] .modal-header{
  border-color:#3a3a3a;
}
[data-theme="dark"] .modal-title{
  color:#ffffff;
}
[data-theme="dark"] .modal-close:hover{
  background:#3a3a3a;
}
[data-theme="dark"] .modal-body{
  color:#9ca3af;
}
[data-theme="dark"] .modal-body h3{
  color:#ffffff;
}
[data-theme="dark"] .usage-text{
  color:#9ca3af;
}
[data-theme="dark"] .ym{
  color:#ffffff;
}

.datebox{
  padding:10px;
  border-radius:12px;
  background:#ffffff;
  box-shadow:0 2px 8px rgba(0,0,0,0.06);
  border:1px solid #f0f0f0;
  transition:all 0.3s ease;
}
.datebox:hover{
  box-shadow:0 4px 12px rgba(0,0,0,0.08);
}

/* ...existing code... */
.hidden{display:none !important;}
.icon-btn-ghost{
  background:#fff;
  border:1px solid var(--line);
  border-radius:10px;
  padding:8px 10px;
  cursor:pointer;
  min-width:40px;
}
.home-hero{
  padding:40px 24px;
  line-height:1.7;
  max-width:1200px;
  margin:0 auto;
}
.home-hero h1{
  font-size:26px;
  margin-bottom:12px;
}
.home-header{
  text-align:center;
  margin-bottom:60px;
}
.home-section{
  display:flex;
  gap:40px;
  align-items:center;
  margin-bottom:60px;
}
.home-section-reverse{
  flex-direction:row-reverse;
}
.home-section-content{
  flex:1;
}
.home-section-image{
  flex:1;
  min-width:300px;
}
.home-section-icon{
  font-size:48px;
  margin-bottom:16px;
}
.home-section h2{
  font-size:24px;
  margin-bottom:12px;
  font-weight:700;
}
.home-section p{
  font-size:16px;
  line-height:1.8;
  color:var(--text-secondary);
}
@media (max-width:768px){
  .home-section,
  .home-section-reverse{
    flex-direction:column;
  }
  .home-section-image{
    min-width:100%;
  }
}
.home-hero .hero-actions{
  margin-top:18px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.home-hero .btn-primary{
  background:var(--primary);
  color:#fff;
  border:none;
  padding:12px 16px;
  border-radius:12px;
  font-weight:700;
  cursor:pointer;
}
.home-hero .btn-ghost{
  background:#fff;
  border:1px solid var(--line);
  padding:12px 16px;
  border-radius:12px;
  font-weight:700;
  cursor:pointer;
}
/* ...existing code... */

/* 이벤트 입력 - 구글 캘린더 스타일 */
.event-input-wrapper{
  display:flex;
  gap:8px;
  margin-bottom:12px;
}
.event-title-input{
  flex:1;
  padding:10px 12px;
  border:1px solid #e5e7eb;
  border-radius:8px;
  transition:all 0.2s ease;
  font-size:14px;
}
.event-title-input:focus{
  outline:none;
  border-color:#5C8DFF;
  box-shadow:0 0 0 2px rgba(92,141,255,0.1);
}
.event-datetime-row{
  display:flex;
  gap:8px;
  margin-bottom:8px;
}
.event-date-group{
  flex:1;
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
}
.event-date-group label{
  font-size:12px;
  color:#64748b;
  min-width:36px;
  flex-shrink:0;
}
.event-date-group input[type="date"]{
  flex:1;
  min-width:110px;
  padding:6px 8px;
  border:1px solid #e5e7eb;
  border-radius:8px;
  font-size:12px;
  background:#f8fafc;
}
.event-date-group input[type="date"]:focus{
  outline:none;
  border-color:#5C8DFF;
  background:#fff;
}
.event-time-row{
  display:flex;
  gap:8px;
  margin-bottom:8px;
  align-items:center;
}
.event-time-group{
  display:flex;
  align-items:center;
  gap:6px;
}
.event-time-group label{
  font-size:12px;
  color:#64748b;
  min-width:36px;
}
.event-time-group input[type="time"]{
  padding:6px 8px;
  border:1px solid #e5e7eb;
  border-radius:8px;
  font-size:12px;
  background:#f8fafc;
}
.event-time-group input[type="time"]:focus{
  outline:none;
  border-color:#5C8DFF;
  background:#fff;
}
.event-options{
  display:flex;
  gap:16px;
  align-items:center;
}
.event-option{
  font-size:13px;
  color:#64748b;
  display:flex;
  align-items:center;
  gap:6px;
  cursor:pointer;
}
.event-option input[type="checkbox"]{
  width:16px;
  height:16px;
  cursor:pointer;
}
.repeat-btn{
  padding:8px 12px;
  border:1px solid #e5e7eb;
  border-radius:6px;
  background:#fff;
  font-size:13px;
  color:#64748b;
  cursor:pointer;
  transition:all 0.2s;
}
.repeat-btn:hover{
  background:#f8fafc;
  border-color:#5C8DFF;
  color:#5C8DFF;
}
.repeat-btn.active{
  background:#eff6ff;
  border-color:#5C8DFF;
  color:#5C8DFF;
}
.emoji-btn{width:36px;height:36px;padding:0;border:1px solid var(--line);border-radius:8px;background:#fff;cursor:pointer;font-size:18px}
.btn.full-width{
  width:100%;
  margin-bottom:10px;
  background:linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color:#ffffff;
  border:none;
  padding:12px 20px;
  border-radius:10px;
  font-weight:600;
  cursor:pointer;
  transition:all 0.3s ease;
  box-shadow:0 4px 15px rgba(102,126,234,0.3);
}
.btn.full-width:hover{
  transform:translateY(-2px);
  box-shadow:0 6px 20px rgba(102,126,234,0.4);
}
.btn-toggle{
  width:100%;padding:8px;margin:8px 0;border:1px solid var(--line);border-radius:8px;
  background:#f8f9fb;color:#64748b;font-size:12px;cursor:pointer;transition:all 0.2s;
}
.btn-toggle:hover{background:#e2e8f0}
.event__list{list-style:none;margin:0;padding:10px 0 0;display:flex;flex-direction:column;gap:8px}
.event-item{display:grid;grid-template-columns:1fr auto auto;align-items:center;gap:8px}
.event-label-wrapper{
  display:flex;
  align-items:center;
  gap:4px;
  padding:6px 12px;
  border-radius:8px;
  cursor:pointer;
}
.event-emoji{font-size:16px}
.event-text{
  flex:1;
}
.event-text.done{text-decoration:line-through;color:#9aa5b1 !important;}

/* TODO 입력 */
.todo__input-group{display:grid;grid-template-columns:1fr auto auto auto auto;gap:2px;margin-bottom:8px;align-items:center}
.todo__input-group input[type="text"]{flex:1;padding:10px 12px;border:1px solid var(--line);border-radius:10px}
.todo__input-group .icon-btn{border:none;background:transparent;font-size:14px;padding:4px;width:24px;height:24px;cursor:pointer;transition:transform 0.2s;display:flex;align-items:center;justify-content:center}
.todo__input-group .icon-btn svg{width:18px;height:18px;fill:currentColor}
.todo__input-group .color-indicator{background:#e5e7eb;border-radius:50%;border:1px solid #d1d5db;position:relative;width:18px;height:18px;padding:0}
.todo__input-group .color-indicator.has-color{border-color:currentColor}
.todo__input-group .emoji-gray{filter:grayscale(100%);opacity:0.5}
.todo__input-group .icon-btn:hover{transform:scale(1.15);background:transparent}
.todo__input-group #todoEmojiBtn{filter:grayscale(1);opacity:0.6}
.todo-options-panel{margin-top:8px;padding:12px;background:#f8f9fb;border-radius:8px;border:1px solid var(--line)}
.todo-section-title{font-size:13px;font-weight:700;margin:16px 0 8px;color:var(--text);padding-left:4px}
.todo__dates{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:10px;font-size:12px}
.todo__dates label{display:flex;align-items:center;gap:4px}
.todo__dates input[type="date"]{flex:1;padding:6px 8px;border:1px solid var(--line);border-radius:8px;font-size:11px}

/* REMINDER */
.reminder__input-group{display:grid;grid-template-columns:1fr auto auto;gap:8px;margin-bottom:10px}
.reminder__input-group input[type="text"]{flex:1;padding:10px 12px;border:1px solid var(--line);border-radius:10px}
.reminder__list{list-style:none;margin:0;padding:10px 0;display:flex;flex-direction:column;gap:8px}
.reminder-item{display:grid;grid-template-columns:20px 1fr auto auto;align-items:center;gap:8px}
.reminder-check{width:16px;height:16px;cursor:pointer}
.reminder-check:checked{filter:grayscale(1) opacity(0.6)}
.reminder-label-wrapper{display:flex;align-items:center;gap:4px;padding:6px 12px;border-radius:8px;cursor:pointer}
.reminder-emoji{font-size:14px}
.reminder-text{flex:1}
.reminder-text.done{text-decoration:line-through;color:#9aa5b1 !important}

/* 메모 헤더 */
.memo__header{
  margin-bottom:8px;
  display:flex;
  align-items:center;
  gap:8px;
}
.memo__datepick{
  font-size:12px;
  color:#64748b;
  display:flex;
  align-items:center;
  gap:6px;
}
.memo__datepick input[type="date"]{
  padding:6px 10px;
  border:1px solid #e5e7eb;
  border-radius:8px;
  font-size:12px;
  background:#f8fafc;
  min-width:130px;
  position:relative;
  z-index:1;
}
.memo__datepick input[type="date"]:focus{
  outline:none;
  border-color:#5C8DFF;
  background:#fff;
}

/* 메모 입력 */
.memo__add{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin-bottom:8px}
.memo__add textarea{
  width:100%;
  padding:7px 10px;
  border:1px solid #e5e7eb;
  border-radius:8px;
  background:#f8fafc;
  font-size:13px;
  font-family:"Noto Sans","Noto Sans KR",sans-serif;
  resize:vertical;
  transition:all 0.2s;
}
.memo__add textarea:focus{
  outline:none;
  border-color:#5C8DFF;
  background:#fff;
  box-shadow:0 0 0 2px rgba(92,141,255,0.1);
}
.memo__add .btn{
  padding:7px 12px;
  border:1px solid #5C8DFF;
  border-radius:8px;
  background:#5C8DFF;
  color:#fff;
  font-size:15px;
  font-weight:700;
  cursor:pointer;
  transition:all 0.2s;
}
.memo__add .btn:hover{
  background:#4A7AEE;
  transform:translateY(-1px);
  box-shadow:0 2px 8px rgba(92,141,255,0.25);
}
/* 메모 아이템 */
#memoList .memo-item{
  display:grid !important;
  grid-template-columns:1fr auto !important;
  align-items:center;
  gap:8px;
  padding:6px 8px;
  border-radius:6px;
  background:#f8fafc;
  transition:all 0.2s;
  border:1px solid transparent;
}
#memoList .memo-item:hover{
  background:#ffffff;
  border-color:#e5e7eb;
}
#memoList .memo-text{
  flex:1;
  font-size:13px !important;
  font-family:"Noto Sans","Noto Sans KR",sans-serif !important;
  line-height:1.5 !important;
  color:#1f2937;
  cursor:pointer;
  padding:2px 4px;
}
#memoList .memo-menu-btn{
  width:28px;
  height:28px;
  padding:0;
  border:none;
  background:transparent;
  color:#94a3b8;
  font-size:16px;
  cursor:pointer;
  border-radius:6px;
  transition:all 0.2s;
  flex-shrink:0;
  display:flex;
  align-items:center;
  justify-content:center;
}
#memoList .memo-menu-btn:hover{
  background:#e2e8f0;
  color:#64748b;
}

/* 리스트 */
.todo__list,.memo__list{list-style:none;margin:0;padding:5px 0;display:flex;flex-direction:column;gap:3px}
aside.right .todo-item{display:flex;align-items:center;gap:2px}
.todo-checkbox{width:16px;height:16px;cursor:pointer;flex-shrink:0;margin-right:2px}
.todo-emoji{font-size:16px}
.todo-item .text{
  flex:1;
  padding:6px 12px;
  border-radius:8px;
  cursor:pointer;
}
.todo-item .event-menu-btn{
  margin-left:auto;
}
.todo-item .text.done,.label-text.done{ text-decoration:line-through; color:#9aa5b1 !important; background-color:transparent !important; }

.color-btn{
  width:28px;height:28px;padding:4px;border:1px solid var(--line);border-radius:8px;
  background:#fff;display:inline-grid;place-items:center;cursor:pointer;
  background-image:url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"%3E%3Cdefs%3E%3ClinearGradient id="a" x1="0%25" y1="0%25" x2="100%25" y2="100%25"%3E%3Cstop offset="0%25" style="stop-color:rgb(255,0,0)"/%3E%3Cstop offset="16.67%25" style="stop-color:rgb(255,255,0)"/%3E%3Cstop offset="33.33%25" style="stop-color:rgb(0,255,0)"/%3E%3Cstop offset="50%25" style="stop-color:rgb(0,255,255)"/%3E%3Cstop offset="66.67%25" style="stop-color:rgb(0,0,255)"/%3E%3Cstop offset="83.33%25" style="stop-color:rgb(255,0,255)"/%3E%3Cstop offset="100%25" style="stop-color:rgb(255,0,0)"/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx="12" cy="12" r="10" fill="none" stroke="url(%23a)" stroke-width="4"/%3E%3C/svg%3E');
  background-size:20px 20px;
  background-position:center;
  background-repeat:no-repeat;
  font-size:0;
}
.del-btn{
  width:28px;height:28px;padding:0;border:1px solid var(--line);border-radius:8px;
  background:#fff;display:inline-grid;place-items:center;cursor:pointer;
}
.event-menu-btn{
  width:28px;height:28px;padding:0;border:1px solid var(--line);border-radius:8px;
  background:#fff;display:inline-grid;place-items:center;cursor:pointer;
  font-size:18px;
  font-weight:700;
  color:#64748b;
  transition:all 0.2s;
}
.event-menu-btn:hover{
  background:#f1f5f9;
  color:#5C8DFF;
  transform:scale(1.05);
}
.event-menu-popup{
  position:fixed;
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  box-shadow:0 4px 12px rgba(0,0,0,0.15);
  padding:8px;
  z-index:9999;
  min-width:160px;
  max-height:400px;
  overflow-y:auto;
}
.event-menu-popup .menu-item{
  width:100%;
  padding:10px 12px;
  border:none;
  background:transparent;
  text-align:left;
  cursor:pointer;
  border-radius:8px;
  font-size:14px;
  transition:all 0.15s;
  display:block;
  margin:2px 0;
}
.event-menu-popup .menu-item:hover{
  background:#f1f5f9;
  color:#5C8DFF;
}
.event-menu-popup .menu-item:disabled{
  opacity:0.55;
  cursor:not-allowed;
  color:#94a3b8;
}
.event-menu-popup .menu-item:disabled:hover{
  background:transparent;
  color:#94a3b8;
}
.event-menu-popup .menu-item.del{
  color:#ef4444;
}
.event-menu-popup .menu-item.del:hover{
  background:#fee2e2;
  color:#dc2626;
}

/* 사이드바 아바타 드롭다운 (저스트닥 카테고리형 설정 메뉴 톤) */
.avatar-menu-popup{
  position:fixed;
  background:#fff;
  border:1px solid var(--line,#e5e7eb);
  border-radius:12px;
  box-shadow:0 8px 24px rgba(0,0,0,0.12);
  padding:10px 8px;
  z-index:9999;
  min-width:240px;
  width:max-content;
  max-width:min(280px, calc(100vw - 24px));
  max-height:min(420px, calc(100vh - 24px));
  overflow-y:auto;
  box-sizing:border-box;
}
.avatar-menu-popup .avatar-menu-section-title{
  display:block;
  padding:8px 12px 4px;
  margin:0;
  font-size:11px;
  font-weight:600;
  letter-spacing:0.02em;
  color:#94a3b8;
  text-align:left;
  user-select:none;
}
.avatar-menu-popup .avatar-menu-item{
  width:100%;
  padding:9px 12px;
  border:none;
  background:transparent;
  text-align:left;
  cursor:pointer;
  border-radius:8px;
  font-size:14px;
  line-height:1.35;
  transition:background 0.15s, color 0.15s;
  display:block;
  margin:1px 0;
  color:#1f2937;
  font-family:inherit;
  box-sizing:border-box;
}
.avatar-menu-popup .avatar-menu-item:hover{
  background:#f1f5f9;
  color:#5C8DFF;
}
.avatar-menu-popup .avatar-menu-item.avatar-menu-item--readonly{
  cursor:default;
  color:#64748b;
  font-size:13px;
  word-break:break-all;
}
.avatar-menu-popup .avatar-menu-item.avatar-menu-item--readonly:hover{
  background:transparent;
  color:#64748b;
}
.avatar-menu-popup .avatar-menu-item.avatar-menu-item--danger{
  color:#ef4444;
}
.avatar-menu-popup .avatar-menu-item.avatar-menu-item--danger:hover{
  background:#fee2e2;
  color:#dc2626;
}
.avatar-menu-popup .avatar-menu-divider{
  height:0;
  border:none;
  border-top:1px solid #e5e7eb;
  margin:8px 8px;
}
.avatar-menu-popup .avatar-menu-lang-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  width:100%;
  padding:8px 12px;
  box-sizing:border-box;
  margin:1px 0;
}
.avatar-menu-popup .avatar-menu-lang-label{
  font-size:14px;
  color:#1f2937;
  flex-shrink:0;
}
.avatar-menu-popup .avatar-menu-lang-toggle{
  display:inline-flex;
  align-items:center;
  gap:2px;
  background:#f1f5f9;
  border-radius:999px;
  padding:2px;
  flex-shrink:0;
}
.avatar-menu-popup .avatar-menu-lang-btn{
  border:none;
  background:transparent;
  color:#94a3b8;
  font-size:12px;
  font-weight:700;
  font-family:inherit;
  padding:4px 10px;
  border-radius:999px;
  cursor:pointer;
  line-height:1.2;
  transition:background 0.15s, color 0.15s;
}
.avatar-menu-popup .avatar-menu-lang-btn.active{
  background:#111827;
  color:#fff;
}
.avatar-menu-popup .avatar-menu-lang-btn:not(.active):hover{
  color:#475569;
}

/* 반복 설정 모달 */
.repeat-modal{
  position:fixed;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%);
  background:#fff;
  border-radius:16px;
  box-shadow:0 8px 32px rgba(0,0,0,0.2);
  padding:24px;
  z-index:10000;
  width:400px;
  max-width:calc(100vw - 32px);
  box-sizing:border-box;
}
.repeat-modal-overlay{
  position:fixed;
  top:0;
  left:0;
  right:0;
  bottom:0;
  background:rgba(0,0,0,0.4);
  z-index:9999;
}
.repeat-modal-header{
  font-size:18px;
  font-weight:700;
  margin-bottom:20px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.repeat-modal-close{
  border:none;
  background:transparent;
  font-size:24px;
  color:#94a3b8;
  cursor:pointer;
  padding:0;
  width:32px;
  height:32px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:8px;
  transition:all 0.2s;
}
.repeat-modal-close:hover{
  background:#f1f5f9;
  color:#64748b;
}
.repeat-option{
  padding:12px 16px;
  border:1px solid #e5e7eb;
  border-radius:8px;
  margin-bottom:8px;
  cursor:pointer;
  transition:all 0.2s;
  display:flex;
  align-items:center;
  gap:12px;
}
.repeat-option:hover{
  background:#f8fafc;
  border-color:#5C8DFF;
}
.repeat-option input[type="radio"]{
  width:18px;
  height:18px;
  cursor:pointer;
}
.repeat-option label{
  flex:1;
  cursor:pointer;
  font-size:14px;
}
.repeat-modal-footer{
  display:flex;
  gap:8px;
  margin-top:20px;
}
.repeat-modal-footer button{
  flex:1;
  padding:10px;
  border:none;
  border-radius:8px;
  font-size:14px;
  font-weight:600;
  cursor:pointer;
  transition:all 0.2s;
}
.repeat-modal-footer .btn-cancel{
  background:#f1f5f9;
  color:#64748b;
}
.repeat-modal-footer .btn-cancel:hover{
  background:#e2e8f0;
}
.repeat-modal-footer .btn-confirm{
  background:#5C8DFF;
  color:#fff;
}
.repeat-modal-footer .btn-confirm:hover{
  background:#4A7AEE;
}

/* 일정 상세 편집 모달 */
.event-detail-modal{
  position:fixed;
  bottom:0;
  left:0;
  right:0;
  background:#fff;
  border-radius:20px 20px 0 0;
  max-height:90vh;
  overflow-y:auto;
  z-index:10001;
  animation:slideUp 0.3s ease-out;
  box-shadow:0 -4px 20px rgba(0,0,0,0.15);
}
@keyframes slideUp{
  from{transform:translateY(100%);}
  to{transform:translateY(0);}
}
.event-detail-title{
  width:100%;
  border:none;
  padding:20px 20px 12px;
  font-size:18px;
  font-weight:600;
  outline:none;
  background:transparent;
}
.event-detail-tools{
  display:flex;
  gap:8px;
  padding:0 20px 16px;
  border-bottom:1px solid #f1f5f9;
}
.tool-btn{
  width:40px;
  height:40px;
  border:1px solid #e5e7eb;
  border-radius:10px;
  background:#fff;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:20px;
  transition:all 0.2s;
}
.tool-btn:hover{
  background:#f8fafc;
  border-color:#5C8DFF;
}
.event-detail-row{
  display:flex;
  align-items:center;
  padding:16px 20px;
  border-bottom:1px solid #f1f5f9;
  gap:12px;
}
.event-detail-row.delete-row{
  color:#ef4444;
  cursor:pointer;
}
.event-detail-row.delete-row:hover{
  background:#fef2f2;
}
.row-icon{
  font-size:20px;
  width:24px;
  text-align:center;
}
.row-label{
  flex:1;
  font-size:14px;
  font-weight:500;
}
.row-value{
  font-size:14px;
  color:#64748b;
}
.toggle-switch{
  width:44px;
  height:24px;
  appearance:none;
  background:#cbd5e1;
  border-radius:12px;
  position:relative;
  cursor:pointer;
  transition:all 0.3s;
  outline:none;
}
.toggle-switch:checked{
  background:#5C8DFF;
}
.toggle-switch::before{
  content:'';
  position:absolute;
  width:20px;
  height:20px;
  border-radius:50%;
  background:#fff;
  top:2px;
  left:2px;
  transition:all 0.3s;
}
.toggle-switch:checked::before{
  left:22px;
}
.date-inputs{
  display:flex;
  align-items:center;
  gap:8px;
  flex:1;
}
.date-inputs input{
  flex:1;
  padding:8px 12px;
  border:1px solid #e5e7eb;
  border-radius:8px;
  font-size:14px;
  outline:none;
}
.date-inputs input:focus{
  border-color:#5C8DFF;
}
.event-detail-row input[type="time"]{
  flex:1;
  padding:8px 12px;
  border:1px solid #e5e7eb;
  border-radius:8px;
  font-size:14px;
  outline:none;
}
.event-detail-row input[type="time"]:focus{
  border-color:#5C8DFF;
}
.event-detail-row input[type="time"]:disabled{
  background:#f8fafc;
  color:#94a3b8;
}

/* 팔레트 */
.color-pop-advanced{
  position:fixed;z-index:10060;background:#fff;border:1px solid var(--line);border-radius:16px;
  padding:16px;box-shadow:var(--shadow);max-width:min(400px, calc(100vw - 20px));
  box-sizing:border-box;max-height:min(80vh, 560px);overflow-y:auto;
}
.color-row{display:flex;gap:8px;margin-bottom:12px;flex-wrap:wrap}
.color-swatch{
  width:32px;height:32px;border-radius:50%;border:2px solid transparent;cursor:pointer;
  transition:all 0.2s;box-shadow:0 2px 6px rgba(0,0,0,0.1);flex-shrink:0;
}
.color-swatch.no-color{
  display:grid;place-items:center;text-align:center;
  background:#fff;border:2px solid #e2e8f0;color:#64748b;font-size:11px;font-weight:600;
}
[data-theme="dark"] .color-swatch.no-color{
  background:#1f1f1f;border-color:#3a3a3a;color:#9ca3af;
}
.color-btn:hover{
  transform:scale(1.05);
  box-shadow:0 2px 8px rgba(0,0,0,0.15);
}
.color-swatch:hover{border-color:#5C8DFF;transform:scale(1.15);box-shadow:0 4px 10px rgba(0,0,0,0.2)}
.color-swatch.rainbow{border:none}
.color-grid{
  display:grid;
  grid-template-columns:repeat(12, 24px);
  gap:4px;
  margin-bottom:12px;
}
.color-swatch-small{
  width:24px;height:24px;border-radius:4px;cursor:pointer;transition:transform 0.15s;
  border:1px solid rgba(15,23,42,0.12);box-sizing:border-box;
}
.color-swatch-small:hover{transform:scale(1.2);box-shadow:0 2px 6px rgba(0,0,0,0.2)}
.color-section-title{
  font-size:11px;color:#64748b;margin-bottom:8px;font-weight:600;
}
@media (max-width:640px){
  .color-pop-advanced{
    max-width:calc(100vw - 24px);
    max-height:min(80vh, 560px);
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
  }
  .color-grid{
    grid-template-columns:repeat(6, minmax(0, 1fr));
    width:100%;
  }
  .color-swatch-small{
    width:100%;
    height:auto;
    aspect-ratio:1;
  }
}
[data-theme="dark"] .color-swatch-small{
  border-color:rgba(255,255,255,0.18);
}

/* 이모티콘 선택기 */
.emoji-picker{
  position:absolute;z-index:10040;background:#fff;border:1px solid var(--line);border-radius:16px;
  padding:0;box-shadow:var(--shadow);width:320px;max-width:calc(100vw - 20px);
  max-height:300px;display:flex;flex-direction:column;overflow:hidden;
}
.emoji-picker-header{
  flex-shrink:0;padding:12px;border-bottom:1px solid var(--line);background:#fff;
}
.emoji-picker-search{
  width:100%;box-sizing:border-box;padding:8px 10px;border:1px solid #e2e8f0;
  border-radius:8px;font-size:13px;outline:none;font-family:inherit;
}
.emoji-picker-search:focus{border-color:#5C8DFF;}
.emoji-picker-body{
  flex:1;min-height:0;overflow-y:auto;padding:8px 12px 12px;
}
.emoji-picker-empty{
  padding:20px 8px;text-align:center;color:#94a3b8;font-size:13px;
}
.emoji-category-title{
  font-size:12px;color:#64748b;font-weight:600;margin:0 0 8px 0;
}
.emoji-grid{
  display:grid;grid-template-columns:repeat(8,1fr);gap:4px;margin-bottom:4px;
}
.emoji-item{
  width:32px;height:32px;border:none;background:transparent;
  font-size:20px;cursor:pointer;border-radius:8px;
  transition:background 0.15s;padding:0;
}
.emoji-item:hover{background:#f1f5f9;transform:scale(1.1)}

/* 날짜 선택기 */
.date-picker{
  position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);
  z-index:9999;background:#fff;border-radius:16px;box-shadow:0 8px 28px rgba(0,0,0,0.16);
  width:260px;max-height:340px;overflow:hidden;
}
.date-picker-header{
  padding:10px;text-align:center;background:#f8f9fb;
}
.date-picker-title{
  font-size:14px;font-weight:700;color:#334155;
}
.date-picker-body{
  display:grid;grid-template-columns:1fr 1fr;height:220px;overflow:hidden;
}
.date-picker-col{
  overflow-y:auto;padding:6px;border-right:1px solid #e2e8f0;
}
.date-picker-col:last-child{border-right:none}
.date-picker-item{
  padding:6px 4px;text-align:center;font-size:13px;color:#475569;
  cursor:pointer;border-radius:8px;transition:all 0.12s;
}
.date-picker-item:hover{background:#f1f5f9}
.date-picker-item.selected{
  background:#5C8DFF;color:#fff;font-weight:700;
}
.date-picker-close{
  padding:15px;text-align:center;border-top:1px solid #e2e8f0;
}
.date-picker-col::-webkit-scrollbar{width:4px}
.date-picker-col::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:4px}

/* 달력 라벨/점 */
.calendar__weekdays span{font-size:var(--cal-weekday-font)}
.calendar__weekdays span{
  padding:6px 0;
  font-weight:600;
  color:#475569;
  text-align:center;
  border-right:1px solid var(--line);
}
.calendar__weekdays span:last-child{border-right:none}
/* === [달력 날짜 숫자 폰트사이즈: .day__num] === */
.day__num{font-size:var(--cal-daynum-font)}
.labels{position:absolute;left:0;right:0;top:18px;display:flex;flex-direction:column;gap:0}
.label{display:flex;align-items:center;gap:0px;min-width:0}
.label-checkbox{width:10px;height:10px;appearance:auto;cursor:pointer;flex-shrink:0;margin:0 1px}
.label-checkbox:checked{filter:grayscale(1) opacity(0.6)}
.label-content{display:flex;align-items:center;gap:1px;flex:1;min-width:0;padding-left: 4px !important;border-radius:0}
.label-emoji{font-size:10px;flex-shrink:0;margin-right:1px}
.label-text{
  font-size:12px;
  color:#000;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  flex:1;
  line-height:1.25;
  font-weight:400;
}
.label-more{
  font-size:9px;
  color:#9ca3af;
  font-weight:600;
  padding:0;
  background:transparent;
  border-radius:0;
  line-height:1.2;
}
.dots{position:absolute;left:8px;bottom:8px;display:flex;gap:4px}
.dot{display:none}

/* 달력 상단바 */
.calendar__topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 20px;
  margin-bottom:12px;
}

/* 이달의 목표 (1줄) */
/* 통합 헤더: 이달의 목표 + 날짜 네비게이션 */
.card__header-unified{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:8px 12px;
  border-bottom:1px solid var(--line);
}
.monthly-goal-input-unified{
  flex:1 1 auto;
  width:100%;
  max-width:none;
  padding:6px 10px;
  border:1px solid #e5e7eb;
  background:#f8f9fb;
  color:#1f2937;
  font-size:14px;
  font-weight:600;
  outline:none;
  border-radius:8px;
  transition:all 0.2s;
  min-width:0;
}
.goal-bar{
  position:relative;
  display:flex !important;
  align-items:center;
  gap:8px;
  width:100% !important;
  max-width:none !important;
  min-width:0;
  flex:1 1 auto;
  align-self:stretch;
}
.goal-style-btn{
  width:34px;
  height:32px;
  border:1px solid #d5d9e2;
  border-radius:8px;
  background:#fff;
  cursor:pointer;
  font-size:18px;
  line-height:1;
  display:grid;
  place-items:center;
  color:#111827;
  transition:background .15s ease, box-shadow .15s ease;
  flex:0 0 auto;
  min-width:34px;
}
.goal-style-btn:hover{background:#f4f6fb; box-shadow:0 4px 12px rgba(0,0,0,0.08);}
.goal-style-btn:active{transform:translateY(1px);}
.goal-emoji{
  position:absolute;
  left:8px;
  font-size:16px;
  line-height:1;
  pointer-events:none;
}
.goal-bar .monthly-goal-input-unified{
  padding-left:28px;
}
.card__header-unified .goal-bar{
  width:100%;
  max-width:none;
  min-width:0;
}
.goal-style-menu{
  position:absolute;
  right:0;
  top:40px;
  background:#fff;
  border:1px solid #e5e7eb;
  box-shadow:0 12px 30px rgba(0,0,0,0.14);
  border-radius:12px;
  padding:10px;
  display:grid;
  gap:8px;
  min-width:160px;
  max-width:180px;
  z-index:6000;
}
.goal-style-menu .row{display:flex;align-items:center;gap:8px;font-size:13px;color:#374151;}
.goal-style-menu .row .label{min-width:48px;}
.goal-style-menu .swatch-btn,
.goal-style-menu .emoji-btn-small{
  padding:6px 10px;
  border:1px solid #d5d9e2;
  border-radius:8px;
  background:#f8fafc;
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
}
.goal-style-menu .swatch{width:18px;height:18px;border-radius:6px;border:1px solid #cbd5e1;display:inline-block;}
.goal-style-menu select{flex:1;padding:6px 8px;border:1px solid #e5e7eb;border-radius:8px;}
.goal-style-menu .menu-actions{display:flex;justify-content:flex-end;gap:6px;}
.goal-style-menu .menu-btn{padding:6px 10px;border:1px solid #d5d9e2;border-radius:8px;background:#f8fafc;cursor:pointer;}
.goal-style-menu .menu-btn.primary{background:#4A7AEE;color:#fff;border-color:#4A7AEE;}
.monthly-goal-input-unified::placeholder{
  color:#9ca3af;
  font-weight:400;
}
.monthly-goal-input-unified:focus{
  background:#ffffff;
  border-color:#5C8DFF;
  box-shadow:0 0 0 2px rgba(92,141,255,0.1);
}
.nav-controls{
  display:flex;
  align-items:center;
  gap:8px;
  flex-shrink:0;
}
#brand-header .brand-header__nav{
  margin-left:0;
}
#brand-header #todayBtn.icon-btn{
  font-size:14px;
  font-weight:700;
  min-width:32px;
}
#dailyPage .daily-period-today-btn{
  border:1px solid #e2e8f0;
  background:var(--card);
  color:#475569;
  border-radius:6px;
  font-size:11px;
  font-weight:600;
  line-height:1;
  padding:2px 8px;
  margin-left:4px;
  cursor:pointer;
}
#dailyPage .daily-period-today-btn:hover{
  background:#f8fafc;
  color:#5C8DFF;
  border-color:#bfdbfe;
}
.header-ym-compact{
  font-size:15px;
  font-weight:700;
  color:var(--text);
  white-space:nowrap;
}
.btn-today{
  padding:6px 12px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#f6f8ff;
  cursor:pointer;
  font-size:13px;
  font-weight:600;
  transition:all 0.2s;
  white-space:nowrap;
}
.btn-today:hover{
  background:#e0e7ff;
}

.goal-container{
  margin:2px 0 4px;
}
.monthly-goal-single{
  display:flex;
  align-items:center;
  gap:8px;
  background:#f8f9fb;
  padding:4px 8px;
  border-radius:6px;
  position:relative;
}
.monthly-goal-input-single{
  flex:1;
  padding:4px 8px;
  border:1px solid transparent;
  background:transparent;
  color:#1f2937;
  font-size:13px;
  font-weight:700;
  outline:none;
  border-radius:4px;
  transition:all 0.2s;
}
.goal-menu-btn{
  width:24px;
  height:24px;
  padding:0;
  border:none;
  background:transparent;
  color:#94a3b8;
  font-size:18px;
  cursor:pointer;
  border-radius:4px;
  transition:all 0.2s;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
}
.goal-menu-btn:hover{
  background:#e2e8f0;
  color:#64748b;
}
.monthly-goal-input-single::placeholder{
  color:#9ca3af;
}
.monthly-goal-input-single:focus{
  background:#ffffff;
  border-color:#5C8DFF;
  box-shadow:0 0 0 2px rgba(92,141,255,0.1);
}
.home-reminder-input-wrapper{
  display:none;
  align-items:center;
  gap:6px;
  margin-top:4px;
}
.home-reminder-input-wrapper.active{
  display:flex;
}
.home-reminder-input{
  flex:1;
  padding:6px 8px;
  border:1px solid #e5e7eb;
  background:#ffffff;
  color:#1f2937;
  font-size:13px;
  outline:none;
  line-height:1.5;
  border-radius:4px;
  transition:all 0.2s;
}
.home-reminder-input::placeholder{
  color:#9ca3af;
}
.home-reminder-input:focus{
  background:#f9fafb;
  border-color:#5C8DFF;
  box-shadow:0 0 0 2px rgba(92,141,255,0.1);
}

/* 다크모드일 때만 블랙 배경 적용 */
[data-theme="dark"] .monthly-goal{
  background:#2d2d2d !important;
  box-shadow:0 2px 8px rgba(0,0,0,0.15) !important;
}
[data-theme="dark"] .monthly-goal__header{
  color:#9ca3af !important;
}
[data-theme="dark"] .monthly-goal-item:hover{
  background:rgba(255,255,255,0.03) !important;
}
[data-theme="dark"] .monthly-goal-text{
  color:#9ca3af !important;
}
[data-theme="dark"] .monthly-goal-input{
  color:#e5e7eb !important;
  background:#1f2937 !important;
  border-color:#374151 !important;
}
[data-theme="dark"] .monthly-goal-input::placeholder{
  color:#6b7280 !important;
}
[data-theme="dark"] .monthly-goal-input:focus{
  background:#111827 !important;
  border-color:#5C8DFF !important;
  box-shadow:0 0 0 2px rgba(92,141,255,0.2) !important;
}

[data-theme="dark"] .home-reminder{
  background:#2d2d2d !important;
  box-shadow:0 2px 8px rgba(0,0,0,0.15) !important;
}
[data-theme="dark"] .home-reminder__header{
  color:#9ca3af !important;
}
[data-theme="dark"] .home-reminder-item:hover{
  background:rgba(255,255,255,0.03) !important;
}
[data-theme="dark"] .home-reminder-check:checked{
  filter:grayscale(1) opacity(0.5) !important;
}
[data-theme="dark"] .home-reminder-text{
  color:#9ca3af !important;
}
[data-theme="dark"] .home-reminder-text.done{
  color:#6b7280 !important;
}
[data-theme="dark"] .del-btn{
  color:#6b7280 !important;
}
[data-theme="dark"] .del-btn:hover{
  color:#ef4444 !important;
}
[data-theme="dark"] .home-reminder-input{
  color:#e5e7eb !important;
  background:#1f2937 !important;
  border-color:#374151 !important;
}
[data-theme="dark"] .home-reminder-input::placeholder{
  color:#6b7280 !important;
}
[data-theme="dark"] .home-reminder-input:focus{
  background:#111827 !important;
  border-color:#5C8DFF !important;
  box-shadow:0 0 0 2px rgba(92,141,255,0.2) !important;
}

/* 달력 크기 조절 */
.calendar-wrapper{
  position:relative;
  display:flex;
  flex-direction:column;
  flex:1;
  min-height:0;
}
.calendar{display:flex;flex-direction:column;height:100%;overflow:visible}
.calendar__weekdays{
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
  gap:0;
  flex-shrink:0;
  margin:0;
  padding:0;
  border:1px solid var(--line);
  border-bottom:none;
  border-radius:12px 12px 0 0;
  background:#fff;
  overflow:hidden;
}
.sidebar__top{display:flex;gap:8px;align-items:center;justify-content:space-between;margin-bottom:12px}
.sidebar__top .menu-btn{width:100%;margin:0;flex:1;padding:10px 12px;border-radius:12px}
.menu-btn--pill{flex:1;margin:0;padding:10px 12px;border-radius:12px}
.calendar__grid{
  position:relative;
  flex:1;
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
  grid-auto-rows:1fr;
  gap:0;
  border:1px solid var(--line);
  border-top:none;
  border-radius:0 0 12px 12px;
  overflow:visible;
  background:#fff;
}
.calendar-range-overlay{
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:1;
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
  gap:0;
}
.calendar-range-bar{
  pointer-events:auto;
  cursor:pointer;
  z-index:1;
  box-sizing:border-box;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  text-align:left;
  font-size:12px;
  line-height:1.25;
  padding:0 6px 0 8px;
  min-width:0;
}
.calendar-range-bar__text{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#000;
  min-width:0;
  font-size:12px;
  line-height:1.25;
  font-weight:400;
}
.calendar-range-bar__emoji{
  flex-shrink:0;
  margin-right:2px;
  font-size:12px;
  line-height:1;
}
.calendar__grid .day{
  transition:background-color .15s ease,color .15s ease,border-color .15s ease;
  border-right:1px solid var(--line);
  border-bottom:1px solid var(--line);
  border-radius:0;
  margin:0;
  box-sizing:border-box;
  padding:2px;
  overflow:hidden;
  position:relative;
}
.calendar__grid .day:nth-child(7n){border-right:none}
.calendar__grid .day:nth-last-child(-n+7){border-bottom:none}
.calendar__grid .day.day--selected{border:0 !important;border-right:1px solid var(--line);border-bottom:1px solid var(--line);box-shadow:inset 0 0 0 2px #5C8DFF;background:#EEF2FF}
.calendar__grid .day.day--selected:nth-child(7n){border-right:none}
.calendar__grid .day.day--selected:nth-last-child(-n+7){border-bottom:none}
.day--outside{background:#fff;}
.day--outside .day__num{color:#9aa3b8 !important}


.memo-flag{
  position:absolute;
  top:6px;
  right:6px;
  width:20px;
  height:20px;
  border-radius:6px;
  background:transparent;
  color:inherit;
  font-size:15px;
  font-weight:normal;
  line-height:1;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:none;
}
.day--selected .memo-flag{box-shadow:none;}
[data-theme="dark"] .memo-flag{background:transparent;color:inherit;box-shadow:none;}
[data-theme="dark"] .day--selected .memo-flag{box-shadow:none;}

/* 주말 색 */
.calendar__weekdays span:nth-child(1), .calendar__grid .day:nth-child(7n+1) .day__num{color:#ef4444}
.calendar__weekdays span:nth-child(7), .calendar__grid .day:nth-child(7n) .day__num{color:#5C8DFF}

/* 타이머 */
.timer__ring{position:relative;width:220px;height:220px;margin:4px auto 8px;display:flex;align-items:center;justify-content:center}
.timer__display{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:28px;font-weight:800}

/* 사용법 섹션 */
.usage-section{
  margin-top:16px;
  padding:16px;
  background:#f8f9fb;
  border-radius:12px;
  border:1px solid var(--line);
}
.usage-title{
  font-size:18px;
  font-weight:700;
  color:var(--text);
  margin:0 0 16px 0;
  text-align:center;
  padding-bottom:12px;
  border-bottom:2px solid var(--line);
}
.usage-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:20px;
}
.usage-column{
  background:#ffffff;
  padding:16px;
  border-radius:8px;
  border:1px solid var(--line);
}
.usage-subtitle{
  font-size:15px;
  font-weight:700;
  color:var(--primary);
  margin:0 0 12px 0;
  padding-bottom:8px;
  border-bottom:1px solid #e5e7eb;
}
.usage-text{
  font-size:13px;
  line-height:1.7;
  color:#475569;
}

/* 플로팅 추가 버튼 */
.fab-add{
  position:absolute;
  right:16px;
  bottom:16px;
  width:58px;
  height:58px;
  border-radius:50%;
  border:2px solid #1f2933;
  background:#ffffff;
  color:#1f2933;
  font-size:30px;
  font-weight:800;
  box-shadow:0 10px 24px rgba(0,0,0,0.16);
  cursor:pointer;
  z-index:5000;
  display:grid;
  place-items:center;
  transition:transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
  opacity:1;
  visibility:visible;
  pointer-events:auto;
}
.fab-add:hover{background:#f7f9fb; box-shadow:0 14px 30px rgba(0,0,0,0.22); transform:translateY(-1px);}
.fab-add:active{transform:translateY(1px);}
.fab-menu{
  position:absolute;
  right:16px;
  bottom:84px;
  display:none;
  flex-direction:column;
  gap:8px;
  z-index:4999;
}
.fab-menu.fab-menu--open{display:flex;}
.fab-action{
  border:none;
  border-radius:12px;
  background:#fff;
  color:#111827;
  font-weight:700;
  padding:12px 16px;
  box-shadow:0 10px 30px rgba(0,0,0,0.16);
  cursor:pointer;
  min-width:140px;
  text-align:right;
}
.fab-action:hover{background:#f2f6ff; color:#5C8DFF;}

.usage-text p{
  margin:0 0 12px 0;
}
.usage-text ul{
  margin:8px 0;
  padding-left:20px;
}
.usage-text li{
  margin:6px 0;
}
.usage-text strong{
  color:var(--primary);
  font-weight:600;
}
.timer__eta{display:block;text-align:center;font-size:12px;color:#6b7280;background:#eef2ff;border-radius:999px;width:max-content;margin:0 auto 8px;padding:4px 10px}
.timer__inputs{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:4px 0 8px}
.timer__inputs input{width:100%;box-sizing:border-box}

/* 위젯: 스크롤 제거 */
.widget__body{overflow:auto}
.widget__body::-webkit-scrollbar{width:0;height:0}
.widget__body{scrollbar-width:none;-ms-overflow-style:none}

/* 위젯 버튼 공통 (색상/삭제) */
.widget .color-btn,.widget .del-btn{
  width:32px;height:28px;padding:0;border:1px solid #d9e0eb;border-radius:10px;background:#f7f9fc;display:inline-grid;place-items:center;cursor:pointer;font-size:15px;line-height:1;color:#475569;
}
.widget .color-btn:hover,.widget .del-btn:hover{background:#eef2f8;border-color:#cdd5e2}

/* 미니 달력(메인 문서용) */
.widget--calendar .mini-cal__head{display:flex;gap:8px;align-items:center;margin-bottom:6px;font-size:12px}
.widget--calendar .mini-cal__days{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;margin-bottom:2px}
.widget--calendar .mini-cal__days span{font-size:11px;font-weight:600;color:#475569;text-align:center}
.widget--calendar .mini-cal__grid{position:relative;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:0;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:#fff;width:100%;min-width:0}
.widget--calendar .mini-day{position:relative;display:flex;flex-direction:column;gap:3px;padding:4px 2px 2px;border-right:1px solid var(--line);border-bottom:1px solid var(--line);background:#fff;min-height:0;min-width:0;box-sizing:border-box}
.widget--calendar .mini-day:nth-child(7n){border-right:none}
.widget--calendar .mini-day:nth-last-child(-n+7){border-bottom:none}
.widget--calendar .mini-day__num{display:block;height:16px;line-height:16px;font-size:11px;font-weight:700;color:#1f2937;position:relative;z-index:2;overflow:hidden}
.widget--calendar .mini-day--out .mini-day__num{color:#cbd5e1}
.widget--calendar .mini-day--sel{outline:2px solid #EEF2FF}
.widget--calendar .mini-labels{display:flex;flex-direction:column;gap:2px;overflow:hidden;flex:1;position:relative;z-index:1}
.widget--calendar .mini-label{display:flex;align-items:center;gap:3px;font-size:13px;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#1f2937;padding:0;border-radius:0;background:transparent}
.widget--calendar .mini-label.done{color:#94a3b8;text-decoration:line-through;background:transparent}
.widget--calendar .mini-range-overlay{position:absolute;inset:0;pointer-events:none;z-index:1;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:0}
.widget--calendar .mini-range-bar{pointer-events:none;box-sizing:border-box;overflow:hidden;display:flex;align-items:center;justify-content:flex-start;text-align:left;font-size:10px;line-height:1.15;padding:0 2px 0 4px;min-width:0;color:#111827}
.widget--calendar .mini-range-bar__text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.widget--calendar .mini-more{margin-left:auto;font-size:10px;color:#4A7AEE;font-weight:600}
.widget--calendar .mini-dots{display:none}
.widget--calendar .mini-checkbox{width:12px;height:12px;appearance:auto;cursor:pointer;flex-shrink:0}
.widget--calendar .dot{width:6px;height:6px;border-radius:50%}

/* 푸터 */
.footer{
  background:#ffffff;
  border-top:1px solid var(--line);
  padding:20px 0;
  margin-top:auto;
  grid-column:1/-1;
}
.footer-content{
  max-width:1200px;
  margin:0 auto;
  text-align:center;
  display:flex;
  flex-direction:column;
  align-items:center;
}
.footer-links{
  margin-bottom:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}
.footer-link{
  color:#64748b;
  text-decoration:none;
  font-size:13px;
  transition:color 0.2s;
}
.footer-link:hover{
  color:var(--primary);
}
.footer-divider{
  margin:0 12px;
  color:#cbd5e1;
}
.footer-copyright{
  color:#94a3b8;
  font-size:12px;
  margin:0;
}

/* 모달 팝업 */
.modal-overlay{
  position:fixed;
  top:0;
  left:0;
  right:0;
  bottom:0;
  background:rgba(0,0,0,0.5);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:10000;
  padding:20px;
}
.modal-content{
  background:#ffffff;
  border-radius:16px;
  max-width:800px;
  width:100%;
  max-height:80vh;
  overflow-y:auto;
  box-shadow:0 20px 60px rgba(0,0,0,0.3);
  position:relative;
}
.modal-header{
  padding:20px 24px;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.modal-title{
  font-size:20px;
  font-weight:700;
  color:var(--text);
  margin:0;
}
.modal-close{
  background:transparent;
  border:none;
  font-size:24px;
  color:#94a3b8;
  cursor:pointer;
  width:32px;
  height:32px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:6px;
  transition:all 0.2s;
}
.modal-close:hover{
  background:#f1f5f9;
  color:#64748b;
}
.modal-body{
  padding:24px;
  line-height:1.7;
  color:#475569;
}
.modal-body h3{
  font-size:18px;
  font-weight:700;
  color:var(--text);
  margin:24px 0 12px 0;
}
.modal-body h3:first-child{
  margin-top:0;
}
.modal-body p{
  margin:12px 0;
}
.modal-body ul{
  margin:12px 0;
  padding-left:24px;
}
.modal-body li{
  margin:8px 0;
}
.modal-body strong{
  color:var(--primary);
  font-weight:600;
}

/* 모바일 반응형 */
@media (max-width: 1024px) {
  .app{
    grid-template-columns:1fr;
    padding:4px;
    gap:8px;
  }
  .sidebar{
    display:none;
  }
  .main{
    grid-column:1;
  }
  .right{
    grid-column:1;
  }
  .card__header-unified{
    flex-direction:column;
    align-items:stretch;
    justify-content:flex-start;
    gap:8px;
    padding:8px;
  }
  .monthly-goal-input-unified{
    flex:1 1 auto !important;
    width:100% !important;
    max-width:none !important;
    min-width:0;
    font-size:13px;
    padding:6px 8px;
  }
  .nav-controls{
    width:100%;
    justify-content:center;
  }
  .usage-grid{
    grid-template-columns:1fr;
    gap:12px;
  }
  .footer{
    padding:16px 8px;
  }
  .modal-content{
    margin:20px;
    max-width:calc(100% - 40px);
  }
}

@media (max-width: 768px) {
  .calendar__grid{
    gap:0;
  }
  .day{
    min-height:100px;
  }
  .day__num{
    font-size:9px;
    top:4px;
    left:4px;
  }
  .label-text{
    font-size:10px;
  }
  .label-emoji{
    font-size:10px;
  }
  .labels{
    top:20px;
  }
  .datebox{
    padding:8px;
  }
  .event-datetime-row{
    flex-direction:column;
    gap:6px;
  }
  .fab-add{right:12px; bottom:16px; width:58px; height:58px; font-size:30px;}
  .fab-menu{right:12px; bottom:84px;}
  .event-date-group{
    width:100%;
  }
  .usage-section{
    padding:12px;
  }
  .usage-title{
    font-size:16px;
  }
  .usage-subtitle{
    font-size:14px;
  }
  .usage-text{
    font-size:12px;
  }
  
}

@media (max-width: 480px) {
  .app{
    padding:2px;
    gap:4px;
  }
  .card{
    border-radius:12px;
  }
  .card__header-unified{
    padding:6px;
  }
  .monthly-goal-input-unified{
    font-size:12px;
    padding:5px 8px;
  }
  .btn-today{
    padding:5px 10px;
    font-size:12px;
  }
  .icon-btn{
    width:28px;
    height:28px;
    font-size:14px;
  }
  .header-ym-compact{
    font-size:14px;
  }
  .calendar__weekdays span{
    font-size:10px;
  }
  .day{
    min-height:80px;
  }
  .day__num{
    font-size:8px;
  }
  .label-text{
    font-size:9px;
  }
  .usage-grid{
    gap:8px;
  }
  .usage-column{
    padding:12px;
  }
  .usage-title{
    font-size:15px;
    margin-bottom:12px;
  }
  .usage-subtitle{
    font-size:13px;
  }
  .usage-text{
    font-size:11px;
  }
  .footer-content{
    padding:0 12px;
  }
  .footer-link{
    font-size:11px;
  }
  .footer-copyright{
    font-size:10px;
  }
}

/* 소개 섹션 제목(h2) 가운데정렬 방지 */
#siteIntro .usage-title {
  text-align: left !important;
}

/* memo2_style_patch.css */

/* 모바일/태블릿에서 사이드바(메뉴) 숨김 해제 + 상단 가로 메뉴로 전환 */
@media (max-width: 1024px) {
  /* 기존에 display:none 걸려있어도 무조건 보이게 */
  aside.sidebar {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 8px;

    overflow-x: auto;
    -webkit-overflow-scrolling: touch;

    position: sticky;
    top: 0;
    z-index: 50;

    padding: 10px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 14px;
  }

  /* 앱 레이아웃을 1열로 */
  .app {
    grid-template-columns: 1fr !important;
  }

  /* 메뉴 버튼들이 가로로 넘치면 스크롤되도록 */
  aside.sidebar .menu-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    min-width: 110px;
  }

  /* 사이드바 아래 안내문(있다면)이 너무 커서 레이아웃을 망치면 숨김 */
  .sidebar .hint,
  .sidebar .help,
  .sidebar .desc {
    display: none !important;
  }
}

/* memo2_style_patch.css */

/* 모바일: 왼쪽 사이드바를 상단 가로 메뉴로 */
@media (max-width: 1024px) {
  /* 전체 레이아웃을 1열로 강제 */
  .app {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  /* 사이드바를 상단 가로 스크롤 메뉴로 */
  aside.sidebar {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;

    width: 100% !important;

    position: sticky !important;
    top: 0 !important;
    z-index: 999 !important;

    padding: 10px !important;
    background: var(--bg) !important;
    border: 1px solid var(--line) !important;
    border-radius: 14px !important;

    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* 메뉴 버튼들이 가로로 나열되게 */
  aside.sidebar .menu-btn {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    min-width: 96px !important;
  }

  /* 본문도 100% */
  main, .main, .content {
    width: 100% !important;
  }
}

/* === MOBILE NAV + SCROLL FIX (2026-01-04) === */
@media (max-width: 1024px){

  /* 모바일에서 아래 내용이 안 보이는(스크롤 막힘) 현상 방지 */
  html, body { height: auto !important; }
  body { overflow-y: auto !important; }

  /* grid 깨짐/클리핑 방지: 앱 전체를 세로 흐름으로 */
  .app{
    height: auto !important;
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  /* 모바일에서 메뉴 숨김 해제 + 상단 메뉴바로 */
  aside.sidebar{
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;  /* 가로 스크롤 대신 2줄로 자동 줄바꿈 */
    gap: 8px !important;

    position: sticky !important;
    top: 0 !important;
    z-index: 999 !important;

    padding: 10px !important;
    background: var(--bg) !important;
    border: 1px solid var(--line) !important;
    border-radius: 14px !important;
  }

  aside.sidebar .menu-btn{
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    min-width: 92px !important;
  }

  /* 본문이 숨겨지는 브라우저(웨일) 대비 */
  main, .main, .content{
    width: 100% !important;
    overflow: visible !important;
  }
}

/* /var/www/html/memo2_style_patch.css */
/* === MOBILE MENU FORCE SHOW (2026-01-04) === */
@media (max-width: 1024px){
  /* 스크롤 막힘 방지 */
  html, body { height: auto !important; }
  body { overflow-y: auto !important; }

  /* 앱 레이아웃을 세로 흐름으로 고정 */
  .app{
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    height: auto !important;
    min-height: 100vh !important;
  }

  /* 어떤 CSS가 있어도 메뉴는 무조건 보이게 */
  html body .app aside.sidebar,
  html body aside.sidebar,
  html body .sidebar{
    display: flex !important;
    flex-direction: row !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    padding: 8px !important;
    -webkit-overflow-scrolling: touch !important;
    background: var(--bg) !important;
    border-bottom: 1px solid var(--line) !important;
    overflow-x: hidden !important;
  }

  /* 메뉴가 “고정(sticky/fixed)”되어 본문을 덮지 않게 */
  html body .app aside.sidebar{
    position: sticky !important;
    top: 0 !important;
    z-index: 999 !important;
    width: 100% !important;
    overflow-x: auto !important;
  }

  /* 메뉴 버튼들을 가로로 배치 */
  html body .sidebar .menu-btn,
  html body .sidebar button,
  html body aside.sidebar .menu-btn,
  html body aside.sidebar button {
    flex: 1 1 auto !important;
    white-space: nowrap !important;
    min-width: 60px !important;
    max-width: 120px !important;
    padding: 8px 6px !important;
    font-size: 13px !important;
    text-align: center !important;
  }

  /* 사이드바 상단 그룹도 가로로 */
  html body .sidebar__top {
    display: flex !important;
    flex-direction: row !important;
    gap: 4px !important;
    flex: 0 0 auto !important;
  }

  html body .sidebar__top .menu-btn {
    flex: 0 0 auto !important;
    min-width: 40px !important;
    padding: 6px 8px !important;
  }

  /* 힌트 텍스트 숨김 */
  html body .sidebar__hint,
  html body .sidebar p.sidebar__hint {
    display: none !important;
  }

  /* 본문도 숨겨지지 않게 */
  main, .main, .content{
    width: 100% !important;
    overflow: visible !important;
  }
}

/* 타이머 그리드 스타일 */
.timer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.timer-box {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.timer-box__header {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-bottom: 4px;
}

.timer-box__btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.timer-box__btn:hover {
  background: var(--line);
}

.timer__ring {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 4px auto 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer__display {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
}

.timer__eta {
  display: block;
  text-align: center;
  font-size: 12px;
  color: #6b7280;
  background: #eef2ff;
  border-radius: 999px;
  width: max-content;
  margin: 0 auto 6px;
  padding: 4px 10px;
}

.timer__inputs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0 auto 6px;
  max-width: 180px;
  width: 100%;
}

.timer__inputs input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px;
  font-size: 14px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.timer__footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 220px;
  margin: 0 auto 6px;
}

.timer__footer .timer__controls {
  margin: 0;
}

.timer-label-btn {
  display: inline-block;
  padding: 5px 16px;
  background: color-mix(in srgb, var(--primary) 10%, white);
  color: var(--primary);
  border: 1.5px solid color-mix(in srgb, var(--primary) 30%, white);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timer-label-btn:hover {
  background: color-mix(in srgb, var(--primary) 20%, white);
}

[data-theme="dark"] .timer-label-btn {
  background: color-mix(in srgb, var(--primary) 18%, var(--card));
  border-color: color-mix(in srgb, var(--primary) 40%, var(--card));
}

[data-theme="dark"] .timer-label-btn:hover {
  background: color-mix(in srgb, var(--primary) 28%, var(--card));
}

.timer-setting-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.timer-setting-modal.is-open {
  display: flex;
}

.timer-setting-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
}

.timer-setting-modal__card {
  position: relative;
  z-index: 1;
  background: var(--card);
  color: var(--text);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  max-width: 360px;
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
}

.timer-setting-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.timer-setting-modal__title {
  color: var(--primary);
  font-weight: 700;
  font-size: 16px;
}

.timer-setting-modal__close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 8px;
}

.timer-setting-modal__close:hover {
  background: color-mix(in srgb, var(--line) 50%, transparent);
}

.timer-setting-modal__field {
  margin-bottom: 12px;
}

.timer-setting-modal__field > label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.timer-setting-modal__field input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
}

.timer-setting-modal__time-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.timer-setting-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.timer-setting-modal__btn {
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

.timer-setting-modal__btn--cancel {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
}

.timer-setting-modal__btn--save {
  background: var(--primary);
  border: 1px solid var(--primary);
  color: #fff;
}

.timer__controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin: 8px auto 0;
}

/* 타이머 원형 버튼 스타일 */
.timer-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(92, 141, 255, 0.3);
}

.timer-btn:hover {
  background: #4a7de8;
  box-shadow: 0 4px 12px rgba(92, 141, 255, 0.5);
  transform: translateY(-1px);
}

.timer-btn:active {
  transform: translateY(0);
}

.timer-btn svg {
  display: block;
}

/* 기존 .btn 스타일 제거 */
.timer__controls .btn {
  display: none;
}

/* ── 스탑워치 (브라우저 본체 · 플로팅 위젯) ── */
.widget--stopwatch .stopwatch-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-sizing: border-box;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.stopwatch__ring {
  position: relative;
  margin: 4px auto 8px;
}

.stopwatch-time.timer__display,
.widget--stopwatch .stopwatch-time {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 1px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  margin: 0;
}

.widget--stopwatch .stopwatch-status {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  background: color-mix(in srgb, var(--primary) 10%, white);
  border-radius: 999px;
  padding: 3px 12px;
  display: inline-block;
  margin-bottom: 16px;
}

[data-theme="dark"] .widget--stopwatch .stopwatch-status {
  background: color-mix(in srgb, var(--primary) 18%, var(--card));
}

.widget--stopwatch .stopwatch-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.widget--stopwatch .stopwatch-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, opacity 0.15s;
}

.widget--stopwatch .stopwatch-btn:hover {
  opacity: 0.92;
}

.widget--stopwatch .stopwatch-btn--reset {
  background: var(--card);
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

[data-theme="dark"] .widget--stopwatch .stopwatch-btn--reset {
  background: var(--card);
}

@media (max-width: 1200px) {
  .timer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .timer-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }
}
/* Note page content — padding handled by note.js panels */
.memo-page-content,
.note-page-content {
  padding: 0;
}

.memo-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.memo-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: box-shadow 0.2s, background 0.2s, border-color 0.2s;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.memo-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

.memo-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.memo-card__title {
  font-weight: 600;
  font-size: 16px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memo-card__btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 6px;
  border-radius: 6px;
  color: #64748b;
  transition: background 0.2s;
}

.memo-card__btn:hover {
  background: rgba(0,0,0,.05);
}

.memo-card__content {
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.memo-card__content:hover {
  background: rgba(0,0,0,.02);
}

.memo-card__menu {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 6px;
  color: #64748b;
  transition: background 0.2s;
}

.memo-card__menu:hover {
  background: rgba(0,0,0,.05);
}

.memo-card__text {
  flex: 1;
  font-size: 15px;
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
}

.memo-card__emoji {
  font-size: 20px;
  margin-right: 4px;
}

.memo-empty {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
  font-size: 15px;
}

/* 모달 스타일 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.modal-box {
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.modal-form {
  margin-bottom: 16px;
}

.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}

.btn-danger {
  padding: 10px 16px;
  border: 1px solid #ef4444;
  border-radius: 8px;
  background: #ef4444;
  color: white;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
}

.btn-confirm {
  padding: 10px 16px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: var(--primary);
  color: white;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-confirm:hover {
  background: #4a7de8;
  border-color: #4a7de8;
}

@media (max-width: 768px) {
  .memo-page-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-box {
    padding: 20px;
  }
}

/* 루틴 페이지 스타일 */
.routine-week-calendar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.routine-year-month {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
  color: var(--text);
}

.routine-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.routine-day-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.routine-day-cell:hover {
  background: var(--line);
}

.routine-day-cell.today {
  background: #e0ecff;
  color: var(--primary);
}

.routine-day-cell.selected {
  background: var(--primary);
  color: white;
}

.routine-day-name {
  font-size: 11px;
  margin-bottom: 4px;
  opacity: 0.7;
}

.routine-day-num {
  font-size: 16px;
  font-weight: 600;
}

.routine-content {
  padding: 20px;
}

.routine-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.routine-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  transition: all 0.2s;
}

.routine-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.routine-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

.routine-label {
  flex: 1;
  font-size: 15px;
  cursor: pointer;
}

.routine-edit-input {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--primary);
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
}

.routine-del-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #94a3b8;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.routine-del-btn:hover {
  background: #fee;
  color: #ef4444;
}

.menu-btn {
  position: relative;
}

.menu-btn[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 8px;
  background: var(--text);
  color: var(--card);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 9999;
  pointer-events: none;
}

.insight-tab-bar {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  flex-shrink: 0;
}

.insight-tab {
  border-radius: 8px;
  padding: 6px 20px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}

.insight-tab--active {
  background: var(--primary);
  color: #fff;
  border: none;
}

.insight-tab--inactive {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
}

.insight-lang-toggle {
  display: flex;
  gap: 8px;
}

.insight-lang-btn {
  border-radius: 8px;
  padding: 6px 20px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}

.insight-lang-btn--active {
  background: var(--primary);
  color: #fff;
  border: none;
}

.insight-lang-btn--inactive {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
}

.insight-page-content {
  padding: 0 16px 16px;
}

.insight-write-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.insight-write-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  box-sizing: border-box;
  outline: none;
  background: var(--card);
  color: var(--text);
}

.insight-write-input--title {
  font-size: 18px;
  font-weight: 600;
  border: none;
  border-bottom: 2px solid var(--line);
  border-radius: 0;
  padding-left: 0;
  padding-right: 0;
}

.insight-write-textarea {
  width: 100%;
  min-height: 400px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
  outline: none;
  background: var(--card);
  color: var(--text);
}

/* Daily 주간 카드 내부 task list 스크롤바 슬림화 */
.weekly-day-card-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.06) transparent;
}
.weekly-day-card-scroll::-webkit-scrollbar {
  width: 1px;
}
.weekly-day-card-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.weekly-day-card-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
}
.weekly-day-card-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.14);
}

/* Daily 월간 기록 카드 뷰 */
#dailyMonthCalendar{
  overflow:auto;
}
.daily-month-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:0 4px 10px;
}
.daily-month-title{
  font-weight:600;
  font-size:14px;
  color:#1f2937;
}
.daily-month-nav{
  display:flex;
  gap:6px;
}
.daily-month-nav-btn{
  width:28px;
  height:28px;
  border:1px solid #e2e8f0;
  border-radius:8px;
  background:var(--card);
  color:#64748b;
  cursor:pointer;
}
.daily-month-record-view{
  display:flex;
  flex-direction:column;
  gap:8px;
  width:100%;
  max-width:100%;
  overflow-y:auto;
  padding-bottom:16px;
}
.daily-month-weekday-header{
  display:grid;
  grid-template-columns:repeat(7,minmax(120px,1fr));
  gap:6px;
  width:100%;
  min-width:840px;
  position:sticky;
  top:0;
  z-index:5;
  background:#fff;
  padding:6px 0 8px;
  border-bottom:1px solid #e5e7eb;
}
.daily-month-weekday-cell{
  font-size:11px;
  font-weight:500;
  color:#64748b;
  text-align:center;
  line-height:1.2;
}
.daily-month-week-row{
  display:grid;
  grid-template-columns:repeat(7,minmax(120px,1fr));
  gap:6px;
  width:100%;
  min-width:840px;
}
.daily-month-day-card{
  min-height:150px;
  border:1px solid #dce5f2;
  border-radius:8px;
  background:#fff;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.daily-month-day-card.is-outside-month{
  opacity:0.45;
}
.daily-month-day-card.is-selected{
  border-color:#4A7AEE;
}
.daily-month-day-card-header{
  height:44px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  background:transparent;
  border-bottom:0.5px solid var(--color-border-tertiary,#e5e7eb);
  cursor:pointer;
}
.daily-month-day-card-header.is-today{
  background:#5C8DFF;
}
.daily-month-day-card-header.is-today .daily-month-day-num,
.daily-month-day-card-header.is-today .daily-month-day-num.is-selected{
  color:#fff;
  background:transparent;
  border:none;
  border-radius:0;
}
.daily-month-day-card-header.is-selected:not(.is-today){
  background:#e8efff;
}
.daily-month-day-card-header.is-selected:not(.is-today) .daily-month-day-num{
  color:#5C8DFF;
  background:transparent;
  border:none;
  border-radius:0;
}
.daily-month-day-name{
  font-size:11px;
}
.daily-month-day-num{
  font-size:14px;
  font-weight:700;
  background:transparent;
}
.daily-month-day-num-clickable{
  cursor:pointer;
  min-height:24px;
  min-width:24px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
}
.daily-month-day-num-clickable:hover{
  text-decoration:underline;
}
.daily-month-day-card-header.is-today .daily-month-day-num-clickable:hover,
.daily-month-day-card-header.is-selected .daily-month-day-num-clickable:hover{
  text-decoration:none;
}
.daily-week-day-header{
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:8px 4px 6px;
  background:transparent;
  border-bottom:0.5px solid var(--color-border-tertiary,#e5e7eb);
}
.daily-week-day-name{
  font-size:11px;
  font-weight:500;
  color:#64748b;
  background:transparent;
}
.daily-week-day-num{
  font-size:16px;
  font-weight:700;
  color:#111827;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:28px;
  min-height:28px;
  box-sizing:border-box;
  background:transparent;
}
.daily-week-day-header.is-today{
  background:#5C8DFF;
}
.daily-week-day-header.is-today .daily-week-day-name,
.daily-week-day-header.is-today .daily-week-day-num,
.daily-week-day-header.is-today .daily-week-day-num.is-selected{
  color:#fff;
  background:transparent;
  border:none;
  border-radius:0;
}
.daily-week-day-header.is-selected:not(.is-today){
  background:#e8efff;
}
.daily-week-day-header.is-selected:not(.is-today) .daily-week-day-name,
.daily-week-day-header.is-selected:not(.is-today) .daily-week-day-num{
  color:#5C8DFF;
  background:transparent;
  border:none;
  border-radius:0;
}
.daily-month-day-card-body{
  flex:1;
  min-height:0;
  padding:8px;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
  gap:6px;
}
/* Week view day cell + row (renderDailyWeekCalendar addRow / addInput inline pattern) */
.daily-week-day-add-wrap{
  padding:4px;
  flex-shrink:0;
  margin-top:auto;
}
.daily-week-day-add-input{
  width:100%;
  box-sizing:border-box;
  font-size:11px;
  line-height:1.4;
  border:none;
  border-top:1px solid #e2e8f0;
  padding:4px 2px;
  outline:none;
  background:transparent;
  color:#64748b;
}
/* Month view day cell + button — pinned to bottom like week view */
.daily-month-day-add-btn{
  margin-top:auto;
  flex-shrink:0;
  width:100%;
  box-sizing:border-box;
  padding:4px 2px;
  font-size:11px;
  line-height:1.4;
  border:none;
  border-top:1px solid #e2e8f0;
  border-radius:0;
  background:transparent;
  color:#64748b;
  cursor:pointer;
  text-align:center;
}
.daily-month-day-add-btn:hover{
  color:#5C8DFF;
  background:#f8fafc;
}
.daily-month-task-item{
  display:flex;
  align-items:flex-start;
  gap:6px;
}
.daily-month-task-item input[type="checkbox"]{
  width:13px;
  height:13px;
  margin-top:2px;
  flex-shrink:0;
  accent-color:#5C8DFF;
}
.daily-month-task-text{
  font-size:11px;
  line-height:1.35;
  color:#374151;
  word-break:break-all;
}
.daily-month-task-text.is-done{
  text-decoration:line-through;
  color:#9aa5b1;
}
.daily-month-empty{
  font-size:11px;
  color:#9ca3af;
}
@media (max-width:768px){
  .daily-month-record-view{
    overflow-x:auto;
  }
  .daily-month-week-row{
    min-width:840px;
  }
}

/* Unified view tab bar (Daily, Timer, calendar panel, …) */
.view-segment,
.daily-view-segment,
.timer-view-segment{
  display:flex;
  align-items:center;
  flex:0 1 auto;
  min-width:0;
  max-width:100%;
  gap:2px;
  background:#f3f4f6;
  border-radius:8px;
  padding:2px;
}
.view-tab-btn,
.daily-view-btn{
  flex:1 1 0;
  min-width:0;
  font-weight:400;
  box-shadow:none;
  transition:background 0.15s ease, color 0.15s ease;
}
.view-tab-btn:hover:not(.is-active),
.daily-view-btn:hover:not(.is-active){
  background:#EEF2FF;
  color:#5C8DFF;
}
.view-tab-btn.is-active,
.daily-view-btn.is-active{
  font-weight:500;
}
#dailyPage{
  --color-border-tertiary:#e5e7eb;
}
#dailyPage .daily-page-header{
  justify-content:space-between;
  flex-shrink:0;
}
#dailyPage .daily-header-title-wrap{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
}
#dailyPage .daily-period-nav-wrap{
  display:inline-flex;
  align-items:center;
  gap:4px;
  min-width:0;
}
#dailyPage .daily-period-divider{
  color:#94a3b8;
  margin:0 2px;
}
#dailyPage .daily-period-label{
  font-size:13px;
  font-weight:500;
  color:#475569;
  white-space:nowrap;
}
#dailyPage .daily-period-nav-btn{
  border:1px solid #e2e8f0;
  background:var(--card);
  color:#475569;
  border-radius:6px;
  font-size:11px;
  line-height:1;
  padding:2px 6px;
  cursor:pointer;
}
#dailyPage .daily-period-nav-btn:hover{
  background:#f8fafc;
}
@media (max-width:640px){
  #dailyPage .daily-page-header{
    flex-wrap:wrap;
    align-items:flex-start;
  }
  .view-segment,
  .daily-view-segment,
  .timer-view-segment{
    width:100%;
    flex:1 1 100%;
  }
  .view-tab-btn,
  .daily-view-btn{
    padding:5px 10px;
    font-size:12px;
  }
}

/* Timer page — Timer / Stopwatch tabs (Daily tab style) */
#timerPage{
  display:flex;
  flex-direction:column;
  height:100%;
}
#timerPage #timerPanel{
  flex:1;
  min-height:0;
  overflow:auto;
}
#timerPage .timer-page-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  flex-shrink:0;
  gap:12px;
  flex-wrap:wrap;
}
#timerPage #timerPanel{
  display:block;
}
#timerPage #stopwatchPanel,
#timerPage .stopwatch-page-content-wrap{
  flex:1;
  min-height:0;
  display:none;
  flex-direction:column;
}
#timerPage.timer-page--stopwatch #timerPanel{
  display:none !important;
}
#timerPage.timer-page--stopwatch #stopwatchPanel,
#timerPage.timer-page--stopwatch .stopwatch-page-content-wrap{
  display:flex !important;
}
#timerPage:not(.timer-page--stopwatch) #stopwatchPanel,
#timerPage:not(.timer-page--stopwatch) .stopwatch-page-content-wrap{
  display:none !important;
}

/* Stopwatch — browser page (match widget) */
#stopwatchPageContent .stopwatch-card,
#stopwatchPageContent .stopwatch-card--inline{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  width:100%;
  max-width:360px;
  margin:0 auto;
  padding:28px 16px 32px;
  box-sizing:border-box;
}
#stopwatchPageContent .timer__ring{
  position:relative;
  width:180px;
  height:180px;
  margin:8px auto 12px;
  display:flex;
  align-items:center;
  justify-content:center;
}
#stopwatchPageContent .stopwatch-time.timer__display{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:28px;
  font-weight:800;
  color:var(--text,#111827);
  letter-spacing:1px;
  font-variant-numeric:tabular-nums;
}
#stopwatchPageContent .stopwatch-status{
  font-size:13px;
  color:#5C8DFF;
  background:#EEF2FF;
  border-radius:999px;
  padding:4px 14px;
  display:inline-block;
  margin-bottom:20px;
  font-weight:600;
}
#stopwatchPageContent .stopwatch-actions{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  align-items:center;
  gap:8px;
  width:100%;
}
#stopwatchPageContent .stopwatch-btn{
  border-radius:24px;
  padding:10px 28px;
  font-size:14px;
  font-weight:600;
  border:none;
  cursor:pointer;
  font-family:inherit;
  transition:background 0.15s ease, color 0.15s ease;
}
#stopwatchPageContent .stopwatch-btn--primary{
  background:#5C8DFF;
  color:#fff;
}
#stopwatchPageContent .stopwatch-btn--primary:hover{
  background:#4A7AEE;
}
#stopwatchPageContent .stopwatch-btn--reset{
  background:transparent;
  border:1.5px solid #5C8DFF;
  color:#5C8DFF;
}
#stopwatchPageContent .stopwatch-btn--reset:hover{
  background:#EEF2FF;
}

@media (max-width:640px){
  #timerPage .timer-page-header{
    flex-wrap:wrap;
    align-items:flex-start;
  }
}

/* Daily 일간 워크스페이스 */
.daily-workspace{
  flex:1;
  min-height:0;
  overflow:auto;
}
.daily-day-quick-input{
  padding:10px 16px 0 !important;
}
.daily-day-quick-input.is-day-mode{
  padding-bottom:4px !important;
}
.daily-day-quick-input-inner{
  display:flex;
  gap:8px;
  align-items:center;
}
.daily-day-quick-input-inner input{
  flex:1;
  padding:11px 14px;
  border:1px solid #e2e8f0;
  border-radius:12px;
  font-size:14px;
  font-family:inherit;
  outline:none;
  background:#fff;
  box-sizing:border-box;
}
.daily-day-quick-input-inner input:focus{
  border-color:#93c5fd;
  box-shadow:0 0 0 3px rgba(92,141,255,0.12);
}
.daily-day-quick-input-inner button{
  width:42px;
  height:42px;
  border:1px solid #dbe4f0;
  border-radius:12px;
  background:#f8fafc;
  color:#334155;
  font-size:20px;
  cursor:pointer;
  flex-shrink:0;
}
.daily-day-layout{
  display:grid;
  grid-template-columns:minmax(0,7fr) minmax(260px,3fr);
  gap:12px;
  padding:12px;
  align-items:start;
}
.daily-day-sections{
  min-width:0;
  border:1px solid #e6ebf3;
  border-radius:10px;
  background:var(--card);
  padding:10px;
}
.daily-day-sections-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:12px;
}
.daily-day-layout-toggle{
  display:inline-flex;
  align-items:center;
  gap:4px;
  flex-shrink:0;
}
.daily-day-layout-toggle .newmemo-filter-btn{
  min-width:28px;
  justify-content:center;
}
.daily-day-sections-head-actions{
  display:flex;
  align-items:center;
  gap:8px;
  margin-left:auto;
  flex-shrink:0;
}
.daily-day-head-title{
  font-size:15px;
  font-weight:700;
  color:#0f172a;
}
.daily-day-add-section-btn{
  border:1px dashed #cbd5e1;
  background:#fff;
  color:#475569;
  border-radius:10px;
  padding:7px 12px;
  cursor:pointer;
  font-size:12px;
  font-weight:600;
}
.daily-day-add-section-btn:hover{
  background:#f8fafc;
  border-color:#94a3b8;
}
.daily-day-sections-list{
  display:flex;
  flex-direction:column;
  gap:14px;
}
.daily-day-section-card,
.daily-section-card{
  border:1px solid #e5eaf2;
  border-radius:14px;
  background:#fff;
  overflow:hidden;
  box-shadow:0 1px 3px rgba(15,23,42,0.04);
}
.daily-day-section-head,
.daily-section-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:10px 12px;
  border-bottom:1px solid rgba(15,23,42,0.06);
  background:#ffffff;
}
.daily-section-header--colored{
  border-bottom-color:rgba(0,0,0,0.08);
}
.daily-section-header--colored .daily-day-section-title,
.daily-section-header--colored .daily-day-section-emoji{
  color:inherit;
}
.daily-section-header--colored .daily-day-section-menu-btn{
  color:inherit;
  border-color:transparent;
}
.daily-section-header--colored .daily-day-section-menu-btn:hover{
  background:rgba(0,0,0,0.08);
}
.daily-section-header--colored .daily-day-add-task-btn{
  background:rgba(0,0,0,0.08);
  color:var(--daily-section-text,inherit);
  border-color:rgba(0,0,0,0.1);
  box-shadow:none;
}
.daily-section-header--colored .daily-day-add-task-btn:hover{
  background:rgba(0,0,0,0.12);
}
.section-dot{
  width:9px;
  height:9px;
  border-radius:50%;
  display:inline-block;
  flex-shrink:0;
}
.daily-day-section-left{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.daily-day-section-emoji{
  font-size:18px;
  line-height:1;
}
.daily-day-section-title{
  font-size:14px;
  font-weight:700;
  color:#111827;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.daily-day-section-actions{
  display:flex;
  align-items:center;
  gap:6px;
  flex-shrink:0;
}
.daily-day-section-menu-btn{
  width:30px;
  height:30px;
  border:1px solid transparent;
  border-radius:8px;
  background:transparent;
  color:#64748b;
  font-size:18px;
  line-height:1;
  cursor:pointer;
  padding:0;
}
.daily-day-section-menu-btn:hover{
  background:rgba(255,255,255,0.7);
  border-color:rgba(15,23,42,0.08);
}
.daily-day-section-btn{
  border:1px solid #dbe4f0;
  background:#fff;
  color:#475569;
  border-radius:8px;
  padding:5px 10px;
  cursor:pointer;
  font-size:12px;
  font-weight:600;
}
.daily-day-add-task-btn{
  background:rgba(255,255,255,0.85);
  border-color:#cbd5e1;
  color:#5C8DFF;
}
.daily-day-add-task-btn:hover{
  background:#fff;
  border-color:#93c5fd;
}
.daily-day-section-body{
  display:flex;
  flex-direction:column;
  gap:0;
  padding:4px 0 8px;
  background:#fff;
}
.daily-task-row{
  border-bottom:1px solid #f1f5f9;
}
.daily-task-row:last-child{
  border-bottom:none;
}
.daily-day-task-item{
  display:flex;
  align-items:flex-start;
  gap:8px;
  padding:8px 12px;
  background:#fff;
}
.daily-day-task-item input[type="checkbox"]{
  width:16px;
  height:16px;
  margin-top:2px;
  accent-color:#5C8DFF;
  flex-shrink:0;
}
.daily-day-task-text{
  flex:1;
  min-width:0;
  font-size:13px;
  line-height:1.45;
  color:#334155;
  word-break:break-word;
}
.daily-day-task-text.is-done{
  text-decoration:line-through;
  color:#94a3b8;
}
.daily-day-empty{
  font-size:12px;
  color:#94a3b8;
  padding:10px 12px 12px;
}
.daily-section-task-input{
  width:100%;
  height:36px;
  padding:0 10px;
  border:1px solid #dce5f2;
  border-radius:8px;
  font-size:13px;
  outline:none;
  background:#fff;
  box-sizing:border-box;
  font-family:inherit;
}
.daily-section-task-input:focus{
  border-color:#5C8DFF;
  box-shadow:0 0 0 2px rgba(92,141,255,0.12);
}
.daily-section-title-input{
  width:100%;
  height:36px;
  padding:0 10px;
  border:1px solid #dce5f2;
  border-radius:8px;
  font-size:13px;
  outline:none;
  background:#fff;
  box-sizing:border-box;
  font-family:inherit;
}
.daily-section-title-input:focus{
  border-color:#5C8DFF;
  box-shadow:0 0 0 2px rgba(92,141,255,0.12);
}
.daily-section-add-wrap{
  margin:0 0 10px;
}
.daily-day-section-left .daily-section-title-input{
  flex:1;
  min-width:0;
  height:32px;
}
.daily-day-task-actions{
  display:flex;
  align-items:center;
  gap:2px;
  margin-left:auto;
  flex-shrink:0;
  opacity:1;
}
.daily-day-task-icon-btn{
  background:none;
  border:none;
  cursor:pointer;
  padding:3px;
  display:flex;
  align-items:center;
  opacity:1;
  line-height:1;
}
.daily-day-task-icon-btn:hover{
  opacity:0.85;
}
.daily-day-task-delete{
  color:#cbd5e1;
  font-size:14px;
  opacity:1;
}
.daily-day-memo-panel{
  min-width:0;
  border:1px solid #e6ebf3;
  border-radius:10px;
  background:var(--card);
  padding:10px;
  position:sticky;
  top:8px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
/* Daily right panel — mini calendar */
.mini-cal-panel{
  background:#fff;
  border:0.5px solid var(--line,#e9ecf2);
  border-radius:12px;
  padding:10px 12px;
  flex-shrink:0;
}
#dailyPage #daily-mini-calendar.mini-cal-panel,
#dailyPage #daily-mini-calendar .mini-cal-grid{
  background:#fff !important;
}
.mini-cal-header{
  display:flex;
  align-items:center;
  gap:6px;
  margin-bottom:8px;
}
.mini-cal-header span{
  flex:1;
  font-size:13px;
  font-weight:500;
  color:var(--text,#111827);
  text-align:center;
}
.mini-cal-header button{
  background:none;
  border:none;
  font-size:11px;
  color:var(--text-muted,#64748b);
  cursor:pointer;
  padding:2px 4px;
  font-family:inherit;
}
.mini-cal-header button:hover{
  color:#5C8DFF;
}
#mini-cal-today-btn{
  font-size:11px;
  color:#5C8DFF;
  font-weight:500;
  flex-shrink:0;
}
.mini-cal-grid{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:2px;
  background:#fff;
}
.mini-cal-dow{
  font-size:10px;
  color:var(--text-muted,#9aa5b1);
  text-align:center;
  padding:3px 0;
  font-weight:500;
}
.mini-cal-cell{
  font-size:11px;
  text-align:center;
  padding:4px 2px;
  border-radius:4px;
  cursor:pointer;
  color:var(--text,#111827);
  line-height:1.2;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:22px;
  min-height:22px;
  box-sizing:border-box;
  background:transparent;
  border:none;
}
#dailyPage #daily-mini-calendar .mini-cal-cell:not(.mini-cal-today):not(.mini-cal-selected):not(.empty){
  background:transparent !important;
}
.mini-cal-cell:hover:not(.empty):not(.mini-cal-today):not(.mini-cal-selected){
  background:#e8efff;
  color:#5C8DFF;
}
.mini-cal-cell.empty{
  cursor:default;
  visibility:hidden;
  background:transparent !important;
}
.mini-cal-cell.mini-cal-today{
  background:#5C8DFF !important;
  color:#fff !important;
  font-weight:500;
  border-radius:4px;
  border:none;
}
.mini-cal-cell.mini-cal-selected:not(.mini-cal-today){
  background:#e8efff !important;
  color:#5C8DFF !important;
  font-weight:500;
  border-radius:4px;
  border:none;
}
.daily-panel-widget-row{
  margin-top:4px;
  padding-top:8px;
  border-top:1px solid #eef2f7;
}
.daily-panel-widget-btn{
  width:100%;
  justify-content:center;
}
.daily-day-memo-panel.is-expanded{
  grid-column:1 / -1;
}
.daily-memo-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:10px;
}
.daily-memo-head-title{
  font-size:14px;
  font-weight:700;
  color:#0f172a;
}
.daily-memo-head-actions{
  display:flex;
  align-items:center;
  gap:6px;
  flex-shrink:0;
}
.daily-memo-icon-btn{
  width:28px;
  height:28px;
  border:1px solid #e2e8f0;
  border-radius:8px;
  background:#fff;
  color:#64748b;
  font-size:13px;
  cursor:pointer;
  padding:0;
  line-height:1;
}
.daily-memo-icon-btn:hover{
  background:#f1f5f9;
}
.daily-memo-textarea{
  width:100%;
  min-height:140px;
  border:1px solid #e2e8f0;
  border-radius:12px;
  padding:12px;
  box-sizing:border-box;
  font-size:13px;
  font-family:inherit;
  outline:none;
  resize:vertical;
  background:#fff;
  line-height:1.55;
}
.daily-memo-textarea:focus{
  border-color:#93c5fd;
  box-shadow:0 0 0 3px rgba(92,141,255,0.1);
}
.daily-memo-saved-at{
  margin-top:8px;
  font-size:11px;
  color:#94a3b8;
}
.daily-memo-actions{
  display:flex;
  gap:8px;
  margin:10px 0 8px;
}
.daily-memo-save-btn{
  background:#5C8DFF;
  color:#fff;
  border-color:#5C8DFF;
  flex:1;
}
.daily-memo-all-btn{
  flex:1;
  background:#fff;
}
.daily-memo-linked-list{
  display:flex;
  flex-direction:column;
  gap:8px;
  max-height:220px;
  overflow-y:auto;
  padding-top:4px;
  border-top:1px solid #eef2f7;
}
.daily-memo-item{
  border:1px solid #e8edf4;
  border-radius:10px;
  background:#fff;
  padding:10px;
}
.daily-memo-item-title{
  font-size:12px;
  font-weight:700;
  color:#1f2937;
  margin-bottom:4px;
}
.daily-memo-item-content{
  font-size:12px;
  color:#64748b;
  line-height:1.4;
  word-break:break-word;
}
.daily-section-menu-popup{
  min-width:120px;
}
.daily-section-edit-popup{
  width:min(280px,calc(100vw - 24px));
  padding:14px;
  border:1px solid #e2e8f0;
  border-radius:12px;
  background:#fff;
  box-shadow:0 8px 24px rgba(15,23,42,0.12);
  box-sizing:border-box;
  overflow:visible;
  z-index:10020;
}
.daily-section-edit-label{
  font-size:12px;
  font-weight:700;
  color:#475569;
  margin:10px 0 6px;
}
.daily-section-edit-label:first-child{
  margin-top:0;
}
.daily-section-edit-title{
  width:100%;
  height:36px;
  padding:0 10px;
  border:1px solid #dce5f2;
  border-radius:8px;
  font-size:13px;
  outline:none;
  box-sizing:border-box;
  font-family:inherit;
}
.daily-section-edit-title:focus{
  border-color:#5C8DFF;
  box-shadow:0 0 0 2px rgba(92,141,255,0.12);
}
.daily-section-edit-emoji-grid{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:6px;
}
.daily-section-edit-emoji-btn{
  height:36px;
  border:1px solid #e2e8f0;
  border-radius:8px;
  background:#fff;
  font-size:18px;
  line-height:1;
  cursor:pointer;
  padding:0;
}
.daily-section-edit-emoji-btn.is-selected{
  border-color:#5C8DFF;
  background:#eff6ff;
  box-shadow:0 0 0 2px rgba(92,141,255,0.15);
}
.daily-section-color-grid.is-free{
  display:grid;
  grid-template-columns:repeat(6, 1fr);
  gap:6px;
  padding:4px;
}
.daily-section-color-grid.is-plus{
  display:grid;
  grid-template-columns:repeat(12, 24px);
  gap:4px;
  padding:4px;
}
.daily-section-color-popup{
  max-width:min(400px, calc(100vw - 24px));
  box-sizing:border-box;
}
@media (max-width:640px){
  .daily-section-color-grid.is-plus{
    grid-template-columns:repeat(6, minmax(0, 1fr));
    width:100%;
  }
  .daily-section-color-grid.is-plus button{
    width:100% !important;
    height:auto !important;
    aspect-ratio:1;
  }
  .daily-section-color-popup,
  .daily-section-edit-popup{
    max-width:calc(100vw - 24px);
    max-height:min(80vh, 560px);
    overflow-y:auto;
  }
}
/* 퀵 6색 + 전체 컬러표 링크 */
.jcal-quick-bg-palette{display:flex;flex-direction:column;gap:8px;padding:2px 0;}
.jcal-quick-bg-grid{display:flex;flex-wrap:wrap;gap:8px;align-items:center;}
.jcal-quick-bg-swatch{
  width:30px;height:30px;border-radius:8px;border:2px solid #e5e7eb;
  cursor:pointer;padding:0;background:transparent;
}
.jcal-quick-bg-swatch.is-selected{border-color:#5C8DFF;box-shadow:0 0 0 2px rgba(92,141,255,0.2);}
.jcal-full-palette-link{
  align-self:flex-start;border:none;background:none;color:#5C8DFF;
  font-size:12px;font-weight:600;cursor:pointer;padding:2px 0;font-family:inherit;
}
.jcal-full-palette-link:hover{text-decoration:underline;}
[data-theme="dark"] .jcal-quick-bg-swatch{border-color:#3a3a3a;}
[data-theme="dark"] .jcal-quick-bg-swatch.is-selected{border-color:#7aa2ff;}
[data-theme="dark"] .jcal-full-palette-link{color:#8eb0ff;}

/* 삼성노트형 에디터 글자색/하이라이트 */
.jcal-editor-color-pop{
  position:fixed;z-index:10050;background:#fff;border:1px solid #e5e7eb;border-radius:12px;
  padding:12px;box-shadow:0 8px 24px rgba(17,24,39,0.14);min-width:220px;
  box-sizing:border-box;
}
.jcal-editor-color-title{
  font-size:12px;font-weight:700;color:#374151;margin-bottom:10px;
}
.jcal-editor-color-chips{
  display:grid;grid-template-columns:repeat(9, 1fr);gap:8px;align-items:center;
}
.jcal-editor-color-chip{
  width:22px;height:22px;border-radius:50%;border:2px solid transparent;
  cursor:pointer;padding:0;box-sizing:border-box;position:relative;
  box-shadow:inset 0 0 0 1px rgba(15,23,42,0.12);
}
.jcal-editor-color-chip.is-selected{
  border-color:#5C8DFF;box-shadow:0 0 0 2px rgba(92,141,255,0.25);
}
.jcal-editor-color-chip.is-clear{
  background:#f3f4f6;color:#6b7280;font-size:11px;font-weight:700;
  display:grid;place-items:center;box-shadow:inset 0 0 0 1px #e5e7eb;
}
.jcal-editor-color-chip.is-auto{
  display:grid;place-items:center;
}
.jcal-editor-chip-mark{
  font-size:10px;font-weight:800;color:#fff;mix-blend-mode:difference;line-height:1;
}
.color-swatch.no-color.is-selected,
.color-swatch.is-selected{
  border-color:#5C8DFF;
  box-shadow:0 0 0 2px rgba(92,141,255,0.25);
}
.color-swatch-small.is-selected{
  outline:2px solid #5C8DFF;
  outline-offset:1px;
  box-shadow:0 0 0 2px rgba(92,141,255,0.2);
}

/* draft 미리보기 */
.jcal-draft-color-preview{
  display:flex;align-items:center;gap:8px;margin-bottom:8px;
  font-size:12px;color:#64748b;
}
.jcal-draft-color-swatch{
  width:28px;height:28px;border-radius:8px;border:1px solid rgba(15,23,42,0.12);
  flex-shrink:0;
}
.jcal-draft-color-hex{font-family:ui-monospace,monospace;font-size:11px;color:#374151;}
[data-theme="dark"] .jcal-draft-color-hex{color:#e5e7eb;}
[data-theme="dark"] .jcal-draft-color-swatch{border-color:rgba(255,255,255,0.18);}

/* 커스텀 컬러 패널 (툴바) */
.jcal-custom-color-panel{
  position:fixed;z-index:10070;background:#fff;border:1px solid #e5e7eb;border-radius:12px;
  padding:12px;box-shadow:0 8px 24px rgba(17,24,39,0.16);min-width:200px;box-sizing:border-box;
}
.jcal-custom-color-title{font-size:12px;font-weight:700;color:#374151;margin-bottom:10px;}
.jcal-custom-color-row{display:flex;align-items:center;gap:8px;margin-bottom:10px;}
.jcal-custom-color-native{
  width:36px;height:36px;padding:0;border:1px solid #e5e7eb;border-radius:8px;
  background:none;cursor:pointer;
}
.jcal-custom-color-hex{
  flex:1;min-width:0;height:34px;padding:0 8px;border:1px solid #d1d5db;border-radius:8px;
  font-size:13px;font-family:ui-monospace,monospace;outline:none;
}
.jcal-custom-color-hex:focus{border-color:#5C8DFF;}
.jcal-custom-color-swatch{
  width:28px;height:28px;border-radius:8px;border:1px solid rgba(15,23,42,0.12);flex-shrink:0;
}
.jcal-custom-color-actions{display:flex;gap:8px;}
.jcal-custom-color-cancel,
.jcal-custom-color-apply{
  flex:1;height:32px;border-radius:8px;font-size:12px;font-weight:700;cursor:pointer;font-family:inherit;
}
.jcal-custom-color-cancel{border:1px solid #e5e7eb;background:#f3f4f6;color:#374151;}
.jcal-custom-color-apply{border:none;background:#5C8DFF;color:#fff;}
[data-theme="dark"] .jcal-custom-color-panel{
  background:#2a2a2a;border-color:#3a3a3a;
}
[data-theme="dark"] .jcal-custom-color-title{color:#e5e7eb;}
[data-theme="dark"] .jcal-custom-color-hex{
  background:#1f1f1f;border-color:#3a3a3a;color:#e5e7eb;
}
[data-theme="dark"] .jcal-custom-color-cancel{
  background:#1f1f1f;border-color:#3a3a3a;color:#e5e7eb;
}
.jcal-editor-color-dots{
  display:flex;justify-content:center;gap:6px;margin-top:10px;
}
.jcal-editor-color-dot{
  width:7px;height:7px;border-radius:50%;border:none;padding:0;cursor:pointer;
  background:#d1d5db;
}
.jcal-editor-color-dot.is-active{background:#5C8DFF;}
[data-theme="dark"] .jcal-editor-color-pop{
  background:#2a2a2a;border-color:#3a3a3a;box-shadow:0 8px 24px rgba(0,0,0,0.45);
}
[data-theme="dark"] .jcal-editor-color-title{color:#e5e7eb;}
[data-theme="dark"] .jcal-editor-color-chip{
  box-shadow:inset 0 0 0 1px rgba(255,255,255,0.18);
}
[data-theme="dark"] .jcal-editor-color-chip.is-selected{
  border-color:#8eb0ff;box-shadow:0 0 0 2px rgba(142,176,255,0.3);
}
[data-theme="dark"] .jcal-editor-color-chip.is-clear{
  background:#1f1f1f;color:#9ca3af;box-shadow:inset 0 0 0 1px #3a3a3a;
}
[data-theme="dark"] .jcal-editor-color-dot{background:#4b5563;}
[data-theme="dark"] .jcal-editor-color-dot.is-active{background:#8eb0ff;}

.daily-section-edit-color-grid{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}
.daily-section-edit-color-btn{
  width:22px;
  height:22px;
  border:2px solid transparent;
  border-radius:50%;
  cursor:pointer;
  padding:0;
  flex-shrink:0;
}
.daily-section-edit-color-btn.is-selected{
  border-color:#111827;
  box-shadow:0 0 0 2px rgba(17,24,39,0.15);
}
.daily-section-edit-actions{
  display:flex;
  gap:8px;
  margin-top:14px;
}
.daily-section-edit-cancel,
.daily-section-edit-save{
  flex:1;
  height:34px;
  border-radius:8px;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
  font-family:inherit;
}
.daily-section-edit-cancel{
  border:1px solid #e2e8f0;
  background:#fff;
  color:#475569;
}
.daily-section-edit-save{
  border:1px solid #5C8DFF;
  background:#5C8DFF;
  color:#fff;
}
@media (max-width:1024px){
  .daily-day-layout{
    grid-template-columns:1fr;
  }
  .daily-day-memo-panel{
    position:static;
  }
}

@media (max-width:768px){
  .daily-day-memo-block{
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-top:4px;
    border:1px solid #f1dca8 !important;
    border-radius:14px !important;
    background:#fffaf0 !important;
    padding:10px !important;
    box-shadow:0 1px 4px rgba(15,23,42,0.05) !important;
    box-sizing:border-box !important;
  }

  #dailyPage .daily-day-memo-block .daily-note-section{
    border:none !important;
    border-radius:0 !important;
    background:transparent !important;
    box-shadow:none !important;
    padding:0 !important;
  }

  /* 모바일 미니달력: PC 우측 패널과 동일 — 크림 카드 + 내부 흰 달력 블록 */
  #dailyPage .daily-day-layout > #daily-mini-calendar.mini-cal-panel{
    border:1px solid #f1dca8 !important;
    border-radius:14px !important;
    background:#fffaf0 !important;
    box-shadow:0 1px 4px rgba(15,23,42,0.05) !important;
    padding:10px !important;
    box-sizing:border-box !important;
  }

  #dailyPage .daily-day-layout > #daily-mini-calendar.mini-cal-panel .mini-cal-header{
    margin-bottom:0 !important;
    padding:8px 10px 6px !important;
    background:#ffffff !important;
    border:0.5px solid #e9ecf2 !important;
    border-bottom:none !important;
    border-radius:12px 12px 0 0 !important;
  }

  #dailyPage .daily-day-layout > #daily-mini-calendar.mini-cal-panel .mini-cal-grid{
    background:#ffffff !important;
    border:0.5px solid #e9ecf2 !important;
    border-top:none !important;
    border-radius:0 0 12px 12px !important;
    padding:0 10px 10px !important;
    box-sizing:border-box !important;
  }

  #dailyPage .daily-day-memo-block .daily-memo-head{
    border-bottom:1px solid #f1dca8 !important;
    margin-bottom:0 !important;
    padding:12px 4px !important;
  }

  #dailyPage .daily-day-memo-block .daily-memo-textarea{
    background:#ffffff !important;
    border:1px solid #e6eaf0 !important;
    border-radius:10px !important;
  }

  #dailyPage .daily-day-memo-block .daily-panel-widget-row{
    border-top:1px solid #f1dca8 !important;
    margin-top:0 !important;
    padding-top:10px !important;
  }

  #dailyPage .daily-day-memo-block .daily-panel-widget-btn{
    background:#ffffff !important;
    border:1px solid #e6eaf0 !important;
    border-radius:10px !important;
  }

  #dailyGridBtn {
    display: none !important;
  }

  #dailyListBtn {
    display: none !important;
  }
}

/* 메모 리치 에디터 */
.memo-editor-wrap{
  border:1px solid #e9ecf2;
  border-radius:12px;
  background:var(--card);
  overflow:hidden;
}
.memo-mini-toolbar{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
  padding:8px;
  border-bottom:1px solid #e9ecf2;
  background:#f8fafc;
}
.memo-mini-toolbar button,
.memo-mini-toolbar select,
.memo-mini-toolbar input[type="color"]{
  height:30px;
  border:1px solid #dbe3ef;
  border-radius:8px;
  background:#fff;
  font-size:12px;
  cursor:pointer;
}
.memo-mini-toolbar button{
  padding:0 9px;
}
.memo-rich-editor{
  min-height:400px;
  padding:16px;
  outline:none;
  font-size:15px;
  line-height:1.65;
  font-family:inherit;
  word-break:break-word;
}
.memo-rich-editor:empty::before{
  content:attr(data-placeholder);
  color:#94a3b8;
  pointer-events:none;
}
.memo-rich-editor ul{
  padding-left:22px;
}
.memo-check-row{
  display:flex;
  align-items:center;
  gap:8px;
  margin:4px 0;
}
.memo-check-row input[type="checkbox"]{
  width:16px;
  height:16px;
}
.memo-pasted-image,
.memo-rich-editor img,
.memo-card img{
  max-width:100%;
  height:auto;
  border-radius:10px;
  display:block;
  margin:10px 0;
}
.memo-card__html{
  word-break:break-word;
}
.memo-card img,
.memo-widget img,
.memo-popup-content img,
.daily-memo-panel img,
.daily-memo-item-content img{
  max-width:100%;
  height:auto;
  display:block;
  margin:10px 0;
  border-radius:10px;
}
.memo-card ul,
.memo-widget ul,
.memo-popup-content ul,
.daily-memo-panel ul,
.daily-memo-item-content ul{
  padding-left:22px;
}
.daily-memo-item-content{
  max-height:120px;
  overflow:hidden;
}
.memo-image-block{
  position:relative;
  display:block;
  width:fit-content;
  max-width:100%;
  margin:12px 0;
  padding:4px;
  border:1px solid transparent;
  border-radius:12px;
  cursor:move;
}
.memo-image-block.is-selected{
  border-color:#4A7AEE;
  background:rgba(37,99,235,0.04);
}
.memo-image-block.is-dragging{
  opacity:0.55;
}
.memo-image-block img{
  display:block;
  max-width:100%;
  height:auto;
  border-radius:10px;
  user-select:none;
  pointer-events:none;
}
.memo-image-resize-handle{
  display:none;
  position:absolute;
  right:-6px;
  bottom:-6px;
  width:14px;
  height:14px;
  border:2px solid #4A7AEE;
  border-radius:50%;
  background:#fff;
  cursor:nwse-resize;
}
.memo-image-block.is-selected .memo-image-resize-handle{
  display:block;
}
.memo-image-resizing,
.memo-image-resizing *{
  cursor:nwse-resize !important;
  user-select:none !important;
}
.memo-card .memo-image-resize-handle,
.memo-widget .memo-image-resize-handle,
.memo-popup-content .memo-image-resize-handle,
.daily-memo-item-content .memo-image-resize-handle{
  display:none !important;
}
@media (max-width:768px){
  .memo-mini-toolbar{
    gap:5px;
    padding:7px;
  }
  .memo-mini-toolbar button,
  .memo-mini-toolbar select,
  .memo-mini-toolbar input[type="color"]{
    height:28px;
    font-size:11px;
  }
  .memo-rich-editor{
    min-height:320px;
    padding:14px;
  }
}

/* Daily day restore 2026-05-29 */
#dailyDayWorkspace.daily-workspace {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #fff;
}

#dailyPage .daily-day-quick-input {
  padding: 12px 16px 8px !important;
}

#dailyPage .daily-day-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 360px !important;
  gap: 18px !important;
  padding: 14px 16px 20px !important;
  align-items: start !important;
}

#dailyPage .daily-day-sections {
  min-width: 0 !important;
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
}

#dailyPage .daily-day-sections-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  margin: 0 0 12px !important;
}

#dailyPage .daily-day-head-title {
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #111827 !important;
}

#dailyPage .daily-day-add-section-btn {
  border: 1px dashed var(--color-primary, #5C8DFF) !important;
  background: #ffffff !important;
  color: var(--color-primary, #5C8DFF) !important;
  border-radius: 10px !important;
  padding: 7px 12px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

#dailyPage .daily-day-sections-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 18px !important;
}

#dailyPage .daily-day-section-card {
  border: 1px solid #e5eaf2 !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  overflow: hidden !important;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05) !important;
}

#dailyPage .daily-day-section-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  min-height: 54px !important;
  padding: 12px 16px !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18) !important;
}

#dailyPage .daily-day-section-head:not(.daily-section-header--colored),
#dailyPage .daily-section-header:not(.daily-section-header--colored) {
  background: #ffffff !important;
}

#dailyPage .daily-section-header--colored .daily-day-section-title,
#dailyPage .daily-section-header--colored .daily-day-section-emoji {
  color: inherit !important;
}

#dailyPage .daily-section-header--colored .daily-day-section-menu-btn {
  color: inherit !important;
  background: transparent !important;
  border: 0 !important;
}

#dailyPage .daily-section-header--colored .daily-day-section-menu-btn:hover {
  background: rgba(0, 0, 0, 0.08) !important;
}

#dailyPage .daily-section-header--colored .daily-day-add-task-btn {
  background: rgba(0, 0, 0, 0.08) !important;
  color: var(--daily-section-text, inherit) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: none !important;
}

#dailyPage .daily-day-section-left {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
}

#dailyPage .daily-day-section-emoji {
  font-size: 18px !important;
  line-height: 1 !important;
}

#dailyPage .daily-day-section-title {
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #111827 !important;
}

#dailyPage .daily-day-section-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

#dailyPage .daily-day-section-menu-btn {
  width: 30px !important;
  height: 30px !important;
  border: 0 !important;
  background: transparent !important;
  border-radius: 8px !important;
  color: #475569 !important;
  font-size: 18px !important;
  cursor: pointer !important;
}

#dailyPage .daily-day-section-menu-btn:hover {
  background: rgba(255, 255, 255, 0.65) !important;
}

#dailyPage .daily-day-add-task-btn {
  height: 32px !important;
  padding: 0 12px !important;
  border: 1px solid #dbe4f0 !important;
  border-radius: 9px !important;
  background: #ffffff !important;
  color: #111827 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
}

#dailyPage .daily-day-section-body {
  background: #ffffff !important;
}

#dailyPage .daily-day-task-row {
  min-height: 44px !important;
  display: grid !important;
  grid-template-columns: 24px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 9px 14px !important;
  border-bottom: 1px solid #eef2f7 !important;
}

#dailyPage .daily-day-task-row:last-child {
  border-bottom: 0 !important;
}

#dailyPage .daily-day-task-row input[type="checkbox"] {
  width: 17px !important;
  height: 17px !important;
}

#dailyPage .daily-weekly-notes-wrap {
  background: #f8f9fa !important;
  border: 1px solid #e9ecef !important;
  border-radius: 12px !important;
  min-height: auto !important;
  padding: 10px 12px !important;
  gap: 10px !important;
  align-items: stretch !important;
}

#dailyPage .daily-weekly-notes-col > div:last-child {
  min-height: auto !important;
  padding: 8px 10px !important;
}

#dailyPage .daily-weekly-note-row,
#dailyPage .daily-weekly-note-text {
  line-height: 1.4 !important;
}

#dailyPage .daily-weekly-note-row {
  padding-top: 3px !important;
  padding-bottom: 3px !important;
}

#dailyPage .daily-weekly-notes-wrap input[type="text"] {
  font-size: 0.875rem !important;
  line-height: 1.4 !important;
  padding-top: 2px !important;
  padding-bottom: 2px !important;
}

#dailyPage .daily-day-task-text {
  font-size: 14px !important;
  color: #111827 !important;
  line-height: 1.45 !important;
}

#dailyPage .daily-day-sections-head {
  justify-content: space-between !important;
}

#dailyPage .daily-day-empty {
  padding: 16px !important;
  font-size: 13px !important;
  color: #94a3b8 !important;
}

#dailyPage .daily-day-memo-panel {
  position: sticky !important;
  top: 12px !important;
  border: 1px solid #f1dca8 !important;
  border-radius: 14px !important;
  background: #fffaf0 !important;
  overflow: visible !important;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05) !important;
}

#dailyPage .daily-memo-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  min-height: 52px !important;
  padding: 12px 14px !important;
  border-bottom: 1px solid #f1dca8 !important;
}

#dailyPage .daily-memo-head-title {
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #111827 !important;
}

#dailyPage .daily-memo-textarea {
  width: calc(100% - 20px) !important;
  min-height: 80px !important;
  max-height: none !important;
  margin: 10px !important;
  padding: 8px 10px !important;
  border: 1px solid #e6eaf0 !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  resize: none !important;
  font-family: inherit !important;
  font-size: 0.875rem !important;
  line-height: 1.4 !important;
  overflow: hidden !important;
}

#dailyPage .daily-memo-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 0 10px 10px !important;
}

#dailyPage .daily-memo-actions button,
#dailyPage .daily-memo-save-btn {
  height: 34px !important;
  border-radius: 9px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

@media (max-width: 1024px) {
  #dailyPage .daily-day-layout {
    grid-template-columns: 1fr !important;
  }

  #dailyPage .daily-day-memo-panel {
    position: static !important;
  }
}

/* 브랜드 블루 통일 — 액센트/버튼 */
aside.sidebar .menu-btn.is-active,
html body .sidebar .menu-btn.is-active{
  background:var(--color-primary-light) !important;
  color:var(--color-primary) !important;
  border-color:var(--color-primary) !important;
  font-weight:700;
}
.memo__add .btn,
.daily-memo-save-btn,
.goal-style-menu .menu-btn.primary,
.repeat-modal-footer .btn-confirm,
.btn-primary-accent{
  background:var(--color-primary) !important;
  border-color:var(--color-primary) !important;
  color:#fff !important;
  transition:background 0.15s ease;
}
.memo__add .btn:hover,
.daily-memo-save-btn:hover,
.goal-style-menu .menu-btn.primary:hover,
.repeat-modal-footer .btn-confirm:hover,
.btn-primary-accent:hover{
  background:var(--color-primary-hover) !important;
  border-color:var(--color-primary-hover) !important;
}
input[type="checkbox"],
.daily-day-task-row input[type="checkbox"],
.daily-day-task-item input[type="checkbox"]{
  accent-color:var(--color-primary);
}
.calendar__grid .day.day--today .day__num,
.day--today .day__num{
  background:var(--color-primary);
  color:#fff;
  border-radius:50%;
  width:22px;
  height:22px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.day__num {
  height: 24px;
  line-height: 24px;
  position: relative;
  z-index: 2;
}
.day__labels,
.labels {
  position: absolute;
  top: 24px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}
.day__label,
.label-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
#login-btn:hover,
#login-btn-mobile:hover{
  border-color:var(--color-primary) !important;
  color:var(--color-primary) !important;
}

/* 캘린더 날짜 셀 이벤트 겹침 수정 */
.day {
  position: relative !important;
  overflow: hidden !important;
}

.day .day__num {
  position: relative !important;
  z-index: 2 !important;
  height: 24px !important;
  line-height: 24px !important;
  display: block !important;
}

.calendar__grid .day.day--today .day__num,
.day.day--today .day__num {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  max-width: 22px !important;
  line-height: 1 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

.day.day--selected:not(.day--today) .day__num {
  display: block !important;
  width: auto !important;
  height: 24px !important;
  margin: 0 !important;
}

.day .labels {
  position: absolute !important;
  /* top/inset은 renderCalendar()가 range lane에 맞춰 인라인으로 지정 */
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  overflow: hidden !important;
  max-height: none !important;
  padding: 2px 3px 0 3px !important;
  gap: 2px !important;
  display: flex !important;
  flex-direction: column !important;
}

.day.day--today .labels {
  /* today 원형 숫자도 day__num 높이(24) 안에 포함 — JS top 오프셋 사용 */
}

.day .label {
  position: relative !important;
  z-index: 1 !important;
  margin-bottom: 1px !important;
}

.day .label-content {
  padding: 1px 4px !important;
  margin: 0 !important;
  border-radius: 3px !important;
}

/* Logs page — single page scroll (no nested scroll on post body) */
#logsPage.logs-page{
  display:block;
  height:auto !important;
  min-height:0;
  max-height:none !important;
  overflow:visible !important;
  content-visibility:visible !important;
}
#logsPage .logs-page-body{
  flex:none !important;
  min-height:0;
  max-height:none !important;
  height:auto !important;
  overflow:visible !important;
  padding:16px 20px 24px;
  box-sizing:border-box;
}
#logsPage .logs-detail,
#logsPage #logs-detail{
  overflow:visible !important;
  max-height:none !important;
  height:auto !important;
}
.logs-header{
  padding:20px 0 8px;
}
.logs-header h2{
  font-size:22px;
  font-weight:500;
  margin:0;
  color:var(--text,#111827);
}
.logs-sub{
  font-size:13px;
  color:var(--text-muted,#9aa5b1);
  margin:4px 0 0;
}
.logs-filter{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-bottom:16px;
}
.logs-filter.view-segment{
  margin-bottom:16px;
}
.logs-filter .filter-btn{
  padding:5px 14px;
  font-size:13px;
  font-weight:400;
  border:none;
  border-radius:6px;
  background:transparent;
  color:var(--text,#111827);
  cursor:pointer;
  font-family:inherit;
}
.logs-filter .filter-btn:hover:not(.active){
  background:#EEF2FF;
  color:#5C8DFF;
}
.logs-filter .filter-btn.active{
  padding:5px 14px;
  font-size:13px;
  font-weight:500;
  background:#5C8DFF;
  color:#fff;
  border:none;
}
.logs-list{
  display:block;
}
.log-item{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 0;
  border-bottom:0.5px solid var(--line,#e9ecf2);
  cursor:pointer;
}
.log-item:hover .log-title{
  color:#5C8DFF;
}
.log-title{
  font-size:14px;
  color:var(--text,#111827);
}
.log-date{
  font-size:12px;
  color:var(--text-muted,#9aa5b1);
  flex-shrink:0;
  margin-left:16px;
}
.logs-empty{
  font-size:14px;
  color:var(--text-muted,#9aa5b1);
  padding:24px 0;
}
.log-back-btn{
  font-size:13px;
  color:#5C8DFF;
  background:none;
  border:none;
  cursor:pointer;
  padding:0 0 16px;
  display:block;
  font-family:inherit;
}
.log-detail-title{
  font-size:20px;
  font-weight:500;
  margin:0 0 4px;
}
.log-detail-meta{
  font-size:12px;
  color:var(--text-muted,#9aa5b1);
  margin:0 0 20px;
}
#logsPage .log-content{
  font-size:14px;
  line-height:1.8;
  color:var(--text,#111827);
  overflow:visible !important;
  max-height:none !important;
  height:auto !important;
}
#logsPage .log-content h1,
#logsPage .log-content h2,
#logsPage .log-content h3{
  font-weight:500;
  margin:1.5rem 0 0.5rem;
}
#logsPage .log-content p{
  margin:0 0 1em;
}

/* Logs open: page-level scroll only */
html:has(#logsPage:not(.hidden)),
html:has(#logsPage:not(.hidden)) body{
  height:auto !important;
  min-height:100%;
  overflow-y:auto !important;
}
.app:has(#logsPage:not(.hidden)){
  height:auto !important;
  min-height:100vh;
  min-height:100dvh;
}
.app:has(#logsPage:not(.hidden)) .main{
  overflow:visible !important;
  min-height:0;
}

/* ── 사이드바 축소 (0531 패치) ── */
.app {
  grid-template-columns: 80px minmax(0,1fr) !important;
}
.app:has(> .right:not(.hidden)) {
  grid-template-columns: 80px minmax(0,1fr) minmax(300px,360px) !important;
}

.sidebar {
  width: 80px !important;
  min-width: 80px !important;
}

.menu-btn {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  padding: 10px 4px 8px !important;
  font-size: 9px !important;
  gap: 4px !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  border-radius: 10px !important;
  min-height: 56px !important;
}

/* 이모지 크게, 텍스트 작게 */
.menu-btn::first-line {
  font-size: 20px !important;
}

.menu-icon {
  font-size: 20px;
  line-height: 1;
  display: block;
}
.menu-label {
  font-size: 9px;
  line-height: 1;
  display: block;
  color: inherit;
}
.app {
  grid-template-columns: minmax(0,1fr) !important;
}
.app:has(> .right:not(.hidden)) {
  grid-template-columns: minmax(0,1fr) minmax(300px,360px) !important;
}
.sidebar {
  width: 68px !important;
  min-width: 68px !important;
}
.menu-btn {
  min-height: 52px !important;
  padding: 8px 4px !important;
}

/* ── Layout fix: fixed sidebar + overflow (2026-05-31) ── */
:root {
  --sidebar-width: 68px;
  --mobile-tab-bar-height: 52px;
}

@media (min-width: 1025px) {
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }
  .app {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    padding-left: var(--sidebar-width) !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .app:has(> .right:not(.hidden)) {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px) !important;
  }
  .app > .sidebar-stack {
    width: 0 !important;
    min-width: 0 !important;
    overflow: visible !important;
  }
  .app .main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    grid-column: 1;
  }
  .app .right:not(.hidden) {
    grid-column: 2;
    min-width: 0;
    align-self: start;
  }
}

@media (max-width: 768px) {
  .app {
    padding-left: 0 !important;
    padding-top: var(--mobile-tab-bar-height) !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
  #mobile-tab-bar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 100 !important;
  }
  .app .main {
    margin-left: 0 !important;
    width: 100% !important;
    padding-top: 0 !important;
  }
}

/* Calendar page: Add Event panel above grid, popups on top */
#calendarPage {
  position: relative;
  z-index: 1;
  padding-bottom: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 0 !important;
}
aside.right:not(.hidden) {
  position: relative;
  z-index: 2;
}
aside.right:not(.hidden) .card {
  position: relative;
  z-index: 2;
}
.calendar-wrapper {
  position: relative;
  z-index: 1;
  flex: 1 !important;
  overflow: hidden !important;
  min-height: 0 !important;
}

#calendarPage .calendar {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  min-height: 0 !important;
}

#calendarPage .calendar__grid {
  flex: 1 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  gap: 0 !important;
  grid-auto-rows: 1fr !important;
  border-radius: 0 !important;
}

#calendarPage .calendar__weekdays {
  gap: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

#calendarPage .calendar__grid .day {
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  border-right: 1px solid #e9ecf2 !important;
  border-bottom: 1px solid #e9ecf2 !important;
  min-height: 0 !important;
  height: 100% !important;
  box-sizing: border-box !important;
}

#calendarPage .calendar__grid .day:nth-child(7n) {
  border-right: none !important;
}

#calendarPage .calendar__grid .day:nth-child(7n+1) {
  border-left: 1px solid #e9ecf2 !important;
}
.todo-options-panel {
  position: relative;
  z-index: 20;
}
#inlineRepeatList {
  z-index: 10050 !important;
}
.fab-add,
.fab-menu {
  z-index: 50 !important;
}

.fab-add {
  background: #5C8DFF !important;
  color: #fff !important;
  border: none !important;
}

.fab-add:hover {
  background: #4A7AEE !important;
}

/* 캘린더 셀 크게 + 여백 제거 (틱틱 스타일) */
.calendar__grid {
  gap: 0 !important;
  grid-auto-rows: 1fr !important;
}

.calendar__grid .day {
  border-radius: 0 !important;
  margin: 0 !important;
  border: none !important;
  border-right: 1px solid #e9ecf2 !important;
  border-bottom: 1px solid #e9ecf2 !important;
  min-height: 0 !important;
  height: 100% !important;
  padding: 4px 6px !important;
  box-sizing: border-box !important;
}

.calendar__grid .day:nth-child(7n) {
  border-right: none !important;
}

.calendar__grid .day:nth-child(7n+1) {
  border-left: 1px solid #e9ecf2 !important;
}

.calendar__weekdays {
  gap: 0 !important;
  margin: 0 !important;
  border-bottom: 2px solid #e9ecf2 !important;
  padding: 6px 0 !important;
}

#calendarPage .calendar {
  border-top: 1px solid #e9ecf2 !important;
}

.day--outside {
  background: #fafafa !important;
}

/* 캘린더 헤더 한 줄 컴팩트 */
#calendarPage .card__header-unified {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 6px 12px !important;
  border-bottom: 1px solid #e9ecf2 !important;
  flex-shrink: 0 !important;
}

#calendarPage .card__header-unified .goal-emoji {
  position: static !important;
  flex-shrink: 0 !important;
  font-size: 15px !important;
  line-height: 1 !important;
  pointer-events: none !important;
}

#calendarPage #monthlyGoalInput {
  flex: 1 !important;
  min-width: 0 !important;
  border: none !important;
  outline: none !important;
  font-size: 13px !important;
  background: transparent !important;
  padding: 4px 6px !important;
  box-shadow: none !important;
}

#calendarPage .card__header-unified .goal-style-btn,
#calendarPage .card__header-unified .icon-btn,
#calendarPage .card__header-unified .icon-btn-ghost {
  flex-shrink: 0 !important;
}

#calendarPage .card__header-unified .header-ym-compact {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

#openCalendarWidgetBtn {
  font-size: 11px !important;
  padding: 3px 8px !important;
  color: #9ca3af !important;
}

/* 반응형: 캘린더 헤더 · JustDoc 사이드바 · Daily 주간뷰 */
@media (max-width: 768px) {
  #openCalendarWidgetBtn {
    display: none !important;
  }
  #calendarPage {
    height: calc(100dvh - 52px - 40px) !important;
  }
  .day {
    min-height: 60px !important;
  }
  .day__num {
    font-size: 11px !important;
  }

  /* Daily 주간뷰: 7일 가로 스크롤 (weekGrid = #dailyWeekCalendar 마지막 자식) */
  #dailyWeekCalendar > div:last-child {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    grid-template-columns: unset !important;
    gap: 8px !important;
  }
  #dailyWeekCalendar > div:last-child > div {
    min-width: 120px !important;
    flex-shrink: 0 !important;
  }

  /* 달력 헤더 한 줄 유지 */
  .card__header-unified {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    overflow-x: auto;
    gap: 4px !important;
  }
  .card__header-unified .icon-btn,
  .card__header-unified .goal-style-btn,
  .card__header-unified .icon-btn-ghost {
    flex-shrink: 0;
  }
  .card__header-unified .monthly-goal-input-unified,
  #calendarPage .monthly-goal-input-unified {
    min-width: 80px;
    max-width: 140px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  #openCalendarWidgetBtn {
    display: none !important;
  }
}

#calendarPage.hidden { display: none !important; }

/* Daily repeat section — modify/delete modal */
.daily-repeat-modal {
  min-width: 280px;
  max-width: 360px;
}
.daily-repeat-modal .repeat-option {
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  margin-bottom: 8px;
  padding: 10px 12px;
}
.daily-repeat-modal .repeat-option:hover {
  background: #f8fafc;
  border-color: #5c8dff;
}
.daily-repeat-modal .repeat-option.del {
  color: #dc2626;
}
.daily-repeat-modal .repeat-option.del:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

/* Daily task context menu */
.task-context-menu .ctx-item {
  padding: 12px 16px;
  font-size: 14px;
  cursor: pointer;
  color: #374151;
  user-select: none;
}

.task-context-menu .ctx-item:hover {
  background: #f5f5f5;
}

.task-context-menu .ctx-delete {
  color: #e53935;
}

/* Note section header action buttons (+, ⧉, ···) */
.note-section-header-btn {
  color: #999;
  transition: color 0.15s;
}

.note-section-header-btn:hover {
  color: #555;
}
/* 노트 툴바 삽입 트랜지션 */
.note-toolbar-enter { opacity: 0; max-height: 0; overflow: hidden; }
.note-toolbar-enter-active { opacity: 1; max-height: 60px; overflow: hidden; transition: opacity 130ms ease, max-height 130ms ease; }
.note-edit-scroll { overflow-y: auto; }
.section-edit-toolbar-slot {
  position: sticky;
  z-index: 15;
  background: #fff;
  display: none;
}
.section-edit-toolbar-slot.active { display: block; }

/* Note tab header */
#memoPage .note-page-header {
  flex-shrink: 0;
  flex-wrap: wrap;
}

#memoPage .note-header-row1 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

#memoPage .note-header-row2,
#memoPage .note-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
}

#memoPage .note-header-search {
  flex-shrink: 0;
  width: 160px;
}

@media (max-width: 768px) {
  #memoPage .note-page-header {
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
  }

  #memoPage .note-header-row1 {
    width: 100%;
    flex: 1 1 100%;
  }

  #memoPage .note-header-search {
    flex: 1;
    width: auto !important;
    max-width: none !important;
    min-width: 0;
  }

  #memoPage .note-header-search-input {
    font-size: 12px;
  }

  #memoPage .note-header-row2,
  #memoPage .note-header-actions {
    width: 100%;
    flex: 1 1 100%;
    margin-left: 0;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 4px;
  }
}

/* Guest login nudge — Daily / Memo tab top */
#dailyPage #login-nudge-banner,
#memoPage #login-nudge-banner {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  padding: 8px 12px;
  margin: 0;
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  font-size: 13px;
  line-height: 1.35;
  color: #78350f;
  position: sticky;
  top: 0;
  z-index: 6;
  box-sizing: border-box;
}

.login-nudge-banner__text {
  flex: 1;
  min-width: 0;
}

.login-nudge-banner__btn {
  padding: 6px 12px;
  border: none;
  border-radius: 8px;
  background: #5c8dff;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}

.login-nudge-banner__btn:hover {
  background: #4a7aee;
}

.memo-pin-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text-tertiary, #9ca3af);
  padding: 0;
  line-height: 1;
}
.memo-pin-btn.pinned {
  color: #5C8DFF;
}
.memo-pin-btn:hover {
  color: #5C8DFF;
}

.memo-color-clear-btn {
  color: #374151;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.7);
  border: 2px solid #e5e7eb;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: transform 0.1s, background 0.1s, color 0.1s;
  box-sizing: border-box;
}

.memo-color-clear-btn:hover {
  background: rgba(255, 255, 255, 0.95);
  color: #111827;
  cursor: pointer;
}

/* (legacy #memoPage old memo-tab card styles removed) */

#memoPage ::-webkit-scrollbar,
#dailyPage ::-webkit-scrollbar,
#calendarPage ::-webkit-scrollbar,
#timerPage ::-webkit-scrollbar,
#logsPage ::-webkit-scrollbar {
  width: 2px;
  height: 2px;
}

#memoPage ::-webkit-scrollbar-track,
#dailyPage ::-webkit-scrollbar-track,
#calendarPage ::-webkit-scrollbar-track,
#timerPage ::-webkit-scrollbar-track,
#logsPage ::-webkit-scrollbar-track {
  background: transparent;
}

#memoPage ::-webkit-scrollbar-thumb,
#dailyPage ::-webkit-scrollbar-thumb,
#calendarPage ::-webkit-scrollbar-thumb,
#timerPage ::-webkit-scrollbar-thumb,
#logsPage ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 999px;
}

#memoPage ::-webkit-scrollbar-thumb:hover,
#dailyPage ::-webkit-scrollbar-thumb:hover,
#calendarPage ::-webkit-scrollbar-thumb:hover,
#timerPage ::-webkit-scrollbar-thumb:hover,
#logsPage ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.22);
}

/* Firefox */
#memoPage *,
#dailyPage *,
#calendarPage *,
#timerPage *,
#logsPage * {
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.12) transparent;
}

/* 노트탭 3패널 레이아웃 */
#memoPage:not(.hidden) {
  display: flex !important;
  flex-direction: column !important;
}

#memoPage #memoPageContent,
#memoPage .note-page-content {
  flex: 1;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0;
}

#memoPage .note-panels-container,
#memoPage #memoPageContent > div.note-panels-container {
  display: flex !important;
  flex-direction: row !important;
  gap: 12px;
  flex: 1;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}

#memoPage .note-panel,
#memoPage .note-panels-container > .note-panel {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  height: 100%;
  display: flex;
  flex-direction: column;
}

@media (max-width: 768px) {
  #memoPage:not(.hidden) {
    display: flex !important;
    flex-direction: column !important;
    min-height: calc(100dvh - var(--mobile-tab-bar-height, 52px)) !important;
    height: auto !important;
    overflow: visible !important;
  }

  #memoPage #memoPageContent,
  #memoPage .note-page-content {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: calc(100dvh - var(--mobile-tab-bar-height, 52px) - 130px) !important;
    height: auto !important;
    overflow: visible !important;
  }

  #memoPage .note-panels-container,
  #memoPage #memoPageContent > .note-panels-container {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 300px !important;
    height: auto !important;
    overflow: visible !important;
    padding: 10px !important;
    box-sizing: border-box !important;
  }

  #memoPage .note-panel,
  #memoPage .note-panels-container > .note-panel {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    min-height: 300px !important;
    height: auto !important;
    flex: 1 1 auto !important;
    overflow-y: visible !important;
    box-sizing: border-box !important;
  }

  #memoPage .note-panel-toggle-btns {
    display: flex !important;
  }
}

/* 노트 카드 미리보기 — 표 스타일 */
.note-card-preview table {
  border-collapse: collapse;
  width: 100%;
  margin: 8px 0;
  font-size: 13px;
}
.note-card-preview td,
.note-card-preview th {
  border: 1px solid #e5e7eb;
  padding: 4px 8px;
  min-width: 40px;
  text-align: left;
}
.note-card-preview th {
  background: #f9fafb;
  font-weight: 600;
}
.note-card-preview ul,
.note-card-preview ol {
  padding-left: 20px;
  margin: 4px 0;
}
.note-card-preview img {
  max-width: 100%;
  border-radius: 6px;
}
.note-card-preview p {
  margin: 0 0 4px;
}
/* 강조 블록 — 수정모드와 동일 토큰 (blockquote + data-block-style) */
.note-card-preview blockquote {
  margin: 4px 0;
  padding: 4px 12px;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
  position: relative;
  overflow: visible;
  quotes: none;
}
.note-card-preview blockquote:not([data-block-style]),
.note-card-preview blockquote[data-block-style="default"] {
  background: rgba(249, 250, 251, 0.65);
  border: none;
  border-left: none;
  border-radius: 0;
  box-shadow: none;
  padding: 14px 12px 8px 16px;
  margin: 8px 0 6px;
  color: #4b5563;
}
.note-card-preview blockquote:not([data-block-style])::before,
.note-card-preview blockquote[data-block-style="default"]::before {
  content: "“";
  position: absolute;
  top: -4px;
  left: 2px;
  font-size: 42px;
  line-height: 1;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  color: #c5cad3;
  pointer-events: none;
  user-select: none;
}
.note-card-preview blockquote:not([data-block-style])::after,
.note-card-preview blockquote[data-block-style="default"]::after {
  content: none;
}
.note-card-preview blockquote[data-block-style="vertical"] {
  background: transparent;
  border: none;
  border-left: 5px solid #4b5563;
  border-radius: 0;
  box-shadow: none;
  padding: 2px 0 2px 14px;
  margin: 4px 0;
  color: inherit;
}
.note-card-preview blockquote[data-block-style="vertical"]::before,
.note-card-preview blockquote[data-block-style="vertical"]::after {
  content: none;
}
.note-card-preview blockquote[data-block-style="bubble"] {
  background: #fff;
  border: 1.5px solid #c5cad3;
  border-left: 1.5px solid #c5cad3;
  border-radius: 14px;
  box-shadow: none;
  padding: 10px 14px;
  margin: 4px 0 18px;
  color: inherit;
}
.note-card-preview blockquote[data-block-style="bubble"]::before {
  content: none;
}
.note-card-preview blockquote[data-block-style="bubble"]::after {
  content: "";
  position: absolute;
  left: 20px;
  bottom: -8px;
  width: 14px;
  height: 14px;
  background: #fff;
  border: none;
  border-right: 1.5px solid #c5cad3;
  border-bottom: 1.5px solid #c5cad3;
  transform: rotate(45deg);
  box-sizing: border-box;
  box-shadow: none;
}
.note-card-preview blockquote[data-block-style="sticky"] {
  background: #f3edd8;
  border: 1px solid #d6ccb0;
  border-left: 1px solid #d6ccb0;
  border-radius: 2px;
  box-shadow: 1px 2px 6px rgba(0, 0, 0, 0.08);
  padding: 10px 14px 16px 12px;
  margin: 4px 0;
  color: inherit;
}
.note-card-preview blockquote[data-block-style="sticky"]::before {
  content: none;
}
.note-card-preview blockquote[data-block-style="sticky"]::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 16px 16px;
  border-color: transparent transparent #cfc4a8 #e8e0c8;
  background: transparent;
  transform: none;
  box-shadow: none;
  pointer-events: none;
}
.note-card-preview blockquote[data-block-style="frame"] {
  background:
    linear-gradient(#374151, #374151) top left / 18px 2.5px no-repeat,
    linear-gradient(#374151, #374151) top left / 2.5px 18px no-repeat,
    linear-gradient(#374151, #374151) top right / 18px 2.5px no-repeat,
    linear-gradient(#374151, #374151) top right / 2.5px 18px no-repeat,
    linear-gradient(#374151, #374151) bottom left / 18px 2.5px no-repeat,
    linear-gradient(#374151, #374151) bottom left / 2.5px 18px no-repeat,
    linear-gradient(#374151, #374151) bottom right / 18px 2.5px no-repeat,
    linear-gradient(#374151, #374151) bottom right / 2.5px 18px no-repeat;
  border: none;
  border-left: none;
  border-radius: 0;
  box-shadow: none;
  padding: 14px 16px;
  margin: 8px 0;
  color: inherit;
}
.note-card-preview blockquote[data-block-style="frame"]::before,
.note-card-preview blockquote[data-block-style="frame"]::after {
  content: none;
}

/* ── Tab header & button unification ── */
.newmemo-header,
#memoPage .note-page-header,
#memoPage .card__header,
.diary-tab-bar,
.diary-header,
#dailyPage .daily-page-header,
#calendarPage .card__header-unified,
#timerPage .timer-page-header,
#routinePage .card__header {
  height: 52px;
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 8px;
  box-sizing: border-box;
  border-bottom: 1px solid #f0f0f0;
}

.newmemo-filter-btn,
.diary-tab-btn,
.note-view-btn,
.daily-view-btn,
.view-tab-btn {
  height: 28px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-family: inherit;
  color: #374151;
  line-height: 1;
}

.newmemo-filter-btn.active,
.diary-tab-btn.active,
.note-view-btn.is-active,
.daily-view-btn.is-active,
.view-tab-btn.is-active {
  background: #5C8DFF;
  color: #fff;
  border-color: #5C8DFF;
}

.newmemo-new-btn {
  background: #5C8DFF;
  color: #fff;
  border-color: #5C8DFF;
}

.note-panel-toggle-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  color: #374151;
}

.note-panel-toggle-btn.is-active {
  background: #5C8DFF;
  color: #fff;
  border-color: #5C8DFF;
}

.newmemo-tag-check-item input[type="checkbox"] {
  accent-color: #5C8DFF;
}

/* ── New Memo Tab ── */
#newMemoPage { flex:1; overflow:hidden; display:flex; flex-direction:column; background-color:#ffffff !important; }
.newmemo-header { flex-shrink:0; flex-wrap:wrap; }
.newmemo-title { font-size:14px; font-weight:700; color:#111827; }
.newmemo-search { flex:1; min-width:120px; max-width:200px; padding:4px 10px; border:1px solid #e5e7eb; border-radius:20px; font-size:12px; outline:none; }
.newmemo-filter-bar { display:flex; gap:6px; padding:8px 14px; flex-shrink:0; flex-wrap:wrap; border-bottom:1px solid #f3f4f6; }
.newmemo-filter-tag-sort { display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.newmemo-content { flex:1; overflow-y:auto; padding:12px 14px; }
.newmemo-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.newmemo-card { border-radius:10px; padding:12px; cursor:pointer; border:1px solid #d1d5db; transition:box-shadow 0.15s; position:relative; }
.newmemo-card:hover { box-shadow:0 4px 12px rgba(0,0,0,0.12); }
.newmemo-card-date { font-size:10px; color:#6b7280; margin-bottom:6px; }
.newmemo-card-content { font-size:13px; color:#1f2937; line-height:1.5; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.newmemo-card-content--full { font-size:13px; color:#1f2937; line-height:1.5; white-space:pre-wrap; }
.newmemo-grid-full { column-count:3; column-gap:10px; }
.newmemo-grid-full .newmemo-card { break-inside:avoid; margin-bottom:10px; display:inline-block; width:100%; }
@media (max-width:768px) { .newmemo-grid-full { column-count:2; } }
@media (max-width:480px) { .newmemo-grid-full { column-count:1; } }
.newmemo-card-footer { display:flex; justify-content:flex-start; align-items:center; margin-top:8px; }
.newmemo-card-tag { font-size:11px; color:#6b7280; }
.newmemo-card-actions { display:flex; gap:4px; opacity:0; transition:opacity 0.15s; }
.newmemo-card:hover .newmemo-card-actions { opacity:1; }
/* 목록뷰 */
.newmemo-list { display:flex; flex-direction:column; }
.newmemo-list-item { display:flex; gap:12px; }
.newmemo-list-left { display:flex; flex-direction:column; align-items:center; width:16px; flex-shrink:0; }
.newmemo-list-dot { width:8px; height:8px; border-radius:50%; background:#5C8DFF; margin-top:6px; flex-shrink:0; }
.newmemo-list-line { width:1px; background:#e5e7eb; flex:1; min-height:16px; }
.newmemo-list-card { flex:1; background:#f9fafb; border-radius:8px; padding:10px 12px; margin-bottom:8px; cursor:pointer; border:1px solid #f3f4f6; }
.newmemo-list-card:hover { background:#f3f4f6; }
/* 모달 */
.newmemo-modal-backdrop { position:fixed; inset:0; background:rgba(0,0,0,0.3); backdrop-filter:blur(2px); z-index:1000; display:flex; align-items:center; justify-content:center; }
.newmemo-modal { background:#fff; border-radius:14px; padding:20px; width:90%; max-width:691.2px; max-height:94vh; overflow-y:auto; box-shadow:0 8px 32px rgba(0,0,0,0.18); }
.newmemo-color-palette { display:flex; gap:8px; margin:10px 0; flex-wrap:wrap; }
.newmemo-color-dot { width:26px; height:26px; border-radius:50%; cursor:pointer; border:2px solid transparent; }
.newmemo-color-dot.selected { border-color:#5C8DFF; }
.newmemo-card-tags { display:flex; flex-wrap:wrap; gap:4px; margin-top:4px; justify-content:flex-start; }
.newmemo-tag-pill { display:inline-block; font-size:10px; color:#4A7AEE; background:#EEF2FF; border-radius:999px; padding:2px 8px; line-height:1.4; }
.newmemo-list-card-date { font-size:10px; color:#6b7280; margin-bottom:4px; }
.newmemo-list-card-content { font-size:13px; color:#1f2937; line-height:1.5; margin-bottom:4px; white-space:pre-wrap; }
.newmemo-list-card-tags { display:flex; flex-wrap:wrap; gap:4px; justify-content:flex-start; margin-top:6px; }
.newmemo-modal-title { font-size:14px; font-weight:700; margin-bottom:12px; }
.newmemo-modal-label { display:block; font-size:11px; font-weight:600; color:#6b7280; margin:8px 0 4px; }
.newmemo-modal-date,
.newmemo-modal-input,
.newmemo-modal-textarea { width:100%; box-sizing:border-box; border:1px solid #e5e7eb; border-radius:8px; padding:8px 10px; font-size:13px; font-family:inherit; }
.newmemo-modal-textarea { resize:none; overflow:hidden; min-height:200px; }
.newmemo-tag-input-row { display:flex; gap:6px; margin-bottom:8px; }
.newmemo-tag-input-row .newmemo-modal-input { flex:1; }
.newmemo-tag-checklist { overflow-y:hidden; border:1px solid #f3f4f6; border-radius:8px; padding:6px 8px; margin-bottom:8px; box-sizing:border-box; }
.newmemo-tag-checklist-empty { font-size:12px; color:#9ca3af; padding:8px 4px; }
.newmemo-tag-check-item { display:flex; align-items:center; gap:8px; padding:4px 0; font-size:13px; color:#374151; cursor:pointer; }
.newmemo-tag-check-item span { flex:1; }
.newmemo-tag-remove-btn { border:none; background:none; color:#9ca3af; font-size:16px; cursor:pointer; padding:0 4px; line-height:1; }
.newmemo-tag-remove-btn:hover { color:#ef4444; }
.newmemo-modal-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:14px; }
.newmemo-modal-save { background:#5C8DFF; color:#fff; border-color:#5C8DFF; }
.newmemo-autosave-badge { background:#e1f5ee; color:#0f6e56; font-size:12px; padding:3px 10px; border-radius:6px; align-self:center; white-space:nowrap; }

/* ── Diary Tab ── */
#diaryPage { flex:1; overflow:hidden; display:flex; flex-direction:column; background:#fff; }
.diary-date-nav { display:flex; align-items:center; gap:8px; flex:1; }
.diary-date-nav button { border:none; background:none; cursor:pointer; font-size:16px; color:#374151; padding:4px 8px; }
.diary-date-label { font-size:14px; font-weight:700; color:#111827; }
.diary-tab-bar { flex-shrink:0; }
.diary-content { flex:1; overflow-y:auto; padding:12px 14px; }
.diary-section-card { border:1px solid #f3f4f6; border-radius:10px; margin-bottom:10px; overflow:hidden; }
.diary-section-header { display:flex; align-items:center; justify-content:space-between; padding:10px 14px; cursor:pointer; background:#fafafa; }
.diary-section-name { font-size:13px; font-weight:600; color:#374151; }
.diary-section-body { padding:10px 14px; }
.diary-section-textarea { width:100%; box-sizing:border-box; border:none; outline:none; font-size:13px; line-height:1.7; color:#374151; resize:none; min-height:80px; font-family:inherit; background:transparent; }
.diary-history-card { border:1px solid #f3f4f6; border-radius:8px; padding:12px 14px; margin-bottom:8px; cursor:pointer; }
.diary-history-card:hover { background:#f9fafb; }
.diary-history-date { font-size:11px; color:#9ca3af; margin-bottom:4px; }
.diary-history-section { font-size:11px; color:#5C8DFF; margin-bottom:4px; }
.diary-history-content { font-size:13px; color:#374151; line-height:1.5; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
/* 커스텀 팝업 */
.diary-custom-popup { position:fixed; inset:0; background:rgba(0,0,0,0.3); z-index:1000; display:flex; align-items:flex-end; justify-content:center; }
.diary-custom-sheet { background:#fff; border-radius:16px 16px 0 0; width:100%; max-width:480px; padding:20px; max-height:70vh; overflow-y:auto; }
.diary-custom-item { display:flex; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid #f3f4f6; }
.diary-custom-name { flex:1; font-size:13px; color:#374151; }

/* Daily 섹션/태스크 행 높이 축소 */
.daily-day-section-head,
.daily-section-header,
#dailyPage .daily-day-section-head,
#dailyPage .daily-section-header {
  min-height: 40px !important;
  padding: 6px 12px !important;
}

.daily-task-row,
.daily-day-task-row,
.daily-day-task-item,
#dailyPage .daily-day-task-row {
  min-height: 36px !important;
  padding: 4px 8px !important;
}

.daily-section-add-wrap,
#dailyPage .daily-section-add-wrap {
  min-height: 36px !important;
  padding: 4px 8px !important;
  margin: 0 !important;
}

.daily-section-task-input,
#dailyPage .daily-section-task-input {
  min-height: 36px !important;
  height: 36px !important;
  padding: 4px 8px !important;
}

/* Daily Today 뷰 섹션 레이아웃 */
.daily-sections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.daily-sections-grid3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .daily-sections-grid3 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .daily-sections-grid3 {
    grid-template-columns: 1fr;
  }
}

.daily-sections-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Daily section history right panel */
.daily-section-history-panel{
  background:#fff;
  border:1px solid var(--line,#e9ecf2);
  border-radius:14px;
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
  min-height:320px;
}
.daily-section-history-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding-bottom:8px;
  border-bottom:1px solid #eef2f7;
}
.daily-section-history-title-wrap{
  min-width:0;
  display:flex;
  align-items:center;
  gap:7px;
  font-weight:700;
  color:#111827;
}
.daily-section-history-emoji{font-size:18px;line-height:1}
.daily-section-history-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.daily-section-history-color-chip{width:14px;height:14px;border-radius:999px;border:1px solid rgba(15,23,42,.12);flex:0 0 auto}
.daily-pro-badge{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:#fff4cc;color:#9a6700;border:1px solid #ffe08a;font-size:10px;font-weight:800;line-height:1;padding:3px 6px;letter-spacing:.02em;white-space:nowrap}
.daily-section-history-close{border:1px solid #e5e7eb;background:#fff;border-radius:9px;width:28px;height:28px;cursor:pointer;color:#64748b;font-size:18px;line-height:1}
.daily-section-history-close:hover{background:#f8fafc;color:#111827}
.daily-section-history-controls{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.daily-section-history-controls .newmemo-filter-btn:disabled{opacity:.55;cursor:not-allowed}
.daily-section-history-range{font-size:11px;color:#64748b;background:#f8fafc;border:1px solid #edf2f7;border-radius:10px;padding:7px 8px;line-height:1.4}
.daily-section-history-list{display:flex;flex-direction:column;gap:8px;overflow:auto;max-height:calc(100vh - 230px);padding-right:2px}
.daily-section-history-date-group{border:1px solid #edf2f7;border-radius:12px;background:#fbfcff;padding:9px 10px}
.daily-section-history-date{border:0;background:transparent;padding:0;margin:0 0 7px;cursor:pointer;color:#5C8DFF;font-size:12px;font-weight:800;text-align:left}
.daily-section-history-date:hover{text-decoration:underline}
.daily-section-history-tasks{display:flex;flex-direction:column;gap:5px}
.daily-section-history-task{display:flex;gap:7px;align-items:flex-start;font-size:13px;color:#334155;line-height:1.35}
.daily-section-history-task.is-done .daily-section-history-task-text{text-decoration:line-through;color:#94a3b8}
.daily-section-history-check{flex:0 0 auto;color:#64748b}
.daily-section-history-no-tasks,.daily-section-history-empty,.daily-section-history-loading{font-size:12px;color:#94a3b8;padding:6px 0;text-align:left}
@media (max-width:768px){
  .daily-section-history-list{max-height:none;overflow:visible}
}
