.full-edition #p-town { --w: var(--page); }
#p-town .life-tabs { flex-wrap: wrap; gap: 4px; }
#p-town .life-tabs .yard-button { min-height: 34px; }
.town-fold {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 5fr);
  align-items: start;
  gap: clamp(1rem, 3vw, 2.4rem);
  padding: .25rem .2rem;
}
.full-edition #p-town .town-main {
  display: grid;
  grid-template-rows: auto auto;
  align-items: start;
  justify-items: stretch;
  min-width: 0;
  padding: 0;
  gap: .6rem;
  overflow: visible;
}
.full-edition #p-town .town-main .moon {
  justify-self: center;
  width: min(calc(100% - 38px), clamp(148px, 21vh, 212px));
  max-width: none;
  margin: 10px 0 12px;
}
.town-main .moon-art { width: 100%; height: 100%; }
.town-sheet {
  min-width: 0;
  padding: 12px 15px;
  border: 1px solid rgba(132, 100, 64, .28);
  border-radius: 4px;
  background: rgba(250, 244, 231, .84);
}
.town-fold h3 { margin: .1rem 0 .45rem; font-size: clamp(18px, 1.9vw, 24px); font-weight: normal; }
.town-fold h4 { margin: .1rem 0 .3rem; font-size: 1.04em; }
.town-side { min-width: 0; display: grid; gap: 10px; align-content: start; }
.town-section {
  padding: 11px 14px;
  border: 1px solid rgba(132, 100, 64, .26);
  border-radius: 4px;
  background: rgba(250, 244, 231, .76);
}
.town-note { color: var(--ink-soft); font-size: 13.5px; }
.town-reason { color: #813b2d; font-size: 13.5px; }
.town-choice { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .65rem; margin: .3rem 0; }
.town-choice .life-select { min-width: 0; flex: 1 1 11rem; appearance: none; -webkit-appearance: none; padding-right: 26px; }
.town-budget { display: flex; flex-wrap: wrap; gap: 6px; }
.town-budget b, .town-ledger dd, .town-resources b { font-variant-numeric: tabular-nums; }
.town-budget span {
  padding: 3px 9px;
  border: 1px solid rgba(130, 99, 64, .28);
  border-radius: 3px;
  background: rgba(255, 250, 240, .82);
  font-size: 13px;
}
.town-budget span b { display: inline-block; margin-inline-start: .25rem; color: var(--verm-deep); }
.town-amounts, .town-resources, .town-forecast, .town-merchant-slots { margin: .25rem 0; padding: 0; list-style: none; }
.town-amounts { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.town-amounts li { display: inline-flex; align-items: center; flex-wrap: wrap; column-gap: .4rem; min-width: 0; }
.town-amounts small { color: var(--ink-soft); font-size: 12px; }
.town-flow { margin: .45rem 0; padding: 0; display: grid; gap: 4px; }
.town-flow > div {
  display: grid;
  grid-template-columns: minmax(3.2rem, auto) minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 3px;
  background: rgba(130, 99, 64, .06);
}
.town-ledger {
  margin: .4rem 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 6px;
}
.town-ledger > div {
  padding: 6px 10px;
  border: 1px solid rgba(130, 99, 64, .22);
  border-radius: 3px;
  background: rgba(255, 250, 240, .78);
  display: grid;
  gap: 1px;
}
.town-ledger dt { font-size: 11.5px; color: var(--ink-soft); }
.town-ledger dd { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.town-flow dt { color: var(--ink-soft); font-size: 13px; }
.town-flow dd { margin: 0; }
.town-flow .town-amounts { margin: 0; }
.town-flow .life-item { padding-block: .1rem; }
.town-resources { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 8px; }
.town-resources > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: .3rem;
  padding: 6px 9px;
  border: 1px solid rgba(130, 99, 64, .28);
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(168, 128, 68, .16) var(--fill, 0%), rgba(255, 250, 240, .78) var(--fill, 0%));
}
.town-resources small { grid-column: 1 / -1; color: var(--ink-soft); font-size: 11.5px; }
.town-resources b { white-space: nowrap; }
.town-plan { margin: .45rem 0; padding-inline-start: 1.45rem; }
.town-plan > li { padding-block: 5px; border-bottom: 1px solid rgba(130, 99, 64, .18); }
.town-forecast { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; }
.town-forecast > li {
  display: grid;
  gap: 2px;
  padding: 7px 10px;
  border: 1px solid rgba(130, 99, 64, .24);
  border-radius: 4px;
  background: rgba(255, 250, 240, .76);
  cursor: pointer;
}
.town-forecast > li:hover { border-color: var(--verm-deep); background: #fffaf0; }
.town-forecast > li.is-picked { border-color: var(--verm-deep); box-shadow: inset 0 0 0 1px var(--verm-deep); background: #fff6e4; }
.town-forecast > li > span { color: var(--ink-soft); font-size: 12.5px; }
.town-stamp, .town-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .55rem; }
.town-stamp { margin-top: .45rem; }
.town-fold .stamp { width: 64px; height: 58px; }
.town-fold .stamp .face { font: 20px/1.1 var(--sheet-heading); padding: 0 .2rem; white-space: nowrap; }
:lang(en) .town-fold .stamp .face { font-size: 17px; }
.town-fold .stamp:disabled { opacity: .45; cursor: not-allowed; }
.town-main .yard-button, .town-side .yard-button { min-height: 36px; max-width: 100%; white-space: normal; }
.town-fold :is(button, select):focus-visible { outline: 2px solid var(--verm-deep); outline-offset: 3px; }
.town-cargo, .town-merchant-slip {
  margin-block: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(130, 99, 64, .28);
  border-left: 3px solid var(--verm-deep);
  border-radius: 4px;
  background: rgba(255, 250, 240, .84);
}
.town-merchant-slip[data-empty] { border: 1px solid rgba(130, 99, 64, .22); background: rgba(235, 224, 200, .42); }
.town-forecast .town-mark { color: var(--verm-deep); font-weight: 600; font-size: 12px; }
.town-locked {
  max-width: 520px;
  margin: 28px auto;
  padding: 20px 24px;
  background: rgba(250, 244, 231, .86);
  border: 1px solid rgba(132, 100, 64, .32);
  border-radius: 5px;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 10px;
}
.town-locked .moon { width: 112px; margin: 0; }
.town-locked h3 { margin: 0; font-size: 21px; }
.watch-slip [data-go="p-town"] { margin-inline-end: .5rem; }

@media (max-width: 760px) {
  #p-town .life-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .15rem; }
  #p-town .life-tabs .yard-button { font-size: 14px; }
  .town-fold { grid-template-columns: minmax(0, 1fr); gap: .85rem; }
  .full-edition #p-town .town-main {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr);
    grid-template-rows: auto;
    gap: .2rem .65rem;
    padding: 0 .45rem .5rem;
    border-block: var(--rule);
    background: rgba(245, 233, 211, .35);
  }
  .full-edition #p-town .town-main .moon {
    grid-area: 1 / 1;
    width: min(calc(100% - 15px), 180px);
    margin: 13px 4px 12px 0;
    box-shadow: 0 0 0 4px var(--ink), 0 0 0 6px var(--paper), 0 0 0 7px var(--verm-deep), 4px 6px 0 7px rgba(218,68,44,.35);
  }
  .town-sheet { display: contents; }
  .town-sheet > * { grid-column: 1 / -1; }
  .town-sheet > h3:first-child { grid-area: 1 / 2; align-self: center; }
  .town-fold .stamp { width: 55px; height: 50px; }
  :lang(en) .town-fold .stamp .face { font-size: 15px; }
}

@media (max-width: 370px) {
  .town-resources { grid-template-columns: minmax(0, 1fr); }
}
