.llm-toolbar { width: min(1120px, calc(100% - 40px)); gap: 20px; }
.llm-toolbar > p { flex-shrink: 0; }
.llm-control, .llm-bubble {
  --llm-paper: #f7ebe1;
  --llm-ink: #554037;
  --llm-border: #b39a8f;
  --llm-red: #B13254;
  box-sizing: border-box;
  color: var(--llm-ink);
  background: var(--llm-paper);
  border: 1px solid var(--llm-border);
}
.llm-control {
  position: relative;
  flex: 1 1 640px;
  min-width: 0;
  max-width: 720px;
  height: 52px;
  margin: 0 20px;
  border-radius: 15px;
}
.llm-control [hidden], .llm-bubble[hidden], .llm-bubble [hidden] { display: none !important; }
.llm-connect, .llm-button, .llm-icon, .llm-bubble-close {
  box-sizing: border-box;
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.llm-connect {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0 18px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  font-size: 16px;
}
.llm-connect:hover, .llm-icon:hover, .llm-button:hover { background: #f2e5da; }
.llm-control button:disabled, .llm-bubble button:disabled { opacity: .5; cursor: default; }
.llm-form { display: flex; align-items: center; gap: 8px; width: 100%; height: 100%; padding: 8px 34px 8px 14px; }
.llm-form input {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 4px 0;
  border: 0;
  border-radius: 0;
  font: inherit;
  font-size: 16px;
  color: var(--llm-ink);
  background: transparent;
  outline: none;
}
.llm-form input::placeholder { color: #87746c; opacity: 1; }
.llm-control:focus-within { border-color: #804a3a; box-shadow: 0 0 0 2px #804a3a12; }
.llm-control button:focus-visible, .llm-bubble button:focus-visible, .llm-bubble a:focus-visible {
  outline: 2px solid var(--llm-red);
  outline-offset: 3px;
}
.llm-icon, .llm-bubble-close { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0; }
.llm-icon { width: 32px; height: 32px; border: 1px solid var(--llm-border); border-radius: 10px; background: transparent; }
.llm-icon svg, .llm-bubble-close svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.llm-disconnect {
  position: absolute;
  top: -10px;
  right: -8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border-color: var(--llm-red);
  background: var(--llm-paper);
  color: var(--llm-red);
  z-index: 2;
}
.llm-disconnect::before { content: ''; position: absolute; inset: -4px; border-radius: inherit; }
.llm-disconnect svg { width: 14px; height: 14px; }
.llm-disconnect:hover { background: var(--llm-red); color: var(--llm-paper); }
.llm-status { position: absolute; left: 4px; top: calc(100% + 7px); width: calc(100% - 8px); font-size: 12px; line-height: 1.4; color: #804a3a; z-index: 5; }
.llm-bubble {
  position: absolute;
  width: min(360px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  padding: 18px;
  border-radius: 18px;
  box-shadow: 0 7px 22px #55403712;
  z-index: 25;
  text-align: left;
  font-size: 15px;
  line-height: 1.6;
}
.llm-bubble-tail { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.llm-bubble-tail path { fill: var(--llm-paper); stroke: var(--llm-border); stroke-width: 1; stroke-linejoin: round; }
.llm-bubble-content { position: relative; max-height: var(--llm-body-height, 380px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.llm-bubble-title { margin: 0 20px 10px 0; padding: 0; font-size: 18px; font-weight: 500; line-height: 1.4; color: var(--llm-ink); text-decoration: none; }
.llm-bubble p::before, .llm-bubble p::after { content: none; display: none; }
.llm-auth-description { color: #6e5b51; }
.llm-auth-verification { margin: 17px 0; padding: 12px 14px; border: 1px solid #b39a8f70; border-radius: 10px; background: #f2e5da; }
.llm-auth-code-label { display: block; font-size: 12px; color: #87746c; }
.llm-auth-verification code { display: block; margin-top: 5px; padding: 0; font: inherit; font-size: 24px; line-height: 1.3; letter-spacing: 3px; color: var(--llm-ink); background: transparent; user-select: all; overflow-wrap: anywhere; }
.llm-auth-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.llm-button { padding: 8px 12px; border: 1px solid var(--llm-border); border-radius: 9px; background: transparent; font-size: 14px; line-height: 1.4; }
.llm-auth-link, .llm-auth-link:visited { flex: 1; color: var(--llm-ink); text-align: center; text-decoration: none; }
.llm-auth-cancel { border-color: transparent; color: #87746c; }
.llm-bubble-text { padding-right: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.llm-bubble-close { position: absolute; right: 6px; top: 6px; width: 26px; height: 26px; border-radius: 8px; border: 0; background: var(--llm-paper); color: #87746c; z-index: 2; }
.llm-bubble-close:hover { color: var(--llm-red); background: #f2e5da; }
@media (max-width: 600px) {
  .llm-toolbar { width: calc(100% - 32px); flex-wrap: wrap; gap: 8px; }
  .llm-toolbar > p { margin-top: 6px; margin-bottom: 6px; }
  .llm-control { order: 1; flex-basis: 100%; max-width: none; margin: 10px 0 0; }
  .llm-bubble { font-size: 14px; }
}
@media print { .llm-control, .llm-bubble { display: none !important; } }
