/* Profile page: character panel on the left, actions across the top (icons that open to their names), panels below.
   Applies once the characters are loaded (#profile-app.cs-mode). */
:root { --cs-nav-base: var(--bele-header-h, 76px); --profile-alerts-h: 0px; --cs-actions-only-h: 96px; --cs-nav: var(--cs-nav-base); }
/* Stack, top to bottom: site header, the action tabs (sub nav), then the alerts shelf. --cs-actions-h = tabs + shelf. */

/* Alerts from any profile panel share one sticky shelf immediately below the site header. */
.profile-alerts { position: sticky; top: calc(var(--cs-nav) + var(--cs-actions-only-h)); z-index: 39; background: rgba(7,9,11,.97); backdrop-filter: blur(12px); }
.profile-alerts:not(:has(.anvil-alert, .profile-section-alert)) { display: none; }
.profile-alerts-inner { width: min(100% - 32px, 1500px); max-height: min(38vh, 340px); overflow-y: auto; margin: 0 auto; }
.profile-alerts-inner .anvil-alert-stack { margin: 0; }
.profile-alerts-inner .anvil-alert-stack:empty { display: none; }
.profile-alerts-inner .anvil-alert { border-radius: 0; margin: 0 0 4px; }
.profile-section-alert { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 4px; border: 1px solid rgba(110,196,174,.55); background: #10221f; color: #d2ece5; font-size: .84rem; line-height: 1.4; }
.profile-section-alert.bad { border-color: #bd685a; background: #2a1717; color: #f3c4b8; }
.profile-section-alert::before { content: '✧'; flex: none; color: currentColor; }
.profile-alert-mirrored { display: none !important; }
@media (max-width: 600px) { .profile-alerts-inner { width: 100%; max-height: 42vh; } .profile-section-alert { padding: 9px 12px; } }

#profile-app.cs-mode {
  display: grid; grid-template-columns: 340px minmax(0, 1fr); column-gap: 26px; align-items: start;
}
body:has(#profile-app.cs-mode) .profile-shell { max-width: 1500px; padding-top: 0; }

/* the wrappers around the cards take no box of their own: their children are placed on the page grid */
#profile-app.cs-mode #linked-app,
#profile-app.cs-mode .cs-shell,
#profile-app.cs-mode .char-grid,
#profile-app.cs-mode .char-card { display: contents; }
#profile-app.cs-mode .char-card.cs-off { display: none; }

/* placement */
#profile-app.cs-mode .cs-side { grid-column: 1; grid-row: 1 / span 13; }
#profile-app.cs-mode .cs-actions { grid-column: 2; grid-row: 1; }
#profile-app.cs-mode > .profile-alerts { grid-column: 2; grid-row: 2; }
#profile-app.cs-mode .cs-panels { grid-column: 2; grid-row: 3; min-width: 0; }
#profile-app.cs-mode .thank-you { grid-column: 2; grid-row: 4; }
#profile-app.cs-mode .profile-hero { grid-column: 2; grid-row: 5; margin-top: 18px; }
#profile-app.cs-mode #link-panel { grid-column: 2; grid-row: 6; }
#profile-app.cs-mode .cs-content { grid-column: 2; grid-row: 7; min-width: 0; }

/* the left panel stays in view under the site nav */
.cs-side {
  position: sticky; top: calc(var(--cs-nav) + 10px); align-self: start;
  margin-top: 8px; padding: 14px 16px 16px; border: 1px solid var(--line-strong, rgba(189,145,79,.3));
  background: linear-gradient(160deg, color-mix(in srgb, var(--t, #8d6b3a) 14%, transparent), transparent 55%), rgba(14,17,19,.94);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.cs-bust { position: relative; margin: -4px -6px 10px; border-radius: 6px; overflow: hidden; min-height: 150px;
  background: radial-gradient(ellipse at 50% 38%, rgba(70,214,168,.16), rgba(0,0,0,.55) 78%); }
.cs-bust-canvas { display: block; width: min(100%, 308px); height: 236px; object-fit: cover; margin: 0 auto; cursor: grab; touch-action: none; }
.cs-bust-canvas:active { cursor: grabbing; }
.cs-bust-ph { display: block; width: 56px; height: 56px; margin: 46px auto; border-radius: 50%; border: 2px solid rgba(255,255,255,.12); border-top-color: rgba(70,214,168,.8); animation: cs-spin 1s linear infinite; }
@keyframes cs-spin { to { transform: rotate(360deg); } }
.cs-bust-ctl { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; padding: 6px 4px 8px; }
.cs-bust-ctl button, .cs-bust-ctl select { padding: 3px 10px; border-radius: 999px; border: 1px solid #3a5a52; background: rgba(0,0,0,.35); color: #cfe8df; font-size: .72rem; cursor: pointer; }
.cs-bust-ctl button.on { background: #46d6a8; border-color: #46d6a8; color: #04140e; font-weight: 600; }
.cs-side .sheet-abilities { grid-template-columns: repeat(3, 1fr); }
.cs-side .sheet-foot { flex-direction: column; align-items: stretch; gap: 8px; }
.cs-side .char-pending:empty { display: none; }

/* the character picker */
.cs-selector { margin: 14px 0 4px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.1); }
.cs-selector-h { margin: 0 0 6px; font: 700 .74rem/1 var(--font-ui, sans-serif); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint, #8b8f8c); }
.cs-pick { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; margin: 0 0 4px; padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.08); border-radius: 4px; background: rgba(0,0,0,.22); color: var(--ink-bone, #e6dfd3); cursor: pointer; font: inherit; text-align: left; }
.cs-pick:hover { border-color: rgba(70,214,168,.5); }
.cs-pick.on { border-color: #46d6a8; background: rgba(70,214,168,.12); }
.cs-pick-name { font-weight: 600; }
.cs-pick-meta { font: 500 .74rem/1 var(--font-mono, monospace); color: var(--ink-faint, #8b8f8c); white-space: nowrap; }
.cs-pick-meta i { font-style: normal; color: #e0b070; margin-right: 6px; }

/* the actions: one row of fixed-size buttons, icon over a short name - nothing resizes or moves on hover */
.cs-actions {
  position: sticky; top: var(--cs-nav); z-index: 40; display: flex; flex-wrap: nowrap; gap: 8px; align-items: stretch; container-type: inline-size;
  margin: 0 0 12px; padding: 10px 4px; background: rgba(8,10,11,.95); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-strong, rgba(189,145,79,.3));
}
.cs-actions .act {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  flex: 1 1 0; min-width: 0; max-width: 150px; min-height: 74px; padding: 8px 4px 7px; border-radius: 8px; transform: none; text-align: center; cursor: grab;
}
.cs-actions .act:hover, .cs-actions .act:focus-visible, .cs-actions .act:active { transform: none; }
.cs-actions .act:active { cursor: grabbing; }
.cs-actions .act::after { content: attr(data-short); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 .74rem/1.1 var(--font-ui, sans-serif); letter-spacing: .02em; color: var(--ink-bone, #e6dfd3); }
.cs-actions .act-ic { width: 34px; height: 34px; }
.cs-actions .act-txt, .cs-actions .act-open { display: none; }
.cs-actions .act-cost { position: static; padding: 1px 6px; font-size: .66rem; border-radius: 10px; }
.cs-actions .act[aria-expanded="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 24%, rgba(15,12,8,.7)); }
.cs-actions .act[aria-expanded="true"]::after { color: #fff; }
.cs-actions .anvil-badge { display: none; }
.cs-actions .act.anvil-waiting .act-ic { box-shadow: 0 0 0 2px #e08a3c, 0 0 14px rgba(224,138,60,.7); }

/* sparks for the click effects are drawn over the whole viewport */
.cs-panels .fx-layer { position: fixed; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }

/* panels open full width on the right */
.cs-panels .forge-slot:not([hidden]) { margin: 0 0 18px; }

@media (max-width: 1000px) {
  #profile-app.cs-mode { display: block; }
  #profile-app.cs-mode .cs-side { position: static; max-height: none; }
  #profile-app.cs-mode .cs-actions { display: flex; }
  #profile-app.cs-mode #linked-app, #profile-app.cs-mode .cs-shell { display: block; }
  #profile-app.cs-mode .char-grid, #profile-app.cs-mode .char-card { display: contents; }
}

/* reordering */
.cs-actions .act-dragging { opacity: .45; }
.cs-actions .act-drop-before { box-shadow: -4px 0 0 #46d6a8; }
.cs-actions .act-drop-after { box-shadow: 4px 0 0 #46d6a8; }
/* narrow rows: smaller icons, then icon only */
@container (max-width: 640px) { .cs-actions .act-ic { width: 28px; height: 28px; } .cs-actions .act::after { font-size: .66rem; } }
@container (max-width: 480px) { .cs-actions .act::after { display: none; } .cs-actions .act { min-height: 56px; } .cs-actions .act-cost { display: none; } }

/* the left panel never scrolls; when the window is too short to hold it beside the page it simply scrolls away with it */
.cs-side.cs-tall { position: static; }

/* the mercenary shown in place of the character */
.cs-side.cs-side-merc > .sheet-head, .cs-side.cs-side-merc > .sheet-rule, .cs-side.cs-side-merc > .sheet-class,
.cs-side.cs-side-merc > .sheet-vitals, .cs-side.cs-side-merc > .sheet-abilities { display: none; }
.cs-merc[hidden] { display: none; }
.cs-merc-back { width: 100%; margin: 10px 0 0; padding: 7px 10px; border: 1px solid rgba(255,255,255,.14); border-radius: 4px; background: rgba(0,0,0,.25);
  color: var(--ink-bone, #e6dfd3); cursor: pointer; font: inherit; font-size: .82rem; }
.cs-merc-back:hover { border-color: #46d6a8; }

/* Sell-swords: its tab row (Gear, Build, Appearance, AI, Finances) sits first, directly under the action buttons, and stays there */
#profile-app.cs-mode .sellswords { display: flex; flex-direction: column; }
#profile-app.cs-mode .sellswords > .sw-tabs {
  order: -10; position: sticky; top: calc(var(--cs-nav) + var(--cs-actions-h, 96px)); z-index: 35;
  margin: 0 0 14px; background: rgba(8,10,11,.97); box-shadow: 0 8px 14px rgba(0,0,0,.35);
}

/* archive */
.char-archive { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 7px 10px; border: 1px solid rgba(143,176,200,.4);
  border-radius: 4px; background: rgba(143,176,200,.08); color: #a9c4d6; cursor: pointer; font: 600 .72rem/1 var(--font-ui, sans-serif); letter-spacing: .1em; text-transform: uppercase; }
.char-archive:hover { border-color: #a9c4d6; background: rgba(143,176,200,.16); }
.char-archive svg { width: 15px; height: 15px; }
.cs-archived-btn { width: 100%; margin: 6px 0 0; padding: 7px 10px; border: 1px dashed rgba(143,176,200,.45); border-radius: 4px; background: transparent;
  color: #a9c4d6; cursor: pointer; font: inherit; font-size: .8rem; }
.cs-archived-btn:hover { border-style: solid; }
.cs-archived { margin: 0 0 18px; padding: 14px 16px; border: 1px solid rgba(143,176,200,.35); background: rgba(14,20,24,.9); }
.cs-archived h3 { margin: 0 0 4px; }
.cs-archived-note { margin: 0 0 10px; color: var(--ink-faint, #8b8f8c); font-size: .84rem; }
.cs-archived-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 10px; margin: 0 0 6px;
  border: 1px solid rgba(255,255,255,.08); border-radius: 4px; background: rgba(0,0,0,.25); }
.cs-archived-row small { display: block; color: var(--ink-faint, #8b8f8c); }
#profile-app.cs-mode .cs-archived { grid-column: 2; }

/* class line: the text takes one line with an ellipsis, the pin is just an icon at the end */
.cs-side .sheet-class { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.cs-side .sheet-class-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-side .char-pin { flex: 0 0 auto; margin-left: 0; width: 28px; height: 28px; padding: 0; justify-content: center; border-radius: 50%; }
.cs-side .char-pin svg { width: 15px; height: 15px; }

/* Shop: direct items and services at the top */
.shop-direct { margin: 0 0 20px; padding: 14px 16px; border: 1px solid rgba(215,174,88,.35); background: rgba(215,174,88,.05); }
.shop-direct h4 { margin: 0 0 10px; font: 700 .8rem/1 var(--font-ui, sans-serif); letter-spacing: .14em; text-transform: uppercase; color: #d7ae58; }
.shop-direct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.shop-direct-card { display: flex; flex-direction: column; gap: 10px; padding: 16px 16px 14px; border-radius: 6px; position: relative; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--c) 38%, transparent);
  background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--c) 16%, transparent), transparent 60%), linear-gradient(180deg, rgba(255,255,255,.03), rgba(0,0,0,.28));
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 6px 18px rgba(0,0,0,.28); transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.shop-direct-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 70%, transparent); box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 10px 24px rgba(0,0,0,.4); }
.shop-direct-head { display: flex; align-items: center; gap: 12px; }
.shop-direct-head b { font-size: 1.05rem; line-height: 1.2; letter-spacing: .01em; }
.shop-direct-ic { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: var(--c);
  border: 1.5px solid color-mix(in srgb, var(--c) 70%, transparent); background: color-mix(in srgb, var(--c) 12%, rgba(0,0,0,.35)); box-shadow: 0 0 12px color-mix(in srgb, var(--c) 30%, transparent); }
.shop-direct-ic svg { width: 21px; height: 21px; }
.shop-direct-txt { margin: 0; flex: 1; color: var(--ink-faint, #a2a6a3); font-size: .88rem; line-height: 1.5; }
.shop-direct-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--c) 22%, transparent); }
.shop-direct-price { font-weight: 700; font-size: 1.05rem; color: #ecd9a4; white-space: nowrap; }
.shop-direct-price i { font-style: normal; color: var(--c); margin-right: 2px; }
.shop-direct-price em { font-style: normal; font-weight: 400; font-size: .72rem; color: var(--ink-faint, #8b8f8c); letter-spacing: .06em; text-transform: uppercase; margin-left: 2px; }
.shop-direct-foot .btn { min-width: 84px; }

/* ---- vitals as liquids: hit points are blood, experience is a cosmic, translucent fluid ---- */
.cs-bars { display: grid; gap: 8px; margin: 2px 0 10px; }
.liq { position: relative; height: 26px; border-radius: 13px; overflow: hidden; background: #070405; border: 1px solid rgba(0,0,0,.9);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.85), 0 0 0 1px rgba(255,255,255,.04); isolation: isolate; }
.liq > span { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; padding: 0 8px; white-space: nowrap;
  font: 700 .76rem var(--font-ui, inherit); letter-spacing: .03em; color: #fff; text-shadow: 0 1px 3px #000, 0 0 8px rgba(0,0,0,.9); }
.liq > i { position: absolute; inset: 0 auto 0 0; z-index: 1; border-radius: 13px 0 0 13px; overflow: hidden; transition: width .9s cubic-bezier(.2,.7,.2,1); }

/* blood: dark, viscous, with a wet meniscus along the top and slow clots drifting through it */
.liq-blood > i {
  background:
    radial-gradient(ellipse 22px 9px at 18% 62%, rgba(25,0,2,.65), transparent 70%),
    radial-gradient(ellipse 30px 11px at 63% 40%, rgba(25,0,2,.55), transparent 72%),
    radial-gradient(ellipse 18px 8px at 85% 70%, rgba(255,60,50,.22), transparent 70%),
    linear-gradient(180deg, #ff4a3d 0, #c4121a 18%, #8e0710 52%, #4f0309 100%);
  background-size: 180px 100%, 230px 100%, 150px 100%, 100% 100%;
  animation: liq-ooze 14s linear infinite;
  box-shadow: inset 0 3px 3px rgba(255,170,160,.45), inset 0 -4px 6px rgba(20,0,2,.7), 0 0 12px rgba(160,10,16,.55);
}
.liq-blood > i::before { content: ""; position: absolute; left: 3%; right: 6%; top: 3px; height: 5px; border-radius: 4px;
  background: linear-gradient(90deg, transparent, rgba(255,210,200,.55), transparent); animation: liq-glint 6s ease-in-out infinite; }
.liq-blood > i::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 7px; background: linear-gradient(90deg, transparent, rgba(255,70,60,.8)); }
@keyframes liq-ooze { to { background-position: 180px 0, -230px 0, 150px 0, 0 0; } }
@keyframes liq-glint { 0%, 100% { transform: translateX(-12%); opacity: .55; } 50% { transform: translateX(10%); opacity: 1; } }

/* experience: deep indigo to teal nebula, stars twinkling inside, a slow shimmer sweeping through */
.liq-cosmic { background: radial-gradient(ellipse at 50% 0, #0b0720, #04030c); }
.liq-cosmic > i {
  background:
    radial-gradient(circle 1.2px at 12% 30%, rgba(255,255,255,.95), transparent 60%),
    radial-gradient(circle 1px at 31% 70%, rgba(190,220,255,.9), transparent 60%),
    radial-gradient(circle 1.4px at 54% 38%, rgba(255,255,255,.95), transparent 60%),
    radial-gradient(circle 1px at 72% 74%, rgba(230,200,255,.9), transparent 60%),
    radial-gradient(circle 1.2px at 90% 28%, rgba(255,255,255,.9), transparent 60%),
    radial-gradient(ellipse 60px 16px at 25% 50%, rgba(160,90,255,.55), transparent 70%),
    radial-gradient(ellipse 70px 18px at 70% 55%, rgba(70,200,255,.5), transparent 70%),
    linear-gradient(90deg, rgba(40,18,120,.92), rgba(30,70,190,.82), rgba(110,40,190,.88), rgba(24,130,200,.8), rgba(40,18,120,.92));
  background-size: 140px 100%, 140px 100%, 140px 100%, 140px 100%, 140px 100%, 200px 100%, 260px 100%, 300% 100%;
  animation: liq-nebula 18s linear infinite, liq-twinkle 3.2s ease-in-out infinite alternate;
  box-shadow: inset 0 2px 4px rgba(190,170,255,.45), inset 0 -3px 6px rgba(10,5,50,.7), 0 0 14px rgba(110,80,255,.5), 0 0 26px rgba(40,170,255,.18);
}
.liq-cosmic > i::before { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.28) 48%, transparent 66%);
  background-size: 220% 100%; animation: liq-sheen 5.5s ease-in-out infinite; mix-blend-mode: screen; }
.liq-cosmic > i::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 8px; background: linear-gradient(90deg, transparent, rgba(200,170,255,.85)); filter: blur(1px); }
@keyframes liq-nebula { to { background-position: -140px 0, 140px 0, -140px 0, 140px 0, -140px 0, 200px 0, -260px 0, 300% 0; } }
@keyframes liq-twinkle { from { filter: brightness(.92) saturate(1); } to { filter: brightness(1.2) saturate(1.25); } }
@keyframes liq-sheen { from { background-position: 120% 0; } to { background-position: -80% 0; } }
@media (prefers-reduced-motion: reduce) { .liq > i, .liq > i::before { animation: none !important; } }

/* the pin: a lancer on a rearing horse; pinned, it fills with the same cosmic liquid as the experience bar */
.cs-side .char-pin { width: 36px; height: 36px; border-radius: 50%; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.16); color: inherit; }
.char-pin .knight { display: block; width: 24px; height: 24px; background: #a99d86;
  -webkit-mask: url("/images/pin-knight.svg") center / contain no-repeat; mask: url("/images/pin-knight.svg") center / contain no-repeat;
  transition: background-color .25s; }
.char-pin:hover .knight { background: #e4d6b4; }
.char-pin.on { background: radial-gradient(circle at 50% 40%, rgba(70,40,150,.55), rgba(5,3,20,.9)); border-color: rgba(150,120,255,.75);
  box-shadow: 0 0 10px rgba(110,80,255,.55), inset 0 0 8px rgba(60,160,255,.25); }
.char-pin.on .knight {
  background:
    radial-gradient(circle 1px at 20% 30%, #fff, transparent 60%), radial-gradient(circle 1px at 70% 60%, #cfe3ff, transparent 60%),
    radial-gradient(circle 1.2px at 45% 80%, #fff, transparent 60%), radial-gradient(circle 1px at 85% 25%, #f0dcff, transparent 60%),
    radial-gradient(ellipse 14px 8px at 30% 50%, rgba(170,100,255,.9), transparent 70%),
    radial-gradient(ellipse 16px 9px at 75% 55%, rgba(70,210,255,.85), transparent 70%),
    linear-gradient(90deg, #4a2bd0, #2a7bff, #9a4cff, #28b4ff, #4a2bd0);
  background-size: 24px 24px, 24px 24px, 24px 24px, 24px 24px, 36px 24px, 40px 24px, 300% 100%;
  animation: liq-nebula-pin 9s linear infinite, liq-twinkle 2.4s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 3px rgba(140,110,255,.9));
}
@keyframes liq-nebula-pin { to { background-position: -24px 0, 24px 0, -24px 0, 24px 0, 36px 0, -40px 0, 300% 0; } }
@media (prefers-reduced-motion: reduce) { .char-pin.on .knight { animation: none; } }

/* one bar: who is signed in, the Sovereigns balance and the daily earning, and Sign out */
.profile-hero { gap: 18px 28px; flex-wrap: wrap; }
.hero-sov { display: flex; align-items: center; gap: 14px; margin-left: 12px; padding: 4px 0 4px 28px; border-left: 1px solid rgba(255,255,255,.12); flex: 1 1 360px; min-width: 0; }
.hero-sov .sov-label { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint, #8b8f8c); }
.hero-sov .sov-amount { font-size: 2rem; }
.hero-sov .sov-daily { flex: 1 1 200px; max-width: 360px; min-width: 150px; }
@media (max-width: 760px) { .hero-sov { border-left: 0; padding-left: 0; margin-left: 0; flex-basis: 100%; } }

/* transactions: the latest three, the rest in a searchable drop-down */
.pu-all { margin-top: 12px; border: 1px solid var(--line-strong, rgba(189,145,79,.3)); background: rgba(14,17,19,.7); }
.pu-all > summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 10px; }
.pu-all > summary::before { content: "▸"; color: #46d6a8; transition: transform .2s; }
.pu-all[open] > summary::before { transform: rotate(90deg); }
.pu-all > summary small { color: var(--ink-faint, #8b8f8c); font-weight: 400; }
.pu-search { display: block; width: calc(100% - 32px); margin: 0 16px 12px; box-sizing: border-box; padding: 8px 12px; background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.14); border-radius: 4px; color: inherit; font: inherit; }
.pu-all-list { display: grid; gap: 10px; padding: 0 16px 16px; max-height: 70vh; overflow-y: auto; }
.pu-more-note { color: var(--ink-faint, #8b8f8c); font-size: .84rem; margin: 4px 0 0; }

/* artwork icons in the action row */
.cs-actions .act-ic.has-art { width: 52px; height: 52px; border: 0; background: none; box-shadow: none; border-radius: 0; }
.cs-actions .act-ic.has-art img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0,0,0,.55)); transition: transform .2s, filter .2s; }
.cs-actions .act:hover .act-ic.has-art { transform: none; box-shadow: none; }
.cs-actions .act:hover .act-ic.has-art img { transform: scale(1.08); filter: drop-shadow(0 0 8px color-mix(in srgb, var(--c) 70%, transparent)); }
.cs-actions .act { min-height: 88px; }
.cs-actions .act-ledger { margin-left: auto; }
.act-estates { --c: #2fbf8a; }
.act-sellswords { --c: #46d6a8; }

/* the account panel: sign-in line, Sovereigns, then a strip of account figures */
#selected-note { display: none !important; }
.hero-stats { flex: 1 1 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; margin-top: 4px;
  border-top: 1px solid rgba(255,255,255,.1); padding-top: 14px; }
.hero-stat { display: grid; gap: 3px; padding: 4px 14px; border-left: 1px solid rgba(255,255,255,.08); min-width: 0; }
.hero-stat:first-child { border-left: 0; padding-left: 0; }
.hero-stat span { font: 700 .66rem/1 var(--font-ui, sans-serif); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint, #8b8f8c); }
.hero-stat b { font: 600 1.15rem/1.25 var(--font-display, serif); color: var(--ink-bone, #e6dfd3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-stat b small { font: 500 .72rem var(--font-ui, sans-serif); color: var(--ink-faint, #8b8f8c); margin-left: 4px; letter-spacing: 0; }
.hero-stat[data-stat="selected"] b { color: #46d6a8; }
.hero-stat[data-stat="selected"] { grid-column: span 2; }
@media (max-width: 760px) { .hero-stat[data-stat="selected"] { grid-column: span 1; } .hero-stat { border-left: 0; padding-left: 0; } }

/* recent transactions: a pill in the account block that expands into a scrolling list */
.hero-pill { flex: 1 1 100%; margin-top: 2px; }
.pu-pill-box { border: 1px solid rgba(255,255,255,.14); border-radius: 999px; background: rgba(0,0,0,.25); transition: border-radius .2s; }
.pu-pill-box[open] { border-radius: 18px; border-color: rgba(70,214,168,.45); }
.pu-pill-box summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 9px 18px; cursor: pointer; min-width: 0; }
.pu-pill-box summary::-webkit-details-marker { display: none; }
.pu-pill-k { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint, #8b8f8c); white-space: nowrap; }
.pu-pill-last { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; color: #cfd6d2; }
.pu-pill-last b { color: #f3e4c4; font-weight: 600; }
.pu-pill-box summary small { padding: 1px 9px; border-radius: 999px; background: rgba(255,255,255,.08); color: #cfd6d2; }
.pu-chev { width: 8px; height: 8px; border-right: 2px solid #9aa5a0; border-bottom: 2px solid #9aa5a0; transform: rotate(45deg); transition: transform .2s; margin: 0 4px 3px; }
.pu-pill-box[open] .pu-chev { transform: rotate(-135deg); margin-bottom: -3px; }
.pu-pill-body { padding: 0 14px 14px; }
.pu-pill-body .pu-search { width: 100%; box-sizing: border-box; margin-bottom: 10px; background: #0d1a17; border: 1px solid #2f3f39; border-radius: 999px; color: #eaf5f0; padding: .45rem .9rem; font: inherit; }
.pu-pill-body .pu-all-list { display: grid; gap: 10px; max-height: 340px; overflow-y: auto; padding: 0 4px 0 0; scrollbar-width: thin; }
.pu-pill-empty { padding: 9px 18px; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; background: rgba(0,0,0,.2); color: #8b8f8c; font-size: .85rem; }
.pu-pill-empty span { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; margin-right: 8px; }
@media (max-width: 760px) { .pu-pill-k { display: none; } }

/* name and level on one line, race / gender / age / alignment on one line under both */
.cs-side .sheet-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; row-gap: 2px; }
.cs-side .sheet-head > div { display: contents; }
.cs-side .sheet-head .char-name { grid-column: 1; min-width: 0; }
.cs-side .sheet-head .char-level { grid-column: 2; grid-row: 1; }
.cs-side .sheet-head .sheet-sub { grid-column: 1 / -1; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; }
/* armour class sits on the class line */
.cs-side .sheet-ac { flex: 0 0 auto; padding: 2px 9px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(0,0,0,.28);
  font: 500 .92rem/1.2 var(--font-mono); color: var(--ink-bone); white-space: nowrap; }
.cs-side .sheet-ac b { margin-right: 4px; font: 700 .72rem/1 var(--font-ui); letter-spacing: .08em; color: #d8765a; }

.profile-hero[hidden] { display: none !important; }

/* ---- action tabs: a finer button (depth, accent glow, a lit underline on the open one) ---- */
.cs-actions .act {
  --c: var(--ghost, #46d6a8);
  border-radius: 12px; min-height: 92px; padding: 10px 6px 9px; gap: 6px;
  border: 1px solid color-mix(in srgb, var(--c) 30%, rgba(255,255,255,.08));
  background:
    radial-gradient(ellipse 90% 70% at 50% 0%, color-mix(in srgb, var(--c) 20%, transparent), transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(0,0,0,.28)),
    rgba(14,12,9,.82);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), inset 0 -10px 18px rgba(0,0,0,.28), 0 2px 6px rgba(0,0,0,.35);
  transition: border-color .18s, box-shadow .22s, background .22s, filter .18s;
}
.cs-actions .act::before {                     /* the lit underline, shown on the open tab and sweeping in on hover */
  content: ""; position: absolute; left: 18%; right: 18%; bottom: 0; height: 3px; border-radius: 3px 3px 0 0;
  background: var(--c); box-shadow: 0 0 12px var(--c); opacity: 0; transform: scaleX(.3); transition: opacity .2s, transform .25s;
}
.cs-actions .act:hover, .cs-actions .act:focus-visible {
  border-color: color-mix(in srgb, var(--c) 78%, white 6%); filter: brightness(1.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), inset 0 -10px 18px rgba(0,0,0,.2), 0 0 0 1px color-mix(in srgb, var(--c) 35%, transparent), 0 0 20px color-mix(in srgb, var(--c) 28%, transparent);
}
.cs-actions .act:hover::before { opacity: .6; transform: scaleX(.6); }
.cs-actions .act:focus-visible { outline: 2px solid color-mix(in srgb, var(--c) 80%, white); outline-offset: 2px; }
.cs-actions .act:active { filter: brightness(.95); box-shadow: inset 0 3px 10px rgba(0,0,0,.55); }
.cs-actions .act[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--c) 85%, white 5%);
  background:
    radial-gradient(ellipse 100% 80% at 50% 0%, color-mix(in srgb, var(--c) 38%, transparent), transparent 75%),
    linear-gradient(180deg, color-mix(in srgb, var(--c) 14%, rgba(255,255,255,.04)), rgba(0,0,0,.3)),
    rgba(14,12,9,.9);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent), 0 6px 20px color-mix(in srgb, var(--c) 22%, rgba(0,0,0,.5));
}
.cs-actions .act[aria-expanded="true"]::before { opacity: 1; transform: scaleX(1); left: 10%; right: 10%; }
.cs-actions .act[aria-expanded="true"]::after { color: #fff; text-shadow: 0 0 8px color-mix(in srgb, var(--c) 70%, transparent); }
.cs-actions .act::after { font-weight: 650; letter-spacing: .03em; }
.cs-actions .act-ic.has-art img { filter: drop-shadow(0 2px 4px rgba(0,0,0,.6)); }
.cs-actions .act[aria-expanded="true"] .act-ic.has-art img { filter: drop-shadow(0 0 10px color-mix(in srgb, var(--c) 75%, transparent)); transform: scale(1.06); }
@media (prefers-reduced-motion: reduce) { .cs-actions .act, .cs-actions .act::before { transition: none; } }


/* ---- account sub-nav: the flat bar the Community pages use (icon + name on one row, full width, pinned under the site header) ---- */
body:has(#profile-app.cs-mode) { overflow-x: clip; }                                  /* the full-bleed bar must not add a sideways scrollbar */
#profile-app.cs-mode .cs-actions { grid-column: 1 / -1; grid-row: 1; }
#profile-app.cs-mode .cs-side { grid-row: 2 / span 11; }
.cs-actions {
  gap: 0; align-items: stretch; min-height: 48px; padding: 0 max(20px, calc((100vw - 1400px) / 2));
  margin: 0 calc(50% - 50vw) 18px;                                                    /* break out to the window edges, then pad the items back to the page grid */
  background: rgba(6, 8, 10, .97); backdrop-filter: blur(14px);
  border-top: 1px solid rgba(189, 145, 79, .18); border-bottom: 1px solid rgba(189, 145, 79, .32); box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
  overflow-x: auto; scrollbar-width: none;
}
.cs-actions::-webkit-scrollbar { display: none; }
.cs-actions .act {
  --c: var(--ghost, #d7ae58);
  flex: 0 0 auto; flex-direction: row; justify-content: flex-start; align-items: center; gap: 8px; min-width: 0; max-width: none; min-height: 48px; padding: 0 15px;
  border: 0; border-radius: 0; background: none; box-shadow: none; filter: none; color: #aaa198; cursor: pointer; position: relative;
}
.cs-actions .act::after {
  order: 1; content: attr(data-short); display: inline; max-width: none; overflow: visible; color: inherit;
  font: 600 .68rem var(--font-ui, sans-serif); letter-spacing: .09em; text-transform: uppercase; text-shadow: none;
}
.cs-actions .act-cost { order: 2; }
.cs-actions .act-ic, .cs-actions .act-ic.nav-line {
  width: 16px; height: 16px; border: 0; background: none; box-shadow: none; border-radius: 0; display: flex; align-items: center; justify-content: center;
  color: var(--ghost, #d7ae58); opacity: .95; transform: none;
}
.cs-actions .act-ic svg { width: 16px; height: 16px; }
.cs-actions .act:hover .act-ic, .cs-actions .act:hover .act-ic.nav-line { transform: none; box-shadow: none; }
.cs-actions .act::before {                                                            /* the lit underline on the open tab */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 0; background: var(--ghost, #d7ae58); box-shadow: none;
  opacity: 0; transform: none; transition: opacity .15s;
}
.cs-actions .act:hover, .cs-actions .act:focus-visible {
  color: #f3d9a4; background: color-mix(in srgb, var(--ghost, #d7ae58) 9%, transparent); box-shadow: none; filter: none; border: 0;
}
.cs-actions .act:hover::before { opacity: .55; transform: none; }
.cs-actions .act:focus-visible { outline: 2px solid color-mix(in srgb, var(--ghost, #d7ae58) 70%, white); outline-offset: -3px; }
.cs-actions .act:active { filter: none; box-shadow: none; }
.cs-actions .act[aria-expanded="true"] { color: #f3d9a4; background: color-mix(in srgb, var(--ghost, #d7ae58) 14%, transparent); box-shadow: none; border: 0; }
.cs-actions .act[aria-expanded="true"]::before { opacity: 1; transform: none; left: 0; right: 0; }
.cs-actions .act[aria-expanded="true"]::after { color: #f3d9a4; text-shadow: none; }
.cs-actions .act-ledger { margin-left: 0; }
.cs-actions .act-drop-before { box-shadow: inset 3px 0 0 var(--ghost, #d7ae58); }
.cs-actions .act-drop-after { box-shadow: inset -3px 0 0 var(--ghost, #d7ae58); }
.cs-actions .act.anvil-waiting .act-ic { box-shadow: 0 0 0 2px #e08a3c, 0 0 10px rgba(224, 138, 60, .7); border-radius: 50%; }
@media (max-width: 900px) {
  .cs-actions .act { padding: 0 11px; gap: 6px; }
  .cs-actions .act-ic { display: none; }
  .cs-actions .act::after { font-size: .64rem; }
}
