#lab-warfront-medallion {
  position: fixed; top: 50%; right: 18px; transform: translateY(-50%);
  z-index: 1340; display: none; align-items: center; justify-content: center;
  width: 62px; height: 62px; cursor: pointer;
  background: linear-gradient(158deg, var(--lab-glass-a, rgba(40,24,47,0.9)), var(--lab-glass-b, rgba(15,8,19,0.94)));
  border: 1px solid var(--lab-edge, rgba(244,207,139,0.42)); border-radius: 50%;
  color: var(--lab-gold, #f4cf8b); box-shadow: var(--lab-shadow, 0 14px 40px rgba(0,0,0,0.55)), 0 0 0 1px rgba(244,207,139,0.14) inset;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
#lab-warfront-medallion:hover {
  background: linear-gradient(158deg, var(--lab-gold, #f4cf8b), #d8aa6e); color: #1a0d1f;
  transform: translateY(-50%) scale(1.06); border-color: var(--lab-gold-bright, #ffe9bd);
}
#lab-warfront-medallion i, #lab-warfront-medallion svg { width: 30px; height: 30px; }
#lab-warfront-medallion.has-alert { border-color: #ff9b6b; box-shadow: var(--lab-shadow, 0 14px 40px rgba(0,0,0,0.55)), 0 0 0 2px rgba(255,140,90,0.5) inset; }
#lab-warfront-medallion .lwm-badge {
  position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px;
  background: linear-gradient(180deg, #d64d4d, #b02f2f); color: #fff; border-radius: 9999px;
  font-family: 'Raleway', sans-serif; font-size: 0.78rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--lab-glass-b, #0f0813); box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}


.wf-lbl {
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.13em;
  color: var(--lab-gold-dim, #9c8a63); font-weight: 700; margin: 0.9rem 0 0.4rem;
}

.wf-call {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 0.7rem 0.9rem; margin-bottom: 0.6rem; border-radius: 12px;
  border: 1px solid var(--lab-edge, rgba(244,207,139,0.42)); background: rgba(244, 207, 139, 0.06);
}
.wf-call-txt { display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; color: #f4e3a8; flex: 1 1 260px; line-height: 1.4; }
.wf-call-ico { width: 17px; height: 17px; color: var(--lab-gold, #f4cf8b); flex: 0 0 auto; }
.wf-call-acts { display: flex; gap: 8px; }

.wf-war {
  border: 1px solid var(--lab-edge-soft, rgba(244,207,139,0.14)); border-radius: 14px;
  padding: 1rem 1.1rem; margin-bottom: 1rem; background: rgba(0, 0, 0, 0.2);
}
.wf-war-head { display: flex; align-items: center; gap: 10px; }
.wf-war-title { font-family: 'Cinzel', Georgia, serif; font-weight: 700; font-size: 1.02rem; color: #f4e3a8; }
.wf-war-sub { font-size: 0.8rem; color: var(--lab-gold-dim, #9c8a63); margin: 0.25rem 0 0.7rem; line-height: 1.45; }

.wf-bars { display: flex; flex-direction: column; gap: 0.6rem; margin: 0.4rem 0 0.2rem; }
.wf-bar-row { display: flex; flex-direction: column; gap: 0.25rem; }
.wf-bar-top { display: flex; justify-content: space-between; font-size: 0.76rem; font-weight: 700; }
.wf-bar-pct { color: var(--lab-gold-dim, #9c8a63); font-weight: 600; }
.wf-bar { height: 12px; border-radius: 7px; overflow: hidden; background: rgba(0, 0, 0, 0.5); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4) inset; }
.wf-bar-fill { height: 100%; transition: width 0.4s ease; box-shadow: 0 0 8px rgba(244, 207, 139, 0.25); }
.wf-bar-split { position: relative; }
.wf-bar-split::after { content: ''; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: rgba(255, 255, 255, 0.6); }

.wf-crest { display: inline-flex; width: 36px; height: 42px; flex: 0 0 auto; align-items: center; justify-content: center; filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5)); }
.wf-crest svg { width: 100%; height: 100%; display: block; }
.wf-crest-dot { display: inline-flex; width: 36px; height: 36px; border-radius: 9px; flex: 0 0 auto; align-items: center; justify-content: center; font-weight: 800; font-size: 1rem; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 2px 6px rgba(0, 0, 0, 0.4); }

.wf-opp { margin: 0.5rem 0 0.3rem; }
.wf-opp-heads { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 0.45rem; }
.wf-opp-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.84rem; min-width: 0; }
.wf-opp-head .wf-crest { width: 46px; height: 54px; }
.wf-opp-head .wf-crest-dot { width: 44px; height: 44px; font-size: 1.15rem; }
.wf-opp-nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.wf-opp-pct { color: var(--lab-gold-dim, #9c8a63); font-weight: 600; font-size: 0.8rem; }
.wf-opp-track { position: relative; height: 16px; border-radius: 8px; background: rgba(0, 0, 0, 0.5); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4) inset; overflow: hidden; }
.wf-opp-fill { position: absolute; top: 0; bottom: 0; transition: width 0.45s ease; box-shadow: 0 0 8px rgba(244, 207, 139, 0.2); }
.wf-opp-me { left: 0; border-radius: 8px 0 0 8px; }
.wf-opp-foe { right: 0; border-radius: 0 8px 8px 0; }
.wf-opp-mid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: rgba(255, 255, 255, 0.7); transform: translateX(-50%); z-index: 2; box-shadow: 0 0 4px rgba(255, 255, 255, 0.4); }

.wf-goals { list-style: none; margin: 0; padding: 0; }
.wf-goal { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; padding: 0.2rem 0; color: #e7d9ac; }
.wf-goal-ic { width: 14px; height: 14px; flex: 0 0 auto; color: var(--lab-gold-deep, #c79a4f); }
.wf-goal.mine .wf-goal-ic { color: var(--lab-good, #79d39b); }
.wf-goal.done { opacity: 0.55; text-decoration: line-through; }

.wf-contract { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.82rem; padding: 0.28rem 0; }
.wf-ct-who { font-weight: 700; color: #f4e3a8; }
.wf-ct-terms { font-size: 0.74rem; color: var(--lab-gold-dim, #9c8a63); font-style: italic; }
.wf-ct-x { margin-left: auto; }

.wf-battles { display: flex; flex-direction: column; gap: 4px; }
.wf-battle {
  display: flex; align-items: center; gap: 0.6rem; width: 100%; text-align: left;
  padding: 0.4rem 0.6rem; border-radius: 8px; cursor: pointer;
  background: rgba(20, 14, 8, 0.4); border: 1px solid var(--lab-edge-soft, rgba(244,207,139,0.14));
  color: #cdbb88; font-size: 0.8rem; transition: background 0.12s ease, border-color 0.12s ease;
}
.wf-battle:hover { background: rgba(244, 207, 139, 0.1); border-color: var(--lab-edge, rgba(244,207,139,0.42)); }
.wf-battle.wf-battle-flat { cursor: default; }
.wf-battle.wf-battle-flat:hover { background: rgba(20, 14, 8, 0.4); border-color: var(--lab-edge-soft, rgba(244,207,139,0.14)); }
.wf-battle-turn { flex: 0 0 auto; font-weight: 700; color: var(--lab-gold-dim, #9c8a63); }
.wf-battle-sum { flex: 1 1 auto; }
.wf-battle.win .wf-battle-sum { color: #9fdca0; }
.wf-battle.loss .wf-battle-sum { color: #e89a9a; }
.wf-battle-ch { width: 14px; height: 14px; flex: 0 0 auto; color: var(--lab-gold-deep, #c79a4f); }

.wf-war-foot { display: flex; gap: 8px; margin-top: 0.9rem; flex-wrap: wrap; }
.wf-note { font-size: 0.76rem; color: var(--lab-gold-dim, #9c8a63); font-style: italic; align-self: center; }

.wf-reinf-head { display: flex; align-items: center; gap: 12px; margin-bottom: 0.7rem; }
.wf-reinf-title { font-family: 'Cinzel', Georgia, serif; font-weight: 700; font-size: 1.02rem; color: #f4e3a8; }

.wf-list { display: flex; flex-direction: column; border: 1px solid var(--lab-edge-soft, rgba(244,207,139,0.14)); border-radius: 12px; background: rgba(0, 0, 0, 0.18); overflow: hidden; }
/* The bar comes from the canonical .lab-panel rule in lab_hub.css; this only sets the scroll box. */
.wf-scroll { max-height: 44vh; overflow-y: auto; }
.wf-row, .wf-pick { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 0.55rem 0.85rem; border-bottom: 1px solid var(--lab-edge-soft, rgba(244,207,139,0.1)); }
.wf-row:last-child, .wf-pick:last-child { border-bottom: none; }
.wf-pick { cursor: pointer; transition: background 0.12s ease; }
.wf-pick:hover { background: rgba(244, 207, 139, 0.08); }
.wf-pick.selected { background: rgba(244, 207, 139, 0.15); box-shadow: 0 0 0 1px var(--lab-edge, rgba(244,207,139,0.42)) inset; }
.wf-row-id { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
.wf-who { font-weight: 700; color: #f4e3a8; font-size: 0.84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-sub { font-size: 0.68rem; color: var(--lab-gold-dim, #9c8a63); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-row-num { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; flex: 0 0 auto; text-align: right; }
.wf-men { font-size: 0.74rem; color: #cdbb88; white-space: nowrap; }
.wf-fair { font-size: 0.63rem; color: var(--lab-gold-dim, #9c8a63); white-space: nowrap; }
.wf-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4); }

.wf-terms { margin-top: 0.9rem; border: 1px solid var(--lab-edge, rgba(244,207,139,0.42)); border-radius: 12px; padding: 0.9rem 1rem; background: rgba(244, 207, 139, 0.05); }
.wf-terms-head { font-family: 'Cinzel', Georgia, serif; font-weight: 700; color: #f4e3a8; font-size: 0.95rem; }
.wf-terms-sub { font-size: 0.76rem; color: var(--lab-gold-dim, #9c8a63); margin: 0.25rem 0 0.8rem; line-height: 1.45; }
.wf-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.6rem; }
.wf-field { display: flex; flex-direction: column; gap: 4px; }
.wf-field-lbl { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--lab-gold-dim, #9c8a63); font-weight: 700; }
.wf-res-row { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.6rem; }
.wf-res-lbl { flex: 0 0 130px; font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--lab-gold-dim, #9c8a63); font-weight: 700; }
.wf-res-row .lab-select { flex: 1; }
.wf-res-row .lab-num { flex: 0 0 92px; }
.wf-send { margin-top: 0.9rem; }
