:root {
  --bg: #f5f3ed;
  --panel: #fffefa;
  --ink: #253a32;
  --muted: #69736b;
  --line: #dce1d7;
  --green: #285641;
  --soft: #e8eee4;
  --amber: #785019;
  --red: #a3392c;
  --shadow: 0 12px 60px #203c221a;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
a {
  color: var(--green);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
.button {
  background: var(--green);
  color: white;
  border: 1px solid transparent;
  padding: 12px 18px;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
button:hover,
.button:hover {
  filter: brightness(0.94);
  text-decoration: none;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button.secondary,
.button.secondary {
  background: var(--panel);
  border-color: var(--line);
  color: var(--ink);
}
button.text-button {
  padding: 8px 0;
  color: var(--muted);
  background: none;
  font-weight: 400;
}
button.icon-button {
  background: none;
  color: var(--ink);
  font-size: 28px;
  padding: 0 8px;
}
.brand {
  font-size: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-family: Georgia, serif;
}
.mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--green);
  color: white;
  font:
    italic 32px Georgia,
    serif;
}
.address {
  font-size: 12px;
  color: var(--muted);
  margin: 16px 0 40px;
  letter-spacing: 0.06em;
}
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 232px;
  border-right: 1px solid var(--line);
  padding: 34px 24px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
}
nav {
  display: grid;
  gap: 6px;
}
nav a {
  color: var(--muted);
  font-size: 14px;
  padding: 12px;
  border-radius: 7px;
}
nav a.active {
  background: var(--soft);
  color: var(--green);
  font-weight: 650;
}
.aside-end {
  margin-top: auto;
  display: grid;
  gap: 16px;
  font-size: 13px;
}
.workspace {
  margin-left: 232px;
}
header {
  height: 78px;
  border-bottom: 1px solid var(--line);
  padding: 0 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}
.private-label::before {
  content: "●";
  color: var(--green);
  font-size: 9px;
  margin-right: 8px;
}
main {
  max-width: 1500px;
  padding: 44px;
  margin: auto;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 11px;
  font-weight: 650;
  color: var(--green);
  margin: 0 0 14px;
}
h1 {
  font-family: Georgia, serif;
  font-size: 42px;
  line-height: 1.12;
  font-weight: 400;
  margin: 0 0 14px;
}
h2 {
  font-size: 19px;
  font-weight: 550;
  margin: 0 0 20px;
}
h3 {
  font-size: 16px;
  margin: 0 0 10px;
}
p {
  line-height: 1.65;
}
.intro {
  color: var(--muted);
  margin: 0;
  max-width: 700px;
  font-size: 15px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}
.page-heading button {
  flex-shrink: 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin: 30px 0;
}
.stat {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
  padding: 22px;
}
.stat small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.stat strong {
  display: block;
  font:
    34px Georgia,
    serif;
  margin: 12px 0;
}
.stat p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 26px;
  margin-bottom: 24px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.panel-head h2 {
  min-width: 0;
  overflow-wrap: anywhere;
  margin: 0;
}
.panel-head a {
  font-size: 13px;
}
.row {
  padding: 17px 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}
.row:first-child {
  border-top: 0;
}
.row p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.row strong {
  font-size: 14px;
  font-weight: 550;
}
.badge {
  display: inline-block;
  font-size: 11px;
  border-radius: 5px;
  padding: 5px 8px;
  background: var(--soft);
  color: var(--green);
  white-space: nowrap;
}
.badge.high {
  background: #f4e9da;
  color: #795015;
}
.badge.unknown {
  background: #efeee8;
  color: #62695f;
}
.amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.subtle {
  color: var(--muted);
  font-size: 12px;
}
.muted {
  color: var(--muted);
}
.tools {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 24px 0;
}
input,
select,
textarea {
  border: 1px solid #c9d0c3;
  border-radius: 6px;
  color: var(--ink);
  background: var(--panel);
  padding: 11px 12px;
  max-width: 100%;
}
input[type="search"] {
  min-width: 220px;
  flex: 1;
}
textarea {
  min-height: 100px;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid #739680;
  outline-offset: 2px;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  text-align: left;
}
th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  background: #f0f2eb;
  font-weight: 600;
  white-space: nowrap;
}
td,
th {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
tbody tr:last-child td {
  border-bottom: 0;
}
td:first-child {
  min-width: 240px;
  max-width: 420px;
}
td p {
  margin: 4px 0 0;
}
.record-link {
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  color: var(--ink);
  font-size: 14px;
  font-weight: 550;
}
.record-link:hover {
  color: var(--green);
  text-decoration: underline;
}
.empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
}
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.cards .panel {
  margin: 0;
}
.content-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
}
.meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}
.callout {
  padding: 18px 22px;
  border-left: 3px solid #829476;
  background: var(--soft);
  font-size: 14px;
  line-height: 1.65;
  margin: 24px 0;
}
.section-space {
  margin-top: 36px;
}
.bar-list {
  display: grid;
  gap: 12px;
}
.water-bar {
  display: grid;
  grid-template-columns: 92px 1fr 84px;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.bar-track {
  background: var(--soft);
  height: 14px;
  border-radius: 3px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: #7d967c;
}

.value-list {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  font-size: 14px;
}
.value-list dt {
  color: var(--muted);
}
.value-list dd {
  margin: 0;
  white-space: pre-wrap;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
  width: min(700px, calc(100% - 24px));
  max-height: 90dvh;
  padding: 0;
}
dialog::backdrop {
  background: #172d245c;
  backdrop-filter: blur(3px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  flex-shrink: 0;
}
.dialog-head h2 {
  margin: 0;
}
#editor-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
label.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.field.wide {
  grid-column: 1/-1;
}
.dialog-actions {
  display: flex;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
  gap: 8px;
}
#form-error {
  color: var(--red);
  font-size: 14px;
}
#notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 22px;
  background: var(--ink);
  color: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 10;
  display: none;
  max-width: 90vw;
}
.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: var(--soft);
}
.login main {
  max-width: 580px;
  padding: 40px;
}
.login h1 {
  font-size: 64px;
  margin: 26px 0;
}
.login .eyebrow {
  margin-top: 32px;
}
.login .button {
  margin: 24px 0 10px;
  min-width: 280px;
}
.login .muted {
  font-size: 12px;
}
.report-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.report-card .button {
  align-self: start;
  margin-top: auto;
}
.archive-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.file-list li {
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--line);
}
.file-list p {
  margin: 0;
}
.file-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  column-gap: 16px;
}
.file-head a {
  padding: 8px 0;
  overflow-wrap: anywhere;
}
.file-head span {
  white-space: nowrap;
}
@media (max-width: 700px) {
  .file-head span {
    flex-basis: 100%;
    margin-bottom: 6px;
  }
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
}
details {
  margin: 16px 0;
}
summary {
  cursor: pointer;
  font-weight: 550;
}
footer {
  font-size: 12px;
  color: var(--muted);
  margin-top: 30px;
}
@media (max-width: 1000px) {
  aside {
    width: 200px;
    padding: 28px 16px;
  }
  .workspace {
    margin-left: 200px;
  }
  main {
    padding: 30px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  header {
    padding: 0 30px;
  }
  .stats {
    gap: 12px;
  }
  .stat {
    padding: 18px;
  }
}

.mobile-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
#section-toggle {
  display: none;
}
.quick-links {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 14px;
  margin: 18px 0;
}
.job-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.job-tab {
  background: transparent;
  color: var(--muted);
  padding: 10px 14px;
  gap: 10px;
  border: 1px solid var(--line);
  font-size: 13px;
}
.job-tab[aria-pressed="true"] {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.job-tab span {
  font-size: 11px;
  opacity: 0.8;
}
.filter-options {
  margin: 0;
}
.filter-options > summary {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  font-size: 14px;
}
.filter-fields {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.filter-options[open] {
  flex-basis: 100%;
}
.results-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 12px;
}
.job-cards {
  display: none;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding-top: 18px;
}
.editor-section {
  grid-column: 1/-1;
  border-top: 1px solid var(--line);
  margin: 0;
  padding-top: 18px;
}
.editor-section summary {
  font-size: 14px;
}
#cost-preview {
  display: block;
  margin: 8px 0 0;
  font-weight: 400;
}
.save-actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
}
#discard-prompt {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--soft);
}
#discard-prompt p {
  margin: 0 0 10px;
}
dialog[open] {
  display: flex;
}
#edit-form {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: calc(90dvh - 2px);
}
#editor-body {
  overflow-y: auto;
  padding: 0 24px 24px;
  overscroll-behavior: contain;
}
#form-error {
  margin: 0;
  padding: 0 24px;
}
#form-error:not(:empty) {
  padding: 12px 24px;
}
@media (max-width: 700px) {
  aside {
    position: sticky;
    top: 0;
    z-index: 5;
    width: auto;
    padding: 14px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    font-size: 23px;
  }
  .address {
    display: none;
  }
  nav {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 16px;
  }
  nav a {
    white-space: normal;
    font-size: 14px;
    padding: 12px;
  }
  .aside-end {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    font-size: 12px;
  }
  .workspace {
    margin: 0;
  }
  header {
    display: none;
  }
  main {
    padding: 26px 20px;
  }
  h1 {
    font-size: 34px;
  }
  .page-heading {
    align-items: start;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
  }
  .stats {
    grid-template-columns: 1fr;
    margin: 24px 0;
  }
  .stat {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 5px;
  }
  .stat strong {
    grid-column: 2;
    grid-row: 1/3;
    margin: 0;
    font-size: 28px;
  }
  .stat p {
    grid-column: 1;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .panel {
    padding: 20px;
  }
  .tools {
    gap: 8px;
  }
  .tools input,
  .tools select {
    width: 100%;
    min-width: 0;
  }
  #editor-fields {
    grid-template-columns: 1fr;
  }
  .field.wide {
    grid-column: 1;
  }
  .value-list {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .value-list dd {
    margin-bottom: 12px;
  }
  .login h1 {
    font-size: 52px;
  }
  .login main {
    padding: 28px;
  }
  .table-wrap {
    max-width: 100%;
  }
  .private-label {
    font-size: 10px;
  }

  #section-toggle {
    display: inline-flex;
    padding: 10px 12px;
    font-size: 13px;
  }
  aside.menu-open nav {
    display: grid;
  }
  aside.menu-open .aside-end {
    display: flex;
  }
  .job-tools {
    margin: 16px 0;
  }
  .filter-options {
    width: 100%;
  }
  .filter-fields {
    display: grid;
    grid-template-columns: 1fr;
  }
  .job-tabs {
    gap: 6px;
  }
  .job-tab {
    padding: 10px;
    gap: 6px;
  }
  .jobs-desktop {
    display: none;
  }
  .job-cards {
    display: grid;
    gap: 12px;
  }
  .job-card {
    margin: 0;
  }
  .job-card h2 {
    margin: 14px 0 8px;
  }
  .job-card .record-link {
    font-size: 18px;
    line-height: 1.35;
  }
  .job-note {
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
  .job-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    font-size: 13px;
  }
  .job-card-footer button {
    padding: 10px 12px;
  }
  .quick-links {
    gap: 12px 20px;
  }
  dialog {
    width: calc(100% - 16px);
    max-height: 94dvh;
  }
  #edit-form {
    max-height: calc(94dvh - 2px);
  }
  .dialog-head {
    padding: 16px 18px;
  }
  #editor-body {
    padding: 0 18px 18px;
  }
  .dialog-actions {
    padding: 12px 16px;
  }
  .dialog-actions button {
    padding: 11px 13px;
    font-size: 14px;
  }
  .dialog-head h2 {
    font-size: 22px;
  }
  .field-grid {
    grid-template-columns: 1fr;
  }
  textarea {
    min-height: 76px;
  }
  input,
  select,
  textarea {
    font-size: 16px;
  }
}

.panel-head > button {
  flex-shrink: 0;
}
.sheet-group {
  margin-top: 28px;
}
.sheet-group h2 {
  font-size: 18px;
  margin: 0 0 12px;
}

.finding {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.finding h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.viewer [data-add],
.viewer [data-restore],
.viewer [data-edit]:not(.record-link):not(.hk-row),
.viewer a[href="/api/backup"] {
  display: none;
}

.job-place {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
}
.job-place::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.5;
}
.job-place:hover {
  text-decoration: underline;
}

/* Conclusions drawn from the records */
.insight-panel {
  border-left: 4px solid var(--amber);
  margin-bottom: 24px;
}
.insight-panel h2 {
  margin: 0 0 8px;
}
.insight-panel p {
  margin: 6px 0;
  line-height: 1.5;
}
.insight-panel a {
  white-space: nowrap;
}
.sale-head {
  font-size: 20px;
  margin: 8px 0 14px;
}
.sale-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.sale-fact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}
.sale-fact h3 {
  margin: 0;
  font-size: 16px;
}
.sale-fact p {
  margin: 0;
  line-height: 1.5;
}
.sale-fact > a {
  margin-top: auto;
  font-weight: 600;
}
.sale-work {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.sale-work li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}
.sale-work li span:last-child {
  color: var(--muted);
  text-align: right;
}

/* Water use per billing period. Each bar opens its bill. */
.water-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 180px;
  margin: 14px 0 4px;
}
.water-bar {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.water-bar:hover {
  background: none;
  filter: none;
  color: var(--ink);
}
.wb-bar {
  width: 100%;
  max-width: 64px;
  height: var(--h, 0%);
  min-height: 2px;
  background: #7d967c;
  border-radius: 4px 4px 0 0;
}
.water-bar:hover .wb-bar {
  background: var(--green);
}
.wb-val {
  color: var(--ink);
  font-weight: 600;
}
