/* Town Hall tray. Loaded by the town, the shop room, and /shops/hall/. */
body.hall-tray #shopUI #tray{
  width:min(440px,calc(100vw - 28px));
  max-width:440px;
  left:16px; bottom:18px;
  max-height:calc(100dvh - 200px);
  padding:24px 22px 22px;
  box-sizing:border-box;
  /* The tray is the frame, not the scroller: `#tray > .t-scroll` is the one region that scrolls
     (world.css, and the "one scroll region" rule Chronicle follows). With overflow-y:auto here a
     short screen got two nested scrollbars, and the pinned action row could scroll away with the
     form because this box moved instead of the inner one. */
  overflow-x:hidden;
  overflow-y:hidden;
  background:#1f1a15;
  border:1px solid #3a3128;
  box-shadow:0 16px 40px rgba(0,0,0,.45);
  backdrop-filter:none;
}
body.hall-tray #shopUI .t-head,
body.hall-tray #shopUI .label,
body.hall-tray #shopUI .hero,
body.hall-tray #shopUI #t-who,
body.hall-tray #shopUI #t-track,
body.hall-tray #shopUI .shop-track,
body.hall-tray #shopUI .say,
body.hall-tray #shopUI .t-links,
body.hall-tray #shopUI .rcpt,
body.hall-tray #shopUI #t-act{display:none!important}
body.hall-tray #shopUI #t-form{margin:0;min-width:0;max-width:100%}
body[data-shop=hall] main.shop-page{padding-bottom:128px}
.hall-card{display:grid;gap:18px;min-width:0;max-width:100%}
.hall-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:5px;border-radius:var(--r-panel);background:#17130f;border:1px solid #4a3a28}
.hall-tab{
  min-height:44px;padding:8px 6px;margin:0;border:0;border-radius:var(--r-control);
  background:transparent;color:#d4c4a8;cursor:pointer;
  font:700 15px/1 system-ui,sans-serif;
}
.hall-split{display:grid;grid-template-columns:1fr 1fr;gap:12px}
body.hall-tray #shopUI .hall-tab.on,
body.hall-tray #shopUI .hall-tab[aria-selected="true"]{background:linear-gradient(180deg,#f5d08a,#e2b35b);color:#2a1608}
.hall-flow{display:flex;align-items:center;justify-content:center;gap:16px;padding:16px 14px;border-radius:var(--r-card);background:#17130f;border:1px solid rgba(214,180,106,.35)}
.hall-flow-ico{width:48px;height:48px;display:flex}
.hall-flow-ico svg{width:48px;height:48px;border-radius:var(--r-control)}
.hall-flow-arrow{color:#c98f4e;font:700 22px/1 system-ui,sans-serif}
.hall-flow-step{color:#fff8ee;font:700 14px/1.2 system-ui,sans-serif}
.hall-pane{display:grid;gap:16px;min-width:0}
.hall-pane[hidden]{display:none!important}
.hall-field{display:flex;flex-direction:column;gap:8px;margin:0;color:#e8d7b8;font:650 13px/1.2 system-ui,sans-serif}
.hall-field input,.hall-amt{
  width:100%;min-height:48px;box-sizing:border-box;padding:0 12px;border-radius:var(--r-control);
  border:1px solid #4a3a28;background:#17130f;color:#fff8ee;font:600 15px/1.2 system-ui,sans-serif;
}
.hall-amt{display:flex;align-items:center;gap:10px}
.hall-amt input{flex:1;min-width:0;border:0;background:transparent;color:#fff8ee;font:650 17px/1.2 system-ui,sans-serif;outline:none;padding:0}
.hall-amt span{color:#f5d08a;font:700 13px/1 system-ui,sans-serif}
.hall-line,.hall-gap{margin:0;color:#fff8ee;font:600 14px/1.4 system-ui,sans-serif;overflow-wrap:break-word}
.hall-gap{color:#f5d08a}
body.hall-tray #shopUI .hall-cta{
  display:inline-flex;align-items:center;justify-content:center;
  width:auto;min-width:min(220px,100%);max-width:100%;
  min-height:48px;padding:12px 22px;margin:0;justify-self:center;box-sizing:border-box;
  border:1px solid #c9a05a;border-radius:var(--r-panel);
  background:linear-gradient(180deg,#ffe2a8 0%,#f5d08a 42%,#e2b35b 100%);
  color:#2a1608;font:700 15px/1.15 system-ui,sans-serif;cursor:pointer;
  box-shadow:0 1px 0 rgba(255,255,255,.55) inset,0 -2px 0 rgba(120,70,20,.22) inset,0 4px 0 #9a6f2e,0 8px 16px rgba(0,0,0,.28);
}
.hall-cta:active{transform:translateY(3px)}
.hall-text{
  min-height:44px;padding:8px 4px;border:0;background:transparent;color:#f5d08a;
  font:650 14px/1.2 system-ui,sans-serif;cursor:pointer;text-align:left;
}
.hall-status{margin:0;color:#f5d08a;font:650 14px/1.35 system-ui,sans-serif;text-align:center;overflow-wrap:break-word}
.hall-rules{margin:0;text-align:center}
.hall-rules a{color:#e8d7b8;font:600 13px/1.3 system-ui,sans-serif}
/* "Personal rules" is the only link on its line, not a link inside a sentence, so it can have a
   real target: measured 93x24 before this, under the 40px floor every other control here meets.
   It is centred on its own row, so growing the box moves nothing sideways. */
.hall-rules a{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:0 12px}
.hall-note{margin:0;color:#f3ead8;font:600 14px/1.4 system-ui,sans-serif;overflow-wrap:anywhere}
.hall-seal{display:flex;align-items:center;gap:8px;margin:0;padding:12px 14px;border-radius:var(--r-control);background:#3a1614;color:#ffd0d0;font:700 14px/1.35 system-ui,sans-serif}
.hall-seal[hidden]{display:none}
#hall-agent-dock{
  position:fixed;right:20px;bottom:22px;z-index:70;
  display:flex;flex-direction:row;align-items:flex-end;gap:12px;
  pointer-events:none;
}
#hall-agent-dock > *,
#hall-agent-dock .hall-agent-send{pointer-events:auto}
#hall-agent-dock[hidden]{display:none!important}
.hall-agent-char{
  display:flex;flex-direction:column;align-items:center;gap:6px;
  width:96px;padding:0;border:0;background:transparent;cursor:pointer;color:#fff8ee;
}
.hall-agent-avatar{width:72px;height:72px;object-fit:contain;display:block;filter:drop-shadow(0 10px 18px rgba(0,0,0,.45))}
.hall-agent-name{margin:0;color:#f5d08a;font:700 11px/1.2 system-ui,sans-serif;letter-spacing:.05em;text-transform:uppercase}
.hall-agent-pop[hidden]{display:none!important}
.hall-agent-pop{
  width:min(300px,calc(100vw - 140px));
  box-sizing:border-box;padding:10px;border-radius:var(--r-panel);
  border:1px solid #d6b46a66;background:#1f1a15;
  box-shadow:0 12px 28px rgba(0,0,0,.4);
  display:grid;gap:8px;
}
.hall-agent-log{margin:0;color:#f5d08a;font:600 13px/1.35 system-ui,sans-serif;overflow-wrap:anywhere}
.hall-agent-row{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:8px}
.hall-agent-pop input{
  width:100%;min-width:0;box-sizing:border-box;min-height:44px;padding:0 12px;border-radius:var(--r-control);
  border:1px solid #4a3a28;background:#17130f;color:#fff8ee;
}
.hall-agent-send{
  width:44px;min-width:44px;height:44px;margin:0;padding:0;border:0;border-radius:var(--r-control);
  background:linear-gradient(180deg,#f5d08a,#e2b35b);color:#2a1608;font:700 16px/1 system-ui,sans-serif;cursor:pointer;
}
#shopUI #t-form button.hall-tab:not(.route-chip){
  background:transparent;color:#d4c4a8;border:0;min-height:44px;border-radius:var(--r-control);
  box-shadow:none;padding:8px 6px;
}
#shopUI #t-form button.hall-tab.on:not(.route-chip),
#shopUI #t-form button.hall-tab[aria-selected="true"]:not(.route-chip){
  background:linear-gradient(180deg,#f5d08a,#e2b35b);color:#2a1608;border:0;
}
#shopUI #t-form button.hall-cta{
  min-height:48px;border:1px solid #c9a05a;border-radius:var(--r-panel);color:#2a1608;
  background:linear-gradient(180deg,#ffe2a8 0%,#f5d08a 42%,#e2b35b 100%);
  box-shadow:0 1px 0 rgba(255,255,255,.55) inset,0 -2px 0 rgba(120,70,20,.22) inset,0 4px 0 #9a6f2e,0 8px 16px rgba(0,0,0,.28);
}
#shopUI #t-form button.hall-text:not(.route-chip){background:transparent;border:0;box-shadow:none;color:#f5d08a;min-height:44px}
@media (max-width:720px){
  /* The panel stays full width like every other shop. It used to be narrowed to
     `100vw - 112px` so the agent's 96px avatar had room beside it; measured on a 390px phone
     that made this the only shop with a 278px panel (the rest are 374px) and the form's fields
     then overflowed it. The avatar sits above the panel's bottom edge instead, where it does not
     cover a field. */
  body.hall-tray #shopUI #tray{
    left:8px;
    right:8px!important;
    /* The Lamplighter stands in the bottom-right corner of the room on a phone, and a full-width
       panel reaches the floor, so the two met: measured at 390x844 the dock covered 96x91 of the
       last worker field and the gold action. The tray stops above the dock instead, which gives
       the character its own strip of screen. The form scrolls a little more on a phone; nothing
       is covered. */
    bottom:calc(104px + env(safe-area-inset-bottom,0px));
    /* `height` from the shell wins over `top`+`bottom`, so the box stayed 676px and reached the
       floor anyway. With it released, the two offsets define the height. */
    height:auto;
    width:auto!important;
    max-width:420px!important;
    max-height:none;
  }
  .hall-tab{font-size:13px}
  body.hall-tray #shopUI .hall-cta{min-width:min(200px,100%)}
  .hall-card{gap:12px}
  .hall-pane{gap:10px}
  .hall-flow{padding:10px 12px}
  #hall-agent-dock{right:8px;bottom:calc(12px + env(safe-area-inset-bottom,0px))}
  .hall-agent-pop{width:min(220px,calc(100vw - 120px))}
}
.hall-tx a{overflow-wrap:anywhere;word-break:break-all}
