.symbol-sheet { position: absolute; width: 0; height: 0; overflow: hidden; }
.ui-icon { display: block; width: 23px; height: 23px; flex: none; }
.screen-header {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-inline: max(20px, calc((100% - 1160px) / 2));
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.wordmark { display: flex; align-items: center; gap: 10px; }
.wordmark h1 { font-size: clamp(1.55rem, 2.65vw, 2.7rem); font-weight: 650; letter-spacing: -.055em; line-height: 1.1; }
.brand-pine { width: 1em; height: 1.1em; object-fit: contain; font-size: clamp(37px, 4.4vw, 63px); }
.return-link, .sound-toggle, .icon-button, .roster-trigger { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; font-weight: 650; }
.return-link { color: var(--ink); }
.return-link:hover { color: var(--accent); }
.sound-toggle, .icon-button, .roster-trigger { border: 0; border-radius: 2px; background: transparent; color: var(--ink); }
.sound-toggle, .icon-button { min-width: 44px; padding: 0; }
.sound-toggle[aria-pressed="true"] { color: var(--accent); }
.sound-toggle:hover, .icon-button:hover, .roster-trigger:hover:not(:disabled) { background: #d8e5e7; }
body[data-screen="plaza"] .screen-header {
  position: absolute;
  z-index: 3;
  inset: 0 0 auto;
  height: auto;
  align-items: flex-start;
  padding: max(17px, env(safe-area-inset-top)) clamp(16px, 3.6vw, 66px) 34px;
  border: 0;
  background: linear-gradient(to bottom, #f7fbfcd6, #f7fbfc6b 65%, transparent);
  pointer-events: none;
}
body[data-screen="plaza"] .wordmark { color: #253f49; text-shadow: 0 1px 4px #fbfffbb3; }
body[data-screen="plaza"] .sound-toggle { pointer-events: auto; align-self: center; }
body[data-screen="plaza"] .return-link, body[data-screen="person"] .wordmark { display: none; }
#directory {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100vh;
  height: 100svh;
  min-height: 300px;
}
.world { position: relative; isolation: isolate; overflow: hidden; background: linear-gradient(#d0e4ef, #ebf0e8 42%, #e0eaee 46%, #edf4f5); }
.character-plaza, .plaza-canvas, .plaza-characters { position: absolute; inset: 0; width: 100%; height: 100%; }
body[data-screen="plaza"] .character-plaza[data-stage-ready] { touch-action: none; }
.character-plaza[data-orbiting], .character-plaza[data-orbiting] .plaza-person { cursor: grabbing; user-select: none; }
.plaza-characters { pointer-events: none; }
.character-plaza:not([data-stage-ready]) .plaza-characters { visibility: hidden; }
.plaza-person {
  position: absolute; inset: 0 auto auto 0; display: flex; justify-content: center;
  align-items: end; pointer-events: auto; outline-offset: 3px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.plaza-person:focus-visible { outline-width: 2px; }
.plaza-name {
  flex: none; min-width: 0; max-width: calc(145px * var(--plaza-name-scale, 1)); overflow: hidden; padding: 2px 8px;
  background: #f9fcf6ed; box-shadow: 0 1px 2px #28414e35;
  border-radius: 2px; color: #29434c; font-size: calc(.82rem * var(--plaza-name-scale, 1)); font-weight: 650; line-height: 1.29;
  text-align: center; text-overflow: ellipsis; white-space: nowrap;
}
.plaza-person[aria-describedby] .plaza-name { opacity: 0; }
.plaza-tooltip {
  position: absolute; z-index: 1000; inset: 0 auto auto 0; width: max-content;
  max-width: min(240px, 100% - 16px); padding: 10px 14px; pointer-events: none;
  overflow-wrap: anywhere; border-left: 3px solid var(--accent); border-radius: 2px;
  box-shadow: 0 3px 9px #31455428; background: #fbfdf9f7; color: var(--ink); font-size: .85rem; line-height: 1.32;
}
.plaza-tooltip strong { font-size: 1rem; font-weight: 700; }
.plaza-tooltip dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 5px 0 0; }
.plaza-tooltip dt { color: var(--muted); }
.plaza-tooltip dd { margin: 0; font-weight: 550; }
.plaza-dock {
  position: relative; z-index: 2; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 15px; min-height: 74px;
  padding: 10px clamp(16px, 3.6vw, 66px) max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid #b0c5cb; background: linear-gradient(#fbfdfd, #eaf0f2);
  box-shadow: inset 0 2px #fff, 0 -2px 6px #2946500a;
}
.roster-trigger { justify-self: start; padding: 0 10px; margin-left: -8px; }
.roster-trigger:disabled { cursor: default; }
.dock-hint { color: var(--muted); font-size: .9rem; }
.world-status {
  position: absolute; left: 50%; top: 61%; z-index: 2; transform: translate(-50%, -50%);
  max-width: min(92%, 460px); width: max-content; color: var(--ink); text-align: center;
  background: #f7fbf5ed; padding: 8px 16px; border-radius: 2px;
}
.world-status strong { display: block; font-weight: 600; }
.world-status button { margin-top: 9px; }
body[data-screen="plaza"] .screen-header:has(~ main .fallback-people:not([hidden])) { background: #eaf3f5; }
.fallback-people { list-style: none; margin: 0; padding: 0; }
.fallback-people {
  position: absolute; inset: 100px max(18px, calc((100% - 700px)/2)) 15px;
  overflow-y: auto; overscroll-behavior: contain;
}
.person-link {
  display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 6px 12px;
  border-bottom: 1px solid var(--line); background: var(--paper); font-weight: 600; overflow-wrap: anywhere;
}
.person-link:hover, .person-link:focus-visible { color: var(--accent); background: #e1eff1; }
.person-link:focus-visible { outline-offset: -3px; }
.person-link .avatar-art { flex: none; width: 46px; border-radius: 50%; }
.person-link .chevron { margin-left: auto; color: var(--muted); font-size: 1.4rem; }
dialog { border-radius: 3px; box-shadow: 0 8px 32px #16333e26; }
dialog::backdrop { background: #1d394961; }
@media (max-width: 550px) {
  body[data-screen="plaza"] .screen-header { padding-top: max(15px, env(safe-area-inset-top)); }
  .plaza-dock { grid-template-columns: 1fr; min-height: 65px; }
  .dock-hint { display: none; }
  .wordmark { gap: 6px; }
  .plaza-name { max-width: calc(min(96px, 25vw) * var(--plaza-name-scale, 1)); }
  .screen-header { padding-inline: 16px; height: 52px; }
  .fallback-people { top: 77px; }
}
@media (max-height: 450px) {
  body[data-screen="plaza"] .screen-header { padding-top: 4px; padding-bottom: 8px; }
  .brand-pine { font-size: 32px; }
  .wordmark h1 { font-size: 1.5rem; }
  .plaza-dock { min-height: 49px; padding-block: 2px; }
}
@media (prefers-reduced-motion: no-preference) {
  .plaza-tooltip:not([hidden]) { animation: reveal-info 140ms ease-out; }
  .button, .sound-toggle, .roster-trigger { transition: color 100ms, background-color 100ms, border-color 100ms; }
  @keyframes reveal-info { from { opacity: 0; } to { opacity: 1; } }
}

/* The camera keeps its viewport when the profile controls take over. */
.world { grid-area: 1 / 1 / 3 / 2; }
.plaza-dock { grid-area: 2 / 1 / 3 / 2; }
body[data-screen="focus"] .plaza-dock,
body[data-screen="focus"] .wordmark,
body[data-screen="focus"] .plaza-characters,
body[data-screen="focus"] .plaza-tooltip { visibility: hidden; }
body[data-screen="focus"] .wordmark { display: none; }
body[data-screen="focus"] .screen-header {
  position: fixed; z-index: 6; inset: 0 0 auto; height: 58px; border: 0;
  background: linear-gradient(#f4fafbf0, #f4fafb80 70%, transparent);
  padding-inline: clamp(16px, 3.6vw, 66px);
  pointer-events: none;
}
body[data-screen="focus"] .screen-header :is(a, button) { pointer-events: auto; }

#profile-backdrop { display: none; }
body[data-screen="focus"]:has(#plaza[data-stage-ready]:not([hidden])) #profile-backdrop {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 1;
}

.clothing-callout {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.clothing-callout > * { position: absolute; inset: 0 auto auto 0; }
.clothing-callout-card {
  display: grid;
  gap: 2px;
  width: max-content;
  max-width: min(164px, 42vw);
  padding: 7px 11px;
  border: 1px solid #acc8ce;
  border-left: 2px solid var(--accent);
  border-radius: 2px;
  background: var(--paper);
  box-shadow: 0 3px 10px #31455428;
  color: var(--ink);
  line-height: 1.23;
  overflow-wrap: anywhere;
}
.clothing-callout-card span { color: var(--muted); font-size: .79rem; font-weight: 650; }
.clothing-callout-card strong { font-size: .97rem; font-weight: 700; }
.clothing-callout-leader {
  height: 2px;
  margin-top: -1px;
  background: var(--accent);
  box-shadow: 0 0 0 1px #f9fcfcb3;
  transform-origin: left center;
}
.clothing-callout-pin {
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
