/* ============================================================
   VOICEED — 共通スタイル
   色・サイズは design/*.dc.html から写したもの。勝手に変えない。
   ------------------------------------------------------------
   藍   #2f4a7d   藍うすい #eaeef6   藍文字 #2c3f63
   生成り #f7f5f0  白 #ffffff        うすい生成り #faf8f4 / #f0ede6 / #eae6dd
   文字  #1b1a18   副文字 #6e6960 / #4a463f   うすい字 #a9a296 / #8d877d
   罫線  #e4dfd5 / #ece7dd / #efebe2 / #d8d2c6 / #ddd7cc
   緑   #4a8b66 / #2c6a4a / #e8f2ea
   黄   #d9ae3f / #b08a2a / #8a6412 / #fbf1d8
   赤   #b8432f / #a4443c / #fbeceb
   ============================================================ */

/* ---------- 土台 ---------- */
* { box-sizing: border-box; }

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: #f7f5f0;
  color: #1b1a18;
  font-family: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

a { color: #2f4a7d; text-decoration: none; }
a:hover { color: #22375d; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  margin: 0;
  padding: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

input, textarea, select { font-family: inherit; }
input::placeholder { color: #8d877d; }
input[type="search"] { -webkit-appearance: none; appearance: none; }
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

h1, h2, h3, p { margin: 0; }

[hidden] { display: none !important; }

.mincho { font-family: "Shippori Mincho B1", "Hiragino Mincho ProN", serif; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.grow { flex: 1; }
.spacer44 { width: 44px; flex: none; }

/* ---------- 画面 ----------
   窓の高さは端末・ブラウザによって変わる（Macのブラウザは844pxより低いことがある）。
   ・高さは窓に合わせる（固定値に頼らない）
   ・入りきらないときは画面ごと縦にスクロールできる（切り取って終わりにしない）
   ・下のタブ（.tabbar）は position:sticky で常に見えるところに残る
   窓が足りているときはスクロールも sticky も働かないので、見た目は今までと同じ。 */
.screen {
  width: 100%;
  max-width: 390px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* 下に引っ張って読み込み直すときに、iOSのページ全体の跳ねと喧嘩させない */
  overscroll-behavior-y: contain;
  color: #1b1a18;
}
.screen--cream { background: #f7f5f0; }
.screen--white { background: #ffffff; }

/* ---------- 下のタブ ---------- */
.tabbar {
  display: flex;
  background: #ffffff;
  border-top: 1px solid #e4dfd5;
  padding: 8px 8px calc(20px + env(safe-area-inset-bottom, 0px));
  flex: none;
  /* 窓が低くて画面がスクロールするときも、下に貼りついて必ず見える */
  position: sticky;
  bottom: 0;
  z-index: 5;
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
  min-height: 44px;
  color: #6e6960;
}
.tab:hover { color: #6e6960; }
.tab span { font-size: 13px; font-weight: 500; }
.tab.is-on, .tab.is-on:hover { color: #2f4a7d; }

/* 下のタブは全画面に出す。そのぶん、②（処理中）の手順の段だけを縮めて 390×844 に収める。
   タブ・ボタンは小さくしない。 */
#scr-proc .steps {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---------- 上のバー ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 10px 10px;
  border-bottom: 1px solid #ece7dd;
  flex: none;
}
.topbar--plain { gap: 8px; padding: 16px 12px 8px; border-bottom: none; }
.topbar--white { background: #ffffff; }
.iconbtn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.topbar-title { flex: 1; min-width: 0; text-align: center; }
.tt-main { font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-sub { font-size: 13px; color: #6e6960; margin-top: 2px; }

/* ---------- ボタン ---------- */
.btn {
  height: 52px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-grow { flex: 1; }
.btn-block { width: 100%; }
.btn-w108 { flex: none; width: 108px; }
.btn-w112 { flex: none; width: 112px; }
.btn-primary { background: #2f4a7d; color: #ffffff; font-size: 15px; font-weight: 700; border: none; }
.btn-primary:hover { color: #ffffff; }
.btn-ghost {
  border: 1px solid #d8d2c6;
  background: #ffffff;
  color: #1b1a18;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
}
.btn-ghost:hover { color: #1b1a18; }
.btn-outline-ink {
  border: 1.5px solid #2f4a7d;
  background: #ffffff;
  color: #2f4a7d;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
}

.pill-primary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  background: #2f4a7d;
  color: #ffffff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  flex: none;
  border: none;
}
.pill-primary:hover { color: #ffffff; }
.pill-ghost {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #d8d2c6;
  background: #ffffff;
  color: #1b1a18;
  font-size: 13px;
  font-weight: 500;
  flex: none;
}
.pill-ghost-sm {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid #d8d2c6;
  background: #ffffff;
  color: #4a463f;
  font-size: 13px;
  flex: none;
}
.linkbtn {
  font-size: 13px;
  color: #2f4a7d;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.linkbtn-muted {
  font-size: 13px;
  color: #6e6960;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
}

/* ---------- 合言葉（初回のみ） ---------- */
.screen--gate { justify-content: center; justify-content: safe center; }
.gate-inner { padding: 0 20px 60px; width: 100%; }
.gate-logo { font-size: 20px; font-weight: 600; letter-spacing: 0.04em; }
.gate-lead { font-size: 13px; color: #6e6960; margin-top: 3px; }
.gate-note { font-size: 15px; line-height: 1.75; color: #4a463f; margin-top: 22px; }
.gate-form { margin-top: 22px; display: flex; flex-direction: column; gap: 14px; }
.gate-input {
  width: 100%;
  height: 52px;
  border: 1px solid #e4dfd5;
  border-radius: 12px;
  background: #ffffff;
  padding: 0 14px;
  font-size: 16px;
  color: #1b1a18;
  outline: none;
}
.gate-input:focus { border-color: #2f4a7d; }
.gate-error { font-size: 13px; color: #a4443c; line-height: 1.7; }

/* ---------- ① ホーム ---------- */
.home-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 12px;
  flex: none;
}
.home-logo { font-size: 20px; font-weight: 600; letter-spacing: 0.04em; }
.home-tag { font-size: 13px; color: #6e6960; margin-top: 3px; }
.chip-dict {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #eaeef6;
  border-radius: 999px;
  padding: 0 14px;
  height: 44px;
  flex: none;
}
.chip-dict-t { font-size: 13px; color: #2f4a7d; font-weight: 500; }

.resume-card {
  margin: 4px 20px 0;
  background: #ffffff;
  border: 1px solid #e4dfd5;
  border-radius: 14px;
  padding: 13px 13px 13px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}
.resume-body { flex: 1; min-width: 0; }
.resume-t { font-size: 15px; font-weight: 500; }
.resume-s { font-size: 13px; color: #6e6960; margin-top: 3px; }

.home-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
}
.mic-ring {
  padding: 14px;
  border: 1px solid #e0e4ee;
  border-radius: 50%;
  background: none;
  display: block;
}
.mic-core {
  width: 164px;
  height: 164px;
  border-radius: 50%;
  background: #2f4a7d;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 30px rgba(47, 74, 125, 0.26);
}
.home-cta { font-size: 15px; font-weight: 500; margin-top: 22px; }
.home-help { font-size: 13px; color: #6e6960; margin-top: 7px; text-align: center; line-height: 1.75; }

/* いま接続中のマイク（①ホーム・録音中で共通。1行に収め、長い名前は…で省略） */
.micline {
  font-size: 13px;
  color: #6e6960;
  line-height: 1.3;
  margin-top: 3px;
  padding: 0 20px;
  max-width: 100%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-file {
  margin-top: 22px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid #d8d2c6;
  border-radius: 999px;
  background: #ffffff;
  color: #1b1a18;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.recent { padding: 0 20px 14px; flex: none; }
.recent-head { display: flex; align-items: center; justify-content: space-between; margin: -10px 0 5px; }
.recent-h { font-size: 16px; font-weight: 700; }
.recent-all { font-size: 13px; display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; }
.recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #e4dfd5;
  border-radius: 12px;
  padding: 12px 10px 12px 14px;
  color: inherit;
  min-height: 44px;
}
.recent-row:hover { color: inherit; }
.recent-row > svg { flex: none; }
.recent-row-body { flex: 1; min-width: 0; }
.recent-row-t { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-row-s { font-size: 13px; color: #6e6960; margin-top: 3px; }

/* ---------- 録音中 ---------- */
.rec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 8px;
  flex: none;
}
.rec-badge { display: flex; align-items: center; gap: 7px; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: #b8432f; display: block; }
.rec-label { font-size: 13px; font-weight: 500; color: #4a463f; }

.rec-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rec-time { font-size: 54px; font-weight: 500; letter-spacing: 0.03em; line-height: 1; }
.wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 110px;
  margin-top: 34px;
  padding: 0 22px;
}
.bar { width: 3px; border-radius: 2px; }
.rec-hint { font-size: 13px; color: #6e6960; margin-top: 30px; }

.rec-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 20px;
  flex: none;
}
.rec-pause {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid #d8d2c6;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.rec-go {
  flex: 1;
  height: 64px;
  border-radius: 999px;
  background: #2f4a7d;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(47, 74, 125, 0.24);
}
.rec-discard { text-align: center; padding: 6px 0 calc(22px + env(safe-area-inset-bottom, 0px)); flex: none; }

/* ---------- ② 処理中 ---------- */
.proc-ringwrap { display: flex; flex-direction: column; align-items: center; padding: 18px 0 6px; flex: none; }
.proc-ring { position: relative; width: 168px; height: 168px; }
.proc-ring-svg { transform: rotate(-90deg); }
.proc-ring-in {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.proc-pct { font-size: 38px; font-weight: 600; line-height: 1; }
.proc-pct-u { font-size: 20px; }
.proc-eta { font-size: 13px; color: #6e6960; margin-top: 6px; }

.proc-file {
  margin: 16px 20px 0;
  background: #ffffff;
  border: 1px solid #e4dfd5;
  border-radius: 14px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}
.proc-file-ic {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #eaeef6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.proc-file-body { flex: 1; min-width: 0; }
.proc-file-t { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proc-file-s { font-size: 13px; color: #6e6960; margin-top: 3px; }

.steps {
  margin: 14px 20px 0;
  background: #ffffff;
  border: 1px solid #e4dfd5;
  border-radius: 14px;
  padding: 6px 14px;
  flex: none;
}
.step { display: flex; gap: 12px; padding: 12px 0; }
.step-rail { display: flex; flex-direction: column; align-items: center; flex: none; }
.step-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.step-line { width: 2px; flex: 1; min-height: 16px; background: #e4dfd5; margin-top: 4px; }
.step:last-child .step-line { display: none; }
.step-body { flex: 1; padding-bottom: 4px; }
.step:last-child .step-body { padding-bottom: 0; }
.step-t { font-size: 15px; font-weight: 500; }
.step-s { font-size: 13px; color: #6e6960; margin-top: 3px; }
.step-bar { height: 6px; border-radius: 3px; background: #eae6dd; margin-top: 9px; overflow: hidden; }
.step-bar-in { height: 100%; background: #2f4a7d; border-radius: 3px; }
.step-state { font-size: 13px; color: #6e6960; padding-top: 3px; flex: none; }
.step-pip { width: 9px; height: 9px; border-radius: 50%; background: #2f4a7d; display: block; }

.step .step-check, .step .step-pip { display: none; }
.step[data-state="done"] .step-dot { background: #2f4a7d; }
.step[data-state="done"] .step-check { display: block; }
.step[data-state="active"] .step-dot { border: 2.5px solid #2f4a7d; }
.step[data-state="active"] .step-pip { display: block; }
.step[data-state="wait"] .step-dot { border: 2px solid #ddd7cc; }
.step[data-state="wait"] .step-t { color: #6e6960; }
.step[data-state="wait"] .step-bar { display: none; }
.step[data-state="done"] .step-state,
.step[data-state="active"] .step-state { color: #2f4a7d; font-weight: 500; }

.note-blue {
  margin: 14px 20px 0;
  background: #eaeef6;
  border-radius: 14px;
  padding: 14px 15px;
  font-size: 15px;
  line-height: 1.75;
  color: #2c3f63;
  flex: none;
}
.note-blue--flat { margin: 0; padding: 13px 15px; }
.proc-cancel { text-align: center; padding: 6px 0 calc(24px + env(safe-area-inset-bottom, 0px)); flex: none; }

/* ---------- 保存インジケータ（4状態） ---------- */
.savechip {
  display: flex;
  align-items: center;
  border-radius: 999px;
  flex: none;
}
.savechip--tap { height: 44px; padding: 0 10px 0 12px; gap: 6px; }
.savechip--pill { padding: 6px 12px; gap: 7px; }
.savechip-t { font-size: 13px; white-space: nowrap; color: inherit; }
.savechip-ic { display: flex; align-items: center; justify-content: center; flex: none; }
.savechip-chev { flex: none; }
.savechip .sc-dot,
.savechip .sc-spin,
.savechip .sc-check,
.savechip .sc-alert { display: none; }
.sc-dot { width: 8px; height: 8px; border-radius: 50%; }

.savechip[data-phase="pending"] { background: #f0ede6; color: #4a463f; }
.savechip[data-phase="pending"] .sc-dot { display: block; background: #b08a2a; }

.savechip[data-phase="saving"] { background: #eaeef6; color: #2c3f63; }
.savechip[data-phase="saving"] .sc-spin { display: block; color: #2f4a7d; animation: sc-rotate 0.9s linear infinite; }

.savechip[data-phase="saved"] { background: #e8f2ea; color: #2c6a4a; }
.savechip[data-phase="saved"] .sc-check { display: block; }

.savechip[data-phase="offline"] { background: #fbeceb; color: #a4443c; }
.savechip[data-phase="offline"] .sc-alert { display: block; }

/* 保存に失敗した＝押すともう一度保存する（タップ44px以上） */
.savechip[data-phase="error"] {
  background: #fbeceb;
  color: #a4443c;
  cursor: pointer;
  min-height: 44px;
  padding: 0 14px;
  -webkit-tap-highlight-color: transparent;
}
.savechip[data-phase="error"] .sc-alert { display: block; }
.savechip[data-phase="error"]:active { background: #f6dedc; }
.savechip[data-phase="error"]:focus-visible { outline: 2px solid #a4443c; outline-offset: 2px; }

/* idle（まだ何も直していない）＝pendingと同じ見た目で控えめに */
.savechip[data-phase="idle"] { background: #f0ede6; color: #4a463f; }
.savechip[data-phase="idle"] .sc-dot { display: block; background: #ddd7cc; }

@keyframes sc-rotate { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .savechip[data-phase="saving"] .sc-spin { animation: none; }
}

/* ---------- ③ 結果 ／ ③-d 読む専用 ---------- */
.docbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid #ece7dd;
  flex: none;
}
.seg { display: flex; background: #f0ede6; border-radius: 11px; padding: 3px; flex: none; }
.seg-b {
  padding: 0 16px;
  height: 38px;
  display: flex;
  align-items: center;
  font-size: 13px;
  color: #6e6960;
  border-radius: 9px;
  background: transparent;
}
.seg-b.is-on {
  font-weight: 500;
  color: #1b1a18;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07);
}

.legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  row-gap: 5px;
  padding: 10px 16px;
  border-bottom: 1px solid #ece7dd;
  font-size: 13px;
  color: #4a463f;
  flex: none;
}
.lg { display: flex; align-items: center; gap: 6px; }
.lg-sq { width: 9px; height: 9px; border-radius: 2px; display: block; }
.lg-sq--auto { background: #4a8b66; }
.lg-sq--warn { background: #d9ae3f; }
.lg-sq--mine { background: #2f4a7d; }
.lg-sq--redo { background: #8d877d; }
.lg-sq--filler { background: #8d877d; }

/* 整文を見送ったときの一行 */
.polishnote {
  padding: 9px 16px;
  border-bottom: 1px solid #ece7dd;
  background: #faf8f4;
  font-size: 13px;
  color: #6e6960;
  flex: none;
}

.lockband {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #faf8f4;
  border-bottom: 1px solid #ece7dd;
  flex: none;
}
.lockband > svg { flex: none; }
.lockband > span { font-size: 15px; color: #4a463f; }

.doc-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 20px 4px;
  font-size: 15px;
  line-height: 1.95;
}
.doc-body p { margin: 0 0 17px; }
.doc-body p:last-child { margin-bottom: 0; }

mark { color: inherit; background: none; }
.m-auto { background: #e8f2ea; border-bottom: 2px solid #4a8b66; border-radius: 3px; padding: 0 2px; }
.m-warn { background: #fbf1d8; border-bottom: 2px dashed #b08a2a; border-radius: 3px; padding: 0 2px; }
.m-mine { background: #eaeef6; border-bottom: 2px solid #2f4a7d; border-radius: 3px; padding: 0 2px; }
.m-redo { background: #f0ede6; text-decoration: line-through; border-radius: 3px; padding: 0 2px; }
.m-filler { background: #f0ede6; text-decoration: line-through; border-radius: 3px; padding: 0 2px; }

/* 言い直しをまとめて直す（言い直しの印があるときだけ出す） */
.redobar { padding: 0 16px 10px; flex: none; }

/* 言い淀みも消す（言い淀みの候補があるときだけ出す） */
.fillerbar { padding: 0 16px 10px; flex: none; }

.toast-dark {
  margin: 0 16px 10px;
  background: #1b1a18;
  border-radius: 12px;
  padding: 4px 6px 4px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.toast-ic { flex: none; }
.toast-t { flex: 1; font-size: 13px; color: #ffffff; }
.toast-undo {
  font-size: 13px;
  color: #a8bfe4;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  flex: none;
}

.docfoot {
  display: flex;
  gap: 10px;
  padding: 10px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #ece7dd;
  flex: none;
}
.docfoot-resume { display: none; }

/* 読む専用（③-d）：鍵の帯を出し、下は「編集を再開」1つだけ */
body[data-readonly] #docLegend { display: none; }
body[data-readonly] #docLockBand { display: flex; }
body[data-readonly] #dictToast { display: none !important; }
body[data-readonly] .docfoot-edit,
body[data-readonly] .docfoot-done { display: none; }
body[data-readonly] .docfoot-resume { display: flex; }

/* ---------- ③-b 編集中 ---------- */
.editbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 16px;
  background: #faf8f4;
  border-bottom: 1px solid #ece7dd;
  flex: none;
}
.editbar-t { font-size: 13px; color: #6e6960; }

.editor {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 20px 4px;
  font-size: 15px;
  line-height: 1.95;
  outline: none;
  white-space: pre-wrap;
  word-break: break-word;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-user-select: text;
  user-select: text;
}

/* ---------- ③-c 履歴 ---------- */
.history-notewrap { padding: 14px 20px 0; flex: none; }
.history-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px 0;
}
.hrow { display: flex; gap: 12px; }
.hrail { width: 22px; display: flex; flex-direction: column; align-items: center; flex: none; }
.hdot-now { width: 13px; height: 13px; border-radius: 50%; background: #2f4a7d; margin-top: 15px; flex: none; }
.hdot { width: 11px; height: 11px; border-radius: 50%; border: 2px solid #a9a296; background: #f7f5f0; margin-top: 16px; flex: none; }
.hdot--last { border-color: #cdc6ba; margin-top: 15px; }
.hline { width: 2px; flex: 1; background: #ddd7cc; margin: 3px 0; }
.hcard-now {
  flex: 1;
  min-width: 0;
  background: #ffffff;
  border: 1px solid #2f4a7d;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.hcard {
  flex: 1;
  min-width: 0;
  background: #ffffff;
  border: 1px solid #e4dfd5;
  border-radius: 12px;
  padding: 11px 10px 11px 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hcard-body { flex: 1; min-width: 0; }
.hcard-t { font-size: 15px; font-weight: 500; }
.hcard-s { font-size: 13px; color: #6e6960; margin-top: 3px; }
.h-ago { font-size: 13px; color: #6e6960; font-weight: 400; margin-left: 9px; }
.hmore { flex: 1; min-width: 0; padding: 10px 0; }
.history-foot { padding: 8px 20px calc(26px + env(safe-area-inset-bottom, 0px)); flex: none; }
.history-foot-t { font-size: 13px; color: #6e6960; line-height: 1.7; }

/* ---------- ④ 辞書 ---------- */
.dict-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 20px 12px;
  flex: none;
}
.dict-logo { font-size: 20px; font-weight: 600; letter-spacing: 0.04em; }
.dict-sub { font-size: 13px; color: #6e6960; margin-top: 3px; }
.round-add {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #d8d2c6;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.searchwrap { padding: 0 20px 14px; flex: none; }
.searchwrap--lib { padding-bottom: 16px; }
.searchbar {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #ffffff;
  border: 1px solid #e4dfd5;
  border-radius: 12px;
  padding: 0 14px;
  height: 48px;
}
.search-ic { flex: none; }
.search-in {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  color: #1b1a18;
}

.pending {
  margin: 0 20px 18px;
  background: #ffffff;
  border: 1px solid #e4dfd5;
  border-radius: 14px;
  overflow: hidden;
  flex: none;
}
.pending-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  border-bottom: 1px solid #efebe2;
}
.pending-h { font-size: 16px; font-weight: 700; }
.pending-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-bottom: 1px solid #efebe2;
}
.pending-body { flex: 1; min-width: 0; }
.pending-t { font-size: 15px; }
.p-from { color: #a4443c; text-decoration: line-through; }
.p-arrow { color: #6e6960; }
.p-to { font-weight: 500; }
.pending-s { font-size: 13px; color: #6e6960; margin-top: 3px; }
.pending-more { padding: 2px 14px 6px; text-align: center; }
.pending-more .linkbtn { padding: 0 14px; }

.badge-warn {
  font-size: 12px;
  font-weight: 500;
  color: #8a6412;
  background: #fbf1d8;
  border-radius: 999px;
  padding: 4px 10px;
}
.badge-done {
  font-size: 12px;
  font-weight: 500;
  color: #2c6a4a;
  background: #e8f2ea;
  border-radius: 999px;
  padding: 4px 10px;
}
.badge-count {
  font-size: 12px;
  color: #2f4a7d;
  background: #eaeef6;
  border-radius: 999px;
  padding: 4px 9px;
  font-weight: 500;
  flex: none;
}

.dict-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 20px 16px;
}
.grouplabel { font-size: 13px; color: #6e6960; font-weight: 500; margin-bottom: 7px; }
.list {
  background: #ffffff;
  border: 1px solid #e4dfd5;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
}
.list--last { margin-bottom: 0; }
.list:empty { display: none; }
.term-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  border-bottom: 1px solid #efebe2;
  color: inherit;
}
.term-row:hover { color: inherit; }
.term-row:last-child { border-bottom: none; }
.term-body { flex: 1; min-width: 0; }
.term-t { font-size: 15px; font-weight: 500; }
.term-reading { font-size: 13px; color: #6e6960; font-weight: 400; margin-left: 9px; }
.term-s { font-size: 13px; color: #6e6960; margin-top: 3px; }
.term-chev { flex: none; }

/* 辞書のバックアップ（一覧の下・スクロールの末尾） */
.dictbk { margin-top: 24px; }
.dictbk-h { font-size: 16px; font-weight: 500; }
.dictbk-p { font-size: 15px; color: #6e6960; line-height: 1.75; margin-top: 6px; }
.dictbk-btns { display: flex; gap: 10px; margin-top: 12px; }
.dictbk-note { font-size: 13px; color: #6e6960; line-height: 1.7; margin-top: 10px; }
.dictbk-note:empty { display: none; }

/* 版数（④辞書のいちばん下。目立たせない） */
.appver { font-size: 12px; color: #8d877d; text-align: center; margin-top: 18px; }
.appver:empty { display: none; }

/* ---------- ④-b 語の登録・編集 ---------- */
.termdel {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: #a4443c;
  font-size: 13px;
  font-weight: 500;
  flex: none;
}
.term-form {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 20px 10px;
}
.tf-field { margin-bottom: 20px; }
.tf-label {
  display: block;
  font-size: 13px;
  color: #6e6960;
  font-weight: 500;
  margin-bottom: 7px;
}
.tf-input {
  width: 100%;
  height: 52px;
  border: 1px solid #e4dfd5;
  border-radius: 12px;
  background: #ffffff;
  padding: 0 14px;
  font-size: 16px;
  color: #1b1a18;
  outline: none;
}
.tf-input:focus { border-color: #2f4a7d; }
.tf-error { font-size: 13px; color: #a4443c; line-height: 1.7; margin-top: 7px; }
.tf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tf-chip {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid #d8d2c6;
  background: #ffffff;
  color: #4a463f;
  font-size: 13px;
  font-weight: 500;
  flex: none;
}
.tf-chip.is-on { background: #2f4a7d; border-color: #2f4a7d; color: #ffffff; }
.tf-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tf-tags:empty { display: none; }
.tf-tag {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 2px 0 14px;
  border-radius: 999px;
  border: 1px solid #e4dfd5;
  background: #ffffff;
}
.tf-tag-t { font-size: 13px; color: #1b1a18; }
.tf-tag-x {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6e6960;
  font-size: 13px;
  flex: none;
}
.tf-hits {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0 6px;
}
.tf-hits-l { font-size: 13px; color: #6e6960; font-weight: 500; }
.term-foot {
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #ece7dd;
  background: #f7f5f0;
  flex: none;
  position: sticky;
  bottom: 0;
  z-index: 5;
}

/* ---------- ⑤ 一覧 ---------- */
.lib-head { padding: 20px 20px 12px; flex: none; }
.lib-logo { font-size: 20px; font-weight: 600; letter-spacing: 0.04em; }
.lib-sub { font-size: 13px; color: #6e6960; margin-top: 3px; }
.lib-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 20px 16px;
}
.grouplabel--lib { margin-bottom: 8px; }
.lib-drafts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.lib-done { display: flex; flex-direction: column; gap: 10px; }
.lib-card {
  display: block;
  background: #ffffff;
  border: 1px solid #e4dfd5;
  border-radius: 14px;
  padding: 14px;
  color: inherit;
}
.lib-card:hover { color: inherit; }
.lib-drafts .lib-card,
.lib-card--draft {
  border-color: #dbd3c4;
  box-shadow: 0 2px 6px rgba(70, 60, 40, 0.05);
}
.lib-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.lib-card-date { font-size: 13px; color: #6e6960; }
.lib-card-t { font-size: 15px; font-weight: 500; margin-bottom: 5px; }
.lib-card-x { font-size: 13px; color: #6e6960; line-height: 1.7; }
.excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 下に引っ張って更新する（くるくる） ----------
   色は上の一覧にあるものだけを使う（白 #ffffff / 罫線 #e4dfd5 / 藍 #2f4a7d / 副文字 #6e6960）。
   ・下がった中身の上端に出るように、画面の上の外に置いて JS で下ろす（transform は縦の動きだけ）。
   ・回転は保存インジケータと同じ @keyframes sc-rotate を使い回す。 */
.ptr {
  position: fixed;
  top: -34px;
  left: 50%;
  margin-left: -16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  background: #ffffff;
  border: 1px solid #e4dfd5;
  border-radius: 50%;
  color: #6e6960;
  box-shadow: 0 2px 6px rgba(70, 60, 40, 0.05);
  pointer-events: none;
  opacity: 0;
}
.ptr .sc-spin { display: block; }
/* しきい値を超えた＝離すと更新 */
.ptr.is-ready { color: #2f4a7d; border-color: #2f4a7d; }
/* 更新中＝回り続ける */
.ptr.is-busy { color: #2f4a7d; border-color: #2f4a7d; }
.ptr.is-busy .sc-spin { animation: sc-rotate 0.9s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  .ptr.is-busy .sc-spin { animation: none; }
}

/* ---------- 読み込めなかったときの一行 ----------
   「まだありません」（0件）と見分けがつくように、藍の字で「もう一度」を出す。 */
.read-fail {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 13px;
  line-height: 1.7;
  color: #2f4a7d;
  padding: 12px 4px;
  min-height: 44px;
}
