/* M53：通常版・visualで共用する3ページの資料。 */
.ai-doc-anchor { display: block; scroll-margin-top: 90px; }
#ai-value-message { color: #243c53; padding-block: clamp(36px, 5vw, 64px); }
#ai-value-message .ai-doc-head { max-width: none; margin: 0 0 24px; text-align: left; }
#ai-value-message .ai-doc-head h2 { margin: 0; color: #122b43; font-size: clamp(1.65rem, 3.5vw, 2.5rem); line-height: 1.4; }
.ai-document { min-width: 0; margin-top: 24px; padding: clamp(12px, 2vw, 20px); color: #243c53; background: #f8fafc; border: 1px solid #cbdde6; border-radius: 12px; }
.ai-document .ai-doc-intro, .ai-document .ai-doc-help { margin: 0 0 16px; font-size: 1rem; line-height: 1.8; }
.ai-document .ai-doc-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.ai-document .ai-doc-choices a, .ai-document .ai-doc-retry { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 1px solid #8ba6b5; border-radius: 8px; background: #fff; color: #163247; font: inherit; font-size: 1rem; line-height: 1.7; text-decoration: none; cursor: pointer; }
.ai-document .ai-doc-choices a[aria-current="true"], .ai-document .ai-doc-choices a[aria-pressed="true"] { background: #075d77; color: #fff; border-color: #075d77; }
.ai-document .ai-doc-page { margin: 0; }
.ai-document .ai-doc-frame { aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; background: #0b1622; }
.ai-document .ai-doc-frame img { display: block; width: 100%; height: auto; object-fit: contain; }
.ai-document .ai-doc-page figcaption { margin-top: 16px; font-size: 1rem; line-height: 1.8; color: #243c53; }
.ai-document .ai-doc-page figcaption p { margin: 4px 0 0; font-size: 1rem; line-height: 1.8; }
.ai-document .ai-doc-status { color: #784022; font-size: 1rem; line-height: 1.8; }
.ai-document [hidden], .ai-document .ai-doc-frame img[hidden] { display: none; }
.ai-document .ai-doc-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 12px; }
.ai-document .ai-doc-links a { padding-block: 12px; color: #075d77; font-size: 1rem; line-height: 1.8; font-weight: 750; text-decoration: underline; text-underline-offset: .18em; }
.ai-document .ai-doc-help { margin: 8px 0 0; font-size: .9rem; }
.ai-document :focus-visible { outline: 3px solid #08677f; outline-offset: 4px; }

/* M61：既存の拡大リンクから開くスマホ用資料。通常表示・PC配置は保持。 */
.ai-doc-zoom:not([open]) { display: none; }
@media (max-width: 900px) {
  .ai-document .ai-doc-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); }
  .ai-document .ai-doc-choices a { justify-content: center; padding-inline: 8px; }
  .ai-document .ai-doc-links a { display: inline-flex; align-items: center; min-height: 48px; }
  .ai-document .ai-doc-links [data-ai-doc-open] { padding: 10px 16px; border: 1px solid #075d77; border-radius: 8px; background: #fff; }
  .ai-doc-zoom { box-sizing: border-box; display: flex; flex-direction: column; width: 100%; max-width: 100%; height: 100vh; height: 100dvh; max-height: 100dvh; margin: 0; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); border: 0; background: #f8fafc; color: #163247; overflow: auto; overscroll-behavior: contain; }
  .ai-doc-zoom::backdrop { background: #071126cc; }
  .ai-doc-zoom-toolbar { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 8px; position: sticky; top: 0; padding-bottom: 8px; background: #f8fafc; z-index: 1; }
  .ai-doc-zoom-toolbar button, .ai-doc-zoom-toolbar a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; border: 1px solid #65849b; border-radius: 8px; background: #fff; color: #163247; font: 600 1rem/1.5 system-ui, sans-serif; white-space: normal; text-decoration: none; cursor: pointer; }
  .ai-doc-zoom-toolbar button:first-child { background: #163247; color: #fff; }
  .ai-doc-zoom > p { margin: 4px 0 12px; font: 1rem/1.6 system-ui, sans-serif; }
  .ai-doc-zoom-scroll { min-height: 100px; flex: 1 1 auto; overflow: auto; overscroll-behavior: contain; background: #e0e7ed; }
  .ai-doc-zoom-scroll img { display: block; width: 100%; max-width: none; height: auto; }
  .ai-doc-zoom-scroll.is-enlarged img { width: max(200%, 1200px); }
  .ai-doc-zoom :focus-visible { outline: 3px solid #b24f00; outline-offset: 2px; }
}
