@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@500;600&display=swap");

:root {
  color-scheme: light;
  --ink: #202a22;
  --muted: #7b8379;
  --line: #e4e7df;
  --paper: #ffffff;
  --canvas: #f4f5ef;
  --green: #28694a;
  --green-dark: #1b5138;
  --green-pale: #e9f2e9;
  --red: #b64b3a;
  --red-pale: #fbefeb;
  --mono: "DM Mono", "Courier New", monospace;
  --sans: "DM Sans", "Segoe UI", sans-serif;
  --serif: "Playfair Display", Georgia, serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}
button {
  cursor: pointer;
}

.page-shell {
  width: min(1120px, calc(100% - 64px));
  margin: 0 auto;
}
.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #dfe3d9;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.25px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: var(--green);
  color: white;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0;
}
.brand-divider {
  padding: 0 4px;
  color: #a4aa9f;
}
.date-chip {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 9px;
  color: #5f695f;
  font-family: var(--mono);
  font-size: 11px;
}
.time-separator {
  color: #a4aa9f;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #77a66e;
  box-shadow: 0 0 0 3px #e2ebdd;
}

.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px 0 32px;
}
.eyebrow {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 1.05px;
}
.intro h1 {
  margin: 10px 0 9px;
  font-family: var(--serif);
  font-size: 43px;
  font-weight: 500;
  line-height: 1.04;
}
.intro h1 span {
  color: var(--green);
}
.intro-copy {
  margin: 0;
  color: #727b71;
  font-size: 13px;
}
.intro-stamp {
  width: 108px;
  height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  border: 1px solid #d5dbce;
  border-radius: 50%;
  color: #72806d;
  transform: rotate(8deg);
}
.intro-stamp span {
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 1.1px;
}
.intro-stamp strong {
  color: var(--green);
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 500;
  line-height: 1.1;
}

.summary {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  border: 1px solid #dfe5da;
  background: var(--paper);
}
.summary > article {
  min-width: 0;
  padding: 20px 23px;
}
.summary > article + article {
  border-left: 1px solid var(--line);
}
.summary-main {
  background: var(--green);
  color: white;
}
.summary-main .eyebrow {
  color: #c0d8c5;
}
.summary-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.summary-icon {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid #ffffff55;
  border-radius: 50%;
  overflow: hidden;
  font-size: 14px;
}
.summary-icon img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.summary-value {
  display: block;
  margin-top: 13px;
  font-family: var(--mono);
  font-size: clamp(23px, 3vw, 31px);
  letter-spacing: -0.5px;
}
.summary-main p {
  margin: 6px 0 0;
  color: #d0e0d3;
  font-size: 11px;
}
.summary-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.stat-value {
  display: block;
  margin: 13px 0 6px;
  font-family: var(--mono);
  font-size: 21px;
  color: var(--ink);
}
.stat-note {
  color: var(--muted);
  font-size: 11px;
}
.summary-checks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 10px;
  border: 1px solid var(--line);
  background: #f9faf7;
}
.summary-check-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 13px 16px;
}
.summary-check-item + .summary-check-item {
  border-left: 1px solid var(--line);
}
.summary-check-item span {
  color: #667064;
  font-size: 10px;
}
.summary-check-item output {
  flex: 0 0 auto;
  color: var(--green);
  font-family: var(--mono);
  font-size: 11px;
}
.summary-check-item output.is-off {
  color: var(--red);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}
.form-column,
.results-column {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
}
.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 19px 21px 17px;
  border-bottom: 1px solid #edf0e9;
}
.section-number {
  display: grid;
  place-items: center;
  flex: 0 0 27px;
  height: 27px;
  background: var(--green-pale);
  color: var(--green);
  font-family: var(--mono);
  font-size: 10px;
}
.section-heading h2 {
  margin: 1px 0 4px;
  font-size: 15px;
  font-weight: 600;
}
.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}
.money-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px 14px;
  padding: 19px 21px 22px;
}
.field {
  display: grid;
  gap: 7px;
  color: #596259;
  font-size: 11px;
  font-weight: 600;
}
.input-wrap {
  display: flex;
  align-items: center;
  height: 40px;
  border: 1px solid #dfe4da;
  background: #fcfdfa;
  transition:
    border-color 150ms,
    box-shadow 150ms;
}
.input-wrap:focus-within {
  border-color: #61916b;
  box-shadow: 0 0 0 3px #e8f1e8;
}
.currency-prefix {
  padding: 0 0 0 11px;
  color: #869085;
  font-family: var(--mono);
  font-size: 11px;
}
.input-wrap input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  padding: 0 10px;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
}
.input-wrap input::placeholder {
  color: #b3b9af;
}
.input-wrap input::-webkit-inner-spin-button,
.denomination-row input::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}
.input-wrap input[type="number"],
.denomination-row input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.cash-panel {
  padding-bottom: 0;
}
.cash-mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 15px 21px 2px;
  padding: 0;
  border: 0;
}
.cash-mode-switch legend {
  width: 100%;
  margin-bottom: 8px;
}
.cash-mode-switch label {
  position: relative;
  cursor: pointer;
}
.cash-mode-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.cash-mode-switch label span {
  display: block;
  padding: 8px 11px;
  border: 1px solid #dfe4da;
  color: #667064;
  background: #fcfdfa;
  font-size: 10px;
  font-weight: 600;
}
.cash-mode-switch input:checked + span {
  border-color: var(--green);
  color: var(--green-dark);
  background: var(--green-pale);
}
.cash-mode-switch input:focus-visible + span {
  outline: 2px solid #61916b;
  outline-offset: 2px;
}
.manual-entry {
  padding: 18px 21px 20px;
}
.manual-entry .field {
  max-width: 360px;
}
.denomination-header,
.denomination-row {
  display: grid;
  grid-template-columns: 1fr 100px minmax(100px, 0.8fr);
  align-items: center;
  gap: 12px;
  padding-left: 21px;
  padding-right: 21px;
}
.denomination-header {
  padding-top: 15px;
  padding-bottom: 7px;
  color: #9aa197;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.7px;
}
.denomination-header span:nth-child(2) {
  text-align: center;
}
.denomination-header span:nth-child(3) {
  text-align: right;
}
.denomination-row {
  min-height: 43px;
  border-top: 1px solid #f0f2ed;
}
.denomination-name {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
}
.denomination-row input {
  width: 70px;
  height: 29px;
  justify-self: center;
  padding: 0 7px;
  border: 1px solid #e2e6df;
  background: #fcfdfa;
  color: var(--ink);
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  outline: 0;
}
.denomination-row input:focus {
  border-color: #61916b;
  box-shadow: 0 0 0 2px #e8f1e8;
}
.denomination-row output {
  color: #687267;
  text-align: right;
  font-family: var(--mono);
  font-size: 11px;
}
.cash-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 21px;
  margin-top: 5px;
  border-top: 1px solid #e4e9e1;
  background: #f7f9f5;
  font-size: 12px;
  font-weight: 700;
}
.cash-total-row output {
  color: var(--green);
  font-family: var(--mono);
  font-size: 16px;
}

.check-panel {
  padding-bottom: 5px;
}
.compact-heading {
  padding-bottom: 15px;
}
.check-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 11px 18px;
  border-bottom: 1px solid #edf0e9;
}
.check-row > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.check-row > div span {
  font-size: 11px;
  font-weight: 600;
}
.check-row small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}
.difference {
  flex: 0 0 auto;
  color: var(--green);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
}
.difference.is-off {
  color: var(--red);
}
.net-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 17px 18px 13px;
  font-size: 11px;
  font-weight: 700;
}
.net-row output {
  color: var(--green);
  font-family: var(--mono);
  font-size: 13px;
}
.net-row output.is-negative {
  color: var(--red);
}
.calculation-note {
  margin: 0;
  padding: 0 18px 17px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}
.note-panel {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid #dfe5da;
  background: #edf2e9;
}
.note-mark {
  display: grid;
  place-items: center;
  flex: 0 0 17px;
  height: 17px;
  border: 1px solid #83917d;
  border-radius: 50%;
  color: #687666;
  font-family: var(--serif);
  font-size: 11px;
  font-style: italic;
}
.note-panel p {
  margin: 1px 0 0;
  color: #586456;
  font-size: 10px;
  line-height: 1.55;
}

.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 19px 0 34px;
  margin-top: 2px;
  border-top: 1px solid #dfe3d9;
}
.footer-caption {
  color: #7b8379;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.7px;
}
.footer-caption span {
  padding-left: 6px;
  color: #a0a69c;
}
.footer-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}
.button {
  min-height: 37px;
  padding: 0 14px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 600;
}
.button-quiet {
  color: #647064;
  background: transparent;
}
.button-quiet:hover {
  background: #eaede6;
}
@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 36px, 560px);
  }
  .topbar {
    height: 62px;
  }
  .summary {
    grid-template-columns: 1fr 1fr;
  }
  .summary-main {
    grid-column: 1 / -1;
  }
  .summary > article {
    padding: 16px;
  }
  .summary > article + article {
    border-left: 0;
  }
  .summary > article:last-child {
    border-left: 1px solid var(--line);
  }
  .summary-stat {
    min-height: 102px;
  }
  .stat-value {
    font-size: 17px;
  }
  .summary-checks {
    grid-template-columns: 1fr;
  }
  .summary-check-item + .summary-check-item {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
  .workspace-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 14px;
  }
  .form-column,
  .results-column {
    gap: 14px;
  }
  .results-column {
    grid-row: 2;
  }
  .form-footer {
    padding-bottom: 24px;
  }
}

@media (max-width: 420px) {
  .page-shell {
    width: calc(100% - 28px);
  }
  .date-chip {
    gap: 6px;
    font-size: 9px;
  }
  .money-grid {
    gap: 14px 10px;
    padding: 16px 14px 18px;
  }
  .section-heading {
    padding-right: 14px;
    padding-left: 14px;
  }
  .denomination-header,
  .denomination-row {
    grid-template-columns: 1fr 78px minmax(80px, 0.8fr);
    gap: 6px;
    padding-right: 14px;
    padding-left: 14px;
  }
  .denomination-row input {
    width: 58px;
  }
  .cash-total-row {
    padding-right: 14px;
    padding-left: 14px;
  }
  .cash-mode-switch {
    margin-right: 14px;
    margin-left: 14px;
  }
  .manual-entry {
    padding-right: 14px;
    padding-left: 14px;
  }
  .footer-caption {
    font-size: 8px;
  }
  .footer-actions {
    gap: 3px;
  }
  .button {
    padding: 0 10px;
  }
}
