/* SIC support assistant (bottom right on SIC FORM / DOWNLOAD CENTER / MY PAGE).
   Matches the platform pages: black base, cyan / gold accents. Everything is scoped under .sa-root. */
.sa-root {
  --sa-bg: #080D12; --sa-surface: #0F1820; --sa-line: #22323D; --sa-text: #F5F8FA; --sa-text2: #A8BAC5;
  --sa-cyan: #00D5EB; --sa-gold: linear-gradient(180deg, #F6E3AE 0%, #D4AF62 52%, #AE8840 100%);
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 2147483000; display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
  font-family: var(--stl-font, 'Orbitron', 'Noto Sans JP', system-ui, sans-serif); color: var(--sa-text);
}
.sa-root[hidden], .sa-root [hidden] { display: none !important; }
/* Not before the page itself: a lone launcher on an empty screen made every page change flicker.
   Hidden while the page is still loading, then shown a moment after the page has painted. */
.sa-root { transition: opacity .25s ease .35s, visibility 0s linear .35s; }
body:has(.boot-wait) .sa-root, body:not(:has(#stl)):not(:has(#dc-root .stl-page)) .sa-root { visibility: hidden; opacity: 0; transition: none; }
@media (prefers-reduced-motion: reduce) { .sa-root { transition: none; } }
.sa-root.sa-above-bar { bottom: calc(96px + env(safe-area-inset-bottom)); }
/* Updated from the real .compose bounding box by assistant.js, never a height guess. */
.sa-root.sa-composer-anchor { bottom: calc(var(--sa-composer-clearance) + env(safe-area-inset-bottom)); }
.sa-root.sa-anchor-left { right: auto; left: max(16px, env(safe-area-inset-left)); }
.sa-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 50px; height: 50px; padding: 5px; border-radius: 50%; cursor: pointer;
  background: rgba(8,13,18,.96); border: 1px solid rgba(212,175,98,.58); color: var(--sa-text); font-weight: 700; font-size: 14px; font-family: inherit;
  box-shadow: 0 10px 28px rgba(0,0,0,.5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease; }
.sa-btn-lb { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.sa-btn:hover { border-color: #FF5A6E; background: linear-gradient(135deg, rgba(114,20,32,.98), rgba(43,12,19,.98)); box-shadow: 0 12px 30px rgba(255,90,110,.28); }
.sa-btn:active { transform: translateY(1px) scale(.98); border-color: #FF7A88; background: linear-gradient(135deg, #9B2638, #57111D); box-shadow: 0 5px 16px rgba(255,90,110,.34); }
.sa-btn:focus-visible, .sa-send:focus-visible, .sa-hint:focus-visible, .sa-close:focus-visible { outline: 2px solid var(--sa-cyan); outline-offset: 2px; }
.sa-btn-ic { width: 38px; height: 38px; border-radius: 50%; background: var(--sa-gold); display: inline-flex; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5); }
/* The shared artwork keeps its original composition; only the display windows differ. */
.sa-btn-ic { position: relative; padding: 2px; overflow: hidden; }
.sa-btn-ic img { position: absolute; left: -20%; top: -84%; width: 300%; height: 300%; max-width: none; border-radius: 0; object-fit: cover; display: block; }
.sa-hero-frame { width: 100%; aspect-ratio: 5 / 3; overflow: hidden; border-radius: 12px; flex: none; }
.sa-hero { display: block; width: 100%; height: 100%; object-fit: cover; }
.sa-dot { position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--sa-cyan); box-shadow: 0 0 8px rgba(0,213,235,.8); }
.sa-panel { width: 370px; max-width: calc(100vw - 32px); height: min(560px, calc(100dvh - 140px)); display: flex; flex-direction: column;
  background: var(--sa-bg); border: 1px solid rgba(212,175,98,.45); border-radius: 18px; overflow: hidden; box-shadow: 0 18px 50px rgba(0,0,0,.55); }
.sa-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--sa-line); background: var(--sa-surface); }
.sa-title { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 15px; }
.sa-badge { font-family: 'Orbitron', sans-serif; font-size: 10px; letter-spacing: .12em; color: var(--sa-cyan); border: 1px solid rgba(0,213,235,.5); border-radius: 999px; padding: 1px 7px; }
.sa-link { background: none; border: 0; color: var(--sa-text2); font-size: 12px; cursor: pointer; font-family: inherit; }
.sa-close { background: none; border: 1px solid var(--sa-line); color: var(--sa-text); width: 32px; height: 32px; border-radius: 8px; font-size: 18px; cursor: pointer; }
.sa-list { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.sa-msg { max-width: 90%; padding: 10px 14px; border-radius: 14px; font-size: 15px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.sa-assistant { align-self: flex-start; background: var(--sa-surface); border: 1px solid var(--sa-line); border-top-left-radius: 4px; }
.sa-user { align-self: flex-end; background: rgba(0,213,235,.12); border: 1px solid rgba(0,213,235,.35); border-top-right-radius: 4px; }
.sa-intro { font-size: 13px; color: var(--sa-text2); }
.sa-mode-note, .sa-mode-ai { margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--sa-line); font-size: 12px; white-space: normal; }
.sa-mode-note { color: #FFD166; }
.sa-mode-ai { color: #71E0B8; }
.sa-error { border-color: rgba(255,90,110,.5); color: #FFB3BD; }
.sa-orb { font-family: 'Orbitron', sans-serif; letter-spacing: .12em; }
.sa-name { color: #F0D89A; }
.sa-src { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--sa-line); white-space: normal; }
.sa-src-h { font-size: 11px; color: var(--sa-cyan); margin-bottom: 2px; }
.sa-src-i { font-size: 13px; color: var(--sa-text); }
.sa-act { display: inline-block; margin-top: 10px; padding: 8px 16px; border-radius: 10px; background: var(--sa-gold); color: #1A1307; font-weight: 700; font-size: 13px; text-decoration: none; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5); }
.sa-act:focus-visible { outline: 2px solid var(--sa-cyan); outline-offset: 2px; }
.sa-meta { margin-top: 8px; font-size: 11px; color: rgba(0,213,235,.75); white-space: normal; }
.sa-typing { color: var(--sa-text2); letter-spacing: .3em; }
.sa-hints { display: flex; flex-wrap: wrap; gap: 6px; }
.sa-hint { background: transparent; border: 1px solid rgba(0,213,235,.45); color: #56EAF5; border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; font-family: inherit; }
.sa-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px; border-top: 1px solid var(--sa-line); background: var(--sa-surface); }
.sa-input { flex: 1; min-width: 0; resize: none; background: #0B141B; color: var(--sa-text); border: 1px solid #2C404D; border-radius: 12px; padding: 11px 12px; font: inherit; font-size: 15px; line-height: 1.5; min-height: 46px; max-height: 120px; }
.sa-input:focus { border-color: var(--sa-cyan); outline: none; }
.sa-send { border: 0; border-radius: 12px; padding: 0 18px; height: 46px; font-weight: 700; font-family: inherit; cursor: pointer; background: var(--sa-gold); color: #1A1307; }
.sa-send[disabled] { opacity: .5; cursor: progress; }
.sa-send.sa-empty { background: #1C2A34; color: var(--sa-text2); box-shadow: none; }
.sa-foot { font-size: 11px; color: var(--sa-text2); padding: 6px 12px 10px; background: var(--sa-surface); }
@media (max-width: 760px) {
  /* Fallback only; .sa-composer-anchor uses the live composer position when it exists. */
  .sa-root { bottom: calc(var(--nav-h, 64px) + 20px + env(safe-area-inset-bottom)); }
  .sa-btn { width: 48px; height: 48px; padding: 5px; }
  .sa-btn-ic { width: 36px; height: 36px; }
  .sa-root.sa-open { left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); }
  .sa-root.sa-open .sa-panel { width: 100%; max-width: 100%; height: min(80dvh, 640px); border-radius: 18px; }
}
@media (prefers-reduced-motion: no-preference) { .sa-panel { animation: sa-in .16s ease-out; } @keyframes sa-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } } }

/* Phones: the open chat sheet spans the screen width. */
@media (max-width: 760px) {
  .sa-root.sa-open { left: 8px; right: 8px; }
  .sa-root.sa-open .sa-panel { max-height: none; }
}

/* Floating launcher: the "SICbotに質問" banner, compact and draggable (owner instruction 2026-10-27). */
.sa-root .sa-btn.sa-banner { width: 140px; height: auto; aspect-ratio: 2 / 1; padding: 0; border-radius: 16px; overflow: hidden;
  border: 1.5px solid rgba(212,175,98,.85); background: #05090D; box-shadow: 0 10px 26px rgba(0,0,0,.55); }
.sa-root .sa-btn.sa-banner .sa-banner-img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 47%; border-radius: 0; }
.sa-root .sa-btn.sa-banner:hover, .sa-root .sa-btn.sa-banner:focus-visible { transform: translateY(-2px); background: #05090D; border-color: #F0D89A;
  box-shadow: 0 14px 30px rgba(0,0,0,.6), 0 0 18px rgba(212,175,98,.4); }
.sa-root .sa-btn.sa-banner:active { transform: translateY(0) scale(.98); background: #05090D; }
@media (max-width: 760px) { .sa-root .sa-btn.sa-banner { width: 110px; height: auto; padding: 0; } }
/* Dragging: the member moves the launcher; it no longer follows the composer or the FORM summary bar. */
.sa-root .sa-btn.sa-banner { touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.sa-root .sa-btn.sa-banner .sa-banner-img { pointer-events: none; -webkit-user-drag: none; }
.sa-root.sa-dragging .sa-btn.sa-banner { cursor: grabbing; transform: scale(1.04); transition: none; }
.sa-root.sa-dragging { transition: none; }
/* Phones: leave room at the end of each page so the floating banner never hides the last content. */
@media (max-width: 760px) {
  html[data-sicbot="on"] .user .main { padding-bottom: calc(var(--nav-h, 64px) + 116px + env(safe-area-inset-bottom)) !important; }
  html[data-sicbot="on"] .stl-platform-member .stl-platform-content { padding-bottom: calc(var(--stl-nav-height, 72px) + 116px + env(safe-area-inset-bottom)) !important; }
}
/* Members without their own AI key: what it adds and where to set it. */
.sa-keyhint { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--sa-line); font-size: 13px; color: #F0D89A; white-space: normal; }
