/* 右下のチャットボット（使い方・開発の要望）と CS の「開発の要望」。色は墨・灰・白だけ（状態ごとに色を変えない）。部品は style.css の変数だけを使う */
.rq-ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* 浮くボタン: チャットボットのマーク。開いている間は × */
.rq-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: var(--z-fab, 55);
  display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer;
  color: var(--c-text); background: var(--c-surface); box-shadow: var(--e2);
  transition: transform .3s var(--ease), box-shadow .3s ease;
}
.rq-fab[hidden] { display: none; }
.rq-fab .rq-ic { width: 28px; height: 28px; stroke-width: 1.5; }
.rq-fab .rq-fab-x { display: none; width: 22px; height: 22px; }
.rq-av { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.rq-fab { overflow: hidden; }
.rq-fab.is-open { overflow: visible; }
/* 右下のアイコンの動き: 出てきたときにぽんと弾み、ふだんはふわふわ浮いて、ときどき首をかしげる。押す前に指を乗せると跳ねる */
.rq-fab:not([hidden]) { animation: rq-pop .6s var(--ease) backwards; }
.rq-fab .rq-fab-bot { transform-origin: 50% 60%; animation: rq-float 3.2s ease-in-out infinite, rq-tilt 7s ease-in-out 2s infinite; }
.rq-fab:hover .rq-fab-bot { animation: rq-hop .5s var(--ease); }
@keyframes rq-pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 80% { transform: scale(.96); } 100% { transform: scale(1); } }
@keyframes rq-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -3px; } }
@keyframes rq-tilt { 0%, 80%, 100% { rotate: 0deg; } 84% { rotate: -12deg; } 90% { rotate: 8deg; } 95% { rotate: -3deg; } }
@keyframes rq-hop { 0% { transform: scale(1); } 35% { transform: scale(1.14) translateY(-2px); } 65% { transform: scale(.95); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .rq-fab, .rq-fab .rq-fab-bot, .rq-fab:hover .rq-fab-bot { animation: none; } }
.rq-fab.is-open .rq-fab-bot { display: none; }
.rq-fab.is-open .rq-fab-x { display: block; }
.rq-fab:hover { transform: translateY(-1px); box-shadow: var(--e3); }
.rq-fab:focus-visible, .rq-panel button:focus-visible, .rq-panel a:focus-visible { outline: 2px solid var(--c-text); outline-offset: 2px; }

.rq-panel {
  position: fixed; right: 24px; bottom: 92px; z-index: var(--z-fab, 55);
  display: flex; flex-direction: column; width: 400px; max-width: calc(100vw - 32px); height: min(640px, calc(100vh - 120px));
  background: var(--c-surface); border-radius: var(--r-l, 20px); box-shadow: var(--e2);
  overflow: hidden;
}
/* 重なり順は ui.css の --z-fab（シートの上・ダイアログの下）。ダイアログ・シート・スマホのメニューを開いている間は隠す（そのボタンを覆わない） */
body.modal-open .rq-fab, body.modal-open .rq-panel,
body.ui-sheet-open .rq-fab, body.ui-sheet-open .rq-panel,
.is-menu .rq-fab, .is-menu .rq-panel { display: none; }

.rq-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px 20px; }
.rq-avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; color: var(--c-text); flex: none; }
.rq-avatar .rq-ic { width: 24px; height: 24px; }
.rq-title { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: 0.06em; color: var(--c-text); }
.rq-close { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-left: auto; border: 0; border-radius: 50%; background: transparent; color: var(--c-text-3); cursor: pointer; }
.rq-close:hover { background: var(--c-bg); color: var(--c-text); }

/* 使い方・要望の切り替え（文字のタブ。今いる方は墨と下線） */
.rq-tabs { display: flex; align-items: flex-end; gap: 0 24px; padding: 0 20px; border-bottom: 1px solid var(--c-line); }
.rq-tabs[hidden] { display: none; }
.rq-tab {
  position: relative; padding: 8px 0 11px; border: 0; background: none; cursor: pointer;
  font-family: var(--f); font-size: 14px; font-weight: 700; letter-spacing: 0.06em; color: var(--c-text-3);
}
.rq-tab:hover { color: var(--c-text-sub); }
.rq-tab[aria-selected="true"] { color: var(--c-text); }
.rq-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--c-text); }
.rq-all { align-self: center; margin-left: auto; padding: 8px 0; font-size: 12px; font-weight: 700; color: var(--c-text-sub); white-space: nowrap; }
.rq-all:hover { color: var(--c-text); }

.rq-view { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.rq-tabs[hidden] + .rq-view { border-top: 1px solid var(--c-line); }
.rq-thread { flex: 1 1 auto; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; background: var(--c-bg); }
.rq-item { display: flex; flex-direction: column; gap: 6px; }
.rq-msg { display: flex; align-items: flex-start; gap: 8px; }
.rq-msg .rq-avatar { width: 28px; height: 28px; margin-top: 4px; }
.rq-msg .rq-avatar .rq-ic { width: 22px; height: 22px; }
.rq-bubble { max-width: 86%; padding: 10px 14px; border-radius: var(--r-m, 16px); font-size: 14px; line-height: 1.8; color: var(--c-text); background: var(--c-surface); box-shadow: var(--e1); }
.rq-bubble.is-me { align-self: flex-end; border-bottom-right-radius: 6px; }
.rq-bubble.is-bot { border-top-left-radius: 6px; }
.rq-bubble-meta { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; font-size: 12px; font-weight: 700; color: var(--c-text-3); }
.rq-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 500; }
.rq-guide-title { margin: 0 0 4px; font-size: 14px; font-weight: 700; }
.rq-when { font-family: var(--f-en); font-size: 12px; font-weight: 600; color: var(--c-text-3); letter-spacing: 0; }
.rq-receipt { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.rq-receipt .rq-body { font-weight: 700; }
.rq-receipt .rq-ic { width: 16px; height: 16px; stroke-width: 2; }
.rq-item.is-fresh { animation: rq-in .5s var(--ease) both; }
.rq-item.is-fresh .rq-bubble.is-me { box-shadow: var(--e2); }
@keyframes rq-in { from { opacity: 0; transform: translateY(8px); } }
.rq-state-line { align-self: flex-end; display: inline-flex; align-items: center; gap: 8px; }
.rq-err { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--c-text); font-size: 13px; font-weight: 700; }

/* 状態: 線のアイコン＋文字（色で分けない） */
.rq-status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--c-text-sub); white-space: nowrap; }
.rq-status .rq-ic { width: 15px; height: 15px; }
.rq-status.is-hold, .rq-status.is-wontfix { color: var(--c-text-3); }

/* 最初に選ぶ: 使い方を聞く・開発の要望を出す */
.rq-choices { display: flex; flex-direction: column; gap: 10px; padding-left: 36px; }
.rq-choice {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 0 16px; text-align: left; cursor: pointer;
  border: 0; border-radius: var(--r-s); background: var(--c-surface); color: var(--c-text); box-shadow: var(--e1);
  font-family: var(--f); font-size: 14px; font-weight: 700; letter-spacing: 0.04em;
  transition: box-shadow .2s ease;
}
.rq-choice:hover { box-shadow: var(--e2); }
.rq-choice .rq-ic { width: 20px; height: 20px; }
.rq-choice .rq-chev { width: 14px; height: 14px; margin-left: auto; color: var(--c-text-3); }

/* 使い方: よく聞かれること・答えの下の画面へのリンク（文字＋›。囲まない） */
.rq-suggest { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding-left: 36px; }
.rq-links { display: flex; flex-wrap: wrap; gap: 0 16px; margin-top: 6px; }
.rq-link {
  display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0; border: 0; background: none; cursor: pointer;
  font-family: var(--f); font-size: 13px; font-weight: 700; letter-spacing: 0.04em; color: var(--c-text-sub); text-decoration: none; text-align: left;
}
.rq-link:hover { color: var(--c-text); }
.rq-link .rq-ic { width: 13px; height: 13px; stroke-width: 2; }
.rq-thinking { display: inline-flex; align-items: center; gap: 8px; color: var(--c-text-3); font-size: 13px; font-weight: 700; }
.rq-dots { display: inline-flex; gap: 4px; }
.rq-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--c-text-3); animation: rq-dot 1.2s ease-in-out infinite; }
.rq-dots i:nth-child(2) { animation-delay: .15s; }
.rq-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes rq-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.rq-compose { padding: 12px 20px 16px; border-top: 1px solid var(--c-line); display: flex; flex-direction: column; gap: 10px; background: var(--c-surface); }
.rq-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rq-selects .input { font-size: 13px; padding-top: 6px; padding-bottom: 5px; }
.rq-ta { min-height: 52px; max-height: 160px; padding: 12px 14px; font-size: 14px; line-height: 1.7; resize: none; }
.rq-ta.is-long { min-height: 76px; }
textarea.input.rq-ta { resize: none; }
textarea.input.rq-ta:focus { border-color: var(--c-text); }
.rq-actions { display: flex; align-items: center; gap: 10px; }
.rq-len { margin-left: auto; font-family: var(--f-en); font-size: 12px; color: var(--c-text-3); }
.rq-mic { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--c-line); border-radius: 50%; background: var(--c-surface); color: var(--c-text-sub); cursor: pointer; flex: none; }
.rq-mic:hover { color: var(--c-text); border-color: var(--c-text-3); }
.rq-mic.is-on { color: var(--c-text); border-color: var(--c-text); }
.rq-mic.is-on::after { content: ""; position: absolute; inset: -5px; border: 1px solid var(--c-text-3); border-radius: 50%; animation: rq-pulse 1.4s ease-in-out infinite; }
@keyframes rq-pulse { 0% { opacity: .9; transform: scale(.92); } 100% { opacity: 0; transform: scale(1.18); } }
.rq-listening { font-size: 12px; font-weight: 700; color: var(--c-text-sub); }
.rq-listening[hidden] { display: none; }
.rq-send {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; margin-left: auto; padding: 0 18px 0 22px; flex: none; cursor: pointer;
  border: 1.5px solid var(--c-text); border-radius: var(--r-pill, 999px); background: var(--c-surface); color: var(--c-text);
  font-family: var(--f); font-size: 14px; font-weight: 700; letter-spacing: 0.06em; transition: box-shadow .2s ease, color .2s ease, border-color .2s ease;
}
.rq-send:not(:disabled):hover { box-shadow: var(--e1); }
.rq-send.is-sent, .rq-send.is-sent:disabled { color: var(--c-text); border-color: var(--c-text); cursor: default; }
.rq-send.is-sent .rq-ic { display: none; }
.rq-len:not(:empty) + .rq-send { margin-left: 0; }
.rq-send:disabled { color: var(--c-text-3); border-color: var(--c-line); cursor: not-allowed; }

/* 添える画像（入力欄の下の小さい見本）と、送った要望・CS の一覧の画像 */
.rq-clip:disabled { color: var(--c-text-3); border-color: var(--c-line); cursor: not-allowed; }
.rq-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.rq-thumbs[hidden] { display: none; }
.rq-thumb { position: relative; display: block; width: 64px; height: 64px; border-radius: var(--r-s); background: var(--c-bg); box-shadow: var(--e1); }
.rq-thumb img { width: 100%; height: 100%; object-fit: contain; border-radius: var(--r-s); display: block; }
.rq-thumb-x { position: absolute; top: -6px; right: -6px; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border: 1px solid var(--c-line); border-radius: 50%; background: var(--c-surface); color: var(--c-text-sub); cursor: pointer; }
.rq-thumb-x .rq-ic { width: 12px; height: 12px; }
.rq-thumb-x:hover { color: var(--c-text); }
.rq-compose.is-drop { outline: 1px dashed var(--c-text-3); outline-offset: -6px; }
.rq-shots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.rq-shot { display: block; width: 96px; height: 72px; border-radius: var(--r-s); overflow: hidden; background: var(--c-bg); box-shadow: var(--e1); }
.rq-shot img { width: 100%; height: 100%; object-fit: contain; display: block; }
.rq-admin-row .rq-shots { margin-top: 0; }
.rq-admin-row .rq-shot { width: 160px; height: 110px; }

/* CS の「開発の要望」 */
.rq-chips { margin: 18px 0 6px; }
.rq-admin-list { display: flex; flex-direction: column; }
.rq-admin-row { padding: 18px 0; border-top: 1px solid var(--c-line-soft); display: flex; flex-direction: column; gap: 8px; }
.rq-admin-row:first-child { border-top: 0; }
.rq-admin-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; }
.rq-admin-no { font-family: var(--f-en); font-weight: 800; color: var(--c-text); }
.rq-admin-tg { font-weight: 700; color: var(--c-text-sub); }
.rq-admin-by { color: var(--c-text-3); font-weight: 700; }
.rq-admin-row .rq-when { margin-left: auto; }
.rq-admin-page { align-self: flex-start; margin: 0; font-family: var(--f-mono); font-size: 12px; color: var(--c-text-3); overflow-wrap: anywhere; }
.rq-admin-page:hover { color: var(--c-text); }
.rq-admin-edit { display: grid; grid-template-columns: 140px 1fr auto; gap: 14px; align-items: end; }
.rq-reply { min-height: 44px; padding: 10px 12px; font-size: 13px; line-height: 1.7; }

@media (max-width: 767px) {
  .rq-fab { right: 16px; bottom: 16px; width: 52px; height: 52px; }
  .rq-panel { right: 16px; left: 16px; bottom: 80px; width: auto; max-width: none; height: calc(100vh - 110px); height: calc(100dvh - 110px); }
  /* iPhone は 16px 未満の入力欄を押すと画面を拡大する。拡大させないよう 16px にする */
  .rq-ta, .rq-selects .input, .rq-reply { font-size: 16px; }
  .rq-admin-edit { grid-template-columns: 1fr; }
}
/* 1023px 以下で下に貼り付く操作の帯（.ui-actionbar。body に .has-actionbar）があるときは、帯の上に逃がす */
@media (max-width: 1023px) {
  body.has-actionbar .rq-fab { bottom: calc(var(--actionbar-h, 64px) + env(safe-area-inset-bottom, 0px) + 16px); }
  body.has-actionbar .rq-panel { top: 16px; bottom: calc(var(--actionbar-h, 64px) + env(safe-area-inset-bottom, 0px) + 84px); height: auto; }
}
@media (prefers-reduced-motion: reduce) { .rq-mic.is-on::after, .rq-item.is-fresh, .rq-dots i { animation: none; } }
