/* The Ledger — player profile ("Counterparty File").
 * Dark ledger-ink palette (§11), mono figures. The file reads like an index
 * card from the exchange's own archive — no gradients, no glass, no emoji. */

.profile-target { cursor: pointer; }
.profile-target:hover { text-decoration: underline dotted; text-underline-offset: 3px; }
/* corp-target — same affordance for corp names/tickers that open the corps
   panel's detail (app.js corpTarget + [data-corp-target] delegation). */
.corp-target { cursor: pointer; }
.corp-target:hover { text-decoration: underline dotted; text-underline-offset: 3px; }

/* ── Hover card ─────────────────────────────────────────────────────────── */
.pf-card {
  position: fixed;
  z-index: 90;
  width: 232px;
  padding: 12px;
  background: var(--panel-2, #121722);
  border: 1px solid var(--border, #1b2432);
  box-shadow: 0 10px 28px rgba(2, 3, 6, 0.55);
  font-size: 12px;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease;
  pointer-events: auto;
}
.pf-card-on { opacity: 1; transform: none; }

.pf-card-head { display: flex; gap: 9px; align-items: center; margin-bottom: 9px; }
.pf-card-id { min-width: 0; }
.pf-card-name { font-weight: 600; color: var(--text, #d3dcea); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-card-tier { color: var(--muted, #74809a); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 1px; }

.pf-card-nw {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 7px 0; border-top: 1px solid var(--border, #1b2432);
  color: var(--muted, #74809a);
}
.pf-card-nw b { color: var(--accent-2, #7ee0a3); font-family: var(--mono, ui-monospace, 'SFMono-Regular', Menlo, monospace); }

/* Self-view card — briefer, money-forward. Net worth is the headline, the
   leaderboard standing right under it; nothing decorative. */
.pf-card-nw-self b { font-size: 15px; color: var(--c-gold, #f0b429); }
.pf-card-stand {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 2px 0 8px; color: var(--muted, #74809a);
}
.pf-card-stand b { color: var(--text, #e8ecf4); font-family: var(--mono, ui-monospace, 'SFMono-Regular', Menlo, monospace); }
.pf-card-buff {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 2px 0 8px; color: var(--muted, #74809a); font-size: 11.5px;
}
.pf-card-buff b { color: var(--c-gold, #f0b429); font-family: var(--mono, ui-monospace, 'SFMono-Regular', Menlo, monospace); }

.pf-meters { display: grid; gap: 5px; padding: 3px 0 7px; }

.pf-card-foot {
  display: flex; justify-content: space-between; gap: 6px;
  border-top: 1px solid var(--border, #1b2432); padding-top: 6px;
  color: var(--muted, #74809a); font-size: 10px;
}
.pf-file { font-family: var(--mono, ui-monospace, 'SFMono-Regular', Menlo, monospace); letter-spacing: 0.04em; }

/* ── Seal ───────────────────────────────────────────────────────────────── */
.pf-seal {
  --pf-hue: #3aa8e0;
  flex: none;
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1.5px solid var(--pf-hue);
  background: color-mix(in srgb, var(--pf-hue) 14%, transparent);
  color: var(--pf-hue);
  font-family: var(--serif, Georgia, 'Times New Roman', serif);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 15px;
}
/* The profile is drawn in a 16×16 viewBox; shrink it inside the circular chip
 * so the bust sits like a coin effigy, not stretched edge-to-edge. The flex
 * centers it; the drawing is taller than wide, so height is the binding axis. */
.pf-seal svg { width: auto; height: 70%; }
/* Zodiac avatar — the animal figure is drawn 36×36 and squarer than the bust,
 * so it fills the chip (80%) instead of floating at the bust's 70%. The two
 * tone anchors ride CSS vars set inline by sealHTML (--pf-tone-a/--pf-tone-b),
 * keeping the ring + wash tinted like the silhouette seal is by --pf-hue. */
/* Avatar — the figure (12 zodiac + 100 monikers) is a light-anchored chip: the
 * toneA line-art + toneA outline sit on a solid toneB ground (toneB is the
 * light ~74%-L anchor, so the dark figure pops against the ledger's dark UI).
 * The toneA ring carries around from --pf-hue. */
.pf-seal-avatar {
  border-color: var(--pf-tone-a, var(--pf-hue));
  background: var(--pf-tone-b, #f0ead6);
}
/* Dark-chip variant — the clown (D. Odin), this world's shadow-superpower: the
 * figure inks in the username's tones over a black ground instead of the light
 * toneB chip, so it reads as a grin on the dark. */
.pf-seal-avatar--dark {
  background: #000;
  border-color: var(--pf-tone-a, var(--pf-hue));
}
.pf-seal-avatar svg { height: 80%; }
/* Autopilots are stamped with a dashed "machine charter" ring — humans get a
 * solid seal. */
.pf-seal-bot { border-style: dashed; }

/* Small seal — the leaderboard avatar stamp (18px, keeps the dashed ring for
 * bots). Compact enough to sit inline before a username. The profile bust and
 * ring are drawn at 16-viewBox, so at 18px a hairline stroke reads as mush —
 * thicken both stroke + ring so the silhouette holds its shape at small size. */
.pf-seal-sm {
  width: 18px; height: 18px;
  font-size: 8px;
  border-width: 1.5px;
}
.pf-seal-sm svg { stroke-width: 1.6; }
/* High-tier rim: SOVEREIGN/INSTITUTION seals carry a brass outer ring. Applied
 * where tier is known (hover card / dossier); leaderboard rows carry no tier on
 * the entry, so their stamps stay neutral. */
.pf-seal.pf-tier-brass {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brass, #d4b47a) 42%, transparent);
}
/* Leaderboard name cell — small seal + handle, inline-flex aligned. */
.lb-sealwrap { display: inline-flex; align-items: center; gap: 6px; }

/* ── Meters (posture ladder) ─────────────────────────────────────────────── */
.pf-meter-head { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted, #74809a); margin-bottom: 2px; }
.pf-meter-track { height: 3px; background: var(--panel, #0d1017); border: 1px solid var(--border, #1b2432); }
.pf-meter-track i { display: block; height: 100%; }
.pf-band-low { color: #e06a6a; }
.pf-band-mid { color: var(--brass, #d4b47a); }
.pf-band-high { color: var(--accent-2, #7ee0a3); }
.pf-meter-track .pf-band-low { background: #e06a6a; }
.pf-meter-track .pf-band-mid { background: var(--brass, #d4b47a); }
.pf-meter-track .pf-band-high { background: var(--accent-2, #7ee0a3); }

/* ── Tells ───────────────────────────────────────────────────────────────── */
.pf-tells { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 0 7px; }
.pf-tell {
  font-size: 9px; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 2px 6px; border: 1px solid var(--border, #1b2432); color: var(--muted, #74809a);
}
.pf-tell-edge { color: var(--brass, #d4b47a); border-color: color-mix(in srgb, var(--brass, #d4b47a) 40%, transparent); }
.pf-tell-plain { color: var(--muted, #74809a); }

/* ── Dossier modal ───────────────────────────────────────────────────────── */
.pf-overlay {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(4, 3, 2, 0.72);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.pf-modal {
  position: relative;
  width: min(460px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--panel, #0d1017);
  border: 1px solid var(--border, #1b2432);
  padding: 20px;
}
.pf-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; color: var(--muted, #74809a);
  font-size: 15px; cursor: pointer; padding: 4px 6px;
}
.pf-close:hover { color: var(--text, #d3dcea); }

.pf-sealrow { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.pf-sealrow .pf-seal { width: 52px; height: 52px; font-size: 20px; }
.pf-title {
  color: var(--muted, #74809a); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
}
.pf-name { color: var(--text, #d3dcea); font-weight: 700; font-size: 20px; line-height: 1.2; }
.pf-sub { color: var(--muted, #74809a); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; margin-top: 2px; }

.pf-meta {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  border-top: 1px solid var(--border, #1b2432); border-bottom: 1px solid var(--border, #1b2432);
  padding: 9px 0; margin-bottom: 14px;
  font-family: var(--mono, ui-monospace, 'SFMono-Regular', Menlo, monospace);
}
.pf-meta > span { font-size: 12px; color: var(--accent-2, #7ee0a3); }
.pf-meta .pf-dist { color: var(--brass, #d4b47a); letter-spacing: 0.04em; }
.pf-meta .pf-dist-high { color: #e06a6a; }
.pf-meta .pf-mach { color: var(--muted, #74809a); letter-spacing: 0.1em; font-size: 10px; text-transform: uppercase; }

.pf-section { margin: 14px 0 0; }
.pf-section-title {
  color: var(--muted, #74809a); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 8px;
}
.pf-desk {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text, #d3dcea); margin-bottom: 6px;
}
.pf-desk-line { min-width: 0; }
/* Desk stamp — a tiny bordered chip holding the desk's typographic glyph
 * (↗ ⇄ ▤ ▢ ⁂ · — unicode marks, never emoji). Muted resting, brass on hover. */
.pf-desk-glyph {
  flex: none;
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border, #1b2432);
  background: var(--panel-2, #121722);
  color: var(--muted, #74809a);
  font-size: 11px; line-height: 1;
}
.pf-desk:hover .pf-desk-glyph {
  color: var(--brass, #d4b47a);
  border-color: color-mix(in srgb, var(--brass, #d4b47a) 45%, transparent);
}

.pf-ladder { display: grid; gap: 7px; margin: 10px 0; }

.pf-sectors { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 10px; }
.pf-sector {
  font-size: 9px; letter-spacing: 0.08em; color: var(--accent, #3aa8e0);
  border: 1px solid color-mix(in srgb, var(--accent, #3aa8e0) 35%, transparent);
  padding: 2px 7px;
}

.pf-quote {
  font-family: var(--serif, Georgia, 'Times New Roman', serif);
  font-style: italic;
  color: var(--brass, #d4b47a);
  font-size: 13px;
  border-left: 2px solid color-mix(in srgb, var(--brass, #d4b47a) 50%, transparent);
  padding: 2px 0 2px 10px;
  margin-top: 4px;
}

/* ── Algorithm card (strategy-composer) ──────────────────────────────────── */
.pf-strategy {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border, #1b2432);
}
.pf-strategy-desk {
  font-family: var(--serif, Georgia, 'Times New Roman', serif);
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #d3dcea);
}
.pf-strategy-skip {
  font-size: 10px; letter-spacing: 0.04em;
  color: var(--muted, #74809a);
  margin: 2px 0 6px;
}
.pf-strategy-legs { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 8px; }
.pf-leg {
  font-size: 9px; letter-spacing: 0.05em;
  font-family: var(--mono, ui-monospace, 'SFMono-Regular', Menlo, monospace);
  color: var(--accent, #3aa8e0);
  border: 1px solid color-mix(in srgb, var(--accent, #3aa8e0) 35%, transparent);
  padding: 2px 6px;
}
.pf-strategy-sig {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 10px; color: var(--muted, #74809a);
}
.pf-strategy-sig b {
  color: var(--brass, #d4b47a);
  font-family: var(--mono, ui-monospace, 'SFMono-Regular', Menlo, monospace);
  font-weight: 600;
}

/* ── Human ENIGMA (sealed file) ──────────────────────────────────────────── */
.pf-enigma-cap {
  font-size: 11px; color: var(--muted, #74809a); font-style: italic; margin-bottom: 8px;
}
.pf-enigma-row { display: flex; align-items: center; gap: 8px; height: 12px; margin: 3px 0; }
.pf-enigma-label {
  flex: none; width: 12px; text-align: center; color: var(--muted, #74809a); font-size: 11px;
}
.pf-enigma-swatch {
  display: block; height: 100%;
  background: repeating-linear-gradient(90deg, #000 0 2px, #0a0c10 2px 4px);
  border: 1px solid var(--border, #1b2432);
}

/* ── Corps holdings ──────────────────────────────────────────────────────── */
.pf-corps { display: grid; gap: 4px; }
.pf-corp {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12px; padding: 4px 8px; background: var(--panel-2, #121722);
  border: 1px solid var(--border, #1b2432);
}
.pf-corp-name { color: var(--text, #d3dcea); font-weight: 600; }
.pf-corp-ticker { color: var(--muted, #74809a); font-size: 10px; font-family: var(--mono, ui-monospace, 'SFMono-Regular', Menlo, monospace); }
.pf-corp b { margin-left: auto; color: var(--accent-2, #7ee0a3); font-family: var(--mono, ui-monospace, 'SFMono-Regular', Menlo, monospace); font-size: 11px; }
.pf-corp-empty { color: var(--muted, #74809a); font-size: 11px; font-style: italic; }

/* ── Balance sheet ───────────────────────────────────────────────────────── */
.pf-bs { border: 1px solid var(--border, #1b2432); }
.pf-bs-row {
  display: flex; justify-content: space-between; padding: 5px 9px; font-size: 12px;
  color: var(--muted, #74809a);
}
.pf-bs-row:nth-child(odd) { background: var(--panel-2, #121722); }
.pf-bs-row b { color: var(--text, #d3dcea); font-family: var(--mono, ui-monospace, 'SFMono-Regular', Menlo, monospace); }

/* ── Provenance footer ──────────────────────────────────────────────────── */
.pf-prov {
  display: flex; justify-content: space-between; gap: 8px;
  margin-top: 16px; padding-top: 9px; border-top: 1px solid var(--border, #1b2432);
  color: var(--muted, #74809a); font-size: 10px; letter-spacing: 0.04em;
}

@media (max-width: 560px) {
  .pf-overlay { padding: 10px; align-items: flex-start; }
  .pf-modal { max-height: 94vh; padding: 16px; }
  .pf-card { width: min(232px, calc(100vw - 24px)); }
}
