/* --- FFJ: Rounded action bar buttons (Copy + Email) --- */
.cgpt-ffj-action-bar .cgpt-ffj-btn {
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #111827;
  padding: 6px 12px;
  font-size: 13px;
  line-height: 1.2;
}
.cgpt-ffj-action-bar {
  display: flex;
  gap: 8px;
}
/* Admin Assistants Tab Enhancements */
.cgpt-assist-list {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.cgpt-assist-card {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  padding: 18px 18px 12px 18px;
  margin-bottom: 0;
  min-width: 320px;
  max-width: 420px;
  flex: 1 1 340px;
  position: relative;
  transition: box-shadow 0.2s, border 0.2s;
}
.cgpt-assist-card:hover {
  box-shadow: 0 4px 18px rgba(13,110,253,0.10);
  border-color: #0d6efd;
}
.cgpt-assist-card label {
  font-size: 13px;
  color: #222;
  margin-right: 10px;
  margin-bottom: 6px;
  display: inline-block;
}
.cgpt-assist-card input[type="text"],
.cgpt-assist-card input[type="number"],
.cgpt-assist-card textarea {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
  margin-right: 8px;
  margin-bottom: 4px;
  background: #f9fafb;
  width: auto;
  max-width: 100%;
}
.cgpt-assist-card textarea {
  min-height: 38px;
  resize: vertical;
}
.cgpt-assist-card .button {
  font-size: 13px;
  border-radius: 6px;
  padding: 4px 14px;
  margin-top: 6px;
  margin-right: 4px;
  background: #f3f4f6;
  color: #dc2626;
  border: 1px solid #dc2626;
  transition: background 0.2s, color 0.2s;
}
.cgpt-assist-card .button:hover {
  background: #fee2e2;
}
.cgpt-assist-card .as-short {
  background: #f3f4f6;
  color: #0d6efd;
  border: none;
  font-weight: 600;
}
.cgpt-assist-card .as-short:focus {
  outline: 1.5px solid #0d6efd;
}
#cgpt-add-assistant {
  margin-top: 10px;
  font-size: 14px;
  border-radius: 8px;
  background: #0d6efd;
  color: #fff;
  border: none;
  padding: 8px 22px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(13,110,253,0.08);
  transition: background 0.2s;
}
#cgpt-add-assistant:hover {
  background: #0b5ed7;
}
@media (max-width: 700px) {
  .cgpt-assist-list { flex-direction: column; gap: 10px; }
  .cgpt-assist-card { min-width: 0; max-width: 100%; }
}
/* Admin Data Table Enhancements */
.cgpt-admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  overflow: hidden;
  margin-bottom: 18px;
}
.cgpt-admin-table th, .cgpt-admin-table td {
  padding: 10px 12px;
  font-size: 14px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}
.cgpt-admin-table th {
  background: #f3f4f6;
  position: sticky;
  top: 0;
  z-index: 2;
  font-weight: 600;
  color: #222;
  box-shadow: 0 2px 0 #e5e7eb;
}
.cgpt-admin-table tr:nth-child(even) {
  background: #f9fafb;
}
.cgpt-admin-table tr:hover {
  background: #e6f4ff;
  transition: background 0.2s;
}
.cgpt-admin-table .cgpt-query-row.selected {
  background: #dbeafe !important;
}
.cgpt-admin-table input[type="checkbox"] {
  transform: scale(1.2);
  accent-color: var(--ffj-accent, #0d6efd);
}
.cgpt-admin-table .cgpt-edit-query, .cgpt-admin-table .cgpt-save-query, .cgpt-admin-table .cgpt-cancel-query {
  font-size: 13px;
  border-radius: 6px;
  padding: 4px 12px;
  margin-right: 4px;
  transition: background 0.2s, color 0.2s;
}
.cgpt-admin-table .cgpt-edit-query {
  background: #f3f4f6;
  color: #0d6efd;
  border: 1px solid #0d6efd;
}
.cgpt-admin-table .cgpt-edit-query:hover {
  background: #e6f4ff;
}
.cgpt-admin-table .cgpt-save-query {
  background: #0d6efd;
  color: #fff;
  border: none;
}
.cgpt-admin-table .cgpt-save-query:hover {
  background: #0b5ed7;
}
.cgpt-admin-table .cgpt-cancel-query {
  background: #f3f4f6;
  color: #dc2626;
  border: 1px solid #dc2626;
}
.cgpt-admin-table .cgpt-cancel-query:hover {
  background: #fee2e2;
}
.cgpt-admin-table .cgpt-query-details {
  background: #f8fafc !important;
}
.cgpt-admin-table textarea {
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  font-size: 13px;
  padding: 6px 8px;
  width: 100%;
  box-sizing: border-box;
}
.cgpt-admin-table .cgpt-save-status {
  font-size: 12px;
  color: #555;
  margin-left: 8px;
}
/*
 * ChatGPT Messenger FFJ – Frontend Stylesheet
 * Chat container, message bubbles, quota pills, responsive layout.
 * Version: 9.0
 * Author: Pierre RICHE and GPT 5
 * Date: 2025-08-09
 */
.cgpt-ffj-chatbox{
  --ffj-bg:#fff; --ffj-border:#e5e7eb; --ffj-muted:#6b7280; --ffj-shadow:0 2px 8px rgba(0,0,0,.06);
  --ffj-accent:#0d6efd; --ffj-accent-hover:#0b5ed7; --ffj-user:#e6f4ff; --ffj-assistant:#f3f4f6;
  --ffj-warn:#d97706; --ffj-danger:#dc2626;
  width:100%; background:var(--ffj-bg); border:1px solid var(--ffj-border);
  border-radius:10px; box-shadow:var(--ffj-shadow); display:flex; flex-direction:column; overflow:hidden;
  max-height:85vh;
}

.cgpt-ffj-messages{ flex:1 1 auto; min-height:220px; overflow:auto; padding:12px; background:#fafafa; -webkit-overflow-scrolling:touch; overscroll-behavior:auto }
.cgpt-ffj-messages::-webkit-scrollbar{ width:8px }
.cgpt-ffj-messages::-webkit-scrollbar-thumb{ background:rgba(0,0,0,.15); border-radius:4px }

.cgpt-ffj-message{ padding:10px 12px; border-radius:8px; margin:6px 0; line-height:1.5; font-size:14px; box-sizing:border-box; max-width:90%; width:fit-content; width:-moz-fit-content; word-break:break-word; overflow-wrap:anywhere; }
/* User bubble: right aligned, shrink-to-content until max-width (90% container) */
.cgpt-ffj-message.user{
  background:var(--ffj-user); color:#111; margin-left:auto; text-align:right; width:fit-content; width:-moz-fit-content;
}
/* Assistant bubble: left aligned shrink-to-content */
.cgpt-ffj-message.assistant{ background:var(--ffj-assistant); color:#222; margin-right:auto; text-align:left; width:fit-content; width:-moz-fit-content; }
/* Right alignment helper for assistant bubbles (used for FR→JA in audio mode) */
.cgpt-ffj-message.assistant.cgpt-ffj-align-right{ margin-left:auto; margin-right:0; text-align:right; }
/* Audio direction-aware bubble accents */
.cgpt-ffj-message.assistant.cgpt-ffj-bubble-green{ background: #d1fae5; }
.cgpt-ffj-message.assistant.cgpt-ffj-bubble-blue{ background: var(--ffj-user); }
/* Realtime blue bubbles (JA output for FR→JA) are rotated 180° for across-the-table readability */
.cgpt-ffj-message.assistant.cgpt-ffj-rt-msg.cgpt-ffj-bubble-blue .cgpt-ffj-bubbletext{
  transform: rotate(180deg);
  transform-origin: center;
}
/* Keep meta/debug blocks unrotated */
.cgpt-ffj-message.assistant.cgpt-ffj-rt-msg .cgpt-ffj-meta,
.cgpt-ffj-message.assistant.cgpt-ffj-rt-msg .cgpt-ffj-admin-debug{ transform: none; }
/* Ensure very short one-word messages aren't too tiny */
.cgpt-ffj-message.user span, .cgpt-ffj-message.assistant span{ display:inline }
/* Safari fallback (fit-content issues): allow flex growth when streaming */
.cgpt-ffj-streaming .cgpt-ffj-message{ width:auto; }

.cgpt-ffj-meta {
  font-size: 12px;
  color: #888;
  margin-bottom: 2px;
}
.cgpt-ffj-meta strong {
  color: #222;
}
.cgpt-ffj-bubbletext {
  font-size: 14px;
  color: inherit;
  white-space: normal; /* rely on renderer to add <br> where needed */
  overflow-wrap: anywhere; /* keep long URLs/words from overflowing */
}
/* Audio mode: make the target transcript (line 1) much larger */
.cgpt-ffj-bubbletext .cgpt-ffj-target-primary{
  display:inline-block;
  font-size: 24px;
  line-height: 1.55;
  font-weight: 700;
}
/* Markdown formatting inside assistant bubble */
.cgpt-ffj-message.assistant .cgpt-ffj-bubbletext h1,
.cgpt-ffj-message.assistant .cgpt-ffj-bubbletext h2,
.cgpt-ffj-message.assistant .cgpt-ffj-bubbletext h3,
.cgpt-ffj-message.assistant .cgpt-ffj-bubbletext h4,
.cgpt-ffj-message.assistant .cgpt-ffj-bubbletext h5,
.cgpt-ffj-message.assistant .cgpt-ffj-bubbletext h6 { margin: 8px 0 6px; font-weight: 700; line-height:1.25; }
.cgpt-ffj-message.assistant .cgpt-ffj-bubbletext h1 { font-size: 1.25rem; }
.cgpt-ffj-message.assistant .cgpt-ffj-bubbletext h2 { font-size: 1.15rem; }
.cgpt-ffj-message.assistant .cgpt-ffj-bubbletext h3 { font-size: 1.08rem; }
.cgpt-ffj-message.assistant .cgpt-ffj-bubbletext ul,
.cgpt-ffj-message.assistant .cgpt-ffj-bubbletext ol { margin:6px 0 6px 18px; padding:0; }
.cgpt-ffj-message.assistant .cgpt-ffj-bubbletext li { margin: 2px 0; }
.cgpt-ffj-message.assistant .cgpt-ffj-bubbletext blockquote { margin:6px 0; padding:6px 8px; border-left:3px solid #cbd5e1; background:#f8fafc; color:#334155; border-radius:4px; }
.cgpt-ffj-message.assistant .cgpt-ffj-bubbletext hr { border:none; border-top:1px solid #e5e7eb; margin:8px 0; }
.cgpt-ffj-message.assistant .cgpt-ffj-bubbletext code { background:#1118270d; padding:0 3px; border-radius:4px; font-family: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; font-size: 13px; }
.cgpt-ffj-message.assistant .cgpt-ffj-bubbletext pre.cgpt-ffj-code { background:#0b1220; color:#e5e7eb; padding:10px; border-radius:8px; overflow:auto; line-height:1.4; }
.cgpt-ffj-message.assistant .cgpt-ffj-bubbletext pre.cgpt-ffj-code code { background:transparent; padding:0; font-size:12.5px; }

/* ---------------------------------------------
 * Access / Quota / Disclaimer Overlays (v9.0)
 * ------------------------------------------- */
.cgpt-ffj-access-overlay{position:fixed;inset:0;z-index:9999;background:rgba(0,0,0,0.55);display:flex;align-items:center;justify-content:center;padding:18px;}
.cgpt-ffj-access-dialog{background:#fff;width:100%;max-width:560px;padding:28px 26px 24px;border-radius:16px;box-shadow:0 10px 48px rgba(0,0,0,0.32);font-size:14px;line-height:1.55;}
.cgpt-ffj-access-dialog h2{margin:0 0 16px;font-size:22px;line-height:1.2;}
.cgpt-ffj-access-dialog.cgpt-ffj-small h2{font-size:21px;margin-bottom:14px;}
.cgpt-ffj-access-actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap;}
.cgpt-ffj-access-btn, .cgpt-ffj-access-close, .cgpt-ffj-access-primary{appearance:none;border:1px solid #2271b1;background:#2271b1;color:#fff;padding:9px 18px;border-radius:8px;cursor:pointer;font-size:13px;text-decoration:none;display:inline-block;}
.cgpt-ffj-access-btn-dark{background:#111827;border-color:#111827;color:#fff;}
.cgpt-ffj-access-close{background:#e2e8f0;border:1px solid #cbd5e1;color:#111827;}
.cgpt-ffj-access-close:hover{background:#cfd8e3;}
.cgpt-ffj-access-btn:hover{background:#1d5f94;}
.cgpt-ffj-access-btn-dark:hover{background:#1f2937;}
.cgpt-ffj-no-access-body,.cgpt-ffj-quota-body,.cgpt-ffj-quota-extra{max-height:50vh;overflow:auto;}
.cgpt-ffj-quota-extra{margin:0 0 18px;}
/* Tables inside assistant messages */
.cgpt-ffj-message.assistant .cgpt-ffj-bubbletext .cgpt-ffj-table-wrap{ width:100%; overflow:auto; margin:8px 0; }
.cgpt-ffj-message.assistant .cgpt-ffj-bubbletext table.cgpt-ffj-table{ width:100%; border-collapse: collapse; border-spacing:0; font-size:14px; }
.cgpt-ffj-message.assistant .cgpt-ffj-bubbletext table.cgpt-ffj-table thead th{ position:sticky; top:0; background:#f3f4f6; color:#111; font-weight:700; border-bottom:1px solid #e5e7eb; padding:6px 8px; }
.cgpt-ffj-message.assistant .cgpt-ffj-bubbletext table.cgpt-ffj-table td{ padding:6px 8px; border-bottom:1px solid #e5e7eb; }
.cgpt-ffj-message.assistant .cgpt-ffj-bubbletext table.cgpt-ffj-table tr:nth-child(even) td{ background:#f9fafb; }
.cgpt-ffj-message.assistant .cgpt-ffj-bubbletext table.cgpt-ffj-table th, 
.cgpt-ffj-message.assistant .cgpt-ffj-bubbletext table.cgpt-ffj-table td{ vertical-align:top; }
/* Chatbox height is constrained via .cgpt-ffj-chatbox { max-height } and messages pane scrolls */
/* Zone sous le prompt pour quotas */
.cgpt-ffj-remaining{ color:#111827; font-size:12px; padding:6px 12px; display:block; flex-shrink:0 }
.cgpt-ffj-remaining .label{ color:var(--ffj-muted); margin-right:6px }
.cgpt-ffj-remaining .pill{
  display:inline-block; border:1px solid #e5e7eb; border-radius:999px; padding:2px 8px; margin-right:6px
}
.cgpt-ffj-remaining .pill.warn{ border-color:var(--ffj-warn); color:var(--ffj-warn) }
.cgpt-ffj-remaining .pill.danger{ border-color:var(--ffj-danger); color:var(--ffj-danger) }

.cgpt-ffj-inputrow{ display:flex; gap:8px; align-items:flex-end; padding:10px; border-top:1px solid var(--ffj-border); background:#fff; flex-shrink:0 }
.cgpt-ffj-input{ flex:1; min-height:44px; max-height:160px; padding:10px 12px; border:1px solid var(--ffj-border); border-radius:8px; resize:vertical; font-size:14px }
/* Actions column with Speak + Send stacked; keeps equal width between buttons */
.cgpt-ffj-actionscol{ display:flex; flex-direction:column; gap:6px; align-items:stretch; }
.cgpt-ffj-actionscol > .cgpt-ffj-send,
.cgpt-ffj-actionscol > .cgpt-ffj-speak{ width: 180px; }
@media (max-width:540px){ .cgpt-ffj-actionscol > .cgpt-ffj-send, .cgpt-ffj-actionscol > .cgpt-ffj-speak{ width: 150px; } }
/* Speak button base and states */
.cgpt-ffj-speak{ white-space:nowrap; height:40px; padding:0 14px; border-radius:8px; font-weight:700; cursor:pointer; transition:filter .15s ease, background .2s ease, box-shadow .2s ease; border:none; box-shadow:0 2px 4px rgba(0,0,0,0.15); background:#10b981; color:#fff; }
.cgpt-ffj-speak:hover{ filter:brightness(0.98); }
.cgpt-ffj-speak[data-state="idle"]{ background:#10b981; }
.cgpt-ffj-speak[data-state="prepping"]{ background:#f59e0b; }
.cgpt-ffj-speak[data-state="recording"]{ background:#ef4444; }
.cgpt-ffj-speak[disabled]{ opacity:.6; cursor:not-allowed; }
/* Mode buttons (Texte/Image/Audio) */
.cgpt-ffj-mode-buttons{display:inline-flex;gap:6px;vertical-align:middle;}
/* Responsive wrap for mode buttons */
.cgpt-ffj-modewrap{display:flex;flex-wrap:wrap;gap:8px;align-items:center;}
.cgpt-ffj-mode-buttons{flex-wrap:wrap;row-gap:6px;}
.cgpt-ffj-mode-btn{background:#f1f5f9;color:#334155;border:1px solid #d0d7e2;padding:6px 14px;font-size:13px;line-height:1.2;border-radius:8px;cursor:pointer;font-weight:500;transition:background .18s,border-color .18s,color .18s,box-shadow .18s;box-shadow:0 1px 2px rgba(0,0,0,.05);}
.cgpt-ffj-mode-btn:hover{background:#e2e8f0;border-color:#c1c9d4;}
.cgpt-ffj-mode-btn.active{background:var(--ffj-accent-mode,var(--ffj-accent,#0d6efd));border-color:var(--ffj-accent-mode,var(--ffj-accent,#0d6efd));color:#fff;box-shadow:0 2px 4px rgba(0,0,0,.12);} 

/* Mode-specific accent colors on the chatbox container */
.cgpt-ffj-chatbox[data-ui-mode="text"]{ --ffj-accent-mode: #2563eb; } /* blue */
.cgpt-ffj-chatbox[data-ui-mode="image"]{ --ffj-accent-mode: #10b981; } /* green */
.cgpt-ffj-chatbox[data-ui-mode="audio"]{ --ffj-accent-mode: #f59e0b; } /* orange for traduction */
.cgpt-ffj-chatbox[data-ui-mode="audio_rt"]{ --ffj-accent-mode: #f59e0b; } /* orange for conversation */
.cgpt-ffj-mode-btn:focus{outline:2px solid var(--ffj-accent,#0d6efd);outline-offset:2px;}
.cgpt-ffj-send{ white-space:nowrap; height:40px; padding:0 14px; border-radius:8px; font-weight:600; cursor:pointer; transition:transform .05s ease, background .2s ease, box-shadow .2s ease; background:var(--ffj-accent, #0d6efd); color:#fff; border:none; box-shadow:0 2px 4px rgba(0,0,0,0.15); }
.cgpt-ffj-send:hover{ background:var(--ffj-accent-hover,#0b5ed7); }
.cgpt-ffj-send:active{ transform:translateY(1px) }
.cgpt-ffj-send[disabled], .cgpt-ffj-input[disabled]{ opacity:.6; cursor:not-allowed }

/* Feedback thumbs */
.cgpt-ffj-feedback{ margin-top:6px; display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.cgpt-ffj-feedback-prompt{ font-size:12px; color:#555; margin-right:4px; }
.cgpt-ffj-thumb{ background:#f1f5f9; border:1px solid #d1d5db; padding:4px 10px; border-radius:6px; cursor:pointer; font-size:14px; line-height:1; }
.cgpt-ffj-thumb.cgpt-ffj-up.active{ background:#16a34a; border-color:#15803d; color:#fff; }
.cgpt-ffj-thumb.cgpt-ffj-down.active{ background:#dc2626; border-color:#b91c1c; color:#fff; }
.cgpt-ffj-thumb:hover{ background:#e2e8f0; }

/* Survey (thumbs-down) modal */
#cgpt-ffj-survey-overlay.cgpt-ffj-survey-overlay{position:fixed;inset:0;z-index:99999;background:rgba(0,0,0,0.5);display:none;align-items:center;justify-content:center;padding:16px;}
#cgpt-ffj-survey-overlay.cgpt-ffj-open{display:flex;}
.cgpt-ffj-survey-dialog{background:#fff;color:#222;border-radius:8px;max-width:480px;width:100%;box-shadow:0 4px 18px rgba(0,0,0,0.25);font-size:14px;line-height:1.4;}
.cgpt-ffj-survey-header{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid #ddd;font-weight:600;}
.cgpt-ffj-survey-header button{background:none;border:none;font-size:18px;cursor:pointer;line-height:1;color:#666;}
.cgpt-ffj-survey-header button:hover{color:#000;}
.cgpt-ffj-survey-form{padding:14px;}
.cgpt-ffj-survey-reasons label{cursor:pointer;}
.cgpt-ffj-survey-reasons input{margin-right:6px;}
.cgpt-ffj-survey-notes textarea{width:100%;resize:vertical;margin-top:10px;font-size:13px;}
.cgpt-ffj-survey-actions{margin-top:14px;display:flex;gap:8px;}
.cgpt-ffj-survey-actions .button{cursor:pointer;}
.cgpt-ffj-survey-reasons.cgpt-ffj-missing{animation:cgptPulse 0.4s linear 0s 3;outline:2px solid #dc2626;outline-offset:2px;border-radius:4px;padding:4px;background:#fff5f5;}
@keyframes cgptPulse{0%,100%{outline-color:#dc2626;}50%{outline-color:#fca5a5;}}

/* Blinking cursor for thinking message */
.cgpt-ffj-thinking-inline{display:inline-block;position:relative;}
.cgpt-ffj-thinking-inline .cgpt-ffj-cursor{display:inline-block;width:7px;margin-left:4px;border-right:2px solid #555;animation:cgptBlink 0.9s steps(2,start) infinite;height:1em;vertical-align:baseline;}
@keyframes cgptBlink{0%,49%{border-color:#555;}50%,100%{border-color:transparent;}}
/* Streaming reveal fade-in for each chunk (optional subtle) */
.cgpt-ffj-streaming .cgpt-ffj-bubbletext{min-height:1em;}
/* Audio button group */
.cgpt-ffj-audios .cgpt-ffj-audio-btn:hover{ background:#e5e7eb; }
/* Speak buttons (JA top / FR bottom) consistent sizing & centering */
.cgpt-ffj-audiorow, .cgpt-ffj-audiorow-top{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; width:100%; flex:0 0 auto; }
.cgpt-ffj-audiorow{ padding:12px; border-top:1px solid var(--ffj-border); background:#fff; min-height:70px; box-sizing:border-box; }
.cgpt-ffj-chatbox > .cgpt-ffj-audiorow{ display:flex !important; }
.cgpt-ffj-audiorow-top{ width:100%; }
.cgpt-ffj-audiorow-rt, .cgpt-ffj-audiorow-top-rt{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; width:100%; flex:0 0 auto; }
.cgpt-ffj-audiorow-rt{ padding:12px; border-top:1px solid var(--ffj-border); background:#fff; min-height:70px; box-sizing:border-box; }

/* (2025-09) Debug outline for audio rows when debug flag set */
body[data-cgptffj-debug="1"] .cgpt-ffj-audiorow,
/* Forced repair clone (zero-size mitigation) */
.cgpt-ffj-force-pos{ position:relative; z-index:10; }
.cgpt-ffj-audio-btn{ appearance:none; border:none; border-radius:12px; padding:16px 20px; background:#10b981; color:#fff; font-weight:700; cursor:pointer; font-size:18px; display:block; width:min(680px,92%); margin:4px auto; text-align:center; box-shadow:0 2px 6px rgba(0,0,0,.08); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cgpt-ffj-audio-btn:hover{ filter:brightness(0.98); }
.cgpt-ffj-audio-btn[disabled]{ opacity:.65; cursor:not-allowed; }
/* Upside-down display for across-the-table readability (classic audio FR→JA target line only) */
.cgpt-ffj-bubbletext .cgpt-ffj-upside-down{
  display:inline-block;
  transform: rotate(180deg);
  transform-origin: center;
}
/* A−/A+ inline controls at the start of the first translation line */
.cgpt-ffj-font-controls{ display:inline-flex; gap:4px; margin-right:6px; vertical-align:baseline; }
.cgpt-ffj-font-controls button{ appearance:none; border:1px solid #cbd5e1; background:#f1f5f9; color:#334155; padding:0 6px; height:20px; border-radius:4px; font-size:12px; line-height:18px; cursor:pointer; }
.cgpt-ffj-font-controls button:hover{ background:#e2e8f0; }
/* Rotate utility for UI controls needing across-the-table readability */
.cgpt-ffj-rotate-180{ transform: rotate(180deg); }
/* Realtime instruction note (centered, matches button width) */
.cgpt-ffj-rt-note{ text-align:center; width:min(680px,92%); margin:0 auto 6px auto; }
/* Fullscreen top dock to host top speak buttons inside the chatbox */
.cgpt-ffj-fs-topdock{ width:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; padding:6px 10px; }
@media (max-width:640px){
  .cgpt-ffj-chatbox{ border-radius:8px; max-height:90vh }
  .cgpt-ffj-message{ font-size:13px }
}
