/* ============================================================
   notes.css — TODO / コメント機能のスタイル
   デザイントークン（theme.css）のみを使用する。
   ============================================================ */

/* ---- 下部パネルのアクション行（ソート等）：問題/進捗のフィルタ行と平仄を合わせ、折り返さない ---- */
.notes-actions { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
/* 並び替え・完了フィルター・別ウィンドウの間に区切り線を入れて境界を分かりやすく */
.notes-sep { flex: 0 0 auto; width: 1px; height: 16px; background: var(--border); margin: 0 4px; }
/* 並び替えセレクト：Stellia テーマ風（appearance:none＋ブランド色＋CSS で ▼ を描画。テーマ追従） */
.notes-sort {
  appearance: none; -webkit-appearance: none;
  height: 24px; box-sizing: border-box;
  border: 1px solid var(--brand-tint-4);
  border-radius: 999px;
  color: var(--brand-ink);
  font-size: 12px;
  padding: 0 22px 0 10px;
  max-width: 120px;
  cursor: pointer;
  background-color: var(--surface);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--brand-ink) 50%),
    linear-gradient(135deg, var(--brand-ink) 50%, transparent 50%);
  background-position: calc(100% - 13px) 50%, calc(100% - 9px) 50%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.notes-sort:hover { border-color: var(--brand-soft); background-color: var(--brand-tint-1); }
.notes-sort:focus { outline: none; border-color: var(--brand); }

/* 下部パネルのヘッダー：どのタブでも行の高さ・縦位置を揃える（タブ間で上下余白が変わらないように、
   ヘッダー内のすべての操作要素を 24px・縦中央に統一） */
.lint-head .panel-tab,
.lint-head .lint-filter-btn,
.lint-head .notes-sort,
.lint-head .notes-pill {
  height: 22px; box-sizing: border-box;
  display: inline-flex; align-items: center;
}
/* editor.css の `.lint button{border:0}` が下部パネルの独自ドロップダウン/ピルの枠線を消すため、
   別ウィンドウ（components.css 由来の枠あり）と見た目を揃えるべく枠線を復活させる。 */
.lint-head .ss-trigger, .lint-head .notes-pill { border: 1px solid var(--border); }
.lint-head .ss-trigger:hover, .lint-head .ss-trigger.open { border-color: var(--brand); }
.lint-head .notes-pill.is-toggle.toggle-on { border-color: var(--brand); }
/* `.lint button{color:var(--link)}` がドロップダウンの文字色を変えてしまうのを上書きし、別ウィンドウと統一 */
.lint-head .ss-trigger, .lint-head .ss-label { color: var(--text); }
.lint-head .ss-arrow { color: var(--muted); }

/* #todoList 等に display:block を指定すると [hidden] 属性（display:none）が効かなくなるため、
   明示的に hidden を復活させる（これが無いと全タブで TODO/コメント一覧が同時表示される）。 */
#todoList[hidden], #commentList[hidden], #nvTodoList[hidden], #nvCommentList[hidden] { display: none; }

/* 並び替えラベル（任意）。小さく muted で、折り返さない。 */
.notes-sort-label { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---- Stellia 独自ドロップダウン（styleSelect）。components.css と同じ .ss-* を
   別ウィンドウ（components.css 非読込）でも使えるよう複製し、ツールバー用にコンパクト化。 ---- */
.ss-wrap { position: relative; display: inline-block; width: 100%; min-width: 0; }
.ss-wrap > select { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; opacity: 0; pointer-events: none; border: 0; }
.ss-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  font: inherit; font-size: 13px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; min-height: 36px;
  box-sizing: border-box; cursor: pointer; text-align: left;
}
.ss-trigger:hover { border-color: var(--brand); }
.ss-trigger.open { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-tint-2); }
.ss-trigger:disabled { opacity: .5; cursor: default; }
.ss-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 0; }
.ss-arrow { flex: 0 0 auto; color: var(--muted); font-size: 18px; line-height: 1; transition: transform .15s ease; }
.ss-trigger.open .ss-arrow { transform: rotate(180deg); }
.ss-panel {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 1200;
  max-height: 260px; overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow-pop, 0 10px 30px rgba(0,0,0,.18)); padding: 4px;
}
.ss-option { padding: 7px 10px; border-radius: 6px; font-size: 13px; color: var(--text); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-option:hover { background: var(--brand-tint-2); }
.ss-option.current { background: var(--brand-tint-3); color: var(--text); font-weight: 700; }

/* ツールバー用コンパクト版（下部パネル・別ウィンドウのソート） */
.notes-actions .ss-wrap, .nv-tabs .ss-wrap { width: auto; min-width: 84px; }
.notes-actions .ss-trigger, .nv-tabs .ss-trigger {
  min-height: 24px; height: 24px; padding: 0 10px; font-size: 12px; border-radius: 999px; gap: 4px;
}
.notes-actions .ss-arrow, .nv-tabs .ss-arrow { font-size: 14px; }

/* ---- ノート一覧（問題/進捗パネル・別ウィンドウで配置/フォントを統一）---- */
.notes-list {
  list-style: none;
  margin: 0;
  padding: 8px 10px;
  overflow: auto;
}
/* 下部パネルでは .lint ul のグリッド/gap が乗るため、id で上書きしてブロック表示に統一。
   別ウィンドウのリストとも完全に同じレイアウトにする（上下の余分な余白を排除）。 */
#todoList, #commentList, #nvTodoList, #nvCommentList {
  display: block;
  gap: 0;
  padding: 4px 8px;
}
/* 「TODOはありません」等を問題/進捗の lint-empty と同じ配置・字体に（コンパクト化） */
.notes-empty {
  display: block;
  padding: 4px 0;
  color: var(--muted);
  font-style: italic;
}
/* フォントは「問題・進捗・TODO・コメントの表示フォント」設定（--lint-font / --lint-size）に統一。
   サイズはカード全体（タイトル/本文/メタ/日付/作成者）に効くよう、.note-body を基準に相対指定。 */
#todoList, #commentList, .notes-list, .notes-list li, .notes-empty, .note-body {
  font-family: var(--lint-font, inherit);
}
.note-body { font-size: var(--lint-size, 13px); }
.note-title, .note-rest { font-size: 1em; }
.notes-empty, .notes-list li { font-size: var(--lint-size, 13px); }
.note-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 3px 2px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
/* 下部パネルでは editor.css `.lint li{display:grid;grid-template-columns:auto 1fr}` が
   .note-item に乗り、子をグリッドに並べてしまう。コメント（チェックボックス無し＝子2個）だと
   .note-body が auto 列で content 幅に縮み、作成日の margin-left:auto が効かず右寄せにならない。
   flex に戻して .note-body を全幅にする（`.lint li`=0,1,1 に勝つ 0,2,1）。 */
.lint li.note-item { display: flex; }
.note-item:hover { background: var(--brand-tint-1); }
.note-item.selected { background: var(--brand-tint-2); }
.note-item.selected:hover { background: var(--brand-tint-2); }
.note-item.done .note-title { text-decoration: line-through; color: var(--muted); font-weight: 500; }
/* タイトル行：左に折りたたみ ▼/▲（複数行のみ）＋1行目（タイトル的に）。
   右端の編集/削除アイコンに重ならないよう、この行だけ右に余白を取る（メタ行は下なので不要）。 */
.note-titlerow { display: flex; align-items: baseline; gap: 4px; padding-right: 46px; }
.note-fold { flex: 0 0 auto; border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: .8em; line-height: 1.4; padding: 0; width: 1.1em; text-align: center; }
.note-fold:hover { color: var(--brand-ink); }
.note-title { flex: 1 1 auto; min-width: 0; font-weight: 600; color: var(--text); white-space: pre-wrap; word-break: break-word; line-height: 1.4; cursor: pointer; }
/* 詳細（2行目以降）はアニメーションで開閉（max-height / opacity をトランジション） */
.note-rest {
  max-height: 0; overflow: hidden; opacity: 0; margin-top: 0;
  color: var(--text); white-space: pre-wrap; word-break: break-word; line-height: 1.5;
  transition: max-height .22s ease, opacity .2s ease, margin-top .22s ease;
}
.note-rest.open { max-height: 600px; opacity: .92; margin-top: 2px; }
.note-empty-text { color: var(--muted); }
/* 作成日は行数と同じメタ行の右端（編集/削除アイコンの下）に表示する。 */
.note-created { margin-left: auto; white-space: nowrap; color: var(--muted); }
.note-item.drifted { background: var(--warn-tint); }
.note-item.flash { animation: note-flash 1.1s ease; }
@keyframes note-flash {
  0%, 100% { background: transparent; }
  20%, 60% { background: var(--brand-tint-3); }
}
/* 完了したことが分かる軽い行ハイライト（チェックON時に一度だけ） */
.note-item.done-flash { animation: note-done-flash .6s ease; }
@keyframes note-done-flash {
  0% { background: transparent; }
  30% { background: color-mix(in srgb, var(--ok, #1a7f37) 16%, transparent); }
  100% { background: transparent; }
}
/* 完了チェック：未完了は薄いチェック、完了ははっきりした緑。ネイティブ装飾は消す。 */
.note-check {
  appearance: none; -webkit-appearance: none;
  flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px;
  border: 1px solid var(--border); border-radius: 5px;
  background: var(--surface); cursor: pointer;
  display: inline-grid; place-items: center;
}
.note-check::after {
  content: "✓"; font-size: 12px; line-height: 1; font-weight: 700;
  color: var(--muted); opacity: .28;
  transition: opacity .12s ease, color .12s ease, transform .12s ease;
}
.note-check:hover { border-color: var(--brand-soft); }
.note-check:checked { border-color: var(--ok, #1a7f37); background: color-mix(in srgb, var(--ok, #1a7f37) 14%, transparent); }
.note-check:checked::after { color: var(--ok, #1a7f37); opacity: 1; }
/* 完了に切り替えた瞬間だけ拡大して戻る（JS が just-checked を一度だけ付与） */
.note-check.just-checked::after { animation: note-check-pop .28s ease; }
@keyframes note-check-pop { 0% { transform: scale(.55); } 55% { transform: scale(1.35); } 100% { transform: scale(1); } }
.note-body { flex: 1 1 auto; min-width: 0; }
.note-text {
  font-size: 13px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}
.note-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 5px;
  font-size: .82em; /* --lint-size に追従（行番号/日付/作成者/期限も一緒に変わる） */
  color: var(--muted);
}
.note-line {
  color: var(--brand-ink);
  background: var(--brand-tint-3);
  border-radius: 4px;
  padding: 0 6px;
  cursor: pointer;
}
.note-line:hover { background: var(--brand-tint-4); }
.note-due { color: var(--warn); }
.note-drift { color: var(--warn); font-weight: 600; }
.note-path { color: var(--link); }
.note-author::before { content: "👤 "; }
/* 編集/削除アイコンはカード右上の操作エリアに固定（本文・日付と分離。コメントも同じ）。 */
.note-ops { position: absolute; top: 3px; right: 4px; display: flex; gap: 2px; align-items: center; opacity: 0; transition: opacity .12s; }
.note-item:hover .note-ops, .note-item:focus-within .note-ops, .note-item.selected .note-ops { opacity: 1; }
/* TODO/コメント一覧の右クリックメニュー（最前面） */
/* TODO/コメントの右クリックメニュー：Explorer の .context-menu と同一デザインに統一。
   components.css 非読込の別ウィンドウでも使えるよう、ここに同等定義を複製。最前面に出す。 */
.context-menu.note-ctx { z-index: 100000; }
.note-ctx { position: fixed; min-width: 170px; padding: 6px; border: 1px solid var(--brand-tint-4); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow-pop, 0 12px 32px rgba(0,0,0,.24)); }
.note-ctx button { display: flex; width: 100%; align-items: center; gap: 8px; border: 0; background: transparent; box-shadow: none; border-radius: 8px; padding: 8px 10px; color: var(--text); font-weight: 700; text-align: left; cursor: pointer; font-size: 13px; line-height: 20px; }
.note-ctx button:hover { background: var(--brand-tint-2); color: var(--brand-ink); }
.note-ctx button.danger { color: var(--danger); }
.note-ctx button.danger:hover { background: var(--danger-tint-2, var(--danger-tint)); color: var(--danger); }
.note-ctx .ctx-ic { flex: none; width: 18px; text-align: center; font-size: 14px; line-height: 1; }
.note-ctx .ctx-sep { height: 1px; margin: 4px 6px; padding: 0; border: 0; background: var(--border); flex: 0 0 auto; box-sizing: border-box; }
.note-op {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 4px 5px;
  border-radius: 5px;
}
.note-op:hover { background: var(--brand-tint-3); }
.note-op.danger:hover { background: var(--danger-tint); }
/* 本体パネルは editor.css の `.lint button{padding:0}` が効いて編集/削除アイコンが詰まる。
   別ウィンドウ（padding:4px 5px のまま）と同じ間隔になるよう padding を復元する。 */
.lint .note-op { padding: 4px 5px; }

/* ---- 編集ダイアログ ---- */
.note-dialog .note-anchor {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 10px;
  font-size: 12px;
}
.note-anchor-label { color: var(--muted); }
.note-anchor-info {
  color: var(--brand-ink);
  background: var(--brand-tint-2);
  border-radius: 5px;
  padding: 2px 8px;
}
.note-dialog textarea {
  width: 100%;
  min-height: 80px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
}
.note-dialog input[type=date] {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}
.note-meta .note-created, .note-created { color: var(--muted); }

/* ---- CodeMirror：行ハイライト＋ガターアイコン ---- */
.cm-todo-line { background: color-mix(in srgb, var(--brand) 9%, transparent); }
.cm-todo-line.cm-todo-done { background: color-mix(in srgb, var(--ok) 9%, transparent); }
.cm-comment-line { background: color-mix(in srgb, var(--warn) 10%, transparent); }
.cm-note-both { background: color-mix(in srgb, var(--brand) 9%, transparent); }

/* 行ジャンプ時の一時ハイライト：一瞬光ってフェードアウト（選択を残さない＝常時ハイライト防止）。 */
.cm-jump-flash { animation: cm-jump-flash 1.3s ease-out forwards; }
@keyframes cm-jump-flash {
  0%   { background: color-mix(in srgb, var(--brand) 42%, transparent); }
  60%  { background: color-mix(in srgb, var(--brand) 30%, transparent); }
  100% { background: transparent; }
}

.cm-note-gutter {
  min-width: 18px;
  display: flex;
  align-items: stretch;
}
.cm-note-gmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  font-size: 11px;
  cursor: pointer;
  line-height: 1;
}
.cm-note-gmark:hover { filter: brightness(1.15); }

/* テーマ切替時のクロスフェード（別ウィンドウは boot.css 非読込のため複製）。本体と同じ挙動。 */
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .42s ease, color .42s ease, border-color .42s ease, fill .42s ease, stroke .42s ease, box-shadow .42s ease !important;
}

/* ---- 別ウィンドウ（notes-view） ---- */
html, body { height: 100%; }
.nv-body {
  margin: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Yu Gothic UI", Meiryo, sans-serif;
}
.nv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--soft);
}
.nv-title { font-weight: 700; font-size: 15px; color: var(--brand-ink); white-space: nowrap; }
.nv-scope { display: flex; gap: 6px; }
.nv-scope-btn {
  border: 1px solid var(--brand-tint-4);
  background: var(--surface);
  color: var(--brand-ink);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.nv-scope-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.nv-scope-btn:disabled { opacity: .45; cursor: not-allowed; }
/* ヘッダー右の操作アイコン（再読み込み・最前面）。プレビューのアイコンとサイズ感を統一 */
.nv-tools { display: flex; align-items: center; gap: 6px; }
.nv-iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; box-sizing: border-box;
  border: 1px solid transparent; background: transparent; color: var(--brand-ink);
  border-radius: 8px; cursor: pointer; padding: 0;
}
.nv-iconbtn:hover { background: var(--brand-tint-2); }
.nv-iconbtn.on { background: var(--brand); color: #fff; }
.nv-ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
/* 接続状態インジケータ（ヘッダー内の小さな表示。本文はグレーアウトしない） */
.nv-status { font-size: 12px; padding: 2px 8px; border-radius: 999px; cursor: default; white-space: nowrap; }
.nv-status.connecting { color: var(--muted); }
.nv-status.lost { color: #fff; background: var(--warn-border, #b45309); cursor: pointer; }
.nv-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
}
/* 下部パネル（問題/進捗）のタブと見た目を統一（base.css の .lint .panel-tab 相当を notes-view 用に定義） */
.nv-tabs .panel-tab {
  font-size: 12px; padding: 2px 10px; border-radius: 999px; border: 0;
  background: transparent; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
}
.nv-tabs .panel-tab:hover { background: var(--brand-tint-2); color: var(--text); }
.nv-tabs .panel-tab.active { background: var(--brand); color: #fff; }
.nv-tabs .panel-tab-badge {
  display: inline-grid; place-items: center; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 10px; line-height: 1;
}
.nv-tabs .panel-tab.active .panel-tab-badge { background: #fff; color: var(--brand); }
.nv-tabs .panel-tab-badge[hidden] { display: none; }
.nv-spacer { flex: 1 1 auto; }
.nv-main { flex: 1 1 auto; overflow: auto; }
.nv-file-head {
  position: sticky; top: 0;
  background: var(--soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 14px;
  border-bottom: 1px solid var(--border);
  list-style: none;
}
.nv-edit { padding: 6px 12px 10px 34px; display: flex; flex-direction: column; gap: 6px; }
.nv-edit textarea {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 56px;
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px;
}
.nv-edit input[type=date] {
  border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px;
  background: var(--surface); color: var(--text); font-size: 13px; width: max-content;
}
.nv-edit-row { display: flex; justify-content: flex-end; gap: 8px; }
.nv-edit-save, .nv-edit-cancel { border: 1px solid var(--border); border-radius: 7px; padding: 5px 12px; cursor: pointer; font-size: 13px; }
.nv-edit-save { background: var(--brand); color: #fff; border-color: var(--brand); }
.nv-edit-cancel { background: var(--surface); color: var(--text); }

/* Stellia 風 確認ダイアログ（別ウィンドウ用：dialog.css 非読込のため見た目を複製）。
   仕様書「Stellia Markdown Editor ダイアログ I/F」の見た目（左枠アクセント＋アイコン）に準拠。 */
.nv-dialog {
  border: 0; border-left: 4px solid var(--link); border-radius: 16px; padding: 0;
  background: var(--panel); color: var(--text);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
  width: min(420px, calc(100vw - 40px)); max-height: calc(100vh - 32px);
}
.nv-dialog::backdrop { background: rgba(15, 23, 42, .36); backdrop-filter: blur(2px); }
.nv-dialog.dlg-info { border-left-color: var(--link); }
.nv-dialog.dlg-warning { border-left-color: var(--warn-border); }
.nv-dialog.dlg-error { border-left-color: var(--danger); }
.nv-dialog-body { padding: 18px; display: flex; flex-direction: column; }
.nv-dialog-body h2 { margin: 0 0 12px; font-size: 17px; display: flex; align-items: center; gap: 7px; }
.nv-dialog .dlg-icon { font-size: 17px; line-height: 1; }
.nv-dialog-msg { margin: 0; white-space: pre-line; font-size: 13.5px; color: var(--text); line-height: 1.5; }
.nv-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--brand-tint-3); }
.nv-btn { appearance: none; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer; font-family: inherit; }
.nv-btn:hover { background: var(--brand-tint-1); }
.nv-btn.primary { border-color: var(--button-primary-bg); background: var(--button-primary-bg); color: #fff; }
.nv-btn.primary:hover { background: var(--button-primary-bg-hover); }
.nv-btn.danger { border-color: var(--danger); background: var(--danger); color: #fff; }
.nv-btn.danger:hover { filter: brightness(1.06); }
.nv-btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.nv-btn.ghost:hover { background: var(--brand-tint-1); color: var(--text); }
/* 下部パネル・別ウィンドウ共通のアクション/トグルピル。
   アクション（別ウィンドウを開く等）は常時はっきり表示。トグル（完了を隠す）だけ
   OFF 時に薄くする（is-toggle）。これで「別ウィンドウのアイコンが灰色」を解消。 */
.notes-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: 24px; box-sizing: border-box;
  font-size: 12px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  cursor: pointer;
}
.notes-pill:hover { color: var(--text); border-color: var(--brand-soft); background: var(--brand-tint-1); }
.notes-pill.is-toggle { opacity: .55; }
.notes-pill.is-toggle.toggle-on { opacity: 1; color: var(--text); border-color: var(--brand); background: var(--brand-tint-2); }
.notes-pill .lf-ic { font-size: 1em; line-height: 1; }
/* 「完了を隠す」はアイコンのみ＝丸いボタン（紫系トグル）。 */
.notes-pill.is-toggle { width: 24px; padding: 0; border-radius: 50%; }
.lint-head .notes-pill.is-toggle { border-radius: 50%; }

/* 別ウィンドウを開くボタン：枠線なしのアイコンボタン。ホバーで薄く背景。 */
.notes-iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; box-sizing: border-box;
  border: none; background: transparent; color: var(--muted);
  border-radius: 7px; cursor: pointer; font-size: 13px; line-height: 1;
}
.notes-iconbtn:hover { background: var(--brand-tint-2); color: var(--brand-ink); }
.notes-iconbtn .lf-ic { font-size: 1em; line-height: 1; }

/* 編集ダイアログの「記入日」の上に余白（カード全体は大きくしすぎない） */
.note-dialog .note-meta { margin-top: 12px; }
/* ダイアログ内の入力エラー（最前面のモーダル内なので確実に見える） */
.note-error { margin: 8px 0 0; color: var(--danger); font-size: 12px; background: var(--danger-tint); border: 1px solid var(--danger); border-radius: 6px; padding: 6px 10px; }
.note-error[hidden] { display: none; }
/* コメント編集時は完了チェック/期限を非表示（.check の display:flex!important を上書き） */
#noteDoneRow[hidden], #noteDueRow[hidden] { display: none !important; }

/* Explorer の未完了TODOマーク（Lint アイコンの左に並べる。サイズは lint-mark に合わせる）。 */
.todo-mark { flex: none; display: inline-grid; place-items: center; width: 15px; height: 15px; font-size: 11px; line-height: 1; margin-left: 2px; }

/* ガターホバーのツールチップ（行番号・本文を押し広げない／最前面／折り返し） */
.cm-note-tip {
  position: fixed; z-index: 100000; max-width: 340px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px;
  box-shadow: var(--shadow-pop, 0 10px 30px rgba(0,0,0,.22));
  font-size: 12px; line-height: 1.5; pointer-events: none;
  white-space: pre-wrap; word-break: break-word;
}
.cm-note-tip-row + .cm-note-tip-row { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }

/* ---- CodeMirror：TODO/コメント用ガター（行番号の左・固定幅で本文がずれない） ---- */
.cm-note-gutter { width: 16px; }
.cm-note-gutter .cm-gutterElement { padding: 0; }
/* 行番号の右余白を詰める */
.cm-lineNumbers .cm-gutterElement { padding: 0 2px 0 6px; }
