:root { color-scheme: light; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: #f3efe7;
  color: #1c241c;
  font: 16px/1.45 system-ui, sans-serif;
}
main { max-width: 40rem; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
header { text-align: center; }
.logo { display: block; width: min(100%, 18rem); height: auto; margin: 0 auto 0.2rem; }
h1 { font-size: 1.05rem; font-weight: 650; letter-spacing: 0; color: #3d5346; margin: 0 0 1.1rem; }
h2 { font-size: 1.05rem; margin: 0; }
section {
  background: #fff;
  border: 1px solid #e6dfd3;
  border-radius: 14px;
  padding: 1rem;
  margin: 0 0 0.75rem;
  box-shadow: 0 1px 2px rgba(40, 32, 22, 0.05);
}
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.section-head .text { width: auto; margin: 0; padding: 0.2rem 0; }
label { display: block; margin: 0.75rem 0 0; font-size: 0.92rem; font-weight: 600; }
input:not([hidden]), select, textarea {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.7rem 0.75rem;
  font: inherit;
  font-weight: 450;
  color: inherit;
  background: #fff;
  border: 1px solid #d5cec3;
  border-radius: 8px;
}
textarea { min-height: 4.5rem; resize: vertical; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
button {
  font: inherit;
  min-height: 44px;
  border-radius: 8px;
  cursor: pointer;
}
button.primary {
  width: 100%;
  margin-top: 0.85rem;
  border: 0;
  background: #1f4d3a;
  color: #fff;
  font-weight: 650;
}
button.primary:disabled { background: #9aa59a; cursor: default; }
button.secondary {
  width: 100%;
  border: 2px solid #1f4d3a;
  background: #fff;
  color: #1f4d3a;
  font-weight: 650;
}
.receipt-actions { display: grid; gap: 0.55rem; margin-top: 0.85rem; }
.receipt-actions .primary,
.receipt-actions .secondary { margin-top: 0; }
button.text {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.4rem;
  border: 0;
  background: transparent;
  color: #1f4d3a;
  font-weight: 650;
  text-decoration: underline;
}
.hint, .foot { color: #5e675e; font-size: 0.9rem; }
.foot.ok { color: #1f6b4a; font-weight: 650; }
.notice {
  margin: 0.75rem 0 0;
  padding: 0.7rem 0.8rem;
  border-radius: 8px;
  background: #eef3ea;
  color: #1c241c;
}
.notice.wait { background: #f3efe7; }
.notice.ok { background: #e5f4ea; color: #145c38; font-weight: 650; }
.notice.bad { background: #fdeeee; color: #8f1d1c; font-weight: 650; }
.flag {
  margin: 0.55rem 0 0;
  padding: 0.55rem 0.7rem;
  color: #8f1d1c;
  background: #fdeeee;
  border-radius: 8px;
}
.card {
  margin-top: 0.65rem;
  padding: 0.2rem 0.75rem 0.45rem;
  background: #fbfaf7;
  border: 1px solid #e6dfd3;
  border-radius: 12px;
}
.card.fresh { box-shadow: inset 3px 0 0 #1f6b4a; }
.card.bad { box-shadow: inset 3px 0 0 #8f1d1c; }
button.row {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.7rem 0.1rem 0.35rem;
  border: 0;
  background: transparent;
  text-align: left;
  text-decoration: none;
  min-height: 0;
  color: inherit;
}
.row-top, .row-bottom { display: flex; justify-content: space-between; gap: 0.75rem; align-items: baseline; }
.row-title { font-weight: 700; }
.row-amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.row-sub { color: #5e675e; font-size: 0.92rem; }
.row-action { color: #1f4d3a; font-size: 0.9rem; font-weight: 650; text-decoration: underline; white-space: nowrap; }
.totals {
  margin-top: 0.9rem;
  padding: 0.85rem 1rem;
  background: #e7f2eb;
  border-radius: 12px;
}
.total-label { margin: 0; color: #3d5346; font-size: 0.85rem; font-weight: 650; }
.total-figure { margin: 0.1rem 0 0; font-size: 1.7rem; font-weight: 750; letter-spacing: -0.03em; }
.total-meta { margin: 0.15rem 0 0; color: #243028; }
.muted { color: #5e675e; font-size: 0.9rem; }
.flag button {
  margin-left: 0.4rem;
  min-height: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}
canvas {
  width: 100%;
  height: 140px;
  margin-top: 0.75rem;
  border: 1px dashed #b9b3a8;
  border-radius: 8px;
  background: #fff;
  touch-action: none;
}
#summary { margin: 0.7rem 0 0; font-weight: 650; }
#status:empty { display: none; }
