.sheet {
  display: grid;
  min-width: 0;
  gap: 18px;
  padding: 22px 22px 16px;
  border: 1px solid #efe8dc;
  border-radius: 22px;
  background:
    linear-gradient(180deg, #fffdf9 0%, #fffcf8 42%, #fbf7f1 100%);
  box-shadow: 0 18px 40px rgba(28, 25, 23, 0.05);
}

.sheet-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px 18px;
}

.sheet-grid .is-wide {
  grid-column: 1 / -1;
}

.sheet label {
  display: grid;
  gap: 6px;
  margin: 0;
}

.sheet-label {
  color: #44403c;
  font-size: 13px;
  font-weight: 680;
  letter-spacing: -0.01em;
}

.sheet-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid #e6dfd4;
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.sheet-field:focus-within {
  border-color: #0f6b56;
  box-shadow: 0 0 0 3px rgba(15, 107, 86, 0.12);
}

.sheet-field input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #1c1917;
  font: inherit;
  font-size: 20px;
  font-weight: 740;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.sheet-field input.is-bad {
  color: #b91c1c;
}

.sheet-field:has(.is-bad) {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.sheet-field[data-unit]::after {
  content: attr(data-unit);
  flex: none;
  color: #a8a29e;
  font-size: 14px;
  font-weight: 680;
}

.sheet-help,
.sheet-note,
.sheet-foot {
  margin: 0;
  color: #a8a29e;
  font-size: 12px;
  line-height: 1.5;
}

.sheet-pills {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  background: #f3efe8;
}

.sheet-pills button {
  flex: 1 1 0;
  min-height: 42px;
  padding: 0 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #78716c;
  font: inherit;
  font-size: 14px;
  font-weight: 740;
  cursor: pointer;
}

.sheet-pills button[aria-pressed="true"] {
  background: #fff;
  color: #0f6b56;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.08), 0 0 0 1px rgba(28, 25, 23, 0.04);
}

.sheet-error {
  margin: 0;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 680;
}

.sheet-result {
  display: grid;
  width: 100%;
  min-width: 0;
  justify-items: center;
  gap: 6px;
  padding-top: 18px;
  border-top: 1px solid #efe8dc;
  text-align: center;
}

.sheet-kicker {
  margin: 0;
  color: #78716c;
  font-size: 13px;
  font-weight: 680;
}

.sheet-figure {
  max-width: 100%;
  margin: 0;
  color: #0f6b56;
  font-size: clamp(36px, 6vw, 52px);
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.sheet-figure.is-long {
  font-size: clamp(26px, 4.2vw, 36px);
}

.sheet-figure.is-longer {
  font-size: clamp(20px, 3.4vw, 28px);
  line-height: 1.25;
}

.sheet-caption {
  margin: 0;
  max-width: 36em;
  color: #57534e;
  font-size: 14px;
  line-height: 1.45;
}

.sheet-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  width: 100%;
  margin: 10px 0 0;
}

.sheet-tiles div {
  padding: 12px 14px;
  border: 1px solid #efe8dc;
  border-radius: 14px;
  background: #fff;
  text-align: start;
}

.sheet-tiles dt {
  color: #78716c;
  font-size: 12px;
  font-weight: 650;
}

.sheet-tiles dd {
  margin: 4px 0 0;
  color: #1c1917;
  font-size: 16px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.sheet-tiles .is-accent {
  background: #f3faf7;
  border-color: #d7efe6;
}

.sheet-tiles .is-accent dd {
  color: #0f6b56;
}

.sheet-tiles .is-warn {
  background: #fff7ed;
  border-color: #fed7aa;
}

.sheet-tiles .is-warn dd {
  color: #c2410c;
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sheet-actions button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #e6dfd4;
  border-radius: 999px;
  background: #fff;
  color: #1c1917;
  font: inherit;
  font-size: 14px;
  font-weight: 720;
  cursor: pointer;
}

.sheet-actions button:first-child {
  border-color: #0f6b56;
  background: #0f6b56;
  color: #fff;
}

.sheet-foot {
  text-align: center;
}

@media (max-width: 720px) {
  .sheet {
    padding: 16px 14px 12px;
    border-radius: 18px;
  }

  .sheet-grid {
    grid-template-columns: 1fr;
  }

  .sheet-pills button {
    padding: 0 6px;
    font-size: 13px;
  }

  .sheet-field input {
    font-size: 18px;
  }
}

.sheet-box {
  width: 100%;
  min-height: 132px;
  padding: 14px 16px;
  border: 1px solid #e6dfd4;
  border-radius: 14px;
  background: #fff;
  color: #1c1917;
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  resize: vertical;
}

.sheet-box:focus {
  border-color: #0f6b56;
  box-shadow: 0 0 0 3px rgba(15, 107, 86, 0.12);
  outline: none;
}

.sheet-code {
  width: 100%;
  max-height: 360px;
  margin: 8px 0 0;
  overflow: auto;
  padding: 16px 18px;
  border-radius: 16px;
  background: #14261f;
  color: #e7f6ef;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.55;
  text-align: start;
  white-space: pre;
}

.sheet-warn {
  margin: 0;
  color: #c2410c;
  font-size: 13px;
  font-weight: 680;
}

.sheet-file {
  display: grid;
  gap: 6px;
  justify-self: start;
}

.sheet-reveal {
  justify-self: start;
  width: fit-content;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #e6dfd4;
  border-radius: 999px;
  background: #fff;
  color: #1c1917;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.sheet-code-edit {
  min-height: 220px;
  background: #14261f;
  color: #e7f6ef;
  border-color: #1d3a30;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.55;
}

.sheet-drop {
  display: grid;
  gap: 6px;
  justify-items: center;
  min-height: 188px;
  padding: 36px 20px;
  border: 1.5px dashed #d9cfc3;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 0%, rgba(15, 107, 86, 0.08), transparent 55%),
    #fff;
  color: #1c1917;
  text-align: center;
  cursor: pointer;
}

.sheet-drop strong {
  font-size: 22px;
  letter-spacing: -0.03em;
}

.sheet-drop span,
.sheet-drop em {
  color: #78716c;
  font-style: normal;
  font-size: 14px;
}

.sheet-drop em {
  margin-top: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #f3efe8;
  color: #1c1917;
  font-weight: 700;
}

.sheet-drop.is-hot,
.sheet-drop:focus-visible {
  border-color: #0f6b56;
  box-shadow: 0 0 0 4px rgba(15, 107, 86, 0.12);
  outline: none;
}

.sheet-files {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sheet-files li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #efe8de;
}

.sheet-files strong { font-size: 14px; }
.sheet-files span,
.sheet-files em { color: #78716c; font-size: 12px; font-style: normal; }
.sheet-files em { grid-column: 1 / -1; }
.sheet-files em.is-hot,
.sheet-tiles dd.is-hot { color: #b42318; font-weight: 750; }

.sheet-paper {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 42px 40px 36px;
  border: 1px solid #e7e0d6;
  border-radius: 6px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    repeating-linear-gradient(0deg, transparent, transparent 27px, rgba(28, 25, 23, 0.04) 28px);
  box-shadow: 0 18px 40px rgba(28, 25, 23, 0.06);
  color: #1c1917;
}

.sheet-paper h2 {
  margin: 0 0 8px;
  text-align: center;
  font-size: 28px;
  letter-spacing: 0.42em;
}

.sheet-paper-date,
.sheet-paper > p,
.sheet-paper li {
  font-size: 15px;
  line-height: 1.85;
}

.sheet-paper-date { text-align: right; color: #57534e; }
.sheet-paper ol { margin: 12px 0 0; padding-left: 1.3em; }

.sheet-sign {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px 28px;
  margin-top: 28px;
}

.sheet-sign p {
  display: grid;
  gap: 4px;
  margin: 0;
}

.sheet-sign span { color: #78716c; font-size: 12px; font-weight: 700; }
.sheet-sign strong { font-size: 16px; }
.sheet-sign em { color: #57534e; font-size: 13px; font-style: normal; }
.sheet-sign b {
  display: block;
  height: 36px;
  border-bottom: 1px solid #1c1917;
}

@media (max-width: 720px) {
  .sheet-paper { padding: 28px 18px; }
  .sheet-paper h2 { letter-spacing: 0.22em; font-size: 24px; }
  .sheet-sign { grid-template-columns: 1fr; }
}

@media print {
  body:has(.sheet-paper) .site-header,
  body:has(.sheet-paper) .site-footer,
  body:has(.sheet-paper) .mobile-tab,
  body:has(.sheet-paper) .app-side,
  body:has(.sheet-paper) .side-scrim,
  body:has(.sheet-paper) .skip,
  body:has(.sheet-paper) .desk-crumb,
  body:has(.sheet-paper) .desk-head,
  body:has(.sheet-paper) .desk-facts,
  body:has(.sheet-paper) .tool-note,
  body:has(.sheet-paper) .tool-why,
  body:has(.sheet-paper) .explain,
  body:has(.sheet-paper) nav.more,
  body:has(.sheet-paper) .sheet > :not(.sheet-paper) {
    display: none !important;
  }

  body:has(.sheet-paper) .sheet-paper {
    border: 0;
    box-shadow: none;
    padding: 0;
  }
}

.sheet-week,
.sheet-week-row,
.sheet-week-head {
  min-width: 0;
}

.sheet-week {
  display: grid;
  gap: 8px;
}

.sheet-week-head,
.sheet-week-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1.15fr) minmax(0, 1.15fr) minmax(0, 0.85fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.sheet-week-head {
  padding: 0 12px;
  color: #a8a29e;
  font-size: 12px;
  font-weight: 700;
}

.sheet-week-row {
  padding: 10px 12px;
  border: 1px solid #efe8dc;
  border-radius: 16px;
  background: #fff;
}

.sheet-week-row strong {
  color: #1c1917;
  font-size: 14px;
}

.sheet-week-row > label,
.sheet-week-row .sheet-field {
  min-width: 0;
}

.sheet-week-row .sheet-field {
  min-height: 46px;
  padding: 0 8px;
}

.sheet-week-row .sheet-field input {
  font-size: 16px;
}

.sheet-week-row input[type="time"] {
  min-width: 0;
}

.sheet-week-note {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #0f6b56;
  font-size: 13px;
  font-style: normal;
  font-weight: 740;
  font-variant-numeric: tabular-nums;
}

.sheet-tiles dd {
  overflow-wrap: anywhere;
}

.sheet-pills.is-wrap {
  flex-wrap: wrap;
}

.sheet-pills.is-wrap button {
  flex: 1 1 92px;
}

.sheet-actions.is-quiet button:first-child {
  border-color: #e6dfd4;
  background: #fff;
  color: #1c1917;
}

.sheet-sign-line {
  margin-top: 28px;
  padding-top: 12px;
  border-top: 1px solid #1c1917;
  text-align: right;
}

.sheet-paper-to {
  margin-top: 18px;
  font-weight: 740;
}

@media (max-width: 720px) {
  .sheet-week-head { display: none; }
  .sheet-week-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .sheet-week-row strong,
  .sheet-week-note { grid-column: 1 / -1; }
}

.sheet-pay {
  display: grid;
  min-width: 0;
  border: 1px solid #efe8dc;
  border-radius: 16px;
  overflow: hidden;
}

.sheet-pay-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 11px 14px;
  background: #fff;
}

.sheet-pay-row + .sheet-pay-row {
  border-top: 1px solid #f3efe8;
}

.sheet-pay-head {
  background: #f6f1ea;
  color: #78716c;
  font-size: 12px;
  font-weight: 700;
}

.sheet-pay-row strong {
  color: #1c1917;
  font-size: 14px;
}

.sheet-pay-row b {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.sheet-pay-row b.is-focus {
  color: #0f6b56;
}

.sheet-tiles .is-wide-tile {
  grid-column: 1 / -1;
}

@media (max-width: 720px) {
  .sheet-pay-row {
    padding: 10px 12px;
    font-size: 13px;
  }
}

.sheet-ladder {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.sheet-ladder-row {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.sheet-ladder-row strong,
.sheet-ladder-row b {
  min-width: 0;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.sheet-ladder-row b {
  font-weight: 760;
  color: #0f6b56;
}

.sheet-ladder-track {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: #f3efe8;
  overflow: hidden;
}

.sheet-ladder-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #0f6b56;
}

.sheet-ladder-bar.is-down {
  background: #c2410c;
}

.sheet-pay.is-pair .sheet-pay-row {
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.8fr);
}

.sheet-split {
  display: grid;
  gap: 8px;
  width: 100%;
  min-width: 0;
  justify-self: stretch;
}

.sheet-split-track {
  display: flex;
  height: 14px;
  border-radius: 999px;
  background: #f3efe8;
  overflow: hidden;
}

.sheet-split-rent,
.sheet-split-debt {
  display: block;
  height: 100%;
}

.sheet-split-rent { background: #0f6b56; }
.sheet-split-debt { background: #c2410c; }

.sheet-split-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  color: #78716c;
  font-size: 13px;
  font-weight: 700;
}

.sheet-split-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sheet-grid.is-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sheet-split-needs,
.sheet-split-wants,
.sheet-split-save {
  display: block;
  height: 100%;
}

.sheet-split-needs { background: #0f6b56; }
.sheet-split-wants { background: #c2410c; }
.sheet-split-save { background: #1d9a7a; }

.sheet-split-meta.is-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sheet-split-meta.is-three span:nth-child(2) { text-align: center; }
.sheet-split-meta.is-three span:nth-child(3) { text-align: end; }

.sheet-warn {
  margin: 0;
  color: #9a3412;
  font-size: 14px;
  font-weight: 700;
}

.sheet-area {
  width: 100%;
  min-height: 148px;
  padding: 14px 16px;
  border: 1px solid #e7e0d6;
  border-radius: 16px;
  background: #fff;
  color: #1c1917;
  font: inherit;
  line-height: 1.55;
  resize: vertical;
}

.sheet-area:focus {
  outline: 2px solid #0f6b56;
  outline-offset: 2px;
}

.sheet-lines {
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f3faf7;
  color: #1c1917;
  font: inherit;
  font-size: 15px;
  line-height: 1.6;
  text-align: start;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  justify-self: stretch;
}

@media (max-width: 720px) {
  .sheet-grid.is-three {
    grid-template-columns: 1fr;
  }
}
