/* HUBI critical UI: isolated to avoid stale main-stylesheet cache issues. */
.hubi-launcher,
.hubi-panel,
.hubi-launcher *,
.hubi-panel * { box-sizing: border-box; }

.hubi-launcher {
  position: fixed;
  z-index: 85;
  top: 50%;
  right: 0;
  bottom: auto;
  width: 178px;
  height: 64px;
  margin: 0;
  padding: 7px 14px 7px 7px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f2f0e9;
  background: #141915;
  border: 1px solid #414741;
  border-right: 0;
  border-radius: 0;
  box-shadow: -7px 7px 0 rgba(36, 87, 255, .28);
  cursor: pointer;
  text-align: left;
  transform: translateY(-50%);
  transition: background .25s ease, box-shadow .25s ease;
}

.hubi-launcher:hover,
.hubi-launcher:focus-visible {
  width: 178px;
  background: #2457ff;
  box-shadow: -10px 10px 0 rgba(20, 25, 21, .2);
  transform: translateY(-50%);
  outline: none;
}

.hubi-launcher-mark {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #f2f0e9;
}

.hubi-launcher-mark img {
  display: block;
  width: 34px;
  height: 34px;
  max-width: 34px;
  max-height: 34px;
  object-fit: contain;
}

.hubi-launcher > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.hubi-launcher strong {
  color: inherit;
  font: 600 13px/1.1 "Syne", sans-serif;
  letter-spacing: .04em;
}

.hubi-launcher small {
  overflow: hidden;
  color: #aeb2ab;
  font: 400 8px/1.2 "DM Mono", monospace;
  white-space: nowrap;
}

.hubi-launcher:hover small,
.hubi-launcher:focus-visible small { color: rgba(255, 255, 255, .8); }

.hubi-launcher > i {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-radius: 50%;
  background: #ccff3d;
  animation: hubiCriticalPulse 2s infinite;
}

.hubi-panel {
  position: fixed;
  z-index: 90;
  top: 50%;
  right: 18px;
  bottom: auto;
  left: auto;
  width: min(420px, calc(100vw - 44px));
  height: min(680px, calc(100dvh - 40px));
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  color: #f2f0e9;
  background: #111612;
  border: 1px solid #454b45;
  box-shadow: 14px 14px 0 rgba(20, 25, 21, .22);
  overflow: hidden;
  transform: translateY(-50%);
}

.hubi-panel[hidden] { display: none !important; }

.hubi-header {
  min-height: 72px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background: #2457ff;
  border-bottom: 1px solid rgba(255, 255, 255, .25);
}

.hubi-identity { display: flex; align-items: center; gap: 11px; }

.hubi-avatar {
  flex: 0 0 43px;
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #f2f0e9;
  border-radius: 50%;
}

.hubi-avatar img {
  display: block;
  width: 31px;
  height: 31px;
  max-width: 31px;
  max-height: 31px;
  object-fit: contain;
}

.hubi-identity > div { display: grid; gap: 4px; }
.hubi-identity strong { color: #fff; font: 600 17px/1 "Syne", sans-serif; letter-spacing: .04em; }
.hubi-identity small { display: flex; align-items: center; gap: 6px; color: rgba(255, 255, 255, .8); font: 400 8px/1.2 "DM Mono", monospace; text-transform: uppercase; }
.hubi-identity small i { width: 6px; height: 6px; border-radius: 50%; background: #ccff3d; }
.hubi-header-actions { display: flex; gap: 5px; }

.hubi-header-actions button {
  width: 34px;
  height: 34px;
  padding: 0;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 0;
  cursor: pointer;
  font: 400 19px/1 sans-serif;
}

.hubi-header-actions button:hover,
.hubi-header-actions button:focus-visible { color: #141915; background: #ccff3d; border-color: #ccff3d; outline: none; }

.hubi-thread {
  min-height: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  overflow-y: auto;
  background-color: #111612;
  background-image: linear-gradient(rgba(242, 240, 233, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(242, 240, 233, .045) 1px, transparent 1px);
  background-size: 32px 32px;
  scrollbar-width: thin;
  scrollbar-color: #4b514b transparent;
}

.hubi-message {
  max-width: 88%;
  margin: 0;
  padding: 13px 14px;
  font: 400 13px/1.55 "Manrope", sans-serif;
  overflow-wrap: anywhere;
  animation: hubiCriticalMessageIn .35s cubic-bezier(.22, .8, .3, 1) both;
}

.hubi-message-assistant { align-self: flex-start; color: #141915; background: #f2f0e9; border-left: 3px solid #ccff3d; }
.hubi-message-user { align-self: flex-end; color: #fff; background: #2457ff; }

.hubi-quick-actions {
  padding: 0 14px 14px;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  background: #111612;
}

.hubi-quick-actions button {
  min-height: 30px;
  padding: 8px 10px;
  color: #c4c7c1;
  background: transparent;
  border: 1px solid #4b514b;
  border-radius: 0;
  cursor: pointer;
  font: 400 8px/1.2 "DM Mono", monospace;
  text-transform: uppercase;
}

.hubi-quick-actions button:hover,
.hubi-quick-actions button:focus-visible { color: #f2f0e9; border-color: #f2f0e9; outline: none; }
.hubi-quick-actions button.primary { color: #141915; background: #ccff3d; border-color: #ccff3d; }

.hubi-input-row {
  min-height: 46px;
  margin: 0 14px;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  background: #111612;
  border: 1px solid #4b514b;
}

.hubi-input-row:focus-within { border-color: #ccff3d; }

.hubi-input-row input {
  width: 100%;
  min-width: 0;
  height: 44px;
  margin: 0;
  padding: 12px;
  color: #f2f0e9;
  background: transparent;
  border: 0;
  border-radius: 0;
  outline: 0;
  font: 400 12px/1 "Manrope", sans-serif;
}

.hubi-input-row input::placeholder { color: #747a73; }

.hubi-input-row button {
  width: 42px;
  height: 44px;
  margin: 0;
  padding: 0;
  color: #141915;
  background: #ccff3d;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  font: 400 18px/1 sans-serif;
}

.hubi-footer {
  min-height: 32px;
  padding: 10px 14px 12px;
  color: #747a73;
  background: #111612;
  font: 400 7px/1.3 "DM Mono", monospace;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .04em;
}

@keyframes hubiCriticalPulse {
  70% { box-shadow: 0 0 0 8px rgba(204, 255, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(204, 255, 61, 0); }
}

@keyframes hubiCriticalMessageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  .hubi-launcher { top: auto; right: 0; bottom: 24px; width: 58px; height: 58px; padding: 7px; transform: none; }
  .hubi-launcher:hover, .hubi-launcher:focus-visible { width: 58px; transform: none; }
  .hubi-launcher-mark { flex-basis: 42px; width: 42px; height: 42px; }
  .hubi-launcher-mark img { width: 30px; height: 30px; }
  .hubi-launcher > span:nth-child(2) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .hubi-launcher > i { position: absolute; top: 5px; right: 5px; margin: 0; }
  .hubi-panel { inset: 8px; width: auto; height: auto; max-height: none; transform: none; box-shadow: 6px 6px 0 rgba(20, 25, 21, .18); }
  .hubi-open .hubi-launcher { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hubi-launcher > i,
  .hubi-message { animation: none !important; }
}
