:root {
  --bg: #0e1014;
  --panel: #171a21;
  --panel2: #1e222b;
  --line: #2b303b;
  --text: #e6e3dc;
  --muted: #8d939e;
  --gold: #e8c26a;
  --gold-dim: #a8873f;
  --split: #5ab4f0;
  --radius: 10px;
  --head: 56px;
  --ico: 38px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--text); font: 13px/1.4 "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(1400px 500px at 50% -260px, #23293a 0%, transparent 70%), var(--bg);
  display: flex; flex-direction: column;
}
a { color: var(--split); }
h1 { font-size: 16px; margin: 0; letter-spacing: .04em; color: var(--gold); white-space: nowrap; }
h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 6px; font-weight: 600; }
h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--gold-dim); margin: 10px 0 4px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
h3:first-child { margin-top: 0; }

button, input { font: inherit; color: var(--text); }
button { cursor: pointer; background: var(--panel2); border: 1px solid var(--line); border-radius: 7px; padding: 5px 11px; transition: border-color .15s, background .15s; }
button:hover { border-color: var(--gold-dim); }
button.primary { background: linear-gradient(#c9a24f, #9c7a33); border-color: #d9b660; color: #1a1408; font-weight: 600; }
button.primary:hover { filter: brightness(1.1); }
input { background: #0b0d11; border: 1px solid var(--line); border-radius: 7px; padding: 5px 10px; }
input:focus, button:focus-visible { outline: 2px solid var(--gold-dim); outline-offset: 1px; }

/* ---- header: one row ---- */
header {
  flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
  min-height: var(--head); padding: 8px 16px; padding-top: calc(8px + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--line); background: #0e1014e6; position: relative;
}
#professions { display: flex; flex-wrap: wrap; gap: 2px; min-height: 36px; }
#professions button { padding: 3px; border-radius: 8px; background: transparent; border-color: transparent; display: flex; align-items: center; gap: 6px; }
#professions button img { width: 28px; height: 28px; opacity: .5; filter: grayscale(.6); transition: .15s; }
#professions button:hover img { opacity: 1; filter: none; }
#professions button.on { background: var(--panel2); border-color: var(--gold-dim); padding-right: 10px; }
#professions button.on img { opacity: 1; filter: none; }
#professions button span { display: none; color: var(--gold); font-weight: 600; }
#professions button.on span { display: inline; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: transparent; padding: 5px 12px; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--panel2); color: var(--gold); }
.code { display: flex; gap: 6px; flex: 1 1 420px; min-width: 0; }
#chatcode { flex: 1; min-width: 0; font-family: ui-monospace, "Cascadia Mono", monospace; font-size: 11px; }
#codemsg { position: absolute; right: 16px; bottom: -18px; font-size: 11px; color: var(--gold); pointer-events: none; }

/* ---- three columns that fit one screen ---- */
main {
  flex: 1; min-height: 0; display: grid; gap: 12px; padding: 12px 16px;
  grid-template-columns: 420px minmax(620px, 1fr) 330px 270px;
}
main > * { min-height: 0; overflow: auto; }
#center { display: flex; flex-direction: column; gap: 12px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }

/* ---- icons ---- */
.icon { width: var(--ico); height: var(--ico); border-radius: 6px; display: block; background: #07080a; border: 1px solid #000; box-shadow: 0 0 0 1px #ffffff14; }
.icon.empty { background: #0b0d11; box-shadow: inset 0 0 0 1px #ffffff12; }
.split-mark { position: relative; display: block; }
.split-mark::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: -4px; height: 2px; border-radius: 2px; background: var(--split); }
.legend { float: right; font-size: 11px; text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 400; }
.legend i { display: inline-block; width: 14px; height: 2px; background: var(--split); vertical-align: middle; margin-right: 6px; border-radius: 2px; }

/* ---- specializations ---- */
.spec {
  display: flex; justify-content: center; align-items: stretch;
  border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; overflow: hidden;
  background: var(--panel); min-height: 138px;
}
.spec:last-child { margin-bottom: 0; }
/* emblem + traits as one centered group; the art sits behind the group and fades at both ends */
.specin { position: relative; display: flex; align-items: center; gap: 12px; padding: 0 24px; }
/* The art, cut to its own box by scripts/crop-backgrounds.py (the API images use two layouts), on a
   700px band in the center of the card that fades out at both ends. */
.spec { position: relative; }
.spec .bg { position: absolute; top: 0; bottom: 0; left: 50%; width: 760px; max-width: 100%; transform: translateX(-50%);
  background-size: cover; background-position: center 35%; background-repeat: no-repeat; opacity: .55;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 18%, #000 82%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0%, #000 18%, #000 82%, transparent 100%); }
.spec .bg::after { content: ""; position: absolute; inset: 0; background: #0e101455; }
.specin > :not(.bg) { position: relative; }
.emblem { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; padding: 8px; }
.emblem .hex { width: 70px; height: 70px; clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%); background: #000a; display: grid; place-items: center; transition: transform .15s; }
.emblem:hover .hex { transform: scale(1.05); }
.emblem .hex img { width: 62px; height: 62px; }
.emblem .name { font-weight: 600; font-size: 13px; text-shadow: 0 1px 3px #000; }
.emblem .elite { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); }
.emblem .hint { font-size: 11px; color: var(--muted); }
.traits { position: relative; display: flex; align-items: center; gap: 20px; padding: 8px 0; }
.traits svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.traits svg path { fill: none; stroke: var(--gold); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 4px #e8c26a88); opacity: .9; }
.minor { width: 34px; height: 34px; border-radius: 50%; position: relative; z-index: 1; box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--gold-dim); }
.majors { display: flex; flex-direction: column; gap: 4px; position: relative; z-index: 1; }
.major { background: none; border: 0; padding: 0; border-radius: 7px; }
.major .icon { filter: grayscale(1) brightness(.5); transition: filter .15s, box-shadow .15s; }
.major:hover .icon { filter: grayscale(.2) brightness(.9); }
.major.on .icon { filter: none; box-shadow: 0 0 0 2px var(--gold), 0 0 12px #e8c26a88; }

/* ---- skills ---- */
.wtabs { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 10px; }
.hand { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; }
.hand .icon { width: 28px; height: 28px; }
.hand small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); line-height: 1.1; }
.hand:disabled { opacity: .35; cursor: default; }
.attune { display: flex; gap: 4px; }
.attune button { padding: 4px 9px; font-size: 12px; }
.attune button.on { border-color: var(--gold); color: var(--gold); }
.skillbar { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: center; gap: 6px; padding: 10px; background: #0b0d11; border-radius: 10px; border: 1px solid #000; box-shadow: inset 0 1px 0 #ffffff0a; }
.skillbar .gap { width: 20px; }
.slot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.slot .key { font-size: 11px; color: var(--muted); }
.slot button { padding: 0; border: 0; background: none; border-radius: 7px; }
.slot .icon { width: 48px; height: 48px; }
.slot button:hover .icon { box-shadow: 0 0 0 2px var(--gold-dim); }
.slot button .icon.empty { display: grid; place-items: center; color: #ffffff30; font-size: 22px; }
.note { color: var(--muted); font-size: 12px; margin: 8px 0 0; text-align: center; }

/* ---- gear ---- */
.gearhead { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.gearhead .seg button { padding: 3px 9px; font-size: 12px; }
.gearhead > button { padding: 3px 9px; font-size: 12px; }
.grow { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto 22px; align-items: center; gap: 5px; min-height: 30px; }
.grow + .grow { border-top: 1px solid #ffffff08; }
.sname small { color: var(--split); font-size: 10px; }
.grow .sname { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.statbtn { text-align: left; padding: 1px 6px; font-size: 12px; min-width: 0; background: transparent; border-color: transparent; line-height: 1.25; }
.statbtn:hover { border-color: var(--gold-dim); }
.statbtn .sn, .statbtn .sv { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.statbtn .sv { font-size: 10.5px; color: #9fe39f; }
.statbtn.none { color: #8a8f99; }   /* "no stats": readable (contrast 4.5+) */
.statbtn:disabled { opacity: .4; cursor: default; }
.ups { display: flex; gap: 3px; }
.up { padding: 0; border: 0; background: none; border-radius: 5px; }
.up .icon, .up .empty { width: 24px; height: 24px; border-radius: 5px; }
.inf { width: 22px; height: 22px; padding: 0; border-radius: 50%; font-size: 8.5px; font-weight: 700; color: #c6a6ff; background: #0b0d11; border: 1px dashed #ffffff26; }
.inf.on { border: 1px solid #9b6bff; background: #2a1d45; }
.cp { width: 22px; height: 22px; padding: 0; font-size: 13px; color: var(--muted); background: transparent; border-color: transparent; }
.cp:hover { color: var(--gold); }
.runesets { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.runesets span { display: flex; align-items: center; gap: 6px; }
.runesets img { width: 22px; height: 22px; }
.up:hover .icon, .up:hover .empty { box-shadow: 0 0 0 1px var(--gold-dim); }
.wide { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 3px 8px 3px 3px; background: transparent; font-size: 12px; }
.wide .icon { width: 28px; height: 28px; }
.wide small { display: block; color: var(--muted); font-size: 11px; line-height: 1.2; }

/* ---- stats ---- */
.attrs { display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; }
.attrs div { padding: 3px 4px; border-radius: 4px; cursor: default; }
.attrs div:nth-child(4n+1), .attrs div:nth-child(4n+2) { background: #ffffff05; }
.attrs .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.attrs .v.up { color: #9fe39f; }
.statnote { color: var(--muted); font-size: 11px; margin: 8px 0 0; }
.relicbox { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: #d8d4ca; }
.relicbox img { width: 32px; height: 32px; flex: none; }
#stats.tight .rdesc { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
#stats.tighter p.statnote { display: none; }
#stats.tightest .attrs div { padding: 2px 4px; }
#stats.tightest h3 { margin: 6px 0 2px; }
.bonuslist { margin: 4px 0 0; padding-left: 16px; color: #d8d4ca; font-size: 12px; }

/* ---- picker ---- */
#picker { position: absolute; z-index: 30; width: max-content; max-width: min(560px, calc(100vw - 24px)); max-height: 70vh; overflow: auto; background: #12151bf5; border: 1px solid var(--gold-dim); border-radius: 12px; padding: 12px; box-shadow: 0 12px 40px #000c; }
.pickhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; color: var(--gold); font-weight: 600; }
.pickhead button { padding: 3px 10px; font-size: 12px; }
#picksearch { width: 100%; margin-bottom: 8px; }
.group > span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 6px 0 4px; }
.items { display: flex; flex-wrap: wrap; gap: 5px; }
.items button { padding: 0; border: 0; background: none; border-radius: 7px; }
.items button.on .icon { box-shadow: 0 0 0 2px var(--gold); }
.items button:hover .icon { box-shadow: 0 0 0 2px var(--gold-dim); }
.items.named button { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; background: var(--panel2); border: 1px solid var(--line); }
.items.named button.on { border-color: var(--gold); }
.items.named .icon { width: 30px; height: 30px; }
.items.text button { padding: 4px 10px; background: var(--panel2); border: 1px solid var(--line); text-align: left; }
.items.text button.on { border-color: var(--gold); }
#picker.columns { width: min(1000px, calc(100vw - 24px)); max-width: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 12px; align-items: start; }
#picker.columns .pickhead, #picker.columns #picksearch { grid-column: 1 / -1; }
#picker.columns .items { flex-direction: column; flex-wrap: nowrap; }
#picker.columns .items.text button { width: 100%; }
.items small { display: block; color: var(--muted); font-size: 11px; }

/* ---- tooltip ---- */
:is(#tip, #tip2) { position: absolute; z-index: 40; width: 360px; max-width: calc(100vw - 16px); background: #08090cf7; border: 1px solid #3a3f4b; border-radius: 6px; padding: 12px 14px; pointer-events: none; box-shadow: 0 10px 30px #000d; font-size: 13px; }
.tiphead { display: flex; gap: 10px; align-items: flex-start; }
.tiphead img { width: 40px; height: 40px; border: 1px solid #000; }
.tiphead b { color: var(--gold); font-size: 15px; display: block; }
.badge { display: inline-block; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; padding: 1px 6px; border-radius: 4px; margin-top: 2px; }
.badge.split { background: #5ab4f022; color: var(--split); border: 1px solid #5ab4f055; }
.badge.api { background: #e8c26a22; color: var(--gold); border: 1px solid #e8c26a55; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 12px; margin-top: 4px; }
:is(#tip, #tip2) p { margin: 8px 0; color: #d8d4ca; white-space: pre-line; }
.chain { color: var(--muted); font-size: 12px; }
.facts { list-style: none; padding: 0; margin: 8px 0 0; border-top: 1px solid #ffffff12; padding-top: 8px; }
.facts li { display: flex; gap: 8px; align-items: flex-start; margin: 3px 0; }
.facts img { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.facts b { color: #fff; }
.coef { color: var(--split); font-size: 11px; margin-left: 4px; white-space: nowrap; }
.healwho { color: #b9d98a; font-size: 11px; margin-left: 4px; }
.breakdown { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 12px; }
.breakdown td { padding: 2px 0; border-bottom: 1px solid #ffffff0d; }
.breakdown td:last-child { text-align: right; font-variant-numeric: tabular-nums; }

footer { flex: none; padding: 6px 16px 10px; color: var(--muted); font-size: 11px; }
.error { color: #ff7b7b; padding: 16px; }

/* narrower screens: stack the columns and scroll the page */
@media (max-width: 1400px) {
  .buffsec { overflow: visible; }
  body { display: block; }
  main { grid-template-columns: 1fr; }
  main > * { overflow: visible; }
  #center { order: -1; }
}
@media (max-width: 700px) {
  .specin { flex-direction: column; padding: 0 8px; }
  .emblem { flex-direction: row; justify-content: flex-start; }
  .traits { gap: 12px; padding: 6px 10px 12px; }
  :root { --ico: 34px; }
  .skillbar .gap { width: 100%; height: 0; }
}
.statnote input { vertical-align: middle; margin: 0 4px 0 0; }
label.statnote { display: block; cursor: pointer; }

/* ---- saved builds ---- */
.buildbtn { display: flex; align-items: baseline; gap: 8px; max-width: 280px; }
.buildbtn small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.buildbtn span { font-weight: 600; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wvw { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: #ffb27a; border: 1px solid #ffb27a55; border-radius: 6px; padding: 3px 8px; }
.bactions { display: flex; gap: 6px; }
.buildlist { display: flex; flex-direction: column; gap: 4px; min-width: 360px; }
.brow { display: grid; grid-template-columns: 1fr auto auto auto; gap: 4px; align-items: center; }
.brow.on .bopen { border-color: var(--gold); }
.bopen { display: flex; align-items: center; gap: 8px; text-align: left; padding: 4px 10px 4px 4px; }
.bopen img { width: 26px; height: 26px; }
.bopen small { display: block; color: var(--muted); font-size: 11px; }
/* compare, rename, delete: one width, so the buttons line up in all rows (the open build has an empty compare place) */
.bicon { padding: 4px 8px; min-width: 32px; text-align: center; color: var(--muted); background: transparent; }
.bicon.armed { color: #ff8a8a; border-color: #ff8a8a; }
.rename { width: 100%; }

.wpick { display: flex; align-items: center; gap: 6px; padding: 2px 6px 2px 2px; min-width: 0; font-size: 12px; background: transparent; }
.wpick span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wpick .icon { width: 24px; height: 24px; flex: none; }
.wpick.none { color: var(--muted); border-style: dashed; }
.wsets .seg button small { color: var(--muted); font-size: 11px; margin-left: 4px; }
.wsets .seg button.on small { color: var(--gold-dim); }

/* ---- buffs ---- */
.buffsec { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.buffsec #buffs { flex: 1; }
#buffs { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: 1fr; gap: 4px 16px; align-content: start; }
#buffs .bgroup { display: contents; }
#buffs h3 { grid-column: 1 / -1; margin: 6px 0 0; }
#buffs h3:first-child { margin-top: 0; }
#buffs .statnote { grid-column: 1 / -1; }
.buff { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 3px 6px; border-radius: 7px; border: 1px solid transparent; }
.buff.on { border-color: #e8c26a44; background: #e8c26a0d; }
.buff img, .buff .icon { width: 28px; height: 28px; border-radius: 5px; }
.bname { min-width: 0; font-size: 12px; }
.bname b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bname small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; line-clamp: 1; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.25; }   /* full text in the title */
.stepper { display: flex; align-items: center; gap: 2px; }
.stepper button { padding: 1px 7px; font-size: 13px; }
.stepper input { width: 42px; padding: 2px 4px; text-align: center; font-size: 12px; }
.stepper .bmax { font-size: 11px; padding: 2px 6px; }
.btoggle { padding: 2px 10px; font-size: 12px; min-width: 48px; }
.btoggle.on { border-color: var(--gold); color: var(--gold); }
.always { font-size: 11px; color: #9fe39f; }
.boonrow { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; }
.boonbtn { padding: 0; border-radius: 6px; border: 2px solid transparent; background: none; }
.boonbtn img { width: 30px; height: 30px; display: block; border-radius: 4px; filter: grayscale(1) brightness(.55); }
.boonbtn.on { border-color: var(--gold); }
.boonbtn.on img { filter: none; }
.needs { padding: 2px 8px; font-size: 11px; color: var(--muted); }
.needs.on { border-color: var(--gold); color: var(--gold); }
.spec.empty .hex { background: #ffffff0d; }
.spec.empty .plus { font-size: 34px; color: var(--muted); line-height: 1; }
.spec.empty .name { color: var(--muted); font-weight: 400; }
#chatcode.changed { animation: codeflash 1.2s ease-out; }
@keyframes codeflash { 0% { border-color: var(--gold); box-shadow: 0 0 0 3px #e8c26a55; } 100% { border-color: var(--line); box-shadow: none; } }

/* ---- profession mechanics and special bars ---- */
.seg.bars button { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; font-size: 12px; }
.seg.bars img { width: 22px; height: 22px; border-radius: 4px; }
.mechbar { display: flex; justify-content: center; gap: 6px; margin-bottom: 8px; }
.slot.mech .icon { width: 40px; height: 40px; }
.fpick { position: relative; padding: 0; border: 0; background: none; border-radius: 7px; }
.fpick:hover .icon { box-shadow: 0 0 0 2px var(--gold-dim); }
.fpick .more { position: absolute; right: -4px; top: -4px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; background: var(--gold-dim); color: #1a1408; font-size: 10px; font-weight: 700; line-height: 16px; }
.mechbar .icon.empty { display: grid; place-items: center; color: #ffffff40; font-size: 18px; }

/* ---- pets and follow-up skills ---- */
.petrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.petcard { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.petcard.on { border-color: var(--gold); }
.petuse { display: flex; align-items: center; gap: 6px; padding: 2px 8px 2px 2px; background: transparent; border: 0; font-size: 12px; text-align: left; }
.petuse img, .petuse .icon { width: 30px; height: 30px; border-radius: 5px; }
.petuse small { display: block; color: var(--muted); font-size: 10px; }
.petchange { padding: 2px 8px; font-size: 11px; }
.slot.mech { position: relative; }
.plusmark { position: absolute; left: -3px; top: -3px; width: 14px; height: 14px; border-radius: 50%; background: var(--split); color: #071018; font-size: 11px; font-weight: 700; line-height: 14px; text-align: center; pointer-events: none; }
.tipextra { margin-top: 10px; }
/* a skill with its chain or alternate skills: one column per skill */
:is(#tip, #tip2).multi { width: auto; max-width: min(1080px, calc(100vw - 16px)); display: flex; flex-wrap: wrap; gap: 0 16px; }
:is(#tip, #tip2).multi .tipcol { width: 330px; }
:is(#tip, #tip2).multi .tipcol + .tipcol { border-left: 1px solid #ffffff14; padding-left: 16px; }
.tipsep { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--split); border-top: 1px solid #ffffff1a; padding-top: 6px; margin-bottom: 6px; }
#gear h3 { margin: 7px 0 2px; }
#gear .statbtn { padding-block: 0; }
#gear .wpick { padding-block: 1px; }
#gear .wpick .icon { width: 22px; height: 22px; }
.attlabel { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; align-self: center; margin-right: 2px; }
.wide.cons { margin-bottom: 4px; align-items: flex-start; }
.wide.cons .consfx { color: #9fe39f; }
.items small.lvl { color: var(--gold-dim); }

/* item rarity colors (game colors) */
.r-Basic { color: #e8e6e1; } .r-Fine { color: #62a4da; } .r-Masterwork { color: #1fbf2a; } .r-Rare { color: #fcd00b; }
.r-Exotic { color: #ffa405; } .r-Ascended { color: #fb3e8d; } .r-Legendary { color: #b48cff; }
small .r-Basic, small .r-Fine, small .r-Masterwork, small .r-Rare, small .r-Exotic, small .r-Ascended { font-weight: 600; }
/* picker filter chips */
.pickchips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 4px; }
.pickchips .chip { background: #1b1f27; border: 1px solid #ffffff22; border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; color: #cfcab9; }
.pickchips .chip.on { border-color: currentColor; background: #ffffff14; }
.pickchips .chip:not(.on) { opacity: .75; }
.pickchips .chip:first-child:not(.on) { color: #cfcab9; }
.pickchips .chipsep { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: #8d8a80; margin-left: 10px; }
.pickchips .chipcount { margin-left: auto; font-size: 11px; color: #8d8a80; }

/* undo and redo */
.undo { display: inline-flex; gap: 4px; }
.undo button { width: 32px; height: 32px; padding: 0; font-size: 16px; }
.undo button:disabled { opacity: .35; cursor: default; }

/* sync section of the build menu */
.syncbox { margin-top: 12px; padding-top: 10px; border-top: 1px solid #ffffff1a; display: flex; flex-direction: column; gap: 6px; max-width: 460px; }
.syncbox small { color: #a9a597; line-height: 1.4; }
.syncbox input[type="password"], .syncbox input#syncphrase { width: 100%; box-sizing: border-box; background: #0b0d11; color: inherit; border: 1px solid #ffffff2a; border-radius: 6px; padding: 6px 8px; font: inherit; font-family: ui-monospace, monospace; }
.syncbox .showpw { font-size: 12px; color: #a9a597; display: flex; gap: 6px; align-items: center; }
.syncbox .pmform { margin: 0; }
/* visually hidden, but still in the form for password managers */
.vh { position: absolute !important; width: 1px !important; min-width: 0 !important; height: 1px !important; padding: 0 !important; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0 !important; white-space: nowrap; }   /* hidden but readable by password managers */
.syncbox textarea { width: 100%; box-sizing: border-box; background: #0b0d11; color: inherit; border: 1px solid #ffffff2a; border-radius: 6px; padding: 6px 8px; font: inherit; resize: vertical; }
.syncbox .phrase { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px 10px; margin: 4px 0; padding-left: 22px; font-family: ui-monospace, monospace; font-size: 14px; color: #f0d78c; }
.syncbox .syncmsg { margin: 0; color: #f0d78c; font-size: 12px; }
.syncbox .armed { border-color: #c0504d; color: #ff8d86; }
/* a land-only heal, utility or elite skill on an aquatic weapon set */
.slot.noaq .icon, img.icon.noaq { filter: grayscale(1) brightness(0.55); }
.slot.noaq .key::after { content: " ✕"; color: #e06c6c; }
.chain.noaqnote { color: #e06c6c; }

/* a land-only legend on an underwater set */
.petcard.nowater { opacity: .55; }
.petcard.nowater small { color: #ff8d86; }
.impblock + .impblock { border-top: 1px solid #3a3a3a; margin-top: 6px; padding-top: 6px; }
.imphead { display: flex; align-items: center; gap: 8px; color: #f0c674; }
.imphead img { width: 24px; height: 24px; border-radius: 3px; }
.impblock .facts { margin-top: 4px; }
.impdesc { margin: 4px 0 !important; font-size: 12px; }
.traitskill { border-top: 1px solid #3a3a3a; margin-top: 8px; padding-top: 8px; }
#coverage { display: flex; flex-wrap: wrap; gap: 2px 16px; padding: 3px 10px; }
.covtitle { margin: 0; align-self: center; }
.covrow { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.covlabel { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; margin-right: 4px; }
.cov { position: relative; display: inline-flex; cursor: default; }
.cov img { width: 22px; height: 22px; border: 1px solid #000; }
.cov i { font-size: 11px; font-style: normal; padding: 4px; border: 1px solid #333; }
.cov small { position: absolute; right: -2px; bottom: -3px; font-size: 10px; line-height: 1; padding: 1px 2px; background: #000c; color: #ddd; border-radius: 3px; }

/* combo field and finisher chips in the coverage panel */
.covchip { font-size: 11px; padding: 1px 6px; border-radius: 3px; border: 1px solid #ffffff22; color: #e8e4da; background: #ffffff0d; line-height: 18px; }
.covchip small { position: static; margin-left: 4px; background: none; padding: 0; color: #9a968c; }
.field-fire { border-color: #e2603a; color: #ffb08a; } .field-water { border-color: #3a8fe2; color: #9ccaff; }
.field-light { border-color: #e8d36a; color: #fff0a8; } .field-dark { border-color: #8a4ac2; color: #d0a8f0; }
.field-ethereal { border-color: #c24ab8; color: #f0a8e8; } .field-ice { border-color: #7ad0e8; color: #c8f0ff; }
.field-lightning { border-color: #a88af0; color: #d8ccff; } .field-poison { border-color: #5aa84a; color: #b0e8a0; }
.field-smoke { border-color: #8a8a8a; color: #d0d0d0; }
.combos li.dim { opacity: .5; }

/* the skill a fact belongs to (wiki "Has linked skill") */
.factlink { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; font-size: 11px; color: #9ab; }
.factlink img { width: 14px !important; height: 14px !important; }
/* compact tooltips: tag with the trait or relic that changed a value */
.modtag { display: inline-flex; gap: 4px; margin-left: 4px; vertical-align: middle; }
.modtag > span { display: inline-flex; align-items: center; gap: 2px; font-size: 10px; line-height: 14px; padding: 0 4px; border-radius: 3px; background: rgba(120, 170, 255, .14); color: #9fc2ff; white-space: nowrap; }
.modtag img { width: 12px; height: 12px; }
.tiphead .meta b { display: inline; font-size: inherit; color: var(--text, #e8e8e8); }
.tiphead .meta .modtag { margin-left: 4px; }

/* helm or aquabreather not in use (land / underwater switch) */
/* a piece not in use (helm under water, aquabreather on land): muted italic text, dim icons (text stays readable) */
.grow.idle .sname, .grow.idle .statbtn .sn, .grow.idle .statbtn .sv { color: var(--muted); font-style: italic; }
.grow.idle .ups, .grow.idle .cp { opacity: .45; }

/* 404.html */
main.notfound { display: block; max-width: 520px; margin: 18vh auto; padding: 24px; text-align: center; }
main.notfound h1 { font-size: 22px; margin-bottom: 12px; }
main.notfound p { color: var(--muted); }

/* buffs column: reset buttons, and denser steps when the cards do not fit (app.js fitBuffs) */
.breset { margin-left: 8px; padding: 0 6px; font-size: 11px; line-height: 16px; letter-spacing: 0; text-transform: none; color: var(--muted); vertical-align: 1px; }
.breset:hover { color: var(--gold); border-color: var(--gold-dim); }
#buffs.dense1 { gap: 2px 16px; }
#buffs.dense1 h3 { margin-top: 3px; }
#buffs.dense1 .buff { padding: 1px 6px; }
#buffs.dense2 { grid-template-columns: 1fr 1fr; gap: 2px 6px; }
#buffs.dense2 > .bgroup > *:not(.buff:has(> .always)) { grid-column: 1 / -1; }
#buffs.dense2 .buff:has(> .always) { grid-template-columns: 24px minmax(0, 1fr); gap: 5px; padding: 1px 4px; }
#buffs.dense2 .buff:has(> .always) img { width: 24px; height: 24px; }
#buffs.dense2 .buff:has(> .always) > .always { display: none; }
#buffs.dense3 .bname small { display: none; }
/* dense4: lower rows (Herald: six facet switches) */
#buffs.dense4 .buff { padding: 0 6px; gap: 6px; grid-template-columns: 22px minmax(0, 1fr) auto; }
#buffs.dense4 .buff img, #buffs.dense4 .buff .icon { width: 22px; height: 22px; }
/* dense5: Warrior with adrenaline, signets, stances and a relic (pass C layout run) */
#buffs.dense5 { font-size: 12px; row-gap: 1px; }
#buffs.dense5 .buff { grid-template-columns: 19px minmax(0, 1fr) auto; line-height: 1.1; padding-top: 0; padding-bottom: 0; }
#buffs.dense5 .buff img, #buffs.dense5 .buff .icon { width: 19px; height: 19px; }
#buffs.dense5 h3 { margin: 1px 0 0; }
#buffs.dense4 .buff button, #buffs.dense4 .buff input { padding-top: 0; padding-bottom: 0; }
#center.tight { gap: 6px; }
#center.tight .spec { margin-bottom: 6px; }
#center.tight .petrow { margin-top: 2px; }
#center.tighter > section > h2 { display: none; }
#center.tightest .spec { min-height: 124px; margin-bottom: 4px; }

/* gear rarity switch on the Armor, Weapon set A and Trinkets titles */
.rarbtn { margin-left: auto; padding: 0 7px; font-size: 10px; line-height: 16px; letter-spacing: .06em; text-transform: uppercase; background: none; border-color: currentColor; }
.rarbtn:hover { filter: brightness(1.2); }
#gear h3 > small { margin: 0 auto 0 8px; }
#tarmor { width: 64px; padding: 2px 4px; text-align: center; font-size: 12px; }

/* compare two builds (app.js openCompare) */
#compare { position: fixed; inset: 0; z-index: 50; background: #0008; display: flex; align-items: center; justify-content: center; }
#compare[hidden] { display: none; }
.cmpbox { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; width: min(1500px, 96vw); max-height: 94vh; overflow: auto; box-shadow: 0 10px 40px #000a; }
.cmphead { display: flex; align-items: center; margin-bottom: 8px; }
.cmphead h2 { flex: 1; margin: 0; }
.cmpclose { padding: 2px 9px; }
.cmpgrid { display: grid; grid-template-columns: 430px 1fr; gap: 22px; align-items: start; }
.cmp { width: 100%; border-collapse: collapse; font-size: 12px; }
.cmp th, .cmp td { padding: 2px 8px; text-align: left; vertical-align: top; border-bottom: 1px solid #ffffff0a; }
.cmp thead th { color: var(--gold); font-weight: 600; }
.cmp thead small { display: block; color: var(--muted); font-weight: 400; }
.cmp tbody th { color: var(--muted); font-weight: 400; white-space: nowrap; }
.cmpnum td { text-align: right; font-variant-numeric: tabular-nums; }
.cmp .dup { color: #9fe39f; } .cmp .ddown { color: #ff8f8f; } .cmp .d0 { color: var(--muted); }
.cmp tr.sep td { border: 0; height: 8px; }
.cmptext tr.diff td { color: var(--text); } .cmptext tr.same td { color: var(--muted); }
.cmptext td { width: 50%; }
.cmpbox h3 { margin: 12px 0 4px; }

/* the panels show after the first render: the header can change its height when the script fills it,
   and nothing visible may move then (Lighthouse layout shift) */
body:not(.ready) main, body:not(.ready) footer { visibility: hidden; }

/* named effect chain note: "(Soldier's Focus, Marching Orders)" */
.facts .via { opacity: .65; font-size: 11px; margin-left: 4px; }
/* tooltips taller than the window: fact list in columns (place() in app.js) */
:is(#tip, #tip2).wide2 { width: 720px; }
:is(#tip, #tip2).wide3 { width: 1060px; }
:is(#tip, #tip2).wide2 ul.facts { column-count: 2; column-gap: 18px; }
:is(#tip, #tip2).wide3 ul.facts { column-count: 3; column-gap: 18px; }
:is(#tip, #tip2).wide2 ul.facts li, :is(#tip, #tip2).wide3 ul.facts li { break-inside: avoid; }
/* pet row: the traits a pet swap sets off (hover) */
.petswap { font-size: 11px; color: var(--gold); border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px; cursor: default; white-space: nowrap; }

/* ---- buffs column: "Fight state" (inputs) over "Active now" (effects), Claudio 2026-12-05 ---- */
#buffs { display: flex; flex-direction: column; gap: 6px; }
#buffs .fight { display: flex; flex-direction: column; gap: 5px; }
#buffs .fsrow h3 { margin: 0 0 3px; display: flex; align-items: center; gap: 6px; }
#buffs .chips { display: flex; flex-wrap: wrap; gap: 3px; }
#buffs .boonrow + .chips { margin-top: 3px; }
.chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 1px 6px 1px 2px; border: 1px solid var(--line); border-radius: 5px;
  background: #ffffff08; color: var(--muted); font-size: 11.5px; line-height: 20px; white-space: nowrap; }
.chip > span { overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.chip img { width: 18px; height: 18px; border-radius: 3px; filter: grayscale(1) brightness(.6); }
.chip.on { border-color: var(--gold); color: var(--text); background: #e8c26a14; }
.chip.on img { filter: none; }
.chip.step button { padding: 0 4px; min-width: 16px; line-height: 16px; font-size: 11px; }
.chip.step input { width: 30px; padding: 0 2px; font-size: 11px; text-align: center; }
.chip.step input.wide { width: 52px; }
.boonbtn { position: relative; }
.boonbtn .uses { position: absolute; right: -3px; bottom: -3px; font-style: normal; font-size: 9px; line-height: 12px; min-width: 12px; padding: 0 2px;
  border-radius: 6px; background: var(--gold); color: #000; font-weight: 700; }
#buffs h2.acth { margin: 4px 0 0; border-top: 1px solid var(--line); padding-top: 6px; }
#buffs .active { display: flex; flex-direction: column; gap: 2px; }
.arow { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 6px; align-items: center;
  padding: 1px 4px; border-radius: 5px; background: #ffffff06; font-size: 12px; }
.arow img, .arow .icon { width: 20px; height: 20px; border-radius: 3px; grid-row: 1 / 3; }
.arow .aval { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arow .asrc { grid-column: 2; grid-row: 2; color: var(--muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arow .atrig { grid-column: 3; grid-row: 1 / 3; font-size: 10.5px; padding: 0 5px; border-radius: 4px; border: 1px solid #e8c26a66; color: var(--gold); white-space: nowrap; }
.arow .atrig.hand { border-color: var(--line); color: var(--muted); }
.arow.always { grid-template-columns: auto 1fr; }
.arow.always .icons { display: flex; gap: 2px; grid-row: 1; }
.arow.always .icons img { width: 16px; height: 16px; }
.arow.always .aval { color: var(--muted); }
.waiting { font-size: 11px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.wchip { font-size: 11px; padding: 0 5px; border: 1px dashed var(--line); border-radius: 4px; background: none; color: var(--muted); }
.wchip i { font-style: normal; color: var(--gold); }
button.wchip:hover { border-color: var(--gold); color: var(--text); }
/* too many rows: one line per effect (source in the hover) */
#buffs.dense1 .arow .asrc { display: none; }
#buffs.dense1 .arow img { grid-row: 1; width: 16px; height: 16px; }
#buffs.dense2 .chip > span { max-width: 90px; }
button.chip { padding: 1px 6px 1px 2px; border-radius: 5px; }
.chip.step button { border-radius: 3px; border: none; background: #ffffff10; }
.chip.step input { width: 34px; padding: 0 2px; border-radius: 3px; height: 18px; }
.chip.step input.wide { width: 52px; }
#buffs .boonbtn img { width: 26px; height: 26px; }
.wchip { padding: 0 5px; border-radius: 4px; }

/* Short tooltips: "From your build" separator, one line per source, Shift hint */
:is(#tip, #tip2) li.buildsep { display: block; margin: 4px 0 2px; border-top: 1px solid #444; padding-top: 2px; font-size: 11px; color: #9aa; text-transform: uppercase; letter-spacing: .04em; }
:is(#tip, #tip2) li.buildsep img { display: none; }
:is(#tip, #tip2) li.buildmark { display: none; }
:is(#tip, #tip2) li.srcline { align-items: flex-start; }
:is(#tip, #tip2) li.srcline img { width: 16px; height: 16px; }
:is(#tip, #tip2) li.srcline b { color: #cdb; font-weight: 600; }
:is(#tip, #tip2) p.tiphint { margin: 4px 0 0; font-size: 11px; color: #889; font-style: italic; }

/* coverage tooltip: stays open under the mouse, each source line has its own tooltip in #tip2 */
#tip.hold { pointer-events: auto; }
#tip2 { z-index: 41; }
#tip li.subtip { cursor: help; border-radius: 3px; }
#tip li.subtip:hover { background: #ffffff12; }

/* tooltip lines of effects that are not on now */
:is(#tip, #tip2) li.dim { opacity: .5; }
:is(#tip, #tip2) li.dim small.why { color: #aab; font-style: italic; }
