.doc-refresh-widget {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 80;
  display: grid;
  justify-items: end;
  gap: 7px;
  pointer-events: none;
}

.doc-refresh-button,
.doc-refresh-panel button,
.doc-refresh-notice button {
  min-height: 34px;
  border: 1px solid var(--doc-line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--doc-surface-2, #111827) 92%, transparent);
  color: var(--doc-text, #f8fafc);
  box-shadow: var(--doc-shadow, 0 18px 40px rgba(0, 0, 0, .25));
  cursor: pointer;
  pointer-events: auto;
}

.doc-refresh-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  font-size: .78rem;
  font-weight: 850;
}

.doc-refresh-button:hover,
.doc-refresh-button:focus-visible,
.doc-refresh-panel button:hover,
.doc-refresh-panel button:focus-visible {
  border-color: color-mix(in srgb, var(--doc-green, #35e6a5) 40%, transparent);
  outline: none;
}

.doc-refresh-button[disabled] {
  cursor: wait;
  opacity: .74;
}

.doc-refresh-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
}

.doc-refresh-button.is-running .doc-refresh-icon {
  animation: doc-refresh-spin .85s linear infinite;
}

.doc-refresh-last {
  max-width: 280px;
  padding: 5px 8px;
  border: 1px solid var(--doc-line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--doc-card, #101827) 92%, transparent);
  color: var(--doc-muted, #94a3b8);
  font-size: .68rem;
  font-weight: 760;
  box-shadow: var(--doc-shadow, 0 18px 40px rgba(0, 0, 0, .25));
  pointer-events: auto;
}

.doc-refresh-panel {
  width: min(360px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid var(--doc-line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--doc-card, #101827) 96%, transparent);
  color: var(--doc-text, #f8fafc);
  box-shadow: var(--doc-shadow, 0 18px 40px rgba(0, 0, 0, .25));
  pointer-events: auto;
}

.doc-refresh-panel strong {
  display: block;
  margin-bottom: 5px;
}

.doc-refresh-panel p {
  margin: 0 0 8px;
  color: var(--doc-muted, #94a3b8);
  font-size: .82rem;
  line-height: 1.35;
}

.doc-refresh-panel code {
  display: block;
  margin: 8px 0;
  padding: 9px;
  border: 1px solid var(--doc-line);
  border-radius: 8px;
  overflow-x: auto;
  background: color-mix(in srgb, var(--doc-bg, #05080d) 78%, transparent);
  color: var(--doc-green, #35e6a5);
  font-size: .76rem;
  white-space: nowrap;
}

.doc-refresh-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.doc-refresh-panel button {
  padding: 0 10px;
  font-size: .75rem;
  font-weight: 820;
}

.doc-refresh-notice {
  width: min(330px, calc(100vw - 24px));
  padding: 9px;
  justify-items: stretch;
  border: 1px solid var(--doc-line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--doc-card, #101827) 94%, transparent);
  box-shadow: var(--doc-shadow, 0 18px 40px rgba(0, 0, 0, .25));
  pointer-events: auto;
}

.doc-refresh-notice .doc-refresh-last {
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.doc-refresh-notice code {
  padding: 7px 8px;
  border: 1px solid var(--doc-line);
  border-radius: 8px;
  overflow-wrap: anywhere;
  color: var(--doc-green, #35e6a5);
  font-size: .7rem;
}

.doc-refresh-notice button {
  width: fit-content;
  padding: 0 10px;
  font-size: .72rem;
  font-weight: 820;
}

.doc-refresh-panel .primary {
  border-color: color-mix(in srgb, var(--doc-green, #35e6a5) 36%, transparent);
  color: var(--doc-green, #35e6a5);
}

.doc-refresh-sidebar-widget {
  position: static;
  width: auto;
  z-index: auto;
  justify-items: start;
  pointer-events: auto;
}

.doc-refresh-sidebar-widget .doc-refresh-button {
  min-height: 34px;
  padding: 0 10px;
  box-shadow: none;
}

html[data-doc-page="home"] .doc-top-status,
html[data-doc-page="home"] #homeGarminSync {
  display: none !important;
}

@keyframes doc-refresh-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 720px) {
  .doc-refresh-widget {
    top: 10px;
    right: 10px;
  }

  .doc-refresh-widget.doc-refresh-notice {
    top: 10px;
    right: 10px;
    bottom: auto;
    left: auto;
    width: fit-content;
  }

  .doc-refresh-button {
    width: 38px;
    min-height: 38px;
    justify-content: center;
    padding: 0;
  }

  .doc-refresh-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .doc-refresh-widget:not(.doc-refresh-notice) .doc-refresh-last {
    display: none;
  }

  .doc-refresh-notice .doc-refresh-last {
    display: none;
  }

  .doc-refresh-sidebar-widget .doc-refresh-button {
    width: fit-content;
    min-height: 34px;
  }
}
