/* v2 phone shell (concept phone screens): paper top bar · big map · paper bottom sheet · red lacquer bottom nav.
   Landscape: the nav becomes a left rail and the sheet sits on the right. Every hit target ≥ 44 px. */
[data-form='phone'] {
  --gap: 8px;
  --ptop: 58px;
  --pnav: 68px;
  --prail: 80px;
}
[data-form='phone'][data-orient='landscape'] {
  --ptop: 54px;
}
.hud--phone {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: 'top' 'body' 'nav';
}
.hud--phone[data-orient='landscape'] {
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: 'nav top' 'nav body';
}
.hud--phone > .ptop {
  grid-area: top;
}
.hud--phone > .pbody {
  grid-area: body;
}
.hud--phone > .pnav {
  grid-area: nav;
}

/* paper top bar with a lacquer edge */
.ptop {
  position: relative;
  z-index: 8;
  height: var(--ptop);
  padding: 4px 6px 5px;
  background: var(--paper-100) var(--paper-tex);
  border-bottom: 3px solid var(--son-frame);
  box-shadow: inset 0 -1px 0 var(--vang-400), 0 4px 12px rgba(9, 8, 6, 0.35);
}
.ptop__main {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  padding: 0 4px;
  border-radius: 8px;
}
.ptop__gold,
.ptop__pop {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: none;
}
.ptop__gold > span,
.ptop__pop > span {
  display: grid;
  line-height: 1.05;
}
.ptop__gold b {
  font-size: 17px;
}
.ptop__pop b {
  font-size: 15px;
}
.ptop small {
  color: var(--text-muted);
  font-size: 10.5px;
}
.ptop__pop .glyph {
  color: var(--text-2);
}
.ptop__goods {
  display: flex;
  flex: 1 1 auto;
  justify-content: flex-end;
  gap: 2px;
  min-width: 0;
  padding-left: 8px;
  border-left: 1px solid var(--paper-400);
}
.pgood {
  display: grid;
  justify-items: center;
  flex: none;
  width: 44px;
  font-size: 12.5px;
  line-height: 1.05;
}
.pgood[hidden] {
  display: none;
}
.pgood.is-low .num {
  color: var(--bad);
}
.pgood.is-low img {
  filter: drop-shadow(0 0 4px rgba(200, 40, 20, 0.85));
}
.pgood--more {
  align-self: center;
  width: 40px;
  min-width: 0;
  height: 30px;
  border-color: var(--son-400);
  color: var(--title);
  background: var(--paper-50);
}

/* stage: the map, a few round buttons, the guidance card */
.pbody {
  position: relative;
  min-height: 0;
}
.pstage {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.pstage > * {
  pointer-events: auto;
}
.pfabs {
  position: absolute;
  top: var(--gap);
  right: var(--gap);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pfab {
  --orb: 48px;
}
.hud--phone[data-orient='landscape']:not([data-sheet='none']) .pfabs {
  right: calc(var(--sheet-w) + var(--gap));
}
.hud--phone[data-snap='full'] .pfabs {
  display: none;
}
.pnotice {
  position: absolute;
  top: var(--gap);
  left: var(--gap);
  right: calc(var(--gap) * 2 + 48px);
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--then-900);
  border-radius: 10px;
  background: var(--paper-100) var(--paper-tex);
  box-shadow: inset 4px 0 0 var(--son-400), inset 0 0 0 1px var(--vang-500), var(--shadow);
  font-size: 13.5px;
}
.pnotice .toast__icon {
  margin-left: 4px;
}
.pbottom {
  position: absolute;
  left: var(--gap);
  right: var(--gap);
  bottom: calc(var(--sheet-h, 0px) + var(--gap));
  display: flex;
  justify-content: center;
}
.hud--phone[data-orient='landscape'] .pbottom {
  right: auto;
  width: min(400px, calc(100% - 2 * var(--gap) - 56px));
}
.hud--phone[data-orient='landscape']:not([data-sheet='none']) .pbottom {
  bottom: var(--gap);
  width: min(400px, calc(100% - var(--sheet-w) - 3 * var(--gap)));
}
.pguide {
  width: 100%;
  max-width: 480px;
  padding: 8px 10px;
  border: 3px solid var(--son-frame);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--vang-400), var(--shadow);
}
.pguide--goal {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
}
.pguide__t {
  flex: 1;
  display: grid;
  gap: 2px;
  min-width: 0;
}
.pguide__t small {
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pguide__t b {
  font-size: 13.5px;
  line-height: 1.2;
}
.pguide__t span[data-oneline] {
  overflow: hidden;
  color: var(--text-2);
  font-size: 12px;
  font-style: italic;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pguide__row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.pguide__acts {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.pguide__acts .btn {
  flex: 1 1 auto;
  min-height: 44px;
}
.pguide__acts .btn--ghost {
  flex: none;
  min-width: 44px;
  padding: 0;
}
.pguide--show .show__colonies .colony {
  min-height: 44px;
}

/* the sheet */
.psheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  height: var(--sheet-h, 50%);
  border-top: 3px solid var(--son-frame);
  border-radius: 16px 16px 0 0;
  box-shadow: inset 0 1px 0 var(--vang-400), 0 -10px 26px rgba(9, 8, 6, 0.4);
  container: sheet / inline-size;
  overflow: hidden;
}
.hud--phone[data-orient='landscape'] .psheet {
  left: auto;
  width: var(--sheet-w, 52%);
  border-left: 3px solid var(--son-frame);
  border-radius: 16px 0 0 0;
}
.psh__grip {
  position: relative;
  flex: none;
  height: 16px;
}
.psh__handle {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 10;
  display: grid;
  place-items: start center;
  width: 96px;
  height: 44px;
  transform: translateX(-50%);
}
.psh__handle span {
  display: grid;
  place-items: center;
  width: 56px;
  height: 18px;
  border-radius: 0 0 10px 10px;
  background: var(--red);
  color: var(--vang-200);
  box-shadow: inset 0 0 0 1px var(--vang-500);
}
.psh__head {
  flex: none;
  padding: 2px 10px 6px 12px !important;
}
.psh__head .orb {
  --orb: 44px;
}
.psh__head .ch__medal {
  width: 50px;
  height: 50px;
}
.psh__head .ch__medal img {
  width: 46px;
  height: 46px;
}
.psh__head .ch__t h2 {
  font-size: 19px;
}
.psh__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 2px 14px 14px;
}
.psheet[data-snap='peek'] .psh__body,
.psheet[data-snap='peek'] .card__foot {
  visibility: hidden;
}
.psheet .card__foot {
  flex: none;
  padding: 8px 12px 10px;
}
.psheet .card__foot .btn {
  min-height: 44px;
}
.psh__raw {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.psh__raw > .frame,
.psh__raw > .modal > .frame {
  position: static;
  flex: 1;
  width: auto;
  max-height: none;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  z-index: auto;
}
.psh__raw > .modal {
  position: static;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0;
  background: none;
}
.psheet .corner,
.psheet .watermark {
  display: none;
}
.psh__raw .lg__head {
  padding: 0 10px 6px 12px;
}
.psh__raw .lg__seal {
  width: 40px;
  height: 40px;
}
.psheet .orb.close,
.psheet .lg__head .orb {
  --orb: 44px;
}
.psheet .lg__switch {
  display: none;
}
.psheet .btn,
.psheet .switch,
.psheet .seg button,
.psheet .ract__n input,
.psheet .chat__input input,
.psheet .lg__tab {
  min-height: 44px;
}
.psheet .seg button {
  min-width: 46px;
}
.psheet .pin,
.psheet .rstop__head .orb,
.psheet .chat__input .orb {
  --orb: 44px;
  width: 44px;
  height: 44px;
}
.psheet .buf .pin {
  position: static;
  transform: none;
  width: 44px;
  height: 44px;
}
.psheet .buf {
  padding-right: 4px;
}
.psheet .need__ring {
  --ring: 58px;
}
.psheet .infot__b {
  width: 44px;
  height: 44px;
  margin: -12px -12px -12px -8px;
}
.psheet .wcell {
  min-height: 52px;
}
.psheet .crow {
  min-height: 40px;
}
@container sheet (max-width: 430px) {
  .psheet .flow {
    grid-template-columns: auto 1fr;
  }
  .psheet .flow__arrow {
    display: none;
  }
  .psheet .flow__col:last-child {
    grid-column: 1 / -1;
  }
  .psheet .needs {
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  }
  .psheet .jars,
  .psheet .wgrid {
    grid-template-columns: minmax(0, 1fr);
  }
  .psheet .sgoods {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* build sheet */
.ptabs {
  display: flex;
  gap: 6px;
  margin: 0 -14px 8px;
  padding: 0 14px 8px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--paper-300);
}
.ptab {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px 0 6px;
  border: 1px solid var(--paper-400);
  border-radius: 999px;
  background: var(--paper-50);
  font-size: 13px;
  font-weight: 600;
}
.ptab.is-on {
  border-color: var(--then-900);
  background: var(--red);
  color: var(--vang-200);
}
.ptab .portrait {
  box-shadow: 0 0 0 1.5px var(--tone);
}
.ptiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}
.ptile {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 2px;
  min-height: 98px;
  padding: 6px 2px;
  border: 1px solid var(--paper-400);
  border-radius: 10px;
  background: radial-gradient(circle at 50% 35%, var(--paper-50), var(--paper-200));
}
.ptile__img {
  width: 70px;
  height: 58px;
  object-fit: contain;
}
.ptile__img--good {
  width: 44px;
  height: 44px;
  margin: 7px;
}
.ptile__img--glyph {
  display: grid;
  place-items: center;
  height: 58px;
  color: var(--text-2);
}
.ptile.is-temp {
  border-style: dashed;
}
.ptile__n {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
}
.ptile.is-on {
  border-color: var(--son-300);
  box-shadow: 0 0 0 2px var(--son-300), 0 0 0 4px rgba(239, 200, 112, 0.6);
}
.ptile--up {
  grid-auto-flow: row;
  align-content: center;
}
.ptile--up .portrait {
  display: inline-block;
}
.pcard {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--son-300);
  border-radius: 12px;
  background: var(--paper-50);
}
.pcard__img {
  width: 60px;
  height: 54px;
  object-fit: contain;
}
.pcard__img--good {
  width: 44px;
  height: 44px;
}
.pcard__t {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.pcard__t b {
  color: var(--title);
  font: 700 16px var(--font-head);
}
.pcard__t small {
  color: var(--text-2);
  font-size: 11.5px;
}
.pcard__go {
  min-height: 52px !important;
  font-size: 15px;
}
.pfin {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.pfin div {
  display: grid;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(246, 232, 197, 0.8);
  box-shadow: inset 0 0 0 1px var(--paper-300);
}
.pfin small {
  color: var(--text-muted);
  font-size: 11px;
}
.pfin b {
  font-size: 16px;
}
.ptiers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
}
.ptier {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ptier > span {
  display: grid;
  line-height: 1.1;
}
.ptier small {
  color: var(--text-muted);
  font-size: 11px;
}
.grow {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border-bottom: 1px solid var(--paper-300);
}
.grow__t {
  display: grid;
  gap: 4px;
  font-size: 13px;
}
.grow__n {
  display: grid;
  justify-items: end;
  line-height: 1.15;
}
.grow__n small {
  font-size: 11px;
}
.grow.is-low {
  background: linear-gradient(90deg, rgba(163, 31, 18, 0.08), transparent);
}
.pgoods__all {
  width: 100%;
  margin-top: 12px;
}
.pspeed {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}
.pspeed > span {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.pspeed .orb {
  --orb: 44px;
}
.pmenu {
  margin: 0;
  padding: 0;
  list-style: none;
}
.pmenu .mrow {
  min-height: 52px;
}

/* bottom nav / left rail: red lacquer */
.pnav {
  position: relative;
  z-index: 9;
  display: flex;
  height: var(--pnav);
  padding: 5px 4px;
  background: var(--red);
  border-top: 2px solid var(--vang-400);
  box-shadow: 0 -1px 0 var(--then-900), 0 -6px 18px rgba(9, 8, 6, 0.3);
}
.hud--phone[data-orient='landscape'] .pnav {
  flex-direction: column;
  width: var(--prail);
  height: auto;
  border-top: 0;
  border-right: 2px solid var(--vang-400);
}
.pnav__btn {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  margin: 0 2px;
  border-radius: 10px;
  color: var(--paper-50);
  font-size: 11.5px;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(239, 200, 112, 0.25);
}
.hud--phone[data-orient='landscape'] .pnav__btn {
  margin: 2px 0;
}
.pnav__icon {
  color: var(--vang-200);
}
.pnav__btn span:not(.pnav__icon) {
  white-space: nowrap;
}
.pnav__btn.is-on {
  background: rgba(9, 8, 6, 0.32);
  box-shadow: inset 0 0 0 1.5px var(--vang-300);
}
.pnav__btn.is-on span {
  color: var(--vang-200);
}
.pnav__new {
  position: absolute;
  top: 2px;
  right: 4px;
}

.ptop__main {
  min-height: 44px;
}
.psheet .ract {
  grid-template-columns: minmax(0, 1fr) auto;
}
.psheet .ract .seg {
  grid-column: 1 / -1;
  display: flex;
}
.psheet .ract .seg button {
  flex: 1;
}
.ptile--up {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: 2px 4px;
  color: var(--muc-500);
}
.ptile--up .ptile__n {
  flex: 1 0 100%;
}
.hud--phone ~ .spotlight .spotlight__label,
[data-form='phone'] .spotlight .spotlight__label {
  left: calc(100% + 14px);
  bottom: auto;
  top: 50%;
  transform: translateY(-50%) !important;
}
