/* AIに聞く（ページ右下のボタン・各手順の「?」とチャット画面）。2026-11-05。docs/12 */
.ask-fab { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px 0 14px; border: 0; border-radius: 999px; background: var(--navy); color: #fff; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; box-shadow: 0 8px 22px rgba(15,29,58,.32); transition: transform .15s, background .15s; }
.ask-fab:hover { background: var(--navy-2); transform: translateY(-1px); }
.ask-fab svg { color: var(--accent); }
.ask-fab[aria-expanded="true"] { display: none; }

.ask-panel { position: fixed; right: 16px; bottom: 16px; z-index: 70; width: 400px; height: min(620px, calc(100vh - 32px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 52px rgba(15,26,51,.25); overflow: hidden; }
.ask-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 16px; background: var(--navy); color: #fff; }
.ask-head h2 { margin: 0; font-size: 15px; color: #fff; }
.ask-close { margin-left: auto; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--on-navy-sub); font-size: 22px; line-height: 1; cursor: pointer; }
.ask-close:hover { background: var(--navy-2); color: #fff; }
.ask-ctx { display: flex; align-items: center; gap: 6px; padding: 7px 16px; font-size: 12px; color: var(--sub); border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.ask-ctx b { color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.ask-badge { flex: none; font-size: 11px; font-weight: 700; border: 1px solid var(--ink); border-radius: 5px; padding: 0 6px; color: var(--ink); }

.ask-log { flex: 1; overflow-y: auto; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }
.ask-intro { font-size: 14px; line-height: 1.75; }
.ask-intro p { margin: 0 0 6px; }
.ask-small { font-size: 12px; color: var(--sub); }
.ask-stepbox { font-size: 13px; color: var(--sub); border-left: 3px solid var(--accent); padding: 2px 0 2px 10px; }
.ask-stepbox > p { margin: 0 0 6px; }

.ask-msg { max-width: 92%; font-size: 14px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.ask-msg.q { align-self: flex-end; background: var(--navy); color: #fff; border-radius: 14px 14px 4px 14px; padding: 8px 12px; }
.ask-msg.q .ask-quote { display: block; font-size: 12px; color: var(--on-navy-sub); border-left: 2px solid var(--accent); padding-left: 8px; margin-bottom: 4px; }
.ask-msg.a { align-self: flex-start; background: #eef1f7; border-radius: 14px 14px 14px 4px; padding: 9px 13px; }
.ask-msg.a.typing::after { content: "▍"; color: var(--accent); animation: ask-blink 1s steps(2) infinite; }
@keyframes ask-blink { 50% { opacity: 0; } }
.ask-fb { display: flex; gap: 6px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--sub); white-space: normal; }
.ask-fb button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 0 8px; font-size: 12px; line-height: 1.9; cursor: pointer; color: var(--sub); }
.ask-fb button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-wash); }
.ask-err { align-self: center; font-size: 13px; color: #9b2c1f; }

.ask-foot { border-top: 1px solid var(--line); padding: 8px 12px 10px; }
.ask-sel { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; color: var(--sub); background: var(--accent-wash); border: 1px solid #ffd2b8; border-radius: 8px; padding: 4px 6px 4px 10px; margin-bottom: 6px; }
.ask-sel span { flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ask-sel button { border: 0; background: none; color: var(--sub); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
.ask-form { display: flex; align-items: flex-end; gap: 8px; }
.ask-form textarea { flex: 1; min-height: 42px; max-height: 120px; resize: none; border: 1.5px solid var(--line); border-radius: 12px; padding: 9px 12px; font: inherit; font-size: 15px; line-height: 1.5; color: var(--ink); background: #fff; }
.ask-form textarea:focus { outline: none; border-color: var(--accent); }
.ask-send { flex: none; width: 42px; height: 42px; border: 0; border-radius: 12px; background: var(--accent-ink); color: #fff; display: grid; place-items: center; cursor: pointer; }
.ask-send:disabled { background: #c6ccd8; cursor: default; }
.ask-note { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 11px; line-height: 1.6; color: var(--sub); }
.ask-note a { color: var(--sub); }
.ask-count { flex: none; white-space: nowrap; }
.ask-count.over { color: #9b2c1f; font-weight: 700; }

/* 手順の見出しの横の「?」 */
.gstep-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.step-ask { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 4px; margin-top: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--sub); font: inherit; font-size: 12px; cursor: pointer; opacity: .55; transition: opacity .15s, border-color .15s; }
.step-ask > span[aria-hidden] { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--bg); font-weight: 700; color: var(--ink); }
.gstep:hover .step-ask, .step-ask:focus-visible { opacity: 1; }
.step-ask:hover { border-color: var(--accent); color: var(--accent-ink); }

@media (max-width: 600px) {
  .ask-fab { right: 12px; height: 44px; font-size: 14px; padding: 0 14px 0 12px; }
  .ask-panel { left: 0; right: 0; bottom: 0; width: auto; height: 86vh; height: 86dvh; border-radius: 16px 16px 0 0; }
  .step-ask { opacity: 1; padding: 0 4px; }
  .step-ask-l { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ask-fab { transition: none; } .ask-msg.a.typing::after { animation: none; } }

.ask-ts:not(:empty) { margin-bottom: 6px; }
