:root {
  --brand: #E02000;
  --brand-d: #B31A00;
  --brand-l: #FDECEA;
  --ink: #1f2430;
  --sub: #6b7280;
  --line: #e6e8ec;
  --bg: #f5f6f8;
  --nav: #fafafa;
  --nav-ink: #33363c;
  --dark: #2a2f3a;
  --ok: #1B7A1B;
}

* { box-sizing: border-box; }

/* [hidden]属性は通常display:noneになるが、`.nav-item { display: block; }` のように
   同じ要素にdisplayを指定するクラスと組み合わさると、そちらが優先されてhidden属性が
   効かなくなることがある（CSSの既知の落とし穴）。常にhidden属性を最優先させる。 */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Meiryo", "Yu Gothic", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

button, select, input, textarea { font-family: inherit; }

/* ---------- ログイン ---------- */
#login:not([hidden]) {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #fff;
  z-index: 40;
}

.login-card {
  width: min(380px, 92vw);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 36px 34px;
  box-shadow: 0 4px 20px rgba(20,20,30,.08);
}
.login-mark { display: block; max-width: 190px; max-height: 56px; height: auto; margin: 0 auto 8px; }
.login-mark-fallback { font-weight: 800; font-size: 18px; text-align: center; margin: 0 auto 8px; }
.login-card h1 { font-size: 24px; margin: 6px 0 2px; text-align: center; color: var(--ink); }
.login-sub { color: var(--sub); font-size: 13px; text-align: center; margin: 0 0 6px; }
.login-note { font-size: 11px; color: var(--sub); margin-top: 14px; text-align: center; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--sub); margin-bottom: 6px; font-weight: 600; }
.field input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; transition: .15s; }
.field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l); }

.btn { border: 0; background: var(--brand); color: #fff; font-weight: 700; font-size: 15px; padding: 12px 18px; border-radius: 8px; cursor: pointer; transition: .15s; }
.btn:hover { background: var(--brand-d); }
.btn.wide { width: 100%; }

.error { color: #b00020; font-size: 12.5px; margin-top: 8px; }

/* ---------- アプリ全体 ---------- */
#app:not([hidden]) { display: flex; height: 100vh; }

.sidebar {
  width: 224px;
  background: var(--nav);
  color: var(--nav-ink);
  border-right: 1px solid var(--line);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  overflow: hidden;
  white-space: nowrap;
  transition: width .28s cubic-bezier(.4,0,.2,1);
}
#app.collapsed .sidebar { width: 0; }

/* サイドバーの開閉ボタン。position:fixedにして、サイドバーが幅0に折りたたまれても
   （overflow:hiddenで中身がクリップされても）常にクリックできる状態を保つ。
   折りたたみ時はleftをviewport左端に寄せてサイドバーを再度開けるようにする */
.sidebar-collapse-btn {
  position: fixed;
  top: 14px;
  left: 194px;
  z-index: 61;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--sub);
  font-size: 13px;
  cursor: pointer;
  transition: left .28s cubic-bezier(.4,0,.2,1);
}
.sidebar-collapse-btn:hover { border-color: var(--brand); color: var(--brand); }
#app.collapsed .sidebar-collapse-btn { left: 6px; }

.brand { padding: 20px 18px 16px; cursor: pointer; text-align: center; }
.brand:hover { opacity: .8; }
.brand-mark { display: block; max-width: 130px; max-height: 32px; height: auto; margin: 0 auto 8px; }
.brand-title { font-size: 17px; font-weight: 800; color: var(--ink); }
.brand-tag { font-size: 11.5px; color: var(--sub); margin-top: 2px; }
.sidebar-badge { margin: 0 18px 12px; font-size: 10.5px; letter-spacing: .5px; color: var(--sub); background: #eceef0; padding: 4px 9px; display: inline-block; }

.nav-group { font-size: 11px; color: #9aa0aa; padding: 14px 20px 6px; letter-spacing: 1px; }
.nav-item {
  display: block;
  width: 100%;
  background: none;
  border: 0;
  color: var(--nav-ink);
  padding: 10px 20px;
  font-size: 13.5px;
  text-align: left;
  border-left: 3px solid transparent;
  cursor: pointer;
}
.nav-item:hover { background: rgba(0,0,0,.045); }
.nav-item.active { background: var(--brand-l); color: var(--brand-d); border-left-color: var(--brand); font-weight: 700; }
.nav-spacer { flex: 1; }

/* サイドバー各項目・通知ベルの線画アイコン（No.228、モックアップ準拠） */
.nav-icon { width: 16px; height: 16px; margin-right: 10px; vertical-align: -3px; flex-shrink: 0; }
/* ボタン内アイコン（.nav-iconと違い、ボタン側のflex+gapで間隔を取るため独自マージンは持たない） */
.btn-icon { width: 15px; height: 15px; flex-shrink: 0; }
.hamb svg.nav-icon { width: 17px; height: 17px; margin-right: 0; vertical-align: -3px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.topbar {
  /* min-height（heightではなく）にしておくことで、.crumbが折り返して2行に
     なった場合でもトップバーの高さが自然に伸び、はみ出し・重なりが起きない
     ようにしている（No.28）。.topbar自体はwrapさせない（各要素の折り返しは
     .crumb側で吸収する）ので、幅の狭いスマホ向け分岐（下の@media）とは別物 */
  min-height: 56px;
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 20px;
}
.hamb { border: none; background: transparent; width: 36px; height: 36px; cursor: pointer; display: grid; place-items: center; color: var(--sub); font-size: 15px; border-radius: 8px; }
.hamb:hover { background: var(--brand-l); color: var(--brand); }

.back-btn { border: 1px solid var(--line); background: #fff; height: 36px; padding: 0 14px; border-radius: 8px; cursor: pointer; color: var(--sub); font-size: 13px; font-weight: 700; flex-shrink: 0; }
.back-btn:hover { background: var(--brand-l); color: var(--brand); }

/* ウインドウ幅によってはパンくずが長くなり、右側の検索欄・ユーザー情報を
   押し出してトップバーからはみ出す崩れ方をしていた（No.28）。crumb自体は
   flex-wrap:wrapで複数行に折り返せる作りなので、min-width:0で「縮まずに
   はみ出す」デフォルト挙動を止め、実際に折り返せるようにする */
.crumb { font-size: 13px; color: var(--sub); display: flex; gap: 7px; flex-wrap: wrap; min-width: 0; }
.crumb b { color: var(--brand); cursor: pointer; font-weight: 700; }
.crumb b:hover { text-decoration: underline; }

/* 検索欄は固定200pxのままだと、中程度の狭さで.topbarからはみ出す一因になっていた。
   縮んでも操作できる最小幅は確保しつつ、余裕が無い時は縮められるようにする */
/* input[type="text"].header-search という書き方にしているのは、下の
   `input:not([type=checkbox])`（フォーム共通の入力欄スタイル）の方が詳細度が
   高く、.header-search単体のセレクタだとpaddingが後勝ちで上書きされてしまい、
   検索アイコンと文字が重なる不具合が起きていたため（No.229で発覚・修正） */
input[type="text"].header-search {
  width: 200px; min-width: 90px; flex-shrink: 1; height: 36px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0 14px 0 40px; font-size: 13px; color: var(--ink);
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 14px center;
  transition: border-color .15s, background-color .15s;
}
input[type="text"].header-search:focus { outline: none; border-color: var(--brand); background-color: #fff; }

.user { margin-left: auto; display: flex; align-items: center; gap: 9px; font-size: 13px; flex-shrink: 0; }
.avatar { width: 31px; height: 31px; border-radius: 50%; background: var(--brand-l); color: var(--brand); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.user-role { background: #fff; border: 1px solid var(--brand); color: var(--brand-d); font-size: 11px; font-weight: 700; padding: 4px 10px; white-space: nowrap; }
#userName { white-space: nowrap; }

.content { flex: 1; min-height: 0; padding: 24px 28px; overflow: auto; }

.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 23px; font-weight: 800; letter-spacing: .2px; margin: 0 0 6px; position: relative; padding-left: 15px; }
.page-head h1::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 4px; background: var(--brand); }
.page-head p { color: var(--sub); font-size: 14.5px; margin: 0; line-height: 1.7; }
.page-head p.manual-desc { font-size: 16.5px; color: var(--ink); line-height: 1.8; }

.category-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 22px; overflow-x: auto; }
.category-tab { flex-shrink: 0; background: #fff; border: 1px solid var(--line); color: var(--ink); font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: 999px; cursor: pointer; transition: all .15s; }
.category-tab:hover { border-color: var(--brand); color: var(--brand-d); }
.category-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.tag { display: inline-block; background: var(--brand-l); color: var(--brand-d); font-size: 11px; padding: 2px 8px; font-weight: 700; }
.muted { color: var(--sub); font-size: 12.5px; }
.char-counter { color: var(--sub); font-size: 11.5px; text-align: right; margin-top: 3px; }

/* ---------- カード群（カテゴリ一覧等） ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; cursor: pointer;
  box-shadow: 0 1px 3px rgba(20, 20, 30, .05);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: 0 4px 14px rgba(20, 20, 30, .1); }
.card-top { height: 6px; background: var(--brand); }
.card-body { padding: 15px 17px; }
.card-body h3 { margin: 0 0 7px; font-size: 18.5px; font-weight: 800; letter-spacing: .2px; line-height: 1.3; }
.card-body .meta { color: var(--sub); font-size: 12px; display: flex; gap: 9px; }
.code-tag { display: inline-block; font-family: "Consolas", "SFMono-Regular", Menlo, monospace; font-size: 10.5px; color: var(--sub); background: #f3f4f6; border: 1px solid var(--line); padding: 2px 8px; margin-bottom: 8px; }

/* ---------- 製品一覧（HOME）：横並びの行カード ---------- */
/* 契約製品数が少ない運用（5製品前後）を想定し、縦積みのグリッドカードより
   1件あたりの情報量（ロゴ・製品名・タグライン・視聴率）を見せやすい横並びの
   行カードにした（参考UIモックアップに準拠） */
.product-rows { display: flex; flex-direction: column; gap: 12px; }
.product-row {
  display: flex; align-items: center; gap: 22px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 22px; cursor: pointer;
  box-shadow: 0 1px 3px rgba(20, 20, 30, .05);
  transition: border-color .15s, box-shadow .15s;
}
.product-row:hover { border-color: var(--brand); box-shadow: 0 4px 14px rgba(20, 20, 30, .1); }
.logo-slot {
  width: 140px; height: 82px; flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  padding: 8px 14px;
  overflow: hidden;
  font-family: "Consolas", "SFMono-Regular", Menlo, monospace;
  font-weight: 800;
  color: var(--sub);
  letter-spacing: .5px;
}
.logo-slot img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.product-row-body { flex: 1; min-width: 0; }
.product-row-body h3 { margin: 0 0 5px; font-size: 17px; font-weight: 800; letter-spacing: .2px; line-height: 1.3; }
.product-row-meta { flex-shrink: 0; display: flex; align-items: center; gap: 18px; color: var(--sub); font-size: 12px; white-space: nowrap; }
.product-row-chevron { color: var(--sub); font-size: 18px; font-weight: 700; line-height: 1; }
.product-row:hover .product-row-chevron { color: var(--brand); }
/* 製品カードの視聴率表示（各部署フィードバックNo.20、お客様側の進捗把握） */
.product-progress { margin-top: 8px; max-width: 320px; }
.product-progress-bar { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.product-progress-fill { height: 100%; background: var(--brand); border-radius: 999px; }
.product-progress-label { display: block; margin-top: 4px; font-size: 11px; color: var(--sub); }

/* ---------- HOME：ご利用ガイド・FAQを製品一覧から切り離した「サポート」セクション ---------- */
/* No.228：モックアップに合わせ、製品ではないご利用ガイド・FAQを製品一覧の行カードに
   混在させず、見出し付きの専用セクション（アイコン付きの小さいカード2枚）に分離した */
.section-divider { font-size: 12.5px; font-weight: 700; color: var(--sub); margin: 28px 0 12px; display: flex; align-items: center; gap: 10px; }
.section-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.support-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.support-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 18px; cursor: pointer;
  box-shadow: 0 1px 3px rgba(20, 20, 30, .05);
  transition: border-color .15s, box-shadow .15s;
}
.support-card:hover { border-color: var(--brand); box-shadow: 0 4px 14px rgba(20, 20, 30, .1); }
.support-icon { width: 52px; height: 52px; flex-shrink: 0; border-radius: 8px; background: var(--brand-l); color: var(--brand); display: grid; place-items: center; overflow: hidden; }
.support-icon svg { width: 26px; height: 26px; }
/* 各部署フィードバック：FAQ・ご利用ガイドのアイコンに大きな画像を設定すると
   枠からはみ出ていた不具合の対応（.logo-slot imgと同じ考え方で枠に収める） */
.support-icon img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.support-card-body { flex: 1; min-width: 0; }
.support-card-title { font-weight: 700; font-size: 14px; }
.support-card-count { font-size: 12px; color: var(--sub); }

/* ---------- リスト（コンテンツ一覧） ---------- */
.list { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(20, 20, 30, .05); }
.lhead, .row { padding: 9px 14px; }
.lhead { background: #fafafa; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--sub); font-weight: 700; }
.row { border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13.5px; }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--brand-l); }
.row .rt { font-weight: 600; }
.row .rs { color: var(--sub); font-size: 12px; margin-top: 2px; }
.row .row-path { color: var(--brand-d); font-size: 11px; margin-top: 4px; }
.row .search-hit { color: #444; margin-top: 3px; }
.row .search-hit mark { background: var(--brand-l); color: var(--brand-d); padding: 0 2px; font-weight: 700; }
/* チェックボックス・ドラッグハンドル・削除ボタン付きの行（マイブックマーク、No.30） */
.row-with-controls { display: flex; align-items: center; gap: 10px; }
.row-with-controls .row-text { flex: 1; min-width: 0; }

/* ---------- ビューア（本文表示） ---------- */
/* overflow:hiddenは指定しない——position:stickyの基準がこの要素になってしまい、
   .toc（目次）がページ全体のスクロール（.content側）に対して固定されなくなる */
.viewer-layout { display: grid; grid-template-columns: 210px 1fr; gap: 0; background: #fff; border: 1px solid var(--line); }
.viewer-layout.toc-collapsed { grid-template-columns: 1fr; }
.viewer-layout.toc-collapsed .toc { display: none; }
/* 目次を表示した状態でスクロールしても、目次パネル自体は画面内に留まるようにする
   （依頼者要望：「目次を表示させたときは、スクロールで移動しないでほしい」。
   「目次」ボタン（.viewer-toc-float-btn、top:10px）のすぐ下に来るようtopを合わせてある） */
.toc {
  border-right: 1px solid var(--line);
  background: #fafafa;
  padding: 14px;
  position: sticky;
  top: 58px;
  align-self: start;
  max-height: calc(100vh - 78px);
  overflow-y: auto;
}
.toc a { display: block; padding: 8px 9px; font-size: 13.5px; color: var(--ink); text-decoration: none; margin-bottom: 3px; cursor: pointer; }
.toc a.active, .toc a:hover { background: var(--brand-l); color: var(--brand-d); }

/* 以前は.doc自体が独立してスクロールする作りで、外側の.content（ページ全体）と
   合わせてスクロールバーが2つ並ぶ状態になっていた（各部署フィードバックNo.18の
   恵中コメント「スクロールバーは一つでいい」）。.doc固有のスクロールをやめ、
   ページ全体が1つのスクロール領域になるようにした */
.doc { padding: 20px 26px; }
#stepsContainer { background: var(--bg); margin: 0 -26px; padding: 20px 26px 4px; }
.step { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 20px 24px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(20, 20, 30, .06); }
.step:last-child { margin-bottom: 0; }
.step-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.step-body.no-media { grid-template-columns: 1fr; }
.step-media { min-width: 0; }
.step-text { min-width: 0; max-height: 480px; overflow-y: auto; }
.step-head { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.step-badge { display: inline-flex; align-items: center; background: var(--dark); color: #fff; font-weight: 800; font-size: 11px; letter-spacing: .5px; padding: 6px 14px; }
.step-badge-link { cursor: pointer; }
.step-badge-link:hover { background: var(--brand); }
/* 閲覧画面・全画面表示・保存時プレビュー専用のSTEP番号バッジ（丸型）。
   .step-badgeと重ねて付与する追加クラスで、管理画面のマニュアル編集フォーム
   （.step-edit-head内、常に.step-badge単独）には付けていないため影響しない */
.step-num { min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px; background: var(--brand); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: 0; justify-content: center; }
.step-num.step-badge-link:hover { background: var(--brand-d); }
.step-title { font-size: 15px; font-weight: 800; color: var(--ink); }
.step-comment { font-size: 15px; line-height: 1.9; color: #333; white-space: pre-wrap; margin: 0 0 12px; }

.manual-content-frame { width: 100%; height: 60vh; border: 1px solid var(--line); display: block; }
.manual-content-video { width: 100%; max-height: 60vh; display: block; background: #000; }
.manual-content-image { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #fafafa; border: 1px solid var(--line); display: block; }
.manual-content-image.zoomable { cursor: zoom-in; }

a.rich-link { color: #1a56db; text-decoration: underline; cursor: pointer; }
a.rich-link:hover { color: var(--brand-d); }

/* ---------- 画像拡大モーダル ---------- */
.zoom-modal { position: fixed; inset: 0; background: rgba(10,10,15,.78); display: none; align-items: center; justify-content: center; z-index: 90; padding: 30px; }
.zoom-modal.show { display: flex; }
.zoom-modal-inner { position: relative; width: min(1100px, 92vw); height: 88vh; border-radius: 10px; overflow: hidden; box-shadow: 0 8px 30px rgba(0,0,0,.3); }
/* 画像拡大モーダル（#zoomModal）だけ、内容（画像）を中央寄せ・大きめ表示にする。
   .zoom-modal-innerは他の多数のモーダル（フォーム類）でも共有しているクラスのため、
   ここに直接display:flex等を書くと全部のモーダルのレイアウトが崩れる。 */
#zoomModal .zoom-modal-inner { width: min(2000px, 98vw); height: 97vh; display: flex; align-items: center; justify-content: center; }
.zoom-frame { display: block; margin: 0 auto; max-width: 100%; max-height: 100%; object-fit: contain; background: #000; will-change: transform; }
.zoom-close { position: absolute; top: 10px; right: 10px; z-index: 2; background: #fff; border: 0; padding: 8px 14px; border-radius: 6px; font-size: 13px; font-weight: 700; cursor: pointer; width: auto; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.zoom-toolbar { position: absolute; top: 10px; left: 10px; z-index: 2; display: flex; align-items: center; gap: 10px; background: #fff; padding: 6px 12px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.zoom-toolbar span { font-size: 12.5px; color: var(--sub); min-width: 90px; text-align: center; }
.zoom-zoom-btn { border: 1px solid var(--line); background: #fff; width: 30px; height: 30px; font-size: 16px; font-weight: 700; cursor: pointer; color: var(--ink); }
.zoom-zoom-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.zoom-zoom-btn:disabled { opacity: .35; cursor: default; }
.zoom-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; background: rgba(255,255,255,.92); border: 0; width: 46px; height: 46px; border-radius: 50%; font-size: 22px; font-weight: 700; cursor: pointer; color: var(--ink); box-shadow: 0 1px 6px rgba(0,0,0,.3); }
.zoom-nav-btn:hover:not(:disabled) { background: #fff; color: var(--brand); }
.zoom-nav-btn:disabled { opacity: .3; cursor: default; }
.zoom-prev { left: 14px; }
.zoom-next { right: 14px; }

/* ---------- 全画面フォーカスビューア（スライドショー代替） ---------- */
.focus-viewer { position: fixed; inset: 0; background: var(--dark); display: none; z-index: 92; }
.focus-viewer.show { display: block; }
.focus-hint { position: absolute; right: 16px; top: 12px; font-size: 11px; color: #9AA3B5; letter-spacing: .1em; z-index: 3; }
.focus-snap { position: absolute; inset: 0 0 52px 0; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: thin; }
.focus-slide { min-height: 100%; box-sizing: border-box; scroll-snap-align: start; display: flex; align-items: center; justify-content: center; padding: 20px 20px 16px; }
.focus-slide .step { width: 100%; max-width: min(1600px, 96vw); max-height: calc(100vh - 96px); overflow-y: auto; margin: 0 auto; padding: 28px 32px; }
/* フォーカスビューア内は通常表示より大きく見せる（高さ上限・アスペクト比固定を解除）。
   画像を主役にしつつコメントも読める幅を確保する（既定＝右にコメントの列比率）。
   「下にコメント」表示は画像+コメントが縦に積まれるため、画像を控えめな高さにして
   スクロールなしで両方収まるようにする（media-onlyは逆に画像を最大まで大きくしてよい） */
.focus-viewer .step-body { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.focus-viewer .step-text { max-height: none; font-size: 15px; line-height: 1.9; }
.focus-viewer .step-comment { font-size: 15px; }
.focus-viewer .step-media { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.focus-viewer .manual-content-image { will-change: transform; }
.focus-viewer .manual-content-image { aspect-ratio: auto; width: 100%; max-width: 100%; height: auto; max-height: 68vh; margin: 0 auto; }
.focus-viewer .manual-content-video { width: 100%; max-height: 68vh; margin: 0 auto; }
.focus-viewer.layout-media-only .manual-content-image,
.focus-viewer.layout-media-only .manual-content-video { max-height: 82vh; }
.focus-viewer.layout-stack .manual-content-image,
.focus-viewer.layout-stack .manual-content-video { max-height: 45vh; }
/* 表示形式：画像のみ／右にコメント（既定）／下にコメント（いずれもブラウザ内CSSのみで切替、サーバには送らない） */
.focus-viewer.layout-media-only .step-text { display: none; }
.focus-viewer.layout-media-only .step-body { grid-template-columns: 1fr; }
.focus-viewer.layout-stack .step-body { grid-template-columns: 1fr; }
.focus-bar { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(16,19,26,.95); color: #E8EBF2; display: flex; align-items: center; gap: 12px; padding: 9px 14px; font-size: 11px; border-top: 1px solid #34405A; z-index: 4; }
.focus-brand { font-weight: 800; color: #fff; white-space: nowrap; }
.focus-cnt { font-family: ui-monospace, Consolas, monospace; background: #2E3A52; border-radius: 3px; padding: 2px 9px; white-space: nowrap; }
.focus-chips { display: flex; gap: 4px; overflow-x: auto; max-width: 320px; scrollbar-width: thin; }
.focus-chip { flex-shrink: 0; width: 24px; height: 24px; border-radius: 4px; border: 1px solid #46536E; background: transparent; color: #C9CFDC; font-size: 10.5px; font-weight: 800; cursor: pointer; font-family: inherit; }
.focus-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.focus-toc { background: #2E3A52; color: #DDE2EC; border: 1px solid #46536E; border-radius: 4px; font-size: 10.5px; padding: 3px 6px; max-width: 220px; font-family: inherit; }
.focus-close { border: 1px solid #46536E; border-radius: 4px; background: transparent; color: #C9CFDC; padding: 4px 12px; font-size: 11px; cursor: pointer; white-space: nowrap; }
.focus-close:hover { border-color: var(--brand); color: #fff; }
.focus-keys { margin-left: auto; color: #8B93A5; font-size: 9.5px; text-align: right; white-space: nowrap; }
@media (max-width: 900px) { .focus-keys, .focus-toc { display: none; } }

/* ---------- 管理画面：マニュアル新規登録・編集（専用ページ） ---------- */
/* 左側にSTEPの簡易一覧（並び替え用）、右側に本来の編集フォームを並べる（No.6）。
   一覧はスクロールしても画面内に留まるようsticky指定にし、STEP数が多いマニュアルでも
   一覧自体が長くなりすぎないよう独立してスクロールできるようにする */
.manual-edit-layout { display: flex; align-items: flex-start; gap: 20px; }
.manual-edit-main { flex: 1; min-width: 0; }
.step-outline-panel {
  flex-shrink: 0;
  width: 220px;
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 20, 30, .05);
}
.step-outline-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 8px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.step-outline-row:hover { background: var(--brand-l); }
.step-outline-cover { color: var(--sub); font-weight: 700; cursor: pointer; }
.step-outline-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 右側のSTEPクリップボードパネル（No.221追加要望：左のSTEP一覧からドラッグして
   保存、サムネイル表示）。左のstep-outline-panelと同じsticky構成を右側にも適用 */
.step-clipboard-panel {
  flex-shrink: 0;
  width: 190px;
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 1px 3px rgba(20, 20, 30, .05);
}
.step-clipboard-panel-head { font-weight: 700; font-size: 12.5px; margin-bottom: 4px; }
.step-clipboard-panel-hint { font-size: 11px; color: var(--sub); margin: 0 0 10px; }
/* カードは縦積み（サムネイル＋タイトル＋操作ボタンの行の下に、コピー元パス・
   コメント抜粋を小さく添える）。情報量を増やす依頼（クリップボードの情報が
   少なすぎるとの指摘）に応え、狭いパネル幅でも一目で内容が分かるようにした */
.step-clip-card { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 11.5px; }
.step-clip-card:last-child { border-bottom: 0; }
.step-clip-card-top { display: flex; align-items: center; gap: 6px; }
.step-clip-thumb { width: 32px; height: 32px; object-fit: cover; border: 1px solid var(--line); flex-shrink: 0; background: #fafafa; }
.step-clip-thumb-icon { display: flex; align-items: center; justify-content: center; font-size: 15px; }
.step-clip-card-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-clip-card-actions { display: flex; gap: 2px; flex-shrink: 0; }
.step-clip-add-btn, .step-clip-remove-btn { border: 1px solid var(--line); background: #fff; width: 20px; height: 20px; font-size: 11px; line-height: 1; cursor: pointer; padding: 0; }
.step-clip-add-btn:hover { border-color: var(--brand); color: var(--brand); }
.step-clip-remove-btn:hover { border-color: #c0392b; color: #c0392b; }
.step-clip-card-source { color: var(--sub); font-size: 10.5px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-clip-card-comment {
  color: var(--sub);
  font-size: 10.5px;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* モーダル一覧側のサムネイル（.row-with-controls内、行の左端に置く） */
.row-with-controls .step-clip-thumb { width: 40px; height: 40px; }
.manual-edit-form { max-width: 1100px; }
.manual-edit-card, .step-edit-card { border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; background: #fff; box-shadow: 0 1px 3px rgba(20, 20, 30, .05); }
.manual-edit-card { margin-bottom: 14px; }
.manual-edit-toprow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.manual-edit-toprow label { margin: 0; }
.step-edit-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.step-edit-head .step-badge { margin-right: auto; }
.rm { border: 1px solid var(--line); background: #fff; padding: 5px 10px; border-radius: 6px; font-size: 12px; cursor: pointer; color: var(--sub); width: auto; }
.rm:hover { border-color: var(--brand); color: var(--brand); }

.step-edit-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin: 10px 0; align-items: start; }
.step-desc-col label { margin: 0; }
.step-desc-col textarea { height: 220px; resize: vertical; overflow-y: auto; }

.dropzone {
  border: 2px dashed var(--line);
  border-radius: 8px;
  background: #fafafa;
  padding: 18px 14px;
  text-align: center;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.dropzone.dragover { border-color: var(--brand); background: var(--brand-l); }
.dropzone-icons { font-size: 20px; }
.dropzone-hint { font-size: 12.5px; color: var(--sub); }
.dropzone-filename { font-size: 12px; color: var(--sub); word-break: break-all; margin-top: 4px; }
.dropzone-preview { display: none; width: 100%; }
.dropzone-preview img, .dropzone-preview video { max-width: 100%; max-height: 160px; width: auto; height: auto; display: block; margin: 0 auto; border: 1px solid var(--line); }
.dropzone.has-preview .dropzone-preview { display: block; margin-bottom: 6px; }
.dropzone.has-preview .dropzone-icons, .dropzone.has-preview .dropzone-hint { display: none; }

.step-insert-row { display: flex; justify-content: center; gap: 10px; margin: 10px 0; }
.step-insert-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--sub);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.step-insert-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-l); }

.manual-edit-footer { margin-top: 16px; }

/* ---------- 管理画面：画面キャプチャのトリミング ---------- */
.capture-crop-area { position: relative; display: inline-block; max-width: 100%; user-select: none; touch-action: none; cursor: crosshair; }
.capture-crop-area img { max-width: 100%; display: block; -webkit-user-drag: none; user-drag: none; pointer-events: none; }
.capture-crop-selection { position: absolute; border: 2px dashed var(--brand); background: rgba(224, 32, 0, .15); pointer-events: none; }

/* ---------- 管理画面：画像編集（トリミング・四角・矢印・文字入れ） ---------- */
.dropzone-preview-image-wrap { position: relative; display: inline-block; max-width: 100%; }
.dropzone-preview-image-wrap img { display: block; }
.dropzone-edit-btn { position: absolute; top: 6px; right: 6px; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 11.5px; padding: 4px 10px; cursor: pointer; }
.dropzone-edit-btn:hover { background: rgba(0,0,0,.85); }
.image-edit-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.image-edit-tool.active { background: var(--brand); color: #fff; }
.image-edit-color-swatches { display: inline-flex; align-items: center; gap: 5px; }
.image-edit-color-swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.image-edit-color-swatch.active { box-shadow: 0 0 0 2px var(--brand); }
.image-edit-hint { font-size: 11.5px; color: var(--sub); }
.image-edit-canvas-wrap { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: center; justify-content: center; background: #f4f5f7; border: 1px solid var(--line); }
#imageEditCanvas { max-width: 100%; max-height: 100%; cursor: crosshair; touch-action: none; }

/* ---------- 管理画面：関連マニュアルの選択（製品→カテゴリのドリルダウン） ---------- */
.picker-row { display: flex; align-items: center; gap: 8px; padding: 9px 6px; cursor: pointer; border-bottom: 1px solid var(--line); font-size: 13px; }
.picker-row:hover { background: var(--brand-l); }
.picker-caret { color: var(--sub); width: 14px; flex-shrink: 0; }
.picker-label { flex: 1; font-weight: 600; }
.picker-count { color: var(--sub); font-size: 11.5px; background: #f0f1f3; padding: 2px 8px; border-radius: 999px; }
.picker-category-row { padding-left: 24px; }
.picker-category-row .picker-label { font-weight: 400; }
.picker-category-list { margin-bottom: 4px; }
.picker-manual-list { padding: 4px 0 8px 44px; }
.picker-manual-card { border: 1px solid var(--line); border-radius: 6px; background: #fafafa; padding: 10px 14px; margin-bottom: 6px; cursor: pointer; }
.picker-manual-card:hover { border-color: var(--brand); background: var(--brand-l); }
.picker-manual-title { font-weight: 700; font-size: 13px; }
.picker-manual-sub { color: var(--sub); font-size: 11.5px; margin-top: 2px; }

.step-links-section { margin-top: 10px; }
.step-links-label { font-size: 12.5px; font-weight: 700; color: var(--sub); margin-bottom: 6px; }

/* ---------- 閲覧画面：ヘッダーカード（バッジ・タイトル・サムネイル・概要・
   更新日・アクションボタンを1枚のカードにまとめる。手順119で唯一未対応のまま
   残っていた閲覧画面本体のデザイン刷新） ---------- */
.viewer-head-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 1px 3px rgba(20, 20, 30, .05); padding: 22px 26px; margin-bottom: 16px; }
.viewer-head-card .page-head { margin-bottom: 14px; }
.viewer-head-card .admin-form-buttons { margin-bottom: 14px; }
.viewer-head-card .viewer-actions { margin: 0; }
/* 管理者ボタン行（編集・削除・リンクをコピー等）は、他の管理画面と共有している
   .abtnクラス自体（ブランド色の縁取り）は変えず、このカード内だけアイコン間隔・
   角丸・非強調ボタンの配色をモックアップ寄りに上書きする（他画面のabtnには影響しない） */
.viewer-head-card .abtn { display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; }
.viewer-head-card .abtn:not(.primary) { border-color: var(--line); color: var(--sub); }
.viewer-head-card .abtn:not(.primary):hover { border-color: var(--brand); color: var(--brand-d); background: var(--brand-l); }
.viewer-head-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 6px; }
.viewer-head-grid.no-thumb { grid-template-columns: 1fr; }
.viewer-head-thumb { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); }
.viewer-head-thumb img, .viewer-head-thumb video { display: block; width: 100%; }
@media (max-width: 720px) { .viewer-head-grid { grid-template-columns: 1fr; } }

/* ---------- 閲覧画面：アクションボタン行（コメント・評価・ブックマーク・目次） ---------- */
.viewer-actions { display: flex; gap: 10px; margin: 16px 0 20px; flex-wrap: wrap; }
.viewer-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 0 15px;
  font-size: 12.8px;
  font-weight: 600;
  color: var(--sub);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.viewer-action-btn:hover { border-color: var(--brand); color: var(--brand-d); background: var(--brand-l); }
.viewer-action-btn.on { border-color: #c9971f; color: #c9971f; background: #fdf6e3; }

/* 「目次」ボタンだけは他のアクションボタンの列から外し、スクロールしても
   同じ位置に留まるようにする（各部署フィードバックNo.18の恵中コメント
   「戻るボタンと、目次ボタンだけついてくるようにすればいい」） */
.viewer-toc-float-btn {
  position: sticky;
  top: 10px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  margin-bottom: 12px;
  box-shadow: 0 1px 5px rgba(20, 20, 30, .1);
}
.viewer-toc-float-btn:hover { border-color: var(--brand); color: var(--brand-d); background: var(--brand-l); }

/* ---------- フィードバック（Good/Bad・コメント）：ボタンを押すと開く小さいパネル ---------- */
.reaction-panel { margin-bottom: 14px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px 20px; max-width: 640px; box-shadow: 0 1px 3px rgba(20, 20, 30, .05); }
.feedback-title { font-weight: 700; margin-bottom: 10px; }
.feedback-buttons { display: flex; flex-wrap: wrap; }

.comment-panel { margin-bottom: 14px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px 20px; max-width: 640px; box-shadow: 0 1px 3px rgba(20, 20, 30, .05); }

.gb-btn {
  border: 1px solid var(--line);
  background: #fff;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  margin-right: 8px;
}
.gb-btn.good.on { border-color: var(--ok); color: var(--ok); background: #eef7ee; }
.gb-btn.bad.on { border-color: #b00020; color: #b00020; background: #fdecec; }

.comment-item { padding: 10px 0; border-top: 1px solid #f0f0f0; font-size: 14.5px; white-space: pre-wrap; }
.comment-item:first-child { border-top: 0; }
.comment-meta { color: var(--sub); font-size: 11.5px; margin-bottom: 3px; }

/* ---------- ご意見・ご要望 ---------- */
.badge-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-left: 6px; vertical-align: middle; }

.suggestion-thread { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; max-width: 720px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(20, 20, 30, .05); }
.suggestion-message { padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 10px; font-size: 15px; white-space: pre-wrap; }
.suggestion-message:last-child { margin-bottom: 0; }
.suggestion-message.org { background: #fafafa; }
.suggestion-message.admin { background: var(--brand-l); border-color: var(--brand-l); }
.suggestion-message-meta { color: var(--sub); font-size: 11.5px; margin-bottom: 4px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.suggestion-message-delete { margin-left: auto; border: 0; background: none; color: var(--sub); font-size: 11px; font-weight: 700; cursor: pointer; padding: 0; text-decoration: underline; }
.suggestion-message-delete:hover { color: #c33; }

.suggestion-section-title { font-size: 14px; font-weight: 800; margin: 22px 0 12px; position: relative; padding-left: 14px; }
.suggestion-section-title::before { content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 4px; background: var(--brand); }
.suggestion-card { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 0 8px 8px 0; padding: 16px 18px; max-width: 720px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(20, 20, 30, .05); }
.suggestion-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.suggestion-card-head.suggestion-card-toggle { cursor: pointer; }
.suggestion-org { font-weight: 700; font-size: 13.5px; }
.suggestion-card .suggestion-thread { border: 0; padding: 0; margin-bottom: 12px; }
.suggestion-reply-form { display: flex; gap: 8px; align-items: flex-start; }
.suggestion-reply-text { flex: 1; margin: 0; }
.suggestion-reply-form .abtn { flex-shrink: 0; }

/* ---------- 通知ベル（app_admin） ---------- */
.notif-wrap { position: relative; }
.notif-count-badge { position: absolute; top: -4px; right: -4px; background: var(--brand); color: #fff; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; padding: 0 3px; line-height: 1; }
.notif-panel { display: none; position: absolute; top: 44px; right: 0; width: 340px; max-height: 420px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 4px 16px rgba(20,20,30,.15); z-index: 70; }
.notif-panel.show { display: block; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid #f0f0f0; cursor: pointer; font-size: 13px; line-height: 1.5; }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--brand-l); }
.notif-item .nmeta { color: var(--sub); font-size: 11.5px; margin-bottom: 4px; }
.notif-item.unread { background: #fffaf0; }
.notif-empty { padding: 16px; color: var(--sub); font-size: 12.5px; }

/* ---------- お知らせ配信 ---------- */
.announce-box { margin-top: 20px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px 22px; box-shadow: 0 1px 3px rgba(20, 20, 30, .05); }
.announce-box h4 { margin: 0 0 12px; font-size: 13.5px; color: var(--sub); letter-spacing: .3px; }
.announce-item { padding: 10px 0; border-top: 1px solid #f0f0f0; font-size: 15px; line-height: 1.7; white-space: pre-wrap; }
.announce-item:first-of-type { border-top: 0; }
.announce-date { display: inline-block; color: var(--sub); font-size: 11.5px; background: #f3f4f6; padding: 2px 8px; margin-right: 10px; }

/* ---------- フォーム・管理画面 ---------- */
.form {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  max-width: 720px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(20, 20, 30, .05);
}

label {
  display: block;
  font-size: 13px;
  margin-bottom: 14px;
}

input:not([type=checkbox]), select, textarea {
  display: block;
  width: 100%;
  padding: 8px 10px;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

fieldset.org-products {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px 12px;
  margin-bottom: 14px;
}
fieldset.org-products legend { font-size: 13px; padding: 0 4px; color: var(--sub); }

label.checkbox-label {
  display: inline-flex;
  /* 各部署フィードバック：FAQ・ガイドの設定の説明文が長くチェックボックスのラベルが
     2行に折り返すと、align-items:centerだと1行目にテキストだけ、チェックボックス自体は
     複数行の縦中央（＝見た目上2行目の位置）にずれて見えていた。1行のラベルでは
     center/flex-startの見た目に差が無いため、常に1行目の先頭にそろうflex-startに変更 */
  align-items: flex-start;
  gap: 4px;
  width: auto;
  margin-right: 16px;
  margin-bottom: 6px;
  font-size: 13px;
}
label.checkbox-label input[type="checkbox"] { display: inline; width: auto; margin: 0; }

.admin-form-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

.org-picker-tools { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.org-picker-tools input[type="text"] { flex: 1; min-width: 160px; margin: 0; }
.org-picker-tools select { width: auto; margin: 0; }
#announceOrgsFieldset { max-height: 220px; overflow: auto; }
#announceOrgsFieldset .checkbox-label { display: block; margin-right: 0; }

/* 各部署フィードバック：お知らせ配信の配信先が多いと、巨大な一覧を毎回スクロールして
   チェックするのが大変だったため、検索モーダルで選んだ配信先をここにチップとして
   積み上げる方式に変更 */
.announce-chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; min-height: 20px; }
.announce-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--brand-l); color: var(--brand-d);
  border-radius: 999px; padding: 5px 6px 5px 12px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.announce-chip button {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  border: 0; background: rgba(0, 0, 0, .08); color: inherit;
  font-size: 12px; line-height: 1; cursor: pointer; padding: 0;
  display: grid; place-items: center;
}
.announce-chip button:hover { background: rgba(0, 0, 0, .18); }
.abtn { border: 1px solid var(--brand); color: var(--brand); background: #fff; padding: 9px 15px; border-radius: 6px; font-size: 13px; font-weight: 700; width: auto; cursor: pointer; }
.abtn.primary { background: var(--brand); color: #fff; }
.abtn:hover { opacity: .9; }
.abtn:disabled { opacity: .5; cursor: default; }

.password-box { background: #fffbea; border: 1px solid #f0d78c; border-radius: 8px; padding: 18px 20px; margin-bottom: 24px; }
.password-box .password-value {
  font-family: monospace;
  font-size: 18px;
  font-weight: bold;
  background: #fff;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: inline-block;
  user-select: all;
}
.password-box button { margin-top: 8px; }

/* ---------- マニュアル作成・管理：製品→カテゴリのアコーディオン ---------- */
.tree-group { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; box-shadow: 0 1px 3px rgba(20, 20, 30, .05); }
.tree-header { display: flex; align-items: center; gap: 10px; padding: 9px 14px; cursor: pointer; font-weight: 700; background: var(--dark); color: #fff; }
.tree-header:hover { opacity: .92; }
.tree-caret { width: 14px; }
.tree-title { flex: 1; }
.tree-count { font-size: 12px; font-weight: 400; opacity: .85; }
.tree-body { padding: 12px 14px; }
.tree-subgroup { margin-bottom: 12px; }
.tree-subgroup:last-child { margin-bottom: 0; }
.tree-subheader { display: flex; align-items: center; gap: 10px; padding: 7px 11px; cursor: pointer; font-weight: 700; font-size: 13px; background: var(--brand-l); color: var(--brand-d); margin-bottom: 8px; }
.tree-subheader:hover { background: #fbdcd6; }
.tree-subgroup table.admin-table { margin-bottom: 0; }
.tree-subsubgroup { margin: 0 0 10px 14px; }
.tree-subsubgroup:last-child { margin-bottom: 0; }
.tree-subsubheader { display: flex; align-items: center; gap: 10px; padding: 6px 9px; cursor: pointer; font-weight: 700; font-size: 12.5px; background: #f3f4f6; color: var(--ink); margin-bottom: 6px; border-left: 3px solid var(--brand); }
.tree-subsubheader:hover { background: #e9eaec; }
.tree-subsubgroup table.admin-table { margin-bottom: 0; }

/* ---------- 製品作成・管理：常時展開のカテゴリ・フォルダ行に付ける操作ボタン ---------- */
.tree-static { cursor: default; }
.tree-subheader.tree-static:hover { background: var(--brand-l); }
.tree-subsubheader.tree-static:hover { background: #f3f4f6; }
.tree-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.tree-actions button { width: auto; padding: 5px 10px; border-radius: 6px; font-size: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.tree-actions button:hover { opacity: .85; }

/* ---------- 製品・カテゴリ・フォルダの並び替え（ドラッグ＆ドロップ） ---------- */
.drag-handle { cursor: grab; font-size: 14px; padding: 0 6px; user-select: none; flex-shrink: 0; }
.drag-handle:active { cursor: grabbing; }
.tree-header .drag-handle { color: rgba(255, 255, 255, .75); }
.tree-subheader .drag-handle, .tree-subsubheader .drag-handle { color: var(--sub); }
table.admin-table .drag-handle { color: var(--sub); display: inline-block; }
.dragging { opacity: .4; }
.drag-over { outline: 2px dashed var(--brand); outline-offset: -2px; }
/* 複数選択してまとめてドラッグ移動するためのチェックボックス（各部署フィードバックNo.6） */
.drag-select-checkbox { flex-shrink: 0; margin-right: 2px; cursor: pointer; vertical-align: middle; }

.status-pill { display: inline-block; padding: 3px 10px; font-size: 11.5px; font-weight: 700; border-radius: 999px; }
.status-pill.status-published { background: #e8f7ec; color: #1b7a1b; }
.status-pill.status-draft { background: #f0f1f3; color: var(--sub); }

table.admin-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); margin-bottom: 24px; box-shadow: 0 1px 3px rgba(20, 20, 30, .05); }
table.admin-table th, table.admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
table.admin-table th { background: #fafafa; color: var(--sub); font-weight: 700; }
table.admin-table td button { width: auto; margin-right: 6px; padding: 6px 10px; border-radius: 6px; font-size: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
table.admin-table tr.draft-row td { background: repeating-linear-gradient(45deg, #f4f5f7, #f4f5f7 6px, #ececef 6px, #ececef 12px); }

/* ---------- スマホ・タブレット対応 ---------- */
@media (max-width: 900px) {
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; z-index: 60; box-shadow: 2px 0 16px rgba(0,0,0,.25); }
  #app.collapsed .sidebar { box-shadow: none; }
  .content { padding: 14px 16px; }
  .topbar { flex-wrap: wrap; height: auto; min-height: 56px; padding: 8px 12px; row-gap: 8px; }
  /* requirements.md No.269：サイドバー折りたたみ時（スマホでは自動的に折りたたまれる）、
     固定位置のサイドバー開閉ボタン（左上、幅26px+left:6px）とトップバー先頭の「戻る」
     「HOME」ボタンが重なっていたため、折りたたみ時だけトップバーの左余白を広げる */
  #app.collapsed .topbar { padding-left: 46px; }
  .crumb { order: 3; flex-basis: 100%; font-size: 11.5px; }
  .header-search { width: 120px; }
  .user-role { display: none !important; }
  /* 各部署フィードバック：スマホ表示でアカウント名（組織名）が長いと、#userNameの
     white-space:nowrapによりトップバーが横に伸びきってしまい、横スクロールが必要に
     なっていた。スマホ幅だけ、収まりきらない分を...省略にする（min-width:autoのままだと
     flexアイテムは中身の幅より縮まないため、overflow:hiddenも併せて指定する必要がある） */
  .user { flex-wrap: wrap; row-gap: 6px; }
  #userName { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
  .product-row { flex-wrap: wrap; }
  .logo-slot { width: 96px; height: 64px; }
  .product-row-meta { flex-basis: 100%; justify-content: space-between; margin-top: 4px; }
}
