.q-widget{position:fixed;z-index:80;right:24px;bottom:24px;display:grid;justify-items:end;gap:10px;pointer-events:none}
.q-trigger{pointer-events:auto;display:inline-flex;align-items:center;gap:8px;border:0;border-radius:999px;padding:10px 15px;background:#10243b;color:#fff;box-shadow:0 12px 28px rgba(16,36,59,.2);cursor:pointer;font:600 14px/1.2 'Noto Sans TC',sans-serif}
.q-trigger-mark{display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:#f7c948;color:#10243b;font-weight:800}
.q-trigger-dot{width:7px;height:7px;border-radius:50%;background:#69c28f;box-shadow:0 0 0 3px rgba(105,194,143,.18)}
.q-panel{position:fixed;right:24px;bottom:84px;width:min(390px,calc(100vw - 48px));max-height:min(680px,calc(100vh - 110px));display:flex;flex-direction:column;overflow:auto;pointer-events:auto;border:1px solid rgba(16,36,59,.12);border-radius:22px;background:#fff;box-shadow:0 22px 60px rgba(16,36,59,.24);overscroll-behavior:contain}
.q-panel[hidden]{display:none}
.q-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:17px 18px 14px;background:#10243b;color:#fff}
.q-panel-head h2{margin:3px 0 2px;font-size:24px;line-height:1.1}.q-panel-head p{margin:0;color:rgba(255,255,255,.72);font-size:12px}.q-eyebrow{color:#f7c948;font-size:10px;letter-spacing:.12em}
.q-close{border:0;background:transparent;color:#fff;font-size:24px;line-height:1;cursor:pointer}.q-context{padding:9px 14px;background:#f3f7f8;color:#476176;font-size:12px}.q-messages{min-height:54px;padding:12px 14px;color:#24384a;font-size:13px;line-height:1.6}.q-suggestions{display:flex;flex-wrap:wrap;gap:6px;padding:0 14px 10px}.q-suggestions button,.q-escalate{border:1px solid #d5e0e7;border-radius:999px;background:#fff;color:#28455e;padding:7px 10px;font-size:12px;cursor:pointer}.q-form{display:flex;gap:7px;margin:0 14px 10px}.q-form input{min-width:0;flex:1;border:1px solid #cbd9e1;border-radius:10px;padding:9px 10px;font:inherit}.q-form button{border:0;border-radius:10px;padding:0 13px;background:#10243b;color:#fff;cursor:pointer}.q-escalate{align-self:flex-start;margin:0 14px 14px}

.q-model-stage{flex:0 0 220px}
@media(max-width:640px){.q-model-stage{flex-basis:190px}}

.q-panel-head-actions{display:flex;align-items:flex-start;gap:8px}.q-voice{border:0;background:transparent;color:#fff;font-size:18px;padding:2px 4px;cursor:pointer}.q-trigger{min-height:46px}.q-panel{overscroll-behavior:contain}
.q-trigger-avatar{width:30px;height:30px;border-radius:50%;background:#f7c948}.q-trigger-avatar img{width:124%;height:124%;object-fit:contain;transform:translateY(4%)}.q-panel .q-model-stage{display:none}
@media(max-width:640px){.q-widget{right:12px;bottom:calc(12px + env(safe-area-inset-bottom))}.q-trigger{transform:scale(.9);transform-origin:bottom right}.q-panel{right:8px;bottom:calc(8px + env(safe-area-inset-bottom));width:calc(100vw - 16px);max-height:75vh;min-height:65vh}.q-model-stage{flex-basis:120px;height:120px}.q-messages{max-height:none;min-height:0}.q-suggestions{padding-bottom:8px}.q-escalate{margin-bottom:10px}}


/* Mobile workbench SmallQ open/close compact mode 2026-09-21 */
@media(max-width:640px){
  .q-panel{
    right:12px;
    bottom:calc(72px + env(safe-area-inset-bottom));
    width:min(350px,calc(100vw - 24px));
    max-height:min(68vh,520px);
    min-height:0;
  }
  .q-model-stage{
    flex-basis:96px;
    height:96px;
  }
  .q-panel-head{
    position:sticky;
    top:0;
    z-index:2;
  }
  .q-close{
    min-width:40px;
    min-height:40px;
    display:grid;
    place-items:center;
  }
}

/* Checkpoint C — fixed compact mobile assistant sheet */
@media(max-width:640px){
  .q-widget{right:10px;bottom:calc(10px + env(safe-area-inset-bottom))}
  .q-trigger{min-height:52px;height:52px;padding:8px 12px;gap:7px;font-size:13px}
  .q-trigger-mark{width:24px;height:24px;font-size:13px}
  .q-panel{position:fixed;left:10px;right:10px;bottom:calc(76px + env(safe-area-inset-bottom));width:auto;max-height:58dvh;min-height:0;height:auto;border-radius:18px}
  .q-panel-head{padding:10px 14px 8px}
  .q-panel-head h2{font-size:20px;margin:2px 0 0}
  .q-panel-head p{font-size:11px;line-height:1.3}
  .q-model-stage.q-2d-stage{flex:0 0 82px;height:82px;min-height:82px;padding-top:2px}
  .q-2d-stage .smallq-2d{width:76px;height:78px;transform:none;transform-origin:center center;animation:none}
  .q-model-status{right:9px;bottom:5px;font-size:9px}
  .q-context{padding:7px 12px;font-size:11px}
  .q-messages{max-height:none;min-height:0;padding:8px 12px;line-height:1.4}
  .q-suggestions{padding:0 12px 6px;gap:4px}
  .q-suggestions button,.q-escalate{padding:5px 8px;font-size:11px}
  .q-form{margin:0 12px 6px;gap:6px}
  .q-form input{padding:8px}
  .q-form button{padding:0 11px}
  .q-escalate{margin:0 12px 8px}
}

/* The launcher is the supplied 2D SmallQ silhouette, without a pill or badge. */
.q-trigger {
  width: 92px;
  height: 92px;
  min-height: 92px;
  padding: 0;
  gap: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.q-trigger-avatar {
  width: 92px;
  height: 92px;
  border-radius: 0;
  background: transparent;
}
.q-trigger-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: none;
  filter: drop-shadow(0 10px 14px rgba(16,36,59,.2));
}
.q-trigger > span:not(.q-trigger-avatar),
.q-trigger-dot { display: none; }
.q-trigger:focus-visible { outline: 3px solid rgba(57,116,237,.45); outline-offset: 4px; border-radius: 12px; }
.q-panel { bottom: 124px; }
.q-trigger[aria-expanded="true"] .q-trigger-avatar img { animation: smallq-launcher-hop .62s cubic-bezier(.2,.75,.35,1.25) both; }
@keyframes smallq-launcher-hop {
  0% { transform: translateY(0) rotate(0deg) scale(1); }
  35% { transform: translateY(-10px) rotate(-4deg) scale(1.04); }
  65% { transform: translateY(2px) rotate(3deg) scale(.98); }
  100% { transform: translateY(0) rotate(0deg) scale(1); }
}
.q-trigger { --q-follow-y: 0px; transform: translateY(var(--q-follow-y)); transition: transform .28s ease; }
@media (prefers-reduced-motion: reduce) { .q-trigger { transition: none; } }
.q-suggestions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 14px 12px;
}
.q-suggestions button {
  min-width: 0;
  min-height: 36px;
  padding: 8px 10px;
  line-height: 1.3;
  white-space: nowrap;
  text-align: center;
}
.q-messages {
  max-height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}
.q-message { overflow-wrap: anywhere; }
.q-voice-status { margin: 0; padding: 5px 14px 3px; color: #6b7d90; font-size: 11px; line-height: 1.4; }
.q-replay { align-self:flex-start; margin:0 14px 6px; padding:6px 11px; border:1px solid #c7dbf0; border-radius:999px; background:#f2f7fd; color:#1558a2; font-size:11px; font-weight:700; }
.q-replay[hidden] { display:none!important; }
@media(max-width:640px){
  .q-trigger { width: 92px; height: 92px; min-height: 92px; transform: none; }
  .q-trigger-avatar { width: 92px; height: 92px; }
  .q-panel { bottom: calc(106px + env(safe-area-inset-bottom)); }
  .q-suggestions { gap: 6px; padding: 7px 12px 10px; }
  .q-suggestions button { min-height: 34px; padding: 7px 8px; }
  .q-messages { max-height: 210px; }
}

/* P0: the floating assistant answers questions; primary navigation stays in the site header. */
.q-panel {
  overflow: hidden;
  max-height: min(520px, calc(100vh - 140px));
}
.q-panel-head h2 { margin: 0 0 3px; }
.q-panel [data-q-model-status]:empty { display: none; }
.q-messages {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(38vh, 260px);
  overflow-x: hidden;
  overflow-y: auto;
  overflow-wrap: anywhere;
}
.q-message-cta { max-width: 100%; overflow-wrap: anywhere; }
.q-form { flex: 0 0 auto; }

@media (max-width: 640px) {
  .q-widget {
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 20px);
  }
  .q-trigger,
  .q-trigger-avatar {
    width: 72px;
    height: 72px;
    min-height: 72px;
  }
  .q-trigger-avatar img { width: 100%; height: 100%; }
  .q-panel {
    left: 12px;
    right: 12px;
    bottom: calc(84px + env(safe-area-inset-bottom));
    width: auto;
    max-width: none;
    max-height: min(44vh, 360px);
    max-height: min(44dvh, 360px);
    border-radius: 16px;
  }
  .q-panel-head { gap: 8px; padding: 9px 12px 7px; }
  .q-panel-head h2 { font-size: 19px; line-height: 1.2; }
  .q-panel-head p { font-size: 12px; line-height: 1.3; }
  .q-panel-head-actions { align-items: center; gap: 3px; }
  .q-voice,
  .q-close {
    display: grid;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    place-items: center;
  }
  .q-voice { font-size: 17px; }
  .q-voice-status { padding: 4px 12px 0; font-size: 10px; }
  .q-replay { margin: 4px 12px; }
  .q-messages {
    max-height: min(24dvh, 180px);
    padding: 8px 12px;
    font-size: 13px;
    line-height: 1.45;
  }
  .q-form { margin: 0 12px 9px; gap: 6px; }
  .q-form input { min-width: 0; height: 42px; padding: 8px 10px; font-size: 16px; }
  .q-form button { min-height: 42px; padding: 0 11px; }
}

/* Keep SmallQ's character visible in the compact assistant header. */
.q-panel-head { align-items: center; }
.q-panel-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.q-panel-avatar { display: block; width: 42px; height: 42px; flex: 0 0 42px; object-fit: contain; }
.q-panel-identity > div { min-width: 0; }
@media (max-width: 640px) {
  .q-panel-identity { gap: 8px; }
  .q-panel-avatar { width: 36px; height: 36px; flex-basis: 36px; }
}
