/* M38 — unified portrait alignment and genuine Inventory thumbnails, plus the chapter-12 choice card. */
/* Keep image consistently at the far right in ALL story dialogue panels. */
.ufm25-center .ufm31-contact-dialogue{display:grid;grid-template-columns:minmax(0,1fr) 138px;gap:0 20px;align-items:start}
.ufm25-center .ufm31-contact-dialogue>:not(.ufm31-portrait){grid-column:1;min-width:0}
.ufm25-center .ufm31-contact-dialogue>.ufm31-portrait{
  grid-column:2;grid-row:1/span 6;justify-self:end;align-self:start;
  position:relative;top:auto;right:auto;bottom:auto;left:auto;
  width:138px;height:auto;min-height:0;margin:0;padding:0;
}
.ufm25-center .ufm37-dialogue.ufm31-contact-dialogue{padding:19px 18px 20px;min-height:164px}
.ufm25-center .ufm37-dialogue.ufm31-contact-dialogue>.ufm31-portrait{position:relative;top:auto;right:auto;left:auto;bottom:auto}
/* Same actual items_sub_cat.img catalog images the Inventory renders for equipment. */
.ufm25-center .ufm37-types.ufm38-real-gear .ufm38-gear-card{
  display:flex;gap:9px;align-items:center;padding:10px 8px;min-width:0;min-height:74px;
}
.ufm25-center .ufm38-real-gear .ufm38-gear-card img{flex:0 0 50px;width:50px;height:50px;object-fit:contain;max-width:50px;border-radius:7px;background:#132334}
.ufm25-center .ufm38-real-gear .ufm38-gear-card>div{min-width:0}
.ufm25-center .ufm38-real-gear .ufm38-gear-card strong{font-size:10px;line-height:1.4;white-space:normal}
.ufm25-center .ufm38-real-gear .ufm38-gear-card span{display:block;font-size:10px;overflow-wrap:anywhere}
.ufm38-choice-form fieldset{border:0;padding:0;margin:0 0 12px;min-width:0}
.ufm38-choice-form legend{color:#eec085;font-size:13px;font-weight:800;padding:0 0 10px}
.ufm38-choice-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;align-items:stretch}
.ufm38-choice-form .ufm38-choice-card{min-height:94px;padding:12px;display:flex;align-items:center;flex-direction:column;justify-content:center;gap:8px;border:1px solid #476681;border-radius:9px;background:#172a3e;cursor:pointer;color:#e8eef6;font-size:12px;font-weight:800;text-align:center;box-sizing:border-box}
.ufm38-choice-form .ufm38-choice-card:has(input:checked){background:#2a2a3a;border-color:#d8a260;box-shadow:inset 0 0 0 1px #d8a26066}
.ufm38-choice-form .ufm38-choice-card:focus-within{outline:2px solid #dcb17b;outline-offset:2px}
.ufm38-choice-form .ufm38-choice-card input{margin:0;width:16px;height:16px;flex:0 0 16px;accent-color:#e3b06b}
.ufm38-choice-form .ufm38-choice-card img{max-width:48px;height:48px;object-fit:contain}
.ufm38-story .ufm37-objective h3{line-height:1.3}
.ufm38-toast{position:fixed;right:18px;bottom:188px;z-index:2147481801;max-width:calc(100vw - 28px);width:355px;box-sizing:border-box;background:#122536;border:1px solid #45876b;border-left:4px solid #8fdbac;border-radius:12px;padding:14px 16px;color:#eaf5ed;box-shadow:0 16px 40px #000a;opacity:0;transform:translateY(12px);transition:opacity .25s,transform .25s;pointer-events:none}
.ufm38-toast.ufm38-show{opacity:1;transform:translateY(0)}
.ufm38-toast small{display:block;color:#9adbb2;font-size:10px;font-weight:850;letter-spacing:1.1px;margin-bottom:6px}
.ufm38-toast strong{display:block;font-size:14px;margin-bottom:5px}
.ufm38-toast span{font-size:12px;line-height:1.5;color:#c7d8d0}
@media(max-width:740px){.ufm25-center .ufm37-types.ufm38-real-gear{grid-template-columns:repeat(2,minmax(0,1fr))}.ufm38-choice-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:680px){
 .ufm25-center .ufm31-contact-dialogue{grid-template-columns:minmax(0,1fr);row-gap:4px}
 .ufm25-center .ufm31-contact-dialogue>.ufm31-portrait{grid-column:1;grid-row:auto;justify-self:end;width:112px;max-width:45%;margin:9px 0 0 auto}
 .ufm25-center .ufm37-dialogue.ufm31-contact-dialogue{padding:15px;min-height:0}
 .ufm38-toast{right:14px;bottom:130px;width:min(355px,calc(100vw - 28px))}
}
@media(prefers-reduced-motion:reduce){.ufm38-toast{transition:none}}
