.assistant [hidden],
.assistant[hidden] {
  display: none !important;
}
.assistant {
  font-size: 14px;
}
.assistant-launcher {
  position: fixed;
  right: 22px;
  bottom: 20px;
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  color: var(--green);
  padding: 9px 16px;
  box-shadow: 0 3px 14px #26382a0c;
}
.assistant-launcher i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}
.assistant-launcher[aria-expanded="true"] {
  visibility: hidden;
}
.assistant-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: min(460px, calc(100vw - 32px));
  height: min(760px, calc(100dvh - 40px));
  max-height: calc(100dvh - 40px);
  min-height: 280px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 12px 48px #25362a21;
  animation: assistant-appear 140ms ease-out;
}
.assistant-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 18px 18px 12px;
}
.assistant-header > div {
  flex: 1;
  min-width: 0;
}
.assistant-header h2 {
  font-size: 17px;
  letter-spacing: -0.25px;
}
.assistant-project {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.assistant-icon {
  display: inline-flex;
  flex: none;
  justify-content: center;
  align-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
}
.assistant-icon:hover:not(:disabled) {
  background: var(--bg);
  color: var(--ink);
}
.assistant-history {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 17px 10px;
  border-bottom: 1px solid var(--line);
}
.assistant-history select {
  min-width: 0;
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 12px;
  padding: 5px 2px;
}
.assistant-earlier {
  margin: 7px auto 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.assistant-messages {
  flex: 1;
  min-height: 70px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 18px;
  scrollbar-width: thin;
}
.assistant-empty {
  max-width: 310px;
  padding: 24px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.assistant-message {
  margin-bottom: 18px;
  overflow-wrap: anywhere;
}
.assistant-author {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 5px;
}
.assistant-message-text {
  white-space: pre-wrap;
  line-height: 1.6;
}
.assistant-message.from-user {
  margin-left: 22px;
  border-radius: 14px 14px 4px 14px;
  padding: 10px 12px;
  background: var(--bg);
}
.assistant-message.from-assistant {
  padding-right: 10px;
}
.assistant-message-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}
.assistant-message-files a {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  max-width: 100%;
  color: var(--green);
  font-size: 12px;
}
.assistant-message-files img {
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.assistant-message-files > div {
  max-width: 100%;
}
.assistant-message-files audio {
  max-width: 100%;
  width: 270px;
  height: 34px;
  display: block;
}
.assistant-message-files > div > span {
  font-size: 11px;
  color: var(--muted);
}
.assistant-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 16px 8px;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  flex-direction: column;
  align-items: stretch;
}
.assistant-activity {
  display: flex;
  gap: 8px;
  align-items: center;
}
.assistant-activity > span {
  flex: 1;
}
.assistant-activity-dots {
  display: flex;
  gap: 3px;
  align-items: center;
}
.assistant-activity-dots b {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  animation: assistant-thinking 1.2s infinite ease-in-out;
}
.assistant-activity-dots b:nth-child(2) {
  animation-delay: 150ms;
}
.assistant-activity-dots b:nth-child(3) {
  animation-delay: 300ms;
}
.assistant-response-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.assistant-response-actions button,
.assistant-request-card button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--green);
  padding: 7px 10px;
  font-size: 12px;
  text-align: left;
}
.assistant-repair-requests {
  flex: none;
  max-height: 150px;
  overflow: auto;
}
.assistant-request-card {
  margin: 0 16px 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.assistant-request-card p {
  font-size: 12px;
  margin-bottom: 4px;
}
.assistant-request-card > span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 7px;
}
.assistant-pin-form {
  margin-top: 16px;
}
.assistant-pin-error {
  color: #9c655a;
  margin: 10px 0;
}
.assistant-guidance-highlight {
  outline: 3px solid var(--green) !important;
  outline-offset: 5px;
  box-shadow: 0 0 0 8px var(--green-soft);
  scroll-margin: 30px;
}
.assistant-compact .assistant-launcher {
  max-width: calc(100vw - 24px);
  font-size: 12px;
}
@keyframes assistant-thinking {
  0%,
  70%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  35% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
.assistant-progress button,
.assistant-file-info > button,
.assistant-recording > button:not(.assistant-icon),
.assistant-error button {
  border: 0;
  background: none;
  color: inherit;
  font-size: 12px;
  padding: 3px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.assistant-notice,
.assistant-error {
  margin: 0 16px 8px;
  padding: 9px 11px;
  border-radius: 9px;
  font-size: 12px;
  background: #f7f2e8;
  color: #7f7156;
  overflow-wrap: anywhere;
}
.assistant-error button {
  display: block;
  margin-top: 3px;
}
.assistant-compose-wrap {
  flex: none;
  padding: 0 14px 10px;
}
.assistant-context {
  color: var(--muted);
  font-size: 11px;
  padding: 3px 5px 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assistant-composer {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
  padding: 10px 10px 8px;
}
.assistant-composer:focus-within {
  border-color: #a7baa9;
}
.assistant-composer textarea {
  display: block;
  width: 100%;
  min-height: 70px;
  max-height: 180px;
  padding: 3px 5px 8px;
  resize: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  outline: none;
  box-shadow: none;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}
.assistant-composer textarea::placeholder {
  color: #8c9488;
}
.assistant-composer footer {
  display: flex;
  align-items: center;
  gap: 5px;
}
.assistant-model {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.assistant-send {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  height: 34px;
  width: 34px;
  margin-left: 2px;
}
.assistant-send:hover:not(:disabled) {
  background: var(--green-hover);
}
.assistant-send:disabled {
  opacity: 0.32;
}
.assistant-hint {
  text-align: center;
  color: var(--subtle);
  font-size: 10px;
  margin-top: 6px;
}
.assistant-attachments {
  display: flex;
  flex-direction: column;
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.assistant-file {
  display: flex;
  align-items: start;
  gap: 8px;
  padding: 8px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
}
.assistant-file > svg {
  color: var(--muted);
  margin: 4px;
}
.assistant-file > a {
  flex: none;
}
.assistant-file img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--bg);
}
.assistant-file-info {
  flex: 1;
  min-width: 0;
}
.assistant-file-name {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.assistant-file-status {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 1px;
}
.assistant-file-info > button {
  color: var(--green);
  white-space: normal;
  text-align: left;
}
.assistant-file-info audio {
  width: 100%;
  max-width: 290px;
  height: 32px;
  margin-top: 5px;
}
.assistant-file > .assistant-icon {
  width: 26px;
  height: 26px;
}
.assistant-recording {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 6px;
  color: #9c655a;
  font-size: 12px;
}
.assistant-recording > span {
  flex: 1;
}
.assistant-drop {
  position: absolute;
  inset: 6px;
  display: grid;
  place-items: center;
  padding: 20px;
  border: 2px dashed #9ab19c;
  border-radius: 15px;
  color: var(--green);
  background: #f2f7f0f5;
  pointer-events: none;
}
@keyframes assistant-appear {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 520px) {
  .assistant-panel {
    inset: auto 8px 8px;
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 16px;
  }
  .assistant-launcher {
    right: 12px;
    bottom: 12px;
  }
  .assistant-header {
    padding: 12px 14px 8px;
  }
  .assistant-compose-wrap {
    padding: 0 10px max(8px, env(safe-area-inset-bottom));
  }
  .assistant-model {
    font-size: 10px;
  }
  .assistant-hint {
    display: none;
  }
  .assistant-icon,
  .assistant-send {
    width: 38px;
    height: 38px;
  }
  .assistant-messages {
    padding: 12px 14px;
  }
  .assistant-attachments {
    max-height: 135px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .assistant-panel {
    animation: none;
  }
  .assistant-activity-dots b {
    animation: none;
    opacity: 1;
  }
}
