.ph-ai-widget {
  position: fixed;
  bottom: 20px;
  z-index: 999999
}

.ph-ai-align-right {
  right: 20px
}

.ph-ai-align-left {
  left: 20px
}

.ph-ai-align-center {
  left: 50%;
  transform: translateX(-50%)
}

.ph-ai-fab {
  border: none;
  border-radius: 25px;
  box-shadow: 0 8px 24px rgba(0,0,0,.16);
  cursor: pointer;
  transition: transform .15s ease,box-shadow .15s ease;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px
}

.ph-ai-fab img {
  display: block;
  margin: 0;
  border-radius: 40px
}

.ph-ai-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0,0,0,.18)
}

.ph-ai-fab-caption {
  font-weight: 600;
  white-space: nowrap
}

.ph-ai-panel {
  position: fixed;
  bottom: 90px;
  right: 20px;
  overflow: hidden;
  display: none;
  flex-direction: column;
  box-shadow: 0 12px 32px rgba(0,0,0,.18);
  border: 0
}

.ph-ai-panel.is-open {
  display: flex
}

.ph-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  line-height: 1.2;
  min-height: 36px
}

.ph-ai-header-title {
  font-weight: 600
}

.ph-ai-header-title h4 {
  margin: 0;
  color: #fff
}

.ph-ai-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px
}

.ph-ai-header-btn {
  background: 0 0;
  border: 0;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: .95
}

.ph-ai-header-btn:hover {
  opacity: 1
}

.ph-ai-header-btn img {
  width: 36px;
  height: 16px;
  display: block
}

.ph-ai-collapse.rotated img {
  transform: rotate(180deg);
  transition: transform .2s ease
}

.ph-ai-messages {
  flex: auto;
  padding: 12px 12px 16px;
  overflow: auto;
  background: #fafafa;
  overscroll-behavior: contain
}

.ph-ai-msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 0;
  padding: 0 4px
}

.ph-ai-msg.user+.ph-ai-msg.user,.ph-ai-msg.bot+.ph-ai-msg.bot {
  margin-top: 4px
}

.ph-ai-msg.user+.ph-ai-msg.bot,.ph-ai-msg.bot+.ph-ai-msg.user {
  margin-top: 16px
}

.ph-ai-msg .avatar {
  width: var(--aw-avatar-size,32px);
  height: var(--aw-avatar-size,32px);
  border-radius: 999px;
  flex: 0 0 var(--aw-avatar-size,32px);
  background: #e0e0ff;
  display: flex;
  align-items: center;
  justify-content: center
}

.ph-ai-msg .avatar img {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
  display: block
}

.ph-ai-msg .bubble {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.5;
  font-size: 14px;
  box-shadow: 0 1px 1px rgba(0,0,0,3%);
  word-wrap: break-word;
  overflow-wrap: anywhere
}

.ph-ai-msg.bot .bubble {
  background: var(--aw-bot-bubble-bg,#dbd5ff);
  color: var(--aw-bot-text,#2f2177);
  border-top-left-radius: 4px
}

.ph-ai-msg.user {
  flex-direction: row-reverse
}

.ph-ai-msg.user .bubble {
  background: var(--aw-user-bubble-bg,#c9ffe2);
  color: var(--aw-user-text,#032f18);
  border-top-right-radius: 4px
}

.ph-ai-msg.bot+.ph-ai-msg.bot .bubble {
  border-top-left-radius: 8px
}

.ph-ai-msg.user+.ph-ai-msg.user .bubble {
  border-top-right-radius: 8px
}

.ph-ai-msg .bubble p {
  margin: 0 0 6px
}

.ph-ai-msg .bubble p:last-child {
  margin-bottom: 0
}

.ph-ai-msg .bubble ul,.ph-ai-msg .bubble ol {
  margin: 6px 0 6px 18px;
  padding: 0 0 0 5px
}

.ph-ai-msg .bubble a {
  color: #00436b;
  text-decoration: underline !important;
}

.ph-ai-msg .bubble img,.ph-ai-msg .bubble video,.ph-ai-msg .bubble iframe {
  max-width: 100%;
  height: auto;
  border-radius: 8px
}

.ph-ai-faq-row {
  margin: 8px 0 10px;
  padding: 0 4px
}

.ph-ai-faq-suggest {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap
}

.ph-ai-faq-label {
  font-weight: 600;
  margin-right: 4px
}

.ph-ai-faq-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px
}

.ph-ai-faq-btn {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px
}

.ph-ai-faq-btn:hover {
  background: #f8f8f8
}

.ph-ai-panel.is-collapsed .ph-ai-messages {
  flex: 0 0;
  height: 0;
  padding: 0;
  overflow: hidden
}

.ph-ai-input {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(0,0,0,6%);
  background: #fff
}

.ph-ai-text {
  flex: 1;
  border: 1px solid #eaeaea;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: var(--aw-input-fs,16px)
}

.ph-ai-send {
  background: var(--aw-send-bg,#6a52e2);
  border: 0;
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer
}

.ph-ai-send[disabled] {
  opacity: .6;
  cursor: not-allowed;
  filter: grayscale(20%)
}

.ph-ai-send img {
  width: 18px;
  height: 18px;
  display: block
}

.ph-ai-footer {
  border-top: 1px solid rgba(0,0,0,6%);
  padding: 8px 12px
}

.ph-ai-footer-text {
  text-align: center;
  line-height: 1.4
}

.ph-ai-footer-text a {
  color: inherit
}

.ph-ai-typing .bubble {
  opacity: .95
}

.aw-typing-text {
  display: inline-block;
  min-width: 140px
}

.ph-ai-tool-hint {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #64748b;
  padding-top: 6px;
  border-top: 1px dashed rgba(0,0,0,8%)
}

@media(max-width: 640px) {
  .ph-ai-widget {
    left:0!important;
    right: 0!important
  }

  .ph-ai-fab {
    position: fixed;
    bottom: 100px;
    right: 14px
  }

  .ph-ai-panel {
    left: 0!important;
    right: 0!important;
    bottom: 0!important;
    width: 100%!important;
    height: 100dvh!important;
    border-radius: 0!important
  }

  .ph-ai-msg .bubble {
    max-width: 92%
  }
}

@media(max-width: 640px) {
  html.ph-ai-no-scroll,body.ph-ai-no-scroll {
    overflow:hidden!important;
    height: 100%!important
  }

  body.ph-ai-no-scroll {
    position: fixed;
    width: 100%
  }
}

.ph-ai-row-full {
  margin: 8px 0 4px
}

.ph-ai-docs {
  margin-top: 10px
}

.ph-ai-doc-heading {
  font-weight: 600;
  margin: 6px 2px 8px;
  font-size: 14px;
  color: #111827
}

.ph-ai-doc-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch
}

.ph-ai-doc-scroll::-webkit-scrollbar {
  height: 8px
}

.ph-ai-doc-scroll::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.12);
  border-radius: 8px
}

.ph-ai-doc-card {
  flex: none;
  min-width: 240px;
  max-width: 280px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,4%);
  overflow: hidden;
  display: flex;
  flex-direction: column
}

.ph-ai-doc-img {
  width: 100%;
  aspect-ratio: 4/4;
  background: #f6f7fb;
  overflow: hidden
}

.ph-ai-doc-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block
}

.ph-ai-doc-body {
  padding: 10px
}

.ph-ai-doc-name {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
  margin-bottom: 4px;
  color: #0f172a
}

.ph-ai-doc-meta {
  font-size: 12px;
  color: #475569;
  margin-bottom: 10px
}

.ph-ai-doc-sched {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 10px
}

.ph-ai-skel-lines {
  display: grid;
  gap: 6px
}

.ph-ai-skel-lines span {
  display: block;
  height: 10px;
  background: linear-gradient(90deg,#f1f5f9,#e2e8f0,#f1f5f9);
  background-size: 200% 100%;
  border-radius: 6px;
  animation: ph-skel 1.2s ease-in-out infinite
}

@keyframes ph-skel {
  0% {
    background-position: 200% 0
  }

  100% {
    background-position: -200% 0
  }
}

.ph-ai-sched-hospital {
  font-weight: 600;
  font-size: 12px;
  color: #0f172a;
  margin-bottom: 6px
}

.ph-ai-sched-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px
}

.ph-ai-sched-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: #1f2937
}

.ph-ai-sched-item .day {
  font-weight: 600
}

.ph-ai-sched-item .time {
  font-family: ui-monospace,Menlo,monospace;
  background: #fff;
  border: 1px solid #e5e7eb;
  padding: 2px 6px;
  border-radius: 6px
}

.ph-ai-sched-item .badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #eef2ff;
  color: #3730a3
}

.ph-ai-doc-ctas {
  display: flex;
  gap: 8px
}

.ph-ai-doc-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827!important;
  padding: 8px 10px;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer
}

.ph-ai-doc-btn:hover {
  background: #f9fafb
}

.ph-ai-doc-primary {
  background: #00436b;
  border-color: #00436b;
  color: #fff!important
}

.ph-ai-doc-primary:hover {
  background: #00436b;
  border-color: #00436b
}

.ph-ai-doc-modal {
  width: 100%;
  max-width: 720px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 48px rgba(0,0,0,.2);
  position: relative;
  overflow: hidden
}

.ph-ai-doc-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer
}

.ph-ai-doc-close:before {
  content: '\00d7';
  display: block;
  font-size: 20px;
  line-height: 34px;
  text-align: center;
  color: #111827
}

.ph-ai-doc-modal-content {
  padding: 14px
}

.ph-ai-doc-modal-img {
  width: 100%;
  background: #f6f7fb
}

.ph-ai-doc-modal-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block
}

.ph-ai-doc-modal-title {
  margin: 10px 0 4px;
  font-size: 18px
}

.ph-ai-doc-modal-meta {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 10px
}

.ph-ai-doc-modal-desc {
  font-size: 14px;
  color: #0f172a;
  line-height: 1.6
}

.ph-ai-doc-modal-ctas {
  display: flex;
  gap: 10px;
  margin-top: 14px
}

@media(max-width: 640px) {
  .ph-ai-doc-card {
    min-width:220px
  }
}

.ph-ai-book-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.6);
  z-index: 1000001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0
}

.ph-ai-book-overlay.is-open {
  display: flex
}

.ph-ai-book-modal {
  position: relative;
  width: 96vw;
  height: 92vh;
  max-width: 1200px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.45);
  display: flex;
  flex-direction: column
}

.ph-ai-book-header {
  position: relative;
  background: #015c80;
  color: #fff;
  padding: 10px 48px 10px 14px;
  font-weight: 600;
  font-size: 15px
}

.ph-ai-book-title {
  margin: 0;
  color: #fff
}

.ph-ai-book-close {
  position: absolute;
  top: 0;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.18);
  color: #fff;
  cursor: pointer;
  z-index: 2
}

.ph-ai-book-close:before {
  content: '\00d7';
  display: block;
  font-size: 22px;
  line-height: 38px;
  text-align: center
}

.ph-ai-book-iframe {
  flex: auto;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff
}

@media(max-width: 640px) {
  .ph-ai-book-modal {
    width:100vw;
    height: 100dvh;
    border-radius: 0
  }
}
