﻿.nancy-assistant {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 3205;
  display: grid;
  justify-items: end;
  gap: 14px;
}

.nancy-assistant.is-public-mode {
  right: 76px;
  bottom: 18px;
}

.nancy-launcher {
  position: relative;
  min-width: 188px;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px 12px 14px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #11284e 0%, #1d4c8f 55%, #d39c1a 120%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nancy-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 28px 56px rgba(15, 23, 42, 0.3);
}

.nancy-launcher-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(10px);
}

.nancy-launcher-copy {
  display: grid;
  gap: 2px;
  text-align: left;
}

.nancy-launcher-copy strong {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.nancy-launcher-copy small {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
}

.nancy-launcher-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-left: auto;
  background: #bfffd7;
  box-shadow: 0 0 0 0 rgba(191, 255, 215, 0.55);
  animation: nancyPulse 1.9s infinite;
}

@keyframes nancyPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(191, 255, 215, 0.55);
  }

  70% {
    box-shadow: 0 0 0 12px rgba(191, 255, 215, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(191, 255, 215, 0);
  }
}

.nancy-panel {
  width: min(430px, calc(100vw - 32px));
  max-height: min(82vh, 780px);
  display: grid;
  grid-template-rows: auto auto auto auto auto auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 18px;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(202, 214, 233, 0.96);
  background:
    radial-gradient(480px 220px at 100% 0%, rgba(211, 156, 26, 0.13), transparent 68%),
    radial-gradient(420px 180px at 0% 0%, rgba(29, 76, 143, 0.14), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 255, 0.98));
  box-shadow: 0 32px 72px rgba(15, 23, 42, 0.26);
}

.nancy-panel[hidden] {
  display: none !important;
}

.nancy-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.nancy-panel-head h2 {
  margin: 2px 0 6px;
  font-size: 28px;
  color: #0f2342;
}

.nancy-panel-head p {
  margin: 0;
  color: #5d6f8a;
  line-height: 1.6;
  font-size: 14px;
}

.nancy-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(17, 40, 78, 0.08);
  color: #1b4177;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nancy-panel-close {
  width: 40px;
  height: 40px;
  border: 1px solid #d4deec;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #243857;
  cursor: pointer;
}

.nancy-context-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nancy-context-strip .chip {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid #d8e2f2;
}

.nancy-hero-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid #dbe4f2;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 247, 255, 0.94));
}

.nancy-hero-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #174782;
  background: linear-gradient(135deg, rgba(29, 76, 143, 0.14), rgba(211, 156, 26, 0.18));
  border: 1px solid rgba(29, 76, 143, 0.12);
}

.nancy-hero-copy {
  display: grid;
  gap: 4px;
}

.nancy-hero-copy strong {
  color: #10203a;
  font-size: 15px;
}

.nancy-hero-copy p {
  margin: 0;
  color: #60708c;
  line-height: 1.6;
  font-size: 13px;
}

.nancy-sample-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nancy-sample-prompt {
  min-height: 34px;
  border: 1px solid #d6dfed;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #23416c;
  padding: 0 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.nancy-sample-prompt:hover {
  transform: translateY(-1px);
  border-color: #adc0df;
  box-shadow: 0 12px 24px rgba(17, 24, 39, 0.06);
}

.nancy-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.nancy-quick-action {
  min-height: 54px;
  border: 1px solid #d5dfef;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 14px;
  color: #1a3258;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.nancy-quick-action:hover {
  transform: translateY(-1px);
  border-color: #adc0df;
  box-shadow: 0 14px 28px rgba(17, 24, 39, 0.08);
}

.nancy-quick-action:disabled,
.nancy-sample-prompt:disabled,
.nancy-send-btn:disabled,
.nancy-form .panel-btn:disabled,
.nancy-mini-btn:disabled {
  opacity: 0.68;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.nancy-quick-action i {
  width: 18px;
  text-align: center;
  color: #c08416;
}

.nancy-form {
  display: grid;
  gap: 10px;
}

.nancy-form-label {
  font-size: 13px;
  font-weight: 700;
  color: #203252;
}

.nancy-form textarea {
  width: 100%;
  min-height: 76px;
  border: 1px solid #cfdced;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  padding: 12px 14px;
  font: inherit;
  color: #172033;
  resize: vertical;
}

.nancy-form textarea:focus {
  outline: none;
  border-color: #7397cc;
  box-shadow: 0 0 0 4px rgba(64, 110, 183, 0.12);
}

.nancy-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.nancy-send-btn {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--panel-primary), var(--panel-primary-2));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 16px 28px rgba(29, 76, 143, 0.24);
}

.nancy-send-btn:hover {
  transform: translateY(-1px);
}

.nancy-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nancy-form-hint {
  color: #60708c;
  font-size: 12px;
  line-height: 1.55;
}

.nancy-status-row {
  display: grid;
  gap: 10px;
}

.nancy-status,
.nancy-context-note {
  padding: 11px 13px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.55;
}

.nancy-status {
  background: rgba(17, 40, 78, 0.08);
  color: #1f4378;
  font-weight: 700;
}

.nancy-context-note {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid #dde5f2;
  color: #4f617d;
}

.nancy-response {
  min-height: 190px;
  display: grid;
  align-content: start;
  gap: 14px;
  padding-right: 4px;
  overflow-y: auto;
}

.nancy-chat-bubble {
  display: grid;
  gap: 6px;
  max-width: 92%;
  padding: 12px 14px;
  border-radius: 18px;
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.05);
}

.nancy-chat-bubble.is-user {
  justify-self: end;
  background: linear-gradient(135deg, #1d4c8f, #2a61b0);
  color: #fff;
  border-bottom-right-radius: 8px;
}

.nancy-chat-bubble.is-assistant {
  justify-self: start;
  background: rgba(255, 255, 255, 0.95);
  color: #213552;
  border: 1px solid #dbe4f2;
  border-bottom-left-radius: 8px;
}

.nancy-chat-bubble p {
  margin: 0;
  line-height: 1.65;
  font-size: 13px;
}

.nancy-chat-meta {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.88;
}

.nancy-response::-webkit-scrollbar {
  width: 10px;
}

.nancy-response::-webkit-scrollbar-thumb {
  background: #c9d6ee;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.nancy-empty-state,
.nancy-response-card,
.nancy-suggestion-card,
.nancy-match-card {
  border-radius: 20px;
  border: 1px solid #d9e2f1;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 32px rgba(17, 24, 39, 0.06);
}

.nancy-empty-state {
  padding: 18px;
  display: grid;
  gap: 6px;
}

.nancy-empty-state strong {
  color: #142846;
}

.nancy-empty-state p {
  margin: 0;
  color: #62738f;
  line-height: 1.6;
}

.nancy-response-card {
  position: relative;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.nancy-response-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(29, 76, 143, 0.08);
  color: #1f4a84;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nancy-response-head {
  display: grid;
  gap: 8px;
}

.nancy-response-head h3 {
  margin: 0;
  font-size: 20px;
  color: #10203a;
}

.nancy-response-head p {
  margin: 0;
  color: #5a6d88;
  line-height: 1.65;
  font-size: 14px;
}

.nancy-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nancy-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: #eef4ff;
  color: #24436e;
}

.nancy-badge.is-success {
  background: #dff5ea;
  color: #0d6b46;
}

.nancy-badge.is-warning {
  background: #fff2da;
  color: #9b5e00;
}

.nancy-badge.is-danger {
  background: #ffe5df;
  color: #b33b28;
}

.nancy-block {
  display: grid;
  gap: 10px;
}

.nancy-block h4 {
  margin: 0;
  color: #173155;
  font-size: 14px;
}

.nancy-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: #425470;
  line-height: 1.65;
  font-size: 14px;
}

.nancy-suggestion-list,
.nancy-match-list {
  display: grid;
  gap: 12px;
}

.nancy-suggestion-card,
.nancy-match-card {
  padding: 16px;
  display: grid;
  gap: 10px;
}

.nancy-suggestion-card strong,
.nancy-match-card strong {
  color: #10203a;
  font-size: 15px;
}

.nancy-suggestion-slug,
.nancy-match-meta {
  font-size: 12px;
  color: #57708f;
  word-break: break-word;
}

.nancy-suggestion-card p,
.nancy-match-card p {
  margin: 0;
  color: #536885;
  line-height: 1.65;
  font-size: 13px;
}

.nancy-suggestion-meta {
  display: grid;
  gap: 6px;
}

.nancy-suggestion-actions,
.nancy-match-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nancy-mini-btn {
  min-height: 34px;
  border: 1px solid #d3dceb;
  border-radius: 999px;
  background: #fff;
  color: #24436e;
  padding: 0 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.nancy-mini-btn.primary {
  border-color: rgba(30, 60, 114, 0.12);
  background: linear-gradient(135deg, rgba(30, 60, 114, 0.12), rgba(42, 82, 152, 0.12));
  color: #163566;
}

.nancy-mini-btn.linklike {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.nancy-assistant.is-loading .nancy-status {
  background: rgba(37, 99, 235, 0.12);
  color: #2159b4;
}

@media (max-width: 1024px) {
  .nancy-assistant,
  .nancy-assistant.is-studio-draft {
    right: 16px;
    bottom: 16px;
  }

  .nancy-assistant.is-public-mode {
    right: 72px;
    bottom: 16px;
  }

  .nancy-panel {
    width: min(420px, calc(100vw - 20px));
    max-height: calc(100vh - var(--site-nav-height, 0px) - 30px);
  }
}

@media (max-width: 640px) {
  .nancy-assistant,
  .nancy-assistant.is-studio-draft {
    left: 10px;
    right: 10px;
    bottom: 10px;
    justify-items: stretch;
  }

  .nancy-assistant.is-public-mode {
    left: auto;
    right: 68px;
    bottom: 10px;
    justify-items: end;
  }

  .nancy-launcher {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
  }

  .nancy-assistant.is-public-mode .nancy-launcher {
    width: 48px;
    min-width: 48px;
    justify-content: center;
  }

  .nancy-panel {
    width: 100%;
    border-radius: 22px;
    padding: 16px;
  }

  .nancy-hero-card {
    grid-template-columns: 1fr;
  }

  .nancy-quick-grid {
    grid-template-columns: 1fr;
  }

  .nancy-form-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Nancy compact redesign */
.nancy-panel {
  position: relative;
  width: min(372px, calc(100vw - 24px));
  max-height: min(76vh, 620px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(197, 210, 230, 0.72);
  border-radius: 30px;
  background:
    radial-gradient(300px 160px at 100% 0%, rgba(210, 154, 18, 0.14), transparent 72%),
    radial-gradient(240px 180px at 0% 100%, rgba(87, 122, 255, 0.08), transparent 74%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 248, 255, 0.97));
  box-shadow: 0 26px 60px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(18px);
}

.nancy-launcher {
  width: 72px;
  min-width: 72px;
  height: 72px;
  padding: 4px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(17, 40, 84, 0.98), rgba(72, 102, 206, 0.94));
  box-shadow: 0 22px 44px rgba(17, 30, 64, 0.28);
}

.nancy-launcher-copy {
  display: none;
}

.nancy-launcher-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 20px rgba(11, 19, 44, 0.3);
}

.nancy-avatar-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

.nancy-launcher-pulse {
  position: absolute;
  right: 8px;
  bottom: 10px;
  margin-left: 0;
  border: 3px solid #fff;
}

.nancy-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.nancy-panel-brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.nancy-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.nancy-title-icon {
  width: 54px;
  height: 54px;
  padding: 3px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(29, 76, 143, 0.14), rgba(210, 154, 18, 0.2));
  border: 1px solid rgba(29, 76, 143, 0.12);
  box-shadow: 0 12px 28px rgba(26, 49, 87, 0.12);
}

.nancy-title-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.nancy-panel-head h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.03em;
  line-height: 1;
}

.nancy-eyebrow {
  display: none;
}

.nancy-inline-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 26px;
  padding: 0 10px;
  color: #4f6486;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(207, 219, 236, 0.92);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
}

.nancy-inline-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #31b36b;
}

.nancy-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nancy-head-btn,
.nancy-panel-close,
.nancy-tools-close {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  border: 1px solid #d4deec;
  background: rgba(255, 255, 255, 0.86);
  color: #243857;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.nancy-head-btn {
  border-color: rgba(63, 94, 192, 0.18);
  background: linear-gradient(135deg, rgba(22, 48, 98, 0.96), rgba(68, 100, 206, 0.92));
  color: #fff;
  box-shadow: 0 14px 28px rgba(39, 66, 131, 0.24);
}

.nancy-context-note {
  display: none !important;
}

.nancy-tools-sheet {
  position: absolute;
  top: 86px;
  left: 16px;
  right: 16px;
  z-index: 2;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(211, 221, 237, 0.96);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.16);
}

.nancy-tools-sheet[hidden] {
  display: none !important;
}

.nancy-tools-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nancy-tools-sheet-head strong {
  color: #173155;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nancy-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.nancy-tool-card {
  min-height: 84px;
  border: 1px solid rgba(216, 226, 242, 0.92);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 255, 0.96));
  display: grid;
  justify-items: start;
  align-content: center;
  gap: 10px;
  padding: 16px;
  color: #1a3157;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.nancy-tool-card i {
  color: #cc8a10;
  font-size: 16px;
}

.nancy-tool-card.is-wide {
  grid-column: 1 / -1;
}

.nancy-response {
  min-height: 0;
  padding: 4px 2px 0;
  gap: 12px;
}

.nancy-chat-bubble {
  max-width: 100%;
  padding: 14px 15px;
  border: 1px solid rgba(219, 228, 242, 0.94);
  border-radius: 22px;
  background: rgba(249, 251, 255, 0.96);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
}

.nancy-chat-bubble.is-user {
  max-width: 88%;
  margin-left: auto;
  background: linear-gradient(135deg, rgba(24, 52, 95, 0.96), rgba(52, 87, 168, 0.92));
  color: #fff;
  border-color: transparent;
}

.nancy-chat-bubble.is-assistant {
  background: rgba(255, 255, 255, 0.98);
}

.nancy-chat-meta {
  display: inline-block;
  margin-bottom: 6px;
  color: #7082a0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nancy-chat-bubble.is-user .nancy-chat-meta {
  color: rgba(255, 255, 255, 0.78);
}

.nancy-chat-bubble p {
  margin: 0;
}

.nancy-response-card {
  padding: 14px;
  gap: 10px;
  border: 1px solid rgba(219, 228, 242, 0.9);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.nancy-badge-row {
  gap: 8px;
}

.nancy-badge {
  padding: 7px 10px;
  font-size: 11px;
}

.nancy-detail-block {
  border: 1px solid rgba(219, 228, 242, 0.92);
  border-radius: 20px;
  background: rgba(248, 251, 255, 0.82);
  padding: 12px 14px;
}

.nancy-detail-summary {
  cursor: pointer;
  list-style: none;
  color: #18345f;
  font-size: 12px;
  font-weight: 800;
}

.nancy-detail-summary::-webkit-details-marker {
  display: none;
}

.nancy-detail-summary::after {
  content: "+";
  float: right;
  color: #60708c;
}

.nancy-detail-block[open] .nancy-detail-summary::after {
  content: "-";
}

.nancy-detail-block .nancy-list,
.nancy-detail-block .nancy-suggestion-list,
.nancy-detail-block .nancy-match-list {
  margin-top: 10px;
}

.nancy-suggestion-card,
.nancy-match-card {
  padding: 12px;
  gap: 8px;
  box-shadow: none;
}

.nancy-suggestion-card p,
.nancy-match-card p {
  font-size: 12px;
}

.nancy-starter-row {
  display: none !important;
}

.nancy-assistant.is-public-mode .nancy-starter-row {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.nancy-starter-chip {
  min-height: 36px;
  border: 1px solid #d8e2f2;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  padding: 0 12px;
  color: #23416c;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.nancy-starter-chip:hover,
.nancy-tool-card:hover,
.nancy-head-btn:hover,
.nancy-panel-close:hover,
.nancy-tools-close:hover,
.nancy-send-btn:hover {
  transform: translateY(-1px);
}

.nancy-form {
  gap: 0;
}

.nancy-composer {
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: stretch;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(216, 226, 242, 0.96);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.06);
}

.nancy-form textarea {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  padding: 8px 10px;
  resize: none;
  box-shadow: none;
  font-size: 14px;
}

.nancy-form textarea:focus {
  box-shadow: none;
}

.nancy-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #17345f, #4d73df);
  box-shadow: 0 14px 24px rgba(37, 63, 128, 0.24);
}

.nancy-response-kicker,
.nancy-response-head,
.nancy-form-label,
.nancy-form-actions,
.nancy-hero-card,
.nancy-context-strip,
.nancy-sample-prompts,
.nancy-quick-grid,
.nancy-launcher-copy,
.nancy-status-row {
  display: none !important;
}

@media (max-width: 1024px) {
  .nancy-panel {
    width: min(352px, calc(100vw - 20px));
    max-height: calc(100vh - var(--site-nav-height, 0px) - 24px);
  }
}

@media (max-width: 640px) {
  .nancy-launcher {
    width: 66px;
    min-width: 66px;
    height: 66px;
  }

  .nancy-launcher-avatar {
    width: 54px;
    height: 54px;
  }

  .nancy-panel {
    width: 100%;
    max-height: min(74vh, 620px);
    border-radius: 24px;
    padding: 12px;
  }

  .nancy-tool-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Nancy anchored floating widget tune */
.nancy-assistant {
  align-items: end;
  gap: 10px;
}

.nancy-assistant.is-studio-draft {
  right: 24px;
  bottom: 24px;
}

.nancy-panel {
  order: 1;
  width: min(332px, calc(100vw - 24px));
  height: min(538px, calc(100dvh - var(--site-nav-height, 0px) - 56px));
  min-height: min(438px, calc(100dvh - var(--site-nav-height, 0px) - 56px));
  max-height: calc(100dvh - var(--site-nav-height, 0px) - 56px);
  padding: 14px;
  border-radius: 10px;
}

.nancy-launcher {
  order: 2;
  align-self: end;
  width: 48px;
  min-width: 48px;
  height: 48px;
  padding: 3px;
}

.nancy-launcher-avatar {
  width: 36px;
  height: 36px;
}

.nancy-launcher-pulse {
  right: 4px;
  bottom: 5px;
  width: 10px;
  height: 10px;
  border-width: 2px;
}

.nancy-title-row {
  gap: 10px;
}

.nancy-title-icon {
  width: 40px;
  height: 40px;
  padding: 2px;
  border-radius: 8px;
}

.nancy-panel-head {
  align-items: flex-start;
  margin-top: -2px;
}

.nancy-panel-head h2 {
  font-size: 18px;
}

.nancy-inline-status {
  min-height: 20px;
  padding: 0 7px;
  border-radius: 8px;
  border: 1px solid rgba(198, 230, 210, 0.96);
  background: #ebf9f0;
  color: #146847;
  font-size: 11px;
}

.nancy-head-btn,
.nancy-panel-close,
.nancy-panel-dismiss,
.nancy-tools-close {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #476185;
  box-shadow: none;
}

.nancy-tools-sheet {
  top: 58px;
  left: 14px;
  right: 14px;
  padding: 12px;
  border-radius: 10px;
}

.nancy-tool-card {
  min-height: 54px;
  padding: 8px;
  border-radius: 8px;
  gap: 6px;
  font-size: 10px;
}

.nancy-detail-block {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
}

.nancy-chat-bubble {
  border-radius: 14px;
  box-shadow: none;
}

.nancy-chat-bubble.is-assistant {
  border-radius: 14px 14px 14px 8px;
}

.nancy-chat-bubble.is-user {
  border-radius: 14px 14px 8px 14px;
}

.nancy-composer {
  border-radius: 10px;
}

.nancy-form textarea {
  border-radius: 8px;
}

.nancy-send-btn {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 0;
}

@media (max-width: 1024px) {
  .nancy-panel {
    width: min(320px, calc(100vw - 20px));
    height: min(520px, calc(100dvh - var(--site-nav-height, 0px) - 44px));
    max-height: calc(100dvh - var(--site-nav-height, 0px) - 44px);
  }
}

@media (max-width: 640px) {
  .nancy-assistant,
  .nancy-assistant.is-studio-draft {
    left: auto;
    right: 12px;
    bottom: 12px;
    justify-items: end;
  }

  .nancy-launcher {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }

  .nancy-launcher-avatar {
    width: 32px;
    height: 32px;
  }

  .nancy-panel {
    width: min(312px, calc(100vw - 24px));
    height: min(500px, calc(100dvh - 24px));
    min-height: min(420px, calc(100dvh - 24px));
    max-height: calc(100dvh - 24px);
    padding: 12px;
    border-radius: 10px;
  }
}

/* Nancy language and chat polish */
.nancy-assistant.has-language .nancy-language-gate {
  display: none !important;
}

.nancy-language-gate {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(216, 226, 242, 0.96);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
}

.nancy-quick-tools {
  display: none !important;
}

.nancy-quick-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(214, 223, 240, 0.96);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.98);
  color: #26436f;
  font: inherit;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.nancy-quick-tool i {
  font-size: 11px;
  color: #d96ba5;
}

.nancy-quick-tool:hover,
.nancy-quick-tool:focus-visible {
  border-color: rgba(91, 130, 223, 0.42);
  background: rgba(246, 249, 255, 0.98);
  color: #1d3761;
  outline: none;
}

.nancy-language-prompt,
.nancy-settings-label {
  margin: 0;
  color: #193156;
  font-size: 11px;
  font-weight: 800;
}

.nancy-engine-note {
  margin: 0 0 8px;
  color: #5d6b85;
  font-size: 10.5px;
  line-height: 1.5;
}

.nancy-settings-block {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.nancy-language-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nancy-language-btn {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #d7e1ef;
  border-radius: 8px;
  background: #fff;
  color: #21416d;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.nancy-language-btn.is-active {
  border-color: rgba(63, 94, 192, 0.22);
  background: linear-gradient(135deg, rgba(23, 52, 95, 0.96), rgba(77, 115, 223, 0.92));
  color: #fff;
}

.nancy-response {
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(224, 123, 176, 0.4) transparent;
  gap: 10px;
  padding: 4px 2px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.nancy-response::-webkit-scrollbar {
  width: 4px;
}

.nancy-response::-webkit-scrollbar-track {
  background: transparent;
}

.nancy-response::-webkit-scrollbar-thumb {
  background: rgba(224, 123, 176, 0.42);
  border-radius: 999px;
  border: 0;
}

.nancy-composer {
  grid-template-columns: minmax(0, 1fr) 28px;
  min-height: 52px;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid rgba(88, 127, 224, 0.42);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: none;
  align-items: center;
}

.nancy-composer:focus-within {
  border-color: #5b82df;
  box-shadow: 0 0 0 3px rgba(91, 130, 223, 0.14);
}

.nancy-form textarea {
  min-height: 24px;
  max-height: 96px;
  padding: 0;
  line-height: 1.4;
  overflow-y: auto;
  color: #183255;
  font-size: 12.5px;
  align-self: center;
}

.nancy-form textarea::placeholder {
  color: #7a89a3;
}

.nancy-send-btn {
  display: grid !important;
  place-items: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 0;
  padding: 0;
  align-self: center;
  justify-self: center;
  background: transparent;
  box-shadow: none;
  color: #d96ba5;
  margin-right: 2px;
}

.nancy-send-btn i {
  font-size: 18px;
}

.nancy-badge-row {
  gap: 6px;
  margin-top: -2px;
}

.nancy-badge {
  padding: 4px 7px;
  font-size: 9.5px;
}

.nancy-detail-summary {
  font-size: 10.5px;
}

.nancy-detail-block .nancy-list,
.nancy-detail-block .nancy-suggestion-list,
.nancy-detail-block .nancy-match-list {
  margin-top: 8px;
}

.nancy-suggestion-card,
.nancy-match-card {
  padding: 9px;
  border-radius: 8px;
}

.nancy-mini-btn {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 10px;
}

.nancy-chat-bubble {
  position: relative;
  max-width: 92%;
  padding: 10px 11px;
  border: 1px solid rgba(220, 228, 242, 0.96);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 22px rgba(18, 32, 61, 0.06);
}

.nancy-chat-bubble.is-assistant {
  border-left: 3px solid rgba(77, 115, 223, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 250, 255, 0.98));
}

.nancy-chat-bubble.is-user {
  border: 0;
  box-shadow: 0 14px 28px rgba(24, 52, 95, 0.2);
}

.nancy-chat-bubble p {
  font-size: 12px;
  line-height: 1.55;
  color: inherit;
  margin: 0;
}

.nancy-message-body {
  display: grid;
  gap: 8px;
}

.nancy-message-body strong {
  font-weight: 800;
}

.nancy-message-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.nancy-message-list li {
  line-height: 1.55;
}

.nancy-chat-meta {
  display: none !important;
}

.nancy-chat-bubble.is-assistant {
  border-left: 3px solid rgba(224, 123, 176, 0.56);
  background: linear-gradient(180deg, rgba(255, 244, 250, 0.99), rgba(255, 232, 244, 0.98));
  color: #6f2350;
}

.nancy-chat-bubble.is-user {
  background: linear-gradient(135deg, rgba(233, 248, 238, 0.98), rgba(207, 238, 220, 0.95));
  color: #1d5f43;
}

.nancy-draft-preview {
  margin: 2px 0 0;
  color: #5a6485;
  font-size: 11px;
  line-height: 1.5;
}

.nancy-head-actions {
  align-self: flex-start;
  gap: 10px;
  margin-top: -6px;
}

.nancy-panel {
  padding-top: 12px;
}

.nancy-head-btn:hover,
.nancy-panel-close:hover,
.nancy-panel-dismiss:hover,
.nancy-tools-close:hover,
.nancy-send-btn:hover {
  color: #c75796;
  transform: none;
}

.nancy-typing-row {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 0 2px 2px;
}

.nancy-typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 20px;
}

.nancy-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(219, 115, 167, 0.56);
  box-shadow: none;
  opacity: 0.2;
  transform: translateY(0) scale(0.92);
  animation: nancyTypingDot 1s ease-in-out infinite;
}

.nancy-typing-dot:nth-child(2) {
  animation-delay: 0.16s;
}

.nancy-typing-dot:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes nancyTypingDot {
  0%, 80%, 100% {
    opacity: 0.2;
    transform: translateY(0) scale(0.92);
  }

  40% {
    opacity: 0.58;
    transform: translateY(-3px) scale(1);
  }
}

/* Nancy public mode and fixed-height chat stability */
.nancy-assistant.is-public-mode .nancy-head-btn[data-nancy-tools-toggle] {
  display: none !important;
}

.nancy-assistant.is-public-mode .nancy-head-actions {
  gap: 8px;
}

.nancy-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.nancy-response {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.nancy-form {
  margin-top: 0;
}

@media (max-width: 640px) {
  .nancy-panel {
    bottom: calc(100% + 8px);
  }
}
