* { box-sizing: border-box; margin: 0; padding: 0; border-radius: 0; }
html, body {
  background: #FFFFFF;
  color: #111111;
  font-family: Inter, -apple-system, "Helvetica Neue", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.25;
}
html[data-state="settings"],
html[data-state="sale"] {
  overflow: hidden;
}
button, input {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
}
button { text-align: left; }
input:focus { outline: 0; }
.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 600;
}

.screen {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

.row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 8px;
  align-items: center;
}
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: 1 / -1; }
.hit { min-height: 44px; }

.rule {
  height: 1px;
  background: #D9D9D9;
  margin: 0 -16px;
}

.city {
  font-size: 17px;
  font-weight: 600;
}
.fresh {
  font-size: 12px;
  font-weight: 400;
  color: #6B6B6B;
  text-align: right;
}

.stat {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  align-self: end;
  min-height: 44px;
}
.lbl {
  font-size: 12px;
  font-weight: 400;
  color: #6B6B6B;
  text-align: left;
}
.stat .val {
  display: flex;
  align-items: baseline;
  width: 100%;
  min-width: 0;
  border-bottom: 1px solid #D9D9D9;
}
.stat.is-edit .val { border-bottom-color: #111111; }
.gold-show, .gold-input {
  width: 100%;
  min-height: 0;
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: left;
}
.gold-input { caret-color: #111111; }
::selection { background: #D9D9D9; color: #111111; }
.stat.is-edit .gold-show,
.stat.is-edit .qty-show { display: none; }
.stat:not(.is-edit) .gold-input,
.stat:not(.is-edit) .qty-input { display: none; }
.qty-show, .qty-input {
  min-width: 0;
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: left;
}
.qty-input {
  flex: 1;
  caret-color: #111111;
}

.seg {
  grid-column: span 2;
  min-height: 44px;
  font-size: 14px;
  font-weight: 400;
  text-align: center;
  border-bottom: 2px solid transparent;
}
.seg.is-on {
  font-weight: 600;
  border-bottom-color: #E10600;
}

.meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 44px;
}
.meta-text {
  grid-column: span 3;
  font-size: 12px;
  font-weight: 400;
  color: #6B6B6B;
}
.meta-go {
  font-size: 14px;
  font-weight: 600;
  color: #111111;
  text-align: right;
}

.warn {
  display: none;
  min-height: 44px;
}
.warn p {
  grid-column: 1 / -1;
  font-size: 14px;
  font-weight: 400;
  color: #E10600;
}
.warn.is-on { display: grid; }
.cap { font-size: 12px; font-weight: 400; color: #6B6B6B; }

.summary {
  grid-template-columns: 32px minmax(0, 1fr) auto;
  width: 100%;
  min-height: 56px;
  align-items: center;
  border-bottom: 1px solid #D9D9D9;
}
.summary.is-on { border-bottom: 2px solid #E10600; }
.idx {
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.summary .pair {
  grid-column: auto;
  font-size: 14px;
  font-weight: 400;
}
.summary.is-on .pair { font-weight: 600; }
.sum-r { text-align: right; }
.sum-gain {
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.sum-fat {
  font-size: 12px;
  font-weight: 400;
  color: #6B6B6B;
  font-variant-numeric: tabular-nums;
}
.sum-fat.is-over { color: #E10600; }

.detail-h {
  min-height: 44px;
  align-items: start;
  padding-top: 16px;
}
.detail-h .pair {
  font-size: 17px;
  font-weight: 600;
}
.detail-h .gain {
  font-size: 24px;
  font-weight: 600;
}
.fat-line {
  font-size: 12px;
  font-weight: 400;
  color: #6B6B6B;
  font-variant-numeric: tabular-nums;
  padding: 8px 0;
}
.fat-line.is-over { color: #E10600; }

.kicker {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 400;
  color: #6B6B6B;
  padding-top: 8px;
}

.product {
  display: flex;
  align-items: center;
  justify-content: space-between;
  column-gap: 8px;
  width: 100%;
  min-height: 44px;
  min-width: 0;
  border-bottom: 1px solid #D9D9D9;
}
.product .name {
  min-width: 0;
  font-size: 14px;
  font-weight: 400;
}
.product .num { font-size: 17px; }

.hint {
  font-size: 12px;
  font-weight: 400;
  color: #6B6B6B;
  padding-top: 8px;
}
.msg {
  font-size: 14px;
  font-weight: 400;
  color: #6B6B6B;
  padding: 8px 0;
}
.retry {
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
}
.dim { opacity: 0.4; }

.foot {
  padding-top: 16px;
}
.foot p {
  font-size: 12px;
  font-weight: 400;
  color: #6B6B6B;
}

#city-list { display: none; }
#city-list.is-on { display: block; }
#city-list .toggle.is-on .name { font-weight: 600; }

.scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  background: rgba(17,17,17,0.4);
}
html[data-state="settings"] .scrim,
html[data-state="sale"] .scrim { display: block; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  max-height: 85vh;
  max-height: 85dvh;
  overflow: auto;
  overscroll-behavior: contain;
  background: #FFFFFF;
  border-top: 1px solid #D9D9D9;
  padding: 0 16px calc(16px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 150ms, visibility 150ms;
}
html[data-state="settings"] #sheet-settings,
html[data-state="sale"] #sheet-sale {
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
}
.sheet-h {
  min-height: 44px;
  position: sticky;
  top: 0;
  background: #FFFFFF;
  border-bottom: 1px solid #D9D9D9;
  margin: 0 -16px;
  padding: 0 16px;
}
.sheet-h .title {
  font-size: 17px;
  font-weight: 600;
}
.sheet-h .close {
  font-size: 14px;
  font-weight: 400;
  color: #6B6B6B;
  text-align: right;
  min-height: 44px;
}
.sec {
  font-size: 12px;
  font-weight: 400;
  color: #6B6B6B;
  padding: 8px 0;
}
#closed-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 8px;
}
#closed-list .toggle { grid-column: span 2; }
.toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 44px;
}
.toggle .name { font-size: 14px; font-weight: 400; }
.toggle .state {
  font-size: 14px;
  font-weight: 400;
  color: #6B6B6B;
  text-align: right;
}
.toggle.is-off .name,
.toggle.is-off .state {
  font-weight: 600;
  color: #E10600;
}
.toggle:disabled .name,
.toggle:disabled .state {
  font-weight: 400;
  color: #6B6B6B;
}
.inv-h { min-height: 44px; }
.inv {
  min-height: 44px;
  align-items: center;
}
.inv .city-n { font-size: 14px; }
.inv .num { font-size: 14px; }
.inv-in {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.inv-in.is-empty {
  font-weight: 400;
  border-bottom: 1px solid #D9D9D9;
}
.empty {
  min-height: 17px;
  border-bottom: 1px solid #D9D9D9;
}
.note {
  font-size: 12px;
  color: #6B6B6B;
  padding-top: 8px;
}
.sale-sub {
  font-size: 12px;
  color: #6B6B6B;
  padding: 8px 0;
}
.place { padding: 8px 0; }
.place .where {
  font-size: 17px;
  font-weight: 600;
}
.place .fat {
  font-size: 14px;
  font-weight: 400;
  color: #6B6B6B;
  text-align: right;
}
.place .line {
  min-height: 44px;
  align-items: center;
}
.place .line .lbl { align-self: center; }
.place .line .num { font-size: 17px; }
