/* Container Query Responsive Text for Widgets */
@container (min-width: 0) {
  .scalable-text {
    font-size: min(6cqw, 3.5rem);
    line-height: 1.1;
  }

  .scalable-text-small {
    font-size: min(5cqw, 5rem);
    line-height: 1.2;
    white-space: normal;
    word-break: break-word;
  }
}

/* ─── On-Time Performance Widget ────────────────────────────────────────────── */

.otp-root {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px 14px;
}

/* Arc gauge */
.otp-gauge-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.otp-gauge-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-3px);
}

.otp-pct {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  transition: color 0.3s ease;
}

.otp-pct-sign {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.7;
}

/* Status badge */
.otp-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Completion bar */
.otp-bar-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}

.otp-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted-foreground);
  font-weight: 500;
}

.otp-bar-track {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.otp-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Partial-error button */
.otp-warn-btn {
  font-size: 9px;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 999px;
  padding: 2px 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.otp-warn-btn:hover {
  background: rgba(245, 158, 11, 0.16);
}

/* Retry button */
.otp-retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: color-mix(in oklch, var(--primary) 10%, transparent);
  border: 1px solid color-mix(in oklch, var(--primary) 25%, transparent);
  border-radius: 8px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.otp-retry-btn:hover {
  background: color-mix(in oklch, var(--primary) 18%, transparent);
}

/* Error icon circle */
.otp-error-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Shimmer skeleton */
.otp-shimmer {
  background: linear-gradient(90deg,
      var(--muted) 0%,
      color-mix(in oklch, var(--muted) 80%, var(--primary) 20%) 50%,
      var(--muted) 100%);
  background-size: 300px 100%;
  animation: otp-shimmer-anim 1.4s ease-in-out infinite;
}

@keyframes otp-shimmer-anim {
  from {
    background-position: -300px 0;
  }

  to {
    background-position: 300px 0;
  }
}