.aos-thinking-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 13px 6px 7px;
  border: 1px solid rgba(115, 92, 255, .22);
  border-radius: 14px;
  color: var(--aos-ink, #12131b);
  background: linear-gradient(135deg, rgba(115, 92, 255, .09), rgba(255, 255, 255, .96));
  box-shadow: 0 10px 26px rgba(77, 61, 168, .09);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  z-index: 42;
}

.aos-thinking-trigger:hover {
  transform: translateY(-1px);
  border-color: rgba(115, 92, 255, .42);
  box-shadow: 0 14px 34px rgba(77, 61, 168, .15);
}

.aos-thinking-trigger.floating {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 85;
  padding-right: 16px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(18px);
}

.aos-thinking-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, .7), transparent 28%),
    linear-gradient(145deg, #8c78ff, #6049ea);
  box-shadow: 0 9px 20px rgba(92, 69, 237, .28);
  font-size: 16px;
}

.aos-thinking-orb::after {
  content: '';
  position: absolute;
  inset: -3px;
  border: 1px solid rgba(115, 92, 255, .18);
  border-radius: 13px;
}

.aos-thinking-trigger > span:last-child {
  min-width: 0;
  display: grid;
  gap: 1px;
  text-align: left;
}

.aos-thinking-trigger strong {
  font-size: 12px;
  font-weight: 850;
  line-height: 1.15;
  white-space: nowrap;
}

.aos-thinking-trigger small {
  max-width: 145px;
  overflow: hidden;
  color: var(--aos-muted, #747684);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aos-thinking-layer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  visibility: hidden;
}

.aos-thinking-layer.open {
  pointer-events: auto;
  visibility: visible;
}

.aos-thinking-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  opacity: 0;
  background: rgba(15, 13, 27, .34);
  backdrop-filter: blur(3px);
  transition: opacity .22s ease;
}

.aos-thinking-layer.open .aos-thinking-backdrop { opacity: 1; }

.aos-thinking-drawer {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(470px, calc(100vw - 28px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--aos-text, #1a1b24);
  background:
    radial-gradient(circle at 90% 0%, rgba(115, 92, 255, .13), transparent 28%),
    linear-gradient(180deg, #fff 0%, #f8f7fc 100%);
  border-left: 1px solid rgba(115, 92, 255, .12);
  box-shadow: -28px 0 80px rgba(18, 16, 34, .18);
  transform: translateX(104%);
  transition: transform .28s cubic-bezier(.22, .8, .28, 1);
}

.aos-thinking-layer.open .aos-thinking-drawer { transform: translateX(0); }

.aos-thinking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 82px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--aos-line, #e4e4ec);
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(18px);
}

.aos-thinking-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.aos-thinking-brand > span {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 14px;
  background: linear-gradient(145deg, #8c78ff, #6049ea);
  box-shadow: 0 14px 30px rgba(92, 69, 237, .25);
  font-size: 21px;
}

.aos-thinking-brand small,
.aos-thinking-brand h2 {
  display: block;
  margin: 0;
}

.aos-thinking-brand small {
  color: var(--aos-accent, #735cff);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .12em;
}

.aos-thinking-brand h2 {
  margin-top: 2px;
  color: var(--aos-ink, #12131b);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -.03em;
}

.aos-thinking-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--aos-line, #e4e4ec);
  border-radius: 12px;
  color: var(--aos-muted, #747684);
  background: #fff;
  font-size: 23px;
  line-height: 1;
}

.aos-thinking-close:hover {
  color: var(--aos-ink, #12131b);
  border-color: var(--aos-line-strong, #d6d5e1);
}

.aos-thinking-main {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 18px;
  overflow-y: auto;
}

.aos-thinking-context {
  padding: 15px;
  border: 1px solid rgba(115, 92, 255, .14);
  border-radius: 16px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 14px 34px rgba(34, 27, 70, .05);
}

.aos-thinking-context > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.aos-thinking-context > header small {
  color: var(--aos-accent, #735cff);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .1em;
}

.aos-thinking-context > header span {
  max-width: 220px;
  overflow: hidden;
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--aos-muted, #747684);
  background: var(--aos-surface-soft, #fafafe);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aos-thinking-context nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}

.aos-thinking-context nav span {
  padding: 6px 8px;
  border-radius: 9px;
  color: var(--aos-ink-soft, #202231);
  background: var(--aos-accent-soft, #eeebff);
  font-size: 10px;
  font-weight: 800;
}

.aos-thinking-context nav i {
  color: var(--aos-muted-2, #9597a5);
  font-style: normal;
  font-size: 11px;
}

.aos-thinking-context-rows {
  display: grid;
  gap: 8px;
  margin-top: 13px;
}

.aos-thinking-context-rows:empty { display: none; }

.aos-thinking-context-rows > div {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding-top: 8px;
  border-top: 1px solid var(--aos-line, #e4e4ec);
}

.aos-thinking-context-rows small {
  color: var(--aos-muted, #747684);
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.aos-thinking-context-rows strong {
  min-width: 0;
  color: var(--aos-text, #1a1b24);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.4;
}

.aos-thinking-intro {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px 15px;
  border: 1px solid rgba(57, 119, 232, .12);
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(234, 241, 255, .8), rgba(255, 255, 255, .92));
}

.aos-thinking-intro > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  color: var(--aos-blue, #3977e8);
  background: #fff;
  box-shadow: 0 8px 18px rgba(57, 119, 232, .1);
}

.aos-thinking-intro strong {
  display: block;
  color: var(--aos-ink, #12131b);
  font-size: 12px;
}

.aos-thinking-intro p {
  margin: 3px 0 0;
  color: var(--aos-muted, #747684);
  font-size: 11px;
  line-height: 1.5;
}

.aos-thinking-form {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--aos-line, #e4e4ec);
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(25, 22, 43, .06);
}

.aos-thinking-form > label {
  color: var(--aos-ink, #12131b);
  font-size: 12px;
  font-weight: 850;
}

.aos-thinking-form textarea {
  width: 100%;
  min-height: 156px;
  resize: vertical;
  padding: 13px 14px;
  border: 1px solid var(--aos-line-strong, #d6d5e1);
  border-radius: 13px;
  color: var(--aos-text, #1a1b24);
  background: var(--aos-surface-soft, #fafafe);
  font-size: 13px;
  line-height: 1.55;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.aos-thinking-form textarea:focus {
  border-color: rgba(115, 92, 255, .55);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(115, 92, 255, .08);
  outline: 0;
}

.aos-thinking-form textarea::placeholder { color: var(--aos-muted-2, #9597a5); }

.aos-thinking-status {
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--aos-muted, #747684);
  background: var(--aos-surface-soft, #fafafe);
  font-size: 10px;
  font-weight: 750;
}

.aos-thinking-status[data-tone="ready"],
.aos-thinking-status[data-tone="success"] {
  color: var(--aos-green, #1e9f71);
  background: var(--aos-green-soft, #e8f7f1);
}

.aos-thinking-status[data-tone="error"] {
  color: #bd3b35;
  background: var(--aos-coral-soft, #fff0ee);
}

.aos-thinking-status[data-tone="loading"] {
  color: var(--aos-accent-strong, #5b43ed);
  background: var(--aos-accent-soft, #eeebff);
}

.aos-thinking-form footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.aos-thinking-form footer > span {
  max-width: 210px;
  color: var(--aos-muted-2, #9597a5);
  font-size: 9px;
  line-height: 1.35;
}

.aos-thinking-form footer button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--aos-accent, #735cff), var(--aos-accent-strong, #5b43ed));
  box-shadow: 0 12px 28px rgba(91, 67, 237, .24);
  font-size: 11px;
  font-weight: 850;
}

.aos-thinking-form footer button:hover { transform: translateY(-1px); }
.aos-thinking-form footer button i { font-style: normal; font-size: 15px; }

body.aos-thinking-open { overflow: hidden; }

@media (max-width: 900px) {
  .pmh-top-actions .aos-thinking-trigger > span:last-child { display: none; }
  .pmh-top-actions .aos-thinking-trigger { padding: 6px; }
}

@media (max-width: 640px) {
  .aos-thinking-drawer { width: 100vw; }
  .aos-thinking-main { padding: 14px; }
  .aos-thinking-header { min-height: 72px; padding: 13px 15px; }
  .aos-thinking-context-rows > div { grid-template-columns: 1fr; gap: 3px; }
  .aos-thinking-form footer { align-items: stretch; flex-direction: column; }
  .aos-thinking-form footer > span { max-width: none; }
  .aos-thinking-form footer button { justify-content: center; width: 100%; }
  .aos-thinking-trigger.floating { right: 14px; bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .aos-thinking-trigger,
  .aos-thinking-backdrop,
  .aos-thinking-drawer { transition: none; }
}
