.bx-usage {
  --bx-usage-bg: #fff;
  --bx-usage-text: #25332b;
  --bx-usage-muted: #536158;
  --bx-usage-line: #d7e2d4;
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 900;
  box-sizing: border-box;
  width: min(286px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  border: 1px solid var(--bx-usage-line);
  border-radius: 8px;
  background: var(--bx-usage-bg);
  box-shadow: 0 8px 28px rgb(31 49 36 / 18%);
  color: var(--bx-usage-text);
  font-family: Arial, "Noto Sans JP", "Noto Sans KR", sans-serif;
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0;
}

.bx-usage[hidden],
.bx-usage [hidden] {
  display: none !important;
}

.bx-usage *,
.bx-usage *::before,
.bx-usage *::after {
  box-sizing: border-box;
}

.bx-usage__top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 5px 8px 5px 11px;
  border-bottom: 1px solid var(--bx-usage-line);
}

.bx-usage__mark {
  font-size: 17px;
  line-height: 1;
}

.bx-usage__title {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.bx-usage__icon {
  display: grid;
  flex: 0 0 30px;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--bx-usage-muted);
  cursor: pointer;
  font: inherit;
}

.bx-usage__icon:hover,
.bx-usage__icon:focus-visible {
  background: #e9f2e8;
  color: var(--bx-usage-text);
}

.bx-usage__icon:focus-visible {
  outline: 2px solid #28724f;
  outline-offset: 1px;
}

.bx-usage__icon .lucide,
.bx-usage__icon i {
  width: 17px;
  height: 17px;
  font-size: 19px;
  font-style: normal;
  line-height: 1;
}

.bx-usage__restore {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--bx-usage-text);
  cursor: pointer;
}

.bx-usage__restore-flag {
  position: absolute;
  right: 0;
  bottom: 0;
  font-size: 20px;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgb(0 0 0 / 30%));
}

.bx-usage__restore:hover,
.bx-usage__restore:focus-visible {
  background: #e9f2e8;
}

.bx-usage__restore:focus-visible {
  outline: 2px solid #28724f;
  outline-offset: -3px;
}

.bx-usage__restore .lucide,
.bx-usage__restore i {
  width: 22px;
  height: 22px;
  font-size: 22px;
  font-style: normal;
  line-height: 1;
}

.bx-usage__content {
  padding: 9px 12px 11px;
}

.bx-usage__walkers {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  height: 50px;
  margin-bottom: 6px;
  border-bottom: 1px dashed var(--bx-usage-line);
  overflow: hidden;
}

.bx-usage__walker {
  position: relative;
  display: inline-block;
  flex: 0 1 40px;
  min-width: 0;
  height: 45px;
  text-align: center;
  font-size: 31px;
  line-height: 45px;
  animation: bx-usage-step 1.25s ease-in-out infinite alternate;
}

.bx-usage__flag {
  position: absolute;
  top: 0;
  right: -5px;
  font-size: 17px;
  line-height: 1;
}

.bx-usage__metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-height: 30px;
  padding: 5px 0;
}

.bx-usage__metric--history {
  border-top: 1px solid var(--bx-usage-line);
}

.bx-usage__metric-label {
  color: var(--bx-usage-muted);
  font-size: 11px;
}

.bx-usage__metric-value {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.bx-usage__metric--per-visitor {
  flex-wrap: wrap;
}

.bx-usage__change {
  flex: 0 0 100%;
  color: #93483a;
  font-size: 11px;
  text-align: right;
}

.bx-usage__change--up {
  color: #276b49;
}

.bx-usage__geography {
  border-top: 1px solid var(--bx-usage-line);
  padding-top: 7px;
}

.bx-usage__geography-title {
  display: block;
  color: var(--bx-usage-muted);
  font-size: 11px;
  font-weight: 400;
}

.bx-usage__chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 4px;
  height: 92px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.bx-usage__chart-item {
  display: flex;
  flex: 0 1 38px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  height: 100%;
}

.bx-usage__bar-slot {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 65px;
}

.bx-usage__bar {
  display: block;
  width: 21px;
  min-height: 3px;
  border-radius: 3px 3px 0 0;
  background: #3f7562;
}

.bx-usage__chart-item:first-child .bx-usage__bar {
  background: #c59a20;
}

.bx-usage__chart-flag {
  display: block;
  width: 100%;
  height: 23px;
  border-top: 1px solid var(--bx-usage-line);
  font-size: 18px;
  line-height: 22px;
  text-align: center;
}

.bx-usage__countries {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 2px 0 6px;
}

.bx-usage__country {
  font-size: 11px;
  line-height: 1.3;
  color: var(--bx-usage-muted);
}

.bx-usage__status {
  margin: 2px 0 0;
  color: var(--bx-usage-muted);
  font-size: 12px;
}

.bx-greeting {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--bx-usage-line);
}

.bx-greeting__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.bx-greeting__count {
  flex: 0 0 auto;
  font-weight: 700;
}

.bx-greeting__stage {
  position: relative;
  height: 45px;
  margin-top: 2px;
  overflow: hidden;
}

.bx-greeting__walkers {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 100%;
}

.bx-greeting__walker {
  display: block;
  flex: 0 0 32px;
  width: 32px;
  height: 41px;
  font-size: 26px;
  line-height: 41px;
  text-align: center;
  animation: bx-usage-step 1.25s ease-in-out infinite alternate;
}

.bx-greeting__live {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  pointer-events: none;
}

.bx-greeting__wave {
  border-radius: 4px;
  background: var(--bx-usage-bg);
  font-size: 18px;
  line-height: 1.2;
  animation: bx-greeting-wave 2.8s ease-out both;
}

.bx-greeting__recent {
  display: flex;
  justify-content: center;
  gap: 7px;
  min-height: 22px;
}

.bx-greeting__recent-item {
  font-size: 16px;
  line-height: 22px;
}

.bx-greeting__button {
  display: block;
  width: 100%;
  min-height: 42px;
  margin-top: 6px;
  padding: 7px 10px;
  border: 1px solid #275a42;
  border-radius: 5px;
  background: #2b6549;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.bx-greeting__button::before {
  content: '👋';
  margin-right: 6px;
}

.bx-greeting__button:hover:not(:disabled),
.bx-greeting__button:focus-visible:not(:disabled) {
  background: #214f3a;
}

.bx-greeting__button:focus-visible {
  outline: 2px solid #c59a20;
  outline-offset: 2px;
}

.bx-greeting__button:disabled {
  cursor: default;
  opacity: .72;
}

.bx-greeting__status {
  margin: 5px 0 0;
  color: var(--bx-usage-muted);
  font-size: 11px;
}

.bx-usage--compact {
  width: min(229px, calc(100vw - 24px));
}

.bx-usage--compact .bx-usage__top {
  border-bottom: 0;
}

.bx-usage--compact .bx-usage__content {
  display: none;
}

.bx-usage.bx-usage--icon-only {
  width: 48px;
  height: 48px;
  max-height: none;
  overflow: hidden;
  border-radius: 50%;
}

.bx-usage--icon-only .bx-usage__top,
.bx-usage--icon-only .bx-usage__content {
  display: none;
}

html[data-bx-theme="dark"] .bx-usage {
  --bx-usage-bg: #242d26;
  --bx-usage-text: #edf3e9;
  --bx-usage-muted: #b7c5b5;
  --bx-usage-line: #506450;
  box-shadow: 0 8px 28px rgb(0 0 0 / 30%);
}

html[data-bx-theme="dark"] .bx-usage__icon:hover,
html[data-bx-theme="dark"] .bx-usage__icon:focus-visible {
  background: #3b4b3f;
}

html[data-bx-theme="dark"] .bx-usage__restore:hover,
html[data-bx-theme="dark"] .bx-usage__restore:focus-visible {
  background: #3b4b3f;
}

html[data-bx-theme="dark"] .bx-greeting__button {
  border-color: #d5a947;
  background: #d5a947;
  color: #1d2a22;
}

html[data-bx-theme="dark"] .bx-greeting__button:hover:not(:disabled),
html[data-bx-theme="dark"] .bx-greeting__button:focus-visible:not(:disabled) {
  background: #f0c461;
}

@media (max-width: 480px) {
  .bx-usage {
    right: 12px;
    bottom: 12px;
    width: min(286px, calc(100vw - 24px));
    max-height: calc(100dvh - 24px);
  }

  .bx-usage--compact {
    width: min(229px, calc(100vw - 24px));
  }

  .bx-usage__icon {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
  }

  .bx-usage__metric {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bx-usage__walker,
  .bx-greeting__walker,
  .bx-greeting__wave {
    animation: none;
  }
}

@keyframes bx-usage-step {
  from { transform: translateY(0) rotate(-2deg); }
  to { transform: translateY(-4px) rotate(2deg); }
}

@keyframes bx-greeting-wave {
  from { opacity: 0; transform: translateY(16px) rotate(-12deg); }
  25% { opacity: 1; }
  to { opacity: 0; transform: translateY(-8px) rotate(12deg); }
}
