:root {
  color-scheme: light;
  --ink: #222d25;
  --muted: #556055;
  --line: #b1b7a9;
  --red: #a44330;
  --paper: #f7f5ee;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans: "Hiragino Sans", "Yu Gothic", sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.65 var(--sans);
}
.mast,
main,
footer {
  width: min(1040px, calc(100% - 80px));
  margin: auto;
}
.mast {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ink);
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 11px;
  font: bold 22px var(--serif);
  letter-spacing: 0.08em;
}
.wordmark i {
  display: inline-block;
  width: 22px;
  height: 25px;
  border: 2px solid var(--ink);
  border-left: 6px solid var(--ink);
  transform: rotate(-4deg);
  background: repeating-linear-gradient(0deg, transparent 0 5px, var(--ink) 5px 6px);
}
details {
  position: relative;
  font-size: 14px;
}
summary {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}
details p {
  position: absolute;
  z-index: 1;
  right: 0;
  top: 24px;
  width: min(300px, 78vw);
  padding: 16px;
  background: #fffdf5;
  border: 1px solid var(--ink);
}
main {
  padding: 52px 0 36px;
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font: 600 clamp(42px, 6.2vw, 76px)/1.25 var(--serif);
  letter-spacing: 0.02em;
}
h1 span {
  color: var(--red);
}
.intro {
  margin: 14px 0 34px;
  color: var(--muted);
}
.spread {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(270px, 1fr);
  gap: clamp(24px, 5vw, 70px);
  align-items: start;
}
.ledger {
  border-top: 4px solid var(--ink);
  min-width: 0;
}
.daynav,
.date,
.arrows,
.list-heading,
.add,
.amount,
li {
  display: flex;
  align-items: center;
}
.daynav,
.list-heading,
.add,
li {
  justify-content: space-between;
}
.daynav {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  gap: 8px;
}
.date {
  gap: 6px;
  min-width: 0;
}
.date input {
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 600 17px var(--sans);
  padding: 4px 0;
  max-width: 175px;
}
#weekday,
.list-heading span {
  font-size: 13px;
  color: var(--muted);
}
.arrows {
  gap: 5px;
}
button,
input,
summary {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  color: inherit;
  border: 0;
  border-radius: 0;
  font: inherit;
}
button:disabled {
  opacity: 0.35;
  cursor: default;
}
.arrows button {
  background: transparent;
  border: 1px solid var(--line);
  height: 34px;
  width: 38px;
  line-height: 1;
}
.balance {
  padding: 22px 0 20px;
}
.balance h2,
.list-heading h2 {
  font-size: 15px;
  font-weight: 600;
}
.sum {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font:
    normal clamp(52px, 7vw, 82px)/1.1 Georgia,
    "Times New Roman",
    serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}
.yen {
  font-size: 0.42em;
  color: var(--red);
}
output {
  min-width: 0;
}
.list-heading {
  padding: 9px 0;
  border-block: 1px solid var(--ink);
}
ul {
  padding: 0;
  margin: 0;
  list-style: none;
}
li {
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  align-items: baseline;
}
li .name {
  flex: 1;
  overflow-wrap: anywhere;
}
li .money {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.refund {
  color: var(--red);
}
#empty {
  padding: 15px 0;
  color: var(--muted);
}
.entry {
  background: #e9ecdf;
  border-top: 4px solid #56684e;
  padding: 21px clamp(17px, 3vw, 30px) 22px;
}
.entry h2 {
  font: 600 25px/1.4 var(--serif);
  margin-bottom: 17px;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}
legend,
.field {
  font-weight: 600;
  font-size: 14px;
}
.types {
  display: flex;
  gap: 22px;
  margin: 4px 0 12px;
}
.types label {
  cursor: pointer;
}
.types input {
  accent-color: #354936;
}
.field {
  display: block;
  margin-bottom: 12px;
}
.field > input,
.amount {
  width: 100%;
  padding: 9px 11px;
  margin-top: 4px;
  background: #fffef9;
  border: 1px solid #89927f;
}
.field input {
  font: normal 16px var(--sans);
  color: var(--ink);
  border-radius: 0;
}
.field > input,
.amount {
  height: 42px;
}
.amount input {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
}
.amount span {
  color: var(--muted);
}
.add {
  background: #314836;
  color: white;
  width: 100%;
  padding: 10px 15px;
  margin-top: 20px;
  font-weight: 600;
}
.add:hover {
  background: #233728;
}
:focus-visible {
  outline: 2px solid #963e29;
  outline-offset: 3px;
}
#feedback:not(:empty) {
  margin-top: 10px;
  font-size: 13px;
}
footer {
  border-top: 1px solid var(--line);
  padding: 15px 0 26px;
  color: var(--muted);
  font-size: 12px;
}
@media (max-width: 700px) {
  .mast,
  main,
  footer {
    width: calc(100% - 36px);
  }
  .mast {
    height: 57px;
  }
  main {
    padding: 31px 0 25px;
  }
  .intro {
    margin: 10px 0 23px;
    font-size: 14px;
  }
  .spread {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .balance {
    padding: 16px 0;
  }
  .entry h2 {
    font-size: 23px;
  }
  .entry {
    padding: 17px 18px 20px;
  }
}
.reading {
  max-width: 44rem;
  padding-bottom: 3rem;
}
.reading h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
.reading h2 { margin-top: 2em; font-size: 1.25rem; }
.reading p { margin: 1em 0; }
footer a, .reading a, .mast a { color: inherit; }
