/* ==========================================================
   TAPP 相続相談 プラットフォーム 共通デザイン基盤
   Google / Material 3 を参考にした、白地・余白・階層で見せる設計
   ========================================================== */
:root {
  --blue: #1A73E8;
  --blue-700: #1557B0;
  --blue-800: #174EA6;
  --blue-50: #E8F0FE;
  --blue-100: #D2E3FC;
  --ink: #202124;
  --ink-2: #3C4043;
  --ink-3: #5F6368;
  --line: #DADCE0;
  --line-2: #E8EAED;
  --surface: #FFFFFF;
  --surface-2: #F8F9FA;
  --surface-3: #F1F3F4;
  --green: #188038;
  --green-50: #E6F4EA;
  --amber: #B06000;
  --amber-50: #FEF7E0;
  --red: #C5221F;
  --red-50: #FCE8E6;
  --purple: #7627BB;
  --purple-50: #F3E8FD;
  --radius-s: 8px;
  --radius: 12px;
  --radius-l: 16px;
  --radius-xl: 24px;
  --shadow-1: 0 1px 2px rgba(60, 64, 67, .3), 0 1px 3px 1px rgba(60, 64, 67, .15);
  --shadow-2: 0 1px 3px rgba(60, 64, 67, .3), 0 4px 8px 3px rgba(60, 64, 67, .15);
  --font: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  --appbar-h: 64px;
  --nav-w: 256px;
  color-scheme: light;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--appbar-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, dl, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 760px; }

/* ---------- typography ---------- */
.display { font-size: clamp(32px, 4.4vw, 52px); font-weight: 500; line-height: 1.25; letter-spacing: -.01em; }
.h1 { font-size: clamp(26px, 3vw, 36px); font-weight: 500; line-height: 1.3; letter-spacing: -.005em; }
.h2 { font-size: clamp(22px, 2.4vw, 28px); font-weight: 500; line-height: 1.35; }
.h3 { font-size: 18px; font-weight: 500; line-height: 1.4; }
.h4 { font-size: 16px; font-weight: 500; line-height: 1.4; }
.lead { font-size: 17px; color: var(--ink-2); line-height: 1.8; }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--blue); letter-spacing: .04em; }
.sec-head { margin-bottom: 32px; }
.sec-head .h2 { margin-top: 4px; }

/* ---------- icons ---------- */
.ic { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic--s { width: 18px; height: 18px; }
.ic--l { width: 32px; height: 32px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background .15s, box-shadow .15s, border-color .15s;
}
.btn:hover { text-decoration: none; }
.btn--filled { background: var(--blue); color: #fff; }
.btn--filled:hover { background: var(--blue-700); box-shadow: var(--shadow-1); }
.btn--tonal { background: var(--blue-50); color: var(--blue-800); }
.btn--tonal:hover { background: var(--blue-100); }
.btn--outlined { background: var(--surface); color: var(--blue); border-color: var(--line); }
.btn--outlined:hover { background: var(--blue-50); }
.btn--text { background: transparent; color: var(--blue); padding: 0 12px; }
.btn--text:hover { background: var(--blue-50); }
.btn--neutral { background: var(--surface-3); color: var(--ink); }
.btn--neutral:hover { background: var(--line-2); }
.btn--danger { background: var(--red-50); color: var(--red); }
.btn--lg { min-height: 48px; padding: 0 32px; font-size: 15px; }
.btn--sm { min-height: 32px; padding: 0 14px; font-size: 13px; }
.btn--block { display: flex; width: 100%; }
.btn--icon { width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 50%; background: transparent; color: var(--ink-3); border: 0; }
.btn--icon:hover { background: var(--surface-3); color: var(--ink); }
.btn:disabled { opacity: .5; cursor: default; box-shadow: none; }

/* ---------- chips ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.chip:hover { background: var(--surface-3); }
.chip.is-on, .chip[aria-pressed="true"] { background: var(--blue-50); border-color: var(--blue-50); color: var(--blue-800); }
.chip--pill { border-radius: 999px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- badges / status ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  background: var(--surface-3);
  color: var(--ink-2);
}
.badge--blue { background: var(--blue-50); color: var(--blue-800); }
.badge--green { background: var(--green-50); color: var(--green); }
.badge--amber { background: var(--amber-50); color: var(--amber); }
.badge--red { background: var(--red-50); color: var(--red); }
.badge--purple { background: var(--purple-50); color: var(--purple); }
.badge--ad { background: var(--surface); border: 1px solid var(--line); color: var(--ink-3); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 20px;
}
.card--flat { border: 0; background: var(--surface-2); }
.card--hover { transition: box-shadow .15s, border-color .15s; }
.card--hover:hover { box-shadow: var(--shadow-2); border-color: transparent; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card__title { font-size: 16px; font-weight: 500; }
.card__foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--line-2); margin: 16px 0; }

/* ---------- avatar ---------- */
.avatar {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue-50);
  color: var(--blue-800);
  font-size: 15px;
  font-weight: 500;
  flex: none;
  overflow: hidden;
}
.avatar--s { width: 32px; height: 32px; font-size: 13px; }
.avatar--l { width: 56px; height: 56px; font-size: 20px; }
.avatar--xl { width: 88px; height: 88px; font-size: 28px; }
.avatar--tapp { background: var(--ink); color: #fff; }
.avatar--green { background: var(--green-50); color: var(--green); }
.avatar--amber { background: var(--amber-50); color: var(--amber); }
.avatar--purple { background: var(--purple-50); color: var(--purple); }

/* ---------- form ---------- */
.field { display: grid; gap: 6px; }
.field__label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field__hint { font-size: 12px; color: var(--ink-3); }
.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
  font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235F6368' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--blue); flex: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px 0 18px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--ink-3);
}
.search input { flex: 1; border: 0; background: transparent; min-height: 44px; font-size: 15px; color: var(--ink); }
.search input:focus { outline: 0; }
.search:focus-within { background: var(--surface); box-shadow: var(--shadow-1); }

/* ---------- list ---------- */
.list { display: grid; }
.list__item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 8px;
  border-bottom: 1px solid var(--line-2);
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-s);
}
.list__item:last-child { border-bottom: 0; }
a.list__item:hover { background: var(--surface-2); text-decoration: none; }
.list__title { font-weight: 500; }
.list__meta { font-size: 13px; color: var(--ink-3); }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table th { font-size: 12px; font-weight: 500; color: var(--ink-3); background: var(--surface-2); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; }

/* ---------- kpi ---------- */
.kpi { display: grid; gap: 4px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); }
.kpi__label { font-size: 13px; color: var(--ink-3); }
.kpi__value { font-size: 30px; font-weight: 500; line-height: 1.1; letter-spacing: -.01em; }
.kpi__value small { font-size: 14px; font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.kpi__delta { font-size: 12px; }
.kpi__delta.is-up { color: var(--green); }
.kpi__delta.is-down { color: var(--red); }

/* ---------- stepper ---------- */
.stepper { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.step { display: grid; gap: 8px; }
.step__bar { height: 4px; border-radius: 2px; background: var(--line-2); }
.step__label { font-size: 13px; color: var(--ink-3); }
.step__sub { font-size: 12px; color: var(--ink-3); }
.step.is-done .step__bar { background: var(--blue); }
.step.is-done .step__label { color: var(--ink); }
.step.is-now .step__bar { background: var(--blue); }
.step.is-now .step__label { color: var(--blue); font-weight: 500; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-2); margin-bottom: 20px; overflow-x: auto; }
.tab { position: relative; padding: 12px 16px; border: 0; background: transparent; color: var(--ink-3); font-weight: 500; font-size: 14px; white-space: nowrap; }
.tab.is-on { color: var(--blue); }
.tab.is-on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--blue); }

/* ---------- placeholder（差し替え位置に、入れたいデータを書く） ---------- */
.ph {
  display: grid;
  place-content: center;
  gap: 4px;
  text-align: center;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 12px, var(--surface-3) 12px 24px);
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.5;
}
.ph strong { display: block; font-weight: 500; color: var(--ink-2); font-size: 13px; }
.ph--square { aspect-ratio: 1; }
.ph--wide { aspect-ratio: 16 / 9; }
.ph--photo { aspect-ratio: 4 / 3; }
.ph--inline { display: inline-grid; padding: 8px 12px; }

/* ---------- notes（仕様メモへの注記。画面上に置く小さなラベル） ---------- */
.spec {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--amber-50);
  color: var(--amber);
  font-size: 12px;
  line-height: 1.4;
}
.spec::before { content: "仕様"; font-weight: 500; padding-right: 6px; border-right: 1px solid rgba(176, 96, 0, .3); }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  padding: 12px 20px;
  border-radius: var(--radius-s);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 200;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- public app bar（LP・公開ページ） ---------- */
.appbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--appbar-h);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line-2);
}
.appbar__inner { display: flex; align-items: center; gap: 24px; height: 100%; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 18px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 32px; height: 32px; border-radius: 10px; background: var(--blue); display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.brand__sub { font-size: 12px; font-weight: 400; color: var(--ink-3); margin-left: 2px; }
.appbar__nav { display: flex; gap: 4px; }
.appbar__nav a { padding: 8px 14px; border-radius: 999px; color: var(--ink-2); font-size: 14px; font-weight: 500; }
.appbar__nav a:hover { background: var(--surface-3); text-decoration: none; }
.appbar__nav a.is-on { color: var(--blue); background: var(--blue-50); }
.appbar__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.appbar__menu { display: none; }

/* ---------- portal shell（ログイン後） ---------- */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; background: var(--surface); }
.shell__nav {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 12px 12px 24px;
  border-right: 1px solid var(--line-2);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.shell__brand { display: flex; align-items: center; gap: 10px; padding: 10px 12px 18px; }
.shell__brand .brand { font-size: 16px; }
.shell__role { font-size: 12px; color: var(--ink-3); padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; margin-left: auto; white-space: nowrap; }
.navlink {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.navlink:hover { background: var(--surface-3); text-decoration: none; }
.navlink.is-on { background: var(--blue-50); color: var(--blue-800); }
.navlink__count { margin-left: auto; font-size: 12px; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); display: grid; place-items: center; }
.navlink.is-on .navlink__count { background: var(--surface); }
.shell__nav-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-2); display: grid; gap: 4px; }
.shell__main { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--appbar-h);
  padding: 0 24px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-2);
}
.topbar .search { flex: 1; max-width: 560px; min-height: 44px; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.topbar__user { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 12px; border-radius: 999px; }
.topbar__user:hover { background: var(--surface-3); }
.topbar__user-name { font-size: 14px; font-weight: 500; }
.page { padding: 28px 24px 96px; max-width: 1200px; }
.page__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page__title { font-size: 26px; font-weight: 500; line-height: 1.3; }
.page__sub { color: var(--ink-3); font-size: 14px; margin-top: 4px; }
.view { display: none; }
.view.is-on { display: block; }
.section { margin-bottom: 32px; }
.section__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section__title { font-size: 17px; font-weight: 500; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.bottomnav { display: none; }

/* ---------- chat ---------- */
.chat { display: grid; gap: 14px; }
.msg { display: grid; grid-template-columns: auto 1fr; gap: 10px; max-width: 720px; }
.msg--me { grid-template-columns: 1fr auto; justify-items: end; margin-left: auto; }
.msg__bubble { padding: 12px 16px; border-radius: 18px; background: var(--surface-3); font-size: 14px; line-height: 1.7; }
.msg--me .msg__bubble { background: var(--blue-50); color: var(--ink); border-bottom-right-radius: 6px; }
.msg:not(.msg--me) .msg__bubble { border-bottom-left-radius: 6px; }
.msg__meta { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.msg--me .msg__meta { text-align: right; }
.composer { display: flex; align-items: flex-end; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 28px; background: var(--surface); }
.composer textarea { flex: 1; border: 0; resize: none; min-height: 24px; max-height: 120px; padding: 6px 8px; font-size: 14px; }
.composer textarea:focus { outline: 0; }

/* ---------- expert card ---------- */
.expert { display: grid; grid-template-columns: 72px 1fr; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); transition: box-shadow .15s; }
.expert:hover { box-shadow: var(--shadow-2); }
.expert__photo { width: 72px; height: 72px; border-radius: 16px; }
.expert__name { font-size: 16px; font-weight: 500; }
.expert__office { font-size: 13px; color: var(--ink-3); }
.expert__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.expert__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-2); }
.expert__foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.stars { color: var(--amber); letter-spacing: 1px; font-size: 13px; }

/* ---------- article card ---------- */
.article-card { display: grid; gap: 10px; color: inherit; text-decoration: none; }
.article-card:hover { text-decoration: none; }
.article-card:hover .article-card__title { color: var(--blue); }
.article-card__title { font-size: 16px; font-weight: 500; line-height: 1.5; }
.article-card__meta { font-size: 12px; color: var(--ink-3); display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- ad slot ---------- */
.ad { position: relative; display: grid; grid-template-columns: 48px 1fr; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.ad__label { position: absolute; top: 10px; right: 12px; }
.ad__title { font-weight: 500; font-size: 15px; padding-right: 48px; }
.ad__text { font-size: 13px; color: var(--ink-2); }

/* ---------- footer（公開ページ） ---------- */
.footer { border-top: 1px solid var(--line-2); padding: 48px 0 40px; margin-top: 64px; background: var(--surface-2); }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer__title { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-bottom: 10px; }
.footer ul { display: grid; gap: 8px; font-size: 14px; }
.footer a { color: var(--ink-2); }
.footer__copy { margin-top: 32px; font-size: 12px; color: var(--ink-3); }

/* ---------- auth pages ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; background: var(--surface-2); }
.auth__card { width: 100%; max-width: 440px; padding: 40px 36px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); }
.auth__card .brand { margin-bottom: 24px; }
.auth__title { font-size: 24px; font-weight: 500; margin-bottom: 4px; }
.auth__sub { color: var(--ink-3); font-size: 14px; margin-bottom: 24px; }
.auth__or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 12px; margin: 16px 0; }
.auth__or::before, .auth__or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.auth__foot { margin-top: 20px; font-size: 14px; text-align: center; color: var(--ink-3); }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .container { padding: 0 18px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .appbar__nav { display: none; }
  .appbar__menu { display: inline-flex; }
  .appbar__actions .btn--outlined { display: none; }
  .shell { grid-template-columns: 1fr; }
  .shell__nav { display: none; }
  .topbar { padding: 0 16px; }
  .topbar__user-name { display: none; }
  .page { padding: 20px 16px 110px; }
  .page__title { font-size: 22px; }
  .stepper { grid-auto-flow: row; grid-auto-columns: auto; }
  .step { grid-template-columns: 4px 1fr; gap: 10px; }
  .step__bar { height: auto; width: 4px; min-height: 36px; }
  .bottomnav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 60;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    background: var(--surface);
    border-top: 1px solid var(--line-2);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottomnav a { display: grid; justify-items: center; gap: 2px; padding: 6px 4px; color: var(--ink-3); font-size: 11px; text-decoration: none; border-radius: 12px; }
  .bottomnav a.is-on { color: var(--blue-800); }
  .bottomnav a.is-on .ic { background: var(--blue-50); border-radius: 999px; padding: 2px 10px; width: 44px; height: 28px; }
  .expert { grid-template-columns: 56px 1fr; padding: 16px; }
  .expert__photo { width: 56px; height: 56px; }
  .auth__card { padding: 28px 22px; }
  .msg, .msg--me { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
@media (max-width: 768px) { .pc-br { display: none; } }

/* 頭文字アバターは使わない（2026-10-10 ユーザー指示）。空いた列は詰める */
.avatar { display: none !important; }
.list__item { grid-template-columns: 1fr auto; }
.msg, .msg--me { grid-template-columns: 1fr; }
.msg--me { justify-items: end; }
.ad { grid-template-columns: 1fr; }
.topbar__user { padding: 6px 12px; }
@media (max-width: 768px) { .topbar__user-name { display: inline; font-size: 13px; } }
