.noor-assistant {
  position: fixed;
  z-index: 90;
  right: clamp(14px, 2.2vw, 30px);
  bottom: max(18px, env(safe-area-inset-bottom));
  color: var(--ink);
  font-family: Inter, "Segoe UI", "Noto Sans Bengali", "Hind Siliguri", sans-serif;
}

.noor-assistant[hidden],
.noor-panel[hidden],
.noor-welcome[hidden] { display: none !important; }

.noor-launcher {
  position: relative;
  display: grid;
  width: 68px;
  height: 68px;
  margin-left: auto;
  place-items: center;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
  background: #8b3159;
  box-shadow: 0 14px 34px rgba(89, 25, 58, .32), 0 0 0 7px rgba(201, 79, 120, .1);
  cursor: pointer;
  isolation: isolate;
  transition: box-shadow .2s ease, transform .2s ease;
}

.noor-launcher::before {
  position: absolute;
  z-index: -1;
  inset: -8px;
  border: 1px solid rgba(201, 79, 120, .28);
  border-radius: inherit;
  content: "";
  animation: noor-pulse 2.4s ease-out infinite;
}

.noor-launcher:hover,
.noor-launcher:focus-visible {
  box-shadow: 0 18px 42px rgba(89, 25, 58, .38), 0 0 0 8px rgba(201, 79, 120, .13);
  outline: none;
  transform: translateY(-2px) scale(1.02);
}

.noor-launcher img { width: 60px; height: 60px; }
.noor-launcher-status {
  position: absolute;
  right: 2px;
  bottom: 4px;
  width: 13px;
  height: 13px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #2fa869;
}

.noor-welcome {
  position: absolute;
  right: 4px;
  bottom: 84px;
  width: min(295px, calc(100vw - 36px));
  padding: 13px 16px;
  border: 1px solid rgba(225, 180, 197, .85);
  border-radius: 18px 18px 5px 18px;
  background: rgba(255, 253, 253, .98);
  box-shadow: 0 16px 42px rgba(82, 30, 54, .17);
  animation: noor-pop .36s ease both;
}

.noor-welcome::after {
  position: absolute;
  right: 17px;
  bottom: -7px;
  width: 13px;
  height: 13px;
  border-right: 1px solid rgba(225, 180, 197, .85);
  border-bottom: 1px solid rgba(225, 180, 197, .85);
  background: #fffdfd;
  content: "";
  transform: rotate(45deg);
}

.noor-welcome strong,
.noor-welcome span { display: block; }
.noor-welcome strong { margin-bottom: 2px; color: var(--deep); font-family: "Noto Serif Bengali", Georgia, serif; font-size: .93rem; }
.noor-welcome span { color: var(--muted); font-size: .76rem; line-height: 1.45; }

.noor-panel {
  position: absolute;
  right: 0;
  bottom: 86px;
  display: grid;
  overflow: hidden;
  width: min(405px, calc(100vw - 28px));
  height: min(680px, calc(100vh - 130px));
  height: min(680px, calc(100dvh - 130px));
  min-height: 475px;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  border: 1px solid rgba(228, 190, 204, .92);
  border-radius: 25px;
  background: rgba(255, 252, 253, .985);
  box-shadow: 0 26px 80px rgba(70, 22, 47, .27);
  animation: noor-panel-in .25s ease both;
  transform-origin: 90% 100%;
}

.noor-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, .24);
  background: linear-gradient(135deg, #712345, #a93d68 64%, #ce5779);
  color: #fff;
}

.noor-panel-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.noor-panel-identity img { flex: 0 0 auto; width: 43px; height: 43px; filter: drop-shadow(0 6px 10px rgba(54, 13, 35, .2)); }
.noor-panel-identity span,
.noor-panel-identity strong,
.noor-panel-identity small { display: block; }
.noor-panel-identity strong { font-family: "Noto Serif Bengali", Georgia, serif; font-size: 1.08rem; letter-spacing: .01em; }
.noor-panel-identity small { overflow: hidden; color: rgba(255, 255, 255, .82); font-size: .67rem; text-overflow: ellipsis; white-space: nowrap; }
.noor-panel-controls { display: flex; gap: 7px; }
.noor-panel-controls button {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  box-shadow: none;
  color: #fff;
  font-size: 1rem;
  line-height: 1;
}
.noor-panel-controls button:hover,
.noor-panel-controls button:focus-visible { background: rgba(255, 255, 255, .22); box-shadow: none; outline: 2px solid rgba(255,255,255,.35); }
.noor-panel-controls button[aria-pressed="true"] { opacity: .56; }

.noor-transcript {
  overflow-x: hidden;
  overflow-y: auto;
  padding: 17px 15px 10px;
  background:
    radial-gradient(circle at 95% 0, rgba(248, 211, 229, .44), transparent 13rem),
    linear-gradient(180deg, #fffafb, #fffdfd);
  overscroll-behavior: contain;
  scrollbar-color: #dba1b5 transparent;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.noor-message {
  width: auto;
  width: fit-content;
  max-width: 88%;
  margin: 0 0 11px;
  padding: 10px 13px;
  border-radius: 16px 16px 16px 5px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(94, 32, 60, .08);
  color: #644454;
  font-size: .79rem;
  line-height: 1.56;
  animation: noor-message-in .2s ease both;
}

.noor-message.noor-message-user {
  margin-left: auto;
  border-radius: 16px 16px 5px 16px;
  background: linear-gradient(135deg, #a93d68, #ca557a);
  color: #fff;
}

.noor-message strong { color: var(--deep); }
.noor-message.noor-message-user strong { color: #fff; }

.noor-actions {
  position: relative;
  display: grid;
  max-height: min(230px, 34vh);
  max-height: min(230px, 34dvh);
  gap: 8px;
  overflow-y: auto;
  padding: 9px 15px 13px;
  border-top: 1px solid rgba(238, 212, 221, .72);
  background: #fffdfd;
  overscroll-behavior: contain;
  scrollbar-color: #dba1b5 transparent;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.noor-actions.has-more-actions { box-shadow: inset 0 -18px 18px -20px rgba(85, 29, 55, .52); }
.noor-action-overflow-cue {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 35px;
  padding: 5px 12px;
  border: 0;
  border-top: 1px solid #efd7df;
  border-radius: 0;
  background: linear-gradient(180deg, #fff8fa, #ffedf3);
  box-shadow: none;
  color: var(--rose-dark);
  font: inherit;
  font-size: .66rem;
  font-weight: 900;
  cursor: pointer;
}
.noor-action-overflow-cue::after { content: "↓"; font-size: .88rem; animation: noor-scroll-nudge 1.25s ease-in-out infinite; }
.noor-action-overflow-cue:hover, .noor-action-overflow-cue:focus-visible { background: #ffe4ed; box-shadow: none; outline: 2px solid rgba(201,79,120,.14); }
.noor-action-overflow-cue[hidden] { display: none !important; }

.noor-actions.has-filter-form {
  overflow: hidden;
  height: min(310px, 36vh);
  height: min(310px, 36dvh);
  max-height: none;
  padding: 0;
}

.noor-actions.has-filter-form .noor-filter-form {
  display: grid;
  overflow: hidden;
  height: 100%;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 0;
}

.noor-filter-scroll {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 0;
  padding: 11px 15px 16px;
  background: #fffdfd;
  overscroll-behavior: contain;
  scrollbar-color: #c87896 #faedf2;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.noor-filter-scroll.has-more-content {
  box-shadow: inset 0 -18px 18px -20px rgba(85, 29, 55, .48);
}

.noor-filter-fields { display: grid; gap: 9px; }
.noor-scroll-cue {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 34px;
  padding: 5px 12px;
  border: 0;
  border-top: 1px solid #efd7df;
  border-radius: 0;
  background: linear-gradient(180deg, #fff8fa, #fff0f5);
  box-shadow: none;
  color: var(--rose-dark);
  font: inherit;
  font-size: .66rem;
  font-weight: 900;
  cursor: pointer;
}
.noor-scroll-cue::after { content: "↓"; font-size: .88rem; animation: noor-scroll-nudge 1.25s ease-in-out infinite; }
.noor-scroll-cue:hover, .noor-scroll-cue:focus-visible { background: #ffe8f0; box-shadow: none; outline: 2px solid rgba(201,79,120,.14); }
.noor-scroll-cue[hidden] { display: none !important; }
.noor-actions.has-filter-form .noor-form-submit { width: calc(100% - 26px); margin: 10px 13px 13px; }

.noor-action,
.noor-actions button,
.noor-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid #e5b9c9;
  border-radius: 12px;
  background: #fff7fa;
  box-shadow: none;
  color: var(--deep);
  font: inherit;
  font-size: .76rem;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.noor-action:hover,
.noor-actions button:hover,
.noor-actions a:hover,
.noor-action:focus-visible,
.noor-actions button:focus-visible,
.noor-actions a:focus-visible {
  border-color: #cf7898;
  background: #ffeaf1;
  box-shadow: none;
  color: #8d2c53;
  outline: none;
  transform: translateY(-1px);
}

.noor-action-primary,
.noor-actions .noor-action-primary,
.noor-actions .is-primary {
  border-color: transparent;
  background: linear-gradient(135deg, #b03f69, #d55c80);
  color: #fff;
}
.noor-action-primary:hover,
.noor-actions .noor-action-primary:hover,
.noor-actions .is-primary:hover { border-color: transparent; background: linear-gradient(135deg, #9b315b, #c74b73); color: #fff; }
.noor-actions .is-secondary { background: transparent; color: var(--muted); }

.noor-form,
.noor-guided-form { display: grid; gap: 9px; }
.noor-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.noor-form label,
.noor-guided-form label,
.noor-field { display: grid; gap: 5px; color: var(--deep); font-size: .69rem; font-weight: 800; }
.noor-form label.noor-form-full { grid-column: 1 / -1; }
.noor-form input,
.noor-form select,
.noor-form textarea,
.noor-guided-form input,
.noor-guided-form select,
.noor-guided-form textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid #e4bdcb;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: .76rem;
}
.noor-form textarea { min-height: 82px; resize: vertical; }
.noor-guided-form textarea { min-height: 82px; resize: vertical; }
.noor-form input:focus,
.noor-form select:focus,
.noor-form textarea:focus,
.noor-guided-form input:focus,
.noor-guided-form select:focus,
.noor-guided-form textarea:focus { border-color: #c85d82; box-shadow: 0 0 0 3px rgba(201,79,120,.11); outline: none; }
.noor-form details,
.noor-guided-form details { padding: 8px 10px; border: 1px solid #efdae2; border-radius: 11px; background: #fffafb; }
.noor-form summary,
.noor-guided-form summary { color: var(--rose-dark); font-size: .72rem; font-weight: 900; cursor: pointer; }
.noor-form details .noor-form-grid { margin-top: 9px; }
.noor-more-filters > .noor-field { margin-top: 9px; }
.noor-age-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.noor-form-submit { width: 100%; min-height: 43px; padding: 9px 13px; border: 0; border-radius: 12px; background: linear-gradient(135deg, #aa3b66, #d75c80); box-shadow: 0 9px 20px rgba(157, 50, 92, .18); color: #fff; font: inherit; font-size: .76rem; font-weight: 900; cursor: pointer; }
.noor-form-submit:hover, .noor-form-submit:focus-visible { background: linear-gradient(135deg, #973057, #c94e75); outline: 2px solid rgba(201,79,120,.18); }
.noor-form-submit:disabled { cursor: wait; opacity: .65; }
.noor-form-note { margin: 0; color: var(--muted); font-size: .68rem; line-height: 1.5; text-align: center; }
.noor-form-error { margin: 0; padding: 8px 10px; border-radius: 9px; background: #fff0f2; color: #9c3048; font-size: .7rem; font-weight: 700; }
.noor-form-status { min-height: 1em; margin: 0; color: #9c3048; font-size: .69rem; text-align: center; }
.noor-feedback-rating { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.noor-feedback-rating label { cursor: pointer; }
.noor-feedback-rating input { position: absolute; opacity: 0; pointer-events: none; }
.noor-feedback-rating span { display: grid; min-height: 38px; place-items: center; padding: 6px; border: 1px solid #e8c5d2; border-radius: 10px; background: #fff; font-size: .65rem; text-align: center; }
.noor-feedback-rating input:checked + span { border-color: #bd4b74; background: #ffedf3; color: #922e55; box-shadow: 0 0 0 2px rgba(201,79,120,.1); }

.noor-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  padding: 11px 13px 13px;
  border-top: 1px solid #eed6df;
  background: #fff;
}
.noor-composer input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #e2bdca;
  border-radius: 12px;
  background: #fffafb;
  color: var(--ink);
  font: inherit;
  font-size: .73rem;
}
.noor-composer input:focus { border-color: #c65c81; box-shadow: 0 0 0 3px rgba(201,79,120,.1); outline: none; }
.noor-composer button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #a83a65, #d45a7f);
  box-shadow: 0 8px 17px rgba(157, 50, 92, .2);
  color: #fff;
  font-size: 1rem;
}

.visually-hidden {
  position: absolute !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  margin: -1px !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}

@keyframes noor-pulse {
  0% { opacity: .7; transform: scale(.86); }
  75%, 100% { opacity: 0; transform: scale(1.3); }
}
@keyframes noor-pop {
  from { opacity: 0; transform: translateY(9px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@keyframes noor-panel-in {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@keyframes noor-message-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}
@keyframes noor-scroll-nudge {
  0%, 100% { transform: translateY(-1px); }
  50% { transform: translateY(2px); }
}

@media (max-width: 600px) {
  body.noor-panel-open { overflow: hidden; }
  .noor-assistant { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
  .noor-launcher { width: 61px; height: 61px; }
  .noor-launcher img { width: 54px; height: 54px; }
  .noor-welcome { right: 1px; bottom: 76px; }
  .noor-panel {
    position: fixed;
    top: 10px;
    top: max(10px, env(safe-area-inset-top));
    right: 10px;
    bottom: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    width: auto;
    height: auto;
    min-height: 0;
    max-height: none;
    border-radius: 22px;
  }
  .noor-panel-header { padding: 12px 13px; }
  .noor-transcript { padding: 15px 13px 8px; }
  .noor-message { max-width: 91%; text-align: left; }
  .noor-actions { max-height: min(220px, 32vh); max-height: min(220px, 32dvh); padding: 8px 13px 11px; }
  .noor-actions.has-filter-form { height: min(340px, 42vh); height: min(340px, 42dvh); padding: 0; }
  .noor-filter-scroll { padding-right: 13px; padding-left: 13px; }
  .noor-form-grid { grid-template-columns: 1fr; }
  .noor-age-row { grid-template-columns: 1fr; }
  .noor-form label.noor-form-full { grid-column: auto; }
  .noor-form label, .noor-guided-form label, .noor-field, .noor-form-note { text-align: center; }
  .noor-composer { padding: 9px 11px 11px; }
}

@media (max-width: 370px) {
  .noor-panel { right: 6px; left: 6px; border-radius: 18px; }
  .noor-panel-identity small { max-width: 155px; }
  .noor-feedback-rating { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .noor-launcher::before,
  .noor-panel,
  .noor-welcome,
  .noor-message { animation: none !important; }
  .noor-launcher,
  .noor-action,
  .noor-actions button,
  .noor-actions a { transition: none !important; }
  .noor-scroll-cue::after { animation: none !important; }
  .noor-action-overflow-cue::after { animation: none !important; }
}
