/* 操作マニュアル（HTML 版）のページと画面イメージの見た目。
   画面イメージの中身（ボタン・表・カードなど）は、エディタ本体と同じ CSS をそのまま使う。
   ここでは (1) 本文の読みやすさ (2) 画面イメージの枠・カーソル・囲み枠・再生ボタン
   (3) 画面いっぱいを前提にしたエディタの CSS を、図の枠の中に収めるための上書き だけを持つ。 */

/* ---- ページ全体（app.css はエディタ用に画面固定・スクロールなしにしているので戻す） ---- */
html, body { height: auto; }
body {
  display: block;
  overflow: auto;
  background: var(--bgColor-default);
}
.gd-doc#ed2-app,
.gd-doc#g-app { display: block; }

.gd-doc {
  max-width: 860px;
  margin: 0 auto;
  padding: 8px 16px 64px;
  font-size: 15px;
  line-height: 1.85;
  color: var(--fgColor-default);
}

/* 本文の見出し・段落など。画面イメージの中（.gd-stage）には効かせない */
.gd-doc :is(h1, h2, h3, h4):not(.gd-stage *) {
  line-height: 1.4;
  margin: 1.8em 0 0.6em;
}
.gd-doc h1:not(.gd-stage *) { font-size: 1.6rem; margin-top: 1em; }
.gd-doc h2:not(.gd-stage *) {
  font-size: 1.35rem;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--borderColor-muted);
}
.gd-doc h3:not(.gd-stage *) { font-size: 1.1rem; }
.gd-doc h4:not(.gd-stage *) { font-size: 1rem; }
.gd-doc p:not(.gd-stage *) { margin: 0.6em 0; }
.gd-doc :is(ul, ol):not(.gd-stage *) { margin: 0.5em 0; padding-left: 1.6em; }
.gd-doc li:not(.gd-stage *) { margin: 0.25em 0; }
.gd-doc li:not(.gd-stage *) > :is(ul, ol) { margin: 0.2em 0; }
.gd-doc hr:not(.gd-stage *) {
  border: none;
  border-top: 1px solid var(--borderColor-default);
  margin: 2.5em 0;
}
.gd-doc a:not(.gd-stage *) { color: var(--fgColor-accent); }
.gd-doc code:not(.gd-stage *) {
  font-family: var(--fontStack-monospace);
  font-size: 0.88em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--bgColor-muted);
}
/* まだ HTML 版にしていない章へのリンク（GitHub の md へ飛ぶ） */
.gd-doc a.gd-pending-link::after {
  content: '↗';
  font-size: 0.8em;
  margin-left: 0.15em;
}

/* GitHub の [!NOTE] などと同じ形の囲み */
.gd-callout {
  margin: 1em 0;
  padding: 0.5em 1em;
  border-left: 4px solid var(--borderColor-accent-emphasis);
  color: var(--fgColor-default);
}
.gd-callout__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--fgColor-accent);
  margin: 0.2em 0 0.3em !important;
}
.gd-callout--warning,
.gd-callout--caution { border-left-color: var(--borderColor-attention-emphasis); }
.gd-callout--warning .gd-callout__title,
.gd-callout--caution .gd-callout__title { color: var(--fgColor-attention); }

/* ---- 画面イメージ ---- */
.gd-figure {
  margin: 1.4em 0 1.8em;
}
.gd-frame {
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--borderColor-default);
  border-radius: 8px;
  background: var(--bgColor-default);
  box-shadow: 0 1px 3px rgba(31, 35, 40, 0.08), 0 6px 18px rgba(31, 35, 40, 0.06);
}
.gd-scaler {
  position: relative;
  transform-origin: 0 0;
  overflow: hidden;
}
.gd-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  /* 本文の文字設定を持ち込まず、エディタの body と同じにする */
  font: var(--text-body-shorthand-medium);
  color: var(--fgColor-default);
  background: var(--bgColor-default);
  transition: opacity 0.3s;
  /* 画面イメージの中の z-index（ダイアログ・ポップアップなど）を図の中に閉じ込め、
     カーソル・波紋・囲み枠・キー表示がいつもその上に重なるようにする */
  isolation: isolate;
  z-index: 0;
}
.gd-stage.is-fading { opacity: 0; }
/* 手順の show / hide は hidden 属性で切り替える（display を直接書いた要素にも効かせる） */
.gd-stage [hidden] { display: none !important; }
.gd-figure figcaption {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--fgColor-muted);
  text-align: center;
}

/* 押された見た目・入力中の見た目（本物の :active / :focus の代わり） */
.gd-pressed { filter: brightness(0.88); transform: scale(0.97); }
.gd-focus { outline: 2px solid var(--rewis-blue) !important; outline-offset: -1px; }

.gd-cursor {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 30;
  pointer-events: none;
  transition: transform 0.65s cubic-bezier(0.45, 0, 0.2, 1);
}
.gd-cursor svg {
  display: block;
  margin: -2px 0 0 -5px; /* 矢印の先端を座標に合わせる */
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
  transform-origin: 5px 2px;
  transition: transform 0.12s;
}
.gd-cursor.is-pressing svg { transform: scale(0.82); }

.gd-ripple {
  position: absolute;
  z-index: 29;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  border: 3px solid var(--rewis-blue);
  pointer-events: none;
  animation: gd-ripple 0.6s ease-out forwards;
}
@keyframes gd-ripple {
  from { transform: scale(0.2); opacity: 0.9; }
  to { transform: scale(1); opacity: 0; }
}

.gd-spot {
  position: absolute;
  z-index: 25;
  border: 2px solid var(--rewis-orange);
  border-radius: 8px;
  box-shadow: 0 0 0 4px rgba(230, 126, 34, 0.18);
  pointer-events: none;
  transition: left 0.35s, top 0.35s, width 0.35s, height 0.35s;
}
.gd-spot.has-label::after {
  content: attr(data-label);
  position: absolute;
  left: -2px;
  bottom: calc(100% + 4px);
  padding: 1px 8px;
  border-radius: 4px;
  background: var(--rewis-orange);
  color: #fff;
  font: 600 12px/1.6 var(--fontStack-sansSerif);
  white-space: nowrap;
}
.gd-spot.has-label.is-label-below::after { bottom: auto; top: calc(100% + 4px); }

.gd-controls {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 40;
  display: flex;
  gap: 4px;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.gd-frame:hover .gd-controls,
.gd-figure.is-paused .gd-controls,
.gd-controls:focus-within { opacity: 1; }
.gd-control {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--borderColor-default);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--fgColor-default);
  cursor: pointer;
}
.gd-control:hover { background: #fff; color: var(--fgColor-accent); }
.gd-control:focus-visible { outline: 2px solid var(--rewis-blue); outline-offset: 1px; }

/* 押したキー（Esc・Ctrl+Z・Shift など）を画面の下に出す */
.gd-keycap {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 35;
  transform: translateX(-50%);
  padding: 3px 12px;
  border: 1px solid #8c959f;
  border-bottom-width: 3px;
  border-radius: 6px;
  background: #fff;
  color: var(--fgColor-default);
  font: 600 13px/1.5 var(--fontStack-sansSerif);
  box-shadow: 0 2px 6px rgba(31, 35, 40, 0.15);
  pointer-events: none;
  transition: transform 0.1s;
}
.gd-keycap.is-pressed { transform: translateX(-50%) translateY(2px); border-bottom-width: 1px; }

/* ホイールを回しているときのカーソル（上下の矢印を添える） */
.gd-cursor.is-wheel::after {
  content: '↕';
  position: absolute;
  left: 16px;
  top: 14px;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--rewis-blue);
  color: #fff;
  font: 700 12px/1.4 var(--fontStack-sansSerif);
}

/* ---- 画面いっぱい前提のエディタの部品を、図の枠の中に収める ---- */
.gd-app {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.gd-stage .g-dialog-backdrop,
.gd-stage .g-issues-backdrop { position: absolute; }
.gd-stage .g-issues-drawer { position: absolute; }
.gd-stage .g-overlay.gd-popover { position: absolute; z-index: 20; }
/* 図はいつも PC の幅で描くので、狭い画面向けの縦積みにしない */
.gd-stage .ed2-split { flex-direction: row; }
.gd-stage .ed2-split__form { order: 0; width: 360px; }
/* 図形式の 3 列の画面。図は幅 1100px 未満で描くので、実物の狭い画面と同じ列幅にそろえる */
.gd-stage .g-workspace { grid-template-columns: 200px 1fr 260px; }
/* 操作ガイドの吹き出しと暗くする幕（実物は画面全体に固定） */
.gd-stage .g-guide-backdrop,
.gd-stage .g-guide-balloon { position: absolute; }
/* 図の中ではスクロールバーを出さない（はみ出した部分は枠で切る） */
.gd-stage * { scrollbar-width: none; }
.gd-stage *::-webkit-scrollbar { display: none; }

/* ブラウザのアドレス欄（タブが URL に記録されることを見せる図で使う） */
.gd-browser {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  background: #e9ecef;
  border-bottom: 1px solid var(--borderColor-default);
  color: #57606a;
}
.gd-browser__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
}
.gd-browser__url {
  flex: 1 1 auto;
  height: 24px;
  padding: 0 12px;
  border-radius: 12px;
  background: #fff;
  font: 12px/24px var(--fontStack-sansSerif);
  color: var(--fgColor-default);
  white-space: nowrap;
  overflow: hidden;
}
.gd-browser__url b { font-weight: 600; color: var(--fgColor-accent); }

/* 公開ページの画面イメージ（公開ページの layout.css の代わりに最低限の土台だけ置く） */
.gd-public {
  height: 100%;
  padding: 16px;
  background: var(--color-bg-page);
  font-family: var(--fontStack-sansSerif);
  box-sizing: border-box;
}
:where(.gd-public) :where(*) { margin: 0; padding: 0; box-sizing: border-box; }
.gd-public .surface { width: 250px; }

/* 図の説明に関係ない欄の中身（灰色の帯で「ここにデータが入る」ことだけを示す） */
.gd-ph {
  display: inline-block;
  width: 48px;
  height: 0.8em;
  border-radius: 3px;
  background: var(--bgColor-neutral-muted, #e6e8eb);
  vertical-align: middle;
}

/* ブラウザのダウンロード表示（ファイルに書き出したことを見せる図で使う） */
.gd-download {
  position: absolute;
  right: 16px;
  top: 12px;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--borderColor-default);
  box-shadow: var(--shadow-floating-small);
  font: 13px/1.4 var(--fontStack-sansSerif);
  color: var(--fgColor-default);
}

/* ---- 「LLMに質問する：」（タイトルの下、右寄せ。md の全文をコピー・ダウンロードする） ---- */
.gd-ask {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px 8px;
  margin: -0.2em 0 0.4em;
  line-height: 1.4;
}
.gd-ask__label {
  font-size: 13px;
  color: var(--fgColor-muted);
}
.gd-split {
  position: relative;
  display: inline-flex;
}
.gd-split__main {
  border-start-end-radius: 0;
  border-end-end-radius: 0;
}
.gd-split__toggle {
  margin-left: -1px;
  padding-inline: 6px;
  border-start-start-radius: 0;
  border-end-start-radius: 0;
}
.gd-split__toggle svg { transition: transform 0.15s; }
.gd-split__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.gd-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 30;
  width: max-content;
  max-width: min(320px, calc(100vw - 32px));
  padding: 4px;
  border: 1px solid var(--borderColor-default);
  border-radius: var(--borderRadius-medium);
  background: var(--overlay-bgColor, var(--bgColor-default));
  box-shadow: var(--shadow-floating-small);
}
.gd-menu[hidden] { display: none; }
.gd-menu__item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: var(--borderRadius-small, 4px);
  background: none;
  color: var(--fgColor-default);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
/* 「Markdownとして表示」はリンク（a）なので、本文のリンクの色・下線を打ち消してボタンと同じ見た目にする */
.gd-doc a.gd-menu__item { color: var(--fgColor-default); text-decoration: none; box-sizing: border-box; }
.gd-menu__item svg { flex: none; margin-top: 2px; color: var(--fgColor-muted); }
.gd-menu__item:hover,
.gd-menu__item:focus-visible {
  background: var(--bgColor-neutral-muted, var(--bgColor-muted));
  outline: none;
}
.gd-menu__title {
  display: block;
  font-size: 14px;
  font-weight: 600;
}
.gd-menu__desc {
  display: block;
  font-size: 12px;
  color: var(--fgColor-muted);
}

/* ヘルプマーク：3つの方法の違いを説明するパネル */
.gd-help { position: relative; display: inline-flex; }
.gd-help__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--fgColor-muted);
  cursor: pointer;
}
.gd-help__btn:hover,
.gd-help__btn[aria-expanded="true"] { color: var(--fgColor-accent); }
.gd-help__panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 30;
  box-sizing: border-box;
  width: 360px;
  max-width: calc(100vw - 32px);
  padding: 12px 14px;
  border: 1px solid var(--borderColor-default);
  border-radius: var(--borderRadius-medium);
  background: var(--overlay-bgColor, var(--bgColor-default));
  box-shadow: var(--shadow-floating-small);
  font-size: 13px;
  line-height: 1.6;
  text-align: left;
}
.gd-help__panel[hidden] { display: none; }
.gd-help__title { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.gd-help__list { margin: 0; }
.gd-help__list dt { margin-top: 8px; font-weight: 600; }
.gd-help__list dt:first-child { margin-top: 0; }
.gd-help__list dd { margin: 0; color: var(--fgColor-muted); }

/* ==== ページの骨組み：固定ヘッダー・左の目次・本文（src/guide/nav.js と組で動く） ==== */
:root {
  --gd-header-h: var(--header-height);
  --gd-sidebar-w: 264px;
}
/* 見出しへ移ったとき、固定ヘッダーの下に隠れないようにする */
html { scroll-padding-top: calc(var(--gd-header-h) + 16px); }
/* 目次・検索・本文中のリンクで移るときはなめらかにスクロールする（動きを減らす設定の人には、すぐに移る） */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.gd-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  justify-content: flex-start;
  gap: 12px;
  padding-inline: 12px 16px;
}
/* ロゴは REWIS ホームへ、「| 操作マニュアル」はページの先頭へ */
.gd-header__brand { flex: none; }
.gd-header__home { flex: none; color: #fff; text-decoration: none; }
.gd-header__toc { display: none; flex: none; }
.gd-header__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.gd-header__editor { text-decoration: none; }

/* 表形式／図形式の切り替え */
.gd-switch {
  display: inline-flex;
  flex: none;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}
.gd-switch a {
  padding: 2px 12px;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.7;
  text-decoration: none;
}
.gd-switch a:hover { background: rgba(255, 255, 255, 0.18); }
.gd-switch a[aria-current="page"] { background: #fff; color: var(--rewis-blue); }
.gd-switch--sidebar { display: none; margin: 0 0 16px 4px; background: var(--bgColor-muted); }
.gd-switch--sidebar a { color: var(--fgColor-default); }
.gd-switch--sidebar a:hover { background: var(--bgColor-neutral-muted); }
.gd-switch--sidebar a[aria-current="page"] { background: var(--rewis-blue); color: #fff; }

/* 検索 */
/* 検索は、表形式／図形式の切り替えと「エディタを開く」のちょうど中間に置く（左右の余白を同じだけ広げる） */
.gd-search { position: relative; flex: 0 1 420px; min-width: 180px; margin-inline: auto; }
.gd-search__open { display: none; }
.gd-search__box {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 6px 0 10px;
  border-radius: var(--borderRadius-medium);
  background: #fff;
  color: var(--fgColor-muted);
}
.gd-search__box:focus-within { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5); }
.gd-search__input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: none;
  color: var(--fgColor-default);
  font: inherit;
  font-size: 14px;
}
.gd-search__key {
  padding: 0 6px;
  border: 1px solid var(--borderColor-default);
  border-radius: 4px;
  font: 11px/1.6 var(--fontStack-monospace);
  color: var(--fgColor-muted);
}
.gd-search__box:focus-within .gd-search__key { display: none; }
.gd-search__close { display: none; }
/* ヘッダーの白文字ボタンの指定が効くと、白い入力欄の上で × が見えなくなる */
.g-header .gd-search__close { color: var(--fgColor-muted); }
.g-header .gd-search__close:hover:not(:disabled) { background: var(--bgColor-neutral-muted, var(--bgColor-muted)); }
.gd-search__results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 1;
  width: min(520px, calc(100vw - 24px));
  max-height: min(70vh, 560px);
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--borderColor-default);
  border-radius: var(--borderRadius-medium);
  background: var(--bgColor-default);
  color: var(--fgColor-default);
  box-shadow: var(--shadow-floating-medium);
}
.gd-search__results[hidden] { display: none; }
.gd-search__count,
.gd-search__empty {
  margin: 0;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--fgColor-muted);
}
.gd-search__item {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  line-height: 1.55;
  cursor: pointer;
}
.gd-search__item:hover,
.gd-search__item[aria-selected="true"] { background: var(--bgColor-accent-muted); }
.gd-search__where {
  display: block;
  font-size: 11.5px;
  color: var(--fgColor-muted);
}
.gd-search__text { display: block; font-size: 13.5px; }
.gd-search__item.is-heading .gd-search__text { font-weight: 600; }
.gd-search__item mark {
  padding: 0 1px;
  border-radius: 2px;
  background: var(--bgColor-attention-muted);
  color: inherit;
}

/* 左の目次と本文を横に並べる */
/* 目次は画面の左端に置き、本文は残りの幅の中で中央に置く（.gd-doc の max-width と margin: auto） */
.gd-layout {
  display: flex;
  align-items: flex-start;
}
.gd-layout > .gd-doc { flex: 1; min-width: 0; padding-inline: 32px; }
.gd-sidebar {
  position: sticky;
  top: var(--gd-header-h);
  flex: none;
  width: var(--gd-sidebar-w);
  height: calc(100vh - var(--gd-header-h));
  border-right: 1px solid var(--borderColor-muted);
  background: var(--bgColor-default);
}
.gd-sidebar__inner {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 12px 48px 16px;
}
.gd-sidebar__title {
  margin: 0 0 6px;
  padding-left: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--fgColor-muted);
}
.gd-toc,
.gd-toc__sections { list-style: none; margin: 0; padding: 0; }
.gd-toc__link {
  display: block;
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--fgColor-default);
  font-size: 13px;
  line-height: 1.45;
  text-decoration: none;
}
.gd-toc__link:hover { background: var(--bgColor-muted); }
.gd-toc__link:focus-visible { outline: 2px solid var(--rewis-blue); outline-offset: -2px; }
.gd-toc__link--chapter { margin-top: 2px; font-size: 14px; font-weight: 600; }
.gd-toc__sections {
  display: none;
  margin: 2px 0 8px 12px;
  padding-left: 6px;
  border-left: 1px solid var(--borderColor-muted);
}
.gd-toc__chapter.is-open > .gd-toc__sections { display: block; }
.gd-toc__link.is-active {
  background: var(--bgColor-accent-muted);
  color: var(--fgColor-accent);
  font-weight: 600;
}
.gd-backdrop[hidden] { display: none; }

/* タイトル下の入口（初めての方／困ったとき） */
.gd-entry {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 16px 0 8px;
}
.gd-entry__col {
  padding: 12px 16px;
  border: 1px solid var(--borderColor-default);
  border-radius: var(--borderRadius-large);
  background: var(--bgColor-muted);
}
.gd-entry__title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 !important;
  font-size: 15px;
  font-weight: 600;
}
.gd-entry__title svg { color: var(--fgColor-accent); }
.gd-entry__desc { margin: 2px 0 6px !important; font-size: 13px; color: var(--fgColor-muted); }
.gd-doc .gd-entry__list { margin: 0; padding-left: 1.4em; font-size: 14px; }

/* 章の終わりの「次の章」 */
.gd-doc a.gd-next {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2.5em 0 0;
  padding: 12px 16px;
  border: 1px solid var(--borderColor-default);
  border-radius: var(--borderRadius-large);
  color: var(--fgColor-default);
  text-decoration: none;
}
.gd-doc a.gd-next:hover { border-color: var(--borderColor-accent-emphasis); background: var(--bgColor-accent-muted); }
.gd-next__label { flex: none; font-size: 12px; color: var(--fgColor-muted); }
.gd-next__title { flex: 1; font-weight: 600; color: var(--fgColor-accent); }
.gd-next svg { flex: none; color: var(--fgColor-accent); }

/* 見出しのリンクアイコン（押すとその見出しの URL をコピー） */
.gd-doc a.gd-anchor {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 0.35em;
  padding: 0 0.2em;
  color: var(--fgColor-muted);
  font-weight: 400;
  text-decoration: none;
  opacity: 0;
}
.gd-doc :is(h2, h3, h4):hover > a.gd-anchor,
.gd-doc a.gd-anchor:focus-visible { opacity: 1; }
@media (hover: none) { .gd-doc a.gd-anchor { opacity: 0.45; } }

/* 検索や見出しのリンクで移った場所を少しの間だけ光らせる */
.gd-flash { border-radius: 4px; animation: gd-flash 1.8s ease-out; }
@keyframes gd-flash {
  0%, 35% { background: var(--bgColor-attention-muted); box-shadow: 0 0 0 6px var(--bgColor-attention-muted); }
  100% { background: transparent; box-shadow: 0 0 0 6px transparent; }
}
@media (prefers-reduced-motion: reduce) { .gd-flash { animation-duration: 0.01s; } }

/* 画面下の短い知らせ */
.gd-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1100;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: var(--borderRadius-large);
  background: var(--bgColor-emphasis);
  color: var(--fgColor-onEmphasis);
  font-size: 13px;
  box-shadow: var(--shadow-floating-medium);
}
.gd-toast[hidden] { display: none; }

/* 右下の「↑」：ページの先頭へ戻る（目次の引き出しより下に重ねる） */
.gd-totop {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 990;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: var(--shadow-floating-medium);
}
.gd-totop svg { width: 20px; height: 20px; }
.gd-totop[hidden] { display: none; }
@media (max-width: 767px) {
  .gd-totop { right: 16px; bottom: 16px; }
}
@media print { .gd-totop { display: none; } }

/* ---- 幅に合わせた切り替え ---- */
/* エディタと左右に並べたときなど：目次は引き出しにする */
@media (max-width: 1099px) {
  .gd-header__toc { display: inline-flex; }
  /* 検索欄の幅を取るため「| 操作マニュアル」は省く */
  .gd-header__home { display: none; }
  .gd-layout > .gd-doc { padding-inline: 16px; }
  .gd-sidebar {
    position: fixed;
    top: var(--gd-header-h);
    bottom: 0;
    left: 0;
    z-index: 999;
    width: min(300px, 86vw);
    height: auto;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.2s ease, visibility 0.2s;
  }
  .gd-toc-open .gd-sidebar {
    transform: none;
    visibility: visible;
    box-shadow: var(--shadow-floating-large);
  }
  .gd-backdrop {
    position: fixed;
    inset: var(--gd-header-h) 0 0 0;
    z-index: 998;
    background: rgba(0, 0, 0, 0.3);
  }
}
@media (max-width: 959px) {
  .gd-header__editor { padding-inline: 8px; }
  .gd-header__editor span { display: none; }
}
/* スマホ幅：切り替えは目次の中へ、検索は虫眼鏡だけにする */
@media (max-width: 767px) {
  .gd-header { gap: 4px; padding-inline: 4px 8px; }
  .gd-header__home { display: none; }
  .gd-switch--header { display: none; }
  .gd-switch--sidebar { display: inline-flex; }
  /* スマホ幅では虫眼鏡を右側（「エディタを開く」の隣）に置く */
  .gd-search { flex: none; min-width: 0; position: static; margin-inline: auto 0; }
  .gd-search__box { display: none; }
  .gd-search__open { display: inline-flex; }
  .gd-searching .gd-search {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    padding: 0 8px;
    background: var(--rewis-blue);
  }
  .gd-searching .gd-search__box { display: flex; flex: 1; }
  .gd-searching .gd-search__open { display: none; }
  .gd-searching .gd-search__close { display: inline-flex; }
  .gd-search__results {
    position: fixed;
    top: var(--gd-header-h);
    left: 8px;
    right: 8px;
    width: auto;
    max-height: calc(100vh - var(--gd-header-h) - 16px);
  }
}
