.osher-assistant {
  --osher-blue: #087cff;
  --osher-blue-2: #00b7ff;
  --osher-navy: #061a3a;
  --osher-ink: #0b1f3f;
  --osher-muted: #5d6d83;
  --osher-gold: #d8a43a;
  --osher-sky: #eaf7ff;
  --osher-line: rgba(8, 124, 255, 0.18);
  --osher-card: rgba(255, 255, 255, 0.94);
  color: var(--osher-ink);
  direction: rtl;
  font-family: inherit;
  position: fixed;
  z-index: 9999;
  inset: auto 20px 20px auto;
}

.osher-toggle {
  width: 66px;
  height: 66px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  background: linear-gradient(135deg, #ffffff, #dff5ff);
  box-shadow: 0 16px 44px rgba(8, 124, 255, 0.28);
  display: grid;
  place-items: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.osher-toggle:hover,
.osher-toggle:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 20px 52px rgba(8, 124, 255, 0.34);
  outline: 3px solid rgba(0, 183, 255, 0.24);
  outline-offset: 3px;
}

.osher-toggle img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
}

.osher-window {
  position: absolute;
  right: 0;
  bottom: 82px;
  width: min(380px, calc(100vw - 24px));
  max-height: min(560px, calc(100vh - 116px));
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--osher-line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 0%, rgba(0, 183, 255, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,251,255,0.98));
  box-shadow: 0 26px 80px rgba(6, 26, 58, 0.22);
  backdrop-filter: blur(18px);
}

.osher-assistant.is-open .osher-window { display: flex; }

.osher-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--osher-line);
  background: rgba(255, 255, 255, 0.76);
}

.osher-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(8, 124, 255, 0.18);
}

.osher-title {
  flex: 1;
  min-width: 0;
  line-height: 1.2;
}

.osher-title strong {
  display: block;
  font-size: 1.02rem;
  color: var(--osher-navy);
}

.osher-title span {
  display: block;
  margin-top: 0.16rem;
  color: var(--osher-muted);
  font-size: 0.82rem;
}

.osher-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--osher-line);
  border-radius: 50%;
  background: #fff;
  color: var(--osher-navy);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.osher-close:focus-visible,
.osher-option:focus-visible,
.osher-input button:focus-visible,
.osher-input input:focus-visible {
  outline: 3px solid rgba(8, 124, 255, 0.22);
  outline-offset: 2px;
}

.osher-body {
  flex: 1;
  min-height: 260px;
  overflow-y: auto;
  padding: 1rem;
  scroll-behavior: smooth;
}

.osher-message {
  display: flex;
  margin: 0 0 0.72rem;
}

.osher-message span {
  max-width: 88%;
  padding: 0.78rem 0.88rem;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.osher-message-bot { justify-content: flex-start; }
.osher-message-user { justify-content: flex-end; }

.osher-message-bot span {
  background: #fff;
  border: 1px solid var(--osher-line);
  color: var(--osher-ink);
  border-start-start-radius: 7px;
}

.osher-message-user span {
  background: linear-gradient(135deg, var(--osher-blue), var(--osher-blue-2));
  color: #fff;
  border-start-end-radius: 7px;
  box-shadow: 0 10px 24px rgba(8, 124, 255, 0.20);
}

.osher-node-title {
  display: block;
  margin-bottom: 0.28rem;
  color: var(--osher-blue);
  font-weight: 900;
}

.osher-options {
  display: grid;
  gap: 0.54rem;
  margin: 0.72rem 0 0.25rem;
}

.osher-option {
  width: 100%;
  border: 1px solid rgba(8, 124, 255, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--osher-navy);
  cursor: pointer;
  padding: 0.74rem 0.84rem;
  font: inherit;
  font-weight: 850;
  line-height: 1.35;
  text-align: right;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.osher-option:hover {
  transform: translateY(-1px);
  background: var(--osher-sky);
  border-color: rgba(8, 124, 255, 0.38);
}

.osher-option.is-link {
  border-color: rgba(216, 164, 58, 0.34);
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(255,248,226,0.96));
}

.osher-utility {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  padding: 0 1rem 0.78rem;
}

.osher-utility .osher-option {
  flex: 1 1 0;
  min-width: 96px;
  padding: 0.62rem 0.62rem;
  text-align: center;
  font-size: 0.86rem;
  background: rgba(234, 247, 255, 0.78);
}

.osher-input {
  display: flex;
  gap: 0.48rem;
  padding: 0.8rem 1rem 1rem;
  border-top: 1px solid var(--osher-line);
  background: rgba(255, 255, 255, 0.78);
}

.osher-input input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--osher-line);
  border-radius: 999px;
  padding: 0.78rem 0.9rem;
  font: inherit;
  color: var(--osher-ink);
  background: #fff;
}

.osher-input button {
  border: 0;
  border-radius: 999px;
  padding: 0 0.94rem;
  font: inherit;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, var(--osher-blue), var(--osher-blue-2));
  cursor: pointer;
}

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

@media (max-width: 680px) {
  .osher-assistant {
    inset: auto 12px 12px auto;
  }

  .osher-toggle {
    width: 62px;
    height: 62px;
  }

  .osher-toggle img {
    width: 54px;
    height: 54px;
  }

  .osher-window {
    position: fixed;
    right: 10px;
    left: 10px;
    bottom: 82px;
    width: auto;
    max-height: min(620px, calc(100vh - 100px));
    border-radius: 22px;
  }

  .osher-message span {
    max-width: 94%;
    font-size: 0.94rem;
  }

  .osher-option,
  .osher-input button {
    min-height: 44px;
  }
}
