.jchat-budget-button {
  display: inline-flex; align-items: center; gap: 5px; flex: none; min-height: 30px;
  padding: 4px 9px; border: 1px solid #d8e1e6; border-radius: 5px; background: #f8fafb;
  color: #435b69; font: 650 .74rem/1.25 var(--font); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.jchat-budget-button:hover { background: #edf1f4; border-color: #aebdc6; }
.jchat-head { flex-wrap: wrap; }
.jchat-head > .jchat-budget-button { margin-inline-start: auto; }
.jchat-widget-head [data-chat-budget-ring] {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0;
  margin-inline-start: auto; border: 0; border-radius: 50%; background: transparent;
}
.jchat-widget-head [data-chat-budget-ring]:hover { background: #ffffff18; }
[data-chat-budget-ring]:focus-visible { outline: 2px solid #d8e9ff; outline-offset: 1px; }
[data-chat-budget-ring][data-level="high"] { --arc: #56d79a; }
[data-chat-budget-ring][data-level="medium"] { --arc: #ffd253; }
[data-chat-budget-ring][data-level="low"] { --arc: #ff7c7c; }
.jchat-budget-ring {
  width: 22px; height: 22px; box-sizing: border-box; border-radius: 50%;
  background: conic-gradient(var(--arc) 0 var(--remaining), #ffffff38 var(--remaining) 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px));
}
[data-chat-budget-ring][data-empty="true"] .jchat-budget-ring,
[data-chat-budget-ring][data-level="unknown"] .jchat-budget-ring {
  background: none; -webkit-mask: none; mask: none; border: 1px solid var(--arc);
}
[data-chat-budget-ring][data-level="unknown"] .jchat-budget-ring { border: 2px dashed #a9b4c0; }
@media (forced-colors: active) {
  [data-chat-budget-ring] .jchat-budget-ring { --arc: ButtonText; forced-color-adjust: none; }
}
.jchat-widget-head > .jchat-budget-button + .jchat-widget-actions { margin-inline-start: 0; }
.jchat-budget-dialog {
  width: min(388px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto;
  padding: 18px; border: 1px solid #cad4dc; border-radius: 8px; color: var(--ink); background: #fff;
  box-shadow: 0 16px 55px #162a3e38; font: .84rem/1.5 var(--font);
}
.jchat-budget-dialog::backdrop { background: #16202c45; backdrop-filter: none; }
.jchat-budget-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.jchat-budget-dialog h2 { margin: 0; font-size: 1.05rem; }
.jchat-budget-close { display: grid; place-content: center; width: 32px; height: 32px; color: #566b79; font: 1.5rem/1 var(--font); border: 0; border-radius: 5px; background: transparent; }
.jchat-budget-close:hover { background: #eff3f5; }
.jchat-budget-estimate { margin: 12px 0; padding: 10px 12px; border-left: 3px solid #668c95; background: #f1f6f6; border-radius: 3px; }
.jchat-budget-estimate strong { display: block; font-size: .97rem; }
.jchat-budget-estimate p { margin: 3px 0 0; font-size: .8rem; color: #4c646c; }
.jchat-budget-dialog dl { margin: 12px 0; font-size: .78rem; }
.jchat-budget-dialog dl > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 8px; padding: 6px 0; border-bottom: 1px solid #e5ebee; }
.jchat-budget-dialog dt { color: #536976; }
.jchat-budget-dialog dd { margin: 0; text-align: right; overflow-wrap: anywhere; font-weight: 650; font-variant-numeric: tabular-nums; }
.jchat-budget-location { color: #566b79; font-size: .76rem; margin: 9px 0; }
.jchat-budget-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.jchat-budget-actions a { color: #315e79; font-size: .76rem; text-underline-offset: 3px; }
.jchat-budget-dialog form { display: grid; gap: 9px; margin-block-start: 12px; padding-block-start: 12px; border-top: 1px solid #dce5eb; }
.jchat-budget-dialog form label { display: grid; gap: 3px; font-size: .78rem; font-weight: 650; }
.jchat-budget-dialog input { width: 100%; min-height: 36px; padding: 5px 8px; border: 1px solid #b6c7cf; border-radius: 5px; background: white; }
@media (max-width: 560px) {
  .jchat-head { gap: 6px; }
  .jchat-head > .jchat-budget-button { margin-inline-start: 0; }
  .jchat-budget-dialog input { font-size: 1rem; }
}
@media (max-width: 405px) {
  .jchat-widget-head { gap: 6px; padding-inline: 9px; }
  .jchat-widget-head:has(.jchat-budget-button) .jchat-widget-mark { display: none; }
}
@media print { .jchat-budget-dialog, .jchat-budget-button { display: none !important; } }
