.bi3b-screen { min-width: 0; color: var(--bi-text); }
.bi3b-screen p, .bi3b-screen h1, .bi3b-screen h2, .bi3b-screen dl { margin-top: 0; }
.bi3b-header, .bi3b-overview, .bi3b-battle-layout, .bi3b-company-column, .bi3b-situation-column { display: grid; gap: 0.75rem; min-width: 0; }
.bi3b-header { margin-bottom: 0.75rem; border-bottom: 1px solid var(--bi-border-subtle); padding-bottom: 0.75rem; }
.bi3b-header p, .bi3b-fortress > p, .bi3b-horde > p, .bi3b-company-heading p,
.bi3b-section-heading p, .bi3b-orders > div > p, .bi3b-result > p:first-child {
  margin-bottom: 0.15rem; color: var(--bi-gold-muted); font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
}
.bi3b-header h1 { margin-bottom: 0.35rem; font: 24px/1.25 Georgia, "Yu Mincho", serif; overflow-wrap: anywhere; }
.bi3b-status { display: inline-flex; min-height: 28px; align-items: center; border: 1px solid var(--bi-border); padding: 0.2rem 0.55rem; color: var(--bi-text-muted); font-size: 12px; }
.bi3b-header dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; margin-bottom: 0; }
.bi3b-header dl div, .bi3b-company-facts div, .bi3b-horde dl div, .bi3b-result dl div { min-width: 0; }
.bi3b-header dt, .bi3b-company-facts dt, .bi3b-horde dt, .bi3b-result dt { color: var(--bi-text-muted); font-size: 12px; }
.bi3b-header dd { margin: 0.1rem 0 0; font: 20px/1.2 Georgia, serif; }
.bi3b-overview { margin-bottom: 0.75rem; }
.bi3b-fortress, .bi3b-horde, .bi3b-focused-company, .bi3b-reserves, .bi3b-log, .bi3b-orders, .bi3b-result {
  min-width: 0; border: 1px solid var(--bi-border-subtle); background: rgba(16, 21, 29, 0.96); padding: 0.8rem;
}
.bi3b-fortress h2, .bi3b-horde h2, .bi3b-section-heading h2, .bi3b-orders h2, .bi3b-result h2 {
  margin-bottom: 0.55rem; font: 18px/1.3 Georgia, "Yu Mincho", serif; overflow-wrap: anywhere;
}
.bi3b-horde dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; margin-bottom: 0.65rem; }
.bi3b-horde dd, .bi3b-company-facts dd, .bi3b-result dd { margin: 0.1rem 0 0; overflow-wrap: anywhere; }
.bi3b-metric, .bi3b-company-meters section > div { display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline; }
.bi3b-metric strong { font-size: 18px; }
.bi3b-meter { height: 8px; overflow: hidden; border: 1px solid var(--bi-border); background: #090c11; }
.bi3b-meter span { display: block; height: 100%; background: var(--bi-gold-muted); }
.bi3b-meter.is-danger span { background: #a34e45; }
.bi3b-meter.is-hp span { background: #9c845a; }
.bi3b-meter.is-shield span { background: #587b91; }
.bi3b-company-heading { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: 0.65rem; align-items: center; }
.bi3b-company-heading h2 { margin-bottom: 0.15rem; font: 20px/1.3 Georgia, "Yu Mincho", serif; overflow-wrap: anywhere; }
.bi3b-company-heading span:last-child { color: var(--bi-text-muted); font-size: 12px; overflow-wrap: anywhere; }
.bi3b-company-mark { display: grid; place-items: center; width: 3rem; height: 3rem; border: 1px solid var(--bi-gold-muted); color: var(--bi-gold); font: 20px Georgia, serif; }
.bi3b-company-meters { display: grid; gap: 0.6rem; margin-top: 0.8rem; }
.bi3b-company-meters section { display: grid; gap: 0.25rem; }
.bi3b-company-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin: 0.75rem 0 0; border-top: 1px solid var(--bi-border-subtle); padding-top: 0.65rem; }
.bi3b-warnings { margin: 0.65rem 0 0; padding-left: 1.1rem; color: var(--bi-warning); font-size: 12px; }
.bi3b-clear { margin: 0.65rem 0 0; color: var(--bi-text-muted); font-size: 12px; }
.bi3b-section-heading { display: flex; justify-content: space-between; align-items: end; gap: 0.5rem; margin-bottom: 0.65rem; }
.bi3b-section-heading h2 { margin-bottom: 0; }
.bi3b-section-heading > span { color: var(--bi-text-muted); font-size: 12px; }
.bi3b-reserve-list { display: grid; gap: 0.5rem; }
.bi3b-reserve { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.55rem; width: 100%; min-height: 64px;
  align-items: center; border: 1px solid var(--bi-border-subtle); background: var(--bi-surface-raised); padding: 0.55rem; text-align: left; cursor: pointer; }
.bi3b-reserve.is-focused { border-color: var(--bi-gold); box-shadow: inset 3px 0 var(--bi-gold); }
.bi3b-reserve > span:first-child { display: grid; min-width: 0; }
.bi3b-reserve small, .bi3b-reserve > span:first-child > span { color: var(--bi-text-muted); font-size: 12px; }
.bi3b-reserve strong, .bi3b-reserve span { overflow-wrap: anywhere; }
.bi3b-reserve strong { word-break: keep-all; }
.bi3b-reserve-status { display: grid; justify-items: end; color: var(--bi-text-muted); font-size: 12px; }
.bi3b-log ol { display: grid; gap: 0.45rem; margin: 0; padding-left: 1.4rem; }
.bi3b-log li { padding-left: 0.2rem; overflow-wrap: anywhere; }
.bi3b-log-toggle, .bi3b-order-list button, .bi3b-primary-action { min-height: 44px; cursor: pointer; }
.bi3b-log-toggle { width: 100%; margin-top: 0.65rem; border: 1px solid var(--bi-border-subtle); background: #121720; }
.bi3b-orders { display: grid; gap: 0.6rem; }
.bi3b-order-list { display: grid; gap: 0.45rem; }
.bi3b-order-list button { border: 1px solid var(--bi-border-subtle); background: #10141b; color: var(--bi-text-muted); }
.bi3b-primary-action { width: 100%; border: 1px solid var(--bi-gold-muted); background: #2a2116; color: #eadbc2; font-weight: 700; }
.bi3b-primary-action:disabled { cursor: not-allowed; border-color: var(--bi-border-subtle); background: #11151c; color: var(--bi-text-muted); }
.bi3b-action-reason, .bi3b-unavailable { margin-bottom: 0; color: var(--bi-text-muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.bi3b-result { border-color: var(--bi-warning); }
.bi3b-result dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.bi3b-result .bi3b-primary-action { margin-top: 0.35rem; }

@media (min-width: 768px) {
  .bi3b-header { grid-template-columns: minmax(0, 1fr) minmax(15rem, 0.45fr); align-items: end; }
  .bi3b-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bi3b-company-meters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bi3b-reserve-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .bi3b-battle-layout { grid-template-columns: minmax(0, 1.55fr) minmax(19rem, 0.75fr); align-items: start; }
  .bi3b-situation-column { position: sticky; top: 0.75rem; }
}

@media (min-width: 1320px) {
  .bi3b-overview { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
  .bi3b-reserve-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bi3b-reserve { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .bi3b-reserve-status { grid-template-columns: repeat(2, auto); justify-content: start; gap: 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .bi3b-screen *, .bi3b-screen *::before, .bi3b-screen *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
