:root {
  --bg: #0b0706;
  --panel: #160f0c;
  --panel-2: #1e1511;
  --line: #3b2a1e;
  --line-soft: #2a1e16;
  --gold: #e0b45a;
  --gold-2: #f4d58d;
  --gold-dim: #8f6c33;
  --red: #9e1c17;
  --red-2: #c8322a;
  --text: #efe6d6;
  --muted: #a49482;
  --tank: #4a90d9;
  --healer: #3fbf6f;
  --dps: #d9534a;
  --none: #6b625a;
  --keen: #e8b84a;
  --happy: #7fb069;
  --ifneeded: #8a8f98;
  --bad: #e0483e;
  --warn: #e8a33a;
  --good: #59b86a;
  --radius: 10px;
  --head: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --body: 'Alegreya Sans', system-ui, sans-serif;
  --wow: 'Friz Quadrata TT', 'Friz Quadrata Std', 'Friz Quadrata', 'Marcellus', Georgia, serif;
  --guild-green: #40ff40;
  --banner-top: #5c0f0c;
  --banner-bottom: #280806;
  --faction-glow: 200, 50, 42;
  --primary-top: #c3302a;
  --primary-bottom: #7d1511;
  --primary-hover-top: #d63a33;
  --primary-hover-bottom: #8f1a15;
  --field-bg: #0e0907;
  --tile-bg: #110b09;
  --selection-top: #5a1612;
  --selection-bottom: #3a0e0b;
}

:root[data-faction="alliance"] {
  --bg: #080d16;
  --panel: #101c2c;
  --panel-2: #16263a;
  --line: #35485e;
  --line-soft: #26374c;
  --red: #174783;
  --red-2: #2868aa;
  --text: #e3eaf3;
  --muted: #a7b5c8;
  --banner-top: #173b68;
  --banner-bottom: #0b1b34;
  --faction-glow: 45, 105, 185;
  --primary-top: #2868aa;
  --primary-bottom: #123968;
  --primary-hover-top: #347bc2;
  --primary-hover-bottom: #194b85;
  --field-bg: #0a1423;
  --tile-bg: #0c1829;
  --selection-top: #214c7b;
  --selection-bottom: #102b4b;
}
:root[data-faction="alliance"] body {
  background-image:
    radial-gradient(ellipse 90% 50% at 50% -5%, rgba(30, 79, 148, .45), transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(35, 82, 151, .12), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .012) 0 2px, transparent 2px 6px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 90% 50% at 50% -5%, rgba(158, 28, 23, 0.45), transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(158, 28, 23, 0.12), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 6px);
  background-attachment: fixed;
  color: var(--text);
  font: 17px/1.45 var(--body);
  font-variant-numeric: lining-nums tabular-nums;
  min-height: 100vh;
}
img { display: block; }
button, input, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); font-weight: 400; }
[hidden] { display: none !important; }

/* ---------- banner ---------- */
.banner {
  border-bottom: 1px solid var(--gold-dim);
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.15) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, var(--banner-top), var(--banner-bottom));
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), inset 0 -1px 0 rgba(224, 180, 90, 0.25);
  position: sticky; top: 0; z-index: 20;
}
.banner-inner { max-width: 1200px; margin: 0 auto; padding: 18px 16px 10px; display: flex; gap: 16px; align-items: center; }
.crest {
  width: 64px; height: 64px; flex: none; border-radius: 50%;
  padding: 4px; background: conic-gradient(from 45deg, var(--gold-dim), var(--gold-2), var(--gold-dim), var(--gold), var(--gold-dim));
  box-shadow: 0 0 0 2px #000, 0 0 20px rgba(var(--faction-glow), 0.6);
}
.crest img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid #000; }
.eyebrow { margin: 0; font: 600 12px/1 var(--body); letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); opacity: 0.85; }
h1 {
  margin: 4px 0 2px; font: 900 clamp(24px, 4vw, 38px)/1.05 var(--head); letter-spacing: 0.04em;
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 55%, #a8772c);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}
.sub { margin: 0; color: var(--text); font-size: 15px; }
.sub b { color: var(--gold-2); }
.r-tank { color: var(--tank); } .r-healer { color: var(--healer); } .r-dps { color: var(--dps); }

.tabs { max-width: 1200px; margin: 0 auto; padding: 0 16px; display: flex; flex-wrap: wrap; gap: 4px; }
.tabs { overflow-y: hidden; scrollbar-width: thin; }
html[data-edit-mode="off"] .pen,
html[data-edit-mode="off"] .sp-grip,
html[data-edit-mode="off"] .sp-edit,
html[data-edit-mode="off"] [data-sp-new],
html[data-edit-mode="off"] [data-sp-save],
html[data-edit-mode="off"] [data-sp-add-team],
html[data-edit-mode="off"] .sp-menu,
html[data-edit-mode="off"] .sp-size { display: none; }
html[data-edit-mode="off"] .nm-btn { pointer-events: none; cursor: default; }
.tabs a {
  padding: 10px 18px 11px; font: 700 14px/1 var(--head); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; border: 1px solid transparent; border-bottom: none;
  border-radius: 8px 8px 0 0; white-space: nowrap; transition: color 0.15s, background 0.15s;
}
.tabs a:hover { color: var(--gold-2); }
.tabs a[aria-selected="true"] {
  color: var(--gold-2); background: var(--bg); border-color: var(--gold-dim);
  box-shadow: inset 0 2px 0 var(--red-2); margin-bottom: -1px;
}

main { max-width: 1200px; margin: 0 auto; padding: 22px 16px 40px; }

/* ---------- panels ---------- */
.panel {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  position: relative;
}
.panel::before {
  content: ''; position: absolute; inset: 0 30% auto; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}
h2 { margin: 0 0 14px; font: 700 18px/1.2 var(--head); letter-spacing: 0.06em; color: var(--gold); }
h3 { margin: 0; font: 700 16px/1.1 var(--head); letter-spacing: 0.04em; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.two-col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
.two-col .panel { margin-bottom: 0; }

/* ---------- icons ---------- */
.ico {
  width: 32px; height: 32px; border-radius: 5px; flex: none;
  border: 1px solid #000; box-shadow: 0 0 0 1px rgba(143, 108, 51, 0.55);
}
.ico.xs { width: 18px; height: 18px; border-radius: 3px; box-shadow: none; }
.ico.sm { width: 24px; height: 24px; border-radius: 4px; }
.ico.md { width: 40px; height: 40px; }
.ico.lg { width: 46px; height: 46px; border-radius: 7px; }

/* ---------- buttons & inputs ---------- */
.btn {
  border: 1px solid var(--gold-dim); border-radius: 8px; padding: 10px 18px; cursor: pointer;
  background: rgba(255, 255, 255, 0.03); font-weight: 700; transition: transform 0.1s, background 0.15s, border-color 0.15s;
}
.btn:hover { border-color: var(--gold); background: rgba(224, 180, 90, 0.08); }
.btn:active { transform: translateY(1px); }
.btn.small { padding: 6px 12px; font-size: 14px; }
.btn.primary {
  background: linear-gradient(180deg, var(--primary-top), var(--primary-bottom)); border-color: #e0b45a; color: #fff6e0;
  font-family: var(--head); letter-spacing: 0.06em; padding: 12px 24px;
  box-shadow: 0 4px 18px rgba(var(--faction-glow), 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn.primary:hover { background: linear-gradient(180deg, var(--primary-hover-top), var(--primary-hover-bottom)); }
.btn.primary:disabled { opacity: 0.6; cursor: wait; }
.btn.danger { border-color: #6d2420; color: #f0a39d; }
.btn.danger:hover { background: rgba(224, 72, 62, 0.12); border-color: var(--bad); }
.btn.ghost { background: transparent; }
.link-btn { background: none; border: none; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--gold); }

input, textarea {
  width: 100%; background: var(--field-bg); border: 1px solid var(--line); border-radius: 8px; padding: 11px 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, button:focus-visible, .tabs a:focus-visible {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(224, 180, 90, 0.2);
}
textarea { resize: vertical; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--field-bg); flex-wrap: wrap; }
.seg button { border: none; background: none; padding: 8px 14px; cursor: pointer; color: var(--muted); font-weight: 700; font-size: 14px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { color: var(--text); }
.seg button[aria-checked="true"] { background: linear-gradient(180deg, var(--selection-top), var(--selection-bottom)); color: var(--gold-2); }

/* ---------- form ---------- */
.form { max-width: 920px; margin: 0 auto 18px; }
.form-head h2 { font-size: 24px; margin-bottom: 4px; }
.hint { color: var(--muted); margin: 0 0 12px; font-size: 15px; }
.hint strong { color: var(--text); }
.field { margin: 18px 0 8px; max-width: 360px; }
.label { display: block; font-weight: 800; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); margin: 16px 0 8px; }
.label.inline { display: inline; margin: 0 8px 0 0; }
.block { border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 6px 16px 16px; margin: 18px 0 0; background: rgba(0, 0, 0, 0.18); }
.block legend { font: 700 16px/1.3 var(--head); letter-spacing: 0.04em; color: var(--gold-2); padding: 0 8px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.step {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--red); color: #fff; font: 700 13px/1 var(--body); box-shadow: 0 0 0 1px var(--gold-dim);
}

.tile-grid.classes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 760px) { .tile-grid.classes { grid-template-columns: repeat(9, minmax(0, 1fr)); } }
.tile-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tile {
  --c: var(--gold);
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 8px;
  background: var(--tile-bg); border: 1px solid var(--line); border-radius: 9px; cursor: pointer; text-align: center;
  font-weight: 700; font-size: 14px; transition: border-color 0.12s, background 0.12s, transform 0.12s;
  position: relative;
}
.tile:hover:not(:disabled) { border-color: color-mix(in srgb, var(--c) 60%, transparent); transform: translateY(-1px); }
.tile[aria-checked="true"] {
  border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--tile-bg));
  box-shadow: 0 0 0 1px var(--c), 0 0 18px color-mix(in srgb, var(--c) 30%, transparent);
}
.tile[aria-checked="true"] > span:first-of-type { color: var(--c); }
.tile:disabled { opacity: 0.28; cursor: not-allowed; filter: grayscale(1); }
.tile small { font-size: 11px; color: var(--muted); font-weight: 500; margin-top: -4px; }
.tile .new, .new { font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #1a0f05; background: var(--gold); padding: 1px 5px; border-radius: 4px; }
.tile small.new { position: absolute; top: 4px; right: 4px; margin: 0; color: #1a0f05; }
.spec-tile, .race-tile { min-width: 104px; }
.spec-tile.undecided { opacity: 0.85; }
.role-mini { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.role-mini.r-tank { color: var(--tank); } .role-mini.r-healer { color: var(--healer); } .role-mini.r-dps { color: var(--dps); }

.tile-grid.mini { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.tile.mini { padding: 5px; border-radius: 7px; }
.tile-row.mini .tile.mini { flex-direction: row; gap: 6px; padding: 5px 10px 5px 6px; font-size: 13px; min-width: 0; }

.alt-row { border: 1px dashed var(--line); border-radius: 9px; padding: 10px 12px; margin-bottom: 10px; background: rgba(255, 255, 255, 0.015); }
.alt-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.alt-rank { font: 700 14px/1 var(--head); color: var(--gold-2); min-width: 96px; }
.seg.will button { padding: 6px 12px; font-size: 13px; }
.seg.will .w-keen[aria-checked="true"] { background: rgba(232, 184, 74, 0.2); color: var(--keen); }
.seg.will .w-happy[aria-checked="true"] { background: rgba(127, 176, 105, 0.2); color: var(--happy); }
.seg.will .w-ifneeded[aria-checked="true"] { background: rgba(138, 143, 152, 0.2); color: #c6cad1; }
.x { margin-left: auto; background: none; border: 1px solid transparent; border-radius: 6px; color: var(--muted); cursor: pointer; padding: 4px 8px; }
.x:hover { color: var(--bad); border-color: var(--line); }

.form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.form-msg { margin: 0; flex: 1 1 240px; font-weight: 700; }
.form-msg.error { color: #ff8a80; }
.form-msg.success { color: #8ee09a; }
.form-msg.info { color: var(--gold-2); font-weight: 500; }

.owned-bar {
  max-width: 920px; margin: 0 auto 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(0, 0, 0, 0.3);
}
.owned { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; border-radius: 7px; border: 1px solid var(--line); background: var(--tile-bg); cursor: pointer; color: var(--c); font-weight: 700; }
.owned.on { border-color: var(--c); }

/* ---------- composition ---------- */
.comp-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.role-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 18px; }
.role-card {
  --rc: var(--none);
  background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 12%, var(--panel-2)), var(--panel));
  border: 1px solid color-mix(in srgb, var(--rc) 45%, var(--line)); border-top: 3px solid var(--rc);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
}
.rc-top { display: flex; gap: 12px; align-items: center; }
.rc-label { font: 700 17px/1.1 var(--head); letter-spacing: 0.05em; color: var(--rc); }
.role-card.undecided .rc-label { color: var(--muted); }
.rc-status { font-weight: 800; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; margin-top: 3px; }
.role-card.bad .rc-status { color: var(--bad); }
.role-card.warn .rc-status { color: var(--warn); }
.role-card.good .rc-status { color: var(--good); }
.role-card.undecided .rc-status { color: var(--muted); }
.rc-num { margin: 12px 0 6px; display: flex; align-items: baseline; gap: 8px; }
.rc-num b { font: 900 40px/1 var(--head); }
.rc-num span { color: var(--muted); font-size: 14px; }
.meter { height: 8px; border-radius: 4px; background: rgba(0, 0, 0, 0.45); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); }
.meter i { display: block; height: 100%; background: var(--rc); border-radius: 4px; box-shadow: 0 0 10px var(--rc); }
.rc-flex { margin-top: 10px; font-size: 14px; line-height: 1.7; }

.flex-name { display: inline-block; padding: 0 7px; margin: 0 3px 3px 0; border-radius: 10px; font-weight: 700; font-size: 13px; line-height: 20px; border: 1px solid; }
.flex-name.w-keen { color: var(--keen); border-color: rgba(232, 184, 74, 0.45); background: rgba(232, 184, 74, 0.08); }
.flex-name.w-happy { color: var(--happy); border-color: rgba(127, 176, 105, 0.45); background: rgba(127, 176, 105, 0.08); }
.flex-name.w-ifneeded { color: #c0c4cb; border-color: rgba(138, 143, 152, 0.4); }
.nm { color: var(--c); font-weight: 700; }
.nm.big { font-size: 17px; }

.stack-bar { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 12px; }
.bar-label { font-size: 14px; color: var(--muted); font-weight: 700; }
.bar { display: flex; height: 30px; border-radius: 6px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5); }
.bar.target { height: 16px; opacity: 0.6; font-size: 11px; }
.bar > span { display: grid; place-items: center; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); min-width: 2px; }
.bar > span + span { border-left: 2px solid var(--panel); }
.seg-tank { background: var(--tank); } .seg-healer { background: var(--healer); } .seg-dps { background: var(--dps); } .seg-none { background: var(--none); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; font-size: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend.small { font-size: 13px; margin: 0; gap: 12px; color: var(--muted); }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.insights { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ins { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: start; padding: 10px 12px; border-radius: 8px; background: rgba(0, 0, 0, 0.25); border-left: 3px solid var(--none); line-height: 1.7; }
.ins .ico { display: inline-block; vertical-align: -6px; margin-right: 4px; }
.ins-tag { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 0; text-align: center; border-radius: 4px; margin-top: 3px; }
.ins.gap { border-left-color: var(--bad); } .ins.gap .ins-tag { background: rgba(224, 72, 62, 0.18); color: #ff8a80; }
.ins.warn { border-left-color: var(--warn); } .ins.warn .ins-tag { background: rgba(232, 163, 58, 0.16); color: var(--warn); }
.ins.info { border-left-color: var(--gold-dim); } .ins.info .ins-tag { background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.ins.ok { border-left-color: var(--good); } .ins.ok .ins-tag { background: rgba(89, 184, 106, 0.16); color: var(--good); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 3px; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); background: color-mix(in srgb, var(--c) 8%, transparent); color: var(--c); font-weight: 700; font-size: 13px; line-height: 22px; }
.chip .ico { margin: 0; vertical-align: 0; }
.chip em { font-style: normal; color: var(--happy); font-weight: 800; font-size: 12px; }

.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.class-card { border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: var(--radius); background: linear-gradient(180deg, color-mix(in srgb, var(--c) 7%, #130d0a), #110b09); padding: 12px 14px; display: flex; flex-direction: column; }
.class-card header { display: flex; align-items: center; gap: 10px; }
.cc-title { flex: 1; min-width: 0; }
.cc-title h3 { color: var(--c); }
.cc-title .muted { font-size: 13px; }
.cc-count { font: 900 30px/1 var(--head); color: var(--text); }
.tag { font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 6px; border-radius: 4px; }
.tag.gap { background: rgba(224, 72, 62, 0.2); color: #ff8a80; }
.tag.warn { background: rgba(232, 163, 58, 0.18); color: var(--warn); }
.cc-bar { height: 4px; background: rgba(0, 0, 0, 0.5); border-radius: 2px; margin: 10px 0 8px; overflow: hidden; }
.cc-bar i { display: block; height: 100%; background: var(--c); }
.spec-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.spec-list li { display: grid; grid-template-columns: 24px 1fr 18px minmax(0, auto) 22px; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 6px; font-size: 15px; }
.spec-list li:nth-child(odd) { background: rgba(255, 255, 255, 0.02); }
.spec-list li.is-gap { background: rgba(224, 72, 62, 0.07); }
.spec-list li.is-gap .sp-name { color: #f0a39d; }
.spec-list li.nospec .sp-name { color: var(--muted); font-style: italic; }
.sp-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-count { text-align: right; font-weight: 800; }
.gap-dash { color: var(--bad); }
.role-ico { opacity: 0.9; }
.pips { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; max-width: 110px; }
.pip { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.pip.main { background: var(--c, var(--gold)); box-shadow: 0 0 4px var(--c, var(--gold)); }
.pip.keen { border: 2px solid var(--keen); }
.pip.happy { border: 2px solid var(--happy); }
.pip.ifneeded { border: 2px solid var(--ifneeded); }
.legend .pip.main { --c: var(--gold); }
.class-card footer { margin-top: auto; padding-top: 10px; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 14px; border-top: 1px solid var(--line-soft); margin-top: 10px; }

.utility { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.util { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line-soft); }
.util div { display: flex; flex-direction: column; line-height: 1.2; font-size: 14px; }
.util .muted { font-size: 12px; }
.util-st { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.util.have .util-st { color: var(--good); }
.util.flex .util-st { color: var(--warn); }
.util.miss { opacity: 0.85; border-color: rgba(224, 72, 62, 0.35); }
.util.miss .util-st { color: var(--bad); }
.util.miss .ico { filter: grayscale(1); }

.race-bars { display: grid; gap: 8px; }
.race-row { display: grid; grid-template-columns: 24px 110px 1fr 28px; gap: 10px; align-items: center; font-size: 15px; }
.race-name { font-weight: 700; }
.hbar { height: 10px; background: rgba(0, 0, 0, 0.45); border-radius: 5px; overflow: hidden; }
.hbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--red-2)); }
.race-row b { text-align: right; }

/* ---------- roster ---------- */
.roster-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.roster-toolbar input { max-width: 220px; }
.class-filter { display: flex; gap: 4px; flex-wrap: wrap; }
.cf { padding: 3px; border-radius: 6px; border: 1px solid transparent; background: none; cursor: pointer; opacity: 0.55; }
.cf:hover { opacity: 1; }
.cf.on { opacity: 1; border-color: var(--c); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 40%, transparent); }
.table-wrap { overflow-x: auto; }
table.roster { width: 100%; border-collapse: collapse; }
.roster th { text-align: left; font: 700 12px/1 var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); padding: 10px; border-bottom: 1px solid var(--gold-dim); }
.roster td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.roster tbody tr:hover { background: rgba(224, 180, 90, 0.04); }
.main-cell { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; white-space: nowrap; }
.role-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 4px; border-radius: 12px; font-size: 13px; font-weight: 800; border: 1px solid; }
.role-pill.r-tank { color: var(--tank); border-color: rgba(74, 144, 217, 0.5); background: rgba(74, 144, 217, 0.1); }
.role-pill.r-healer { color: var(--healer); border-color: rgba(63, 191, 111, 0.5); background: rgba(63, 191, 111, 0.1); }
.role-pill.r-dps { color: var(--dps); border-color: rgba(217, 83, 74, 0.5); background: rgba(217, 83, 74, 0.1); }
.role-pill.r-none { color: var(--muted); border-color: var(--line); padding-left: 9px; }
.alt-list { display: flex; flex-wrap: wrap; gap: 5px; }
.alt-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 3px; border-radius: 6px; font-size: 13px; font-weight: 700; border: 1px solid; background: rgba(0, 0, 0, 0.3); }
.alt-chip.w-keen { border-color: rgba(232, 184, 74, 0.6); color: var(--keen); }
.alt-chip.w-happy { border-color: rgba(127, 176, 105, 0.55); color: var(--happy); }
.alt-chip.w-ifneeded { border-color: rgba(138, 143, 152, 0.45); color: #c0c4cb; border-style: dashed; }
.badge { font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; color: var(--muted); border: 1px solid var(--line); vertical-align: 2px; }
.you { font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; color: #1a0f05; background: var(--gold); vertical-align: 2px; }
.note { color: var(--muted); font-size: 13px; margin-top: 2px; max-width: 260px; }
td.act { text-align: right; }
.empty { color: var(--muted); text-align: center; padding: 24px; }

/* ---------- misc ---------- */
footer { max-width: 1200px; margin: 0 auto; padding: 0 16px 30px; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 14px; }
dialog { background: var(--panel-2); color: var(--text); border: 1px solid var(--gold-dim); border-radius: var(--radius); padding: 22px; width: min(380px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7); }
dialog::backdrop { background: rgba(0, 0, 0, 0.7); }
dialog h3 { color: var(--gold); margin-bottom: 6px; font-size: 20px; }
.tooltip {
  position: absolute; z-index: 50; pointer-events: none; max-width: 260px;
  background: #0d0806; border: 1px solid var(--gold-dim); color: var(--text); border-radius: 6px;
  padding: 6px 10px; font-size: 13px; font-weight: 500; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; }
  .two-col .panel { margin-bottom: 0; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .banner { position: static; }
  .banner-inner { padding-top: 14px; }
  .crest { width: 48px; height: 48px; }
  .tabs a { padding: 10px 12px 11px; font-size: 13px; letter-spacing: 0.05em; }
  .panel { padding: 14px; }
  .block { padding: 4px 10px 12px; }
  .tile-grid.classes { grid-template-columns: repeat(3, 1fr); }
  .spec-tile:not(.mini), .race-tile { min-width: calc(33% - 6px); flex: 1 1 calc(33% - 6px); }
  .bar-row { grid-template-columns: 1fr; gap: 4px; }
  .ins { grid-template-columns: 1fr; gap: 4px; }
  .ins-tag { justify-self: start; padding: 3px 8px; }
  .roster-toolbar input { max-width: none; }
  table.roster thead { display: none; }
  table.roster, .roster tbody, .roster tr, .roster td { display: block; width: 100%; }
  .roster tr { border: 1px solid var(--line); border-radius: 9px; margin-bottom: 10px; padding: 6px 4px; background: rgba(0, 0, 0, 0.2); }
  .roster td { border: none; padding: 5px 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
  .roster td[data-h]::before { content: attr(data-h); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-dim); min-width: 80px; }
  .roster td[data-h="Name"]::before { display: none; }
  td.act { justify-content: flex-end; }
  .race-row { grid-template-columns: 24px 90px 1fr 24px; }
  footer { flex-direction: column; }
}

/* ---------- guild tag (WoW nameplate green) ---------- */
h1.guild-tag {
  font-family: var(--wow); font-weight: 400; letter-spacing: 0.02em;
  font-size: clamp(30px, 4.6vw, 46px);
  background: none; -webkit-background-clip: border-box; background-clip: border-box;
  color: var(--guild-green);
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0 2px 3px #000, 0 0 18px rgba(64, 255, 64, 0.25);
}

/* ---------- raid frames / nameplates ---------- */
.raid-group { margin-bottom: 18px; }
.rg-head {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; margin-bottom: 8px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.55), transparent); border-left: 3px solid var(--gold-dim); border-radius: 4px;
}
.rg-head h3 { font-family: var(--wow); font-weight: 400; font-size: 17px; color: var(--gold-2); letter-spacing: 0.04em; }
.rg-count { margin-left: auto; font: 700 13px/1 var(--body); color: var(--muted); background: rgba(255, 255, 255, 0.06); padding: 3px 8px; border-radius: 10px; }
.g-tank .rg-head { border-left-color: var(--tank); }
.g-healer .rg-head { border-left-color: var(--healer); }
.g-dps .rg-head { border-left-color: var(--dps); }

.frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.plate {
  background: rgba(8, 5, 4, 0.85); border: 1px solid #000; border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(143, 108, 51, 0.45), 0 6px 14px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.plate-bar {
  position: relative; display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 6px 0 5px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--c) 88%, #fff) 0%, var(--c) 40%,
    color-mix(in srgb, var(--c) 62%, #000) 100%);
  border-bottom: 1px solid #000;
}
.plate-bar::after { /* glossy health-bar sheen */
  content: ''; position: absolute; inset: 0 0 50% 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.04));
}
.plate-bar > * { position: relative; z-index: 1; }
.plate-role { box-shadow: 0 0 0 1px #000; }
.plate-name {
  font-family: var(--wow); font-size: 18px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0 0 4px #000;
}
.plate-asg { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; }
.plate-bar .pen { color: #fff; filter: drop-shadow(0 0 1px #000) drop-shadow(0 0 1px #000); }
.plate-body { padding: 6px 8px 7px; display: grid; gap: 5px; }
.plate-line { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; font-size: 14px; }
.pl-item { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }
.pl-spec { color: var(--c); }
.pl-label { font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-dim); }
.plate .alt-list { gap: 4px; }
.plate .note { max-width: none; }
.plate .badge { margin-left: auto; }

.asg {
  display: inline-grid; place-items: center; min-width: 30px; height: 20px; padding: 0 6px; border-radius: 3px;
  font: 800 11px/1 var(--body); letter-spacing: 0.06em; color: #fff; border: 1px solid #000;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25); text-shadow: 0 1px 1px #000;
}
.asg-mt { background: linear-gradient(180deg, #f3c44f, #a87510); color: #1a0f05; text-shadow: none; }
.asg-ot { background: linear-gradient(180deg, #5aa2ea, #24578f); }
.asg-flex { background: linear-gradient(180deg, #c08bff, #6a3aa8); }
.asg-healLead { background: linear-gradient(180deg, #52d283, #1f7a43); }
.asg-raidLead { background: linear-gradient(180deg, #e2483d, #7d1511); }
.asg.none { background: #2a201a; color: var(--muted); }

.pen {
  display: inline-grid; place-items: center; width: 20px; height: 20px; padding: 0; flex: none;
  background: none; border: 1px solid transparent; border-radius: 4px; color: var(--muted); cursor: pointer;
  opacity: 0.55; transition: opacity 0.12s, color 0.12s, border-color 0.12s, background 0.12s;
}
.plate:hover .pen { opacity: 0.85; }
.pen:hover, .pen:focus-visible { opacity: 1; color: var(--gold-2); border-color: var(--gold-dim); background: rgba(0, 0, 0, 0.45); }

.nm-btn { background: none; border: none; padding: 0; cursor: pointer; font: inherit; font-weight: 700; color: var(--c); text-decoration: underline dotted rgba(255, 255, 255, 0.25); text-underline-offset: 3px; }
.nm-btn:hover { text-decoration-color: var(--c); }

.rc-assign { display: grid; gap: 4px; margin-top: 10px; font-size: 14px; }
.rc-assign > span { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.small-note { font-size: 13px; }
.raid-panel .frames { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ---------- inline edit popover ---------- */
.editpop {
  position: absolute; z-index: 40; width: min(420px, calc(100vw - 16px));
  background: linear-gradient(180deg, #221813, #140d0a); border: 1px solid var(--gold-dim); border-radius: 8px;
  padding: 10px 12px 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 0 1px #000;
}
.editpop .label { margin: 10px 0 6px; }
.pop-head { display: flex; align-items: center; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.pop-head .nm { font-family: var(--wow); font-weight: 400; font-size: 17px; }
.pop-head .muted { font-size: 13px; }
.pop-head .x { margin-left: auto; }
.pop-classes { margin-top: 10px !important; }
.pop-hint { margin: 8px 0 0; font-size: 13px; }
.editpop .tile-grid.mini { margin: 0; }
.pop-name { display: flex; gap: 8px; margin-top: 10px; }
.pop-list { display: grid; gap: 4px; margin-top: 8px; }
.pop-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; cursor: pointer;
  background: #110b09; border: 1px solid var(--line); font-weight: 700; text-align: left;
}
.pop-row:hover { border-color: var(--gold-dim); }
.pop-row[aria-checked="true"] { border-color: var(--gold); background: rgba(224, 180, 90, 0.1); }
.pop-opt[aria-checked="true"] { border-color: var(--gold); }
.editpop .tile-row.mini { margin-top: 0; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60;
  background: #15250f; border: 1px solid #3c7a2c; color: #c8f5bb; padding: 10px 16px; border-radius: 8px;
  font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); max-width: calc(100vw - 32px);
}
.toast.error { background: #2a0f0d; border-color: #8a2a22; color: #ffb3ab; }

@media (hover: none) { .pen { opacity: 0.8; } }
@media (max-width: 680px) {
  .frames, .raid-panel .frames { grid-template-columns: 1fr; }
}

/* ---------- professions ---------- */
.form-profs, .pop-profs { display: grid; gap: 10px; margin-top: 4px; }
.prof-group { display: grid; gap: 6px; }
.prof-tile[aria-pressed="true"] {
  border-color: var(--gold); background: rgba(224, 180, 90, 0.12); color: var(--gold-2);
  box-shadow: 0 0 0 1px var(--gold), 0 0 12px rgba(224, 180, 90, 0.25);
}
.tile-row.mini .prof-tile { flex-direction: row; gap: 6px; padding: 5px 10px 5px 6px; font-size: 13px; }
.prof-list { display: flex; flex-wrap: wrap; gap: 4px; }
.prof-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 3px; border-radius: 6px; font-size: 13px; font-weight: 700; color: var(--gold-2); border: 1px solid rgba(224, 180, 90, 0.35); background: rgba(0, 0, 0, 0.3); }
.prof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.prof-card { padding: 8px 10px; border-radius: 8px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line-soft); }
.prof-card.empty-prof { opacity: 0.6; }
.prof-top { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.prof-top .muted { font-size: 12px; }
.prof-count { margin-left: auto; font: 900 20px/1 var(--head); }
.prof-names { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; font-size: 14px; }
.form-head:has(h2[hidden]) { display: none; }
.plate-line.main-line { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.main-line .pl-item { min-width: 0; }
.main-line .pl-spec { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- split setups ---------- */
.scope-bar { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.comp-splits-entry { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.comp-splits-entry > div { flex: 1 1 260px; }
.comp-splits-entry p { margin: 6px 0 0; }
.comp-splits-entry a { text-decoration: none; }
.sp-scope-label { margin-left: 10px; }
select { background: #0e0907; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--text); font: inherit; font-size: 14px; max-width: 100%; }
select:focus-visible { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(224, 180, 90, 0.2); }
select:disabled, input:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Build Raid workspace ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.sp-banners:empty { display: none; }
.sp-banner { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; border-left: 3px solid var(--warn); background: rgba(0, 0, 0, 0.3); font-weight: 600; }
.sp-banner.bad { border-left-color: var(--bad); color: #ffb3ab; }
.sp-banner.warn { color: var(--gold-2); }
.sp-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.sp-bar h2 { margin: 0; }
.sp-build-name { width: 220px; max-width: 100%; height: 36px; padding: 6px 10px; }
.sp-status { font-size: 14px; color: var(--muted); }
.sp-status.dirty { color: var(--warn); font-weight: 700; }
.sp-status.saved { color: var(--good); }
.sp-bar-actions { margin-left: auto; display: inline-flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sp-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.sp-totals { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.sp-teams { display: grid; gap: 16px; }
.sp-team { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: rgba(0, 0, 0, 0.2); min-width: 0; }
.sp-team.full { border-color: color-mix(in srgb, var(--good) 40%, var(--line)); }
.sp-team-head { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.sp-team-name { flex: 1 1 140px; width: auto; min-width: 0; height: 36px; padding: 6px 10px; font-weight: 700; }
.sp-size button { min-width: 40px; height: 34px; padding: 0 10px; }
.sp-team-count { font: 700 14px/1 var(--body); color: var(--gold-2); min-width: 40px; text-align: right; }
.sp-main-badge { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--gold-dim); color: var(--gold-2); }
.sp-menu { position: relative; }
.sp-menu summary { list-style: none; cursor: pointer; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); font-size: 18px; line-height: 1; user-select: none; }
.sp-menu summary::-webkit-details-marker { display: none; }
.sp-menu summary:hover, .sp-menu[open] summary { border-color: var(--gold-dim); color: var(--text); }
.sp-menu summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sp-menu-pop { position: absolute; right: 0; top: 40px; z-index: 15; min-width: 190px; padding: 4px; display: grid; gap: 2px; background: var(--panel-2); border: 1px solid var(--gold-dim); border-radius: 8px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6); }
.sp-menu-pop button { text-align: left; height: 36px; padding: 0 12px; background: none; border: 0; border-radius: 6px; cursor: pointer; font-weight: 600; }
.sp-menu-pop button:hover:not(:disabled) { background: rgba(224, 180, 90, 0.1); }
.sp-menu-pop button.danger { color: #f0a39d; }
.sp-menu-pop button:disabled { opacity: 0.4; cursor: not-allowed; }

.sp-composition { margin-top: 12px; min-width: 0; }
.sp-comp-roles { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; font-size: 14px; }
.sp-comp-role { --rc: var(--none); display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 6px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--rc) 55%, var(--line)); background: color-mix(in srgb, var(--rc) 10%, transparent); }
.sp-comp-role.bad { --rc: var(--bad); } .sp-comp-role.warn { --rc: var(--warn); } .sp-comp-role.good { --rc: var(--good); }
.sp-comp-role strong { font-weight: 800; color: var(--text); }
.sp-comp-want, .sp-comp-undecided { color: var(--muted); }
.sp-comp-details { margin-top: 8px; }
.sp-comp-details summary { cursor: pointer; padding: 6px 2px; font-size: 14px; font-weight: 700; color: var(--gold-2); border-radius: 4px; min-height: 36px; display: flex; align-items: center; }
.sp-comp-details summary:hover { color: var(--gold); }
.sp-comp-details h5 { margin: 16px 0 8px; font: 700 13px/1.2 var(--head); color: var(--gold); }
.sp-comp-note { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.sp-comp-details .ins { grid-template-columns: 56px minmax(0, 1fr); line-height: 1.5; }
.sp-comp-details .utility { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.sp-party-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-top: 12px; }
.sp-party { border: 1px solid var(--line-soft); border-radius: 8px; padding: 8px; background: rgba(0, 0, 0, 0.18); min-width: 0; }
.sp-party.full { border-color: color-mix(in srgb, var(--good) 35%, var(--line-soft)); }
.sp-party-heading { display: flex; justify-content: space-between; margin: 0 0 8px; font: 700 13px/1.2 var(--head); color: var(--gold-2); }
.sp-party-heading span:last-child { font: 600 13px/1 var(--body); color: var(--muted); }
.sp-members { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.sp-empty-slot { height: 32px; border: 1px dashed var(--line); border-radius: 6px; opacity: 0.6; }
.sp-member { --rc: var(--none); display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 2px 4px 2px 0; border-radius: 6px; background: rgba(255, 255, 255, 0.04); border-left: 2px solid var(--rc); min-width: 0; }
.sp-member[data-role="tank"] { --rc: var(--tank); } .sp-member[data-role="healer"] { --rc: var(--healer); } .sp-member[data-role="dps"] { --rc: var(--dps); }
.sp-member:hover { background: rgba(224, 180, 90, 0.08); }
.sp-grip, .sp-edit { flex: none; display: grid; place-items: center; width: 28px; height: 32px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 6px; padding: 0; }
.sp-grip { cursor: grab; touch-action: none; user-select: none; font-size: 18px; line-height: 1; }
.sp-grip:hover, .sp-edit:hover:not(:disabled) { color: var(--gold-2); background: rgba(224, 180, 90, 0.1); }
.sp-grip:disabled, .sp-edit:disabled { opacity: 0.3; cursor: default; }
.sp-spec-icon { width: 18px; height: 18px; flex: none; border-radius: 3px; }
.sp-spec-unknown { display: grid; place-items: center; background: var(--none); color: #fff; font-size: 12px; font-weight: 700; }
.sp-member-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-role-text { font-size: 12px; color: var(--muted); flex: none; }
.sp-edit { margin-left: auto; width: 32px; }
.sp-add { margin-top: 16px; width: 100%; height: 40px; border-style: dashed; }

.sp-pool { position: sticky; top: 16px; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--gold-dim); border-radius: 8px; background: rgba(0, 0, 0, 0.28); min-width: 0; }
.sp-pool-head { display: flex; justify-content: space-between; align-items: center; }
.sp-pool-head h3 { color: var(--gold); font-size: 15px; }
.sp-pool-count { font-weight: 700; color: var(--muted); font-size: 14px; }
.sp-pool input[type="search"] { height: 36px; padding: 6px 10px; }
.sp-pool-list { overflow-y: auto; display: grid; gap: 12px; align-content: start; min-height: 80px; padding-right: 2px; }
.sp-pool-group h4 { margin: 0 0 4px; font: 700 12px/1.2 var(--body); color: var(--muted); }
.sp-pool-group h4 span { margin-left: 4px; }
.sp-note { margin: 0; padding: 12px 4px; color: var(--muted); font-size: 14px; text-align: center; }

.sp-dialog { width: min(420px, calc(100vw - 32px)); }
.sp-dialog h3 { margin: 0 0 4px; }
.sp-dialog-sub { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.sp-role-choices { border: 0; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.sp-role-choice { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 700; }
.sp-role-choice:has(input:checked) { border-color: var(--rc); background: color-mix(in srgb, var(--rc) 14%, transparent); }
.sp-role-choice:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.sp-role-choice input { accent-color: var(--gold); width: 16px; height: 16px; margin: 0; }
.sp-dialog-actions { display: flex; gap: 8px; align-items: center; margin-top: 16px; }
.sp-spacer { flex: 1; }
.sp-saved { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; max-height: 50dvh; overflow-y: auto; }
.sp-saved li { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border: 1px solid var(--line-soft); border-radius: 8px; }

.sp-dragging { opacity: 0.35; }
.sp-drop-over { outline: 2px dashed var(--gold); outline-offset: 2px; background-color: rgba(224, 180, 90, 0.1); }
.sp-drop-blocked { outline: 2px dashed var(--bad); outline-offset: 2px; }
.sp-drag-ghost { position: fixed; z-index: 100; pointer-events: none; opacity: 0.95; background: #211711; border: 1px solid var(--gold); box-shadow: 0 8px 24px #0009; }

select { background: var(--field-bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--text); font: inherit; font-size: 14px; max-width: 100%; height: 36px; }
select:disabled, input:disabled, .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.small { height: 36px; padding: 0 12px; }
.btn.primary.small { padding: 0 16px; }
a.btn { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.seg button { height: 36px; }
.sp-size.seg button { height: 34px; }
h2 { margin-bottom: 12px; }
.panel { background: var(--panel); }
.panel::before { display: none; }
.label { letter-spacing: 0.06em; }
.btn:hover:not(:disabled) { background: rgba(224, 180, 90, 0.1); }
.scope-bar { display: inline-flex; gap: 8px; flex-wrap: wrap; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

@media (max-width: 900px) {
  .sp-workspace { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .sp-pool { position: static; max-height: 320px; order: -1; }
  .sp-bar-actions { margin-left: 0; width: 100%; }
}
@media (max-width: 680px) {
  .sp-party-grid { grid-template-columns: minmax(0, 1fr); }
  .sp-grip, .sp-edit { height: 40px; }
  .sp-member { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .sp-drop-over, .sp-drop-blocked { outline-width: 3px; }
  .sp-member { border: 1px solid CanvasText; }
}

/* ---------- Unified UX pass: shared chrome, forms, composition, roster ---------- */
.banner { box-shadow: 0 4px 16px rgba(0,0,0,.45), inset 0 -1px 0 rgba(224,180,90,.2); }
.banner-inner { padding: 12px 16px 8px; gap: 12px; }
.crest { width: 48px; height: 48px; padding: 3px; box-shadow: 0 0 0 1px #000; }
h1 { font-size: clamp(22px, 3.4vw, 30px); margin: 2px 0; }
h1.guild-tag { font-size: clamp(24px, 3.6vw, 34px); }
.eyebrow { font-size: 11px; }
.sub { font-size: 14px; color: var(--muted); }
.tabs { gap: 0; }
.tabs a { padding: 10px 16px; min-height: 40px; font-size: 13px; }
main { padding: 16px 16px 32px; }
.panel { padding: 16px; margin-bottom: 16px; box-shadow: none; background: var(--panel); }
.panel::before { display: none; }
h2 { font-size: 17px; margin-bottom: 12px; }
.two-col { gap: 16px; }
.btn { min-height: 40px; padding: 8px 16px; }
.btn.small { min-height: 36px; padding: 6px 12px; }
.btn.primary { padding: 8px 20px; box-shadow: none; }
input, textarea { padding: 8px 12px; min-height: 40px; }
.label { margin: 16px 0 8px; font-size: 12px; letter-spacing: .08em; }
.field { margin: 16px 0 8px; }
.hint { font-size: 14px; margin-bottom: 12px; }
.form-head h2 { font-size: 20px; }
.block { padding: 4px 16px 16px; margin-top: 16px; background: transparent; }
.block legend { font-size: 15px; }
.step { width: 22px; height: 22px; font-size: 12px; box-shadow: none; }
.tile { padding: 8px; transition: border-color .12s, background .12s; }
.tile:hover:not(:disabled) { transform: none; }
.tile[aria-checked="true"] { box-shadow: 0 0 0 1px var(--c); }
.form-actions { margin-top: 24px; }
.alt-row { padding: 12px; background: transparent; }
.owned-bar { padding: 8px 12px; background: transparent; }
.role-cards { gap: 12px; margin-bottom: 16px; }
.role-card { padding: 12px 16px; box-shadow: none; }
.rc-num b { font-size: 32px; }
.meter i, .pip.main { box-shadow: none; }
.class-grid { gap: 12px; }
.class-card { padding: 12px; }
.comp-toolbar { gap: 12px; margin-bottom: 16px; }
.comp-toolbar select, #comp-scope select { min-height: 40px; }
.roster-toolbar { gap: 12px; margin-bottom: 16px; }
.roster th { padding: 8px 12px; }
.roster td { padding: 8px 12px; }
.cf { min-width: 36px; min-height: 36px; display: grid; place-items: center; }
.plate { box-shadow: 0 0 0 1px rgba(143,108,51,.4); }
.empty { padding: 32px 16px; }
footer { font-size: 13px; }
dialog { padding: 24px; box-shadow: 0 16px 40px rgba(0,0,0,.6); }
dialog h3 { font-size: 18px; margin-bottom: 8px; }
.tooltip { box-shadow: none; }
.you, .badge, .new { letter-spacing: .06em; }
@media (max-width: 680px) {
  .banner-inner { padding: 12px 12px 8px; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; padding: 0 8px; }
  .tabs a { padding: 10px 12px; }
  main { padding: 12px 12px 24px; }
  .panel { padding: 12px; }
  .btn, .btn.small { min-height: 40px; }
  .roster tr { padding: 8px 4px; }
}

/* Page-level disclosure */
.opt, .roster-more { border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 0 16px; margin-top: 12px; }
.opt[open], .roster-more[open] { padding-bottom: 16px; }
.opt > summary, .roster-more > summary, .comp-more > summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; gap: 8px; font: 700 15px/1 var(--head); color: var(--gold-2); letter-spacing: .04em; }
.comp-more { padding: 0 16px; }
.comp-more[open] { padding-bottom: 16px; }
:is(.opt, .comp-more, .roster-more, .shell-det, .sp-comp-details) > summary::after {
  content: "";
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
:is(.opt, .comp-more, .roster-more, .shell-det, .sp-comp-details)[open] > summary::after {
  transform: rotate(225deg);
}
.roster-more { margin: 0; padding: 0 12px; flex: 1 1 100%; }
.roster-more .class-filter { margin: 8px 0; }
.roster-toolbar input[type="search"] { flex: 1 1 220px; }
.main-block { margin-top: 16px; }
