:root { color-scheme: light; font-family: system-ui, -apple-system, sans-serif; color: #193047; background: #f2f6fa; font-size: 16px; line-height: 1.55; }
* { box-sizing: border-box; }
body { margin: 0; }
a { color: #12547d; text-underline-offset: .18em; }
a:hover { color: #083b5b; }
header { background: #12354b; color: white; }
.header-inner { max-width: 66rem; margin: auto; padding: 1.1rem 1.5rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.brand { font-size: 1.15rem; font-weight: 700; color: white; text-decoration: none; }
.brand:hover { color: white; text-decoration: underline; }
nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
main { max-width: 66rem; margin: 2.5rem auto; padding: 0 1.5rem; }
h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 1rem; }
h2 { font-size: 1.35rem; margin: 0 0 1rem; }
p { margin: 0 0 1.2rem; }
.panel { background: white; border: 1px solid #c9d7e3; border-radius: .65rem; padding: 1.5rem; margin: 1.5rem 0; }
.sign-in { max-width: 30rem; margin: 4rem auto; }
.eyebrow { color: #416079; font-weight: 600; }
.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
label { display: block; margin: .6rem 0 .4rem; font-weight: 600; }
input, select { width: 100%; padding: .75rem; border: 1px solid #7c91a4; border-radius: .3rem; font: inherit; background: white; color: inherit; }
.billing-period { min-width: 0; padding: 0; margin: .6rem 0 0; border: 0; }
.billing-period legend { padding: 0; margin-bottom: .4rem; font-weight: 600; }
.month-year { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(6rem, 1fr); gap: .5rem; }
.select-wrap { position: relative; }
select { appearance: none; padding-right: 2.2rem; cursor: pointer; }
.select-wrap::after { content: ""; position: absolute; right: 1rem; top: 45%; width: .45rem; height: .45rem; border-right: 2px solid #193047; border-bottom: 2px solid #193047; transform: translateY(-50%) rotate(45deg); pointer-events: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
button { min-height: 2.75rem; padding: .65rem 1.1rem; border: 1px solid transparent; border-radius: .3rem; background: #12668c; color: white; cursor: pointer; font: inherit; font-weight: 600; }
button:hover { background: #0b4b69; }
button:disabled { opacity: .6; cursor: wait; }
button.secondary { background: transparent; border-color: #b7ccd9; color: white; }
button.danger { background: #a62d32; }
.cancel { display: inline-block; margin: .6rem; }
.hint, .field-error { display: block; font-size: .9rem; margin-top: .3rem; }
.hint, .empty { color: #456076; }
.field-error, #form-message { color: #9c222b; }
#form-message:empty { margin: 0; }
#form-message:not(:empty) { margin: 1rem 0; }
[aria-invalid="true"] { border-color: #9c222b; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
caption { text-align: left; margin-bottom: .75rem; color: #456076; }
th, td { padding: .9rem .75rem; text-align: right; border-bottom: 1px solid #d5dfe8; white-space: nowrap; }
th:first-child { text-align: left; }
thead { background: #eef4f8; }
.actions a + a { margin-left: 1rem; }
:focus-visible { outline: 3px solid #d97800; outline-offset: 3px; }
.skip-link { position: absolute; left: 1rem; top: -5rem; background: white; padding: .7rem; z-index: 1; }
.skip-link:focus { top: 1rem; }
.notice { max-width: 63rem; margin: 1rem auto; padding: 1rem; background: white; }
@media (max-width: 42rem) { main { padding: 0 1rem; margin-top: 1.5rem; } .panel { padding: 1rem; } .fields { grid-template-columns: 1fr; gap: .5rem; } .account { overflow-wrap: anywhere; } .sign-in { margin-top: 2rem; } }

nav a, nav a:hover { color: white; }
.electricity-period { max-width: 24rem; }
.input-section { min-width: 0; border: 0; border-top: 1px solid #d5dfe8; padding: 1rem 0; margin: 1.5rem 0 0; }
.input-section legend { padding: 0 .5rem 0 0; font-weight: 600; font-size: 1.1rem; }
.input-section > .hint { margin-top: 1rem; }
.opening-override { display: flex; align-items: center; gap: .6rem; }
.opening-override input { width: auto; padding: 0; flex: none; }
#electricity-form input[readonly] { background: #eef4f8; }
.record-values { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1rem 1.5rem; margin: 1rem 0; }
.record-values dt { color: #456076; }
.record-values dd { margin: .3rem 0 0; font-size: 1.2rem; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.reconciliation-note { border-left: 4px solid #12668c; padding-left: 1rem; }

/* Shared annual utility tables and the compact electricity summary. */
main.annual-main { max-width: 110rem; padding: 0 1rem; }
.annual-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.annual-heading h1 { margin: 0; }
.annual-year { display: flex; align-items: center; gap: .6rem; }
.annual-year label { margin: 0; }
.annual-year input { width: 7rem; padding: .5rem; }
.annual-year button { padding: .5rem .8rem; }
.annual-scroll { overflow-x: auto; border: 1px solid #c9d7e3; border-radius: .5rem; background: white; }
.annual-table { table-layout: fixed; font-size: .8125rem; }
.annual-units { caption-side: bottom; padding: .5rem .65rem; margin: 0; font-size: .85rem; border-top: 1px solid #c9d7e3; }
.annual-table th, .annual-table td { padding: .65rem .25rem; white-space: normal; overflow-wrap: anywhere; vertical-align: middle; }
.annual-table thead th { font-weight: 600; }
.annual-table th:first-child { width: 7rem; position: sticky; left: 0; z-index: 1; background: white; padding-left: .65rem; }
.annual-table thead th:first-child, .annual-table tfoot th:first-child { background: #eef4f8; z-index: 2; }
.annual-table tbody th a { display: inline-block; padding: .35rem 0; }
.annual-table tfoot { background: #eef4f8; font-weight: 700; border-top: 2px solid #aabfce; }
.annual-table tfoot td { padding-top: .9rem; padding-bottom: .9rem; }
.column-unit, .coverage { display: block; color: #456076; font-size: .75rem; font-weight: 400; }
.review-marker { display: block; font-size: .7rem; color: #9c222b; }
.water-annual { font-size: .95rem; }
.electricity-annual { min-width: 36rem; font-size: .95rem; }
.water-annual th, .water-annual td { padding: .65rem 1rem; }
#entry-dialog { width: min(56rem, calc(100% - 3rem)); max-height: calc(100dvh - 3rem); padding: 0; border: 1px solid #7c91a4; border-radius: .65rem; color: inherit; background: white; }
#entry-dialog::backdrop { background: rgb(12 30 45 / 55%); }
#entry-dialog .panel { border: 0; margin: 0; }
#entry-dialog .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#entry-dialog .input-section { margin-top: 1rem; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.form-actions .cancel { margin: 0 .6rem; }
.form-actions .danger { margin-left: auto; }
.entry-warnings { color: #9c222b; padding-left: 1.25rem; font-size: .9rem; }
@media (max-width: 42rem) {
  .annual-heading { align-items: flex-start; }
  .annual-heading h1 { font-size: 1.6rem; }
  .annual-year { gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
  .annual-year input { width: 5.5rem; }
  .annual-table th:first-child { width: 6.25rem; }
  .water-annual th, .water-annual td { padding: .65rem .5rem; }
  #entry-dialog { width: calc(100% - 1rem); max-width: none; height: calc(100dvh - 1rem); max-height: calc(100dvh - 1rem); border-radius: .4rem; }
  #entry-dialog .fields { grid-template-columns: 1fr; }
}

/* Checkbox filters and shared electricity / separate water chart panels. */
.chart-filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(10rem, 1fr) auto; gap: 1rem; align-items: end; }
.chart-filters > div { min-width: 0; }
.control-label { display: block; margin: .6rem 0 .4rem; font-weight: 600; }
.year-control, .metric-control { position: relative; }
#year-selector summary, #metric-selector summary { display: flex; align-items: center; gap: .75rem; min-height: 3.125rem; padding: .75rem; border: 1px solid #7c91a4; border-radius: .3rem; background: white; cursor: pointer; list-style: none; }
#year-selector summary::-webkit-details-marker, #metric-selector summary::-webkit-details-marker { display: none; }
#year-selector summary::after, #metric-selector summary::after { content: ""; flex: 0 0 .45rem; height: .45rem; margin-left: auto; margin-right: .15rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
#year-selector[open] summary::after, #metric-selector[open] summary::after { transform: rotate(225deg); }
#selected-years, #selected-metrics { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.year-options, .metric-options { position: absolute; top: 100%; left: 0; right: 0; z-index: 5; padding: 1rem; border: 1px solid #7c91a4; border-radius: .3rem; background: white; box-shadow: 0 .5rem 1rem rgb(12 30 45 / 15%); }
.year-options fieldset, .metric-options fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.year-list, .metric-list { max-height: 16rem; overflow-y: auto; padding: .2rem; }
.year-list label, .metric-list label { display: flex; gap: .6rem; align-items: center; min-height: 2.75rem; margin: 0; padding: .3rem; cursor: pointer; }
.year-list input, .metric-list input { flex: 0 0 auto; width: 1.1rem; height: 1.1rem; margin: 0; }
#years-error, #metrics-error { color: #9c222b; font-size: .9rem; }
#years-error:empty, #metrics-error:empty { margin: 0; }
.filter-apply { width: auto; min-height: 3.125rem; }
.column-chart { margin: 1.5rem 0; padding: 1.25rem; background: white; border: 1px solid #c9d7e3; border-radius: .65rem; }
.chart-heading { font-size: 1rem; font-weight: 600; }
.axis-unit { grid-area: unit; text-align: right; color: #456076; margin: .25rem 0 .5rem; }
.column-body { display: grid; grid-template-columns: max-content minmax(0, 1fr); grid-template-areas: "unit ." "axis plot"; column-gap: .5rem; font-size: .75rem; }
.column-axis { grid-area: axis; display: flex; flex-direction: column; justify-content: space-between; height: 260px; padding: 10px 0; text-align: right; font: inherit; font-variant-numeric: tabular-nums; }
.axis-tick { display: block; line-height: 0; white-space: nowrap; }
.column-scroll { grid-area: plot; min-width: 0; overflow-x: auto; padding-bottom: .3rem; }
.column-plot { display: grid; grid-template-columns: repeat(12, minmax(1.5rem, 1fr)); align-items: start; }
.month-group { display: block; min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: #193047; font-size: .75rem; font-weight: 400; text-align: center; }
.month-group:hover { background: #eef4f8; }
.month-group:focus-visible { outline-offset: -2px; }
.month-columns { display: block; width: 100%; height: 260px; overflow: visible; }
.column-grid { stroke: #d5dfe8; stroke-width: 1; vector-effect: non-scaling-stroke; }
.column-baseline { stroke: #7c91a4; stroke-width: 1; vector-effect: non-scaling-stroke; }
.column-zero { stroke: white; stroke-width: 1; vector-effect: non-scaling-stroke; }
.month-name { display: block; padding: .25rem 0; }
.month-number { display: none; }
.month-zeros { display: flex; justify-content: center; flex-wrap: wrap; gap: .2rem; }
.zero-chip { display: inline-flex; align-items: center; gap: .1rem; font-size: .65rem; }
.zero-chip svg { width: .4rem; height: .4rem; }
.chart-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.5rem; padding: 0; margin: 1rem 0 0; list-style: none; font-size: .9rem; }
.chart-legend li { display: inline-flex; align-items: center; gap: .4rem; }
.chart-legend svg { width: .75rem; height: .75rem; }
.chart-detail { margin: 1rem 0 0; font-size: .9rem; font-variant-numeric: tabular-nums; }
.chart-detail:empty { margin: 0; }
.column-plot[data-density="2"] { grid-template-columns: repeat(12, minmax(2.5rem, 1fr)); }
.column-plot[data-density="4"] { grid-template-columns: repeat(12, minmax(4.5rem, 1fr)); }
.column-plot[data-density="8"] { grid-template-columns: repeat(12, minmax(8.5rem, 1fr)); }
.column-plot[data-density="16"] { grid-template-columns: repeat(12, minmax(16.5rem, 1fr)); }
.column-plot[data-density="32"] { grid-template-columns: repeat(12, minmax(32.5rem, 1fr)); }
.column-plot[data-density="64"] { grid-template-columns: repeat(12, minmax(64.5rem, 1fr)); }
@media (max-width: 42rem) {
  .chart-filters { grid-template-columns: 1fr; gap: .5rem; }
  .column-chart { padding: .65rem .4rem; }
  .month-word { display: none; }
  .month-number { display: block; }
  .column-body, .month-group { font-size: .65rem; }
  .chart-legend { gap: .5rem 1rem; }
}
