/* アルクAIアシスタント（右下のチャット） */
.arc-chat { --navy: #1d415f; --ink: #0f1230; --grad: linear-gradient(135deg, #0f1230, #1f255f); --beige: #f5f3f0; --line: #d6d6d6;
  font-family: 'Noto Sans JP', sans-serif; color: var(--ink); line-height: 1.7; letter-spacing: .04em; -webkit-font-smoothing: antialiased; }
.arc-chat *, .arc-chat *::before, .arc-chat *::after { box-sizing: border-box; }

.arc-chat-launch { position: fixed; right: 24px; bottom: 24px; z-index: 40; display: flex; align-items: center; gap: 10px;
  padding: 14px 22px 14px 18px; border: 0; border-radius: 999px; background: var(--grad); color: #fff; cursor: pointer;
  font: 600 14px/1.2 'Noto Sans JP', sans-serif; letter-spacing: .08em; box-shadow: 0 10px 30px rgba(15,18,48,.28);
  transition: transform .3s cubic-bezier(.4,.4,0,1), box-shadow .3s, opacity .3s; }
.arc-chat-launch:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(15,18,48,.34); }
.arc-chat-launch:focus-visible { outline: 3px solid #8fb3d9; outline-offset: 3px; }
.arc-chat-launch svg { width: 22px; height: 22px; flex: none; }
.arc-chat-launch small { display: block; font-size: 10px; font-weight: 500; opacity: .8; letter-spacing: .06em; margin-top: 3px; }
.arc-chat-launch .short { display: none; }
.arc-chat.at-foot:not(.is-open) .arc-chat-launch { opacity: 0; pointer-events: none; transform: translateY(12px); }
.arc-chat.is-open .arc-chat-launch { opacity: 0; pointer-events: none; transform: translateY(8px); }

.arc-chat-panel { position: fixed; right: 24px; bottom: 24px; z-index: 41; width: 400px; height: min(640px, calc(100dvh - 48px));
  display: flex; flex-direction: column; background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(15,18,48,.28); opacity: 0; transform: translateY(16px) scale(.98); pointer-events: none; visibility: hidden;
  transition: opacity .3s cubic-bezier(.4,.4,0,1), transform .3s cubic-bezier(.4,.4,0,1), visibility 0s .3s; }
.arc-chat.is-open .arc-chat-panel { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }

.arc-chat-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px 20px; background: var(--grad); color: #fff; }
.arc-chat-head h2 { margin: 0; font: 600 16px/1.3 'Noto Serif JP', serif; letter-spacing: .1em; }
.arc-chat-head p { margin: 2px 0 0; font-size: 11px; opacity: .8; letter-spacing: .04em; }
.arc-chat-head .grow { flex: 1; min-width: 0; }
.arc-chat-icon-btn { flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; cursor: pointer;
  display: grid; place-items: center; transition: background .2s; }
.arc-chat-icon-btn:hover { background: rgba(255,255,255,.22); }
.arc-chat-icon-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.arc-chat-icon-btn svg { width: 18px; height: 18px; }

.arc-chat-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 16px 8px; background: var(--beige); overscroll-behavior: contain; scroll-behavior: smooth; }
.arc-chat-note { margin: 0 4px 14px; font-size: 11px; color: #5d6170; line-height: 1.6; }
.arc-msg { display: flex; margin: 0 0 12px; }
.arc-msg.user { justify-content: flex-end; }
.arc-bubble { max-width: 86%; padding: 11px 14px; border-radius: 12px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.arc-msg.bot .arc-bubble { background: #fff; border-top-left-radius: 4px; box-shadow: 0 1px 2px rgba(15,18,48,.06); }
.arc-msg.user .arc-bubble { background: var(--navy); color: #fff; border-top-right-radius: 4px; }
.arc-bubble.is-typing::after { content: ''; display: inline-block; width: 6px; height: 14px; margin-left: 2px; vertical-align: -2px; background: var(--navy); animation: arc-blink 1s steps(2) infinite; }
.arc-dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.arc-dots i { width: 6px; height: 6px; border-radius: 50%; background: #9aa3b5; animation: arc-dot 1.2s infinite ease-in-out; }
.arc-dots i:nth-child(2) { animation-delay: .15s; } .arc-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes arc-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes arc-blink { 50% { opacity: 0; } }

.arc-sources { margin: -4px 0 12px; padding: 0 4px; font-size: 11px; color: #5d6170; }
.arc-sources a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
.arc-sources a + a::before { content: '／'; color: #9aa3b5; margin: 0 4px; text-decoration: none; display: inline-block; }

.arc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.arc-chip { border: 1px solid var(--navy); background: #fff; color: var(--navy); border-radius: 999px; padding: 7px 14px; font: 500 13px/1.4 'Noto Sans JP', sans-serif;
  letter-spacing: .03em; cursor: pointer; transition: background .2s, color .2s; text-align: left; }
.arc-chip:hover { background: var(--navy); color: #fff; }
.arc-chip:focus-visible { outline: 2px solid #8fb3d9; outline-offset: 2px; }
.arc-chips[aria-disabled="true"] .arc-chip { opacity: .45; pointer-events: none; }

.arc-card { background: #fff; border: 1px solid var(--navy); border-radius: 12px; margin: 0 0 14px; overflow: hidden; }
.arc-card h3 { margin: 0; padding: 10px 14px; background: var(--navy); color: #fff; font: 600 13px/1.4 'Noto Serif JP', serif; letter-spacing: .08em; }
.arc-card dl { margin: 0; padding: 10px 14px 4px; display: grid; grid-template-columns: 6.5em 1fr; gap: 6px 10px; font-size: 13px; }
.arc-card dt { color: #5d6170; }
.arc-card dd { margin: 0; word-break: break-word; }
.arc-card .plan { margin: 6px 14px 0; padding: 8px 10px; background: var(--beige); border-radius: 8px; font-size: 13px; }
.arc-card .plan small { display: block; color: #5d6170; font-size: 11px; margin-top: 2px; }
.arc-card .actions { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; }

.arc-btn { display: block; width: 100%; border: 0; border-radius: 999px; padding: 12px 16px; background: var(--grad); color: #fff; cursor: pointer;
  font: 600 14px/1.3 'Noto Sans JP', sans-serif; letter-spacing: .06em; text-align: center; text-decoration: none; }
.arc-btn.sub { background: #fff; color: var(--navy); border: 1px solid var(--navy); font-weight: 500; }
.arc-btn:focus-visible { outline: 2px solid #8fb3d9; outline-offset: 2px; }
.arc-btn[disabled] { opacity: .5; cursor: default; }

.arc-form { background: #fff; border-radius: 12px; padding: 14px; margin: 0 0 14px; }
.arc-form h3 { margin: 0 0 4px; font: 600 15px/1.4 'Noto Serif JP', serif; letter-spacing: .08em; }
.arc-form p.lead { margin: 0 0 12px; font-size: 12px; color: #5d6170; }
.arc-form label { display: block; margin: 0 0 10px; font-size: 12px; font-weight: 500; }
.arc-form label b { color: #b3261e; font-weight: 500; margin-left: 4px; font-size: 11px; }
.arc-form input, .arc-form textarea { display: block; width: 100%; margin-top: 4px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px;
  font: 16px/1.5 'Noto Sans JP', sans-serif; color: var(--ink); background: #fff; }
.arc-form textarea { min-height: 150px; resize: vertical; font-size: 14px; }
.arc-form input:focus, .arc-form textarea:focus { outline: 2px solid #8fb3d9; border-color: var(--navy); }
.arc-form .err { color: #b3261e; font-size: 12px; margin: -4px 0 10px; }
.arc-form .demo { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: #fff7e0; font-size: 11px; color: #6b5300; }

.arc-chat-foot { flex: none; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #eceae6; }
.arc-chat-input { display: flex; align-items: flex-end; gap: 8px; }
.arc-chat-input textarea { flex: 1; min-width: 0; max-height: 120px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; resize: none;
  font: 16px/1.5 'Noto Sans JP', sans-serif; color: var(--ink); background: #fff; }
.arc-chat-input textarea:focus { outline: 2px solid #8fb3d9; border-color: var(--navy); }
.arc-send { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--grad); color: #fff; cursor: pointer; display: grid; place-items: center; }
.arc-send[disabled] { opacity: .4; cursor: default; }
.arc-send svg { width: 20px; height: 20px; }
.arc-chat-foot small { display: block; margin-top: 6px; font-size: 10px; color: #7a7f8c; text-align: center; letter-spacing: .02em; }

@media (max-width: 840px) {
  .arc-chat-launch { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: 60px; height: 60px; padding: 0; border-radius: 50%;
    flex-direction: column; justify-content: center; gap: 2px; font-size: 10px; letter-spacing: .04em; }
  .arc-chat-launch .full { display: none; }
  .arc-chat-launch .short { display: block; }
}
@media (max-width: 540px) {
  .arc-chat-panel { inset: 0; width: 100%; height: 100dvh; border-radius: 0; }
  .arc-chat-head { padding-top: calc(14px + env(safe-area-inset-top)); }
}
@media (prefers-reduced-motion: reduce) {
  .arc-chat-launch, .arc-chat-panel { transition: none; }
  .arc-dots i, .arc-bubble.is-typing::after { animation: none; }
}
html.arc-chat-lock, html.arc-chat-lock body { overflow: hidden; }
