/* =========================================================================
   Phrasebite のデザイントークン（soft-bold / C 案）。
   正本: apps/phrases/design/concepts/soft-bold/styles.css と soft-bold-v2/v2.css。
   画面側では生の色コードを使わず、必ずここのトークンを参照する。
   テーマ: 既定は端末の設定（prefers-color-scheme）。<html data-theme="light|dark"> で上書き。
   ========================================================================= */

/* ---------- ライト ---------- */
:root {
  color-scheme: light;

  /* 地と面 */
  --bg: #F5F2FC;
  --mesh-a: #E3DAFF;   /* 左上: ライラック */
  --mesh-b: #FFDCCB;   /* 右上: ピーチ */
  --mesh-c: #D3F1E5;   /* 左下: ミント */
  --mesh-d: #FFDDEB;   /* 右下: ローズ */
  --surface: #FFFFFF;
  --surface-2: #F6F3FD;   /* 一段沈んだ面（入力欄・チップ） */
  --surface-3: #ECE7F8;   /* 押下・未達のトラック */
  --glass: rgba(255, 255, 255, .72);
  --line: #E8E3F4;
  --line-strong: #D9D2EC;

  /* 文字 */
  --ink: #1C1736;
  --ink-2: #4D4769;
  --ink-3: #6E6889;
  --ink-4: #A9A3C2;    /* 無効・プレースホルダー（情報を伝える文字には使わない） */
  --on-ink: #FFFFFF;

  /* アクセント（青紫） */
  --accent: #6A4DF4;
  --accent-hi: #7E60FF;
  --accent-lo: #5B3DEB;
  --accent-edge: #3F26B5;
  --accent-soft: #EEE9FF;
  --accent-ink: #5134DB;
  --on-accent: #FFFFFF;

  /* ヒーロー（今日の学習） */
  --hero-1: #5B3DF5;
  --hero-2: #8A4CF0;
  --hero-3: #E06AC0;

  /* 状態 */
  --ok: #10A36B;  --ok-ink: #0A7A4F;  --ok-soft: #DDF5EA;  --ok-edge: #B4E6CE;  --on-ok: #FFFFFF;
  --ng: #EE4B5A;  --ng-ink: #C42B3B;  --ng-soft: #FFE5E8;  --ng-edge: #F8C3CA;  --on-ng: #FFFFFF;
  --hard: #F2A01B; --hard-ink: #9A5B00; --hard-soft: #FFF0D2; --hard-edge: #F4D9A3;
  --easy: #2D8CF0; --easy-ink: #1763C0; --easy-soft: #E0EEFF; --easy-edge: #BCD8FA;
  --flame-ink: #B4410F;
  /* 連続の記録のカレンダー（学習した日）と、区分ボタンの押されている面 */
  --streak-day: #FF8B4D; --on-streak-day: #4A1A00;
  --seg-on: var(--surface);
  /* 区分ボタンの選んでいる方の輪（ライトは白い面が浮くので要らない。ダークだけ付ける。点検 visual-2-10） */
  --seg-ring: 0 0 0 0 transparent;

  /* カテゴリ（面 / 文字 / 印） */
  --c-feel: #FFE6D9;   --c-feel-ink: #A8441A;   --c-feel-dot: #FF8A5B;
  --c-time: #DFEDFF;   --c-time-ink: #1E5DB5;   --c-time-dot: #4C9BFF;
  --c-work: #DAF4E8;   --c-work-ink: #136F4E;   --c-work-dot: #2EC28A;
  --c-talk: #ECE6FF;   --c-talk-ink: #5134DB;   --c-talk-dot: #8B6CFF;
  --c-people: #FFE1EC; --c-people-ink: #B0285F; --c-people-dot: #FF6FA8;
  --c-money: #FFF2C6;  --c-money-ink: #855C00;  --c-money-dot: #F5B92E;

  /* コイン（金） */
  --coin-hi: #FFE58A;
  --coin-lo: #F5B92E;
  --coin-edge: #D08A0C;
  --coin-ink: #8A5A00;
  --coin-on: #4A2E00;
  --coin-soft: #FFF3CC;
  --coin-line: #F3D27A;
  --coin-tile-1: #FFF8DE;
  --coin-tile-2: #FFEDB8;

  /* キャラクターの舞台と床の影 */
  --stage-1: #F1ECFF;
  --stage-2: #FFE8DA;
  --stage-floor: rgba(70, 40, 150, .16);

  /* 部品ごとの面（テーマで変わるもの） */
  --tile-streak-1: #FFF4E6; --tile-streak-2: #FFE3D4;
  --tile-progress-1: #F1EDFF; --tile-progress-2: #E6DEFF;
  --week-dot: rgba(180, 65, 15, .1);
  --goal-track: rgba(160, 110, 0, .14);
  --pack-track: rgba(255, 255, 255, .6);
  --pack-lock: rgba(255, 255, 255, .7);
  --pack-free-1: #EEE8FF; --pack-free-2: #DCD1FF; --pack-free-ink: #3B2696;
  --pack-p1-1: #FFEADF;   --pack-p1-2: #FFD0C0;   --pack-p1-ink: #8F3A14;
  --pack-p2-1: #DEF6EC;   --pack-p2-2: #BFEBD8;   --pack-p2-ink: #105E43;
  --pack-p3-1: #E3EFFF;   --pack-p3-2: #C8DEFF;   --pack-p3-ink: #1A4F9C;
  --pack-p4-1: #FFF4D6;   --pack-p4-2: #FFE3A3;   --pack-p4-ink: #7A5200;
  --pack-p5-1: #FFE6F1;   --pack-p5-2: #FFCBE0;   --pack-p5-ink: #8E1F55;
  --pack-p6-1: #DFF4F7;   --pack-p6-2: #BDE7EE;   --pack-p6-ink: #0E5A68;
  --pack-p7-1: #EEF7D9;   --pack-p7-2: #DCEFB4;   --pack-p7-ink: #466A0E;
  --pack-p8-1: #F1ECE4;   --pack-p8-2: #E3D9C8;   --pack-p8-ink: #5E4A2E;
  --mark-strength: 28%;
  --btn-ink-edge: color-mix(in oklab, var(--ink) 70%, #000);
  --btn-ink-glow: rgba(20, 10, 50, .3);
  --char-outline: none;

  /* 影 */
  --sh-hairline: 0 0 0 1px rgba(40, 24, 110, .05);
  --sh-1: 0 1px 2px rgba(40, 24, 110, .06), 0 2px 6px -2px rgba(40, 24, 110, .08);
  --sh-2: 0 1px 2px rgba(40, 24, 110, .05), 0 6px 14px -6px rgba(40, 24, 110, .12), 0 18px 32px -18px rgba(70, 40, 170, .22);
  --sh-3: 0 2px 4px rgba(40, 24, 110, .05), 0 14px 28px -12px rgba(70, 40, 170, .22), 0 40px 70px -34px rgba(120, 60, 200, .38);
  --sh-inset: inset 0 1px 0 rgba(255, 255, 255, .9);
  --sh-press: inset 0 2px 4px rgba(40, 24, 110, .08);
  --sh-sheet: 0 -10px 40px -10px rgba(40, 24, 110, .25);
  /* 下からのシートの後ろを暗くする幕（social-base.css の .sb-sheet-backdrop） */
  --scrim: rgba(20, 14, 40, .36);

  /* 角丸 */
  --r-xs: 10px; --r-sm: 14px; --r-md: 20px; --r-lg: 28px; --r-xl: 36px; --r-pill: 999px;

  /* 余白 */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  --gutter: 20px;

  /* キャラクターの大きさ */
  --char-xs: 32px; --char-sm: 44px; --char-md: 64px; --char-lg: 96px; --char-xl: 156px; --char-2xl: 200px;

  /* 下部タブ（浮いたガラス） */
  --tabbar-h: 64px;
  --tabbar-gap: 14px;
  /* 上下の safe area（時刻・Dynamic Island と、ホームのバー）。check-layout の --safe-top はここを上書きして iPhone の上端を模す */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tab-space: calc(var(--tabbar-h) + var(--tabbar-gap) + var(--safe-b) + 8px);

  /* 書体: 英字 → 和文。和文は見出しだけ Zen Maru（PB Maru）、本文は端末のフォント */
  --font-sys-ja: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --font-ui: "PB Latin", var(--font-sys-ja);
  --font-head: "PB Latin", "PB Maru", "Hiragino Maru Gothic ProN", var(--font-sys-ja);
  --font-en: "PB English", var(--font-sys-ja);
  --font-num: "PB Num", "PB Latin", var(--font-sys-ja);

  /* モーション */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: linear(0, .009, .035 2.1%, .141 4.4%, .723 12.9%, .938 16.7%, 1.017 19.4%, 1.067, 1.099 24.3%, 1.108 26%, 1.103, 1.087 30.6%, 1.019 39.2%, .998 43.7%, .99 48.4%, .997 59.9%, 1);
  --d-tap: 120ms; --d-fast: 180ms; --d-base: 280ms; --d-slow: 420ms;

  --icon-stroke: 2;
}

/* ---------- ダーク（端末の設定に従う。data-theme="light" のときは除く） ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #13101E;
    --mesh-a: #2B2160; --mesh-b: #3B1F35; --mesh-c: #0E2E2A; --mesh-d: #2F1A45;
    --surface: #1F1B2E; --surface-2: #191626; --surface-3: #2A253D;
    --glass: rgba(31, 27, 46, .74);
    --line: #2E2943; --line-strong: #3A3452;
    --ink: #F2EFFC; --ink-2: #C0BAD9; --ink-3: #948EB0; --ink-4: #5E5878; --on-ink: #16121F;
    --accent: #A08CFF; --accent-hi: #8C70FF; --accent-lo: #6A4DF4; --accent-edge: #3A2694;
    --accent-soft: #2C2550; --accent-ink: #B9A9FF; --on-accent: #FFFFFF;
    --hero-1: #4A2FE0; --hero-2: #7339D6; --hero-3: #B4479F;
    --ok: #3DD68C;  --ok-ink: #5BE3A0;  --ok-soft: #12332A;  --ok-edge: #1C4A3C;  --on-ok: #0B2A1E;
    --ng: #FF6B78;  --ng-ink: #FF8C95;  --ng-soft: #3A1A22;  --ng-edge: #55252F;  --on-ng: #2A0E13;
    --hard: #F5B13D; --hard-ink: #FFC566; --hard-soft: #382A12; --hard-edge: #4E3B1A;
    --easy: #5AA8FF; --easy-ink: #8CC2FF; --easy-soft: #15283F; --easy-edge: #3D6FA6;
    --streak-day: #F27A3A; --on-streak-day: #2A0E00;
    /* ダークは面の差が小さい（溝 #191626 と --surface-3 で約 1.3）ので、一段明るい面と紫の輪で選んでいる方を示す（点検 visual-2-10） */
    --seg-on: #3B3456; --seg-ring: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent);
    --flame-ink: #FFB07A;
    --c-feel: #3A2420;   --c-feel-ink: #FFB590;
    --c-time: #18283F;   --c-time-ink: #8EC0FF;
    --c-work: #132E25;   --c-work-ink: #6EDDAE;
    --c-talk: #282249;   --c-talk-ink: #B9A9FF;
    --c-people: #3A1D2B; --c-people-ink: #FF9EC3;
    --c-money: #33290F;  --c-money-ink: #F5CD62;
    --coin-ink: #FFD27A; --coin-soft: #352A10; --coin-line: #5A4718; --coin-edge: #A86A00;
    --coin-tile-1: #352B12; --coin-tile-2: #2B2210;
    --stage-1: #2A2250; --stage-2: #33201D; --stage-floor: rgba(0, 0, 0, .5);
    --tile-streak-1: #33241F; --tile-streak-2: #2C1C25;
    --tile-progress-1: #262046; --tile-progress-2: #211B3A;
    --week-dot: rgba(255, 176, 122, .12);
    --goal-track: rgba(255, 210, 122, .12);
    --pack-track: rgba(255, 255, 255, .1);
    --pack-lock: rgba(255, 255, 255, .12);
    --pack-free-1: #322A63; --pack-free-2: #261F4D; --pack-free-ink: #D6CCFF;
    --pack-p1-1: #42281F;   --pack-p1-2: #33201D;   --pack-p1-ink: #FFC3A6;
    --pack-p2-1: #173A2E;   --pack-p2-2: #122C24;   --pack-p2-ink: #8FE8C0;
    --pack-p3-1: #1C3352;   --pack-p3-2: #162841;   --pack-p3-ink: #A9CEFF;
    --pack-p4-1: #3D3117;   --pack-p4-2: #302612;   --pack-p4-ink: #FFD98A;
    --pack-p5-1: #42213A;   --pack-p5-2: #341A2E;   --pack-p5-ink: #FFB3D4;
    --pack-p6-1: #163A40;   --pack-p6-2: #112D32;   --pack-p6-ink: #9EE4EE;
    --pack-p7-1: #2A3A14;   --pack-p7-2: #212E10;   --pack-p7-ink: #CFEA8F;
    --pack-p8-1: #3A3328;   --pack-p8-2: #2E2920;   --pack-p8-ink: #E6D6B8;
    --mark-strength: 38%;
    --btn-ink-edge: #B9B2D6;
    --btn-ink-glow: rgba(0, 0, 0, .5);
    --char-outline: drop-shadow(0 0 1px rgba(255, 255, 255, .28));
    --sh-hairline: 0 0 0 1px rgba(255, 255, 255, .04);
    --sh-1: 0 1px 2px rgba(0, 0, 0, .4);
    --sh-2: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 24px -10px rgba(0, 0, 0, .55);
    --sh-3: 0 2px 4px rgba(0, 0, 0, .35), 0 20px 40px -16px rgba(0, 0, 0, .7), 0 40px 80px -40px rgba(110, 70, 255, .35);
    --sh-inset: inset 0 1px 0 rgba(255, 255, 255, .06);
    --sh-press: inset 0 2px 4px rgba(0, 0, 0, .3);
    --sh-sheet: 0 -10px 40px -10px rgba(0, 0, 0, .6);
    --scrim: rgba(4, 2, 12, .6);
  }
}

/* ---------- ダーク（設定で「ダーク」を選んだとき） ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #13101E;
  --mesh-a: #2B2160; --mesh-b: #3B1F35; --mesh-c: #0E2E2A; --mesh-d: #2F1A45;
  --surface: #1F1B2E; --surface-2: #191626; --surface-3: #2A253D;
  --glass: rgba(31, 27, 46, .74);
  --line: #2E2943; --line-strong: #3A3452;
  --ink: #F2EFFC; --ink-2: #C0BAD9; --ink-3: #948EB0; --ink-4: #5E5878; --on-ink: #16121F;
  --accent: #A08CFF; --accent-hi: #8C70FF; --accent-lo: #6A4DF4; --accent-edge: #3A2694;
  --accent-soft: #2C2550; --accent-ink: #B9A9FF; --on-accent: #FFFFFF;
  --hero-1: #4A2FE0; --hero-2: #7339D6; --hero-3: #B4479F;
  --ok: #3DD68C;  --ok-ink: #5BE3A0;  --ok-soft: #12332A;  --ok-edge: #1C4A3C;  --on-ok: #0B2A1E;
  --ng: #FF6B78;  --ng-ink: #FF8C95;  --ng-soft: #3A1A22;  --ng-edge: #55252F;  --on-ng: #2A0E13;
  --hard: #F5B13D; --hard-ink: #FFC566; --hard-soft: #382A12; --hard-edge: #4E3B1A;
  --easy: #5AA8FF; --easy-ink: #8CC2FF; --easy-soft: #15283F; --easy-edge: #3D6FA6;
  --streak-day: #F27A3A; --on-streak-day: #2A0E00;
  --seg-on: #3B3456; --seg-ring: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent);
  --flame-ink: #FFB07A;
  --c-feel: #3A2420;   --c-feel-ink: #FFB590;
  --c-time: #18283F;   --c-time-ink: #8EC0FF;
  --c-work: #132E25;   --c-work-ink: #6EDDAE;
  --c-talk: #282249;   --c-talk-ink: #B9A9FF;
  --c-people: #3A1D2B; --c-people-ink: #FF9EC3;
  --c-money: #33290F;  --c-money-ink: #F5CD62;
  --coin-ink: #FFD27A; --coin-soft: #352A10; --coin-line: #5A4718; --coin-edge: #A86A00;
  --coin-tile-1: #352B12; --coin-tile-2: #2B2210;
  --stage-1: #2A2250; --stage-2: #33201D; --stage-floor: rgba(0, 0, 0, .5);
  --tile-streak-1: #33241F; --tile-streak-2: #2C1C25;
  --tile-progress-1: #262046; --tile-progress-2: #211B3A;
  --week-dot: rgba(255, 176, 122, .12);
  --goal-track: rgba(255, 210, 122, .12);
  --pack-track: rgba(255, 255, 255, .1);
  --pack-lock: rgba(255, 255, 255, .12);
  --pack-free-1: #322A63; --pack-free-2: #261F4D; --pack-free-ink: #D6CCFF;
  --pack-p1-1: #42281F;   --pack-p1-2: #33201D;   --pack-p1-ink: #FFC3A6;
  --pack-p2-1: #173A2E;   --pack-p2-2: #122C24;   --pack-p2-ink: #8FE8C0;
  --pack-p3-1: #1C3352;   --pack-p3-2: #162841;   --pack-p3-ink: #A9CEFF;
  --pack-p4-1: #3D3117;   --pack-p4-2: #302612;   --pack-p4-ink: #FFD98A;
  --pack-p5-1: #42213A;   --pack-p5-2: #341A2E;   --pack-p5-ink: #FFB3D4;
  --pack-p6-1: #163A40;   --pack-p6-2: #112D32;   --pack-p6-ink: #9EE4EE;
  --pack-p7-1: #2A3A14;   --pack-p7-2: #212E10;   --pack-p7-ink: #CFEA8F;
  --pack-p8-1: #3A3328;   --pack-p8-2: #2E2920;   --pack-p8-ink: #E6D6B8;
  --mark-strength: 38%;
  --btn-ink-edge: #B9B2D6;
  --btn-ink-glow: rgba(0, 0, 0, .5);
  --char-outline: drop-shadow(0 0 1px rgba(255, 255, 255, .28));
  --sh-hairline: 0 0 0 1px rgba(255, 255, 255, .04);
  --sh-1: 0 1px 2px rgba(0, 0, 0, .4);
  --sh-2: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 24px -10px rgba(0, 0, 0, .55);
  --sh-3: 0 2px 4px rgba(0, 0, 0, .35), 0 20px 40px -16px rgba(0, 0, 0, .7), 0 40px 80px -40px rgba(110, 70, 255, .35);
  --sh-inset: inset 0 1px 0 rgba(255, 255, 255, .06);
  --sh-press: inset 0 2px 4px rgba(0, 0, 0, .3);
  --sh-sheet: 0 -10px 40px -10px rgba(0, 0, 0, .6);
  --scrim: rgba(4, 2, 12, .6);
}

/* =========================================================================
   Phrasebite のグローバル CSS（soft-bold）。トークンは tokens.css。
   1. リセットと文字  2. シェルと1画面レイアウト  3. 共通部品
   ========================================================================= */

/* ---------- 1. リセットと文字 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  overscroll-behavior: none;   /* 画面全体がゴムのように跳ねない（引っ張って再読み込みもしない） */
  height: 100%;
  background: var(--bg);
}
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.7;
  letter-spacing: .03em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  /* 和文は文節で折る: 文節の間に <wbr> を入れてある（app/phraseBreak.ts）ので、和文の文字の間では折らない。
     入りきらない長い語だけは、はみ出さないよう折る（break-word）。Safari は auto-phrase に対応しないため、この形にしている */
  word-break: keep-all;
  overflow-wrap: break-word;
  line-break: strict;       /* 行頭に句読点・小書き・長音を置かない */
  hyphens: none;            /* 英語を自動ハイフンで割らない */
  overflow: hidden;           /* アプリの枠は1画面。スクロールは各画面の中だけ */
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
img, svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in oklab, var(--accent) 60%, transparent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* アイコンのスプライト（components/Icon.tsx）。場所を取らせない */
.icon-sprite { position: absolute; }

/* 見出し・ボタン・ラベルの和文は丸ゴシック（PB Maru）。本文は端末のフォント */
h1, h2, h3, .head, .btn, .bubble, .label, .tabbar__item, .chip, .seg__btn { font-family: var(--font-head); }

:lang(en) { font-family: var(--font-en); letter-spacing: -.005em; line-height: 1.45; hyphens: none; overflow-wrap: normal; }
/* 行の分かれ方: 段落は最終行の孤立を減らし、見出し・吹き出しは行の長さをそろえる */
/* 段落に text-wrap: pretty は使わない。WebKit は keep-all（和文を文節で折る指定）と pretty が重なると、ページごと落ちる
   （2026-10-18 に利用規約の画面で再現。tests/app/css-guards.test.ts）。孤立行は文言と check-layout で防ぐ */
/* 和文には text-wrap: balance を使わない（行の長さをそろえるために早めに折る。オーナー指示 2026-10-18「入るなら次の文節まで同じ行に」） */
.ja-en { font-family: var(--font-en); font-weight: 750; letter-spacing: -.01em; margin-inline: .22em; white-space: nowrap; }
/* よくある間違い（× 誤り → ○ 正しい形）。英文はそれぞれ 1 行に */
/* 押す部品: 長押しでリンクのプレビュー・選択が出ないように */
a.btn, .btn, .tabbar__item, .row, .pack, .link-row, .chip, .icon-btn, .ss-btn, .ss-icon, .choice, .sh-btn, .sb-btn, .seg__btn, .front, .closet-item, .rate button, .chips button {
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
img, svg { -webkit-touch-callout: none; -webkit-user-drag: none; }
/* リンクの長押しで、アプリの画面を Web ページとして先に見せる表示とメニューを出さない（アプリの中の移動のリンクを長押しで開く意味は無い。点検 iphone-03） */
a { -webkit-touch-callout: none; }
/* iPhone のアプリ: 見出し・ラベル・説明の文字を長押しで選ばせない（ネイティブのアプリと同じ）。
   英語の例文（辞書で引ける）・規約などの本文・コード・入力欄は選べるまま。点検 iphone-04 */
html[data-native] body { -webkit-user-select: none; user-select: none; }
html[data-native] :is([lang="en"], .legal-body, .addf-code, input, textarea, .selectable, .selectable *) { -webkit-user-select: text; user-select: text; }
/* 文ごとの塊（吹き出しで文の途中で折れないように） */
/* 文ごとの塊。以前は inline-block で文を丸ごと次の行に送っていたが、行末が空いたまま早めに折れるのでやめた（行はできるだけ埋める） */
.sent { display: inline; }
.mis__note { display: block; }
.mis__pair { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.mis__ng, .mis__ok { display: flex; align-items: baseline; gap: 6px; font-family: var(--font-en); font-weight: 700; letter-spacing: -.005em; }
.mis__ng .ico, .mis__ok .ico { align-self: center; stroke-width: 2.8; }
.mis__ng { color: var(--ng-ink); }
.mis__ok { color: var(--ok-ink); }
/* 数字と単位・固有名など、途中で折らないもの（DESIGN_QUALITY_GUIDE §3.2） */
.nowrap { white-space: nowrap; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: 0; font-feature-settings: "tnum" 1; }
.eyebrow { font-family: var(--font-en); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; line-height: 1.2; }
.label { font-size: 12px; font-weight: 700; letter-spacing: .06em; line-height: 1.4; color: var(--ink-3); }
.muted { color: var(--ink-3); }
.mark {
  font-weight: 800; color: var(--ink);
  background: linear-gradient(transparent 58%, color-mix(in oklab, var(--accent) var(--mark-strength), transparent) 58%, color-mix(in oklab, var(--accent) var(--mark-strength), transparent) 92%, transparent 92%);
  border-radius: 2px; padding: 0 1px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: var(--icon-stroke); stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico--sm { width: 18px; height: 18px; }
.ico--xs { width: 15px; height: 15px; stroke-width: 2.4; }
.ico--fill { fill: currentColor; stroke: none; }
.ico-art { width: 22px; height: 22px; flex: none; }

/* ---------- 2. シェルと1画面レイアウト ---------- */
#app { height: 100%; }
.shell {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
}
/* パステルのメッシュ地 */
.shell::before {
  content: "";
  position: absolute; inset: -10%;
  z-index: -1;
  background:
    radial-gradient(42% 30% at 6% 4%, var(--mesh-a) 0%, transparent 100%),
    radial-gradient(46% 28% at 100% 10%, var(--mesh-b) 0%, transparent 100%),
    radial-gradient(50% 34% at 0% 74%, var(--mesh-c) 0%, transparent 100%),
    radial-gradient(52% 36% at 100% 100%, var(--mesh-d) 0%, transparent 100%),
    var(--bg);
  pointer-events: none;
}

/* 1画面: 高さ 100dvh、本文は flex で伸び、操作は下に固定 */
.screen {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  /* --notice-h: 保存先の案内の帯が出ているときの、その高さ（App.tsx の StorageNotice） */
  padding: calc(var(--safe-t, 0px) + var(--notice-h, 0px) + 10px) var(--gutter) calc(var(--safe-b) + 12px);
  overflow: hidden;
}
.shell[data-tabs="on"] .screen { padding-bottom: var(--tab-space); }
.screen__head { flex: none; }
.screen__body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.screen__body--scroll { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter) 8px; }
.screen__body--scroll::-webkit-scrollbar { display: none; }
.screen__actions { flex: none; display: flex; flex-direction: column; gap: 10px; padding-top: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row-flex { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }

/* 集中画面などの上部（戻る・見出し・右端） */
.navbar { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; height: 52px; flex: none; }
.navbar__title { text-align: center; font-family: var(--font-head); font-size: 15px; font-weight: 900; letter-spacing: .06em; line-height: 1.3; }
.navbar__end { justify-self: end; display: flex; }

/* 画面の見出し */
.page-head { display: flex; align-items: flex-end; gap: 10px; padding: 4px 0 10px; flex: none; }
.page-head h1 { font-size: 28px; font-weight: 900; letter-spacing: .03em; line-height: 1.2; }
.page-head p { font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: .04em; line-height: 1.5; margin-top: 2px; }
.page-head > :last-child:not(:first-child) { margin-left: auto; }

.sec { display: flex; align-items: center; gap: 8px; margin: 14px 2px 8px; }
.sec h2 { font-size: 15px; font-weight: 900; letter-spacing: .05em; line-height: 1.3; }
.sec small { font-size: 11.5px; font-weight: 700; color: var(--ink-3); letter-spacing: .04em; }
.sec__more { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; min-height: 32px; font-size: 12px; font-weight: 700; color: var(--accent-ink); letter-spacing: .04em; }
.sec__more .ico { width: 14px; height: 14px; stroke-width: 2.4; }

/* ---------- 3. 共通部品 ---------- */
/* 面（押せない情報）: 浮いた面で厚みなし */
.card, .surface {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-hairline), var(--sh-2), var(--sh-inset);
}
.card { padding: 16px; }
.card--flat { box-shadow: var(--sh-hairline), var(--sh-1); }
.well { padding: 10px 14px; border-radius: var(--r-sm); background: var(--surface-2); }

/* 丸いアイコンボタン（44px） */
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-grid; place-items: center; flex: none;
  background: var(--surface); color: var(--ink);
  box-shadow: var(--sh-hairline), var(--sh-1), var(--sh-inset);
  transition: transform var(--d-tap) var(--ease-out);
}
.icon-btn:active { transform: scale(.94); }
.icon-btn--soft { background: var(--accent-soft); color: var(--accent-ink); box-shadow: none; }
.icon-btn--ghost { background: transparent; box-shadow: none; }
.icon-btn--lg { width: 52px; height: 52px; }
.icon-btn:disabled { opacity: .45; }

/* 立体のボタン: 上の光・下の厚み・遠い色付きの影。押すと 3px 沈む */
/*
 * 立体のボタン。下の縁（--btn-edge）は影ではなく border-bottom で描く（面は background-clip: padding-box）。
 * 押したときは枠を動かさず、透明な border-top を足して面だけを縁の上に沈める。
 * 枠（押せる領域）が動かないので、指を置いた場所と反応する場所がずれない（オーナー指摘 2026-10-31。
 * transform で枠ごと沈めると、押した瞬間に枠が指の下から 3px 逃げて、上の端や縁を押したときに反応しない）
 */
.btn {
  --btn-bg: linear-gradient(180deg, var(--accent-hi), var(--accent-lo));
  --btn-ink: var(--on-accent);
  --btn-edge: var(--accent-edge);
  --btn-glow: rgba(98, 64, 240, .45);
  --btn-depth: 4px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: calc(56px + var(--btn-depth)); padding: 0 24px;
  border: 0 solid transparent; border-bottom: var(--btn-depth) solid var(--btn-edge);
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  background-clip: padding-box;
  color: var(--btn-ink);
  font-size: 16px; font-weight: 900; letter-spacing: .08em; line-height: 1;
  white-space: nowrap;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, .38),
    inset 0 -2px 0 rgba(0, 0, 0, .08),
    0 14px 24px -10px var(--btn-glow);
  transition: border-width var(--d-tap) var(--ease-out), box-shadow var(--d-tap) var(--ease-out);
  user-select: none;
}
.btn:active:not(:disabled):not([aria-disabled="true"]) {
  border-top-width: calc(var(--btn-depth) - 1px); border-bottom-width: 1px;
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.3), 0 6px 12px -8px var(--btn-glow);
}
.btn--block { display: flex; width: 100%; }
.btn--white { --btn-bg: linear-gradient(180deg, #FFFFFF, #F4F0FF); --btn-ink: #3E22C9; --btn-edge: rgba(30, 10, 100, .28); --btn-glow: rgba(20, 0, 80, .35); }
.btn--ink { --btn-bg: var(--ink); --btn-ink: var(--on-ink); --btn-edge: var(--btn-ink-edge); --btn-glow: var(--btn-ink-glow); }
.btn--soft { --btn-bg: var(--surface); --btn-ink: var(--ink); --btn-edge: var(--line-strong); --btn-glow: transparent; --btn-depth: 3px; box-shadow: var(--sh-hairline); }
.btn--danger { --btn-bg: var(--ng-soft); --btn-ink: var(--ng-ink); --btn-edge: var(--ng-edge); --btn-glow: transparent; --btn-depth: 3px; box-shadow: var(--sh-hairline); }
.btn--soft:active:not(:disabled):not([aria-disabled="true"]), .btn--danger:active:not(:disabled):not([aria-disabled="true"]) { box-shadow: var(--sh-hairline); }
.btn--coin { --btn-bg: linear-gradient(180deg, var(--coin-hi), var(--coin-lo)); --btn-ink: var(--coin-on); --btn-edge: var(--coin-edge); --btn-glow: rgba(230, 160, 20, .5); }
.btn--sm { min-height: calc(44px + var(--btn-depth)); padding: 0 18px; font-size: 14px; letter-spacing: .06em; }
.btn:disabled, .btn[aria-disabled="true"] { --btn-bg: var(--surface-3); --btn-ink: var(--ink-3); --btn-edge: var(--line-strong); --btn-glow: transparent; }
.btn__icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, #8467FF, #5B3DEB); color: #fff; margin-left: -8px; box-shadow: 0 4px 8px -3px rgba(80, 50, 220, .6); }
.btn__icon .ico { width: 14px; height: 14px; }

/* チップ（小さな札）と、押せるチップ（絞り込み・切り替え） */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 11px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12px; font-weight: 700; letter-spacing: .05em; line-height: 1; white-space: nowrap;
}
.chip__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.chip--feelings { background: var(--c-feel); color: var(--c-feel-ink); }
.chip--time { background: var(--c-time); color: var(--c-time-ink); }
.chip--work { background: var(--c-work); color: var(--c-work-ink); }
.chip--social { background: var(--c-people); color: var(--c-people-ink); }
.chip--everyday { background: var(--c-talk); color: var(--c-talk-ink); }
.dot--feelings { background: var(--c-feel-dot); }
.dot--time { background: var(--c-time-dot); }
.dot--work { background: var(--c-work-dot); }
.dot--social { background: var(--c-people-dot); }
.dot--everyday { background: var(--c-talk-dot); }

button.chip, a.chip { height: 44px; padding: 0 15px; font-size: 13px; background: var(--surface); box-shadow: var(--sh-hairline), var(--sh-1); flex: none; transition: transform var(--d-tap) var(--ease-out), background var(--d-fast); }
button.chip:active { transform: scale(.96); }
button.chip[aria-pressed="true"], button.chip[aria-selected="true"] { background: var(--ink); color: var(--on-ink); box-shadow: 0 6px 14px -6px rgba(28, 23, 54, .5); }
button.chip .num { font-size: 12px; opacity: .7; }
/* 横スクロールの枠は縦も切り抜くので、下の padding は選んだチップの影（下に 14px）の分。負の margin で後ろの位置は変えない */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1) -10px; padding: 2px var(--gutter) 16px; flex: none; }
.chips::-webkit-scrollbar { display: none; }

/* 入力欄 */
.field {
  display: flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: var(--sh-hairline), var(--sh-1), var(--sh-press);
  color: var(--ink-3);
}
.field input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; color: var(--ink); font-size: 16px; }
.field input::placeholder { color: var(--ink-4); }
.field:focus-within { box-shadow: 0 0 0 2px var(--accent), var(--sh-1); }
.input {
  width: 100%; height: 48px; padding: 0 14px;
  border: 0; border-radius: var(--r-md);
  background: var(--surface-2); color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  font-size: 16px;
}
.input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }

/* 区分ボタン（設定の選択肢） */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.seg__btn { min-height: 40px; padding: 0 6px; border-radius: var(--r-pill); font-size: 13px; font-weight: 700; color: var(--ink-2); letter-spacing: .04em; transition: background var(--d-fast), color var(--d-fast); }
.seg__btn[aria-pressed="true"] { background: var(--seg-on); color: var(--accent-ink); box-shadow: var(--seg-ring), var(--sh-hairline), var(--sh-1); }

/* 進捗バーとリング */
.progress { height: 8px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-hi), #C26BEA); box-shadow: inset 0 1px 0 rgba(255,255,255,.4); transition: width var(--d-base) var(--ease-out); }
.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring__track { stroke: color-mix(in oklab, var(--accent) 14%, transparent); }
.ring__bar { stroke: var(--accent); transition: stroke-dashoffset var(--d-base) var(--ease-out); }
.ring__label { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-num); font-weight: 700; font-size: 13px; color: var(--ink); }

/* コイン */
.coin { width: 22px; height: 22px; flex: none; }
.coin-chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 44px; padding: 0 13px 0 8px; border-radius: var(--r-pill);
  background: var(--surface); box-shadow: var(--sh-hairline), var(--sh-1), var(--sh-inset);
  font-size: 12px; font-weight: 700; color: var(--ink-2); flex: none;
}
.coin-chip .coin { width: 24px; height: 24px; }
.coin-chip b { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 700; color: var(--ink); letter-spacing: 0; }
.coin-pill {
  display: inline-flex; align-items: center; gap: 3px; vertical-align: -.25em;
  height: 24px; padding: 0 8px 0 3px; border-radius: var(--r-pill);
  background: var(--coin-soft); color: var(--coin-ink); box-shadow: inset 0 0 0 1px var(--coin-line);
  font-family: var(--font-num); font-size: 13px; font-weight: 700; letter-spacing: 0; line-height: 1; white-space: nowrap;
}
.coin-pill .coin { width: 18px; height: 18px; }

/* 狭い画面（360・375）: コインと連続のチップを少し詰め、日付を押し出さない（5 桁のコイン・4 桁の連続でも欠けない） */
@media (max-width: 380px) {
  .coin-chip { gap: 3px; padding: 0 10px 0 6px; }
  .streak-chip { gap: 3px; padding: 0 10px 0 7px; }
  .coin-chip b, .streak-chip b { font-size: 17px; }
}

/* ストリークのチップ（押すと連続の記録） */
button.streak-chip { border: 0; font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform var(--d-tap, 120ms) var(--ease-out, ease-out); }
button.streak-chip:active { transform: scale(.96); }
.streak-chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 44px; padding: 0 14px 0 9px; border-radius: var(--r-pill);
  background: var(--surface); box-shadow: var(--sh-hairline), var(--sh-1), var(--sh-inset);
  font-size: 12px; font-weight: 700; color: var(--ink-2); flex: none;
}
.streak-chip .ico { width: 24px; height: 24px; }
.streak-chip b { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 700; color: var(--ink); letter-spacing: 0; margin-right: 1px; }

/* キャラクター・アバターの枠（B4 が中身を差し込む） */
.char-slot { position: relative; width: var(--size, var(--char-lg)); aspect-ratio: 1; flex: none; }
.char-slot > img, .char-slot > svg { position: absolute; inset: 0; width: 100%; height: 100%; filter: var(--char-outline); user-select: none; -webkit-user-drag: none; }
.avatar { position: relative; display: block; width: var(--size, var(--char-md)); aspect-ratio: 1; flex: none; border-radius: 50%; overflow: hidden; background: linear-gradient(160deg, var(--stage-1), var(--stage-2)); box-shadow: var(--sh-hairline), inset 0 -2px 0 rgba(40, 24, 110, .06); }
.avatar > img { position: absolute; left: -14%; top: -2%; width: 128%; height: 128%; }
.avatar--ring { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5.5px var(--accent); }

/* 吹き出し */
.bubble {
  position: relative;
  padding: 10px 15px 11px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--sh-hairline), var(--sh-2), var(--sh-inset);
  font-size: 14px; font-weight: 700; line-height: 1.6; letter-spacing: .03em; color: var(--ink);
}
.bubble b { font-weight: 900; }
.bubble::after {
  content: ""; position: absolute; width: 16px; height: 18px; background: inherit;
  right: -11px; bottom: 16px;
  clip-path: path("M0 0 C6 5 11 9 16 18 C9 15 4 14 0 14 Z");
}

/* 下部タブ（浮いたガラス、5つ） */
.tabbar {
  position: absolute; z-index: 20;
  left: 12px; right: 12px; bottom: calc(var(--tabbar-gap) + var(--safe-b));
  height: var(--tabbar-h);
  padding: 6px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  backdrop-filter: blur(22px) saturate(1.6);
  border-radius: var(--r-pill);
  box-shadow: var(--sh-hairline), var(--sh-3), var(--sh-inset);
}
.tabbar__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 44px;
  border-radius: var(--r-pill);
  color: var(--ink-3);
  font-size: 11px; font-weight: 700; letter-spacing: .03em; line-height: 1.3;
  transition: background var(--d-fast) var(--ease-out), color var(--d-fast);
}
.tabbar__item .ico { width: 22px; height: 22px; }
.tabbar__item[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }
.tabbar__item:active { background: var(--accent-soft); transform: scale(.96); }
.tabbar__item[aria-current="page"] .ico { stroke-width: 2.3; }

/* 下から出るシート */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(20, 12, 50, .38); animation: fade-in var(--d-fast) var(--ease-out) both; }
.sheet {
  position: fixed; z-index: 41;
  left: 50%; bottom: 8px; width: calc(100% - 16px); max-width: 464px; transform: translateX(-50%);
  padding: 10px 18px calc(18px + var(--safe-b));
  border-radius: 32px 32px 40px 40px;
  background: var(--surface);
  box-shadow: var(--sh-hairline), var(--sh-sheet), var(--sh-inset);
  animation: rise var(--d-base) var(--ease-out) both;
  /* 低い画面（375×635）でも上が切れないよう、はみ出す分はシートの中でスクロールする */
  max-height: calc(100dvh - 16px - var(--safe-t, 0px)); overflow-y: auto; overscroll-behavior: contain;
}
.sheet__grip { width: 40px; height: 5px; margin: 0 auto 12px; border-radius: 3px; background: var(--line-strong); }
.sheet__close { position: absolute; top: 14px; right: 12px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--ink-3); }
.sheet__close:active { background: var(--surface-2); }
/* 開いた直後はシートそのものにフォーカスを置く（右上の × に太い輪を出さない。useModal）。シートの面には輪を描かない */
.sheet:focus, .sheet:focus-visible { outline: none; }
.sheet__title { font-family: var(--font-head); font-size: 19px; font-weight: 900; letter-spacing: .04em; line-height: 1.35; }
.sheet__text { margin-top: 6px; font-size: 14px; color: var(--ink-2); line-height: 1.7; }
.sheet__actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

/* 小さな知らせ（操作を止めない） */
.toast {
  /* 幅は中身に合わせる（left: 50% のままだと、幅が画面の半分で止まり、短い文でも 2 行になる）。
     上は 56px のヘッダーの下に出す（ヘッダーの右上のコインの数に重なり、「コイン +320」の直後に増えた残高が隠れていた） */
  position: fixed; z-index: 50; left: 50%; top: calc(var(--safe-t, 0px) + 66px);
  transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 32px);
  padding: 10px 16px; border-radius: 22px; text-align: center;
  background: var(--ink); color: var(--on-ink);
  font-size: 13.5px; font-weight: 700; letter-spacing: .04em; line-height: 1.4;
  box-shadow: var(--sh-3);
  animation: drop var(--d-base) var(--ease-out) both;
  pointer-events: none;
}

/* 読み込み中でも枠は出す（読み込み表示は出さない） */
.blank-screen { height: 100dvh; }

/* 準備中 */
.placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.placeholder h1 { font-size: 22px; font-weight: 900; letter-spacing: .04em; line-height: 1.3; }
.placeholder p { color: var(--ink-2); }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
@keyframes drop { from { transform: translate(-50%, -12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}

/* 価格の札（墨色） */
.price { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: var(--ink); color: var(--on-ink); font-family: var(--font-num); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .01em; white-space: nowrap; }

/* 枠いっぱいにキャラクターを描く（枠の大きさは画面ごとの CSS が --size や width で決める） */
.char-slot > .pb-char { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }   /* 縁取りは character.css の .pb-char svg */

/* ---------- 横向きの iPhone・高さの足りない画面（560px 未満） ----------
   1 画面に収める作りのままだと、主ボタンが下に押し出されて見えなくなる。
   この高さでは画面全体を縦にスクロールさせ、下部タブは画面の下に固定する。大きなキャラクターは小さくする */
@media (max-height: 560px) {
  /* body の overflow: hidden を外す（body の値が画面のスクロールに伝わる。外さないと縦に動かず主ボタンに届かない。台帳 D30） */
  body { overflow: auto; }
  .shell { height: auto; min-height: 100dvh; overflow: visible; }
  .shell::before { position: fixed; inset: 0; }
  .shell .screen, .shell .pb-ss:not(.pb-ss--kb), .shell .sb-screen, .shell .shop { height: auto !important; min-height: 100dvh; overflow: visible !important; }
  .shell .pb-ss { background: transparent; }
  .shell .screen__body, .shell .pb-ss:not(.pb-ss--kb) .ss-main, .shell .pb-ss:not(.pb-ss--kb) .qz, .shell .me-pane { flex: none !important; min-height: auto !important; }
  .shell .screen__body--scroll { overflow: visible; }
  /* 法的ページ（legal.css）の本文の枠も、画面ごと動く形に戻す */
  .shell .legal-scroll { flex: none; overflow: visible; }
  .shell .hero { max-height: none; }
  .shell .tabbar { position: fixed; left: max(12px, calc(50% - 228px)); right: max(12px, calc(50% - 228px)); }
  .shell .ss-empty .char-slot, .shell .nf__body .char-slot { width: 120px !important; }
  .shell .welcome-char { width: 120px !important; height: 120px !important; }
}

/* 押した見た目（押せるのに沈まない・色が変わらないものに足す） */
.seg__btn:active, .coin-chip:active, .free-card__pack:active, .sh-row:active, .friends-switch:active,
.closet-tab:active, .legal a:active, .me-links a:active, .qz-swap:active {
  transform: scale(.97); opacity: .82; transition: transform var(--d-tap, 90ms) ease-out, opacity var(--d-tap, 90ms) ease-out;
}

/* 画面の部品を読み込み中の細い帯（すぐ出れば見えないよう 150ms 待ってから） */
.route-loading { position: fixed; z-index: 60; top: var(--safe-t, 0px); left: 0; right: 0; height: 3px; overflow: hidden; pointer-events: none; opacity: 0; display: none; }
html[data-route-loading] .route-loading { display: block; animation: route-loading-in 1ms linear 150ms forwards; }
.route-loading::before { content: ""; position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: route-loading-run 900ms ease-in-out infinite; }
@keyframes route-loading-in { to { opacity: 1; } }
@keyframes route-loading-run { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .route-loading::before { animation: none; width: 100%; opacity: .6; } }
/* 画面が変わったときに見出しへ移すフォーカスは、枠を出さない（読み上げのためのもの） */
h1[tabindex="-1"]:focus { outline: none; }
/* 開いた直後にフォーカスを置くシート・小窓の面（.sheet・.sh-sheet・.sb-sheet。useModal）には輪を描かない */
[role="dialog"][tabindex="-1"]:focus { outline: none; }

/* 読み上げの速さのボタン（SpeedButton）。1.0× 以外のときは色を付けて「変えてある」と分かるように */
.speed-btn { font-family: var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* 地は --accent-lo（ダークの --accent は薄い紫で、白い「1.25×」が 2.7:1 しかなかった。--accent-lo なら約 5.3:1） */
.speed-btn.is-on, .pb-ss .ss-icon--sm.speed-btn.is-on { background: var(--accent-lo) !important; color: var(--on-accent) !important; box-shadow: 0 0 0 2px var(--accent-soft); }

/* 保存先の案内（StorageNotice） */
.storage-notice { position: fixed; z-index: 70; top: calc(var(--safe-t, 0px) + 8px); left: 12px; right: 12px; max-width: 456px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); background: var(--ng-soft); color: var(--ng-ink); box-shadow: var(--sh-2); font-size: 13px; font-weight: 700; line-height: 1.5; }
.storage-notice p { flex: 1; margin: 0; }
.storage-notice button { flex: none; min-height: 40px; padding: 0 12px; border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font-weight: 800; }
/* 画面を描けなかったとき（CrashBoundary） */
.crash .crash__body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.crash h1 { font-size: 22px; }
.crash p { max-width: 20em; color: var(--ink-2); text-align: left; }

/* 連続の記録（components/StreakSheet.tsx） */
.streak-sheet { display: flex; flex-direction: column; align-items: stretch; gap: var(--s-4); margin-top: var(--s-2); }
.streak-sheet__big { display: flex; align-items: baseline; justify-content: center; gap: 2px; font-size: 16px; font-weight: 900; letter-spacing: .04em; color: var(--ink); }
.streak-sheet__big .ico { align-self: center; margin-right: 4px; color: var(--flame-ink); }
.streak-sheet__big .num { font-size: 40px; font-weight: 700; line-height: 1; }
.streak-sheet__big--start { font-size: 18px; }
.streak-sheet__sub, .streak-sheet__next { text-align: center; font-size: 13px; font-weight: 700; color: var(--ink-2); letter-spacing: .03em; }
.streak-sheet__sub { margin-top: calc(var(--s-1) - var(--s-4)); }
.streak-sheet__next { margin-top: calc(var(--s-2) - var(--s-4)); }
.streak-sheet__sub .num, .streak-sheet__next .num { font-size: 15px; margin: 0 2px; color: var(--ink); }
.streak-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: var(--s-3); border-radius: var(--r-md); background: var(--surface-2); }
.streak-cal__wd { text-align: center; font-size: 11px; font-weight: 700; color: var(--ink-3); }
.streak-cal__day { display: grid; place-items: center; height: 28px; border-radius: var(--r-xs); font-family: var(--font-num); font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: 0; }
.streak-cal__day.is-done { background: var(--streak-day); color: var(--on-streak-day); }
.streak-cal__day.is-frozen { background: var(--easy-soft); color: var(--easy-ink); box-shadow: inset 0 0 0 1.5px var(--easy-edge); }
.streak-cal__day.is-today { box-shadow: inset 0 0 0 2px var(--accent); }
.streak-cal__day.is-future { opacity: .35; }
.streak-cal__day--month { letter-spacing: -.02em; }
.streak-cal__legend { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.streak-freeze { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--surface-2); }
/* 題と注記は幅いっぱいに取り、ボタンはいつも次の行の右に送る。ボタンの文字が短い（「あと30コイン」）と横に並び、
   説明が 1 行 8〜10 字に押し込まれて 11 行になっていた（端末で見た目が変わらないように。点検 visual-1-01） */
.streak-freeze .grow { flex: 1 1 100%; min-width: 0; }
.streak-freeze > .btn { margin-left: auto; }
.streak-freeze .btn > .nowrap { display: inline-flex; align-items: center; gap: var(--s-1); }
.streak-freeze__title { display: flex; flex-wrap: nowrap; align-items: center; gap: 2px 6px; font-size: 14px; font-weight: 900; color: var(--ink); }
.streak-freeze__title .num { font-size: 16px; margin: 0 1px; }
.streak-freeze__title small { font-size: 12px; font-weight: 700; color: var(--ink-3); }
/* カレンダーの青い日（おやすみ券で守った日）の凡例。正方形だとチェックボックスに見えるので、横長の札にする */
.streak-freeze__key { flex: none; width: 22px; height: 14px; border-radius: 5px; background: var(--easy-soft); box-shadow: inset 0 0 0 1.5px var(--easy-edge); }
.streak-freeze__note { margin-top: 2px; font-size: 13px; color: var(--ink-3); line-height: 1.6; }
/* お金で買う道は控えめに（文字のリンク）。押せる高さは 44px とる */
.streak-freeze__shop { display: inline-flex; align-items: center; min-height: 44px; margin: -6px 0 -10px; padding: 0; background: none; border: 0; font: inherit; font-size: 13px; font-weight: 700; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.streak-freeze .btn .coin { width: 18px; height: 18px; }

/* 検索から来る人のためのフレーズのページ（src/seo/SeoPages.tsx）。tokens.css と global.css の後ろに足して 1 枚の CSS にする（scripts/build-seo.tsx）。
   アプリの枠（1 画面に収める・本体はスクロールしない）は外し、ふつうの Web ページとして縦に読ませる */

html { height: auto; overscroll-behavior: auto; }
body { overflow: visible; min-height: 100vh; overscroll-behavior: auto; }
/* Web ページなので、リンクの長押しの表示は端末に任せる（アプリの中では止めている） */
a { -webkit-touch-callout: default; }
/* 記事として読ませるので、背景は白い紙（アプリの紫の背景にしない。開いてすぐアプリの画面に見えると戻られる。オーナーの指示 2026-11-21） */
body { background: var(--surface); }

/* ---------- 上と下 ---------- */
.sb-top {
  max-width: 680px; margin: 0 auto; padding: 8px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.sb-logo { display: flex; align-items: center; gap: 8px; min-height: 44px; font-family: var(--font-en); font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.sb-logo__mark { width: 30px; height: 30px; }
.sb-get {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: var(--r-pill);
  background: var(--surface); color: var(--accent-ink); font-family: var(--font-head); font-size: 13px; font-weight: 700; letter-spacing: .04em;
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.sb-foot { max-width: 680px; margin: 0 auto; padding: 32px 16px 40px; text-align: center; }
.sb-foot__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; font-size: 12px; color: var(--ink-3); }
.sb-foot__links a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.sb-foot__name { margin-top: 8px; font-size: 12px; color: var(--ink-3); }

/* ---------- 本文 ---------- */
.sb-main { max-width: 680px; margin: 0 auto; padding: 0 16px; }
/* パンくずのリンクは指で押せる高さ（44px）。そのぶん上下の余白を詰めて、見た目の間隔は前と同じにする */
.sb-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; margin: -4px 0 8px; font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.sb-crumb__here { display: inline-flex; align-items: center; gap: 8px; }
.sb-crumb a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; display: inline-flex; align-items: center; min-height: 44px; }

.sb-head { padding: 24px 20px; border-radius: var(--r-lg); background: var(--surface-2); }
/* 一覧はパンくずが無いので、ロゴの帯との間を少し空ける */
.sb-head--index { margin-top: 12px; }
/* 記事の頭: 分類と言い方（チップにせず、小さな字の見出し）・題・発音 */
.sb-art__head { margin-top: 4px; }
.sb-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: .04em; line-height: 1.5; }
.sb-kicker span + span { padding-left: 12px; border-left: 1px solid var(--line-strong); }
.sb-art__head .sb-h1 { margin-top: 8px; }
/* 調べに来た人が最初に知りたい答え。題のすぐ下の、薄い紫の箱 */
.sb-answer { margin-top: 20px; padding: 16px 18px 18px; border-radius: var(--r-md); background: var(--accent-soft); }
.sb-answer__label { font-size: 12px; font-weight: 700; color: var(--accent-ink); letter-spacing: .08em; line-height: 1.5; }
.sb-answer .sb-mean { margin-top: 4px; }
.sb-answer .sb-mean__detail { color: var(--ink); }
.sb-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sb-tags .chip { height: 26px; padding: 0 10px; font-size: 12px; }
.sb-tag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.sb-h1 { margin-top: 12px; }
/* 見出しの英語は画面の幅に合わせて小さくし（360px でも 1 語だけが次の行に落ちない）、行の長さをそろえる */
.sb-phrase { display: block; font-family: var(--font-en); font-size: min(36px, 8.4vw); font-weight: 800; line-height: 1.12; letter-spacing: -.025em; color: var(--ink); text-wrap: balance; }
.sb-phrase--long { font-size: min(29px, 6.5vw); }
.sb-phrase--xlong { font-size: min(26px, 6.5vw); }
.sb-h1__sub { display: block; margin-top: 8px; font-size: 14px; font-weight: 500; color: var(--ink-2); letter-spacing: .04em; }
.sb-h1--index { margin-top: 0; font-size: 25px; font-weight: 900; line-height: 1.4; letter-spacing: .02em; text-spacing-trim: trim-start; }
.sb-ipa { margin-top: 8px; font-size: 14px; color: var(--ink-3); }
.sb-mean { margin-top: 16px; font-family: var(--font-head); font-size: 23px; font-weight: 900; line-height: 1.45; letter-spacing: .02em; color: var(--accent-ink); }
.sb-mean__detail { margin-top: 8px; font-size: 15px; color: var(--ink-2); line-height: 1.7; }
.sb-lead { margin-top: 12px; font-size: 15px; color: var(--ink-2); line-height: 1.7; }

/* 本文の行間は 1.7、注は 1.6、余白は 4 の倍数にそろえる（デザインの点検 2026-11-17） */
/* 段落の頭の「「」「（」の半角ぶんの空きを詰める（下の行より字下げして見えた） */
.sb-mean, .sb-mean__detail, .sb-text, .sb-senses__mean, .sb-senses__note, .sb-ex__ja, .sb-rels .rel p, .sb-lead { text-spacing-trim: trim-start; }
.sb-sec { margin-top: 32px; }
.sb-sec__title { margin-bottom: 12px; padding-left: 12px; border-left: 4px solid var(--accent); font-size: 18px; font-weight: 900; line-height: 1.4; letter-spacing: .04em; text-spacing-trim: trim-start; }
.sb-text { font-size: 16px; color: var(--ink); line-height: 1.8; }
.sb-text--sub { margin-top: 8px; font-size: 14px; color: var(--ink-2); }

/* 意味（いくつかあるとき） */
.sb-senses { display: flex; flex-direction: column; gap: 16px; }
.sb-senses li { display: grid; grid-template-columns: 24px 1fr; gap: 12px; }
/* 番号は面の上に置く（紫の塗りにすると、本文より先に目に入る） */
.sb-senses__n { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--surface); box-shadow: var(--sh-hairline); color: var(--accent-ink); font-size: 13px; font-weight: 700; margin-top: 2px; }
.sb-senses__mean { font-size: 16px; font-weight: 700; line-height: 1.6; }
.sb-senses__note { margin-top: 4px; font-size: 14px; color: var(--ink-2); line-height: 1.6; }

/* 例文 */
.sb-ex { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.sb-ex li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.sb-ex__scene { font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: .06em; line-height: 1.4; }
.sb-ex__en { margin-top: 4px; font-size: 18px; font-weight: 500; line-height: 1.45; letter-spacing: -.005em; color: var(--ink); }
.sb-ex__ja { margin-top: 4px; font-size: 14px; color: var(--ink-2); line-height: 1.6; }

/* 会話（アプリの詳細と同じ形。話し手の丸は A が紫・B が緑） */
.sb-dlg { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r-md); background: var(--surface-2); }
.sb-dlg .dlg__scene { font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: .04em; line-height: 1.5; }
.sb-dlg .dlg__row { display: flex; gap: 10px; align-items: baseline; font-size: 16px; line-height: 1.45; }
.sb-dlg .dlg__who { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-en); font-size: 12px; font-weight: 800; letter-spacing: 0; background: var(--accent-soft); color: var(--accent-ink); }
.sb-dlg .dlg__row[data-who="B"] .dlg__who { background: var(--ok-soft); color: var(--ok-ink); }
.sb-dlg .dlg__ja { display: block; margin-top: 2px; font-size: 14px; color: var(--ink-3); line-height: 1.6; }

/* 似た表現・注意 */
/* 似た表現と注意は 1 枚の面に行を重ねる（小さな箱を並べると、ほかの節より目立ってしまう） */
.sb-rels { display: flex; flex-direction: column; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.sb-rels .rel { padding: 12px 16px; border-radius: 0; background: transparent; box-shadow: none; }
.sb-rels .rel + .rel { border-top: 1px solid var(--line); }
.sb-rels .rel b { display: block; font-family: var(--font-en); font-size: 16px; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
.sb-rels .rel p { margin-top: 2px; font-size: 14px; color: var(--ink-2); line-height: 1.7; }
.sb-rels .rel--warn { background: var(--hard-soft); }
.sb-rels .rel--warn p { color: var(--ink); }
.sb-rels .mis__pair { font-size: 15px; }

.sb-variants { display: flex; flex-wrap: wrap; row-gap: 4px; }
/* ほかの形は押せないので、丸い札（押せるチップと同じ形）にしない。「／」で区切った文字の並び（デザインの点検 2026-11-21） */
.sb-variants li { padding: 0; background: none; font-size: 16px; font-weight: 700; line-height: 1.6; }
/* 区切りは前の語の後ろに付ける（行が分かれたとき、「／」が行の頭に来ないように） */
.sb-variants li:not(:last-child)::after { content: "／"; margin: 0 .5em; color: var(--ink-4); font-weight: 500; }

/* 一覧の分類へ飛ぶ */
.sb-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.sb-jump .chip { height: 44px; padding: 0 15px; font-size: 13px; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.sb-sec[id], .sb-jump[id] { scroll-margin-top: 12px; }
/* 長い一覧の途中から、分類へ飛ぶチップに戻る */
.sb-back { display: flex; justify-content: flex-end; }
.sb-back a { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 2px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.sb-back .ico { transform: rotate(90deg); }

/* 一覧の行 */
.sb-list { border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.sb-list li + li { border-top: 1px solid var(--line); }
.sb-item { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 12px; min-height: 60px; padding: 12px 12px 12px 16px; }
.sb-item:active { background: var(--surface-2); }
.sb-item__en { grid-column: 1; font-size: 16px; font-weight: 800; line-height: 1.35; letter-spacing: -.01em; text-wrap: balance; }
.sb-item__ja { grid-column: 1; font-size: 13px; color: var(--ink-3); line-height: 1.55; }
/* ほかのパックの中身の例（「figure out」や「wrap up」など）。かぎ括弧はどれも半字にする。ブラウザの詰め（text-spacing-trim）は
   1 行目の頭しか詰めず、iPhone の Safari は詰めないので、自分で詰めてどこでも同じにする（デザインの点検 2026-11-21） */
.sb-samples { text-spacing-trim: space-all; }
.sb-q-o { margin-left: -.5em; }
.sb-q-c { margin-right: -.5em; }
.sb-item__go { grid-column: 2; grid-row: 1 / span 2; color: var(--ink-4); }
.sb-packs__lead { margin: -4px 0 12px; }
.sb-list__shelf { padding: 12px 16px 8px; background: var(--surface-2); font-size: 13px; font-weight: 700; color: var(--ink); letter-spacing: .04em; line-height: 1.4; }
/* パックの 200 フレーズの一覧へ（認知の施策 S20）。一覧の行の中では、フレーズの行と見分けがつくよう英語の太字にしない。
   すぐ下のパックの名前の帯より目立たないよう、行は少し低く（上のまとまりの終わりに見えるように。デザインの点検 2026-11-21） */
.sb-item--all { min-height: 48px; padding-block: 8px; }
.sb-item__all { grid-column: 1; font-size: 14px; font-weight: 700; color: var(--accent-ink); line-height: 1.5; }
.sb-item--all .sb-item__go { grid-row: 1; color: var(--accent-ink); }
.sb-more { display: flex; justify-content: flex-end; margin-top: 4px; }
.sb-more a { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 2px; font-size: 14px; font-weight: 700; color: var(--accent-ink); }
/* 一覧の行の補足（パックの中の、例文まで読める試し読み） */
.sb-item__tag { grid-column: 1; margin-top: 2px; font-size: 12px; font-weight: 700; color: var(--accent-ink); line-height: 1.5; }
/* ほかのパックへの行（パックの名前は和文なので、英語の行の太さ・balance を使わない） */
.sb-item__pk { grid-column: 1; font-size: 16px; font-weight: 700; line-height: 1.45; }
/* パックの一覧の 50 行ずつの帯 */
.sb-band + .sb-band { margin-top: 8px; }

/* アプリの案内 */
.sb-cta {
  margin-top: 32px; padding: 24px 20px 20px; border-radius: var(--r-lg); scroll-margin-top: 12px;
  background: linear-gradient(150deg, var(--hero-1), var(--hero-2) 70%, var(--hero-3));
  color: #fff; box-shadow: var(--sh-3);
}
.sb-cta__head { font-family: var(--font-head); font-size: 18px; font-weight: 900; line-height: 1.5; letter-spacing: .03em; text-spacing-trim: trim-start; }
.sb-cta__body { margin-top: 8px; font-size: 14px; line-height: 1.7; color: rgba(255, 255, 255, .92); }
/* 値段の文は独立した行に（狭い幅で「iPhone のアプリなら」だけが短い行になった。デザインの点検 2026-11-21） */
.sb-cta__body b { display: block; }
.sb-cta__btns { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.sb-cta__main { --btn-bg: linear-gradient(180deg, #FFFFFF, #F4F0FF); --btn-ink: #3E22C9; --btn-edge: rgba(30, 10, 100, .28); --btn-glow: rgba(20, 0, 80, .35); }
.sb-cta .btn--soft { --btn-bg: rgba(255, 255, 255, .16); --btn-ink: #fff; --btn-edge: rgba(20, 0, 80, .25); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.sb-cta__note { margin-top: 12px; font-size: 13px; color: #fff; line-height: 1.6; }
/* フレーズのページの「アプリで覚える」。記事の途中に、薄い紫の帯で置く（スマホの幅では端まで） */
.sb-app { margin: 40px -16px 0; padding: 28px 16px 24px; background: var(--accent-soft); scroll-margin-top: 12px; }
.sb-app .sb-sec__title { margin-bottom: 8px; }
/* 2 枚の画面。スマホの幅では横に送る（2 枚目の端を見せて、続きがあると分かるように）。ページ全体は横に送れない */
.sb-shots { display: flex; gap: 16px; margin: 16px -16px 0; padding: 4px 16px 4px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; overscroll-behavior-x: contain; scrollbar-width: none; }
.sb-shots::-webkit-scrollbar { display: none; }
.sb-shots li { flex: 0 0 min(56%, 220px); scroll-snap-align: start; }
/* iPhone の枠（細い黒い縁）。アプリの画面の写真だと一目で分かるように */
.sb-phone { position: relative; padding: 5px; border-radius: 28px; background: #16122A; box-shadow: var(--sh-2); }
.sb-phone img { display: block; width: 100%; height: auto; border-radius: 23px; }
/* 画面の上の空き（実機では時刻とカメラの島がある所）に、島だけを描く（何も無い白い帯にしない） */
.sb-phone::before { content: ""; position: absolute; top: 9px; left: 50%; width: 30%; aspect-ratio: 126 / 37; transform: translateX(-50%); border-radius: 999px; background: #16122A; }
.sb-shots figcaption { display: grid; grid-template-columns: 22px 1fr; gap: 8px; margin-top: 12px; font-size: 14px; font-weight: 500; line-height: 1.6; color: var(--ink); text-spacing-trim: trim-start; }
.sb-shots__n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; margin-top: 1px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; }
.sb-shots + .sb-text { margin-top: 16px; }
.sb-app .sb-text + .sb-text { margin-top: 8px; }
/* 強調は最初の一文だけ（段落の全部を太字にしない） */
.sb-app__free { margin-top: 16px; font-size: 16px; font-weight: 500; line-height: 1.8; color: var(--ink); text-spacing-trim: trim-start; }
.sb-app__free b { font-weight: 700; }
.sb-app__btns { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.sb-app__note { margin-top: 8px; font-size: 12px; color: var(--ink-2); line-height: 1.6; }

/* ページの下の、もう一度の入口（読み終えた人が上まで戻らずに済むように） */
.sb-again { display: flex; flex-direction: column; gap: 8px; margin-top: 32px; }
.sb-again__lead { font-family: var(--font-head); font-size: 16px; font-weight: 900; line-height: 1.5; letter-spacing: .03em; color: var(--ink); }
/* Web 版は文字のリンク（紫のボタンを 2 つ縦に重ねない。押し売りに見える。デザインの点検 2026-11-21） */
.sb-weblink { display: inline-flex; align-items: center; justify-content: center; gap: 2px; min-height: 44px; font-size: 14px; font-weight: 700; color: var(--accent-ink); white-space: nowrap; text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--accent-ink) 35%, transparent); text-underline-offset: 3px; }

/* iPhone の Safari は text-spacing-trim に対応しないので、段落の頭の「「（」の半字下がりと、「」。」の間の空きを、
   括弧に付けた class で詰める（build-seo.tsx の trimBrackets が付ける。デザインの点検 2026-11-21） */
@supports not (text-spacing-trim: trim-start) {
  .sb-ob { margin-left: -.5em; }
  .sb-cb { margin-right: -.5em; }
}

/* 暗い表示では、枠の色を帯より暗くし、細い明るい縁で端を見せる（明るい画面の写真が浮かないように） */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sb-phone, :root:not([data-theme="light"]) .sb-phone::before { background: #0E0B18; }
  :root:not([data-theme="light"]) .sb-phone { box-shadow: 0 0 0 1px rgba(255, 255, 255, .10), var(--sh-2); }
}
:root[data-theme="dark"] .sb-phone, :root[data-theme="dark"] .sb-phone::before { background: #0E0B18; }
:root[data-theme="dark"] .sb-phone { box-shadow: 0 0 0 1px rgba(255, 255, 255, .10), var(--sh-2); }

@media (min-width: 600px) {
  .sb-phrase { font-size: 44px; }
  .sb-phrase--long { font-size: 34px; }
  .sb-phrase--xlong { font-size: 30px; }
  .sb-head { padding: 28px; }
  /* パックの一覧の 195 行は 2 列に（PC で 1 列が 1 万 px 以上続かないように。デザインの点検 2026-11-21） */
  .sb-list--cols { display: grid; grid-template-columns: 1fr 1fr; }
  .sb-list--cols li + li { border-top: 0; }
  .sb-list--cols li { border-bottom: 1px solid var(--line); }
  .sb-list--cols li:not(.sb-list__shelf):nth-child(even) { border-right: 1px solid var(--line); }
  .sb-list--cols li:last-child, .sb-list--cols li:nth-last-child(2):nth-child(even) { border-bottom: 0; }
  .sb-list--cols .sb-list__shelf { grid-column: 1 / -1; }
  /* 奇数で終わる帯の、1 つだけ残った最後の行は 2 列ぶんに（右下に空のマスを残さない。デザインの点検 2026-11-21） */
  .sb-list--cols li:last-child:nth-child(even) { grid-column: 1 / -1; border-right: 0; }
  .sb-cta__btns, .sb-again, .sb-app__btns { flex-direction: row; }
  /* 帯とページの下: 見出しは上の行に、App Store のボタンは幅を決めて、Web 版の文字のリンクはその横に（デザインの点検 2026-11-21） */
  .sb-app__btns, .sb-again { flex-wrap: wrap; align-items: center; column-gap: 24px; }
  .sb-again__lead { flex: 0 0 100%; }
  .sb-app__btns .btn--block, .sb-again .btn--block { flex: 0 1 320px; }
  /* 広い画面では帯を角丸の面にし、2 枚を横に並べる（送らない） */
  .sb-app { margin: 40px 0 0; padding: 32px 28px 28px; border-radius: var(--r-lg); }
  .sb-shots { justify-content: center; margin: 20px 0 0; padding: 0; overflow: visible; gap: 32px; }
  .sb-shots li { flex: 0 0 232px; }
}
@media (max-width: 359px) {
  .sb-head { padding: 20px 16px; }
}
