.fuel-entry-top, .fuel-records-head, .fuel-outputs {
  display: flex;
  gap: .75rem 1rem;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.fuel-entry-top h2, .fuel-records-head h2 { margin: 0; }
.fuel-records-head p { margin: .25rem 0 .5rem; }

.fuel-text-button, .fuel-row-action {
  color: #16584e;
  font: inherit;
  font-weight: 700;
  background: transparent;
  border: 0;
  text-decoration: underline;
  text-underline-offset: .16em;
  cursor: pointer;
}

.fuel-text-button { padding: .35rem 0; }
.fuel-text-button:hover, .fuel-row-action:hover { color: #092f29; }

.fuel-vehicle-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .7rem;
  padding: .8rem 0;
  font-weight: 700;
}

.fuel-vehicle-row select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: .45rem .6rem;
  border: 1px solid #80938a;
  border-radius: .5rem;
  background: #fff;
}

.fuel-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}
.fuel-fields .car-field { min-width: 0; }
.fuel-fields input { width: 100%; min-width: 0; }
.fuel-fields input[type=date] { min-height: 44px; }
.fuel-unit-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .25rem;
}
.fuel-unit-input select { padding-inline: .38rem; }
.fuel-unit-input input, .fuel-unit-input select { min-width: 0; }

.fuel-tank { border: 0; margin: .55rem 0 .25rem; padding: 0; min-width: 0; }
.fuel-tank legend { font-size: .93rem; font-weight: 700; padding: 0; }
.fuel-tank-options {
  display: flex;
  gap: .45rem;
  margin-top: .3rem;
}
.fuel-tank-options label {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  background: #f6f7f3;
  padding: .25rem .65rem;
  border: 1px solid #a6ada3;
  border-radius: .55rem;
  cursor: pointer;
}
.fuel-tank-options label:has(:checked) {
  background: #e5f1e7;
  border-color: #2e6958;
}
.fuel-page input[type=radio], .fuel-page input[type=checkbox] {
  width: 1.08rem;
  min-height: 0;
  height: 1.08rem;
  flex: 0 0 1.08rem;
  margin: 0;
  accent-color: #235f50;
  padding: 0;
}
.fuel-check {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 38px;
  width: fit-content;
  font-size: .93rem;
  cursor: pointer;
}
.fuel-gap-help { margin: 0 0 .6rem; }
#fillForm .car-actions { margin-top: .55rem; }
#fuelStatus:empty, #exportStatus:empty { display: none; }
.fuel-vehicle-tools, .fuel-average { margin-top: .8rem; }
.fuel-vehicle-tools summary, .fuel-average summary, .fuel-help summary {
  cursor: pointer;
  font-weight: 700;
  min-height: 34px;
  align-content: center;
}
.fuel-vehicle-tools form { margin: .45rem 0; }
.fuel-vehicle-tools form .car-actions { margin-top: .45rem; }

.fuel-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: .4rem;
  margin: .3rem 0 .85rem;
}
.fuel-metric {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .15rem .7rem;
  align-items: center;
  padding: .7rem .75rem;
  border-bottom: 1px solid #d4ddd3;
}
.fuel-metric > span { font-weight: 700; }
.fuel-metric strong { font-size: clamp(1.25rem, 2.6vw, 1.75rem); font-variant-numeric: tabular-nums; }
.fuel-metric small { grid-column: 1 / -1; color: #445649; font-size: .875rem; }
.fuel-guidance { margin: .8rem 0; font-weight: 700; }
.fuel-results .car-muted, .fuel-average p { margin: .45rem 0; }

.fuel-notice {
  padding: .75rem;
  color: #613e08;
  background: #fff1ce;
  border: 1px solid #bb823d;
  border-radius: .55rem;
}

.fuel-records, .fuel-help { margin-block: 1rem; }
.fuel-file-label { position: relative; overflow: hidden; cursor: pointer; }
.fuel-file-label:focus-within { outline: .15rem solid #226650; outline-offset: .18rem; }
.fuel-file-label input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }

.fuel-table-scroll { margin-top: .65rem; }
.fuel-table { font-variant-numeric: tabular-nums; }
.fuel-table th { text-align: left; }
.fuel-table td { vertical-align: top; }
.fuel-table td:nth-child(2), .fuel-table td:nth-child(3), .fuel-table td:nth-child(4), .fuel-table td:nth-child(6),
.fuel-table th:nth-child(2), .fuel-table th:nth-child(3), .fuel-table th:nth-child(4), .fuel-table th:nth-child(6) {
  text-align: right;
}
.fuel-row-action { min-height: 42px; padding: .1rem .45rem; }
.fuel-row-action[data-action=delete] { color: #80493b; }
.fuel-outputs {
  justify-content: flex-start;
  align-items: end;
  margin-top: .95rem;
}
.fuel-help details + details { margin-top: .25rem; }

@media (min-width: 840px) {
  .fuel-workspace { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
}

@media (max-width: 600px) {
  .fuel-entry-top { align-items: center; }
  .fuel-entry-top h2 { font-size: 1.25rem; }
  .fuel-fields { gap: .5rem; }
  .fuel-fields .car-field > label { overflow-wrap: anywhere; }
  .fuel-unit-input { gap: .15rem; }
  .fuel-unit-input input { padding-inline: .45rem; }
  .fuel-unit-input select { font-size: .88rem; padding-inline: .3rem; }
  .fuel-records-head { align-items: stretch; }
  .fuel-file-actions { width: 100%; }
  .fuel-table-scroll { overflow: visible; border: none; }
  .fuel-table, .fuel-table tbody { display: block; }
  .fuel-table thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .fuel-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .2rem .5rem;
    padding: .65rem;
    margin-bottom: .6rem;
    border: 1px solid #a6ada3;
    border-radius: .6rem;
    background: #fff;
  }
  .fuel-table tbody td {
    display: block;
    border: 0;
    padding: .1rem;
    white-space: normal;
    text-align: left !important;
    overflow-wrap: anywhere;
  }
  .fuel-table tbody td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-weight: 700;
    font-size: .84rem;
    color: #445649;
  }
  .fuel-table tbody td:last-child { grid-column: 1 / -1; }
}
