.history-source {
  width: fit-content;
  margin-bottom: 10px;
}
.history-period-hint {
  margin: -2px 0 10px;
  font-size: 11px;
}
.parameter-history-row .date small {
  display: block;
  margin-top: 3px;
  font-size: 10px;
}
.period-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 0 12px;
}
.period-segments {
  display: flex;
  gap: 3px;
  padding: 4px;
  border-radius: 12px;
  background: #222227;
}
.period-segments button {
  min-width: 82px;
  min-height: 36px;
}
.period-segments button.active {
  background: var(--orange);
  color: #17100b;
}
.period-navigation {
  display: flex;
  gap: 6px;
  align-items: center;
}
.period-navigation > button {
  min-width: 36px;
  font-size: 25px;
  line-height: 1;
}
.period-anchor {
  position: relative;
  display: grid;
  min-width: 132px;
  text-align: center;
  font-weight: 550;
}
.period-anchor > span {
  pointer-events: none;
}
.period-anchor input {
  width: 150px;
  min-height: 36px;
  padding: 6px 8px;
  background: transparent;
  border-color: transparent;
  text-align: center;
}
.period-anchor > span {
  display: none;
}
.period-dates {
  display: flex;
  align-items: center;
  gap: 10px;
}
.period-dates label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.period-dates input {
  width: 151px;
  min-height: 36px;
  padding: 7px 9px;
}
.period-error {
  flex-basis: 100%;
  color: var(--red);
  font-size: 12px;
  margin: 0;
}
.period-error:empty {
  display: none;
}
.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(270px, 1fr);
  gap: 16px;
  margin-bottom: 20px;
  align-items: stretch;
}
.chart-panel h2,
.breakdown-panel h2 {
  font-size: 16px;
  margin: 0 0 8px;
}
.chart-panel.summary-total {
  display: block;
  margin: 0;
}
.chart-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.analytics-total {
  display: block;
  font-size: 34px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.7px;
  font-variant-numeric: tabular-nums;
}
.chart-heading .hint {
  margin: 5px 0 8px;
  font-size: 12px;
}
.chart-caption {
  color: var(--muted);
  font-size: 11px;
  margin: 7px 0 3px;
}
.currency-switch {
  display: flex;
  gap: 3px;
  align-items: flex-start;
}
.currency-switch button {
  font-size: 12px;
  padding: 5px 8px;
  min-height: 30px;
}
.currency-switch .active {
  background: #34343d;
  color: var(--ink);
}
.chart-canvas {
  width: 100%;
  min-width: 0;
}
.trend-chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.chart-gridline {
  stroke: #393940;
  stroke-width: 1;
}
.chart-axis {
  fill: var(--muted);
  font-size: 12px;
  font-family: inherit;
}
.chart-line {
  fill: none;
  stroke: #35bee4;
  stroke-width: 3;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.chart-point {
  fill: #35bee4;
}
.chart-point:hover {
  r: 6px;
}
.chart-column {
  fill: var(--orange);
}
.chart-column:hover {
  fill: #ff915f;
}
.chart-data {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.chart-data summary {
  cursor: pointer;
  width: fit-content;
  padding: 7px 0;
}
.chart-table-scroll {
  max-height: 240px;
  overflow: auto;
  margin-top: 8px;
}
.chart-data table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.chart-data th,
.chart-data td {
  border-bottom: 1px solid var(--line);
  text-align: right;
  padding: 7px 8px;
  font-weight: 400;
}
.chart-data th:first-child {
  text-align: left;
}
.chart-data caption {
  text-align: left;
  padding-bottom: 8px;
}
.breakdown-bar {
  width: 100%;
  height: 8px;
  border-radius: 5px;
  overflow: hidden;
  display: block;
  margin: 20px 0 15px;
}
.segment-empty {
  fill: #393940;
}
.segment-fuel {
  fill: var(--green);
}
.segment-maintenance {
  fill: #35bee4;
}
.segment-insurance {
  fill: #a898ef;
}
.segment-other {
  fill: #a3a3af;
}
.category-dot.insurance {
  background: #a898ef;
}
.breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.breakdown-row > span {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 5px 8px;
  font-size: 13px;
  align-items: center;
}
.breakdown-row small {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
}
.breakdown-row strong {
  font-size: 14px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.breakdown-panel > .hint {
  font-size: 11px;
  margin: 16px 0 0;
}
.history-overview {
  margin-bottom: 12px;
}
.history-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr;
  gap: 16px;
  padding-bottom: 0;
}
.history-stats > div {
  min-width: 0;
}
.history-stats > div > span {
  color: var(--muted);
  font-size: 12px;
}
.history-stats strong {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 23px;
  font-weight: 600;
  margin-top: 4px;
}
.history-search {
  margin-bottom: 14px;
}
.history-search input {
  width: min(100%, 390px);
}
.record-month {
  margin-top: 14px;
}
.record-month h2 {
  font-size: 18px;
  margin: 0 0 10px;
  text-transform: capitalize;
}
.record-month > .ledger {
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
  display: grid;
  gap: 8px;
}
.record-month .row {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.metric-maintenance.is-overdue > strong,
.metric-maintenance.is-overdue .maintenance-state {
  color: var(--red);
}
.metric-maintenance .maintenance-state {
  display: block;
  font-size: 12px;
  line-height: 17px;
  margin: 0;
}
.metric-maintenance > strong {
  flex-direction: column;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
}
.metric-maintenance .maintenance-value > small {
  font-size: 14px;
}
.metric-maintenance.is-overdue {
  box-shadow: inset 0 0 0 1px #ff453a40;
}
@media (max-width: 760px) {
  .period-picker {
    gap: 10px;
  }
  .period-segments {
    flex: 1;
  }
  .period-segments button {
    flex: 1;
    min-width: 70px;
  }
  .period-navigation {
    justify-content: space-between;
    width: 100%;
  }
  .period-anchor input {
    width: 174px;
  }
  .period-dates {
    width: 100%;
    gap: 7px;
  }
  .period-dates label {
    flex: 1;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }
  .period-dates input {
    width: 100%;
    min-width: 0;
  }
  .period-dates > span {
    padding-top: 18px;
  }
  .analytics-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .analytics-total {
    font-size: 30px;
  }
  .chart-axis {
    font-size: 18px;
  }
  .history-stats {
    gap: 12px;
    grid-template-columns: 1fr 1fr;
  }
  .history-stats > div:last-child {
    grid-column: 1/-1;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
  }
  .history-stats > div:last-child strong {
    font-size: 23px;
    margin: 0;
  }
  .parameter-history-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .parameter-history-stats > div:last-child {
    grid-column: auto;
    display: block;
  }
  .parameter-history-stats > div:last-child strong {
    margin-top: 4px;
  }
  .record-month .row {
    padding: 10px 12px;
  }
}
@media (pointer: coarse) {
  .inline-mileage .mileage-value {
    min-height: 44px;
  }
  .period-picker button,
  .period-picker input,
  .currency-switch button {
    min-height: 44px;
  }
  .chart-data summary {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

.summary-car-breakdown .section-title .hint {
  margin: 0;
  font-size: 12px;
}
.summary-car-bar {
  display: block;
  width: 100%;
  height: 10px;
  margin: 16px 0 12px;
  overflow: hidden;
  border-radius: 6px;
}
.summary-car .summary-car-legend {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
}
.summary-car .summary-car-name {
  min-width: 0;
  overflow-wrap: anywhere;
}
.summary-car .summary-car-cost {
  display: block;
  flex: 0 0 auto;
  text-align: right;
  white-space: nowrap;
}
.summary-car .summary-car-cost small {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 400;
}
.summary-car-note {
  margin: 12px 0 0;
  font-size: 11px;
}
@media (max-width: 420px) {
  .summary-car-breakdown .summary-car {
    gap: 9px;
  }
  .summary-car-breakdown .summary-car > .ui-icon {
    display: none;
  }
}
