/* ANKLE agents market: directory, agent sheet, my agents. agents-market-20261012.
 * The original ANKLE language: theme tokens only (--fg --bg --panel --line --muted
 * --mono-font --body-font), mono uppercase labels, oval outlined buttons, thin
 * rules, compact type. No new font stacks, no emoji, no blue bars.
 * Shell contract: the bar heights come from the shell when it sets them
 * (--aos-top-h / --aos-bottom-h) and fall back to the original bar (48px / 0).
 */
.am {
  --am-fg: var(--fg, #121212);
  --am-bg: var(--bg, #fff);
  --am-panel: var(--panel, #fafafa);
  --am-line: var(--line, #e8e8e8);
  --am-muted: var(--muted, #636363);
  --am-mono: var(--mono-font, ui-monospace, monospace);
  --am-body: var(--body-font, Arial, sans-serif);
  --am-pill: 999px;
  --am-tile-r: var(--radius, 12px);
  --am-top: var(--aos-top-h, 48px);
  --am-bottom: var(--aos-bottom-h, 0px);
  color: var(--am-fg);
  font: 400 13px/1.45 var(--am-body);
}
body.theme-discmaster .am { --am-pill: 0; --am-tile-r: 0; }
.am *, .am *::before, .am *::after { box-sizing: border-box; }
.am [hidden] { display: none !important; }
html.am-locked, html.am-locked body { overflow: hidden; }
html { scrollbar-gutter: stable; }

/* labels */
.am-eyebrow, .am-label, .am-stats, .am-chip, .am-btn, .am-status, .am-note {
  font-family: var(--am-mono);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.am-eyebrow { display: block; margin: 0 0 6px; font-size: 10px; font-weight: 600; color: var(--am-muted) !important; }
.am-label { font-size: 10px; font-weight: 600; color: var(--am-muted) !important; }
.am-note { font-size: 10px; line-height: 1.5; color: var(--am-muted) !important; }
.am-rule { height: 1px; border: 0; background: var(--am-line); margin: 14px 0; }

/* oval buttons: ~28px visible, 44px tap area via an invisible pad */
.am-btn {
  position: relative;
  appearance: none; -webkit-appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 28px; min-width: 28px; margin: 0; padding: 0 12px;
  border: 1px solid var(--am-fg); border-radius: var(--am-pill) !important;
  background: transparent !important; color: var(--am-fg) !important;
  font-size: 10.5px; font-weight: 600; line-height: 1; white-space: nowrap;
  text-decoration: none !important; cursor: pointer; box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
}
.am-btn::after { content: ""; position: absolute; inset: -8px -4px; }
.am-btn > span { color: inherit !important; }
.am-btn:hover { background: var(--am-panel) !important; }
.am-btn:focus-visible { outline: 2px solid var(--am-fg); outline-offset: 2px; }
.am-btn--ink, .am-btn--ink:hover { background: var(--am-fg) !important; color: var(--am-bg) !important; border-color: var(--am-fg); }
.am-btn--quiet { border-color: var(--am-line); }
.am-btn--quiet:hover { border-color: var(--am-fg); }
.am-btn[disabled], .am-btn[aria-disabled="true"] { border-style: dashed; border-color: var(--am-line); color: var(--am-muted) !important; background: transparent !important; cursor: not-allowed; }
.am-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.am-chip {
  display: inline-flex; align-items: center; height: 18px; padding: 0 7px;
  border: 1px solid var(--am-line); border-radius: var(--am-pill);
  background: var(--am-bg); color: var(--am-fg) !important;
  font-size: 9.5px; font-weight: 600; white-space: nowrap;
}
.am-chip--ink { background: var(--am-fg); border-color: var(--am-fg); color: var(--am-bg) !important; }
button.am-chip { position: relative; height: 26px; padding: 0 11px; cursor: pointer; font-size: 10px; appearance: none; }
button.am-chip::after { content: ""; position: absolute; inset: -9px -3px; }
button.am-chip[aria-pressed="true"] { background: var(--am-fg) !important; border-color: var(--am-fg); color: var(--am-bg) !important; }

/* page */
.am-page { max-width: 1120px; margin: 0 auto; padding: 18px 28px 64px; }
.am-head h1 { margin: 0; font: 700 20px/1.15 var(--am-body); letter-spacing: -.005em; color: var(--am-fg) !important; }
.am-sub { margin: 6px 0 10px; max-width: 60ch; font-size: 13px; color: var(--am-muted) !important; }
.am-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 12px; font-size: 10px; color: var(--am-muted) !important; }
.am-stats b { color: var(--am-fg); font-weight: 600; }
.am-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.am-search {
  flex: 1 1 180px; min-width: 0; height: 28px; padding: 0 12px;
  border: 1px solid var(--am-line); border-radius: var(--am-pill); background: var(--am-bg); color: var(--am-fg);
  font: 400 12px/1 var(--am-mono);
}
.am-search:focus { outline: 2px solid var(--am-fg); outline-offset: 1px; }

/* grid + cards */
.am-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .am-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 1000px) { .am-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.am-tile {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  border: 1px solid var(--am-line); border-radius: var(--am-tile-r); background: var(--am-bg); overflow: hidden;
  transition: border-color 120ms ease;
}
.am-tile:hover, .am-tile:focus-within { border-color: var(--am-fg); }
.am-hit { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; background: transparent !important; cursor: pointer; border-radius: inherit; }
.am-hit:focus-visible { outline: 2px solid var(--am-fg); outline-offset: -2px; }
.am-media {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden;
  background: color-mix(in srgb, var(--c, #8a8a8a) 16%, var(--am-panel));
}
.am-media .am-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.am-media[data-a3d="loaded"] .am-poster { opacity: 0; transition: opacity 200ms ease; }
.am-media .a3d-tile-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.am-media .am-sigil { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 400 34px/1 var(--am-body); color: var(--c, #8a8a8a); opacity: .55; }
.am-media[data-a3d="loaded"] .am-sigil, .am-media.has-poster .am-sigil { display: none; }
.am-flags { position: absolute; top: 7px; left: 7px; z-index: 1; display: flex; gap: 4px; flex-wrap: wrap; }
.am-meta { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px 10px; min-width: 0; }
.am-name { margin: 0; font: 600 14px/1.25 var(--am-body); color: var(--am-fg) !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-role { font: 500 10px/1.3 var(--am-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--am-muted) !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-price { font: 500 11px/1.3 var(--am-mono); color: var(--am-fg) !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-price--owned { color: var(--am-muted) !important; }
.am-empty { padding: 28px 16px; border: 1px dashed var(--am-line); border-radius: var(--am-tile-r); text-align: left; }
.am-wait { padding: 40px 0; text-align: center; }

/* skeleton shimmer, shared by cards and the stage */
@keyframes amPulse { 0%, 100% { opacity: .35; } 50% { opacity: .8; } }
.am-skel { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.am-skel::before { content: ""; width: 38%; aspect-ratio: 1; border: 1px dashed var(--am-muted); border-radius: var(--am-pill); animation: amPulse 1.4s ease-in-out infinite; }
[data-a3d="loaded"] > .am-skel, [data-a3d="failed"] > .am-skel, [data-a3d="unsupported"] > .am-skel { display: none; }
@media (prefers-reduced-motion: reduce) { .am-skel::before { animation: none; } }

/* scrim + sheet (phones) / modal (desktop) */
.am-scrim { position: fixed; inset: 0; z-index: 2147483000; background: rgba(0, 0, 0, .32); opacity: 0; transition: opacity 160ms ease; }
.am-scrim.is-open { opacity: 1; }
.am-sheet {
  position: fixed; z-index: 2147483001; left: 0; right: 0; bottom: var(--am-bottom);
  display: flex; flex-direction: column;
  max-height: calc(100dvh - var(--am-top) - var(--am-bottom) - 8px);
  border: 1px solid var(--am-line); border-bottom: 0; border-radius: 14px 14px 0 0;
  background: var(--am-bg); color: var(--am-fg);
  transform: translateY(100%); transition: transform 200ms cubic-bezier(.2,.8,.2,1);
  overscroll-behavior: contain;
}
body.theme-discmaster .am-sheet { border-radius: 0; }
.am-sheet.is-open { transform: none; }
.am-sheet:focus { outline: none; }
.am-grab { flex: 0 0 auto; display: flex; justify-content: center; padding: 7px 0 3px; touch-action: none; }
.am-grab::before { content: ""; width: 36px; height: 4px; border-radius: 2px; background: var(--am-line); }
.am-sheet-bar { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 14px 8px; }
.am-sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 14px 16px; }
.am-sheet-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.am-stage {
  position: relative; width: 100%; height: min(36dvh, 300px); overflow: hidden;
  border: 1px solid var(--am-line); border-radius: var(--am-tile-r);
  background: color-mix(in srgb, var(--c, #8a8a8a) 16%, var(--am-panel));
}
.am-stage .am-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: blur(2px); opacity: .7; }
.am-stage[data-a3d="loaded"] .am-poster { display: none; }
.am-stage-hint { position: absolute; left: 8px; bottom: 7px; z-index: 1; pointer-events: none; }
.am-stage-fail { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.am-stage[data-a3d="failed"] .am-stage-fail, .am-stage[data-a3d="unsupported"] .am-stage-fail { display: flex; }
.am-stage[data-a3d="failed"] .am-stage-hint, .am-stage[data-a3d="unsupported"] .am-stage-hint { display: none; }
.am-info h2 { margin: 2px 0 2px; font: 700 18px/1.2 var(--am-body); color: var(--am-fg) !important; }
.am-info p { margin: 6px 0; font-size: 13px; line-height: 1.5; color: var(--am-fg); }
.am-facts { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; }
.am-buy { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--am-line); }
.am-buy .am-price { font-size: 12px; white-space: normal; }
.am-status { font-size: 10px; color: var(--am-muted) !important; }
.am-msg { font: 400 12px/1.45 var(--am-body); color: var(--am-fg); }
.am-msg--err { color: #a42a00; }
.am-block { margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--am-line); }
.am-block h3 { margin: 0 0 6px; }
.am-employ-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; }
.am-select {
  height: 28px; max-width: 100%; padding: 0 10px; border: 1px solid var(--am-line); border-radius: var(--am-pill);
  background: var(--am-bg); color: var(--am-fg); font: 500 11px/1 var(--am-mono);
}
.am-secret { margin: 8px 0; padding: 8px 10px; border: 1px dashed var(--am-fg); border-radius: 10px; background: var(--am-panel); }
body.theme-discmaster .am-secret { border-radius: 0; }
.am-secret code { display: block; margin: 6px 0; font: 500 11px/1.4 var(--am-mono); word-break: break-all; color: var(--am-fg); }
.am details { margin: 0; }
.am details > summary { list-style: none; cursor: pointer; padding: 8px 0; }
.am details > summary::-webkit-details-marker { display: none; }
.am details > summary::before { content: "+ "; font-family: var(--am-mono); }
.am details[open] > summary::before { content: "\2212 "; }
.am-log { max-height: 200px; overflow-y: auto; margin: 4px 0 8px; padding: 8px; border: 1px solid var(--am-line); border-radius: 10px; font-size: 12px; }
.am-log div { margin: 0 0 4px; }
.am-input, .am-textarea {
  width: 100%; min-width: 0; padding: 6px 10px; border: 1px solid var(--am-line); border-radius: 10px;
  background: var(--am-bg); color: var(--am-fg); font: 400 12px/1.4 var(--am-body);
}
.am-input { height: 28px; border-radius: var(--am-pill); }
.am-textarea { min-height: 64px; resize: vertical; }
body.theme-discmaster .am-input, body.theme-discmaster .am-textarea, body.theme-discmaster .am-log { border-radius: 0; }

@media (min-width: 641px) {
  .am-sheet {
    left: 50%; right: auto; bottom: auto; top: calc(var(--am-top) + (100dvh - var(--am-top) - var(--am-bottom)) / 2);
    width: min(860px, calc(100vw - 48px));
    max-height: calc(100dvh - var(--am-top) - var(--am-bottom) - 40px);
    border-bottom: 1px solid var(--am-line); border-radius: 14px;
    transform: translate(-50%, -48%) scale(.98); opacity: 0; transition: transform 160ms ease, opacity 160ms ease;
  }
  .am-sheet.is-open { transform: translate(-50%, -50%); opacity: 1; }
  .am-grab { display: none; }
  .am-sheet-bar { padding: 12px 16px 8px; }
  .am-sheet-body { padding: 0 16px 18px; }
  .am-sheet-grid { grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
  .am-stage { height: min(56dvh, 460px); position: sticky; top: 0; }
}
@media (max-width: 640px) {
  .am-page { padding: 14px 28px 56px; }
}
@media (prefers-reduced-motion: reduce) { .am-sheet, .am-scrim { transition: none; } }

/* embed: a World page or booth shows just the turning model */
html.am-embed, html.am-embed body { margin: 0; background: transparent !important; overflow: hidden; }
html.am-embed .am-page, html.am-embed .am-scrim { display: none !important; }
html.am-embed .am-sheet { display: none !important; }
.am-embed-stage { position: fixed; inset: 0; }
.am-embed-stage .am-stage { height: 100%; border: 0; border-radius: 0; background: transparent; }

/* theme.css repaints every button/input/select with !important at (0,3,2)
 * (body.theme-ankle-original button:not(..):not(..)). Repeat classes to outrank
 * it; the paint stays token-driven. */
html body .am button.am-hit.am-hit.am-hit { background: transparent !important; border: 0 !important; box-shadow: none !important; border-radius: inherit !important; padding: 0 !important; }
html body .am button.am-btn.am-btn.am-btn { background: transparent !important; border: 1px solid var(--am-fg) !important; color: var(--am-fg) !important; border-radius: var(--am-pill) !important; box-shadow: none !important; height: 28px !important; min-height: 0 !important; padding: 0 12px !important; font: 600 10.5px/1 var(--am-mono) !important; letter-spacing: .06em !important; text-transform: uppercase !important; }
html body .am button.am-btn.am-btn.am-btn:hover { background: var(--am-panel) !important; }
html body .am button.am-btn--quiet.am-btn--quiet.am-btn--quiet { border-color: var(--am-line) !important; }
html body .am button.am-btn--quiet.am-btn--quiet.am-btn--quiet:hover { border-color: var(--am-fg) !important; }
html body .am button.am-btn--ink.am-btn--ink.am-btn--ink { background: var(--am-fg) !important; border-color: var(--am-fg) !important; color: var(--am-bg) !important; }
html body .am button.am-btn.am-btn.am-btn[disabled] { border: 1px dashed var(--am-line) !important; background: transparent !important; color: var(--am-muted) !important; }
html body .am button.am-chip.am-chip.am-chip { background: var(--am-bg) !important; border: 1px solid var(--am-line) !important; color: var(--am-fg) !important; border-radius: var(--am-pill) !important; box-shadow: none !important; height: 26px !important; min-height: 0 !important; padding: 0 11px !important; font: 600 10px/1 var(--am-mono) !important; letter-spacing: .06em !important; text-transform: uppercase !important; }
html body .am button.am-chip.am-chip.am-chip[aria-pressed="true"] { background: var(--am-fg) !important; border-color: var(--am-fg) !important; color: var(--am-bg) !important; }
html body .am input.am-search.am-search.am-search,
html body .am input.am-input.am-input.am-input,
html body .am select.am-select.am-select.am-select { background: var(--am-bg) !important; border: 1px solid var(--am-line) !important; color: var(--am-fg) !important; border-radius: var(--am-pill) !important; box-shadow: none !important; height: 28px !important; min-height: 0 !important; padding: 0 12px !important; font: 400 12px/1 var(--am-mono) !important; }
html body .am textarea.am-textarea.am-textarea.am-textarea { background: var(--am-bg) !important; border: 1px solid var(--am-line) !important; color: var(--am-fg) !important; border-radius: 10px !important; box-shadow: none !important; font: 400 12px/1.4 var(--am-body) !important; }
html body.theme-discmaster .am button.am-btn.am-btn.am-btn, html body.theme-discmaster .am button.am-chip.am-chip.am-chip,
html body.theme-discmaster .am input.am-search.am-search.am-search, html body.theme-discmaster .am input.am-input.am-input.am-input,
html body.theme-discmaster .am select.am-select.am-select.am-select, html body.theme-discmaster .am textarea.am-textarea.am-textarea.am-textarea { border-radius: 0 !important; }

html body .am a.am-btn.am-btn.am-btn, html body .am a.am-btn.am-btn.am-btn > span { color: var(--am-fg) !important; text-decoration: none !important; }
html body .am a.am-btn--ink.am-btn--ink.am-btn--ink, html body .am a.am-btn--ink.am-btn--ink.am-btn--ink > span { color: var(--am-bg) !important; }
html body .am button.am-btn--ink.am-btn--ink.am-btn--ink > span { color: var(--am-bg) !important; }
html body .am details.am-details.am-details { background: transparent !important; border: 0 !important; border-top: 1px solid var(--am-line) !important; border-radius: 0 !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; }
html body .am details.am-details.am-details:first-child { border-top: 0 !important; }
html body .am details.am-details.am-details > summary { background: transparent !important; border: 0 !important; padding: 8px 0 !important; }
.am-sheet:focus-visible { outline: none; }
html body .am.am-sheet.am-sheet:focus, html body .am.am-sheet.am-sheet:focus-visible { outline: none !important; box-shadow: none !important; }
/* embed: nothing but the model (theme/auth floating controls stay out of the frame) */
html.am-embed.am-embed body > *:not(.am-embed-stage) { display: none !important; }
html.am-embed.am-embed, html.am-embed.am-embed body, html.am-embed.am-embed body[class] { background: transparent !important; background-image: none !important; padding: 0 !important; }
html.am-embed.am-embed .am-embed-stage .am-stage { background: transparent !important; border: 0 !important; }

/* ── centering (Alex: "everything centered perfectly always") ─────────────── */
.am-btn > span, .am-chip > span { display: block; line-height: 1; }
.am-head, .am-meta, .am-info, .am-empty, .am-wait, .am-block { text-align: center; }
.am-meta { align-items: center; }
.am-head .am-row, .am-info .am-row, .am-employ-row, .am-filters, .am-stats, .am-facts, .am-buy, .am-sheet-bar + .am-sheet-body .am-row { justify-content: center; }
.am-buy { align-items: center; }
.am-sub { margin-left: auto; margin-right: auto; }
.am-empty { align-items: center; display: flex; flex-direction: column; }
.am-search { flex-basis: 100%; }
.am-info p { margin-left: auto; margin-right: auto; max-width: 52ch; }
.am-flags { left: 50%; transform: translateX(-50%); justify-content: center; width: max-content; max-width: calc(100% - 14px); }
.am-media .am-poster { object-position: center; }
.am-log { text-align: left; }

/* ── primary actions: ink pill, light label, never dark on dark ───────────── */
html body .am #amCta, html body .am #amCollect, html body .am #amPair, html body .am #amAsk, html body .am #amNote, html body .am #amCta2,
html body .am .am-cta.am-cta.am-cta {
  background: var(--am-fg) !important; background-color: var(--am-fg) !important; border: 1px solid var(--am-fg) !important;
  color: var(--am-bg) !important;
}
html body .am #amCta > span, html body .am #amCollect > span, html body .am #amPair > span, html body .am #amAsk > span,
html body .am #amNote > span, html body .am #amCta2 > span, html body .am .am-cta.am-cta.am-cta > span { color: var(--am-bg) !important; }
html body .am #amCollect[disabled], html body .am #amPair[disabled], html body .am #amAsk[disabled], html body .am #amNote[disabled] {
  background: transparent !important; color: var(--am-muted) !important; border: 1px dashed var(--am-line) !important;
}
html body .am #amCollect[disabled] > span, html body .am #amPair[disabled] > span, html body .am #amAsk[disabled] > span, html body .am #amNote[disabled] > span { color: var(--am-muted) !important; }
.am-nobody { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.am-help, .am-info p.am-help { margin: 6px auto; max-width: 52ch; font: 400 12px/1.5 var(--am-body); color: var(--am-muted) !important; text-transform: none; letter-spacing: 0; }

/* frame: only the sheet, over the host World page */
html.am-frame.am-frame, html.am-frame.am-frame body, html.am-frame.am-frame body[class] { background: transparent !important; background-image: none !important; }
html.am-frame.am-frame body > *:not(.am-sheet):not(.am-scrim) { display: none !important; }
html.am-frame .am { --am-top: 12px; --am-bottom: 0px; }

/* sheet cleanup */
html body .am details.am-details > summary.am-label { color: var(--am-fg) !important; }
.am-flags { z-index: 3; }
html body .am a.am-chip--link.am-chip--link { position: relative; text-decoration: none !important; color: var(--am-fg) !important; background: var(--am-bg) !important; }
html body .am a.am-chip--link.am-chip--link::after { content: ""; position: absolute; inset: -10px -4px; }
html body .am a.am-chip--link.am-chip--link:hover { border-color: var(--am-fg); }
html body .am .am-stage-hint.am-stage-hint { color: var(--am-fg) !important; }
html body .am .am-nobody.am-nobody { color: var(--am-fg) !important; }
/* centred grid: a short last row sits in the middle, never hugging the left edge */
.am-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.am-grid > .am-tile { flex: 0 1 calc(50% - 5px); }
@media (min-width: 720px) { .am-grid { gap: 12px; } .am-grid > .am-tile { flex-basis: calc((100% - 24px) / 3); } }
@media (min-width: 1000px) { .am-grid > .am-tile { flex-basis: calc((100% - 36px) / 4); } }
