/* Sell-swords panel (js/sellswords.js) */
.sellswords { display: grid; gap: .9rem; }
.sw-roster { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.sw-slot { border: 1px dashed #33574e; border-radius: 8px; padding: .5rem .7rem; background: rgba(0,0,0,.18); display: grid; gap: .1rem; text-align: left; color: #a9d5ca; font: inherit; cursor: pointer; }
.sw-slot.on { border-style: solid; border-color: #3d685d; background: rgba(79,251,208,.07); }
.sw-slot.cur { border-color: #4ffbd0; background: rgba(79,251,208,.18); box-shadow: 0 0 0 1px #4ffbd0 inset; }
.sw-slot.empty:hover { border-color: #e9c98f; }
.sw-slot small { color: #7ba59a; font-size: .72rem; }
.sw-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.sw-name h4 { margin: 0; font-size: 1.15rem; color: #f3e4c4; }
.sw-name span { color: #89b5aa; font-size: .85rem; }
.sw-vitals { display: grid; gap: .45rem; }
.sw-hp { position: relative; height: 1.3rem; border-radius: 5px; background: #2a1c18; overflow: hidden; border: 1px solid #284840; }
.sw-hp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #8c2f24, #d6532f); }
.sw-hp span { position: relative; display: block; text-align: center; font-size: .78rem; line-height: 1.3rem; color: #fff3dc; }
.sw-abil { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .82rem; color: #a9d5ca; }
.sw-abil b { color: #4ffbd0; margin-right: .2rem; }
.sw-gold { font-size: .85rem; color: #a9d5ca; }
.sw-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.sw-danger { color: #e08a74; border-color: #7a3a2c; }
.sw-rename { display: inline-flex; gap: .3rem; margin-left: auto; }
.sw-name-in, .sw-gold-in, .sw-num input { background: #0f1a17; border: 1px solid #284840; border-radius: 5px; color: #f3e4c4; padding: .3rem .5rem; font: inherit; }
.sw-name-in { width: 9rem; }
.sw-tabs { display: flex; gap: .4rem; flex-wrap: wrap; }
.sw-two { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
@media (max-width: 760px) { .sw-two, .sw-roster { grid-template-columns: 1fr; } }
.sw-equip { display: grid; gap: .25rem; margin-bottom: .6rem; }
.sw-eqrow { display: grid; grid-template-columns: 4.2rem 2.6rem 1fr; align-items: center; gap: .5rem; font-size: .8rem; color: #a9d5ca; }
.sw-eqrow em { color: #7ba59a; font-style: normal; }
.sw-pack { display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-start; min-height: 3rem; max-height: 22rem; overflow-y: auto; padding: 4px;
  background: rgba(0,0,0,.25); border: 1px solid #1f3932; border-radius: 6px; }
.sw-item { position: relative; width: 2.6rem; height: 2.6rem; padding: 2px; background: #121d1a; border: 1px solid var(--edge, #284840); border-radius: 5px; cursor: pointer; }
.sw-item:hover { border-color: #e9c98f; }
.sw-item.sel { outline: 2px solid #e9c98f; }
.sw-fit { display: grid; place-items: center; width: 100%; height: 100%; }
.sw-fit-box { position: relative; display: block; max-width: 100%; max-height: 100%; aspect-ratio: var(--r, 1); }
.sw-fit-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; image-rendering: auto; }
.sw-goldbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .85rem; color: #a9d5ca; }
.sw-goldbar small { flex-basis: 100%; color: #7ba59a; }
.sw-gold-in { width: 8rem; }
.sw-tgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .3rem .8rem; }
.sw-use { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin: .5rem 0; font-size: .85rem; }
.sw-nums { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .5rem .9rem; }
.sw-num { display: grid; grid-template-columns: 1fr 5rem 4.5rem; align-items: center; gap: .4rem; font-size: .85rem; color: #a9d5ca; }
.sw-num em { color: #7ba59a; font-style: normal; font-size: .75rem; }
.sw-link { background: none; border: 0; color: #e9c98f; cursor: pointer; text-decoration: underline; font: inherit; padding: 0; }
.sw-savebar { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; margin-top: .8rem; }
.sw-auto { font-size: .85rem; color: #a9d5ca; display: inline-flex; gap: .35rem; align-items: center; }
.sw-cards { margin-bottom: .6rem; }
.sw-ledger { overflow-x: auto; }
.sw-ledger td.num { text-align: right; white-space: nowrap; }
.sw-ledger tr.k-weekly td:nth-child(4), .sw-ledger tr.k-hire td:nth-child(4), .sw-ledger tr.k-revive td:nth-child(4), .sw-ledger tr.k-resurrect td:nth-child(4) { color: #e9c98f; }
.sw-ledger tr.k-weekly_missed td { color: #e08a74; }
.big.sm { font-size: 1.05rem; line-height: 1.4; }
.act-sellswords .act-ic { color: #46d6a8; }

/* creator */
.sw-create { display: grid; gap: .8rem; }
.sw-field { display: grid; gap: .25rem; font-size: .85rem; color: #a9d5ca; }
.sw-field input, .sw-field select { background: #0f1a17; border: 1px solid #284840; border-radius: 5px; color: #f3e4c4; padding: .35rem .5rem; font: inherit; max-width: 22rem; }
.sw-classes { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .5rem; }
.sw-class { display: grid; gap: .1rem; text-align: left; border: 1px solid #284840; border-radius: 8px; background: rgba(0,0,0,.2); color: #a9d5ca; padding: .5rem .65rem; cursor: pointer; font: inherit; }
.sw-class b { color: #f3e4c4; } .sw-class small { color: #7ba59a; } .sw-class em { font-style: normal; font-size: .75rem; color: #e9c98f; }
.sw-class:hover { border-color: #4ffbd0; }
.sw-class.sel { border-color: #4ffbd0; background: rgba(79,251,208,.16); box-shadow: 0 0 0 1px #4ffbd0 inset; }
.sw-look { display: flex; flex-wrap: wrap; gap: .8rem 1.4rem; align-items: flex-end; }
.sw-step { display: inline-flex; align-items: center; gap: .5rem; }
.sw-step button { width: 2rem; height: 2rem; border-radius: 6px; border: 1px solid #284840; background: #0f1a17; color: #f3e4c4; cursor: pointer; font-size: 1.1rem; }
.sw-step b { min-width: 2rem; text-align: center; color: #f3e4c4; } .sw-step em { font-style: normal; color: #7ba59a; font-size: .75rem; }
.sw-palmenu { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .5rem; }
.sw-paltab { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .6rem; border-radius: 999px; border: 1px solid #284840; background: rgba(0,0,0,.2); color: #a9d5ca; cursor: pointer; font: inherit; font-size: .82rem; }
.sw-paltab i { width: 1rem; height: 1rem; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); }
.sw-paltab.sel { border-color: #4ffbd0; background: rgba(79,251,208,.18); }
.sw-pal { display: grid; grid-template-columns: repeat(16, minmax(0, 1.5rem)); gap: 3px; }
.sw-col { aspect-ratio: 1; border-radius: 4px; border: 1px solid rgba(0,0,0,.5); cursor: pointer; padding: 0; }
.sw-col.sel { outline: 2px solid #fff3dc; outline-offset: 1px; }
@media (max-width: 520px) { .sw-pal { grid-template-columns: repeat(8, 1fr); } }

/* equipment grids (every slot, filled or empty) and the selection actions */
.sw-eqgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: .6rem; }
.sw-eqslot { position: relative; aspect-ratio: 1; min-width: 0; border: 1px dashed #284840; border-radius: 6px; background: rgba(0,0,0,.22); display: grid; place-items: center; }
.sw-eqslot em { position: absolute; left: 3px; top: 1px; font-style: normal; font-size: .55rem; color: #52776e; text-transform: uppercase; letter-spacing: .03em; pointer-events: none; }
.sw-eqslot.on { border-style: solid; border-color: #3d685d; }
.sw-eqslot .sw-item { width: 88%; height: 88%; }
.sw-selacts { display: flex; flex-wrap: wrap; gap: .4rem; }
@media (max-width: 520px) { .sw-eqgrid { grid-template-columns: repeat(5, 1fr); } }

/* drag and drop */
.sw-item[draggable="true"] { cursor: grab; }
.sw-item.dragging { opacity: .45; }
.drop-ok { outline: 2px dashed #e9c98f; outline-offset: -2px; background-color: rgba(233,201,143,.1); }

/* appearance tab */
.sw-lookpanel { display: grid; grid-template-columns: 280px minmax(0, 1fr) 190px; gap: 18px; align-items: start; }
@media (max-width: 720px) { .sw-lookpanel { grid-template-columns: 1fr; } }
.sw-lookpre { display: grid; gap: 8px; justify-items: center; padding: 12px; border: 1px solid #1f3932; border-radius: 8px; background: radial-gradient(ellipse at 50% 0, rgba(79,251,208,.18), rgba(0,0,0,.25) 70%); position: sticky; top: 76px; }
.sw-portrait { width: 104px; min-height: 120px; display: grid; place-items: center; border: 1px solid #3d685d; border-radius: 6px; background: #0b1110; padding: 4px; font-size: .7rem; color: #62867d; text-align: center; }
.sw-portrait img { width: 96px; height: auto; border-radius: 3px; }
.sw-prename { font-family: var(--font-display, serif); font-size: 1.05rem; text-align: center; color: #f3e4c4; }
.sw-chips { display: flex; flex-wrap: wrap; gap: 4px 8px; justify-content: center; font-size: .68rem; color: #7ba59a; }
.sw-chips i { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-right: 3px; vertical-align: -2px; border: 1px solid rgba(255,255,255,.3); }
.sw-height { position: relative; width: 100%; height: 90px; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid #284840; }
.sw-figure { width: 26px; border-radius: 13px 13px 4px 4px; background: linear-gradient(#4ffbd0, #7a3a2c); transition: height .2s; }
.sw-ref { position: absolute; left: 6px; right: 6px; bottom: 76%; border-top: 1px dashed rgba(233,201,143,.4); }
.sw-height small { position: absolute; right: 2px; top: 0; color: #7ba59a; font-size: .68rem; }
.sw-lookform { display: grid; gap: .8rem; min-width: 0; }
.sw-namecols { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.sw-namecols .sw-col { width: 1.6rem; height: 1.6rem; aspect-ratio: auto; } .sw-col.none { background: #0f1a17; color: #7ba59a; font-size: .9rem; }
.sw-custcol { display: inline-flex; gap: 6px; align-items: center; font-size: .78rem; color: #7ba59a; margin-left: 6px; } .sw-custcol input { width: 2.2rem; height: 1.6rem; padding: 0; border: 1px solid #284840; background: none; }
.sw-hides { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
.sw-ports { display: flex; flex-wrap: wrap; gap: 5px; max-height: 290px; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; padding: 4px; border: 1px solid #1f3932; border-radius: 6px; background: rgba(0,0,0,.2); }
.sw-ports::-webkit-scrollbar { display: none; }
.sw-port { padding: 2px; border: 1px solid #284840; border-radius: 4px; background: #0b1110; cursor: pointer; line-height: 0; }
.sw-port img { border-radius: 2px; } .sw-port:hover { border-color: #e9c98f; } .sw-port.sel { border-color: #4ffbd0; box-shadow: 0 0 0 2px #4ffbd0; }
.sw-step input[type=range] { width: 8rem; }

.sw-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .5rem; margin-bottom: .6rem; }
.sw-preset { display: grid; gap: .15rem; text-align: left; padding: .5rem .65rem; border: 1px solid #284840; border-radius: 8px; background: rgba(0,0,0,.2); color: #a9d5ca; cursor: pointer; font: inherit; }
.sw-preset b { color: #f3e4c4; } .sw-preset small { color: #7ba59a; font-size: .72rem; line-height: 1.3; } .sw-preset:hover { border-color: #4ffbd0; }

/* the top blocks fill the panel to the right edge */
.sellswords .forge-intro, .sellswords .forge-intro p, .sellswords .est-msg { max-width: none; }
.sellswords .est-msg { box-sizing: border-box; width: 100%; }
/* waiting requests: loud and counted down */
.sw-queue-unused { display: grid; grid-template-columns: auto auto 1fr; gap: 4px 12px; align-items: center; margin: 10px 0 0; padding: 10px 14px; border: 1px solid #e0a43a; border-radius: 8px;
  background: linear-gradient(90deg, rgba(224,164,58,.22), rgba(224,164,58,.08)); color: #ffe2a6; }
.sw-queue b { font-size: 1.05rem; color: #ffcf6e; letter-spacing: .02em; }
.sw-eta { justify-self: end; font-weight: 600; color: #fff3dc; font-variant-numeric: tabular-nums; }
.sw-queue ul { grid-column: 1 / -1; margin: 2px 0 0; padding-left: 1.2rem; font-size: .8rem; color: #e8cf9a; }
.sw-pulse { width: 12px; height: 12px; border-radius: 50%; background: #ffb83a; box-shadow: 0 0 0 0 rgba(255,184,58,.7); animation: swpulse 1.4s infinite; }
@keyframes swpulse { 70% { box-shadow: 0 0 0 10px rgba(255,184,58,0); } 100% { box-shadow: 0 0 0 0 rgba(255,184,58,0); } }
@media (prefers-reduced-motion: reduce) { .sw-pulse { animation: none; } }
/* the two sides of the packs: a divider and big coloured names */
.sw-two { gap: 0; }
.sw-side { padding: 0 16px; min-width: 0; }
.sw-side.merc { padding-left: 0; border-right: 2px solid rgba(233,201,143,.28); }
.sw-side.you { padding-right: 0; }
.sw-sidehead { display: grid; gap: 2px; margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; border-left: 4px solid var(--side, #4ffbd0); background: linear-gradient(90deg, color-mix(in srgb, var(--side, #4ffbd0) 22%, transparent), transparent); }
.sw-sidehead i { font-style: normal; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--side, #4ffbd0); }
.sw-sidehead b { font-family: var(--font-display, serif); font-size: 1.45rem; font-weight: 600; line-height: 1.15; color: var(--side, #f3e4c4); overflow-wrap: anywhere; }
.sw-sidehead span { font-size: .78rem; color: #7ba59a; }
.sw-side.merc { --side: #7fe8c8; } .sw-side.you { --side: #84dec7; }
@media (max-width: 760px) { .sw-side.merc { border-right: 0; border-bottom: 2px solid rgba(233,201,143,.28); padding: 0 0 14px; margin-bottom: 14px; } .sw-side.you { padding: 0; } }

/* gold transfer: each side's purse at its own end, the controls between */
.sw-goldbar { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 2px solid rgba(233,201,143,.28); }
.sw-goldbox { display: grid; gap: 1px; padding: 8px 14px; border-radius: 8px; border-left: 4px solid var(--side, #4ffbd0); background: linear-gradient(90deg, color-mix(in srgb, var(--side, #4ffbd0) 20%, transparent), transparent); min-width: 0; }
.sw-goldbox i { font-style: normal; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--side); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-goldbox b { font-size: 1.5rem; color: #ffd98a; font-variant-numeric: tabular-nums; line-height: 1.1; } .sw-goldbox span { font-size: .72rem; color: #7ba59a; }
.sw-goldbox.merc { --side: #7fe8c8; } .sw-goldbox.you { --side: #84dec7; border-left: 0; border-right: 4px solid var(--side); background: linear-gradient(270deg, color-mix(in srgb, var(--side) 20%, transparent), transparent); text-align: right; }
.sw-goldctl { display: grid; gap: 4px; justify-items: center; }
.sw-goldrow { display: flex; gap: 6px; align-items: center; }
.sw-goldrow .sw-gold-in { width: 8.5rem; text-align: center; }
.sw-goldall { display: flex; gap: 14px; font-size: .74rem; }
.sw-goldbar > small { grid-column: 1 / -1; color: #62867d; text-align: center; }
@media (max-width: 760px) { .sw-goldbar { grid-template-columns: 1fr; } .sw-goldbox.you { text-align: left; border-right: 0; border-left: 4px solid var(--side); background: linear-gradient(90deg, color-mix(in srgb, var(--side) 20%, transparent), transparent); } }

.sw-adj { color: #e9c98f; font-size: .74rem; }
.sw-class small { overflow-wrap: anywhere; }

/* dismissal confirmation */
.sw-confirm { margin-top: 12px; padding: 14px 16px; border: 1px solid #c0503c; border-radius: 8px; background: linear-gradient(90deg, rgba(192,80,60,.22), rgba(120,30,20,.12)); display: grid; gap: 8px; }
.sw-confirm > b { color: #ff9c86; font-size: 1.05rem; }
.sw-confirm p { margin: 0; font-size: .84rem; color: #f0d2c8; max-width: none; }
.sw-confirm label { font-size: .84rem; color: #f0d2c8; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .sw-confirm label i { color: #fff3dc; font-style: normal; font-weight: 600; }
.sw-dismiss-in { background: #1a0f0c; border: 1px solid #7a3a2c; border-radius: 5px; color: #f3e4c4; padding: .35rem .5rem; font: inherit; min-width: 12rem; }
.sw-confirm-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.sw-danger-solid { background: #9c3626; border: 1px solid #d0604a; color: #fff3dc; cursor: pointer; padding: .5rem 1rem; border-radius: 4px; font-weight: 600; }
.sw-danger-solid:disabled { opacity: .4; cursor: not-allowed; }

/* waiting requests: a notice that drops in under the site header and stays while the panel is open */
.sw-qbar { position: fixed; z-index: 890; top: var(--cs-nav, 76px); left: 50%; width: min(880px, calc(100vw - 24px)); box-sizing: border-box;
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; border: 1px solid #e0a43a; border-top: 0; border-radius: 0 0 10px 10px;
  background: linear-gradient(90deg, rgba(58,40,10,.97), rgba(40,28,8,.97)); color: #ffe2a6; box-shadow: 0 10px 28px rgba(0,0,0,.55);
  transform: translate(-50%, -140%); opacity: 0; pointer-events: none; transition: transform .35s ease, opacity .25s ease; }
.sw-qbar.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.sw-qbar b { color: #ffcf6e; font-size: 1.02rem; white-space: nowrap; }
.sw-qbar .sw-qwhat { flex: 1; min-width: 0; font-size: .82rem; color: #e8cf9a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-qbar .sw-eta { margin-left: auto; white-space: nowrap; }
@media (max-width: 560px) { .sw-qbar .sw-qwhat { display: none; } }

/* tabs across the whole width, big and obvious */
.sw-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin: 16px 0 14px; border: 1px solid #33574e; border-radius: 10px; overflow: hidden; background: rgba(0,0,0,.3); }
.sw-tab { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 15px 10px; border: 0; border-right: 1px solid #33574e; background: transparent;
  color: #8ebbb0; font: 700 1rem/1.1 var(--font-ui, inherit); letter-spacing: .03em; cursor: pointer; transition: background .15s, color .15s; }
.sw-tab:last-child { border-right: 0; }
.sw-tab i { font-style: normal; display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 1px solid #42675e; font-size: .78rem; color: #7ba59a; }
.sw-tab:hover { background: rgba(233,201,143,.08); color: #f3e4c4; }
.sw-tab.active { background: linear-gradient(180deg, #46d6a8, #1f8f72); color: #04140e; box-shadow: inset 0 -3px 0 #a8ffe9; }
.sw-tab.active i { border-color: rgba(4,20,14,.6); color: #04140e; background: rgba(255,255,255,.25); }
@media (max-width: 640px) { .sw-tabs { grid-template-columns: repeat(2, 1fr); } .sw-tab { border-bottom: 1px solid #33574e; } }
/* actions: summon/unsummon on the left, dismiss alone on the right */
.sw-dismiss-btn { margin-left: auto; }
/* rename, on the Appearance tab */
.sw-renamebar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 14px; margin-bottom: 14px; border: 1px solid #1f3932; border-radius: 8px; background: rgba(0,0,0,.22); }
.sw-renamebar label { font-weight: 700; color: #f3e4c4; }
.sw-renamebar .sw-name-in { flex: 1; min-width: 12rem; max-width: 24rem; width: auto; }
.sw-renamebar small { color: #62867d; }

/* liquid bars: blood for hit points, blue for experience */
.sw-vitals { gap: .55rem; }
.sw-liquid { position: relative; height: 1.9rem; border-radius: 999px; overflow: hidden; border: 1px solid #000; background: radial-gradient(ellipse at 50% 0, #1b1010, #0b0606);
  box-shadow: inset 0 3px 8px rgba(0,0,0,.85), inset 0 -1px 0 rgba(255,255,255,.07), 0 0 0 1px rgba(255,255,255,.06); }
.sw-liquid > i { position: absolute; inset: 0 auto 0 0; border-radius: 999px 0 0 999px; transition: width .6s ease; overflow: hidden; }
.sw-liquid > i::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.38) 0, rgba(255,255,255,.04) 38%, rgba(0,0,0,.28) 100%); }
.sw-liquid > i::after { content: ""; position: absolute; inset: -20% -60%; opacity: .55; background-size: 120px 120%; animation: swwave 5.5s linear infinite;
  background-image: radial-gradient(circle at 14px 70%, rgba(255,255,255,.3) 0 3px, transparent 4px), radial-gradient(circle at 60px 35%, rgba(255,255,255,.22) 0 2px, transparent 3px), radial-gradient(circle at 96px 80%, rgba(255,255,255,.18) 0 2px, transparent 3px); }
@keyframes swwave { to { background-position: 120px 0; } }
.sw-liquid > span { position: absolute; inset: 0; display: grid; place-items: center; font: 700 .82rem var(--font-ui, inherit); color: #fff3f0; text-shadow: 0 1px 3px #000, 0 0 6px rgba(0,0,0,.9); letter-spacing: .03em; }
.sw-liquid.blood > i { background: linear-gradient(90deg, #3d0606 0%, #7d0b0b 35%, #b01218 75%, #d5242a 100%); box-shadow: 0 0 14px rgba(190,20,20,.55); }
.sw-liquid.blood > i { border-right: 2px solid #ff5a5a; }
.sw-liquid.mana { height: 1.55rem; }
.sw-liquid.mana > i { background: linear-gradient(90deg, #024f3c 0%, #04a77e 40%, #11e6b1 80%, #55ffd4 100%); box-shadow: 0 0 14px rgba(40,255,201,.5); border-right: 2px solid #9affe6; }
.sw-liquid.mana > span { font-size: .76rem; color: #eafffa; }
@media (prefers-reduced-motion: reduce) { .sw-liquid > i::after { animation: none; } }
/* build & level tab */
.sw-levelup { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid #366e60; border-radius: 10px; background: linear-gradient(90deg, rgba(17,230,177,.16), rgba(0,0,0,.2)); margin-bottom: 14px; }
.sw-levelup.ready { border-color: #55ffd4; box-shadow: 0 0 0 1px #55ffd4 inset, 0 0 18px rgba(85,255,212,.25); }
.sw-levelup b { font-size: 1.15rem; color: #cffff3; display: block; } .sw-levelup span { font-size: .82rem; color: #9bdccc; }
.sw-levelbtns { display: flex; flex-wrap: wrap; gap: 8px; }
.sw-buildgrid { display: grid; grid-template-columns: minmax(240px, 1fr) 1.4fr; gap: 20px; }
@media (max-width: 760px) { .sw-buildgrid { grid-template-columns: 1fr; } }
.sw-classlist { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; }
.sw-classlist li { display: flex; justify-content: space-between; padding: 6px 10px; border-radius: 6px; background: rgba(0,0,0,.22); border-left: 3px solid #4ffbd0; }
.sw-classlist b { color: #f3e4c4; } .sw-classlist span { color: #7ba59a; }
.sw-abgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 10px; }
.sw-abgrid div { display: grid; justify-items: center; padding: 6px 2px; border: 1px solid #1f3932; border-radius: 6px; background: rgba(0,0,0,.22); }
.sw-abgrid em { font-style: normal; font-size: .66rem; color: #4ffbd0; letter-spacing: .08em; } .sw-abgrid b { font-size: 1.15rem; color: #f3e4c4; } .sw-abgrid i { font-style: normal; font-size: .72rem; color: #62867d; }
.sw-skills { display: flex; flex-wrap: wrap; gap: 5px; max-height: 260px; overflow-y: auto; }
.sw-skills span { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px; border-radius: 999px; background: rgba(0,0,0,.25); border: 1px solid #1f3932; font-size: .8rem; color: #a9d5ca; }
.sw-skills i { font-style: normal; display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; border-radius: 999px; background: #1c3831; color: #ffd98a; font-weight: 700; font-size: .72rem; }
.sw-featfilter { width: 100%; max-width: 22rem; box-sizing: border-box; background: #0f1a17; border: 1px solid #284840; border-radius: 5px; color: #f3e4c4; padding: .4rem .6rem; font: inherit; margin-bottom: 8px; }
.sw-feats { display: flex; flex-wrap: wrap; gap: 5px; max-height: 320px; overflow-y: auto; padding: 6px; border: 1px solid #1f3932; border-radius: 6px; background: rgba(0,0,0,.2); }
.sw-feats span { padding: 3px 9px; border-radius: 4px; background: rgba(233,201,143,.07); border: 1px solid #1f3932; font-size: .78rem; color: #abccc4; }

/* 3D head preview */
.sw-head3d { width: 170px; height: 200px; display: grid; place-items: center; border: 1px solid #33574e; border-radius: 8px; overflow: hidden; cursor: grab;
  background: radial-gradient(ellipse at 50% 35%, rgba(79,251,208,.25), rgba(0,0,0,.55) 75%); touch-action: none; }
.sw-head3d:active { cursor: grabbing; }
.sw-head3d[hidden] { display: none; }
.sw-h3d-canvas { display: block; width: 170px; height: 200px; }
.sw-lookpre { width: 194px; }

/* the apply button floats in its own column so it is always in reach */
.sw-lookactions { position: sticky; top: 90px; align-self: start; display: grid; gap: 10px; padding: 14px; border: 1px solid #357f6c; border-radius: 10px;
  background: linear-gradient(180deg, rgba(79,251,208,.14), rgba(0,0,0,.3)); }
.sw-lookactions b { color: #f3e4c4; font-size: .95rem; }
.sw-lookactions .btn { width: 100%; }
.sw-lookactions small { color: #7ba59a; font-size: .74rem; line-height: 1.35; }
.sellswords { container-type: inline-size; container-name: swpanel; }
/* three columns only when the panel is wide enough for the form; otherwise the actions drop under the form, still reachable */
@container swpanel (max-width: 900px) { .sw-lookpanel { grid-template-columns: 280px minmax(0, 1fr); } .sw-lookactions { grid-column: 1 / -1; position: sticky; bottom: 10px; top: auto; z-index: 5;
  grid-template-columns: 1fr auto auto; align-items: center; background: linear-gradient(180deg, rgba(40,16,30,.97), rgba(20,10,16,.97)); box-shadow: 0 -8px 20px rgba(0,0,0,.45); }
  .sw-lookactions small { display: none; } .sw-lookactions .btn { width: auto; } }
@container swpanel (max-width: 620px) { .sw-lookpanel { grid-template-columns: 1fr; } }

/* dismiss: black button with a skull behind the label; the eyes light up red on hover */
.sw-dismiss-btn { position: relative; background-color: #000; background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 64 64%22%3E%3Cpath d=%22M32 4C16 4 7 15 7 28c0 8 3 13 8 16v8c0 2 2 4 4 4h5v-5h3v5h10v-5h3v5h5c2 0 4-2 4-4v-8c5-3 8-8 8-16C57 15 48 4 32 4z%22 fill=%22%234a4a4a%22 stroke=%22%236a6a6a%22 stroke-width=%221.2%22/%3E%3Cpath d=%22M32 36l-4 8h8z%22 fill=%22%23050505%22/%3E%3Cellipse cx=%2222%22 cy=%2227%22 rx=%226%22 ry=%225.5%22 fill=%22%23000%22/%3E%3Cellipse cx=%2242%22 cy=%2227%22 rx=%226%22 ry=%225.5%22 fill=%22%23000%22/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; background-size: auto 150%;
  border: 1px solid #3a1a1a; color: #d2e6e1; text-shadow: 0 1px 3px #000, 0 0 6px #000; min-width: 7.5rem; transition: border-color .2s, color .2s, box-shadow .2s; }
.sw-dismiss-btn:hover, .sw-dismiss-btn:focus-visible { background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 64 64%22%3E%3Cfilter id=%22g%22 x=%22-80%25%22 y=%22-80%25%22 width=%22260%25%22 height=%22260%25%22%3E%3CfeGaussianBlur stdDeviation=%222.2%22/%3E%3C/filter%3E%3Cpath d=%22M32 4C16 4 7 15 7 28c0 8 3 13 8 16v8c0 2 2 4 4 4h5v-5h3v5h10v-5h3v5h5c2 0 4-2 4-4v-8c5-3 8-8 8-16C57 15 48 4 32 4z%22 fill=%22%234a4a4a%22 stroke=%22%236a6a6a%22 stroke-width=%221.2%22/%3E%3Cpath d=%22M32 36l-4 8h8z%22 fill=%22%23050505%22/%3E%3Cellipse cx=%2222%22 cy=%2227%22 rx=%227%22 ry=%226.5%22 fill=%22%23ff1a1a%22 filter=%22url(%23g)%22/%3E%3Cellipse cx=%2242%22 cy=%2227%22 rx=%227%22 ry=%226.5%22 fill=%22%23ff1a1a%22 filter=%22url(%23g)%22/%3E%3Cellipse cx=%2222%22 cy=%2227%22 rx=%226%22 ry=%225.5%22 fill=%22%23ff1a1a%22/%3E%3Cellipse cx=%2242%22 cy=%2227%22 rx=%226%22 ry=%225.5%22 fill=%22%23ff1a1a%22/%3E%3C/svg%3E"); border-color: #a01010; color: #fff; box-shadow: 0 0 10px rgba(255,26,26,.45); }

/* full-body 3D preview */
.sw-body3d { width: 250px; height: 360px; }
.sw-body3d .sw-h3d-canvas { width: 250px; height: 360px; }
.sw-lookpre { width: 274px; }
.sw-viewtog { display: flex; gap: 6px; justify-content: center; }
.sw-viewtog button { padding: 3px 12px; border-radius: 999px; border: 1px solid #3a5a52; background: rgba(0,0,0,.25); color: #cfe8df; cursor: pointer; font-size: .74rem; }
.sw-viewtog button.on { background: #46d6a8; border-color: #46d6a8; color: #04140e; font-weight: 600; }
.sw-createpre { display: grid; gap: 8px; justify-items: center; margin: 0 0 12px; }

.sw-viewtog select { padding: 2px 8px; border-radius: 999px; border: 1px solid #3a5a52; background: #0d1a17; color: #cfe8df; font-size: .74rem; }

/* full-body preview backdrop: pictures from the game, chosen with the Backdrop menu */
.sw-body3d { background: #14110c center / cover no-repeat; border-color: #5a4a30; }
.sw-body3d[data-bg="wall"] { background-image: url("/images/body-bg-wall.jpg"); background-position: 78% 50%; }
.sw-body3d[data-bg="forest"] { background-image: url("/images/body-bg-forest.jpg"); background-position: 32% 50%; }
.sw-body3d[data-bg="camp"] { background-image: url("/images/body-bg-camp.jpg"); background-position: 50% 50%; }
.sw-body3d[data-bg="plain"] { background-image: radial-gradient(ellipse at 50% 35%, rgba(70,214,168,.22), rgba(0,0,0,.6) 75%); }
.sw-viewtog { flex-wrap: wrap; }

/* spellbook */
.sw-sbclass { margin: 0 0 14px; padding: 10px 12px; border: 1px solid #2f3f39; border-radius: 8px; background: rgba(0,0,0,.2); }
.sw-sbclass h6 { margin: 0 0 6px; font-size: .95rem; }
.sw-sblevel { margin: 4px 0; border: 1px solid #2f3f39; border-radius: 6px; padding: 4px 8px; }
.sw-sblevel summary { cursor: pointer; font-weight: 600; } .sw-sblevel summary small { color: #8fa39b; font-weight: 400; margin-left: 8px; }
.sw-sblab { margin: 8px 0 4px; color: #8fa39b; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; }
.sw-spells { display: flex; flex-wrap: wrap; gap: 5px; }
.sw-spell { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 3px; border: 1px solid #2f3f39; border-radius: 5px; background: rgba(255,255,255,.04); font-size: .8rem; }
.sw-spell img { width: 22px; height: 22px; object-fit: contain; }
.sw-sbsel { display: flex; flex-wrap: wrap; gap: 6px; }
.sw-sbsel select { max-width: 15rem; background: #0d1a17; border: 1px solid #2f3f39; border-radius: 5px; color: #eaf5f0; padding: 3px 6px; font: inherit; font-size: .8rem; }
.sw-sbbar { display: flex; gap: 8px; margin-top: 8px; }

/* carried weight */
.sw-wt { display: block; margin-top: 2px; font-size: .74rem; color: #8fc9b4; }
.sw-wt.over { color: #e0b070; } .sw-wt.heavy { color: #e0604a; }

/* the tab bar stays under the action row, and the Apply pill sticks under the tab bar instead of sliding behind both */
:root { --sw-tabs-h: 66px; }
.sw-tabs { position: sticky; top: calc(var(--cs-nav, 76px) + var(--cs-actions-h, 96px)); z-index: 30; background: rgba(8, 12, 11, .97); backdrop-filter: blur(8px); }
.sw-lookactions { top: calc(var(--cs-nav, 76px) + var(--cs-actions-h, 96px) + var(--sw-tabs-h) + 14px); }
.sw-lookpre { top: calc(var(--cs-nav, 76px) + var(--cs-actions-h, 96px) + var(--sw-tabs-h) + 14px); }

/* creating a mercenary: the look controls and the preview sit side by side */
.sw-createrow { display: grid; grid-template-columns: max-content 280px; justify-content: start; gap: 28px; align-items: start; }
.sw-createrow .sw-createform { display: grid; gap: .8rem; min-width: 0; }
.sw-createrow .sw-createpre { position: sticky; top: calc(var(--cs-nav, 76px) + var(--cs-actions-h, 96px) + 14px); margin: 0; padding: 12px; border: 1px solid #1f3932; border-radius: 8px;
  background: radial-gradient(ellipse at 50% 0, rgba(79,251,208,.18), rgba(0,0,0,.25) 70%); }
.sw-createrow .sw-body3d, .sw-createrow .sw-head3d { width: 250px; }
@media (max-width: 760px) { .sw-createrow { grid-template-columns: 1fr; } .sw-createrow .sw-createpre { position: static; } }
@media (max-width: 1000px) { .sw-createrow { grid-template-columns: minmax(0, 1fr) 280px; } }
