* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  -webkit-text-size-adjust: 100%;
}

.screen { display: none; min-height: 100%; padding-bottom: 90px; }
.screen.active { display: block; }

.app-header {
  background: var(--card);
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  position: sticky; top: 0; z-index: 10;
}
.app-header h1 { font-size: 1.25rem; }
.app-tagline { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.app-header.slim { display: flex; align-items: center; gap: 12px; }

/* 言語切替(ヘッダー右上に重ねる。見出しの折り返しに影響させないため absolute。
   .app-header は position: sticky なので、その中で位置が決まる) */
.lang-switch { position: absolute; top: 10px; right: 12px; }
#langSelect {
  font-size: .8rem; padding: 5px 26px 5px 9px;
  border: 1px solid #d7dde5; border-radius: 8px;
  background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23667' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E") no-repeat right 9px center / 9px;
  color: var(--text); appearance: none; -webkit-appearance: none; cursor: pointer;
}
/* 見出しが言語セレクタの下に潜り込まないよう、右側に余白を確保する */
.app-header h1, .app-tagline { padding-right: 92px; }
.app-header.slim h1, .app-header.slim .app-tagline { padding-right: 0; }
#editTitle { font-weight: bold; }

.status { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.status.ready { color: #16a34a; }
.status.error { color: var(--danger); }

/* ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--card); color: var(--text);
  border: 1px solid #cbd5e1; border-radius: 12px;
  padding: 12px 16px; font-size: 1rem; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn-primary { background: var(--primary); border-color: var(--primary-dark); color: #fff; font-weight: bold; }
.btn-danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn-ghost { border: none; background: transparent; padding: 8px; }
.btn-outline { background: #fff; border-color: var(--primary); color: var(--primary); font-weight: bold; }
.btn-big { width: 100%; padding: 18px; font-size: 1.15rem; }

.home-actions { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; }

/* 本棚 */
.shelf { padding: 14px 16px 4px; }
.shelf-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.shelf-label { flex: 1; min-width: 0; font-size: .9rem; color: var(--muted); }
/* 冊数制限の説明を開くⓘボタン */
.shelf-info {
  flex: 0 0 auto; width: 30px; height: 30px; padding: 0;
  border: none; background: transparent; cursor: pointer;
  font-size: 1.05rem; line-height: 1; color: var(--primary);
}
.shelf-note {
  font-size: .78rem; line-height: 1.6; color: #334155;
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px;
}
.shelf-note[hidden] { display: none; }
.shelf-list { display: flex; flex-direction: column; gap: 8px; }
.shelf-empty { font-size: .9rem; color: var(--muted); padding: 8px 2px; }
/* 端末内の概算使用容量 */
.storage-info { font-size: .72rem; color: var(--muted); padding: 8px 2px 0; line-height: 1.5; }
.storage-info[hidden] { display: none; }

/* 撮影後に出すタイトル入力欄 */
.title-prompt {
  margin: 10px 16px 0; padding: 12px 14px;
  background: var(--card); border: 1px solid #cbd5e1; border-radius: 12px;
}
.title-prompt[hidden] { display: none; }
.title-prompt-label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.title-prompt-row { display: flex; gap: 8px; }
.title-input {
  flex: 1; min-width: 0; padding: 10px 12px;
  border: 1px solid #cbd5e1; border-radius: 10px;
  font-size: 1rem; color: var(--text); background: #fff;
}
.title-prompt-row .btn { flex: 0 0 auto; }
.title-prompt-note { font-size: .72rem; color: var(--muted); margin-top: 6px; }
.book-card {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 2px solid #e2e8f0; border-radius: 12px;
  padding: 10px 12px;
}
.book-card.open { border-color: var(--primary); background: #eff6ff; }
.book-main { flex: 1; min-width: 0; text-align: left; background: none; border: none;
  cursor: pointer; color: var(--text); padding: 2px 0; font-size: 1rem; }
.book-title { font-weight: bold; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-meta { display: block; font-size: .78rem; color: var(--muted); margin-top: 2px; }
.book-act { border: none; background: transparent; font-size: 1.05rem; padding: 6px 8px; cursor: pointer; }
.book-act.del { color: var(--danger); }

/* 開いている本のバー */
.open-book-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 16px 4px;
}
.open-book-bar[hidden] { display: none; }
.open-book-name { flex: 1; font-weight: bold; color: var(--primary); }

/* 選択操作バー */
.select-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; padding: 4px 16px 8px; }
.select-bar[hidden] { display: none; }
.select-lead { flex-basis: 100%; font-size: .85rem; color: var(--primary); font-weight: bold; }
.select-info { flex: 1; font-size: .85rem; color: var(--muted); }
.btn.small { padding: 6px 10px; font-size: .8rem; border: 1px solid #cbd5e1; }

/* ライブ自動撮影画面 */
#screen-camera { padding-bottom: 0; background: #000; display: none; }
#screen-camera.active { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.cam-top {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: #000; color: #fff;
}
.cam-close { color: #fff; font-size: 1.3rem; }
.cam-status { flex: 1; text-align: center; font-size: .9rem; }
.cam-count { font-size: .85rem; background: rgba(255,255,255,.18); padding: 4px 10px; border-radius: 10px; }
.cam-stage {
  position: relative; flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; background: #000;
  /* 撮影中に画面がピンチズームすると枠合わせができなくなるため、
     ここだけズーム/スクロールを止める(ページ全体のズームは許可したまま) */
  touch-action: none;
}
/* 映像は #camOverlay に自前で描く(枠と同じ座標系にするため)。
   video要素は映像の取得元・寸法の基準としてだけ使うので見えなくする。
   display:none にすると描画が止まる端末があるため opacity で隠す。 */
#camVideo { max-width: 100%; max-height: 100%; display: block; opacity: 0; }
#camOverlay { position: absolute; pointer-events: auto; touch-action: none; }
.cam-hint { flex-basis: 100%; text-align: center; font-size: .78rem; color: rgba(255,255,255,.7); margin-bottom: 4px; }
/* 撮影開始前の枠の確定。撮影画面を狭めないよう高さを抑える */
.cam-confirm {
  background: rgba(37,99,235,.18); border: 1px solid rgba(96,165,250,.6);
  border-radius: 10px; padding: 6px 10px; margin-bottom: 8px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px;
}
.cam-confirm-msg { font-size: .76rem; color: #dbeafe; text-align: center; }
.cam-confirm .btn { padding: 8px 14px; font-size: .85rem; }
.cam-locked {
  background: rgba(34,197,94,.15); border: 1px solid rgba(74,222,128,.5);
  border-radius: 10px; padding: 6px 10px; margin-bottom: 8px;
  font-size: .76rem; color: #dcfce7; text-align: center;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px;
}
/* 普段使わない設定はたたんでおく */
.cam-more { margin-top: 10px; }
.cam-more > summary {
  cursor: pointer; list-style: none; text-align: center;
  font-size: .78rem; color: rgba(255,255,255,.72);
  padding: 6px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px;
}
.cam-more > summary::-webkit-details-marker { display: none; }
.cam-more[open] > summary { margin-bottom: 10px; }

.cam-flash {
  position: absolute; inset: 0; background: #fff; opacity: 0;
  pointer-events: none; transition: opacity .12s ease-out;
}
.cam-flash.on { opacity: .85; transition: none; }
/* 操作部が伸びても撮影画面を潰さないよう高さに上限を設け、中でスクロールさせる */
.cam-controls {
  background: #000; color: #fff; padding: 8px 12px 12px;
  max-height: 42vh; overflow-y: auto; flex-shrink: 0;
}
.cam-settings { display: flex; flex-wrap: wrap; gap: 8px 12px; justify-content: center; margin-bottom: 12px; }
.cam-settings .chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.12); color: #fff;
  padding: 8px 12px; border-radius: 20px; font-size: .85rem;
  border: none;
}
select.chip { appearance: none; }
.chip input { width: 16px; height: 16px; }
.cam-actions { display: flex; align-items: center; justify-content: center; gap: 20px; position: relative; }
.shutter {
  width: 72px; height: 72px; border-radius: 50%;
  background: #fff; border: 4px solid rgba(255,255,255,.4);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 0 0 2px #000 inset;
}
.shutter:active { transform: scale(.94); }
.cam-done { position: absolute; right: 0; }

/* 横向きで構えたとき。縦の余白が少ないので操作部を右側に置き、
   撮影画面の高さを確保する(上下に積むと映像が極端に小さくなる)。
   ※この指定は .cam-controls / .cam-actions / .shutter の通常指定より
     "後ろ" に置くこと。同じ強さの指定なので、前に置くと後ろの指定に負け、
     max-height:42vh や 72px のシャッターがそのまま効いてしまう。 */
@media (orientation: landscape) and (max-height: 560px) {
  #screen-camera.active {
    display: grid;
    grid-template-columns: 1fr 210px;
    grid-template-rows: auto 1fr;
    grid-template-areas: "top top" "stage controls";
  }
  .cam-top { grid-area: top; padding: 5px 12px; }
  .cam-stage { grid-area: stage; min-height: 0; min-width: 0; }
  .cam-controls {
    grid-area: controls; min-height: 0; max-height: none; overflow-y: auto;
    display: flex; flex-direction: column; gap: 8px;
    /* 中身が収まるときだけ上下中央に置く。
       単なる center だと、中身がはみ出したときに上下"両方"へ押し出され、
       上にはみ出した分はスクロールで出せなくなる(scrollTopは0より小さくできない)。
       実際これで「✔ この枠で撮影を始める」が画面外に隠れていた。
       safe center は、はみ出すときだけ上寄せに切り替えてくれる。
       未対応のブラウザは前の行(flex-start)がそのまま効く。 */
    justify-content: flex-start;
    justify-content: safe center;
  }
  .cam-actions { flex-direction: column-reverse; gap: 10px; }
  .shutter { width: 56px; height: 56px; }
  .cam-confirm, .cam-locked { margin-bottom: 0; }
  .cam-confirm .btn { width: 100%; }
  .cam-more { margin-top: 0; }
  .cam-settings { margin-bottom: 0; }
}

.empty-msg { text-align: center; color: var(--muted); padding: 40px 20px; line-height: 1.8; }

/* サムネイル一覧 */
.thumb-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px; padding: 0 16px;
}
.thumb-card {
  background: var(--card); border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  display: flex; flex-direction: column;
}
.thumb-card .img-wrap { position: relative; aspect-ratio: 3/4; background: #e2e8f0; }
.thumb-card img { width: 100%; height: 100%; object-fit: contain; display: block; cursor: pointer; }
.thumb-card .badge {
  position: absolute; top: 6px; left: 6px;
  background: rgba(220,38,38,.9); color: #fff;
  font-size: .7rem; padding: 2px 8px; border-radius: 8px;
}
.thumb-card .page-no {
  position: absolute; bottom: 6px; left: 6px;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: .75rem; padding: 2px 8px; border-radius: 8px;
}
/* PDF/OCRに含めるか選ぶチェックボックス */
.thumb-card .sel-check {
  position: absolute; top: 6px; right: 6px;
  width: 28px; height: 28px; cursor: pointer;
  accent-color: var(--primary); margin: 0;
  filter: drop-shadow(0 0 2px rgba(255,255,255,.9));
}
.thumb-card.unselected { opacity: .6; }
.thumb-card.unselected .img-wrap::after {
  content: "対象外"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(148,163,184,.35); color: #334155; font-weight: bold; font-size: .85rem;
}
.thumb-tools { display: flex; }
.thumb-tools button {
  flex: 1; border: none; background: var(--card); border-top: 1px solid #e2e8f0;
  padding: 9px 0; font-size: .95rem; cursor: pointer; color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
.thumb-tools button + button { border-left: 1px solid #e2e8f0; }
.thumb-tools button:disabled { opacity: .3; }
.thumb-tools .del { color: var(--danger); }

/* OCRオプション */
.ocr-options {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px;
  padding: 12px 16px; margin: 4px 16px 0;
  background: var(--card); border-radius: 12px; font-size: .9rem;
}
.ocr-options[hidden] { display: none; }
.ocr-label { color: var(--muted); }
.ocr-select {
  font-size: .88rem; padding: 5px 8px;
  border: 1px solid #d7dde5; border-radius: 8px;
  background: #fff; color: var(--text); cursor: pointer;
}
/* 英語のみを選ぶと縦書きが選べなくなるので、その理由を添える */
.ocr-note { font-size: .78rem; color: var(--muted); flex-basis: 100%; }
.ocr-note[hidden] { display: none; }
.radio { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.radio input { width: 18px; height: 18px; }
.radio input:disabled { opacity: .4; }
.radio:has(input:disabled) { opacity: .45; cursor: default; }

/* 出力バー */
.export-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; gap: 8px; padding: 12px 12px;
  background: var(--card); box-shadow: 0 -2px 8px rgba(0,0,0,.08);
}
/* 幅375pxでも1行に収まるよう、折り返しを禁止して文字を画面幅に追従させる */
.export-bar .btn {
  flex: 1; min-width: 0; padding: 14px 4px;
  white-space: nowrap; font-size: clamp(.76rem, 3.4vw, .95rem);
}
.export-bar #btnClear { flex: 0 0 auto; padding: 14px 12px; }

/* OCR結果画面 */
.ocr-result-wrap { padding: 8px 16px; }
.ocr-text {
  width: 100%; height: calc(100vh - 240px); min-height: 300px;
  padding: 14px; border: 1px solid #cbd5e1; border-radius: 12px;
  font-size: 1rem; line-height: 1.7; resize: none;
  font-family: "Hiragino Sans", "Yu Gothic UI", "Meiryo", monospace;
  color: var(--text); background: var(--card);
}

/* 補正画面 */
.hint { text-align: center; font-size: .85rem; color: var(--muted); padding: 8px 16px; }
.canvas-wrap {
  display: flex; justify-content: center; align-items: center;
  padding: 8px; background: #1e293b;
  /* 四隅ドラッグ中に意図せずズームしないよう、補正エリアだけズームを止める */
  touch-action: none;
}
#editCanvas {
  max-width: 100%;
  max-height: calc(100vh - 240px);
  touch-action: none;
  display: block;
}
.edit-toolbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; gap: 8px; padding: 12px;
  background: var(--card); box-shadow: 0 -2px 8px rgba(0,0,0,.08);
  flex-wrap: wrap;
}
.edit-toolbar .btn { flex: 1; min-width: 64px; padding: 12px 4px; font-size: .85rem; }
.edit-toolbar #btnConfirm { flex: 1.3; }
.mode-select { appearance: none; text-align: center; }
#btnBrush.active { background: var(--primary); color: #fff; border-color: var(--primary-dark); }

/* 指消しツールバー */
.brush-bar {
  position: fixed; bottom: 64px; left: 0; right: 0;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px; background: #0f172a; color: #fff;
  box-shadow: 0 -2px 8px rgba(0,0,0,.2);
}
.brush-bar[hidden] { display: none; }
.brush-label { font-size: .85rem; flex-basis: 100%; text-align: center; margin-bottom: 2px; }
.brush-size { display: flex; align-items: center; gap: 6px; font-size: .8rem; flex: 1; }
.brush-size input { flex: 1; }
.brush-bar .btn { padding: 10px 12px; font-size: .85rem; }

/* オーバーレイ */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15,23,42,.7); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  font-size: 1rem;
}
.overlay[hidden] { display: none; }
.spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,.25); border-top-color: #fff;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 取扱説明書・注意事項 */
.manual {
  margin: 8px 16px 16px; background: var(--card); border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow: hidden;
}
.manual > summary {
  cursor: pointer; list-style: none; padding: 14px 16px;
  font-size: .9rem; font-weight: bold; color: var(--text);
}
.manual > summary::-webkit-details-marker { display: none; }
.manual > summary::after { content: "▾"; float: right; color: var(--muted); }
.manual[open] > summary::after { content: "▴"; }
.manual h2 {
  font-size: .88rem; margin: 4px 16px 8px; color: var(--primary);
}
.manual ol, .manual ul { margin: 0 16px 16px 34px; }
.manual li { font-size: .82rem; line-height: 1.7; color: var(--text); margin-bottom: 4px; }
.manual .manual-note { font-size: .78rem; color: var(--muted); margin: 0 16px 16px; line-height: 1.6; }
.manual .manual-terms li { color: var(--text); }

.guide-link { text-align: center; padding: 4px 16px 16px; }
.guide-link a { font-size: .82rem; color: var(--primary); text-decoration: none; }
.guide-link a:active { opacity: .7; }

/* 解説記事ページ(guide.html) */
.guide-back { display: block; font-size: .85rem; color: var(--primary); text-decoration: none; margin-bottom: 8px; }
.guide-wrap { max-width: 720px; margin: 0 auto; padding: 24px 20px 120px; line-height: 1.9; }
.guide-wrap h1 { font-size: 1.4rem; margin-bottom: 10px; }
.guide-lead { font-size: .95rem; color: var(--muted); margin-bottom: 24px; }
.guide-wrap h2 { font-size: 1.08rem; color: var(--primary); margin: 32px 0 12px; padding-top: 8px; border-top: 1px solid #e2e8f0; }
.guide-wrap h2:first-of-type { border-top: none; padding-top: 0; }
.guide-wrap p { font-size: .92rem; margin-bottom: 12px; }
.guide-wrap ol, .guide-wrap ul { margin: 0 0 16px 26px; font-size: .92rem; }
.guide-wrap li { margin-bottom: 8px; }
.guide-wrap strong { color: var(--text); }
.guide-cta {
  display: block; text-align: center; background: var(--primary); color: #fff;
  font-weight: bold; font-size: 1.02rem; padding: 16px; border-radius: 12px;
  text-decoration: none; margin: 20px 0;
}
.guide-cta:active { opacity: .85; }
.guide-faq dt { font-weight: bold; font-size: .92rem; margin-top: 14px; }
.guide-faq dt::before { content: "Q. "; color: var(--primary); }
.guide-faq dd { font-size: .88rem; color: var(--muted); margin: 4px 0 0 0; }
.guide-faq dd::before { content: "A. "; color: var(--text); font-weight: bold; }
.guide-footer-note { font-size: .78rem; color: var(--muted); margin-top: 32px; padding-top: 16px; border-top: 1px solid #e2e8f0; }

/* SEO用の静的ページ(ランディング/FAQ/英語版)共通パーツ */
.lang-toggle-link { position: absolute; top: 14px; right: 16px; font-size: .8rem; color: var(--primary); text-decoration: none; padding: 5px 10px; border: 1px solid #d7dde5; border-radius: 8px; background: #fff; }
.callout { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 12px; padding: 14px 16px; font-size: .88rem; margin: 16px 0; color: var(--text); }
.callout strong { color: var(--primary-dark); }
.site-footer-nav { max-width: 720px; margin: 40px auto 0; padding: 20px 20px 100px; border-top: 1px solid #e2e8f0; text-align: center; }
.site-footer-nav a { display: inline-block; font-size: .8rem; color: var(--primary); text-decoration: none; margin: 4px 10px; }
.site-footer-nav a:active { opacity: .7; }

/* トースト */
.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%);
  background: rgba(15,23,42,.92); color: #fff;
  padding: 12px 20px; border-radius: 12px; font-size: .9rem;
  z-index: 200; max-width: 90%; text-align: center; line-height: 1.5;
}
.toast[hidden] { display: none; }

/* バックアップ促し(ホーム上部) */
.backup-bar {
  display: flex; align-items: center; gap: 10px;
  margin: 12px 16px 0; padding: 12px 14px;
  background: #fffbeb; border: 1px solid #fcd34d; border-radius: 12px;
}
.backup-bar[hidden] { display: none; }
.backup-icon { font-size: 1.1rem; color: #b45309; flex: 0 0 auto; }
.backup-msg { flex: 1; font-size: .8rem; line-height: 1.6; color: #78350f; }
.backup-bar .btn { flex: 0 0 auto; }

/* ホーム画面に追加(PWA)のバナー */
.install-banner {
  /* 下部の書き出しバー(高さ約100px)に重ならない位置に置く */
  position: fixed; left: 12px; right: 12px; bottom: 112px; z-index: 150;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--card); border: 1px solid #cbd5e1; border-radius: 14px;
  box-shadow: 0 6px 20px rgba(15,23,42,.18);
}
.install-banner[hidden] { display: none; }
/* 撮影・補正・OCRの画面では引っ込める。
   画面の外に固定表示しているため、そのままだと撮影画面の
   「✔ この枠で撮影を始める」などの操作ボタンの上に重なってしまう。
   body[data-screen] を条件に入れているのは、起動直後(showScreen前)の
   ホーム表示で消えてしまわないようにするため。 */
body[data-screen]:not([data-screen="home"]) .install-banner { display: none; }
.install-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.install-text strong { font-size: .9rem; }
.install-text span { font-size: .75rem; color: var(--muted); line-height: 1.5; }
.install-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; }

/* iOS向け手順モーダル */
.ios-guide {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(15,23,42,.6);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.ios-guide[hidden] { display: none; }
.ios-card {
  position: relative; width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto;
  background: var(--card); border-radius: 16px; padding: 22px 20px 18px;
}
.ios-close {
  position: absolute; top: 8px; right: 8px;
  border: none; background: transparent; font-size: 1.1rem;
  color: var(--muted); padding: 8px; cursor: pointer;
}
.ios-card h2 { font-size: 1.02rem; margin-bottom: 14px; padding-right: 24px; }
.ios-steps { list-style: none; display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.ios-steps li {
  display: flex; align-items: center; gap: 12px;
  font-size: .86rem; line-height: 1.6;
}
.ios-step-text { flex: 1; min-width: 0; }
.ios-step-icon {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 12px;
  background: #eff6ff; display: flex; align-items: center; justify-content: center;
}
.ios-note {
  font-size: .76rem; color: var(--muted); line-height: 1.6;
  background: var(--bg); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px;
}
