.bi3e-screen { min-width: 0; color: var(--bi-text); padding-bottom: env(safe-area-inset-bottom); }
.bi3e-screen p, .bi3e-screen h1, .bi3e-screen h2, .bi3e-screen dl { margin-top: 0; }
.bi3e-header, .bi3e-layout, .bi3e-report-column, .bi3e-side-column, .bi3e-results { display: grid; gap: .75rem; min-width: 0; }
.bi3e-header { margin-bottom: .75rem; border-bottom: 1px solid var(--bi-border-subtle); padding-bottom: .75rem; }
.bi3e-header p, .bi3e-result-card header p, .bi3e-section-heading p, .bi3e-next-cycle > div > p,
.bi3e-confirmation > p:first-child { margin-bottom: .15rem; color: var(--bi-gold-muted); font-size: 12px; font-weight: 700; letter-spacing: .12em; }
.bi3e-header h1 { margin-bottom: .35rem; font: 26px/1.2 Georgia, "Yu Mincho", serif; }
.bi3e-header > div > span { display: inline-flex; min-height: 28px; align-items: center; border: 1px solid var(--bi-border); padding: .2rem .55rem; color: var(--bi-text-muted); font-size: 12px; }
.bi3e-header dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-bottom: 0; }
.bi3e-header dt, .bi3e-next-cycle dt, .bi3e-confirmation dt { color: var(--bi-text-muted); font-size: 12px; }
.bi3e-header dd { margin: .1rem 0 0; font: 20px/1.2 Georgia, serif; overflow-wrap: anywhere; }
.bi3e-result-card, .bi3e-crises, .bi3e-history, .bi3e-next-cycle {
  min-width: 0; border: 1px solid var(--bi-border-subtle); background: rgba(16, 21, 29, .96); padding: .8rem;
}
.bi3e-result-card header { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: .55rem; align-items: center; }
.bi3e-result-card header > span { width: 8px; height: 38px; background: #61705b; }
.bi3e-result-card.is-lost header > span { background: #87534e; }
.bi3e-result-card.is-changed header > span { background: #637c8c; }
.bi3e-result-card.is-reward header > span { background: #927a4f; }
.bi3e-result-card h2, .bi3e-section-heading h2, .bi3e-next-cycle h2, .bi3e-confirmation h2 {
  margin-bottom: 0; font: 18px/1.3 Georgia, "Yu Mincho", serif; overflow-wrap: anywhere;
}
.bi3e-result-card header strong, .bi3e-section-heading > span { color: var(--bi-text-muted); font-size: 12px; }
.bi3e-result-card ul, .bi3e-crises ul { display: grid; gap: .45rem; margin: .7rem 0 0; padding-left: 1.2rem; }
.bi3e-result-card li, .bi3e-crises li { overflow-wrap: anywhere; }
.bi3e-section-toggle, .bi3e-history-toggle, .bi3e-history-item, .bi3e-primary-action,
.bi3e-confirmation button { min-height: 44px; cursor: pointer; }
.bi3e-section-toggle, .bi3e-history-toggle { width: 100%; margin-top: .65rem; border: 1px solid var(--bi-border-subtle); background: #121720; }
.bi3e-section-heading { display: flex; justify-content: space-between; gap: .5rem; align-items: end; margin-bottom: .55rem; }
.bi3e-section-heading h2 { margin-bottom: 0; }
.bi3e-empty, .bi3e-action-reason { margin-bottom: 0; color: var(--bi-text-muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.bi3e-history > p { color: var(--bi-text-muted); font-size: 13px; line-height: 1.6; }
.bi3e-history-list { display: grid; gap: .45rem; margin-top: .65rem; }
.bi3e-history-item { display: grid; width: 100%; min-width: 0; border: 1px solid var(--bi-border-subtle); background: var(--bi-surface-raised); padding: .55rem; text-align: left; }
.bi3e-history-item.is-selected { border-color: var(--bi-gold); box-shadow: inset 3px 0 var(--bi-gold); }
.bi3e-history-item span, .bi3e-history-item small, .bi3e-history-item em { color: var(--bi-text-muted); font-size: 12px; overflow-wrap: anywhere; }
.bi3e-history-item strong { margin: .15rem 0; overflow-wrap: anywhere; }
.bi3e-history-item em { font-style: normal; }
.bi3e-next-cycle { display: grid; gap: .65rem; }
.bi3e-next-cycle dl, .bi3e-confirmation dl { display: grid; gap: .5rem; margin-bottom: 0; }
.bi3e-next-cycle dl div, .bi3e-confirmation dl div { min-width: 0; border-top: 1px solid var(--bi-border-subtle); padding-top: .45rem; }
.bi3e-next-cycle dd, .bi3e-confirmation dd { margin: .1rem 0 0; overflow-wrap: anywhere; }
.bi3e-primary-action { width: 100%; border: 1px solid var(--bi-gold-muted); background: #2a2116; color: #eadbc2; font-weight: 700; }
.bi3e-primary-action:disabled { cursor: not-allowed; border-color: var(--bi-border-subtle); background: #11151c; color: var(--bi-text-muted); }
.bi3e-confirmation-backdrop { position: fixed; z-index: 30; inset: 0; display: grid; align-items: end; background: rgba(4, 6, 9, .74); }
.bi3e-confirmation { max-height: min(82vh, 44rem); overflow-y: auto; border: 1px solid var(--bi-gold-muted); border-bottom: 0; background: #111720; padding: 1rem max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); }
.bi3e-confirmation > p { line-height: 1.65; overflow-wrap: anywhere; }
.bi3e-confirmation-note { color: var(--bi-text-muted); font-size: 12px; }
.bi3e-confirmation > div:last-child { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.bi3e-confirmation button:not(.bi3e-primary-action) { border: 1px solid var(--bi-border); background: #171d26; }

@media (min-width: 768px) {
  .bi3e-header { grid-template-columns: minmax(0, 1fr) minmax(15rem, .45fr); align-items: end; }
  .bi3e-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bi3e-confirmation-backdrop { place-items: center; }
  .bi3e-confirmation { width: min(34rem, calc(100vw - 2rem)); border-bottom: 1px solid var(--bi-gold-muted); }
}

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

@media (min-width: 1320px) {
  .bi3e-result-card { min-height: 12rem; }
  .bi3e-history-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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