#babelGeoToolbar,
#babelGeoToolbar *,
#babelGeoWorksModal,
#babelGeoWorksModal *,
#babelGeoAiModal,
#babelGeoAiModal * {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}

#babelGeoToolbar {
  position: fixed;
  top: 5px;
  right: 188px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100vw - 92px);
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  animation: babelGeoToolbarIn .22s ease-out both;
}

.babel-geo-mark {
  display: grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid #d6dad8;
  border-radius: 5px;
  color: #fff;
  background: #0b8065;
  box-shadow: 0 1px 2px rgba(31, 42, 38, .08), inset 0 0 0 1px rgba(255, 255, 255, .12);
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 18px;
  font-weight: 800;
}

.babel-geo-account {
  display: flex;
  align-items: center;
  height: 40px;
  max-width: 120px;
  padding: 0 11px;
  overflow: hidden;
  border: 1px solid #d6dad8;
  border-radius: 5px;
  color: #405049;
  background: #fff;
  box-shadow: 0 1px 2px rgba(31, 42, 38, .08);
  font-family: "Avenir Next", "PingFang SC", sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.babel-geo-divider {
  display: none;
}

.babel-geo-title {
  display: flex;
  align-items: center;
  height: 40px;
  max-width: 180px;
  padding: 0 11px;
  overflow: hidden;
  border: 1px solid #d6dad8;
  border-radius: 5px;
  color: #5f6d67;
  background: #fff;
  box-shadow: 0 1px 2px rgba(31, 42, 38, .08);
  font-family: "Avenir Next", "PingFang SC", sans-serif;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.babel-geo-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.babel-geo-button {
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid #d6dad8;
  border-radius: 5px;
  color: #26332e;
  background: #fff;
  box-shadow: 0 1px 2px rgba(31, 42, 38, .08);
  font-family: "Avenir Next", "PingFang SC", sans-serif;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease, color .14s ease, transform .14s ease;
}

.babel-geo-button:hover,
.babel-geo-button:focus-visible {
  border-color: #0b8065;
  background: #edf8f4;
  transform: translateY(-1px);
}

.babel-geo-button.is-quiet {
  border-color: #d6dad8;
  color: #52615b;
  background: #fff;
}

.babel-geo-button.is-primary {
  border-color: #0b8065;
  color: #fff;
  background: #0b8065;
  box-shadow: 0 2px 7px rgba(11, 128, 101, .2);
}

.babel-geo-button.is-ai {
  border-color: rgba(11, 128, 101, .4);
  color: #08745c;
  background: #edf8f4;
}

.babel-geo-button:disabled {
  opacity: .5;
  cursor: wait;
}

.babel-geo-status {
  position: fixed;
  top: 62px;
  right: 188px;
  z-index: 20000;
  max-width: min(360px, calc(100vw - 32px));
  padding: 8px 12px;
  border-radius: 9px;
  color: #fff;
  background: rgba(31, 42, 38, .9);
  box-shadow: 0 6px 18px rgba(31, 42, 38, .16);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-5px);
  transition: opacity .18s ease, transform .18s ease;
}

@keyframes babelGeoToolbarIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.babel-geo-status.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.babel-geo-status.is-error {
  background: rgba(150, 52, 43, .94);
}

#babelGeoWorksModal[hidden],
#babelGeoAiModal[hidden] {
  display: none;
}

#babelGeoWorksModal,
#babelGeoAiModal {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 28, 25, .42);
  backdrop-filter: blur(4px);
}

#babelGeoAiModal {
  z-index: 30010;
  display: block;
  padding: 0;
  pointer-events: none;
  background: transparent;
  backdrop-filter: none;
}

.babel-geo-modal-card {
  width: min(780px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  overflow: hidden;
  border: 1px solid rgba(11, 128, 101, .22);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(22, 35, 30, .28);
}

.babel-geo-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 18px;
  border-bottom: 1px solid #e5ece8;
}

.babel-geo-modal-head h2 {
  margin: 0;
  color: #1f2a26;
  font-size: 18px;
}

.babel-geo-modal-head p {
  margin: 4px 0 0;
  color: #75817b;
  font-size: 12px;
}

.babel-geo-modal-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: #53605a;
  background: #f1f5f3;
  font-size: 22px;
  cursor: pointer;
}

.babel-geo-work-list {
  display: grid;
  gap: 9px;
  max-height: min(580px, calc(100vh - 130px));
  overflow: auto;
  padding: 14px;
}

.babel-geo-work-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid #dce7e2;
  border-radius: 12px;
  background: #fbfdfc;
}

.babel-geo-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.babel-geo-row-actions .babel-geo-button {
  min-height: 36px;
  padding-inline: 11px;
}

.babel-geo-work-name {
  overflow: hidden;
  color: #25312c;
  font-size: 15px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.babel-geo-work-meta,
.babel-geo-empty {
  margin-top: 4px;
  color: #77837d;
  font-size: 12px;
}

.babel-geo-ai-card {
  display: grid;
  grid-template-rows: auto minmax(220px, 1fr) auto;
  position: fixed;
  top: 50%;
  right: 18px;
  left: auto;
  width: min(720px, 100%);
  height: min(720px, calc(100vh - 36px));
  pointer-events: auto;
  border-color: rgba(171, 205, 192, .72);
  background: rgba(255, 255, 255, .56);
  backdrop-filter: blur(2px);
  box-shadow: 0 22px 62px rgba(22, 35, 30, .2);
  transform: translateY(-50%);
  transition: box-shadow .18s ease;
}

.babel-geo-ai-card .babel-geo-modal-head {
  cursor: grab;
  background: rgba(255, 255, 255, .48);
  touch-action: none;
  user-select: none;
}

.babel-geo-ai-card .babel-geo-modal-head button {
  cursor: pointer;
}

.babel-geo-ai-card.is-dragging {
  box-shadow: 0 30px 86px rgba(22, 35, 30, .34);
}

.babel-geo-ai-card.is-dragging .babel-geo-modal-head {
  cursor: grabbing;
}

.babel-geo-ai-card.is-resizing {
  transition: none;
  user-select: none;
}

.babel-geo-ai-resize-handle {
  position: absolute;
  right: 3px;
  bottom: 3px;
  z-index: 5;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 9px 0 13px 0;
  background: transparent;
  cursor: nwse-resize;
  touch-action: none;
}

.babel-geo-ai-resize-handle::before,
.babel-geo-ai-resize-handle::after {
  position: absolute;
  right: 6px;
  bottom: 6px;
  content: "";
  border-right: 2px solid rgba(11, 128, 101, .78);
  border-bottom: 2px solid rgba(11, 128, 101, .78);
}

.babel-geo-ai-resize-handle::before {
  width: 13px;
  height: 13px;
}

.babel-geo-ai-resize-handle::after {
  width: 7px;
  height: 7px;
}

.babel-geo-ai-resize-handle:hover,
.babel-geo-ai-resize-handle:focus-visible {
  outline: none;
  background: rgba(11, 128, 101, .1);
}

.babel-geo-ai-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  padding: 18px;
  background: rgba(247, 250, 248, .26);
}

.babel-geo-ai-message {
  display: flex;
  flex-direction: column;
  align-self: flex-start;
  gap: 7px;
  max-width: min(86%, 560px);
}

.babel-geo-ai-message.is-user {
  align-self: flex-end;
}

.babel-geo-ai-message-body {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border: 1px solid #dce7e2;
  border-radius: 14px 14px 14px 4px;
  color: #29352f;
  background: #fff;
  box-shadow: 0 1px 3px rgba(31, 42, 38, .05);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.babel-geo-ai-message.is-user .babel-geo-ai-message-body {
  border-color: #0b8065;
  border-radius: 14px 14px 4px 14px;
  color: #fff;
  background: #0b8065;
}

.babel-geo-ai-message.is-error .babel-geo-ai-message-body {
  border-color: #efc2bc;
  color: #923d33;
  background: #fff6f4;
}

.babel-geo-ai-message-images,
.babel-geo-ai-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.babel-geo-ai-message-images {
  justify-content: flex-end;
}

.babel-geo-ai-message-images img,
.babel-geo-ai-images img {
  display: block;
  width: 72px;
  height: 72px;
  border: 1px solid #d8e3de;
  border-radius: 10px;
  object-fit: cover;
  background: #fff;
}

.babel-geo-ai-message details {
  color: #69766f;
  font-size: 12px;
}

.babel-geo-ai-message summary {
  cursor: pointer;
}

.babel-geo-ai-message pre {
  max-width: 100%;
  margin: 7px 0 0;
  overflow: auto;
  padding: 10px;
  border-radius: 9px;
  color: #dcebe5;
  background: #17231f;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
}

.babel-geo-ai-spinner {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  border: 2px solid #c9ddd5;
  border-top-color: #0b8065;
  border-radius: 50%;
  animation: babelGeoAiSpin .8s linear infinite;
}

@keyframes babelGeoAiSpin {
  to { transform: rotate(360deg); }
}

.babel-geo-ai-composer {
  display: grid;
  gap: 10px;
  padding: 13px 38px 14px 14px;
  border-top: 1px solid #e2ebe7;
  background: rgba(255, 255, 255, .52);
}

.babel-geo-ai-composer textarea {
  width: 100%;
  min-height: 82px;
  max-height: 180px;
  resize: vertical;
  padding: 11px 12px;
  border: 1px solid #cfdad5;
  border-radius: 11px;
  outline: none;
  color: #25312c;
  background: rgba(255, 255, 255, .72);
  font-size: 14px;
  line-height: 1.5;
}

.babel-geo-ai-composer textarea:focus {
  border-color: #0b8065;
  box-shadow: 0 0 0 3px rgba(11, 128, 101, .1);
}

.babel-geo-ai-compose-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.babel-geo-ai-image-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.babel-geo-ai-image-button.is-disabled {
  opacity: .5;
  pointer-events: none;
}

.babel-geo-ai-hint {
  margin-right: auto;
  color: #88938e;
  font-size: 11px;
}

.babel-geo-ai-images[hidden] {
  display: none;
}

.babel-geo-ai-images figure {
  position: relative;
  margin: 0;
}

.babel-geo-ai-images button {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  padding: 0;
  border: 1px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: #52615b;
  cursor: pointer;
}

.babel-geo-empty {
  padding: 34px 18px;
  text-align: center;
}

@media (max-width: 980px) {
  .babel-geo-account,
  .babel-geo-divider,
  .babel-geo-title {
    display: none;
  }
}

@media (max-width: 680px) {
  #babelGeoToolbar {
    top: auto;
    right: 10px;
    bottom: 12px;
    left: 10px;
    z-index: 100;
    max-width: none;
    justify-content: space-between;
    border-radius: 14px;
  }
  .babel-geo-actions {
    margin-left: auto;
  }
  .babel-geo-status {
    top: auto;
    right: 12px;
    bottom: 66px;
  }
  .babel-geo-work-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .babel-geo-row-actions {
    justify-content: flex-start;
  }
  .babel-geo-ai-card {
    top: 12px;
    right: 12px;
    left: 12px;
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    transform: none;
  }
  .babel-geo-ai-resize-handle {
    display: none;
  }
  .babel-geo-ai-composer {
    padding-right: 14px;
  }
  .babel-geo-ai-thread {
    padding: 13px;
  }
  .babel-geo-ai-message {
    max-width: 94%;
  }
  .babel-geo-ai-hint {
    display: none;
  }
  .babel-geo-ai-compose-actions {
    flex-wrap: wrap;
  }
  #babelGeoAiSend {
    margin-left: auto;
  }
}
