.ui-offline-widget,
.ui-offline-toast {
  box-sizing: border-box;
  font-family: Inter, "Plus Jakarta Sans", "Segoe UI", Arial, sans-serif;
  color: #07182d;
}

.ui-offline-widget *,
.ui-offline-toast * {
  box-sizing: border-box;
}

.ui-offline-widget {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 99999;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100vw - 24px));
  pointer-events: none;
}

.ui-offline-widget[hidden] {
  display: none !important;
}

.ui-offline-widget__panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 10px 11px 12px;
  border: 1px solid rgba(14, 119, 118, .18);
  border-radius: 14px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 18px 50px rgba(7, 24, 45, .18);
  backdrop-filter: blur(14px);
  pointer-events: auto;
}

.ui-offline-widget__state {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ui-offline-widget__state strong {
  overflow: hidden;
  color: #062341;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-offline-widget__state span {
  overflow: hidden;
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-offline-widget__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.ui-offline-widget button,
.ui-offline-toast button {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.ui-offline-widget button:hover,
.ui-offline-toast button:hover {
  transform: translateY(-1px);
}

.ui-offline-sync-btn {
  flex: 0 0 auto;
  padding: 10px 12px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #0f766e, #0ea5e9);
  box-shadow: 0 12px 28px rgba(14, 119, 118, .24);
}

.ui-offline-sync-btn[disabled] {
  cursor: wait;
  opacity: .62;
}

.ui-offline-sync-btn[hidden] {
  display: none;
}

.ui-offline-widget.is-clean .ui-offline-sync-btn {
  background: linear-gradient(135deg, #e8f4f5, #f8fbff);
  color: #0f766e;
  box-shadow: inset 0 0 0 1px rgba(14, 119, 118, .16);
}

.ui-offline-widget__close,
.ui-offline-toast__close {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  color: #53657b;
  background: rgba(226, 232, 240, .78);
}

.ui-offline-widget__close:hover,
.ui-offline-toast__close:hover {
  color: #0b3558;
  background: #dbe7ee;
}

.ui-offline-toast[hidden] {
  display: none !important;
}

.ui-offline-toast {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + 76px);
  z-index: 100001;
  width: min(390px, calc(100vw - 24px));
  padding: 13px 44px 13px 14px;
  border: 1px solid rgba(14, 119, 118, .18);
  border-radius: 14px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 20px 60px rgba(7, 24, 45, .18);
}

.ui-offline-toast__close {
  position: absolute;
  top: 10px;
  right: 10px;
}

.ui-offline-toast strong {
  display: block;
  margin-bottom: 4px;
  color: #06172b;
  font-size: 14px;
  font-weight: 950;
}

.ui-offline-toast p {
  margin: 0;
  color: #53657b;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .ui-offline-widget,
  .ui-offline-toast {
    right: 8px;
    left: 8px;
    width: auto;
  }

  .ui-offline-widget {
    bottom: max(6px, env(safe-area-inset-bottom));
  }

  .ui-offline-toast {
    bottom: calc(max(6px, env(safe-area-inset-bottom)) + 54px);
  }

  .ui-offline-widget__panel {
    align-items: center;
    gap: 5px;
    min-height: 42px;
    padding: 6px 7px;
    border-radius: 12px;
  }

  .ui-offline-widget__state {
    gap: 1px;
  }

  .ui-offline-widget__state strong {
    font-size: 11px;
    line-height: 1.05;
    white-space: nowrap;
  }

  .ui-offline-widget__state span {
    display: none;
  }

  .ui-offline-widget__actions {
    gap: 4px;
  }

  html body .ui-offline-widget .ui-offline-sync-btn {
    min-height: 30px;
    max-width: 116px;
    padding: 0 9px;
    overflow: hidden;
    border-radius: 9px;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html body .ui-offline-widget .ui-offline-widget__close {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
}

@media (max-width: 390px) {
  html body .ui-offline-widget .ui-offline-sync-btn {
    max-width: 102px;
    padding-inline: 7px;
  }
}
