
/* renderer/vendor/codemirror.min.css */
.CodeMirror{font-family:monospace;height:300px;color:#000;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection,.cm-fat-cursor .CodeMirror-line>span::selection,.cm-fat-cursor .CodeMirror-line>span>span::selection{background:0 0}.cm-fat-cursor .CodeMirror-line::-moz-selection,.cm-fat-cursor .CodeMirror-line>span::-moz-selection,.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:0 0}.cm-fat-cursor{caret-color:transparent}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-type,.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:red}.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:0;position:relative;z-index:0}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none;outline:0}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}
/* renderer/styles.css */
/* Daynote 디자인 시스템 v2 — 중립 배경 · 얇은 선 · 강조색 하나 · 넉넉한 여백 (DAYNOTE_UX_V2.md §6)
   색은 모두 아래 토큰으로만 쓴다. 밝은 테마는 :root, 어두운 테마는 [data-theme="dark"] 와 시스템 설정을 따른다. */

/* ------------------------------------------------------------- 글꼴 (앱에 내장 — 인터넷 없이 동작) */
@font-face {
  font-family: 'Pretendard Variable';
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
  src: url('/renderer/vendor/fonts/PretendardVariable.woff2') format('woff2');
}

/* ------------------------------------------------------------- 토큰: 밝은 테마 */
:root {
  color-scheme: light;

  /* 바탕 · 표면 · 선 · 글자 */
  --bg-app: #F7F7F5;
  --surface: #FFFFFF;
  --surface-subtle: #F1F1EF;      /* 칩 · hover */
  --surface-hover: #EDEDEA;       /* 선택된 메뉴 · 눌림 */
  --surface-raised: #FFFFFF;      /* 떠 있는 것: 대화상자 · 메뉴 */
  --surface-active: #FFFFFF;      /* 세그먼트에서 고른 칸 */
  --border-deco: #E6E6E3;         /* 구분선 (1px) */
  --border-strong: #D6D6D2;       /* hover 때 진해지는 선 */
  --border-input: #D6D6D2;        /* 입력창 · 버튼 테두리 */
  --border-control: #8C8C8C;      /* 체크 동그라미 (3:1 이상) */
  --text-primary: #1A1A1A;
  --text-secondary: #6B6B6B;
  --text-tertiary: #8C8C8C;       /* 안내 문구 · 흐린 표시 (본문에는 쓰지 않는다) */

  /* 강조색 하나 */
  --primary: #5B5BD6;             /* 글자 · 아이콘 · 선 */
  --primary-hover: #4C4CC4;
  --primary-ink: #4646B8;         /* 옅은 강조 바탕 위의 글자 */
  --primary-soft: #EEEEFB;
  --primary-line: rgba(91, 91, 214, .35);
  --primary-fill: #5B5BD6;        /* 채운 버튼 · 내 말풍선 */
  --primary-fill-hover: #4C4CC4;
  --on-primary: #FFFFFF;
  --focus: #5B5BD6;
  --focus-ring: rgba(91, 91, 214, .22);

  /* 상태 */
  --success: #1A7F45;
  --success-soft: #E7F4EC;
  --success-ink: #14532D;
  --success-line: #BFE3C9;
  --warning: #B45309;
  --warning-soft: #FBF0E3;
  --warning-ink: #7A3A06;
  --warning-line: #EBCB9E;
  --on-warning: #FFFFFF;
  --error: #B91C1C;
  --error-soft: #FCECEC;
  --secondary: #0B6E65;           /* 진행 중 · 지금 */
  --secondary-soft: #E3F3F0;
  --accent-warm: var(--warning);
  --accent-warm-soft: var(--warning-soft);

  /* 종류 (할 일 · 일정 · 메모 · 아이디어 · 링크) — 색은 선·점, -ink 는 옅은 바탕 위 글자(4.5:1 이상) */
  --kind-task: #2F6FEB;   --kind-task-soft: #EAF1FD;   --kind-task-ink: #2259C9;
  --kind-event: #D9730D;  --kind-event-soft: #FCF0E4;  --kind-event-ink: #9C4E08;
  --kind-memo: #6B6B6B;   --kind-memo-soft: #F1F1EF;   --kind-memo-ink: #5F5F5F;
  --kind-idea: #9A6B00;   --kind-idea-soft: #F8F0DA;   --kind-idea-ink: #835B00;
  --kind-link: #0F8A7E;   --kind-link-soft: #E2F4F1;   --kind-link-ink: #0B6E65;

  /* 떠 있는 것 */
  --shadow-float: 0 12px 32px rgba(17, 17, 19, .10), 0 2px 8px rgba(17, 17, 19, .06), 0 0 0 1px rgba(17, 17, 19, .03);
  --overlay: rgba(17, 17, 19, .32);
  --inverse-bg: #1F1F22;          /* 알림 · 선택 팝업 */
  --inverse-text: #F5F5F7;
  --inverse-hover: rgba(255, 255, 255, .14);
  --inverse-active: rgba(255, 255, 255, .22);
  --toast-error-bg: #9F1F1F;
  --toast-error-text: #FFFFFF;
  --ai-checked-bg: #FAFAFF;
  --scrollbar: #D3D3CF;
  --scrollbar-hover: #B5B5B0;

  /* 캘린더 격자 */
  --grid-line: #F1F1EF;
  --grid-line-strong: #E6E6E3;
  --today-col: rgba(91, 91, 214, .03);

  /* 글꼴 · 모양 · 움직임 */
  --font: 'Pretendard Variable', 'Pretendard', -apple-system, 'Segoe UI', 'Malgun Gothic', 'Apple SD Gothic Neo', system-ui, sans-serif;
  --mono: 'JetBrains Mono', Consolas, ui-monospace, monospace;
  --r-control: 8px;
  --r-panel: 12px;
  --r-pill: 999px;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --t-fast: 160ms;
  --t-mid: 200ms;
  --sidebar-w: 224px;
  --detail-w: 340px;

  /* 가져온 편집기(editor.css)가 쓰는 이름 */
  --bg: var(--surface);
  --bg-alt: var(--surface-subtle);
  --text: var(--text-primary);
  --text-muted: var(--text-secondary);
  --text-faint: #8C8C8C;
  --border: var(--border-deco);
  --accent: var(--primary);
  --on-accent: #FFFFFF;
  --accent-soft: rgba(91, 91, 214, .10);
  --selection: rgba(91, 91, 214, .18);
  --code-text: #A3245A;
  --code-bg: rgba(17, 17, 19, .05);
  --codeblock-bg: #F4F4F2;
  --highlight-bg: #FCEBB6;
  --highlight-text: #4A3700;
  --quote-bar: #D6D6D2;
  --cal-blue: #2259C9;   --cal-blue-bg: rgba(47, 111, 235, .07);
  --cal-green: #1A7F45;  --cal-green-bg: rgba(26, 127, 69, .07);
  --cal-orange: #B45309; --cal-orange-bg: rgba(217, 115, 13, .08);
  --cal-red: #B91C1C;    --cal-red-bg: rgba(185, 28, 28, .07);
  --cal-gray: #6B6B6B;   --cal-gray-bg: rgba(107, 107, 107, .07);
  --editor-font: 16px;
}

/* ------------------------------------------------------------- 토큰: 어두운 테마 (설정에서 '어둡게') */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-app: #111113;
  --surface: #19191C;
  --surface-subtle: #222226;
  --surface-hover: #2A2A2F;
  --surface-raised: #1F1F23;
  --surface-active: #303036;
  --border-deco: #2E2E33;
  --border-strong: #3C3C42;
  --border-input: #3A3A40;
  --border-control: #75757D;
  --text-primary: #EDEDEF;
  --text-secondary: #A0A0A8;
  --text-tertiary: #75757D;
  --primary: #8B8BF5;
  --primary-hover: #A0A0F8;
  --primary-ink: #A9A9FA;
  --primary-soft: #26264A;
  --primary-line: rgba(139, 139, 245, .42);
  --primary-fill: #5B5BD6;
  --primary-fill-hover: #6464DC;
  --on-primary: #FFFFFF;
  --focus: #8B8BF5;
  --focus-ring: rgba(139, 139, 245, .30);
  --success: #4CC38A;
  --success-soft: #16291F;
  --success-ink: #7FD9AB;
  --success-line: #24503A;
  --warning: #F0A050;
  --warning-soft: #33261A;
  --warning-ink: #F3B877;
  --warning-line: #5A4026;
  --on-warning: #1A1206;
  --error: #FF7B7B;
  --error-soft: #3A1E20;
  --secondary: #4CC8B8;
  --secondary-soft: #173330;
  --kind-task: #6CA0FF;   --kind-task-soft: #1E2A40;   --kind-task-ink: #6CA0FF;
  --kind-event: #F0A050;  --kind-event-soft: #33261A;  --kind-event-ink: #F0A050;
  --kind-memo: #A0A0A8;   --kind-memo-soft: #26262A;   --kind-memo-ink: #A0A0A8;
  --kind-idea: #E8C060;   --kind-idea-soft: #332C1A;   --kind-idea-ink: #E8C060;
  --kind-link: #4CC8B8;   --kind-link-soft: #173330;   --kind-link-ink: #4CC8B8;
  --shadow-float: 0 16px 40px rgba(0, 0, 0, .50), 0 2px 8px rgba(0, 0, 0, .30), 0 0 0 1px rgba(255, 255, 255, .06);
  --overlay: rgba(0, 0, 0, .55);
  --inverse-bg: #2C2C32;
  --inverse-text: #EDEDEF;
  --inverse-hover: rgba(255, 255, 255, .10);
  --inverse-active: rgba(255, 255, 255, .18);
  --toast-error-bg: #5C1F22;
  --toast-error-text: #FFE1E1;
  --ai-checked-bg: #1D1D2A;
  --scrollbar: #3A3A40;
  --scrollbar-hover: #4C4C54;
  --grid-line: #1F1F23;
  --grid-line-strong: #2A2A2F;
  --today-col: rgba(139, 139, 245, .04);
  --text-faint: #75757D;
  --on-accent: #111113;
  --accent-soft: rgba(139, 139, 245, .16);
  --selection: rgba(139, 139, 245, .32);
  --code-text: #FF8FB6;
  --code-bg: rgba(255, 255, 255, .07);
  --codeblock-bg: #1F1F23;
  --highlight-bg: #4D3F12;
  --highlight-text: #F7E4A6;
  --quote-bar: #3C3C42;
  --cal-blue: #6CA0FF;   --cal-blue-bg: rgba(108, 160, 255, .10);
  --cal-green: #4CC38A;  --cal-green-bg: rgba(76, 195, 138, .10);
  --cal-orange: #F0A050; --cal-orange-bg: rgba(240, 160, 80, .10);
  --cal-red: #FF7B7B;    --cal-red-bg: rgba(255, 123, 123, .10);
  --cal-gray: #A0A0A8;   --cal-gray-bg: rgba(160, 160, 168, .10);
}

/* 시스템 따라가기(기본) — 위 블록과 같은 값 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg-app: #111113;
    --surface: #19191C;
    --surface-subtle: #222226;
    --surface-hover: #2A2A2F;
    --surface-raised: #1F1F23;
    --surface-active: #303036;
    --border-deco: #2E2E33;
    --border-strong: #3C3C42;
    --border-input: #3A3A40;
    --border-control: #75757D;
    --text-primary: #EDEDEF;
    --text-secondary: #A0A0A8;
    --text-tertiary: #75757D;
    --primary: #8B8BF5;
    --primary-hover: #A0A0F8;
    --primary-ink: #A9A9FA;
    --primary-soft: #26264A;
    --primary-line: rgba(139, 139, 245, .42);
    --primary-fill: #5B5BD6;
    --primary-fill-hover: #6464DC;
    --on-primary: #FFFFFF;
    --focus: #8B8BF5;
    --focus-ring: rgba(139, 139, 245, .30);
    --success: #4CC38A;
    --success-soft: #16291F;
    --success-ink: #7FD9AB;
    --success-line: #24503A;
    --warning: #F0A050;
    --warning-soft: #33261A;
    --warning-ink: #F3B877;
    --warning-line: #5A4026;
    --on-warning: #1A1206;
    --error: #FF7B7B;
    --error-soft: #3A1E20;
    --secondary: #4CC8B8;
    --secondary-soft: #173330;
    --kind-task: #6CA0FF;   --kind-task-soft: #1E2A40;   --kind-task-ink: #6CA0FF;
    --kind-event: #F0A050;  --kind-event-soft: #33261A;  --kind-event-ink: #F0A050;
    --kind-memo: #A0A0A8;   --kind-memo-soft: #26262A;   --kind-memo-ink: #A0A0A8;
    --kind-idea: #E8C060;   --kind-idea-soft: #332C1A;   --kind-idea-ink: #E8C060;
    --kind-link: #4CC8B8;   --kind-link-soft: #173330;   --kind-link-ink: #4CC8B8;
    --shadow-float: 0 16px 40px rgba(0, 0, 0, .50), 0 2px 8px rgba(0, 0, 0, .30), 0 0 0 1px rgba(255, 255, 255, .06);
    --overlay: rgba(0, 0, 0, .55);
    --inverse-bg: #2C2C32;
    --inverse-text: #EDEDEF;
    --inverse-hover: rgba(255, 255, 255, .10);
    --inverse-active: rgba(255, 255, 255, .18);
    --toast-error-bg: #5C1F22;
    --toast-error-text: #FFE1E1;
    --ai-checked-bg: #1D1D2A;
    --scrollbar: #3A3A40;
    --scrollbar-hover: #4C4C54;
    --grid-line: #1F1F23;
    --grid-line-strong: #2A2A2F;
    --today-col: rgba(139, 139, 245, .04);
    --text-faint: #75757D;
    --on-accent: #111113;
    --accent-soft: rgba(139, 139, 245, .16);
    --selection: rgba(139, 139, 245, .32);
    --code-text: #FF8FB6;
    --code-bg: rgba(255, 255, 255, .07);
    --codeblock-bg: #1F1F23;
    --highlight-bg: #4D3F12;
    --highlight-text: #F7E4A6;
    --quote-bar: #3C3C42;
    --cal-blue: #6CA0FF;   --cal-blue-bg: rgba(108, 160, 255, .10);
    --cal-green: #4CC38A;  --cal-green-bg: rgba(76, 195, 138, .10);
    --cal-orange: #F0A050; --cal-orange-bg: rgba(240, 160, 80, .10);
    --cal-red: #FF7B7B;    --cal-red-bg: rgba(255, 123, 123, .10);
    --cal-gray: #A0A0A8;   --cal-gray-bg: rgba(160, 160, 168, .10);
  }
}

/* ------------------------------------------------------------- 바탕 */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  font-variant-numeric: tabular-nums;   /* 시각 · 날짜가 세로로 맞도록 */
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; line-height: 1.3; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: var(--selection); }
::placeholder { color: var(--text-tertiary); opacity: 1; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary-fill); }
code { font-family: var(--mono); font-size: .92em; background: var(--code-bg); border-radius: 4px; padding: 1px 4px; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* 얇은 스크롤 막대 — 내용 위에 떠 보이지 않게 바탕과 같은 결로 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: var(--r-pill); border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--scrollbar-hover); }
::-webkit-scrollbar-corner { background: transparent; }

/* ------------------------------------------------------------- 셸 */
.app { display: flex; height: 100vh; min-width: 0; }

.sidebar {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  padding: 12px 8px 10px;
  border-right: 1px solid var(--border-deco);
  background: var(--bg-app);
  transition: width var(--t-mid) var(--ease), flex-basis var(--t-mid) var(--ease);
  overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 2px 4px 14px 8px; min-height: 40px; }
.app-mark { width: 100%; height: 100%; display: block; }
.brand-name { display: flex; align-items: center; color: var(--text-primary); }
.wordmark { height: 19px; width: auto; display: block; }
.login-brand .wordmark { height: 24px; }
.brand-collapse { margin-left: auto; }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-item, .nav-sub {
  display: flex; align-items: center; gap: 10px;
  height: 32px; padding: 0 10px; border: 0; border-radius: var(--r-control);
  background: transparent; color: var(--text-secondary); cursor: pointer; text-align: left;
  font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background var(--t-fast) ease-out, color var(--t-fast) ease-out;
}
.nav-item:hover, .nav-sub:hover { background: var(--surface-subtle); color: var(--text-primary); }
.nav-item[aria-current="page"], .nav-sub[aria-current="page"] { background: var(--surface-hover); color: var(--text-primary); font-weight: 600; }
.nav-item[aria-current="page"] svg, .nav-sub[aria-current="page"] svg { color: var(--primary); }
.nav-item svg, .nav-sub svg { flex: 0 0 18px; width: 18px; height: 18px; }
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-count { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.nav-item[aria-current="page"] .nav-count, .nav-sub[aria-current="page"] .nav-count { color: var(--text-primary); }
.nav-sep { height: 1px; background: var(--border-deco); margin: 10px 10px; }
.nav-section-title { font-size: 12px; color: var(--text-secondary); padding: 4px 10px; white-space: nowrap; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.save-indicator { font-size: 12px; color: var(--text-secondary); padding: 6px 10px; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.save-indicator .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); flex: 0 0 6px; }
.save-indicator.is-saving .dot { background: var(--text-tertiary); }
.save-indicator.is-error { color: var(--error); }
.save-indicator.is-error .dot { background: var(--error); }

.app.sidebar-collapsed .sidebar { flex-basis: 60px; width: 60px; }
.app.sidebar-collapsed .nav-label,
.app.sidebar-collapsed .nav-count,
.app.sidebar-collapsed .brand-name,
.app.sidebar-collapsed .nav-section-title,
.app.sidebar-collapsed .save-indicator span:not(.dot) { display: none; }
.app.sidebar-collapsed .brand { padding-left: 10px; }
.app.sidebar-collapsed .brand-collapse { margin-left: 0; }
.app.sidebar-collapsed .brand { flex-direction: column; gap: 10px; }
.app.sidebar-collapsed .nav-item, .app.sidebar-collapsed .nav-sub { padding: 0 11px; }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; position: relative; background: var(--bg-app); }
.view { flex: 1 1 auto; min-height: 0; overflow: auto; }
.view-pad { padding: 32px 40px 64px; max-width: 1080px; margin: 0 auto; }

.sample-banner {
  display: flex; align-items: center; gap: 10px; padding: 7px 16px;
  background: var(--warning-soft); color: var(--warning-ink); font-size: 13px;
  border-bottom: 1px solid var(--warning-line);
}
.sample-banner b { font-weight: 600; }
.sample-banner .btn { margin-left: auto; }

/* ------------------------------------------------------------- 공통 요소 */
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; }
.page-sub { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }
.page-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-actions .chip svg { width: 13px; height: 13px; }
.section-title { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
.panel-title { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
.muted { color: var(--text-secondary); }
.meta { font-size: 12px; color: var(--text-secondary); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: var(--r-control);
  border: 1px solid var(--border-input); background: var(--surface); color: var(--text-primary);
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background var(--t-fast) ease-out, border-color var(--t-fast) ease-out, color var(--t-fast) ease-out;
}
.btn:hover { background: var(--surface-subtle); border-color: var(--border-strong); }
.btn:active { background: var(--surface-hover); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover { background: var(--surface); border-color: var(--border-input); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary-fill); border-color: var(--primary-fill); color: var(--on-primary); }
.btn-primary:hover, .btn-primary:active { background: var(--primary-fill-hover); border-color: var(--primary-fill-hover); }
.btn-primary:disabled:hover { background: var(--primary-fill); border-color: var(--primary-fill); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-subtle); border-color: transparent; }
.btn-ghost:disabled:hover { background: transparent; border-color: transparent; }
.btn-danger { color: var(--error); }
.btn-danger:hover { background: var(--error-soft); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 12px; border-radius: 6px; gap: 4px; }
.btn-xs svg { width: 14px; height: 14px; }
.icon-btn {
  width: 30px; height: 30px; padding: 0; display: inline-grid; place-items: center;
  border: 0; border-radius: var(--r-control); background: transparent; cursor: pointer; color: var(--text-secondary);
  transition: background var(--t-fast) ease-out, color var(--t-fast) ease-out;
}
.icon-btn:hover { background: var(--surface-subtle); color: var(--text-primary); }
.icon-btn svg { width: 18px; height: 18px; }
.link-btn {
  border: 0; background: none; padding: 0; color: var(--primary); cursor: pointer; font-weight: 500;
  text-decoration: underline; text-decoration-color: var(--primary-line); text-underline-offset: 3px;
}
.link-btn:hover { color: var(--primary-hover); text-decoration-color: currentColor; }

svg.ico { width: 16px; height: 16px; flex: 0 0 auto; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.input, .select, .textarea {
  width: 100%; height: 32px; padding: 0 10px; border-radius: var(--r-control);
  border: 1px solid var(--border-input); background: var(--surface); color: var(--text-primary); font-size: 14px;
  transition: border-color var(--t-fast) ease-out, box-shadow var(--t-fast) ease-out;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.textarea { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > label, .field-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.help { font-size: 13px; color: var(--text-secondary); }

/* 칩 — 모서리 999, 글자 12px */
.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  border-radius: var(--r-pill); font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--surface-subtle); color: var(--text-secondary); border: 1px solid transparent;
}
.chip svg { width: 12px; height: 12px; stroke-width: 1.8; }
.chip-project { background: transparent; border-color: var(--border-deco); color: var(--text-primary); }
.chip-project::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--pc, var(--primary)); }
.chip-due { color: var(--text-primary); }
.chip-overdue { background: var(--error-soft); color: var(--error); }
.chip-today { background: var(--warning-soft); color: var(--warning-ink); }
.chip-sched { background: var(--primary-soft); color: var(--primary-ink); }
.chip-unsched { background: transparent; border: 1px dashed var(--border-strong); color: var(--text-secondary); }
.chip-high { background: var(--warning-soft); color: var(--warning-ink); }
.chip-progress { background: var(--secondary-soft); color: var(--secondary); }
.chip-waiting { background: var(--surface-subtle); color: var(--text-secondary); border: 1px solid var(--border-deco); }
.chip-guess { background: transparent; border: 1px dashed var(--warning); color: var(--warning-ink); }
.chip-sample { background: var(--warning-soft); color: var(--warning-ink); }
.chip-auto { background: var(--surface-subtle); }
.chip-manual { background: var(--secondary-soft); color: var(--secondary); }
.chip-missing { background: var(--error-soft); color: var(--error); }
.chip-overlap { background: var(--warning-soft); color: var(--warning-ink); }
.chip-btn { cursor: pointer; }
button.chip { font-family: inherit; }
button.chip:hover { border-color: var(--border-strong); }

/* 종류 칩 — .chip.chip-kind.kind-task 처럼 쓴다 (data-kind 도 된다) */
.kind-task, [data-kind="task"] { --kind: var(--kind-task); --kind-soft: var(--kind-task-soft); --kind-ink: var(--kind-task-ink); }
.kind-event, [data-kind="event"] { --kind: var(--kind-event); --kind-soft: var(--kind-event-soft); --kind-ink: var(--kind-event-ink); }
.kind-memo, [data-kind="memo"] { --kind: var(--kind-memo); --kind-soft: var(--kind-memo-soft); --kind-ink: var(--kind-memo-ink); }
.kind-idea, [data-kind="idea"] { --kind: var(--kind-idea); --kind-soft: var(--kind-idea-soft); --kind-ink: var(--kind-idea-ink); }
.kind-link, [data-kind="link"] { --kind: var(--kind-link); --kind-soft: var(--kind-link-soft); --kind-ink: var(--kind-link-ink); }
.chip-kind { background: var(--kind-soft, var(--surface-subtle)); color: var(--kind-ink, var(--text-secondary)); font-weight: 600; }
.kind-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--kind, var(--text-tertiary)); flex: 0 0 8px; }

.card { background: var(--surface); border: 1px solid var(--border-deco); border-radius: var(--r-panel); }
.card-pad { padding: 16px 20px; }
.panel { background: var(--surface); border: 1px solid var(--border-deco); border-radius: var(--r-panel); }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px 6px; }
.panel-head .panel-title { flex: 1; }
.panel-body { padding: 4px 8px 10px; }
.pill {
  height: 28px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--border-input); background: var(--surface);
  font-size: 13px; cursor: pointer; font-weight: 500;
}
.pill:hover { background: var(--surface-subtle); }
.pill[aria-pressed="true"] { background: var(--primary-fill); border-color: var(--primary-fill); color: var(--on-primary); }

.empty {
  padding: 32px 20px; text-align: center; color: var(--text-secondary); font-size: 14px; line-height: 1.7;
}
.empty h3 { font-size: 16px; color: var(--text-primary); margin-bottom: 4px; font-weight: 600; }
.empty .btn { margin-top: 12px; }

/* 세그먼트 — 옅은 홈 안에서 고른 칸만 떠오른다 */
.seg {
  display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--r-control);
  background: var(--surface-subtle); border: 1px solid var(--border-deco);
}
.seg button {
  border: 0; background: transparent; height: 26px; padding: 0 12px; border-radius: 6px;
  font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text-secondary);
  transition: background var(--t-fast) ease-out, color var(--t-fast) ease-out;
}
.seg button:hover { color: var(--text-primary); }
.seg button[aria-pressed="true"] { background: var(--surface-active); color: var(--text-primary); font-weight: 600; box-shadow: 0 0 0 1px var(--border-deco); }

/* ------------------------------------------------------------- 할 일 행 */
.task-list { list-style: none; margin: 0; padding: 0; }
.task-group { margin-bottom: 20px; }
.task-group-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.task-group-head .count { font-weight: 500; }
.task-row {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: var(--r-control);
  border: 1px solid transparent; cursor: pointer; position: relative;
  transition: background var(--t-fast) ease-out, border-color var(--t-fast) ease-out;
}
.task-row:hover, .task-row:focus-within { background: var(--surface-subtle); }
.task-row.is-selected { background: var(--primary-soft); border-color: var(--primary-line); }
.task-row:focus { outline: 2px solid var(--focus); outline-offset: -2px; }
.task-main { flex: 1; min-width: 0; }
.task-title { font-size: 14px; line-height: 1.5; word-break: break-word; }
.task-row.is-done .task-title { text-decoration: line-through; color: var(--text-secondary); }
.task-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.task-chips:empty { display: none; }
.task-actions { display: flex; gap: 2px; opacity: 0; transition: opacity var(--t-fast); }
.task-row:hover .task-actions, .task-row:focus-within .task-actions, .task-row.is-selected .task-actions { opacity: 1; }
.task-actions .icon-btn { width: 28px; height: 28px; }
.task-actions .icon-btn svg { width: 16px; height: 16px; }
.task-title-input { width: 100%; border: 0; background: transparent; padding: 0; font-size: 14px; outline: none; }

.check {
  appearance: none; -webkit-appearance: none; flex: 0 0 18px; width: 18px; height: 18px; margin: 1px 0 0;
  border: 1.5px solid var(--border-control); border-radius: 50%; background: transparent; cursor: pointer; position: relative;
  transition: background var(--t-mid) var(--ease), border-color var(--t-mid) var(--ease);
}
.check:hover { border-color: var(--primary); }
.check:checked { background: var(--primary-fill); border-color: var(--primary-fill); }
.check:checked::after {
  content: ''; position: absolute; left: 5px; top: 1.6px; width: 4px; height: 8px;
  border: solid var(--on-primary); border-width: 0 1.8px 1.8px 0; transform: rotate(45deg);
}

.add-row {
  display: flex; gap: 8px; align-items: center; padding: 4px 10px; border-radius: var(--r-control);
  border: 1px dashed var(--border-strong); background: transparent; color: var(--text-secondary);
  transition: border-color var(--t-fast) ease-out, box-shadow var(--t-fast) ease-out, background var(--t-fast) ease-out;
}
.add-row input { flex: 1; border: 0; background: transparent; height: 30px; outline: none; font-size: 14px; color: var(--text-primary); }
.add-row:focus-within { border-style: solid; border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring); background: var(--surface); }

/* ------------------------------------------------------------- 상세 패널 */
.detail {
  flex: 0 0 var(--detail-w); width: var(--detail-w); border-left: 1px solid var(--border-deco);
  background: var(--surface); display: flex; flex-direction: column; min-height: 0;
  animation: slideIn var(--t-mid) var(--ease);
}
.detail-head { display: flex; align-items: center; gap: 6px; padding: 12px 12px 10px 20px; border-bottom: 1px solid var(--border-deco); }
.detail-head .panel-title { flex: 1; font-size: 14px; color: var(--text-secondary); }
.detail-body { flex: 1; overflow: auto; padding: 16px 20px 32px; display: flex; flex-direction: column; gap: 16px; }
.detail-title {
  width: 100%; border: 1px solid transparent; border-radius: var(--r-control); padding: 6px 8px; margin: -6px -8px 0;
  font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.35; resize: none; background: transparent; overflow: hidden;
  transition: border-color var(--t-fast) ease-out, box-shadow var(--t-fast) ease-out;
}
.detail-title:hover { border-color: var(--border-deco); }
.detail-title:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px var(--focus-ring); background: var(--surface); }
.detail-section { display: flex; flex-direction: column; gap: 8px; }
.detail-section h4 { font-size: 13px; font-weight: 600; color: var(--text-secondary); letter-spacing: -0.01em; }
.source-item { border-left: 2px solid var(--border-strong); padding: 6px 10px; font-size: 13px; background: var(--surface-subtle); border-radius: 0 var(--r-control) var(--r-control) 0; }
.source-item .excerpt { color: var(--text-primary); line-height: 1.55; }
.step-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.step-row input[type="text"] { flex: 1; }
.step-row .est { width: 64px; }
.block-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; }
.block-row .when { flex: 1; }

/* 패널·대화상자 같은 "표면" 은 투명도를 바꾸지 않고 위치만 움직인다 — 어느 순간에 멈춰도 글자가 흐려 보이지 않는다 */
@keyframes slideIn { from { transform: translateX(12px); } to { transform: none; } }
@keyframes modalIn { from { transform: translateY(6px) scale(.985); } to { transform: none; } }
@keyframes popIn { from { transform: translateY(4px); } to { transform: none; } }
@keyframes backdropIn { from { background-color: transparent; } to { background-color: var(--overlay); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------------------------------------- 오늘 일정 행 (홈) */
.agenda-item { position: relative; display: flex; gap: 10px; padding: 6px 8px 6px 16px; border-radius: var(--r-control); font-size: 13px; align-items: baseline; }
.agenda-item::before { content: ''; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 3px; border-radius: var(--r-pill); background: var(--kind-event); }
.agenda-item.is-work::before { background: var(--kind-task); }
.agenda-item .time { width: 88px; flex: 0 0 88px; color: var(--text-secondary); font-variant-numeric: tabular-nums; font-size: 12px; }
.agenda-item .t { flex: 1; min-width: 0; }
.agenda-item.is-now { background: var(--secondary-soft); }
.agenda-item.is-work .t::before { content: '작업 · '; color: var(--kind-task-ink); font-weight: 600; font-size: 12px; }
.agenda-item.is-past { color: var(--text-secondary); }
.agenda-item.is-past::before { background: var(--border-strong); }

/* ------------------------------------------------------------- 메모 */
.notes-layout { display: flex; height: 100%; min-height: 0; }
.notes-list {
  flex: 0 0 280px; width: 280px; border-right: 1px solid var(--border-deco); display: flex; flex-direction: column; min-height: 0;
  background: var(--bg-app);
}
.notes-list-head { padding: 18px 14px 10px; display: flex; flex-direction: column; gap: 10px; }
.notes-list-head .row { display: flex; align-items: center; gap: 8px; }
.notes-list-head .row h2 { flex: 1; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 8px; width: 16px; height: 16px; color: var(--text-tertiary); pointer-events: none; }
.search input { padding-left: 32px; }
.notes-items { flex: 1; overflow: auto; padding: 0 8px 16px; }
.note-item {
  display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: var(--r-control);
  border: 1px solid transparent; background: none; cursor: pointer; margin-bottom: 2px;
  transition: background var(--t-fast) ease-out;
}
.note-item:hover { background: var(--surface-subtle); }
.note-item[aria-current="true"] { background: var(--surface); border-color: var(--border-deco); }
.note-item .t { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.01em; }
.note-item .p { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.note-item .m { display: flex; flex-wrap: wrap; white-space: nowrap; gap: 4px 6px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--text-secondary); }
.note-item mark { background: var(--highlight-bg); color: var(--highlight-text); border-radius: 2px; }

.note-editor { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.note-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 20px; border-bottom: 1px solid var(--border-deco); min-height: 52px; }
.note-toolbar .select { width: auto; height: 28px; font-size: 13px; }
.note-toolbar .status { margin-left: auto; font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.note-toolbar .status.is-error { color: var(--error); }
.editor-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; justify-content: center; cursor: text; position: relative; }
.page { position: relative; width: 100%; max-width: 760px; padding: 32px 40px 30vh; }
.note-title-input {
  width: 100%; border: 0; outline: none; background: transparent; font-size: 26px; font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.3; padding: 0; margin: 0 0 16px; color: var(--text-primary);
}
.note-title-input::placeholder { color: var(--text-tertiary); }
.note-linked { border-top: 1px solid var(--border-deco); padding: 10px 20px 12px; background: var(--bg-app); max-height: 34%; overflow: auto; }
.note-linked h4 { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; letter-spacing: -0.01em; }
.note-linked h4 svg { width: 14px; height: 14px; }
.sel-pop {
  position: absolute; z-index: 30; display: flex; gap: 2px; padding: 4px; border-radius: var(--r-control);
  background: var(--inverse-bg); box-shadow: var(--shadow-float); animation: popIn var(--t-fast) var(--ease);
}
.sel-pop button { border: 0; background: transparent; color: var(--inverse-text); height: 28px; padding: 0 10px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.sel-pop button:hover { background: var(--inverse-hover); }
.sel-pop svg { width: 14px; height: 14px; }
.CodeMirror-placeholder-hint { color: var(--text-tertiary); pointer-events: none; position: absolute; top: 0; }

/* ------------------------------------------------------------- 할 일 화면 */
.tasks-layout { display: flex; height: 100%; min-height: 0; }
.tasks-main { flex: 1; min-width: 0; overflow: auto; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .select { width: auto; }

/* ------------------------------------------------------------- 캘린더 */
.cal-layout { display: flex; height: 100%; min-height: 0; }
.cal-side { flex: 0 0 260px; width: 260px; border-right: 1px solid var(--border-deco); display: flex; flex-direction: column; min-height: 0; background: var(--bg-app); }
.cal-side-head { padding: 18px 14px 8px; }
.cal-side-head h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.cal-side-list { flex: 1; overflow: auto; padding: 0 8px 16px; }
.unsched {
  display: flex; flex-direction: column; gap: 4px; padding: 9px 10px; margin-bottom: 6px; border-radius: var(--r-control);
  background: var(--surface); border: 1px solid var(--border-deco); cursor: grab; font-size: 13px;
  transition: border-color var(--t-fast) ease-out;
}
.unsched:hover { border-color: var(--border-strong); }
.unsched:active { cursor: grabbing; }
.unsched .row { display: flex; gap: 6px; align-items: center; }
.unsched .row .t { flex: 1; font-weight: 500; font-size: 14px; }
.cal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.cal-head { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--border-deco); flex-wrap: wrap; }
.cal-head h2 { font-size: 20px; font-weight: 600; margin-right: 8px; letter-spacing: -0.02em; }
.cal-head .grow { flex: 1; }
.cal-days-head { display: grid; border-bottom: 1px solid var(--border-deco); background: var(--surface); }
.cal-day-label { padding: 8px 6px 6px; text-align: center; font-size: 12px; color: var(--text-secondary); border-left: 1px solid var(--grid-line-strong); }
.cal-day-label b {
  display: grid; place-items: center; width: 32px; height: 32px; margin: 2px auto 0; border-radius: var(--r-pill);
  font-size: 20px; color: var(--text-primary); font-weight: 600; letter-spacing: -0.02em;
}
.cal-day-label.is-today { color: var(--primary); font-weight: 600; }
.cal-day-label.is-today b { background: var(--primary-fill); color: var(--on-primary); font-size: 16px; }
.cal-day-label .due { font-size: 12px; color: var(--warning-ink); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-scroll { flex: 1; overflow: auto; position: relative; background: var(--surface); }
.cal-grid { display: grid; position: relative; }
.cal-hours { position: relative; }
.cal-hour-label { position: absolute; right: 8px; font-size: 12px; color: var(--text-secondary); transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.cal-col { position: relative; border-left: 1px solid var(--grid-line-strong); }
.cal-col.is-today { background: var(--today-col); }
.cal-slot { position: absolute; left: 0; right: 0; border-top: 1px solid var(--grid-line); }
.cal-slot.hour { border-top-color: var(--grid-line-strong); }
.cal-block {
  position: absolute; left: 3px; right: 3px; border-radius: 6px; padding: 3px 6px 3px 7px; font-size: 12px; line-height: 1.35;
  overflow: hidden; cursor: pointer; border: 0; border-left: 3px solid; z-index: 2;
}
.cal-block.work { background: var(--kind-task-soft); border-left-color: var(--kind-task); color: var(--kind-task-ink); }
.cal-block.event { background: var(--kind-event-soft); border-left-color: var(--kind-event); color: var(--kind-event-ink); }
.cal-block.is-done .bt { text-decoration: line-through; opacity: .7; }
.cal-block.is-conflict { box-shadow: 0 0 0 2px var(--warning); }
.cal-block .bt { font-weight: 600; }
.cal-block .bm { font-size: 12px; opacity: .85; }
.cal-block .conf { color: var(--warning-ink); font-weight: 600; font-size: 12px; }
.cal-block:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
.cal-ghost {
  position: absolute; left: 3px; right: 3px; border-radius: 6px; border: 2px dashed var(--primary); background: var(--accent-soft);
  z-index: 3; pointer-events: none; font-size: 12px; padding: 3px 6px; color: var(--primary-ink); font-weight: 600;
}
.cal-ghost.is-conflict { border-color: var(--warning); color: var(--warning-ink); background: var(--warning-soft); }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--error); z-index: 4; pointer-events: none; }
.cal-now::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--error); }

/* ------------------------------------------------------------- 프로젝트 */
.proj-layout { display: flex; height: 100%; min-height: 0; }
.proj-list { flex: 0 0 240px; width: 240px; border-right: 1px solid var(--border-deco); padding: 18px 8px; overflow: auto; background: var(--bg-app); }
.proj-list h2 { font-size: 20px; font-weight: 600; padding: 0 10px 12px; letter-spacing: -0.02em; }
.proj-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border-radius: var(--r-control); border: 0;
  background: none; cursor: pointer; text-align: left; font-size: 14px; color: var(--text-primary);
  transition: background var(--t-fast) ease-out;
}
.proj-item:hover { background: var(--surface-subtle); }
.proj-item[aria-current="true"] { background: var(--surface-hover); font-weight: 600; }
.proj-item .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.proj-item .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-item .meta { margin-left: auto; }
.proj-main { flex: 1; min-width: 0; overflow: auto; }
.proj-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { padding: 14px 16px; }
.stat .k { font-size: 12px; color: var(--text-secondary); }
.stat .v { font-size: 20px; font-weight: 700; margin-top: 2px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.timeline { position: relative; margin-top: 8px; }
.tl-day { font-size: 13px; font-weight: 600; color: var(--text-secondary); padding: 16px 0 6px; position: sticky; top: 0; background: var(--bg-app); z-index: 1; }
.tl-item { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--r-panel); background: var(--surface); border: 1px solid var(--border-deco); margin-bottom: 6px; }
.tl-item.is-auto { background: transparent; border-color: transparent; border-bottom-color: var(--border-deco); border-radius: 0; }
.tl-item.is-revoked .tl-title { text-decoration: line-through; color: var(--text-secondary); }
.tl-icon { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-subtle); color: var(--text-secondary); }
.tl-icon svg { width: 15px; height: 15px; }
.tl-icon.t-task_done { background: var(--success-soft); color: var(--success); }
.tl-icon.t-decision { background: var(--primary-soft); color: var(--primary); }
.tl-icon.t-blocker { background: var(--error-soft); color: var(--error); }
.tl-icon.t-achievement { background: var(--warning-soft); color: var(--warning); }
.tl-icon.t-update { background: var(--secondary-soft); color: var(--secondary); }
.tl-body { flex: 1; min-width: 0; }
.tl-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tl-title { font-weight: 600; font-size: 14px; }
.tl-text { font-size: 13px; margin-top: 4px; white-space: pre-wrap; line-height: 1.6; }
.tl-refs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.ref-link { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; color: var(--primary); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--primary-line); text-underline-offset: 3px; }
.ref-link:hover { text-decoration-color: currentColor; }
.ref-link.is-missing { color: var(--error); text-decoration: none; cursor: default; }
.ref-link svg { width: 12px; height: 12px; }
.tl-time { font-size: 12px; color: var(--text-secondary); margin-left: auto; white-space: nowrap; }
.compose { padding: 16px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.compose .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ref-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.ref-picker label { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 10px; border: 1px solid var(--border-deco); border-radius: var(--r-pill); cursor: pointer; background: var(--surface); }
.ref-picker label:hover { border-color: var(--border-strong); }
.ref-picker input { margin: 0; }

.proj-head { margin-bottom: 24px; display: flex; flex-direction: column; gap: 8px; }
.proj-title-row { display: flex; align-items: center; gap: 10px; }
.proj-color { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 12px; }
.proj-title-input {
  flex: 1; min-width: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; border: 1px solid transparent;
  border-radius: var(--r-control); background: transparent; padding: 2px 6px; margin-left: -6px; color: var(--text-primary);
  transition: border-color var(--t-fast) ease-out, box-shadow var(--t-fast) ease-out;
}
.proj-title-input:hover { border-color: var(--border-deco); }
.proj-title-input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring); background: var(--surface); }
.proj-desc { min-height: 0; }
.proj-columns { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; margin-bottom: 24px; }
.proj-section { margin-bottom: 8px; }
.proj-section-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.proj-none { font-size: 13px; padding: 6px 2px; }
.proj-more { font-size: 13px; margin-top: 6px; }
.proj-notes { list-style: none; margin: 0; padding: 0; }
.proj-note { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; border-radius: var(--r-control); background: none; cursor: pointer; text-align: left; font-size: 14px; color: var(--text-primary); }
.proj-note:hover { background: var(--surface-subtle); }
.proj-note svg { width: 15px; height: 15px; color: var(--text-secondary); flex: 0 0 15px; }
.proj-note .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose-type { width: auto; min-width: 110px; }
.compose-date { width: auto; }
.tl-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 4px; }
.tl-before { display: inline-flex; align-items: center; gap: 6px; }
.tl-list { list-style: none; margin: 0; padding: 0; }
.tl-actions { display: flex; gap: 2px; align-self: flex-start; opacity: 0; transition: opacity var(--t-fast) ease-out; }
.tl-item:hover .tl-actions, .tl-item:focus-within .tl-actions { opacity: 1; }

/* ------------------------------------------------------------- 주간 */
.weekly-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
.wk-section { margin-bottom: 20px; }
.wk-section h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.wk-section ul { list-style: none; margin: 0; padding: 0; }
.wk-section li { display: flex; gap: 8px; align-items: baseline; padding: 4px 2px; font-size: 13px; line-height: 1.5; }
.wk-section li .grow { flex: 1; min-width: 0; }
.wk-section li.wk-item { display: block; padding: 8px 2px; border-bottom: 1px solid var(--border-deco); }
.wk-section li.wk-item:last-child { border-bottom: 0; }
.wk-proj { font-size: 13px; font-weight: 600; margin: 10px 0 2px; display: flex; gap: 6px; align-items: center; }
.wk-title { display: block; width: 100%; font-size: 14px; line-height: 1.5; font-weight: 500; color: var(--text-primary); word-break: keep-all; overflow-wrap: anywhere; }
button.wk-title { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; }
.wk-link:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.wk-body { font-size: 13px; color: var(--text-secondary); margin-top: 2px; white-space: pre-wrap; }
.wk-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; font-size: 12px; color: var(--text-secondary); }
.wk-meta:empty { display: none; }
.wk-carry { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-primary); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.wk-carry:hover { background: var(--surface-subtle); }
.wk-carry input { margin: 0; }
.wk-hint { margin: 0 0 4px; }
.report-editor {
  width: 100%; min-height: 320px; font-family: var(--font); font-size: 14px; line-height: 1.7; padding: 16px 20px;
  border-radius: var(--r-control); border: 1px solid var(--border-input); resize: none; overflow: hidden; background: var(--surface); color: var(--text-primary);
}
.report-editor:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring); }
.report-state { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--text-secondary); margin: 8px 0; flex-wrap: wrap; }
.report-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 10px; }
.report-toolbar .report-state { margin: 0; }
.report-preview { border: 1px solid var(--border-deco); border-radius: var(--r-control); padding: 16px 20px; font-size: 14px; line-height: 1.7; background: var(--surface); }
.report-preview .md-h { margin: 16px 0 4px; font-weight: 700; letter-spacing: -0.02em; }
.report-preview h2.md-h { font-size: 20px; margin-top: 0; }
.report-preview h3.md-h { font-size: 16px; padding-top: 8px; border-top: 1px solid var(--border-deco); }
.report-preview h4.md-h { font-size: 14px; color: var(--text-secondary); }
.report-preview ul { margin: 2px 0 6px; padding-left: 20px; }
.report-preview p { margin: 4px 0; }
.report-preview hr { border: 0; border-top: 1px dashed var(--border-deco); margin: 16px 0; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.compare pre { white-space: pre-wrap; font-family: var(--font); font-size: 13px; line-height: 1.6; max-height: 360px; overflow: auto; margin: 0; padding: 12px; background: var(--surface-subtle); border-radius: var(--r-control); }

/* ------------------------------------------------------------- 추천함 */
.sug { padding: 16px 18px; margin-bottom: 10px; }
.sug-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sug-title { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; flex: 1; min-width: 200px; }
.sug-quote {
  margin: 10px 0 6px; padding: 8px 12px; border-left: 2px solid var(--warning); background: var(--warning-soft); color: var(--text-primary);
  border-radius: 0 var(--r-control) var(--r-control) 0; font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}
.sug-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); align-items: center; }
.sug-actions { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.sug.is-done { background: var(--surface-subtle); }
.sug-edit { display: grid; grid-template-columns: 1fr 160px 160px; gap: 8px; margin-top: 10px; }

/* ------------------------------------------------------------- 설정 */
.settings-card { padding: 20px 24px; margin-bottom: 16px; }
.settings-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.settings-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 4px 0 12px; }
.settings-row .grow { flex: 1; min-width: 200px; }
.settings-row .lbl { font-size: 14px; font-weight: 500; }
.status-line { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 8px 0; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-tertiary); flex: 0 0 8px; }
.status-dot.ok { background: var(--success); }
.status-dot.err { background: var(--error); }
.status-dot.busy { background: var(--warning); }
.provider-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.provider { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border-deco); border-radius: var(--r-control); }
.provider > svg { color: var(--text-secondary); }
.provider .grow { flex: 1; }
.check-row { display: flex; gap: 10px; align-items: center; font-size: 14px; }

/* ------------------------------------------------------------- 떠 있는 것 */
.toast-wrap { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: var(--r-panel);
  background: var(--inverse-bg); color: var(--inverse-text); font-size: 13px; box-shadow: var(--shadow-float); pointer-events: auto;
  animation: popIn var(--t-mid) var(--ease); max-width: 560px;
}
.toast button { border: 0; background: var(--inverse-hover); color: inherit; height: 28px; padding: 0 10px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 13px; transition: background var(--t-fast) ease-out; }
.toast button:hover { background: var(--inverse-active); }
.toast button, .toast span { white-space: nowrap; }
.toast > span:first-child { white-space: normal; }
.toast.is-error { background: var(--toast-error-bg); color: var(--toast-error-text); }

.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 80; display: grid; place-items: center; animation: backdropIn var(--t-fast) ease-out; padding: 16px; }
.modal {
  animation: modalIn var(--t-mid) var(--ease);
  background: var(--surface-raised); border: 1px solid var(--border-deco); border-radius: var(--r-panel); box-shadow: var(--shadow-float);
  width: min(520px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; overflow: hidden;
}
.modal-wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; padding: 16px 16px 8px 20px; }
.modal-head h2 { font-size: 16px; font-weight: 600; flex: 1; }
.modal-body { padding: 8px 20px 18px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--border-deco); align-items: center; }
.modal-foot .left { margin-right: auto; }
.conflict-box { padding: 8px 12px; border-radius: var(--r-control); background: var(--warning-soft); color: var(--warning-ink); font-size: 13px; line-height: 1.55; }
.ok-box { padding: 8px 12px; border-radius: var(--r-control); background: var(--success-soft); color: var(--success-ink); font-size: 13px; }

.menu {
  position: fixed; z-index: 90; min-width: 200px; background: var(--surface-raised); border-radius: var(--r-panel);
  box-shadow: var(--shadow-float); padding: 4px; border: 1px solid var(--border-deco); animation: popIn var(--t-fast) var(--ease);
}
.menu button { display: flex; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: var(--r-control); cursor: pointer; font-size: 13px; gap: 8px; color: var(--text-primary); }
.menu button:hover, .menu button:focus { background: var(--surface-subtle); outline: none; }
.menu .menu-label { font-size: 12px; color: var(--text-secondary); padding: 6px 10px 2px; }
.menu .sub { margin-left: auto; color: var(--text-secondary); font-size: 12px; }

/* ------------------------------------------------------------- 단축키 표기 */
kbd {
  display: inline-block; padding: 1px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px;
  background: var(--surface-subtle); font-family: var(--font); font-size: 12px; line-height: 1.5; color: var(--text-primary); white-space: nowrap;
}

/* ------------------------------------------------------------- AI 정리 검토 패널
   원본(편집기) · AI 결과(점선·보라 표시) · 확정 데이터(일반 행)를 눈으로 구분한다 */
.notes-layout .review-col { flex: 0 0 400px; width: 400px; min-height: 0; display: flex; border-left: 1px solid var(--border-deco); background: var(--bg-app); }
.review { display: flex; flex-direction: column; min-height: 0; width: 100%; }
.review-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 6px 16px; }
.review-title { flex: 1; display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 16px; letter-spacing: -0.02em; }
.review-title svg { width: 18px; height: 18px; color: var(--primary); }
.review-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 16px 10px; font-size: 12px; color: var(--text-secondary); line-height: 1.5; border-bottom: 1px solid var(--border-deco); }
.review-status.is-warn { color: var(--warning-ink); }
.review-status.is-error { color: var(--error); }
.spinner { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--primary-soft); border-top-color: var(--primary); animation: spin 0.8s linear infinite; flex: 0 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.review-body { flex: 1; overflow: auto; padding: 12px 12px 20px; display: flex; flex-direction: column; gap: 14px; }
.review-group h3 { font-size: 14px; font-weight: 600; padding: 0 2px 6px; }
.review-foot { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border-deco); background: var(--surface); }
.review-foot .meta { margin-right: auto; }
.review-done { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.review-sec-h { display: flex; align-items: baseline; gap: 6px; padding: 2px 2px 0; }
.review-sec-h h3 { font-size: 14px; font-weight: 600; }
.review-kind { font-size: 12px; color: var(--text-secondary); font-weight: 600; padding: 2px 4px 0; }
.review-empty { font-size: 13px; color: var(--text-secondary); padding: 6px 4px 4px; }
.review-dismissed-toggle { align-self: flex-start; font-size: 12px; }

.ai-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; background: var(--primary-soft); color: var(--primary-ink); white-space: nowrap; }
.ai-box { background: var(--surface); border: 1px dashed var(--primary-line); border-radius: var(--r-panel); padding: 12px 14px; }
.ai-box.is-stale { opacity: .7; }
.ai-box-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ai-box-head .meta { flex: 1; }
.ai-box-toggle { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; cursor: pointer; font-size: 13px; color: var(--text-secondary); flex: 1; text-align: left; }
.ai-summary { margin: 0 0 8px; font-size: 14px; line-height: 1.65; }
.ai-box .ai-summary { margin: 6px 0 0; }
.ai-sec { margin-top: 8px; }
.ai-sec-h { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.ai-sec ul { margin: 4px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.line-link { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.line-link:hover { color: var(--primary); text-decoration: underline; }

.ai-card { background: var(--surface); border: 1px dashed var(--primary-line); border-radius: var(--r-panel); padding: 0; margin-bottom: 0; display: flex; flex-direction: column; gap: 0; }
.ai-card.is-checked { border-style: dashed; border-color: var(--primary); background: var(--ai-checked-bg); }
.ai-card.is-open { border-style: solid; border-color: var(--primary-line); }
.ai-card.is-stale { opacity: .65; }
.ai-card-head { display: flex; align-items: center; gap: 8px; }
.ai-card-head input[type="checkbox"] { width: 16px; height: 16px; flex: 0 0 auto; }
.review-title-input { font-weight: 600; height: 32px; }
.ai-card-meta { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; }
.ai-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; cursor: pointer; border-radius: var(--r-panel); transition: background var(--t-fast) ease-out; }
.ai-row:hover { background: var(--surface-subtle); }
.ai-row:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.ai-row input[type="checkbox"] { width: 16px; height: 16px; margin-top: 3px; flex: 0 0 auto; }
.ai-row-main { flex: 1; min-width: 0; }
.ai-row-title { font-size: 14px; font-weight: 600; line-height: 1.45; word-break: keep-all; overflow-wrap: anywhere; }
.ai-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 3px; font-size: 12px; color: var(--text-secondary); }
.ai-row-meta .kind { font-weight: 600; color: var(--primary); }
.ai-row-chev { color: var(--text-secondary); font-size: 12px; padding-top: 3px; }
.ai-card-detail { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 12px 38px; }
.ai-card-top { display: flex; gap: 6px; align-items: center; }
.quote-link { border: 0; background: var(--surface-subtle); border-radius: 6px; padding: 4px 8px; text-align: left; cursor: pointer; font-size: 12px; line-height: 1.5; color: var(--text-primary); flex: 1; min-width: 0; transition: background var(--t-fast) ease-out; }
.quote-link:hover { background: var(--primary-soft); }
.review-flag { font-size: 12px; line-height: 1.5; padding: 6px 10px; border-radius: 6px; background: var(--warning-soft); color: var(--warning-ink); }
.review-flag.is-error { background: var(--error-soft); color: var(--error); }
.review-flag.is-info { background: var(--primary-soft); color: var(--primary-ink); }
.review-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.review-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.review-field > label { font-size: 12px; color: var(--text-secondary); font-weight: 500; display: flex; gap: 4px; align-items: center; }
.review-field .input, .review-field .select { height: 30px; font-size: 13px; }
.review-field.is-confirm .input, .review-field.is-confirm .select { border-color: var(--warning); border-style: dashed; }
.review-field.is-required .select, .review-field.is-required .input { border-style: solid; border-color: var(--warning); box-shadow: 0 0 0 1px var(--warning); }
.review-fields > .review-flag, .review-fields > .meta, .review-asTask { grid-column: 1 / -1; }
.review-span { grid-column: 1 / -1; }
.review-asTask { font-size: 12px; color: var(--text-secondary); }
.confirm-badge { display: inline-flex; height: 20px; align-items: center; padding: 0 7px; border-radius: var(--r-pill); background: var(--warning-soft); color: var(--warning-ink); font-size: 12px; font-weight: 600; }
.confirm-badge.is-required { background: var(--warning); color: var(--on-warning); }
.confirm-help { font-size: 12px; color: var(--warning-ink); line-height: 1.45; }
.confirm-opts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.btn-ai svg { color: var(--primary); }
.btn-primary.btn-ai svg { color: inherit; }
.cm-flash { background: var(--highlight-bg); transition: background .3s; }
.state-pill { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; white-space: nowrap; }
.state-pill.is-ready { background: var(--success-soft); color: var(--success-ink); }
.state-pill.is-note { background: var(--surface-subtle); color: var(--text-secondary); border: 1px solid var(--border-deco); }
.state-pill.is-blocked { background: var(--warning-soft); color: var(--warning-ink); border: 1px solid var(--warning-line); }
.foot-counts { display: flex; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.foot-counts .ok { color: var(--success-ink); font-weight: 600; }
.foot-counts .bad { color: var(--warning-ink); font-weight: 600; }
.foot-actions { display: flex; gap: 8px; justify-content: flex-end; }
.save-result { border: 1px solid var(--success-line); background: var(--success-soft); border-radius: var(--r-panel); padding: 10px 12px; font-size: 13px; }
.save-result-h { display: flex; gap: 6px; align-items: center; font-weight: 600; color: var(--success-ink); margin-bottom: 4px; }
.save-result ul, .review-saved { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.save-result-actions { display: flex; gap: 6px; margin-top: 8px; }
.created-link { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; padding: 5px 6px; border-radius: 6px; text-align: left; cursor: pointer; font-size: 13px; color: var(--text-primary); }
.created-link:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.review-saved .created-link:hover { background: var(--surface-subtle); }
.created-link .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }

/* ======================================================= 홈: 흐름(채팅) | 오늘(할 일 · 메모 · 일정) */
.home { display: grid; grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr); gap: 16px; height: 100%; padding: 16px 20px; min-height: 0; }
.home-chat, .home-lists { min-height: 0; min-width: 0; display: flex; flex-direction: column; }

/* 흐름 — 내 글은 강조색 말풍선, Daynote 의 정리 결과는 얇은 선의 카드 */
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-deco); border-radius: var(--r-panel); overflow: hidden; }
.chat-head { display: flex; align-items: baseline; gap: 8px; padding: 14px 16px 10px; border-bottom: 1px solid var(--border-deco); }
.chat-head .meta { margin-left: auto; }
.chat-list { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--bg-app); }
.chat-day { align-self: center; font-size: 12px; color: var(--text-secondary); background: var(--surface-subtle); border-radius: var(--r-pill); padding: 1px 10px; }
.msg { display: flex; }
.msg-user { justify-content: flex-end; }
.msg-body { max-width: 88%; padding: 10px 14px; border-radius: var(--r-panel); font-size: 14px; line-height: 1.55; }
.msg-user .msg-body { background: var(--primary-fill); color: var(--on-primary); border-bottom-right-radius: 4px; white-space: pre-wrap; word-break: break-word; }
.msg-assistant .msg-body { background: var(--surface); border: 1px solid var(--border-deco); border-bottom-left-radius: 4px; }
.msg-text { white-space: pre-wrap; word-break: break-word; }
.msg-text .spinner { display: inline-block; vertical-align: -1px; }
.msg-items { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.msg-item {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--border-deco); background: var(--surface);
  border-radius: var(--r-control); padding: 6px 8px; text-align: left; cursor: pointer; font-size: 13px; flex-wrap: wrap;
  transition: background var(--t-fast) ease-out, border-color var(--t-fast) ease-out;
}
.msg-item:hover { background: var(--surface-subtle); border-color: var(--border-strong); }
.msg-item .t { font-weight: 500; font-size: 14px; }
/* 결과 줄의 종류 칩: 할 일(파랑) · 일정(주황) */
.msg-item > .chip:first-child { background: var(--kind-task-soft); color: var(--kind-task-ink); font-weight: 600; }
.msg-item > .chip-progress:first-child { background: var(--kind-event-soft); color: var(--kind-event-ink); }
.msg-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.msg-proj { width: auto; height: 24px; font-size: 12px; padding: 0 6px; max-width: 160px; border-radius: 6px; }
.chat-tools { display: flex; gap: 6px; padding: 10px 12px 0; border-top: 1px solid var(--border-deco); background: var(--surface); flex-wrap: wrap; }
.chat-tool {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: var(--r-pill);
  border: 1px solid var(--border-input); background: var(--surface); color: var(--text-secondary); cursor: pointer; font-size: 13px; font-weight: 500;
  transition: background var(--t-fast) ease-out, color var(--t-fast) ease-out, border-color var(--t-fast) ease-out;
}
.chat-tool:hover { background: var(--surface-subtle); border-color: var(--border-strong); color: var(--text-primary); }
.chat-tool svg { width: 14px; height: 14px; color: var(--primary); }
.chat-input { padding: 8px 12px 12px; background: var(--surface); }
.chat-input textarea {
  width: 100%; border: 1px solid var(--border-input); border-radius: var(--r-panel); padding: 10px 12px; resize: none;
  font-size: 14px; line-height: 1.5; outline: none; min-height: 42px; max-height: 160px; background: var(--surface); color: var(--text-primary);
  transition: border-color var(--t-fast) ease-out, box-shadow var(--t-fast) ease-out;
}
.chat-input textarea:hover { border-color: var(--border-strong); }
.chat-input textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring); }
.chat-input-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.chat-input-foot .btn-primary { margin-left: auto; }
.chat-proj { width: auto; height: 28px; font-size: 12px; max-width: 170px; }
.bd-title { font-weight: 600; margin: 4px 0 2px; }
.bd-steps { margin: 8px 0 4px; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.bd-step { display: flex; gap: 6px; align-items: center; }
.bd-step .input { height: 30px; font-size: 13px; }
.bd-step .bd-min { width: 64px; flex: 0 0 64px; }
.bd-step .icon-btn { width: 26px; height: 26px; }
.bd-add { font-size: 13px; }
.next-title { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; margin-top: 2px; }
.next-title.is-done { text-decoration: line-through; color: var(--text-secondary); }
.next-reasons { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: var(--text-secondary); }
.el-pick { border-top: 1px solid var(--border-deco); padding-top: 10px; margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.el-pick:first-child { border-top: 0; margin-top: 4px; padding-top: 0; }
.el-pick.is-done { font-size: 13px; color: var(--text-secondary); }
.el-title { font-weight: 600; }
.el-q { font-size: 14px; }
.el-pick .textarea { font-size: 13px; }
.rest-list { margin: 6px 0 2px; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.rest-timer { display: flex; align-items: center; gap: 4px; margin-top: 8px; font-weight: 600; color: var(--secondary); font-variant-numeric: tabular-nums; }

/* 오늘 — 한 장의 패널을 1px 선으로 세 칸(할 일 · 메모 · 일정)으로 나눈다 */
.home-today { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-deco); border-radius: var(--r-panel); overflow: hidden; }
.home-today-head { display: flex; align-items: baseline; gap: 10px; padding: 14px 16px 6px; }
.home-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.home-sec { display: flex; flex-direction: column; min-height: 0; }
.home-sec-head { display: flex; align-items: center; gap: 8px; padding: 8px 16px 4px; min-height: 36px; }
.home-sec-head h2 { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.home-sec-head .btn { margin-left: auto; color: var(--text-secondary); }
.home-sec-head .btn:hover { color: var(--text-primary); }
.home-scroll { flex: 1; min-height: 0; overflow: auto; padding: 0 8px 10px; }
.home-empty { padding: 18px 12px; font-size: 13px; }
.home-list { list-style: none; margin: 0; padding: 0; }
.home-row {
  display: flex; align-items: flex-start; gap: 8px; padding: 7px 8px; border-radius: var(--r-control); cursor: pointer;
  border: 1px solid transparent; position: relative; transition: background var(--t-fast) ease-out;
}
.home-row:hover { background: var(--surface-subtle); }
.home-row:focus { outline: 2px solid var(--focus); outline-offset: -2px; }
.home-row.is-selected { background: var(--primary-soft); border-color: var(--primary-line); }
.home-row.is-done .home-row-title { text-decoration: line-through; color: var(--text-secondary); }
.home-row.is-dragging { opacity: .45; }
.home-row.drop-before { box-shadow: inset 0 2px 0 var(--primary); }
.home-row.drop-after { box-shadow: inset 0 -2px 0 var(--primary); }
.drag-handle { flex: 0 0 12px; width: 12px; color: var(--text-tertiary); cursor: grab; font-size: 12px; line-height: 20px; letter-spacing: -2px; user-select: none; opacity: 0; }
.home-row:hover .drag-handle, .home-row:focus .drag-handle { opacity: 1; }
.drag-handle.is-off { visibility: hidden; }
.home-row .check { margin-top: 1px; }
.home-main { flex: 1; min-width: 0; }
.home-row-title { font-size: 14px; line-height: 1.45; word-break: keep-all; overflow-wrap: anywhere; }
.home-memo .home-row-title { font-weight: 600; letter-spacing: -0.01em; }
.home-preview { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; align-items: center; }
/* 기본 비율 — today.js 가 prefs.homeSplit(없으면 split.DEFAULT)을 인라인 flex 로 덮어쓴다 */
.home-sec-tasks { flex: 0.45 1 0; }
.home-sec-memos { flex: 0.33 1 0; }
.home-sec-agenda { flex: 0.22 1 0; }
.home-sec-agenda .home-sec-head .btn:first-of-type { margin-left: auto; }
.home-sec-agenda .home-sec-head .btn + .btn { margin-left: 0; }

/* 세 칸 사이 분할 막대 — 평소엔 1px 선, 올리면 손잡이가 가로로 펼쳐진다 (투명도 대신 크기로) */
.home-split {
  flex: 0 0 9px; position: relative; cursor: row-resize; touch-action: none;
  background: linear-gradient(var(--border-deco), var(--border-deco)) center / 100% 1px no-repeat;
}
.home-split::before { content: ''; position: absolute; left: 0; right: 0; top: -3px; bottom: -3px; }   /* 잡기 쉬운 영역 */
.home-split::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 36px; height: 4px; margin: -2px 0 0 -18px;
  border-radius: var(--r-pill); background: var(--primary); transform: scaleX(0);
  transition: transform var(--t-fast) var(--ease);
}
.home-split:hover, .home-split.is-dragging { background-image: linear-gradient(var(--primary-line), var(--primary-line)); }
.home-split:hover::after, .home-split.is-dragging::after, .home-split:focus-visible::after { transform: none; }
.home-split:focus { outline: none; }
.home-split:focus-visible { outline: 2px solid var(--focus); outline-offset: -1px; }
.is-row-resizing, .is-row-resizing * { cursor: row-resize !important; user-select: none !important; }

/* ------------------------------------------------------------- 반응형 */
@media (max-width: 1280px) {
  .view-pad { padding: 28px 28px 60px; }
  .notes-layout.has-review .notes-list { display: none; }
}
/* 작은 창: 상세 패널은 위에 겹치는 드로어가 된다 */
@media (max-width: 1250px) {
  .home { grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr); grid-template-rows: minmax(0, 1fr); }
}
@media (max-width: 1180px) {
  .detail { position: absolute; right: 0; top: 0; bottom: 0; z-index: 40; box-shadow: var(--shadow-float); }
  .notes-list { flex-basis: 240px; width: 240px; }
  .cal-side { flex-basis: 220px; width: 220px; }
  .proj-list { flex-basis: 200px; width: 200px; }
}
@media (max-width: 1000px) {
  .weekly-grid { grid-template-columns: minmax(0, 1fr); }
  .proj-overview { grid-template-columns: 1fr 1fr; }
  .sug-edit { grid-template-columns: 1fr; }
  .notes-layout .review-col { position: absolute; right: 0; top: 0; bottom: 0; z-index: 35; box-shadow: var(--shadow-float); width: min(400px, 100%); }
}
@media (max-width: 900px) { .proj-columns { grid-template-columns: 1fr; } }
/* 세로로 쌓이는 좁은 화면: 막대를 숨기고 예전 흐름으로 (인라인 flex 를 덮는다) */
@media (max-width: 860px) {
  .home { grid-template-columns: 1fr; grid-template-rows: 60vh auto; overflow: auto; height: auto; }
  .home-split { display: none; }
  /* 아래 칸은 높이가 정해지지 않아 0 기준으로 나누면 칸이 접혀 제목이 겹친다 — 내용만큼 쌓고 화면째 스크롤 */
  .home-today { flex: none; }
  .home-sec-tasks:not(.is-only) { flex: 0 0 auto !important; }
  .home-sec-memos { flex: 0 0 auto !important; border-top: 1px solid var(--border-deco); }
  .home-sec-agenda { flex: 0 0 auto !important; border-top: 1px solid var(--border-deco); }
}

/* 모션 줄이기 — OS 설정 또는 앱 설정 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation: none !important; transition: none !important; }

/* ======================================================= 홈 v2 · 보관함 · 검색·명령 (DAYNOTE_UX_V2.md §3·§5·§8) */

/* ------------------------------------------------------------- 메뉴: 고를 수 있는 항목 · 구분선 · 종류 아이콘 */
.menu .menu-sep { height: 1px; background: var(--border-deco); margin: 4px 6px; }
.menu button { align-items: center; }
.menu button:disabled { color: var(--text-tertiary); cursor: not-allowed; }
.menu button svg { width: 16px; height: 16px; color: var(--text-secondary); }
.menu button[class*="kind-"] svg { color: var(--kind); }
.menu .menu-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu .menu-check { width: 16px; flex: 0 0 16px; display: inline-grid; place-items: center; }
.menu .menu-check svg { color: var(--primary); }
.menu button.is-checked { font-weight: 600; }
.menu .sub + .menu-check { margin-left: 0; }
.menu.cap-menu { min-width: 220px; }
.cap-proj-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; margin: 0 4px; }

/* ------------------------------------------------------------- 정리 결과 카드 */
.msg-cap .msg-body { width: 100%; max-width: 92%; padding: 0; }
.cap { display: flex; flex-direction: column; }
.cap-head { padding: 10px 14px 6px; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.5; }
.cap-head-sub { font-weight: 400; color: var(--text-secondary); font-size: 13px; }
.cap-rows { display: flex; flex-direction: column; padding: 0 6px 4px; }
.cap-row {
  display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 8px;
  border-radius: var(--r-control); transition: background var(--t-fast) ease-out;
}
.cap-row > .chip, .cap-row > .icon-btn { flex: 0 0 auto; }
.cap-row:hover, .cap-row:focus-within { background: var(--surface-subtle); }
.chip-kind svg { color: var(--kind, currentColor); }
.cap-kind { cursor: pointer; padding-right: 6px; }
.cap-kind:hover { border-color: var(--kind); }
.cap-kind .cap-caret { width: 12px; height: 12px; margin-left: -1px; }
.cap-title {
  flex: 0 1 auto; min-width: 48px; border: 0; background: none; padding: 2px 4px; text-align: left; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--text-primary); border-radius: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cap-title:hover { color: var(--primary); text-decoration: underline; text-decoration-color: var(--primary-line); text-underline-offset: 3px; }
.cap-row[data-kind="memo"] .cap-title, .cap-row[data-kind="idea"] .cap-title, .cap-row[data-kind="link"] .cap-title { font-weight: 400; }
.cap-date, .cap-proj, .cap-uncertain { cursor: pointer; }
.cap-date { background: var(--surface); border-color: var(--border-deco); color: var(--text-primary); }
.cap-date svg { color: var(--text-secondary); }
.cap-date.chip-today { background: var(--warning-soft); border-color: transparent; color: var(--warning-ink); }
.cap-date.chip-overdue { background: var(--error-soft); border-color: transparent; color: var(--error); }
.cap-date.chip-today svg, .cap-date.chip-overdue svg { color: inherit; }
.cap-date.is-none { border-style: dashed; border-color: var(--border-strong); color: var(--text-secondary); }
.cap-proj.is-empty { background: transparent; border: 1px dashed var(--border-strong); color: var(--text-secondary); opacity: 0; transition: opacity var(--t-fast) ease-out; }
.cap-row:hover .cap-proj.is-empty, .cap-row:focus-within .cap-proj.is-empty, .cap-proj.is-empty[aria-expanded="true"] { opacity: 1; }
.cap-x { width: 26px; height: 26px; margin-left: auto; opacity: 0; transition: opacity var(--t-fast) ease-out; }
.cap-x svg { width: 15px; height: 15px; }
.cap-x:hover { color: var(--error); background: var(--error-soft); }
.cap-row:hover .cap-x, .cap-row:focus-within .cap-x { opacity: 1; }
.cap-foot { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 2px 14px 10px; }
.cap-foot kbd { font-size: 11px; padding: 0 5px; margin-right: 2px; }
.cap-foot .btn svg { width: 14px; height: 14px; }
/* 할 일·일정 목록 답 — 줄을 누르면 자세히 */
.ag-list { display: flex; flex-direction: column; margin-top: 6px; }
.ag-day { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); margin: 8px 0 2px; }
.ag-day:first-child { margin-top: 0; }
.ag-row { display: flex; align-items: baseline; gap: 8px; width: 100%; text-align: left; padding: 4px 8px; margin: 0 -8px; border: 0; border-radius: 8px; background: transparent; color: var(--text-primary); font: inherit; cursor: pointer; }
.ag-row:hover { background: var(--surface-hover); }
.ag-row:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.ag-row.is-gone { color: var(--text-tertiary); cursor: default; text-decoration: line-through; }
.ag-row.is-gone:hover { background: transparent; }
.ag-row.is-done .ag-name { text-decoration: line-through; color: var(--text-secondary); }
.ag-at { font-variant-numeric: tabular-nums; color: var(--text-secondary); font-size: 12.5px; flex: none; }
.ag-name { min-width: 0; overflow-wrap: anywhere; }
.ag-tag { color: var(--text-tertiary); font-size: 12px; flex: none; margin-left: auto; }
.cap-suggest { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; width: 100%; font-size: 12.5px; color: var(--text-secondary); }

/* 정리 중 — 얇은 줄 하나 (움직임은 위치만: 깜빡임 없음) */
.cap.is-pending { padding: 10px 14px; }
.cap-skel { display: flex; align-items: center; gap: 10px; min-height: 24px; }
.cap-skel-chip { width: 54px; height: 22px; border-radius: var(--r-pill); background: var(--surface-subtle); flex: 0 0 54px; }
.cap-skel-text { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
.cap-skel-bar { flex: 1; height: 8px; border-radius: var(--r-pill); background: var(--surface-subtle); position: relative; overflow: hidden; min-width: 40px; }
.cap-skel-bar::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; border-radius: inherit;
  background: var(--border-deco); animation: capSlide 1.2s var(--ease) infinite;
}
@keyframes capSlide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* 날짜 직접 고르기 (메뉴 자리에 뜨는 작은 칸) */
.cap-pick { display: flex; flex-direction: column; gap: 8px; padding: 8px; min-width: 240px; }
.cap-pick-title { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.cap-pick-row { display: flex; gap: 6px; }
.cap-pick-row .input { height: 30px; font-size: 13px; }
.cap-pick-row .input[type="time"] { width: 110px; flex: 0 0 110px; }
.cap-pick-foot { display: flex; justify-content: flex-end; gap: 6px; }

/* ------------------------------------------------------------- 첫 화면 (흐름이 비었을 때) */
.chat-list.is-empty { justify-content: center; }
.chat-empty { margin: auto; max-width: 440px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px 8px; }
.chat-empty-mark {
  width: 44px; height: 44px; border-radius: var(--r-panel); background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; margin-bottom: 8px;
}
.chat-empty-mark svg { width: 22px; height: 22px; }
.chat-empty-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.chat-empty-sub { margin: 0; color: var(--text-secondary); font-size: 14px; line-height: 1.6; }
.chat-examples { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.chat-example {
  height: 32px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--border-input); background: var(--surface);
  color: var(--text-primary); font-size: 13px; cursor: pointer;
  transition: background var(--t-fast) ease-out, border-color var(--t-fast) ease-out, color var(--t-fast) ease-out;
}
.chat-example:hover { border-color: var(--primary-line); background: var(--primary-soft); color: var(--primary-ink); }
.chat-empty-hint { margin: 14px 0 0; font-size: 13px; color: var(--text-secondary); }
.chat-empty-hint kbd { margin: 0 2px; }
.chat-input-hint { font-size: 12px; color: var(--text-tertiary); margin-left: auto; white-space: nowrap; }
.chat-input-foot .chat-input-hint + .btn-primary { margin-left: 0; }

/* ------------------------------------------------------------- 오늘: 메모 칸의 종류 칩 · 링크 */
.home-link {
  display: inline-flex; align-items: center; gap: 4px; max-width: 200px; height: 22px; padding: 0 8px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 500; color: var(--kind-link-ink); background: transparent; border: 1px solid var(--border-deco);
  text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.home-link svg { width: 12px; height: 12px; flex: 0 0 12px; }
.home-link:hover { border-color: var(--kind-link); background: var(--kind-link-soft); }

/* ------------------------------------------------------------- 보관함 */
.arc { max-width: 920px; }
.arc-filters { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 20px; }
.arc-kinds { display: flex; gap: 6px; flex-wrap: wrap; }
.arc-kind { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.arc-kind:hover { color: var(--text-primary); }
.arc-kind[aria-pressed="true"] { background: var(--kind-soft, var(--primary-fill)); border-color: var(--kind, var(--primary-fill)); color: var(--kind-ink, var(--on-primary)); font-weight: 600; }
.arc-filter-right { display: flex; gap: 8px; align-items: center; margin-left: auto; flex: 1 1 320px; justify-content: flex-end; }
.arc-proj { width: auto; max-width: 180px; height: 32px; font-size: 13px; }
.arc-search { flex: 1 1 200px; max-width: 280px; }
.arc-day { margin-bottom: 18px; }
.arc-day-head { display: flex; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-secondary); padding: 0 10px 6px; letter-spacing: -0.01em; }
.arc-day-head .count { font-weight: 500; color: var(--text-tertiary); }
.arc-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border-deco); border-radius: var(--r-panel); overflow: hidden; }
.arc-list > li + li { border-top: 1px solid var(--border-deco); }
.arc-row {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: transparent;
  text-align: left; cursor: pointer; color: var(--text-primary); transition: background var(--t-fast) ease-out;
}
.arc-row:hover { background: var(--surface-subtle); }
.arc-row:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.arc-main { flex: 1; min-width: 0; }
.arc-text {
  font-size: 14px; line-height: 1.5; white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.arc-hits { display: flex; flex-direction: column; gap: 1px; margin-top: 4px; font-size: 13px; color: var(--text-secondary); }
.arc-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; align-items: center; }
.arc-time { font-size: 12px; color: var(--text-secondary); padding-top: 2px; white-space: nowrap; }
.arc-more { display: flex; justify-content: center; margin-top: 4px; }
.arc-empty { background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--r-panel); }
.arc mark, .pal mark { background: var(--highlight-bg); color: var(--highlight-text); border-radius: 2px; }

/* ------------------------------------------------------------- Ctrl+K 검색·명령 */
.overlay.pal-overlay { place-items: start center; padding-top: 12vh; }
.modal.pal { width: min(620px, 100%); max-height: min(560px, 76vh); }
.pal-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border-deco); }
.pal-head > svg { width: 18px; height: 18px; color: var(--text-tertiary); }
.pal-input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 16px; height: 30px; color: var(--text-primary); }
.pal-list { flex: 1; min-height: 0; overflow: auto; padding: 6px; }
.pal-group + .pal-group { margin-top: 4px; }
.pal-group-title { font-size: 12px; font-weight: 600; color: var(--text-secondary); padding: 8px 10px 4px; }
.pal-opt {
  display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 6px 10px; border-radius: var(--r-control);
  cursor: pointer; font-size: 14px; color: var(--text-primary);
}
.pal-opt.is-active { background: var(--primary-soft); }
.pal-opt.is-active .pal-label { color: var(--primary-ink); }
.pal-ico { width: 18px; flex: 0 0 18px; display: inline-grid; place-items: center; color: var(--text-secondary); }
.pal-ico svg { width: 16px; height: 16px; }
.pal-opt[class*="kind-"] .pal-ico { color: var(--kind); }
.pal-opt.is-active .pal-ico { color: var(--primary); }
.pal-opt.is-active[class*="kind-"] .pal-ico { color: var(--kind); }
.pal-dot { width: 8px; height: 8px; border-radius: 50%; }
.pal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pal-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.pal-snippet { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-sub { font-size: 12px; color: var(--text-secondary); white-space: nowrap; max-width: 46%; overflow: hidden; text-overflow: ellipsis; }
.pal-check { color: var(--primary); display: inline-grid; }
.pal-check svg { width: 16px; height: 16px; }
.pal-keys { font-size: 11px; }
.pal-empty { padding: 28px 16px; text-align: center; color: var(--text-secondary); font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.pal-foot { display: flex; gap: 14px; padding: 8px 16px; border-top: 1px solid var(--border-deco); font-size: 12px; color: var(--text-secondary); }
.pal-foot kbd { font-size: 11px; padding: 0 5px; margin-right: 2px; }

@media (max-width: 860px) {
  .arc-filter-right { margin-left: 0; justify-content: flex-start; }
  .msg-cap .msg-body { max-width: 100%; }
  /* 좁은 화면: 정리 줄의 칩이 한 줄에 안 들어가면 다음 줄로 (옆으로 밀리지 않게) */
  .cap-row { flex-wrap: wrap; }
}

/* 완료 보고 줄 ("샤워 완료" → 기존 할 일 완료) — 성공색 칩, 제목은 줄을 긋는다 */
.kind-done, [data-kind="done"] { --kind: var(--success); --kind-soft: var(--success-soft); --kind-ink: var(--success-ink); }
.cap-row.is-done .cap-title { text-decoration: line-through; text-decoration-color: var(--text-secondary); color: var(--text-secondary); }
/* 날짜 바꾸기 줄 ("견적서는 내일 보낼게" → 기존 할 일 마감 변경) */
.kind-moved, [data-kind="moved"] { --kind: var(--kind-event); --kind-soft: var(--kind-event-soft); --kind-ink: var(--kind-event-ink); }

/* 마감 지난 칩 — Alt 를 누르고 있으면 눌러서 24시간 미룰 수 있다는 표시 */
.alt-down .is-postponable, .alt-down .cap-date.chip-overdue { cursor: pointer; box-shadow: 0 0 0 1.5px var(--error); }

/* ---------------------------------------------------------------- 할 일 작업 공간 (채팅 = 작업 공간) */
.chip-paused { background: var(--warning-soft); color: var(--warning); }
.chip-progress svg, .chip-paused svg { width: 12px; height: 12px; }
/* 끌어 놓을 수 있는 곳 */
.chat-list.is-drop-target, .home-sec-tasks.is-drop-target { outline: 2px dashed var(--primary); outline-offset: -6px; background: var(--primary-soft); }
.chat-spacer { flex: none; }
/* 작업 카드 */
.msg-work .msg-body { width: 100%; max-width: 560px; }
.work { display: flex; flex-direction: column; gap: 8px; border-left: 3px solid var(--border); padding-left: 12px; cursor: grab; }
.work:active { cursor: grabbing; }
.work.is-running { border-left-color: var(--secondary); }
.work.is-paused { border-left-color: var(--warning); }
.work.is-done { border-left-color: var(--success); cursor: default; }
.work.is-done .work-title { text-decoration: line-through; color: var(--text-secondary); }
.work.is-closed { border: 0; padding: 0; cursor: default; flex-direction: row; align-items: baseline; gap: 0; }
.work-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.work-state { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.work-state svg { width: 13px; height: 13px; }
.work.is-running .work-state { color: var(--secondary); }
.work.is-paused .work-state { color: var(--warning); }
.work-time { font-weight: 500; font-variant-numeric: tabular-nums; }
.work-title { all: unset; cursor: pointer; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.4; }
.work-title:hover { text-decoration: underline; }
.work-title:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.work-steps ul { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.work-steps li label { display: flex; align-items: baseline; gap: 8px; padding: 3px 0; cursor: pointer; font-size: 14px; }
.work-steps li.is-done span:not(.meta) { text-decoration: line-through; color: var(--text-secondary); }
.work .msg-actions { align-items: center; flex-wrap: wrap; }
.work-sep { width: 1px; height: 18px; background: var(--border); margin: 0 2px; }

/* 단계 시간 — 숫자를 잡고 위아래로 끌어 맞춘다 (옆에 작게 '분') */
.bd-min-wrap { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.bd-step .bd-min-wrap .bd-min { width: 52px; flex: 0 0 52px; text-align: right; font-variant-numeric: tabular-nums; cursor: ns-resize; user-select: none; }
.bd-step .bd-min-wrap .bd-min:focus { cursor: text; user-select: text; }
.bd-step .bd-min.is-scrubbing { border-color: var(--primary); background: var(--primary-soft); }
.bd-min-unit { font-size: 12px; color: var(--text-secondary); }
html.is-scrubbing, html.is-scrubbing * { cursor: ns-resize !important; user-select: none !important; }

/* 홈 좌우 비율 — 채팅 | 오늘 패널 사이 막대를 끌어 조정 */
.home { column-gap: 0; }
.home-colbar { position: relative; width: 16px; cursor: col-resize; touch-action: none; }
.home-colbar::after { content: ''; position: absolute; top: 50%; left: 50%; width: 4px; height: 40px; margin: -20px 0 0 -2px; border-radius: 999px; background: var(--border); transition: background var(--t-fast), height var(--t-fast); }
.home-colbar:hover::after, .home-colbar.is-dragging::after, .home-colbar:focus-visible::after { background: var(--primary); height: 64px; margin-top: -32px; }
.home-colbar:focus-visible { outline: none; }
html.is-col-resizing, html.is-col-resizing * { cursor: col-resize !important; user-select: none !important; }
@media (max-width: 860px) {
  .home { grid-template-columns: 1fr !important; }
  .home-colbar { display: none; }
}

/* 세부 할 일 — 할 일을 누르면 제목 아래에 펼쳐진다 */
.task-steps { margin-top: 8px; padding: 8px 10px; border-radius: var(--r-control); background: var(--surface-subtle); display: flex; flex-direction: column; gap: 6px; cursor: default; }
.task-steps ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.task-steps li label { display: flex; align-items: baseline; gap: 8px; padding: 3px 0; cursor: pointer; font-size: 13.5px; }
.task-steps li label .meta { margin-left: auto; font-variant-numeric: tabular-nums; }
.task-steps li.is-done .task-step-title { text-decoration: line-through; color: var(--text-secondary); }
.task-steps-empty { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.task-steps .task-step-add { height: 28px; font-size: 13px; background: var(--surface); }
li[aria-expanded="true"] { background: var(--surface-subtle); }
li[aria-expanded="true"] .task-steps { background: var(--surface); }

/* 데모 AI 초안 표시 */
.bd-demo { display: flex; align-items: flex-start; gap: 6px; margin: 6px 0 2px; padding: 6px 10px; border-radius: var(--r-control); background: var(--warning-soft); color: var(--warning); font-size: 12.5px; line-height: 1.5; }
.bd-demo svg { flex: none; width: 14px; height: 14px; margin-top: 2px; }

/* ---------------------------------------------------------------- 월간 달력 (일요일 시작) */
.cal-month-main { min-height: 0; }
.cal-month { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border-deco); }
.cal-m-head { padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--text-secondary); text-align: left; border-bottom: 1px solid var(--border-deco); }
.cal-m-head.is-sun { color: var(--error); }
.cal-m-head.is-sat { color: var(--kind-task-ink); }
.cal-m-cell { position: relative; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 2px; padding: 4px 6px 6px; border-right: 1px solid var(--border-deco); border-bottom: 1px solid var(--border-deco); cursor: pointer; }
.cal-m-cell:nth-child(7n + 7) { border-right: 0; }
.cal-m-cell:hover { background: var(--surface-subtle); }
.cal-m-cell.is-out { background: var(--bg-app); }
.cal-m-cell.is-out .cal-m-date { color: var(--text-faint); }
.cal-m-cell.is-drop { background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--primary); }
.cal-m-date { all: unset; cursor: pointer; align-self: flex-start; min-width: 24px; height: 24px; padding: 0 6px; box-sizing: border-box; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-m-date:hover { background: var(--surface-subtle); }
.cal-m-date:focus-visible { outline: 2px solid var(--focus); }
.cal-m-cell.is-sun .cal-m-date { color: var(--error); }
.cal-m-cell.is-sat .cal-m-date { color: var(--kind-task-ink); }
.cal-m-cell.is-today .cal-m-date { background: var(--primary); color: #fff; }
.cal-m-items { display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.cal-m-item { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 1px 6px; border-radius: 4px; font-size: 12px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-m-item:focus-visible { outline: 2px solid var(--focus); }
.cal-m-item.event { background: var(--kind-event-soft); color: var(--kind-event-ink); }
.cal-m-item.work { background: var(--kind-task-soft); color: var(--kind-task-ink); }
.cal-m-item.work.is-done { text-decoration: line-through; opacity: .7; }
.cal-m-item.due { color: var(--text-secondary); padding-left: 4px; }
.cal-m-item.due svg { width: 11px; height: 11px; vertical-align: -1px; }
.cal-m-item.due.is-over { color: var(--error); }
.cal-m-time { font-variant-numeric: tabular-nums; opacity: .8; }
.cal-m-more { all: unset; cursor: pointer; font-size: 11.5px; color: var(--text-secondary); padding: 0 6px; }
.cal-m-more:hover { color: var(--text-primary); text-decoration: underline; }

/* 월간에서 끌어 놓을 때 뜨는 그날 24시간 시간표 */
.day-picker { position: fixed; z-index: 90; width: 260px; max-height: calc(100vh - 16px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-deco); border-radius: var(--r-panel); box-shadow: var(--shadow-float); overflow-y: auto; padding-bottom: 8px; animation: slideIn var(--t-fast) var(--ease); }
.dp-head { display: flex; align-items: baseline; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border-deco); font-size: 13px; }
.dp-head .meta { font-size: 11.5px; }
.dp-area { position: relative; margin: 0 8px 0 44px; flex: none; }
.day-picker > .dp-area { overflow: visible; }
.dp-hour { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border-deco); }
.dp-hour.is-work { background: var(--surface-subtle); }
.dp-hlabel { position: absolute; left: -40px; top: -7px; width: 34px; text-align: right; font-size: 10.5px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.dp-block { position: absolute; left: 2px; right: 2px; border-radius: 4px; padding: 0 5px; font-size: 10.5px; line-height: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; opacity: .85; pointer-events: none; }
.dp-block.event { background: var(--kind-event-soft); color: var(--kind-event-ink); }
.dp-block.work { background: var(--kind-task-soft); color: var(--kind-task-ink); }
.dp-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--error); pointer-events: none; }
.dp-ghost { position: absolute; left: 0; right: 0; border-radius: 4px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 600; padding: 1px 6px; pointer-events: none; box-shadow: 0 2px 8px rgba(0,0,0,.2); font-variant-numeric: tabular-nums; }
.dp-ghost.is-conflict { background: var(--warning); }
/* 고정 자리(왼쪽)에 뜬 시간표 + 지금 고르는 날짜 칸 */
.day-picker.is-docked { animation: none; }
.dp-date { font-size: 15px; letter-spacing: -0.01em; }
.dp-head { flex-direction: column; align-items: flex-start; gap: 2px; }
.cal-m-cell.is-picking { box-shadow: inset 0 0 0 2px var(--primary); background: var(--primary-soft); }
.cal-m-cell.is-picking .cal-m-date { background: var(--primary); color: #fff; }
/* 끄는 동안 커서 옆 알약 */
.drag-pill { position: fixed; top: -1000px; left: -1000px; display: inline-flex; align-items: center; gap: 6px; max-width: 220px; padding: 4px 10px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 600; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.drag-pill-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drag-pill-m { opacity: .8; font-weight: 500; font-variant-numeric: tabular-nums; }
/* 시간표 머리: 위에 고정, 놓을 시각을 크게 */
.day-picker .dp-head { position: sticky; top: 0; z-index: 2; background: var(--surface); }
.dp-target { font-size: 13px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.dp-target.is-set { font-size: 15px; font-weight: 700; color: var(--primary); }
.dp-target.is-conflict { color: var(--warning); }
.dp-ghost { opacity: 1; z-index: 1; border: 2px solid var(--surface); }
.dp-ghost.is-conflict { background: var(--warning); color: #fff; }
/* 시간표가 왼쪽 자리를 위아래 꽉 채운다 — 모서리 없이 그 자리에 붙어서 */
.day-picker.is-docked { max-height: none; border-radius: 0; border-top: 0; border-bottom: 0; box-shadow: 4px 0 16px rgba(0,0,0,.12); padding-bottom: 8px; }
.day-picker.is-docked .dp-area { margin-top: 8px; }
.dp-hour { border-top-color: var(--border); }
.dp-hour::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed var(--border); opacity: .6; }

/* ---------------------------------------------------------------- 연구 기반 도움들 */
/* 진행 막대 (작업 카드) · 미니 막대 (오늘 목록) */
.pbar { height: 6px; border-radius: 999px; background: var(--surface-subtle); overflow: hidden; margin: 4px 0 6px; }
.pbar-fill { height: 100%; background: var(--success); border-radius: 999px; transition: width var(--t-mid) var(--ease); }
.chip-steps { gap: 6px; }
.mini-bar { display: inline-block; width: 28px; height: 4px; border-radius: 999px; background: var(--border); overflow: hidden; vertical-align: middle; }
.mini-bar > span { display: block; height: 100%; background: var(--success); }
.chip-goal { background: var(--warning-soft); color: var(--warning); font-weight: 600; }
/* 작업 카드: 예상·현실 시간, 이어서 할 첫 행동 */
.work-est { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.work-est svg, .work-resume svg { width: 13px; height: 13px; }
.work-resume { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--r-control); background: var(--primary-soft); color: var(--primary); font-size: 13px; }
.work-resume-box { display: flex; flex-direction: column; gap: 4px; }
.work-resume-in { height: 30px; font-size: 13px; }
/* 다음 시각 고르기 칩 */
.when-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { cursor: pointer; border: 1px solid var(--border); background: var(--surface); }
.chip-btn:hover { border-color: var(--primary); color: var(--primary); }
.chip-btn.is-ghost { border-style: dashed; color: var(--text-secondary); }
.cap-row-wrap { display: flex; flex-direction: column; }
.cap-when { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 2px 8px 8px 36px; }
/* 하루 마무리 · 밀린 일 · 새 주 */
.dayclose, .overdue-card, .weekstart { display: flex; flex-direction: column; gap: 10px; }
.dc-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.dc-sub { font-size: 13px; color: var(--text-secondary); }
.dc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }
.dc-list li { display: flex; align-items: center; gap: 6px; }
.dc-list svg { width: 13px; height: 13px; color: var(--success); }
.dc-left { display: flex; flex-direction: column; gap: 8px; }
.dc-row { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: var(--r-control); background: var(--surface-subtle); }
.dc-row.is-set { opacity: .75; }
.dc-row-title { font-weight: 600; font-size: 14px; }
.dc-end { font-weight: 600; color: var(--success); }
.ws-list { display: flex; flex-direction: column; gap: 2px; }
.ws-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; font-size: 14px; }

/* 사이드바 아래: 저장 상태 + 되돌리기·다시 실행 */
.sidebar-foot-row { display: flex; align-items: center; gap: 4px; }
.sidebar-foot-row .save-indicator { flex: 1; min-width: 0; }
.hist-btns { display: flex; gap: 2px; }
.hist-btn { width: 28px; height: 28px; }
.hist-btn:disabled { opacity: .35; cursor: default; }
.sidebar-collapsed .sidebar-foot-row { flex-direction: column; }

/* ---------------------------------------------------------------- 휴식 화면 (앱 전체를 가린다) */
.rest-overlay { position: fixed; inset: 0; z-index: 300; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  background: #0E1420; color: #E6EAF2; padding: 24px; overflow: auto; animation: restIn 400ms ease-out; }
@keyframes restIn { from { opacity: 0; } to { opacity: 1; } }
html.is-resting .app { visibility: hidden; }
.rest-overlay .btn { background: rgba(255,255,255,.08); color: #E6EAF2; border-color: rgba(255,255,255,.16); }
.rest-overlay .btn:hover { background: rgba(255,255,255,.14); }
.rest-overlay .btn-primary { background: #7C8CF8; border-color: #7C8CF8; color: #0E1420; font-weight: 600; }
.rest-overlay .btn-ghost { background: transparent; border-color: transparent; color: #A9B2C6; }
.rest-title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 6px; text-align: center; }
.rest-sub { color: #A9B2C6; margin: 0 0 20px; text-align: center; }
.rest-picker, .rest-end { margin: auto; max-width: 860px; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.rest-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; width: 100%; }
@media (max-width: 900px) { .rest-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rest-card { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); min-height: 170px; }
.rest-card:hover, .rest-card:focus-visible { background: rgba(124,140,248,.16); border-color: #7C8CF8; outline: none; }
.rest-card b { font-size: 17px; }
.rest-card-icon svg { width: 22px; height: 22px; color: #7C8CF8; }
.rest-card-desc { font-size: 13.5px; color: #C9D0DE; line-height: 1.5; }
.rest-card-why { margin-top: auto; font-size: 11.5px; color: #8892A8; line-height: 1.4; }
.rest-durations, .rest-rate { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; color: #A9B2C6; font-size: 13px; }
.rest-dur, .rest-mode { all: unset; cursor: pointer; padding: 5px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); color: #C9D0DE; font-size: 13px; }
.rest-dur.is-on, .rest-mode.is-on { background: #7C8CF8; border-color: #7C8CF8; color: #0E1420; font-weight: 600; }
.rest-dur:focus-visible, .rest-mode:focus-visible { outline: 2px solid #7C8CF8; outline-offset: 2px; }
.rest-top { display: flex; flex-direction: column; align-items: center; gap: 8px; opacity: .55; transition: opacity 200ms; }
.rest-top:hover, .rest-top:focus-within { opacity: 1; }
.rest-modes { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.rest-stage { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; position: relative; }
.rest-bottom { opacity: .6; }
.rest-bottom:hover, .rest-bottom:focus-within { opacity: 1; }
.rest-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.rest-line { font-size: 20px; margin: 0; text-align: center; }
.rest-hint { color: #8892A8; margin: 0; }
.rest-small-time { color: #8892A8; font-variant-numeric: tabular-nums; }
/* 남은 시간 고리 (눈 감고 쉬기 · 산책하기) */
.rest-ring-wrap { position: relative; width: 240px; height: 240px; }
.rest-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.rest-ring circle { fill: none; stroke-width: 6; }
.ring-bg { stroke: rgba(255,255,255,.08); }
.ring-fg { stroke: #7C8CF8; stroke-linecap: round; transition: stroke-dashoffset 250ms linear; }
.rest-ring-wrap .rest-time { position: absolute; inset: 0; display: grid; place-items: center; font-size: 44px; font-weight: 300; font-variant-numeric: tabular-nums; }
/* 숨 고르고 눈 감기 — 순환 한숨: 들이쉬기 → 한 번 더 → 길게 내쉬기 */
.breath-wrap { width: 300px; height: 300px; display: grid; place-items: center; }
.breath-circle { width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #9AA7FF, #5B66D6); display: grid; place-items: center;
  transform: scale(1); transition-property: transform; transition-timing-function: ease-in-out; box-shadow: 0 0 60px rgba(124,140,248,.35); }
.breath-circle.is-in { transform: scale(1.7); }
.breath-circle.is-top { transform: scale(1.95); }
.breath-circle.is-out { transform: scale(1); }
.breath-count { color: #8892A8; font-size: 14px; font-variant-numeric: tabular-nums; }
.rest-skip { color: #8892A8; font-size: 13px; }
.breath-word { font-size: 15px; font-weight: 600; color: #0E1420; }
.is-reduced .breath-circle { transition: none !important; }
/* 몸 풀기 */
.stretch-card { max-width: 560px; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 32px; border-radius: 18px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); text-align: center; }
.stretch-pos { color: #8892A8; font-size: 13px; }
.stretch-title { font-size: 28px; margin: 0; letter-spacing: -0.02em; }
.stretch-how { font-size: 17px; line-height: 1.6; color: #C9D0DE; margin: 0; }
.stretch-count { font-size: 48px; font-weight: 300; font-variant-numeric: tabular-nums; color: #7C8CF8; }
.mode-end .rest-sub { margin-bottom: 8px; }
/* 설정 — 휴식 모드 비교 */
.rest-stats { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 8px; }
.rest-stats th, .rest-stats td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border-deco); }
.rest-stats td.num { font-variant-numeric: tabular-nums; }
.rest-score-bar { display: inline-block; width: 80px; height: 6px; border-radius: 999px; background: var(--surface-subtle); vertical-align: middle; margin-right: 6px; overflow: hidden; }
.rest-score-bar > span { display: block; height: 100%; background: var(--success); }

/* 휴식 — 쉬기 전 화면 · 생각 내려놓기 · 돌아올 때 */
html.is-resting .toast, html.is-resting .toasts { display: none !important; }   /* 쉬는 동안 알림은 보이지 않게 */
.rest-label { align-self: stretch; font-size: 12.5px; font-weight: 600; color: #8892A8; margin-top: 6px; }
.rest-park-row { align-self: stretch; display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.rest-park { flex: 1; min-width: 240px; resize: none; font: inherit; font-size: 14px; color: #E6EAF2; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: 10px; padding: 8px 10px; }
.rest-park:focus, .rest-input:focus { outline: 2px solid #7C8CF8; outline-offset: 0; }
.rest-park-saved { align-self: center; font-size: 12.5px; color: #9FD8B0; }
.rest-resume { align-self: stretch; display: flex; flex-direction: column; gap: 6px; }
.rest-resume-row { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr; gap: 10px; align-items: center; font-size: 14px; }
.rest-input { font: inherit; font-size: 14px; color: #E6EAF2; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: 8px; padding: 6px 10px; }
.rest-top-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; align-items: center; }
.rest-park-mini { width: min(560px, 90vw); }
.walk-ideas { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.walk-ideas li { padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.06); color: #C9D0DE; font-size: 13.5px; }
.rest-return { align-self: stretch; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 6px; }
.rest-return-row { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 10px; background: rgba(255,255,255,.06); }
.rest-return-row span { color: #9FB0FF; font-size: 13.5px; }
.rest-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .rest-cards { grid-template-columns: 1fr; } }

/* 집중 타이머 · 작은 축하 · 3개만 보기 */
.focus-run { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 13px; font-variant-numeric: tabular-nums; }
.focus-run svg { width: 13px; height: 13px; }
.toast.is-celebrate { border-left: 3px solid var(--success); border-radius: 0; animation: celebrate 520ms var(--ease); }
@keyframes celebrate { 0% { transform: scale(.92); } 55% { transform: scale(1.04); } 100% { transform: scale(1); } }
.reduce-motion .toast.is-celebrate { animation: none; }
.home-more { list-style: none; padding: 6px 16px; }
.home-sec-head .btn.is-on { background: var(--primary-soft); color: var(--primary); }
.rest-top, .rest-bottom { position: relative; z-index: 2; }
.rest-card.is-default { border-color: #7C8CF8; }
.rest-card-tag { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: rgba(124,140,248,.2); color: #B7C0FF; font-size: 11px; font-weight: 600; vertical-align: middle; }

/* 세부 할 일 나무 — 하위 단계는 들여 쓰고 왼쪽 선으로 묶는다 */
.step-tree { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.step-tree.is-sub { margin: 2px 0 4px 9px; padding-left: 14px; border-left: 1px solid var(--border-deco); }
.step-row { display: flex; align-items: center; gap: 6px; min-height: 28px; }
.step-row label { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; padding: 3px 0; cursor: pointer; font-size: 13.5px; }
.step-row label .meta { font-variant-numeric: tabular-nums; }
.step-row .step-sub-count { margin-left: auto; }
.step-tree li.is-done > .step-row .task-step-title { text-decoration: line-through; color: var(--text-secondary); }
.step-tools { display: inline-flex; gap: 2px; opacity: 0; transition: opacity 120ms; }
.step-row:hover .step-tools, .step-row:focus-within .step-tools { opacity: 1; }
.step-tool { all: unset; cursor: pointer; font-size: 12px; color: var(--text-secondary); padding: 2px 6px; border-radius: 6px; display: inline-flex; align-items: center; }
.step-tool:hover, .step-tool:focus-visible { background: var(--surface-hover, var(--surface-subtle)); color: var(--text); }
.step-tool svg { width: 12px; height: 12px; }
.step-sub-add { margin: 2px 0 4px 23px; width: calc(100% - 23px); }
.work-steps .step-tree { margin-top: 4px; }
/* 메모를 할 일 목록에 끌어 놓기 */
.home-sec.is-note-drop { outline: 2px dashed var(--primary); outline-offset: -4px; border-radius: 12px; }

/* 몸 풀기 — 구간별 말·남은 초 */
.stretch-focus { justify-content: center; }
.stretch-why { margin: -4px 0 0; color: #8892A8; font-size: 14px; }
.stretch-how { min-height: 3.2em; display: flex; align-items: center; justify-content: center; }
.stretch-how.is-rest { color: #8892A8; }
.stretch-phase-bar { width: 100%; max-width: 360px; height: 4px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.stretch-phase-bar > span { display: block; height: 100%; background: #7C8CF8; transition: width 300ms; }
.stretch-next { color: #8892A8; font-size: 13px; min-height: 1.2em; }
.stretch-actions { display: flex; gap: 8px; }

/* 마감·프로젝트 칩 — 눌러서 고치기, 없으면 '+ 마감' '+ 프로젝트' */
.chip.is-editable { cursor: pointer; }
.chip.is-editable:hover, .chip.is-editable:focus-visible { filter: brightness(1.15); outline: 1px solid currentColor; outline-offset: 1px; }
.chip.chip-add { cursor: pointer; background: transparent; border: 1px dashed var(--border); color: var(--text-secondary); opacity: .55; }
.home-row:hover .chip-add, .work:hover .chip-add, .chip-add:focus-visible { opacity: 1; }
.chip.chip-add:hover { color: var(--primary); border-color: var(--primary); }
.menu-due { padding: 10px; min-width: 280px; }
.due-editor { display: flex; flex-direction: column; gap: 8px; }
.due-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.due-fields { display: grid; grid-template-columns: 1fr 120px; gap: 6px; }
.due-fields .input { height: 30px; }
.due-actions { display: flex; justify-content: flex-end; gap: 6px; }
.proj-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
/* 메모 분류 — 끌면 아래에 프로젝트 폴더·휴지통 */
.note-dock { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 900; max-width: min(920px, calc(100vw - 32px));
  padding: 12px 14px 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 18px 48px rgba(0,0,0,.28);
  display: flex; flex-direction: column; gap: 8px; animation: dock-in 160ms var(--ease, ease-out); }
@keyframes dock-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.reduce-motion .note-dock { animation: none; }
.dock-hint { font-size: 12px; color: var(--text-secondary); text-align: center; }
.dock-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.dock-tile { flex: 0 0 auto; width: 88px; padding: 8px 4px 6px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 1px solid transparent; transition: background 100ms, transform 100ms; }
.dock-tile * { pointer-events: none; }
.dock-tile.is-over { background: var(--primary-soft); border-color: var(--primary); transform: translateY(-3px) scale(1.04); }
.dock-tile.is-current { opacity: .45; }
.dock-icon { width: 48px; height: 40px; display: grid; place-items: center; }
.dock-icon svg { width: 48px; height: 40px; }
.dock-name { font-size: 12px; max-width: 80px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-plus, .dock-trash { width: 40px; height: 36px; border-radius: 10px; display: grid; place-items: center; border: 1.5px dashed var(--border); color: var(--text-secondary); }
.dock-plus svg, .dock-trash svg { width: 20px; height: 20px; }
.dock-tile.is-trash .dock-trash { border-style: solid; }
.dock-tile.is-trash.is-over { background: rgba(220, 38, 38, .12); border-color: #DC2626; }
.dock-tile.is-trash.is-over .dock-trash { color: #DC2626; border-color: #DC2626; }
.dock-tile + .dock-tile.is-new { margin-left: 8px; border-left: 0; }
.note-dock.is-trash-only { padding: 8px; border-radius: 20px; animation: dock-pop 260ms cubic-bezier(.34,1.56,.64,1); }
@keyframes dock-pop { 0% { opacity: 0; transform: translate(-50%, 24px) scale(.6); } 100% { opacity: 1; transform: translate(-50%, 0) scale(1); } }
.reduce-motion .note-dock.is-trash-only { animation: none; }

.menu.menu-due .due-quick button { display: inline-flex; width: auto; padding: 4px 10px; border: 1px solid var(--border); background: var(--surface); }
.menu.menu-due .due-actions button { display: inline-flex; width: auto; }

/* 휴지통은 처음부터 빨갛게 */
.dock-tile.is-trash .dock-trash { color: #DC2626; border: 1.5px solid #DC2626; background: rgba(220, 38, 38, .1); }
.dock-tile.is-trash .dock-name { color: #DC2626; font-weight: 600; }
.dock-tile.is-trash.is-over .dock-trash { background: #DC2626; color: #fff; }
/* 메모 체크 · 보관함 팝업 */
.home-memo .check { margin-top: 3px; }
.shelf { display: flex; flex-direction: column; gap: 10px; min-height: 320px; }
.shelf-top { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.shelf-tabs { display: flex; gap: 4px; }
.shelf-tab { all: unset; cursor: pointer; padding: 5px 12px; border-radius: 999px; font-size: 13px; color: var(--text-secondary); }
.shelf-tab.is-on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.shelf-search { max-width: 220px; height: 30px; }
.shelf-list { display: flex; flex-direction: column; gap: 2px; max-height: 56vh; overflow: auto; }
.shelf-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-control); }
.shelf-row:hover { background: var(--surface-subtle); }
.shelf-main { flex: 1; min-width: 0; }
.shelf-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf-title.is-done { text-decoration: line-through; color: var(--text-secondary); }
.shelf-preview { font-size: 12.5px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf-meta { display: flex; gap: 6px; align-items: center; font-size: 12px; margin-top: 2px; }

/* 앞을 내다보기 — 보기 탭 · 2주 띠 · 날짜별 묶음 · 다가오는 마감 */
.home-today-head { flex-wrap: wrap; }
.hz-tabs { margin-left: auto; display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px; background: var(--surface-subtle); }
.hz-tab { all: unset; cursor: pointer; padding: 4px 12px; border-radius: 999px; font-size: 12.5px; color: var(--text-secondary); }
.hz-tab:hover { color: var(--text-primary); }
.hz-tab.is-on { background: var(--surface); color: var(--text-primary); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.hz-tab:focus-visible { outline: 2px solid var(--primary); }
.hz-strip { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 3px; margin: 2px 0 8px; }
.hz-day { all: unset; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 0 5px; border-radius: 8px; border: 1px solid transparent; min-width: 0; }
.hz-day:hover { background: var(--surface-subtle); }
.hz-day:focus-visible { outline: 2px solid var(--primary); }
.hz-day.is-week { border-left: 1px dashed var(--border-deco); border-radius: 0 8px 8px 0; }
.hz-day.is-shown { background: var(--primary-soft); }
.hz-day.is-today .hz-date { background: var(--primary); color: #fff; }
.hz-day.is-busy .hz-date { box-shadow: inset 0 -2px 0 var(--warning, #D97706); }
.hz-day.is-drop { background: var(--primary-soft); border-color: var(--primary); transform: translateY(-2px); }
.hz-wd { font-size: 10.5px; color: var(--text-secondary); }
.hz-date { font-size: 13px; font-weight: 600; width: 24px; height: 22px; display: grid; place-items: center; border-radius: 999px; font-variant-numeric: tabular-nums; }
.hz-dots { display: flex; gap: 2px; min-height: 14px; }
.hz-dot { font-size: 9.5px; line-height: 14px; min-width: 14px; padding: 0 3px; border-radius: 999px; text-align: center; font-variant-numeric: tabular-nums; }
.hz-dot.is-task { background: var(--surface-subtle); color: var(--text-secondary); }
.hz-dot.is-task.is-due { background: rgba(217, 119, 6, .16); color: var(--warning, #B45309); }
.hz-dot.is-event { background: var(--primary-soft); color: var(--primary); }
.hz-group { margin-bottom: 10px; }
.hz-group-head { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px; border-radius: 8px; position: sticky; top: 0; background: var(--surface); z-index: 1; border: 1px solid transparent; }
.hz-group-head.is-drop { border-color: var(--primary); background: var(--primary-soft); }
.hz-event { display: flex; gap: 8px; align-items: baseline; padding: 3px 12px 3px 26px; font-size: 13px; }
.hz-event .time { color: var(--text-secondary); font-variant-numeric: tabular-nums; font-size: 12px; }
.hz-empty { padding: 4px 26px 8px; font-size: 12.5px; }
.hz-upcoming { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 6px 12px; margin: 0 0 4px; border-radius: 10px; background: var(--surface-subtle); font-size: 12.5px; }
.hz-up-label { font-weight: 600; color: var(--text-secondary); }
.hz-up { display: inline-flex; align-items: center; gap: 2px; }
.hz-up.is-prep .meta { color: var(--warning, #B45309); font-weight: 600; }
.hz-up-more { margin-left: auto; font-size: 12px; }
.chip.chip-plan { background: var(--primary-soft); color: var(--primary); }

/* 결과 카드: 어디로 갔는지 · 날짜 안 정한 할 일 */
.chip.cap-where { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); font-size: 11.5px; }
.chip.cap-where:hover { color: var(--primary); border-color: var(--primary); }
.hz-undated { margin: 0 0 4px; padding: 6px 12px; border-radius: 10px; border: 1px dashed var(--border); font-size: 12.5px; }
.hz-undated-head { display: flex; align-items: center; gap: 10px; }
.hz-undated-head .link-btn { margin-left: auto; }
.hz-undated .home-list { margin-top: 4px; }

/* 날짜 창: 마감 | 할 날 */
.due-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 2px; border-radius: 8px; background: var(--surface-subtle); }
.menu.menu-due .due-mode-btn { all: unset; cursor: pointer; text-align: center; padding: 5px 6px; border-radius: 6px; font-size: 12.5px; color: var(--text-secondary); }
.menu.menu-due .due-mode-btn.is-on { background: var(--surface); color: var(--text-primary); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.due-fields.is-plan { grid-template-columns: 1fr; }
.menu.menu-due .due-swap { all: unset; cursor: pointer; font-size: 12px; color: var(--primary); }
/* 달력: 할 날 */
.cal-m-item.plan { color: var(--primary); background: var(--primary-soft); }
.cal-day-label .due.is-plan { color: var(--primary); }

/* 홈 공간 (UX 점검 H-01·02·05): 머리 도구 한 묶음 · 한 줄 요약 · 2주 띠 접기 */
.home-sec-head .home-sec-tools { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; }
.home-sec-head .home-sec-tools .btn { margin-left: 0; }
.hz-strip-toggle { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 4px 8px; border-radius: 999px; font-size: 12px; color: var(--text-secondary); border: 1px solid var(--border); }
.hz-strip-toggle svg { width: 12px; height: 12px; }
.hz-strip-toggle.is-on { color: var(--primary); border-color: var(--primary-soft); background: var(--primary-soft); }
.hz-strip-toggle:focus-visible { outline: 2px solid var(--primary); }
.hz-alerts { margin: 0 12px 4px; }
.hz-alerts-row { display: flex; gap: 6px; flex-wrap: wrap; }
.hz-alert { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; background: var(--surface-subtle); color: var(--text-secondary); }
.hz-alert b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.hz-alert svg { width: 12px; height: 12px; }
.hz-alert:hover, .hz-alert.is-on { background: var(--primary-soft); color: var(--primary); }
.hz-alert.is-warn { background: rgba(217, 119, 6, .14); color: var(--warning, #B45309); }
.hz-alert:focus-visible { outline: 2px solid var(--primary); }
.hz-alerts .hz-upcoming, .hz-alerts .hz-undated { margin: 6px 0 2px; }

.step-row label .meta { white-space: nowrap; }
.detail-section h4 svg { width: 13px; height: 13px; vertical-align: -2px; }

.dc-bulk { margin: 6px 0 4px; }
.dc-more { padding: 4px 2px; }

/* 프로젝트 쓴 시간 */
.proj-overview { flex-wrap: wrap; }
.proj-time-actions { display: flex; justify-content: flex-end; margin: 8px 0 4px; }

/* 집중 타이머 — 사이드바 알약 */
.focus-pill { display: flex; align-items: center; gap: 2px; margin: 0 4px 6px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.focus-pill[hidden] { display: none; }
.focus-pill-main { all: unset; cursor: pointer; flex: 1; display: flex; align-items: center; gap: 6px; padding: 7px 10px; font-size: 13px; font-variant-numeric: tabular-nums; min-width: 0; }
.focus-pill-main svg { width: 14px; height: 14px; flex: none; }
.focus-pill-stop { all: unset; cursor: pointer; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; }
.focus-pill-stop:hover, .focus-pill-main:hover { background: rgba(124,140,248,.18); }
.focus-pill-stop svg { width: 13px; height: 13px; }
.focus-pill button:focus-visible { outline: 2px solid var(--primary); }
.sidebar-collapsed .focus-pill-label { display: none; }
.sidebar-collapsed .focus-pill { flex-direction: column; }

/* 외부(회사) 캘린더 일정 — 읽기 전용: 빗금 · 끌 수 없음 */
.cal-block.is-ext { cursor: pointer; background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(127,127,127,.08) 6px 12px); border-left-style: dashed; }
.cal-m-item.is-ext { background-image: repeating-linear-gradient(135deg, transparent 0 5px, rgba(127,127,127,.08) 5px 10px); }
.cal-m-item.is-allday svg { width: 11px; height: 11px; vertical-align: -1px; }
.cal-day-label .due.is-ext { color: var(--kind-event-ink); }
.agenda-item.is-ext::before { background: repeating-linear-gradient(180deg, var(--kind-event) 0 4px, transparent 4px 7px); }
.agenda-allday { display: flex; gap: 6px; align-items: center; padding: 4px 8px 6px 16px; font-size: 12px; color: var(--kind-event-ink); }
.agenda-allday svg { width: 12px; height: 12px; flex: none; }
.agenda-allday span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ext-info { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; font-size: 14px; }
.ext-info-row { display: flex; gap: 8px; align-items: center; }
.ext-info-row svg { width: 15px; height: 15px; color: var(--text-secondary); flex: none; }
.cal-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.cal-help { margin-top: 10px; font-size: 13px; }
.cal-help summary { cursor: pointer; color: var(--primary); }
.cal-help ul { margin: 8px 0 6px 18px; display: flex; flex-direction: column; gap: 4px; color: var(--text-secondary); }
.cal-sub-err { color: var(--error); }

/* 로그인 화면 */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg-app); }
.login-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--border-deco); border-radius: 16px; padding: 32px 32px 24px; box-shadow: 0 8px 32px rgba(0,0,0,.06); }
.login-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; margin-bottom: 22px; }
.login-title { font-size: 21px; font-weight: 700; margin: 0 0 8px; }
.login-sub { color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0 0 22px; }
.login-google { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; height: 44px; border-radius: 10px; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; font-family: Roboto, 'Segoe UI', 'Malgun Gothic', sans-serif; font-size: 15px; font-weight: 500; cursor: pointer; }
.login-google:hover { background: #f8f9fa; border-color: #c6c9cc; }
.login-google:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.login-google[disabled] { opacity: .55; cursor: default; }
.login-row { display: flex; align-items: center; gap: 8px; min-height: 30px; margin-top: 10px; }
.login-msg { flex: 1; margin: 0; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.login-msg.is-err { color: var(--error); }
.login-msg.is-ok { color: var(--success); }
.login-setup:empty { display: none; }
.login-setup { margin-top: 8px; padding: 12px 14px; border-radius: 10px; background: var(--surface-subtle); font-size: 13px; line-height: 1.6; }
.login-setup ol { margin: 6px 0 0 18px; padding: 0; }
.login-setup code { font-size: 12px; }
.login-fine { margin: 18px 0 0; font-size: 12px; color: var(--text-tertiary); line-height: 1.5; }
.acc-avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 13px; flex: none; }

/* 주간 정리 — 제목과 내용 구분: 섹션 제목(아이콘 배지·굵게·개수) / 내용(들여 쓴 칸, 보통 굵기) */
.wk-section { margin: 0; padding: 18px 0 14px; border-top: 1px solid var(--border-deco); }
.wk-sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.wk-sec-icon { width: 26px; height: 26px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.wk-sec-icon svg { width: 15px; height: 15px; }
.wk-section h3 { font-size: 15px; font-weight: 700; margin: 0; letter-spacing: -0.01em; display: block; }
.wk-sec-count { font-size: 12px; font-weight: 600; color: var(--primary); background: var(--primary-soft); border-radius: 999px; padding: 1px 8px; }
.wk-sec-body { padding-left: 34px; }
.wk-sec-body > .help, .wk-sec-body > div > .help:first-child, .wk-sec-body .wk-hint { font-size: 12px; color: var(--text-tertiary); }
.wk-section li.wk-item { padding: 9px 12px; border: 0; border-radius: 10px; background: var(--surface-subtle); margin-bottom: 6px; }
.wk-section li.wk-item:last-child { margin-bottom: 0; }
.wk-section .wk-title { font-size: 14px; font-weight: 400; }
.wk-section .wk-proj { margin: 4px 0 6px; }
.wk-section .report-state { margin-top: 10px; }

/* 메모를 끄는 동안 — 날짜 칸도 놓을 수 있는 곳으로 보이게 (놓으면 그날 할 일) */
.is-note-dragging .hz-day { outline: 1px dashed color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: -2px; }
.hz-day.is-note-drop, .hz-group-head.is-note-drop { outline: 2px solid var(--primary); outline-offset: -2px; background: var(--primary-soft); }

/* 메모 팝업 — 메모 화면과 같은 편집기를 대화상자 안에 */
.np-modal { width: min(820px, 100%); height: min(720px, calc(100vh - 40px)); }
.np-modal .modal-body { flex: 1; min-height: 0; padding-top: 0; gap: 8px; }
.np-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12px; color: var(--text-tertiary); }
.np-status { margin-left: auto; }
.np-scroll { flex: 1; min-height: 0; overflow-y: auto; cursor: text; border-top: 1px solid var(--border-deco); }
.np-page { padding: 14px 6px 40px; }
.np-title { font-size: 20px; margin-bottom: 6px; }
.np-modal .modal-foot .left { display: flex; gap: 4px; }

/* [오늘] 아래 '내일' 묶음 */
.hz-tomorrow { margin-top: 14px; }
.hz-tomorrow-head { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.home-empty.is-compact { padding: 14px 8px; }

/* 날 묶음 전체가 놓는 곳 — 할 일을 다른 날로 끌어 옮기기 */
.hz-group.is-drop, .hz-today-zone.is-drop { outline: 2px dashed var(--primary); outline-offset: -2px; background: color-mix(in srgb, var(--primary-soft) 60%, transparent); border-radius: 10px; }
.hz-today-zone { min-height: 40px; border-radius: 10px; }

/* 월간 시간표 — 놓은 뒤 조정 (위아래로 끌어 15분 단위) */
.dp-placed { position: absolute; left: 0; right: 0; z-index: 3; border-radius: 6px; padding: 2px 8px; display: flex; gap: 8px; align-items: flex-start; overflow: hidden;
  background: var(--primary); color: #fff; font-size: 12px; font-weight: 600; cursor: grab; touch-action: none; user-select: none; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.dp-placed.is-dragging { cursor: grabbing; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.dp-placed.is-conflict { background: var(--warning); color: #1b1b1b; }
.dp-placed:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.dp-placed-time { flex: none; font-variant-numeric: tabular-nums; }
.dp-placed-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.day-picker.is-adjusting .dp-area { cursor: pointer; }
.dp-adjust-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; margin-top: 4px; }

/* 보관함 — 폴더 창 */
.shelf-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.shelf-folder { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px 10px; border-radius: 12px; border: 1px solid transparent; text-align: center; }
.shelf-folder:hover { background: var(--surface-subtle); border-color: var(--border-deco); }
.shelf-folder:focus-visible { outline: 2px solid var(--primary); }
.shelf-folder-icon { width: 56px; height: 46px; display: grid; place-items: center; }
.shelf-folder-icon svg { width: 56px; height: 46px; }
.shelf-folder-name { font-size: 13px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf-folder-count { font-size: 12px; }
.shelf-done-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--success-soft); color: var(--success); }
.shelf-done-icon svg { width: 22px; height: 22px; }
.shelf-back svg { width: 14px; height: 14px; }

/* 메뉴 찾기 칸 · 더 보기 */
.menu .menu-search { width: calc(100% - 8px); margin: 4px 4px 6px; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-primary); font-size: 13px; outline: none; box-sizing: border-box; }
.menu .menu-search:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.menu .menu-empty { font-size: 12px; color: var(--text-tertiary); padding: 6px 10px; }
.menu .menu-empty[hidden], .menu button[hidden], .menu .menu-sep[hidden], .menu .menu-label[hidden] { display: none; }
.menu button.menu-more { color: var(--primary); font-size: 12px; }
.menu button.menu-more svg { color: var(--primary); }

/* 항목이 많으면 메뉴 안에서 스크롤 */
.menu[role=menu] { max-height: min(70vh, 520px); overflow-y: auto; }

.np-status.is-dirty { color: var(--warning-ink, var(--warning)); }

.md-tree pre { margin: 6px 0 4px; padding: 10px 12px; border-radius: 8px; background: var(--surface-subtle); font-size: 12px; line-height: 1.6; color: var(--text-secondary); overflow-x: auto; }

/* 끌어 놓을 자리 — 줄 사이 한가운데 선 하나 */
.hz-today-zone, .hz-group, .home-scroll ul.home-list { position: relative; }
.drop-line { position: absolute; left: 6px; right: 6px; height: 2px; border-radius: 2px; background: var(--primary); pointer-events: none; z-index: 6; box-shadow: 0 0 0 1px var(--surface); }
.drop-line::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }

/* 세부 할 일 끌기 · 할 일 안으로 넣기 */
.step-tree li[draggable="true"] > .step-row { cursor: grab; }
.step-tree li.is-dragging { opacity: .45; }
.home-row.is-nest-target { outline: 2px solid var(--primary); outline-offset: -2px; background: var(--primary-soft); border-radius: 10px; position: relative; }
.home-row.is-nest-target::after { content: '세부 할 일로 넣기'; position: absolute; right: 10px; top: 8px; font-size: 11px; font-weight: 600; color: var(--primary); background: var(--surface); border: 1px solid var(--primary); border-radius: 999px; padding: 1px 8px; pointer-events: none; }

/* Ctrl 끌기 — 나눠서 놓기 */
.drop-line.is-split { background: var(--success, #2f9e5b); }
.drop-line.is-split::before { background: var(--success, #2f9e5b); }
.drop-line.is-split::after { content: '나눠서 놓기 (1/2 · 2/2)'; position: absolute; right: 0; top: -10px; font-size: 11px; font-weight: 600; color: #fff; background: var(--success, #2f9e5b); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }

/* 보관함 — 아래쪽 폴더 줄 */
.shelf-dock { bottom: 24px; }
.shelf-dock-head { display: flex; align-items: center; gap: 8px; }
.shelf-dock-head .dock-hint { flex: 1; }
.shelf-dock-x svg { width: 14px; height: 14px; }
.shelf-dock-tile { appearance: none; background: none; font: inherit; color: inherit; cursor: pointer; text-align: center; }   /* 크기·여백은 .dock-tile 그대로 (끌 때 뜨는 폴더 줄과 같게) */
.shelf-dock-tile.dock-tile * { pointer-events: none; }
.shelf-dock-tile:hover, .shelf-dock-tile:focus-visible { background: var(--primary-soft); border-color: var(--primary); }
.shelf-dock-tile.is-trash:hover, .shelf-dock-tile.is-trash:focus-visible { background: rgba(220, 38, 38, .12); border-color: #DC2626; }
.shelf-dock-count { font-size: 11px; color: var(--text-tertiary); }
.dock-tile .shelf-done-icon { width: 40px; height: 36px; }

/* 보관함 폴더 줄 — 끌 때 뜨는 폴더 줄과 같은 높이: 개수는 아이콘 귀퉁이 배지, 닫기는 모서리 */
.shelf-dock .shelf-dock-head { position: relative; display: block; }
.shelf-dock .shelf-dock-x { position: absolute; right: -8px; top: -8px; width: 24px; height: 24px; }
.shelf-dock .shelf-dock-tile { position: relative; }
.shelf-dock .shelf-dock-count { position: absolute; top: 4px; right: 12px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px;
  background: var(--surface-raised, var(--surface)); border: 1px solid var(--border-deco); font-size: 11px; line-height: 16px; color: var(--text-secondary); }

/* 월간 시간표 — 좌우 두 칸(오전 · 오후) */
.dp-cols-head { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 8px 0; padding-left: 36px; font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.dp-cols-head span + span { padding-left: 36px; }
.dp-area.is-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 8px 0; }
.day-picker.is-docked .dp-area.is-split { margin-top: 6px; }
.dp-col { position: relative; margin-left: 36px; }
.dp-col .dp-hlabel { left: -38px; width: 32px; }
.dp-col .dp-block { font-size: 10.5px; }
/* 놓은 블록 길이 바꾸기 손잡이 (아래 끝) */
.dp-resize { position: absolute; left: 0; right: 0; bottom: -3px; height: 9px; cursor: ns-resize; }
.dp-resize::after { content: ''; position: absolute; left: 50%; bottom: 3px; width: 22px; height: 3px; margin-left: -11px; border-radius: 2px; background: rgba(255,255,255,.75); }

/* 주간·일간 블록 — 위·아래 끝을 끌어 길이 바꾸기 */
.cal-block .cal-resize { position: absolute; left: 0; right: 0; height: 7px; cursor: ns-resize; z-index: 2; }
.cal-block .cal-resize.is-top { top: -2px; }
.cal-block .cal-resize.is-bottom { bottom: -2px; }
.cal-block:hover .cal-resize.is-bottom::after { content: ''; position: absolute; left: 50%; bottom: 2px; width: 20px; height: 3px; margin-left: -10px; border-radius: 2px; background: currentColor; opacity: .5; }
.cal-resize-tip { position: absolute; right: 4px; bottom: 4px; z-index: 3; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--primary); color: #fff; font-variant-numeric: tabular-nums; pointer-events: none; }

/* 준비할 일 — 그 일을 하기 전에 틈틈이 해 둘 세부 할 일 (남는 시간에 먼저 추천) */
.chip-prep { background: var(--success-soft); color: var(--success-ink); font-weight: 600; }
.step-row .step-prep { height: 18px; padding: 0 6px; font-size: 11px; align-self: center; flex: none; }
.step-tool.step-prep-tool.is-on { color: var(--success); font-weight: 600; }
.task-step-addrow { display: flex; gap: 6px; align-items: center; }
.task-step-addrow .task-step-add { flex: 1; min-width: 0; }
.step-prep-toggle { all: unset; cursor: pointer; flex: none; height: 26px; padding: 0 10px; border-radius: 8px; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); border: 1px dashed var(--border); display: inline-flex; align-items: center; }
.step-prep-toggle:hover, .step-prep-toggle:focus-visible { color: var(--text); border-color: var(--text-secondary); }
.step-prep-toggle.is-on { color: var(--success); background: var(--success-soft); border: 1px solid transparent; }
.next-intro { margin-bottom: 6px; }
.next-for { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 4px; font-size: 13px; }
.next-for .link-btn { font-size: 13px; }

/* 쓴 토큰 (설정에서 켰을 때) */
.token-line { margin-top: 6px; font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.token-box { margin-top: 12px; }
.token-box .help { margin: 4px 0 0 28px; }
.cap .token-line { margin: 0; padding: 0 14px 10px; }

/* AI 와 주고받은 내용 (설정에서 켰을 때) */
.ai-x-list { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.ai-x-item > summary { cursor: pointer; font-size: 13px; color: var(--text-secondary); padding: 4px 0; }
.ai-x-item > .ai-x > .ai-x-meta { display: none; }
.ai-x { display: flex; flex-direction: column; gap: 6px; }
.ai-x-meta { font-size: 12px; }
.ai-x-part { border: 1px solid var(--border-deco); border-radius: var(--r-control); padding: 6px 10px; background: var(--surface); }
.ai-x-part > summary { cursor: pointer; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.ai-x-copy { margin-left: auto; font-size: 12px; }
.ai-x-pre { margin: 6px 0 2px; max-height: 360px; overflow: auto; white-space: pre-wrap; word-break: break-word; font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--text-primary); background: var(--surface-subtle); border-radius: 6px; padding: 8px 10px; }
.cap-x { padding: 0 14px 10px; }
.cap-x-link { font-size: 12px; }
.token-line .prompt-btn { font-size: 12px; }

/* 문서 화면 — 보관함(날짜별)·프로젝트 (views/docs.js) */
.doc-toolbar { gap: 6px; }
.doc-toolbar .grow { flex: 1; }
.doc-when { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.doc-date { width: auto; height: 28px; font-size: 13px; padding: 0 8px; }
.doc-hint { font-size: 12px; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.doc-page { padding-top: 24px; }
.doc-day .t { font-weight: 500; }
.doc-tail { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; vertical-align: 1px; }
.doc-chip, .doc-open {
  border: 0; border-radius: 999px; padding: 0 8px; height: 20px; display: inline-flex; align-items: center; gap: 4px;
  font: inherit; font-size: 12px; font-weight: 500; line-height: 20px; cursor: pointer;
  background: var(--surface-subtle); color: var(--text-secondary);
}
.doc-chip:hover, .doc-open:hover { color: var(--text-primary); background: var(--surface-hover); }
.doc-chip.is-today { background: var(--warning-soft); color: var(--warning-ink); }
.doc-chip.is-over { background: var(--error-soft); color: var(--error); }
.doc-open .ico, .doc-open svg { width: 13px; height: 13px; }

/* 문서 화면 — 위 폴더 줄 (두 줄까지, 넘치면 그 안에서 스크롤) */
.doc-shell { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.doc-folders {
  flex: 0 0 auto; position: relative; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px;
  padding: 10px 14px; max-height: 86px; overflow-y: auto; overscroll-behavior: contain;
  border-bottom: 1px solid var(--border-deco); background: var(--bg-app);
}
.doc-folder {
  height: 30px; max-width: 220px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px;
  border: 1px solid var(--border-deco); border-radius: 999px; background: var(--surface); color: var(--text-secondary);
  font: inherit; font-size: 13px; white-space: nowrap; cursor: pointer;
}
.doc-folder:hover { color: var(--text-primary); border-color: var(--border-strong); }
.doc-folder[aria-current="true"] { background: var(--primary-soft); color: var(--primary-ink); border-color: transparent; font-weight: 600; }
.doc-folder .n { overflow: hidden; text-overflow: ellipsis; }
.doc-folder .c { font-size: 11px; color: var(--text-tertiary); font-weight: 500; }
.doc-folder[aria-current="true"] .c { color: inherit; opacity: .7; }
.doc-folder .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.doc-folder.is-add { border-style: dashed; }
.doc-folder.is-add svg { width: 13px; height: 13px; }
.doc-folders-empty { font-size: 13px; color: var(--text-secondary); align-self: center; }
.doc-col { flex: 1 1 auto; min-height: 0; }
.doc-search-wrap { width: 170px; }
.doc-search-wrap .input { height: 28px; font-size: 13px; }
.doc-date { gap: 4px; }

/* 날짜 고르기 달력 — 끝낸 할 일 3·5·10·15개부터 파랗게 */
.doc-cal-pop { padding: 10px; }
.doc-cal { width: 252px; min-width: 252px; --done: #2563eb; }
.doc-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.doc-cal-title { flex: 1; text-align: center; white-space: nowrap; font-weight: 600; font-size: 14px; }
.doc-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.doc-cal-wd { font-size: 11px; color: var(--text-tertiary); text-align: center; padding: 2px 0; }
.doc-cal-wd.is-sun { color: var(--error); }
.doc-cal-wd.is-sat { color: var(--primary); }
.doc-cal-day {
  height: 32px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text-primary);
  font: inherit; font-size: 13px; cursor: pointer;
}
.doc-cal-day:hover { border-color: var(--border-strong); }
.doc-cal-day.is-today { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.doc-cal-day.is-cur { border-color: var(--primary); }
.doc-cal .lv1 { background: color-mix(in srgb, var(--done) 20%, transparent); }
.doc-cal .lv2 { background: color-mix(in srgb, var(--done) 30%, transparent); }
.doc-cal .lv3 { background: color-mix(in srgb, var(--done) 52%, transparent); }
.doc-cal .lv4 { background: color-mix(in srgb, var(--done) 78%, transparent); color: #fff; }
.doc-cal-legend { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 11px; color: var(--text-secondary); flex-wrap: wrap; }
.doc-cal-key { display: inline-flex; align-items: center; gap: 3px; }
.doc-cal-key i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* 다른 날을 볼 때 — 할 일·일정 한 칸이 아래까지 */
.home-sec.is-only { flex: 1 1 auto !important; }

/* 채팅 팁 */
.tip { display: flex; flex-direction: column; gap: 4px; }
.tip-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--warning-ink); }
.tip-head svg { width: 15px; height: 15px; }
.tip-title { font-weight: 600; font-size: 14px; }
.tip-body { font-size: 13.5px; color: var(--text-secondary); line-height: 1.55; }
.tip-try { font-size: 13px; color: var(--text-primary); background: var(--surface-subtle); border-radius: 8px; padding: 6px 10px; margin-top: 2px; }
.msg-tip .msg-body { border-color: color-mix(in srgb, var(--warning) 35%, var(--border-deco)); }
.tip .msg-actions { margin-top: 6px; }
.tip-x { margin-left: auto; width: 24px; height: 24px; color: var(--text-tertiary); }
.tip-x svg { width: 14px; height: 14px; }
.tip-x:hover { color: var(--text-primary); }

/* 휴대폰: 메뉴·작은 창은 화면 아래 판으로 (ui.popover) */
.menu.is-sheet {
  left: 8px !important; right: 8px; top: auto !important; width: auto; min-width: 0; max-height: min(60vh, 460px); overflow-y: auto;
  padding: 6px; border-radius: 16px; box-shadow: 0 -6px 30px rgba(0,0,0,.25); animation: sheetUp var(--t-fast) var(--ease);
}
.menu.is-sheet button { padding: 11px 12px; font-size: 15px; }
.menu.is-sheet .menu-search { font-size: 16px; }
@keyframes sheetUp { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* renderer/editor.css */
/* MD_Reflo(live-preview-app) 의 라이브 프리뷰 편집기 스타일을 가져와 Daynote 토큰에 맞춘 것 */
/* 노트 안의 이미지 */
.md-image { display: inline-block; max-width: 100%; vertical-align: top; }
.md-image img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
}
.md-image.is-missing {
  padding: 3px 9px;
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
  color: var(--text-faint);
  font-size: 13px;
}

/* 표 — 커서가 블록 밖에 있을 때 원문 대신 이 모양으로 보인다 */
.md-table-wrap {
  display: block;
  margin: 6px 0 10px;
  overflow-x: auto;
  max-width: 100%;
}
.md-table {
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.55;
  min-width: 40%;
}
.md-table th,
.md-table td {
  padding: 6px 12px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  cursor: text;
}
.md-table thead th {
  background: var(--bg-alt);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.md-table tbody tr:hover td { background: var(--accent-soft); }
.md-table code {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 3px;
  padding: 0 4px;
  font-size: 0.92em;
}
.md-table .md-link { color: var(--accent); }

/* ---- editor base ---- */
.CodeMirror {
  height: auto;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: var(--editor-font, 16px);
  line-height: 1.7;
}
.CodeMirror-lines { padding: 0; }
.CodeMirror pre.CodeMirror-line,
.CodeMirror pre.CodeMirror-line-like { padding: 0; }
.CodeMirror-cursor { border-left: 2px solid var(--accent); }
.CodeMirror-selected,
.CodeMirror-focused .CodeMirror-selected { background: var(--selection) !important; }
/* 기본 테마의 밝은 선택색을 덮는다 — 어두운 테마에서도 글자가 보이게 */
.CodeMirror-line::selection,
.CodeMirror-line > span::selection,
.CodeMirror-line > span > span::selection { background: var(--selection); }
.CodeMirror .cm-searching { background: var(--highlight-bg); color: var(--highlight-text); }
.CodeMirror-gutters { display: none; }

/* ---- block level ---- */
.CodeMirror pre.md-h1, .CodeMirror pre.md-h2, .CodeMirror pre.md-h3,
.CodeMirror pre.md-h4, .CodeMirror pre.md-h5, .CodeMirror pre.md-h6 { font-weight: 700; letter-spacing: -0.01em; }
.CodeMirror pre.md-h1 { font-size: 2.2em; line-height: 1.28; }
.CodeMirror pre.md-h2 { font-size: 1.75em; line-height: 1.32; }
.CodeMirror pre.md-h3 { font-size: 1.42em; line-height: 1.38; }
.CodeMirror pre.md-h4 { font-size: 1.2em; }
.CodeMirror pre.md-h5 { font-size: 1.06em; }
.CodeMirror pre.md-h6 { font-size: 0.98em; color: var(--text-muted); }

/* 커서가 놓인 줄 오른쪽 끝에 뜨는 수정 시각 */
.md-line-time {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12.5px;
  font-weight: 400;
  font-style: normal;
  line-height: 1.4;
  color: var(--text-faint);
  background: var(--bg);
  padding: 1px 4px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-indent: 0;
}

.CodeMirror pre.md-quote { padding-left: 16px; color: var(--text-muted); }
.md-quote-bg { box-shadow: inset 3px 0 0 var(--quote-bar); }

.md-hr::before {
  content: '';
  display: block;
  height: 1px;
  background: var(--border-strong);
  margin: 12px 0;
}

/* indentation lives in padding on the line box so the caret measures correctly;
   the negative text-indent gives wrapped list text a hanging indent */
.md-indent-1 { --lvl: 1; }
.md-indent-2 { --lvl: 2; }
.md-indent-3 { --lvl: 3; }
.md-indent-4 { --lvl: 4; }
.md-indent-5 { --lvl: 5; }
.md-indent-6 { --lvl: 6; }
.CodeMirror pre.md-list {
  padding-left: calc(var(--lvl, 0) * 24px + 1.4em);
  text-indent: -1.4em;
}

/* ---- callouts ---- */
.md-callout { box-shadow: inset 3px 0 0 var(--callout-color); background: var(--callout-bg); }
.md-callout-top { border-radius: 5px 5px 0 0; }
.md-callout-bottom { border-radius: 0 0 5px 5px; }
.md-callout-note { --callout-color: var(--cal-blue); --callout-bg: var(--cal-blue-bg); }
.md-callout-tip { --callout-color: var(--cal-green); --callout-bg: var(--cal-green-bg); }
.md-callout-warning { --callout-color: var(--cal-orange); --callout-bg: var(--cal-orange-bg); }
.md-callout-danger { --callout-color: var(--cal-red); --callout-bg: var(--cal-red-bg); }
.md-callout-quote { --callout-color: var(--cal-gray); --callout-bg: var(--cal-gray-bg); }
.CodeMirror pre.md-callout-text { padding-left: 16px; }
.md-callout-title { font-weight: 700; }
.md-callout-label {
  display: inline-flex;
  text-indent: 0;
  align-items: center;
  gap: 6px;
  margin-right: 6px;
  font-weight: 700;
}
.md-callout-label svg { flex: 0 0 auto; }

/* ---- frontmatter ---- */
.CodeMirror pre.md-frontmatter {
  font-family: var(--mono);
  font-size: 0.82em;
  color: var(--text-muted);
}
.md-frontmatter-bg { background: var(--codeblock-bg); }

.CodeMirror pre.md-codeblock { font-family: var(--mono); font-size: 0.86em; }
.md-codeblock-bg { background: var(--codeblock-bg); }
.md-cb-top { border-radius: 6px 6px 0 0; }
.md-cb-bottom { border-radius: 0 0 6px 6px; }
.CodeMirror pre.md-fence { color: var(--text-faint); font-size: 0.8em; }

/* ---- inline ---- */
.md-syntax { color: var(--text-faint); font-weight: 400; }
.md-strong { font-weight: 700; }
.md-em { font-style: italic; }
.md-strike { text-decoration: line-through; color: var(--text-muted); }
.md-inlinecode {
  font-family: var(--mono);
  font-size: 0.86em;
  color: var(--code-text);
  background: var(--code-bg);
  padding: 0.12em 0.32em;
  border-radius: 4px;
}
.md-highlight { background: var(--highlight-bg); color: var(--highlight-text); border-radius: 2px; }
.md-linktext, .md-wikilink { color: var(--accent); cursor: pointer; }
.md-linktext:hover, .md-wikilink:hover { text-decoration: underline; }
.md-tag {
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 0.1em 0.5em;
  font-size: 0.86em;
}
/* 찾은 자리가 태그 한가운데에 걸리면 CodeMirror가 표시를 쪼개서
   알약 하나가 둘로 보인다. 그런 줄에서는 알약 모양을 잠시 벗겨 글자만 남긴다.
   :has() 로 하면 줄마다 검사해서 큰 문서의 스타일 계산이 눈에 띄게 느려진다 —
   찾기 쪽에서 그 줄에만 표시를 붙인다. */
.md-has-find .md-tag {
  background: none;
  padding: 0;
  border-radius: 0;
}
/* 벗기고 나서도 찾은 자리 표시는 남아야 한다 (같은 무게로 뒤에 둔다) */
.md-has-find .cm-find-hit { background: var(--highlight-bg); color: var(--highlight-text); }
.md-has-find .cm-find-current { background: var(--accent); color: var(--on-accent); }

.md-list-number { color: var(--text-muted); }
.md-task-done { color: var(--text-muted); text-decoration: line-through; }

.md-bullet {
  display: inline-block;
  text-indent: 0;
  width: 1ch;
  color: var(--text-faint);
  font-size: 1.1em;
  line-height: 1;
  vertical-align: baseline;
}

.md-checkbox {
  display: inline-flex;
  text-indent: 0;
  vertical-align: middle;
  transform: translateY(-1px);
  margin-right: 7px;
}
.md-checkbox input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1.5px solid var(--border-strong);
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.md-checkbox input:hover { border-color: var(--accent); }
.md-checkbox input:checked { background: var(--accent); border-color: var(--accent); }
.md-checkbox input:checked::after {
  content: '';
  position: absolute;
  left: 4.5px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid var(--on-accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.md-checkbox input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
/* ------------------------------------------------------------------ 접기
   화살표는 .page 의 왼쪽 여백(34px) 안에 떠 있다. 글자 자리를 차지하지 않으므로
   생기고 사라져도 본문이 흔들리지 않는다. 가로 위치가 곧 레벨이다. */
.md-fold-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}
.md-fold-btn {
  position: absolute;
  width: 16px;
  height: 16px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  pointer-events: auto;
  opacity: .7;
}
.md-fold-btn:hover { opacity: 1; }
.md-fold-btn.is-folded { opacity: 1; color: var(--accent); }
.md-fold-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(90deg);
  transition: transform .1s ease;
}
.md-fold-btn.is-folded svg { transform: rotate(0deg); }
.md-fold-btn:hover { background: var(--accent-soft); color: var(--accent); }
.md-fold-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* 접힌 자리 표시 — 제목 줄 끝에 붙는다 */
.md-fold-ellipsis {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72em;
  font-weight: 600;
  line-height: 1.5;
  vertical-align: middle;
  letter-spacing: 1px;
}

/* Ctrl 을 누르고 있는 동안 보이는 모든 줄의 수정 시각 */
.md-all-times {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.md-line-time-float {
  position: absolute;
  right: 4px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-faint);
  background: var(--bg);
  padding: 0 4px;
  border-radius: 4px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* 마우스를 올린 줄에 뜨는 수정 시각 (본문을 다시 그리지 않는다) */
.md-hover-time {
  position: absolute;
  right: 4px;
  z-index: 6;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-faint);
  background: var(--bg);
  padding: 0 4px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

/* modib/mobile.css */
/* 휴대폰 화면 (웹 버전) — Daynote 화면은 그대로 두고 좁은 화면에서만 바꾼다
   - 왼쪽 사이드바 → 아래 메뉴 줄 (좌우로 밀기)
   - 홈은 [적어 두기 | 오늘] 탭으로 한 칸씩 (modib/mobile.js 가 탭을 붙인다)
   - 마우스를 올려야 보이던 도구는 늘 보이게 (터치) */
.m-tabs { display: none; }

@media (max-width: 760px) {
  html, body { height: 100%; overscroll-behavior: none; }
  .app { flex-direction: column; height: 100vh; height: 100dvh; }

  /* 아래 메뉴 줄 */
  .app .sidebar, .app.sidebar-collapsed .sidebar {
    order: 2; flex: 0 0 auto; width: 100%; height: auto;
    flex-direction: row; align-items: stretch; gap: 0;
    padding: 0 4px env(safe-area-inset-bottom);
    border-right: 0; border-top: 1px solid var(--border-deco);
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  }
  .app .sidebar::-webkit-scrollbar { display: none; }
  .app .sidebar .brand, .app .sidebar .sidebar-foot-row, .app .sidebar .focus-pill { display: none !important; }
  /* 메뉴 단추(설정 포함)가 한 줄을 나눠 쓴다 */
  .app .sidebar .nav, .app .sidebar .sidebar-foot { display: contents; }
  .app .sidebar .nav-item, .app .sidebar .nav-sub {
    position: relative; flex: 1 1 0; flex-direction: column; justify-content: center; gap: 2px;
    min-width: 46px; height: 56px; padding: 4px 2px !important; border-radius: 10px;
    font-size: 11px; font-weight: 500;
  }
  .app .sidebar .nav-label { display: block !important; flex: none; font-size: 11px; }
  .app .sidebar .nav-count {
    display: block !important; position: absolute; top: 4px; right: 10px;
    min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
    background: var(--primary-fill); color: var(--on-primary); font-size: 10px; line-height: 16px; text-align: center;
  }
  .app .sidebar .nav-item[aria-current="page"] .nav-count { color: var(--on-primary); }

  .main { order: 1; flex: 1 1 auto; min-height: 0; }

  /* 홈: 탭으로 한 칸씩 */
  .m-tabs {
    display: flex; gap: 4px; padding: 8px 10px 0; position: sticky; top: 0; z-index: 5; background: var(--bg-app);
  }
  .m-tab {
    flex: 1; height: 36px; border: 1px solid var(--border-deco); border-radius: 10px; background: var(--surface);
    color: var(--text-secondary); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  }
  .m-tab[aria-selected="true"] { background: var(--primary-soft); color: var(--primary-ink); border-color: transparent; }
  .m-hist {
    flex: 0 0 40px; height: 36px; display: grid; place-items: center; border: 1px solid var(--border-deco); border-radius: 10px;
    background: var(--surface); color: var(--text-primary); cursor: pointer; padding: 0;
  }
  .m-hist .ico { width: 18px; height: 18px; }
  .m-hist:disabled { color: var(--text-tertiary); opacity: 0.5; cursor: default; }
  .view:has(> .m-tabs) { display: flex; flex-direction: column; overflow: hidden; }
  .home, .view .home {
    flex: 1 1 auto; height: auto !important; min-height: 0; overflow: hidden !important;
    padding: 8px 8px 8px !important; grid-template-rows: minmax(0, 1fr) !important;
  }
  html.m-pane-chat .home-lists, html.m-pane-chat .home-colbar { display: none !important; }
  html.m-pane-lists .home-chat, html.m-pane-lists .home-colbar { display: none !important; }
  html.m-pane-lists .home-lists { overflow: auto; }
  /* 채팅은 위아래로만 — 좌우로 밀리지 않게. 'Enter 보내기' 안내는 휴대폰에선 빼서 보내기 단추가 잘리지 않게 */
  .chat-list { overflow-x: hidden; touch-action: pan-y; overscroll-behavior-x: none; }
  .chat-input-hint { display: none; }
  .chat-input-foot .chat-input-hint + .btn-primary { margin-left: auto; }

  /* 겹쳐 뜨는 것들은 화면 너비로 */
  .detail, .detail > * { width: 100% !important; max-width: 100% !important; }
  .modal { width: calc(100vw - 20px) !important; max-width: calc(100vw - 20px) !important; max-height: calc(100dvh - 24px); }
  .overlay { padding: 10px; }
  .view-pad { padding: 16px 14px 40px !important; }
  .cal-side, .notes-list, .proj-list { display: none; }

  /* 입력할 때 확대되지 않게 (iOS 는 16px 보다 작은 글자 칸을 누르면 확대한다) */
  input, textarea, select { font-size: 16px !important; }
}

/* 터치 화면 — 마우스를 올려야 보이던 도구를 늘 보이게 */
@media (hover: none) {
  .step-tools { opacity: 1 !important; }
  .home-colbar { display: none !important; }
}

/* 문서 화면(보관함·프로젝트) — 휴대폰 */
@media (max-width: 760px) {
  .doc-hint { display: none; }
  .doc-toolbar { padding: 8px 10px; min-height: 48px; flex-wrap: wrap; }
  .doc-page { padding: 16px 16px 40vh; }
  .doc-folders { padding: 8px 10px; max-height: 82px; }
  .doc-folder { height: 30px; font-size: 13px; }
  .doc-search-wrap { width: 120px; }
  .doc-date { padding: 0 8px; }
}

/* 서식 단추 줄 — 문서·메모를 쓸 때 키보드 바로 위 (modib/mobile.js) */
.m-mdbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; gap: 6px; padding: 6px 8px;
  background: var(--surface); border-top: 1px solid var(--border-deco); box-shadow: 0 -2px 10px rgba(0,0,0,.08);
}
.m-mdbar[hidden] { display: none; }
.m-md-btn {
  flex: 1; height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border-deco); border-radius: 10px; background: var(--surface-subtle); color: var(--text-primary);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none;
}
.m-md-btn:active { background: var(--primary-soft); }
.m-md-btn b { font-size: 20px; line-height: 1; }
.m-md-box { width: 14px; height: 14px; border: 2px solid currentColor; border-radius: 3px; }

/* 휴대폰 [오늘] 칸 — 비어 있어도 아래까지 꽉 차게 (마지막 칸이 남은 높이를 채운다) */
@media (max-width: 760px) {
  html.m-pane-lists .home-lists > .home-today { flex: 1 0 auto; min-height: 100%; }
  html.m-pane-lists .home-today > .home-sec:last-child { flex: 1 0 auto !important; }
}

/* 휴대폰 채팅 — 도우미 단추 줄(다음 할 일·작게 나누기·휴식·하루 마무리)과 모델 이름은 컴퓨터에서만 */
@media (max-width: 760px) {
  .chat-tools, .chat-badge { display: none !important; }
  /* 키보드가 올라와 있는 동안 (mobile.js 가 html.m-kb) — 화면을 보이는 높이에 맞추고 아래 메뉴는 숨긴다 */
  html.m-kb .app { position: fixed; left: 0; right: 0; top: var(--app-top, 0px); height: var(--app-h, 100dvh) !important; }
  html.m-kb .app .sidebar { display: none !important; }
}
