/* ══════════════ Left Sidebar ══════════════ */
.sb-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 24px 20px;
  border-bottom: 1px solid var(--border);
}
.sb-logo {
  width: 42px;
  height: 42px;
  border-radius: var(--r-sm);
  background: var(--pri);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(38,85,212,.3);
}
.sb-title { font-size: 16px; font-weight: 750; letter-spacing: -0.02em; }
.sb-date  { font-size: 12px; color: var(--text3); margin-top: 2px; font-weight: 500; }

.sb-card {
  margin: 16px 20px;
  padding: 18px;
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--sh);
  border: 1px solid rgba(0,0,0,.04);
}
.sb-card-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.sb-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.sb-cal-title { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.sb-cal-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  border-radius: 6px;
  transition: all .15s;
}
.sb-cal-btn:hover { background: var(--hover); color: var(--text); }

.sb-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 10px;
  font-weight: 650;
  color: var(--text4);
  margin-bottom: 6px;
}
.sb-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.sb-cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all .15s var(--ease);
  color: var(--text2);
}
.sb-cal-day:hover           { background: var(--hover); }
.sb-cal-day.today           { background: var(--pri-light); color: var(--pri); font-weight: 750; }
.sb-cal-day.selected        { background: var(--pri); color: #fff; font-weight: 700; }
.sb-cal-day.other           { color: var(--text4); opacity: .4; }
.sb-cal-day.has-event       { position: relative; }
.sb-cal-day.has-event::after {
  content: '';
  position: absolute;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--warn);
}
.sb-cal-day.selected.has-event::after { background: rgba(255,255,255,.6); }

.sb-progress {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
}
.sb-ring { width: 100%; height: 100%; }
.sb-ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.sb-ring-pct  { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.sb-prog-detail { text-align: center; margin-top: 12px; font-size: 13px; color: var(--text3); font-weight: 500; }

.sb-sched-list { max-height: 200px; overflow-y: auto; }
.sb-sched-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bg);
}
.sb-sched-item:last-child { border-bottom: none; }
.sb-sched-dot  { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); flex-shrink: 0; }
.sb-sched-time { font-size: 12px; font-weight: 600; color: var(--text3); min-width: 40px; font-variant-numeric: tabular-nums; }
.sb-sched-name {
  font-size: 13px;
  font-weight: 520;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-sched-empty { font-size: 12px; color: var(--text4); text-align: center; padding: 12px 0; }

/* ══════════════ Right Sidebar — Tabs ══════════════ */
.sbr-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0; }
.sbr-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 0;
  font-size: 13px;
  font-weight: 650;
  color: var(--text3);
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
  border-bottom: 2px solid transparent;
}
.sbr-tab.active { color: var(--pri); border-bottom-color: var(--pri); }
.sbr-tab:hover  { color: var(--text2); }
.sbr-tab svg    { flex-shrink: 0; }

.sbr-view        { display: none; flex: 1; flex-direction: column; overflow: hidden; }
.sbr-view.active { display: flex; }

/* Visual timetable task block */
.vt-task { background: rgba(99,102,241,.12); border-left: 3px solid #6366f1; color: #4338ca; }

/* ══════════════ Visual Timetable ══════════════ */
.vt-wrap     { flex: 1; overflow-y: auto; padding: 12px 0; }
.vt-timeline { position: relative; margin-left: 52px; margin-right: 12px; }
.vt-marker {
  position: absolute;
  left: -52px;
  right: 0;
  display: flex;
  align-items: flex-start;
  pointer-events: none;
}
.vt-marker-time {
  font-size: 12px;
  font-weight: 600;
  color: var(--text4);
  width: 48px;
  text-align: right;
  padding-right: 8px;
  font-variant-numeric: tabular-nums;
  transform: translateY(-6px);
}
.vt-marker-line { flex: 1; height: 1px; background: var(--border); }

.vt-blocks { position: absolute; top: 0; left: 0; right: 0; }
.vt-block {
  position: absolute;
  left: 4px;
  right: 4px;
  border-radius: 8px;
  padding: 5px 10px 4px;
  overflow: hidden;
  cursor: default;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 22px;
  transition: opacity .15s;
}
.vt-block.vt-done     { opacity: .45; }
.vt-block.vt-override { border-left-style: dashed; border-left-width: 3px; opacity: .85; }

.vt-morning  { background: rgba(255,159,10,.12); border-left: 3px solid var(--morning); color: #b45309; }
.vt-daytime  { background: rgba(0,122,255,.1);   border-left: 3px solid var(--daytime); color: #1e40af; }
.vt-evening  { background: rgba(175,82,222,.1);  border-left: 3px solid var(--evening); color: #6d28d9; }
.vt-night    { background: rgba(99,99,102,.1);   border-left: 3px solid var(--night);   color: #4b5563; }
.vt-schedule { background: rgba(255,149,0,.12);  border-left: 3px solid var(--warn);    color: #c2410c; }
.vt-weekly   { background: rgba(16,185,129,.1);  border-left: 3px solid #10b981;        color: #065f46; }

.vt-block-time  { font-size: 13px; font-weight: 600; opacity: .65; line-height: 1.2; flex-shrink: 0; }
.vt-block-title { font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; flex-shrink: 0; }
.vt-block-sub   { font-size: 12px; font-weight: 500; opacity: .6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Small blocks */
.vt-block.vt-sm .vt-block-time  { font-size: 11px; line-height: 1; }
.vt-block.vt-sm .vt-block-title { font-size: 12px; line-height: 1.2; }
.vt-block.vt-sm .vt-block-sub, .vt-block.vt-sm .vt-block-members { display: none; }

/* Extra-small blocks */
.vt-block.vt-xs { flex-direction: row; align-items: center; gap: 6px; padding: 2px 8px; }
.vt-block.vt-xs .vt-block-time  { font-size: 10px; line-height: 1; opacity: .5; }
.vt-block.vt-xs .vt-block-title { font-size: 11px; line-height: 1; }
.vt-block.vt-xs .vt-block-sub, .vt-block.vt-xs .vt-block-members, .vt-block.vt-xs .vt-grp-count { display: none; }

.vt-now { position: absolute; left: -52px; right: 0; display: flex; align-items: center; z-index: 5; pointer-events: none; }
.vt-now-dot  { width: 8px; height: 8px; border-radius: 50%; background: var(--err); margin-left: 40px; flex-shrink: 0; }
.vt-now-line { flex: 1; height: 2px; background: var(--err); }
.vt-empty    { text-align: center; padding: 40px 20px; color: var(--text4); font-size: 13px; }

/* Grouped block */
.vt-group        { min-height: 36px; }
.vt-grp-count    { font-size: 12px; font-weight: 500; opacity: .6; margin-left: 4px; }
.vt-block-members { font-size: 12px; line-height: 1.5; opacity: .8; margin-top: 2px; overflow: hidden; }
.vt-grp-check    { font-size: 12px; margin-right: 3px; }
.vt-grp-check.done     { color: var(--ok); }
.vt-grp-check.no-track { color: var(--text4); }
.vt-grp-no-track { opacity: .45; }

/* ══════════════ Week Timetable ══════════════ */
.wt-wrap { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.wt-header {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0;
}
.wt-time-spacer { width: 28px; flex-shrink: 0; }
.wt-day-hdr {
  flex: 1;
  text-align: center;
  padding: 10px 0 8px;
  font-size: 11px;
  font-weight: 650;
  color: var(--text3);
  line-height: 1.3;
}
.wt-day-hdr.wt-today { color: var(--pri); }
.wt-day-hdr.wt-sel   { color: var(--pri); }
.wt-day-num { display: block; font-size: 14px; font-weight: 750; color: var(--text); margin-top: 1px; }
.wt-day-hdr.wt-today .wt-day-num { color: var(--pri); }
.wt-body { flex: 1; overflow-y: auto; position: relative; }
.wt-grid { position: relative; min-height: 100%; }

.wt-hour { position: absolute; left: 0; right: 0; display: flex; align-items: flex-start; }
.wt-hour-lbl {
  width: 28px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text4);
  text-align: right;
  padding-right: 4px;
  font-variant-numeric: tabular-nums;
  transform: translateY(-5px);
  flex-shrink: 0;
}
.wt-hour-line { flex: 1; height: 1px; background: var(--border); }
.wt-col-line  { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); opacity: .5; }

.wt-block {
  position: absolute;
  border-radius: 5px;
  padding: 2px 4px;
  overflow: hidden;
  cursor: default;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 16px;
  margin: 0 1px;
  box-sizing: border-box;
}
.wt-block-title { font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.wt-block.wt-xs .wt-block-title { font-size: 9px; line-height: 1; }

.wt-now {
  position: absolute;
  left: 28px;
  right: 0;
  height: 2px;
  background: var(--err);
  z-index: 3;
  pointer-events: none;
}
.wt-now::before {
  content: '';
  position: absolute;
  left: -3px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--err);
}

/* ══════════════ Memo Editor ══════════════ */
.memo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--border);
}
.memo-header-actions { display: flex; gap: 4px; flex-shrink: 0; }
.memo-btn-mode {
  border: none;
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 650;
  color: var(--text3);
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.memo-btn-mode:hover { background: var(--pri-light); color: var(--pri); }

.memo-btn-del {
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text4);
  transition: all .15s;
}
.memo-btn-del:hover { background: var(--err-light); color: var(--err); }

.memo-breadcrumb {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.memo-bc-link    { font-size: 12px; font-weight: 600; color: var(--text3); cursor: pointer; white-space: nowrap; transition: color .12s; }
.memo-bc-link:hover { color: var(--pri); }
.memo-bc-sep     { font-size: 11px; color: var(--text4); margin: 0 2px; flex-shrink: 0; }
.memo-bc-current { font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.memo-title-input {
  display: block;
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  padding: 14px 16px 4px;
  font-size: 18px;
  font-weight: 750;
  font-family: 'Pretendard Variable','Pretendard',sans-serif;
  color: var(--text);
  letter-spacing: -0.02em;
}
.memo-title-input::placeholder { color: var(--text4); }

.memo-content-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  position: relative;
}
.memo-content-edit {
  display: block;
  width: 100%;
  flex: 1;
  padding: 10px 16px 20px;
  border: none;
  outline: none;
  font-family: 'Pretendard Variable','Pretendard',sans-serif;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  background: transparent;
  letter-spacing: -0.01em;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  min-height: 60px;
}
.memo-content-edit:empty { min-height: 60px; }
.memo-placeholder {
  position: absolute;
  top: 10px;
  left: 16px;
  right: 16px;
  font-size: 13px;
  line-height: 2;
  color: var(--text4);
  pointer-events: none;
  user-select: none;
}

/* WYSIWYG block styles */
.memo-content-edit h1 { font-size: 22px; font-weight: 750; margin: 4px 0; letter-spacing: -0.02em; }
.memo-content-edit h2 { font-size: 18px; font-weight: 700; margin: 3px 0; letter-spacing: -0.01em; }
.memo-content-edit h3 { font-size: 15px; font-weight: 700; margin: 2px 0; }
.memo-content-edit blockquote {
  border-left: 3px solid var(--pri);
  padding: 2px 12px;
  margin: 4px 0;
  background: var(--pri-light);
  border-radius: 0 6px 6px 0;
  color: var(--text2);
}
.memo-content-edit pre {
  background: var(--bg-warm);
  padding: 10px 14px;
  border-radius: 8px;
  margin: 4px 0;
  font-family: 'SF Mono','Fira Code',monospace;
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}
.memo-content-edit hr   { border: none; border-top: 1px solid var(--border); margin: 10px 0; }
.memo-content-edit code { background: var(--bg-warm); padding: 1px 5px; border-radius: 4px; font-size: 12px; font-family: 'SF Mono','Fira Code',monospace; }
.memo-content-edit pre code { background: none; padding: 0; }
.memo-content-edit a    { color: var(--pri); text-decoration: underline; }

.memo-li { position: relative; padding-left: 24px; margin: 1px 0; }
.memo-li::before { content: '•'; position: absolute; left: 6px; top: 0; color: var(--text3); font-weight: 700; line-height: 1.8; pointer-events: none; }
.memo-check { position: relative; padding-left: 28px; margin: 1px 0; }
.memo-cb { position: absolute; left: 4px; top: 3px; width: 18px; height: 18px; cursor: pointer; font-size: 16px; line-height: 1; user-select: none; text-align: center; }
.memo-cb:hover { opacity: .7; }
.memo-check.done { text-decoration: line-through; color: var(--text4); }

.memo-inline-page {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin: 4px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all .12s;
  user-select: none;
}
.memo-inline-page:hover { background: var(--hover); border-color: var(--text4); box-shadow: var(--sh); }
.memo-inline-page.dragging { opacity: .4; border-style: dashed; }
.memo-inline-page.dead     { border-color: var(--err-light); opacity: .6; }
.memo-inline-page.dead .mip-title { color: var(--text4); }
.mip-drag-handle { flex-shrink: 0; cursor: grab; color: var(--text4); font-size: 14px; opacity: 0; transition: opacity .15s; user-select: none; line-height: 1; }
.memo-inline-page:hover .mip-drag-handle { opacity: 1; }
.mip-del {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text4);
  cursor: pointer;
  transition: all .12s;
}
.mip-del:hover { background: var(--err-light); color: var(--err); }
.mip-icon  { font-size: 16px; flex-shrink: 0; }
.mip-title { flex: 1; font-size: 13px; font-weight: 600; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.memo-drop-indicator { height: 3px; background: var(--pri); border-radius: 2px; margin: 2px 0; transition: all .1s; }

.memo-status-wrap  { padding: 4px 16px 8px; min-height: 20px; }
.memo-editor-status { font-size: 11px; color: var(--ok); font-weight: 600; opacity: 0; transition: opacity .3s; }
.memo-editor-status.show { opacity: 1; }

/* Slash command menu */
.slash-menu {
  position: absolute;
  left: 12px;
  right: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
  z-index: 10;
  padding: 6px;
  max-height: 260px;
  overflow-y: auto;
}
.slash-menu-label { font-size: 10px; font-weight: 700; color: var(--text4); padding: 6px 10px 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.slash-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .1s;
}
.slash-item:hover, .slash-item.active { background: var(--pri-light); }
.slash-item-icon {
  font-size: 14px;
  width: 30px;
  height: 30px;
  background: var(--bg);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  color: var(--text3);
  font-family: 'SF Mono','Fira Code',monospace;
}
.slash-item-info { flex: 1; min-width: 0; }
.slash-item-name { font-size: 13px; font-weight: 650; color: var(--text); }
.slash-item-desc { font-size: 11px; color: var(--text3); font-weight: 450; }
