/*
 * 推奨の吹き出しの新デザイン（2026-11 M3）＋ヘッダーの色と背景。
 * body[data-reco-ui="m3"] のときだけ読み込まれる（RECO_UI_M3 / ?ui=m3）。
 * 値はモック docs/design/reco_ui_m3/chat.html の確定設定（INTEGRATION_PLAN.md）から写したもの。
 * 文字の大きさは --fs（チャットの本文の大きさ）の倍数で書き、表示設定の文字サイズに追従させる。
 */

body[data-reco-ui="m3"] {
  --m3-paper: #f3efe4;
  --m3-paper-2: #e9e3d2;
  --m3-line: #d9d2bf;
  --m3-high: #e2e7ed;
  --m3-pri: #2f5d46;
  --m3-pri-c: #dde9df;
  --m3-on: #1b1f24;
  --m3-var: #4a525c;
  --m3-out: #7a838e;
  --m3-outv: #d3d8de;
  --m3-ok: #2f6b4a; --m3-ok-c: #dcefe3; --m3-on-ok: #143c27;
  --m3-warn: #8a5a00; --m3-warn-c: #fff1d1; --m3-on-warn: #4a3300;
  --m3-err: #ba1a1a; --m3-err-c: #ffdeda; --m3-on-err: #410002;
  --m3-info: #3f6384; --m3-info-c: #e3edf6; --m3-on-info: #0e2a42;
  --m3-head: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --m3-r: 18px;
}

/* ---------- ヘッダーの色と背景（既定の配色のときだけ。設定で選んだ配色はそのまま） ---------- */
body[data-reco-ui="m3"]:not([data-sage-color-theme]) .sage-header.ui-header,
body[data-reco-ui="m3"][data-sage-color-theme="sage-terrace"] .sage-header.ui-header {
  background: linear-gradient(180deg, #3a6b52 0%, #2f5d46 100%);
}

body[data-reco-ui="m3"] .sage-header #appTitle {
  font-family: var(--m3-head);
  font-weight: 600;
  letter-spacing: 0.06em;
}

body[data-reco-ui="m3"]:not([data-sage-color-theme]) .chat-messages-viewport,
body[data-reco-ui="m3"][data-sage-color-theme="sage-terrace"] .chat-messages-viewport {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--m3-paper-2) 60%, transparent) 0, transparent 30%, transparent 70%, color-mix(in srgb, var(--m3-pri-c) 45%, transparent) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E"),
    var(--m3-paper);
}

/* 葉: 右上（左右反転）と左下。先端を画面の上の中央へ向ける（角度はモックの計算値） */
body[data-reco-ui="m3"]:not([data-sage-color-theme]) .chat-messages-viewport::before,
body[data-reco-ui="m3"]:not([data-sage-color-theme]) .chat-messages-viewport::after,
body[data-reco-ui="m3"][data-sage-color-theme="sage-terrace"] .chat-messages-viewport::before,
body[data-reco-ui="m3"][data-sage-color-theme="sage-terrace"] .chat-messages-viewport::after {
  content: "";
  position: absolute;
  z-index: 0;
  width: 130px;
  height: 207px;
  background: url("../brand/onboarding-leaf.png") center / contain no-repeat;
  opacity: 0.16;
  pointer-events: none;
}

body[data-reco-ui="m3"] .chat-messages-viewport::before {
  right: -30px;
  top: 40px;
  transform: rotate(-16deg) scaleX(-1);
}

body[data-reco-ui="m3"] .chat-messages-viewport::after {
  left: -38px;
  bottom: 40px;
  transform: rotate(-7deg);
}

/* ---------- 吹き出し全体 ---------- */
body[data-reco-ui="m3"] .ui-bubble--reco {
  border-color: var(--m3-line);
  border-radius: var(--m3-r);
  padding: 12px 0 6px;
  max-width: 100%;
}

body[data-reco-ui="m3"] .ui-reco-block--m3,
body[data-reco-ui="m3"] .ui-reco-block[data-streaming-skeleton] {
  --fs: var(--sage-chat-copy-fs, var(--font-size-base, 1rem));
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--m3-on);
}

/* 詳細シートは吹き出しの外（body 直下）に出すので、吹き出しに限らず大きさを決める */
body[data-reco-ui="m3"] svg.m3-i {
  width: 16px;
  height: 16px;
  flex: none;
}

/* ひとこと（ラベル付き） */
body[data-reco-ui="m3"] .ui-reco-block .ui-personal-advice {
  margin: 0;
  padding: 0 14px;
  background: none;
  border: 0;
  box-shadow: none;
}

body[data-reco-ui="m3"] .m3-advice__label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: calc(var(--fs) * 0.76);
  font-weight: 700;
  color: var(--m3-pri);
  margin-bottom: 2px;
  letter-spacing: 0.04em;
}

body[data-reco-ui="m3"] .m3-advice__label svg.m3-i { width: 14px; height: 14px; }

body[data-reco-ui="m3"] .ui-reco-block .ui-personal-advice__text {
  margin: 0;
  font-size: calc(var(--fs) * 1.07);
  line-height: 1.7;
  color: var(--m3-on);
}

/* 受診・インフルの帯 */
body[data-reco-ui="m3"] .m3-alert {
  margin: 0 14px;
  border-radius: 14px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--m3-paper) 38%, #fff);
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--m3-on);
}

body[data-reco-ui="m3"] .m3-alert__h { display: flex; align-items: center; gap: 10px; }
body[data-reco-ui="m3"] .m3-alert__h b { font-size: calc(var(--fs) * 1.02); line-height: 1.4; }
body[data-reco-ui="m3"] .m3-alert__ic {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; flex: none; color: #fff;
}
body[data-reco-ui="m3"] .m3-alert__ic svg.m3-i { width: 17px; height: 17px; }
body[data-reco-ui="m3"] .m3-alert--err .m3-alert__ic { background: var(--m3-err); }
body[data-reco-ui="m3"] .m3-alert--err .m3-alert__h b { color: #8c1d18; }
body[data-reco-ui="m3"] .m3-alert--warn .m3-alert__ic { background: #9a6400; }
body[data-reco-ui="m3"] .m3-alert--warn .m3-alert__h b { color: #6b4500; }

body[data-reco-ui="m3"] .m3-alert__todo {
  list-style: none; margin: 0; padding: 0 0 0 40px;
  display: flex; flex-direction: column; gap: 6px;
}
body[data-reco-ui="m3"] .m3-alert__todo li {
  display: flex; align-items: flex-start; gap: 8px;
  font-weight: 700; font-size: calc(var(--fs) * 0.98); line-height: 1.45;
}
body[data-reco-ui="m3"] .m3-alert__todo svg.m3-i { width: 18px; height: 18px; margin-top: 1px; }

body[data-reco-ui="m3"] .m3-alert__more { margin-left: 40px; }
body[data-reco-ui="m3"] .m3-alert__more > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  font-size: calc(var(--fs) * 0.84);
  font-weight: 700;
  color: var(--m3-pri);
}
body[data-reco-ui="m3"] .m3-alert__more > summary::-webkit-details-marker { display: none; }
body[data-reco-ui="m3"] .m3-alert__more[open] > summary svg { transform: rotate(90deg); }
body[data-reco-ui="m3"] .m3-alert__body {
  margin-top: 6px;
  font-size: calc(var(--fs) * 0.86);
  line-height: 1.6;
}

/* 剤形の希望（カードの上の1行） */
body[data-reco-ui="m3"] .m3-cohd {
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px; margin-bottom: -4px;
  font-size: calc(var(--fs) * 0.84); color: var(--m3-var); line-height: 1.5;
}
body[data-reco-ui="m3"] .m3-cohd__ic {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--m3-pri-c); color: var(--m3-pri);
  display: grid; place-items: center; flex: none;
}
body[data-reco-ui="m3"] .m3-cohd__ic svg.m3-i { width: 15px; height: 15px; }

/* ---------- カードの列 ---------- */
body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-carousel-region { padding: 0; }
body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-carousel-wrap {
  padding: 2px 14px 4px;
  scroll-padding-inline: 14px;
  scrollbar-width: none;
}
body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-carousel-wrap::-webkit-scrollbar { display: none; }
body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-carousel {
  gap: 10px;
  padding: 0;
  align-items: stretch;
}
body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-carousel .ui-card--m3 {
  /* 縦長・幅固定（どの画面でも 260px。狭い画面では 78vw まで） */
  flex: 0 0 min(260px, 78vw);
  scroll-snap-align: start;
}
/*
 * 送りボタンが出る広い画面では、3枚が少しだけはみ出すときに幅を 200px まで縮めて全部見せる
 * （#357: はみ出すと「›」が3枚目の写真に重なっていた）。スマホは従来どおり次のカードの端が見える幅。
 */
@media (min-width: 769px) {
  body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-carousel .ui-card--m3 {
    flex: 1 1 0;
    min-width: 200px;
    max-width: 260px;
  }
}

body[data-reco-ui="m3"] .ui-card--m3 {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--m3-high);
  border-radius: var(--m3-r);
  overflow: hidden;
  padding: 0;
  box-shadow: none;
}
body[data-reco-ui="m3"] .ui-card--m3.is-first { border: 1.5px solid var(--m3-pri); }
body[data-reco-ui="m3"] .ui-card--m3.is-open { border-color: var(--m3-pri); }
body[data-reco-ui="m3"] .ui-card--m3.is-unusable .m3-ph,
body[data-reco-ui="m3"] .ui-card--m3.is-unusable .m3-cb { opacity: 0.55; }

/* 写真（主役）。順位・区分・製品名を重ねる */
body[data-reco-ui="m3"] .m3-ph {
  position: relative;
  height: 200px;
  flex: none;
  overflow: hidden;
  background: radial-gradient(70% 80% at 50% 55%, #fff 0 45%, color-mix(in srgb, var(--m3-pri-c) 55%, #fff) 100%);
}
body[data-reco-ui="m3"] .m3-pimg {
  position: absolute;
  inset: 14px 18px calc(10px + var(--fs) * 2.6);
  display: flex;
  align-items: center;
  justify-content: center;
}
body[data-reco-ui="m3"] .m3-pimg .ui-med-image {
  aspect-ratio: auto;
  width: 100%;
  height: 100%;
  background: transparent;
}
/* 写真は枠の中に収める（拡大するとカードからはみ出していた） */
body[data-reco-ui="m3"] .m3-pimg .ui-med-image { overflow: hidden; border-radius: 10px; }
body[data-reco-ui="m3"] .m3-pimg .ui-med-image img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  transform: none;
}
body[data-reco-ui="m3"] .m3-ph::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: calc(var(--fs) * 3.6);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.92) 70%);
  z-index: 1;
  pointer-events: none;
}
body[data-reco-ui="m3"] .m3-cn { position: absolute; z-index: 2; display: flex; gap: 4px; align-items: center; }
body[data-reco-ui="m3"] .m3-cn--tl { left: 8px; top: 8px; }
body[data-reco-ui="m3"] .m3-cn--tr { right: 8px; top: 8px; }
body[data-reco-ui="m3"] .m3-cn--name { left: 12px; right: 12px; bottom: 4px; display: block; }

body[data-reco-ui="m3"] .m3-rk {
  height: calc(var(--fs) * 1.5);
  padding: 0 0.6em;
  border-radius: 99px;
  background: var(--m3-pri);
  color: #fff;
  font-size: calc(var(--fs) * 0.78);
  font-weight: 700;
  display: flex;
  align-items: center;
}
body[data-reco-ui="m3"] .m3-rk--alt { background: rgba(27, 31, 36, 0.62); }
body[data-reco-ui="m3"] .m3-rk--ng { background: var(--m3-err); }

body[data-reco-ui="m3"] .m3-cls {
  height: calc(var(--fs) * 1.5);
  padding: 0 0.6em;
  border-radius: 6px;
  font-size: calc(var(--fs) * 0.74);
  font-weight: 700;
  display: flex;
  align-items: center;
  background: #fff;
  box-shadow: 0 0 0 1px var(--m3-outv);
  color: var(--m3-var);
}
body[data-reco-ui="m3"] .m3-cls--c1 { color: #8a1d12; box-shadow: 0 0 0 1px #e8b4ac; background: #fff7f5; }
body[data-reco-ui="m3"] .m3-cls--c2s { color: #6b4500; box-shadow: 0 0 0 1px #e8cf99; background: #fffaf0; }

body[data-reco-ui="m3"] .m3-maker {
  font-size: calc(var(--fs) * 0.74);
  color: var(--m3-var);
  line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body[data-reco-ui="m3"] .ui-card--m3 .m3-name {
  margin: 0;
  font-size: calc(var(--fs) * 1.1);
  font-weight: 700;
  line-height: 1.3;
  color: var(--m3-on);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* カードの本文 */
body[data-reco-ui="m3"] .m3-cb {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: calc(var(--fs) * 0.3) calc(var(--fs) * 0.8) 0;
  flex: 1 1 auto;
}

body[data-reco-ui="m3"] .m3-fit { display: flex; flex-direction: column; gap: 2px; }
body[data-reco-ui="m3"] .m3-fit small { font-size: calc(var(--fs) * 0.72); color: var(--m3-var); line-height: 1; }
body[data-reco-ui="m3"] .m3-fit__row { display: flex; align-items: center; gap: 8px; }
body[data-reco-ui="m3"] .m3-fit__track { flex: 1; height: 5px; background: var(--m3-high); border-radius: 3px; overflow: hidden; }
body[data-reco-ui="m3"] .m3-fit__track i { display: block; height: 100%; background: var(--m3-pri); border-radius: 3px; }
body[data-reco-ui="m3"] .m3-fit b { font-size: calc(var(--fs) * 0.93); color: var(--m3-pri); font-variant-numeric: tabular-nums; line-height: 1; }

body[data-reco-ui="m3"] .m3-info {
  font-size: calc(var(--fs) * 0.84);
  color: var(--m3-var);
  display: flex; flex-wrap: wrap; gap: 0.15em 0.5em; align-items: center;
}
body[data-reco-ui="m3"] .m3-info span { display: inline-flex; gap: 3px; align-items: center; }
body[data-reco-ui="m3"] .m3-info svg.m3-i { width: 15px; height: 15px; color: var(--m3-info); }
body[data-reco-ui="m3"] .m3-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--m3-out); }

/* バッジ（丸・薄い塗り・短い名前） */
body[data-reco-ui="m3"] .m3-bdg { display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-start; }
body[data-reco-ui="m3"] .m3-b {
  display: inline-flex; align-items: center; gap: 3px;
  height: calc(var(--fs) * 1.6);
  padding: 0 calc(var(--fs) * 0.55) 0 calc(var(--fs) * 0.42);
  border: 0;
  border-radius: calc(var(--fs) * 0.8);
  font-family: inherit;
  font-size: calc(var(--fs) * 0.8);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  flex: none;
}
body[data-reco-ui="m3"] button.m3-b { cursor: pointer; }
body[data-reco-ui="m3"] .m3-b svg.m3-i { width: 13px; height: 13px; }
body[data-reco-ui="m3"] .m3-b--err { background: var(--m3-err-c); color: var(--m3-on-err); }
body[data-reco-ui="m3"] .m3-b--err svg { color: var(--m3-err); }
body[data-reco-ui="m3"] .m3-b--warn { background: var(--m3-warn-c); color: var(--m3-on-warn); }
body[data-reco-ui="m3"] .m3-b--warn svg { color: var(--m3-warn); }
body[data-reco-ui="m3"] .m3-b--ok { background: var(--m3-ok-c); color: var(--m3-on-ok); }
body[data-reco-ui="m3"] .m3-b--ok svg { color: var(--m3-ok); }
body[data-reco-ui="m3"] .m3-b--info { background: var(--m3-info-c); color: var(--m3-on-info); }
body[data-reco-ui="m3"] .m3-b--info svg { color: var(--m3-info); }
body[data-reco-ui="m3"] .m3-more-n {
  height: calc(var(--fs) * 1.6);
  padding: 0 0.5em;
  border: 0;
  border-radius: 99px;
  background: #f4f6f8;
  font-family: inherit;
  font-size: calc(var(--fs) * 0.78);
  font-weight: 700;
  line-height: 1;
  color: var(--m3-var);
  cursor: pointer;
}
body[data-reco-ui="m3"] button.m3-b:focus-visible,
body[data-reco-ui="m3"] .m3-more-n:focus-visible,
body[data-reco-ui="m3"] .m3-more:focus-visible {
  outline: 2px solid var(--m3-pri);
  outline-offset: 2px;
}

/* カード下の一言 */
body[data-reco-ui="m3"] .m3-pt {
  display: flex; gap: 8px; align-items: center;
  border-top: 1px solid var(--m3-high);
  padding: 6px 0;
  flex: 1 1 auto;
}
body[data-reco-ui="m3"] .m3-pt__ic {
  width: calc(var(--fs) * 1.5); height: calc(var(--fs) * 1.5);
  border-radius: 50%; display: grid; place-items: center; flex: none;
}
body[data-reco-ui="m3"] .m3-pt__ic svg.m3-i { width: 13px; height: 13px; }
body[data-reco-ui="m3"] .m3-pt--ok .m3-pt__ic { background: var(--m3-ok-c); color: var(--m3-ok); }
body[data-reco-ui="m3"] .m3-pt--warn .m3-pt__ic { background: var(--m3-warn-c); color: var(--m3-warn); }
body[data-reco-ui="m3"] .m3-pt--err .m3-pt__ic { background: var(--m3-err-c); color: var(--m3-err); }
/* 第1類・要指導: 薬剤師の案内（注意の一言とは別の行。文が長いので4行まで出す） */
body[data-reco-ui="m3"] .m3-pt--rx { flex: 0 0 auto; }
body[data-reco-ui="m3"] .m3-pt--rx .m3-pt__ic { background: #fff7f5; color: #8a1d12; box-shadow: 0 0 0 1px #e8b4ac; }
body[data-reco-ui="m3"] .m3-pt--rx .m3-pt__tx { -webkit-line-clamp: 4; }
body[data-reco-ui="m3"] .m3-pt__tx {
  font-size: calc(var(--fs) * 0.82);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* くわしく */
body[data-reco-ui="m3"] .m3-mwrap {
  border-top: 1px solid var(--m3-high);
  margin-top: auto;
  padding: 2px calc(var(--fs) * 0.8) 4px;
}
body[data-reco-ui="m3"] .m3-more {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: calc(var(--fs) * 0.88);
  font-weight: 700;
  color: var(--m3-pri);
  cursor: pointer;
}
body[data-reco-ui="m3"] .ui-card--m3 .m3-detail {
  margin: 0;
  padding: 0 calc(var(--fs) * 0.8) 10px;
  font-size: calc(var(--fs) * 0.86);
}
body[data-reco-ui="m3"] .ui-card--m3 .m3-detail.is-collapsed { display: none; }
body[data-reco-ui="m3"] .m3-cautlist { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
body[data-reco-ui="m3"] .m3-cautlist li { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; line-height: 1.5; }

/* 合う薬が無い: 案内カードと同じ見出し帯の形（.m3-st）。吹き出しの端まで帯を出す */
body[data-reco-ui="m3"] .ui-reco-block--m3 > .m3-none { margin: 0; }
body[data-reco-ui="m3"] .ui-reco-block--m3:has(> .m3-none) { padding-top: 0 !important; gap: 0; }
body[data-reco-ui="m3"] .ui-reco-block--m3:has(> .m3-none) .m3-after { border-top: 0; padding: 0 14px 10px; }

/* ---------- 下の注意・役に立ちましたか ---------- */
body[data-reco-ui="m3"] .m3-after {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px 0;
  border-top: 1px solid var(--m3-high);
}
body[data-reco-ui="m3"] .m3-after > .ui-alert,
body[data-reco-ui="m3"] .m3-after > details,
body[data-reco-ui="m3"] .m3-after > .m3-none { margin: 0; }
/* 下の枠の上線と、先頭に来た注意の上線が2本重ならないように */
body[data-reco-ui="m3"] .m3-after > .m3-care:first-child { border-top: 0; padding-top: 0; }

/* 全体の注意: 1件目を2行だけ見せて畳む */
body[data-reco-ui="m3"] .m3-notes > summary {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}
body[data-reco-ui="m3"] .m3-notes > summary::-webkit-details-marker { display: none; }
body[data-reco-ui="m3"] .m3-notes { display: flex; flex-direction: column; gap: 6px; }
body[data-reco-ui="m3"] .m3-notes[open] { gap: 6px; }
body[data-reco-ui="m3"] .m3-notes__h {
  display: flex; align-items: center; gap: 6px;
  font-size: calc(var(--fs) * 0.8); font-weight: 700; color: var(--m3-on-warn);
}
body[data-reco-ui="m3"] .m3-notes__h svg.m3-i { color: var(--m3-warn); }
body[data-reco-ui="m3"] .m3-notes__i {
  display: block;
  position: relative;
  padding-left: 13px;
  font-size: calc(var(--fs) * 0.86); line-height: 1.55;
}
body[data-reco-ui="m3"] .m3-notes__i::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--m3-warn);
}
body[data-reco-ui="m3"] .m3-notes:not([open]) .m3-notes__first {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
body[data-reco-ui="m3"] .m3-notes__more {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: calc(var(--fs) * 0.84); font-weight: 700; color: var(--m3-pri);
}
body[data-reco-ui="m3"] .m3-notes[open] .m3-notes__more { display: none; }

/* 追加の質問と年齢の案内（1つの枠） */
body[data-reco-ui="m3"] .m3-ask {
  margin: 0;
  background: var(--m3-pri-c);
  color: #0f2a1c;
  border: 0;
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
body[data-reco-ui="m3"] .m3-ask__h { display: flex; align-items: center; gap: 6px; color: var(--m3-pri); }
body[data-reco-ui="m3"] .m3-ask__h b { font-size: calc(var(--fs) * 0.9); }
body[data-reco-ui="m3"] .m3-ask__q { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
body[data-reco-ui="m3"] .m3-ask__q li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: calc(var(--fs) * 0.9); line-height: 1.5;
}
body[data-reco-ui="m3"] .m3-ask__q li svg.m3-i { margin-top: 0.2em; color: var(--m3-pri); }
/* 問いの右に余白があれば「回答する」を右に並べ、無ければ下の右端へ回す */
body[data-reco-ui="m3"] .m3-ask.ui-reco-followup { flex-direction: row; flex-wrap: wrap; align-items: flex-end; column-gap: 12px; }
body[data-reco-ui="m3"] .m3-ask.ui-reco-followup .m3-ask__h { flex: 1 0 100%; }
body[data-reco-ui="m3"] .m3-ask.ui-reco-followup .m3-ask__q { flex: 1 0 auto; max-width: 100%; min-width: 0; }  /* 問いが折れずに収まるときだけ右に並ぶ */
body[data-reco-ui="m3"] .ui-reco-block--m3 button.m3-ask__btn {
  margin-left: auto; flex: 0 0 auto;
  align-self: flex-end;
  display: inline-flex; align-items: center; gap: 2px;
  min-height: 36px; min-width: 0;
  padding: 0 0.9em 0 1.1em;
  border: 0; border-radius: 18px;
  background: var(--m3-pri); color: #fff;
  font-family: inherit; font-size: calc(var(--fs) * 0.88); font-weight: 700;
  cursor: pointer;
}

body[data-reco-ui="m3"] .m3-disc {
  display: flex; gap: 6px; align-items: center;
  font-size: calc(var(--fs) * 0.8); color: var(--m3-var);
}

/* 受診の目安（従来の畳み）を落ち着いた形に */
body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-reco-collapse--doctor {
  border: 0;
  background: none;
  padding: 0;
}
body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-reco-collapse--doctor > summary {
  font-size: calc(var(--fs) * 0.84);
  font-weight: 700;
  color: var(--m3-pri);
}
body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-reco-collapse--doctor .ui-alert {
  background: color-mix(in srgb, var(--m3-paper) 38%, #fff);
  border: 0;
  border-radius: 12px;
  color: var(--m3-on);
}

body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-feedback-compact { margin: 0; }

@media (prefers-reduced-motion: no-preference) {
  body[data-reco-ui="m3"] .m3-alert__more > summary svg { transition: transform 0.15s ease; }
}

/*
 * main.css の「ボタンは最低 44px 四方」（button:not(...) で詳しさが高い）が
 * バッジと「くわしく」を縦に引き伸ばすので、カードの中だけ打ち消す。
 * 押せる高さはバッジで 24px 以上（WCAG 2.2 の最小）を保つ。
 */
body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-card--m3 button.m3-b,
body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-card--m3 button.m3-more-n {
  min-height: 0;
  min-width: 0;
  height: max(24px, calc(var(--fs) * 1.6));
  justify-content: flex-start;
  font-size: calc(var(--fs) * 0.8);
}
body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-card--m3 button.m3-more-n {
  font-size: calc(var(--fs) * 0.78);
}
body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-card--m3 button.m3-more {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  justify-content: space-between;
  font-size: calc(var(--fs) * 0.88);
}

/* 読み上げは「役に立ちましたか」の行のスピーカーで足りるので、下の大きいボタンは出さない */
/* main.js が #voice-read-container-inline に display:block を直接書くので !important で打ち消す */
body[data-reco-ui="m3"] .m3-after:has(.ui-feedback-compact) > .ui-reco-voice { display: none !important; }
body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-feedback-compact {
  background: none;
  border: 0;
  padding: 0;
  box-shadow: none;
}

/*
 * 候補の送り（‹ ・・・ 1/3 ›）。スマホは横にめくれて次のカードの端も見えるので出さない。
 * 広い画面ではマウスで送れるよう矢印だけ残す（点と件数は出さない）。
 */
@media (max-width: 768px) {
  body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-carousel-nav { display: none; }
}
body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-carousel-dots,
body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-carousel-counter { display: none; }

/*
 * 広い画面の送りボタン: カードの下に並べず、左右の端に重ねる（白い丸＋深緑の矢印＋薄い影）。
 * 製品写真を隠さないよう写真の下の高さに置く（#357）。端まで来た側と、全部見えているときは出さない。
 * 端の判定は reco_m3_renderer.js が data-m3-start / data-m3-end を付ける。
 */
body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-carousel-region { position: relative; }
body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-carousel-nav {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  pointer-events: none;
}
body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-carousel-arrow {
  position: absolute;
  /* 写真（.m3-ph 高さ 200px）の下、おすすめ度の行の高さに置き、製品写真を隠さない（#357） */
  top: 232px;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--m3-pri);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.14);
  display: grid;
  place-items: center;
  pointer-events: auto;
  transition: opacity 0.15s ease, background 0.15s ease;
}
body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-carousel-arrow--prev { left: 6px; }
body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-carousel-arrow--next { right: 6px; }
body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-carousel-arrow svg { width: 20px; height: 20px; }
body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-carousel-arrow:hover { background: var(--m3-pri-c); }
body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-carousel-region[data-m3-start] .ui-carousel-arrow--prev,
body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-carousel-region[data-m3-end] .ui-carousel-arrow--next {
  opacity: 0;
  pointer-events: none;
}

/* ---------- 「くわしく」の詳細シート ---------- */
body[data-reco-ui="m3"] .m3-sheet-root { position: fixed; inset: 0; z-index: 1000; }
body[data-reco-ui="m3"] .m3-sheet-root button.m3-scrim {
  position: absolute; inset: 0; width: 100%; height: 100%;
  min-height: 0; min-width: 0; border: 0; padding: 0;
  background: rgba(15, 20, 18, 0.42);
  cursor: default;
}
body[data-reco-ui="m3"] .m3-sheet {
  --fs: var(--sage-chat-copy-fs, var(--font-size-base, 1rem));
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 86vh; max-height: 86dvh;
  display: flex; flex-direction: column;
  background: #fff;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px));
  color: var(--m3-on);
}
@media (min-width: 769px) {
  body[data-reco-ui="m3"] .m3-sheet {
    left: 50%; right: auto; bottom: auto; top: 50%;
    width: min(520px, calc(100vw - 48px));
    max-height: 80vh;
    transform: translate(-50%, -50%);
    border-radius: 22px;
  }
  body[data-reco-ui="m3"] .m3-sheet__grab { display: none; }
}
body[data-reco-ui="m3"] .m3-sheet__grab { width: 36px; height: 4px; border-radius: 2px; background: var(--m3-outv); align-self: center; margin-bottom: 6px; }
body[data-reco-ui="m3"] .m3-sheet button.m3-sheet__x {
  position: absolute; right: 10px; top: 10px;
  width: 36px; height: 36px; min-width: 0; min-height: 0;
  border: 0; border-radius: 50%; background: #f4f6f8; color: var(--m3-var);
  display: grid; place-items: center; cursor: pointer;
}
body[data-reco-ui="m3"] .m3-sheet__x svg.m3-i { width: 18px; height: 18px; }
body[data-reco-ui="m3"] .m3-sheet__hd { display: flex; gap: 12px; align-items: center; padding: 4px 56px 10px 16px; }
body[data-reco-ui="m3"] .m3-sheet__hd img { width: 64px; height: 64px; object-fit: contain; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px var(--m3-high); flex: none; }
body[data-reco-ui="m3"] .m3-sheet__hd .m3-cls { display: inline-flex; margin-top: 4px; }
body[data-reco-ui="m3"] .m3-sheet__name { font-weight: 700; font-size: calc(var(--fs) * 1.1); line-height: 1.35; }
body[data-reco-ui="m3"] .m3-sheet__tabs { display: flex; border-bottom: 1px solid var(--m3-high); padding: 0 8px; flex: none; }
body[data-reco-ui="m3"] .m3-sheet__tabs button[role="tab"] {
  flex: 1; min-width: 0; min-height: 44px;
  border: 0; background: none; padding: 0 4px;
  font-family: inherit; font-size: calc(var(--fs) * 0.88); font-weight: 700; color: var(--m3-var);
  border-bottom: 3px solid transparent; cursor: pointer;
}
body[data-reco-ui="m3"] .m3-sheet__tabs button[aria-selected="true"] { color: var(--m3-pri); border-bottom-color: var(--m3-pri); }
body[data-reco-ui="m3"] .m3-sheet__body {
  overflow-y: auto; padding: 12px 16px 8px;
  font-size: calc(var(--fs) * 0.92); line-height: 1.65;
  display: flex; flex-direction: column; gap: 10px;
}
body[data-reco-ui="m3"] .m3-sheet__p { margin: 0; }
body[data-reco-ui="m3"] .m3-sheet__body .ui-card-label { font-weight: 700; color: var(--m3-pri); font-size: calc(var(--fs) * 0.82); }
body[data-reco-ui="m3"] .m3-sheet button:focus-visible { outline: 2px solid var(--m3-pri); outline-offset: 2px; }


/* ---------- 詳細シートの中身（表・注意のまとまり） ---------- */
body[data-reco-ui="m3"] .m3-sheet__body { gap: 14px; }
body[data-reco-ui="m3"] .m3-muted { color: var(--m3-var); }
body[data-reco-ui="m3"] .m3-chips { display: flex; flex-wrap: wrap; gap: 6px; }
body[data-reco-ui="m3"] .m3-chips span {
  padding: 4px 10px; border-radius: 99px;
  background: var(--m3-pri-c); color: #0f2a1c;
  font-size: calc(var(--fs) * 0.84); line-height: 1.4;
}
body[data-reco-ui="m3"] .m3-chips--err span { background: var(--m3-err-c); color: var(--m3-on-err); }
body[data-reco-ui="m3"] .m3-sec { display: flex; flex-direction: column; gap: 8px; }
body[data-reco-ui="m3"] .m3-sec h4 {
  margin: 0; display: flex; align-items: center; gap: 6px;
  font-size: calc(var(--fs) * 0.92); font-weight: 700;
}
body[data-reco-ui="m3"] .m3-sec h4 svg.m3-i { width: 18px; height: 18px; }
body[data-reco-ui="m3"] .m3-sec--err h4 { color: #8c1d18; }
body[data-reco-ui="m3"] .m3-sec--warn h4 { color: #6b4500; }
body[data-reco-ui="m3"] .m3-sec--ok h4, body[data-reco-ui="m3"] .m3-sec--info h4, body[data-reco-ui="m3"] .m3-sec--you h4 { color: var(--m3-pri); }
body[data-reco-ui="m3"] .m3-sec--err { background: #fff7f6; border-radius: 12px; padding: 10px 12px; }
body[data-reco-ui="m3"] .m3-sec--warn { background: #fffaf0; border-radius: 12px; padding: 10px 12px; }
body[data-reco-ui="m3"] .m3-sec__lead { margin: 0; font-size: calc(var(--fs) * 0.86); font-weight: 700; }
body[data-reco-ui="m3"] .m3-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
body[data-reco-ui="m3"] .m3-list > li { display: flex; gap: 8px; align-items: flex-start; font-size: calc(var(--fs) * 0.88); line-height: 1.55; }
body[data-reco-ui="m3"] .m3-list > li > svg.m3-i { margin-top: 0.2em; color: var(--m3-pri); }
body[data-reco-ui="m3"] .m3-list > li.is-warn > svg.m3-i { color: var(--m3-warn); }
body[data-reco-ui="m3"] .m3-sec--err .m3-list > li::before,
body[data-reco-ui="m3"] .m3-sec--warn .m3-list > li::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none; margin-top: 0.62em;
}
body[data-reco-ui="m3"] .m3-sec--err .m3-list > li::before { background: var(--m3-err); }
body[data-reco-ui="m3"] .m3-sec--warn .m3-list > li::before { background: var(--m3-warn); }
body[data-reco-ui="m3"] .m3-sub { margin: 4px 0 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: 2px; font-size: calc(var(--fs) * 0.84); color: var(--m3-var); }
body[data-reco-ui="m3"] .m3-per { font-size: calc(var(--fs) * 0.8); font-weight: 700; color: var(--m3-var); margin-bottom: -6px; }
body[data-reco-ui="m3"] .m3-tbl { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--m3-high); border-radius: 12px; overflow: hidden; font-size: calc(var(--fs) * 0.88); }
body[data-reco-ui="m3"] .m3-tbl th { background: #f4f6f8; color: var(--m3-var); font-weight: 700; text-align: left; padding: 8px 10px; font-size: calc(var(--fs) * 0.8); }
body[data-reco-ui="m3"] .m3-tbl td { padding: 8px 10px; border-top: 1px solid var(--m3-high); vertical-align: top; }
body[data-reco-ui="m3"] .m3-tbl thead + tbody tr:first-child td { border-top: 0; }
body[data-reco-ui="m3"] .m3-tbl tbody tr:first-child td { border-top: 0; }
body[data-reco-ui="m3"] .m3-tbl td:first-child { font-weight: 700; }
body[data-reco-ui="m3"] .m3-tbl tr.is-ng td { color: #8c1d18; background: #fff7f6; }
/* 成分の内訳（漢方エキスのもとの生薬と量など）は成分名の下に小さく */
body[data-reco-ui="m3"] .m3-tbl__sub { display: block; margin-top: 2px; font-weight: 400; color: var(--m3-var); font-size: calc(var(--fs) * 0.78); line-height: 1.5; }
body[data-reco-ui="m3"] .m3-tbl--ing td:last-child { min-width: 5.5em; }
body[data-reco-ui="m3"] .m3-eff-text { line-height: 1.7; }
body[data-reco-ui="m3"] .m3-ingc { display: block; font-size: calc(var(--fs) * 0.85); color: var(--m3-var); }
body[data-reco-ui="m3"] .m3-caut-none { display: flex; gap: 6px; align-items: flex-start; font-size: calc(var(--fs) * 0.85); }
body[data-reco-ui="m3"] .m3-caut-none .m3-i { flex: none; margin-top: 2px; width: 16px; height: 16px; }
body[data-reco-ui="m3"] .m3-eff-notes { color: var(--m3-var); font-size: calc(var(--fs) * 0.85); }
body[data-reco-ui="m3"] .m3-fold > summary {
  list-style: none; display: inline-flex; align-items: center; gap: 2px; cursor: pointer;
  font-size: calc(var(--fs) * 0.84); font-weight: 700; color: var(--m3-pri);
}
body[data-reco-ui="m3"] .m3-fold > summary::-webkit-details-marker { display: none; }
body[data-reco-ui="m3"] .m3-fold[open] > summary svg { transform: rotate(90deg); }
body[data-reco-ui="m3"] .m3-fold[open] > summary { margin-bottom: 6px; }
body[data-reco-ui="m3"] .m3-src-link { align-self: flex-start; display: inline-flex; align-items: center; gap: 2px; font-size: calc(var(--fs) * 0.78); color: var(--m3-var); text-decoration: none; }
body[data-reco-ui="m3"] .m3-src-link:hover { color: var(--m3-pri); text-decoration: underline; }

/* ---------- カードの下: 注意と受診の目安（1枚） ---------- */
body[data-reco-ui="m3"] .m3-after { gap: 10px; padding-bottom: 2px; }
body[data-reco-ui="m3"] .m3-care {
  border-top: 1px solid var(--m3-high); border-bottom: 1px solid var(--m3-high);
  padding: 8px 2px; display: flex; flex-direction: column; gap: 6px; background: none;
}
body[data-reco-ui="m3"] .m3-care__row,
body[data-reco-ui="m3"] .m3-care__w > summary {
  display: flex; align-items: flex-start; gap: 8px; list-style: none;
  font-size: calc(var(--fs) * 0.86); line-height: 1.55; color: var(--m3-on);
}
body[data-reco-ui="m3"] details.m3-care__row { display: block; }
body[data-reco-ui="m3"] .m3-care__w > summary { cursor: pointer; }
body[data-reco-ui="m3"] .m3-care__w > summary::-webkit-details-marker { display: none; }
body[data-reco-ui="m3"] .m3-care__row span { flex: 1; min-width: 0; }
body[data-reco-ui="m3"] .m3-care__row svg.m3-i { flex: 0 0 auto; margin-top: 3px; }
body[data-reco-ui="m3"] .m3-care__w svg.m3-i:first-child { color: var(--m3-warn); }
body[data-reco-ui="m3"] .m3-care__v svg.m3-i { color: var(--m3-err); }
body[data-reco-ui="m3"] .m3-care__w > summary svg.m3-i:last-child { color: var(--m3-out); width: 14px; height: 14px; transition: transform .2s; }
body[data-reco-ui="m3"] .m3-care__w[open] > summary svg.m3-i:last-child { transform: rotate(90deg); }
body[data-reco-ui="m3"] .m3-care__w > p { margin: 4px 0 2px 24px; font-size: calc(var(--fs) * 0.8); line-height: 1.6; color: var(--m3-var); }
/* 参考情報の一文: 「役に立ちましたか」の下に小さく1行、余白を詰める */
body[data-reco-ui="m3"] .m3-after .m3-disc { margin-top: -4px; font-size: calc(var(--fs) * 0.72); gap: 4px; color: var(--m3-out); }
body[data-reco-ui="m3"] .m3-after .m3-disc svg.m3-i { width: 13px; height: 13px; }
body[data-reco-ui="m3"] .ui-reco-block--m3 .ui-feedback-stack { margin: 0; padding: 0; }

/* ---------- 進捗カード（細い線＋今の段階の細かい手順＋済んだことの畳み＋キャラクター） ---------- */
body[data-reco-ui="m3"] .processing-status-card .processing-status-header,
body[data-reco-ui="m3"] .processing-status-card .processing-status-track,
body[data-reco-ui="m3"] .processing-status-card .processing-status-step-pill { display: none; }
body[data-reco-ui="m3"] .processing-status-card { display: flex; flex-direction: column; gap: 0; min-width: min(300px, 78vw); max-width: min(420px, 86vw); }
body[data-reco-ui="m3"] .processing-status-card .processing-status-mascot-row { display: block; }
/* 一言はカードの中の手順の一覧で見せるので、元の行は読み上げ用にだけ残す */
body[data-reco-ui="m3"] .processing-status-card .m3-prog + .processing-status-label {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0 !important;
}
body[data-reco-ui="m3"] .m3-prog__bar {
  height: 3px; border-radius: 3px; background: var(--m3-high); overflow: hidden; margin-bottom: 12px; position: relative;
}
body[data-reco-ui="m3"] .m3-prog__bar i {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, #4f8a69, var(--m3-pri));
  transition: width .7s cubic-bezier(.2, .8, .2, 1); position: relative; overflow: hidden;
}
/* 今の段階: 左にキャラクター、右に題と細かい手順 */
body[data-reco-ui="m3"] .m3-prog__now { display: flex; align-items: flex-start; gap: 12px; }
body[data-reco-ui="m3"] .m3-prog__mascot { flex: 0 0 auto; padding-top: 2px; }
body[data-reco-ui="m3"] .m3-prog__mascot .processing-status-mascot { margin: 0; }
body[data-reco-ui="m3"] .m3-prog__body { flex: 1 1 auto; min-width: 0; }
body[data-reco-ui="m3"] .m3-prog__title {
  margin: 0 0 6px; font-weight: 700; color: var(--m3-on); font-size: calc(var(--sage-chat-copy-fs, 1rem) * 0.95); line-height: 1.4;
}
body[data-reco-ui="m3"] .m3-prog__subs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
body[data-reco-ui="m3"] .m3-prog__subs li {
  display: flex; align-items: flex-start; gap: 8px; font-size: calc(var(--sage-chat-copy-fs, 1rem) * 0.8); line-height: 1.45; color: var(--m3-out);
}
body[data-reco-ui="m3"] .m3-prog__subs li.is-now { color: var(--m3-on); }
body[data-reco-ui="m3"] .m3-prog__subs li i,
body[data-reco-ui="m3"] .m3-prog__done summary i {
  flex: 0 0 auto; width: 14px; height: 14px; margin-top: 2px; border-radius: 50%; position: relative; box-sizing: border-box;
}
body[data-reco-ui="m3"] .m3-prog__subs li.is-done i,
body[data-reco-ui="m3"] .m3-prog__done summary i { background: var(--m3-pri-c); }
body[data-reco-ui="m3"] .m3-prog__subs li.is-done i::after,
body[data-reco-ui="m3"] .m3-prog__done summary i::after {
  content: ""; position: absolute; left: 4.5px; top: 2.5px; width: 3.5px; height: 6px;
  border: solid var(--m3-pri); border-width: 0 1.8px 1.8px 0; transform: rotate(45deg);
}
body[data-reco-ui="m3"] .m3-prog__subs li.is-now i { border: 2px solid var(--m3-pri-c); border-top-color: var(--m3-pri); }
/* キャラクター: 形・表情・色は以前の CSS のキャラのまま */
body[data-reco-ui="m3"] .m3-prog__mascot { position: relative; width: 34px; display: flex; justify-content: center; }
/* 手に持つもの（お薬選びの段階） */
body[data-reco-ui="m3"] .m3-prog__held {
  position: absolute; right: -8px; bottom: -6px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.16); display: flex; align-items: center; justify-content: center;
}
body[data-reco-ui="m3"] .m3-prog__held img,
body[data-reco-ui="m3"] .m3-prog__held svg { width: 18px; height: 18px; display: block; }
body[data-reco-ui="m3"] .m3-prog__held[data-kind="lens"] svg { width: 14px; height: 14px; }
@media (prefers-reduced-motion: no-preference) {
  body[data-reco-ui="m3"] .m3-prog__mascot.is-hop { animation: m3-hop .6s cubic-bezier(.3, 1.4, .5, 1) both; }
  body[data-reco-ui="m3"] .m3-prog__mascot.is-nod { animation: m3-nod .45s ease-in-out both; }
  body[data-reco-ui="m3"] .m3-prog__held { animation: m3-pop .4s cubic-bezier(.3, 1.6, .5, 1) both; }
  body[data-reco-ui="m3"] .m3-prog__held[data-kind="lens"] svg { animation: m3-search 2.4s ease-in-out infinite; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-reco-ui="m3"] .m3-prog__mascot .processing-status-mascot,
  body[data-reco-ui="m3"] .m3-prog__mascot .processing-status-mascot::before,
  body[data-reco-ui="m3"] .m3-prog__mascot .processing-status-mascot::after { animation: none !important; }
}
@keyframes m3-hop { 0% { transform: none; } 30% { transform: translateY(-8px) scale(1.06, .94); } 55% { transform: translateY(0) scale(.94, 1.06); } 75% { transform: translateY(-2px); } 100% { transform: none; } }
@keyframes m3-nod { 0%, 100% { transform: none; } 40% { transform: translateY(2px) rotate(-4deg); } 70% { transform: translateY(0) rotate(2deg); } }
@keyframes m3-pop { from { transform: scale(0) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes m3-search { 0%, 100% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(-1.5px, -1px) rotate(-8deg); } 75% { transform: translate(1.5px, 1px) rotate(8deg); } }
/* 済んだこと（畳み） */
body[data-reco-ui="m3"] .m3-prog__done { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--m3-high); }
body[data-reco-ui="m3"] .m3-prog__done summary {
  display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; min-height: 28px;
  font-size: calc(var(--sage-chat-copy-fs, 1rem) * 0.8); font-weight: 700; color: var(--m3-pri);
}
body[data-reco-ui="m3"] .m3-prog__done summary::-webkit-details-marker { display: none; }
body[data-reco-ui="m3"] .m3-prog__done summary::after {
  content: ""; width: 6px; height: 6px; margin-left: 2px; border: solid currentColor; border-width: 0 1.6px 1.6px 0;
  transform: rotate(45deg) translateY(-2px); transition: transform .2s;
}
body[data-reco-ui="m3"] .m3-prog__done[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
body[data-reco-ui="m3"] .m3-prog__donelist { list-style: none; margin: 6px 0 0; padding: 0 0 0 22px; display: flex; flex-direction: column; gap: 8px; }
body[data-reco-ui="m3"] .m3-prog__donelist b { display: block; font-size: calc(var(--sage-chat-copy-fs, 1rem) * 0.8); color: var(--m3-on); }
body[data-reco-ui="m3"] .m3-prog__donelist ul {
  margin: 3px 0 0; padding: 0 0 0 10px; border-left: 2px solid var(--m3-pri-c); list-style: none;
  display: flex; flex-direction: column; gap: 2px; font-size: calc(var(--sage-chat-copy-fs, 1rem) * 0.76); color: var(--m3-out); line-height: 1.45;
}
@media (prefers-reduced-motion: no-preference) {
  body[data-reco-ui="m3"] .m3-prog__subs li.is-now i { animation: m3-spin .9s linear infinite; }
  body[data-reco-ui="m3"] .m3-prog__subs li.is-new,
  body[data-reco-ui="m3"] .m3-prog__now.is-new .m3-prog__title { animation: m3-rise .35s ease-out both; }
  body[data-reco-ui="m3"] .m3-prog__bar i::after {
    content: ""; position: absolute; inset: 0; width: 40%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
    animation: m3-shine 1.6s ease-in-out infinite;
  }
}
@keyframes m3-spin { to { transform: rotate(360deg); } }
@keyframes m3-rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes m3-shine { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
/* 「担当ChatOrchestrator」のような内部の名前は利用者に見せない（遅いときの案内は残す） */
body[data-reco-ui="m3"] .processing-status-card .processing-status-agent-user { display: none; }

/* ---------- 返事の途中にもう一度送ったときの案内（入力欄の上に小さく数秒） ---------- */
body[data-reco-ui="m3"] .m3-busy-toast {
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translate(-50%, 6px);
  max-width: min(92%, 420px); padding: 7px 14px; border-radius: 999px;
  background: var(--m3-on); color: #fff; font-size: 13px; line-height: 1.4; text-align: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.18); opacity: 0; pointer-events: none; z-index: 20;
  transition: opacity .2s ease, transform .2s ease;
}
body[data-reco-ui="m3"] .m3-busy-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 動的問診（症状の入力フォーム）: 質問＋小さな札を詰めて、補足と送信は1行に ---------- */
/* チャットの中では筆（明朝）のような字は使わず、本文と同じゴシックにする */
body[data-reco-ui="m3"] .ui-status-block--m3form {
  --fs: var(--sage-chat-copy-fs, var(--font-size-base, 1rem));
  display: flex; flex-direction: column; gap: 8px;
}
body[data-reco-ui="m3"] .ui-bubble--status:has(.ui-status-block--m3form) { padding: 10px 12px; }
/* 「相談内容を受け付けました」（注意の△）は出さず、質問文を見出しにする */
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-intro { display: none; }
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-advice,
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-advice__text { margin: 0 !important; padding: 0 !important; }
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-advice__text {
  font-weight: 700; font-size: calc(var(--fs) * 0.95); line-height: 1.45; color: var(--m3-on);
}
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-input-form {
  margin: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important;
  display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 8px; row-gap: 8px;
}
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-input-form > :not(.ui-status-input-form__optional):not(.ui-status-input-form__submit) { grid-column: 1 / -1; }
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-input-form__field { margin: 0 !important; padding: 0 !important; display: flex; flex-direction: column; gap: 4px; }
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-input-form__field-label {
  margin: 0 !important; font-size: 11.5px; font-weight: 700; color: var(--m3-out); line-height: 1.3;
}
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-input-form__options,
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-input-form__quick-dates {
  display: flex; flex-wrap: wrap; gap: 5px; margin: 0 !important; padding: 0 !important; overflow: visible; max-height: none;
}
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-form__option {
  min-height: 30px !important; height: auto; padding: 3px 11px !important; margin: 0 !important;
  border-radius: 999px !important; border: 1px solid var(--m3-outv) !important; background: #fff !important;
  color: var(--m3-on) !important; font-size: 13px !important; font-weight: 500; line-height: 1.3;
  box-shadow: none !important; width: auto; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px;
  transition: background-color .15s, border-color .15s, color .15s;
}
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-form__option:hover { border-color: var(--m3-pri) !important; }
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-form__option[aria-pressed="true"],
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-form__option.is-selected {
  background: var(--m3-pri) !important; border-color: var(--m3-pri) !important; color: #fff !important;
}
/* 「特に当てはまらない」は控えめに */
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-form__option[data-option-none]:not([aria-pressed="true"]) {
  border-style: dashed !important; color: var(--m3-out) !important;
}
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-date-picker-wrap { display: inline-flex; }
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-date-picker-icon { width: 12px; height: 12px; }
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-date-feedback { margin: 2px 0 0 !important; font-size: 12px; }
/* 補足（左）と送信（右）を同じ行に */
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-input-form__optional {
  grid-column: 1; margin: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important;
}
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-input-form__optional[open] { grid-column: 1 / -1; }
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-input-form__optional > summary {
  min-height: 0 !important; padding: 2px 0 !important; border: 0 !important; background: none !important;
  font-size: 12.5px !important; font-weight: 700; color: var(--m3-pri) !important; cursor: pointer; list-style: none;
  display: inline-flex !important; justify-content: flex-start !important; gap: 2px; width: auto !important;
}
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-input-form__optional > summary::-webkit-details-marker { display: none; }
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-input-form__optional > summary::before { content: "＋ "; }
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-input-form__optional[open] > summary::before { content: "－ "; }
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-input-form__optional > summary::after { display: none !important; }
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-input-form__optional .ui-accordion__body { padding: 4px 0 0 !important; }
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-input-form__optional .ui-status-input-form__field-label { display: none; }
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-input-form__text {
  width: 100%; box-sizing: border-box; border: 1px solid var(--m3-outv); border-radius: 10px; padding: 6px 10px; font-size: 13.5px; min-height: 0;
}
/* 何件選んだかは札の色で分かるので出さない */
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-input-form__count { display: none !important; }
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-input-form__submit {
  grid-column: 2; justify-self: end; min-height: 34px !important; padding: 6px 16px !important; border-radius: 999px !important;
  background: var(--m3-pri) !important; color: #fff !important; border: 0 !important; font-size: 13.5px !important; font-weight: 700;
  box-shadow: none !important; width: auto !important; margin: 0 !important;
}
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-input-form__optional[open] ~ .ui-status-input-form__submit { grid-column: 1 / -1; }
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-input-form__submit:disabled {
  background: var(--m3-high) !important; color: var(--m3-out) !important; cursor: not-allowed;
}
body[data-reco-ui="m3"] .ui-status-block--m3form .m3-care { margin: 0 !important; padding: 6px 0 !important; border-bottom: 0; }
body[data-reco-ui="m3"] .ui-status-block--m3form .m3-care__row { font-size: 12.5px; line-height: 1.5; color: var(--m3-var); }
body[data-reco-ui="m3"] .ui-status-block--m3form .m3-care__row svg.m3-i { width: 14px; height: 14px; margin-top: 2px; }
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-feedback-stack { margin: 0 !important; }

/* ---------- 案内カード（エラー・注意・受診すすめ・緊急・危機）: 淡い色の見出し帯（比較モック status_cards.html の C） ---------- */
body[data-reco-ui="m3"] {
  --m3-st-err: #b3261e; --m3-st-err-c: #fbe9e7; --m3-st-on-err: #5c1712;
  --m3-st-crit: #a3302a; --m3-st-crit-c: #fbe6e3; --m3-st-on-crit: #5a1612;
  --m3-st-sec: #6b4a8f; --m3-st-sec-c: #efe8f6; --m3-st-on-sec: #3a2257;
  --m3-st-warn: #8a5a00; --m3-st-warn-c: #fdf1dc; --m3-st-on-warn: #4a3300;
  --m3-st-care: #a8613a; --m3-st-care-c: #f8ece3; --m3-st-on-care: #5a3018;
}
body[data-reco-ui="m3"] .ui-bubble--status:has(> .m3-st),
body[data-reco-ui="m3"] .ui-bubble--reco:has(.m3-none) { padding: 0 !important; overflow: hidden; }
body[data-reco-ui="m3"] .m3-st {
  --fs: var(--sage-chat-copy-fs, var(--font-size-base, 1rem));
  margin: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important;
  display: block; font-size: calc(var(--fs) * 0.92); color: var(--m3-on);
}
body[data-reco-ui="m3"] .m3-st__band {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  font-weight: 700; font-size: calc(var(--fs) * 0.98); line-height: 1.4;
}
body[data-reco-ui="m3"] .m3-st__band svg.m3-i { width: 17px; height: 17px; flex: 0 0 auto; }
body[data-reco-ui="m3"] .m3-st--err .m3-st__band { background: var(--m3-st-err-c); color: var(--m3-st-on-err); }
body[data-reco-ui="m3"] .m3-st--err .m3-st__band svg.m3-i { color: var(--m3-st-err); }
body[data-reco-ui="m3"] .m3-st--crit .m3-st__band { background: var(--m3-st-crit-c); color: var(--m3-st-on-crit); }
body[data-reco-ui="m3"] .m3-st--crit .m3-st__band svg.m3-i { color: var(--m3-st-crit); }
body[data-reco-ui="m3"] .m3-st--sec .m3-st__band { background: var(--m3-st-sec-c); color: var(--m3-st-on-sec); }
body[data-reco-ui="m3"] .m3-st--sec .m3-st__band svg.m3-i { color: var(--m3-st-sec); }
body[data-reco-ui="m3"] .m3-st--warn .m3-st__band { background: var(--m3-st-warn-c); color: var(--m3-st-on-warn); }
body[data-reco-ui="m3"] .m3-st--warn .m3-st__band svg.m3-i { color: var(--m3-st-warn); }
body[data-reco-ui="m3"] .m3-st--care .m3-st__band { background: var(--m3-st-care-c); color: var(--m3-st-on-care); }
body[data-reco-ui="m3"] .m3-st--care .m3-st__band svg.m3-i { color: var(--m3-st-care); }
body[data-reco-ui="m3"] .m3-st__body { padding: 9px 14px 11px; display: flex; flex-direction: column; gap: 6px; }
body[data-reco-ui="m3"] .m3-st__lead { margin: 0; font-weight: 700; line-height: 1.55; }
body[data-reco-ui="m3"] .m3-st__msg { margin: 0; line-height: 1.6; color: var(--m3-var); }
body[data-reco-ui="m3"] .m3-st__refs { font-size: calc(var(--fs) * 0.86); overflow-wrap: anywhere; }
body[data-reco-ui="m3"] .m3-st__refs a { color: var(--m3-pri, inherit); text-decoration: underline; text-underline-offset: 2px; }
body[data-reco-ui="m3"] .m3-st__sub { margin: 2px 0 0; font-size: calc(var(--fs) * 0.8); font-weight: 700; color: var(--m3-var); display: flex; align-items: baseline; gap: 8px; }
body[data-reco-ui="m3"] .m3-st__rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: calc(var(--fs) * 0.92); line-height: 1.5; }
body[data-reco-ui="m3"] .m3-st__rows li { display: flex; gap: 7px; align-items: flex-start; }
body[data-reco-ui="m3"] .m3-st__rows li svg.m3-i { width: 15px; height: 15px; margin-top: 2px; flex: 0 0 auto; color: var(--m3-out); }
body[data-reco-ui="m3"] .m3-st__call {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-top: 4px;
  background: var(--m3-st-crit); color: #fff !important; border-radius: 999px; padding: 8px 18px;
  font-weight: 700; text-decoration: none; min-height: 40px;
}
body[data-reco-ui="m3"] .m3-st__call svg.m3-i { width: 16px; height: 16px; }
body[data-reco-ui="m3"] .m3-st__acts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 !important; padding: 0 !important; }
body[data-reco-ui="m3"] .m3-st__acts .m3-st__quiet {
  background: none !important; border: 0 !important; box-shadow: none !important; padding: 2px 0 !important; min-height: 0 !important;
  color: var(--m3-var) !important; font-size: calc(var(--fs) * 0.85) !important; font-weight: 400 !important;
  text-decoration: underline; text-underline-offset: 3px; width: auto !important;
}
body[data-reco-ui="m3"] .m3-st .ui-feedback-stack { margin: 4px 0 0 !important; padding: 7px 0 0 !important; border-top: 1px solid var(--m3-high); }

/* 危機のときの相談先: やさしい語りかけ＋横に並ぶ相談先 */
body[data-reco-ui="m3"] .m3-st--care .m3-st__msg { color: var(--m3-on); }
body[data-reco-ui="m3"] .m3-care__ask { margin: 2px 0 0; padding: 8px 11px; border-radius: 12px; background: #faf6f1; line-height: 1.55; }
body[data-reco-ui="m3"] .m3-care__ask p { margin: 0; }
body[data-reco-ui="m3"] .m3-care__askhint { margin-top: 4px !important; font-size: calc(var(--fs) * 0.8); color: var(--m3-var); }
body[data-reco-ui="m3"] .m3-care__dial { display: flex; gap: 6px; margin-top: 5px; }
body[data-reco-ui="m3"] .m3-care__dial a {
  display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 4px 14px; border-radius: 999px;
  border: 1px solid #e3cdbd; background: #fff; color: #7a3b1d !important; font-weight: 700; text-decoration: none;
}
body[data-reco-ui="m3"] .m3-care__dial a svg.m3-i { width: 14px; height: 14px; }
body[data-reco-ui="m3"] .m3-care__list {
  list-style: none; margin: 0; padding: 0; border: 1px solid #efe3d8; border-radius: 14px; background: #fffdfb; overflow: hidden;
}
body[data-reco-ui="m3"] .m3-care__row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; }
body[data-reco-ui="m3"] .m3-care__row + .m3-care__row { border-top: 1px solid #f2e8df; }
body[data-reco-ui="m3"] .m3-care__row[hidden] { display: none !important; }
body[data-reco-ui="m3"] .m3-care__who { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
body[data-reco-ui="m3"] .m3-care__who b { font-size: calc(var(--fs) * 0.94); line-height: 1.35; }
body[data-reco-ui="m3"] .m3-care__who small { color: var(--m3-out); font-size: calc(var(--fs) * 0.78); line-height: 1.4; }
body[data-reco-ui="m3"] .m3-care__call {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 5px 14px;
  background: var(--m3-st-care); color: #fff !important; border-radius: 999px; font-weight: 700; text-decoration: none;
  font-size: calc(var(--fs) * 0.86);
}
body[data-reco-ui="m3"] .m3-care__call--web { background: #fff; color: #7a3b1d !important; border: 1px solid #e3cdbd; }
body[data-reco-ui="m3"] .m3-care__call svg.m3-i { width: 14px; height: 14px; }
body[data-reco-ui="m3"] .m3-care__morebtn {
  align-self: flex-start; background: none; border: 0; padding: 2px 0; cursor: pointer;
  color: #7a3b1d; font: inherit; font-size: calc(var(--fs) * 0.84); font-weight: 700;
}
body[data-reco-ui="m3"] .m3-care__em { margin: 0; font-size: calc(var(--fs) * 0.8); color: var(--m3-var); }

/* 緊急カード: 119 と「緊急ではない場合」を横に並べ、押したらカードの中で一度確かめる */
body[data-reco-ui="m3"] .m3-st__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
body[data-reco-ui="m3"] .m3-st__cta .m3-st__call { margin-top: 0; }
body[data-reco-ui="m3"] .m3-st__ghost {
  display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--m3-outv); background: #fff; color: var(--m3-on);
  font: inherit; font-size: calc(var(--fs) * 0.88); font-weight: 600; cursor: pointer;
}
body[data-reco-ui="m3"] .m3-st__ghost:hover { background: var(--m3-paper); }
body[data-reco-ui="m3"] .m3-st__ghost:focus-visible,
body[data-reco-ui="m3"] .m3-st__unlock button:focus-visible { outline: 2px solid var(--m3-pri); outline-offset: 2px; }
body[data-reco-ui="m3"] .m3-st__ghost[hidden] { display: none !important; }
body[data-reco-ui="m3"] .m3-st__ghost-arrow { margin-left: 6px; font-size: 1.15em; line-height: 1; color: var(--m3-var); }
body[data-reco-ui="m3"] .m3-st__unlock {
  margin-top: 2px; padding: 9px 12px; border-radius: 12px; background: var(--m3-paper);
  display: flex; flex-direction: column; gap: 7px;
}
body[data-reco-ui="m3"] .m3-st__unlock p { margin: 0; line-height: 1.5; }
body[data-reco-ui="m3"] .m3-st__unlock-q { font-weight: 700; }
body[data-reco-ui="m3"] .m3-st__unlock-btns { display: flex; flex-wrap: wrap; gap: 6px; }
body[data-reco-ui="m3"] .m3-st__unlock-btns button {
  min-height: 36px; padding: 5px 14px; border-radius: 999px; font: inherit; font-size: calc(var(--fs) * 0.88);
  font-weight: 600; cursor: pointer; border: 1px solid var(--m3-outv); background: #fff; color: var(--m3-on);
}
body[data-reco-ui="m3"] .m3-st__unlock-btns .m3-st__unlock-yes { background: var(--m3-pri); border-color: transparent; color: #fff; }
body[data-reco-ui="m3"] .m3-st__unlock-btns button:disabled { opacity: .55; cursor: default; }
body[data-reco-ui="m3"] .m3-st__unlock-note { font-size: calc(var(--fs) * 0.86); color: var(--m3-var); }
body[data-reco-ui="m3"] .m3-st__unlock--done { background: var(--m3-ok-c); }
body[data-reco-ui="m3"] .m3-st__unlock-done { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--m3-on-ok); }
body[data-reco-ui="m3"] .m3-st__unlock-done svg.m3-i { width: 17px; height: 17px; flex: 0 0 auto; }
body[data-reco-ui="m3"] .m3-st__unlock--stay { background: var(--m3-st-crit-c); }
body[data-reco-ui="m3"] .m3-st__unlock--stay .m3-st__unlock-note { color: var(--m3-st-on-crit); font-weight: 600; }

/* 問診の答えの吹き出し: 「【問診回答】見出し: 値」を値だけの短い形で見せる（送った文は変えない） */
body[data-reco-ui="m3"] .message.user .message-content--inquiry { font-size: 0 !important; line-height: 0; }
body[data-reco-ui="m3"] .message.user .message-content--inquiry::before {
  content: attr(data-pretty); display: block;
  font-size: var(--sage-chat-copy-fs, var(--font-size-base, 1rem)); line-height: 1.55;
}

/* 比較表の「参照した項目」は出典（PMDA添付文書）と重なるので、新デザインでは出さない */
body[data-reco-ui="m3"] .ui-qa-compare__evidence { display: none !important; }
body[data-reco-ui="m3"] .ui-qa-compare__usage-sub { display: block; margin-top: 2px; font-size: calc(var(--fs) * 0.8); color: var(--m3-var); }

/* お知らせ・医薬品Q&A: 同じ帯の形で、落ち着いた淡い緑 */
body[data-reco-ui="m3"] { --m3-st-note: #2f6b4a; --m3-st-note-c: #e4f0e8; --m3-st-on-note: #173f2a; }
body[data-reco-ui="m3"] .ui-bubble--qa:has(> .m3-st) { padding: 0 !important; overflow: hidden; }
body[data-reco-ui="m3"] .m3-st--note .m3-st__band { background: var(--m3-st-note-c); color: var(--m3-st-on-note); }
body[data-reco-ui="m3"] .m3-st--note .m3-st__band svg.m3-i { color: var(--m3-st-note); }
/* 薬の質問への答え: 結論の一文を太字にし、主色の薄い面と左の罫で一番に目に入るようにする */
body[data-reco-ui="m3"] .m3-st__answer {
  display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 12px;
  border-radius: 12px; border-left: 4px solid var(--m3-pri);
  background: color-mix(in srgb, var(--m3-pri) 8%, #fff);
}
body[data-reco-ui="m3"] .m3-st__answer svg.m3-i { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; color: var(--m3-pri); }
body[data-reco-ui="m3"] .m3-st__answer p { margin: 0; line-height: 1.65; color: var(--m3-on); font-size: calc(var(--fs) * 0.95); }
body[data-reco-ui="m3"] .m3-st__answer-head { font-weight: 700; font-size: calc(var(--fs) * 1.02); color: var(--m3-on); }

/* 製品ごとの説明の表（製品・種類と成分・主な用途） */
body[data-reco-ui="m3"] .m3-qa-tbl-wrap { overflow-x: auto; margin: 0; border: 1px solid var(--m3-outv); border-radius: 12px; }
body[data-reco-ui="m3"] .m3-qa-tbl { width: 100%; border-collapse: collapse; font-size: calc(var(--fs) * 0.88); line-height: 1.5; color: var(--m3-on); }
body[data-reco-ui="m3"] .m3-qa-tbl thead th {
  text-align: left; font-weight: 700; font-size: calc(var(--fs) * 0.78); color: var(--m3-var);
  background: var(--m3-high, #f1f4f7); padding: 6px 10px; white-space: nowrap;
}
body[data-reco-ui="m3"] .m3-qa-tbl tbody th, body[data-reco-ui="m3"] .m3-qa-tbl td {
  padding: 8px 10px; border-top: 1px solid var(--m3-outv); vertical-align: top; text-align: left;
}
body[data-reco-ui="m3"] .m3-qa-tbl tbody th { font-weight: 700; color: var(--m3-pri); white-space: nowrap; }
body[data-reco-ui="m3"] .m3-qa-tbl tbody th > * { vertical-align: middle; }
body[data-reco-ui="m3"] .m3-qa-tbl tbody th svg.m3-i { width: 14px; height: 14px; margin-right: 5px; color: var(--m3-pri); }
body[data-reco-ui="m3"] .m3-qa-tbl__kind { display: block; font-weight: 600; }
body[data-reco-ui="m3"] .m3-qa-tbl__ing {
  display: inline-block; margin-top: 3px; padding: 1px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--m3-pri) 10%, #fff); color: var(--m3-pri); font-size: calc(var(--fs) * 0.8); font-weight: 600;
}
body[data-reco-ui="m3"] .m3-qa-tbl__uses { display: flex; flex-wrap: wrap; gap: 4px; }
body[data-reco-ui="m3"] .m3-qa-tbl__tag {
  padding: 1px 8px; border-radius: 999px; border: 1px solid var(--m3-outv); background: #fff; font-size: calc(var(--fs) * 0.8); white-space: nowrap;
}
body[data-reco-ui="m3"] .m3-qa-tbl__note { display: block; margin-top: 4px; font-size: calc(var(--fs) * 0.8); color: var(--m3-var); }
/* スマホ幅では1製品ずつの縦並び（見出しを左に添える） */
@media (max-width: 480px) {
  body[data-reco-ui="m3"] .m3-qa-tbl thead { display: none; }
  body[data-reco-ui="m3"] .m3-qa-tbl, body[data-reco-ui="m3"] .m3-qa-tbl tbody,
  body[data-reco-ui="m3"] .m3-qa-tbl tr, body[data-reco-ui="m3"] .m3-qa-tbl tbody th, body[data-reco-ui="m3"] .m3-qa-tbl td { display: block; width: 100%; }
  body[data-reco-ui="m3"] .m3-qa-tbl tr + tr { border-top: 1px solid var(--m3-outv); }
  body[data-reco-ui="m3"] .m3-qa-tbl tbody th { border-top: 0; padding-bottom: 2px; }
  body[data-reco-ui="m3"] .m3-qa-tbl td { border-top: 0; padding-top: 2px; display: flex; gap: 8px; }
  body[data-reco-ui="m3"] .m3-qa-tbl td::before {
    content: attr(data-label); flex: 0 0 5.5em; font-size: calc(var(--fs) * 0.76); color: var(--m3-var); font-weight: 600; padding-top: 1px;
  }
  body[data-reco-ui="m3"] .m3-qa-tbl td > * { min-width: 0; }
}

/* 注意の欄（相互作用・副作用など）: 一文ずつアイコンつきで、注意色の薄い面にまとめる */
body[data-reco-ui="m3"] .m3-st__notice {
  list-style: none; margin: 0; padding: 8px 10px; display: flex; flex-direction: column; gap: 5px;
  border-radius: 12px; background: color-mix(in srgb, #d98324 9%, #fff);
  font-size: calc(var(--fs) * 0.9); line-height: 1.55; color: var(--m3-on);
}
body[data-reco-ui="m3"] .m3-st__notice-row { display: flex; gap: 7px; align-items: flex-start; }
body[data-reco-ui="m3"] .m3-st__notice-row svg.m3-i { width: 16px; height: 16px; margin-top: 2px; flex: 0 0 auto; color: #b5651d; }
body[data-reco-ui="m3"] .m3-st__notice-row--ban { font-weight: 700; }
body[data-reco-ui="m3"] .m3-st__notice-label { display: inline-block; margin-right: 6px; font-weight: 700; color: var(--m3-on); }
body[data-reco-ui="m3"] .m3-st__notice-label::after { content: "："; }
body[data-reco-ui="m3"] .m3-st__notice-row--ban svg.m3-i { color: #c0392b; }
body[data-reco-ui="m3"] .m3-st__notice-row--hospital svg.m3-i,
body[data-reco-ui="m3"] .m3-st__notice-row--store svg.m3-i,
body[data-reco-ui="m3"] .m3-st__notice-row--info svg.m3-i { color: var(--m3-var); }
/* 添付文書のリンクは最後に、上と細い罫で分ける */
body[data-reco-ui="m3"] .m3-st__body > .m3-st__refs { padding-top: 6px; border-top: 1px solid var(--m3-high); }

body[data-reco-ui="m3"] .m3-st__html { font-size: calc(var(--fs) * 0.92); line-height: 1.55; color: var(--m3-on); }
body[data-reco-ui="m3"] .m3-st__html > :first-child { margin-top: 0; }
body[data-reco-ui="m3"] .m3-st__html > :last-child { margin-bottom: 0; }

/* 選んで答える問いかけ（カウンセリングなど）: 帯なしで、問い＋短い札＋小さな目安 */
/* 推奨の下の「より合う薬のために」（.m3-ask.ui-reco-followup）には当てない */
body[data-reco-ui="m3"] .ui-bubble--status:has(> .m3-ask) { padding: 10px 12px !important; }
body[data-reco-ui="m3"] .m3-ask:not(.ui-reco-followup) {
  --fs: var(--sage-chat-copy-fs, var(--font-size-base, 1rem));
  margin: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important;
  display: flex; flex-direction: column; gap: 8px; font-size: calc(var(--fs) * 0.92); color: var(--m3-on);
}
body[data-reco-ui="m3"] .m3-ask__lead { margin: 0; line-height: 1.55; font-size: calc(var(--fs) * 0.9); color: var(--m3-var); }
body[data-reco-ui="m3"] .m3-ask:not(.ui-reco-followup) .m3-ask__q { margin: 0; font-weight: 700; font-size: calc(var(--fs) * 0.95); line-height: 1.45; color: var(--m3-on); }
body[data-reco-ui="m3"] .m3-ask__chips { display: flex !important; flex-wrap: wrap; gap: 5px; margin: 0 !important; padding: 0 !important; }
body[data-reco-ui="m3"] .m3-ask__chips .m3-ask__chip {
  /* 問診フォームの札と同じ大きさ・形 */
  width: auto !important; min-height: 30px !important; height: auto; padding: 3px 11px !important; margin: 0 !important;
  border-radius: 999px !important; border: 1px solid var(--m3-outv) !important; background: #fff !important;
  color: var(--m3-on) !important; font-size: 13px !important; font-weight: 500 !important; line-height: 1.3; text-align: left;
  box-shadow: none !important; white-space: normal; flex: 0 0 auto;
}
body[data-reco-ui="m3"] .m3-ask__chips .m3-ask__chip:hover { border-color: var(--m3-pri) !important; }
body[data-reco-ui="m3"] .m3-ask__other { margin: 0; font-size: calc(var(--fs) * 0.82); color: var(--m3-var); }
body[data-reco-ui="m3"] .m3-ask__hints {
  list-style: none; margin: 2px 0 0; padding: 8px 0 0; border-top: 1px solid var(--m3-high);
  display: flex; flex-direction: column; gap: 3px; font-size: calc(var(--fs) * 0.82); line-height: 1.5; color: var(--m3-var);
}
body[data-reco-ui="m3"] .m3-ask__hints li { display: flex; gap: 6px; align-items: flex-start; }
body[data-reco-ui="m3"] .m3-ask__hints svg.m3-i { width: 14px; height: 14px; margin-top: 2px; flex: 0 0 auto; color: var(--m3-out); }

/* 動的自律問診（風邪の症状カードと同じ帯つきの形）: 自由入力・目安の畳み・送信後の1行 */
body[data-reco-ui="m3"] .m3-ask-st .m3-ask__body { display: flex; flex-direction: column; gap: 8px; }
body[data-reco-ui="m3"] .m3-ask-st .m3-ask__other { margin: 0; display: flex; flex-direction: column; gap: 4px; }
body[data-reco-ui="m3"] .m3-ask-st .m3-ask__other-label { margin: 0; font-size: calc(var(--fs, 1rem) * 0.82); color: var(--m3-var); }
body[data-reco-ui="m3"] .m3-ask-st .m3-ask__other-row { display: flex; gap: 6px; align-items: center; min-width: 0; }
body[data-reco-ui="m3"] .m3-ask-st .m3-ask__other-input {
  flex: 1 1 auto; min-width: 0; height: 36px; padding: 0 12px; margin: 0;
  border: 1px solid var(--m3-outv); border-radius: 999px; background: #fff; color: var(--m3-on);
  font-size: 16px; /* iOS で拡大されない大きさ */ font-family: inherit;
}
body[data-reco-ui="m3"] .m3-ask-st .m3-ask__other-input:focus { outline: 2px solid var(--m3-pri); outline-offset: 1px; border-color: var(--m3-pri); }
body[data-reco-ui="m3"] .m3-ask-st .m3-ask__other-send {
  flex: 0 0 auto; width: auto !important; min-height: 36px !important; height: 36px !important; padding: 0 16px !important; margin: 0 !important;
  border-radius: 999px !important; border: 0 !important; background: var(--m3-pri) !important; color: #fff !important;
  font-size: 13px !important; font-weight: 700 !important; box-shadow: none !important;
}
body[data-reco-ui="m3"] .m3-ask-st .m3-ask__other-send:disabled { background: var(--m3-high) !important; color: var(--m3-out) !important; cursor: default; }
body[data-reco-ui="m3"] .m3-ask-st .m3-ask__guide { margin-top: -2px; }
body[data-reco-ui="m3"] .m3-ask-st .m3-ask__guide-sum {
  cursor: pointer; font-size: calc(var(--fs, 1rem) * 0.82); color: var(--m3-pri); font-weight: 600; list-style: none;
  display: inline-flex; align-items: center; gap: 4px; min-height: 28px;
}
body[data-reco-ui="m3"] .m3-ask-st .m3-ask__guide-sum::-webkit-details-marker { display: none; }
body[data-reco-ui="m3"] .m3-ask-st .m3-ask__guide-sum::after { content: "▾"; transition: transform .15s; }
body[data-reco-ui="m3"] .m3-ask-st .m3-ask__guide[open] > .m3-ask__guide-sum::after { transform: rotate(180deg); }
body[data-reco-ui="m3"] .m3-ask-st .m3-ask__guide .m3-st__rows { margin-top: 4px; }
body[data-reco-ui="m3"] .m3-ask-st.is-answered .ui-status-input-summary { margin: 0; }
/* 中身の無い「選択済み」は開かない1行（▾ なし・全文を折り返して見せる） */
body[data-reco-ui="m3"] .ui-status-input-summary--static .ui-status-input-summary__summary {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; margin: 0; padding: 8px 12px;
  font-size: 0.9rem; color: var(--ui-primary-dark, #3d5a73);
}
body[data-reco-ui="m3"] .ui-status-input-summary--static .ui-status-input-summary__value { white-space: normal; overflow: visible; }

/* 問診: 畳んだ選択肢と「ほかの症状 ▾」 */
body[data-reco-ui="m3"] .ui-status-form__option[hidden] { display: none !important; }
body[data-reco-ui="m3"] .ui-status-block--m3form .m3-more-btn {
  /* ほかの札と同じ高さ・大きさ（ボタン共通の最小44pxを当てない） */
  width: auto !important; min-height: 30px !important; height: auto !important; padding: 3px 11px !important; margin: 0 !important;
  border-radius: 999px !important; border: 1px dashed var(--m3-outv) !important; background: none !important; box-shadow: none !important;
  color: var(--m3-pri) !important; font-size: 13px !important; font-weight: 700 !important; line-height: 1.3 !important;
  flex: 0 0 auto; display: inline-flex; align-items: center; cursor: pointer;
}
/* 1つだけ背の高い札があっても、同じ行のほかの札を引き伸ばさない */
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-input-form__options,
body[data-reco-ui="m3"] .ui-status-block--m3form .ui-status-input-form__quick-dates { align-items: center; }

/* 同じ成分の重なり（一緒に飲まない注意）: 案内カードの「注意」と同じ淡い黄の見出し帯。たたまない */
body[data-reco-ui="m3"] .m3-ovl {
  margin: 0; border: 1px solid #ecdcb4; border-radius: 14px; overflow: hidden; background: #fff;
}
body[data-reco-ui="m3"] .m3-ovl__band {
  display: flex; align-items: center; gap: 6px; padding: 7px 12px;
  background: var(--m3-st-warn-c); color: var(--m3-st-on-warn);
  font-size: calc(var(--fs) * 0.9); line-height: 1.4;
}
body[data-reco-ui="m3"] .m3-ovl__band svg.m3-i { width: 16px; height: 16px; flex: 0 0 auto; color: var(--m3-st-warn); }
body[data-reco-ui="m3"] .m3-ovl__body { padding: 8px 12px 10px; display: flex; flex-direction: column; gap: 6px; }
body[data-reco-ui="m3"] .m3-ovl__msg { margin: 0; font-size: calc(var(--fs) * 0.84); line-height: 1.55; color: var(--m3-var); }
body[data-reco-ui="m3"] .m3-ovl__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
body[data-reco-ui="m3"] .m3-ovl__list li { display: flex; flex-wrap: wrap; column-gap: 8px; font-size: calc(var(--fs) * 0.86); line-height: 1.5; color: var(--m3-on); }
body[data-reco-ui="m3"] .m3-ovl__ing { font-weight: 700; color: var(--m3-st-on-warn); }
body[data-reco-ui="m3"] .m3-ovl__meds small { font-size: 0.9em; color: var(--m3-var); }

/* イメージ図（写真の無い製品）。写真と同じ枠・同じ大きさで出す。2026-11 */
body[data-reco-ui="m3"] .m3-pimg .ui-med-image--illustration { background: transparent; }
body[data-reco-ui="m3"] .m3-pimg .ui-med-image--illustration img { padding: 0; mix-blend-mode: normal; }
body[data-reco-ui="m3"] .m3-illnote {
  border-top-color: var(--m3-high);
  color: var(--m3-var);
  font-size: calc(var(--fs) * 0.78);
}

/* 薬の質問への答えの「製品画像」（#356）
   枠が灰色（#f0f0f0）だと、白い背景で縦横比の違う写真（ロキソニンS）の左右に灰色の帯が出て、
   枠いっぱいに収まる写真（バファリンA）と大きさがそろわなかった。
   推奨カードの写真と同じく白い枠に余白をとって収め、写真の白地を枠になじませる。 */
body[data-reco-ui="m3"] .ui-qa-product-images__item .ui-med-image--card:not(.ui-med-image--illustration):not(.ui-med-image--placeholder) {
  aspect-ratio: 16 / 10;
  background: #fff;
  border: 1px solid var(--m3-high, #e3e3e3);
  border-radius: 10px;
}
body[data-reco-ui="m3"] .ui-qa-product-images__item .ui-med-image--card:not(.ui-med-image--illustration):not(.ui-med-image--placeholder) img {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 6% 7%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

/* 海外持ち込み・日本持ち込み Q&A カード（M3 デザイン規則準拠・2026-11-22） */
body[data-reco-ui="m3"] .m3-travel-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* 1. M3準拠の結論カード（左太線なし・白地＋公式トークンの淡いバッジ） */
body[data-reco-ui="m3"] .m3-trv__hero {
  border-radius: 12px;
  padding: 11px 13px;
  background: #fff;
  border: 1px solid var(--m3-outv, #d3d8de);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
body[data-reco-ui="m3"] .m3-trv__hero--danger {
  background: color-mix(in srgb, var(--m3-err-c, #ffdeda) 22%, #fff);
  border-color: color-mix(in srgb, var(--m3-err, #ba1a1a) 20%, var(--m3-outv, #d3d8de));
}
body[data-reco-ui="m3"] .m3-trv__hero--caution {
  background: color-mix(in srgb, var(--m3-warn-c, #fff1d1) 26%, #fff);
  border-color: color-mix(in srgb, var(--m3-warn, #8a5a00) 20%, var(--m3-outv, #d3d8de));
}
body[data-reco-ui="m3"] .m3-trv__hero--ok {
  background: color-mix(in srgb, var(--m3-ok-c, #dcefe3) 22%, #fff);
  border-color: color-mix(in srgb, var(--m3-ok, #2f6b4a) 20%, var(--m3-outv, #d3d8de));
}
body[data-reco-ui="m3"] .m3-trv__hero--info {
  background: color-mix(in srgb, var(--m3-info-c, #e3edf6) 24%, #fff);
  border-color: color-mix(in srgb, var(--m3-info, #3f6384) 18%, var(--m3-outv, #d3d8de));
}
body[data-reco-ui="m3"] .m3-trv__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
body[data-reco-ui="m3"] .m3-trv__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: calc(var(--fs, 1rem) * 0.76);
  font-weight: 700;
  line-height: 1.4;
}
body[data-reco-ui="m3"] .m3-trv__badge--danger {
  background: var(--m3-err-c, #ffdeda);
  color: var(--m3-on-err, #410002);
}
body[data-reco-ui="m3"] .m3-trv__badge--danger .m3-trv__ico { color: var(--m3-err, #ba1a1a); }
body[data-reco-ui="m3"] .m3-trv__badge--caution {
  background: var(--m3-warn-c, #fff1d1);
  color: var(--m3-on-warn, #4a3300);
}
body[data-reco-ui="m3"] .m3-trv__badge--caution .m3-trv__ico { color: var(--m3-warn, #8a5a00); }
body[data-reco-ui="m3"] .m3-trv__badge--ok {
  background: var(--m3-ok-c, #dcefe3);
  color: var(--m3-on-ok, #143c27);
}
body[data-reco-ui="m3"] .m3-trv__badge--ok .m3-trv__ico { color: var(--m3-ok, #2f6b4a); }
body[data-reco-ui="m3"] .m3-trv__badge--info {
  background: var(--m3-info-c, #e3edf6);
  color: var(--m3-on-info, #0e2a42);
}
body[data-reco-ui="m3"] .m3-trv__badge--info .m3-trv__ico { color: var(--m3-info, #3f6384); }
body[data-reco-ui="m3"] .m3-trv__ico { width: 13px; height: 13px; flex: 0 0 auto; }
body[data-reco-ui="m3"] .m3-trv__dest-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--m3-paper, #f3efe4);
  border: 1px solid var(--m3-line, #d9d2bf);
  color: var(--m3-var, #4a525c);
  font-size: calc(var(--fs, 1rem) * 0.74);
  font-weight: 600;
}
body[data-reco-ui="m3"] .m3-trv__sub-ico { width: 13px; height: 13px; flex: 0 0 auto; color: var(--m3-out, #7a838e); }
body[data-reco-ui="m3"] .m3-trv__headline {
  margin: 1px 0 0;
  font-size: calc(var(--fs, 1rem) * 0.94);
  font-weight: 700;
  line-height: 1.5;
  color: var(--m3-on, #1b1f24);
}
body[data-reco-ui="m3"] .m3-trv__subline {
  margin: 0;
  font-size: calc(var(--fs, 1rem) * 0.82);
  line-height: 1.55;
  color: var(--m3-var, #4a525c);
}

/* 2. 製品別 持ち込み判定テーブル（パッケージ画像つき） */
body[data-reco-ui="m3"] .m3-trv__tbl-wrap {
  border: 1px solid var(--m3-outv, #d3d8de);
  border-radius: 12px;
  overflow-x: auto;
  background: #fff;
}
body[data-reco-ui="m3"] .m3-trv__tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: calc(var(--fs, 1rem) * 0.82);
  line-height: 1.48;
}
body[data-reco-ui="m3"] .m3-trv__tbl thead th {
  background: color-mix(in srgb, var(--m3-paper, #f3efe4) 55%, #fff);
  color: var(--m3-var, #4a525c);
  font-size: calc(var(--fs, 1rem) * 0.72);
  font-weight: 700;
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--m3-outv, #d3d8de);
  white-space: nowrap;
}
body[data-reco-ui="m3"] .m3-trv__tbl tbody td {
  padding: 8px;
  border-bottom: 1px solid var(--m3-high, #e2e7ed);
  vertical-align: middle;
}
body[data-reco-ui="m3"] .m3-trv__tbl tbody tr:last-child td { border-bottom: 0; }
body[data-reco-ui="m3"] .m3-trv__prod-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 112px;
}
body[data-reco-ui="m3"] .m3-trv__thumb {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--m3-high, #e2e7ed);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 3px;
  box-sizing: border-box;
}
body[data-reco-ui="m3"] .m3-trv__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}
body[data-reco-ui="m3"] .m3-trv__thumb--ph {
  background: color-mix(in srgb, var(--m3-paper, #f3efe4) 60%, #fff);
  color: var(--m3-out, #7a838e);
}
body[data-reco-ui="m3"] .m3-trv__ph-ico { width: 20px; height: 20px; }
body[data-reco-ui="m3"] .m3-trv__prod-name {
  font-weight: 700;
  color: var(--m3-on, #1b1f24);
  font-size: calc(var(--fs, 1rem) * 0.8);
  line-height: 1.35;
}
body[data-reco-ui="m3"] .m3-trv__cell-st { white-space: nowrap; }
body[data-reco-ui="m3"] .m3-trv__st {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: calc(var(--fs, 1rem) * 0.72);
  font-weight: 700;
  line-height: 1.4;
}
body[data-reco-ui="m3"] .m3-trv__st--danger { background: var(--m3-err-c, #ffdeda); color: var(--m3-on-err, #410002); }
body[data-reco-ui="m3"] .m3-trv__st--caution { background: var(--m3-warn-c, #fff1d1); color: var(--m3-on-warn, #4a3300); }
body[data-reco-ui="m3"] .m3-trv__st--ok { background: var(--m3-ok-c, #dcefe3); color: var(--m3-on-ok, #143c27); }
body[data-reco-ui="m3"] .m3-trv__st--info,
body[data-reco-ui="m3"] .m3-trv__st--unknown { background: var(--m3-info-c, #e3edf6); color: var(--m3-on-info, #0e2a42); }
body[data-reco-ui="m3"] .m3-trv__ing-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 3px;
}
body[data-reco-ui="m3"] .m3-trv__ing-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--m3-err-c, #ffdeda) 65%, #fff);
  color: var(--m3-on-err, #410002);
  font-size: calc(var(--fs, 1rem) * 0.68);
  font-weight: 700;
}
body[data-reco-ui="m3"] .m3-trv__reason {
  display: block;
  color: var(--m3-var, #4a525c);
  font-size: calc(var(--fs, 1rem) * 0.74);
  line-height: 1.48;
}

/* 3. 渡航先・確認ポイント（M3 ペーパー面） */
body[data-reco-ui="m3"] .m3-trv__dest {
  background: color-mix(in srgb, var(--m3-paper, #f3efe4) 55%, #fff);
  border: 1px solid var(--m3-line, #d9d2bf);
  border-radius: 10px;
  padding: 8px 11px;
}
body[data-reco-ui="m3"] .m3-trv__dest-hd {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: calc(var(--fs, 1rem) * 0.78);
  font-weight: 700;
  color: var(--m3-on, #1b1f24);
  margin-bottom: 4px;
}
body[data-reco-ui="m3"] .m3-trv__dest-list {
  margin: 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: calc(var(--fs, 1rem) * 0.78);
  line-height: 1.5;
  color: var(--m3-var, #4a525c);
}

/* 4. 公式の最新情報リンク（新規タブ） */
body[data-reco-ui="m3"] .m3-trv__links-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
body[data-reco-ui="m3"] .m3-trv__links-hd {
  font-size: calc(var(--fs, 1rem) * 0.74);
  font-weight: 700;
  color: var(--m3-var, #4a525c);
}
body[data-reco-ui="m3"] .m3-trv__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
body[data-reco-ui="m3"] .m3-trv__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--m3-outv, #d3d8de);
  color: var(--m3-pri, #2f5d46);
  font-size: calc(var(--fs, 1rem) * 0.78);
  font-weight: 600;
  text-decoration: none;
  line-height: 1.3;
  transition: background .15s, border-color .15s;
}
body[data-reco-ui="m3"] .m3-trv__link:hover {
  background: var(--m3-pri-c, #dde9df);
  border-color: var(--m3-pri, #2f5d46);
}
body[data-reco-ui="m3"] .m3-trv__ext-ico {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  opacity: 0.75;
}

/* 5. 持ち込み前のチェックリスト（デフォルト閉じアコーディオン） */
body[data-reco-ui="m3"] .m3-trv__acc {
  border: 1px solid var(--m3-outv, #d3d8de);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
body[data-reco-ui="m3"] .m3-trv__acc-sum {
  list-style: none;
  cursor: pointer;
  padding: 8px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: calc(var(--fs, 1rem) * 0.8);
  font-weight: 700;
  color: var(--m3-on, #1b1f24);
  user-select: none;
}
body[data-reco-ui="m3"] .m3-trv__acc-sum::-webkit-details-marker { display: none; }
body[data-reco-ui="m3"] .m3-trv__acc-lbl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
body[data-reco-ui="m3"] .m3-trv__chev {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--m3-out, #7a838e);
  transition: transform .16s ease;
}
body[data-reco-ui="m3"] .m3-trv__acc[open] > .m3-trv__acc-sum .m3-trv__chev {
  transform: rotate(180deg);
}
body[data-reco-ui="m3"] .m3-trv__acc-list {
  margin: 0;
  padding: 8px 12px 10px 26px;
  border-top: 1px solid var(--m3-high, #e2e7ed);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: calc(var(--fs, 1rem) * 0.78);
  line-height: 1.5;
  color: var(--m3-var, #4a525c);
}

/* ---------- 副作用の重さ別の表（2026-11-22 デザイン決定: 重さ × 主な症状 × どうする） ---------- */
body[data-reco-ui="m3"] .ui-se-tbl-card {
  margin: 4px 0 0; padding: 0; border: 1px solid var(--m3-high); border-radius: 14px;
  background: #fff; overflow: hidden; container-type: inline-size;
}
body[data-reco-ui="m3"] .ui-se-tbl-card__name { margin: 0; padding: 10px 14px 0; font-weight: 700; color: var(--m3-on); }
body[data-reco-ui="m3"] .ui-se-tbl { width: 100%; border-collapse: collapse; font-size: calc(var(--fs) * 0.9); line-height: 1.5; }
body[data-reco-ui="m3"] .ui-se-tbl thead th {
  text-align: left; font-weight: 600; font-size: calc(var(--fs) * 0.78); color: var(--m3-var);
  padding: 8px 14px 6px; background: color-mix(in srgb, var(--m3-high) 45%, #fff); border-bottom: 1px solid var(--m3-high);
}
body[data-reco-ui="m3"] .ui-se-tbl tbody th,
body[data-reco-ui="m3"] .ui-se-tbl tbody td { padding: 10px 14px; vertical-align: top; border-bottom: 1px solid var(--m3-high); text-align: left; }
body[data-reco-ui="m3"] .ui-se-tbl tbody tr:last-child th,
body[data-reco-ui="m3"] .ui-se-tbl tbody tr:last-child td { border-bottom: 0; }
body[data-reco-ui="m3"] .ui-se-tbl tbody th { width: 7.5em; white-space: nowrap; font-weight: 700; }
body[data-reco-ui="m3"] .ui-se-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: 0.05em; }
body[data-reco-ui="m3"] .ui-se-row--mild th { color: var(--m3-on-ok); }
body[data-reco-ui="m3"] .ui-se-row--mild .ui-se-dot { background: var(--m3-ok); }
body[data-reco-ui="m3"] .ui-se-row--stop th { color: var(--m3-on-warn); }
body[data-reco-ui="m3"] .ui-se-row--stop .ui-se-dot { background: var(--m3-warn); }
body[data-reco-ui="m3"] .ui-se-row--serious { background: color-mix(in srgb, var(--m3-err-c) 45%, #fff); }
body[data-reco-ui="m3"] .ui-se-row--serious th { color: var(--m3-err); }
body[data-reco-ui="m3"] .ui-se-row--serious .ui-se-dot { background: var(--m3-err); }
body[data-reco-ui="m3"] .ui-se-more { margin-left: 6px; font-size: calc(var(--fs) * 0.78); color: var(--m3-var); white-space: nowrap; }
body[data-reco-ui="m3"] .ui-se-act { width: 9.5em; }
body[data-reco-ui="m3"] .ui-se-act { font-weight: 600; color: var(--m3-on); }
body[data-reco-ui="m3"] .ui-se-row--serious .ui-se-act { color: var(--m3-err); }
body[data-reco-ui="m3"] .ui-se-all { border-top: 1px solid var(--m3-high); }
body[data-reco-ui="m3"] .ui-se-all > summary {
  cursor: pointer; list-style: none; padding: 9px 14px; font-size: calc(var(--fs) * 0.85); font-weight: 600; color: var(--m3-pri);
}
body[data-reco-ui="m3"] .ui-se-all > summary::-webkit-details-marker { display: none; }
body[data-reco-ui="m3"] .ui-se-all > summary::after { content: " ▾"; }
body[data-reco-ui="m3"] .ui-se-all[open] > summary::after { content: " ▴"; }
body[data-reco-ui="m3"] .ui-se-all__grp { padding: 0 14px 10px; }
body[data-reco-ui="m3"] .ui-se-all__label { margin: 0 0 2px; font-size: calc(var(--fs) * 0.78); font-weight: 700; color: var(--m3-var); }
body[data-reco-ui="m3"] .ui-se-all__grp--serious .ui-se-all__label { color: var(--m3-err); }
body[data-reco-ui="m3"] .ui-se-all__list { margin: 0; font-size: calc(var(--fs) * 0.85); line-height: 1.6; color: var(--m3-on); }
body[data-reco-ui="m3"] .ui-se-tbl-card + .ui-side-effect-footnote,
body[data-reco-ui="m3"] .ui-side-effect-list .ui-side-effect-footnote { margin: 6px 2px 0; font-size: calc(var(--fs) * 0.75); color: var(--m3-var); }
/* カードが狭いとき（スマホ・狭い吹き出し）: 3 列をやめ、重さ＋どうする → 症状 を縦に積む */
@container (max-width: 440px) {
  body[data-reco-ui="m3"] .ui-se-tbl thead { display: none; }
  body[data-reco-ui="m3"] .ui-se-tbl tbody tr { display: grid; grid-template-columns: 1fr auto; border-bottom: 1px solid var(--m3-high); }
  body[data-reco-ui="m3"] .ui-se-tbl tbody tr:last-child { border-bottom: 0; }
  body[data-reco-ui="m3"] .ui-se-tbl tbody th,
  body[data-reco-ui="m3"] .ui-se-tbl tbody td { border-bottom: 0; width: auto; padding: 6px 12px; }
  body[data-reco-ui="m3"] .ui-se-tbl tbody th { grid-column: 1; padding-top: 10px; }
  body[data-reco-ui="m3"] .ui-se-act { grid-column: 2; grid-row: 1; padding-top: 10px; text-align: right; font-size: calc(var(--fs) * 0.82); }
  body[data-reco-ui="m3"] .ui-se-tbl tbody td:not(.ui-se-act) { grid-column: 1 / -1; padding-bottom: 10px; }
}
/* 読み上げだけに残す見出し（「対象製品の要点」の表の caption など。画面では欄のタイトルと二重にしない） */
.ui-visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
