.giv-chat-launcher, .giv-chat, .giv-chat-entry, .giv-chat-contact-note {
  --chat-blue: #36537c;
  --chat-ink: #24374d;
  --chat-line: #d8e0e8;
  --chat-soft: #f2f5f8;
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: .02em;
  line-height: 1.7;
  color: var(--chat-ink);
  box-sizing: border-box;
}
.giv-chat *, .giv-chat-entry *, .giv-chat-contact-note * { box-sizing: border-box; }
.giv-chat-launcher {
  position: fixed; right: 24px; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 1001;
  display: flex; align-items: center; gap: 9px; min-height: 52px; padding: 12px 22px;
  border: 1px solid #fff8; border-radius: 32px; color: #fff; background: var(--chat-blue);
  box-shadow: 0 6px 24px #23375226; cursor: pointer; font-weight: 600;
}
.giv-chat-launcher:hover { background: #243e62; }
.giv-chat-launcher[aria-expanded="true"] { background: #243e62; }
.giv-chat[hidden] { display: none; }
.giv-chat:not([hidden]) {
  --chat-panel-bottom: max(88px, calc(env(safe-area-inset-bottom) + 76px));
  display: block; position: fixed; right: 24px; bottom: var(--chat-panel-bottom); z-index: 1002; margin: 0;
  width: min(380px, calc(100% - 48px)); max-width: none;
  height: 620px;
  max-height: calc(100vh - var(--chat-panel-bottom) - var(--chat-site-header-height, 0px) - 12px);
  max-height: calc(100dvh - var(--chat-panel-bottom) - var(--chat-site-header-height, 0px) - 12px);
  container: giv-chat-panel / size;
  padding: 0; border: 1px solid var(--chat-line); border-radius: 16px; background: #fff;
  box-shadow: 0 8px 36px #102c4b2b; overflow: hidden;
}
.giv-chat-shell { height: 100%; display: flex; flex-direction: column; }
.giv-chat-content { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.giv-chat-header { display: flex; flex-shrink: 0; align-items: center; gap: 10px; padding: 10px 16px; background: var(--chat-soft); border-bottom: 1px solid var(--chat-line); }
.giv-chat-avatar { display: grid; place-items: center; flex: 0 0 34px; height: 34px; background: var(--chat-blue); color: #fff; border-radius: 50%; font: 25px Georgia, serif; }
.giv-chat .giv-chat-eyebrow, .giv-chat-entry .giv-chat-eyebrow { margin: 0 0 3px; font-size: 10px; color: var(--chat-blue); letter-spacing: .16em; font-weight: 600; }
.giv-chat h2 { margin: 0; padding: 0; border: 0; background: transparent; font-size: 17px; font-weight: 600; line-height: 1.4; }
.giv-chat h2::before, .giv-chat h2::after, .giv-chat h3::before, .giv-chat h3::after { content: none; }
.giv-chat button { font: inherit; letter-spacing: inherit; cursor: pointer; text-transform: none; }
.giv-chat .giv-chat-close { margin-left: auto; padding: 0; flex: 0 0 44px; height: 44px; border: 0; border-radius: 50%; background: #fff; color: var(--chat-blue); font-size: 29px; line-height: 1; }
.giv-chat-body { position: relative; overflow-anchor: none; flex: 1 1 auto; min-height: 0; padding: 20px 18px; overflow-y: auto; overscroll-behavior: contain; scroll-padding-top: 20px; }
.giv-chat .giv-chat-kicker { color: var(--chat-blue); font-size: 12px; font-weight: 600; margin: 0 0 12px; letter-spacing: .06em; }
.giv-chat .giv-chat-intro-title { font-family: Georgia, "Noto Serif JP", "Hiragino Mincho ProN", serif; font-weight: 500; font-size: 23px; line-height: 1.75; white-space: pre-line; margin: 0 0 18px; border: 0; padding: 0; }
.giv-chat .giv-chat-copy { margin: 0 0 18px; font-size: 14px; line-height: 1.85; }
.giv-chat-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 25px; }
.giv-chat-tags span { padding: 6px 12px; border: 1px solid var(--chat-line); border-radius: 20px; font-size: 12px; color: var(--chat-blue); }
.giv-chat .giv-chat-note { color: #526477; font-size: 12px; line-height: 1.8; margin: 18px 0 0; }
.giv-chat .giv-chat-question { font-size: 17px; line-height: 1.7; font-weight: 600; margin: 0 0 16px; padding: 0; border: 0; background: transparent; overflow-wrap: anywhere; }
.giv-chat .giv-chat-hint { font-size: 13px; color: #526477; margin: -8px 0 20px; }
.giv-chat-choices { display: grid; gap: 10px; }
.giv-chat-choice, .giv-chat .giv-chat-choice {
  display: block; width: 100%; min-height: 48px; border: 1px solid var(--chat-line); border-radius: 10px;
  padding: 11px 12px; text-align: left; font-size: 14px; line-height: 1.6; background: #fff; color: var(--chat-ink); white-space: normal;
}
.giv-chat-choice:hover, .giv-chat .giv-chat-choice:hover { border-color: var(--chat-blue); background: var(--chat-soft); }
.giv-chat-primary, .giv-chat .giv-chat-primary {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px;
  border: 1px solid var(--chat-blue); border-radius: 8px; padding: 14px 20px; background: var(--chat-blue); color: #fff;
  font: inherit; font-weight: 600; line-height: 1.6; text-align: center; text-decoration: none; white-space: normal; cursor: pointer;
}
.giv-chat-primary:hover, .giv-chat .giv-chat-primary:hover { background: #243e62; color: #fff; }
.giv-chat-wide { width: 100%; }
.giv-chat-footer { padding: 10px 18px; background: #fff; border-top: 1px solid var(--chat-line); flex-shrink: 0; }
.giv-chat-footer .giv-chat-primary { min-height: 44px; padding: 11px 12px; font-size: 14px; }
.giv-chat-tools { display: flex; justify-content: space-between; gap: 12px; }
.giv-chat-footer > .giv-chat-primary + .giv-chat-tools { margin-top: 8px; }
.giv-chat-text-button, .giv-chat .giv-chat-text-button { background: transparent; color: var(--chat-blue); border: 0; border-radius: 4px; font: inherit; font-size: 12px; padding: 9px 5px; min-height: 44px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.giv-chat :focus-visible, .giv-chat-launcher:focus-visible, .giv-chat-entry :focus-visible, .giv-chat-contact-note :focus-visible { outline: 3px solid #3e85ab; outline-offset: 3px; }
.giv-chat [data-chat-focus]:focus { outline: none; }
.giv-chat-results { display: grid; gap: 12px; }
.giv-chat-result { padding: 19px; border: 1px solid var(--chat-line); border-left: 3px solid var(--chat-blue); border-radius: 8px; }
.giv-chat-result h4 { font-size: 16px; font-weight: 600; margin: 0 0 6px; padding: 0; border: 0; }
.giv-chat-result p { font-size: 13px; color: #526477; margin: 0; }
.giv-chat-entry { display: flex; align-items: center; justify-content: space-between; gap: 30px; max-width: 1080px; margin: 70px auto; padding: 32px 38px; border: 1px solid var(--chat-line); border-radius: 12px; background: #fff; }
.giv-chat-entry h2 { font-size: 25px; line-height: 1.5; margin: 6px 0 10px; }
.giv-chat-entry p { margin: 0; font-size: 14px; }
.giv-chat-entry button { flex-shrink: 0; }
.giv-chat-contact-note { background: #fff; color: var(--chat-ink); border-left: 3px solid var(--chat-blue); padding: 22px; margin: 0 0 28px; }
.giv-chat-contact-note h2 { font-size: 18px; font-weight: 600; margin: 0 0 8px; padding: 0; border: 0; }
.giv-chat-contact-note p { margin: 0 0 8px; font-size: 14px; }
.giv-chat-storage-fallback { margin-top: 24px; padding: 16px; background: var(--chat-soft); }
.giv-chat-storage-fallback h4 { margin: 0 0 8px; }
.giv-chat-storage-fallback textarea, .giv-chat-contact-note textarea { display: block; width: 100%; min-height: 180px; margin: 12px 0; padding: 12px; border: 1px solid var(--chat-line); background: #fff; color: var(--chat-ink); font: inherit; font-size: 13px; }

.giv-chat-turn { position: relative; margin: 0 0 28px; }
.giv-chat-turn-answered { padding-bottom: 20px; border-bottom: 1px solid var(--chat-line); }
.giv-chat-turn .giv-chat-reply { margin: 18px 0 0; }
.giv-chat .giv-chat-choice:disabled { cursor: default; opacity: 1; color: #617083; background: #f8fafc; border-color: #e4e9ef; transform: none; }
.giv-chat .giv-chat-choice[aria-pressed="true"] { color: var(--chat-blue); background: #eaf0f7; border-color: var(--chat-blue); }
.giv-chat .giv-chat-choice[aria-pressed="true"]::after { content: ' ✓ 選択済み'; display: block; font-size: 11px; font-weight: 600; margin-top: 3px; }
.giv-chat-change { display: block; margin-left: auto; }

/* Gentle conversational transitions; previous messages remain in the scrollable transcript. */
.giv-chat:not([hidden]) { transform-origin: bottom right; animation: giv-panel-in 500ms cubic-bezier(.2,.7,.2,1) both; }
.giv-chat-launcher, .giv-chat-close, .giv-chat-primary, .giv-chat-choice {
  transition: background-color 160ms, border-color 160ms, box-shadow 160ms, transform 160ms;
}
.giv-chat-launcher:hover { transform: translateY(-2px); }
.giv-chat-choice:active, .giv-chat-primary:active { transform: scale(.985); }
.giv-chat-bot-message { padding: 15px; margin-bottom: 14px; border-radius: 4px 14px 14px; background: var(--chat-soft); animation: none; }
.giv-chat-bot-message .giv-chat-kicker { font-size: 11px; margin-bottom: 8px; }
.giv-chat-bot-message .giv-chat-question { font-size: 16px; margin-bottom: 0; }
.giv-chat-bot-message .giv-chat-hint { margin: 10px 0 0; font-size: 12px; }
.giv-chat-reply { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; margin-bottom: 18px; animation: giv-reply-in 500ms ease-out both; }
.giv-chat-reply.giv-chat-reply-settled { animation: none; }
.giv-chat-reply-label { font-size: 10px; color: #526477; }
.giv-chat-reply p { max-width: 90%; margin: 0; padding: 10px 13px; border-radius: 13px 4px 13px 13px; background: var(--chat-blue); color: #fff; font-size: 13px; overflow-wrap: anywhere; }
.giv-chat-turn-new .giv-chat-choice, .giv-chat-turn-new .giv-chat-result { animation: giv-message-in 500ms ease-out both; animation-delay: calc(360ms + var(--chat-order, 0) * 140ms); }
.giv-chat-turn-new .giv-chat-bot-message, .giv-chat-turn-new > .giv-chat-question { animation: giv-message-in 500ms ease-out both; }
.giv-chat-intro-title { animation: giv-message-in 500ms ease-out both; }
.giv-chat-typing { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 12px; max-width: 100%; padding: 13px 15px; border-radius: 4px 14px 14px; background: var(--chat-soft); color: #526477; font-size: 12px; animation: giv-message-in 500ms ease-out both; }
.giv-chat-typing:focus { outline: none; }
.giv-chat-typing-dots { display: inline-flex; align-items: center; gap: 4px; height: 16px; }
.giv-chat-typing-dots span { width: 5px; height: 5px; border-radius: 50%; background: var(--chat-blue); animation: giv-typing-dot 1100ms ease-in-out infinite; }
.giv-chat-typing-dots span:nth-child(2) { animation-delay: 120ms; }
.giv-chat-typing-dots span:nth-child(3) { animation-delay: 240ms; }
.giv-chat[aria-busy="true"] .giv-chat-avatar { animation: giv-avatar-pulse 1100ms ease-in-out infinite; }
@keyframes giv-panel-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes giv-message-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes giv-reply-in { from { opacity: 0; transform: translateX(7px); } to { opacity: 1; transform: none; } }
@keyframes giv-typing-dot { 0%, 65%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }
@keyframes giv-avatar-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .65; } }
@media (prefers-reduced-motion: reduce) {
  .giv-chat, .giv-chat *, .giv-chat-launcher, .giv-chat-entry * { animation: none !important; transition: none !important; }
  .giv-chat-launcher:hover { transform: none; }
}
@media (max-width: 640px) {
  .giv-chat-launcher { right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); min-height: 48px; font-size: 13px; padding: 11px 17px; }
  .giv-chat:not([hidden]) { --chat-panel-bottom: max(74px, calc(env(safe-area-inset-bottom) + 60px)); right: 12px; width: min(350px, calc(100% - 24px)); height: min(500px, 58dvh); }
  .giv-chat-body { padding: 16px; }
  .giv-chat .giv-chat-intro-title { font-size: 21px; }
  .giv-chat-footer { padding: 8px 16px; }
  .giv-chat-entry { flex-direction: column; align-items: flex-start; margin: 40px 16px; padding: 24px; gap: 20px; }
  .giv-chat-entry h2 { font-size: 22px; }
  .giv-chat-entry .giv-chat-primary { width: 100%; }
}
@media (max-height: 480px) {
  .giv-chat-launcher[aria-expanded="true"] { visibility: hidden; }
  .giv-chat:not([hidden]) { --chat-panel-bottom: max(12px, env(safe-area-inset-bottom)); height: 620px; }
  .giv-chat-header { padding: 6px 14px; }
  .giv-chat-body { padding: 14px; }
  .giv-chat-footer { padding: 6px 14px; }
}
@container giv-chat-panel (max-height: 245px) {
  .giv-chat-content { display: block; overflow-y: auto; overscroll-behavior: contain; }
  .giv-chat-body { overflow: visible; }
}
