:root {
  --roleplay-nav-height: 72px;
  --roleplay-nav-offset: 0px;
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
}

.app-shell {
  padding-top: calc(10px + var(--safe-area-top));
  padding-right: max(12px, var(--safe-area-right));
  padding-bottom: calc(var(--roleplay-nav-height) + var(--safe-area-bottom) + 18px);
  padding-left: max(12px, var(--safe-area-left));
}

.roleplay-view[hidden],
.bottom-sheet-backdrop[hidden] {
  display: none !important;
}

.bottom-nav {
  position: fixed !important;
  left: 50%;
  bottom: var(--roleplay-nav-offset) !important;
  z-index: 60;
  width: min(100%, 460px);
  min-height: calc(var(--roleplay-nav-height) + var(--safe-area-bottom));
  transform: translateX(-50%);
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: center;
  padding-right: max(10px, var(--safe-area-right));
  padding-bottom: max(8px, var(--safe-area-bottom));
  padding-left: max(10px, var(--safe-area-left));
  box-shadow: 0 -10px 26px rgba(42, 87, 143, 0.08);
  isolation: isolate;
}

.nav-item {
  min-height: 54px;
  touch-action: manipulation;
}

.bottom-sheet-backdrop {
  position: fixed;
  top: var(--safe-area-top);
  left: 50%;
  bottom: calc(var(--roleplay-nav-offset) + var(--roleplay-nav-height) + var(--safe-area-bottom));
  z-index: 50;
  width: min(100%, 460px);
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  padding-top: 12px;
  padding-right: max(12px, var(--safe-area-right));
  padding-bottom: 12px;
  padding-left: max(12px, var(--safe-area-left));
  background: rgba(11, 33, 70, 0.20);
  backdrop-filter: blur(3px);
}

.bottom-sheet {
  width: 100%;
  max-height: min(66vh, 560px);
  overflow-y: auto;
  padding: 8px 12px 14px;
  border: 1px solid rgba(223, 233, 247, 0.96);
  border-radius: 22px 22px 16px 16px;
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 -18px 48px rgba(29, 68, 121, 0.20);
  overscroll-behavior: contain;
}

.bottom-sheet-handle {
  width: 42px;
  height: 4px;
  margin: 2px auto 10px;
  border-radius: 999px;
  background: #dbe5f2;
}

.bottom-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 10px;
  border-bottom: 1px solid #edf2f8;
}

.bottom-sheet-head h2 {
  margin: 0;
  font-size: 16px;
}

.sheet-close-button {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 0;
  border-radius: 50%;
  background: #eef5ff;
  color: #5278ad;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.commercial-quick {
  margin: 10px 2px;
  color: #174f96;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.commercial-condition-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}

.commercial-condition-item {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 11px;
  background: #f5f9ff;
}

.commercial-condition-item span {
  display: block;
  margin-bottom: 3px;
  color: #7890b5;
  font-size: 9px;
  font-weight: 700;
}

.commercial-condition-item strong {
  display: block;
  overflow-wrap: anywhere;
  color: #123e78;
  font-size: 11px;
}

.commercial-condition-note {
  margin: 10px 2px 0;
  color: #7d91ae;
  font-size: 9px;
  line-height: 1.5;
}

@media (max-width: 360px) {
  .commercial-condition-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 760px) {
  :root {
    --roleplay-nav-offset: 28px;
  }
}
