:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #182827;
  background: #eff4f2;
  --muted: #536662;
  --line: #dee7e3;
  --green: #125b48;
}
* { box-sizing: border-box; }
body { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; margin: 0; }
[hidden] { display: none !important; }
.sidebar { display: flex; flex-direction: column; gap: 44px; padding: 34px 19px 24px; background: #132e2a; color: #eef9f4; }
.brand { display: flex; gap: 10px; align-items: center; padding-left: 8px; font-size: 1.22rem; font-weight: 750; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #bdebd4; color: #15382f; }
nav { display: grid; gap: 5px; }
nav a { padding: 11px 12px; border-radius: 8px; color: #ccded7; text-decoration: none; font-size: .94rem; }
nav a:hover, nav a[aria-current] { color: white; background: #285047; }
.sidebar-footer { margin: auto 8px 0; color: #c0d4cc; font-size: .84rem; }
.sidebar-footer button { border: 1px solid #719188; border-radius: 7px; padding: 7px 10px; background: none; color: #eef9f4; font: inherit; cursor: pointer; margin-top: 8px; min-height: 36px; }
main { min-width: 0; padding: clamp(24px, 5vw, 70px); }
.page { max-width: 1100px; margin-inline: auto; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.85rem, 3vw, 2.8rem); line-height: 1.1; letter-spacing: -.045em; }
h2 { font-size: 1.12rem; letter-spacing: -.018em; }
.page-header p { margin-top: 9px; color: var(--muted); }
.button { display: inline-flex; justify-content: center; align-items: center; width: fit-content; min-height: 44px; padding: 11px 16px; border: 0; border-radius: 8px; color: white; background: var(--green); font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; }
.button:hover { background: #0d493a; }
.button:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 3px solid #198d73; outline-offset: 3px; }
.sidebar :focus-visible { outline-color: #bdebd4; }
.summary-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 18px; margin-bottom: 18px; }
.card { padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.tank { display: flex; flex-direction: column; background: #e0f3e9; border-color: #cce7d8; }
.card-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.badge { padding: 5px 9px; border-radius: 8px; font-size: .875rem; font-weight: 650; background: #eaf2ee; color: #25574a; }
.badge.warning, .notice.error { background: #fff1d8; color: #784407; }
.stat { font-size: clamp(2.7rem, 5vw, 4.3rem); line-height: 1; letter-spacing: -.055em; font-weight: 750; margin-top: 25px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.unit { font-size: 1.25rem; letter-spacing: 0; }
.muted, dt, .threshold { color: var(--muted); }
.stat + .muted { margin: 6px 0 20px; }
.threshold { margin-top: auto; display: flex; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid #beded0; font-size: .9rem; }
dl { margin: 14px 0 0; }
dl div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; }
dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.balance-total { margin-top: 4px; border-top: 1px solid var(--line); }
.balance-total dt, .balance-total dd { color: #182827; font-weight: 750; }
.table-wrap { overflow-x: auto; margin-top: 14px; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .875rem; font-weight: 650; white-space: nowrap; }
th:last-child, td:last-child { text-align: right; white-space: nowrap; }
td[colspan] { text-align: left; color: var(--muted); white-space: normal; }
td:nth-child(2) { overflow-wrap: anywhere; }
tbody tr:last-child td { border-bottom: 0; }
.entry-form { max-width: 740px; display: grid; gap: 22px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
label { display: grid; gap: 8px; font-weight: 650; }
input, select { min-width: 0; width: 100%; min-height: 46px; border: 1px solid #a8bab3; border-radius: 8px; padding: 9px 12px; color: inherit; background: white; font: inherit; font-weight: 450; }
select { appearance: none; padding-right: 32px; background: linear-gradient(45deg, transparent 50%, #4b665d 50%) right 15px center / 5px 5px no-repeat, linear-gradient(135deg, #4b665d 50%, transparent 50%) right 10px center / 5px 5px no-repeat, white; }
.volume-preview, .notice { padding: 13px; border-radius: 8px; background: #e7f4ed; color: #174d3e; }
.volume-preview { display: flex; justify-content: space-between; gap: 12px; }
output { font-weight: 750; }
#load-status { margin-bottom: 16px; }
@media (max-width: 850px) {
  body { display: block; }
  .sidebar { gap: 15px; padding: 16px 20px; }
  nav { display: flex; flex-wrap: wrap; }
  .sidebar-footer { margin: 0 8px; }
  .sidebar-footer button { margin: 0 0 0 10px; }
}
@media (max-width: 610px) {
  main { padding: 24px 16px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .summary-grid, .field-row { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  th, td { padding-inline: 7px; }
}
