:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #e6e8ec;
  --text: #1a1d23;
  --text-soft: #6b7280;
  --text-faint: #9ca3af;
  --accent: #5b6cff;
  --accent-soft: #eef0ff;
  --accent-hover: #4757f0;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --amber: #f59e0b;
  --amber-soft: #fef3c7;
  --red: #ef4444;
  --purple: #8b5cf6;
  --pink: #ec4899;
  --grad: linear-gradient(135deg, #5b6cff, #8b5cf6);
  --grad-pink: linear-gradient(135deg, #8b5cf6, #ec4899);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.09);
  --shadow-lg: 0 20px 50px rgba(16, 24, 40, 0.16);
  --shadow-accent: 0 8px 22px rgba(91, 108, 255, 0.28);
  --radius: 18px;
  --radius-sm: 11px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', 'Noto Sans KR', -apple-system, sans-serif;
  background-color: #f4f6fb;
  background-image:
    radial-gradient(1100px 560px at 100% -8%, rgba(91, 108, 255, 0.12), transparent 60%),
    radial-gradient(900px 520px at -8% 108%, rgba(236, 72, 153, 0.10), transparent 55%);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* 커스텀 스크롤바 */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: rgba(120, 130, 160, 0.35); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(120, 130, 160, 0.55); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

.hidden { display: none !important; }

/* ===== 잠금 화면 ===== */
.lock-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #5b6cff 0%, #8b5cf6 50%, #ec4899 100%);
  z-index: 100;
  animation: fadeIn 0.5s ease;
}
.lock-card {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  padding: 48px 40px;
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  width: 360px; max-width: 90vw;
  text-align: center;
  animation: rise 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.lock-logo {
  width: 64px; height: 64px;
  margin: 0 auto 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, #5b6cff, #8b5cf6);
  color: #fff; font-size: 30px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(91, 108, 255, 0.35);
}
.lock-title { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.lock-sub { color: var(--text-soft); font-size: 14px; margin: 6px 0 28px; }
.lock-input-wrap { position: relative; margin-bottom: 12px; }
.lock-input-wrap input {
  width: 100%; padding: 14px 44px 14px 16px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; outline: none;
  transition: border 0.2s, box-shadow 0.2s; font-family: inherit;
}
.lock-input-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.toggle-pw {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  font-size: 16px; opacity: 0.5; padding: 6px;
}
.toggle-pw:hover { opacity: 1; }
.lock-btn {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, #5b6cff, #7c5cff);
  color: #fff; border: none; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s; font-family: inherit;
}
.lock-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(91, 108, 255, 0.4); }
.lock-btn:active { transform: translateY(0); }
.lock-error { color: var(--red); font-size: 13px; margin-top: 12px; min-height: 18px; font-weight: 500; }
.lock-hint { color: var(--text-faint); font-size: 12px; margin-top: 4px; }

/* ===== 앱 레이아웃 ===== */
.app { display: flex; min-height: 100vh; animation: fadeIn 0.4s ease; }
.sidebar {
  width: 244px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid rgba(230, 232, 236, 0.8);
  padding: 24px 16px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 12px 24px; font-weight: 800; font-size: 18px; }
.brand-name { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.brand-mark {
  width: 34px; height: 34px;
  background: var(--grad);
  color: #fff; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  box-shadow: var(--shadow-accent);
}
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border: none; background: none;
  border-radius: var(--radius-sm);
  font-size: 14.5px; font-weight: 500; color: var(--text-soft);
  cursor: pointer; text-align: left; transition: all 0.18s; font-family: inherit;
}
.nav-item span { font-size: 16px; width: 18px; text-align: center; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--grad); color: #fff; font-weight: 600; box-shadow: var(--shadow-accent); }
.sidebar-footer { display: flex; flex-direction: column; gap: 6px; padding-top: 16px; border-top: 1px solid var(--border); }
.ghost-btn {
  padding: 9px 14px; background: none; border: none;
  border-radius: var(--radius-sm); color: var(--text-soft);
  font-size: 13.5px; font-weight: 500; cursor: pointer; text-align: left;
  transition: all 0.18s; font-family: inherit;
}
.ghost-btn:hover { background: var(--surface-2); color: var(--text); }

/* ===== 컨텐츠 ===== */
.content { flex: 1; padding: 40px 48px; max-width: 1180px; width: 100%; }
.view { display: none; animation: fadeIn 0.35s ease; }
.view.active { display: block; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 28px; }
.view-head h2 { font-size: 28px; font-weight: 800; letter-spacing: -0.6px; }
.sub-head { font-size: 15px; font-weight: 500; color: var(--text-faint); margin-left: 6px; }
.greeting { color: var(--text-soft); font-size: 15px; margin-bottom: 4px; font-weight: 500; }
#today-date { font-size: 27px; font-weight: 800; letter-spacing: -0.6px; }
.primary-btn {
  padding: 11px 18px; background: var(--grad); color: #fff; border: none;
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.18s; font-family: inherit; white-space: nowrap;
  box-shadow: var(--shadow-accent);
}
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(91, 108, 255, 0.4); filter: brightness(1.05); }
.primary-btn:active { transform: translateY(0); }

/* ===== 통계 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow-sm); transition: transform 0.2s, box-shadow 0.2s;
  position: relative; overflow: hidden;
}
.stat-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-label { color: var(--text-soft); font-size: 13px; font-weight: 500; }
.stat-num { font-size: 34px; font-weight: 800; margin-top: 8px; letter-spacing: -1.2px; line-height: 1; }
.stat-grid .stat-card:nth-child(1)::before { background: #5b6cff; }
.stat-grid .stat-card:nth-child(2)::before { background: #16a34a; }
.stat-grid .stat-card:nth-child(3)::before { background: #8b5cf6; }
.stat-grid .stat-card:nth-child(4)::before { background: #ec4899; }
.stat-grid .stat-card:nth-child(1) .stat-num { color: #5b6cff; }
.stat-grid .stat-card:nth-child(2) .stat-num { color: #16a34a; }
.stat-grid .stat-card:nth-child(3) .stat-num { color: #8b5cf6; }
.stat-grid .stat-card:nth-child(4) .stat-num { color: #ec4899; }

.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dash-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm);
}
.dash-block h3 { font-size: 15px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.dash-memo-preview { font-size: 14px; color: var(--text-soft); white-space: pre-wrap; min-height: 60px; line-height: 1.7; }
.dash-memo-preview.empty { color: var(--text-faint); }
.mini-list { display: flex; flex-direction: column; gap: 10px; }
.mini-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 14px; }
.mini-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.mini-item .mi-title { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-item .mi-meta { color: var(--text-faint); font-size: 12.5px; flex-shrink: 0; }
.mini-empty { color: var(--text-faint); font-size: 13.5px; padding: 8px 4px; }

/* ===== 필터 칩 ===== */
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip {
  padding: 6px 14px; border: 1px solid var(--border); background: var(--surface);
  border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--text-soft);
  cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.tag-chip:hover { border-color: var(--accent); color: var(--accent); }
.tag-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ===== 프로젝트 ===== */
.projects-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; margin-top: 20px; }
.project-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm);
  position: relative; transition: transform 0.2s, box-shadow 0.2s;
}
.project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.project-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 10px; }
.project-card h4 { font-size: 17px; font-weight: 700; flex: 1; }
.status-badge { font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.status-badge.todo { background: var(--surface-2); color: var(--text-soft); }
.status-badge.doing { background: var(--accent-soft); color: var(--accent); }
.status-badge.done { background: var(--green-soft); color: var(--green); }
.project-card p { color: var(--text-soft); font-size: 14px; white-space: pre-wrap; word-break: break-word; margin-bottom: 16px; }
.progress-wrap { margin-bottom: 12px; }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-soft); margin-bottom: 6px; font-weight: 500; }
.progress-bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--purple)); border-radius: 999px; transition: width 0.4s; }
.project-foot { display: flex; align-items: center; justify-content: space-between; }
.project-due { font-size: 12.5px; color: var(--text-faint); }
.project-due.urgent { color: var(--red); font-weight: 600; }
.proj-actions { display: flex; gap: 4px; }
.icon-btn {
  background: none; border: none; cursor: pointer; color: var(--text-faint);
  font-size: 14px; padding: 4px 6px; border-radius: 6px; transition: all 0.15s; font-family: inherit;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.del:hover { color: var(--red); }

/* ===== 달력 ===== */
.calendar-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); margin-bottom: 24px;
}
.cal-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.cal-header h3 { font-size: 19px; font-weight: 800; min-width: 150px; }
.cal-nav {
  width: 34px; height: 34px; border: 1px solid var(--border); background: var(--surface);
  border-radius: 9px; font-size: 18px; cursor: pointer; color: var(--text-soft);
  transition: all 0.15s; font-family: inherit;
}
.cal-nav:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.cal-today-btn {
  margin-left: auto; padding: 8px 16px; border: 1px solid var(--border); background: var(--surface);
  border-radius: 9px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text-soft);
  transition: all 0.15s; font-family: inherit;
}
.cal-today-btn:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 8px; }
.cal-weekdays span { text-align: center; font-size: 12.5px; font-weight: 600; color: var(--text-faint); padding: 6px 0; }
.cal-weekdays span:first-child { color: #f87171; }
.cal-weekdays span:last-child { color: #60a5fa; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell {
  min-height: 88px; border: 1px solid var(--border); border-radius: 10px;
  padding: 8px; cursor: pointer; background: var(--surface);
  transition: all 0.15s; display: flex; flex-direction: column; gap: 4px; overflow: hidden;
}
.cal-cell:hover { border-color: var(--accent); background: var(--accent-soft); }
.cal-cell.empty { border: none; background: none; cursor: default; }
.cal-cell.empty:hover { background: none; }
.cal-cell.today { border-color: var(--accent); border-width: 2px; }
.cal-daynum { font-size: 13px; font-weight: 600; color: var(--text); }
.cal-cell.today .cal-daynum {
  background: var(--accent); color: #fff; width: 22px; height: 22px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.cal-cell.sun .cal-daynum { color: #f87171; }
.cal-cell.sat .cal-daynum { color: #60a5fa; }
.cal-event {
  font-size: 11px; padding: 2px 6px; border-radius: 5px;
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-event.done { background: var(--surface-2); color: var(--text-faint); text-decoration: line-through; }
.cal-more { font-size: 10.5px; color: var(--text-faint); padding-left: 4px; }

/* ===== 메모지 ===== */
.memo-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.memo-note {
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.note-today { background: linear-gradient(160deg, #fffdf5, #fff8e6); border-color: #fde68a; }
.note-week { background: linear-gradient(160deg, #f5fbff, #e6f4ff); border-color: #bae0fd; }
.memo-head { display: flex; align-items: center; justify-content: space-between; font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.memo-saved { font-size: 11.5px; font-weight: 500; color: var(--green); opacity: 0; transition: opacity 0.3s; }
.memo-saved.show { opacity: 1; }
.memo-note textarea {
  width: 100%; min-height: 220px; border: none; background: transparent;
  resize: vertical; outline: none; font-family: inherit; font-size: 14.5px;
  line-height: 1.9; color: var(--text);
  background-image: repeating-linear-gradient(transparent, transparent 33px, rgba(0,0,0,0.06) 34px);
}
.memo-note textarea::placeholder { color: rgba(0,0,0,0.3); }

/* ===== 연구 탭 ===== */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab-btn {
  padding: 12px 18px; background: none; border: none; border-bottom: 2px solid transparent;
  font-size: 14.5px; font-weight: 600; color: var(--text-soft); cursor: pointer;
  transition: all 0.15s; font-family: inherit; margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.research-pane { display: none; animation: fadeIn 0.3s ease; }
.research-pane.active { display: block; }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.pane-head .filter-row { flex: 1; }

/* ===== 논문 ===== */
.papers-list { display: flex; flex-direction: column; gap: 28px; }
.topic-group { display: flex; flex-direction: column; gap: 14px; }
.topic-head { display: flex; align-items: center; gap: 10px; padding-bottom: 4px; border-bottom: 2px solid var(--border); }
.topic-icon { font-size: 17px; }
.topic-head h3 { font-size: 16.5px; font-weight: 800; letter-spacing: -0.3px; }
.topic-count { font-size: 12px; font-weight: 600; color: var(--text-faint); background: var(--surface-2); padding: 3px 10px; border-radius: 999px; }
.topic-papers { display: flex; flex-direction: column; gap: 14px; }
.paper-card {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--purple);
  border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm);
  position: relative; transition: transform 0.15s, box-shadow 0.2s;
}
.paper-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.paper-card.read { border-left-color: var(--green); }
.paper-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.paper-card h4 { font-size: 16.5px; font-weight: 700; flex: 1; padding-right: 8px; line-height: 1.4; }
.read-toggle {
  font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  cursor: pointer; border: none; white-space: nowrap; transition: all 0.15s; font-family: inherit;
  background: var(--surface-2); color: var(--text-soft);
}
.read-toggle.read { background: var(--green-soft); color: var(--green); }
.paper-meta { font-size: 13px; color: var(--text-soft); margin-bottom: 10px; }
.paper-meta .sep { margin: 0 8px; color: var(--text-faint); }
.paper-notes { font-size: 14px; color: var(--text-soft); white-space: pre-wrap; word-break: break-word; margin-bottom: 12px; background: var(--surface-2); padding: 12px 14px; border-radius: var(--radius-sm); }
.paper-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.paper-link { font-size: 13px; color: var(--accent); font-weight: 600; text-decoration: none; }
.paper-link:hover { text-decoration: underline; }
.paper-tags { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.paper-tag { font-size: 11.5px; font-weight: 600; padding: 3px 9px; background: #f3e8ff; color: var(--purple); border-radius: 999px; }
.paper-card .proj-actions { position: absolute; top: 16px; right: 16px; opacity: 0; transition: opacity 0.15s; }
.paper-card:hover .proj-actions { opacity: 1; }

/* ===== 아이디어 ===== */
.ideas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.idea-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s; position: relative; border-top: 3px solid var(--accent);
}
.idea-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.idea-card h4 { font-size: 16px; font-weight: 700; margin-bottom: 8px; padding-right: 24px; }
.idea-card p { color: var(--text-soft); font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.idea-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.idea-tag { font-size: 11.5px; font-weight: 600; padding: 3px 9px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; }
.idea-date { color: var(--text-faint); font-size: 12px; margin-top: 12px; }
.card-del {
  position: absolute; top: 14px; right: 14px; background: none; border: none;
  color: var(--text-faint); cursor: pointer; font-size: 16px; line-height: 1;
  opacity: 0; transition: opacity 0.15s, color 0.15s; padding: 2px;
}
.idea-card:hover .card-del { opacity: 1; }
.card-del:hover { color: var(--red); }

/* ===== 북마크 ===== */
.bookmarks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.bm-card {
  position: relative; display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm);
  text-decoration: none; color: inherit;
  transition: transform 0.18s, box-shadow 0.2s, border-color 0.18s;
}
.bm-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.bm-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); overflow: hidden;
  font-size: 20px; font-weight: 800; color: var(--accent);
}
.bm-icon img { width: 28px; height: 28px; display: block; }
.bm-info { min-width: 0; flex: 1; }
.bm-title { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-domain { font-size: 12.5px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.bm-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s; }
.bm-card:hover .bm-actions { opacity: 1; }

/* ===== 노트 (게시판/아코디언) ===== */
.notes-board { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.note-row {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow 0.2s, border-color 0.18s;
}
.note-row:hover { box-shadow: var(--shadow-md); }
.note-row.open { border-color: var(--accent); }
.note-row-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; }
.note-kind { font-size: 16px; flex-shrink: 0; }
.nr-title { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.nr-tags { display: flex; gap: 6px; flex: 1; overflow: hidden; flex-wrap: nowrap; }
.note-tag { font-size: 11.5px; font-weight: 600; padding: 3px 9px; background: var(--surface-2); color: var(--text-soft); border-radius: 999px; white-space: nowrap; }
.nr-date { color: var(--text-faint); font-size: 12.5px; white-space: nowrap; flex-shrink: 0; }
.nr-actions { display: flex; gap: 2px; flex-shrink: 0; opacity: 0; transition: opacity 0.15s; }
.note-row:hover .nr-actions { opacity: 1; }
.nr-caret { color: var(--text-faint); font-size: 12px; transition: transform 0.2s; flex-shrink: 0; }
.note-row.open .nr-caret { transform: rotate(180deg); }
.note-row-body { display: none; padding: 0 18px 16px; animation: fadeIn 0.2s ease; }
.note-row.open .note-row-body { display: block; }
/* 일반 메모: 읽기 좋은 보통 글 스타일 */
.note-body {
  font-size: 14px; line-height: 1.75; color: var(--text);
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 14px 16px; white-space: pre-wrap; word-break: break-word;
  overflow-x: auto; max-height: 360px; overflow-y: auto;
}
/* 명령어/코드: 어두운 터미널 스타일 */
.note-body.code {
  font-family: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.7; color: #e6e8ec; background: #1e2330;
}
.copy-btn {
  background: var(--accent-soft); border: none; color: var(--accent);
  font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 7px;
  cursor: pointer; transition: all 0.15s; font-family: inherit; white-space: nowrap; margin-top: 12px;
}
.copy-btn:hover { background: var(--accent); color: #fff; }
.copy-btn.copied { background: var(--green); color: #fff; }
@media (max-width: 620px) { .nr-tags { display: none; } .nr-title { max-width: 60%; } }

/* ===== 빈 상태 ===== */
.empty-state { text-align: center; color: var(--text-faint); font-size: 15px; padding: 70px 20px; }

/* ===== 모달 ===== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16, 24, 40, 0.4); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 200;
  animation: fadeIn 0.2s ease; padding: 20px;
}
.modal {
  background: var(--surface); border-radius: 20px; padding: 28px;
  width: 460px; max-width: 100%; box-shadow: var(--shadow-lg);
  animation: rise 0.3s cubic-bezier(0.16, 1, 0.3, 1); max-height: 90vh; overflow-y: auto;
}
.modal h3 { font-size: 19px; font-weight: 800; margin-bottom: 20px; }
.field { margin-bottom: 16px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-soft); margin-bottom: 7px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14.5px; outline: none; transition: border 0.2s, box-shadow 0.2s; font-family: inherit; background: var(--surface);
}
.field textarea { resize: vertical; min-height: 80px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field .hint-text { font-size: 12px; color: var(--text-faint); margin-top: 5px; }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type=range] { flex: 1; accent-color: var(--accent); }
.range-val { font-weight: 700; color: var(--accent); min-width: 44px; text-align: right; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.day-events { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.day-event-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 14px; }
.day-event-item .de-check { cursor: pointer; width: 20px; height: 20px; border: 2px solid var(--border); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; flex-shrink: 0; }
.day-event-item .de-check.checked { background: var(--green); border-color: var(--green); }
.day-event-item.done .de-title { text-decoration: line-through; color: var(--text-faint); }
.day-event-item .de-title { flex: 1; font-weight: 500; }
.day-event-item .de-time { font-size: 12.5px; color: var(--text-faint); }
.day-event-item .de-del { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 14px; }
.day-event-item .de-del:hover { color: var(--red); }

/* ===== 토스트 ===== */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 12px 22px; border-radius: 999px;
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); z-index: 300;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ===== 반응형 ===== */
@media (max-width: 920px) {
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; padding: 12px 16px; }
  .brand { padding: 0 16px 0 4px; }
  .nav { flex-direction: row; flex: 1; flex-wrap: wrap; }
  .nav-item span { display: none; }
  .nav-item { padding: 9px 12px; }
  .sidebar-footer { flex-direction: row; border: none; padding: 0; }
  .ghost-btn { font-size: 0; padding: 9px; }
  .app { flex-direction: column; }
  .content { padding: 24px 20px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-cols, .memo-row { grid-template-columns: 1fr; }
  .cal-cell { min-height: 64px; }
  .cal-event { display: none; }
}
