/* ====== Player Profile System — Character V4 (Dossier-style) ======
 * Visual language aligned with the subject-dossier (dossier-v4.css):
 * cream paper, warm-gray ink, dashed dividers, red classified accents.
 * ================================================================== */

/* ====== SCOPED VARIABLES (Dossier palette) ====== */
#playerProfileSection .profile-container {
  --pp-paper:         #EBE6D8;             /* dossier paper */
  --pp-paper-light:   #F2EDDF;             /* highlight cream */
  --pp-paper-dark:    #D4C8BE;             /* tab/strip cream */
  --pp-ink:           #3A3238;             /* main text */
  --pp-ink-faded:     #5F5449;             /* secondary text */
  --pp-ink-light:     #8E7F7F;             /* labels */
  --pp-ink-muted:    #8E7F7F;              /* muted labels */
  --pp-red:           #8B0000;             /* classified red */
  --pp-red-light:     rgba(139, 0, 0, 0.10);
  --pp-border:        rgba(142,127,127,0.30);
  --pp-border-strong: #8E7F7F;
  --pp-header-bg:     rgba(212,200,190,0.40);
  --pp-header-text:   #3A3238;
  --pp-card-header:   rgba(142,127,127,0.15);
  --pp-green:         #4a5d4a;
  --pp-green-bg:      rgba(74, 93, 74, 0.10);
  --pp-gold:          #c4a87a;
  --pp-gold-bg:       rgba(196,168,122,0.12);
  --pp-bar-bg:        rgba(142,127,127,0.15);
  --pp-blue-pen:      #1b4fb0;
}

/* ====== OVERLAY ====== */
#playerProfileSection {
  pointer-events: auto !important;
}

/* ====== PROFILE CONTAINER (dossier document) ====== */
#playerProfileSection {
  background: rgba(58, 50, 56, 0.92) !important; /* dossier overlay scrim */
}

#playerProfileSection .profile-container {
  max-width: 1100px;
  width: 95vw;
  /* QA P2-13 — the overlay dialogue strip lives on the bottom
     ~110px of the glass; with only 4rem of tail margin the SAVE
     PROFILE / EXPORT DATA row scrolled to a stop underneath it.
     The tail clears the strip now. */
  margin: 2rem auto calc(4rem + 90px);
  background: var(--pp-paper);
  border: 1px solid var(--pp-border-strong);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 1000000;
  pointer-events: auto !important;
  font-family: 'Courier New', Courier, monospace;
  color: var(--pp-ink);
  animation: ppFadeIn 0.4s ease-out;
  /* Dossier paper — faint horizontal rule lines like a casefile sheet */
  background-image: repeating-linear-gradient(
    0deg, transparent, transparent 28px,
    rgba(142, 127, 127, 0.04) 28px, rgba(142, 127, 127, 0.04) 29px);
}

@keyframes ppFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Paper textures dropped — the rule-line gradient on the container is the
 * texture now, matching dossier-v4. No turbulence noise, no coffee stains. */
#playerProfileSection .profile-container::before,
#playerProfileSection .profile-container::after {
  content: none;
}

/* ====== HEADER (dossier-style) ====== */
#playerProfileSection .pp-header {
  background: var(--pp-header-bg);
  padding: 1.5rem 2rem 1rem;
  text-align: center;
  position: relative;
  z-index: 2;
  border-bottom: 1px dashed var(--pp-border-strong);
  display: block;
}

/* Tiny CASE: identifier — top-left, dossier "el" style */
#playerProfileSection .pp-case-number {
  position: absolute;
  left: 1.5rem;
  top: 0.8rem;
  font-size: 0.6rem;
  color: var(--pp-ink-light);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: bold;
}

/* The title morphs into a dossier .page-title — large, dark, letter-spaced */
#playerProfileSection .pp-title {
  display: block;
  margin: 0.3rem auto 0;
  font-size: 1.4rem;
  color: var(--pp-ink);
  letter-spacing: 4px;
  text-transform: uppercase;
  font-weight: bold;
  line-height: 1.2;
}

/* Add the red classified banner above the title */
#playerProfileSection .pp-header::before {
  content: "CLASSIFIED \2014  WITNESS PROFILE";
  display: inline-block;
  background: var(--pp-red);
  color: var(--pp-paper);
  padding: 0.3rem 1rem;
  font-size: 0.7rem;
  letter-spacing: 3px;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

#playerProfileSection .pp-close-btn {
  position: absolute;
  right: 0.8rem;
  top: 0.6rem;
  background: none;
  border: 1px solid var(--pp-border-strong);
  color: var(--pp-ink-faded);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
  font-family: 'Courier New', Courier, monospace;
}

#playerProfileSection .pp-close-btn:hover {
  color: var(--pp-red);
  border-color: var(--pp-red);
  background: var(--pp-red-light);
}

/* ====== TABS (dossier folder-tabs) ====== */
#playerProfileSection .page-tabs {
  display: flex;
  background: rgba(212, 200, 190, 0.20);
  border-bottom: 2px solid var(--pp-border-strong);
  position: relative;
  z-index: 2;
  padding: 0 2rem;
  margin-bottom: 0;
}

#playerProfileSection .page-tab {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--pp-ink-light);
  padding: 0.8rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 700;
  position: static;
  top: auto;
}

#playerProfileSection .page-tab:hover {
  color: var(--pp-ink);
  background: none;
}

#playerProfileSection .page-tab.active {
  color: var(--pp-ink);
  border-bottom-color: var(--pp-red);
  background: none;
}

/* ====== CONTENT AREA ====== */
#playerProfileSection .content-area {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 2rem 2rem;
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

/* ====== PAGE PANELS ====== */
#playerProfileSection .page-content {
  display: none;
}

#playerProfileSection .page-content.active {
  display: block;
  animation: ppFadeIn 0.25s ease;
}

/* ====== SECTION HEADER (dossier .st style) ====== */
#playerProfileSection .sec-header {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--pp-ink);
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 0 0 0.4rem 0;
  border: none;
  border-bottom: 1px dashed var(--pp-border-strong);
  margin: 1.5rem 0 0.8rem;
}

/* ====== DOSSIER-STYLE BOX CARDS (.bx pattern) ====== */
#playerProfileSection .dcard {
  border: 1px solid var(--pp-border);
  background: rgba(255, 255, 255, 0.25);
  margin-bottom: 1rem;
}

#playerProfileSection .dcard-header {
  background: var(--pp-card-header);
  color: var(--pp-ink);
  font-size: 0.65rem;
  font-weight: bold;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 0.4rem 0.7rem;
  border-bottom: 1px solid var(--pp-border);
}

#playerProfileSection .dcard-body {
  padding: 0.6rem 0.8rem;
}

/* ====== ID LAYOUT (Personal Tab — dossier .pg style) ====== */
#playerProfileSection .id-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

/* The photo block mirrors the dossier ".pb" — diagonal-stripe placeholder
 * giving the feel of a clipped Polaroid waiting to be replaced. */
#playerProfileSection .id-photo {
  width: 180px;
  height: 220px;
  border: 1px solid var(--pp-border-strong);
  background: repeating-linear-gradient(45deg,
    #5F5449, #5F5449 8px, #4a4240 8px, #4a4240 16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.25);
  color: var(--pp-paper);
}

#playerProfileSection .id-photo:hover {
  transform: translateY(-6px) rotate(-1.6deg);
  box-shadow: 5px 10px 20px rgba(0, 0, 0, 0.45);
}

#playerProfileSection .id-photo-icon {
  width: 50px;
  height: 60px;
  border: 1px solid rgba(235, 230, 216, 0.5);
  margin-bottom: 0.5rem;
  background: rgba(0, 0, 0, 0.10);
}

#playerProfileSection .id-photo-text {
  font-size: 0.65rem;
  color: var(--pp-paper);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
  line-height: 1.8;
}

#playerProfileSection .id-fields {
  flex: 1;
}

/* ====== FORM ROWS (dossier .fr / .fl / .fv) ====== */
#playerProfileSection .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.5rem;
}

#playerProfileSection .form-field {
  display: flex;
  gap: 0.8rem;
  padding: 0.3rem 0;
  font-size: 0.82rem;
  border-bottom: 1px dotted rgba(142, 127, 127, 0.3);
  align-items: baseline;
}

#playerProfileSection .form-label {
  font-size: 0.7rem;
  color: var(--pp-ink-light);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: bold;
  min-width: 110px;
  margin-bottom: 0;
}

#playerProfileSection .form-value {
  font-size: 0.82rem;
  color: var(--pp-ink);
  font-weight: normal;
  padding: 0;
  border: none;
  background: none;
  min-height: auto;
  flex: 1;
}

#playerProfileSection .form-full {
  grid-column: 1 / -1;
}

/* ====== ATTRIBUTE BOXES (cleaner, dossier-style) ====== */
#playerProfileSection .attr-boxes {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 0.8rem;
}

#playerProfileSection .attr-box {
  border: 1px solid var(--pp-border-strong);
  padding: 0.9rem 0.7rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.2);
}

#playerProfileSection .attr-box-name {
  font-size: 0.62rem;
  color: var(--pp-ink-light);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: bold;
  margin-bottom: 0.3rem;
}

/* S.E.K.S attribute strip — stamped first letter + small uppercase tail.
 * Same treatment as the character-creation strip so the read is consistent
 * across creation and the live character sheet. */
#playerProfileSection .seks-row .attr-box-name {
  font-size: inherit;
  letter-spacing: 0;
  text-transform: none;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 1px;
  margin-bottom: 0.5rem;
}
#playerProfileSection .seks-letter {
  font-family: 'Special Elite', 'Courier Prime', 'Courier New', cursive;
  font-size: 1.2rem;
  color: var(--pp-ink);
  line-height: 1;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}
#playerProfileSection .seks-rest {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.68rem;
  color: var(--pp-ink-faded);
  letter-spacing: 1.5px;
  font-weight: bold;
  text-transform: uppercase;
  align-self: flex-end;
  padding-bottom: 0.15rem;
}

/* ── Unified distribution strip (mirror of character-creation) ── */
#playerProfileSection .seks-distribution-block {
  margin: 1rem 0 0 0;
}
#playerProfileSection .seks-distribution-label {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.65rem;
  color: var(--pp-ink-light);
  letter-spacing: 2.5px;
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
#playerProfileSection .seks-distribution-tally {
  color: var(--pp-ink);
  letter-spacing: 1.5px;
}
/* Provenance under the ratio strip — where the numbers come from.
   Typed annotation voice: small, muted, dotted rule above. */
#playerProfileSection .seks-provenance {
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px dotted rgba(142, 127, 127, 0.4);
}
#playerProfileSection .seks-prov-line {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.72rem;
  letter-spacing: 1.2px;
  color: var(--pp-ink-muted);
  line-height: 1.7;
}
#playerProfileSection .seks-prov-num {
  color: var(--pp-ink-faded);
  font-weight: bold;
}

/* ── The attribute ledger slip ────────────────────────────────
   FIELD ADJUSTMENTS is a door: hover it and the paper trail
   unfolds — one typed line per gain, source and game date. Same
   slip language as the attribute hints. */
#playerProfileSection .seks-prov-ledger { position: relative; cursor: help; }
#playerProfileSection .seks-ledger-slip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: 340px;
  background: var(--pp-paper-light, #F2EDDF);
  border: 1px solid var(--pp-border-strong);
  border-top: 3px solid var(--pp-red);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  padding: 0.55rem 0.7rem;
  transform: rotate(-0.3deg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 20;
}
#playerProfileSection .seks-prov-ledger:hover .seks-ledger-slip {
  opacity: 1;
  visibility: visible;
  transition-delay: 0.2s;
}
#playerProfileSection .seks-ledger-row {
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  line-height: 1.55;
  color: var(--pp-ink-faded);
  border-bottom: 1px dotted rgba(142, 127, 127, 0.3);
  padding: 0.12rem 0;
}
#playerProfileSection .seks-ledger-row:last-child { border-bottom: none; }
#playerProfileSection .seks-ledger-amt {
  color: var(--pp-red);
  font-weight: bold;
  letter-spacing: 1px;
  margin-right: 0.4rem;
}
#playerProfileSection .seks-ledger-src { color: var(--pp-ink-faded); }
#playerProfileSection .seks-ledger-older,
#playerProfileSection .seks-ledger-empty {
  font-size: 0.7rem;
  font-style: italic;
  color: var(--pp-ink-muted);
}

/* ── Attribute hint cards ─────────────────────────────────────
   The native browser tooltip broke the paper; this is the file's
   own annotation: a small paper slip that unfolds above the box
   on hover — dossier palette, red classification edge, typed
   voice. Pure CSS (content from data-hint), slight delay so it
   reads as "held", not "brushed". */
#playerProfileSection .attr-box { position: relative; }
#playerProfileSection .attr-box[data-hint]::after {
  content: attr(data-hint);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) rotate(-0.4deg);
  width: 280px;
  background: var(--pp-paper-light, #F2EDDF);
  border: 1px solid var(--pp-border-strong);
  border-top: 3px solid var(--pp-red);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  padding: 0.6rem 0.75rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8rem;
  font-weight: normal;
  letter-spacing: 0.5px;
  line-height: 1.5;
  text-transform: none;
  text-align: left;
  color: var(--pp-ink-faded);
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 20;
}
/* the pin: a small paper arrow under the slip */
#playerProfileSection .attr-box[data-hint]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 9px; height: 9px;
  background: var(--pp-paper-light, #F2EDDF);
  border-right: 1px solid var(--pp-border-strong);
  border-bottom: 1px solid var(--pp-border-strong);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 21;
}
#playerProfileSection .attr-box[data-hint]:hover::after,
#playerProfileSection .attr-box[data-hint]:hover::before {
  opacity: 1;
  visibility: visible;
  transition-delay: 0.25s;
}

/* P2-10 — each attribute box wears its ceiling: the big number is
   the value, the small grey " / 100" is the scale. */
#playerProfileSection .attr-box-cap {
  font-size: 0.55em;
  font-weight: normal;
  color: var(--pp-ink-muted);
  letter-spacing: 1px;
}
#playerProfileSection .seks-distribution {
  display: flex;
  height: 14px;
  border: 1px solid var(--pp-border-strong);
  background: var(--pp-bar-bg);
  overflow: hidden;
}
#playerProfileSection .seks-seg {
  height: 100%;
  transition: width 0.35s ease;
}
#playerProfileSection .seks-seg.strength  { background: #8B0000; }
#playerProfileSection .seks-seg.endurance { background: #6b6040; }
#playerProfileSection .seks-seg.knowledge { background: #c4a87a; }
#playerProfileSection .seks-seg.seduce    { background: #8b3a5a; }
#playerProfileSection .seks-distribution-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.62rem;
  color: var(--pp-ink-light);
  letter-spacing: 1.5px;
  font-weight: bold;
}
#playerProfileSection .seks-distribution-legend i.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border: 1px solid var(--pp-border-strong);
  margin-right: 4px;
  vertical-align: -1px;
}
#playerProfileSection .seks-distribution-legend i.dot.strength  { background: #8B0000; }
#playerProfileSection .seks-distribution-legend i.dot.endurance { background: #6b6040; }
#playerProfileSection .seks-distribution-legend i.dot.knowledge { background: #c4a87a; }
#playerProfileSection .seks-distribution-legend i.dot.seduce    { background: #8b3a5a; }

#playerProfileSection .attr-box-val {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--pp-ink);
  line-height: 1;
  letter-spacing: 1px;
}

/* ====== HATCHED BARS (dossier metric-bar style) ====== */
#playerProfileSection .hbar-row {
  display: flex;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px dotted rgba(142, 127, 127, 0.25);
  font-size: 0.78rem;
}

#playerProfileSection .hbar-row:last-child {
  border-bottom: none;
}

#playerProfileSection .hbar-name {
  font-size: 0.75rem;
  color: var(--pp-ink-faded);
  letter-spacing: 0.5px;
  width: 150px;
  flex-shrink: 0;
  text-transform: uppercase;
  font-weight: bold;
}

#playerProfileSection .hbar-wrap {
  flex: 1;
  height: 12px;
  background: var(--pp-bar-bg);
  border: 1px solid var(--pp-border-strong);
  border-radius: 0;
  overflow: hidden;
  position: relative;
}

#playerProfileSection .hbar-fill {
  height: 100%;
  position: relative;
  transition: width 0.4s ease;
}

/* Diagonal hatch overlay — same pattern as dossier .pb stripe */
#playerProfileSection .hbar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg,
    transparent, transparent 4px,
    rgba(235, 230, 216, 0.28) 4px, rgba(235, 230, 216, 0.28) 6px);
}

/* Bar color variants — dossier metric-bar palette */
#playerProfileSection .hbar-fill.green  { background: #4a5d4a; }
#playerProfileSection .hbar-fill.yellow { background: #6b6040; }
#playerProfileSection .hbar-fill.red    { background: #5d4a4a; }
#playerProfileSection .hbar-fill.blue   { background: #4a4a5d; }
#playerProfileSection .hbar-fill.purple { background: #5d4a5d; }
#playerProfileSection .hbar-fill.teal   { background: #4a5d5d; }
#playerProfileSection .hbar-fill.pink   { background: #5d4a55; }

#playerProfileSection .hbar-val {
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--pp-ink);
  letter-spacing: 1px;
  width: 50px;
  text-align: right;
  flex-shrink: 0;
  margin-left: 0.6rem;
}

/* ====== MULTI-COLUMN LAYOUTS ====== */
#playerProfileSection .cols-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

#playerProfileSection .cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ====== DATA ROWS (dossier .e style) ====== */
#playerProfileSection .drow {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px dotted rgba(142, 127, 127, 0.25);
  font-size: 0.8rem;
  line-height: 1.5;
}

#playerProfileSection .drow:last-child {
  border-bottom: none;
}

#playerProfileSection .drow-key {
  color: var(--pp-ink-faded);
  letter-spacing: 0.5px;
}

#playerProfileSection .drow-val {
  font-weight: bold;
  color: var(--pp-ink);
  text-align: right;
  letter-spacing: 0.5px;
}

#playerProfileSection .drow-val.green { color: var(--pp-green); }
#playerProfileSection .drow-val.red   { color: var(--pp-red); }
#playerProfileSection .drow-val.muted { color: var(--pp-ink-muted); }

/* ====== BOTTOM BAR ====== */
#playerProfileSection .bottom-bar {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px dashed var(--pp-border-strong);
  position: relative;
}

#playerProfileSection .btn-action {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.78rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: bold;
  padding: 0.7rem 2rem;
  border: 1px solid;
  cursor: pointer;
  transition: all 0.2s;
  background: transparent;
}

#playerProfileSection .btn-primary {
  background: var(--pp-ink);
  border-color: var(--pp-ink);
  color: var(--pp-paper);
}

#playerProfileSection .btn-primary:hover {
  background: var(--pp-ink-faded);
  border-color: var(--pp-ink-faded);
}

#playerProfileSection .btn-secondary {
  background: transparent;
  border-color: var(--pp-red);
  color: var(--pp-red);
}

#playerProfileSection .btn-secondary:hover {
  background: var(--pp-red-light);
}

/* ====== STAMP (corner-stamp / "Top Secret" red rotated stamp) ====== */
#playerProfileSection .stamp {
  position: absolute;
  bottom: 0.6rem;
  right: 0;
  width: 90px;
  height: 90px;
  border: 2.5px solid var(--pp-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-12deg);
  opacity: 0.45;
  pointer-events: none;
}

#playerProfileSection .stamp-text {
  font-size: 0.7rem;
  font-weight: bold;
  color: var(--pp-red);
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.2;
}

/* ====== SKILLS TAB ====== */
#playerProfileSection .skills-layout {
  display: flex;
  gap: 20px;
  min-height: 520px;
}

#playerProfileSection .skills-sidebar {
  width: 160px;
  flex-shrink: 0;
}

#playerProfileSection .skills-sidebar .dcard {
  height: 100%;
}

#playerProfileSection .skills-sidebar .dcard-header {
  font-size: 10px;
  letter-spacing: 1.5px;
}

#playerProfileSection .skills-sidebar .dcard-body {
  padding: 8px 10px;
  overflow-y: auto;
}

/* Slot labels */
#playerProfileSection .slot-label {
  font-size: 8px;
  color: var(--pp-ink-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 3px;
  border-bottom: 1px dashed var(--pp-border);
  padding-bottom: 3px;
}

/* Skill drop slots — empty state */
#playerProfileSection .skill-drop-slot {
  border: 2px dashed var(--pp-border);
  padding: 10px 8px;
  text-align: center;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Courier New', Courier, monospace;
  position: relative;
  background: rgba(255,255,255,0.03);
}

#playerProfileSection .skill-drop-slot:hover {
  border-color: var(--pp-ink-light);
  background: rgba(0,0,0,0.02);
}

/* Filled slot state — applied by skills-system.js */
#playerProfileSection .skill-drop-slot.filled {
  border-style: solid;
  border-color: var(--pp-border-strong);
  background: rgba(0,0,0,0.02);
}

#playerProfileSection .skill-drop-slot.filled.equipped {
  border-color: var(--pp-green);
}

#playerProfileSection .skill-drop-slot .skill-icon {
  font-size: 16px;
  margin-bottom: 2px;
  display: block;
}

#playerProfileSection .skill-drop-slot .skill-name {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.3;
  color: var(--pp-ink-faded);
}

#playerProfileSection .skill-drop-slot .skill-level {
  font-size: 10px;
  color: var(--pp-ink-light);
}

#playerProfileSection .skill-drop-slot .empty-slot-text {
  color: var(--pp-ink-muted);
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Skills main area */
#playerProfileSection .skills-main {
  flex: 1;
  min-width: 0;
}

#playerProfileSection .skills-title-area {
  text-align: center;
  margin-bottom: 16px;
}

/* Skills tab title block — mirrors the dossier page-title / page-subtitle */
#playerProfileSection .skills-classified {
  font-size: 0.7rem;
  color: var(--pp-red);
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: bold;
  opacity: 1;
}

#playerProfileSection .skills-title {
  font-weight: bold;
  font-size: 1.4rem;
  color: var(--pp-ink);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin: 0.3rem 0;
  line-height: 1.2;
}

#playerProfileSection .skills-meta {
  font-size: 0.7rem;
  color: var(--pp-ink-light);
  letter-spacing: 1.5px;
  font-weight: bold;
}

#playerProfileSection .skills-points-value {
  color: var(--pp-green);
  font-size: 14px;
  font-weight: 700;
}

/* Category tabs */
#playerProfileSection .skills-cat-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* Skill category tabs mirror the dossier .media-tabs strip */
#playerProfileSection .dossier-skill-tab {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: bold;
  padding: 0.55rem 1.2rem;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  background: none;
  color: var(--pp-ink-light);
  cursor: pointer;
  transition: all 0.2s;
}

#playerProfileSection .dossier-skill-tab:hover {
  background: none;
  color: var(--pp-ink);
}

#playerProfileSection .dossier-skill-tab.active {
  background: none;
  color: var(--pp-ink);
  border-bottom-color: var(--pp-red);
}

/* Wrap the category-tab strip with a continuous underline */
#playerProfileSection .skills-cat-tabs {
  border-bottom: 2px solid var(--pp-border-strong);
}

/* Sub-selectors (occupation, life, casino) */
#playerProfileSection .skills-sub-selector {
  margin-bottom: 16px;
  background: rgba(0,0,0,0.02);
  border: 1px solid var(--pp-border);
  padding: 12px;
}

#playerProfileSection .skills-sub-label {
  font-size: 10px;
  color: var(--pp-ink-light);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

#playerProfileSection .skills-sub-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

#playerProfileSection .occupation-type-tab,
#playerProfileSection .life-subcategory-tab,
#playerProfileSection .physical-subcategory-tab,
#playerProfileSection .casino-game-tab {
  font-family: 'Courier New', Courier, monospace;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
  padding: 6px 14px;
  border: 1px solid var(--pp-border);
  background: none;
  color: var(--pp-ink-light);
  cursor: pointer;
  transition: all 0.15s;
}

#playerProfileSection .occupation-type-tab:hover,
#playerProfileSection .life-subcategory-tab:hover,
#playerProfileSection .physical-subcategory-tab:hover,
#playerProfileSection .casino-game-tab:hover {
  background: rgba(0,0,0,0.03);
}

/* Occupation keeps its archival green — it's a distinctive accent in the
 * skill tree, and the user wants some of that color carried into the
 * dossier palette. Life, Physical and Casino default to ink so they don't compete. */
#playerProfileSection .occupation-type-tab.active {
  background: var(--pp-green);
  color: var(--pp-paper);
  border-color: var(--pp-green);
}

#playerProfileSection .life-subcategory-tab.active,
#playerProfileSection .physical-subcategory-tab.active,
#playerProfileSection .casino-game-tab.active {
  background: var(--pp-ink);
  color: var(--pp-paper);
  border-color: var(--pp-ink);
}

/* Skills pool */
#playerProfileSection .skills-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  min-height: 200px;
}

/* Skill nodes — dynamically created by skills-system.js */
#playerProfileSection .skill-node {
  border: 2px solid var(--pp-border-strong);
  padding: 14px 16px;
  text-align: center;
  background: var(--pp-paper);
  width: 180px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  font-family: 'Courier New', Courier, monospace;
  opacity: 0;
  animation: ppFadeIn 0.3s ease forwards;
}

#playerProfileSection .skill-node:hover:not(.locked) {
  background: rgba(0,0,0,0.03);
  border-color: var(--pp-ink-light);
}

#playerProfileSection .skill-node.locked {
  opacity: 0.45;
  cursor: default;
}

#playerProfileSection .skill-node.locked .tnode-lock-label,
#playerProfileSection .skill-node .tnode-lock-label {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: var(--pp-ink-muted);
  color: var(--pp-paper);
  font-size: 8px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 3px 0;
}

#playerProfileSection .skill-node.unlocked,
#playerProfileSection .skill-node.available.unlocked {
  border-color: var(--pp-green);
  background: var(--pp-green-bg);
}

#playerProfileSection .skill-node.available {
  border-color: var(--pp-gold);
  background: var(--pp-gold-bg);
}

#playerProfileSection .skill-node.available::after {
  content: '+';
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--pp-gold);
}

#playerProfileSection .skill-node .skill-icon,
#playerProfileSection .skill-node .tnode-icon {
  font-size: 26px;
  margin-bottom: 6px;
  display: block;
}

#playerProfileSection .skill-node .skill-title,
#playerProfileSection .skill-node .tnode-name {
  font-size: 11px;
  color: var(--pp-ink);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 4px;
  font-weight: 700;
}

#playerProfileSection .skill-node .skill-description,
#playerProfileSection .skill-node .tnode-desc {
  font-size: 11px;
  color: var(--pp-ink-faded);
  line-height: 1.3;
  margin-bottom: 4px;
  font-style: italic;
}

#playerProfileSection .skill-node .skill-level-display,
#playerProfileSection .skill-node .tnode-lvl {
  font-size: 10px;
  color: var(--pp-ink-muted);
  letter-spacing: 1px;
}

/* Skill connections */
#playerProfileSection .skill-connections,
#playerProfileSection svg.skill-connections {
  pointer-events: none !important;
  z-index: 0;
}

/* Skills tree area */
#playerProfileSection .skills-tree-title {
  color: var(--pp-red);
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 16px;
}

#playerProfileSection .skills-tree-area {
  padding: 20px;
  background: rgba(0,0,0,0.02);
  border: 2px solid var(--pp-border-strong);
}

#playerProfileSection .skills-stats-footer {
  background: var(--pp-header-bg);
  color: var(--pp-paper-light);
  padding: 12px;
  margin-top: 10px;
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 12px;
}

/* ====== SKILL POPUP OVERLAY ====== */
#playerProfileSection .popup-overlay,
.skill-popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,18,14,0.6);
  z-index: 1000001;
  align-items: center;
  justify-content: center;
}

#playerProfileSection .popup-overlay.open,
.skill-popup-overlay.open {
  display: flex;
}

/* ====== POINTER EVENTS ====== */
#playerProfileSection > * {
  pointer-events: auto !important;
}

#playerProfileSection .content-area,
#playerProfileSection .page-tabs,
#playerProfileSection .page-content,
#playerProfileSection #skillsPage {
  pointer-events: auto !important;
}

#playerProfileSection button,
#playerProfileSection .page-tab,
#playerProfileSection .skill-node,
#playerProfileSection .skill-drop-slot,
#playerProfileSection .dossier-skill-tab,
#playerProfileSection .occupation-type-tab,
#playerProfileSection .life-subcategory-tab,
#playerProfileSection .physical-subcategory-tab,
#playerProfileSection .casino-game-tab,
#playerProfileSection .btn-action,
#playerProfileSection .pp-close-btn {
  pointer-events: auto !important;
  cursor: pointer !important;
  position: relative;
  z-index: 10;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 800px) {
  #playerProfileSection .cols-3 { grid-template-columns: 1fr; }
  #playerProfileSection .cols-2 { grid-template-columns: 1fr; }
  #playerProfileSection .attr-boxes { grid-template-columns: 1fr 1fr; }
  #playerProfileSection .form-grid { grid-template-columns: 1fr; }
  #playerProfileSection .id-layout { flex-direction: column; }
  #playerProfileSection .page-tabs { flex-wrap: wrap; }
  #playerProfileSection .page-tab { padding: 10px 14px; font-size: 9px; }
  #playerProfileSection .skills-layout { flex-direction: column; }
  #playerProfileSection .skills-sidebar { width: 100%; }
  #playerProfileSection .hbar-name { width: 120px; }
}

@media (max-width: 480px) {
  #playerProfileSection .attr-boxes { grid-template-columns: 1fr; }
  #playerProfileSection .pp-title { font-size: 10px; letter-spacing: 3px; }
  #playerProfileSection .content-area { padding: 16px; }
}

/* ====== LEGACY COMPATIBILITY ====== */
/* Skills system control button used in skills close */
#playerProfileSection .control-button {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.78rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: bold;
  padding: 0.7rem 1.6rem;
  border: 1px solid var(--pp-ink);
  cursor: pointer;
  transition: all 0.2s;
  background: var(--pp-ink);
  color: var(--pp-paper);
}

#playerProfileSection .control-button:hover {
  background: var(--pp-ink-faded);
  border-color: var(--pp-ink-faded);
}

#playerProfileSection .control-button.secondary {
  background: transparent;
  border-color: var(--pp-red);
  color: var(--pp-red);
}

#playerProfileSection .control-button.secondary:hover {
  background: var(--pp-red-light);
}

/* Classified stamp in skills area */
#playerProfileSection .skill-classification {
  position: absolute;
  top: -8px;
  right: -5px;
  background: var(--pp-red);
  color: white;
  padding: 2px 6px;
  font-size: 8px;
  font-weight: bold;
  transform: rotate(15deg);
  border-radius: 2px;
}

/* ──────────────────────────────────────────────────────────────────
   CHARACTER PANEL — RESTRICTED MODE
   While `#playerProfileSection.character-restricted` is on, the
   panel limits the player to Personal Information and a trimmed
   Status & Attributes page. Used in PART XXIV onward until the
   world fully unlocks. Remove the class to restore full access.
   ────────────────────────────────────────────────────────────── */

/* Hide the tabs the player can't browse yet — Financial Records,
   Medical Records, Skills Assessment. The two visible tabs become
   Personal Information + Status & Attributes. */
#playerProfileSection.character-restricted .page-tab[onclick*="financial"],
#playerProfileSection.character-restricted .page-tab[onclick*="medical"],
#playerProfileSection.character-restricted .page-tab[onclick*="skills"] {
  display: none !important;
}

/* In Status & Attributes, hide the Security Clearance Status card
   entirely — only the Daily Status Report card stays visible. */
#playerProfileSection.character-restricted #statusPage .cols-2 .dcard:nth-of-type(2) {
  display: none !important;
}

/* In Daily Status Report, hide rows the player hasn't earned yet.
   Visible: Stamina Level, Stress Management, Personal Grooming.
   Hidden: Urge (row 3), Physical Condition (row 5), Ideological
   Balance (row 6). nth-child indexes are 1-based on .hbar-row
   siblings inside .dcard-body. */
#playerProfileSection.character-restricted #statusPage .cols-2 .dcard:nth-of-type(1) .dcard-body .hbar-row:nth-child(3),
#playerProfileSection.character-restricted #statusPage .cols-2 .dcard:nth-of-type(1) .dcard-body .hbar-row:nth-child(5),
#playerProfileSection.character-restricted #statusPage .cols-2 .dcard:nth-of-type(1) .dcard-body .hbar-row:nth-child(6) {
  display: none !important;
}

/* The Status & Attributes bottom bar has Save Profile + Export Data
   buttons; the Save Profile button shows the gold reveal even with
   the trimmed view, which feels OK. If those should also lock,
   uncomment the rule below. */
/*
#playerProfileSection.character-restricted #statusPage .bottom-bar .btn-action {
  pointer-events: none;
  opacity: 0.4;
}
*/

/* On the Personal Information page, the SKILLS SECTION button at
   the bottom links to the locked Skills tab — disable it so the
   player can't bypass the lock. */
#playerProfileSection.character-restricted #personalPage .control-button.secondary,
#playerProfileSection.character-restricted #personalPage .control-button[onclick*="Skills"],
#playerProfileSection.character-restricted #personalPage .control-button[onclick*="skills"] {
  pointer-events: none;
  opacity: 0.4;
  cursor: not-allowed;
}
