/* Agent Town section. Uses the site's tokens (--ivory, --muted, --line, --tungsten, --display) with fallbacks. */
.town-shell {
  margin-top: clamp(3.5rem, 7vw, 7rem);
}
.agent-town {
  --t-ink: var(--ivory, #f1ecd8);
  --t-muted: var(--muted, #a7a69f);
  --t-line: var(--line, rgba(241, 236, 216, .16));
  --t-panel: rgba(16, 20, 38, .9);
  --t-accent: var(--tungsten, #e5b567);
  position: relative;
  height: clamp(28rem, 56vw, 46rem);
  margin-top: 1.2rem;
  overflow: hidden;
  border-block: 1px solid var(--t-line);
  background:
    radial-gradient(ellipse at 50% 36%, rgba(229, 181, 103, .09), transparent 62%),
    linear-gradient(#0a0d1c, #101426 55%, #151a30);
  color: var(--t-ink);
}
.agent-town canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; outline: none; }
.agent-town canvas:active { cursor: grabbing; }
.agent-town canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--t-accent); }
.agent-town .at-msg { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 2rem; text-align: center; color: var(--t-muted); font-size: .9rem; }
.agent-town .at-places { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: .45rem; padding: 0 .9rem .9rem; overflow-x: auto; scrollbar-width: none; }
.agent-town .at-places::-webkit-scrollbar { display: none; }
.agent-town .at-places button { flex: 0 0 auto; font: inherit; font-size: .78rem; color: var(--t-ink); background: rgba(16, 20, 38, .82); border: 1px solid var(--t-line); border-radius: 2px; padding: .45rem .75rem; cursor: pointer; }
.agent-town .at-places button[aria-pressed="true"] { border-color: var(--t-accent); color: var(--t-accent); }
.agent-town .at-dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; margin-right: .45rem; vertical-align: .05em; }
.agent-town .at-n { color: var(--t-muted); margin-left: .45rem; }
.agent-town .at-info { position: absolute; top: .9rem; right: .9rem; width: min(20rem, calc(100% - 1.8rem)); max-height: calc(100% - 5.5rem); overflow: auto; background: var(--t-panel); border: 1px solid var(--t-line); padding: 1rem 1.1rem; font-size: .84rem; line-height: 1.5; }
.agent-town .at-info[hidden] { display: none; }
.agent-town .at-info h3 { font-family: var(--display, Georgia, serif); font-weight: 400; font-size: 1.35rem; line-height: 1.15; margin: 0 2rem .4rem 0; }
.agent-town .at-info p { margin: .3rem 0; color: var(--t-muted); }
.agent-town .at-info ul { list-style: none; margin: .6rem 0 0; padding: 0; }
.agent-town .at-info ul li { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; border-top: 1px solid var(--t-line); }
.agent-town .at-info ul li span + span { color: var(--t-muted); white-space: nowrap; }
.agent-town .at-info blockquote { margin: .45rem 0; padding-left: .7rem; border-left: 2px solid var(--t-accent); }
.agent-town .at-close { position: absolute; top: .5rem; right: .5rem; width: 2rem; height: 2rem; border: 1px solid var(--t-line); border-radius: 50%; background: transparent; color: var(--t-ink); font: inherit; cursor: pointer; }
.agent-town .at-hint { position: absolute; right: .9rem; bottom: 3.5rem; margin: 0; color: var(--t-muted); font-size: .72rem; pointer-events: none; }
.agent-town .at-toast { position: absolute; left: 50%; top: .9rem; transform: translateX(-50%); margin: 0; padding: .45rem .8rem; background: var(--t-panel); border: 1px solid var(--t-line); font-size: .78rem; opacity: 0; transition: opacity .2s; pointer-events: none; white-space: nowrap; }
.agent-town .at-toast.on { opacity: 1; }
.agent-town .at-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; padding: 0; }
.agent-town button:focus-visible { outline: 2px solid var(--t-accent); outline-offset: 2px; }
.town-status { color: var(--muted, #a7a69f); font-size: .8rem; }
@media (max-width: 640px) {
  .agent-town { height: 32rem; }
  .agent-town .at-info { top: auto; bottom: 3.4rem; max-height: 46%; }
  .agent-town .at-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) { .agent-town .at-toast { transition: none; } }
.agent-town .at-feed { position: absolute; top: .9rem; left: .9rem; max-width: min(36rem, calc(100% - 23rem)); display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem .5rem .5rem; background: rgba(16, 20, 38, .86); border: 1px solid var(--t-line); font-size: .8rem; line-height: 1.35; }
.agent-town .at-feed[hidden] { display: none; }
.agent-town .at-feed-k { flex: 0 0 auto; padding: .15rem .4rem; border: 1px solid var(--t-accent); color: var(--t-accent); font-size: .7rem; letter-spacing: .04em; }
.agent-town .at-feed-t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-town .at-feed-b { flex: 0 0 auto; font: inherit; font-size: .75rem; color: var(--t-ink); background: transparent; border: 1px solid var(--t-line); padding: .3rem .55rem; cursor: pointer; }
.agent-town .at-info code { font-size: .78em; }
.agent-town .at-info ol { margin: .4rem 0 .6rem 1.2rem; padding: 0; }
.agent-town .at-info ol li { margin: .3rem 0; color: var(--t-muted); }
.agent-town .at-info code { overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .agent-town .at-feed { right: .9rem; max-width: none; }
  .agent-town .at-info { top: 4.2rem; }
}
@media (max-width: 640px) { .agent-town .at-feed-b { display: none; } .agent-town .at-info { top: auto; } }
