.time-budget-strip { --budget-color: var(--amber); flex: 0 0 auto; width: 100%; padding: 6px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg); color: var(--text); }
.time-budget-content { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "plan deadline" "meter deadline"; align-items: center; column-gap: 20px; row-gap: 4px; width: min(1120px, 100%); margin: 0 auto; }
.budget-plan { grid-area: plan; display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.budget-values { display: flex; align-items: baseline; gap: 5px; margin: 0; color: var(--text); font-size: 15px; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.budget-trip-label, .budget-available-label { color: var(--muted); font-size: 12px; font-weight: 500; }
.budget-values strong { font-weight: 800; }
.budget-divider { color: var(--muted); }
.budget-status { color: var(--muted); font-size: 11px; line-height: 1.2; }
.budget-mobile-label { display: none; }
.budget-deadline { grid-area: deadline; display: grid; gap: 1px; min-width: 0; padding-left: 20px; border-left: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.budget-deadline-label { color: var(--muted); font-size: 10px; line-height: 1.1; }
#budget-back-by { font-size: 15px; font-weight: 800; line-height: 1.15; }
#budget-available-hint { color: var(--muted); font-size: 10px; line-height: 1.1; }
.budget-meter { grid-area: meter; position: relative; min-width: 0; }
.budget-meter-track { display: block; height: 6px; overflow: hidden; border-radius: 20px; background: var(--line); }
.budget-meter-fill { display: block; width: calc(var(--budget-fill, 0) * 1%); height: 100%; border-radius: inherit; background: var(--budget-color); transition: width 180ms ease; }
.budget-ring, .budget-percent { display: none; }
.budget-meter[data-known="false"] .budget-meter-track { background: repeating-linear-gradient(90deg, var(--line) 0 12px, transparent 12px 16px); }
.time-budget-strip[data-state="fits"] { --budget-color: var(--green); }
.time-budget-strip[data-state="fits"] .budget-status { color: var(--green); }
.time-budget-strip:is([data-state="invalid"], [data-state="blocked"], [data-state="changed"], [data-state="uncalculated"], [data-state="calculating"]) { --budget-color: var(--muted); }
.time-budget-strip[data-state="over"] { --budget-color: #e27162; }
.time-budget-strip[data-state="over"] :is(#budget-trip, .budget-status) { color: var(--budget-color); }
:root[data-theme="light"] .time-budget-strip[data-state="over"] { --budget-color: #b02c20; }
@media (max-width: 860px) {
  .time-budget-strip { padding: 5px 10px; }
  .time-budget-content { grid-template-columns: 42px minmax(0, 1fr) minmax(88px, auto); grid-template-areas: "meter plan deadline"; column-gap: 9px; }
  .budget-plan { display: grid; align-content: center; gap: 1px; }
  .budget-mobile-label { display: block; color: var(--muted); font-size: 10px; font-weight: 600; line-height: 1.1; }
  .budget-values { gap: 3px; font-size: 13px; line-height: 1.15; }
  .budget-trip-label, .budget-available-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .budget-status { font-size: 10px; line-height: 1.15; }
  .budget-meter { width: 42px; height: 42px; }
  .budget-meter-track { display: none; }
  .budget-ring { display: block; width: 42px; height: 42px; transform: rotate(-90deg); }
  .budget-ring circle { fill: none; stroke-width: 4; }
  .budget-ring-track { stroke: var(--line); }
  .budget-ring-fill { stroke: var(--budget-color); stroke-dasharray: var(--budget-fill, 0) 100; stroke-linecap: round; transition: stroke-dasharray 180ms ease; }
  .budget-meter[data-known="false"] .budget-ring-track { stroke-dasharray: 2 3; }
  .budget-meter[data-known="false"] .budget-ring-fill { opacity: 0; }
  .time-budget-strip[data-state="empty"] .budget-ring-fill { stroke-linecap: butt; }
  .budget-percent { position: absolute; inset: 0; display: grid; place-items: center; color: var(--budget-color); font-size: 10px; font-weight: 800; font-variant-numeric: tabular-nums; }
  .budget-deadline { padding-left: 9px; gap: 2px; max-width: 122px; }
  .budget-deadline-label, #budget-available-hint { font-size: 10px; }
  #budget-back-by { font-size: 13px; }
}
@media (max-width: 360px) {
  .time-budget-content { grid-template-columns: 38px minmax(0, 1fr) minmax(82px, auto); column-gap: 7px; }
  .budget-meter, .budget-ring { width: 38px; height: 38px; }
  .budget-values { font-size: 12px; }
  .budget-deadline { padding-left: 7px; max-width: 105px; }
  #budget-back-by { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .budget-meter-fill, .budget-ring-fill { transition: none; } }
