.active-orders-panel {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 38;
  display: grid;
  justify-items: end;
  gap: 9px;
  color: var(--ink);
}

.active-orders-list {
  order: 1;
  width: min(390px, calc(100vw - 24px));
  max-height: min(52vh, 430px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 18px);
  background: var(--surface);
  box-shadow: 0 20px 55px rgba(25, 34, 33, 0.22);
}

.active-orders-trigger {
  position: relative;
  order: 2;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid color-mix(in srgb, var(--accent) 72%, var(--border));
  border-radius: 50%;
  background: var(--accent, #1b756d);
  color: #ffffff;
  padding: 0;
  box-shadow: 0 12px 32px rgba(25, 34, 33, 0.28);
  cursor: pointer;
}

.active-orders-trigger:hover {
  transform: translateY(-1px);
}

.active-orders-trigger:focus-visible,
.active-order-link:focus-visible {
  outline: 3px solid var(--surface);
  outline-offset: 3px;
}

.active-orders-trigger-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.active-orders-count {
  position: absolute;
  top: -4px;
  right: -4px;
  display: grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: #c94444;
  color: #ffffff;
  padding: 0 5px;
  font-size: 0.7rem;
  font-weight: 900;
}

.active-order-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 11px;
  align-items: center;
  padding: 14px;
}

.active-order-row + .active-order-row {
  border-top: 1px solid var(--border);
}

.active-order-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--accent-soft, rgba(27, 117, 109, 0.1));
  font-size: 1.25rem;
}

.active-order-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.active-order-copy strong,
.active-order-copy span {
  overflow-wrap: anywhere;
}

.active-order-copy strong {
  font-size: 0.96rem;
  line-height: 1.25;
}

.active-order-copy span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.active-order-link.button {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 42px;
  justify-content: center;
  margin: 0;
  text-decoration: none;
}

.customer-page .active-orders-panel {
  bottom: calc(84px + env(safe-area-inset-bottom));
}

@media (min-width: 960px) {
  .customer-page .active-orders-panel {
    bottom: 18px;
  }
}

@media (max-width: 600px) {
  .active-orders-panel {
    right: 12px;
  }

  .active-orders-list {
    width: calc(100vw - 24px);
    max-height: 44vh;
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .active-orders-list {
    animation: active-orders-popover 0.18s ease-out;
    transform-origin: bottom right;
  }

  .active-orders-trigger {
    transition: transform 0.16s ease, box-shadow 0.16s ease;
  }

  @keyframes active-orders-popover {
    from { opacity: 0; transform: translateY(6px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
}
