:root {
  /* ライト：クールなガラス＋ネオングロー（インディゴ×シアン） */
  --bg: #eef2f9;           /* 下地（クール） */
  --panel: #ffffff;        /* カード面は白でくっきり */
  --panel2: #e9eefb;       /* ホバー面（クール） */
  --side: rgba(255,255,255,0.55);  /* ガラス（ぼかし併用） */
  --line: #e3e9f4;         /* 境界線（やわらか） */
  --fg: #16203a;           /* 本文（深いネイビー寄り） */
  --muted: #6b7890;        /* 補助テキスト */
  --accent: #4f46e5;       /* indigo-600：差し色 */
  --accent-soft: rgba(79,70,229,0.12);
  --accent2: #0284c7;      /* sky-600：フォルダ（白地でも読める濃さ） */
  --danger: #e11d48;       /* rose-600 */
  --shadow: 0 1px 2px rgba(30,41,80,0.05), 0 6px 20px rgba(30,41,80,0.06);
  --glow: rgba(79,70,229,0.30);
  --app-bg:
    radial-gradient(820px 460px at 6% -12%, rgba(99,102,241,0.16), transparent 60%),
    radial-gradient(720px 460px at 104% -8%, rgba(14,165,233,0.14), transparent 58%),
    linear-gradient(180deg, #f5f8fd 0%, #e9eef7 100%);
  --map-bg:
    radial-gradient(60% 55% at 50% 40%, rgba(79,70,229,0.06), transparent 70%),
    radial-gradient(circle at 50% 45%, #ffffff, #e9eef7);
  --map-stage: #f3f6fc;
  --peek-bg: rgba(255,255,255,0.62);
}
html.dark {
  /* ダーク：Obsidian風＋ほのかなグロー */
  --bg: #1a1b20;
  --panel: #242630;
  --panel2: #2b2e3a;
  --side: rgba(26,27,32,0.55);
  --line: #33363f;
  --fg: #d7dae0;
  --muted: #8b909c;
  --accent: #8a7cff;
  --accent-soft: rgba(138,124,255,0.20);
  --accent2: #6fc6e6;
  --danger: #e0728a;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.3);
  --glow: rgba(138,124,255,0.34);
  --app-bg:
    radial-gradient(820px 460px at 6% -12%, rgba(138,124,255,0.16), transparent 60%),
    radial-gradient(720px 460px at 104% -8%, rgba(91,140,255,0.12), transparent 58%),
    linear-gradient(180deg, #1d1e24 0%, #161720 100%);
  --map-bg:
    radial-gradient(60% 55% at 50% 40%, rgba(138,124,255,0.10), transparent 70%),
    radial-gradient(circle at 50% 45%, #181a26, #101119);
  --map-stage: #14151c;
  --peek-bg: rgba(33,35,45,0.62);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--app-bg) fixed; color: var(--fg);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif;
  display: flex; flex-direction: column; height: 100vh; font-size: 15px;
}
header {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--side);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
h1 { font-size: 15px; margin: 0; font-weight: 700; color: var(--fg); letter-spacing: .02em;
  display: flex; align-items: center; gap: 8px; }
h1 .brand-mark { color: var(--accent); display: inline-flex; }
.spacer { flex: 1; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; border-radius: 9px;
  background: transparent; color: var(--muted); border: 1px solid transparent; cursor: pointer;
}
.icon-btn:hover { color: var(--fg); background: var(--panel2); border-color: var(--line); }
.icon-btn:disabled { opacity: .5; cursor: default; }
.busy { color: var(--accent); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* インライン線アイコン */
.ic { width: 16px; height: 16px; flex-shrink: 0; fill: none; vertical-align: -3px;
  stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .ic { width: 18px; height: 18px; vertical-align: 0; }
.th-label { display: inline-flex; align-items: center; gap: 5px; }
.th-label .ic { width: 15px; height: 15px; }

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

button { font-family: inherit; }
.primary, .ghost, .danger, .seg { display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.primary { background: var(--accent); color: #fff; border: 0; padding: 8px 14px; border-radius: 8px; cursor: pointer;
  box-shadow: 0 2px 12px var(--glow); font-weight: 600; }
.primary:hover { filter: brightness(1.05); box-shadow: 0 4px 18px var(--glow); }
.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); padding: 5px 9px; border-radius: 8px; cursor: pointer; font-size: 12px; }
.ghost:hover { color: var(--fg); border-color: var(--accent); background: var(--panel2); }
.danger { background: transparent; color: var(--danger); border: 1px solid var(--line); padding: 6px 11px; border-radius: 8px; cursor: pointer; }
.danger:hover { border-color: var(--danger); background: rgba(220,38,38,0.06); }
.hint { color: var(--muted); font-size: 12px; }
.hint.offline { color: #b45309; }
/* オフライン表示バー（PWA） */
#offline-bar {
  padding: 7px 18px; font-size: 12.5px; font-weight: 600; text-align: center;
  background: #fff7ed; color: #9a3412; border-bottom: 1px solid #fed7aa;
}
html.dark #offline-bar { background: #3a2a12; color: #fcd9a8; border-bottom-color: #5a3d18; }

/* ============ エディタ（2ペイン） ============ */
.ed-layout { display: flex; flex: 1; min-height: 0; }
.ed-side {
  width: 290px; flex-shrink: 0; background: var(--side); border-right: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  display: flex; flex-direction: column; padding: 12px; gap: 8px;
}
.ed-side .primary { width: 100%; }
.ed-new-row { display: flex; gap: 6px; }
.ed-side .ed-new-row .primary { width: auto; flex: 1; }
.ed-new-row #ed-newfolder { flex-shrink: 0; }
.ed-search {
  width: 100%; padding: 7px 10px; background: var(--panel); color: var(--fg);
  border: 1px solid var(--line); border-radius: 7px; font-size: 13px;
}
.ed-search-wrap { position: relative; }
.ed-search-wrap .ed-search { padding-right: 44px; }   /* バッジ分の余白 */
.ed-search-kbd {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font: 600 9px/1.3 inherit; letter-spacing: .02em; color: var(--muted); background: var(--panel2);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px;
  cursor: pointer; user-select: none; white-space: nowrap; opacity: .8;
}
.ed-search-kbd:hover { color: var(--accent); border-color: var(--accent); }
/* サイドバー最下部：ログイン中ユーザー（クリックでアカウント設定）。スマホはドロワー内に表示 */
.ed-userbar {
  display: flex; align-items: center; gap: 8px; width: 100%;
  margin: 4px -4px 0; padding: 8px; border: 0; border-top: 1px solid var(--line);
  background: transparent; color: var(--fg); cursor: pointer; text-align: left; font-family: inherit;
}
.ed-userbar:hover { background: var(--panel); }
.ed-user-avatar {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; text-transform: uppercase;
}
.ed-user-email { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12.5px; color: var(--muted); }
.ed-user-cog { flex: none; width: 16px; height: 16px; color: var(--muted); }
.ed-userbar:hover .ed-user-email, .ed-userbar:hover .ed-user-cog { color: var(--fg); }
.ed-modes { display: flex; gap: 4px; }
.seg { flex: 1; background: var(--panel); color: var(--muted); border: 1px solid var(--line);
  padding: 5px 8px; border-radius: 7px; cursor: pointer; font-size: 12px; }
.seg.on { background: var(--panel2); color: var(--fg); border-color: var(--accent); }
.ed-side-head { display: flex; align-items: center; justify-content: space-between; gap: 6px 8px; flex-wrap: wrap; }
#ed-count { white-space: nowrap; }
.ed-side-tools { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.ed-tree { flex: 1; overflow: auto; margin: 0 -4px; display: flex; flex-direction: column; }
.ed-tree > * { flex-shrink: 0; }   /* 縦フレックスで各セクションを潰さない（はみ出しはスクロール） */
.tree-head .cat-edit, .tree-head .cat-archive, .tree-head .cat-new, .tree-head .cat-fav, .tree-head .cat-sub, .tree-head .cat-del { color: var(--muted); cursor: pointer; padding: 0 3px; opacity: 0; font-weight: 400; display: inline-flex; }
.tree-head:hover .cat-edit, .tree-head:hover .cat-archive, .tree-head:hover .cat-new, .tree-head:hover .cat-fav, .tree-head:hover .cat-sub, .tree-head:hover .cat-del { opacity: .7; }
.tree-head .cat-edit:hover, .tree-head .cat-archive:hover, .tree-head .cat-new:hover, .tree-head .cat-fav:hover, .tree-head .cat-sub:hover { opacity: 1; color: var(--accent); }
.tree-head .cat-del:hover { opacity: 1; color: #e5484d; }
.tree-head .cat-purge { color: var(--muted); cursor: pointer; padding: 0 3px; opacity: 0; display: inline-flex; }
.tree-head:hover .cat-purge { opacity: .7; }
.tree-head .cat-purge:hover { opacity: 1; color: #e5484d; }
.tree-head .cat-purge .ic { width: 14px; height: 14px; }
/* アーカイブ系見出しは破壊ボタンを常時うっすら見せる（hover待ちにしない） */
.tree-group.archived > .tree-head .cat-purge { opacity: .55; }
.tree-head .cat-edit .ic, .tree-head .cat-archive .ic, .tree-head .cat-new .ic, .tree-head .cat-fav .ic, .tree-head .cat-sub .ic, .tree-head .cat-del .ic { width: 14px; height: 14px; }
/* お気に入り（★）は常時表示＆金色フィル */
.tree-head .cat-fav.is-fav, .tree-head:hover .cat-fav.is-fav { opacity: 1; color: #f5b400; }
.tree-head .cat-fav.is-fav .ic { fill: #f5b400; stroke: #f5b400; }
.tree-head .cat-fav.is-fav:hover { color: #e0a400; }

/* セクション見出し（フォルダ／メモ）＋ 未分類メモ一覧 */
.tree-section { font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--muted);
  padding: 12px 8px 4px; }
.ed-tree > .tree-section:first-child { padding-top: 4px; }
.mem-list { display: block; min-height: 10px; padding: 2px 0 8px; border-radius: 8px; }
.mem-list.drop-on { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.tree-group.archived > .tree-head { color: var(--muted); }
.tree-group.archived > .tree-head .th-label { opacity: .8; }
/* アーカイブ本体：通常フォルダと区別（区切り線＋箱アイコン＋淡色） */
.tree-group.archive-root { margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--line); flex-shrink: 0; }
.tree-group.archive-root > .tree-head .th-label { font-weight: 600; opacity: 1; }
.tree-group.archive-root > .tree-head .th-label .ic { color: var(--muted); }

/* 自動分類オプション */
.ed-classify-panel { border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  padding: 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.ed-classify-panel .cls-title { font-weight: 700; font-size: 13px; color: var(--accent); }
.cls-instruction { width: 100%; resize: vertical; font-family: inherit; font-size: 12.5px; line-height: 1.5;
  padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); }
.cls-instruction:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cls-check { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--fg); cursor: pointer; }
.cls-check input { accent-color: var(--accent); }
.cls-actions { display: flex; justify-content: flex-end; gap: 8px; }
.cls-actions .ghost { padding: 6px 12px; }
.cls-note { font-size: 11px; }

/* 設定モーダル */
.modal-overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(15,23,42,0.42); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal { width: min(560px, 92vw); max-height: 86vh; overflow: auto; background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 60px rgba(15,23,42,0.3); }

/* コマンドパレット（Ctrl/⌘+K） */
.cmd-overlay { align-items: flex-start; }
.cmd-modal { width: min(620px, 94vw); margin-top: 12vh; background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 70px rgba(15,23,42,0.35); overflow: hidden; }
.cmd-input-row { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.cmd-input-row .ic { width: 18px; height: 18px; color: var(--muted); flex: none; }
#cmd-input { flex: 1; border: none; outline: none; background: transparent; font-size: 16px; color: var(--fg); }
.cmd-esc { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
.cmd-results { max-height: 56vh; overflow: auto; padding: 6px; }
.cmd-group { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px 4px; }
.cmd-item { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px; cursor: pointer; }
.cmd-item .ic { width: 17px; height: 17px; color: var(--muted); flex: none; }
.cmd-item.active { background: var(--accent); color: #fff; }
.cmd-item.active .ic, .cmd-item.active .cmd-sub { color: rgba(255,255,255,.85); }
.cmd-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.cmd-sub { font-size: 12px; color: var(--muted); flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-empty { padding: 22px; text-align: center; color: var(--muted); font-size: 13px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 700; }
.modal-head .icon-btn { width: 30px; height: 30px; }
.modal-body { padding: 18px; }
.set-section { display: flex; flex-direction: column; gap: 8px; }
.set-row { display: flex; gap: 6px; }
.set-label { font-weight: 600; font-size: 13.5px; }
.set-desc { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); }

/* 設定モーダル（ChatGPT風：左ナビ＋右ペイン） */
.settings-modal { width: min(780px, 95vw); height: min(560px, 86vh); overflow: hidden; display: flex; flex-direction: column; }
.settings-layout { display: flex; flex: 1; min-height: 0; }
.settings-nav { flex: 0 0 184px; display: flex; flex-direction: column; gap: 2px;
  padding: 14px 10px; background: var(--panel2); border-right: 1px solid var(--line); overflow: auto; }
.settings-nav-title { font-weight: 700; font-size: 13px; color: var(--muted); padding: 4px 10px 10px; }
.set-nav { text-align: left; justify-content: flex-start; background: transparent; border: 0; color: var(--fg);
  padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 13.5px; font-family: inherit; }
.set-nav:hover { background: var(--panel); }
.set-nav.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.settings-main { flex: 1; min-width: 0; padding: 22px 26px; overflow: auto; position: relative; }
.settings-close { position: absolute; top: 12px; right: 12px; }
.set-pane { display: none; }
.set-pane.active { display: block; }
.set-h { font-size: 16px; font-weight: 700; margin: 0 0 18px; }
.set-pane .set-section { margin-bottom: 20px; }
.set-pane .ap-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--line); }
.set-pane .ap-row .v { font-size: 13px; color: var(--fg); }
#set-email { max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-badge { display: inline-block; padding: 2px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.set-badge.pro { background: var(--accent); color: #fff; }
.set-badge.free { background: var(--panel); color: var(--muted); border: 1px solid var(--line); }
.hint.err { color: var(--danger); }
.hint.ok { color: #16a34a; }
html.dark .hint.ok { color: #6ec07a; }
.set-input { width: 100%; box-sizing: border-box; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel); color: var(--fg); font-size: 13.5px; font-family: inherit; }
.set-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
#settings-saved.ok { color: #16a34a; }
html.dark #settings-saved.ok { color: #6ec07a; }
.tree-item.dragging { opacity: .4; }
.tree-group.dragging { opacity: .5; }
.tree-group.drop-on > .tree-head { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.tree-head { position: relative; }
.tree-head.drop-into { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.tree-head.drop-before::before, .tree-head.drop-after::after {
  content: ""; position: absolute; left: 4px; right: 4px; height: 2px; background: var(--accent); border-radius: 2px; }
.tree-head.drop-before::before { top: -1px; }
.tree-head.drop-after::after { bottom: -1px; }
.tree-head[draggable="true"] { cursor: grab; }

.tree-group { margin-bottom: 2px; }
.tree-head {
  display: flex; align-items: center; gap: 4px; cursor: pointer; user-select: none;
  padding: 5px 8px; border-radius: 6px; font-size: 13px; color: var(--accent2); font-weight: 600;
}
.tree-head:hover { background: var(--panel2); }
.tree-head .tog { color: var(--muted); width: 12px; font-weight: 400; }
.tree-head .cnt { color: var(--muted); font-weight: 400; font-size: 11px; margin-left: auto; }
.tree-body { display: none; padding-left: 14px; }
.tree-group.open > .tree-body { display: block; }
.tree-item {
  display: block; padding: 5px 10px; border-radius: 6px; cursor: pointer; font-size: 13.5px;
  color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tree-item:not(.card) { display: flex; align-items: center; gap: 6px; }
.tree-item .ti-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-item:hover { background: var(--panel2); }
.tree-item.active { background: var(--accent-soft); color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }
.tree-item .ti-date { color: var(--muted); font-size: 11px; margin-left: 6px; flex-shrink: 0; }
/* タイトル横のゴミ箱（ホバーで出る） */
.ti-del { flex-shrink: 0; display: inline-flex; align-items: center; cursor: pointer;
  color: var(--muted); opacity: 0; padding: 0 1px; transition: opacity .12s, color .12s; }
.tree-item:hover .ti-del { opacity: .75; }
.ti-del:hover { opacity: 1; color: var(--accent); }            /* 通常＝アーカイブ（破壊的でない） */
.ti-del.danger-act:hover { color: var(--danger); }            /* アーカイブ内＝完全削除（赤） */
.ti-del .ic { width: 14px; height: 14px; }
.tree-item.card .ti-meta { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
/* カード表示 */
.tree-item.card { white-space: normal; border: 1px solid var(--line); background: var(--panel);
  margin: 0 4px 8px; padding: 9px 11px; cursor: grab; box-shadow: 0 1px 2px rgba(15,23,42,0.04); }
.tree-item.card:hover { border-color: var(--accent); background: var(--panel2); }
.tree-item.card.active { border-color: var(--accent); }
.tree-item.card .ti-top { display: flex; justify-content: space-between; gap: 8px; }
.tree-item.card .ti-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-item.card .ti-snip { color: var(--muted); font-size: 12px; margin-top: 5px; line-height: 1.7;
  white-space: pre-line;   /* 改行（・の箇条書き）をそのまま見せる */
  display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }

/* 右ペイン */
.ed-main { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.ed-viewbar { display: flex; justify-content: flex-end; padding: 8px 12px 0; }
.ed-viewbar .on { color: var(--fg); border-color: var(--accent); background: var(--panel2); }
.ed-empty { margin: auto; color: var(--muted); }
/* 言葉の地図（リング） */
.ed-map { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 0 12px 12px; position: relative; }
/* フォーカス中フォルダの中身をうっすら覗かせる左上パネル */
.map-peek {
  position: absolute; top: 50px; left: 20px; width: 212px; z-index: 2;
  max-height: calc(100% - 92px); overflow: hidden; pointer-events: none;
  padding: 10px 12px; border-radius: 12px;
  background: var(--peek-bg); border: 1px solid var(--line); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  font-size: 12.5px; line-height: 1.5;
}
.map-peek .mp-head { display: flex; align-items: center; gap: 6px; font-weight: 700;
  color: var(--accent); padding-bottom: 7px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.map-peek .mp-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-peek .mp-head em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--muted); font-weight: 600; }
.map-peek .mp-sub { color: var(--muted); font-size: 11px; margin: -2px 0 6px; }
.map-peek .mp-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2.5px 0; color: var(--fg); }
.map-peek .mp-name { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.map-peek .mp-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-peek .mp-row.cat { color: var(--accent2); }
.map-peek .mp-row .ic { width: 14px; height: 14px; color: var(--muted); opacity: .9; }
.map-peek .mp-row.cat .ic { color: var(--accent2); }
.map-peek .mp-vol { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.map-peek .mp-bar { width: 34px; height: 4px; border-radius: 3px; background: var(--line); overflow: hidden; }
.map-peek .mp-bar i { display: block; height: 100%; background: var(--accent2); border-radius: 3px; }
.map-peek .mp-vol em { font-style: normal; font-size: 11px; color: var(--muted); min-width: 16px; text-align: right; }
.map-peek .mp-more { color: var(--muted); font-size: 11px; padding-top: 5px; }
/* メモ（ファイル）フォーカス時の本文カード */
.map-peek .mp-cat { display: inline-flex; align-items: center; gap: 5px; font-size: 11px;
  color: var(--accent2); margin: 2px 0 7px; }
.map-peek .mp-cat .ic { width: 13px; height: 13px; }
.map-peek .mp-memo { font-size: 12px; line-height: 1.75; color: var(--fg);
  max-height: 320px; overflow: hidden; word-break: break-word; }
/* その場編集（パネルは透過のまま、入力欄だけ操作可能に） */
.map-peek input, .map-peek textarea, .map-peek .mp-newmemo, .map-peek .mp-fav, .map-peek .mp-row.clickable { pointer-events: auto; }
.map-peek .mp-row.clickable { cursor: pointer; border-radius: 6px; margin: 0 -4px; padding-left: 4px; padding-right: 4px; }
.map-peek .mp-row.clickable:hover { background: var(--accent-soft); }
.map-peek .mp-row.clickable:hover .mp-name > span { color: var(--accent); }
.map-peek .mp-fav { cursor: pointer; color: var(--muted); display: inline-flex; margin-left: 2px; }
.map-peek .mp-fav .ic { width: 15px; height: 15px; }
.map-peek .mp-fav:hover { color: var(--accent); }
.map-peek .mp-fav.is-fav { color: #f5b400; }
.map-peek .mp-fav.is-fav .ic { fill: #f5b400; stroke: #f5b400; }
.map-peek .mp-newmemo { display: inline-flex; align-items: center; gap: 5px; margin-top: 9px;
  padding: 5px 10px; border-radius: 8px; cursor: pointer; font-size: 11.5px; font-weight: 600;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--line); font-family: inherit; }
.map-peek .mp-newmemo:hover { background: var(--accent); color: #fff; }
.map-peek .mp-newmemo .ic { width: 13px; height: 13px; }
.map-peek.editing { width: 300px; }
.map-peek .mp-head em#mp-saved { font-style: normal; font-size: 10px; color: var(--muted); font-weight: 400; flex-shrink: 0; }
.map-peek .mp-title, .map-peek input.mp-foldername {
  flex: 1; min-width: 0; font-weight: 700; font-family: inherit; color: var(--fg);
  background: transparent; border: 0; border-bottom: 1px solid transparent; padding: 2px 1px; font-size: 13.5px; }
.map-peek input.mp-foldername { color: var(--accent2); font-size: 13px; }
.map-peek .mp-title:focus, .map-peek input.mp-foldername:focus { outline: none; border-bottom-color: var(--accent); }
.map-peek .mp-body { width: 100%; min-height: 150px; resize: vertical; font-family: inherit;
  font-size: 12px; line-height: 1.7; color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; margin-top: 6px; }
.map-peek .mp-body:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* 地図フォーカスとサイドバーの連動ハイライト */
.tree-item.map-focus { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.tree-head.map-focus { box-shadow: inset 0 0 0 2px var(--accent); border-radius: 6px; }
.map-topbar { display: flex; align-items: center; gap: 8px; }
.map-topbar .map-crumb { flex: 1; min-width: 0; }
/* フラット移動トグル：リングと同じ画面（キャンバス領域）に重ねて配置 */
.map-flatbtn { position: absolute; top: 42px; right: 18px; z-index: 3;
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--peek-bg); color: var(--muted); border: 1px solid var(--line); border-radius: 9px;
  cursor: pointer; -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); box-shadow: var(--shadow); }
.map-flatbtn:hover { color: var(--fg); border-color: var(--accent); }
.map-flatbtn.on { color: #fff; background: var(--accent); border-color: var(--accent); }
.map-flatbtn .ic { width: 18px; height: 18px; }
.map-crumb { padding: 6px 2px; font-size: 13px; color: var(--muted); }
.map-crumb a { color: var(--accent2); text-decoration: none; }
.map-crumb a:hover { text-decoration: underline; }
.map-crumb .sep { color: var(--muted); margin: 0 2px; }
#map-canvas { flex: 1; width: 100%; background: var(--map-bg);
  border: 1px solid var(--line); border-radius: 12px;
  touch-action: none; }   /* スマホ：ブラウザのスクロール/ズームに奪われずタップ・スワイプを取る */
.map-hint { padding: 8px 2px 0; }
/* 操作ヒントはマウス前提の文言（クリック/長押し/スクロール）。ウィンドウ幅ではなく、
   タッチ端末（＝操作がタップ/スワイプで異なる）のときだけ畳む。 */
@media (hover: none) and (pointer: coarse) {
  .map-hint { display: none; }
}
.ed-pane { flex: 1; display: flex; flex-direction: column; padding: 30px 40px; max-width: 800px; width: 100%; margin: 0 auto; }
.ed-title {
  width: 100%; font-size: 24px; font-weight: 700; padding: 4px 0; margin-bottom: 8px;
  letter-spacing: -.01em; line-height: 1.4;
  background: transparent; color: var(--fg); border: 0; border-bottom: 1px solid transparent;
}
.ed-title:focus { outline: none; border-bottom-color: var(--line); }
.ed-keywords { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; min-height: 22px; }
.kw { display: inline-flex; align-items: center; gap: 4px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-soft);
  border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.kw .ic { width: 13px; height: 13px; vertical-align: 0; }
.kw .kw-x { display: inline-flex; align-items: center; cursor: pointer; margin-left: 2px; opacity: .55; }
.kw:hover .kw-x { opacity: .85; }
.kw .kw-x:hover { opacity: 1; color: var(--danger); }
.kw .kw-x .ic { width: 12px; height: 12px; }
.kw.empty { color: var(--muted); background: transparent; border: 1px dashed var(--line); }
.ed-body-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.ed-body {
  flex: 1; width: 100%; font-size: 15.5px; line-height: 1.95; padding: 0; resize: none;
  letter-spacing: .01em;
  background: transparent; color: var(--fg); border: 0; font-family: inherit;
}
.ed-body:focus { outline: none; }
.ed-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 12px; border-top: 1px solid var(--line); margin-top: 10px; }
.ed-foot-r { display: flex; align-items: center; gap: 12px; }
#ed-saved.dirty { color: var(--accent2); }
#ed-saved.saved { color: #16a34a; }
html.dark #ed-saved.saved { color: #6ec07a; }

/* ============ 質感の磨き込み ============ */
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "palt"; letter-spacing: .01em; }
.cat-edit .ic { width: 14px; height: 14px; vertical-align: -2px; }
.tab, .ghost, .seg, .primary, .danger, .icon-btn,
.tree-item, .tree-head, .ed-title, .ed-search, .kw {
  transition: background-color .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease;
}
.ed-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
::selection { background: var(--accent-soft); }

/* スクロールバー（細く・主張しすぎない） */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 7px; border: 3px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ============ カテゴリ変更の履歴 ============ */
.ghost.icon-only { padding: 5px 7px; }
.ghost:disabled { opacity: .4; cursor: default; }
.ghost:disabled:hover { color: var(--muted); border-color: var(--line); background: transparent; }
.ed-history-panel { border: 1px solid var(--line); border-radius: 9px; background: var(--panel);
  max-height: 210px; overflow: auto; padding: 5px; box-shadow: var(--shadow); }
.eh-item { padding: 6px 9px; border-radius: 7px; font-size: 12.5px; color: var(--fg); line-height: 1.5; }
.eh-item + .eh-item { border-top: 1px solid var(--line); }
.eh-item .eh-time { color: var(--muted); font-size: 11px; display: block; }
.eh-item.next { background: var(--accent-soft); }
.eh-item.next .eh-tag { color: var(--accent); font-weight: 600; }
.eh-empty { color: var(--muted); font-size: 12px; padding: 10px; text-align: center; }


/* インラインのフォルダ作成／改名（prompt 廃止） */
.folder-new-row { display: flex; align-items: center; gap: 6px; padding: 4px 8px; margin: 2px 0; }
.folder-new-row .ic { width: 15px; height: 15px; color: var(--accent); flex-shrink: 0; }
.folder-new-input, .folder-rename-input {
  font: inherit; font-size: 13px; color: var(--fg); background: var(--panel);
  border: 1px solid var(--accent); border-radius: 6px; padding: 3px 7px; }
.folder-new-input { flex: 1; min-width: 0; }
.th-label .folder-rename-input { width: 150px; padding: 1px 5px; }
.folder-new-input:focus, .folder-rename-input:focus { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

/* 確認ダイアログ／トースト（confirm / alert 置き換え） */
.confirm-modal { width: min(420px, 92vw); }
#confirm-msg { white-space: pre-line; margin: 2px; line-height: 1.65; color: var(--fg); }
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px;
  font-size: 13px; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 60; max-width: 80vw; text-align: center; }
.toast.show { opacity: .96; transform: translateX(-50%) translateY(0); }

/* ============ モバイル対応（サイドバーをドロワー化） ============ */
.nav-toggle { display: none; }   /* PC では非表示 */
.nav-overlay { display: none; }
.ed-newmobile { display: none; }  /* PCはサイドバーの＋新規メモがあるので不要 */

@media (max-width: 768px) {
  header { padding: 8px 12px; gap: 8px; }
  h1 { font-size: 17px; }
  .nav-toggle { display: inline-flex; }
  /* 「✦自動分類」はスマホではアイコンのみに（テキストを畳む） */
  #ed-deep { font-size: 0; gap: 0; padding: 6px 8px; }
  /* スマホはサイドバーが隠れるので、ビューバー左に「＋新規メモ」を出す */
  .ed-viewbar { justify-content: space-between; }
  .ed-newmobile { display: inline-flex; padding: 7px 14px; }

  /* サイドバーを画面外から滑り込むドロワーに */
  .ed-side {
    position: fixed; top: 0; bottom: 0; left: 0;
    width: min(84vw, 320px);
    z-index: 70;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 0 0 40px -8px rgba(0,0,0,.5);
  }
  body.nav-open .ed-side { transform: translateX(0); }

  /* ドロワーの背景（タップで閉じる） */
  .nav-overlay {
    display: block; position: fixed; inset: 0; z-index: 65;
    background: rgba(15,18,32,.42);
    opacity: 0; pointer-events: none; transition: opacity .22s;
  }
  body.nav-open .nav-overlay { opacity: 1; pointer-events: auto; }

  /* 本文・地図は全幅に（ドロワーは fixed で flow から外れる） */
  .ed-pane { padding: 16px 16px 14px; }
  .ed-title { font-size: 21px; }
  .ed-body { font-size: 16px; line-height: 1.85; }  /* 16px＝iOSで入力時に拡大されない */
  .ed-viewbar { padding: 6px 10px 0; }
  .ed-map { padding: 0 8px 8px; }
  /* スマホ：フォーカスの中身カードは左上だと対象を覆うので、下のシートに逃がす
     （フォーカス項目はリング真上に描かれるため、上が空いて見える） */
  /* 下シートの高さはフォーカス対象で変える。フォルダ＝コンパクト（リング広い）／
     メモ＝広めに開いて本文をしっかり／入力中＝最大。切替は transition で滑らか（リングも追従）。 */
  .map-peek {
    top: auto; left: 0; right: 0; bottom: 0;
    width: 100%; max-width: 100%;
    height: 32vh; max-height: 32vh; overflow: hidden;   /* フォルダ焦点＝コンパクト。スクロールは中身側で */
    display: flex; flex-direction: column;
    padding: 8px 13px calc(8px + env(safe-area-inset-bottom));
    border-radius: 14px 14px 0 0;
    border-left: 0; border-right: 0; border-bottom: 0;
    pointer-events: auto;
    transition: height .18s ease, max-height .18s ease;
  }
  .map-peek.editing { width: 100%; height: 38vh; max-height: 38vh; }   /* メモ焦点＝本文を確保しつつリングも残す（下の余白を詰める） */
  .map-peek .mp-head { padding-bottom: 5px; margin-bottom: 5px; flex-shrink: 0; }
  .map-peek .mp-cat { margin: 1px 0 4px; flex-shrink: 0; }   /* カテゴリ表示の余白を縮小 */
  .map-peek .mp-list { flex: 1; min-height: 0; overflow-y: auto; }   /* フォルダ：一覧が長ければ中でスクロール */
  /* メモ：本文欄を主役に。残り高さを全部 textarea へ（はみ出さない＝シートにバー出ない・ボタンは常に下端に残る） */
  .map-peek .mp-body { flex: 1; min-height: 0; margin-top: 4px; padding: 8px 10px; font-size: 15px; line-height: 1.7; }
  .map-peek.editing .mp-body { min-height: 18vh; }   /* flexが効かない端末向けの下限（通常はflexで本文が伸びる） */
  .map-peek .mp-newmemo { margin-top: 6px; align-self: flex-start; flex-shrink: 0; }
  .map-peek .mp-memo { max-height: none; }

  /* 設定モーダル：左ナビを上のタブ列に */
  .settings-modal { width: 96vw; max-height: 90vh; }
  .settings-layout { flex-direction: column; }
  .settings-nav { flex: 0 0 auto; flex-direction: row; overflow-x: auto; gap: 4px; padding: 8px;
    border-right: 0; border-bottom: 1px solid var(--line); }
  .settings-nav-title { display: none; }
  .set-nav { white-space: nowrap; padding: 7px 13px; }
  .settings-main { padding: 18px 16px; }
}

@media (max-width: 380px) {
  h1 { font-size: 0; gap: 0; }            /* 極狭幅ではブランド文字を畳んでアイコンだけに */
  h1 .brand-mark .ic { width: 20px; height: 20px; }
  header { gap: 4px; }
}

/* ============ AIに聞く（チャットモーダル） ============ */
.ask-modal, .reflect-modal {
  width: min(620px, 94vw); max-height: 86vh; display: flex; flex-direction: column;
  padding: 0; overflow: hidden;
}
.ask-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.ask-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--fg); }
.ask-title .brand-mark { color: var(--accent); display: inline-flex; }
.ask-sub { font-size: 12px; }
.ask-head .icon-btn { width: 30px; height: 30px; }
.ask-head .ghost { padding: 6px 10px; font-size: 13px; }
/* 会話履歴ドロップダウン（複数スレッド切替） */
.ask-threads {
  position: absolute; left: 12px; top: 54px; z-index: 5;
  width: min(300px, 80%); max-height: 320px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 6px;
}
.ask-th { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.ask-th:hover { background: var(--panel2); }
.ask-th.on { background: var(--accent-soft); }
.ask-th-title { flex: 1; font-size: 13px; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-th-del { flex-shrink: 0; opacity: .5; display: inline-flex; }
.ask-th-del:hover { opacity: 1; color: var(--danger); }
.ask-th-del .ic { width: 15px; height: 15px; }
.ask-th-empty { padding: 12px; text-align: center; }
.ask-modal { position: relative; }   /* ドロップダウンの基準 */
.ask-log { flex: 1; min-height: 200px; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ask-msg { display: flex; }
.ask-msg.user { justify-content: flex-end; }
.ask-bub {
  max-width: 86%; padding: 10px 13px; border-radius: 12px; font-size: 14px; line-height: 1.7;
  word-break: break-word; white-space: normal;
}
.ask-msg.user .ask-bub { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.ask-msg.ai .ask-bub { background: var(--panel2); color: var(--fg); border-bottom-left-radius: 4px; }
.ask-bub ul { margin: 4px 0; padding-left: 18px; }
.ask-bub li { margin: 2px 0; }
.ask-bub strong { color: var(--fg); }
.ask-cite { color: var(--accent2); font-weight: 600; }
.ask-typing { letter-spacing: 2px; color: var(--muted); animation: pulse 1s ease-in-out infinite; }
.ask-suggest { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 16px 12px; }
.ask-chip {
  font-size: 12.5px; padding: 6px 11px; border-radius: 16px; cursor: pointer;
  background: var(--accent-soft); color: var(--accent); border: 1px solid transparent; font-family: inherit;
}
.ask-chip:hover { border-color: var(--accent); }
.ask-form { display: flex; gap: 8px; align-items: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); flex-shrink: 0; }
.ask-input {
  flex: 1; resize: none; font-family: inherit; font-size: 15px; line-height: 1.6;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--fg); max-height: 140px;
}
.ask-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ask-form .primary.icon-only { width: 40px; height: 40px; padding: 0; border-radius: 10px; flex-shrink: 0; }

/* ============ カレンダーモーダル ============ */
.reflect-modal { width: min(840px, 94vw); }
.reflect-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.rf-cols { display: flex; gap: 18px; align-items: flex-start; }
.rf-cal { flex: 1 1 56%; min-width: 0; }
.rf-daymemos { flex: 1 1 44%; min-width: 0; max-height: 380px; overflow-y: auto; }
.rf-streak { display: flex; gap: 10px; flex-wrap: wrap; }
.rf-stat {
  flex: 1; min-width: 84px; text-align: center; padding: 12px 6px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px;
}
.rf-num { display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-size: 24px; font-weight: 800; color: var(--fg); }
.rf-num .ic { width: 20px; height: 20px; }
.rf-num.rf-fire { color: var(--accent); }
.rf-lab { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
/* 月めくりカレンダー（日付が読める／書いた日に色＋件数） */
.rf-cal-head { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 10px; }
.rf-cal-title { font-size: 15px; font-weight: 700; color: var(--fg); min-width: 100px; text-align: center; }
.rf-nav {
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 18px; line-height: 1;
  background: var(--panel2); color: var(--fg); border: 1px solid var(--line);
}
.rf-nav:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.rf-nav:disabled { opacity: .35; cursor: default; }
.rf-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.rf-wd { text-align: center; font-size: 11px; color: var(--muted); padding-bottom: 2px; }
.rf-wd.sun { color: var(--danger); }
.rf-wd.sat { color: var(--accent2); }
.rf-day {
  position: relative; aspect-ratio: 1 / 1; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--muted); background: var(--bg); border: 1px solid transparent;
}
.rf-day.empty { background: transparent; }
.rf-day.l0 { background: var(--bg); }
.rf-day.l1 { background: color-mix(in srgb, var(--accent) 16%, var(--bg)); }
.rf-day.l2 { background: color-mix(in srgb, var(--accent) 34%, var(--bg)); }
.rf-day.l3 { background: color-mix(in srgb, var(--accent) 58%, var(--bg)); }
.rf-day.l4 { background: var(--accent); }
.rf-day.has { color: var(--fg); font-weight: 600; }
.rf-day.l3, .rf-day.l4 { color: #fff; }
.rf-day:not(.empty) { cursor: pointer; }
.rf-day:not(.empty):hover { border-color: var(--accent); }
.rf-day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.rf-day.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.rf-dnum { line-height: 1; }
.rf-dcnt {
  position: absolute; bottom: 2px; right: 3px; font-size: 9px; font-weight: 700;
  color: var(--accent2); opacity: .9;
}
.rf-day.l3 .rf-dcnt, .rf-day.l4 .rf-dcnt { color: #fff; }
.rf-note { font-size: 12px; color: var(--muted); margin: -2px 0 8px; }
.rf-empty { padding: 14px 2px; line-height: 1.8; }
.rf-sec:empty { display: none; }
.rf-h { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--accent2); margin: 0 0 8px; }
.rf-h .ic { width: 16px; height: 16px; }
/* 選択した日のメモ＝アプリのカード表示と同じ見た目で */
.rf-cards { display: flex; flex-direction: column; }
.rf-card { cursor: pointer; }   /* サイドバーの grab ではなくクリックで開く */
.rf-card .ti-date { font-size: 11px; color: var(--muted); flex-shrink: 0; }

@media (max-width: 768px) {
  /* 「AIに聞く」「新しい会話」はスマホではアイコンのみに（テキストを畳む） */
  #ed-ask, #ask-new { font-size: 0; gap: 0; padding: 6px 8px; }
  .ask-modal, .reflect-modal { width: 100vw; max-width: 100vw; height: 90vh; max-height: 90vh; border-radius: 14px 14px 0 0; align-self: flex-end; }
  /* カレンダー（reflect）：内容ぶんの高さのボトムシート。余白を作らず、長ければ中でスクロール */
  .reflect-modal { height: auto; max-height: 90dvh; }
  /* 縦積み＋横は full に伸ばす（align-items:flex-start のままだと幅が縮んで左に余る） */
  .rf-cols { flex-direction: column; align-items: stretch; }
  .rf-cal { flex: none; width: 100%; }
  .rf-daymemos { flex: none; width: 100%; max-height: none; overflow: visible; }
  .ask-threads { top: 50px; }
  /* 記録は控えめに：1行に4つ収める（小さめ） */
  .rf-streak { display: flex; flex-wrap: nowrap; gap: 6px; }
  .rf-stat { flex: 1; min-width: 0; padding: 7px 3px; border-radius: 10px; }
  .rf-num { font-size: 16px; }
  .rf-num .ic { width: 14px; height: 14px; }
  .rf-lab { font-size: 9px; margin-top: 1px; line-height: 1.25; }
  .rf-card { margin: 0 0 8px; }   /* モーダル内は左右マージン不要 */
  .ask-input { font-size: 16px; }   /* iOSで入力時に拡大されない */
}

