/* 梅岩の画面。Material 3 Expressive に合わせて手で作った部品。
   数値は公式のトークン（@material/web 2.5.0 の tokens。Material 3 の版 34.0.21）から写した。
   余白は 8dp 刻み（Google I/O 2026 の spacing system）。配色は theme.css（tools/make_theme.mjs で作る） */

:root {
  /* 角の丸み（md.sys.shape.corner） */
  --shape-xs: 4px; --shape-s: 8px; --shape-m: 12px; --shape-l: 16px; --shape-l-inc: 20px;
  --shape-xl: 28px; --shape-xl-inc: 32px; --shape-xxl: 48px; --shape-full: 9999px;
  /* 余白（8dp 刻み。部品の内側だけ 4dp も使う） */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;
  /* 動き（md.sys.motion.spring。ばねの値（stiffness・damping）を CSS の曲線に直した） */
  --spring-fast-spatial: linear(0, 0.029, 0.1, 0.193, 0.295, 0.397, 0.493, 0.581, 0.658, 0.725, 0.782, 0.829, 0.868, 0.899, 0.924, 0.944, 0.959, 0.971, 0.98, 0.987, 0.992, 0.995, 0.998, 0.999, 1, 1.001, 1.001, 1.002, 1.002, 1.001, 1.001, 1.001, 1);
  --spring-fast-spatial-dur: 224ms;   /* stiffness 1400・damping 0.9 */
  --spring-default-spatial-dur: 317ms; /* stiffness 700・damping 0.9（曲線は同じ形） */
  --spring-fast-effects: linear(0, 0.034, 0.114, 0.214, 0.32, 0.422, 0.515, 0.598, 0.67, 0.731, 0.782, 0.825, 0.859, 0.888, 0.911, 0.929, 0.944, 0.956, 0.965, 0.973, 0.979, 0.983, 0.987, 0.99, 0.992, 0.994, 0.995, 0.996, 0.997, 0.998, 0.998, 0.999, 1);
  --spring-fast-effects-dur: 150ms;   /* stiffness 3800・damping 1 */
  --font: Roboto, "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface);
  font: 400 1rem/1.5rem var(--font); letter-spacing: 0.03125rem;  /* body-large */
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--md-sys-color-primary); }
svg.icon { width: 24px; height: 24px; fill: currentColor; flex: none; }

/* 文字（md.sys.typescale。emphasized は太さだけ上げる） */
.display-s { font-size: 2.25rem; line-height: 2.75rem; font-weight: 400; }
.headline-l { font-size: 2rem; line-height: 2.5rem; font-weight: 400; }
.headline-m { font-size: 1.75rem; line-height: 2.25rem; font-weight: 400; }
.headline-s { font-size: 1.5rem; line-height: 2rem; font-weight: 400; }
.headline-m.emph, .headline-l.emph { font-weight: 500; }
.title-l { font-size: 1.375rem; line-height: 1.75rem; font-weight: 400; }
.title-m { font-size: 1rem; line-height: 1.5rem; font-weight: 500; letter-spacing: 0.009375rem; }
.title-s { font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; letter-spacing: 0.00625rem; }
.body-m { font-size: 0.875rem; line-height: 1.25rem; letter-spacing: 0.015625rem; }
.body-s { font-size: 0.75rem; line-height: 1rem; letter-spacing: 0.025rem; }
.label-l { font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; letter-spacing: 0.00625rem; }
.label-m { font-size: 0.75rem; line-height: 1rem; font-weight: 500; letter-spacing: 0.03125rem; }
.muted { color: var(--md-sys-color-on-surface-variant); }
h1, h2, h3 { margin: 0; }

/* ---- 全体の並べ方（幅で切り替える。600dp 未満はナビゲーションバー、それ以上はナビゲーションレール） ---- */
/* 列は minmax(0, 1fr)。1fr だと、中身の長い1行の文字（…で切る一覧の題名など）に合わせて列が広がり、スマートフォンで横にはみ出す */
.shell { display: grid; grid-template-columns: 96px minmax(0, 1fr); min-height: 100%; }
.content { padding: var(--sp-6) var(--sp-6) var(--sp-12); max-width: 1040px; width: 100%; }
.page-head { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-6); }
/* 見出しは文字の長さを基準に置き、横のボタンや印と並べて収まらないときは、ボタンや印のほうを次の行に送る
   （flex: 1 だと見出しが縮められ、「返信のテンプレ／ート」のように語の途中で折り返していた）。
   それでも1行に入らない長い見出しは、行の長さをそろえて折り返す */
.page-head h1 { flex: 1 1 auto; min-width: 0; text-wrap: balance; }
/* 戻るボタンの後ろの見出しは、ボタンと同じ行に残す（長い題名だと、戻るボタンだけが1行目に残っていた）。40 はボタンの幅 */
.page-head .icon-btn + h1 { max-width: calc(100% - 40px - var(--sp-4)); }

/* ナビゲーションレール（nav-rail collapsed：幅 96、上の余白 44、項目の間 4。指示 56×32・全丸） */
.rail {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center;
  gap: var(--sp-1); padding-top: var(--sp-6); background: var(--md-sys-color-surface);
}
.rail .fab { margin-bottom: var(--sp-6); }
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-1); width: 80px; padding: 6px 0;
  color: var(--md-sys-color-on-surface-variant); text-decoration: none; border-radius: var(--shape-full);
}
.nav-item .indicator {
  width: 56px; height: 32px; border-radius: var(--shape-full); display: grid; place-items: center;
  transition: background-color var(--spring-fast-effects-dur) var(--spring-fast-effects),
              width var(--spring-fast-spatial-dur) var(--spring-fast-spatial);
}
.nav-item:hover .indicator { background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); }
.nav-item[aria-current="page"] { color: var(--md-sys-color-on-surface); }
.nav-item[aria-current="page"] .indicator { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.nav-item[aria-current="page"] .label-m { font-weight: 700; }   /* emphasized label-medium */
.rail .spacer { flex: 1; }

/* ---- ボタン（small：高さ 40・左右 16・アイコン 20・押すと角が 8 に変わる。medium：高さ 56・左右 24・押すと 12） ---- */
.btn {
  --h: 40px; --pad: 16px; --radius: var(--shape-full); --pressed: var(--shape-s);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  height: var(--h); padding: 0 var(--pad); border: 0; border-radius: var(--radius); cursor: pointer;
  font: 500 0.875rem/1.25rem var(--font); letter-spacing: 0.00625rem; white-space: nowrap;
  background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); text-decoration: none;
  transition: border-radius var(--spring-fast-spatial-dur) var(--spring-fast-spatial),
              background-color var(--spring-fast-effects-dur) var(--spring-fast-effects),
              box-shadow var(--spring-fast-effects-dur) var(--spring-fast-effects);
}
.btn svg.icon { width: 20px; height: 20px; }
.btn:hover { box-shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 1px 3px 1px rgb(0 0 0 / 0.15); }
.btn:active { border-radius: var(--pressed); }
.btn:focus-visible, .nav-item:focus-visible, .list-item:focus-visible, .chip:focus-visible, .seg button:focus-visible {
  outline: 3px solid var(--md-sys-color-secondary); outline-offset: 2px;
}
.btn.medium { --h: 56px; --pad: 24px; --pressed: var(--shape-m); font-size: 1rem; line-height: 1.5rem; }
.btn.medium svg.icon { width: 24px; height: 24px; }
.btn.tonal { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.btn.outlined { background: transparent; color: var(--md-sys-color-on-surface-variant); box-shadow: inset 0 0 0 1px var(--md-sys-color-outline-variant); }
.btn.text { background: transparent; color: var(--md-sys-color-primary); padding: 0 12px; }
.btn.text:hover, .btn.outlined:hover { box-shadow: none; background: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent); }
.btn.danger { background: var(--md-sys-color-error); color: var(--md-sys-color-on-error); }
.btn:disabled { background: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent); color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent); cursor: default; box-shadow: none; }
.icon-btn {
  width: 40px; height: 40px; border-radius: var(--shape-full); border: 0; display: inline-grid; place-items: center;
  background: transparent; color: var(--md-sys-color-on-surface-variant); cursor: pointer;
  transition: border-radius var(--spring-fast-spatial-dur) var(--spring-fast-spatial);
}
.icon-btn:hover { background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); }
.icon-btn:active { border-radius: var(--shape-s); }

/* 拡張 FAB（small：高さ 56・左右 16・角 16） */
.fab {
  display: inline-flex; align-items: center; gap: var(--sp-2); height: 56px; padding: 0 var(--sp-4);
  border: 0; border-radius: var(--shape-l); cursor: pointer; font: 500 1rem/1.5rem var(--font);
  background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.3), 0 4px 8px 3px rgb(0 0 0 / 0.15);
  transition: border-radius var(--spring-fast-spatial-dur) var(--spring-fast-spatial);
}
.fab:active { border-radius: var(--shape-m); }
.rail .fab { width: 56px; padding: 0; justify-content: center; }
.rail .fab span { display: none; }

/* ---- 表現の強いリスト（項目どうしは 2dp の隙間、外側の角 16・内側の角 4。触れると 12、選ぶと 16） ---- */
.list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.list-item {
  display: flex; align-items: center; gap: var(--sp-3); min-height: 56px; padding: 10px var(--sp-6) 10px var(--sp-4);
  background: var(--md-sys-color-surface-container-low); color: inherit; text-decoration: none;
  border-radius: var(--shape-xs); cursor: pointer;
  transition: border-radius var(--spring-fast-spatial-dur) var(--spring-fast-spatial),
              background-color var(--spring-fast-effects-dur) var(--spring-fast-effects);
}
.list > :first-child .list-item, .list > .list-item:first-child { border-top-left-radius: var(--shape-l); border-top-right-radius: var(--shape-l); }
.list > :last-child .list-item, .list > .list-item:last-child { border-bottom-left-radius: var(--shape-l); border-bottom-right-radius: var(--shape-l); }
.list-item:hover { border-radius: var(--shape-m); background: var(--md-sys-color-surface-container); }
.list-item:active { border-radius: var(--shape-l); }
.list-item .main { flex: 1; min-width: 0; }
.list-item .main > * { overflow: hidden; text-overflow: ellipsis; }
.list-item .one-line { white-space: nowrap; }
.list-item .trail { display: flex; align-items: center; gap: var(--sp-2); flex: none; }
.list-item.three-line { min-height: 88px; align-items: flex-start; }
.avatar {
  width: 40px; height: 40px; border-radius: var(--shape-full); display: grid; place-items: center; flex: none;
  background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); font-weight: 500;
}
.empty { padding: var(--sp-8) var(--sp-6); text-align: center; border-radius: var(--shape-l); background: var(--md-sys-color-surface-container-low); }

/* チップ（高さ 32・角 8） */
.chip {
  display: inline-flex; align-items: center; gap: var(--sp-2); height: 32px; padding: 0 var(--sp-3);
  border-radius: var(--shape-s); font: 500 0.875rem/1.25rem var(--font); white-space: nowrap;
  background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface-variant);
}
.chip.ok { background: var(--md-sys-color-tertiary-container); color: var(--md-sys-color-on-tertiary-container); }
.chip.warn { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }
.chip.busy { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
button.chip { border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px var(--md-sys-color-outline-variant); background: transparent; }

/* 分かれたボタン（segmented。高さ 40・外側だけ全丸） */
/* 1行に収め、入りきらない幅ではよこに送る（折り返すと外側だけ全丸の形が崩れるため） */
.seg { display: flex; gap: 2px; overflow-x: auto; max-width: 100%; padding-bottom: 2px; }
.seg button {
  height: 40px; padding: 0 var(--sp-3); border: 0; cursor: pointer; font: 500 0.875rem/1.25rem var(--font); white-space: nowrap; flex: none;
  background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface);
  border-radius: var(--shape-s);
  transition: border-radius var(--spring-fast-spatial-dur) var(--spring-fast-spatial),
              background-color var(--spring-fast-effects-dur) var(--spring-fast-effects);
}
.seg button:first-child { border-radius: var(--shape-full) var(--shape-s) var(--shape-s) var(--shape-full); }
.seg button:last-child { border-radius: var(--shape-s) var(--shape-full) var(--shape-full) var(--shape-s); }
.seg button[aria-pressed="true"] { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); border-radius: var(--shape-full); }
/* 選ぶものが6つ以上の列（営業の結果など）は、つながったボタンではなく、離れたボタンの並び（button group。間 8・全丸）にして折り返す。
   つながったボタンは2〜5個向けで、よこに送ると端の選びもの（「見送り」）が隠れて気づきにくかったため */
.seg.wrap { flex-wrap: wrap; overflow: visible; gap: var(--sp-2); padding-bottom: 0; }
.seg.wrap button, .seg.wrap button:first-child, .seg.wrap button:last-child { border-radius: var(--shape-full); padding: 0 var(--sp-4); }
.seg.wrap button[aria-pressed="true"] { border-radius: var(--shape-m); }

/* カード（角 12） */
.card { background: var(--md-sys-color-surface-container-low); border-radius: var(--shape-m); padding: var(--sp-4) var(--sp-6) var(--sp-6); }
.card + .card, .card + .grid-2 { margin-top: var(--sp-4); }
.card h2 { margin-bottom: var(--sp-3); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-4); align-items: start; }

/* 入力欄（外枠つき。高さ 56・角 4） */
.field { display: flex; flex-direction: column; gap: var(--sp-1); margin-bottom: var(--sp-4); }
.field label { font: 500 0.75rem/1rem var(--font); color: var(--md-sys-color-on-surface-variant); }
.field input, .field textarea {
  font: 400 1rem/1.5rem var(--font); color: var(--md-sys-color-on-surface); background: transparent;
  border: 1px solid var(--md-sys-color-outline); border-radius: var(--shape-xs); padding: var(--sp-4);
}
.field input { height: 56px; }
.field textarea { min-height: 160px; resize: vertical; }
.field textarea.short { min-height: 88px; }
.field input:focus, .field textarea:focus { outline: none; border: 2px solid var(--md-sys-color-primary); padding: 15px; }
.field .hint { font-size: 0.75rem; line-height: 1rem; color: var(--md-sys-color-on-surface-variant); }
.check { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.check input { width: 18px; height: 18px; accent-color: var(--md-sys-color-primary); }
.actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; justify-content: flex-end; }

/* ダイアログ（角 28・余白 24） */
dialog {
  border: 0; padding: var(--sp-6); width: min(560px, calc(100vw - 32px)); border-radius: var(--shape-xl);
  background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface);
}
dialog::backdrop { background: color-mix(in srgb, var(--md-sys-color-scrim) 32%, transparent); }
dialog h2 { margin-bottom: var(--sp-4); }
dialog[open] { animation: pop var(--spring-default-spatial-dur) var(--spring-fast-spatial); }
@keyframes pop { from { transform: scale(0.92); opacity: 0; } to { transform: none; opacity: 1; } }

/* スナックバー（角 4・暗い面） */
.snackbar {
  position: fixed; left: 50%; bottom: var(--sp-6); transform: translateX(-50%); z-index: 10;
  min-height: 48px; max-width: min(560px, calc(100vw - 32px)); padding: 14px var(--sp-4); border-radius: var(--shape-xs);
  background: var(--md-sys-color-inverse-surface); color: var(--md-sys-color-inverse-on-surface);
  font-size: 0.875rem; line-height: 1.25rem; box-shadow: 0 2px 6px 2px rgb(0 0 0 / 0.15);
}

/* 数字の並び（分析・送り主の集計） */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-2); }
.stat { display: flex; flex-direction: column; gap: var(--sp-1); }
.bar-row { display: grid; grid-template-columns: 88px 1fr 40px; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-2); }
.bar { height: 12px; border-radius: var(--shape-full); background: var(--md-sys-color-secondary-container); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: var(--shape-full); background: var(--md-sys-color-primary);
  transition: width var(--spring-default-spatial-dur) var(--spring-fast-spatial); }
.bar-row .score { text-align: right; }
input.month { font: 500 0.875rem/1.25rem var(--font); height: 40px; padding: 0 var(--sp-3); border-radius: var(--shape-s);
  border: 1px solid var(--md-sys-color-outline-variant); background: transparent; color: var(--md-sys-color-on-surface); }

/* 課題ボード */
.sheet { margin: 0; }
.sheet dt { margin-top: var(--sp-3); color: var(--md-sys-color-on-surface-variant); }
.sheet dd { margin: var(--sp-1) 0 0; white-space: pre-wrap; }
.proposal { padding: var(--sp-4) 0; border-top: 1px solid var(--md-sys-color-outline-variant); }
.proposal:first-of-type { border-top: 0; padding-top: 0; }
.pre { white-space: pre-wrap; }
.genres { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 var(--sp-4); }
button.chip[aria-pressed="true"] { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); box-shadow: none; }
.select { font: 400 1rem/1.5rem var(--font); height: 56px; padding: 0 var(--sp-4); border-radius: var(--shape-xs);
  border: 1px solid var(--md-sys-color-outline); background: transparent; color: var(--md-sys-color-on-surface); }

/* 梅岩の印（梅鉢）と、名前の3つの意味 */
.mark .petal { fill: var(--md-sys-color-primary); transform-origin: 50px 51px;
  animation: bloom var(--spring-default-spatial-dur) var(--spring-fast-spatial) both; animation-delay: calc(var(--i) * 40ms); }
.mark .heart { fill: var(--md-sys-color-on-primary); }
.mark .dot { fill: var(--md-sys-color-tertiary-container); }   /* 花の芯は鶯色（梅に鶯） */
@keyframes bloom { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
.rail-logo { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: var(--sp-2); border-radius: var(--shape-full); }
.rail-logo:focus-visible { outline: 3px solid var(--md-sys-color-secondary); outline-offset: 2px; }
.center .card.hero { max-width: 760px; width: 100%; padding: var(--sp-8) var(--sp-6); display: flex; flex-direction: column; align-items: center; gap: var(--sp-1);
  border-radius: var(--shape-xl); background: var(--md-sys-color-surface-container-low); }
.card.hero .display-s { margin: var(--sp-2) 0 0; }
.meanings { display: grid; grid-template-columns: 1fr; gap: var(--sp-2); width: 100%; margin-bottom: var(--sp-6); text-align: left; }
.meaning { display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-4); background: var(--md-sys-color-surface-container-low);
  border-radius: var(--shape-l-inc); }
.meaning:nth-child(2) { border-radius: var(--shape-xl-inc); }   /* まん中だけ形を変える（色は同じにして読みやすく） */
.meaning .kanji { font-size: 1.5rem; line-height: 2rem; font-weight: 500; color: var(--md-sys-color-primary); letter-spacing: 0.1em; }
.empty .mark { margin-bottom: var(--sp-2); }

/* ---- 業務の道具らしい見た目：薄い灰色の地に、白いカードと細い枠線 ---- */
body { background: var(--md-sys-color-surface-container-low); }
.rail { background: var(--md-sys-color-surface-container-lowest); border-right: 1px solid var(--md-sys-color-outline-variant); }
.card, .table-card, .empty { background: var(--md-sys-color-surface-container-lowest); box-shadow: inset 0 0 0 1px var(--md-sys-color-outline-variant); }
.page-head h1.headline-m { font-size: 1.5rem; line-height: 2rem; }   /* 見出しは控えめ（headline-small） */
.summary { margin-bottom: var(--sp-4); }
.summary .stat .headline-s { color: var(--md-sys-color-primary); font-weight: 500; }
.list-item { background: var(--md-sys-color-surface-container-lowest); }
.list-item:hover { background: var(--md-sys-color-surface-container); }
.brand { display: none; }

/* 一覧の表（パソコン）。スマートフォンでは1つずつの行 */
.table-card { border-radius: var(--shape-l); overflow: hidden; }
.table-head { display: none; }
.rows { gap: 0; }
.rows .list-item.row { border-radius: 0; border-top: 1px solid var(--md-sys-color-outline-variant); }
.rows > li:first-child .list-item.row { border-top: 0; border-radius: 0; }
.rows > li:last-child .list-item.row { border-radius: 0; }
.row { flex-wrap: wrap; }
.cell.who { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.cell.who .one-line { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 840px) {
  .table-head, .row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr) 136px 120px 96px; gap: var(--sp-4); align-items: center; }
  .table-head { padding: var(--sp-3) var(--sp-6) var(--sp-3) var(--sp-4); background: var(--md-sys-color-surface-container); }
  .cell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 599px) { .add-lead { display: none; } }   /* スマートフォンでは右下の FAB を使う */
@media (max-width: 839px) {
  .row .cell:nth-child(2), .row .cell:nth-child(3) { display: none; }
  .row { flex-wrap: nowrap; }
  .row .cell { flex: none; }
  .row .cell.who { flex: 1; min-width: 0; }
}

/* 開いたナビゲーションレール（1200dp 以上。幅 220・項目の高さ 56・左右 16・アイコンと文字の間 8） */
@media (min-width: 1200px) {
  .shell { grid-template-columns: 240px minmax(0, 1fr); }
  .rail { align-items: stretch; padding: var(--sp-6) var(--sp-3) var(--sp-4); }
  .rail-logo { width: auto; height: auto; display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-3) var(--sp-4); text-decoration: none; color: inherit; border-radius: var(--shape-m); }
  .brand { display: flex; flex-direction: column; }
  .rail .fab { width: auto; padding: 0 var(--sp-4); align-self: flex-start; margin: 0 0 var(--sp-4) var(--sp-1); }
  .rail .fab span { display: inline; }
  .nav-item { flex-direction: row; width: auto; height: 56px; padding: 0 var(--sp-4); gap: var(--sp-2); }
  .nav-item .indicator { width: auto; height: auto; background: none !important; }
  .nav-item .label-m { font-size: 0.875rem; line-height: 1.25rem; }
  .nav-item[aria-current="page"] { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
  .nav-item:hover { background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); }
}

/* トップの部品 */
.brand-row { display: flex; align-items: center; gap: var(--sp-3); }
.feature-icon { width: 40px; height: 40px; border-radius: var(--shape-m); display: grid; place-items: center; flex: none;
  background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
.body-l { font-size: 1rem; line-height: 1.5rem; letter-spacing: 0.03125rem; margin: 0; }
.label-s { font-size: 0.6875rem; line-height: 1rem; font-weight: 500; letter-spacing: 0.03125rem; }
@media (max-width: 839px) {
}

/* 調査.md の表示 */
.md h1 { font-size: 1.375rem; line-height: 1.75rem; font-weight: 500; margin: 0 0 var(--sp-3); }
.md h2 { font-size: 1rem; line-height: 1.5rem; font-weight: 500; margin: var(--sp-4) 0 var(--sp-2); }
.md p, .md ul { margin: 0 0 var(--sp-2); }
.md ul { padding-left: var(--sp-6); }
.md hr { border: 0; border-top: 1px solid var(--md-sys-color-outline-variant); margin: var(--sp-4) 0; }
.md h3 { font-size: 0.9375rem; line-height: 1.5rem; font-weight: 500; margin: var(--sp-3) 0 var(--sp-1); }
.md ol { margin: 0 0 var(--sp-2); padding-left: var(--sp-6); }
.md ol ol { margin: var(--sp-1) 0 0; list-style: decimal; }
.md li { margin-bottom: var(--sp-1); }
.table-wrap { overflow-x: auto; margin: 0 0 var(--sp-3); }
.md table { border-collapse: collapse; width: 100%; font-size: 0.875rem; line-height: 1.25rem; }
.md th, .md td { border: 1px solid var(--md-sys-color-outline-variant); padding: var(--sp-2) var(--sp-3); text-align: left; vertical-align: top; }
.md th { background: var(--md-sys-color-surface-container); font-weight: 500; }
/* 規約・同意 */
.legal .card { padding: var(--sp-8); }
.legal-links { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-6); margin: var(--sp-4) 0; }
.center-links { justify-content: center; }
.consent { max-width: 560px; display: flex; flex-direction: column; gap: var(--sp-3); }
.consent h1 { margin: var(--sp-2) 0 0; }
.check { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3); border-radius: var(--shape-m);
  background: var(--md-sys-color-surface-container-low); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--md-sys-color-primary); flex: none; }
.top-bar-actions { display: flex; gap: var(--sp-2); align-items: center; }
.invite { display: flex; gap: var(--sp-3); align-items: flex-end; flex-wrap: wrap; margin-top: var(--sp-3); }
.invite .field { flex: 1; min-width: 220px; }
@media (max-width: 599px) { .legal .card { padding: var(--sp-4); } }
.meter { height: 8px; border-radius: var(--shape-full); background: var(--md-sys-color-secondary-container); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: var(--shape-full); background: var(--md-sys-color-primary); }
.code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.9375rem; word-break: break-all; }
.score { font-variant-numeric: tabular-nums; }

/* ログイン前・読み込み中 */
.center { min-height: 100vh; display: grid; place-items: center; padding: var(--sp-6); text-align: center; }
.center .card { max-width: 440px; }
.center .display-s { margin-bottom: var(--sp-2); }
.progress { width: 48px; height: 48px; border-radius: 50%; border: 4px solid var(--md-sys-color-secondary-container); border-top-color: var(--md-sys-color-primary); animation: spin 1s linear infinite; margin: var(--sp-6) auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- 幅が狭いとき（600dp 未満）：ナビゲーションバー（高さ 80・指示 64×32）を下に置き、FAB は右下 ---- */
@media (max-width: 599px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .content { padding: var(--sp-4) var(--sp-4) calc(80px + 96px); }
  .rail {
    position: fixed; inset: auto 0 0 0; top: auto; height: 80px; flex-direction: row; justify-content: space-around;
    padding: var(--sp-3) 0 var(--sp-4); gap: 0; z-index: 5; background: var(--md-sys-color-surface-container);
  }
  .rail .spacer { display: none; }
  .rail-logo { display: none; }
  .meanings { grid-template-columns: 1fr; }
  .rail .fab {
    position: fixed; right: var(--sp-4); bottom: calc(80px + var(--sp-4)); margin: 0; width: auto; padding: 0 var(--sp-4);
  }
  .rail .fab span { display: inline; }
  .nav-item { width: auto; flex: 1; padding: 0; }
  .nav-item .indicator { width: 64px; }
  .nav-item.hide-compact { display: none; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .page-head .headline-m { font-size: 1.5rem; line-height: 2rem; }
  .snackbar { bottom: calc(80px + var(--sp-4)); }
}

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

/* ---- トップ（ログインの前）：売りを3つ大きく。名前の由来はよくある質問の中だけ ---- */
.top { min-height: 100vh; max-width: 1120px; margin: 0 auto; padding: 0 var(--sp-8); display: flex; flex-direction: column; }
.top-bar { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-4) 0; }
.top-hero { padding: var(--sp-12) 0 var(--sp-8); display: flex; flex-direction: column; gap: var(--sp-4); max-width: 760px; }
.top-hero .eyebrow { color: var(--md-sys-color-primary); margin: 0; }
.top-title { margin: 0; font-size: 3.25rem; line-height: 4rem; font-weight: 500; letter-spacing: 0; }
.top-title span { display: block; text-wrap: balance; }
.top-title span:last-child { color: var(--md-sys-color-primary); }
.points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); padding: var(--sp-4) 0 var(--sp-12); }
.point { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-6); background: var(--md-sys-color-surface-container-lowest);
  border-radius: var(--shape-xl); box-shadow: inset 0 0 0 1px var(--md-sys-color-outline-variant); }
.point:nth-child(2) { border-radius: var(--shape-xl-inc); }   /* まん中だけ角を大きくして、Expressive の形の変化を出す */
.point p { margin: 0; }
.point-title span { display: inline-block; }   /* 語のまとまりの途中で改行しない */
.point-head { display: flex; align-items: center; justify-content: space-between; }
.point-no { font-size: 2.25rem; line-height: 2.75rem; font-weight: 500; color: var(--md-sys-color-primary); }
.point-title { margin: 0; font-size: 1.5rem; line-height: 2rem; font-weight: 500; }
.faq { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-8) 0; border-top: 1px solid var(--md-sys-color-outline-variant); max-width: 760px; }
.faq h2 { margin: 0 0 var(--sp-2); }
.faq-item { background: var(--md-sys-color-surface-container-lowest); border-radius: var(--shape-l); box-shadow: inset 0 0 0 1px var(--md-sys-color-outline-variant); }
.faq-item summary { cursor: pointer; padding: var(--sp-4); list-style-position: inside; }
.faq-a { padding: 0 var(--sp-4) var(--sp-4); }
.faq-a p { margin: 0 0 var(--sp-3); }
.faq-a .meanings { margin-bottom: 0; }
.faq-a .meaning { padding: var(--sp-3); }
.faq-a .meaning .kanji { font-size: 1.125rem; line-height: 1.5rem; }
.top-foot { display: flex; gap: var(--sp-6); padding: var(--sp-6) 0 var(--sp-8); margin-top: auto; flex-wrap: wrap; }
@media (max-width: 839px) {
  .top { padding: 0 var(--sp-4); }
  .top-hero { padding: var(--sp-8) 0 var(--sp-6); }
  .top-title { font-size: 1.625rem; line-height: 2.25rem; }
  .points { grid-template-columns: 1fr; padding-bottom: var(--sp-8); }
  .point { padding: var(--sp-4); }
  .point-title { font-size: 1.25rem; line-height: 1.75rem; }
}
.top-foot .legal-links { margin: 0; }
.consent { text-align: left; }
.consent h1 { text-align: left; }
.stack { display: flex; flex-direction: column; gap: 2px; }
.invite .field { margin: 0; }
