/*
  寸法は ChatGPT iPhone 版（iPhone 16, 393 × 852 pt）の実測値を 1pt = 1px で写したもの。
  出典: ../chatgpt-sidebar-study/research.md
*/
:root {
  color-scheme: dark;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* ノート詳細 */
  --text: #e8eaec;
  --text-muted: rgba(232, 236, 240, 0.72);
  --body-size: 17px;
  --body-leading: 24px;

  /* サイドバー */
  --drawer-text: rgba(255, 255, 255, 0.94);
  --drawer-muted: rgba(255, 255, 255, 0.46);
  --row-inset: 10px;          /* セル左端からボタンまで */
  --row-pad: 18px;            /* ボタン内側。文字開始は 28px */
  /* アクセント色 Mist: 本文の文字と同じ系統の白。色は中身（コールアウトや引用）に任せる */
  --accent: #e4e7ea;                       /* ボタンの塗り（Done・New） */
  --accent-ink: #15181b;                   /* 塗りの上のアイコン・文字 */
  --accent-mark: #e4e7ea;                  /* 選択の丸・並べ替えの線・カーソル */
  --accent-rgb: 232, 236, 240;             /* 選択の背景（透明度を変えて使う） */
  --accent-glow: rgba(0, 0, 0, 0.35);      /* ボタンの影 */

  --ease-ios: cubic-bezier(0.32, 0.72, 0, 1);
  --dur: 420ms;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: #070708;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 展示ページ ---------- */
.stage {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 56px;
  padding: 40px;
}
.phone {
  --p: 0;
  --kb: 0px;               /* キーボードの高さ（編集中だけ） */                     /* ドロワーの開き具合 0〜1 */
  --safe-top: 54px;
  --safe-bottom: 34px;
  position: relative;
  width: 393px;
  height: 852px;
  flex: none;
  overflow: hidden;
  border-radius: 55px;
  background: #000;
  box-shadow: 0 0 0 11px #1c1c1e, 0 0 0 12px #333, 0 40px 80px rgba(0, 0, 0, 0.6);
  isolation: isolate;
  touch-action: pan-y;
}
.phone.is-dragging { user-select: none; -webkit-user-select: none; cursor: grabbing; }
.notes { max-width: 300px; color: #b5b8bc; font-size: 14px; line-height: 1.7; }
.notes h1 { margin: 0 0 8px; color: #f2f3f4; font-size: 18px; }
.notes ul { padding-left: 1.1em; }
.notes kbd, .notes code { font-family: var(--mono); font-size: 12px; padding: 1px 5px; border-radius: 4px; background: #1d1f22; color: #e6e6e6; }
.notes .hint { color: #8a8e93; }

/* ---------- ステータスバー（展示用） ---------- */
.status-bar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 50;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 34px 0 50px;
  color: #fff;
  pointer-events: none;
}
.status-time { font-size: 17px; font-weight: 600; letter-spacing: -0.2px; }
.status-icons { display: flex; align-items: center; gap: 6px; }
.status-icons svg { width: 17px; height: 17px; stroke-width: 2.6; }
.signal { display: flex; align-items: flex-end; gap: 1.5px; height: 11px; }
.signal i { width: 3px; background: #fff; border-radius: 1px; }
.signal i:nth-child(1) { height: 4px; } .signal i:nth-child(2) { height: 6px; }
.signal i:nth-child(3) { height: 8.5px; } .signal i:nth-child(4) { height: 11px; }
.battery { width: 25px; height: 12px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.4); padding: 1.5px; position: relative; }
.battery::after { content: ""; position: absolute; right: -3.5px; top: 3.5px; width: 1.5px; height: 4px; border-radius: 0 1px 1px 0; background: rgba(255, 255, 255, 0.4); }
.battery i { display: block; height: 100%; width: 80%; border-radius: 2px; background: #5fd35f; }

/* ---------- ノート詳細 ---------- */
.note-screen { position: absolute; inset: 0; }
/* 写真: Julian Ostarek / Unsplash（Unsplash License）。文字を読めるよう、上ほど青みのある灰色、下ほど黒を重ねる */
.note-backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(52, 58, 68, 0.82) 0%, rgba(30, 34, 38, 0.62) 40%, rgba(8, 10, 10, 0.55) 100%),
    url("bg-forest.jpg") center / cover no-repeat;
}
.note-header {
  position: absolute;
  inset: calc(var(--safe-top) + 4px) 0 auto;
  z-index: 2;
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0 7px 0 16px;
  /* 隠すときはその場で少し上へずれながら消える。移動と透明度は同じ速さ・同じカーブ */
  transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.note-screen.header-hidden .note-header {
  transform: translateY(-10px);
  opacity: 0;
  pointer-events: none;
}
.icon-button {
  width: 40px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: var(--text-muted);
}
.note-header > .icon-button:first-child { margin-left: -3px; color: var(--text-muted); }
.note-header svg { width: 20px; height: 20px; stroke-width: 1.6; }
.crumb {
  flex: 1;
  min-width: 0;
  margin: 0 0 0 4px;
  font-size: 15px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crumb .sep { margin: 0 4px; opacity: 0.8; }

/* 戻る・進む。使えるときだけ現れる。場所は常に確保して、パンくずをずらさない */
.history-buttons { display: flex; flex: none; margin-left: 4px; }
.history-buttons .icon-button {
  opacity: 0;
  transform: scale(0.85);
  pointer-events: none;
  transition: opacity 200ms ease, transform 260ms var(--ease-ios);
}
.history-buttons .icon-button.is-available { opacity: 1; transform: none; pointer-events: auto; }
.history-buttons svg { width: 22px; height: 22px; stroke-width: 1.8; }



.note-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: none;
}
.note-scroll::-webkit-scrollbar { display: none; }
.note-body {
  position: relative;
  padding: calc(var(--safe-top) + 72px) 36px calc(var(--safe-bottom) + 80px) 28px;
  transition: padding-bottom 300ms var(--ease-ios);
  font-size: var(--body-size);
  line-height: var(--body-leading);
}
.note-body p { margin: 0 0 var(--body-leading); }

/* ---------- ブロックと編集 ---------- */
.b { position: relative; transition: transform 260ms var(--ease-ios); }
.b.is-swiping { transition: none; }
.b [contenteditable] { outline: none; caret-color: var(--accent-mark); -webkit-user-select: text; user-select: text; }
.b [contenteditable="false"] { -webkit-user-select: none; user-select: none; }
.note-body.is-empty .b-p p:empty::before { content: attr(data-placeholder); color: rgba(232, 236, 240, 0.4); pointer-events: none; }
.b-p p:empty { min-height: var(--body-leading); }

/* 選択の背景（文字の外側 10px まで）と、右端の丸・つまみ */
.b::before {
  content: "";
  position: absolute;
  inset: -6px -30px -6px -10px;
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0);
  transition: background 160ms ease;
  pointer-events: none;
}
.b.is-armed::before { background: rgba(var(--accent-rgb), 0.1); }
.b.is-selected::before { background: rgba(var(--accent-rgb), 0.2); }
.sel-dot, .grip {
  position: absolute;
  right: -27px;
  top: 50%;
  height: 24px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 160ms ease;
  pointer-events: none;
}
.sel-dot::after {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.38);
  transition: background 160ms ease, box-shadow 160ms ease;
}
.phone.is-selecting .sel-dot { opacity: 1; }
.b.is-selected .sel-dot::after { background: var(--accent-mark); box-shadow: none; }
.grip svg { width: 16px; height: 16px; stroke-width: 2; color: rgba(255, 255, 255, 0.35); }
/* つまみは見た目より広くつかめるようにする */
.phone.is-editing .b.is-focused .grip { pointer-events: auto; width: 40px; height: 40px; right: -35px; cursor: grab; touch-action: none; }
.phone.is-block-dragging, .phone.is-block-dragging * { cursor: grabbing !important; }
.phone.is-editing .b.is-focused .grip { opacity: 1; }

/* 右上の Done。編集中・選択中は戻る・進むの代わりに出る */
.done-button {
  display: none;
  flex: none;
  width: 36px;
  height: 36px;
  margin-left: 8px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 4px 14px var(--accent-glow);
}
.done-button svg { width: 20px; height: 20px; stroke-width: 2.6; }
.phone.is-editing .done-button, .phone.is-selecting .done-button { display: grid; animation: pop-in 220ms var(--ease-ios); }
.phone.is-editing .history-buttons, .phone.is-selecting .history-buttons { display: none; }
@keyframes pop-in { from { transform: scale(0.6); opacity: 0; } }

/* キーボードの上のツールバー（Craft の並びから / ・コピー・キーボードを隠す だけを残す） */
.kb-toolbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 22px;
  background: rgba(30, 31, 34, 0.94);
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.07);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 300ms var(--ease-ios), visibility 0s 300ms;
}
.phone.is-editing .kb-toolbar { transform: translateY(calc(-1 * var(--kb))); visibility: visible; transition: transform 300ms var(--ease-ios); }
.kb-toolbar button { width: 48px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: rgba(255, 255, 255, 0.78); }
.kb-toolbar button:active { background: rgba(255, 255, 255, 0.08); }
.kb-toolbar svg { width: 22px; height: 22px; stroke-width: 1.8; }
.kb-gap { flex: 1; }
.phone.is-editing .note-body { padding-bottom: calc(var(--kb) + 48px + 120px); }

/* 展示用のキーボード（端末では出さない） */
.fake-kb {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9;
  height: 336px;
  padding: 0 3px 30px;
  border-radius: 34px 34px 0 0;
  background: #1f1f21;
  color: #fff;
  transform: translateY(100%);
  transition: transform 300ms var(--ease-ios);
  font-family: var(--font);
}
.phone.is-editing .fake-kb { transform: none; }
.phone.is-task-composing .fake-kb { z-index: 46; transform: none; }
.kb-suggest { height: 45px; display: flex; align-items: center; justify-content: space-around; font-size: 17px; color: rgba(255, 255, 255, 0.85); }
.kb-row { display: flex; justify-content: center; gap: 6px; padding: 0 3px; margin-bottom: 11px; }
.kb-key { flex: 0 0 32px; height: 42px; display: grid; place-items: center; border-radius: 8px; background: #4a4a4d; font-size: 22px; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4); }
.kb-key.fn { flex-basis: 44px; background: #333336; font-size: 16px; }
.kb-key.space { flex: 1; background: #4a4a4d; font-size: 15px; }
.kb-key.ret { flex-basis: 88px; font-size: 15px; }

/* 選択中の下部アクションバー（アイコン + ラベル、横スクロール、Delete は右端に固定） */
.action-bar {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: var(--safe-bottom);
  z-index: 8;
  height: 79px;
  display: flex;
  border-radius: 28px;
  background: rgba(46, 47, 51, 0.9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 32px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  transform: translateY(calc(100% + var(--safe-bottom) + 10px));
  transition: transform 320ms var(--ease-ios);
  overflow: hidden;
}
.phone.is-selecting .action-bar { transform: none; }
.action-scroll { flex: 1; display: flex; overflow-x: auto; scrollbar-width: none; padding-left: 6px; touch-action: pan-x; }
.action-scroll::-webkit-scrollbar { display: none; }
.action-bar button {
  flex: none;
  width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--c, #f1f2f3);
}
.action-bar svg { width: 26px; height: 26px; stroke-width: 1.7; }
.action-bar span { font-size: 11.5px; color: rgba(241, 242, 243, 0.8); white-space: nowrap; }
.action-bar button:active { opacity: 0.6; }
.action-delete { width: 72px !important; border-left: 1px solid rgba(255, 255, 255, 0.08); background: rgba(255, 255, 255, 0.04); color: #ff6b6b !important; }
.action-delete span { color: #ff8b8b; }

/* 並べ替え中: 元の場所は薄く、文字の影が指につき、落とす位置に青い線 */
.b.is-dragging { opacity: 0.35; }
.drag-ghost {
  position: absolute;
  z-index: 30;
  height: var(--body-leading);
  font-size: var(--body-size);
  line-height: var(--body-leading);
  color: rgba(232, 236, 240, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.drop-line {
  position: absolute;
  z-index: 29;
  height: 2px;
  border-radius: 1px;
  background: var(--accent-mark);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.6);
  pointer-events: none;
  transition: top 90ms ease-out, opacity 120ms ease;
}
.drop-line.is-hidden { opacity: 0; }

/* アクションバー: 1つ選択と複数選択で出し分ける */
.action-bar[data-count="single"] [data-when="multi"],
.action-bar[data-count="multi"] [data-when="single"] { display: none; }

/* ---------- 引用 ---------- */
/* ごく薄い面に引用符。本文は明朝体、出典は右寄せ */
:root { --serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", ui-serif, serif; }
.quote {
  position: relative;
  margin: 40px 0;
  padding: 50px 20px 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.quote-mark { position: absolute; top: 18px; left: 20px; width: 20px; height: 20px; stroke-width: 1.6; color: rgba(232, 236, 240, 0.34); }
.quote blockquote {
  margin: 0;
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 30px;
  letter-spacing: 0.03em;
  font-feature-settings: "palt";
  color: #eef0f1;
}
.quote p { margin: 0; }
.quote figcaption { margin-top: 16px; text-align: right; font-size: 12.5px; color: rgba(232, 236, 240, 0.45); }
.quote figcaption::before { content: "— "; }
.quote cite { font-style: normal; }

/* Daily の末尾: その日に作成・編集したノート。本文の続きとして置き、色はグレー */
.day-footer { margin-top: 64px; color: rgba(232, 236, 240, 0.5); }
.day-footer h2 { margin: 0 0 6px; font-size: 13px; font-weight: 500; letter-spacing: 0.02em; color: rgba(232, 236, 240, 0.42); }
.day-footer ul { list-style: none; margin: 0; padding: 0; }
.day-footer button {
  display: flex;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 8px 0;
  text-align: left;
  font-size: 15px;
  line-height: 22px;
  color: rgba(232, 236, 240, 0.55);
}
.day-footer .day-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-footer .day-meta { flex: none; font-size: 13px; color: rgba(232, 236, 240, 0.36); font-variant-numeric: tabular-nums; }
.day-footer button:active .day-title { color: rgba(232, 236, 240, 0.8); }

.callout {
  margin: 40px 0 20px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--callout-bg);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.callout + .callout { margin-top: 20px; }
.callout-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--callout-ink);
}
.callout-title svg { width: 18px; height: 18px; stroke-width: 2; }
.callout p { margin: 0; color: #f1f2f3; }
.callout.warning { --callout-bg: rgba(104, 78, 52, 0.3); --callout-ink: #e3ba90; }
.callout.tip { --callout-bg: rgba(58, 82, 54, 0.3); --callout-ink: #b5d0a1; }
.callout.note { --callout-bg: rgba(54, 72, 100, 0.3); --callout-ink: #a9c3ea; }

.code {
  position: relative;
  margin: 40px 0 24px;
  padding: 56px 14px 26px 13px;
  border-radius: 12px;
  background: rgba(8, 12, 10, 0.2);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.code-lang { position: absolute; top: 14px; right: 16px; font-size: 14px; color: var(--text-muted); }
.code pre {
  margin: 0;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 16px;
  line-height: 29px;
  letter-spacing: 0.04em;
  color: #eceeee;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
}
.code pre::-webkit-scrollbar { display: none; }
.tok-kw { color: #b8a9db; }
.tok-str { color: #c4daa4; }
.tok-com { color: #7d8580; }

/* ---------- サイドバー ---------- */
.drawer {
  position: absolute;
  inset: 0;
  z-index: 20;
  transform: translate3d(calc((var(--p) - 1) * 100%), 0, 0);
  user-select: none;
  -webkit-user-select: none;
}
.phone.is-animating .drawer { transition: transform var(--dur) var(--ease-ios); }

/*
  左から右へ弱まるぼかし。
  1枚目は全体を薄くぼかし、2枚目以降はより強いぼかしを左側だけに重ねる。
  重なった層のぼかしは合成されるので、左端ほど強く、右端ほど弱くなる。
*/
.drawer-blur { position: absolute; inset: 0; pointer-events: none; }
.drawer-blur i {
  position: absolute;
  inset: 0;
  -webkit-backdrop-filter: blur(var(--b));
  backdrop-filter: blur(var(--b));
  -webkit-mask-image: linear-gradient(to right, #000 var(--solid), transparent var(--end));
  mask-image: linear-gradient(to right, #000 var(--solid), transparent var(--end));
}
.drawer-blur i:nth-child(1) { --b: 2px;  --solid: 100%; --end: 100%; }
.drawer-blur i:nth-child(2) { --b: 4px;  --solid: 55%;  --end: 95%; }
.drawer-blur i:nth-child(3) { --b: 8px;  --solid: 40%;  --end: 80%; }
.drawer-blur i:nth-child(4) { --b: 14px; --solid: 25%;  --end: 65%; }
.drawer-blur i:nth-child(5) { --b: 24px; --solid: 10%;  --end: 50%; }
.drawer-blur i:nth-child(6) { --b: 40px; --solid: 0%;   --end: 35%; }
/* 文字を読めるように、ぼかしの上から暗く重ねる。こちらも左ほど濃い */
.drawer-blur::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(10, 11, 12, 0.66) 0%, rgba(10, 11, 12, 0.5) 55%, rgba(10, 11, 12, 0.34) 100%);
}

.drawer-scroll {
  position: relative;
  height: 100%;
  /* ステータスバーの下に潜る部分を消す（ChatGPT の上端 99px の重ね合わせ層に相当） */
  -webkit-mask-image: linear-gradient(to bottom, transparent calc(var(--safe-top) - 14px), #000 calc(var(--safe-top) + 45px));
  mask-image: linear-gradient(to bottom, transparent calc(var(--safe-top) - 14px), #000 calc(var(--safe-top) + 45px));
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: calc(var(--safe-top) + 29px) 0 calc(var(--safe-bottom) + 100px);
  scrollbar-width: none;
}
.drawer-scroll::-webkit-scrollbar { display: none; }
.drawer ul { list-style: none; margin: 0; padding: 0; }

/* 行はセル幅いっぱいだが、ボタンは文字の幅だけ。右側の空きは「何もない部分」 */
/* 欄の間の余白は、表示されている2つ目以降の欄にだけ付ける（Recent や Pinned が無いときも崩れない） */
.section:not([hidden]) ~ .section:not([hidden]) { padding-top: 24px; }
.scroll-spacer { height: 0; }
.section-head {
  height: 48px;
  display: flex;
  align-items: center;
  padding-left: calc(var(--row-inset) + var(--row-pad));
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  color: var(--drawer-text);
}
.note-list li {
  height: 48px;
  display: flex;
  align-items: center;
  /* 階層ごとに 20px ずつ字下げ */
  padding: 0 var(--row-inset) 0 calc(var(--row-inset) + var(--depth, 0) * 20px);
}
/* ノートの行のボタンは文字の幅だけ。右側の空きは「何もない部分」（タップで閉じる） */
.note-row {
  height: 44px;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  padding: 0 var(--row-pad);
  border-radius: 12px;
  font-size: 17px;
  color: var(--drawer-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.note-row span { overflow: hidden; text-overflow: ellipsis; }
/* フォルダの行: 名前の左の余白にシェブロンを置き、名前はノートのタイトルと同じ位置に揃える */
.folder-row { position: relative; }
.folder-row svg {
  position: absolute;
  left: 3px;
  top: 50%;
  width: 13px;
  height: 13px;
  margin-top: -6.5px;
  stroke-width: 2.4;
  color: rgba(255, 255, 255, 0.42);
}
.folder-row[aria-expanded="true"] svg { transform: rotate(90deg); }

/* 並べ替え */
.note-row { -webkit-touch-callout: none; }
.note-list li.is-lifted { position: relative; z-index: 5; }
.note-list li.is-shifting, .note-list li.is-settling { transition: transform 200ms var(--ease-ios); }
.note-list li.is-lifted-head .note-row {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  transform: scale(1.04);
}
.note-list li .note-row { transition: transform 160ms var(--ease-ios), background 160ms ease, box-shadow 160ms ease; }
.phone.is-reordering { cursor: grabbing; }
/* 今開いているノートは太字の白、他のノートは少し暗くする（背景や記号は足さない） */
.note-list .note-row:not(.see-all) { color: rgba(255, 255, 255, 0.7); }
.note-list .note-row[aria-current="page"] { color: #fff; font-weight: 600; }
.note-row.see-all { color: var(--drawer-muted); }
.nav-row:active, .note-row:active { background: rgba(255, 255, 255, 0.08); }

/* 下部の浮動操作 */
.drawer-actions {
  position: absolute;
  left: 34px;
  right: 36px;
  bottom: calc(var(--safe-bottom));
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.drawer-actions > * { pointer-events: auto; }
.new-button {
  height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 22px 0 18px;
  border-radius: 24px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 19px;
  font-weight: 600;
  box-shadow: 0 6px 20px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.new-button svg { width: 22px; height: 22px; stroke-width: 2.1; }
.capsule {
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 4px;
  border-radius: 24px;
  background: rgba(34, 35, 38, 0.92);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 6px 20px rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.capsule button { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 24px; }
.capsule svg { width: 24px; height: 24px; stroke-width: 2; }

/* ---------- トースト ---------- */
.toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 72px);
  z-index: 60;
  margin: 0;
  padding: 10px 16px;
  border-radius: 20px;
  background: rgba(40, 41, 44, 0.95);
  font-size: 14px;
  color: #eee;
  white-space: nowrap;
  transform: translate(-50%, 8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  :root { --dur: 1ms; }
}

/* 実機（幅 500px 以下）では端末いっぱいに表示 */
@media (max-width: 500px) {
  .stage { padding: 0; display: block; }
  .phone {
    --safe-top: max(env(safe-area-inset-top), 20px);
    --safe-bottom: env(safe-area-inset-bottom);
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
  .status-bar, .notes, .fake-kb { display: none; }
}
