.mac-sarah-widget,
.mac-sarah-widget * {
  box-sizing: border-box;
}

.mac-sarah-widget {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.mac-sarah-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 999998;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px 10px 10px;
  color: #fff;
  background: linear-gradient(145deg, #111, #000);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .18);
  cursor: pointer;
}

.mac-sarah-launcher span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #111;
  background: linear-gradient(160deg, #fff, #d8d8d8);
  font-weight: 900;
}

.mac-sarah-launcher strong {
  font-size: 14px;
}

.mac-sarah-panel {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 999999;
  width: min(390px, calc(100vw - 28px));
  height: min(650px, calc(100vh - 118px));
  min-height: 470px;
  display: none;
  grid-template-rows: auto 1fr auto auto auto;
  overflow: hidden;
  border-radius: 30px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(255, 255, 255, .75);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .95);
  backdrop-filter: blur(24px) saturate(1.2);
}

.mac-sarah-panel[data-open="true"] {
  display: grid;
}

.mac-sarah-top {
  padding: 16px;
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0)), #050505;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mac-sarah-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mac-sarah-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #111;
  background: linear-gradient(145deg, #fff, #d7d7d7);
  font-weight: 900;
}

.mac-sarah-top h2 {
  margin: 0;
  color: #fff;
  font-size: 16px;
  line-height: 1.1;
}

.mac-sarah-top p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
}

.mac-sarah-top p span {
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .14);
}

.mac-sarah-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, .08);
  cursor: pointer;
  font-weight: 800;
}

.mac-sarah-messages {
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .78), rgba(245, 245, 245, .92)), #f7f7f7;
}

.mac-sarah-row {
  display: flex;
  margin: 0 0 10px;
}

.mac-sarah-row.visitor {
  justify-content: flex-end;
}

.mac-sarah-bubble {
  max-width: 82%;
  border-radius: 20px;
  padding: 11px 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 9px 24px rgba(0, 0, 0, .08);
}

.mac-sarah-row.visitor .mac-sarah-bubble {
  color: #fff;
  background: #080808;
}

.mac-sarah-row.sarah .mac-sarah-bubble,
.mac-sarah-row.agent .mac-sarah-bubble {
  color: #111;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .07);
}

.mac-sarah-row.system .mac-sarah-bubble {
  max-width: 100%;
  margin: 0 auto;
  color: #555;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
}

.mac-sarah-quick {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px 12px;
  background: #f7f7f7;
}

.mac-sarah-quick button {
  flex: 0 0 auto;
  height: 34px;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 999px;
  padding: 0 12px;
  color: #111;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.mac-sarah-form {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .95);
  border-top: 1px solid rgba(0, 0, 0, .08);
}

.mac-sarah-form textarea {
  width: 100%;
  height: 44px;
  max-height: 110px;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 18px;
  resize: none;
  padding: 12px 13px;
  outline: none;
  color: #111;
  background: #f7f7f7;
  font-size: 14px;
  line-height: 1.35;
}

.mac-sarah-form button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #050505;
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
}

.mac-sarah-form button:disabled {
  opacity: .45;
  cursor: wait;
}

.mac-sarah-panel footer {
  padding: 0 14px 12px;
  text-align: center;
  color: #6f6f6f;
  background: rgba(255, 255, 255, .95);
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 520px) {
  .mac-sarah-launcher {
    right: 16px;
    bottom: 16px;
  }

  .mac-sarah-panel {
    inset: auto 10px 10px 10px;
    width: auto;
    height: min(720px, calc(100vh - 20px));
    min-height: 0;
    border-radius: 28px;
  }
}
