/* Shared by the workbench and the floating panel. */
#balance {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  white-space: nowrap;
  line-height: 20px;
  color: var(--text, #1D2129);
  font-variant-numeric: tabular-nums;
}
.quota-values {display: inline-flex; align-items: baseline; gap: 4px}
#quota-status, #quota-total {color: #86909C; font-weight: 400}
#quota-status {font-size: 11px}
#quota-remaining {font-size: 16px; font-weight: 700}
#quota-total {font-size: 12px}
#quota-percent {color: #86909C; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums}
#balance[data-tone="green"] #quota-percent {color: #15803D}
#balance[data-tone="yellow"] #quota-percent {color: #B45309}
#balance[data-tone="red"] #quota-percent {color: #DC2626}

.quota-actions, .quota-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.quota-actions {justify-content: space-between}
.quota-buttons :is(#card-open, #recharge) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 28px;
  padding: 0 10px;
  border: 1px solid #dce1e7;
  border-radius: 999px;
  background: #fff;
  color: #1D2129;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
}
.quota-buttons #recharge {border-color: #F5C26B; background: #FFF7E6; color: #B45309; font-weight: 700}
#dock[data-theme="dark"] #card-open {border-color: #48515f; background: #252a32; color: #e6eaf1}
#dock[data-theme="dark"] #recharge {border-color: #8e6839; background: #3b2e1f; color: #f3c783}
.quota-actions #range-toggle {
  padding: 4px 0 4px 6px;
  border: 0;
  background: transparent;
  color: var(--secondary, #596575);
  font-size: 12px;
  line-height: 20px;
}

/* A quota meter has no time-based progress: only balance updates change its width. */
#energy-track {
  --quota-sweep: 3.2s;
  height: 9px;
  width: 100%;
  position: relative;
  border-radius: 999px;
  background-color: #e5e9ed;
  margin: 6px 0 10px;
}
#dock[data-theme="dark"] #energy-track {background-color: #404651}
#energy-track[data-active="true"] {--quota-sweep: 1.2s}
#energy-fill {
  display: block;
  position: relative;
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width 0.6s ease;
}
#energy-track[data-tone="green"] #energy-fill {background: linear-gradient(90deg, #16A34A, #34D399)}
#energy-track[data-tone="yellow"] #energy-fill {background: linear-gradient(90deg, #D97706, #FBBF24)}
#energy-track[data-tone="red"] #energy-fill {background: linear-gradient(90deg, #DC2626, #F87171)}
#energy-fill::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(105deg, transparent 35%, #ffffff40 48%, #ffffff70 52%, transparent 65%);
  background-size: 260% 100%;
  animation: quota-sweep var(--quota-sweep) linear infinite;
}
#energy-track:is([data-tone="locked"],[data-tone="empty"]) #energy-fill::before {display: none}
#energy-track[data-tone="red"] #energy-fill::after {
  content: '';
  position: absolute;
  inset-inline-end: 0;
  top: 1px;
  width: min(5px, 100%);
  height: 5px;
  border-radius: 50%;
  box-shadow: 0 0 5px 1px #f8717190;
  animation: quota-pulse 2s ease-in-out infinite alternate;
}
@keyframes quota-sweep {
  from {background-position: 100% center}
  to {background-position: 0% center}
}
@keyframes quota-pulse {from {opacity: .3} to {opacity: .9}}
@media (prefers-reduced-motion: reduce) {
  #energy-fill {transition: none}
  #energy-fill::before,
  #energy-track[data-tone="red"] #energy-fill::after {display: none; animation: none}
}
