.github-widget {
  position: absolute;
  z-index: 2;
  left: max(28px, env(safe-area-inset-left));
  bottom: max(85px, calc(env(safe-area-inset-bottom) + 65px));
  width: min(440px, calc(100vw - 56px));
  color: #36503a;
  font-variant-numeric: tabular-nums;
}

.github-card {
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 57%);
  border-radius: 12px;
  background: rgb(255 251 232 / 83%);
  box-shadow: 0 5px 23px rgb(112 77 13 / 8%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.github-heading { display: flex; align-items: center; justify-content: space-between; min-height: 38px; gap: 12px; padding: 0 13px 0 7px; touch-action: none; user-select: none; cursor: grab; }
.github-toggle { display: flex; align-items: center; gap: 7px; min-height: 37px; padding: 4px 6px; border: 0; background: transparent; font-size: 11px; font-weight: 550; cursor: grab; }
.github-widget.is-dragging .github-heading, .github-widget.is-dragging .github-toggle { cursor: grabbing; }
.github-widget.is-dragging .github-card { box-shadow: 0 9px 30px rgb(112 77 13 / 17%); }
.github-mark { width: 14px; height: 14px; }
.github-chevron { width: 10px; height: 10px; opacity: .5; transition: transform .15s; }
.github-toggle[aria-expanded="true"] .github-chevron { transform: rotate(180deg); }
.github-profile { color: #75826b; font: 9px/1.5 var(--mono); text-decoration: none; white-space: nowrap; }
.github-profile:hover { color: #28683b; text-decoration: underline; text-underline-offset: 3px; }
.github-panel { padding: 0 13px 11px; }
.github-panel[hidden], .github-legend[hidden], .github-retry[hidden] { display: none; }
.github-total { margin: 0 0 8px; color: #53634c; font: 10px/1.5 var(--mono); }
.github-calendar svg { display: block; width: 100%; height: auto; overflow: visible; }
.github-month { fill: #7f8b75; font: 7.5px var(--mono); }
.github-level { fill: #e2e7d5; background: #e2e7d5; }
.github-level[data-level="1"] { fill: #c0d6a1; background: #c0d6a1; }
.github-level[data-level="2"] { fill: #87b86d; background: #87b86d; }
.github-level[data-level="3"] { fill: #4a9451; background: #4a9451; }
.github-level[data-level="4"] { fill: #246e3c; background: #246e3c; }
.github-legend { display: flex; justify-content: flex-end; align-items: center; gap: 3px; margin-top: 3px; color: #8a957f; font: 8px/1.4 var(--mono); }
.github-legend .github-level { display: block; width: 6px; height: 6px; border-radius: 1px; }
.github-legend > span:first-child { margin-right: 2px; }
.github-legend > span:last-child { margin-left: 2px; }
.github-retry { padding: 2px 0; border: 0; background: transparent; color: #3c7244; font-size: 10px; text-decoration: underline; text-underline-offset: 3px; }
.github-toggle:focus-visible, .github-profile:focus-visible, .github-retry:focus-visible { outline-offset: 1px; }

@media (max-width: 600px) {
  .github-widget {
    left: max(18px, env(safe-area-inset-left));
    bottom: max(78px, calc(env(safe-area-inset-bottom) + 62px));
    width: calc(100vw - 36px);
    pointer-events: none;
  }
  .github-card { width: max-content; min-width: 155px; max-width: 100%; pointer-events: auto; }
  .github-widget:has(.github-toggle[aria-expanded="true"]) .github-card { width: 100%; }
  .github-heading { min-height: 38px; padding-right: 12px; gap: 12px; }
  .github-toggle { min-height: 38px; }
  .github-profile { font-size: 8px; }
  .github-panel { padding-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .github-chevron { transition: none; }
}
