:root {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  color: #243630;
  background: #f5f4ee;
  line-height: 1.55;
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: #23654d;
}
button,
input,
select {
  font: inherit;
}
button,
.file {
  border: 1px solid #215d49;
  border-radius: 6px;
  padding: 0.65rem 1rem;
  background: #215d49;
  color: white;
  cursor: pointer;
  font-weight: 600;
}
button:hover {
  background: #173f32;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button.secondary {
  background: white;
  color: #215d49;
}
input,
select {
  width: 100%;
  min-width: 0;
  padding: 0.6rem;
  border: 1px solid #b8c1b9;
  border-radius: 5px;
  background: white;
  color: #182b23;
}
input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid #b47b25;
  outline-offset: 3px;
}
label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.9rem;
}
form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: end;
  gap: 1rem;
}
form button {
  justify-self: start;
}
main {
  max-width: 1180px;
  margin: auto;
  padding: 2rem 1.5rem;
}
.bar {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  border-bottom: 1px solid #d5dbd2;
  padding: 1rem 2rem;
}
.bar > a {
  font-weight: 800;
  letter-spacing: 0.15em;
  text-decoration: none;
}
.bar span {
  font-size: 0.8rem;
}
.badge {
  margin-left: auto;
  border: 1px solid #c3cabc;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
}
.intro {
  max-width: 750px;
  padding: 1rem 0 2rem;
}
h1 {
  font-family: Georgia, serif;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 400;
  line-height: 1.1;
  margin: 0.6rem 0 1.3rem;
}
h2 {
  font-size: 1.3rem;
  margin: 0 0 0.7rem;
}
h3 {
  font-size: 1rem;
  margin: 1.6rem 0 0.7rem;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 700;
}
.muted {
  color: #53685d;
  font-size: 0.9rem;
}
.panel {
  background: #fff;
  border: 1px solid #d7ddd3;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.3rem;
}
.panel > p {
  max-width: 850px;
}
.actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}
.file {
  display: block;
  position: relative;
}
.file input {
  max-width: 250px;
  margin-top: 0.5rem;
  font-size: 0.8rem;
}
.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}
.stat {
  background: #e4ece4;
  border-radius: 8px;
  padding: 1rem;
}
.stat strong {
  display: block;
  font-size: 1.4rem;
}
.stat span {
  font-size: 0.8rem;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.3rem;
}
.split .panel {
  min-width: 0;
}
.wide {
  grid-column: 1/-1;
}
nav {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}
details {
  margin-top: 1.3rem;
}
summary {
  cursor: pointer;
  font-weight: 600;
}
details form {
  margin-top: 1rem;
}
.table-wrap {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.85rem;
}
th,
td {
  border-bottom: 1px solid #dce2d9;
  text-align: left;
  padding: 0.65rem;
  vertical-align: top;
  overflow-wrap: anywhere;
  max-width: 260px;
}
th {
  background: #f1f4ee;
}
td.money {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
#message:not(:empty) {
  background: #fff1d9;
  border: 1px solid #b8812f;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}
#save-status {
  font-weight: 600;
}
#import-review {
  border: 2px solid #b8812f;
  padding: 1rem;
  margin-top: 1rem;
}
.packet-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.8rem;
  color: #53685d;
}
[hidden] {
  display: none !important;
}
@media (max-width: 700px) {
  main {
    padding: 1.5rem 0.8rem;
  }
  .bar {
    padding: 1rem;
    flex-wrap: wrap;
  }
  .bar > span:not(.badge) {
    display: none;
  }
  .badge {
    margin-left: 0;
  }
  .panel {
    padding: 1rem;
  }
  .split {
    display: block;
  }
  .summary {
    grid-template-columns: 1fr 1fr;
  }
  .packet-heading {
    display: block;
  }
  .actions button {
    width: 100%;
  }
  form {
    grid-template-columns: 1fr;
  }
  th,
  td {
    padding: 0.45rem;
  }
}
@media print {
  .no-print,
  .bar,
  .intro,
  footer,
  #message {
    display: none !important;
  }
  body {
    background: white;
    color: black;
    font-size: 10pt;
  }
  main {
    max-width: none;
    padding: 0;
  }
  .panel {
    border: 0;
    padding: 0;
  }
  table {
    font-size: 8pt;
    table-layout: fixed;
  }
  th,
  td {
    max-width: none;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
  .table-wrap {
    overflow: visible;
  }
  thead {
    display: table-header-group;
  }
  tr {
    break-inside: avoid;
  }
  .summary {
    grid-template-columns: repeat(4, 1fr);
  }
  .stat {
    border: 1px solid #aaa;
    background: white;
  }
  h3 {
    break-after: avoid;
  }
  a {
    color: black;
  }
}

@media screen and (max-width: 700px) {
  .table-wrap {
    overflow: visible;
  }
  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }
  thead {
    display: none;
  }
  tr {
    border: 1px solid #dce2d9;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
  }
  td {
    max-width: none;
    border: 0;
    padding: 0.3rem;
    display: grid;
    grid-template-columns: minmax(105px, 40%) 1fr;
    gap: 0.5rem;
  }
  td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #53685d;
    overflow-wrap: normal;
  }
}
@page {
  size: A4 landscape;
  margin: 12mm;
}

.review-warning,
#recovery-status:not(:empty) {
  padding: 1rem;
  border: 2px solid #a86c14;
  background: #fff2d7;
  color: #603e0c;
  border-radius: 6px;
}
